@aws-amplify/graphql-transformer-interfaces 4.0.0 → 4.1.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/API.md +10 -11
- package/CHANGELOG.md +10 -0
- package/lib/graphql-api-provider.d.ts +3 -4
- package/lib/graphql-api-provider.d.ts.map +1 -1
- package/lib/graphql-api-provider.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/transform-host-provider.d.ts +4 -4
- package/lib/transform-host-provider.d.ts.map +1 -1
- package/package.json +11 -5
- package/src/graphql-api-provider.ts +3 -10
- package/src/index.ts +0 -1
- package/src/transform-host-provider.ts +5 -1
- package/tsconfig.tsbuildinfo +1 -1
package/API.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { BackedDataSource } from 'aws-cdk-lib/aws-appsync';
|
|
8
8
|
import { BaseDataSource } from 'aws-cdk-lib/aws-appsync';
|
|
9
9
|
import { CfnDomain } from 'aws-cdk-lib/aws-elasticsearch';
|
|
10
|
+
import { CfnFunctionConfiguration } from 'aws-cdk-lib/aws-appsync';
|
|
10
11
|
import { CfnParameter } from 'aws-cdk-lib';
|
|
11
12
|
import { CfnResolver } from 'aws-cdk-lib/aws-appsync';
|
|
12
13
|
import { CfnResource } from 'aws-cdk-lib';
|
|
@@ -24,6 +25,8 @@ import { FieldNode } from 'graphql';
|
|
|
24
25
|
import { Grant } from 'aws-cdk-lib/aws-iam';
|
|
25
26
|
import { GraphqlApiBase } from 'aws-cdk-lib/aws-appsync';
|
|
26
27
|
import { HttpDataSource } from 'aws-cdk-lib/aws-appsync';
|
|
28
|
+
import { HttpDataSourceOptions } from 'aws-cdk-lib/aws-appsync';
|
|
29
|
+
import { IamResource } from 'aws-cdk-lib/aws-appsync';
|
|
27
30
|
import { IAsset } from 'aws-cdk-lib';
|
|
28
31
|
import { IConstruct } from 'constructs';
|
|
29
32
|
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
@@ -57,12 +60,6 @@ export interface AmplifyDynamoDbModelDataSourceStrategy extends ModelDataSourceS
|
|
|
57
60
|
readonly provisionStrategy: 'AMPLIFY_TABLE';
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
// @public (undocumented)
|
|
61
|
-
export interface APIIAMResourceProvider {
|
|
62
|
-
// (undocumented)
|
|
63
|
-
resourceArns: (api: GraphQLAPIProvider) => string[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
63
|
// @public (undocumented)
|
|
67
64
|
export interface ApiKeyConfig {
|
|
68
65
|
// (undocumented)
|
|
@@ -202,7 +199,7 @@ export interface GraphQLAPIProvider extends IConstruct {
|
|
|
202
199
|
// (undocumented)
|
|
203
200
|
readonly assetProvider: AssetProvider;
|
|
204
201
|
// (undocumented)
|
|
205
|
-
grant: (grantee: IGrantable, resources:
|
|
202
|
+
grant: (grantee: IGrantable, resources: IamResource, ...actions: string[]) => Grant;
|
|
206
203
|
// (undocumented)
|
|
207
204
|
grantMutation: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
208
205
|
// (undocumented)
|
|
@@ -210,6 +207,8 @@ export interface GraphQLAPIProvider extends IConstruct {
|
|
|
210
207
|
// (undocumented)
|
|
211
208
|
grantSubscription: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
212
209
|
// (undocumented)
|
|
210
|
+
readonly graphqlUrl: string;
|
|
211
|
+
// (undocumented)
|
|
213
212
|
readonly host: TransformHostProvider;
|
|
214
213
|
// (undocumented)
|
|
215
214
|
readonly name: string;
|
|
@@ -872,11 +871,11 @@ export type TransformerValidationStepContextProvider = Pick<TransformerContextPr
|
|
|
872
871
|
// @public (undocumented)
|
|
873
872
|
export interface TransformHostProvider {
|
|
874
873
|
// (undocumented)
|
|
875
|
-
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct) => AppSyncFunctionConfigurationProvider;
|
|
874
|
+
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => AppSyncFunctionConfigurationProvider;
|
|
876
875
|
// (undocumented)
|
|
877
876
|
addDynamoDbDataSource(name: string, table: ITable, options?: DynamoDbDataSourceOptions, scope?: Construct): DynamoDbDataSource;
|
|
878
877
|
// (undocumented)
|
|
879
|
-
addHttpDataSource(name: string, endpoint: string, options?:
|
|
878
|
+
addHttpDataSource(name: string, endpoint: string, options?: HttpDataSourceOptions, scope?: Construct): HttpDataSource;
|
|
880
879
|
// (undocumented)
|
|
881
880
|
addLambdaDataSource(name: string, lambdaFunction: IFunction, options?: DataSourceOptions, scope?: Construct): LambdaDataSource;
|
|
882
881
|
// (undocumented)
|
|
@@ -886,7 +885,7 @@ export interface TransformHostProvider {
|
|
|
886
885
|
// (undocumented)
|
|
887
886
|
addNoneDataSource(name: string, options?: DataSourceOptions, scope?: Construct): NoneDataSource;
|
|
888
887
|
// (undocumented)
|
|
889
|
-
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct) => CfnResolver;
|
|
888
|
+
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => CfnResolver;
|
|
890
889
|
// (undocumented)
|
|
891
890
|
addSearchableDataSource(name: string, endpoint: string, region: string, options?: SearchableDataSourceOptions, scope?: Construct): BaseDataSource;
|
|
892
891
|
// (undocumented)
|
|
@@ -944,7 +943,7 @@ export interface VpcConfig {
|
|
|
944
943
|
|
|
945
944
|
// Warnings were encountered during analysis:
|
|
946
945
|
//
|
|
947
|
-
// src/graphql-api-provider.ts:
|
|
946
|
+
// src/graphql-api-provider.ts:37:3 - (ae-forgotten-export) The symbol "OpenIDConnectConfig" needs to be exported by the entry point index.d.ts
|
|
948
947
|
|
|
949
948
|
// (No @packageDocumentation comment for this package)
|
|
950
949
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.1.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-transformer-interfaces@4.0.1...@aws-amplify/graphql-transformer-interfaces@4.1.0) (2024-09-06)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **generation-transformer:** add generation transformer ([#2820](https://github.com/aws-amplify/amplify-category-api/issues/2820)) ([a86db4e](https://github.com/aws-amplify/amplify-category-api/commit/a86db4e40962565fb55b7262a7d771f21bacef2a))
|
|
11
|
+
|
|
12
|
+
## [4.0.1](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-transformer-interfaces@4.0.0...@aws-amplify/graphql-transformer-interfaces@4.0.1) (2024-08-28)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @aws-amplify/graphql-transformer-interfaces
|
|
15
|
+
|
|
6
16
|
# [4.0.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-transformer-interfaces@3.10.1...@aws-amplify/graphql-transformer-interfaces@4.0.0) (2024-08-20)
|
|
7
17
|
|
|
8
18
|
- feat!: bump version for v2 transformer packages ([7dac35c](https://github.com/aws-amplify/amplify-category-api/commit/7dac35cceb971b256b5688b0745ef82afc78b641))
|
|
@@ -3,6 +3,7 @@ import { Construct, IConstruct } from 'constructs';
|
|
|
3
3
|
import { Grant, IGrantable, IRole } from 'aws-cdk-lib/aws-iam';
|
|
4
4
|
import { TransformHostProvider } from './transform-host-provider';
|
|
5
5
|
import { AssetProvider } from './asset-provider';
|
|
6
|
+
import { IamResource } from 'aws-cdk-lib/aws-appsync';
|
|
6
7
|
export type AppSyncAuthMode = 'API_KEY' | 'AMAZON_COGNITO_USER_POOLS' | 'AWS_IAM' | 'OPENID_CONNECT' | 'AWS_LAMBDA';
|
|
7
8
|
export type AppSyncAuthConfiguration = {
|
|
8
9
|
defaultAuthentication: AppSyncAuthConfigurationEntry;
|
|
@@ -80,17 +81,15 @@ export interface S3MappingFunctionCodeProvider {
|
|
|
80
81
|
export type MappingTemplateProvider = InlineMappingTemplateProvider | S3MappingTemplateProvider;
|
|
81
82
|
export interface GraphQLAPIProvider extends IConstruct {
|
|
82
83
|
readonly apiId: string;
|
|
84
|
+
readonly graphqlUrl: string;
|
|
83
85
|
readonly host: TransformHostProvider;
|
|
84
86
|
readonly name: string;
|
|
85
87
|
readonly assetProvider: AssetProvider;
|
|
86
88
|
addToSchema: (addition: string) => void;
|
|
87
89
|
addSchemaDependency: (construct: CfnResource) => boolean;
|
|
88
|
-
grant: (grantee: IGrantable, resources:
|
|
90
|
+
grant: (grantee: IGrantable, resources: IamResource, ...actions: string[]) => Grant;
|
|
89
91
|
grantMutation: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
90
92
|
grantQuery: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
91
93
|
grantSubscription: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
92
94
|
}
|
|
93
|
-
export interface APIIAMResourceProvider {
|
|
94
|
-
resourceArns: (api: GraphQLAPIProvider) => string[];
|
|
95
|
-
}
|
|
96
95
|
//# sourceMappingURL=graphql-api-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-api-provider.d.ts","sourceRoot":"","sources":["../src/graphql-api-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,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AU,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,KAAK,CAAC;IAOhE,iBAAiB,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,KAAK,CAAC;CACxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-api-provider.js","sourceRoot":"","sources":["../src/graphql-api-provider.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"graphql-api-provider.js","sourceRoot":"","sources":["../src/graphql-api-provider.ts"],"names":[],"mappings":";;;AAyGA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,2CAA2B,CAAA;AAC7B,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './transformer-context';
|
|
2
2
|
export { TransformerPluginProvider, TransformerPluginType } from './transformer-plugin-provider';
|
|
3
3
|
export { MutationFieldType, QueryFieldType, SubscriptionFieldType, TransformerModelProvider, TransformerModelEnhancementProvider, TransformerAuthProvider, } from './transformer-model-provider';
|
|
4
|
-
export { GraphQLAPIProvider, AppSyncFunctionConfigurationProvider, DataSourceOptions, MappingTemplateProvider, S3MappingTemplateProvider, S3MappingFunctionCodeProvider, InlineMappingTemplateProvider,
|
|
4
|
+
export { GraphQLAPIProvider, AppSyncFunctionConfigurationProvider, DataSourceOptions, MappingTemplateProvider, S3MappingTemplateProvider, S3MappingFunctionCodeProvider, InlineMappingTemplateProvider, TemplateType as MappingTemplateType, AppSyncAuthConfiguration, AppSyncAuthConfigurationAPIKeyEntry, AppSyncAuthConfigurationEntry, AppSyncAuthConfigurationIAMEntry, ApiKeyConfig, AppSyncAuthConfigurationOIDCEntry, AppSyncAuthConfigurationUserPoolEntry, AppSyncAuthMode, UserPoolConfig, SearchableDataSourceOptions, } from './graphql-api-provider';
|
|
5
5
|
export { TransformHostProvider, DynamoDbDataSourceOptions } from './transform-host-provider';
|
|
6
6
|
export { TransformerLog, TransformerLogLevel } from './transformer-log';
|
|
7
7
|
export type { TransformParameters } from './transformer-context/transform-parameters';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,oCAAoC,EACpC,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,oCAAoC,EACpC,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,YAAY,IAAI,mBAAmB,EACnC,wBAAwB,EACxB,mCAAmC,EACnC,6BAA6B,EAC7B,gCAAgC,EAChC,YAAY,EACZ,iCAAiC,EACjC,qCAAqC,EACrC,eAAe,EACf,cAAc,EACd,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3E,cAAc,oBAAoB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,wDAAsC;AACtC,6EAAiG;AAA7D,oIAAA,qBAAqB,OAAA;AACzD,2EAOsC;AANpC,+HAAA,iBAAiB,OAAA;AACjB,4HAAA,cAAc,OAAA;AACd,mIAAA,qBAAqB,OAAA;AAKvB,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,wDAAsC;AACtC,6EAAiG;AAA7D,oIAAA,qBAAqB,OAAA;AACzD,2EAOsC;AANpC,+HAAA,iBAAiB,OAAA;AACjB,4HAAA,cAAc,OAAA;AACd,mIAAA,qBAAqB,OAAA;AAKvB,+DAmBgC;AAX9B,2HAAA,YAAY,OAAuB;AAarC,qDAAwE;AAA/C,sHAAA,mBAAmB,OAAA;AAI5C,qDAAmC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duration } from 'aws-cdk-lib';
|
|
2
|
-
import { BaseDataSource, DynamoDbDataSource, GraphqlApiBase, HttpDataSource, LambdaDataSource, NoneDataSource, CfnResolver } from 'aws-cdk-lib/aws-appsync';
|
|
2
|
+
import { BaseDataSource, DynamoDbDataSource, GraphqlApiBase, HttpDataSource, LambdaDataSource, NoneDataSource, CfnResolver, CfnFunctionConfiguration, HttpDataSourceOptions } from 'aws-cdk-lib/aws-appsync';
|
|
3
3
|
import { ITable } from 'aws-cdk-lib/aws-dynamodb';
|
|
4
4
|
import { IFunction, ILayerVersion, Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
5
5
|
import { IRole } from 'aws-cdk-lib/aws-iam';
|
|
@@ -11,13 +11,13 @@ export interface DynamoDbDataSourceOptions extends DataSourceOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export interface TransformHostProvider {
|
|
13
13
|
setAPI(api: GraphqlApiBase): void;
|
|
14
|
-
addHttpDataSource(name: string, endpoint: string, options?:
|
|
14
|
+
addHttpDataSource(name: string, endpoint: string, options?: HttpDataSourceOptions, scope?: Construct): HttpDataSource;
|
|
15
15
|
addDynamoDbDataSource(name: string, table: ITable, options?: DynamoDbDataSourceOptions, scope?: Construct): DynamoDbDataSource;
|
|
16
16
|
addNoneDataSource(name: string, options?: DataSourceOptions, scope?: Construct): NoneDataSource;
|
|
17
17
|
addLambdaDataSource(name: string, lambdaFunction: IFunction, options?: DataSourceOptions, scope?: Construct): LambdaDataSource;
|
|
18
18
|
addSearchableDataSource(name: string, endpoint: string, region: string, options?: SearchableDataSourceOptions, scope?: Construct): BaseDataSource;
|
|
19
|
-
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct) => AppSyncFunctionConfigurationProvider;
|
|
20
|
-
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct) => CfnResolver;
|
|
19
|
+
addAppSyncFunction: (name: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, dataSourceName: string, scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => AppSyncFunctionConfigurationProvider;
|
|
20
|
+
addResolver: (typeName: string, fieldName: string, requestMappingTemplate: MappingTemplateProvider, responseMappingTemplate: MappingTemplateProvider, resolverLogicalId?: string, dataSourceName?: string, pipelineConfig?: string[], scope?: Construct, runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty) => CfnResolver;
|
|
21
21
|
addLambdaFunction: (functionName: string, functionKey: string, handlerName: string, filePath: string, runtime: Runtime, layers?: ILayerVersion[], role?: IRole, environment?: {
|
|
22
22
|
[key: string]: string;
|
|
23
23
|
}, timeout?: Duration, scope?: Construct, vpc?: VpcConfig, description?: string) => IFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-host-provider.d.ts","sourceRoot":"","sources":["../src/transform-host-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,
|
|
1
|
+
{"version":3,"file":"transform-host-provider.d.ts","sourceRoot":"","sources":["../src/transform-host-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,oCAAoC,EACpC,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAo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/C,uBAAuB,EAAE,uBAAuB,EAChD,iBAAiB,CAAC,EAAE,MAAM,EAC1B,cAAc,CAAC,EAAE,MAAM,EACvB,cAAc,CAAC,EAAE,MAAM,EAAE,EACzB,KAAK,CAAC,EAAE,SAAS,EACjB,OAAO,CAAC,EAAE,wBAAwB,CAAC,sBAAsB,KACtD,WAAW,CAAC;IAEjB,iBAAiB,EAAE,CACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,EAAE,EACxB,IAAI,CAAC,EAAE,KAAK,EACZ,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACvC,OAAO,CAAC,EAAE,QAAQ,EAClB,KAAK,CAAC,EAAE,SAAS,EACjB,GAAG,CAAC,EAAE,SAAS,EACf,WAAW,CAAC,EAAE,MAAM,KACjB,SAAS,CAAC;IAEf,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,CAAC;IACvD,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAEzC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;IACzE,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/graphql-transformer-interfaces",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Amplify GraphQL transformer interface definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,14 +31,16 @@
|
|
|
31
31
|
"graphql": "^15.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"aws-cdk-lib": "^2.
|
|
34
|
+
"aws-cdk-lib": "^2.152.0",
|
|
35
35
|
"constructs": "^10.3.0"
|
|
36
36
|
},
|
|
37
37
|
"jest": {
|
|
38
38
|
"transform": {
|
|
39
39
|
"^.+\\.tsx?$": "ts-jest"
|
|
40
40
|
},
|
|
41
|
-
"
|
|
41
|
+
"testEnvironmentOptions": {
|
|
42
|
+
"url": "http://localhost"
|
|
43
|
+
},
|
|
42
44
|
"testRegex": "(src/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
|
43
45
|
"moduleFileExtensions": [
|
|
44
46
|
"ts",
|
|
@@ -59,7 +61,11 @@
|
|
|
59
61
|
],
|
|
60
62
|
"coveragePathIgnorePatterns": [
|
|
61
63
|
"/__tests__/"
|
|
62
|
-
]
|
|
64
|
+
],
|
|
65
|
+
"snapshotFormat": {
|
|
66
|
+
"escapeString": true,
|
|
67
|
+
"printBasicPrototype": true
|
|
68
|
+
}
|
|
63
69
|
},
|
|
64
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "47cbcc39b5c28486ff5759d29efee07725bb8b55"
|
|
65
71
|
}
|
|
@@ -4,6 +4,7 @@ import { Grant, IGrantable, IRole } from 'aws-cdk-lib/aws-iam';
|
|
|
4
4
|
// eslint-disable-next-line import/no-cycle
|
|
5
5
|
import { TransformHostProvider } from './transform-host-provider';
|
|
6
6
|
import { AssetProvider } from './asset-provider';
|
|
7
|
+
import { IamResource } from 'aws-cdk-lib/aws-appsync';
|
|
7
8
|
|
|
8
9
|
// Auth Config Modes
|
|
9
10
|
export type AppSyncAuthMode = 'API_KEY' | 'AMAZON_COGNITO_USER_POOLS' | 'AWS_IAM' | 'OPENID_CONNECT' | 'AWS_LAMBDA';
|
|
@@ -127,6 +128,7 @@ export type MappingTemplateProvider = InlineMappingTemplateProvider | S3MappingT
|
|
|
127
128
|
|
|
128
129
|
export interface GraphQLAPIProvider extends IConstruct {
|
|
129
130
|
readonly apiId: string;
|
|
131
|
+
readonly graphqlUrl: string;
|
|
130
132
|
readonly host: TransformHostProvider;
|
|
131
133
|
readonly name: string;
|
|
132
134
|
readonly assetProvider: AssetProvider;
|
|
@@ -136,7 +138,7 @@ export interface GraphQLAPIProvider extends IConstruct {
|
|
|
136
138
|
addToSchema: (addition: string) => void;
|
|
137
139
|
addSchemaDependency: (construct: CfnResource) => boolean;
|
|
138
140
|
|
|
139
|
-
grant: (grantee: IGrantable, resources:
|
|
141
|
+
grant: (grantee: IGrantable, resources: IamResource, ...actions: string[]) => Grant;
|
|
140
142
|
// /**
|
|
141
143
|
// * Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.
|
|
142
144
|
// *
|
|
@@ -159,12 +161,3 @@ export interface GraphQLAPIProvider extends IConstruct {
|
|
|
159
161
|
// */
|
|
160
162
|
grantSubscription: (grantee: IGrantable, ...fields: string[]) => Grant;
|
|
161
163
|
}
|
|
162
|
-
|
|
163
|
-
export interface APIIAMResourceProvider {
|
|
164
|
-
/**
|
|
165
|
-
* Return the Resource ARN
|
|
166
|
-
*
|
|
167
|
-
* @param api The GraphQL API to give permissions
|
|
168
|
-
*/
|
|
169
|
-
resourceArns: (api: GraphQLAPIProvider) => string[];
|
|
170
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
LambdaDataSource,
|
|
8
8
|
NoneDataSource,
|
|
9
9
|
CfnResolver,
|
|
10
|
+
CfnFunctionConfiguration,
|
|
11
|
+
HttpDataSourceOptions,
|
|
10
12
|
} from 'aws-cdk-lib/aws-appsync';
|
|
11
13
|
import { ITable } from 'aws-cdk-lib/aws-dynamodb';
|
|
12
14
|
import { IFunction, ILayerVersion, Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
@@ -30,7 +32,7 @@ export interface DynamoDbDataSourceOptions extends DataSourceOptions {
|
|
|
30
32
|
export interface TransformHostProvider {
|
|
31
33
|
setAPI(api: GraphqlApiBase): void;
|
|
32
34
|
|
|
33
|
-
addHttpDataSource(name: string, endpoint: string, options?:
|
|
35
|
+
addHttpDataSource(name: string, endpoint: string, options?: HttpDataSourceOptions, scope?: Construct): HttpDataSource;
|
|
34
36
|
addDynamoDbDataSource(name: string, table: ITable, options?: DynamoDbDataSourceOptions, scope?: Construct): DynamoDbDataSource;
|
|
35
37
|
addNoneDataSource(name: string, options?: DataSourceOptions, scope?: Construct): NoneDataSource;
|
|
36
38
|
addLambdaDataSource(name: string, lambdaFunction: IFunction, options?: DataSourceOptions, scope?: Construct): LambdaDataSource;
|
|
@@ -48,6 +50,7 @@ export interface TransformHostProvider {
|
|
|
48
50
|
responseMappingTemplate: MappingTemplateProvider,
|
|
49
51
|
dataSourceName: string,
|
|
50
52
|
scope?: Construct,
|
|
53
|
+
runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty,
|
|
51
54
|
) => AppSyncFunctionConfigurationProvider;
|
|
52
55
|
|
|
53
56
|
addResolver: (
|
|
@@ -59,6 +62,7 @@ export interface TransformHostProvider {
|
|
|
59
62
|
dataSourceName?: string,
|
|
60
63
|
pipelineConfig?: string[],
|
|
61
64
|
scope?: Construct,
|
|
65
|
+
runtime?: CfnFunctionConfiguration.AppSyncRuntimeProperty,
|
|
62
66
|
) => CfnResolver;
|
|
63
67
|
|
|
64
68
|
addLambdaFunction: (
|