@pattform/api-kit 2.6.7 → 2.6.9

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.
@@ -17,5 +17,6 @@ export interface ApiComponentArgs {
17
17
  containerUrl: pulumi.Input<string>;
18
18
  appDomain: pulumi.Input<string>;
19
19
  localAppDomain: pulumi.Input<string>;
20
+ additionalAllowedOrigins?: pulumi.Input<string>[];
20
21
  apiDomain: pulumi.Input<string>;
21
22
  }
@@ -10,7 +10,7 @@ const pattformHelper_1 = require("./pattformHelper");
10
10
  */
11
11
  class ApiComponent extends pulumi.ComponentResource {
12
12
  constructor(name, args, opts) {
13
- var _a;
13
+ var _a, _b;
14
14
  super("custom:pattform:ApiComponent", name, args, opts);
15
15
  const awsConfig = new pulumi.Config("aws");
16
16
  const awsRegion = awsConfig.require("region");
@@ -29,6 +29,11 @@ class ApiComponent extends pulumi.ComponentResource {
29
29
  sessionName: pulumi.interpolate `pattform-api-${args.imageName}-${args.environment}`.apply(s => s.substring(0, 64)),
30
30
  },
31
31
  } : {})));
32
+ const allowOrigins = [
33
+ args.appDomain,
34
+ args.localAppDomain,
35
+ ...((_b = args.additionalAllowedOrigins) !== null && _b !== void 0 ? _b : []),
36
+ ];
32
37
  // Create an HTTP API for the load balancer to route to
33
38
  this.httpApi = new aws.apigatewayv2.Api("api-component-" + args.imageName + "-api-" + args.environment, {
34
39
  name: args.imageName,
@@ -39,7 +44,7 @@ class ApiComponent extends pulumi.ComponentResource {
39
44
  corsConfiguration: {
40
45
  allowMethods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
41
46
  allowHeaders: ["*"],
42
- allowOrigins: [args.appDomain, args.localAppDomain],
47
+ allowOrigins: allowOrigins,
43
48
  allowCredentials: true,
44
49
  exposeHeaders: ["*"],
45
50
  },
@@ -14,6 +14,7 @@ export interface AppComponentArgs {
14
14
  repoUrl: string;
15
15
  subDomains?: string;
16
16
  buildSpec?: string;
17
+ nodeVersion?: string;
17
18
  roleArn?: pulumi.Input<string>;
18
19
  manageDns?: boolean;
19
20
  customRules?: aws.types.input.amplify.AppCustomRule[];
@@ -7,7 +7,7 @@ const cloudflare = require("@pulumi/cloudflare");
7
7
  const pattformHelper_1 = require("./pattformHelper");
8
8
  class AppComponent extends pulumi.ComponentResource {
9
9
  constructor(name, args, opts) {
10
- var _a, _b, _c, _d;
10
+ var _a, _b, _c, _d, _e, _f;
11
11
  super("custom:pattform:AppComponent", name, args, opts);
12
12
  const awsConfig = new pulumi.Config("aws");
13
13
  const awsRegion = awsConfig.require("region");
@@ -104,6 +104,9 @@ class AppComponent extends pulumi.ComponentResource {
104
104
  phases:
105
105
  preBuild:
106
106
  commands:
107
+ - nvm install ${(_d = args.nodeVersion) !== null && _d !== void 0 ? _d : "22"}
108
+ - nvm use ${(_e = args.nodeVersion) !== null && _e !== void 0 ? _e : "22"}
109
+ - node -v
107
110
  - npm install
108
111
  build:
109
112
  commands:
@@ -154,7 +157,7 @@ class AppComponent extends pulumi.ComponentResource {
154
157
  // stack already manages the apex (e.g. the apex/www site while this
155
158
  // is a subdomain app), set manageValidationRecord: false to reuse it
156
159
  // instead of colliding on an identical record.
157
- if ((_d = args.manageValidationRecord) !== null && _d !== void 0 ? _d : true) {
160
+ if ((_f = args.manageValidationRecord) !== null && _f !== void 0 ? _f : true) {
158
161
  this.validationRecord = new cloudflare.Record(`${appName}-cloudflareValidateRecord-${env}`, {
159
162
  zoneId: cloudflareZone.id,
160
163
  name: this.domainAssociation.certificateVerificationDnsRecord.apply(record => record.split(' ')[0]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pattform/api-kit",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "Pulumi infra library for building and deploying an API",
5
5
  "author": "Pattform <contact@pattform.io>",
6
6
  "license": "SEE LICENSE IN LICENSE",