@mettlecast/domain-cdk-packer 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -169,7 +169,7 @@ export class DomainStack extends cdk.Stack {
169
169
  apiRoute = { ...apiRouteBase, authorizer: jwtAuthorizer };
170
170
  }
171
171
  else if (api.authType === 'api-key') {
172
- // TODO(#1785): wire HttpApiKeyAuthorizer
172
+ cdk.Annotations.of(this).addWarning(`[DomainStack] API "${api.id}" uses authType "api-key" which is not supported on HTTP API v2 — route is UNAUTHENTICATED. Switch to "jwt" or implement a Lambda authorizer.`);
173
173
  apiRoute = apiRouteBase;
174
174
  }
175
175
  else {
@@ -127,16 +127,24 @@ export class FlowsStack extends cdk.Stack {
127
127
  };
128
128
  }
129
129
  case 'flow-control':
130
- return this.translateFlowControl(step);
130
+ return this.translateFlowControl(step, options, flowId);
131
131
  }
132
132
  }
133
- translateFlowControl(step) {
133
+ translateFlowControl(step, options, flowId) {
134
134
  switch (step.control) {
135
135
  case 'choice':
136
136
  return { Type: 'Choice', Choices: step.choices.map(c => ({ Variable: '$.path', StringEquals: c.when, Next: c.next })), Default: step.default };
137
- case 'parallel':
138
- // TODO(#1787): full nested branch translation. For Wave 2, single linear branch only.
139
- return { Type: 'Parallel', Branches: step.branches.map(() => ({ StartAt: 'Pass', States: { Pass: { Type: 'Pass', End: true } } })), ...(step.next ? { Next: step.next } : { End: true }) };
137
+ case 'parallel': {
138
+ const branches = step.branches.map(branchSteps => {
139
+ if (branchSteps.length === 0)
140
+ return { StartAt: 'Pass', States: { Pass: { Type: 'Pass', End: true } } };
141
+ const branchStates = {};
142
+ for (const s of branchSteps)
143
+ branchStates[s.name] = this.translateStep(s, options, flowId);
144
+ return { StartAt: branchSteps[0].name, States: branchStates };
145
+ });
146
+ return { Type: 'Parallel', Branches: branches, ...(step.next ? { Next: step.next } : { End: true }) };
147
+ }
140
148
  case 'wait':
141
149
  return { Type: 'Wait', Seconds: step.seconds, ...(step.next ? { Next: step.next } : { End: true }) };
142
150
  case 'succeed':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mettlecast/domain-cdk-packer",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",