@aws-amplify/graphql-api-construct 1.16.0-gen2-migration-1015.0 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +78 -151
- package/API.md +1 -11
- package/CHANGELOG.md +17 -1
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +9 -12
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/internal/metadata.d.ts +4 -0
- package/lib/internal/metadata.js +42 -0
- 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 +5 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +14 -14
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +14 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts +44 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.js +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/conversation-model.d.ts +10 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/conversation-model.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/{session-model.js → conversation-model.js} +18 -24
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/conversation-model.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts +10 -10
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js +46 -51
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.d.ts +14 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.js +30 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts +1 -24
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js +1 -7
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-pipeline-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-pipeline-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-pipeline-definition.js +53 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-pipeline-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-subscription-pipeline-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-subscription-pipeline-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-subscription-pipeline-definition.js +21 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-subscription-pipeline-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/generate-resolver.d.ts +7 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/generate-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/generate-resolver.js +41 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/generate-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.d.ts +7 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.js +15 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.d.ts +2 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.js +11 -13
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/resolver-function-definition.d.ts +23 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/resolver-function-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/resolver-function-definition.js +18 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/resolver-function-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js +85 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/send-message-pipeline-definition.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{assistant-messages-subscription-resolver-fn.template.js → templates/assistant-messages-subscription-resolver-fn.template.js} +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{invoke-lambda-resolver-fn.template.js → templates/invoke-lambda-resolver-fn.template.js} +8 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{list-messages-init-resolver-fn.template.js → templates/list-messages-init-resolver-fn.template.js} +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/{utils → tools}/graphql-json-schema-type.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/graphql-json-schema-type.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/{utils → tools}/graphql-json-schema-type.js +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/{utils → tools}/graphql-json-schema-type.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/{utils/tools.d.ts → tools/process-tools.d.ts} +8 -14
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/{utils/tools.js → tools/process-tools.js} +21 -21
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts +3 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js +65 -16
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts +2 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js +18 -19
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts +2 -7
- 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 +48 -98
- 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 +14 -13
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +2 -2
- 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/lib/directives/conversation.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.js +6 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.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 +5 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +5 -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/package.json +12 -12
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -13
- 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.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 -6
- 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/package.json +10 -13
- 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 +8 -8
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +5 -3
- 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/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 +5 -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 +5 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +5 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +18 -18
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +0 -4
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +4 -7
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +1 -1
- 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 +2 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.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 +1 -11
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +0 -11
- 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/package.json +2 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +0 -10
- 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/API.md +1 -0
- package/node_modules/graphql-transformer-common/CHANGELOG.md +7 -3
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts +1 -0
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js +1 -0
- package/node_modules/graphql-transformer-common/lib/TypescriptSchemaConstants.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +3 -3
- package/package.json +22 -22
- package/src/amplify-graphql-api.ts +12 -12
- package/src/internal/metadata.ts +40 -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/graphql-types/session-model.d.ts +0 -10
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js +0 -16
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js +0 -25
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js +0 -16
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts +0 -3
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js +0 -22
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js +0 -77
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts +0 -5
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js +0 -34
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js +0 -25
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/graphql-json-schema-type.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.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/import-table.d.ts +0 -7
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/import-table.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/import-table.js +0 -205
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/import-table.js.map +0 -1
- 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/@aws-amplify/graphql-transformer-interfaces/LICENSE +0 -201
- package/node_modules/graphql-mapping-template/LICENSE +0 -201
- /package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{assistant-mutation-resolver-fn.template.js → templates/assistant-mutation-resolver-fn.template.js} +0 -0
- /package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{auth-resolver-fn.template.js → templates/auth-resolver-fn.template.js} +0 -0
- /package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{init-resolver-fn.template.js → templates/init-resolver-fn.template.js} +0 -0
- /package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{verify-session-owner-resolver-fn.template.js → templates/verify-session-owner-resolver-fn.template.js} +0 -0
- /package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{write-message-to-table-resolver-fn.template.js → templates/write-message-to-table-resolver-fn.template.js} +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createS3AssetMappingTemplateGenerator = exports.createResolverFunctionDefinition = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const createResolverFunctionDefinition = (definition) => {
|
6
|
+
var _a, _b;
|
7
|
+
return {
|
8
|
+
...definition,
|
9
|
+
dataSource: (_a = definition.dataSource) !== null && _a !== void 0 ? _a : NONE_DATA_SOURCE,
|
10
|
+
substitutions: (_b = definition.substitutions) !== null && _b !== void 0 ? _b : EMPTY_SUBSTITUTIONS,
|
11
|
+
};
|
12
|
+
};
|
13
|
+
exports.createResolverFunctionDefinition = createResolverFunctionDefinition;
|
14
|
+
const createS3AssetMappingTemplateGenerator = (parentName, slotName, fieldName) => (config, code) => graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(code, `${parentName}.${fieldName(config)}.${slotName}.js`);
|
15
|
+
exports.createS3AssetMappingTemplateGenerator = createS3AssetMappingTemplateGenerator;
|
16
|
+
const NONE_DATA_SOURCE = () => undefined;
|
17
|
+
const EMPTY_SUBSTITUTIONS = () => ({});
|
18
|
+
//# sourceMappingURL=resolver-function-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resolver-function-definition.js","sourceRoot":"","sources":["../../src/resolvers/resolver-function-definition.ts"],"names":[],"mappings":";;;AAEA,oFAAwE;AAOjE,MAAM,gCAAgC,GAAG,CAC9C,UAAgF,EACpD,EAAE;;IAC9B,OAAO;QACL,GAAG,UAAU;QACb,UAAU,EAAE,MAAA,UAAU,CAAC,UAAU,mCAAI,gBAAgB;QACrD,aAAa,EAAE,MAAA,UAAU,CAAC,aAAa,mCAAI,mBAAmB;KAC/D,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,gCAAgC,oCAQ3C;AA0BK,MAAM,qCAAqC,GAChD,CAAC,UAAkB,EAAE,QAAgB,EAAE,SAAiE,EAAE,EAAE,CAC5G,CAAC,MAA0C,EAAE,IAAY,EAAE,EAAE,CAC3D,0CAAe,CAAC,+BAA+B,CAAC,IAAI,EAAE,GAAG,UAAU,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,QAAQ,KAAK,CAAC,CAAC;AAHlG,QAAA,qCAAqC,yCAG6D;AAI/G,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AACzC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"send-message-pipeline-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/send-message-pipeline-definition.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAKxC,eAAO,MAAM,6BAA6B,EAAE,kBAK3C,CAAC"}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.sendMessagePipelineDefinition = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const name_values_1 = require("../graphql-types/name-values");
|
6
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
7
|
+
exports.sendMessagePipelineDefinition = {
|
8
|
+
requestSlots: [init(), auth(), verifySessionOwner(), writeMessageToTable()],
|
9
|
+
dataSlot: invokeLambda(),
|
10
|
+
responseSlots: [],
|
11
|
+
field: (config) => ({ typeName: 'Mutation', fieldName: config.field.name.value }),
|
12
|
+
};
|
13
|
+
function init() {
|
14
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
15
|
+
slotName: 'init',
|
16
|
+
fileName: 'init-resolver-fn.template.js',
|
17
|
+
generateTemplate: (_, code) => graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString(code),
|
18
|
+
substitutions: (_, ctx) => ({
|
19
|
+
GRAPHQL_API_ENDPOINT: ctx.api.graphqlUrl,
|
20
|
+
}),
|
21
|
+
});
|
22
|
+
}
|
23
|
+
function auth() {
|
24
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
25
|
+
slotName: 'auth',
|
26
|
+
fileName: 'auth-resolver-fn.template.js',
|
27
|
+
generateTemplate: templateGenerator('auth'),
|
28
|
+
});
|
29
|
+
}
|
30
|
+
function verifySessionOwner() {
|
31
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
32
|
+
slotName: 'verifySessionOwner',
|
33
|
+
fileName: 'verify-session-owner-resolver-fn.template.js',
|
34
|
+
generateTemplate: templateGenerator('verify-session-owner'),
|
35
|
+
dataSource: (config) => config.dataSources.conversationTableDataSource,
|
36
|
+
substitutions: () => ({
|
37
|
+
CONVERSATION_ID_PARENT: 'ctx.args',
|
38
|
+
}),
|
39
|
+
});
|
40
|
+
}
|
41
|
+
function writeMessageToTable() {
|
42
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
43
|
+
slotName: 'writeMessageToTable',
|
44
|
+
fileName: 'write-message-to-table-resolver-fn.template.js',
|
45
|
+
generateTemplate: templateGenerator('write-message-to-table'),
|
46
|
+
dataSource: (config) => config.dataSources.messageTableDataSource,
|
47
|
+
substitutions: (config) => ({
|
48
|
+
CONVERSATION_MESSAGE_TYPE_NAME: config.message.model.name.value,
|
49
|
+
}),
|
50
|
+
});
|
51
|
+
}
|
52
|
+
function invokeLambda() {
|
53
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
54
|
+
slotName: 'data',
|
55
|
+
fileName: 'invoke-lambda-resolver-fn.template.js',
|
56
|
+
generateTemplate: templateGenerator('invoke-lambda'),
|
57
|
+
dataSource: (config) => config.dataSources.lambdaFunctionDataSource,
|
58
|
+
substitutions: invokeLambdaResolverSubstitutions,
|
59
|
+
});
|
60
|
+
}
|
61
|
+
function invokeLambdaResolverSubstitutions(config) {
|
62
|
+
return {
|
63
|
+
MODEL_ID: JSON.stringify(config.aiModel),
|
64
|
+
SYSTEM_PROMPT: JSON.stringify(config.systemPrompt),
|
65
|
+
DATA_TOOLS: JSON.stringify(config.toolSpec),
|
66
|
+
SELECTION_SET: selectionSet,
|
67
|
+
INFERENCE_CONFIGURATION: JSON.stringify(config.inferenceConfiguration),
|
68
|
+
RESPONSE_MUTATION_NAME: config.assistantResponseMutation.field.name.value,
|
69
|
+
RESPONSE_MUTATION_INPUT_TYPE_NAME: config.assistantResponseMutation.input.name.value,
|
70
|
+
MESSAGE_MODEL_NAME: config.message.model.name.value,
|
71
|
+
GET_QUERY_NAME: (0, name_values_1.getConversationMessageGetQueryName)(config),
|
72
|
+
GET_QUERY_INPUT_TYPE_NAME: name_values_1.CONVERSATION_MESSAGE_GET_QUERY_INPUT_TYPE_NAME,
|
73
|
+
LIST_QUERY_NAME: (0, name_values_1.getConversationMessageListQueryName)(config),
|
74
|
+
LIST_QUERY_INPUT_TYPE_NAME: (0, name_values_1.getConversationMessageListQueryInputTypeName)(config),
|
75
|
+
LIST_QUERY_LIMIT: 'undefined',
|
76
|
+
};
|
77
|
+
}
|
78
|
+
function fieldName(config) {
|
79
|
+
return config.field.name.value;
|
80
|
+
}
|
81
|
+
function templateGenerator(slotName) {
|
82
|
+
return (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Mutation', slotName, fieldName);
|
83
|
+
}
|
84
|
+
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`;
|
85
|
+
//# sourceMappingURL=send-message-pipeline-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"send-message-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/send-message-pipeline-definition.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,8DAKsC;AACtC,iFAKwC;AAK3B,QAAA,6BAA6B,GAAuB;IAC/D,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,EAAE,mBAAmB,EAAE,CAAC;IAC3E,QAAQ,EAAE,YAAY,EAAE;IACxB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAA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,MAAM,CAAC;QAChF,gBAAgB,EAAE,WAAW;KAC9B,CAAC;AACJ,CAAC;AAKD,SAAS,SAAS,CAAC,MAA0C;IAC3D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACjC,CAAC;AAKD,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,IAAA,oEAAqC,EAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,YAAY,GAAG,mQAAmQ,CAAC"}
|
@@ -32,7 +32,7 @@ export function request(ctx) {
|
|
32
32
|
if (!isAuthorized && ctx.stash.authFilter.length === 0) {
|
33
33
|
util.unauthorized();
|
34
34
|
}
|
35
|
-
ctx.args.filter = { ...ctx.
|
35
|
+
ctx.args.filter = { ...ctx.stash.authFilter, and: [{ conversationId: { eq: ctx.args.conversationId } }] };
|
36
36
|
return { version: '2018-05-29', payload: {} };
|
37
37
|
}
|
38
38
|
|
@@ -4,7 +4,6 @@ export function request(ctx) {
|
|
4
4
|
const { args, request } = ctx;
|
5
5
|
const { graphqlApiEndpoint } = ctx.stash;
|
6
6
|
|
7
|
-
[[TOOL_DEFINITIONS_LINE]]
|
8
7
|
const selectionSet = '[[SELECTION_SET]]';
|
9
8
|
|
10
9
|
const responseMutation = {
|
@@ -13,12 +12,18 @@ export function request(ctx) {
|
|
13
12
|
selectionSet,
|
14
13
|
};
|
15
14
|
const currentMessageId = ctx.stash.defaultValues.id;
|
16
|
-
|
15
|
+
|
16
|
+
const modelConfiguration = {
|
17
|
+
modelId: [[MODEL_ID]],
|
18
|
+
systemPrompt: [[SYSTEM_PROMPT]],
|
19
|
+
inferenceConfiguration: [[INFERENCE_CONFIGURATION]],
|
20
|
+
};
|
17
21
|
|
18
22
|
const clientTools = args.toolConfiguration?.tools?.map((tool) => {
|
19
23
|
return { ...tool.toolSpec };
|
20
24
|
});
|
21
|
-
[[
|
25
|
+
const dataTools = [[DATA_TOOLS]];
|
26
|
+
const toolsConfiguration = { dataTools, clientTools };
|
22
27
|
|
23
28
|
const messageHistoryQuery = {
|
24
29
|
getQueryName: '[[GET_QUERY_NAME]]',
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { JSONSchema } from '@aws-amplify/graphql-transformer-core';
|
1
2
|
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
3
|
import { TypeNode } from 'graphql';
|
3
|
-
import { JSONSchema } from '@aws-amplify/graphql-transformer-core';
|
4
4
|
export declare function generateJSONSchemaFromTypeNode(typeNode: TypeNode, ctx: TransformerContextProvider, schema?: JSONSchema): JSONSchema;
|
5
5
|
//# sourceMappingURL=graphql-json-schema-type.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"graphql-json-schema-type.d.ts","sourceRoot":"","sources":["../../src/tools/graphql-json-schema-type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAOL,QAAQ,EAET,MAAM,SAAS,CAAC;AAUjB,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,0BAA0B,EAC/B,MAAM,GAAE,UAAyB,GAChC,UAAU,CASZ"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.generateJSONSchemaFromTypeNode = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
4
5
|
const graphql_1 = require("graphql");
|
5
6
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
6
|
-
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
7
7
|
function generateJSONSchemaFromTypeNode(typeNode, ctx, schema = { type: '' }) {
|
8
8
|
switch (typeNode.kind) {
|
9
9
|
case graphql_1.Kind.NAMED_TYPE:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graphql-json-schema-type.js","sourceRoot":"","sources":["../../src/
|
1
|
+
{"version":3,"file":"graphql-json-schema-type.js","sourceRoot":"","sources":["../../src/tools/graphql-json-schema-type.ts"],"names":[],"mappings":";;;AAAA,oFAK+C;AAE/C,qCASiB;AACjB,2EAAmE;AASnE,SAAgB,8BAA8B,CAC5C,QAAkB,EAClB,GAA+B,EAC/B,SAAqB,EAAE,IAAI,EAAE,EAAE,EAAE;IAEjC,QAAQ,QAAQ,CAAC,IAAI,EAAE;QACrB,KAAK,cAAI,CAAC,UAAU;YAClB,OAAO,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAChD,KAAK,cAAI,CAAC,aAAa;YACrB,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAClD,KAAK,cAAI,CAAC,SAAS;YACjB,OAAO,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;KAChD;AACH,CAAC;AAbD,wEAaC;AASD,SAAS,eAAe,CAAC,QAAuB,EAAE,GAA+B,EAAE,MAAkB;IACnG,MAAM,eAAe,GAAG,IAAA,uDAA4B,EAAC,QAAQ,CAAC,CAAC;IAC/D,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAEvC,IAAI,IAAA,qCAAQ,EAAC,QAAQ,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC;KACf;IAED,MAAM,YAAY,GAAG,IAAA,wCAAW,EAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,QAAQ,YAAY,YAAY,CAAC,CAAC;KACnD;IAED,MAAM,CAAC,UAAU,GAAG,mCAAmC,CAAC,OAAO,EA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AC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,8BAA8B,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACtF,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,cAAI,CAAC,aAAa,EAAE;YAC1C,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAClE;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,eAAe,GAAG,CAAC,IAAI,CAAC,KAAK,gBAAgB,CAAC,CAAC;KAChE;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAOD,SAAS,oBAAoB,CAAC,GAA2B;;IACvD,OAAO;QACL,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAA,GAAG,CAAC,MAAM,0CAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SACnD;KACF,CAAC;AACJ,CAAC"}
|
@@ -1,25 +1,19 @@
|
|
1
1
|
import { JSONSchema } from '@aws-amplify/graphql-transformer-core';
|
2
2
|
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
3
|
-
|
3
|
+
import { ToolDefinition } from '../conversation-directive-configuration';
|
4
|
+
export type Tool = {
|
4
5
|
name: string;
|
5
6
|
description: string;
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
inputSchema: {
|
8
|
+
json: JSONSchema;
|
9
|
+
};
|
10
|
+
graphqlRequestInputDescriptor?: GraphQLRequestInputDescriptor;
|
9
11
|
};
|
10
12
|
type GraphQLRequestInputDescriptor = {
|
11
13
|
selectionSet: string;
|
12
14
|
propertyTypes: Record<string, string>;
|
13
15
|
queryName: string;
|
14
16
|
};
|
15
|
-
|
16
|
-
name: string;
|
17
|
-
description: string;
|
18
|
-
inputSchema: {
|
19
|
-
json: JSONSchema;
|
20
|
-
};
|
21
|
-
graphqlRequestInputDescriptor?: GraphQLRequestInputDescriptor;
|
22
|
-
};
|
23
|
-
export declare const processTools: (toolDefinitions: ToolDefinition[], ctx: TransformerContextProvider) => Tools | undefined;
|
17
|
+
export declare const processTools: (toolDefinitions: ToolDefinition[], ctx: TransformerContextProvider) => Tool[] | undefined;
|
24
18
|
export {};
|
25
|
-
//# sourceMappingURL=tools.d.ts.map
|
19
|
+
//# sourceMappingURL=process-tools.d.ts.map
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"process-tools.d.ts","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAGzF,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;IACF,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;CAC/D,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAUF,eAAO,MAAM,YAAY,oBAAqB,cAAc,EAAE,OAAO,0BAA0B,KAAG,IAAI,EAAE,GAAG,SAyB1G,CAAC"}
|
@@ -4,6 +4,26 @@ exports.processTools = void 0;
|
|
4
4
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
5
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
6
6
|
const graphql_json_schema_type_1 = require("./graphql-json-schema-type");
|
7
|
+
const processTools = (toolDefinitions, ctx) => {
|
8
|
+
if (!toolDefinitions || toolDefinitions.length === 0) {
|
9
|
+
return undefined;
|
10
|
+
}
|
11
|
+
const queryType = ctx.output.getType('Query');
|
12
|
+
if (!queryType.fields || queryType.fields.length === 0) {
|
13
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError('Tools must be queries - no queries found in the schema');
|
14
|
+
}
|
15
|
+
const tools = toolDefinitions.map((toolDefinition) => {
|
16
|
+
var _a;
|
17
|
+
const { name: toolName, description } = toolDefinition;
|
18
|
+
const queryField = (_a = queryType.fields) === null || _a === void 0 ? void 0 : _a.find((field) => field.name.value === toolName);
|
19
|
+
if (!queryField) {
|
20
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool "${toolName}" defined in @conversation directive has no matching Query field definition`);
|
21
|
+
}
|
22
|
+
return createTool(toolName, description, queryField, ctx);
|
23
|
+
});
|
24
|
+
return tools;
|
25
|
+
};
|
26
|
+
exports.processTools = processTools;
|
7
27
|
const generateSelectionSet = (currentType, ctx, seenTypes = new Set(), fieldName = '') => {
|
8
28
|
if ((0, graphql_transformer_common_1.isScalar)(currentType)) {
|
9
29
|
return fieldName;
|
@@ -37,26 +57,6 @@ const getObjectTypeFromName = (name, ctx) => {
|
|
37
57
|
}
|
38
58
|
return node;
|
39
59
|
};
|
40
|
-
const processTools = (toolDefinitions, ctx) => {
|
41
|
-
if (!toolDefinitions || toolDefinitions.length === 0) {
|
42
|
-
return undefined;
|
43
|
-
}
|
44
|
-
const queryType = ctx.output.getType('Query');
|
45
|
-
if (!queryType.fields || queryType.fields.length === 0) {
|
46
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError('Tools must be queries - no queries found in the schema');
|
47
|
-
}
|
48
|
-
const tools = toolDefinitions.map((toolDefinition) => {
|
49
|
-
var _a;
|
50
|
-
const { name: toolName, description } = toolDefinition;
|
51
|
-
const queryField = (_a = queryType.fields) === null || _a === void 0 ? void 0 : _a.find((field) => field.name.value === toolName);
|
52
|
-
if (!queryField) {
|
53
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool "${toolName}" defined in @conversation directive has no matching Query field definition`);
|
54
|
-
}
|
55
|
-
return createTool(toolName, description, queryField, ctx);
|
56
|
-
});
|
57
|
-
return { tools };
|
58
|
-
};
|
59
|
-
exports.processTools = processTools;
|
60
60
|
const createTool = (toolName, description, queryField, ctx) => {
|
61
61
|
const { type: returnType, arguments: fieldArguments } = queryField;
|
62
62
|
const { properties, required } = generateToolProperties(fieldArguments, ctx, toolName, returnType);
|
@@ -113,4 +113,4 @@ const generatePropertyTypes = (fieldArguments, toolName, returnType) => {
|
|
113
113
|
const isModelListOperation = (toolName, responseType) => {
|
114
114
|
return (0, graphql_transformer_common_1.getBaseType)(responseType).startsWith('Model') && toolName.startsWith('list');
|
115
115
|
};
|
116
|
-
//# sourceMappingURL=tools.js.map
|
116
|
+
//# sourceMappingURL=process-tools.js.map
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"process-tools.js","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":";;;AAAA,oFAA0F;AAG1F,2EAAkF;AAElF,yEAA4E;AAyBrE,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,GAA+B,EAAsB,EAAE;IAErH,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAGD,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAA6B,CA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AI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC7C;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAoE,CACnG,CAAC;AACJ,CAAC,CAAC;AAQF,MAAM,qBAAqB,GAAG,CAC5B,cAA+D,EAC/D,QAAgB,EAChB,UAAoB,EACI,EAAE;IAC1B,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;QAClD,OAAO,EAAE,CAAC;KACX;IAED,IAAI,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE;QAC9C,OAAO,EAAE,CAAC;KACX;IAED,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE;QAClD,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;QACtC,MAAM,MAAM,GAAG,IAAA,0CAAa,EAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,GAAG,CAAC,IAAI,CAAC,GAAG,IAAA,wCAAW,EAAC,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;QACrD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAA4B,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAE,YAAsB,EAAW,EAAE;IACjF,OAAO,IAAA,wCAAW,EAAC,YAAY,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACtF,CAAC,CAAC"}
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import { TransformerSchemaVisitStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
2
|
import { DirectiveNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
3
|
-
import { ConversationDirectiveConfiguration } from '../
|
3
|
+
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
4
4
|
export declare class ConversationFieldHandler {
|
5
5
|
getDirectiveConfig(parent: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, definition: FieldDefinitionNode, directive: DirectiveNode, context: TransformerSchemaVisitStepContextProvider): ConversationDirectiveConfiguration;
|
6
6
|
private getConversationConfig;
|
7
7
|
private createModels;
|
8
|
+
private createSupportingFields;
|
8
9
|
private validate;
|
10
|
+
private validateHandler;
|
9
11
|
private validateReturnType;
|
10
12
|
private validateInferenceConfig;
|
11
13
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,
|
1
|
+
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EACL,aAAa,EACb,mBAAmB,EAEnB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAsB7F,qBAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAAG,2BAA2B,EAC9D,UAAU,EAAE,mBAAmB,EAC/B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,yCAAyC,GACjD,kCAAkC;IA0BrC,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,sBAAsB;IAgC9B,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,uBAAuB;CAqBhC"}
|
@@ -1,21 +1,47 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
26
|
exports.ConversationFieldHandler = void 0;
|
4
27
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
-
const
|
6
|
-
const
|
28
|
+
const semver = __importStar(require("semver"));
|
29
|
+
const conversation_model_1 = require("../graphql-types/conversation-model");
|
7
30
|
const message_model_1 = require("../graphql-types/message-model");
|
31
|
+
const name_values_1 = require("../graphql-types/name-values");
|
8
32
|
class ConversationFieldHandler {
|
9
33
|
getDirectiveConfig(parent, definition, directive, context) {
|
10
34
|
if (parent.name.value !== 'Mutation') {
|
11
35
|
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation directive must be used on Mutation field.');
|
12
36
|
}
|
13
|
-
const
|
14
|
-
const
|
15
|
-
|
16
|
-
config
|
17
|
-
|
18
|
-
|
37
|
+
const parsedConfig = this.getConversationConfig(directive, parent, definition, context);
|
38
|
+
const conversationModels = this.createModels(parsedConfig, definition);
|
39
|
+
const supportingFields = this.createSupportingFields(parsedConfig);
|
40
|
+
const config = {
|
41
|
+
...parsedConfig,
|
42
|
+
...conversationModels,
|
43
|
+
...supportingFields,
|
44
|
+
};
|
19
45
|
this.validate(config);
|
20
46
|
return config;
|
21
47
|
}
|
@@ -25,7 +51,6 @@ class ConversationFieldHandler {
|
|
25
51
|
parent,
|
26
52
|
directive,
|
27
53
|
field: definition,
|
28
|
-
inferenceConfiguration: {},
|
29
54
|
}, (0, graphql_transformer_core_1.generateGetArgumentsInput)(context.transformParameters));
|
30
55
|
return config;
|
31
56
|
}
|
@@ -33,17 +58,39 @@ class ConversationFieldHandler {
|
|
33
58
|
if (definition.type.kind !== 'NamedType' || definition.type.name.value !== 'ConversationMessage') {
|
34
59
|
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be ConversationMessage');
|
35
60
|
}
|
36
|
-
const
|
37
|
-
const
|
38
|
-
const
|
39
|
-
const
|
40
|
-
|
41
|
-
|
42
|
-
|
61
|
+
const conversationMessageTypeName = (0, name_values_1.getConversationMessageTypeName)(config);
|
62
|
+
const conversationTypeName = (0, name_values_1.getConversationTypeName)(config);
|
63
|
+
const message = (0, message_model_1.createMessageModel)(conversationTypeName, conversationMessageTypeName, name_values_1.CONVERSATION_MESSAGES_REFERENCE_FIELD_NAME, definition.type);
|
64
|
+
const conversation = (0, conversation_model_1.createConversationModel)(conversationTypeName, conversationMessageTypeName, name_values_1.CONVERSATION_MESSAGES_REFERENCE_FIELD_NAME);
|
65
|
+
return { message, conversation };
|
66
|
+
}
|
67
|
+
createSupportingFields(config) {
|
68
|
+
const conversationMessageTypeName = (0, name_values_1.getConversationMessageTypeName)(config);
|
69
|
+
const messageSubscriptionFieldName = (0, name_values_1.getMessageSubscriptionFieldName)(config);
|
70
|
+
const assistantMutationFieldName = (0, name_values_1.getAssistantMutationFieldName)(config);
|
71
|
+
const assistantResponseSubscriptionField = (0, message_model_1.createMessageSubscription)(messageSubscriptionFieldName, conversationMessageTypeName, assistantMutationFieldName);
|
72
|
+
const assistantResponseMutationInput = (0, message_model_1.createAssistantResponseMutationInput)(conversationMessageTypeName);
|
73
|
+
const assistantResponseMutationField = (0, message_model_1.createAssistantMutationField)(assistantMutationFieldName, conversationMessageTypeName, assistantResponseMutationInput.name.value);
|
74
|
+
return {
|
75
|
+
assistantResponseMutation: { field: assistantResponseMutationField, input: assistantResponseMutationInput },
|
76
|
+
assistantResponseSubscriptionField,
|
77
|
+
};
|
43
78
|
}
|
44
79
|
validate(config) {
|
45
80
|
this.validateReturnType(config);
|
46
81
|
this.validateInferenceConfig(config);
|
82
|
+
this.validateHandler(config);
|
83
|
+
}
|
84
|
+
validateHandler(config) {
|
85
|
+
if (config.handler && config.functionName) {
|
86
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError("'functionName' and 'handler' are mutually exclusive");
|
87
|
+
}
|
88
|
+
if (config.handler) {
|
89
|
+
const eventVersion = semver.coerce(config.handler.eventVersion);
|
90
|
+
if ((eventVersion === null || eventVersion === void 0 ? void 0 : eventVersion.major) !== 1) {
|
91
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`Unsupported custom conversation handler. Expected eventVersion to match 1.x, received ${config.handler.eventVersion}`);
|
92
|
+
}
|
93
|
+
}
|
47
94
|
}
|
48
95
|
validateReturnType(config) {
|
49
96
|
const { field } = config;
|
@@ -52,6 +99,8 @@ class ConversationFieldHandler {
|
|
52
99
|
}
|
53
100
|
}
|
54
101
|
validateInferenceConfig(config) {
|
102
|
+
if (!config.inferenceConfiguration)
|
103
|
+
return;
|
55
104
|
const { maxTokens, temperature, topP } = config.inferenceConfiguration;
|
56
105
|
if (maxTokens !== undefined && maxTokens < 1) {
|
57
106
|
throw new graphql_transformer_core_1.InvalidDirectiveError(`@conversation directive maxTokens valid range: Minimum value of 1. Provided: ${maxTokens}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2H;AAS3H,+CAAiC;AAEjC,4EAAiG;AACjG,kEAMwC;AACxC,8DAMsC;AAOtC,MAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAA8D,EAC9D,UAA+B,EAC/B,SAAwB,EACxB,OAAkD;QAElD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;YACpC,MAAM,IAAI,gDAAqB,CAAC,yDAAyD,CAAC,CAAC;SAC5F;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACxF,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG;YACb,GAAG,YAAY;YACf,GAAG,kBAAkB;YACrB,GAAG,gBAAgB;SACpB,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IAYO,qBAAqB,CAC3B,SAAwB,EACxB,MAA8D,EAC9D,UAA+B,EAC/B,OAAkD;QAElD,MAAM,gBAAgB,GAAG,IAAI,2CAAgB,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,gBAA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AAM,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAGvE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,GAAG,CAAC,EAAE;YAC5C,MAAM,IAAI,gDAAqB,CAAC,gFAAgF,SAAS,EAAE,CAAC,CAAC;SAC9H;QAED,IAAI,WAAW,KAAK,SAAS,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,EAAE;YACrE,MAAM,IAAI,gDAAqB,CAC7B,sGAAsG,WAAW,EAAE,CACpH,CAAC;SACH;QAED,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,EAAE;YAChD,MAAM,IAAI,gDAAqB,CAC7B,+FAA+F,IAAI,EAAE,CACtG,CAAC;SACH;IACH,CAAC;CACF;AA/LD,4DA+LC"}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { TransformerPrepareStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
1
|
import { ModelTransformer } from '@aws-amplify/graphql-model-transformer';
|
3
2
|
import { BelongsToTransformer, HasManyTransformer } from '@aws-amplify/graphql-relational-transformer';
|
4
|
-
import { TransformerAuthProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
5
|
-
import { ConversationDirectiveConfiguration } from '../
|
3
|
+
import { TransformerAuthProvider, TransformerPrepareStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
4
|
+
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
6
5
|
export declare class ConversationPrepareHandler {
|
7
6
|
private modelTransformer;
|
8
7
|
private hasManyTransformer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEvG,OAAO,EAAE,uBAAuB,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AAC7H,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAO7F,qBAAa,0BAA0B;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,YAAY,CAA0B;gBAU5C,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,uBAAuB;IAmBvC,OAAO,CAAC,GAAG,EAAE,qCAAqC,EAAE,UAAU,EAAE,kCAAkC,EAAE,GAAG,IAAI;IAkB3G,OAAO,CAAC,4BAA4B;CA2CrC"}
|
@@ -15,29 +15,28 @@ class ConversationPrepareHandler {
|
|
15
15
|
}
|
16
16
|
}
|
17
17
|
prepareResourcesForDirective(directive, ctx) {
|
18
|
-
const {
|
19
|
-
const
|
20
|
-
const
|
21
|
-
|
22
|
-
ctx.output.
|
23
|
-
ctx.output.
|
24
|
-
ctx.output.
|
25
|
-
ctx.output.addObject(
|
26
|
-
ctx.
|
27
|
-
ctx.providerRegistry.registerDataSourceProvider(
|
28
|
-
ctx.
|
29
|
-
ctx.dataSourceStrategies[
|
30
|
-
|
31
|
-
this.modelTransformer.object(
|
32
|
-
this.modelTransformer.object(messageModel, messageModelDirective, ctx);
|
18
|
+
const { conversation, message, assistantResponseMutation, assistantResponseSubscriptionField } = directive;
|
19
|
+
const conversationName = conversation.model.name.value;
|
20
|
+
const messageName = message.model.name.value;
|
21
|
+
ctx.output.addInput(assistantResponseMutation.input);
|
22
|
+
ctx.output.addMutationFields([assistantResponseMutation.field]);
|
23
|
+
ctx.output.addSubscriptionFields([assistantResponseSubscriptionField]);
|
24
|
+
ctx.output.addObject(conversation.model);
|
25
|
+
ctx.output.addObject(message.model);
|
26
|
+
ctx.providerRegistry.registerDataSourceProvider(conversation.model, this.modelTransformer);
|
27
|
+
ctx.providerRegistry.registerDataSourceProvider(message.model, this.modelTransformer);
|
28
|
+
ctx.dataSourceStrategies[conversationName] = graphql_transformer_core_1.DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY;
|
29
|
+
ctx.dataSourceStrategies[messageName] = graphql_transformer_core_1.DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY;
|
30
|
+
this.modelTransformer.object(conversation.model, conversation.modelDirective, ctx);
|
31
|
+
this.modelTransformer.object(message.model, message.modelDirective, ctx);
|
33
32
|
this.modelTransformer.before(ctx);
|
34
|
-
this.belongsToTransformer.field(
|
35
|
-
this.hasManyTransformer.field(
|
33
|
+
this.belongsToTransformer.field(message.model, message.conversationField, message.belongsToConversationDirective, ctx);
|
34
|
+
this.hasManyTransformer.field(conversation.model, conversation.messagesField, conversation.hasManyMessagesDirective, ctx);
|
36
35
|
if (!this.authProvider.object) {
|
37
36
|
throw new graphql_transformer_core_1.InvalidTransformerError('No authentication provider found.');
|
38
37
|
}
|
39
|
-
this.authProvider.object(
|
40
|
-
this.authProvider.object(
|
38
|
+
this.authProvider.object(conversation.model, conversation.authDirective, ctx);
|
39
|
+
this.authProvider.object(message.model, message.authDirective, ctx);
|
41
40
|
}
|
42
41
|
}
|
43
42
|
exports.ConversationPrepareHandler = ConversationPrepareHandler;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-prepare-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"conversation-prepare-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/convers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formerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
-
import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
|
3
2
|
import * as cdk from 'aws-cdk-lib';
|
3
|
+
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
4
4
|
export declare class ConversationResolverGenerator {
|
5
5
|
private readonly functionNameMap?;
|
6
6
|
constructor(functionNameMap?: Record<string, cdk.aws_lambda.IFunction> | undefined);
|
7
7
|
generateResolvers(directives: ConversationDirectiveConfiguration[], ctx: TransformerContextProvider): void;
|
8
|
-
private
|
8
|
+
private generateDataSources;
|
9
9
|
private generateResolversForDirective;
|
10
|
-
private createFunctionStack;
|
11
10
|
private setupFunctionDataSource;
|
12
11
|
private setupExistingFunctionDataSource;
|
13
12
|
private setupDefaultConversationHandler;
|
14
|
-
private createConversationPipelineResolver;
|
15
|
-
private addPipelineResolverFunctions;
|
16
|
-
private createAssistantResponseResolver;
|
17
|
-
private createAssistantResponseSubscriptionResolver;
|
18
13
|
private addLambdaDataSource;
|
19
14
|
private addInitSlotToListMessagesPipeline;
|
20
15
|
private setupMessageTableIndex;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC7G,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAInC,OAAO,EAAE,kCAAkC,EAAoC,MAAM,yCAAyC,CAAC;AAgB/H,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBAAhB,eAAe,CAAC,sDAA2B;IAQxE,iBAAiB,CAAC,UAAU,EAAE,kCAAkC,EAAE,EAAE,GAAG,EAAE,0BAA0B,GAAG,IAAI;IAuB1G,OAAO,CAAC,mBAAmB;IAmC3B,OAAO,CAAC,6BAA6B;IA8BrC,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,+BAA+B;IAmBvC,OAAO,CAAC,+BAA+B;IA+BvC,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,iCAAiC;IAazC,OAAO,CAAC,sBAAsB;IAoC9B,OAAO,CAAC,uBAAuB;CAgChC"}
|