@gradientedge/cdk-utils 8.11.0 → 8.13.0

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.
@@ -52,8 +52,9 @@ export declare class ApiManager {
52
52
  * @param {string[]?} allowedOrigins
53
53
  * @param {string[]?} allowedMethods
54
54
  * @param {string[]?} allowedHeaders
55
+ * @param {{}?} requestParameters
55
56
  */
56
- createApiResource(id: string, scope: common.CommonConstruct, parent: apig.IResource, path: string, integration: apig.Integration, addProxy: boolean, authorizer?: apig.IAuthorizer, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[]): apig.Resource;
57
+ createApiResource(id: string, scope: common.CommonConstruct, parent: apig.IResource, path: string, integration: apig.Integration, addProxy: boolean, authorizer?: apig.IAuthorizer, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[], methodRequestParameters?: {}): apig.Resource;
57
58
  /**
58
59
  * @summary Method to create an api deployment
59
60
  * @param {string} id
@@ -76,6 +76,8 @@ class ApiManager {
76
76
  variables: props.deployOptions?.variables,
77
77
  methodOptions: props.deployOptions?.methodOptions,
78
78
  loggingLevel: props.deployOptions?.loggingLevel,
79
+ dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
80
+ cachingEnabled: props.deployOptions?.cachingEnabled,
79
81
  },
80
82
  retainDeployments: props.retainDeployments,
81
83
  parameters: props.parameters,
@@ -126,8 +128,9 @@ class ApiManager {
126
128
  * @param {string[]?} allowedOrigins
127
129
  * @param {string[]?} allowedMethods
128
130
  * @param {string[]?} allowedHeaders
131
+ * @param {{}?} requestParameters
129
132
  */
130
- createApiResource(id, scope, parent, path, integration, addProxy, authorizer, allowedOrigins, allowedMethods, allowedHeaders) {
133
+ createApiResource(id, scope, parent, path, integration, addProxy, authorizer, allowedOrigins, allowedMethods, allowedHeaders, methodRequestParameters) {
131
134
  const methods = allowedMethods ?? apig.Cors.ALL_METHODS;
132
135
  const resource = parent.addResource(path, {
133
136
  defaultCorsPreflightOptions: {
@@ -137,7 +140,7 @@ class ApiManager {
137
140
  allowCredentials: true,
138
141
  },
139
142
  });
140
- methods.forEach(method => resource.addMethod(method, integration, { authorizer }));
143
+ methods.forEach(method => resource.addMethod(method, integration, { authorizer, requestParameters: methodRequestParameters }));
141
144
  utils.createCfnOutput(`${id}-${path}ResourceId`, scope, resource.resourceId);
142
145
  if (addProxy) {
143
146
  const resourceProxy = resource.addResource(`{${path}+}`, {
@@ -148,7 +151,7 @@ class ApiManager {
148
151
  allowCredentials: true,
149
152
  },
150
153
  });
151
- methods.forEach(method => resourceProxy.addMethod(method, integration, { authorizer }));
154
+ methods.forEach(method => resourceProxy.addMethod(method, integration, { authorizer, requestParameters: methodRequestParameters }));
152
155
  utils.createCfnOutput(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId);
153
156
  }
154
157
  return resource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.11.0",
3
+ "version": "8.13.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -58,6 +58,8 @@ export class ApiManager {
58
58
  variables: props.deployOptions?.variables,
59
59
  methodOptions: props.deployOptions?.methodOptions,
60
60
  loggingLevel: props.deployOptions?.loggingLevel,
61
+ dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
62
+ cachingEnabled: props.deployOptions?.cachingEnabled,
61
63
  },
62
64
  retainDeployments: props.retainDeployments,
63
65
  parameters: props.parameters,
@@ -114,6 +116,7 @@ export class ApiManager {
114
116
  * @param {string[]?} allowedOrigins
115
117
  * @param {string[]?} allowedMethods
116
118
  * @param {string[]?} allowedHeaders
119
+ * @param {{}?} requestParameters
117
120
  */
118
121
  public createApiResource(
119
122
  id: string,
@@ -125,7 +128,8 @@ export class ApiManager {
125
128
  authorizer?: apig.IAuthorizer,
126
129
  allowedOrigins?: string[],
127
130
  allowedMethods?: string[],
128
- allowedHeaders?: string[]
131
+ allowedHeaders?: string[],
132
+ methodRequestParameters?: {}
129
133
  ) {
130
134
  const methods = allowedMethods ?? apig.Cors.ALL_METHODS
131
135
  const resource = parent.addResource(path, {
@@ -136,7 +140,9 @@ export class ApiManager {
136
140
  allowCredentials: true,
137
141
  },
138
142
  })
139
- methods.forEach(method => resource.addMethod(method, integration, { authorizer }))
143
+ methods.forEach(method =>
144
+ resource.addMethod(method, integration, { authorizer, requestParameters: methodRequestParameters })
145
+ )
140
146
  utils.createCfnOutput(`${id}-${path}ResourceId`, scope, resource.resourceId)
141
147
 
142
148
  if (addProxy) {
@@ -148,7 +154,9 @@ export class ApiManager {
148
154
  allowCredentials: true,
149
155
  },
150
156
  })
151
- methods.forEach(method => resourceProxy.addMethod(method, integration, { authorizer }))
157
+ methods.forEach(method =>
158
+ resourceProxy.addMethod(method, integration, { authorizer, requestParameters: methodRequestParameters })
159
+ )
152
160
  utils.createCfnOutput(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId)
153
161
  }
154
162