@aws-amplify/graphql-api-construct 1.16.0-gen2-migration-1015.0 → 1.16.1-ai-streaming.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +79 -152
- package/API.md +1 -11
- package/CHANGELOG.md +21 -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/ai-constructs/lib/conversation/conversation_handler_construct.d.ts +19 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.js +36 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.d.ts +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.d.ts +11 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +279 -67
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.js +34 -8
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.d.ts +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.js +17 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +17 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +56 -18
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/default_handler.d.ts +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/event_tools_provider.js +2 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.d.ts +7 -7
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.js +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.d.ts +7 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.js +16 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.d.ts +2 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js +4 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.d.ts +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.js +4 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.d.ts +71 -14
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/README.md +4 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.d.ts +118 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.d.ts +117 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +31 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.d.ts +59 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +12 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.d.ts +59 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +25 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +515 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +112 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.d.ts +2 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +18 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.d.ts +42 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +28 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +27 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +12 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.d.ts +33 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.d.ts +32 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +33 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/package.json +27 -0
- package/node_modules/@aws-amplify/ai-constructs/package.json +9 -2
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +9 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +14 -14
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +20 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts +48 -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 +14 -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 +99 -46
- 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 +15 -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 +32 -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-stream-pipeline-definition.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-pipeline-definition.js +58 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-response-stream-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 +8 -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 +17 -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 +88 -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/templates/assistant-streaming-mutation-resolver-fn.template.js +96 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/{invoke-lambda-resolver-fn.template.js → templates/invoke-lambda-resolver-fn.template.js} +14 -7
- 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 +72 -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 +22 -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 +50 -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 +15 -14
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +9 -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 +9 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +9 -1
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +9 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +8 -8
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +9 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +9 -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 +6 -11
- 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 +9 -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 +9 -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 +9 -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 +9 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +9 -9
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +9 -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 +7 -6
- 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 +11 -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 +23 -23
- 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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message-model.d.ts","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,
|
1
|
+
{"version":3,"file":"message-model.d.ts","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAG7B,aAAa,EACb,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAsBjB,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,aAAa,CAAC;IAC9B,8BAA8B,EAAE,aAAa,CAAC;IAC9C,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;AA6BF,eAAO,MAAM,kBAAkB,qBACX,MAAM,eACX,MAAM,sBACC,MAAM,gCACI,aAAa,KAC1C,YAoBF,CAAC;AAEF,eAAO,MAAM,yBAAyB,qBAAsB,MAAM,kBAAkB,MAAM,KAAG,mBAW5F,CAAC;AAEF,eAAO,MAAM,4BAA4B,cAAe,MAAM,eAAe,MAAM,iBAAiB,MAAM,KAAG,mBAK5G,CAAC;AAEF,eAAO,MAAM,oCAAoC,gBAAiB,MAAM,KAAG,6BAW1E,CAAC;AAEF,eAAO,MAAM,6CAA6C,qBAAsB,MAAM,KAAG,6BAkBxF,CAAC;AAEF,eAAO,MAAM,gCAAgC,QAAO,6BASnD,CAAC;AAEF,eAAO,MAAM,qCAAqC,cAAe,MAAM,iBAAiB,MAAM,KAAG,mBAKhG,CAAC;AAsIF,eAAO,MAAM,2BAA2B,QAAO,wBAsB9C,CAAC"}
|
@@ -1,32 +1,93 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.createMessageModel = void 0;
|
3
|
+
exports.constructStreamResponseType = exports.createAssistantStreamingMutationField = exports.createConversationTurnErrorInput = exports.createAssistantResponseStreamingMutationInput = exports.createAssistantResponseMutationInput = exports.createAssistantMutationField = exports.createMessageSubscription = exports.createMessageModel = void 0;
|
4
4
|
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
5
5
|
const graphql_1 = require("graphql");
|
6
6
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
-
const createMessageModel = (
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const messageConversationField = constructMessageSessionField(messageBelongsToConversationDirective, conversationModelName);
|
14
|
-
const messageModel = constructConversationMessageModel(messageModelName, messageConversationField, referenceFieldName, [messageModelDirective, messageAuthDirective], conversationMessageInterface);
|
15
|
-
const messageSubscription = constructMessageSubscription(messageSubscriptionFieldName, messageModelName, assistantMutationFieldName);
|
16
|
-
const assistantMutationInput = constructAssistantResponseMutationInput(messageModelName);
|
17
|
-
const assistantMutationField = constructAssistantMutationField(assistantMutationFieldName, messageModelName, assistantMutationInput.name.value);
|
7
|
+
const createMessageModel = (conversationName, messageName, referenceFieldName, conversationMessageInterface) => {
|
8
|
+
const authDirective = constructMessageAuthDirective();
|
9
|
+
const modelDirective = constructMessageModelDirective();
|
10
|
+
const belongsToConversationDirective = constructMessageSessionFieldBelongsToDirective(referenceFieldName);
|
11
|
+
const conversationField = constructMessageConversationField(belongsToConversationDirective, conversationName);
|
12
|
+
const model = constructConversationMessageModel(messageName, conversationField, referenceFieldName, [modelDirective, authDirective], conversationMessageInterface);
|
18
13
|
return {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
messageSubscription,
|
25
|
-
assistantMutationInput,
|
26
|
-
assistantMutationField,
|
14
|
+
authDirective,
|
15
|
+
modelDirective,
|
16
|
+
belongsToConversationDirective,
|
17
|
+
conversationField,
|
18
|
+
model,
|
27
19
|
};
|
28
20
|
};
|
29
21
|
exports.createMessageModel = createMessageModel;
|
22
|
+
const createMessageSubscription = (subscriptionName, onMutationName) => {
|
23
|
+
const awsSubscribeDirective = (0, graphql_transformer_common_1.makeDirective)('aws_subscribe', [(0, graphql_transformer_common_1.makeArgument)('mutations', (0, graphql_transformer_common_1.makeValueNode)([onMutationName]))]);
|
24
|
+
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
25
|
+
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNamedType)('ID'))];
|
26
|
+
const subscriptionField = (0, graphql_transformer_common_1.makeField)(subscriptionName, args, (0, graphql_transformer_common_1.makeNamedType)(STREAM_RESPONSE_TYPE_NAME), [
|
27
|
+
awsSubscribeDirective,
|
28
|
+
cognitoAuthDirective,
|
29
|
+
]);
|
30
|
+
return subscriptionField;
|
31
|
+
};
|
32
|
+
exports.createMessageSubscription = createMessageSubscription;
|
33
|
+
const createAssistantMutationField = (fieldName, messageName, inputTypeName) => {
|
34
|
+
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('input', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)(inputTypeName)))];
|
35
|
+
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
36
|
+
const createAssistantResponseMutation = (0, graphql_transformer_common_1.makeField)(fieldName, args, (0, graphql_transformer_common_1.makeNamedType)(messageName), [cognitoAuthDirective]);
|
37
|
+
return createAssistantResponseMutation;
|
38
|
+
};
|
39
|
+
exports.createAssistantMutationField = createAssistantMutationField;
|
40
|
+
const createAssistantResponseMutationInput = (messageName) => {
|
41
|
+
const inputName = `Create${messageName}AssistantInput`;
|
42
|
+
return {
|
43
|
+
kind: 'InputObjectTypeDefinition',
|
44
|
+
name: { kind: 'Name', value: inputName },
|
45
|
+
fields: [
|
46
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNamedType)('ID')),
|
47
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('content', (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ContentBlockInput'))),
|
48
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('associatedUserMessageId', (0, graphql_transformer_common_1.makeNamedType)('ID')),
|
49
|
+
],
|
50
|
+
};
|
51
|
+
};
|
52
|
+
exports.createAssistantResponseMutationInput = createAssistantResponseMutationInput;
|
53
|
+
const createAssistantResponseStreamingMutationInput = (messageModelName) => {
|
54
|
+
const inputName = `Create${messageModelName}AssistantStreamingInput`;
|
55
|
+
return {
|
56
|
+
kind: 'InputObjectTypeDefinition',
|
57
|
+
name: { kind: 'Name', value: inputName },
|
58
|
+
fields: [
|
59
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
60
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('associatedUserMessageId', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
61
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockIndex', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('Int'))),
|
62
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockText', (0, graphql_transformer_common_1.makeNamedType)('String')),
|
63
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockDeltaIndex', (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
64
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockToolUse', (0, graphql_transformer_common_1.makeNamedType)('AWSJSON')),
|
65
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockDoneAtIndex', (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
66
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('stopReason', (0, graphql_transformer_common_1.makeNamedType)('String')),
|
67
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('accumulatedTurnContent', (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ContentBlockInput'))),
|
68
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('errors', (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ConversationTurnErrorInput'))),
|
69
|
+
],
|
70
|
+
};
|
71
|
+
};
|
72
|
+
exports.createAssistantResponseStreamingMutationInput = createAssistantResponseStreamingMutationInput;
|
73
|
+
const createConversationTurnErrorInput = () => {
|
74
|
+
return {
|
75
|
+
kind: 'InputObjectTypeDefinition',
|
76
|
+
name: { kind: 'Name', value: 'ConversationTurnErrorInput' },
|
77
|
+
fields: [
|
78
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('errorType', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('String'))),
|
79
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('message', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('String'))),
|
80
|
+
],
|
81
|
+
};
|
82
|
+
};
|
83
|
+
exports.createConversationTurnErrorInput = createConversationTurnErrorInput;
|
84
|
+
const createAssistantStreamingMutationField = (fieldName, inputTypeName) => {
|
85
|
+
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('input', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)(inputTypeName)))];
|
86
|
+
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
87
|
+
const createAssistantResponseMutation = (0, graphql_transformer_common_1.makeField)(fieldName, args, (0, graphql_transformer_common_1.makeNamedType)(STREAM_RESPONSE_TYPE_NAME), [cognitoAuthDirective]);
|
88
|
+
return createAssistantResponseMutation;
|
89
|
+
};
|
90
|
+
exports.createAssistantStreamingMutationField = createAssistantStreamingMutationField;
|
30
91
|
const constructMessageModelDirective = () => {
|
31
92
|
return (0, graphql_transformer_common_1.makeDirective)('model', [
|
32
93
|
(0, graphql_transformer_common_1.makeArgument)('subscriptions', (0, graphql_transformer_common_1.makeValueNode)({ onUpdate: null, onDelete: null })),
|
@@ -61,10 +122,10 @@ const constructMessageSessionFieldBelongsToDirective = (referenceFieldName) => {
|
|
61
122
|
const referencesArg = (0, graphql_transformer_common_1.makeArgument)('references', (0, graphql_transformer_common_1.makeValueNode)(referenceFieldName));
|
62
123
|
return (0, graphql_transformer_common_1.makeDirective)(graphql_directives_1.BelongsToDirective.name, [referencesArg]);
|
63
124
|
};
|
64
|
-
const
|
125
|
+
const constructMessageConversationField = (belongsToDirective, typeName) => {
|
65
126
|
return (0, graphql_transformer_common_1.makeField)('conversation', [], (0, graphql_transformer_common_1.makeNamedType)(typeName), [belongsToDirective]);
|
66
127
|
};
|
67
|
-
const constructConversationMessageModel = (modelName,
|
128
|
+
const constructConversationMessageModel = (modelName, conversationField, referenceFieldName, typeDirectives, conversationMessageInterface) => {
|
68
129
|
const id = (0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID')));
|
69
130
|
const conversationId = (0, graphql_transformer_common_1.makeField)(referenceFieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID')));
|
70
131
|
const role = (0, graphql_transformer_common_1.makeField)('role', [], (0, graphql_transformer_common_1.makeNamedType)('ConversationParticipantRole'));
|
@@ -75,37 +136,29 @@ const constructConversationMessageModel = (modelName, sessionField, referenceFie
|
|
75
136
|
const object = {
|
76
137
|
...(0, graphql_transformer_common_1.blankObject)(modelName),
|
77
138
|
interfaces: [conversationMessageInterface],
|
78
|
-
fields: [id, conversationId,
|
139
|
+
fields: [id, conversationId, conversationField, role, content, context, uiComponents, associatedUserMessageId],
|
79
140
|
directives: typeDirectives,
|
80
141
|
};
|
81
142
|
return object;
|
82
143
|
};
|
83
|
-
const
|
84
|
-
|
85
|
-
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
86
|
-
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNamedType)('ID'))];
|
87
|
-
const subscriptionField = (0, graphql_transformer_common_1.makeField)(subscriptionName, args, (0, graphql_transformer_common_1.makeNamedType)(conversationMessageTypeName), [
|
88
|
-
awsSubscribeDirective,
|
89
|
-
cognitoAuthDirective,
|
90
|
-
]);
|
91
|
-
return subscriptionField;
|
92
|
-
};
|
93
|
-
const constructAssistantMutationField = (fieldName, messageModelName, inputTypeName) => {
|
94
|
-
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('input', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)(inputTypeName)))];
|
95
|
-
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
96
|
-
const createAssistantResponseMutation = (0, graphql_transformer_common_1.makeField)(fieldName, args, (0, graphql_transformer_common_1.makeNamedType)(messageModelName), [cognitoAuthDirective]);
|
97
|
-
return createAssistantResponseMutation;
|
98
|
-
};
|
99
|
-
const constructAssistantResponseMutationInput = (messageModelName) => {
|
100
|
-
const inputName = `Create${messageModelName}AssistantInput`;
|
144
|
+
const STREAM_RESPONSE_TYPE_NAME = 'ConversationMessageStreamPart';
|
145
|
+
const constructStreamResponseType = () => {
|
101
146
|
return {
|
102
|
-
kind: '
|
103
|
-
name: { kind: 'Name', value:
|
147
|
+
kind: 'ObjectTypeDefinition',
|
148
|
+
name: { kind: 'Name', value: STREAM_RESPONSE_TYPE_NAME },
|
104
149
|
fields: [
|
105
|
-
(0, graphql_transformer_common_1.
|
106
|
-
(0, graphql_transformer_common_1.
|
107
|
-
(0, graphql_transformer_common_1.
|
150
|
+
(0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
151
|
+
(0, graphql_transformer_common_1.makeField)('owner', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
152
|
+
(0, graphql_transformer_common_1.makeField)('conversationId', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
153
|
+
(0, graphql_transformer_common_1.makeField)('associatedUserMessageId', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
154
|
+
(0, graphql_transformer_common_1.makeField)('contentBlockIndex', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('Int'))),
|
155
|
+
(0, graphql_transformer_common_1.makeField)('contentBlockText', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
156
|
+
(0, graphql_transformer_common_1.makeField)('contentBlockDeltaIndex', [], (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
157
|
+
(0, graphql_transformer_common_1.makeField)('contentBlockToolUse', [], (0, graphql_transformer_common_1.makeNamedType)('AWSJSON')),
|
158
|
+
(0, graphql_transformer_common_1.makeField)('contentBlockDoneAtIndex', [], (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
159
|
+
(0, graphql_transformer_common_1.makeField)('stopReason', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
108
160
|
],
|
109
161
|
};
|
110
162
|
};
|
163
|
+
exports.constructStreamResponseType = constructStreamResponseType;
|
111
164
|
//# sourceMappingURL=message-model.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message-model.js","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"names":[],"mappings":";;;AAAA,wEAAqE;AACrE,qCAQiB;AACjB,2EAWoC;
|
1
|
+
{"version":3,"file":"message-model.js","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"names":[],"mappings":";;;AAAA,wEAAqE;AACrE,qCAQiB;AACjB,2EAWoC;AA6C7B,MAAM,kBAAkB,GAAG,CAChC,gBAAwB,EACxB,WAAmB,EACnB,kBAA0B,EAC1B,4BAA2C,EAC7B,EAAE;IAChB,MAAM,aAAa,GAAG,6BAA6B,EAAE,CAAC;IACtD,MAAM,cAAc,GAAG,8BAA8B,EAAE,CAAC;IACxD,MAAM,8BAA8B,GAAG,8CAA8C,CAAC,kBAAkB,CAAC,CAAC;IAC1G,MAAM,iBAAiB,GAAG,iCAAiC,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,CAAC;IAC9G,MAAM,KAAK,GAAG,iCAAiC,CAC7C,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,CAAC,cAAc,EAAE,aAAa,CAAC,EAC/B,4BAA4B,CAC7B,CAAC;IAEF,OAAO;QACL,aAAa;QACb,cAAc;QACd,8BAA8B;QAC9B,iBAAiB;QACjB,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,kBAAkB,sBAyB7B;AAEK,MAAM,yBAAyB,GAAG,CAAC,gBAAw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AAC,IAAA,0CAAa,EAAC,KAAK,CAAC,CAAC,CAAC;YAEzE,IAAA,sCAAS,EAAC,kBAAkB,EAAE,EAAE,EAAE,IAAA,0CAAa,EAAC,QAAQ,CAAC,CAAC;YAC1D,IAAA,sCAAS,EAAC,wBAAwB,EAAE,EAAE,EAAE,IAAA,0CAAa,EAAC,KAAK,CAAC,CAAC;YAE7D,IAAA,sCAAS,EAAC,qBAAqB,EAAE,EAAE,EAAE,IAAA,0CAAa,EAAC,SAAS,CAAC,CAAC;YAE9D,IAAA,sCAAS,EAAC,yBAAyB,EAAE,EAAE,EAAE,IAAA,0CAAa,EAAC,KAAK,CAAC,CAAC;YAE9D,IAAA,sCAAS,EAAC,YAAY,EAAE,EAAE,EAAE,IAAA,0CAAa,EAAC,QAAQ,CAAC,CAAC;SACrD;KACF,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,2BAA2B,+BAsBtC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
2
|
+
export declare const CONVERSATION_MESSAGES_REFERENCE_FIELD_NAME = "conversationId";
|
3
|
+
export declare const LIST_MESSAGES_INDEX_NAME = "gsi-ConversationMessage.conversationId.createdAt";
|
4
|
+
export declare const CONVERSATION_MESSAGE_GET_QUERY_INPUT_TYPE_NAME = "ID";
|
5
|
+
export declare const getConversationTypeName: (config: ConversationDirectiveConfiguration) => string;
|
6
|
+
export declare const getConversationMessageTypeName: (config: ConversationDirectiveConfiguration) => string;
|
7
|
+
export declare const getMessageSubscriptionFieldName: (config: ConversationDirectiveConfiguration) => string;
|
8
|
+
export declare const getAssistantMutationFieldName: (config: ConversationDirectiveConfiguration) => string;
|
9
|
+
export declare const getAssistantStreamingMutationFieldName: (config: ConversationDirectiveConfiguration) => string;
|
10
|
+
export declare const getFunctionStackName: (config: ConversationDirectiveConfiguration) => string;
|
11
|
+
export declare const getConversationMessageGetQueryName: (config: ConversationDirectiveConfiguration) => string;
|
12
|
+
export declare const getConversationMessageListQueryName: (config: ConversationDirectiveConfiguration) => string;
|
13
|
+
export declare const getConversationMessageListQueryInputTypeName: (config: ConversationDirectiveConfiguration) => string;
|
14
|
+
export declare const upperCaseConversationFieldName: (config: ConversationDirectiveConfiguration) => string;
|
15
|
+
//# sourceMappingURL=name-values.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"name-values.d.ts","sourceRoot":"","sources":["../../src/graphql-types/name-values.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,eAAO,MAAM,0CAA0C,mBAAmB,CAAC;AAC3E,eAAO,MAAM,wBAAwB,qDAAqD,CAAC;AAC3F,eAAO,MAAM,8CAA8C,OAAO,CAAC;AAEnE,eAAO,MAAM,uBAAuB,WAAY,kCAAkC,WACzB,CAAC;AAE1D,eAAO,MAAM,8BAA8B,WAAY,kCAAkC,WACzB,CAAC;AAEjE,eAAO,MAAM,+BAA+B,WAAY,kCAAkC,WACpB,CAAC;AAEvE,eAAO,MAAM,6BAA6B,WAAY,kCAAkC,WACpB,CAAC;AAErE,eAAO,MAAM,sCAAsC,WAAY,kCAAkC,WACvB,CAAC;AAE3E,eAAO,MAAM,oBAAoB,WAAY,kCAAkC,WACF,CAAC;AAE9E,eAAO,MAAM,kCAAkC,WAAY,kCAAkC,WAC1B,CAAC;AAEpE,eAAO,MAAM,mCAAmC,WAAY,kCAAkC,WACf,CAAC;AAEhF,eAAO,MAAM,4CAA4C,WAAY,kCAAkC,WACvB,CAAC;AAEjF,eAAO,MAAM,8BAA8B,WAAY,kCAAkC,WAAqC,CAAC"}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/name-values.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.upperCaseConversationFieldName = exports.getConversationMessageListQueryInputTypeName = exports.getConversationMessageListQueryName = exports.getConversationMessageGetQueryName = exports.getFunctionStackName = exports.getAssistantStreamingMutationFieldName = exports.getAssistantMutationFieldName = exports.getMessageSubscriptionFieldName = exports.getConversationMessageTypeName = exports.getConversationTypeName = exports.CONVERSATION_MESSAGE_GET_QUERY_INPUT_TYPE_NAME = exports.LIST_MESSAGES_INDEX_NAME = exports.CONVERSATION_MESSAGES_REFERENCE_FIELD_NAME = void 0;
|
7
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
8
|
+
const pluralize_1 = __importDefault(require("pluralize"));
|
9
|
+
exports.CONVERSATION_MESSAGES_REFERENCE_FIELD_NAME = 'conversationId';
|
10
|
+
exports.LIST_MESSAGES_INDEX_NAME = 'gsi-ConversationMessage.conversationId.createdAt';
|
11
|
+
exports.CONVERSATION_MESSAGE_GET_QUERY_INPUT_TYPE_NAME = 'ID';
|
12
|
+
const getConversationTypeName = (config) => `Conversation${(0, exports.upperCaseConversationFieldName)(config)}`;
|
13
|
+
exports.getConversationTypeName = getConversationTypeName;
|
14
|
+
const getConversationMessageTypeName = (config) => `ConversationMessage${(0, exports.upperCaseConversationFieldName)(config)}`;
|
15
|
+
exports.getConversationMessageTypeName = getConversationMessageTypeName;
|
16
|
+
const getMessageSubscriptionFieldName = (config) => `onCreateAssistantResponse${(0, exports.upperCaseConversationFieldName)(config)}`;
|
17
|
+
exports.getMessageSubscriptionFieldName = getMessageSubscriptionFieldName;
|
18
|
+
const getAssistantMutationFieldName = (config) => `createAssistantResponse${(0, exports.upperCaseConversationFieldName)(config)}`;
|
19
|
+
exports.getAssistantMutationFieldName = getAssistantMutationFieldName;
|
20
|
+
const getAssistantStreamingMutationFieldName = (config) => `createAssistantResponseStream${(0, exports.upperCaseConversationFieldName)(config)}`;
|
21
|
+
exports.getAssistantStreamingMutationFieldName = getAssistantStreamingMutationFieldName;
|
22
|
+
const getFunctionStackName = (config) => `${(0, exports.upperCaseConversationFieldName)(config)}ConversationDirectiveLambdaStack`;
|
23
|
+
exports.getFunctionStackName = getFunctionStackName;
|
24
|
+
const getConversationMessageGetQueryName = (config) => `getConversationMessage${(0, exports.upperCaseConversationFieldName)(config)}`;
|
25
|
+
exports.getConversationMessageGetQueryName = getConversationMessageGetQueryName;
|
26
|
+
const getConversationMessageListQueryName = (config) => `listConversationMessage${(0, pluralize_1.default)((0, exports.upperCaseConversationFieldName)(config))}`;
|
27
|
+
exports.getConversationMessageListQueryName = getConversationMessageListQueryName;
|
28
|
+
const getConversationMessageListQueryInputTypeName = (config) => `ModelConversationMessage${(0, exports.upperCaseConversationFieldName)(config)}FilterInput`;
|
29
|
+
exports.getConversationMessageListQueryInputTypeName = getConversationMessageListQueryInputTypeName;
|
30
|
+
const upperCaseConversationFieldName = (config) => (0, graphql_transformer_common_1.toUpper)(config.field.name.value);
|
31
|
+
exports.upperCaseConversationFieldName = upperCaseConversationFieldName;
|
32
|
+
//# sourceMappingURL=name-values.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"name-values.js","sourceRoot":"","sources":["../../src/graphql-types/name-values.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAqD;AACrD,0DAAkC;AAGrB,QAAA,0CAA0C,GAAG,gBAAgB,CAAC;AAC9D,QAAA,wBAAwB,GAAG,kDAAkD,CAAC;AAC9E,QAAA,8CAA8C,GAAG,IAAI,CAAC;AAE5D,MAAM,uBAAuB,GAAG,CAAC,MAA0C,EAAE,EAAE,CACpF,eAAe,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AAD7C,QAAA,uBAAuB,2BACsB;AAEnD,MAAM,8BAA8B,GAAG,CAAC,MAA0C,EAAE,EAAE,CAC3F,sBAAsB,IAAA,sCAA8B,EAAC,MAAM,CAAC,EAAE,CAAC;AADpD,QAAA,8BAA8B,kCACsB;AAE1D,MAAM,+BAA+B,GAAG,C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, HasManyTransformer } from '@aws-amplify/graphql-relational-transformer';
|
3
3
|
import { TransformerPluginBase } from '@aws-amplify/graphql-transformer-core';
|
4
4
|
import { TransformerAuthProvider, TransformerContextProvider, TransformerPrepareStepContextProvider, TransformerSchemaVisitStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
5
|
-
import { DirectiveNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
6
|
-
import { ConversationModel } from './graphql-types/session-model';
|
7
|
-
import { MessageModel } from './graphql-types/message-model';
|
8
|
-
import { type ToolDefinition, type Tools } from './utils/tools';
|
9
5
|
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
10
|
-
|
11
|
-
parent: ObjectTypeDefinitionNode;
|
12
|
-
directive: DirectiveNode;
|
13
|
-
aiModel: string;
|
14
|
-
functionName: string | undefined;
|
15
|
-
field: FieldDefinitionNode;
|
16
|
-
responseMutationInputTypeName: string;
|
17
|
-
responseMutationName: string;
|
18
|
-
systemPrompt: string;
|
19
|
-
tools: ToolDefinition[];
|
20
|
-
toolSpec: Tools;
|
21
|
-
conversationModel: ConversationModel;
|
22
|
-
messageModel: MessageModel;
|
23
|
-
inferenceConfiguration: ConversationInferenceConfiguration;
|
24
|
-
};
|
25
|
-
export type ConversationInferenceConfiguration = {
|
26
|
-
maxTokens?: number;
|
27
|
-
temperature?: number;
|
28
|
-
topP?: number;
|
29
|
-
};
|
6
|
+
import { DirectiveNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
30
7
|
export declare class ConversationTransformer extends TransformerPluginBase {
|
31
8
|
private directives;
|
32
9
|
private fieldHandler;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grapqhl-conversation-transformer.d.ts","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACvG,OAAO,EAAyB,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACrG,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,yCAAyC,EAC1C,MAAM,6CAA6C,CAAC;AACrD,OAAO,
|
1
|
+
{"version":3,"file":"grapqhl-conversation-transformer.d.ts","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACvG,OAAO,EAAyB,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACrG,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,qCAAqC,EACrC,yCAAyC,EAC1C,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAQpH,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,cAAc,CAA6B;IACnD,OAAO,CAAC,iBAAiB,CAAgC;gBAGvD,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,uBAAuB,EACrC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC;IAepD,KAAK,WACK,wBAAwB,GAAG,2BAA2B,cAClD,mBAAmB,aACpB,aAAa,WACf,yCAAyC,KACjD,IAAI,CAGL;IAMF,iBAAiB,QAAS,0BAA0B,KAAG,IAAI,CAEzD;IAMF,OAAO,QAAS,qCAAqC,KAAG,IAAI,CAE1D;CACH"}
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConversationTransformer = void 0;
|
4
4
|
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
5
5
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
6
|
+
const conversation_field_handler_1 = require("./transformer-steps/conversation-field-handler");
|
6
7
|
const conversation_prepare_handler_1 = require("./transformer-steps/conversation-prepare-handler");
|
7
8
|
const conversation_resolver_generator_1 = require("./transformer-steps/conversation-resolver-generator");
|
8
|
-
const conversation_field_handler_1 = require("./transformer-steps/conversation-field-handler");
|
9
9
|
class ConversationTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
10
10
|
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider, functionNameMap) {
|
11
11
|
super('amplify-conversation-transformer', graphql_directives_1.ConversationDirective.definition);
|
@@ -26,10 +26,4 @@ class ConversationTransformer extends graphql_transformer_core_1.TransformerPlug
|
|
26
26
|
}
|
27
27
|
}
|
28
28
|
exports.ConversationTransformer = ConversationTransformer;
|
29
|
-
const validate = (config, ctx) => {
|
30
|
-
const { field } = config;
|
31
|
-
if (field.type.kind !== 'NamedType' || field.type.name.value !== 'ConversationMessage') {
|
32
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be ConversationMessage');
|
33
|
-
}
|
34
|
-
};
|
35
29
|
//# sourceMappingURL=grapqhl-conversation-transformer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grapqhl-conversation-transformer.js","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAGxE,oFAAqG;
|
1
|
+
{"version":3,"file":"grapqhl-conversation-transformer.js","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAGxE,oFAAqG;AAUr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"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAKxC,eAAO,MAAM,mCAAmC,EAAE,kBAKjD,CAAC"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assistantResponsePipelineDefinition = void 0;
|
4
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
5
|
+
exports.assistantResponsePipelineDefinition = {
|
6
|
+
requestSlots: [init(), auth(), verifySessionOwner()],
|
7
|
+
dataSlot: data(),
|
8
|
+
responseSlots: [],
|
9
|
+
field: (config) => ({ typeName: 'Mutation', fieldName: fieldName(config) }),
|
10
|
+
};
|
11
|
+
function init() {
|
12
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
13
|
+
slotName: 'init',
|
14
|
+
fileName: 'init-resolver-fn.template.js',
|
15
|
+
generateTemplate: templateGenerator('init'),
|
16
|
+
});
|
17
|
+
}
|
18
|
+
function auth() {
|
19
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
20
|
+
slotName: 'auth',
|
21
|
+
fileName: 'auth-resolver-fn.template.js',
|
22
|
+
generateTemplate: templateGenerator('auth'),
|
23
|
+
});
|
24
|
+
}
|
25
|
+
function verifySessionOwner() {
|
26
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
27
|
+
slotName: 'verifySessionOwner',
|
28
|
+
fileName: 'verify-session-owner-resolver-fn.template.js',
|
29
|
+
generateTemplate: templateGenerator('verify-session-owner'),
|
30
|
+
dataSource: (config) => config.dataSources.conversationTableDataSource,
|
31
|
+
substitutions: () => ({
|
32
|
+
CONVERSATION_ID_PARENT: 'ctx.args.input',
|
33
|
+
}),
|
34
|
+
});
|
35
|
+
}
|
36
|
+
function data() {
|
37
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
38
|
+
slotName: 'data',
|
39
|
+
fileName: 'assistant-mutation-resolver-fn.template.js',
|
40
|
+
generateTemplate: templateGenerator('assistant-response'),
|
41
|
+
dataSource: (config) => config.dataSources.messageTableDataSource,
|
42
|
+
substitutions: (config) => ({
|
43
|
+
CONVERSATION_MESSAGE_TYPE_NAME: config.message.model.name.value,
|
44
|
+
}),
|
45
|
+
});
|
46
|
+
}
|
47
|
+
function fieldName(config) {
|
48
|
+
return config.assistantResponseMutation.field.name.value;
|
49
|
+
}
|
50
|
+
function templateGenerator(slotName) {
|
51
|
+
return (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Mutation', slotName, fieldName);
|
52
|
+
}
|
53
|
+
//# sourceMappingURL=assistant-response-pipeline-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/assistant-response-pipeline-definition.ts"],"names":[],"mappings":";;;AACA,iFAKwC;AAK3B,QAAA,mCAAmC,GAAuB;IACrE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,CAAC;IACpD,QAAQ,EAAE,IAAI,EAAE;IAChB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;CAC5E,CAAC;AAKF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,iBAAiB,CAAC,MAAM,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,iBAAiB,CAAC,MAAM,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,kBAAkB;IACzB,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,oBAAoB;QAC9B,QAAQ,EAAE,8CAA8C;QACxD,gBAAgB,EAAE,iBAAiB,CAAC,sBAAsB,CAAC;QAC3D,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,2BAA2B;QACtE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;YACpB,sBAAsB,EAAE,gBAAgB;SACzC,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,4CAA4C;QACtD,gBAAgB,EAAE,iBAAiB,CAAC,oBAAoB,CAAC;QACzD,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB;QACjE,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC1B,8BAA8B,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK;SAChE,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,SAAS,CAAC,MAA0C;IAC3D,OAAO,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAC3D,CAAC;AAKD,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,IAAA,oEAAqC,EAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-stream-pipeline-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-response-stream-pipeline-definition.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,yCAAyC,EAAE,kBAKvD,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assistantResponseStreamPipelineDefinition = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
6
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
+
exports.assistantResponseStreamPipelineDefinition = {
|
8
|
+
requestSlots: [init(), auth(), verifySessionOwner()],
|
9
|
+
dataSlot: data(),
|
10
|
+
responseSlots: [],
|
11
|
+
field: (config) => ({ typeName: 'Mutation', fieldName: fieldName(config) }),
|
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.input',
|
38
|
+
}),
|
39
|
+
});
|
40
|
+
}
|
41
|
+
function data() {
|
42
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
43
|
+
slotName: 'data',
|
44
|
+
fileName: 'assistant-streaming-mutation-resolver-fn.template.js',
|
45
|
+
generateTemplate: templateGenerator('persist-message'),
|
46
|
+
dataSource: (config) => config.dataSources.messageTableDataSource,
|
47
|
+
substitutions: (config) => ({
|
48
|
+
CONVERSATION_MESSAGE_TYPE_NAME: `ConversationMessage${(0, graphql_transformer_common_1.toUpper)(config.field.name.value)}`,
|
49
|
+
}),
|
50
|
+
});
|
51
|
+
}
|
52
|
+
function fieldName(config) {
|
53
|
+
return config.assistantResponseStreamingMutation.field.name.value;
|
54
|
+
}
|
55
|
+
function templateGenerator(slotName) {
|
56
|
+
return (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Mutation', slotName, fieldName);
|
57
|
+
}
|
58
|
+
//# sourceMappingURL=assistant-response-stream-pipeline-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-stream-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/assistant-response-stream-pipeline-definition.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,iFAKwC;AACxC,2EAAqD;AAKxC,QAAA,yCAAyC,GAAuB;IAC3E,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,kBAAkB,EAAE,CAAC;IACpD,QAAQ,EAAE,IAAI,EAAE;IAChB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;CAC5E,CAAC;AAKF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE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AAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACpE,CAAC;AAKD,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,IAAA,oEAAqC,EAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-subscription-pipeline-definition.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-response-subscription-pipeline-definition.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAKxC,eAAO,MAAM,+CAA+C,EAAE,kBAK7D,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assistantResponseSubscriptionPipelineDefinition = void 0;
|
4
|
+
const resolver_function_definition_1 = require("./resolver-function-definition");
|
5
|
+
exports.assistantResponseSubscriptionPipelineDefinition = {
|
6
|
+
requestSlots: [],
|
7
|
+
dataSlot: data(),
|
8
|
+
responseSlots: [],
|
9
|
+
field: (config) => ({ typeName: 'Subscription', fieldName: fieldName(config) }),
|
10
|
+
};
|
11
|
+
function data() {
|
12
|
+
return (0, resolver_function_definition_1.createResolverFunctionDefinition)({
|
13
|
+
slotName: 'data',
|
14
|
+
fileName: 'assistant-messages-subscription-resolver-fn.template.js',
|
15
|
+
generateTemplate: (0, resolver_function_definition_1.createS3AssetMappingTemplateGenerator)('Subscription', 'assistant-message', fieldName),
|
16
|
+
});
|
17
|
+
}
|
18
|
+
function fieldName(config) {
|
19
|
+
return config.assistantResponseSubscriptionField.name.value;
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=assistant-response-subscription-pipeline-definition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-response-subscription-pipeline-definition.js","sourceRoot":"","sources":["../../src/resolvers/assistant-response-subscription-pipeline-definition.ts"],"names":[],"mappings":";;;AACA,iFAKwC;AAK3B,QAAA,+CAA+C,GAAuB;IACjF,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE,IAAI,EAAE;IAChB,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;CAChF,CAAC;AAKF,SAAS,IAAI;IACX,OAAO,IAAA,+DAAgC,EAAC;QACtC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,yDAAyD;QACnE,gBAAgB,EAAE,IAAA,oEAAqC,EAAC,cAAc,EAAE,mBAAmB,EAAE,SAAS,CAAC;KACxG,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,SAAS,CAAC,MAA0C;IAC3D,OAAO,MAAM,CAAC,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC;AAC9D,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { TransformerResolver } from '@aws-amplify/graphql-transformer-core';
|
2
|
+
import { MappingTemplateProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
3
|
+
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
4
|
+
import { PipelineDefinition, ResolverFunctionDefinition } from './resolver-function-definition';
|
5
|
+
export declare const generateResolverPipeline: (pipelineDefinition: PipelineDefinition, directiveConfig: ConversationDirectiveConfiguration, ctx: TransformerContextProvider) => TransformerResolver;
|
6
|
+
export declare const generateResolverFunction: (definition: ResolverFunctionDefinition, config: ConversationDirectiveConfiguration, ctx: TransformerContextProvider) => MappingTemplateProvider;
|
7
|
+
//# sourceMappingURL=generate-resolver.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generate-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/generate-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAIlH,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAQhG,eAAO,MAAM,wBAAwB,uBACf,kBAAkB,mBACrB,kCAAkC,OAC9C,0BAA0B,KAC9B,mBA0BF,CAAC;AAQF,eAAO,MAAM,wBAAwB,eACvB,0BAA0B,UAC9B,kCAAkC,OACrC,0BAA0B,KAC9B,uBAKF,CAAC"}
|