@ttoss/appsync-api 0.6.0 → 0.7.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.
@@ -539,7 +539,7 @@ var getPackageLambdaLayerStackName = (packageName) => {
539
539
  // package.json
540
540
  var package_default = {
541
541
  name: "@ttoss/appsync-api",
542
- version: "0.6.0",
542
+ version: "0.7.0",
543
543
  description: "A library for building GraphQL APIs for AWS AppSync.",
544
544
  license: "UNLICENSED",
545
545
  author: "ttoss",
@@ -719,10 +719,28 @@ var createApiTemplate = ({
719
719
  }
720
720
  },
721
721
  Outputs: {
722
- [AppSyncGraphQLApiLogicalId]: {
722
+ AppSyncApiGraphQLUrl: {
723
+ Export: {
724
+ Name: {
725
+ "Fn::Join": [
726
+ ":",
727
+ [{ Ref: "AWS::StackName" }, "AppSyncApiGraphQLUrl"]
728
+ ]
729
+ }
730
+ },
723
731
  Value: {
724
732
  "Fn::GetAtt": [AppSyncGraphQLApiLogicalId, "GraphQLUrl"]
725
733
  }
734
+ },
735
+ AppSyncApiArn: {
736
+ Export: {
737
+ Name: {
738
+ "Fn::Join": [":", [{ Ref: "AWS::StackName" }, "AppSyncApiArn"]]
739
+ }
740
+ },
741
+ Value: {
742
+ "Fn::GetAtt": [AppSyncGraphQLApiLogicalId, "Arn"]
743
+ }
726
744
  }
727
745
  }
728
746
  };
@@ -764,6 +782,11 @@ var createApiTemplate = ({
764
782
  }
765
783
  };
766
784
  }
785
+ if (lambdaFunction.environment?.variables) {
786
+ template.Resources[AppSyncLambdaFunctionLogicalId].Properties.Environment = {
787
+ Variables: lambdaFunction.environment.variables
788
+ };
789
+ }
767
790
  return template;
768
791
  };
769
792
 
package/dist/esm/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import {
3
3
  AppSyncGraphQLSchemaLogicalId
4
- } from "./chunk-MENSBKNQ.js";
4
+ } from "./chunk-PZ5B6I7R.js";
5
5
  import "./chunk-NQOARNEJ.js";
6
6
 
7
7
  // src/cli.ts
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import {
3
3
  createApiTemplate
4
- } from "./chunk-MENSBKNQ.js";
4
+ } from "./chunk-PZ5B6I7R.js";
5
5
  import "./chunk-NQOARNEJ.js";
6
6
 
7
7
  // src/index.ts
package/dist/index.d.ts CHANGED
@@ -13,6 +13,9 @@ declare const createApiTemplate: ({ apiKey, schemaComposer, dataSource, lambdaFu
13
13
  roleArn: Role;
14
14
  };
15
15
  lambdaFunction: {
16
+ environment?: {
17
+ variables: Record<string, string>;
18
+ };
16
19
  roleArn: Role;
17
20
  };
18
21
  }) => CloudFormationTemplate;
package/dist/index.js CHANGED
@@ -572,7 +572,7 @@ var getPackageLambdaLayerStackName = (packageName) => {
572
572
  // package.json
573
573
  var package_default = {
574
574
  name: "@ttoss/appsync-api",
575
- version: "0.6.0",
575
+ version: "0.7.0",
576
576
  description: "A library for building GraphQL APIs for AWS AppSync.",
577
577
  license: "UNLICENSED",
578
578
  author: "ttoss",
@@ -752,10 +752,28 @@ var createApiTemplate = ({
752
752
  }
753
753
  },
754
754
  Outputs: {
755
- [AppSyncGraphQLApiLogicalId]: {
755
+ AppSyncApiGraphQLUrl: {
756
+ Export: {
757
+ Name: {
758
+ "Fn::Join": [
759
+ ":",
760
+ [{ Ref: "AWS::StackName" }, "AppSyncApiGraphQLUrl"]
761
+ ]
762
+ }
763
+ },
756
764
  Value: {
757
765
  "Fn::GetAtt": [AppSyncGraphQLApiLogicalId, "GraphQLUrl"]
758
766
  }
767
+ },
768
+ AppSyncApiArn: {
769
+ Export: {
770
+ Name: {
771
+ "Fn::Join": [":", [{ Ref: "AWS::StackName" }, "AppSyncApiArn"]]
772
+ }
773
+ },
774
+ Value: {
775
+ "Fn::GetAtt": [AppSyncGraphQLApiLogicalId, "Arn"]
776
+ }
759
777
  }
760
778
  }
761
779
  };
@@ -797,6 +815,11 @@ var createApiTemplate = ({
797
815
  }
798
816
  };
799
817
  }
818
+ if (lambdaFunction.environment?.variables) {
819
+ template.Resources[AppSyncLambdaFunctionLogicalId].Properties.Environment = {
820
+ Variables: lambdaFunction.environment.variables
821
+ };
822
+ }
800
823
  return template;
801
824
  };
802
825
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/appsync-api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "A library for building GraphQL APIs for AWS AppSync.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -68,5 +68,5 @@
68
68
  ]
69
69
  }
70
70
  },
71
- "gitHead": "6c5898425e2847fed46511ae1e573ff8dc3eb1d4"
71
+ "gitHead": "17a62817bc08beb436ba6f2a1a1a5262a913d67f"
72
72
  }
@@ -32,6 +32,9 @@ export const createApiTemplate = ({
32
32
  roleArn: Role;
33
33
  };
34
34
  lambdaFunction: {
35
+ environment?: {
36
+ variables: Record<string, string>;
37
+ };
35
38
  roleArn: Role;
36
39
  };
37
40
  }): CloudFormationTemplate => {
@@ -152,11 +155,29 @@ export const createApiTemplate = ({
152
155
  },
153
156
  },
154
157
  Outputs: {
155
- [AppSyncGraphQLApiLogicalId]: {
158
+ AppSyncApiGraphQLUrl: {
159
+ Export: {
160
+ Name: {
161
+ 'Fn::Join': [
162
+ ':',
163
+ [{ Ref: 'AWS::StackName' }, 'AppSyncApiGraphQLUrl'],
164
+ ],
165
+ },
166
+ },
156
167
  Value: {
157
168
  'Fn::GetAtt': [AppSyncGraphQLApiLogicalId, 'GraphQLUrl'],
158
169
  },
159
170
  },
171
+ AppSyncApiArn: {
172
+ Export: {
173
+ Name: {
174
+ 'Fn::Join': [':', [{ Ref: 'AWS::StackName' }, 'AppSyncApiArn']],
175
+ },
176
+ },
177
+ Value: {
178
+ 'Fn::GetAtt': [AppSyncGraphQLApiLogicalId, 'Arn'],
179
+ },
180
+ },
160
181
  },
161
182
  };
162
183
 
@@ -205,5 +226,12 @@ export const createApiTemplate = ({
205
226
  };
206
227
  }
207
228
 
229
+ if (lambdaFunction.environment?.variables) {
230
+ template.Resources[AppSyncLambdaFunctionLogicalId].Properties.Environment =
231
+ {
232
+ Variables: lambdaFunction.environment.variables,
233
+ };
234
+ }
235
+
208
236
  return template;
209
237
  };