@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.
- package/dist/esm/{chunk-MENSBKNQ.js → chunk-PZ5B6I7R.js} +25 -2
- package/dist/esm/cli.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +25 -2
- package/package.json +2 -2
- package/src/createApiTemplate.ts +29 -1
|
@@ -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.
|
|
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
|
-
|
|
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
package/dist/esm/index.js
CHANGED
package/dist/index.d.ts
CHANGED
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.
|
|
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
|
-
|
|
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.
|
|
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": "
|
|
71
|
+
"gitHead": "17a62817bc08beb436ba6f2a1a1a5262a913d67f"
|
|
72
72
|
}
|
package/src/createApiTemplate.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|