@go-to-k/cdkd 0.102.0 → 0.102.1

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.
package/dist/cli.js CHANGED
@@ -12346,9 +12346,17 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12346
12346
  * when CDK's `LambdaIntegration({ responseTransferMode: STREAM })` was
12347
12347
  * used together with the streaming `response-streaming-invocations` URI.
12348
12348
  *
12349
- * `IntegrationResponses` (the CFn array shape under `Integration`) is
12350
- * applied via per-entry `PutIntegrationResponseCommand` calls after the
12351
- * integration itself is put in place.
12349
+ * `MethodResponses` and `IntegrationResponses` are applied as separate
12350
+ * per-entry calls (`PutMethodResponseCommand` /
12351
+ * `PutIntegrationResponseCommand`). Order matters: every
12352
+ * `MethodResponse` is put BEFORE any `IntegrationResponse`, because AWS
12353
+ * validates that the matching method response already exists when
12354
+ * accepting an integration response (the integration response's
12355
+ * `ResponseParameters` / `ResponseTemplates` map onto headers declared
12356
+ * by the method response). The inverse order surfaces as
12357
+ * `Invalid mapping expression specified: ... [No method response exists
12358
+ * for method.]` — the canonical trigger is a CORS preflight OPTIONS
12359
+ * method emitted by `RestApi({ defaultCorsPreflightOptions: ... })`.
12352
12360
  */
12353
12361
  async createMethod(logicalId, resourceType, properties) {
12354
12362
  this.logger.debug(`Creating API Gateway Method ${logicalId}`);
@@ -12379,27 +12387,39 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12379
12387
  authorizationScopes
12380
12388
  }));
12381
12389
  const integration = properties["Integration"];
12382
- if (integration) {
12383
- await this.apiGatewayClient.send(new PutIntegrationCommand({
12390
+ if (integration) await this.apiGatewayClient.send(new PutIntegrationCommand({
12391
+ restApiId,
12392
+ resourceId,
12393
+ httpMethod,
12394
+ type: integration["Type"],
12395
+ integrationHttpMethod: integration["IntegrationHttpMethod"],
12396
+ uri: integration["Uri"],
12397
+ connectionType: integration["ConnectionType"],
12398
+ connectionId: integration["ConnectionId"],
12399
+ credentials: integration["Credentials"],
12400
+ requestParameters: integration["RequestParameters"],
12401
+ requestTemplates: integration["RequestTemplates"],
12402
+ passthroughBehavior: integration["PassthroughBehavior"],
12403
+ contentHandling: integration["ContentHandling"],
12404
+ timeoutInMillis: integration["TimeoutInMillis"],
12405
+ cacheNamespace: integration["CacheNamespace"],
12406
+ cacheKeyParameters: integration["CacheKeyParameters"],
12407
+ tlsConfig: integration["TlsConfig"] ? { insecureSkipVerification: integration["TlsConfig"]["InsecureSkipVerification"] } : void 0,
12408
+ responseTransferMode: integration["ResponseTransferMode"]
12409
+ }));
12410
+ const methodResponses = properties["MethodResponses"];
12411
+ if (methodResponses) for (const resp of methodResponses) {
12412
+ const statusCode = String(resp["StatusCode"]);
12413
+ await this.apiGatewayClient.send(new PutMethodResponseCommand({
12384
12414
  restApiId,
12385
12415
  resourceId,
12386
12416
  httpMethod,
12387
- type: integration["Type"],
12388
- integrationHttpMethod: integration["IntegrationHttpMethod"],
12389
- uri: integration["Uri"],
12390
- connectionType: integration["ConnectionType"],
12391
- connectionId: integration["ConnectionId"],
12392
- credentials: integration["Credentials"],
12393
- requestParameters: integration["RequestParameters"],
12394
- requestTemplates: integration["RequestTemplates"],
12395
- passthroughBehavior: integration["PassthroughBehavior"],
12396
- contentHandling: integration["ContentHandling"],
12397
- timeoutInMillis: integration["TimeoutInMillis"],
12398
- cacheNamespace: integration["CacheNamespace"],
12399
- cacheKeyParameters: integration["CacheKeyParameters"],
12400
- tlsConfig: integration["TlsConfig"] ? { insecureSkipVerification: integration["TlsConfig"]["InsecureSkipVerification"] } : void 0,
12401
- responseTransferMode: integration["ResponseTransferMode"]
12417
+ statusCode,
12418
+ responseModels: resp["ResponseModels"],
12419
+ responseParameters: resp["ResponseParameters"]
12402
12420
  }));
12421
+ }
12422
+ if (integration) {
12403
12423
  const integrationResponses = integration["IntegrationResponses"];
12404
12424
  if (integrationResponses) for (const ir of integrationResponses) {
12405
12425
  const statusCode = String(ir["StatusCode"]);
@@ -12415,18 +12435,6 @@ var ApiGatewayProvider = class ApiGatewayProvider {
12415
12435
  }));
12416
12436
  }
12417
12437
  }
12418
- const methodResponses = properties["MethodResponses"];
12419
- if (methodResponses) for (const resp of methodResponses) {
12420
- const statusCode = String(resp["StatusCode"]);
12421
- await this.apiGatewayClient.send(new PutMethodResponseCommand({
12422
- restApiId,
12423
- resourceId,
12424
- httpMethod,
12425
- statusCode,
12426
- responseModels: resp["ResponseModels"],
12427
- responseParameters: resp["ResponseParameters"]
12428
- }));
12429
- }
12430
12438
  const physicalId = `${restApiId}|${resourceId}|${httpMethod}`;
12431
12439
  this.logger.debug(`Successfully created API Gateway Method ${logicalId}: ${physicalId}`);
12432
12440
  return {
@@ -42701,7 +42709,7 @@ function reorderArgs(argv) {
42701
42709
  */
42702
42710
  async function main() {
42703
42711
  const program = new Command();
42704
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.102.0");
42712
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.102.1");
42705
42713
  program.addCommand(createBootstrapCommand());
42706
42714
  program.addCommand(createSynthCommand());
42707
42715
  program.addCommand(createListCommand());