@aws-amplify/graphql-api-construct 1.14.0-gen2-migration-0930.0 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +99 -157
- package/API.md +3 -11
- package/CHANGELOG.md +2 -7
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.d.ts +5 -0
- package/lib/amplify-graphql-api.js +3 -2
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/model-datasource-strategy-types.d.ts +1 -19
- package/lib/model-datasource-strategy-types.js +1 -1
- package/lib/sql-model-datasource-strategy.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +1 -1
- 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 +19 -15
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +14 -14
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver-fn.template.js +43 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js +9 -55
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver-fn.template.js +58 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js +9 -70
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver-fn.template.js +38 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js +9 -50
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver-fn.template.js +15 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js +9 -27
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver-fn.template.js +56 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts +2 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js +37 -75
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver-fn.template.js +40 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js +9 -52
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver-fn.template.js +30 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts +3 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js +9 -43
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver-fn.template.js +24 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts +2 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js +15 -37
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js +24 -23
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +13 -12
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +1 -1
- 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 +9 -9
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +0 -6
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.js +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/package.json +2 -3
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js +2 -2
- package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock-resolver-fn.template.js +45 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts +1 -4
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js +27 -60
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +10 -9
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/lib/graphql-http-transformer.js +2 -2
- package/node_modules/@aws-amplify/graphql-http-transformer/lib/graphql-http-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +2 -2
- 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 +9 -9
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +1 -1
- 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.js +4 -4
- 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/package.json +12 -12
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +2 -15
- 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 +2 -7
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +3 -12
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +0 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +2 -4
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +0 -3
- 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 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +1 -141
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.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/package.json +10 -13
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js +2 -2
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +2 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +0 -3
- 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/has-many/has-many-directive-ddb-references-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js +1 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js +1 -7
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +0 -1
- 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 -1
- 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 -9
- 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 +1 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +1 -1
- 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 +9 -9
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +1 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +2 -8
- package/node_modules/@aws-amplify/graphql-transformer/package.json +18 -18
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +23 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +2 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts +2 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.d.ts +10 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.js +26 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +2 -2
- 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 +4 -3
- 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 +9 -3
- 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 +43 -10
- 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/transform.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts +12 -10
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js +107 -38
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.d.ts +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.js +6 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +1 -0
- 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 +4 -1
- 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/function-runtime.d.ts +4 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js +19 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts +1 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js +1 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +28 -14
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +2 -9
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +1 -6
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts +8 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-resolver-provider.d.ts +10 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-resolver-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +2 -2
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +0 -10
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transform-host-provider.ts +38 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +7 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-resolver-provider.ts +6 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- 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/CHANGELOG.md +0 -10
- package/node_modules/graphql-transformer-common/package.json +3 -4
- package/package.json +22 -22
- package/src/amplify-graphql-api.ts +6 -0
- package/src/model-datasource-strategy-types.ts +0 -21
- package/src/types.ts +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts +0 -6
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js +0 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-directives/LICENSE +0 -201
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/.package-lock.json +0 -13
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/LICENSE +0 -47
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/README.md +0 -18
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/index.js +0 -1848
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/package.json +0 -16
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/package-lock.json +0 -21
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/package.json +0 -11
- package/node_modules/graphql-mapping-template/LICENSE +0 -201
- package/node_modules/graphql-transformer-common/LICENSE +0 -201
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"assistant-mutation-resolver.js","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"assistant-mutation-resolver.js","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AASjB,MAAM,yBAAyB,GAAG,CAAC,MAA0C,EAA2B,EAAE;IAC/G,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,4CAA4C,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7G,MAAM,YAAY,GAAG,YAAY,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,wBAAwB,CAAC;IACjF,OAAO,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
export function request(ctx) {
|
2
|
+
ctx.stash.hasAuth = true;
|
3
|
+
const isAuthorized = false;
|
4
|
+
|
5
|
+
if (util.authType() === 'User Pool Authorization') {
|
6
|
+
if (!isAuthorized) {
|
7
|
+
const authFilter = [];
|
8
|
+
let ownerClaim0 = ctx.identity['claims']['sub'];
|
9
|
+
ctx.args.owner = ownerClaim0;
|
10
|
+
const currentClaim1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
11
|
+
if (ownerClaim0 && currentClaim1) {
|
12
|
+
ownerClaim0 = ownerClaim0 + '::' + currentClaim1;
|
13
|
+
authFilter.push({ owner: { eq: ownerClaim0 } });
|
14
|
+
}
|
15
|
+
const role0_0 = ctx.identity['claims']['sub'];
|
16
|
+
if (role0_0) {
|
17
|
+
authFilter.push({ owner: { eq: role0_0 } });
|
18
|
+
}
|
19
|
+
// we can just reuse currentClaim1 here, but doing this (for now) to mirror the existing
|
20
|
+
// vtl auth resolver.
|
21
|
+
const role0_1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
22
|
+
if (role0_1) {
|
23
|
+
authFilter.push({ owner: { eq: role0_1 } });
|
24
|
+
}
|
25
|
+
if (authFilter.length !== 0) {
|
26
|
+
ctx.stash.authFilter = { or: authFilter };
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
if (!isAuthorized && ctx.stash.authFilter.length === 0) {
|
31
|
+
util.unauthorized();
|
32
|
+
}
|
33
|
+
return { version: '2018-05-29', payload: {} };
|
34
|
+
}
|
35
|
+
|
36
|
+
export function response(ctx) {
|
37
|
+
return {};
|
38
|
+
}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
|
+
export declare const authMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
|
3
4
|
//# sourceMappingURL=auth-resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"auth-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAQzF,eAAO,MAAM,mBAAmB,WAAY,kCAAkC,KAAG,uBAIhF,CAAC"}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js
CHANGED
@@ -1,57 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.authMappingTemplate = void 0;
|
4
7
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const
|
6
|
-
const
|
7
|
-
|
8
|
-
const
|
9
|
-
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
const authMappingTemplate = (config) => {
|
11
|
+
const resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'auth-resolver-fn.template.js'), 'utf8');
|
12
|
+
const templateName = `Mutation.${config.field.name.value}.auth.js`;
|
13
|
+
return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
|
10
14
|
};
|
11
15
|
exports.authMappingTemplate = authMappingTemplate;
|
12
|
-
const createAuthRequestFunction = () => {
|
13
|
-
const requestFunctionString = `
|
14
|
-
export function request(ctx) {
|
15
|
-
ctx.stash.hasAuth = true;
|
16
|
-
const isAuthorized = false;
|
17
|
-
|
18
|
-
if (util.authType() === 'User Pool Authorization') {
|
19
|
-
if (!isAuthorized) {
|
20
|
-
const authFilter = [];
|
21
|
-
let ownerClaim0 = ctx.identity['claims']['sub'];
|
22
|
-
ctx.args.owner = ownerClaim0;
|
23
|
-
const currentClaim1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
24
|
-
if (ownerClaim0 && currentClaim1) {
|
25
|
-
ownerClaim0 = ownerClaim0 + '::' + currentClaim1;
|
26
|
-
authFilter.push({ owner: { eq: ownerClaim0 } })
|
27
|
-
}
|
28
|
-
const role0_0 = ctx.identity['claims']['sub'];
|
29
|
-
if (role0_0) {
|
30
|
-
authFilter.push({ owner: { eq: role0_0 } });
|
31
|
-
}
|
32
|
-
// we can just reuse currentClaim1 here, but doing this (for now) to mirror the existing
|
33
|
-
// vtl auth resolver.
|
34
|
-
const role0_1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
35
|
-
if (role0_1) {
|
36
|
-
authFilter.push({ owner: { eq: role0_1 }});
|
37
|
-
}
|
38
|
-
if (authFilter.length !== 0) {
|
39
|
-
ctx.stash.authFilter = { or: authFilter };
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
if (!isAuthorized && ctx.stash.authFilter.length === 0) {
|
44
|
-
util.unauthorized();
|
45
|
-
}
|
46
|
-
return { version: '2018-05-29', payload: {} };
|
47
|
-
}`;
|
48
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
|
49
|
-
};
|
50
|
-
const createAuthResponseFunction = () => {
|
51
|
-
const responseFunctionString = `
|
52
|
-
export function response(ctx) {
|
53
|
-
return {};
|
54
|
-
}`;
|
55
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
|
56
|
-
};
|
57
16
|
//# sourceMappingURL=auth-resolver.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth-resolver.js","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"auth-resolver.js","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AASjB,MAAM,mBAAmB,GAAG,CAAC,MAA0C,EAA2B,EAAE;IACzG,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/F,MAAM,YAAY,GAAG,YAAY,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;IACnE,OAAO,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export function request(ctx) {
|
2
|
+
ctx.stash.defaultValues = ctx.stash.defaultValues ?? {};
|
3
|
+
ctx.stash.defaultValues.id = util.autoId();
|
4
|
+
const createdAt = util.time.nowISO8601();
|
5
|
+
ctx.stash.defaultValues.createdAt = createdAt;
|
6
|
+
ctx.stash.defaultValues.updatedAt = createdAt;
|
7
|
+
return {
|
8
|
+
version: '2018-05-09',
|
9
|
+
payload: {},
|
10
|
+
};
|
11
|
+
}
|
12
|
+
|
13
|
+
export function response(ctx) {
|
14
|
+
return {};
|
15
|
+
}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
|
+
export declare const initMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
|
3
4
|
//# sourceMappingURL=init-resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"init-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAQzF,eAAO,MAAM,mBAAmB,WAAY,kCAAkC,KAAG,uBAIhF,CAAC"}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js
CHANGED
@@ -1,34 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.initMappingTemplate = void 0;
|
4
7
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const
|
6
|
-
const
|
7
|
-
|
8
|
-
const
|
9
|
-
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
const initMappingTemplate = (config) => {
|
11
|
+
const resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'init-resolver-fn.template.js'), 'utf8');
|
12
|
+
const templateName = `Mutation.${config.field.name.value}.init.js`;
|
13
|
+
return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
|
10
14
|
};
|
11
15
|
exports.initMappingTemplate = initMappingTemplate;
|
12
|
-
const createInitRequestFunction = () => {
|
13
|
-
const requestFunctionString = `
|
14
|
-
export function request(ctx) {
|
15
|
-
ctx.stash.defaultValues = ctx.stash.defaultValues ?? {};
|
16
|
-
ctx.stash.defaultValues.id = util.autoId();
|
17
|
-
const createdAt = util.time.nowISO8601();
|
18
|
-
ctx.stash.defaultValues.createdAt = createdAt;
|
19
|
-
ctx.stash.defaultValues.updatedAt = createdAt;
|
20
|
-
return {
|
21
|
-
version: '2018-05-09',
|
22
|
-
payload: {}
|
23
|
-
};
|
24
|
-
}`;
|
25
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
|
26
|
-
};
|
27
|
-
const createInitResponseFunction = () => {
|
28
|
-
const responseFunctionString = `
|
29
|
-
export function response(ctx) {
|
30
|
-
return {};
|
31
|
-
}`;
|
32
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
|
33
|
-
};
|
34
16
|
//# sourceMappingURL=init-resolver.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-resolver.js","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"init-resolver.js","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AASjB,MAAM,mBAAmB,GAAG,CAAC,MAA0C,EAA2B,EAAE;IACzG,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/F,MAAM,YAAY,GAAG,YAAY,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;IACnE,OAAO,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { util } from '@aws-appsync/utils';
|
2
|
+
|
3
|
+
export function request(ctx) {
|
4
|
+
const { args, request, prev } = ctx;
|
5
|
+
[[TOOL_DEFINITIONS_LINE]]
|
6
|
+
const selectionSet = '[[SELECTION_SET]]';
|
7
|
+
const graphqlApiEndpoint = '[[GRAPHQL_API_ENDPOINT]]';
|
8
|
+
|
9
|
+
const messages = prev.result.items;
|
10
|
+
const responseMutation = {
|
11
|
+
name: '[[RESPONSE_MUTATION_NAME]]',
|
12
|
+
inputTypeName: '[[RESPONSE_MUTATION_INPUT_TYPE_NAME]]',
|
13
|
+
selectionSet,
|
14
|
+
};
|
15
|
+
const currentMessageId = ctx.stash.defaultValues.id;
|
16
|
+
[[MODEL_CONFIGURATION_LINE]]
|
17
|
+
|
18
|
+
const clientTools = args.toolConfiguration?.tools?.map((tool) => {
|
19
|
+
return { ...tool.toolSpec };
|
20
|
+
});
|
21
|
+
[[TOOLS_CONFIGURATION_LINE]]
|
22
|
+
|
23
|
+
const authHeader = request.headers['authorization'];
|
24
|
+
const payload = {
|
25
|
+
conversationId: args.conversationId,
|
26
|
+
currentMessageId,
|
27
|
+
responseMutation,
|
28
|
+
graphqlApiEndpoint,
|
29
|
+
modelConfiguration,
|
30
|
+
request: { headers: { authorization: authHeader } },
|
31
|
+
messages,
|
32
|
+
toolsConfiguration,
|
33
|
+
};
|
34
|
+
|
35
|
+
return {
|
36
|
+
operation: 'Invoke',
|
37
|
+
payload,
|
38
|
+
invocationType: 'Event',
|
39
|
+
};
|
40
|
+
}
|
41
|
+
|
42
|
+
export function response(ctx) {
|
43
|
+
if (ctx.error) {
|
44
|
+
util.appendError(ctx.error.message, ctx.error.type);
|
45
|
+
}
|
46
|
+
const response = {
|
47
|
+
__typename: '[[MESSAGE_MODEL_NAME]]',
|
48
|
+
id: ctx.stash.defaultValues.id,
|
49
|
+
conversationId: ctx.args.conversationId,
|
50
|
+
role: 'user',
|
51
|
+
content: ctx.args.content,
|
52
|
+
createdAt: ctx.stash.defaultValues.createdAt,
|
53
|
+
updatedAt: ctx.stash.defaultValues.updatedAt,
|
54
|
+
};
|
55
|
+
return response;
|
56
|
+
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
1
|
+
import { TransformerContextProvider, MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
2
|
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
|
-
|
4
|
-
export declare const invokeLambdaMappingTemplate: (config: ConversationDirectiveConfiguration, ctx: TransformerContextProvider) => JSResolverFunctionProvider;
|
3
|
+
export declare const invokeLambdaMappingTemplate: (config: ConversationDirectiveConfiguration, ctx: TransformerContextProvider) => MappingTemplateProvider;
|
5
4
|
//# sourceMappingURL=invoke-lambda-resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,
|
1
|
+
{"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAYzF,eAAO,MAAM,2BAA2B,WAC9B,kCAAkC,OACrC,0BAA0B,KAC9B,uBA8BF,CAAC"}
|
@@ -1,94 +1,56 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.invokeLambdaMappingTemplate = void 0;
|
4
7
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
const ts_dedent_1 = __importDefault(require("ts-dedent"));
|
6
11
|
const invokeLambdaMappingTemplate = (config, ctx) => {
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
12
|
+
const { TOOL_DEFINITIONS_LINE, TOOLS_CONFIGURATION_LINE } = generateToolLines(config);
|
13
|
+
const SELECTION_SET = selectionSet;
|
14
|
+
const GRAPHQL_API_ENDPOINT = ctx.api.graphqlUrl;
|
15
|
+
const MODEL_CONFIGURATION_LINE = generateModelConfigurationLine(config);
|
16
|
+
const RESPONSE_MUTATION_NAME = config.responseMutationName;
|
17
|
+
const RESPONSE_MUTATION_INPUT_TYPE_NAME = config.responseMutationInputTypeName;
|
18
|
+
const MESSAGE_MODEL_NAME = config.messageModel.messageModel.name.value;
|
19
|
+
const substitutions = {
|
20
|
+
TOOL_DEFINITIONS_LINE,
|
21
|
+
TOOLS_CONFIGURATION_LINE,
|
22
|
+
SELECTION_SET,
|
23
|
+
GRAPHQL_API_ENDPOINT,
|
24
|
+
MODEL_CONFIGURATION_LINE,
|
25
|
+
RESPONSE_MUTATION_NAME,
|
26
|
+
RESPONSE_MUTATION_INPUT_TYPE_NAME,
|
27
|
+
MESSAGE_MODEL_NAME,
|
28
|
+
};
|
29
|
+
let resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'invoke-lambda-resolver-fn.template.js'), 'utf8');
|
30
|
+
Object.entries(substitutions).forEach(([key, value]) => {
|
31
|
+
const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value);
|
32
|
+
resolver = replaced;
|
33
|
+
});
|
34
|
+
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString(resolver);
|
10
35
|
};
|
11
36
|
exports.invokeLambdaMappingTemplate = invokeLambdaMappingTemplate;
|
12
|
-
const
|
13
|
-
const { responseMutationInputTypeName, responseMutationName } = config;
|
37
|
+
const generateToolLines = (config) => {
|
14
38
|
const toolDefinitions = JSON.stringify(config.toolSpec);
|
15
|
-
const
|
16
|
-
const
|
17
|
-
|
18
|
-
const toolsConfigurationLine = toolDefinitions
|
19
|
-
? (0, ts_dedent_1.dedent) `const dataTools = toolDefinitions.tools;
|
39
|
+
const TOOL_DEFINITIONS_LINE = toolDefinitions ? `const toolDefinitions = ${toolDefinitions};` : '';
|
40
|
+
const TOOLS_CONFIGURATION_LINE = toolDefinitions
|
41
|
+
? (0, ts_dedent_1.default) `const dataTools = toolDefinitions.tools;
|
20
42
|
const toolsConfiguration = {
|
21
43
|
dataTools,
|
22
44
|
clientTools,
|
23
45
|
};`
|
24
|
-
: (0, ts_dedent_1.
|
46
|
+
: (0, ts_dedent_1.default) `const toolsConfiguration = {
|
25
47
|
clientTools
|
26
48
|
};`;
|
27
|
-
|
28
|
-
import { util } from '@aws-appsync/utils';
|
29
|
-
|
30
|
-
export function request(ctx) {
|
31
|
-
const { args, identity, request, prev } = ctx;
|
32
|
-
${toolDefinitionsLine}
|
33
|
-
const selectionSet = '${selectionSet}';
|
34
|
-
const graphqlApiEndpoint = '${graphqlEndpoint}';
|
35
|
-
|
36
|
-
const messages = prev.result.items;
|
37
|
-
const responseMutation = {
|
38
|
-
name: '${responseMutationName}',
|
39
|
-
inputTypeName: '${responseMutationInputTypeName}',
|
40
|
-
selectionSet,
|
41
|
-
};
|
42
|
-
const currentMessageId = ctx.stash.defaultValues.id;
|
43
|
-
${modelConfigurationLine}
|
44
|
-
|
45
|
-
const clientTools = args.toolConfiguration?.tools?.map((tool) => { return { ...tool.toolSpec }});
|
46
|
-
${toolsConfigurationLine}
|
47
|
-
|
48
|
-
const authHeader = request.headers['authorization'];
|
49
|
-
const payload = {
|
50
|
-
conversationId: args.conversationId,
|
51
|
-
currentMessageId,
|
52
|
-
responseMutation,
|
53
|
-
graphqlApiEndpoint,
|
54
|
-
modelConfiguration,
|
55
|
-
request: { headers: { authorization: authHeader }},
|
56
|
-
messages,
|
57
|
-
toolsConfiguration,
|
58
|
-
};
|
59
|
-
|
60
|
-
return {
|
61
|
-
operation: 'Invoke',
|
62
|
-
payload,
|
63
|
-
invocationType: 'Event'
|
64
|
-
};
|
65
|
-
}`;
|
66
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
|
67
|
-
};
|
68
|
-
const createInvokeLambdaResponseFunction = (config) => {
|
69
|
-
const responseFunctionString = `
|
70
|
-
export function response(ctx) {
|
71
|
-
let success = true;
|
72
|
-
if (ctx.error) {
|
73
|
-
util.appendError(ctx.error.message, ctx.error.type);
|
74
|
-
success = false;
|
75
|
-
}
|
76
|
-
const response = {
|
77
|
-
__typename: '${config.messageModel.messageModel.name.value}',
|
78
|
-
id: ctx.stash.defaultValues.id,
|
79
|
-
conversationId: ctx.args.conversationId,
|
80
|
-
role: 'user',
|
81
|
-
content: ctx.args.content,
|
82
|
-
createdAt: ctx.stash.defaultValues.createdAt,
|
83
|
-
updatedAt: ctx.stash.defaultValues.updatedAt,
|
84
|
-
};
|
85
|
-
return response;
|
86
|
-
}`;
|
87
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
|
49
|
+
return { TOOL_DEFINITIONS_LINE, TOOLS_CONFIGURATION_LINE };
|
88
50
|
};
|
89
51
|
const generateModelConfigurationLine = (config) => {
|
90
52
|
const { aiModel, systemPrompt } = config;
|
91
|
-
return (0, ts_dedent_1.
|
53
|
+
return (0, ts_dedent_1.default) `const modelConfiguration = {
|
92
54
|
modelId: '${aiModel}',
|
93
55
|
systemPrompt: ${JSON.stringify(systemPrompt)},
|
94
56
|
${generateModelInferenceConfigurationLine(config)}
|
@@ -97,7 +59,7 @@ const generateModelConfigurationLine = (config) => {
|
|
97
59
|
const generateModelInferenceConfigurationLine = (config) => {
|
98
60
|
const { inferenceConfiguration } = config;
|
99
61
|
return inferenceConfiguration && Object.keys(inferenceConfiguration).length > 0
|
100
|
-
? (0, ts_dedent_1.
|
62
|
+
? (0, ts_dedent_1.default) `inferenceConfiguration: ${JSON.stringify(config.inferenceConfiguration)},`
|
101
63
|
: '';
|
102
64
|
};
|
103
65
|
const selectionSet = `id conversationId content { image { format source { bytes }} text toolUse { toolUseId name input } toolResult { status toolUseId content { json text image { format source { bytes }} document { format name source { bytes }} }}} role owner createdAt updatedAt`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-lambda-resolver.js","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"invoke-lambda-resolver.js","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":";;;;;;AACA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AACxB,0DAA+B;AASxB,MAAM,2BAA2B,GAAG,CACzC,MAA0C,EAC1C,GAA+B,EACN,EAAE;IAC3B,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACtF,MAAM,aAAa,GAAG,YAAY,CAAC;IACnC,MAAM,oBAAoB,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;IAChD,MAAM,wBAAwB,GAAG,8BAA8B,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,sBAAsB,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAC3D,MAAM,iCAAiC,GAAG,MAAM,CAAC,6BAA6B,CAAC;IAC/E,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAEvE,MAAM,aAAa,GAAG;QACpB,qBAAqB;QACrB,wBAAwB;QACxB,aAAa;QACb,oBAAoB;QACpB,wBAAwB;QACxB,sBAAsB;QACtB,iCAAiC;QACjC,kBAAkB;KACnB,CAAC;IAEF,IAAI,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uCAAuC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACrD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAChF,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC,CAAC,CAAC;IAKH,OAAO,0CAAe,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC,CAAC;AAjCW,QAAA,2BAA2B,+BAiCtC;AAEF,MAAM,iBAAiB,GAAG,CAAC,MAA0C,EAAE,EAAE;IACvE,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,qBAAqB,GAAG,eAAe,CAAC,CAAC,CAAC,2BAA2B,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnG,MAAM,wBAAwB,GAAG,eAAe;QAC9C,CAAC,CAAC,IAAA,mBAAM,EAAA;;;;OAIL;QACH,CAAC,CAAC,IAAA,mBAAM,EAAA;;OAEL,CAAC;IAEN,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,CAAC;AAC7D,CAAC,CAAC;AAQF,MAAM,8BAA8B,GAAG,CAAC,MAA0C,EAAE,EAAE;IACpF,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAEzC,OAAO,IAAA,mBAAM,EAAA;gBACC,OAAO;oBACH,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;MAC1C,uCAAuC,CAAC,MAAM,CAAC;KAChD,CAAC;AACN,CAAC,CAAC;AAQF,MAAM,uCAAuC,GAAG,CAAC,MAA0C,EAAE,EAAE;IAC7F,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,CAAC;IAC1C,OAAO,sBAAsB,IAAI,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,GAAG,CAAC;QAC7E,CAAC,CAAC,IAAA,mBAAM,EAAA,2BAA2B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG;QACnF,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAKF,MAAM,YAAY,GAAG,mQAAmQ,CAAC"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
export function request(ctx) {
|
2
|
+
const { conversationId } = ctx.args;
|
3
|
+
const { authFilter } = ctx.stash;
|
4
|
+
|
5
|
+
const limit = 100;
|
6
|
+
const query = {
|
7
|
+
expression: 'conversationId = :conversationId',
|
8
|
+
expressionValues: util.dynamodb.toMapValues({
|
9
|
+
':conversationId': conversationId,
|
10
|
+
}),
|
11
|
+
};
|
12
|
+
|
13
|
+
const filter = JSON.parse(util.transform.toDynamoDBFilterExpression(authFilter));
|
14
|
+
const index = 'gsi-ConversationMessage.conversationId.createdAt';
|
15
|
+
|
16
|
+
return {
|
17
|
+
operation: 'Query',
|
18
|
+
query,
|
19
|
+
filter,
|
20
|
+
index,
|
21
|
+
scanIndexForward: false,
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
export function response(ctx) {
|
26
|
+
if (ctx.error) {
|
27
|
+
util.error(ctx.error.message, ctx.error.type);
|
28
|
+
}
|
29
|
+
const messagesWithAssistantResponse = ctx.result.items
|
30
|
+
.filter((message) => message.assistantContent !== undefined)
|
31
|
+
.reduce((acc, current) => {
|
32
|
+
acc.push({ role: 'user', content: current.content });
|
33
|
+
acc.push({ role: 'assistant', content: current.assistantContent });
|
34
|
+
return acc;
|
35
|
+
}, []);
|
36
|
+
|
37
|
+
const currentMessage = { role: 'user', content: ctx.prev.result.content };
|
38
|
+
const items = [...messagesWithAssistantResponse, currentMessage];
|
39
|
+
return { items };
|
40
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
|
+
export declare const readHistoryMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
|
3
4
|
//# sourceMappingURL=message-history-resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message-history-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/message-history-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"message-history-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/message-history-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAOzF,eAAO,MAAM,0BAA0B,WAAY,kCAAkC,KAAG,uBAIvF,CAAC"}
|
@@ -1,59 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.readHistoryMappingTemplate = void 0;
|
4
7
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const
|
6
|
-
const
|
7
|
-
|
8
|
-
const
|
9
|
-
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
const readHistoryMappingTemplate = (config) => {
|
11
|
+
const resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'message-history-resolver-fn.template.js'), 'utf8');
|
12
|
+
const templateName = `Mutation.${config.field.name.value}.message-history.js`;
|
13
|
+
return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
|
10
14
|
};
|
11
15
|
exports.readHistoryMappingTemplate = readHistoryMappingTemplate;
|
12
|
-
const createMessageHistoryRequestFunction = () => {
|
13
|
-
const requestFunctionString = `
|
14
|
-
export function request(ctx) {
|
15
|
-
const { conversationId } = ctx.args;
|
16
|
-
const { authFilter } = ctx.stash;
|
17
|
-
|
18
|
-
const limit = 100;
|
19
|
-
const query = {
|
20
|
-
expression: 'conversationId = :conversationId',
|
21
|
-
expressionValues: util.dynamodb.toMapValues({
|
22
|
-
':conversationId': ctx.args.conversationId
|
23
|
-
})
|
24
|
-
};
|
25
|
-
|
26
|
-
const filter = JSON.parse(util.transform.toDynamoDBFilterExpression(authFilter));
|
27
|
-
const index = 'gsi-ConversationMessage.conversationId.createdAt';
|
28
|
-
|
29
|
-
return {
|
30
|
-
operation: 'Query',
|
31
|
-
query,
|
32
|
-
filter,
|
33
|
-
index,
|
34
|
-
scanIndexForward: false,
|
35
|
-
}
|
36
|
-
}`;
|
37
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
|
38
|
-
};
|
39
|
-
const createMessageHistoryResponseFunction = () => {
|
40
|
-
const responseFunctionString = `
|
41
|
-
export function response(ctx) {
|
42
|
-
if (ctx.error) {
|
43
|
-
util.error(ctx.error.message, ctx.error.type);
|
44
|
-
}
|
45
|
-
const messagesWithAssistantResponse = ctx.result.items
|
46
|
-
.filter((message) => message.assistantContent !== undefined)
|
47
|
-
.reduce((acc, current) => {
|
48
|
-
acc.push({ role: 'user', content: current.content });
|
49
|
-
acc.push({ role: 'assistant', content: current.assistantContent });
|
50
|
-
return acc;
|
51
|
-
}, [])
|
52
|
-
|
53
|
-
const currentMessage = { role: 'user', content: ctx.prev.result.content };
|
54
|
-
const items = [...messagesWithAssistantResponse, currentMessage];
|
55
|
-
return { items };
|
56
|
-
}`;
|
57
|
-
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
|
58
|
-
};
|
59
16
|
//# sourceMappingURL=message-history-resolver.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message-history-resolver.js","sourceRoot":"","sources":["../../src/resolvers/message-history-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"message-history-resolver.js","sourceRoot":"","sources":["../../src/resolvers/message-history-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AAQjB,MAAM,0BAA0B,GAAG,CAAC,MAA0C,EAA2B,EAAE;IAChH,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,yCAAyC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1G,MAAM,YAAY,GAAG,YAAY,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,qBAAqB,CAAC;IAC9E,OAAO,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAJW,QAAA,0BAA0B,8BAIrC"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
export function request(ctx) {
|
2
|
+
const { authFilter } = ctx.stash;
|
3
|
+
|
4
|
+
const query = {
|
5
|
+
expression: 'id = :id',
|
6
|
+
expressionValues: util.dynamodb.toMapValues({
|
7
|
+
':id': ctx.args.conversationId,
|
8
|
+
}),
|
9
|
+
};
|
10
|
+
|
11
|
+
const filter = JSON.parse(util.transform.toDynamoDBFilterExpression(authFilter));
|
12
|
+
|
13
|
+
return {
|
14
|
+
operation: 'Query',
|
15
|
+
query,
|
16
|
+
filter,
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
export function response(ctx) {
|
21
|
+
if (ctx.error) {
|
22
|
+
util.error(ctx.error.message, ctx.error.type);
|
23
|
+
}
|
24
|
+
|
25
|
+
if (ctx.result.items.length !== 0) {
|
26
|
+
return ctx.result.items[0];
|
27
|
+
}
|
28
|
+
|
29
|
+
util.error('Conversation not found', 'ResourceNotFound');
|
30
|
+
}
|
@@ -1,3 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
|
+
export declare const verifySessionOwnerMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
|
3
4
|
//# sourceMappingURL=verify-session-owner-resolver.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"verify-session-owner-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/verify-session-owner-resolver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"verify-session-owner-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/verify-session-owner-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAOzF,eAAO,MAAM,iCAAiC,WAAY,kCAAkC,KAAG,uBAI9F,CAAC"}
|