@aws-amplify/graphql-api-construct 1.4.3 → 1.5.0
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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,cAAc,+BAA+B,CAAC"}
|
@@ -1,10 +1,22 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SQL_SCHEMA_FILE_NAME = exports.
|
17
|
+
exports.SQL_SCHEMA_FILE_NAME = exports.ImportedRDSType = void 0;
|
4
18
|
var import_appsync_api_types_1 = require("./import-appsync-api-types");
|
5
|
-
Object.defineProperty(exports, "DDB_DB_TYPE", { enumerable: true, get: function () { return import_appsync_api_types_1.DDB_DB_TYPE; } });
|
6
19
|
Object.defineProperty(exports, "ImportedRDSType", { enumerable: true, get: function () { return import_appsync_api_types_1.ImportedRDSType; } });
|
7
|
-
Object.defineProperty(exports, "MYSQL_DB_TYPE", { enumerable: true, get: function () { return import_appsync_api_types_1.MYSQL_DB_TYPE; } });
|
8
|
-
Object.defineProperty(exports, "POSTGRES_DB_TYPE", { enumerable: true, get: function () { return import_appsync_api_types_1.POSTGRES_DB_TYPE; } });
|
9
20
|
Object.defineProperty(exports, "SQL_SCHEMA_FILE_NAME", { enumerable: true, get: function () { return import_appsync_api_types_1.SQL_SCHEMA_FILE_NAME; } });
|
21
|
+
__exportStar(require("./model-datasource-strategies"), exports);
|
10
22
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uEAQoC;AALlC,2HAAA,eAAe,OAAA;AACf,gIAAA,oBAAoB,OAAA;AAMtB,gEAA8C"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ModelDataSourceStrategy, ModelDataSourceStrategyDbType, ModelDataSourceStrategySqlDbType } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
export declare const DDB_DB_TYPE: ModelDataSourceStrategyDbType;
|
3
|
+
export declare const MYSQL_DB_TYPE: ModelDataSourceStrategySqlDbType;
|
4
|
+
export declare const POSTGRES_DB_TYPE: ModelDataSourceStrategySqlDbType;
|
5
|
+
export declare const DDB_DEFAULT_DATASOURCE_STRATEGY: ModelDataSourceStrategy;
|
6
|
+
export declare const DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY: ModelDataSourceStrategy;
|
7
|
+
//# sourceMappingURL=model-datasource-strategies.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"model-datasource-strategies.d.ts","sourceRoot":"","sources":["../../src/types/model-datasource-strategies.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,gCAAgC,EACjC,MAAM,6CAA6C,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,6BAA0C,CAAC;AAErE,eAAO,MAAM,aAAa,EAAE,gCAA0C,CAAC;AAEvE,eAAO,MAAM,gBAAgB,EAAE,gCAA6C,CAAC;AAE7E,eAAO,MAAM,+BAA+B,EAAE,uBAG7C,CAAC;AAEF,eAAO,MAAM,uCAAuC,EAAE,uBAGrD,CAAC"}
|
package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY = exports.DDB_DEFAULT_DATASOURCE_STRATEGY = exports.POSTGRES_DB_TYPE = exports.MYSQL_DB_TYPE = exports.DDB_DB_TYPE = void 0;
|
4
|
+
exports.DDB_DB_TYPE = 'DYNAMODB';
|
5
|
+
exports.MYSQL_DB_TYPE = 'MYSQL';
|
6
|
+
exports.POSTGRES_DB_TYPE = 'POSTGRES';
|
7
|
+
exports.DDB_DEFAULT_DATASOURCE_STRATEGY = {
|
8
|
+
dbType: exports.DDB_DB_TYPE,
|
9
|
+
provisionStrategy: 'DEFAULT',
|
10
|
+
};
|
11
|
+
exports.DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY = {
|
12
|
+
dbType: exports.DDB_DB_TYPE,
|
13
|
+
provisionStrategy: 'AMPLIFY_TABLE',
|
14
|
+
};
|
15
|
+
//# sourceMappingURL=model-datasource-strategies.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"model-datasource-strategies.js","sourceRoot":"","sources":["../../src/types/model-datasource-strategies.ts"],"names":[],"mappings":";;;AAMa,QAAA,WAAW,GAAkC,UAAU,CAAC;AAExD,QAAA,aAAa,GAAqC,OAAO,CAAC;AAE1D,QAAA,gBAAgB,GAAqC,UAAU,CAAC;AAEhE,QAAA,+BAA+B,GAA4B;IACtE,MAAM,EAAE,mBAAW;IACnB,iBAAiB,EAAE,SAAS;CAC7B,CAAC;AAEW,QAAA,uCAAuC,GAA4B;IAC9E,MAAM,EAAE,mBAAW;IACnB,iBAAiB,EAAE,eAAe;CACnC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC"}
|
@@ -1,13 +1,27 @@
|
|
1
1
|
import { DefinitionNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
2
2
|
export declare const isObjectTypeDefinitionNode: (obj: DefinitionNode) => obj is ObjectTypeDefinitionNode;
|
3
|
+
export declare const isMutationType: (typeName: string) => typeName is "Mutation";
|
4
|
+
export declare const isQueryType: (typeName: string) => typeName is "Query";
|
5
|
+
export declare const isSubscriptionType: (typeName: string) => typeName is "Subscription";
|
6
|
+
export declare const isBuiltInGraphqlType: (typeName: string) => typeName is "Mutation" | "Query" | "Subscription";
|
7
|
+
export declare const isMutationNode: (obj: DefinitionNode) => obj is ObjectTypeDefinitionNode | (InterfaceTypeDefinitionNode & {
|
8
|
+
name: {
|
9
|
+
value: 'Mutation';
|
10
|
+
};
|
11
|
+
});
|
3
12
|
export declare const isQueryNode: (obj: DefinitionNode) => obj is ObjectTypeDefinitionNode | (InterfaceTypeDefinitionNode & {
|
4
13
|
name: {
|
5
14
|
value: 'Query';
|
6
15
|
};
|
7
16
|
});
|
8
|
-
export declare const
|
17
|
+
export declare const isSubscriptionNode: (obj: DefinitionNode) => obj is ObjectTypeDefinitionNode | (InterfaceTypeDefinitionNode & {
|
9
18
|
name: {
|
10
|
-
value: '
|
19
|
+
value: 'Subscription';
|
20
|
+
};
|
21
|
+
});
|
22
|
+
export declare const isBuiltInGraphqlNode: (obj: DefinitionNode) => obj is ObjectTypeDefinitionNode | (InterfaceTypeDefinitionNode & {
|
23
|
+
name: {
|
24
|
+
value: 'Mutation' | 'Query';
|
11
25
|
};
|
12
26
|
});
|
13
27
|
export declare const fieldsWithSqlDirective: (obj: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode) => FieldDefinitionNode[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graphql-utils.d.ts","sourceRoot":"","sources":["../../src/utils/graphql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|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.fieldsWithSqlDirective = exports.
|
3
|
+
exports.fieldsWithSqlDirective = exports.isBuiltInGraphqlNode = exports.isSubscriptionNode = exports.isQueryNode = exports.isMutationNode = exports.isBuiltInGraphqlType = exports.isSubscriptionType = exports.isQueryType = exports.isMutationType = exports.isObjectTypeDefinitionNode = void 0;
|
4
4
|
const graphql_1 = require("graphql");
|
5
5
|
const SQL_DIRECTIVE_NAME = 'sql';
|
6
6
|
const isObjectTypeDefinitionNode = (obj) => {
|
7
7
|
return obj.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION || obj.kind === graphql_1.Kind.INTERFACE_TYPE_DEFINITION;
|
8
8
|
};
|
9
9
|
exports.isObjectTypeDefinitionNode = isObjectTypeDefinitionNode;
|
10
|
+
const isMutationType = (typeName) => typeName === 'Mutation';
|
11
|
+
exports.isMutationType = isMutationType;
|
12
|
+
const isQueryType = (typeName) => typeName === 'Query';
|
13
|
+
exports.isQueryType = isQueryType;
|
14
|
+
const isSubscriptionType = (typeName) => typeName === 'Subscription';
|
15
|
+
exports.isSubscriptionType = isSubscriptionType;
|
16
|
+
const isBuiltInGraphqlType = (typeName) => (0, exports.isMutationType)(typeName) || (0, exports.isQueryType)(typeName) || (0, exports.isSubscriptionType)(typeName);
|
17
|
+
exports.isBuiltInGraphqlType = isBuiltInGraphqlType;
|
18
|
+
const isMutationNode = (obj) => {
|
19
|
+
return (0, exports.isObjectTypeDefinitionNode)(obj) && (0, exports.isMutationType)(obj.name.value);
|
20
|
+
};
|
21
|
+
exports.isMutationNode = isMutationNode;
|
10
22
|
const isQueryNode = (obj) => {
|
11
|
-
return (0, exports.isObjectTypeDefinitionNode)(obj) && obj.name.value
|
23
|
+
return (0, exports.isObjectTypeDefinitionNode)(obj) && (0, exports.isQueryType)(obj.name.value);
|
12
24
|
};
|
13
25
|
exports.isQueryNode = isQueryNode;
|
14
|
-
const
|
15
|
-
return (0, exports.isObjectTypeDefinitionNode)(obj) && obj.name.value
|
26
|
+
const isSubscriptionNode = (obj) => {
|
27
|
+
return (0, exports.isObjectTypeDefinitionNode)(obj) && (0, exports.isSubscriptionType)(obj.name.value);
|
16
28
|
};
|
17
|
-
exports.
|
29
|
+
exports.isSubscriptionNode = isSubscriptionNode;
|
30
|
+
const isBuiltInGraphqlNode = (obj) => {
|
31
|
+
return (0, exports.isMutationNode)(obj) || (0, exports.isQueryNode)(obj) || (0, exports.isSubscriptionNode)(obj);
|
32
|
+
};
|
33
|
+
exports.isBuiltInGraphqlNode = isBuiltInGraphqlNode;
|
18
34
|
const fieldsWithSqlDirective = (obj) => {
|
19
35
|
var _a, _b;
|
20
36
|
return (_b = (_a = obj.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => { var _a; return (_a = field.directives) === null || _a === void 0 ? void 0 : _a.some((directive) => directive.name.value === SQL_DIRECTIVE_NAME); })) !== null && _b !== void 0 ? _b : [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graphql-utils.js","sourceRoot":"","sources":["../../src/utils/graphql-utils.ts"],"names":[],"mappings":";;;AAAA,qCAA2H;AAE3H,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAE1B,MAAM,0BAA0B,GAAG,CAAC,GAAmB,EAAmC,EAAE;IACjG,OAAO,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,sBAAsB,IAAI,GAAG,CAAC,IAAI,KAAK,cAAI,CAAC,yBAAyB,CAAC;AACjG,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC;AAEK,MAAM,WAAW,GAAG,CACzB,GAAmB,EAC6E,EAAE;IAClG,OAAO,IAAA,kCAA0B,EAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,
|
1
|
+
{"version":3,"file":"graphql-utils.js","sourceRoot":"","sources":["../../src/utils/graphql-utils.ts"],"names":[],"mappings":";;;AAAA,qCAA2H;AAE3H,MAAM,kBAAkB,GAAG,KAAK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OAAO,IAAA,kCAA0B,EAAC,GAAG,CAAC,IAAI,IAAA,0BAAkB,EAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC,CAAC;AAJW,QAAA,kBAAkB,sBAI7B;AAEK,MAAM,oBAAoB,GAAG,CAClC,GAAmB,EAC0F,EAAE;IAC/G,OAAO,IAAA,sBAAc,EAAC,GAAG,CAAC,IAAI,IAAA,mBAAW,EAAC,GAAG,CAAC,IAAI,IAAA,0BAAkB,EAAC,GAAG,CAAC,CAAC;AAC5E,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AAEK,MAAM,sBAAsB,GAAG,CAAC,GAA2D,EAAyB,EAAE;;IAC3H,OAAO,MAAA,MAAA,GAAG,CAAC,MAAM,0CAAE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,kBAAkB,CAAC,CAAA,EAAA,CAAC,mCAAI,EAAE,CAAC;AACjI,CAAC,CAAC;AAFW,QAAA,sBAAsB,0BAEjC"}
|
@@ -2,13 +2,12 @@ export { getPrimaryKeyFields } from './model-util';
|
|
2
2
|
export { DirectiveWrapper, GetArgumentsOptions, generateGetArgumentsInput } from './directive-wrapper';
|
3
3
|
export { collectDirectives, collectDirectivesByTypeNames } from './type-map-utils';
|
4
4
|
export { stripDirectives } from './strip-directives';
|
5
|
-
export { getTable, getKeySchema, getSortKeyFieldNames,
|
5
|
+
export { getTable, getKeySchema, getSortKeyFieldNames, getStrategyDbTypeFromTypeNode } from './schema-utils';
|
6
6
|
export { DEFAULT_SCHEMA_DEFINITION } from './defaultSchema';
|
7
|
-
export { getParameterStoreSecretPath
|
7
|
+
export { getParameterStoreSecretPath } from './rds-util';
|
8
8
|
export declare const APICategory = "api";
|
9
|
-
export { setResourceName, getResourceName } from './resource-name';
|
9
|
+
export { setResourceName, getDefaultStrategyNameForDbType, getResourceName, getResourceNamesForStrategy, getResourceNamesForStrategyName, SQLLambdaResourceNames, } from './resource-name';
|
10
10
|
export type { SetResourceNameProps } from './resource-name';
|
11
|
-
export { getDatasourceProvisionStrategy } from './provision-strategy-utils';
|
12
11
|
export * from './model-datasource-strategy-utils';
|
13
12
|
export * from './graphql-utils';
|
14
13
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,OAAO,EACL,eAAe,EACf,+BAA+B,EAC/B,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC"}
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.
|
17
|
+
exports.getResourceNamesForStrategyName = exports.getResourceNamesForStrategy = exports.getResourceName = exports.getDefaultStrategyNameForDbType = exports.setResourceName = exports.APICategory = exports.getParameterStoreSecretPath = exports.DEFAULT_SCHEMA_DEFINITION = exports.getStrategyDbTypeFromTypeNode = exports.getSortKeyFieldNames = exports.getKeySchema = exports.getTable = exports.stripDirectives = exports.collectDirectivesByTypeNames = exports.collectDirectives = exports.generateGetArgumentsInput = exports.DirectiveWrapper = exports.getPrimaryKeyFields = void 0;
|
18
18
|
var model_util_1 = require("./model-util");
|
19
19
|
Object.defineProperty(exports, "getPrimaryKeyFields", { enumerable: true, get: function () { return model_util_1.getPrimaryKeyFields; } });
|
20
20
|
var directive_wrapper_1 = require("./directive-wrapper");
|
@@ -29,25 +29,18 @@ var schema_utils_1 = require("./schema-utils");
|
|
29
29
|
Object.defineProperty(exports, "getTable", { enumerable: true, get: function () { return schema_utils_1.getTable; } });
|
30
30
|
Object.defineProperty(exports, "getKeySchema", { enumerable: true, get: function () { return schema_utils_1.getKeySchema; } });
|
31
31
|
Object.defineProperty(exports, "getSortKeyFieldNames", { enumerable: true, get: function () { return schema_utils_1.getSortKeyFieldNames; } });
|
32
|
-
Object.defineProperty(exports, "
|
32
|
+
Object.defineProperty(exports, "getStrategyDbTypeFromTypeNode", { enumerable: true, get: function () { return schema_utils_1.getStrategyDbTypeFromTypeNode; } });
|
33
33
|
var defaultSchema_1 = require("./defaultSchema");
|
34
34
|
Object.defineProperty(exports, "DEFAULT_SCHEMA_DEFINITION", { enumerable: true, get: function () { return defaultSchema_1.DEFAULT_SCHEMA_DEFINITION; } });
|
35
35
|
var rds_util_1 = require("./rds-util");
|
36
36
|
Object.defineProperty(exports, "getParameterStoreSecretPath", { enumerable: true, get: function () { return rds_util_1.getParameterStoreSecretPath; } });
|
37
|
-
Object.defineProperty(exports, "getModelDataSourceType", { enumerable: true, get: function () { return rds_util_1.getModelDataSourceType; } });
|
38
|
-
Object.defineProperty(exports, "isDynamoDBModel", { enumerable: true, get: function () { return rds_util_1.isDynamoDBModel; } });
|
39
|
-
Object.defineProperty(exports, "isRDSModel", { enumerable: true, get: function () { return rds_util_1.isRDSModel; } });
|
40
|
-
Object.defineProperty(exports, "isImportedRDSType", { enumerable: true, get: function () { return rds_util_1.isImportedRDSType; } });
|
41
|
-
Object.defineProperty(exports, "isRDSDBType", { enumerable: true, get: function () { return rds_util_1.isRDSDBType; } });
|
42
|
-
Object.defineProperty(exports, "constructDataSourceMap", { enumerable: true, get: function () { return rds_util_1.constructDataSourceMap; } });
|
43
|
-
Object.defineProperty(exports, "getEngineFromDBType", { enumerable: true, get: function () { return rds_util_1.getEngineFromDBType; } });
|
44
|
-
Object.defineProperty(exports, "getImportedRDSType", { enumerable: true, get: function () { return rds_util_1.getImportedRDSType; } });
|
45
37
|
exports.APICategory = 'api';
|
46
38
|
var resource_name_1 = require("./resource-name");
|
47
39
|
Object.defineProperty(exports, "setResourceName", { enumerable: true, get: function () { return resource_name_1.setResourceName; } });
|
40
|
+
Object.defineProperty(exports, "getDefaultStrategyNameForDbType", { enumerable: true, get: function () { return resource_name_1.getDefaultStrategyNameForDbType; } });
|
48
41
|
Object.defineProperty(exports, "getResourceName", { enumerable: true, get: function () { return resource_name_1.getResourceName; } });
|
49
|
-
|
50
|
-
Object.defineProperty(exports, "
|
42
|
+
Object.defineProperty(exports, "getResourceNamesForStrategy", { enumerable: true, get: function () { return resource_name_1.getResourceNamesForStrategy; } });
|
43
|
+
Object.defineProperty(exports, "getResourceNamesForStrategyName", { enumerable: true, get: function () { return resource_name_1.getResourceNamesForStrategyName; } });
|
51
44
|
__exportStar(require("./model-datasource-strategy-utils"), exports);
|
52
45
|
__exportStar(require("./graphql-utils"), exports);
|
53
46
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA;AAC5B,yDAAuG;AAA9F,qHAAA,gBAAgB,OAAA;AAAuB,8HAAA,yBAAyB,OAAA;AACzE,mDAAmF;AAA1E,mHAAA,iBAAiB,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACxD,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,+
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAmD;AAA1C,iHAAA,mBAAmB,OAAA;AAC5B,yDAAuG;AAA9F,qHAAA,gBAAgB,OAAA;AAAuB,8HAAA,yBAAyB,OAAA;AACzE,mDAAmF;AAA1E,mHAAA,iBAAiB,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACxD,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,+CAA6G;AAApG,wGAAA,QAAQ,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,oHAAA,oBAAoB,OAAA;AAAE,6HAAA,6BAA6B,OAAA;AACpF,iDAA4D;AAAnD,0HAAA,yBAAyB,OAAA;AAClC,uCAAyD;AAAhD,uHAAA,2BAA2B,OAAA;AACvB,QAAA,WAAW,GAAG,KAAK,CAAC;AACjC,iDAOyB;AANvB,gHAAA,eAAe,OAAA;AACf,gIAAA,+BAA+B,OAAA;AAC/B,gHAAA,eAAe,OAAA;AACf,4HAAA,2BAA2B,OAAA;AAC3B,gIAAA,+BAA+B,OAAA;AAIjC,oEAAkD;AAClD,kDAAgC"}
|
@@ -1,11 +1,14 @@
|
|
1
|
-
import { AmplifyDynamoDbModelDataSourceStrategy,
|
2
|
-
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
1
|
+
import { AmplifyDynamoDbModelDataSourceStrategy, DataSourceStrategiesProvider, DefaultDynamoDbModelDataSourceStrategy, ModelDataSourceStrategy, ModelDataSourceStrategyDbType, ModelDataSourceStrategySqlDbType, SQLLambdaModelDataSourceStrategy } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { ImportedRDSType } from '../types';
|
3
|
+
export declare const getModelDataSourceNameForTypeName: (ctx: DataSourceStrategiesProvider, typeName: string) => string;
|
4
|
+
export declare const getImportedRDSTypeFromStrategyDbType: (dbType: ModelDataSourceStrategyDbType) => ImportedRDSType;
|
5
|
+
export declare const getModelDataSourceStrategy: (ctx: DataSourceStrategiesProvider, typename: string) => ModelDataSourceStrategy;
|
6
6
|
export declare const isAmplifyDynamoDbModelDataSourceStrategy: (strategy: ModelDataSourceStrategy) => strategy is AmplifyDynamoDbModelDataSourceStrategy;
|
7
|
-
export declare const
|
7
|
+
export declare const isDefaultDynamoDbModelDataSourceStrategy: (strategy: ModelDataSourceStrategy) => strategy is DefaultDynamoDbModelDataSourceStrategy;
|
8
|
+
export declare const isDynamoDbModel: (ctx: DataSourceStrategiesProvider, typename: string) => boolean;
|
9
|
+
export declare const isDynamoDbType: (dbType: ModelDataSourceStrategyDbType) => dbType is "DYNAMODB";
|
10
|
+
export declare const isSqlDbType: (dbType: ModelDataSourceStrategyDbType) => dbType is ModelDataSourceStrategySqlDbType;
|
11
|
+
export declare const isSqlModel: (ctx: DataSourceStrategiesProvider, typename: string) => boolean;
|
8
12
|
export declare const isSqlStrategy: (strategy: ModelDataSourceStrategy) => strategy is SQLLambdaModelDataSourceStrategy;
|
9
|
-
export declare const
|
10
|
-
export declare const normalizeDbType: (candidate: string) => DBType;
|
13
|
+
export declare const normalizeDbType: (candidate: string) => ModelDataSourceStrategyDbType;
|
11
14
|
//# sourceMappingURL=model-datasource-strategy-utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"model-datasource-strategy-utils.d.ts","sourceRoot":"","sources":["../../src/utils/model-datasource-strategy-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,
|
1
|
+
{"version":3,"file":"model-datasource-strategy-utils.d.ts","sourceRoot":"","sources":["../../src/utils/model-datasource-strategy-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC5B,sCAAsC,EACtC,uBAAuB,EACvB,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAe,eAAe,EAAmC,MAAM,UAAU,CAAC;AAYzF,eAAO,MAAM,iCAAiC,QAAS,4BAA4B,YAAY,MAAM,KAAG,MAUvG,CAAC;AAMF,eAAO,MAAM,oCAAoC,WAAY,6BAA6B,KAAG,eAS5F,CAAC;AAQF,eAAO,MAAM,0BAA0B,QAAS,4BAA4B,YAAY,MAAM,KAAG,uBAMhG,CAAC;AAKF,eAAO,MAAM,wCAAwC,aACzC,uBAAuB,uDAOlC,CAAC;AAKF,eAAO,MAAM,wCAAwC,aACzC,uBAAuB,uDAOlC,CAAC;AAQF,eAAO,MAAM,eAAe,QAAS,4BAA4B,YAAY,MAAM,KAAG,OAMrF,CAAC;AAKF,eAAO,MAAM,cAAc,WAAY,6BAA6B,yBAEnE,CAAC;AAKF,eAAO,MAAM,WAAW,WAAY,6BAA6B,+CAEhE,CAAC;AAQF,eAAO,MAAM,UAAU,QAAS,4BAA4B,YAAY,MAAM,KAAG,OAMhF,CAAC;AAKF,eAAO,MAAM,aAAa,aAAc,uBAAuB,iDAI9D,CAAC;AAeF,eAAO,MAAM,eAAe,cAAe,MAAM,KAAG,6BAenD,CAAC"}
|
@@ -1,81 +1,93 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.normalizeDbType = exports.
|
4
|
-
const
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
};
|
14
|
-
case 'AMPLIFY_TABLE':
|
15
|
-
return {
|
16
|
-
dbType: 'DDB',
|
17
|
-
provisionDB: true,
|
18
|
-
provisionStrategy: "AMPLIFY_TABLE",
|
19
|
-
};
|
20
|
-
default:
|
21
|
-
throw new Error(`Encountered unexpected provision strategy: ${dataSourceStrategy.provisionStrategy}`);
|
22
|
-
}
|
3
|
+
exports.normalizeDbType = exports.isSqlStrategy = exports.isSqlModel = exports.isSqlDbType = exports.isDynamoDbType = exports.isDynamoDbModel = exports.isDefaultDynamoDbModelDataSourceStrategy = exports.isAmplifyDynamoDbModelDataSourceStrategy = exports.getModelDataSourceStrategy = exports.getImportedRDSTypeFromStrategyDbType = exports.getModelDataSourceNameForTypeName = void 0;
|
4
|
+
const types_1 = require("../types");
|
5
|
+
const graphql_utils_1 = require("./graphql-utils");
|
6
|
+
const resource_name_1 = require("./resource-name");
|
7
|
+
const getModelDataSourceNameForTypeName = (ctx, typeName) => {
|
8
|
+
let dataSourceName;
|
9
|
+
const strategy = (0, exports.getModelDataSourceStrategy)(ctx, typeName);
|
10
|
+
if ((0, exports.isSqlStrategy)(strategy)) {
|
11
|
+
const resourceNames = (0, resource_name_1.getResourceNamesForStrategy)(strategy);
|
12
|
+
dataSourceName = resourceNames.sqlLambdaDataSource;
|
23
13
|
}
|
24
|
-
else
|
25
|
-
|
26
|
-
dbType: (0, exports.convertSQLDBType)(dataSourceStrategy.dbType),
|
27
|
-
provisionDB: false,
|
28
|
-
provisionStrategy: "DEFAULT",
|
29
|
-
};
|
14
|
+
else {
|
15
|
+
dataSourceName = `${typeName}Table`;
|
30
16
|
}
|
31
|
-
|
17
|
+
return dataSourceName;
|
32
18
|
};
|
33
|
-
exports.
|
34
|
-
const
|
35
|
-
|
36
|
-
|
37
|
-
|
19
|
+
exports.getModelDataSourceNameForTypeName = getModelDataSourceNameForTypeName;
|
20
|
+
const getImportedRDSTypeFromStrategyDbType = (dbType) => {
|
21
|
+
switch (dbType) {
|
22
|
+
case types_1.MYSQL_DB_TYPE:
|
23
|
+
return types_1.ImportedRDSType.MYSQL;
|
24
|
+
case types_1.POSTGRES_DB_TYPE:
|
25
|
+
return types_1.ImportedRDSType.POSTGRESQL;
|
26
|
+
default:
|
27
|
+
throw new Error(`Unsupported RDS datasource type: ${dbType}`);
|
28
|
+
}
|
38
29
|
};
|
39
|
-
exports.
|
40
|
-
const
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
exports.getImportedRDSTypeFromStrategyDbType = getImportedRDSTypeFromStrategyDbType;
|
31
|
+
const getModelDataSourceStrategy = (ctx, typename) => {
|
32
|
+
const strategy = ctx.dataSourceStrategies[typename];
|
33
|
+
if (!strategy) {
|
34
|
+
throw new Error(`Cannot find datasource type for model ${typename}`);
|
35
|
+
}
|
36
|
+
return strategy;
|
44
37
|
};
|
45
|
-
exports.
|
38
|
+
exports.getModelDataSourceStrategy = getModelDataSourceStrategy;
|
46
39
|
const isAmplifyDynamoDbModelDataSourceStrategy = (strategy) => {
|
47
|
-
return ((0, exports.
|
40
|
+
return ((0, exports.isDynamoDbType)(strategy.dbType) &&
|
48
41
|
typeof strategy['provisionStrategy'] === 'string' &&
|
49
42
|
strategy['provisionStrategy'] === 'AMPLIFY_TABLE');
|
50
43
|
};
|
51
44
|
exports.isAmplifyDynamoDbModelDataSourceStrategy = isAmplifyDynamoDbModelDataSourceStrategy;
|
52
|
-
const
|
45
|
+
const isDefaultDynamoDbModelDataSourceStrategy = (strategy) => {
|
46
|
+
return ((0, exports.isDynamoDbType)(strategy.dbType) &&
|
47
|
+
typeof strategy['provisionStrategy'] === 'string' &&
|
48
|
+
strategy['provisionStrategy'] === 'DEFAULT');
|
49
|
+
};
|
50
|
+
exports.isDefaultDynamoDbModelDataSourceStrategy = isDefaultDynamoDbModelDataSourceStrategy;
|
51
|
+
const isDynamoDbModel = (ctx, typename) => {
|
52
|
+
if ((0, graphql_utils_1.isBuiltInGraphqlType)(typename)) {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
const modelDataSourceType = (0, exports.getModelDataSourceStrategy)(ctx, typename);
|
56
|
+
return (0, exports.isDynamoDbType)(modelDataSourceType.dbType);
|
57
|
+
};
|
58
|
+
exports.isDynamoDbModel = isDynamoDbModel;
|
59
|
+
const isDynamoDbType = (dbType) => {
|
53
60
|
return dbType === 'DYNAMODB';
|
54
61
|
};
|
55
|
-
exports.
|
62
|
+
exports.isDynamoDbType = isDynamoDbType;
|
63
|
+
const isSqlDbType = (dbType) => {
|
64
|
+
return [types_1.MYSQL_DB_TYPE, types_1.POSTGRES_DB_TYPE].includes(dbType);
|
65
|
+
};
|
66
|
+
exports.isSqlDbType = isSqlDbType;
|
67
|
+
const isSqlModel = (ctx, typename) => {
|
68
|
+
if ((0, graphql_utils_1.isBuiltInGraphqlType)(typename)) {
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
const modelDataSourceType = (0, exports.getModelDataSourceStrategy)(ctx, typename);
|
72
|
+
return (0, exports.isSqlDbType)(modelDataSourceType.dbType);
|
73
|
+
};
|
74
|
+
exports.isSqlModel = isSqlModel;
|
56
75
|
const isSqlStrategy = (strategy) => {
|
57
|
-
return ((0, exports.
|
58
|
-
typeof strategy.name === 'string' &&
|
59
|
-
typeof strategy.dbConnectionConfig === 'object');
|
76
|
+
return ((0, exports.isSqlDbType)(strategy.dbType) && typeof strategy.name === 'string' && typeof strategy.dbConnectionConfig === 'object');
|
60
77
|
};
|
61
78
|
exports.isSqlStrategy = isSqlStrategy;
|
62
|
-
const isSqlModelDataSourceDbType = (dbType) => {
|
63
|
-
const validDbTypes = ['MYSQL', 'POSTGRES'];
|
64
|
-
return validDbTypes.includes(dbType);
|
65
|
-
};
|
66
|
-
exports.isSqlModelDataSourceDbType = isSqlModelDataSourceDbType;
|
67
79
|
const normalizeDbType = (candidate) => {
|
68
80
|
switch (candidate.toLowerCase()) {
|
69
81
|
case 'mysql':
|
70
|
-
return
|
82
|
+
return types_1.MYSQL_DB_TYPE;
|
71
83
|
case 'ddb':
|
72
84
|
case 'dynamodb':
|
73
85
|
case 'dynamo_db':
|
74
|
-
return
|
86
|
+
return types_1.DDB_DB_TYPE;
|
75
87
|
case 'pg':
|
76
88
|
case 'postgres':
|
77
89
|
case 'postgresql':
|
78
|
-
return
|
90
|
+
return types_1.POSTGRES_DB_TYPE;
|
79
91
|
default:
|
80
92
|
throw new Error(`Unknown database type ${candidate}`);
|
81
93
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"model-datasource-strategy-utils.js","sourceRoot":"","sources":["../../src/utils/model-datasource-strategy-utils.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"model-datasource-strategy-utils.js","sourceRoot":"","sources":["../../src/utils/model-datasource-strategy-utils.ts"],"names":[],"mappings":";;;AASA,oCAAyF;AACzF,mDAAuD;AACvD,mDAA8D;AAUvD,MAAM,iCAAiC,GAAG,CAAC,GAAiC,EAAE,QAAgB,EAAU,EAAE;IAC/G,IAAI,cAAsB,CAAC;IAC3B,MAAM,QAAQ,GAAG,IAAA,kCAA0B,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC3D,IAAI,IAAA,qBAAa,EAAC,QAAQ,CAAC,EAAE;QAC3B,MAAM,aAAa,GAAG,IAAA,2CAA2B,EAAC,QAAQ,CAAC,CAAC;QAC5D,cAAc,GAAG,aAAa,CAAC,mBAAmB,CAAC;KACpD;SAAM;QACL,cAAc,GAAG,GAAG,QAAQ,OAAO,CAAC;KACrC;IACD,OAAO,cAAc,CAAC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AG,CAAC,SAAiB,EAAiC,EAAE;IAClF,QAAQ,SAAS,CAAC,WAAW,EAAE,EAAE;QAC/B,KAAK,OAAO;YACV,OAAO,qBAAa,CAAC;QACvB,KAAK,KAAK,CAAC;QACX,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,mBAAW,CAAC;QACrB,KAAK,IAAI,CAAC;QACV,KAAK,UAAU,CAAC;QAChB,KAAK,YAAY;YACf,OAAO,wBAAgB,CAAC;QAC1B;YACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;KACzD;AACH,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
|
@@ -1,12 +1,2 @@
|
|
1
|
-
import { DataSourceType, DBType, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
-
import { ImportedRDSType } from '../types';
|
3
1
|
export declare const getParameterStoreSecretPath: (secret: string, secretsKey: string, apiName: string, environmentName: string, appId: string) => string;
|
4
|
-
export declare const getModelDataSourceType: (ctx: TransformerContextProvider, typename: string) => DBType;
|
5
|
-
export declare const isDynamoDBModel: (ctx: TransformerContextProvider, typename: string) => boolean;
|
6
|
-
export declare const isRDSModel: (ctx: TransformerContextProvider, typename: string) => boolean;
|
7
|
-
export declare const isImportedRDSType: (dbInfo: DataSourceType) => boolean;
|
8
|
-
export declare const isRDSDBType: (dbType: DBType) => boolean;
|
9
|
-
export declare const constructDataSourceMap: (schema: string, datasourceType: DataSourceType) => Map<string, DataSourceType>;
|
10
|
-
export declare const getEngineFromDBType: (dbType: DBType) => ImportedRDSType;
|
11
|
-
export declare const getImportedRDSType: (modelToDatasourceMap: Map<string, DataSourceType>) => DBType;
|
12
2
|
//# sourceMappingURL=rds-util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rds-util.d.ts","sourceRoot":"","sources":["../../src/utils/rds-util.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"rds-util.d.ts","sourceRoot":"","sources":["../../src/utils/rds-util.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,2BAA2B,WAC9B,MAAM,cACF,MAAM,WACT,MAAM,mBACE,MAAM,SAChB,MAAM,KACZ,MAWF,CAAC"}
|
@@ -3,12 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
6
|
+
exports.getParameterStoreSecretPath = void 0;
|
7
7
|
const path_1 = __importDefault(require("path"));
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
9
|
-
const graphql_1 = require("graphql");
|
10
|
-
const types_1 = require("../types");
|
11
|
-
const types_2 = require("../types");
|
12
9
|
const api_category_1 = require("./api-category");
|
13
10
|
const getParameterNameForDBSecret = (secret, secretsKey) => {
|
14
11
|
return `${secretsKey}_${secret}`;
|
@@ -25,58 +22,4 @@ const getParameterStoreSecretPath = (secret, secretsKey, apiName, environmentNam
|
|
25
22
|
return path_1.default.posix.join('/amplify', appId, environmentName, `AMPLIFY_${categoryName}${apiName}${paramName}`);
|
26
23
|
};
|
27
24
|
exports.getParameterStoreSecretPath = getParameterStoreSecretPath;
|
28
|
-
const getModelDataSourceType = (ctx, typename) => {
|
29
|
-
const config = ctx.modelToDatasourceMap.get(typename);
|
30
|
-
return (config === null || config === void 0 ? void 0 : config.dbType) || types_1.DDB_DB_TYPE;
|
31
|
-
};
|
32
|
-
exports.getModelDataSourceType = getModelDataSourceType;
|
33
|
-
const isDynamoDBModel = (ctx, typename) => {
|
34
|
-
return (0, exports.getModelDataSourceType)(ctx, typename) === types_1.DDB_DB_TYPE;
|
35
|
-
};
|
36
|
-
exports.isDynamoDBModel = isDynamoDBModel;
|
37
|
-
const isRDSModel = (ctx, typename) => {
|
38
|
-
const modelDataSourceType = (0, exports.getModelDataSourceType)(ctx, typename);
|
39
|
-
return [types_1.MYSQL_DB_TYPE, types_1.POSTGRES_DB_TYPE].includes(modelDataSourceType);
|
40
|
-
};
|
41
|
-
exports.isRDSModel = isRDSModel;
|
42
|
-
const isImportedRDSType = (dbInfo) => {
|
43
|
-
return (0, exports.isRDSDBType)(dbInfo === null || dbInfo === void 0 ? void 0 : dbInfo.dbType) && !(dbInfo === null || dbInfo === void 0 ? void 0 : dbInfo.provisionDB);
|
44
|
-
};
|
45
|
-
exports.isImportedRDSType = isImportedRDSType;
|
46
|
-
const isRDSDBType = (dbType) => {
|
47
|
-
return [types_1.MYSQL_DB_TYPE, types_1.POSTGRES_DB_TYPE].includes(dbType);
|
48
|
-
};
|
49
|
-
exports.isRDSDBType = isRDSDBType;
|
50
|
-
const constructDataSourceMap = (schema, datasourceType) => {
|
51
|
-
const parsedSchema = (0, graphql_1.parse)(schema);
|
52
|
-
const result = new Map();
|
53
|
-
parsedSchema.definitions
|
54
|
-
.filter((obj) => { var _a; return obj.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION && ((_a = obj.directives) === null || _a === void 0 ? void 0 : _a.some((dir) => dir.name.value === 'model')); })
|
55
|
-
.forEach((type) => {
|
56
|
-
result.set(type.name.value, datasourceType);
|
57
|
-
});
|
58
|
-
return result;
|
59
|
-
};
|
60
|
-
exports.constructDataSourceMap = constructDataSourceMap;
|
61
|
-
const getEngineFromDBType = (dbType) => {
|
62
|
-
switch (dbType) {
|
63
|
-
case types_1.MYSQL_DB_TYPE:
|
64
|
-
return types_2.ImportedRDSType.MYSQL;
|
65
|
-
case types_1.POSTGRES_DB_TYPE:
|
66
|
-
return types_2.ImportedRDSType.POSTGRESQL;
|
67
|
-
default:
|
68
|
-
throw new Error(`Unsupported RDS datasource type: ${dbType}`);
|
69
|
-
}
|
70
|
-
};
|
71
|
-
exports.getEngineFromDBType = getEngineFromDBType;
|
72
|
-
const getImportedRDSType = (modelToDatasourceMap) => {
|
73
|
-
var _a;
|
74
|
-
const datasourceMapValues = Array.from(modelToDatasourceMap === null || modelToDatasourceMap === void 0 ? void 0 : modelToDatasourceMap.values());
|
75
|
-
const dbTypes = new Set((_a = datasourceMapValues === null || datasourceMapValues === void 0 ? void 0 : datasourceMapValues.filter((value) => (0, exports.isImportedRDSType)(value))) === null || _a === void 0 ? void 0 : _a.map((value) => value === null || value === void 0 ? void 0 : value.dbType));
|
76
|
-
if (dbTypes.size > 1) {
|
77
|
-
throw new Error(`Multiple imported SQL datasource types ${Array.from(dbTypes)} are detected. Only one type is supported.`);
|
78
|
-
}
|
79
|
-
return dbTypes.values().next().value;
|
80
|
-
};
|
81
|
-
exports.getImportedRDSType = getImportedRDSType;
|
82
25
|
//# sourceMappingURL=rds-util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rds-util.js","sourceRoot":"","sources":["../../src/utils/rds-util.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAAuB;AACvB,
|
1
|
+
{"version":3,"file":"rds-util.js","sourceRoot":"","sources":["../../src/utils/rds-util.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAAuB;AACvB,iDAA6C;AAE7C,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,UAAkB,EAAU,EAAE;IACjF,OAAO,GAAG,UAAU,IAAI,MAAM,EAAE,CAAC;AACnC,CAAC,CAAC;AAMK,MAAM,2BAA2B,GAAG,CACzC,MAAc,EACd,UAAkB,EAClB,OAAe,EACf,eAAuB,EACvB,KAAa,EACL,EAAE;IACV,IAAI,gBAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;KAC9C;IACD,MAAM,YAAY,GAAG,0BAAW,CAAC;IACjC,MAAM,SAAS,GAAG,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAElE,IAAI,CAAC,eAAe,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACpF;IACD,OAAO,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,YAAY,GAAG,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC;AAC9G,CAAC,CAAC;AAjBW,QAAA,2BAA2B,+BAiBtC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ModelDataSourceStrategySqlDbType, SQLLambdaModelDataSourceStrategy } from '@aws-amplify/graphql-transformer-interfaces';
|
1
2
|
import { Construct } from 'constructs';
|
2
3
|
export type SetResourceNameProps = {
|
3
4
|
name: string;
|
@@ -5,4 +6,25 @@ export type SetResourceNameProps = {
|
|
5
6
|
};
|
6
7
|
export declare const setResourceName: (scope: Construct, { name, setOnDefaultChild }: SetResourceNameProps) => void;
|
7
8
|
export declare const getResourceName: (scope: Construct) => string | undefined;
|
9
|
+
export interface SQLLambdaResourceNames {
|
10
|
+
sqlLambdaAliasLogicalId: string;
|
11
|
+
sqlLambdaAliasName: string;
|
12
|
+
sqlLambdaDataSource: string;
|
13
|
+
sqlLambdaExecutionRole: string;
|
14
|
+
sqlLambdaLayerVersion: string;
|
15
|
+
sqlLambdaExecutionRolePolicy: string;
|
16
|
+
sqlLambdaFunction: string;
|
17
|
+
sqlLayerVersionMapping: string;
|
18
|
+
sqlLayerVersionResolverCustomResource: string;
|
19
|
+
sqlPatchingLambdaExecutionRole: string;
|
20
|
+
sqlPatchingLambdaExecutionRolePolicy: string;
|
21
|
+
sqlPatchingLambdaFunction: string;
|
22
|
+
sqlPatchingSubscription: string;
|
23
|
+
sqlPatchingTopic: string;
|
24
|
+
sqlStack: string;
|
25
|
+
sqlVpcEndpointPrefix: string;
|
26
|
+
}
|
27
|
+
export declare const getDefaultStrategyNameForDbType: (dbType: ModelDataSourceStrategySqlDbType) => string;
|
28
|
+
export declare const getResourceNamesForStrategy: (strategy: SQLLambdaModelDataSourceStrategy) => SQLLambdaResourceNames;
|
29
|
+
export declare const getResourceNamesForStrategyName: (strategyName: string) => SQLLambdaResourceNames;
|
8
30
|
//# sourceMappingURL=resource-name.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource-name.d.ts","sourceRoot":"","sources":["../../src/utils/resource-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"resource-name.d.ts","sourceRoot":"","sources":["../../src/utils/resource-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AACjI,OAAO,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAKtD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAQF,eAAO,MAAM,eAAe,UAAW,SAAS,+BAA+B,oBAAoB,KAAG,IAKrG,CAAC;AAsBF,eAAO,MAAM,eAAe,UAAW,SAAS,KAAG,MAAM,GAAG,SAI3D,CAAC;AAKF,MAAM,WAAW,sBAAsB;IAErC,uBAAuB,EAAE,MAAM,CAAC;IAOhC,kBAAkB,EAAE,MAAM,CAAC;IAG3B,mBAAmB,EAAE,MAAM,CAAC;IAG5B,sBAAsB,EAAE,MAAM,CAAC;IAG/B,qBAAqB,EAAE,MAAM,CAAC;IAM9B,4BAA4B,EAAE,MAAM,CAAC;IAGrC,iBAAiB,EAAE,MAAM,CAAC;IAM1B,sBAAsB,EAAE,MAAM,CAAC;IAG/B,qCAAqC,EAAE,MAAM,CAAC;IAG9C,8BAA8B,EAAE,MAAM,CAAC;IAMvC,oCAAoC,EAAE,MAAM,CAAC;IAM7C,yBAAyB,EAAE,MAAM,CAAC;IAGlC,uBAAuB,EAAE,MAAM,CAAC;IAGhC,gBAAgB,EAAE,MAAM,CAAC;IAGzB,QAAQ,EAAE,MAAM,CAAC;IAMjB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAKD,eAAO,MAA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