@aws-amplify/graphql-api-construct 1.3.0-rds-5.0 → 1.4.0-construct-publish-test.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +774 -465
- package/API.md +67 -28
- package/CHANGELOG.md +19 -3
- package/README.md +1039 -401
- package/lib/amplify-dynamodb-table-wrapper.d.ts +128 -0
- package/lib/amplify-dynamodb-table-wrapper.js +102 -0
- package/lib/amplify-graphql-api.d.ts +4 -6
- package/lib/amplify-graphql-api.js +12 -61
- package/lib/amplify-graphql-definition.d.ts +19 -13
- package/lib/amplify-graphql-definition.js +58 -21
- package/lib/index.d.ts +2 -1
- package/lib/index.js +5 -2
- package/lib/internal/authorization-modes.js +20 -2
- package/lib/internal/construct-exports.js +8 -1
- package/lib/internal/data-source-config.d.ts +7 -0
- package/lib/internal/data-source-config.js +37 -0
- package/lib/internal/index.d.ts +1 -1
- package/lib/internal/index.js +2 -2
- package/lib/internal/model-type-name.d.ts +8 -0
- package/lib/internal/model-type-name.js +27 -0
- package/lib/types.d.ts +52 -102
- package/lib/types.js +1 -1
- package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +8 -9
- package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +16 -18
- package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +11 -16
- package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +23 -19
- package/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +12 -1
- package/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +38 -60
- package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +16 -14
- package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +7 -9
- package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +5 -0
- package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +8 -9
- package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +5 -0
- package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +10 -11
- package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +8 -9
- package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +10 -12
- package/node_modules/@aws-amplify/backend-output-schemas/package.json +4 -23
- package/node_modules/@aws-amplify/backend-output-storage/lib/index.d.ts +1 -0
- package/node_modules/@aws-amplify/backend-output-storage/lib/index.js +17 -14
- package/node_modules/@aws-amplify/backend-output-storage/lib/stack_metadata_output_storage_strategy.js +28 -32
- package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.d.ts +50 -0
- package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.js +104 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
- package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/package.json +23 -0
- package/node_modules/@aws-amplify/backend-output-storage/package.json +6 -4
- package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +1 -5
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -12
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts +1 -3
- 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 +50 -64
- 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/{vtl-generator/ddb/resolvers → resolvers}/field.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/field.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/helpers.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/helpers.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.create.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.create.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.delete.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.delete.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.update.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.update.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts +6 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/query.js +3 -28
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/search.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/search.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/rds/resolvers/subscription.d.ts → resolvers/subscriptions.d.ts} +2 -2
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/subscriptions.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js +0 -3
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts +2 -3
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +1 -4
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +11 -11
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +5 -3
- 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 +1 -13
- 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 +8 -8
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-index-transformer/API.md +3 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +6 -4
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js +4 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js.map +1 -1
- 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 +2 -2
- 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/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js +2 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js +1 -4
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +5 -6
- 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 +43 -26
- 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 +8 -8
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/API.md +0 -15
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -8
- 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/field-mapping-resolvers.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js +1 -13
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts +1 -2
- 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 +33 -16
- 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/index.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js +1 -3
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +13 -13
- package/node_modules/@aws-amplify/graphql-model-transformer/API.md +15 -15
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +5 -13
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts +2 -1
- 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 +58 -66
- 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/graphql-types/mutation.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js +2 -9
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.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/generators/dynamodb-vtl-generator.d.ts +5 -6
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts +5 -6
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js +11 -11
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts +5 -6
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts +3 -4
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js +55 -74
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts +1 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js +2 -8
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +3 -10
- 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 +42 -127
- 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/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +15 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +169 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +40 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +242 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +12 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +663 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts +5 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js +47 -60
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +5 -5
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +0 -1
- 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 +1 -28
- 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 +11 -9
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +7 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +6 -5
- 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 +9 -41
- 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 +8 -35
- 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.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +8 -30
- 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 +2 -3
- 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/resolvers.d.ts +4 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +164 -24
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js +8 -14
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +0 -5
- 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 +1 -85
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +10 -10
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +5 -3
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +0 -3
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +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 +8 -8
- package/node_modules/@aws-amplify/graphql-transformer/API.md +2 -3
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +5 -8
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +3 -4
- 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 +1 -5
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +14 -15
- package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +5 -15
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +7 -39
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +7 -12
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js +2 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +4 -4
- 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 +3 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +1 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts +1 -0
- 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 +3 -1
- 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 +3 -2
- 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 +3 -2
- 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 +2 -4
- 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 +2 -1
- 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 +12 -1
- 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 +4 -6
- 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 +1 -2
- 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 +2 -3
- 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 +1 -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 +1 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.js +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +3 -3
- 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 -14
- 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/provision-strategy-utils.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js +15 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js +25 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +1 -3
- 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 +1 -7
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +17 -12
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +8 -5
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +2 -5
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.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 +2 -1
- 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 +2 -3
- 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 +8 -2
- 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 +6 -1
- 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 +2 -2
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +16 -17
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +3 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +2 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +18 -10
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
- package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
- package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
- package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
- package/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
- package/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
- package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
- package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
- package/node_modules/@aws-amplify/platform-core/package.json +24 -0
- package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.d.ts +4 -0
- package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.d.ts +9 -0
- package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts +42 -0
- package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_output.d.ts +6 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_output.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts +13 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.d.ts +8 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.d.ts +7 -0
- package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/construct_container.d.ts +26 -0
- package/node_modules/@aws-amplify/plugin-types/lib/construct_container.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.d.ts +21 -0
- package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts +5 -0
- package/node_modules/@aws-amplify/plugin-types/lib/function_resources.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.d.ts +14 -0
- package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/index.d.ts +16 -0
- package/node_modules/@aws-amplify/plugin-types/lib/index.js +32 -0
- package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.d.ts +11 -0
- package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.d.ts +8 -0
- package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.d.ts +7 -0
- package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.d.ts +25 -0
- package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.js +3 -0
- package/node_modules/@aws-amplify/plugin-types/package.json +20 -0
- package/node_modules/graphql-mapping-template/CHANGELOG.md +0 -4
- package/node_modules/graphql-mapping-template/package.json +2 -3
- package/node_modules/graphql-transformer-common/API.md +3 -21
- package/node_modules/graphql-transformer-common/CHANGELOG.md +2 -7
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +3 -0
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +3 -0
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
- package/node_modules/graphql-transformer-common/lib/definition.d.ts +2 -9
- package/node_modules/graphql-transformer-common/lib/definition.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/definition.js +1 -52
- package/node_modules/graphql-transformer-common/lib/definition.js.map +1 -1
- package/node_modules/graphql-transformer-common/lib/util.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/util.js +1 -3
- package/node_modules/graphql-transformer-common/lib/util.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +6 -6
- package/package.json +25 -27
- package/src/amplify-dynamodb-table-wrapper.ts +177 -0
- package/src/amplify-graphql-api.ts +14 -76
- package/src/amplify-graphql-definition.ts +60 -20
- package/src/index.ts +13 -6
- package/src/internal/authorization-modes.ts +22 -1
- package/src/internal/construct-exports.ts +7 -0
- package/src/internal/data-source-config.ts +39 -0
- package/src/internal/index.ts +1 -1
- package/src/internal/model-type-name.ts +30 -0
- package/src/types.ts +59 -118
- package/babel.config.js +0 -13
- package/lib/internal/amplify-metadata.d.ts +0 -6
- package/lib/internal/amplify-metadata.js +0 -58
- package/lib/sql-model-datasource-binding.d.ts +0 -20
- package/lib/sql-model-datasource-binding.js +0 -42
- package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.d.ts +0 -3
- package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.js +0 -27
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts +0 -20
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js +0 -24
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts +0 -6
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts +0 -3
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts +0 -20
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js +0 -24
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts +0 -13
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js +0 -157
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts +0 -5
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js +0 -21
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts +0 -8
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js +0 -56
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts +0 -8
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +0 -41
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js +0 -18
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts +0 -19
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js +0 -3
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts +0 -10
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js +0 -102
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts +0 -13
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +0 -81
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts +0 -13
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +0 -171
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js +0 -18
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts +0 -8
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js +0 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts +0 -14
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +0 -115
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/API.md +0 -26
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +0 -10
- package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +0 -201
- package/node_modules/@aws-amplify/graphql-sql-transformer/README.md +0 -13
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts +0 -12
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +0 -132
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts +0 -2
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js +0 -6
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +0 -71
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts +0 -6
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.js +0 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts +0 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js +0 -5
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts +0 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js +0 -19
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +0 -14
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +0 -82
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +0 -1
- package/node_modules/graphql-mapping-template/LICENSE +0 -201
- package/remove-module-type-from-package-json.ts +0 -19
- package/src/internal/amplify-metadata.ts +0 -58
- package/src/sql-model-datasource-binding.ts +0 -45
- /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/index.d.ts +0 -0
- /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/index.js +0 -0
package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generateAuthExpressionForRelationQuery = exports.generateFieldAuthResponse = exports.generateAuthExpressionForField = exports.generateAuthExpressionForQueries = void 0;
|
4
|
-
const graphql_mapping_template_1 = require("graphql-mapping-template");
|
5
|
-
const graphql_model_transformer_1 = require("@aws-amplify/graphql-model-transformer");
|
6
|
-
const common_1 = require("./common");
|
7
|
-
const generateAuthExpressionForQueries = (ctx, providers, roles, fields, def, indexName) => {
|
8
|
-
const expressions = [];
|
9
|
-
expressions.push((0, graphql_mapping_template_1.compoundExpression)((0, common_1.generateAuthRulesFromRoles)(roles, fields, providers.hasIdentityPoolId, true)));
|
10
|
-
expressions.push((0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('authResult'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.authRules.queryAuth'), (0, graphql_mapping_template_1.ref)('authRules'))));
|
11
|
-
expressions.push((0, common_1.validateAuthResult)(), (0, common_1.constructAuthFilter)(), common_1.emptyPayload);
|
12
|
-
return (0, graphql_mapping_template_1.printBlock)('Authorization rules')((0, graphql_mapping_template_1.compoundExpression)(expressions));
|
13
|
-
};
|
14
|
-
exports.generateAuthExpressionForQueries = generateAuthExpressionForQueries;
|
15
|
-
const generateAuthExpressionForField = (providers, roles, fields, fieldName = undefined) => {
|
16
|
-
const expressions = [];
|
17
|
-
expressions.push((0, graphql_mapping_template_1.compoundExpression)((0, common_1.generateAuthRulesFromRoles)(roles, fields, providers.hasIdentityPoolId, true)));
|
18
|
-
expressions.push((0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('authResult'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.authRules.queryAuth'), (0, graphql_mapping_template_1.ref)('authRules'))));
|
19
|
-
expressions.push((0, common_1.validateAuthResult)(), common_1.emptyPayload);
|
20
|
-
return (0, graphql_mapping_template_1.printBlock)('Authorization rules')((0, graphql_mapping_template_1.compoundExpression)(expressions));
|
21
|
-
};
|
22
|
-
exports.generateAuthExpressionForField = generateAuthExpressionForField;
|
23
|
-
const generateFieldAuthResponse = (operation, fieldName, subscriptionsEnabled) => {
|
24
|
-
if (subscriptionsEnabled) {
|
25
|
-
return (0, graphql_mapping_template_1.printBlock)('Checking for allowed operations which can return this field')((0, graphql_mapping_template_1.compoundExpression)([
|
26
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('operation'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.defaultIfNull'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('ctx.source.get'), (0, graphql_mapping_template_1.str)(graphql_model_transformer_1.OPERATION_KEY)), (0, graphql_mapping_template_1.nul)())),
|
27
|
-
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('operation'), (0, graphql_mapping_template_1.str)(operation)), (0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.nul)()), (0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)(`context.source["${fieldName}"]`))),
|
28
|
-
]));
|
29
|
-
}
|
30
|
-
return (0, graphql_mapping_template_1.printBlock)('Return Source Field')((0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)(`context.source["${fieldName}"]`)));
|
31
|
-
};
|
32
|
-
exports.generateFieldAuthResponse = generateFieldAuthResponse;
|
33
|
-
const generateAuthExpressionForRelationQuery = (ctx, def, field, relatedModelObject, providers, roles, fields) => {
|
34
|
-
const expressions = [];
|
35
|
-
expressions.push((0, graphql_mapping_template_1.compoundExpression)((0, common_1.generateAuthRulesFromRoles)(roles, fields, providers.hasIdentityPoolId, true)));
|
36
|
-
expressions.push((0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('authResult'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.authRules.queryAuth'), (0, graphql_mapping_template_1.ref)('authRules'))));
|
37
|
-
expressions.push((0, common_1.validateAuthResult)(), (0, common_1.constructAuthFilter)(), common_1.emptyPayload);
|
38
|
-
return (0, graphql_mapping_template_1.printBlock)('Authorization rules')((0, graphql_mapping_template_1.compoundExpression)(expressions));
|
39
|
-
};
|
40
|
-
exports.generateAuthExpressionForRelationQuery = generateAuthExpressionForRelationQuery;
|
41
|
-
//# sourceMappingURL=query.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{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AC;AAVW,QAAA,yBAAyB,6BAUpC;AAKK,MAAM,sCAAsC,GAAG,CAEpD,GAA+B,EAE/B,GAA6B,EAE7B,KAA0B,EAE1B,kBAA4C,EAC5C,SAAkC,EAClC,KAA4B,EAC5B,MAA0C,EAClC,EAAE;IACV,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,WAAW,CAAC,IAAI,CAAC,IAAA,6CAAkB,EAAC,IAAA,mCAA0B,EAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACnH,WAAW,CAAC,IAAI,CAAC,IAAA,8BAAG,EAAC,IAAA,8BAAG,EAAC,YAAY,CAAC,EAAE,IAAA,qCAAU,EAAC,IAAA,8BAAG,EAAC,0BAA0B,CAAC,EAAE,IAAA,8BAAG,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACxG,WAAW,CAAC,IAAI,CAAC,IAAA,2BAAkB,GAAE,EAAE,IAAA,4BAAmB,GAAE,EAAE,qBAAY,CAAC,CAAC;IAC5E,OAAO,IAAA,qCAAU,EAAC,qBAAqB,CAAC,CAAC,IAAA,6CAAkB,EAAC,WAAW,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAlBW,QAAA,sCAAsC,0CAkBjD"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../src/vtl-generator/rds/resolvers/subscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGzE,eAAO,MAAM,sCAAsC,cAAe,uBAAuB,SAAS,MAAM,cAAc,CAAC,KAAG,MA0BzH,CAAC"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generateAuthExpressionForSubscriptions = void 0;
|
4
|
-
const graphql_mapping_template_1 = require("graphql-mapping-template");
|
5
|
-
const common_1 = require("./common");
|
6
|
-
const generateAuthExpressionForSubscriptions = (providers, roles) => {
|
7
|
-
const expressions = [];
|
8
|
-
expressions.push((0, graphql_mapping_template_1.compoundExpression)((0, common_1.generateAuthRulesFromRoles)(roles, [], providers.hasIdentityPoolId, true)));
|
9
|
-
expressions.push((0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('authResult'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.authRules.subscriptionAuth'), (0, graphql_mapping_template_1.ref)('authRules'))));
|
10
|
-
expressions.push((0, common_1.validateAuthResult)());
|
11
|
-
expressions.push((0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.ref)('authResult'), (0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrEmpty'), (0, graphql_mapping_template_1.ref)('authResult.authFilter')))]), (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrEmpty'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('ctx.args.filter'), (0, graphql_mapping_template_1.ref)('authResult.authFilter')), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('ctx.args.filter'), (0, graphql_mapping_template_1.obj)({
|
12
|
-
and: (0, graphql_mapping_template_1.list)([(0, graphql_mapping_template_1.ref)('authResult.authFilter'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')]),
|
13
|
-
})))));
|
14
|
-
expressions.push(common_1.emptyPayload);
|
15
|
-
return (0, graphql_mapping_template_1.printBlock)('Authorization rules')((0, graphql_mapping_template_1.compoundExpression)(expressions));
|
16
|
-
};
|
17
|
-
exports.generateAuthExpressionForSubscriptions = generateAuthExpressionForSubscriptions;
|
18
|
-
//# sourceMappingURL=subscription.js.map
|
@@ -1 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IAAA,+BAAI,EAAC,CAAC,IAAA,8BAAG,EAAC,uBAAuB,CAAC,EAAE,IAAA,8BAAG,EAAC,iBAAiB,CAAC,CAAC,CAAC;KAClE,CAAC,CACH,CACF,CACF,CACF,CAAC;IAEF,WAAW,CAAC,IAAI,CAAC,qBAAY,CAAC,CAAC;IAE/B,OAAO,IAAA,qCAAU,EAAC,qBAAqB,CAAC,CAAC,IAAA,6CAAkB,EAAC,WAAW,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AA1BW,QAAA,sCAAsC,0CA0BjD"}
|
package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
-
import { FieldDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
3
|
-
import { ConfiguredAuthProviders, RoleDefinition } from '../utils';
|
4
|
-
export interface AuthVTLGenerator {
|
5
|
-
generateAuthExpressionForCreate: (ctx: TransformerContextProvider, providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>) => string;
|
6
|
-
generateAuthExpressionForUpdate: (providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>) => string;
|
7
|
-
generateAuthRequestExpression: (ctx: TransformerContextProvider, def: ObjectTypeDefinitionNode) => string;
|
8
|
-
generateAuthExpressionForDelete: (providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>) => string;
|
9
|
-
generateAuthExpressionForField: (providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>, fieldName: string | undefined) => string;
|
10
|
-
generateFieldAuthResponse: (operation: string, fieldName: string, subscriptionsEnabled: boolean) => string;
|
11
|
-
generateAuthExpressionForQueries: (ctx: TransformerContextProvider, providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>, def: ObjectTypeDefinitionNode, indexName: string | undefined) => string;
|
12
|
-
generateAuthExpressionForSearchQueries: (providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>, allowedAggFields: Array<string>) => string;
|
13
|
-
generateAuthExpressionForSubscriptions: (providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>) => string;
|
14
|
-
setDeniedFieldFlag: (operation: string, subscriptionsEnabled: boolean) => string;
|
15
|
-
generateAuthExpressionForRelationQuery: (ctx: TransformerContextProvider, def: ObjectTypeDefinitionNode, field: FieldDefinitionNode, relatedModelObject: ObjectTypeDefinitionNode, providers: ConfiguredAuthProviders, roles: Array<RoleDefinition>, fields: ReadonlyArray<FieldDefinitionNode>) => string;
|
16
|
-
generateFieldResolverForOwner: (entity: string) => string;
|
17
|
-
generateSandboxExpressionForField: (sandboxEnabled: boolean) => string;
|
18
|
-
}
|
19
|
-
//# sourceMappingURL=vtl-generator.d.ts.map
|
package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"vtl-generator.d.ts","sourceRoot":"","sources":["../../src/vtl-generator/vtl-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAA8B,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/F,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B,EAAE,CAC/B,GAAG,EAAE,0BAA0B,EAC/B,SAAS,EAAE,uBAAuB,EAClC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,KACvC,MAAM,CAAC;IAEZ,+BA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,CAAC,KAAK,MAAM,CAAC;IAErH,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,KAAK,MAAM,CAAC;IAEjF,sCAAsC,EAAE,CACtC,GAAG,EAAE,0BAA0B,EAC/B,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,mBAAmB,EAC1B,kBAAkB,EAAE,wBAAwB,EAC5C,SAAS,EAAE,uBAAuB,EAClC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,KACvC,MAAM,CAAC;IAEZ,6BAA6B,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAE1D,iCAAiC,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,MAAM,CAAC;CACxE"}
|
package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"vtl-generator.js","sourceRoot":"","sources":["../../src/vtl-generator/vtl-generator.ts"],"names":[],"mappings":""}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { TransformerPreProcessContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
-
import { ObjectTypeDefinitionNode, DirectiveNode, DocumentNode, ObjectTypeExtensionNode, FieldDefinitionNode } from 'graphql';
|
3
|
-
import { TransformerSchemaVisitStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
4
|
-
export declare const setTypeMappingInSchema: (context: TransformerPreProcessContextProvider, directiveName: string) => void;
|
5
|
-
export declare const updateTypeMapping: (modelName: string, mappedName: string, updateFunction: (newTypeName: string, originalTypeName: string) => void) => void;
|
6
|
-
export declare const shouldBeAppliedToModel: (definition: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, directiveName: string) => void;
|
7
|
-
export declare const getMappedName: (definition: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, directive: DirectiveNode, directiveName: string, inputDocument: DocumentNode) => string;
|
8
|
-
export declare const getMappedFieldName: (parent: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, definition: FieldDefinitionNode, directive: DirectiveNode, directiveName: string) => string;
|
9
|
-
export declare const updateFieldMapping: (modelName: string, fieldName: string, mappedName: string, context: TransformerSchemaVisitStepContextProvider) => void;
|
10
|
-
//# sourceMappingURL=graphql-name-mapping.d.ts.map
|
package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graphql-name-mapping.d.ts","sourceRoot":"","sources":["../src/graphql-name-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EACL,wBAAwB,EACxB,aAAa,EAGb,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AAExG,eAAO,MAAM,sBAAsB,YAAa,oCAAoC,iBAAiB,MAAM,SAY1G,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACjB,MAAM,cACL,MAAM,gCACY,MAAM,oBAAoB,MAAM,KAAK,IAAI,SAGxE,CAAC;AAEF,eAAO,MAAM,sBAAsB,eAAgB,wBAAwB,GAAG,uBAAuB,iBAAiB,MAAM,SAM3H,CAAC;AAEF,eAAO,MAAM,aAAa,eACZ,wBAAwB,GAAG,uBAAuB,aACnD,aAAa,iBACT,MAAM,iBACN,YAAY,KAC1B,MAuBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,WACrB,wBAAwB,GAAG,uBAAuB,cAC9C,mBAAmB,aACpB,aAAa,iBACT,MAAM,KACpB,MAsBF,CAAC;AAsCF,eAAO,MAAM,kBAAkB,cAClB,MAAM,aACN,MAAM,cACL,MAAM,WACT,yCAAyC,SAInD,CAAC"}
|
@@ -1,102 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.updateFieldMapping = exports.getMappedFieldName = exports.getMappedName = exports.shouldBeAppliedToModel = exports.updateTypeMapping = exports.setTypeMappingInSchema = void 0;
|
4
|
-
const graphql_1 = require("graphql");
|
5
|
-
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
6
|
-
const setTypeMappingInSchema = (context, directiveName) => {
|
7
|
-
var _a, _b;
|
8
|
-
(_b = (_a = context.inputDocument) === null || _a === void 0 ? void 0 : _a.definitions) === null || _b === void 0 ? void 0 : _b.forEach((def) => {
|
9
|
-
var _a;
|
10
|
-
if (def.kind === 'ObjectTypeDefinition' || def.kind === 'ObjectTypeExtension') {
|
11
|
-
(_a = def === null || def === void 0 ? void 0 : def.directives) === null || _a === void 0 ? void 0 : _a.forEach((dir) => {
|
12
|
-
if (dir.name.value === directiveName) {
|
13
|
-
const modelName = def.name.value;
|
14
|
-
const mappedName = (0, exports.getMappedName)(def, dir, directiveName, context.inputDocument);
|
15
|
-
(0, exports.updateTypeMapping)(modelName, mappedName, context.schemaHelper.setTypeMapping);
|
16
|
-
}
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
};
|
21
|
-
exports.setTypeMappingInSchema = setTypeMappingInSchema;
|
22
|
-
const updateTypeMapping = (modelName, mappedName, updateFunction) => {
|
23
|
-
updateFunction(modelName, mappedName);
|
24
|
-
};
|
25
|
-
exports.updateTypeMapping = updateTypeMapping;
|
26
|
-
const shouldBeAppliedToModel = (definition, directiveName) => {
|
27
|
-
var _a;
|
28
|
-
const typeName = definition.name.value;
|
29
|
-
const hasModelDirective = !!((_a = definition.directives) === null || _a === void 0 ? void 0 : _a.find((directive) => directive.name.value === 'model'));
|
30
|
-
if (!hasModelDirective) {
|
31
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${directiveName} is not supported on type ${typeName}. It can only be used on a @model type.`);
|
32
|
-
}
|
33
|
-
};
|
34
|
-
exports.shouldBeAppliedToModel = shouldBeAppliedToModel;
|
35
|
-
const getMappedName = (definition, directive, directiveName, inputDocument) => {
|
36
|
-
var _a, _b, _c;
|
37
|
-
const modelName = definition.name.value;
|
38
|
-
const mappedName = getNameInput(directive, directiveName);
|
39
|
-
const schemaHasConflictingModel = !!inputDocument.definitions.find(hasModelWithNamePredicate(mappedName));
|
40
|
-
if (schemaHasConflictingModel) {
|
41
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Cannot apply @${directiveName} with name "${mappedName}" on type "${modelName}" because "${mappedName}" model already exists in the schema.`);
|
42
|
-
}
|
43
|
-
const modelsWithDuplicateName = (_a = inputDocument === null || inputDocument === void 0 ? void 0 : inputDocument.definitions) === null || _a === void 0 ? void 0 : _a.filter((def) => isModelWithDuplicateMapping(def, modelName, mappedName, directiveName));
|
44
|
-
if ((modelsWithDuplicateName === null || modelsWithDuplicateName === void 0 ? void 0 : modelsWithDuplicateName.length) > 0) {
|
45
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Cannot apply @${directiveName} with name "${mappedName}" on type "${modelName}" because "${(_c = (_b = modelsWithDuplicateName[0]) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.value}" model already has the same name mapping.`);
|
46
|
-
}
|
47
|
-
return mappedName;
|
48
|
-
};
|
49
|
-
exports.getMappedName = getMappedName;
|
50
|
-
const getMappedFieldName = (parent, definition, directive, directiveName) => {
|
51
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
52
|
-
const modelName = (_a = parent === null || parent === void 0 ? void 0 : parent.name) === null || _a === void 0 ? void 0 : _a.value;
|
53
|
-
const fieldName = (_b = definition === null || definition === void 0 ? void 0 : definition.name) === null || _b === void 0 ? void 0 : _b.value;
|
54
|
-
const mappedName = getNameInput(directive, directiveName);
|
55
|
-
const fieldsWithSameMappings = (_c = parent === null || parent === void 0 ? void 0 : parent.fields) === null || _c === void 0 ? void 0 : _c.filter((field) => isFieldWithDuplicateMapping(field, fieldName, mappedName, directiveName));
|
56
|
-
if (fieldsWithSameMappings && (fieldsWithSameMappings === null || fieldsWithSameMappings === void 0 ? void 0 : fieldsWithSameMappings.length) > 0) {
|
57
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Cannot apply @${directiveName} with name "${mappedName}" on field "${(_d = definition === null || definition === void 0 ? void 0 : definition.name) === null || _d === void 0 ? void 0 : _d.value}" in type "${modelName}" because "${(_f = (_e = fieldsWithSameMappings[0]) === null || _e === void 0 ? void 0 : _e.name) === null || _f === void 0 ? void 0 : _f.value}" field already has the same name mapping.`);
|
58
|
-
}
|
59
|
-
const fieldWithMappedName = (_g = parent === null || parent === void 0 ? void 0 : parent.fields) === null || _g === void 0 ? void 0 : _g.find((field) => { var _a; return ((_a = field === null || field === void 0 ? void 0 : field.name) === null || _a === void 0 ? void 0 : _a.value) === mappedName; });
|
60
|
-
if (fieldWithMappedName) {
|
61
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Cannot apply @${directiveName} with name "${mappedName}" on field "${(_h = definition === null || definition === void 0 ? void 0 : definition.name) === null || _h === void 0 ? void 0 : _h.value}" in type "${modelName}" because "${(_j = fieldWithMappedName === null || fieldWithMappedName === void 0 ? void 0 : fieldWithMappedName.name) === null || _j === void 0 ? void 0 : _j.value}" field already exists in the model.`);
|
62
|
-
}
|
63
|
-
return mappedName;
|
64
|
-
};
|
65
|
-
exports.getMappedFieldName = getMappedFieldName;
|
66
|
-
const getNameInput = (directive, directiveName) => {
|
67
|
-
var _a, _b;
|
68
|
-
const mappedNameNode = (_a = directive.arguments) === null || _a === void 0 ? void 0 : _a.find((arg) => arg.name.value === 'name');
|
69
|
-
if (!mappedNameNode) {
|
70
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`name is required in @${directiveName} directive.`);
|
71
|
-
}
|
72
|
-
if (mappedNameNode.value.kind !== 'StringValue') {
|
73
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`A single string must be provided for "name" in @${directiveName} directive`);
|
74
|
-
}
|
75
|
-
return (_b = mappedNameNode === null || mappedNameNode === void 0 ? void 0 : mappedNameNode.value) === null || _b === void 0 ? void 0 : _b.value;
|
76
|
-
};
|
77
|
-
const hasModelWithNamePredicate = (name) => (node) => { var _a; return node.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION && !!((_a = node.directives) === null || _a === void 0 ? void 0 : _a.find((dir) => dir.name.value === 'model')) && node.name.value === name; };
|
78
|
-
const isModelWithDuplicateMapping = (node, modelName, mappedName, directiveName) => {
|
79
|
-
var _a, _b;
|
80
|
-
return node.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION &&
|
81
|
-
((_a = node === null || node === void 0 ? void 0 : node.name) === null || _a === void 0 ? void 0 : _a.value) !== modelName &&
|
82
|
-
!!((_b = node.directives) === null || _b === void 0 ? void 0 : _b.find((dir) => {
|
83
|
-
var _a;
|
84
|
-
return dir.name.value === directiveName &&
|
85
|
-
((_a = dir.arguments) === null || _a === void 0 ? void 0 : _a.find((arg) => arg.name.value === 'name' && arg.value.kind === graphql_1.Kind.STRING && arg.value.value === mappedName));
|
86
|
-
}));
|
87
|
-
};
|
88
|
-
const isFieldWithDuplicateMapping = (node, fieldName, mappedName, directiveName) => {
|
89
|
-
var _a, _b;
|
90
|
-
return ((_a = node === null || node === void 0 ? void 0 : node.name) === null || _a === void 0 ? void 0 : _a.value) !== fieldName &&
|
91
|
-
!!((_b = node.directives) === null || _b === void 0 ? void 0 : _b.find((dir) => {
|
92
|
-
var _a;
|
93
|
-
return dir.name.value === directiveName &&
|
94
|
-
((_a = dir.arguments) === null || _a === void 0 ? void 0 : _a.find((arg) => arg.name.value === 'name' && arg.value.kind === graphql_1.Kind.STRING && arg.value.value === mappedName));
|
95
|
-
}));
|
96
|
-
};
|
97
|
-
const updateFieldMapping = (modelName, fieldName, mappedName, context) => {
|
98
|
-
const modelFieldMap = context.resourceHelper.getModelFieldMap(modelName);
|
99
|
-
modelFieldMap.addMappedField({ currentFieldName: fieldName, originalFieldName: mappedName });
|
100
|
-
};
|
101
|
-
exports.updateFieldMapping = updateFieldMapping;
|
102
|
-
//# sourceMappingURL=graphql-name-mapping.js.map
|
package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graphql-name-mapping.js","sourceRoot":"","sources":["../src/graphql-name-mapping.ts"],"names":[],"mappings":";;;AACA,qCAQiB;AACjB,oFAA8E;AAGvE,MAAM,sBAAsB,GAAG,CAAC,OAA6C,EAAE,aAAqB,EAAE,EAAE;;IAC7G,MAAA,MAAA,OAAO,CAAC,aAAa,0CAAE,WAAW,0CAAE,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;;QAClD,IAAI,GAAG,CAAC,IAAI,KAAK,sBAAsB,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB,EAAE;YAC7E,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,0CAAE,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC/B,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,aAAa,EAAE;oBACpC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;oBACjC,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;oBACjF,IAAA,yBAAiB,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;iBAC/E;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAZW,QAAA,sBAAsB,0BAYjC;AAEK,MAAM,iBAAiB,GAAG,CAC/B,SAAiB,EACjB,UAAkB,EAClB,cAAuE,EACvE,EAAE;IACF,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;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CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,cAAI,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,UAAU,CAAC,CAAA,CAAA;SAAA,CAC9H,CAAA,CAAA;CAAA,CAAC;AAEG,MAAM,kBAAkB,GAAG,CAChC,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,OAAkD,EAClD,EAAE;IACF,MAAM,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACzE,aAAa,CAAC,cAAc,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC,CAAC;AAC/F,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B"}
|
package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import { TransformerPluginBase } from '@aws-amplify/graphql-transformer-core';
|
2
|
-
import { TransformerContextProvider, TransformerPreProcessContextProvider, TransformerSchemaVisitStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
3
|
-
import { ObjectTypeDefinitionNode, DirectiveNode, FieldDefinitionNode, ObjectTypeExtensionNode, InterfaceTypeDefinitionNode } from 'graphql';
|
4
|
-
export declare class RefersToTransformer extends TransformerPluginBase {
|
5
|
-
constructor();
|
6
|
-
object: (definition: ObjectTypeDefinitionNode, directive: DirectiveNode, ctx: TransformerSchemaVisitStepContextProvider) => void;
|
7
|
-
field: (parent: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, definition: FieldDefinitionNode, directive: DirectiveNode, ctx: TransformerSchemaVisitStepContextProvider) => void;
|
8
|
-
after: (context: TransformerContextProvider) => void;
|
9
|
-
preMutateSchema: (context: TransformerPreProcessContextProvider) => void;
|
10
|
-
}
|
11
|
-
export declare const shouldBeAppliedToRDSModels: (definition: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, ctx: TransformerContextProvider) => void;
|
12
|
-
export declare const shouldNotBeOnRelationalField: (definition: FieldDefinitionNode, modelName: string) => void;
|
13
|
-
//# sourceMappingURL=graphql-refers-to-transformer.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graphql-refers-to-transformer.d.ts","sourceRoot":"","sources":["../src/graphql-refers-to-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAsD,MAAM,uCAAuC,CAAC;AAClI,OAAO,EACL,0BAA0B,EAE1B,oCAAoC,EACpC,yCAAyC,EAC1C,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAE5B,MAAM,SAAS,CAAC;AAiBjB,qBAAa,mBAAoB,SAAQ,qBAAqB;;IAQ5D,MAAM,eAAgB,wBAAwB,aAAa,aAAa,OAAO,yCAAyC,UAOtH;IAKF,KAAK,WACK,wBAAwB,GAAG,2BAA2B,cAClD,mBAAmB,aACpB,aAAa,OACnB,yCAAyC,UAc9C;IAMF,KAAK,YAAa,0BAA0B,UAuB1C;IAMF,eAAe,YAAa,oCAAoC,UAE9D;CACH;AAED,eAAO,MAAM,0BAA0B,eACzB,wBAAwB,GAAG,uBAAuB,OACzD,0BAA0B,SAMhC,CAAC;AAEF,eAAO,MAAM,4BAA4B,eAAgB,mBAAmB,aAAa,MAAM,SAK9F,CAAC"}
|
package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.shouldNotBeOnRelationalField = exports.shouldBeAppliedToRDSModels = exports.RefersToTransformer = void 0;
|
4
|
-
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const graphql_transformer_interfaces_1 = require("@aws-amplify/graphql-transformer-interfaces");
|
6
|
-
const graphql_1 = require("graphql");
|
7
|
-
const graphql_name_mapping_1 = require("./graphql-name-mapping");
|
8
|
-
const field_mapping_resolvers_1 = require("./field-mapping-resolvers");
|
9
|
-
const directiveName = 'refersTo';
|
10
|
-
const directiveDefinition = `
|
11
|
-
directive @${directiveName}(name: String!) on OBJECT | FIELD_DEFINITION
|
12
|
-
`;
|
13
|
-
class RefersToTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
14
|
-
constructor() {
|
15
|
-
super(`amplify-refers-to-transformer`, directiveDefinition, graphql_transformer_interfaces_1.TransformerPluginType.GENERIC);
|
16
|
-
this.object = (definition, directive, ctx) => {
|
17
|
-
const context = ctx;
|
18
|
-
(0, graphql_name_mapping_1.shouldBeAppliedToModel)(definition, directiveName);
|
19
|
-
(0, exports.shouldBeAppliedToRDSModels)(definition, context);
|
20
|
-
const modelName = definition.name.value;
|
21
|
-
const mappedName = (0, graphql_name_mapping_1.getMappedName)(definition, directive, directiveName, ctx.inputDocument);
|
22
|
-
(0, graphql_name_mapping_1.updateTypeMapping)(modelName, mappedName, ctx.resourceHelper.setModelNameMapping);
|
23
|
-
};
|
24
|
-
this.field = (parent, definition, directive, ctx) => {
|
25
|
-
var _a, _b, _c, _d;
|
26
|
-
if (parent.kind === graphql_1.Kind.INTERFACE_TYPE_DEFINITION) {
|
27
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`@refersTo directive cannot be placed on "${(_a = parent === null || parent === void 0 ? void 0 : parent.name) === null || _a === void 0 ? void 0 : _a.value}" interface's ${(_b = definition === null || definition === void 0 ? void 0 : definition.name) === null || _b === void 0 ? void 0 : _b.value} field.`);
|
28
|
-
}
|
29
|
-
const context = ctx;
|
30
|
-
const modelName = (_c = parent === null || parent === void 0 ? void 0 : parent.name) === null || _c === void 0 ? void 0 : _c.value;
|
31
|
-
(0, graphql_name_mapping_1.shouldBeAppliedToModel)(parent, directiveName);
|
32
|
-
(0, exports.shouldBeAppliedToRDSModels)(parent, context);
|
33
|
-
(0, exports.shouldNotBeOnRelationalField)(definition, modelName);
|
34
|
-
const mappedName = (0, graphql_name_mapping_1.getMappedFieldName)(parent, definition, directive, directiveName);
|
35
|
-
(0, graphql_name_mapping_1.updateFieldMapping)(modelName, (_d = definition === null || definition === void 0 ? void 0 : definition.name) === null || _d === void 0 ? void 0 : _d.value, mappedName, ctx);
|
36
|
-
};
|
37
|
-
this.after = (context) => {
|
38
|
-
context.resourceHelper.getModelFieldMapKeys().forEach((modelName) => {
|
39
|
-
if (!(0, graphql_transformer_core_1.isRDSModel)(context, modelName)) {
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
const modelFieldMap = context.resourceHelper.getModelFieldMap(modelName);
|
43
|
-
if (!modelFieldMap.getMappedFields().length) {
|
44
|
-
return;
|
45
|
-
}
|
46
|
-
modelFieldMap.getResolverReferences().forEach(({ typeName, fieldName, isList }) => {
|
47
|
-
const resolver = context.resolvers.getResolver(typeName, fieldName);
|
48
|
-
if (!resolver) {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
(0, field_mapping_resolvers_1.attachFieldMappingSlot)({
|
52
|
-
resolver,
|
53
|
-
resolverTypeName: typeName,
|
54
|
-
resolverFieldName: fieldName,
|
55
|
-
fieldMap: modelFieldMap.getMappedFields(),
|
56
|
-
});
|
57
|
-
});
|
58
|
-
});
|
59
|
-
};
|
60
|
-
this.preMutateSchema = (context) => {
|
61
|
-
(0, graphql_name_mapping_1.setTypeMappingInSchema)(context, directiveName);
|
62
|
-
};
|
63
|
-
}
|
64
|
-
}
|
65
|
-
exports.RefersToTransformer = RefersToTransformer;
|
66
|
-
const shouldBeAppliedToRDSModels = (definition, ctx) => {
|
67
|
-
const modelName = definition.name.value;
|
68
|
-
if (!(0, graphql_transformer_core_1.isRDSModel)(ctx, modelName)) {
|
69
|
-
throw new Error(`@${directiveName} is only supported on RDS models. ${modelName} is not an RDS model.`);
|
70
|
-
}
|
71
|
-
};
|
72
|
-
exports.shouldBeAppliedToRDSModels = shouldBeAppliedToRDSModels;
|
73
|
-
const shouldNotBeOnRelationalField = (definition, modelName) => {
|
74
|
-
var _a, _b;
|
75
|
-
const relationalDirectives = ['hasOne', 'hasMany', 'belongsTo', 'manyToMany'];
|
76
|
-
if ((_a = definition === null || definition === void 0 ? void 0 : definition.directives) === null || _a === void 0 ? void 0 : _a.some((directive) => { var _a; return relationalDirectives.includes((_a = directive === null || directive === void 0 ? void 0 : directive.name) === null || _a === void 0 ? void 0 : _a.value); })) {
|
77
|
-
throw new Error(`@${directiveName} is not supported on "${(_b = definition === null || definition === void 0 ? void 0 : definition.name) === null || _b === void 0 ? void 0 : _b.value}" relational field in "${modelName}" model.`);
|
78
|
-
}
|
79
|
-
};
|
80
|
-
exports.shouldNotBeOnRelationalField = shouldNotBeOnRelationalField;
|
81
|
-
//# sourceMappingURL=graphql-refers-to-transformer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graphql-refers-to-transformer.js","sourceRoot":"","sources":["../src/graphql-refers-to-transformer.ts"],"names":[],"mappings":";;;AAAA,oFAAkI;AAClI,gGAKqD;AACrD,qCAOiB;AACjB,iEAOgC;AAChC,uEAAmE;AAEnE,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,MAAM,mBAAmB,GAAG;eACb,aAAa;CAC3B,CAAC;AAEF,MAAa,mBAAoB,SAAQ,gDAAqB;IAC5D;QACE,KAAK,CAAC,+BAA+B,EAAE,mBAAmB,EAAE,sDAAqB,CAAC,OAAO,CAAC,CAAC;QAM7F,WAAM,GAAG,CAAC,UAAoC,EAAE,SAAwB,EAAE,GAA8C,EAAE,EAAE;YAC1H,MAAM,OAAO,GAAG,GAAiC,CAAC;YAClD,IAAA,6CAAsB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;YAClD,IAAA,kCAA0B,EAAC,UAAU,EAAE,OAA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qC,SAAS,uBAAuB,CAAC,CAAC;KACzG;AACH,CAAC,CAAC;AARW,QAAA,0BAA0B,8BAQrC;AAEK,MAAM,4BAA4B,GAAG,CAAC,UAA+B,EAAE,SAAiB,EAAE,EAAE;;IACjG,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAC9E,IAAI,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,WAAC,OAAA,oBAAoB,CAAC,QAAQ,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,KAAK,CAAC,CAAA,EAAA,CAAC,EAAE;QACtG,MAAM,IAAI,KAAK,CAAC,IAAI,aAAa,yBAAyB,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,KAAK,0BAA0B,SAAS,UAAU,CAAC,CAAC;KACjI;AACH,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC"}
|
package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
-
import { Expression, ObjectNode } from 'graphql-mapping-template';
|
3
|
-
import { ObjectTypeDefinitionNode } from 'graphql';
|
4
|
-
import { BelongsToDirectiveConfiguration, HasManyDirectiveConfiguration, HasOneDirectiveConfiguration } from '../types';
|
5
|
-
import { RelationalResolverGenerator } from './generator';
|
6
|
-
export declare class DDBRelationalResolverGenerator extends RelationalResolverGenerator {
|
7
|
-
makeExpression: (keySchema: any[], connectionAttributes: string[]) => ObjectNode;
|
8
|
-
makeHasManyGetItemsConnectionWithKeyResolver: (config: HasManyDirectiveConfiguration, ctx: TransformerContextProvider) => void;
|
9
|
-
makeHasOneGetItemConnectionWithKeyResolver: (config: HasOneDirectiveConfiguration | BelongsToDirectiveConfiguration, ctx: TransformerContextProvider) => void;
|
10
|
-
buildKeyValueExpression: (fieldName: string, object: ObjectTypeDefinitionNode, isPartitionKey?: boolean) => Expression;
|
11
|
-
makeBelongsToGetItemConnectionWithKeyResolver: (config: HasOneDirectiveConfiguration, ctx: TransformerContextProvider) => void;
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=ddb-generator.d.ts.map
|
package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ddb-generator.d.ts","sourceRoot":"","sources":["../../src/resolver/ddb-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAEL,UAAU,EACV,UAAU,EAsBX,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxH,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAQ1D,qBAAa,8BAA+B,SAAQ,2BAA2B;IAC7E,cAAc,cAAe,GAAG,EAAE,wBAAwB,MAAM,EAAE,KAAG,UAAU,CAkC7E;IAOF,4CAA4C,WAAY,6BAA6B,OAAO,0BAA0B,KAAG,IAAI,CA6H3H;IAOF,0CAA0C,WAChC,4BAA4B,GAAG,+BAA+B,OACjE,0BAA0B,KAC9B,IAAI,CA+GL;IAEF,uBAAuB,cAAe,MAAM,UAAU,wBAAwB,+BAA2B,UAAU,CAWjH;IAEF,6CAA6C,WAAY,4BAA4B,OAAO,0BAA0B,KAAG,IAAI,CAE3H;CACH"}
|
package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js
DELETED
@@ -1,171 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DDBRelationalResolverGenerator = void 0;
|
4
|
-
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const graphql_mapping_template_1 = require("graphql-mapping-template");
|
6
|
-
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
-
const generator_1 = require("./generator");
|
8
|
-
const resolvers_1 = require("../resolvers");
|
9
|
-
const SORT_KEY_VALUE = 'sortKeyValue';
|
10
|
-
const CONNECTION_STACK = 'ConnectionStack';
|
11
|
-
const authFilter = (0, graphql_mapping_template_1.ref)('ctx.stash.authFilter');
|
12
|
-
const PARTITION_KEY_VALUE = 'partitionKeyValue';
|
13
|
-
class DDBRelationalResolverGenerator extends generator_1.RelationalResolverGenerator {
|
14
|
-
constructor() {
|
15
|
-
super(...arguments);
|
16
|
-
this.makeExpression = (keySchema, connectionAttributes) => {
|
17
|
-
if (keySchema[1] && connectionAttributes[1]) {
|
18
|
-
let condensedSortKeyValue;
|
19
|
-
if (connectionAttributes.length > 2) {
|
20
|
-
const rangeKeyFields = connectionAttributes.slice(1);
|
21
|
-
condensedSortKeyValue = rangeKeyFields
|
22
|
-
.map((keyField, idx) => `\${${SORT_KEY_VALUE}${idx}}`)
|
23
|
-
.join(graphql_transformer_common_1.ModelResourceIDs.ModelCompositeKeySeparator());
|
24
|
-
}
|
25
|
-
return (0, graphql_mapping_template_1.obj)({
|
26
|
-
expression: (0, graphql_mapping_template_1.str)('#partitionKey = :partitionKey AND #sortKey = :sortKey'),
|
27
|
-
expressionNames: (0, graphql_mapping_template_1.obj)({
|
28
|
-
'#partitionKey': (0, graphql_mapping_template_1.str)(keySchema[0].attributeName),
|
29
|
-
'#sortKey': (0, graphql_mapping_template_1.str)(keySchema[1].attributeName),
|
30
|
-
}),
|
31
|
-
expressionValues: (0, graphql_mapping_template_1.obj)({
|
32
|
-
':partitionKey': (0, graphql_mapping_template_1.ref)(`util.dynamodb.toDynamoDB($${PARTITION_KEY_VALUE})`),
|
33
|
-
':sortKey': (0, graphql_mapping_template_1.ref)(`util.dynamodb.toDynamoDB(${condensedSortKeyValue ? `"${condensedSortKeyValue}"` : `$${SORT_KEY_VALUE}0`})`),
|
34
|
-
}),
|
35
|
-
});
|
36
|
-
}
|
37
|
-
return (0, graphql_mapping_template_1.obj)({
|
38
|
-
expression: (0, graphql_mapping_template_1.str)('#partitionKey = :partitionKey'),
|
39
|
-
expressionNames: (0, graphql_mapping_template_1.obj)({
|
40
|
-
'#partitionKey': (0, graphql_mapping_template_1.str)(keySchema[0].attributeName),
|
41
|
-
}),
|
42
|
-
expressionValues: (0, graphql_mapping_template_1.obj)({
|
43
|
-
':partitionKey': (0, graphql_mapping_template_1.ref)(`util.dynamodb.toDynamoDB($${PARTITION_KEY_VALUE})`),
|
44
|
-
}),
|
45
|
-
});
|
46
|
-
};
|
47
|
-
this.makeHasManyGetItemsConnectionWithKeyResolver = (config, ctx) => {
|
48
|
-
const { connectionFields, field, fields, indexName, limit, object, relatedType } = config;
|
49
|
-
const connectionAttributes = fields.length > 0 ? fields : connectionFields;
|
50
|
-
if (connectionAttributes.length === 0) {
|
51
|
-
throw new Error('Either connection fields or local fields should be populated.');
|
52
|
-
}
|
53
|
-
const table = (0, graphql_transformer_core_1.getTable)(ctx, relatedType);
|
54
|
-
const dataSource = ctx.api.host.getDataSource(`${relatedType.name.value}Table`);
|
55
|
-
const keySchema = (0, graphql_transformer_core_1.getKeySchema)(table, indexName);
|
56
|
-
const setup = [
|
57
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('limit'), (0, graphql_mapping_template_1.ref)(`util.defaultIfNull($context.args.limit, ${limit})`)),
|
58
|
-
...connectionAttributes
|
59
|
-
.slice(1)
|
60
|
-
.map((ca, idx) => (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${SORT_KEY_VALUE}${idx}`), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.defaultIfNull'), (0, graphql_mapping_template_1.ref)(`ctx.stash.connectionAttibutes.get("${ca}")`), (0, graphql_mapping_template_1.ref)(`ctx.source.${ca}`)))),
|
61
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('query'), this.makeExpression(keySchema, connectionAttributes)),
|
62
|
-
];
|
63
|
-
if (keySchema[1] && !connectionAttributes[1]) {
|
64
|
-
const sortKeyFieldName = keySchema[1].attributeName;
|
65
|
-
const sortKeyField = relatedType.fields.find((f) => f.name.value === sortKeyFieldName);
|
66
|
-
if (sortKeyField) {
|
67
|
-
setup.push((0, graphql_transformer_common_1.applyKeyConditionExpression)(sortKeyFieldName, (0, graphql_transformer_common_1.attributeTypeFromScalar)(sortKeyField.type), 'query'));
|
68
|
-
}
|
69
|
-
else {
|
70
|
-
const sortKeyFieldNames = sortKeyFieldName.split(graphql_transformer_common_1.ModelResourceIDs.ModelCompositeKeySeparator());
|
71
|
-
setup.push((0, graphql_transformer_common_1.applyCompositeKeyConditionExpression)(sortKeyFieldNames, 'query', (0, graphql_transformer_common_1.toCamelCase)(sortKeyFieldNames), sortKeyFieldName));
|
72
|
-
}
|
73
|
-
}
|
74
|
-
setup.push(graphql_transformer_common_1.setArgs, (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)(authFilter)), (0, graphql_mapping_template_1.compoundExpression)([
|
75
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), authFilter),
|
76
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.obj)({ and: (0, graphql_mapping_template_1.list)([(0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('args.filter')]) }))),
|
77
|
-
]), (0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('args.filter')))), (0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('filter'))), (0, graphql_mapping_template_1.compoundExpression)([
|
78
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filterExpression'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.transform.toDynamoDBFilterExpression'), (0, graphql_mapping_template_1.ref)('filter')))),
|
79
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrBlank'), (0, graphql_mapping_template_1.ref)('filterExpression.expression'))), (0, graphql_mapping_template_1.compoundExpression)([
|
80
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterExpression.expressionValues.size')), (0, graphql_mapping_template_1.int)(0)), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterExpression.remove'), (0, graphql_mapping_template_1.str)('expressionValues')))),
|
81
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('filterExpression')),
|
82
|
-
])),
|
83
|
-
])));
|
84
|
-
const queryArguments = {
|
85
|
-
query: (0, graphql_mapping_template_1.raw)('$util.toJson($query)'),
|
86
|
-
scanIndexForward: (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.ref)('context.args.sortDirection'), (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('context.args.sortDirection'), (0, graphql_mapping_template_1.str)('ASC')), (0, graphql_mapping_template_1.bool)(true), (0, graphql_mapping_template_1.bool)(false)), (0, graphql_mapping_template_1.bool)(true)),
|
87
|
-
filter: (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('util.toJson($filter)'), (0, graphql_mapping_template_1.nul)()),
|
88
|
-
limit: (0, graphql_mapping_template_1.ref)('limit'),
|
89
|
-
nextToken: (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.ref)('context.args.nextToken'), (0, graphql_mapping_template_1.ref)('util.toJson($context.args.nextToken)'), (0, graphql_mapping_template_1.nul)()),
|
90
|
-
};
|
91
|
-
if (indexName) {
|
92
|
-
queryArguments.index = (0, graphql_mapping_template_1.str)(indexName);
|
93
|
-
}
|
94
|
-
const queryObj = graphql_mapping_template_1.DynamoDBMappingTemplate.query(queryArguments);
|
95
|
-
const resolverResourceId = graphql_transformer_common_1.ResolverResourceIDs.ResolverResourceID(object.name.value, field.name.value);
|
96
|
-
const resolver = ctx.resolvers.generateQueryResolver(object.name.value, field.name.value, resolverResourceId, dataSource, graphql_transformer_core_1.MappingTemplate.s3MappingTemplateFromString((0, graphql_mapping_template_1.print)((0, graphql_mapping_template_1.compoundExpression)([
|
97
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.ref)('ctx.stash.deniedField'), (0, graphql_mapping_template_1.raw)('#return($util.toJson(null))')),
|
98
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(PARTITION_KEY_VALUE), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.defaultIfNull'), (0, graphql_mapping_template_1.ref)(`ctx.stash.connectionAttributes.get("${connectionAttributes[0]}")`), (0, graphql_mapping_template_1.ref)(`ctx.source.${connectionAttributes[0]}`))),
|
99
|
-
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)(PARTITION_KEY_VALUE)), (0, graphql_mapping_template_1.compoundExpression)([(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('result'), (0, graphql_mapping_template_1.obj)({ items: (0, graphql_mapping_template_1.list)([]) })), (0, graphql_mapping_template_1.raw)('#return($result)')]), (0, graphql_mapping_template_1.compoundExpression)([...setup, queryObj])),
|
100
|
-
])), `${object.name.value}.${field.name.value}.req.vtl`), graphql_transformer_core_1.MappingTemplate.s3MappingTemplateFromString((0, graphql_mapping_template_1.print)(graphql_mapping_template_1.DynamoDBMappingTemplate.dynamoDBResponse(false, (0, graphql_mapping_template_1.compoundExpression)([(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.raw)('!$result'), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('result'), (0, graphql_mapping_template_1.ref)('ctx.result'))), (0, graphql_mapping_template_1.raw)('$util.toJson($result)')]))), `${object.name.value}.${field.name.value}.res.vtl`));
|
101
|
-
resolver.setScope(ctx.stackManager.getScopeFor(resolverResourceId, CONNECTION_STACK));
|
102
|
-
ctx.resolvers.addResolver(object.name.value, field.name.value, resolver);
|
103
|
-
};
|
104
|
-
this.makeHasOneGetItemConnectionWithKeyResolver = (config, ctx) => {
|
105
|
-
const { connectionFields, field, fields, object, relatedType, relatedTypeIndex } = config;
|
106
|
-
if (relatedTypeIndex.length === 0) {
|
107
|
-
throw new Error('Expected relatedType index fields to be set for connection.');
|
108
|
-
}
|
109
|
-
const localFields = fields.length > 0 ? fields : connectionFields;
|
110
|
-
const table = (0, graphql_transformer_core_1.getTable)(ctx, relatedType);
|
111
|
-
const { keySchema } = table;
|
112
|
-
const dataSource = ctx.api.host.getDataSource(`${relatedType.name.value}Table`);
|
113
|
-
const partitionKeyName = keySchema[0].attributeName;
|
114
|
-
const totalExpressions = ['#partitionKey = :partitionValue'];
|
115
|
-
const totalExpressionNames = {
|
116
|
-
'#partitionKey': (0, graphql_mapping_template_1.str)(partitionKeyName),
|
117
|
-
};
|
118
|
-
const totalExpressionValues = {
|
119
|
-
':partitionValue': this.buildKeyValueExpression(localFields[0], ctx.output.getObject(object.name.value), true),
|
120
|
-
};
|
121
|
-
if (relatedTypeIndex.length > 2) {
|
122
|
-
const rangeKeyFields = localFields.slice(1);
|
123
|
-
const sortKeyName = keySchema[1].attributeName;
|
124
|
-
const condensedSortKeyValue = (0, resolvers_1.condenseRangeKey)(rangeKeyFields.map((keyField) => `\${ctx.source.${keyField}}`));
|
125
|
-
totalExpressions.push('#sortKeyName = :sortKeyName');
|
126
|
-
totalExpressionNames['#sortKeyName'] = (0, graphql_mapping_template_1.str)(sortKeyName);
|
127
|
-
totalExpressionValues[':sortKeyName'] = (0, graphql_mapping_template_1.ref)(`util.parseJson($util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank("${condensedSortKeyValue}", "${graphql_transformer_common_1.NONE_VALUE}")))`);
|
128
|
-
}
|
129
|
-
else if (relatedTypeIndex.length === 2) {
|
130
|
-
const sortKeyName = keySchema[1].attributeName;
|
131
|
-
totalExpressions.push('#sortKeyName = :sortKeyName');
|
132
|
-
totalExpressionNames['#sortKeyName'] = (0, graphql_mapping_template_1.str)(sortKeyName);
|
133
|
-
totalExpressionValues[':sortKeyName'] = this.buildKeyValueExpression(localFields[1], ctx.output.getObject(object.name.value));
|
134
|
-
}
|
135
|
-
const resolverResourceId = graphql_transformer_common_1.ResolverResourceIDs.ResolverResourceID(object.name.value, field.name.value);
|
136
|
-
const resolver = ctx.resolvers.generateQueryResolver(object.name.value, field.name.value, resolverResourceId, dataSource, graphql_transformer_core_1.MappingTemplate.s3MappingTemplateFromString((0, graphql_mapping_template_1.print)((0, graphql_mapping_template_1.compoundExpression)([
|
137
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.ref)('ctx.stash.deniedField'), (0, graphql_mapping_template_1.raw)('#return($util.toJson(null))')),
|
138
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(PARTITION_KEY_VALUE), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.defaultIfNull'), (0, graphql_mapping_template_1.ref)(`ctx.stash.connectionAttibutes.get("${localFields[0]}")`), (0, graphql_mapping_template_1.ref)(`ctx.source.${localFields[0]}`))),
|
139
|
-
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.or)([
|
140
|
-
(0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)(PARTITION_KEY_VALUE)),
|
141
|
-
...localFields.slice(1).map((f) => (0, graphql_mapping_template_1.raw)(`$util.isNull($ctx.source.${f})`)),
|
142
|
-
]), (0, graphql_mapping_template_1.raw)('#return'), (0, graphql_mapping_template_1.compoundExpression)([
|
143
|
-
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('GetRequest'), (0, graphql_mapping_template_1.obj)({ version: (0, graphql_mapping_template_1.str)('2018-05-29'), operation: (0, graphql_mapping_template_1.str)('Query') })),
|
144
|
-
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('GetRequest.put'), (0, graphql_mapping_template_1.str)('query'), (0, graphql_mapping_template_1.obj)({
|
145
|
-
expression: (0, graphql_mapping_template_1.str)(totalExpressions.join(' AND ')),
|
146
|
-
expressionNames: (0, graphql_mapping_template_1.obj)(totalExpressionNames),
|
147
|
-
expressionValues: (0, graphql_mapping_template_1.obj)(totalExpressionValues),
|
148
|
-
}))),
|
149
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)(authFilter)), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('GetRequest.put'), (0, graphql_mapping_template_1.str)('filter'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.transform.toDynamoDBFilterExpression'), authFilter))))),
|
150
|
-
(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)('GetRequest')),
|
151
|
-
])),
|
152
|
-
])), `${object.name.value}.${field.name.value}.req.vtl`), graphql_transformer_core_1.MappingTemplate.s3MappingTemplateFromString((0, graphql_mapping_template_1.print)(graphql_mapping_template_1.DynamoDBMappingTemplate.dynamoDBResponse(false, (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.ref)('ctx.result.items.isEmpty()')), (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('ctx.result.scannedCount'), (0, graphql_mapping_template_1.int)(1))]), (0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)('ctx.result.items[0]')), (0, graphql_mapping_template_1.compoundExpression)([
|
153
|
-
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.ref)('ctx.result.items.isEmpty()'), (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('ctx.result.scannedCount'), (0, graphql_mapping_template_1.int)(1))]), (0, graphql_mapping_template_1.ref)('util.unauthorized()')),
|
154
|
-
(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.nul)()),
|
155
|
-
])))), `${object.name.value}.${field.name.value}.res.vtl`));
|
156
|
-
resolver.setScope(ctx.stackManager.getScopeFor(resolverResourceId, CONNECTION_STACK));
|
157
|
-
ctx.resolvers.addResolver(object.name.value, field.name.value, resolver);
|
158
|
-
};
|
159
|
-
this.buildKeyValueExpression = (fieldName, object, isPartitionKey = false) => {
|
160
|
-
var _a;
|
161
|
-
const field = (_a = object.fields) === null || _a === void 0 ? void 0 : _a.find((it) => it.name.value === fieldName);
|
162
|
-
const attributeType = field ? (0, graphql_transformer_common_1.attributeTypeFromScalar)(field.type) : 'S';
|
163
|
-
return (0, graphql_mapping_template_1.ref)(`util.parseJson($util.dynamodb.toDynamoDBJson($util.${attributeType === 'S' ? 'defaultIfNullOrBlank' : 'defaultIfNull'}(${isPartitionKey ? `$${PARTITION_KEY_VALUE}` : `$ctx.source.${fieldName}`}, "${graphql_transformer_common_1.NONE_VALUE}")))`);
|
164
|
-
};
|
165
|
-
this.makeBelongsToGetItemConnectionWithKeyResolver = (config, ctx) => {
|
166
|
-
this.makeHasOneGetItemConnectionWithKeyResolver(config, ctx);
|
167
|
-
};
|
168
|
-
}
|
169
|
-
}
|
170
|
-
exports.DDBRelationalResolverGenerator = DDBRelationalResolverGenerator;
|
171
|
-
//# sourceMappingURL=ddb-generator.js.map
|