@aws-amplify/graphql-api-construct 1.12.0-gen2-migration-0809.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +311 -227
- package/API.md +3 -15
- package/CHANGELOG.md +25 -3
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +5 -12
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/internal/default-parameters.js +1 -2
- 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 +5 -28
- package/lib/types.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/README.md +66 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.d.ts +28 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.js +74 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.d.ts +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/index.js +6 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.d.ts +30 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +191 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.d.ts +30 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.js +47 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +18 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +66 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/default_handler.d.ts +8 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/default_handler.js +10 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/event_tools_provider.d.ts +15 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/event_tools_provider.js +32 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_query_factory.d.ts +9 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_query_factory.js +44 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.js +48 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/index.d.ts +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/index.js +6 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/types.d.ts +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/types.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.d.ts +4 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.js +6 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.d.ts +61 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/test-assets/custom_handler.d.ts +5 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/test-assets/custom_handler.js +11 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/index.d.ts +3 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/index.internal.d.ts +4 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/index.internal.js +34 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/index.js +29 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/README.md +9 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/amplify_function.d.ts +4 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/amplify_function.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts +66 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/auth_resources.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/aws_client_provider.d.ts +5 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/aws_client_provider.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_identifier.d.ts +56 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_identifier.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_output.d.ts +6 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_output.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts +22 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.d.ts +8 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.d.ts +7 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/construct_container.d.ts +35 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/construct_container.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/construct_factory.d.ts +24 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/construct_factory.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/deep_partial.d.ts +17 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/deep_partial.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/deployment_type.d.ts +8 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/deployment_type.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts +8 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/function_resources.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.d.ts +14 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/index.d.ts +23 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/index.js +39 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.d.ts +11 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.d.ts +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/package_manager_controller.d.ts +16 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/package_manager_controller.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_access_acceptor.d.ts +27 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_access_acceptor.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_name_validator.d.ts +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_name_validator.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_provider.d.ts +10 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/resource_provider.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/ssm_environment_entries_generator.d.ts +5 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/ssm_environment_entries_generator.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/stable_backend_identifiers.d.ts +4 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/lib/stable_backend_identifiers.js +3 -0
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/plugin-types/package.json +24 -0
- package/node_modules/@aws-amplify/ai-constructs/package.json +37 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +19 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +6 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +26 -20
- package/node_modules/@aws-amplify/graphql-conversation-transformer/API.md +33 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +10 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/README.md +145 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts +13 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js +111 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.d.ts +10 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.js +81 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/session-model.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts +39 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js +35 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/index.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/index.js +6 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js +62 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js +77 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js +57 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js +34 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts +5 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js +104 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts +6 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js +59 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js +50 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js +45 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts +12 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js +68 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts +15 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js +44 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-prepare-handler.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts +20 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js +184 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/graphql-json-schema-type.d.ts +5 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/graphql-json-schema-type.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/graphql-json-schema-type.js +81 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/graphql-json-schema-type.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.d.ts +25 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.js +116 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/utils/tools.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +82 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +17 -1
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +19 -13
- package/node_modules/@aws-amplify/graphql-directives/API.md +6 -0
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +10 -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 +3 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.js +31 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/generation.d.ts +3 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/generation.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/generation.js +24 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/generation.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/index.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/index.js +5 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/lib/index.js +2 -0
- package/node_modules/@aws-amplify/graphql-directives/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/package.json +12 -6
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +13 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +16 -12
- package/node_modules/@aws-amplify/graphql-generation-transformer/API.md +26 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +11 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/README.md +85 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.d.ts +32 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js +119 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/index.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/index.js +6 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts +7 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js +72 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/graphql-json-schema-type.d.ts +5 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/graphql-json-schema-type.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/graphql-json-schema-type.js +78 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/graphql-json-schema-type.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.d.ts +27 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.js +31 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/validation.d.ts +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/validation.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/validation.js +29 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/lib/validation.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +78 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +13 -1
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +16 -12
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +17 -1
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +17 -13
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +17 -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 +20 -16
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +15 -7
- 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 -47
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +2 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +22 -4
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +3 -12
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +0 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +2 -4
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +0 -3
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +1 -111
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js +1 -3
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +0 -3
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +2 -2
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +18 -16
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +19 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js +3 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +16 -12
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +23 -3
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +12 -13
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +13 -11
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +13 -11
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +7 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/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 +8 -10
- package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +18 -14
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +23 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +3 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +21 -15
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +17 -1
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +17 -13
- package/node_modules/@aws-amplify/graphql-transformer/API.md +0 -1
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +23 -2
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +11 -6
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +31 -22
- package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +11 -8
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +54 -7
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +14 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts +2 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.js +3 -9
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.d.ts +5 -11
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js +6 -31
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +2 -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 +8 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts +3 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +12 -16
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts +6 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js +71 -23
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/graphql-scalar-json-schema-definitions.d.ts +20 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/graphql-scalar-json-schema-definitions.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/graphql-scalar-json-schema-definitions.js +89 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/graphql-scalar-json-schema-definitions.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/index.d.ts +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/index.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/index.js +10 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/index.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.d.ts +21 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.js +3 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/json-schema.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/named-type-conversion.d.ts +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/named-type-conversion.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/named-type-conversion.js +44 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/ai/named-type-conversion.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.d.ts +21 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js +27 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js.map +1 -0
- 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 +18 -12
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +12 -23
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +14 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +3 -4
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +1 -6
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts +4 -4
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/synth-parameters.d.ts +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/synth-parameters.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +13 -6
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +3 -10
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +0 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +0 -10
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transform-host-provider.ts +5 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/synth-parameters.ts +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transform-parameters.ts +0 -3
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- package/node_modules/graphql-mapping-template/CHANGELOG.md +12 -0
- package/node_modules/graphql-mapping-template/LICENSE +201 -0
- package/node_modules/graphql-mapping-template/package.json +13 -5
- package/node_modules/graphql-transformer-common/API.md +0 -1
- package/node_modules/graphql-transformer-common/CHANGELOG.md +9 -3
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +0 -1
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +0 -1
- package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
- package/node_modules/graphql-transformer-common/package.json +13 -6
- package/package.json +40 -29
- package/src/amplify-graphql-api.ts +3 -11
- package/src/internal/default-parameters.ts +0 -1
- package/src/model-datasource-strategy-types.ts +0 -21
- package/src/types.ts +5 -29
- 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
@@ -0,0 +1,145 @@
|
|
1
|
+
# GraphQL @conversation Transformer
|
2
|
+
|
3
|
+
The `@conversation` transformer is a powerful tool for quickly and easily creating AI-powered conversation routes within your AWS AppSync API. This transformer leverages the capabilities of large language models to enable dynamic, context-aware conversations in your GraphQL schema.
|
4
|
+
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
- [GraphQL @conversation Transformer](#graphql-conversation-transformer)
|
8
|
+
- [Table of Contents](#table-of-contents)
|
9
|
+
- [Directive Definition](#directive-definition)
|
10
|
+
- [Usage](#usage)
|
11
|
+
- [Configuration Options](#configuration-options)
|
12
|
+
- [Generated Resources](#generated-resources)
|
13
|
+
- [Examples](#examples)
|
14
|
+
- [Basic Usage](#basic-usage)
|
15
|
+
- [Advanced Usage with Tools and Inference Configuration](#advanced-usage-with-tools-and-inference-configuration)
|
16
|
+
- [Best Practices](#best-practices)
|
17
|
+
- [Troubleshooting](#troubleshooting)
|
18
|
+
|
19
|
+
## Directive Definition
|
20
|
+
|
21
|
+
The `@conversation` directive is defined as follows:
|
22
|
+
|
23
|
+
```graphql
|
24
|
+
directive @conversation(
|
25
|
+
aiModel: String!
|
26
|
+
systemPrompt: String!
|
27
|
+
functionName: String
|
28
|
+
tools: [ToolMap]
|
29
|
+
inferenceConfiguration: ConversationInferenceConfiguration
|
30
|
+
) on FIELD_DEFINITION
|
31
|
+
|
32
|
+
input ToolMap {
|
33
|
+
name: String
|
34
|
+
description: String
|
35
|
+
}
|
36
|
+
|
37
|
+
input ConversationInferenceConfiguration {
|
38
|
+
maxTokens: Int
|
39
|
+
temperature: Float
|
40
|
+
topP: Float
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
|
46
|
+
To use the `@conversation` directive, add it to a field in your GraphQL schema. This field should be of type `ConversationMessage` and should be part of the `Mutation` type.
|
47
|
+
|
48
|
+
```graphql
|
49
|
+
type Mutation {
|
50
|
+
sendMessage(conversationId: ID!, content: String!): ConversationMessage
|
51
|
+
@conversation(aiModel: "anthropic.claude-3-haiku-20240307-v1:0", systemPrompt: "You are a helpful AI assistant.")
|
52
|
+
}
|
53
|
+
```
|
54
|
+
|
55
|
+
To find the necessary GraphQL types to use with the `@conversation` directive, see `src/graphql-types/conversation-schema-types.ts`.
|
56
|
+
|
57
|
+
## Configuration Options
|
58
|
+
|
59
|
+
The `@conversation` directive accepts the following configuration options:
|
60
|
+
|
61
|
+
- `aiModel` (required): Specifies the AI model to be used for generating responses.
|
62
|
+
- `systemPrompt` (required): Defines the initial prompt that sets the context for the AI model.
|
63
|
+
- `functionName` (optional): Specifies a custom Lambda function to handle the conversation logic.
|
64
|
+
- `tools` (optional): An array of tool configurations that the AI can use during the conversation.
|
65
|
+
- `inferenceConfiguration` (optional): Fine-tunes the AI model's behavior with parameters like `maxTokens`, `temperature`, and `topP`.
|
66
|
+
|
67
|
+
## Generated Resources
|
68
|
+
|
69
|
+
When you use the `@conversation` directive, the transformer generates several AWS resources to support the conversation functionality:
|
70
|
+
|
71
|
+
1. DynamoDB Tables:
|
72
|
+
|
73
|
+
- A table for storing conversation sessions
|
74
|
+
- A table for storing individual messages
|
75
|
+
|
76
|
+
2. AppSync Resolvers:
|
77
|
+
|
78
|
+
- A pipeline resolver for the conversation mutation
|
79
|
+
- A resolver for the assistant's response mutation
|
80
|
+
- A subscription resolver for real-time updates
|
81
|
+
|
82
|
+
3. Lambda Function:
|
83
|
+
|
84
|
+
- A default conversation handler (if no custom `functionName` is provided)
|
85
|
+
|
86
|
+
4. IAM Roles and Policies:
|
87
|
+
|
88
|
+
- Necessary permissions for AppSync to interact with DynamoDB and Lambda
|
89
|
+
|
90
|
+
5. AppSync Data Sources:
|
91
|
+
- DynamoDB data sources for conversation and message tables
|
92
|
+
- Lambda data source for the conversation handler
|
93
|
+
|
94
|
+
## Examples
|
95
|
+
|
96
|
+
### Basic Usage
|
97
|
+
|
98
|
+
```graphql
|
99
|
+
type Mutation {
|
100
|
+
chat(conversationId: ID!, message: String!): ConversationMessage
|
101
|
+
@conversation(
|
102
|
+
aiModel: "anthropic.claude-3-haiku-20240307-v1:0"
|
103
|
+
systemPrompt: "You are a friendly AI assistant. Respond to user queries in a helpful and concise manner."
|
104
|
+
)
|
105
|
+
}
|
106
|
+
```
|
107
|
+
|
108
|
+
### Advanced Usage with Tools and Inference Configuration
|
109
|
+
|
110
|
+
```graphql
|
111
|
+
type Mutation {
|
112
|
+
customerSupport(conversationId: ID!, inquiry: String!): ConversationMessage
|
113
|
+
@conversation(
|
114
|
+
aiModel: "anthropic.claude-3-haiku-20240307-v1:0"
|
115
|
+
systemPrompt: "You are a customer support AI. Help users with their product inquiries and issues."
|
116
|
+
tools: [
|
117
|
+
{ name: "getProductInfo", description: "Retrieves detailed information about a product" }
|
118
|
+
{ name: "checkOrderStatus", description: "Checks the status of a customer's order" }
|
119
|
+
]
|
120
|
+
inferenceConfiguration: { maxTokens: 500, temperature: 0.7, topP: 0.9 }
|
121
|
+
)
|
122
|
+
}
|
123
|
+
```
|
124
|
+
|
125
|
+
## Best Practices
|
126
|
+
|
127
|
+
1. **Craft Clear System Prompts**: The system prompt sets the tone and context for the conversation route. Make it specific and aligned with your use case.
|
128
|
+
|
129
|
+
2. **Use Appropriate AI Models**: Choose AI models that suit your application's needs in terms of capabilities and response time.
|
130
|
+
|
131
|
+
3. **Implement Error Handling**: Always handle potential errors client-side code.
|
132
|
+
|
133
|
+
4. **Monitor and Optimize**: Regularly review the performance and costs associated with your conversation route.
|
134
|
+
|
135
|
+
## Troubleshooting
|
136
|
+
|
137
|
+
If you encounter issues while using the `@conversation` transformer, consider the following:
|
138
|
+
|
139
|
+
1. **Check Your Schema**: Ensure your GraphQL schema is valid and the `@conversation` directive is used correctly.
|
140
|
+
|
141
|
+
2. **Verify AWS Resources**: Check that all required AWS resources have been created successfully.
|
142
|
+
|
143
|
+
3. **Review Logs**: Examine CloudWatch logs for any errors in your Lambda functions or AppSync resolvers.
|
144
|
+
|
145
|
+
4. **Test Incrementally**: When adding complex features like custom tools, test each addition incrementally to isolate potential issues.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { DirectiveNode, FieldDefinitionNode, ObjectTypeDefinitionNode, NamedTypeNode, InputObjectTypeDefinitionNode } from 'graphql';
|
2
|
+
export type MessageModel = {
|
3
|
+
messageAuthDirective: DirectiveNode;
|
4
|
+
messageModelDirective: DirectiveNode;
|
5
|
+
messageBelongsToConversationDirective: DirectiveNode;
|
6
|
+
messageConversationField: FieldDefinitionNode;
|
7
|
+
messageModel: ObjectTypeDefinitionNode;
|
8
|
+
messageSubscription: FieldDefinitionNode;
|
9
|
+
assistantMutationInput: InputObjectTypeDefinitionNode;
|
10
|
+
assistantMutationField: FieldDefinitionNode;
|
11
|
+
};
|
12
|
+
export declare const createMessageModel: (conversationModelName: string, messageModelName: string, referenceFieldName: string, capitalizedFieldName: string, conversationMessageInterface: NamedTypeNode) => MessageModel;
|
13
|
+
//# sourceMappingURL=message-model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"message-model.d.ts","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAEb,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EAEb,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAsBjB,MAAM,MAAM,YAAY,GAAG;IACzB,oBAAoB,EAAE,aAAa,CAAC;IACpC,qBAAqB,EAAE,aAAa,CAAC;IACrC,qCAAqC,EAAE,aAAa,CAAC;IACrD,wBAAwB,EAAE,mBAAmB,CAAC;IAC9C,YAAY,EAAE,wBAAwB,CAAC;IACvC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,sBAAsB,EAAE,6BAA6B,CAAC;IACtD,sBAAsB,EAAE,mBAAmB,CAAC;CAC7C,CAAC;AA6BF,eAAO,MAAM,kBAAkB,0BACN,MAAM,oBACX,MAAM,sBACJ,MAAM,wBACJ,MAAM,gCACE,aAAa,KAC1C,YAmCF,CAAC"}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createMessageModel = void 0;
|
4
|
+
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
5
|
+
const graphql_1 = require("graphql");
|
6
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
+
const createMessageModel = (conversationModelName, messageModelName, referenceFieldName, capitalizedFieldName, conversationMessageInterface) => {
|
8
|
+
const messageSubscriptionFieldName = `onCreateAssistantResponse${capitalizedFieldName}`;
|
9
|
+
const assistantMutationFieldName = `createAssistantResponse${capitalizedFieldName}`;
|
10
|
+
const messageAuthDirective = constructMessageAuthDirective();
|
11
|
+
const messageModelDirective = constructMessageModelDirective();
|
12
|
+
const messageBelongsToConversationDirective = constructMessageSessionFieldBelongsToDirective(referenceFieldName);
|
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);
|
18
|
+
return {
|
19
|
+
messageAuthDirective,
|
20
|
+
messageModelDirective,
|
21
|
+
messageBelongsToConversationDirective,
|
22
|
+
messageConversationField,
|
23
|
+
messageModel,
|
24
|
+
messageSubscription,
|
25
|
+
assistantMutationInput,
|
26
|
+
assistantMutationField,
|
27
|
+
};
|
28
|
+
};
|
29
|
+
exports.createMessageModel = createMessageModel;
|
30
|
+
const constructMessageModelDirective = () => {
|
31
|
+
return (0, graphql_transformer_common_1.makeDirective)('model', [
|
32
|
+
(0, graphql_transformer_common_1.makeArgument)('subscriptions', (0, graphql_transformer_common_1.makeValueNode)({ onUpdate: null, onDelete: null })),
|
33
|
+
(0, graphql_transformer_common_1.makeArgument)('mutations', (0, graphql_transformer_common_1.makeValueNode)({ update: null })),
|
34
|
+
]);
|
35
|
+
};
|
36
|
+
const constructMessageAuthDirective = () => {
|
37
|
+
return (0, graphql_transformer_common_1.makeDirective)('auth', [
|
38
|
+
(0, graphql_transformer_common_1.makeArgument)('rules', {
|
39
|
+
kind: graphql_1.Kind.LIST,
|
40
|
+
values: [
|
41
|
+
{
|
42
|
+
kind: graphql_1.Kind.OBJECT,
|
43
|
+
fields: [
|
44
|
+
{
|
45
|
+
kind: graphql_1.Kind.OBJECT_FIELD,
|
46
|
+
name: { kind: graphql_1.Kind.NAME, value: 'allow' },
|
47
|
+
value: { kind: graphql_1.Kind.ENUM, value: 'owner' },
|
48
|
+
},
|
49
|
+
{
|
50
|
+
kind: graphql_1.Kind.OBJECT_FIELD,
|
51
|
+
name: { kind: graphql_1.Kind.NAME, value: 'ownerField' },
|
52
|
+
value: { kind: graphql_1.Kind.STRING, value: 'owner' },
|
53
|
+
},
|
54
|
+
],
|
55
|
+
},
|
56
|
+
],
|
57
|
+
}),
|
58
|
+
]);
|
59
|
+
};
|
60
|
+
const constructMessageSessionFieldBelongsToDirective = (referenceFieldName) => {
|
61
|
+
const referencesArg = (0, graphql_transformer_common_1.makeArgument)('references', (0, graphql_transformer_common_1.makeValueNode)(referenceFieldName));
|
62
|
+
return (0, graphql_transformer_common_1.makeDirective)(graphql_directives_1.BelongsToDirective.name, [referencesArg]);
|
63
|
+
};
|
64
|
+
const constructMessageSessionField = (belongsToDirective, typeName) => {
|
65
|
+
return (0, graphql_transformer_common_1.makeField)('conversation', [], (0, graphql_transformer_common_1.makeNamedType)(typeName), [belongsToDirective]);
|
66
|
+
};
|
67
|
+
const constructConversationMessageModel = (modelName, sessionField, referenceFieldName, typeDirectives, conversationMessageInterface) => {
|
68
|
+
const id = (0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID')));
|
69
|
+
const conversationId = (0, graphql_transformer_common_1.makeField)(referenceFieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID')));
|
70
|
+
const role = (0, graphql_transformer_common_1.makeField)('role', [], (0, graphql_transformer_common_1.makeNamedType)('ConversationParticipantRole'));
|
71
|
+
const content = (0, graphql_transformer_common_1.makeField)('content', [], (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ContentBlock')));
|
72
|
+
const context = (0, graphql_transformer_common_1.makeField)('aiContext', [], (0, graphql_transformer_common_1.makeNamedType)('AWSJSON'));
|
73
|
+
const uiComponents = (0, graphql_transformer_common_1.makeField)('toolConfiguration', [], (0, graphql_transformer_common_1.makeNamedType)('ToolConfiguration'));
|
74
|
+
const assistantContent = (0, graphql_transformer_common_1.makeField)('assistantContent', [], (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ContentBlock')));
|
75
|
+
const object = {
|
76
|
+
...(0, graphql_transformer_common_1.blankObject)(modelName),
|
77
|
+
interfaces: [conversationMessageInterface],
|
78
|
+
fields: [id, conversationId, sessionField, role, content, context, uiComponents, assistantContent],
|
79
|
+
directives: typeDirectives,
|
80
|
+
};
|
81
|
+
return object;
|
82
|
+
};
|
83
|
+
const constructMessageSubscription = (subscriptionName, conversationMessageTypeName, onMutationName) => {
|
84
|
+
const awsSubscribeDirective = (0, graphql_transformer_common_1.makeDirective)('aws_subscribe', [(0, graphql_transformer_common_1.makeArgument)('mutations', (0, graphql_transformer_common_1.makeValueNode)([onMutationName]))]);
|
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`;
|
101
|
+
return {
|
102
|
+
kind: 'InputObjectTypeDefinition',
|
103
|
+
name: { kind: 'Name', value: inputName },
|
104
|
+
fields: [
|
105
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNamedType)('ID')),
|
106
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('content', (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)('ContentBlockInput'))),
|
107
|
+
(0, graphql_transformer_common_1.makeInputValueDefinition)('associatedUserMessageId', (0, graphql_transformer_common_1.makeNamedType)('ID')),
|
108
|
+
],
|
109
|
+
};
|
110
|
+
};
|
111
|
+
//# sourceMappingURL=message-model.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"message-model.js","sourceRoot":"","sources":["../../src/graphql-types/message-model.ts"],"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AC;IACzE,MAAM,+BAA+B,GAAG,IAAA,sCAAS,EAAC,SAAS,EAAE,IAAI,EAAE,IAAA,0CAAa,EAAC,gBAAgB,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC5H,OAAO,+BAA+B,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,uCAAuC,GAAG,CAAC,gBAAwB,EAAiC,EAAE;IAC1G,MAAM,SAAS,GAAG,SAAS,gBAAgB,gBAAgB,CAAC;IAC5D,OAAO;QACL,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;QACxC,MAAM,EAAE;YACN,IAAA,qDAAwB,EAAC,gBAAgB,EAAE,IAAA,0CAAa,EAAC,IAAI,CAAC,CAAC;YAC/D,IAAA,qDAAwB,EAAC,SAAS,EAAE,IAAA,yCAAY,EAAC,IAAA,0CAAa,EAAC,mBAAmB,CAAC,CAAC,CAAC;YACrF,IAAA,qDAAwB,EAAC,yBAAyB,EAAE,IAAA,0CAAa,EAAC,IAAI,CAAC,CAAC;SACzE;KACF,CAAC;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { DirectiveNode, FieldDefinitionNode, ObjectTypeDefinitionNode } from 'graphql';
|
2
|
+
export type ConversationModel = {
|
3
|
+
conversationAuthDirective: DirectiveNode;
|
4
|
+
conversationModelDirective: DirectiveNode;
|
5
|
+
conversationHasManyMessagesDirective: DirectiveNode;
|
6
|
+
conversationMessagesField: FieldDefinitionNode;
|
7
|
+
conversationModel: ObjectTypeDefinitionNode;
|
8
|
+
};
|
9
|
+
export declare const createConversationModel: (conversationModelName: string, messageModelName: string, referenceFieldName: string) => ConversationModel;
|
10
|
+
//# sourceMappingURL=session-model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"session-model.d.ts","sourceRoot":"","sources":["../../src/graphql-types/session-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAyB,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoB9G,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yBAAyB,EAAE,aAAa,CAAC;IACzC,0BAA0B,EAAE,aAAa,CAAC;IAC1C,oCAAoC,EAAE,aAAa,CAAC;IACpD,yBAAyB,EAAE,mBAAmB,CAAC;IAC/C,iBAAiB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AAsBF,eAAO,MAAM,uBAAuB,0BACX,MAAM,oBACX,MAAM,sBACJ,MAAM,KACzB,iBAiBF,CAAC"}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createConversationModel = void 0;
|
4
|
+
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
5
|
+
const graphql_1 = require("graphql");
|
6
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
7
|
+
const createConversationModel = (conversationModelName, messageModelName, referenceFieldName) => {
|
8
|
+
const conversationAuthDirective = createSessionAuthDirective();
|
9
|
+
const conversationModelDirective = createSessionModelDirective();
|
10
|
+
const conversationHasManyMessagesDirective = createSessionModelMessagesFieldHasManyDirective(referenceFieldName);
|
11
|
+
const conversationMessagesField = createSessionModelMessagesField(conversationHasManyMessagesDirective, messageModelName);
|
12
|
+
const conversationModel = makeConversationSessionModel(conversationModelName, conversationMessagesField, [
|
13
|
+
conversationAuthDirective,
|
14
|
+
conversationModelDirective,
|
15
|
+
]);
|
16
|
+
return {
|
17
|
+
conversationAuthDirective,
|
18
|
+
conversationModelDirective,
|
19
|
+
conversationHasManyMessagesDirective,
|
20
|
+
conversationMessagesField,
|
21
|
+
conversationModel,
|
22
|
+
};
|
23
|
+
};
|
24
|
+
exports.createConversationModel = createConversationModel;
|
25
|
+
const createSessionAuthDirective = () => {
|
26
|
+
const rules = (0, graphql_transformer_common_1.makeArgument)('rules', {
|
27
|
+
kind: graphql_1.Kind.LIST,
|
28
|
+
values: [
|
29
|
+
{
|
30
|
+
kind: graphql_1.Kind.OBJECT,
|
31
|
+
fields: [
|
32
|
+
{
|
33
|
+
kind: graphql_1.Kind.OBJECT_FIELD,
|
34
|
+
name: { kind: graphql_1.Kind.NAME, value: 'allow' },
|
35
|
+
value: { kind: graphql_1.Kind.ENUM, value: 'owner' },
|
36
|
+
},
|
37
|
+
{
|
38
|
+
kind: graphql_1.Kind.OBJECT_FIELD,
|
39
|
+
name: { kind: graphql_1.Kind.NAME, value: 'ownerField' },
|
40
|
+
value: { kind: graphql_1.Kind.STRING, value: 'owner' },
|
41
|
+
},
|
42
|
+
],
|
43
|
+
},
|
44
|
+
],
|
45
|
+
});
|
46
|
+
return (0, graphql_transformer_common_1.makeDirective)('auth', [rules]);
|
47
|
+
};
|
48
|
+
const createSessionModelDirective = () => {
|
49
|
+
const subscriptionsOffValue = {
|
50
|
+
kind: graphql_1.Kind.OBJECT,
|
51
|
+
fields: [
|
52
|
+
{
|
53
|
+
kind: graphql_1.Kind.OBJECT_FIELD,
|
54
|
+
name: { kind: graphql_1.Kind.NAME, value: 'level' },
|
55
|
+
value: { kind: graphql_1.Kind.ENUM, value: 'off' },
|
56
|
+
},
|
57
|
+
],
|
58
|
+
};
|
59
|
+
return (0, graphql_transformer_common_1.makeDirective)('model', [
|
60
|
+
(0, graphql_transformer_common_1.makeArgument)('subscriptions', subscriptionsOffValue),
|
61
|
+
(0, graphql_transformer_common_1.makeArgument)('mutations', (0, graphql_transformer_common_1.makeValueNode)({ update: null })),
|
62
|
+
]);
|
63
|
+
};
|
64
|
+
const createSessionModelMessagesFieldHasManyDirective = (fieldName) => {
|
65
|
+
const referencesArg = (0, graphql_transformer_common_1.makeArgument)('references', (0, graphql_transformer_common_1.makeValueNode)(fieldName));
|
66
|
+
return (0, graphql_transformer_common_1.makeDirective)(graphql_directives_1.HasManyDirective.name, [referencesArg]);
|
67
|
+
};
|
68
|
+
const createSessionModelMessagesField = (hasManyDirective, typeName) => {
|
69
|
+
return (0, graphql_transformer_common_1.makeField)('messages', [], (0, graphql_transformer_common_1.makeListType)((0, graphql_transformer_common_1.makeNamedType)(typeName)), [hasManyDirective]);
|
70
|
+
};
|
71
|
+
const makeConversationSessionModel = (modelName, messagesField, typeLevelDirectives) => {
|
72
|
+
const id = (0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID')));
|
73
|
+
const name = (0, graphql_transformer_common_1.makeField)('name', [], (0, graphql_transformer_common_1.makeNamedType)('String'));
|
74
|
+
const metadata = (0, graphql_transformer_common_1.makeField)('metadata', [], (0, graphql_transformer_common_1.makeNamedType)('AWSJSON'));
|
75
|
+
return {
|
76
|
+
...(0, graphql_transformer_common_1.blankObject)(modelName),
|
77
|
+
fields: [id, name, metadata, messagesField],
|
78
|
+
directives: typeLevelDirectives,
|
79
|
+
};
|
80
|
+
};
|
81
|
+
//# sourceMappingURL=session-model.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"session-model.js","sourceRoot":"","sources":["../../src/graphql-types/session-model.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AACnE,qCAA8G;AAC9G,2EASoC;AAsC7B,MAAM,uBAAuB,GAAG,CACrC,qBAA6B,EAC7B,gBAAwB,EACxB,kBAA0B,EACP,EAAE;IACrB,MAAM,yBAAyB,GAAG,0BAA0B,EAAE,CAAC;IAC/D,MAAM,0BAA0B,GAAG,2BAA2B,EAAE,CAAC;IACjE,MAAM,oCAAoC,GAAG,+CAA+C,CAAC,kBAAkB,CAAC,CAAC;IACjH,MAAM,yBAAyB,GAAG,+BAA+B,CAAC,oCAAoC,EAAE,gBAAgB,CAAC,CAAC;IAC1H,MAAM,iBAAiB,GAAG,4BAA4B,CAAC,qBAAqB,EAAE,yBAAyB,EAAE;QACvG,yBAAyB;QACzB,0BAA0B;KAC3B,CAAC,CAAC;IAEH,OAAO;QACL,yBAAyB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,SAAS,CAAC;QACzB,MAAM,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC;QAC3C,UAAU,EAAE,mBAAmB;KAChC,CAAC;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { ModelTransformer } from '@aws-amplify/graphql-model-transformer';
|
2
|
+
import { BelongsToTransformer, HasManyTransformer } from '@aws-amplify/graphql-relational-transformer';
|
3
|
+
import { TransformerPluginBase } from '@aws-amplify/graphql-transformer-core';
|
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
|
+
export type ConversationDirectiveConfiguration = {
|
10
|
+
parent: ObjectTypeDefinitionNode;
|
11
|
+
directive: DirectiveNode;
|
12
|
+
aiModel: string;
|
13
|
+
functionName: string | undefined;
|
14
|
+
field: FieldDefinitionNode;
|
15
|
+
responseMutationInputTypeName: string;
|
16
|
+
responseMutationName: string;
|
17
|
+
systemPrompt: string;
|
18
|
+
tools: ToolDefinition[];
|
19
|
+
toolSpec: Tools;
|
20
|
+
conversationModel: ConversationModel;
|
21
|
+
messageModel: MessageModel;
|
22
|
+
inferenceConfiguration: ConversationInferenceConfiguration;
|
23
|
+
};
|
24
|
+
export type ConversationInferenceConfiguration = {
|
25
|
+
maxTokens?: number;
|
26
|
+
temperature?: number;
|
27
|
+
topP?: number;
|
28
|
+
};
|
29
|
+
export declare class ConversationTransformer extends TransformerPluginBase {
|
30
|
+
private directives;
|
31
|
+
private fieldHandler;
|
32
|
+
private prepareHandler;
|
33
|
+
private resolverGenerator;
|
34
|
+
constructor(modelTransformer: ModelTransformer, hasManyTransformer: HasManyTransformer, belongsToTransformer: BelongsToTransformer, authProvider: TransformerAuthProvider);
|
35
|
+
field: (parent: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, definition: FieldDefinitionNode, directive: DirectiveNode, context: TransformerSchemaVisitStepContextProvider) => void;
|
36
|
+
generateResolvers: (ctx: TransformerContextProvider) => void;
|
37
|
+
prepare: (ctx: TransformerPrepareStepContextProvider) => void;
|
38
|
+
}
|
39
|
+
//# sourceMappingURL=grapqhl-conversation-transformer.d.ts.map
|
@@ -0,0 +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,EAAE,aAAa,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACpH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAQhE,MAAM,MAAM,kCAAkC,GAAG;IAC/C,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,6BAA6B,EAAE,MAAM,CAAC;IACtC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC;IAChB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,sBAAsB,EAAE,kCAAkC,CAAC;CAC5D,CAAC;AAKF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAKF,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;IAevC,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"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConversationTransformer = void 0;
|
4
|
+
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
5
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
6
|
+
const conversation_prepare_handler_1 = require("./transformer-steps/conversation-prepare-handler");
|
7
|
+
const conversation_resolver_generator_1 = require("./transformer-steps/conversation-resolver-generator");
|
8
|
+
const conversation_field_handler_1 = require("./transformer-steps/conversation-field-handler");
|
9
|
+
class ConversationTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
10
|
+
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider) {
|
11
|
+
super('amplify-conversation-transformer', graphql_directives_1.ConversationDirective.definition);
|
12
|
+
this.directives = [];
|
13
|
+
this.field = (parent, definition, directive, context) => {
|
14
|
+
const directiveConfg = this.fieldHandler.getDirectiveConfig(parent, definition, directive, context);
|
15
|
+
this.directives.push(directiveConfg);
|
16
|
+
};
|
17
|
+
this.generateResolvers = (ctx) => {
|
18
|
+
this.resolverGenerator.generateResolvers(this.directives, ctx);
|
19
|
+
};
|
20
|
+
this.prepare = (ctx) => {
|
21
|
+
this.prepareHandler.prepare(ctx, this.directives);
|
22
|
+
};
|
23
|
+
this.fieldHandler = new conversation_field_handler_1.ConversationFieldHandler();
|
24
|
+
this.prepareHandler = new conversation_prepare_handler_1.ConversationPrepareHandler(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider);
|
25
|
+
this.resolverGenerator = new conversation_resolver_generator_1.ConversationResolverGenerator();
|
26
|
+
}
|
27
|
+
}
|
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
|
+
//# sourceMappingURL=grapqhl-conversation-transformer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"grapqhl-conversation-transformer.js","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAGxE,oFAAqG;AAWrG,mGAA8F;AAC9F,yGAAoG;AACpG,+FAA0F;AAiC1F,MAAa,uBAAwB,SAAQ,gDAAqB;IAMhE,YACE,gBAAkC,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AAM,IAAI,gDAAqB,CAAC,uDAAuD,CAAC,CAAC;KAC1F;AACH,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConversationTransformer = void 0;
|
4
|
+
var grapqhl_conversation_transformer_1 = require("./grapqhl-conversation-transformer");
|
5
|
+
Object.defineProperty(exports, "ConversationTransformer", { enumerable: true, get: function () { return grapqhl_conversation_transformer_1.ConversationTransformer; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uFAA6E;AAApE,2IAAA,uBAAuB,OAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-messages-subscription-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-messages-subscription-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAQ7E,eAAO,MAAM,8CAA8C,QAAO,0BAKjE,CAAC"}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.conversationMessageSubscriptionMappingTamplate = void 0;
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
|
+
const ts_dedent_1 = require("ts-dedent");
|
6
|
+
const conversationMessageSubscriptionMappingTamplate = () => {
|
7
|
+
const req = createAssistantMessagesSubscriptionRequestFunction();
|
8
|
+
const res = createAssistantMessagesSubscriptionResponseFunction();
|
9
|
+
return { req, res };
|
10
|
+
};
|
11
|
+
exports.conversationMessageSubscriptionMappingTamplate = conversationMessageSubscriptionMappingTamplate;
|
12
|
+
const createAssistantMessagesSubscriptionRequestFunction = () => {
|
13
|
+
const requestFunctionString = `
|
14
|
+
export function request(ctx) {
|
15
|
+
ctx.stash.hasAuth = true;
|
16
|
+
const isAuthorized = false;
|
17
|
+
|
18
|
+
if (util.authType() === 'User Pool Authorization') {
|
19
|
+
if (!isAuthorized) {
|
20
|
+
const authFilter = [];
|
21
|
+
let ownerClaim0 = ctx.identity['claims']['sub'];
|
22
|
+
ctx.args.owner = ownerClaim0;
|
23
|
+
const currentClaim1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
24
|
+
if (ownerClaim0 && currentClaim1) {
|
25
|
+
ownerClaim0 = ownerClaim0 + '::' + currentClaim1;
|
26
|
+
authFilter.push({ owner: { eq: ownerClaim0 } })
|
27
|
+
}
|
28
|
+
const role0_0 = ctx.identity['claims']['sub'];
|
29
|
+
if (role0_0) {
|
30
|
+
authFilter.push({ owner: { eq: role0_0 } });
|
31
|
+
}
|
32
|
+
// we can just reuse currentClaim1 here, but doing this (for now) to mirror the existing
|
33
|
+
// vtl auth resolver.
|
34
|
+
const role0_1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
|
35
|
+
if (role0_1) {
|
36
|
+
authFilter.push({ owner: { eq: role0_1 }});
|
37
|
+
}
|
38
|
+
if (authFilter.length !== 0) {
|
39
|
+
ctx.stash.authFilter = { or: authFilter };
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
if (!isAuthorized && ctx.stash.authFilter.length === 0) {
|
44
|
+
util.unauthorized();
|
45
|
+
}
|
46
|
+
ctx.args.filter = { ...ctx.args.filter, and: [{ conversationId: { eq: ctx.args.conversationId }}]};
|
47
|
+
return { version: '2018-05-29', payload: {} };
|
48
|
+
}`;
|
49
|
+
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
|
50
|
+
};
|
51
|
+
const createAssistantMessagesSubscriptionResponseFunction = () => {
|
52
|
+
const responseFunctionString = `
|
53
|
+
import { util, extensions } from '@aws-appsync/utils';
|
54
|
+
|
55
|
+
export function response(ctx) {
|
56
|
+
const subscriptionFilter = util.transform.toSubscriptionFilter(ctx.args.filter);
|
57
|
+
extensions.setSubscriptionFilter(subscriptionFilter);
|
58
|
+
return null;
|
59
|
+
}`;
|
60
|
+
return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
|
61
|
+
};
|
62
|
+
//# sourceMappingURL=assistant-messages-subscription-resolver.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-messages-subscription-resolver.js","sourceRoot":"","sources":["../../src/resolvers/assistant-messages-subscription-resolver.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,yCAAmC;AAS5B,MAAM,8CAA8C,GAAG,GAA+B,EAAE;IAC7F,MAAM,GAAG,GAAG,kDAAkD,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,mDAAmD,EAAE,CAAC;IAElE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AALW,QAAA,8CAA8C,kDAKzD;AAQF,MAAM,kDAAkD,GAAG,GAA4B,EAAE;IACvF,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmCxB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,qBAAqB,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC;AAQF,MAAM,mDAAmD,GAAG,GAA4B,EAAE;IACxF,MAAM,sBAAsB,GAAG;;;;;;;QAOzB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,sBAAsB,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assistant-mutation-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAS7E,eAAO,MAAM,yBAAyB,QAAO,0BAI5C,CAAC"}
|