@aws-amplify/graphql-api-construct 1.4.3 → 1.5.1-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +202 -201
- package/API.md +7 -7
- package/CHANGELOG.md +12 -0
- package/README.md +210 -20
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.d.ts +0 -7
- package/lib/amplify-graphql-api.js +18 -76
- package/lib/amplify-graphql-definition.d.ts +1 -13
- package/lib/amplify-graphql-definition.js +27 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/internal/data-source-config.d.ts +14 -20
- package/lib/internal/data-source-config.js +110 -38
- package/lib/internal/model-type-name.d.ts +2 -2
- package/lib/internal/model-type-name.js +4 -4
- package/lib/{model-datasource-strategy.d.ts → model-datasource-strategy-types.d.ts} +17 -11
- package/lib/model-datasource-strategy-types.js +10 -0
- package/lib/sql-model-datasource-strategy.d.ts +1 -1
- package/lib/sql-model-datasource-strategy.js +4 -4
- package/lib/types.d.ts +1 -9
- package/lib/types.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +6 -10
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +16 -12
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +2 -7
- package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +13 -9
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js +7 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +11 -7
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +11 -7
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js +4 -4
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +3 -5
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +12 -34
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +13 -9
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js +3 -4
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +3 -3
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +16 -12
- package/node_modules/@aws-amplify/graphql-model-transformer/API.md +2 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +7 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts +1 -3
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +61 -68
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +8 -8
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +32 -36
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +70 -34
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +15 -10
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +11 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/API.md +2 -2
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +14 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +6 -6
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +6 -6
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +8 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +5 -3
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +2 -2
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +18 -6
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +18 -18
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +54 -54
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +14 -10
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +1 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +12 -8
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +31 -25
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +12 -8
- package/node_modules/@aws-amplify/graphql-transformer/API.md +3 -17
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +4 -14
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +8 -15
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +20 -16
- package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +30 -57
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +97 -30
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +7 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +3 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +22 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js +4 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +6 -12
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +4 -11
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts +0 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts +12 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js +94 -39
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +10 -22
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +3 -7
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts +1 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js +1 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +2 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +16 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.d.ts +7 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.js +15 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts +16 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.js +21 -5
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +3 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js +5 -12
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts +11 -8
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js +64 -52
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +0 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +1 -58
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.d.ts +22 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.js +28 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +2 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js +7 -6
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +9 -5
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +32 -68
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +11 -7
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js +1 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +11 -18
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts +0 -15
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js +1 -10
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +7 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +50 -18
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +0 -6
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +14 -21
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +0 -43
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- package/node_modules/graphql-mapping-template/CHANGELOG.md +4 -0
- package/node_modules/graphql-mapping-template/LICENSE +201 -0
- package/node_modules/graphql-mapping-template/package.json +8 -3
- package/node_modules/graphql-transformer-common/API.md +0 -15
- package/node_modules/graphql-transformer-common/CHANGELOG.md +6 -0
- package/node_modules/graphql-transformer-common/LICENSE +201 -0
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +0 -15
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +0 -15
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +8 -3
- package/package.json +24 -19
- package/src/amplify-graphql-api.ts +19 -91
- package/src/amplify-graphql-definition.ts +41 -17
- package/src/index.ts +1 -1
- package/src/internal/data-source-config.ts +146 -52
- package/src/internal/model-type-name.ts +3 -2
- package/src/{model-datasource-strategy.ts → model-datasource-strategy-types.ts} +20 -12
- package/src/sql-model-datasource-strategy.ts +3 -3
- package/src/types.ts +1 -9
- package/lib/model-datasource-strategy.js +0 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts +0 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js +0 -15
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js.map +0 -1
package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import { DataSourceType } from '../transformer-context/transformer-datasource-provider';
|
2
|
-
|
3
1
|
// #########################################################################################################################################
|
4
2
|
// If you change types in this file (the internal implementation), be sure to make corresponding necessary changes to
|
5
3
|
// amplify-graphql-api-construct/src/model-datasource-strategy.ts (the customer-facing interface) and the adapter functions in this file.
|
@@ -17,8 +15,15 @@ export interface ModelDataSourceStrategyBase {
|
|
17
15
|
dbType: ModelDataSourceStrategyDbType;
|
18
16
|
}
|
19
17
|
|
20
|
-
|
21
|
-
|
18
|
+
/**
|
19
|
+
* All supported database types that can be used to resolve models.
|
20
|
+
*/
|
21
|
+
export type ModelDataSourceStrategyDbType = 'DYNAMODB' | ModelDataSourceStrategySqlDbType;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* All supported SQL database types that can be used to resolve models.
|
25
|
+
*/
|
26
|
+
export type ModelDataSourceStrategySqlDbType = 'MYSQL' | 'POSTGRES';
|
22
27
|
|
23
28
|
/**
|
24
29
|
* Use default CloudFormation type 'AWS::DynamoDB::Table' to provision table.
|
@@ -39,6 +44,8 @@ export interface AmplifyDynamoDbModelDataSourceStrategy extends ModelDataSourceS
|
|
39
44
|
/**
|
40
45
|
* A strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.
|
41
46
|
*
|
47
|
+
* Note: The implementation type is different from the interface type: the interface type contains the custom SQL statements that are
|
48
|
+
* reference by the `@sql` `reference` attribute, while the implementation moves those into the SqlDirectiveDataSourceStrategy type.
|
42
49
|
*/
|
43
50
|
export interface SQLLambdaModelDataSourceStrategy extends ModelDataSourceStrategyBase {
|
44
51
|
/**
|
@@ -50,7 +57,7 @@ export interface SQLLambdaModelDataSourceStrategy extends ModelDataSourceStrateg
|
|
50
57
|
/**
|
51
58
|
* The type of the SQL database used to process model operations for this definition.
|
52
59
|
*/
|
53
|
-
readonly dbType:
|
60
|
+
readonly dbType: ModelDataSourceStrategySqlDbType;
|
54
61
|
|
55
62
|
/**
|
56
63
|
* The parameters the Lambda data source will use to connect to the database.
|
@@ -62,12 +69,6 @@ export interface SQLLambdaModelDataSourceStrategy extends ModelDataSourceStrateg
|
|
62
69
|
*/
|
63
70
|
readonly vpcConfiguration?: VpcConfig;
|
64
71
|
|
65
|
-
/**
|
66
|
-
* Custom SQL statements. The key is the value of the `references` attribute of the `@sql` directive in the `schema`; the value is the SQL
|
67
|
-
* to be executed.
|
68
|
-
*/
|
69
|
-
readonly customSqlStatements?: Record<string, string>;
|
70
|
-
|
71
72
|
/**
|
72
73
|
* The configuration for the provisioned concurrency of the Lambda.
|
73
74
|
*/
|
@@ -137,27 +138,58 @@ export interface SqlModelDataSourceDbConnectionConfig {
|
|
137
138
|
readonly databaseNameSsmPath: string;
|
138
139
|
}
|
139
140
|
|
140
|
-
|
141
|
+
/**
|
142
|
+
* The internal implementation type for defining a ModelDataSourceStrategy used to resolve a field annotated with a `@sql` directive.
|
143
|
+
*
|
144
|
+
* Note: The implementation type is different from the interface type: it directly contains the SQL statement to be executed rather than
|
145
|
+
* passing a map.
|
146
|
+
*/
|
147
|
+
export interface SqlDirectiveDataSourceStrategy {
|
148
|
+
/** The built-in type (either "Query" or "Mutation") with which the custom SQL is associated */
|
141
149
|
readonly typeName: 'Query' | 'Mutation';
|
150
|
+
|
151
|
+
/** The field name with which the custom SQL is associated */
|
142
152
|
readonly fieldName: string;
|
143
|
-
|
144
|
-
|
153
|
+
|
154
|
+
/** The strategy used to create the datasource that will resolve the custom SQL statement. */
|
155
|
+
readonly strategy: SQLLambdaModelDataSourceStrategy;
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Custom SQL statements to be executed to resolve this field.
|
159
|
+
*
|
160
|
+
* Note: It's overkill to make this a map: a SqlDirectiveDataSourceStrategy will only ever use at most one statement (and maybe not even
|
161
|
+
* that if the directive uses inline statements). However, to avoid having to parse the directive configuration in multiple places, we'll
|
162
|
+
* pass the entire map as specified in the CDK construct definition, and let the directive transformer use it to look up references.
|
163
|
+
*/
|
164
|
+
readonly customSqlStatements?: Record<string, string>;
|
145
165
|
}
|
146
166
|
|
167
|
+
/**
|
168
|
+
* Defines types that vend a dataSourceStrategies and optional customSqlDataSourceStrategies field. Primarily used for transformer context.
|
169
|
+
*/
|
147
170
|
export interface DataSourceStrategiesProvider {
|
148
171
|
/** Maps GraphQL model names to the ModelDataSourceStrategy used to resolve it. The key of the record is the GraphQL type name. */
|
149
|
-
|
150
|
-
// dataSourceStrategies: Record<string, ModelDataSourceStrategy>;
|
172
|
+
dataSourceStrategies: Record<string, ModelDataSourceStrategy>;
|
151
173
|
|
152
174
|
/** Maps custom Query and Mutation fields to the ModelDataSourceStrategy used to resolve them. */
|
153
|
-
|
175
|
+
sqlDirectiveDataSourceStrategies?: SqlDirectiveDataSourceStrategy[];
|
154
176
|
}
|
155
177
|
|
156
178
|
/**
|
157
|
-
* Maps a given AWS region to the SQL Lambda layer version ARN for that region. TODO:
|
179
|
+
* Maps a given AWS region to the SQL Lambda layer version ARN for that region. TODO: Once we remove SQL imports from Gen1 CLI, remove this
|
180
|
+
* from the transformer interfaces package in favor of the model generator, which is the only place that needs it now that we always resolve
|
181
|
+
* the layer mapping at deploy time.
|
158
182
|
*/
|
159
183
|
export interface RDSLayerMapping {
|
160
184
|
readonly [key: string]: {
|
161
185
|
layerRegion: string;
|
162
186
|
};
|
163
187
|
}
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Defines types that vend an rdsLayerMapping field. This is used solely for the Gen1 CLI import API flow, since wiring the custom resource
|
191
|
+
* provider used by the CDK isn't worth the cost. TODO: Remove this once we remove SQL imports from Gen1 CLI.
|
192
|
+
*/
|
193
|
+
export interface RDSLayerMappingProvider {
|
194
|
+
rdsLayerMapping?: RDSLayerMapping;
|
195
|
+
}
|
package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts
CHANGED
@@ -3,12 +3,6 @@ export {
|
|
3
3
|
TransformerDataSourceManagerProvider,
|
4
4
|
AppSyncDataSourceType,
|
5
5
|
DataSourceInstance,
|
6
|
-
DataSourceType,
|
7
|
-
DBType,
|
8
|
-
DataSourceProvisionStrategy,
|
9
|
-
DynamoDBProvisionStrategy,
|
10
|
-
SQLLambdaModelProvisionStrategy,
|
11
|
-
SQLDBType,
|
12
6
|
} from './transformer-datasource-provider';
|
13
7
|
export { TransformerContextOutputProvider } from './transformer-context-output-provider';
|
14
8
|
export { TransformerProviderRegistry } from './transformer-provider-registry';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
2
2
|
import { AppSyncAuthConfiguration, GraphQLAPIProvider } from '../graphql-api-provider';
|
3
|
-
import {
|
4
|
-
import { TransformerDataSourceManagerProvider
|
3
|
+
import { DataSourceStrategiesProvider, RDSLayerMappingProvider } from '../model-datasource';
|
4
|
+
import { TransformerDataSourceManagerProvider } from './transformer-datasource-provider';
|
5
5
|
import { TransformerProviderRegistry } from './transformer-provider-registry';
|
6
6
|
import { TransformerContextOutputProvider } from './transformer-context-output-provider';
|
7
7
|
import { StackManagerProvider } from './stack-manager-provider';
|
@@ -11,23 +11,20 @@ import { TransformerResolversManagerProvider } from './transformer-resolver-prov
|
|
11
11
|
import { SynthParameters } from './synth-parameters';
|
12
12
|
|
13
13
|
export interface TransformerContextMetadataProvider {
|
14
|
-
set<T>(key: string, value: T)
|
15
|
-
get<T>(key: string)
|
16
|
-
has(key: string)
|
14
|
+
set: <T>(key: string, value: T) => void;
|
15
|
+
get: <T>(key: string) => T | undefined;
|
16
|
+
has: (key: string) => boolean;
|
17
17
|
}
|
18
18
|
|
19
19
|
export type TransformerSecrets = { [key: string]: any };
|
20
20
|
|
21
|
-
export interface TransformerContextProvider {
|
21
|
+
export interface TransformerContextProvider extends DataSourceStrategiesProvider, RDSLayerMappingProvider {
|
22
22
|
metadata: TransformerContextMetadataProvider;
|
23
23
|
resolvers: TransformerResolversManagerProvider;
|
24
24
|
dataSources: TransformerDataSourceManagerProvider;
|
25
25
|
providerRegistry: TransformerProviderRegistry;
|
26
26
|
|
27
27
|
inputDocument: DocumentNode;
|
28
|
-
modelToDatasourceMap: Map<string, DataSourceType>;
|
29
|
-
customSqlDataSourceStrategies?: CustomSqlDataSourceStrategy[];
|
30
|
-
datasourceSecretParameterLocations: Map<string, TransformerSecrets>;
|
31
28
|
output: TransformerContextOutputProvider;
|
32
29
|
stackManager: StackManagerProvider;
|
33
30
|
api: GraphQLAPIProvider;
|
@@ -35,20 +32,16 @@ export interface TransformerContextProvider {
|
|
35
32
|
authConfig: AppSyncAuthConfiguration;
|
36
33
|
transformParameters: TransformParameters;
|
37
34
|
synthParameters: SynthParameters;
|
38
|
-
customQueries: Map<string, string>;
|
39
35
|
|
40
|
-
isProjectUsingDataStore()
|
41
|
-
getResolverConfig<ResolverConfig>()
|
42
|
-
readonly sqlLambdaVpcConfig?: VpcConfig;
|
43
|
-
readonly rdsLayerMapping?: RDSLayerMapping;
|
44
|
-
readonly sqlLambdaProvisionedConcurrencyConfig?: ProvisionedConcurrencyConfig;
|
36
|
+
isProjectUsingDataStore: () => boolean;
|
37
|
+
getResolverConfig: <ResolverConfig>() => ResolverConfig | undefined;
|
45
38
|
}
|
46
39
|
|
47
40
|
export type TransformerBeforeStepContextProvider = Pick<
|
48
41
|
TransformerContextProvider,
|
49
42
|
| 'inputDocument'
|
50
|
-
| '
|
51
|
-
| '
|
43
|
+
| 'dataSourceStrategies'
|
44
|
+
| 'sqlDirectiveDataSourceStrategies'
|
52
45
|
| 'transformParameters'
|
53
46
|
| 'isProjectUsingDataStore'
|
54
47
|
| 'getResolverConfig'
|
@@ -60,8 +53,8 @@ export type TransformerBeforeStepContextProvider = Pick<
|
|
60
53
|
export type TransformerSchemaVisitStepContextProvider = Pick<
|
61
54
|
TransformerContextProvider,
|
62
55
|
| 'inputDocument'
|
63
|
-
| '
|
64
|
-
| '
|
56
|
+
| 'dataSourceStrategies'
|
57
|
+
| 'sqlDirectiveDataSourceStrategies'
|
65
58
|
| 'output'
|
66
59
|
| 'providerRegistry'
|
67
60
|
| 'transformParameters'
|
@@ -75,8 +68,8 @@ export type TransformerSchemaVisitStepContextProvider = Pick<
|
|
75
68
|
export type TransformerValidationStepContextProvider = Pick<
|
76
69
|
TransformerContextProvider,
|
77
70
|
| 'inputDocument'
|
78
|
-
| '
|
79
|
-
| '
|
71
|
+
| 'dataSourceStrategies'
|
72
|
+
| 'sqlDirectiveDataSourceStrategies'
|
80
73
|
| 'output'
|
81
74
|
| 'providerRegistry'
|
82
75
|
| 'dataSources'
|
@@ -26,46 +26,3 @@ export interface TransformerDataSourceManagerProvider {
|
|
26
26
|
}
|
27
27
|
|
28
28
|
export interface DataSourceProvider extends BackedDataSource {}
|
29
|
-
|
30
|
-
/**
|
31
|
-
* Supported transformable database types. TODO: Remove this when we normalize database type handling throughout
|
32
|
-
*/
|
33
|
-
export type DBType = 'DDB' | SQLDBType;
|
34
|
-
|
35
|
-
/**
|
36
|
-
* Supported transformable SQL database types. TODO: Remove this when we normalize database type handling throughout
|
37
|
-
*/
|
38
|
-
export type SQLDBType = 'MySQL' | 'Postgres';
|
39
|
-
|
40
|
-
// TODO: add strategy for the RDS. TODO: Move this to amplify-graphql-api-construct
|
41
|
-
export type DataSourceProvisionStrategy = DynamoDBProvisionStrategy | SQLLambdaModelProvisionStrategy;
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Provisioning configuration for a DynamoDB datasource. TODO: Remove this type in favor of strategy definitions in
|
45
|
-
* amplify-graphql-api-construct
|
46
|
-
*/
|
47
|
-
export const enum DynamoDBProvisionStrategy {
|
48
|
-
/**
|
49
|
-
* Use default CloudFormation resource of `AWS::DynamoDB::Table`
|
50
|
-
*/
|
51
|
-
DEFAULT = 'DEFAULT',
|
52
|
-
/**
|
53
|
-
* Use custom resource type `Custom::AmplifyDynamoDBTable`
|
54
|
-
*/
|
55
|
-
AMPLIFY_TABLE = 'AMPLIFY_TABLE',
|
56
|
-
}
|
57
|
-
|
58
|
-
// TODO: Remove this type in favor of fully-specified SQLLambdaModelDataSourceStrategy from amplify-graphql-api-construct
|
59
|
-
export const enum SQLLambdaModelProvisionStrategy {
|
60
|
-
/**
|
61
|
-
* A strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.
|
62
|
-
*/
|
63
|
-
DEFAULT = 'DEFAULT',
|
64
|
-
}
|
65
|
-
|
66
|
-
// TODO: Replace usages of this type with ModelDataSourceStrategy
|
67
|
-
export interface DataSourceType {
|
68
|
-
dbType: DBType;
|
69
|
-
provisionDB: boolean;
|
70
|
-
provisionStrategy: DataSourceProvisionStrategy;
|
71
|
-
}
|