@aws-amplify/graphql-api-construct 1.15.1-ai-streaming.5 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +19 -19
- package/CHANGELOG.md +5 -19
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +1 -1
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/sql-model-datasource-strategy.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.d.ts +1 -12
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/conversation_handler_construct.js +2 -22
- 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 +2 -8
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +34 -195
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.js +3 -19
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.d.ts +3 -5
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_executor.js +5 -20
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +1 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +7 -6
- 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 +2 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.d.ts +1 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js +2 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.d.ts +2 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/index.js +2 -4
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.d.ts +10 -32
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.js +1 -1
- package/node_modules/@aws-amplify/ai-constructs/package.json +2 -9
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +12 -11
- package/node_modules/@aws-amplify/graphql-conversation-transformer/API.md +2 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +3 -23
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts +0 -3
- 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 +5 -53
- 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/grapqhl-conversation-transformer.d.ts +6 -0
- 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 +40 -6
- 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/invoke-lambda-resolver-fn.template.js +1 -14
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js +1 -8
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/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 +2 -3
- 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 +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js +4 -20
- 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 +11 -10
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +7 -6
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +6 -0
- package/node_modules/@aws-amplify/graphql-directives/LICENSE +201 -0
- 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 +3 -2
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +6 -5
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +6 -5
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +6 -5
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +7 -6
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/LICENSE +201 -0
- 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 +10 -9
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/LICENSE +201 -0
- 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/package.json +6 -5
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +6 -5
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +8 -7
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +7 -6
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +7 -6
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +1 -21
- package/node_modules/@aws-amplify/graphql-transformer/package.json +17 -17
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -3
- package/package.json +20 -20
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_streaming_response_sender.d.ts +0 -19
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_streaming_response_sender.js +0 -38
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.d.ts +0 -7
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/executable_tool_factory.js +0 -16
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/README.md +0 -4
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.d.ts +0 -23
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.d.ts +0 -22
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/ai/conversation/v1.js +0 -11
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.d.ts +0 -113
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.d.ts +0 -112
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +0 -30
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.d.ts +0 -23
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.d.ts +0 -22
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/custom/v1.js +0 -11
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.d.ts +0 -23
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.d.ts +0 -22
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/function/v1.js +0 -11
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.d.ts +0 -59
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +0 -12
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.d.ts +0 -59
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +0 -25
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +0 -508
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +0 -112
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.d.ts +0 -2
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +0 -18
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.d.ts +0 -42
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +0 -22
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +0 -28
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +0 -27
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +0 -12
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.d.ts +0 -33
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +0 -10
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.d.ts +0 -32
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +0 -33
- package/node_modules/@aws-amplify/ai-constructs/node_modules/@aws-amplify/backend-output-schemas/package.json +0 -27
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-reduce-chunks-resolver-fn.template.js +0 -105
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-reduce-chunks-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-reduce-chunks-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-reduce-chunks-resolver.js +0 -25
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-reduce-chunks-resolver.js.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-resolver-fn.template.js +0 -114
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-resolver.d.ts +0 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-resolver.d.ts.map +0 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-resolver.js +0 -25
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-streaming-mutation-resolver.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-auth-transformer",
|
3
|
-
"version": "4.1.
|
3
|
+
"version": "4.1.4",
|
4
4
|
"description": "Amplify GraphQL @auth transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -30,10 +30,10 @@
|
|
30
30
|
"extract-api": "ts-node ../../scripts/extract-api.ts"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@aws-amplify/graphql-directives": "2.
|
34
|
-
"@aws-amplify/graphql-model-transformer": "3.0.
|
35
|
-
"@aws-amplify/graphql-relational-transformer": "3.0.
|
36
|
-
"@aws-amplify/graphql-transformer-core": "3.2.
|
33
|
+
"@aws-amplify/graphql-directives": "2.4.0",
|
34
|
+
"@aws-amplify/graphql-model-transformer": "3.0.6",
|
35
|
+
"@aws-amplify/graphql-relational-transformer": "3.0.6",
|
36
|
+
"@aws-amplify/graphql-transformer-core": "3.2.1",
|
37
37
|
"@aws-amplify/graphql-transformer-interfaces": "4.1.2",
|
38
38
|
"graphql": "^15.5.0",
|
39
39
|
"graphql-mapping-template": "5.0.1",
|
@@ -42,11 +42,11 @@
|
|
42
42
|
"md5": "^2.3.0"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
|
-
"@aws-amplify/graphql-function-transformer": "3.1.
|
46
|
-
"@aws-amplify/graphql-index-transformer": "3.0.
|
47
|
-
"@aws-amplify/graphql-searchable-transformer": "3.0.
|
48
|
-
"@aws-amplify/graphql-sql-transformer": "0.4.
|
49
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
45
|
+
"@aws-amplify/graphql-function-transformer": "3.1.3",
|
46
|
+
"@aws-amplify/graphql-index-transformer": "3.0.6",
|
47
|
+
"@aws-amplify/graphql-searchable-transformer": "3.0.6",
|
48
|
+
"@aws-amplify/graphql-sql-transformer": "0.4.6",
|
49
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.5",
|
50
50
|
"@types/node": "^18.0.0"
|
51
51
|
},
|
52
52
|
"peerDependencies": {
|
@@ -92,5 +92,6 @@
|
|
92
92
|
"escapeString": true,
|
93
93
|
"printBasicPrototype": true
|
94
94
|
}
|
95
|
-
}
|
95
|
+
},
|
96
|
+
"gitHead": "701c6763d9679033043d84f9fa4091884dc3697e"
|
96
97
|
}
|
@@ -27,6 +27,8 @@ export class ConversationTransformer extends TransformerPluginBase {
|
|
27
27
|
generateResolvers: (ctx: TransformerContextProvider) => void;
|
28
28
|
// (undocumented)
|
29
29
|
prepare: (ctx: TransformerPrepareStepContextProvider) => void;
|
30
|
+
// (undocumented)
|
31
|
+
validate: () => void;
|
30
32
|
}
|
31
33
|
|
32
34
|
// (No @packageDocumentation comment for this package)
|
@@ -3,31 +3,11 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
|
6
|
+
# [0.4.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.0...@aws-amplify/graphql-conversation-transformer@0.4.0) (2024-10-17)
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
## [0.3.1-ai-streaming.4](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.3...@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.4) (2024-10-16)
|
11
|
-
|
12
|
-
**Note:** Version bump only for package @aws-amplify/graphql-conversation-transformer
|
13
|
-
|
14
|
-
## [0.3.1-ai-streaming.3](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.2...@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.3) (2024-10-15)
|
15
|
-
|
16
|
-
**Note:** Version bump only for package @aws-amplify/graphql-conversation-transformer
|
17
|
-
|
18
|
-
## [0.3.1-ai-streaming.2](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.1...@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.2) (2024-10-15)
|
19
|
-
|
20
|
-
**Note:** Version bump only for package @aws-amplify/graphql-conversation-transformer
|
21
|
-
|
22
|
-
## [0.3.1-ai-streaming.1](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.0...@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.1) (2024-10-11)
|
23
|
-
|
24
|
-
### Bug Fixes
|
25
|
-
|
26
|
-
- resolver logic for determining streaming based on exp env var ([b11ad67](https://github.com/aws-amplify/amplify-category-api/commit/b11ad67d4347445052a28421c962d3f9b15d7d86))
|
27
|
-
|
28
|
-
## [0.3.1-ai-streaming.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.3.0...@aws-amplify/graphql-conversation-transformer@0.3.1-ai-streaming.0) (2024-10-11)
|
8
|
+
### Features
|
29
9
|
|
30
|
-
|
10
|
+
- constrain custom conversation handler event version ([#2958](https://github.com/aws-amplify/amplify-category-api/issues/2958)) ([083fe17](https://github.com/aws-amplify/amplify-category-api/commit/083fe173e32a06976300b36c20d91e3c55d19f2a))
|
31
11
|
|
32
12
|
# [0.3.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-conversation-transformer@0.2.2...@aws-amplify/graphql-conversation-transformer@0.3.0) (2024-10-10)
|
33
13
|
|
@@ -8,9 +8,6 @@ export type MessageModel = {
|
|
8
8
|
messageSubscription: FieldDefinitionNode;
|
9
9
|
assistantMutationInput: InputObjectTypeDefinitionNode;
|
10
10
|
assistantMutationField: FieldDefinitionNode;
|
11
|
-
assistantStreamingMutationInput: InputObjectTypeDefinitionNode;
|
12
|
-
assistantStreamingMutationField: FieldDefinitionNode;
|
13
11
|
};
|
14
12
|
export declare const createMessageModel: (conversationModelName: string, messageModelName: string, referenceFieldName: string, capitalizedFieldName: string, conversationMessageInterface: NamedTypeNode) => MessageModel;
|
15
|
-
export declare const constructStreamResponseType: () => ObjectTypeDefinitionNode;
|
16
13
|
//# sourceMappingURL=message-model.d.ts.map
|
@@ -1 +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;
|
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"}
|
@@ -1,23 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
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
7
|
const createMessageModel = (conversationModelName, messageModelName, referenceFieldName, capitalizedFieldName, conversationMessageInterface) => {
|
8
8
|
const messageSubscriptionFieldName = `onCreateAssistantResponse${capitalizedFieldName}`;
|
9
9
|
const assistantMutationFieldName = `createAssistantResponse${capitalizedFieldName}`;
|
10
|
-
const assistantStreamingMutationFieldName = `createAssistantResponseStream${capitalizedFieldName}`;
|
11
10
|
const messageAuthDirective = constructMessageAuthDirective();
|
12
11
|
const messageModelDirective = constructMessageModelDirective();
|
13
12
|
const messageBelongsToConversationDirective = constructMessageSessionFieldBelongsToDirective(referenceFieldName);
|
14
13
|
const messageConversationField = constructMessageSessionField(messageBelongsToConversationDirective, conversationModelName);
|
15
14
|
const messageModel = constructConversationMessageModel(messageModelName, messageConversationField, referenceFieldName, [messageModelDirective, messageAuthDirective], conversationMessageInterface);
|
16
|
-
const messageSubscription = constructMessageSubscription(messageSubscriptionFieldName,
|
15
|
+
const messageSubscription = constructMessageSubscription(messageSubscriptionFieldName, messageModelName, assistantMutationFieldName);
|
17
16
|
const assistantMutationInput = constructAssistantResponseMutationInput(messageModelName);
|
18
17
|
const assistantMutationField = constructAssistantMutationField(assistantMutationFieldName, messageModelName, assistantMutationInput.name.value);
|
19
|
-
const assistantStreamingMutationInput = constructAssistantResponseStreamingMutationInput(messageModelName);
|
20
|
-
const assistantStreamingMutationField = constructAssistantStreamingMutationField(assistantStreamingMutationFieldName, assistantStreamingMutationInput.name.value);
|
21
18
|
return {
|
22
19
|
messageAuthDirective,
|
23
20
|
messageModelDirective,
|
@@ -27,8 +24,6 @@ const createMessageModel = (conversationModelName, messageModelName, referenceFi
|
|
27
24
|
messageSubscription,
|
28
25
|
assistantMutationInput,
|
29
26
|
assistantMutationField,
|
30
|
-
assistantStreamingMutationInput,
|
31
|
-
assistantStreamingMutationField,
|
32
27
|
};
|
33
28
|
};
|
34
29
|
exports.createMessageModel = createMessageModel;
|
@@ -85,11 +80,11 @@ const constructConversationMessageModel = (modelName, sessionField, referenceFie
|
|
85
80
|
};
|
86
81
|
return object;
|
87
82
|
};
|
88
|
-
const constructMessageSubscription = (subscriptionName,
|
89
|
-
const awsSubscribeDirective = (0, graphql_transformer_common_1.makeDirective)('aws_subscribe', [(0, graphql_transformer_common_1.makeArgument)('mutations', (0, graphql_transformer_common_1.makeValueNode)(
|
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]))]);
|
90
85
|
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
91
86
|
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNamedType)('ID'))];
|
92
|
-
const subscriptionField = (0, graphql_transformer_common_1.makeField)(subscriptionName, args, (0, graphql_transformer_common_1.makeNamedType)(
|
87
|
+
const subscriptionField = (0, graphql_transformer_common_1.makeField)(subscriptionName, args, (0, graphql_transformer_common_1.makeNamedType)(conversationMessageTypeName), [
|
93
88
|
awsSubscribeDirective,
|
94
89
|
cognitoAuthDirective,
|
95
90
|
]);
|
@@ -113,47 +108,4 @@ const constructAssistantResponseMutationInput = (messageModelName) => {
|
|
113
108
|
],
|
114
109
|
};
|
115
110
|
};
|
116
|
-
const constructAssistantStreamingMutationField = (fieldName, inputTypeName) => {
|
117
|
-
const args = [(0, graphql_transformer_common_1.makeInputValueDefinition)('input', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)(inputTypeName)))];
|
118
|
-
const cognitoAuthDirective = (0, graphql_transformer_common_1.makeDirective)('aws_cognito_user_pools', []);
|
119
|
-
const createAssistantResponseMutation = (0, graphql_transformer_common_1.makeField)(fieldName, args, (0, graphql_transformer_common_1.makeNamedType)(STREAM_RESPONSE_TYPE_NAME), [cognitoAuthDirective]);
|
120
|
-
return createAssistantResponseMutation;
|
121
|
-
};
|
122
|
-
const constructAssistantResponseStreamingMutationInput = (messageModelName) => {
|
123
|
-
const inputName = `Create${messageModelName}AssistantStreamingInput`;
|
124
|
-
return {
|
125
|
-
kind: 'InputObjectTypeDefinition',
|
126
|
-
name: { kind: 'Name', value: inputName },
|
127
|
-
fields: [
|
128
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('conversationId', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
129
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('associatedUserMessageId', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
130
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockIndex', (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('Int'))),
|
131
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockText', (0, graphql_transformer_common_1.makeNamedType)('String')),
|
132
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockDeltaIndex', (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
133
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockToolUse', (0, graphql_transformer_common_1.makeNamedType)('AWSJSON')),
|
134
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('contentBlockDoneAtIndex', (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
135
|
-
(0, graphql_transformer_common_1.makeInputValueDefinition)('stopReason', (0, graphql_transformer_common_1.makeNamedType)('String')),
|
136
|
-
],
|
137
|
-
};
|
138
|
-
};
|
139
|
-
const STREAM_RESPONSE_TYPE_NAME = 'ConversationMessageStreamPart';
|
140
|
-
const constructStreamResponseType = () => {
|
141
|
-
return {
|
142
|
-
kind: 'ObjectTypeDefinition',
|
143
|
-
name: { kind: 'Name', value: STREAM_RESPONSE_TYPE_NAME },
|
144
|
-
fields: [
|
145
|
-
(0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
146
|
-
(0, graphql_transformer_common_1.makeField)('owner', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
147
|
-
(0, graphql_transformer_common_1.makeField)('conversationId', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
148
|
-
(0, graphql_transformer_common_1.makeField)('associatedUserMessageId', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
149
|
-
(0, graphql_transformer_common_1.makeField)('contentBlockIndex', [], (0, graphql_transformer_common_1.makeNonNullType)((0, graphql_transformer_common_1.makeNamedType)('Int'))),
|
150
|
-
(0, graphql_transformer_common_1.makeField)('contentBlockText', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
151
|
-
(0, graphql_transformer_common_1.makeField)('contentBlockDeltaIndex', [], (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
152
|
-
(0, graphql_transformer_common_1.makeField)('contentBlockToolUse', [], (0, graphql_transformer_common_1.makeNamedType)('AWSJSON')),
|
153
|
-
(0, graphql_transformer_common_1.makeField)('contentBlockDoneAtIndex', [], (0, graphql_transformer_common_1.makeNamedType)('Int')),
|
154
|
-
(0, graphql_transformer_common_1.makeField)('stopReason', [], (0, graphql_transformer_common_1.makeNamedType)('String')),
|
155
|
-
],
|
156
|
-
};
|
157
|
-
};
|
158
|
-
exports.constructStreamResponseType = constructStreamResponseType;
|
159
111
|
//# 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;AAgD7B,MAAM,kBAAkB,GAAG,CAChC,qBAA6B,EAC7B,gBAAwB,EACxB,kBAA0B,EAC1B,oBAA4B,EAC5B,4BAA2C,EAC7B,EAAE;IAChB,MAAM,4BAA4B,GAAG,4BAA4B,oBAAoB,EAAE,CAAC;IACxF,MAAM,0BAA0B,GAAG,0BAA0B,oBAAoB,EAAE,CAAC;IAEpF,MAAM,oBAAoB,GAAG,6BAA6B,EAAE,CAAC;IAC7D,MAAM,qBA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AAM,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"}
|
@@ -12,6 +12,7 @@ export type ConversationDirectiveConfiguration = {
|
|
12
12
|
directive: DirectiveNode;
|
13
13
|
aiModel: string;
|
14
14
|
functionName: string | undefined;
|
15
|
+
handler: ConversationHandlerFunctionConfiguration | undefined;
|
15
16
|
field: FieldDefinitionNode;
|
16
17
|
responseMutationInputTypeName: string;
|
17
18
|
responseMutationName: string;
|
@@ -22,6 +23,10 @@ export type ConversationDirectiveConfiguration = {
|
|
22
23
|
messageModel: MessageModel;
|
23
24
|
inferenceConfiguration: ConversationInferenceConfiguration;
|
24
25
|
};
|
26
|
+
export type ConversationHandlerFunctionConfiguration = {
|
27
|
+
functionName: string;
|
28
|
+
eventVersion: string;
|
29
|
+
};
|
25
30
|
export type ConversationInferenceConfiguration = {
|
26
31
|
maxTokens?: number;
|
27
32
|
temperature?: number;
|
@@ -36,5 +41,6 @@ export declare class ConversationTransformer extends TransformerPluginBase {
|
|
36
41
|
field: (parent: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, definition: FieldDefinitionNode, directive: DirectiveNode, context: TransformerSchemaVisitStepContextProvider) => void;
|
37
42
|
generateResolvers: (ctx: TransformerContextProvider) => void;
|
38
43
|
prepare: (ctx: TransformerPrepareStepContextProvider) => void;
|
44
|
+
validate: () => void;
|
39
45
|
}
|
40
46
|
//# sourceMappingURL=grapqhl-conversation-transformer.d.ts.map
|
@@ -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,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;AAIhE,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;
|
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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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;IAEF,QAAQ,QAAO,IAAI,CAiBjB;CACH"}
|
@@ -1,4 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
26
|
exports.ConversationTransformer = void 0;
|
4
27
|
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
@@ -6,6 +29,7 @@ const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-cor
|
|
6
29
|
const conversation_prepare_handler_1 = require("./transformer-steps/conversation-prepare-handler");
|
7
30
|
const conversation_resolver_generator_1 = require("./transformer-steps/conversation-resolver-generator");
|
8
31
|
const conversation_field_handler_1 = require("./transformer-steps/conversation-field-handler");
|
32
|
+
const semver = __importStar(require("semver"));
|
9
33
|
class ConversationTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
10
34
|
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider, functionNameMap) {
|
11
35
|
super('amplify-conversation-transformer', graphql_directives_1.ConversationDirective.definition);
|
@@ -20,16 +44,26 @@ class ConversationTransformer extends graphql_transformer_core_1.TransformerPlug
|
|
20
44
|
this.prepare = (ctx) => {
|
21
45
|
this.prepareHandler.prepare(ctx, this.directives);
|
22
46
|
};
|
47
|
+
this.validate = () => {
|
48
|
+
for (const directive of this.directives) {
|
49
|
+
if (directive.field.type.kind !== 'NamedType' || directive.field.type.name.value !== 'ConversationMessage') {
|
50
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be ConversationMessage');
|
51
|
+
}
|
52
|
+
if (directive.handler && directive.functionName) {
|
53
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError("'functionName' and 'handler' are mutually exclusive");
|
54
|
+
}
|
55
|
+
if (directive.handler) {
|
56
|
+
const eventVersion = semver.coerce(directive.handler.eventVersion);
|
57
|
+
if ((eventVersion === null || eventVersion === void 0 ? void 0 : eventVersion.major) !== 1) {
|
58
|
+
throw new Error(`Unsupported custom conversation handler. Expected eventVersion to match 1.x, received ${directive.handler.eventVersion}`);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
};
|
23
63
|
this.fieldHandler = new conversation_field_handler_1.ConversationFieldHandler();
|
24
64
|
this.prepareHandler = new conversation_prepare_handler_1.ConversationPrepareHandler(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider);
|
25
65
|
this.resolverGenerator = new conversation_resolver_generator_1.ConversationResolverGenerator(functionNameMap);
|
26
66
|
}
|
27
67
|
}
|
28
68
|
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
69
|
//# 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":"
|
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;AAE1F,+CAAiC;AA+CjC,MAAa,uBAAwB,SAAQ,gDAAqB;IAMhE,YACE,gBAAkC,EAClC,kBAAsC,EACtC,oBAA0C,EAC1C,YAAqC,EACrC,eAAkD;QAElD,KAAK,CAAC,kCAAkC,EAAE,0CAAqB,CAAC,UAAU,CAAC,CAAC;QAZtE,eAAU,GAAyC,EAAE,CAAC;QAyB9D,UAAK,GAAG,CACN,MAA8D,EAC9D,UAA+B,EAC/B,SAAwB,EACxB,OAAkD,EAC5C,EAAE;YACR,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YACpG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC,CAAC;QAMF,sBAAiB,GAAG,CAAC,GAA+B,EAAQ,EAAE;YAC5D,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,EAAE,GAA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@ export function request(ctx) {
|
|
7
7
|
[[TOOL_DEFINITIONS_LINE]]
|
8
8
|
const selectionSet = '[[SELECTION_SET]]';
|
9
9
|
|
10
|
-
const
|
10
|
+
const responseMutation = {
|
11
11
|
name: '[[RESPONSE_MUTATION_NAME]]',
|
12
12
|
inputTypeName: '[[RESPONSE_MUTATION_INPUT_TYPE_NAME]]',
|
13
13
|
selectionSet,
|
14
14
|
};
|
15
|
-
|
16
|
-
const streamingResponseMutation = {
|
17
|
-
name: '[[STREAMING_RESPONSE_MUTATION_NAME]]',
|
18
|
-
inputTypeName: '[[STREAMING_RESPONSE_MUTATION_INPUT_TYPE_NAME]]',
|
19
|
-
selectionSet,
|
20
|
-
};
|
21
|
-
|
22
15
|
const currentMessageId = ctx.stash.defaultValues.id;
|
23
16
|
[[MODEL_CONFIGURATION_LINE]]
|
24
17
|
|
@@ -35,11 +28,6 @@ export function request(ctx) {
|
|
35
28
|
listQueryLimit: [[LIST_QUERY_LIMIT]],
|
36
29
|
};
|
37
30
|
|
38
|
-
const disableStreaming = ctx.env['[[DISABLE_STREAMING_ENV_VAR]]'] === 'true';
|
39
|
-
const responseMutation = !!disableStreaming
|
40
|
-
? singleShotResponseMutation
|
41
|
-
: streamingResponseMutation;
|
42
|
-
|
43
31
|
const authHeader = request.headers['authorization'];
|
44
32
|
const payload = {
|
45
33
|
conversationId: args.conversationId,
|
@@ -50,7 +38,6 @@ export function request(ctx) {
|
|
50
38
|
request: { headers: { authorization: authHeader } },
|
51
39
|
messageHistoryQuery,
|
52
40
|
toolsConfiguration,
|
53
|
-
streamResponse: !disableStreaming,
|
54
41
|
};
|
55
42
|
|
56
43
|
return {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAczF,eAAO,MAAM,2BAA2B,WAAY,kCAAkC,KAAG,
|
1
|
+
{"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAczF,eAAO,MAAM,2BAA2B,WAAY,kCAAkC,KAAG,uBAuCxF,CAAC"}
|
@@ -12,7 +12,7 @@ const graphql_transformer_common_1 = require("graphql-transformer-common");
|
|
12
12
|
const pluralize_1 = __importDefault(require("pluralize"));
|
13
13
|
const invokeLambdaMappingTemplate = (config) => {
|
14
14
|
const { TOOL_DEFINITIONS_LINE, TOOLS_CONFIGURATION_LINE } = generateToolLines(config);
|
15
|
-
const SELECTION_SET =
|
15
|
+
const SELECTION_SET = selectionSet;
|
16
16
|
const MODEL_CONFIGURATION_LINE = generateModelConfigurationLine(config);
|
17
17
|
const RESPONSE_MUTATION_NAME = config.responseMutationName;
|
18
18
|
const RESPONSE_MUTATION_INPUT_TYPE_NAME = config.responseMutationInputTypeName;
|
@@ -22,9 +22,6 @@ const invokeLambdaMappingTemplate = (config) => {
|
|
22
22
|
const LIST_QUERY_NAME = `listConversationMessage${(0, graphql_transformer_common_1.toUpper)((0, pluralize_1.default)(config.field.name.value))}`;
|
23
23
|
const LIST_QUERY_INPUT_TYPE_NAME = `ModelConversationMessage${(0, graphql_transformer_common_1.toUpper)(config.field.name.value)}FilterInput`;
|
24
24
|
const LIST_QUERY_LIMIT = 'undefined';
|
25
|
-
const STREAMING_RESPONSE_MUTATION_NAME = config.messageModel.assistantStreamingMutationField.name.value;
|
26
|
-
const STREAMING_RESPONSE_MUTATION_INPUT_TYPE_NAME = config.messageModel.assistantStreamingMutationInput.name.value;
|
27
|
-
const DISABLE_STREAMING_ENV_VAR = `${config.field.name.value}_DISABLE_STREAMING`;
|
28
25
|
const substitutions = {
|
29
26
|
TOOL_DEFINITIONS_LINE,
|
30
27
|
TOOLS_CONFIGURATION_LINE,
|
@@ -38,9 +35,6 @@ const invokeLambdaMappingTemplate = (config) => {
|
|
38
35
|
LIST_QUERY_NAME,
|
39
36
|
LIST_QUERY_INPUT_TYPE_NAME,
|
40
37
|
LIST_QUERY_LIMIT,
|
41
|
-
STREAMING_RESPONSE_MUTATION_NAME,
|
42
|
-
STREAMING_RESPONSE_MUTATION_INPUT_TYPE_NAME,
|
43
|
-
DISABLE_STREAMING_ENV_VAR,
|
44
38
|
};
|
45
39
|
let resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'invoke-lambda-resolver-fn.template.js'), 'utf8');
|
46
40
|
Object.entries(substitutions).forEach(([key, value]) => {
|
@@ -80,5 +74,4 @@ const generateModelInferenceConfigurationLine = (config) => {
|
|
80
74
|
: '';
|
81
75
|
};
|
82
76
|
const selectionSet = `id conversationId content { image { format source { bytes }} text toolUse { toolUseId name input } toolResult { status toolUseId content { json text image { format source { bytes }} document { format name source { bytes }} }}} role owner createdAt updatedAt`;
|
83
|
-
const streamingSelectionSet = `associatedUserMessageId contentBlockDeltaIndex contentBlockDoneAtIndex contentBlockIndex contentBlockText contentBlockToolUse conversationId id stopReason`;
|
84
77
|
//# sourceMappingURL=invoke-lambda-resolver.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoke-lambda-resolver.js","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":";;;;;;AACA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AACxB,0DAA+B;AAC/B,2EAAqD;AACrD,0DAAkC;AAS3B,MAAM,2BAA2B,GAAG,CAAC,MAA0C,EAA2B,EAAE;IACjH,MAAM,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACtF,MAAM,aAAa,GAAG,
|
1
|
+
{"version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O;oBACH,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;MAC1C,uCAAuC,CAAC,MAAM,CAAC;KAChD,CAAC;AACN,CAAC,CAAC;AAQF,MAAM,uCAAuC,GAAG,CAAC,MAA0C,EAAE,EAAE;IAC7F,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,CAAC;IAC1C,OAAO,sBAAsB,IAAI,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,GAAG,CAAC;QAC7E,CAAC,CAAC,IAAA,mBAAM,EAAA,2BAA2B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG;QACnF,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAKF,MAAM,YAAY,GAAG,mQAAmQ,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;
|
1
|
+
{"version":3,"file":"conversation-prepare-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAOzF,qBAAa,0BAA0B;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,YAAY,CAA0B;gBAU5C,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,uBAAuB;IAmBvC,OAAO,CAAC,GAAG,EAAE,qCAAqC,EAAE,UAAU,EAAE,kCAAkC,EAAE,GAAG,IAAI;IAkB3G,OAAO,CAAC,4BAA4B;CA+DrC"}
|
@@ -16,12 +16,11 @@ class ConversationPrepareHandler {
|
|
16
16
|
}
|
17
17
|
prepareResourcesForDirective(directive, ctx) {
|
18
18
|
const { conversationAuthDirective, conversationModelDirective, conversationHasManyMessagesDirective, conversationMessagesField, conversationModel, } = directive.conversationModel;
|
19
|
-
const { messageAuthDirective, messageModelDirective, messageBelongsToConversationDirective, messageConversationField, messageModel, messageSubscription, assistantMutationField, assistantMutationInput,
|
19
|
+
const { messageAuthDirective, messageModelDirective, messageBelongsToConversationDirective, messageConversationField, messageModel, messageSubscription, assistantMutationField, assistantMutationInput, } = directive.messageModel;
|
20
20
|
const sessionModelName = conversationModel.name.value;
|
21
21
|
const messageModelName = messageModel.name.value;
|
22
22
|
ctx.output.addInput(assistantMutationInput);
|
23
|
-
ctx.output.
|
24
|
-
ctx.output.addMutationFields([assistantMutationField, assistantStreamingMutationField]);
|
23
|
+
ctx.output.addMutationFields([assistantMutationField]);
|
25
24
|
ctx.output.addSubscriptionFields([messageSubscription]);
|
26
25
|
ctx.output.addObject(conversationModel);
|
27
26
|
ctx.output.addObject(messageModel);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-prepare-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":";;;AAIA,oFAAyH;
|
1
|
+
{"version":3,"file":"conversation-prepare-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-prepare-handler.ts"],"names":[],"mappings":";;;AAIA,oFAAyH;AAQzH,MAAa,0BAA0B;IAarC,YACE,gBAAkC,EAClC,kBAAsC,EACtC,oBAA0C,EAC1C,YAAqC;QAErC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAaD,OAAO,CAAC,GAA0C,EAAE,UAAgD;QAClG,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;SACnD;IACH,CAAC;IAcO,4BAA4B,CAAC,SAA6C,EAAE,GAA0C;QAI5H,MAAM,EACJ,yBAAyB,EACzB,0BAA0B,EAC1B,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,GAClB,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAGhC,MAAM,EACJ,oBAAoB,EACpB,qBAAqB,EACrB,qCAAqC,EACrC,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,GAAG,SAAS,CAAC,YAAY,CAAC;QAG3B,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;QACtD,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAGjD,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QAC5C,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,mB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F;AArHD,gEAqHC"}
|
@@ -14,7 +14,6 @@ export declare class ConversationResolverGenerator {
|
|
14
14
|
private createConversationPipelineResolver;
|
15
15
|
private addPipelineResolverFunctions;
|
16
16
|
private createAssistantResponseResolver;
|
17
|
-
private createAssistantStreamingResponseResolver;
|
18
17
|
private createAssistantResponseSubscriptionResolver;
|
19
18
|
private addLambdaDataSource;
|
20
19
|
private addInitSlotToListMessagesPipeline;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAClH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAIzF,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAClH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAIzF,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAwBnC,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBAAhB,eAAe,CAAC,sDAA2B;IAExE,iBAAiB,CAAC,UAAU,EAAE,kCAAkC,EAAE,EAAE,GAAG,EAAE,0BAA0B,GAAG,IAAI;IAQ1G,OAAO,CAAC,wBAAwB;IAOhC,OAAO,CAAC,6BAA6B;IAgDrC,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,+BAA+B;IAmBvC,OAAO,CAAC,+BAA+B;IAgCvC,OAAO,CAAC,kCAAkC;IA6C1C,OAAO,CAAC,4BAA4B;IAkCpC,OAAO,CAAC,+BAA+B;IA2CvC,OAAO,CAAC,2CAA2C;IAqCnD,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,iCAAiC;IAazC,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,uBAAuB;CAgChC"}
|
@@ -43,8 +43,6 @@ const assistant_messages_subscription_resolver_1 = require("../resolvers/assista
|
|
43
43
|
const graphql_index_transformer_1 = require("@aws-amplify/graphql-index-transformer");
|
44
44
|
const pluralize_1 = __importDefault(require("pluralize"));
|
45
45
|
const list_messages_init_resolver_1 = require("../resolvers/list-messages-init-resolver");
|
46
|
-
const assistant_streaming_mutation_resolver_1 = require("../resolvers/assistant-streaming-mutation-resolver");
|
47
|
-
const assistant_streaming_mutation_reduce_chunks_resolver_1 = require("../resolvers/assistant-streaming-mutation-reduce-chunks-resolver");
|
48
46
|
class ConversationResolverGenerator {
|
49
47
|
constructor(functionNameMap) {
|
50
48
|
this.functionNameMap = functionNameMap;
|
@@ -79,14 +77,16 @@ class ConversationResolverGenerator {
|
|
79
77
|
const writeMessageToTableFunction = (0, write_message_to_table_resolver_1.writeMessageToTableMappingTemplate)(directive);
|
80
78
|
this.createConversationPipelineResolver(ctx, parentName, fieldName, capitalizedFieldName, functionDataSource, invokeLambdaFunction, initResolverFunction, authResolverFunction, verifySessionOwnerSendMessageResolverFunction, writeMessageToTableFunction);
|
81
79
|
this.createAssistantResponseResolver(ctx, directive, capitalizedFieldName, initResolverFunction, authResolverFunction, verifySessionOwnerAssistantResponseResolverFunction);
|
82
|
-
this.createAssistantStreamingResponseResolver(ctx, directive, capitalizedFieldName, initResolverFunction, authResolverFunction, verifySessionOwnerAssistantResponseResolverFunction);
|
83
80
|
this.createAssistantResponseSubscriptionResolver(ctx, directive, capitalizedFieldName);
|
84
81
|
}
|
85
82
|
createFunctionStack(ctx, capitalizedFieldName) {
|
86
83
|
return ctx.stackManager.createStack(`${capitalizedFieldName}ConversationDirectiveLambdaStack`);
|
87
84
|
}
|
88
85
|
setupFunctionDataSource(directive, functionStack, capitalizedFieldName) {
|
89
|
-
if (directive.
|
86
|
+
if (directive.handler) {
|
87
|
+
return this.setupExistingFunctionDataSource(directive.handler.functionName);
|
88
|
+
}
|
89
|
+
else if (directive.functionName) {
|
90
90
|
return this.setupExistingFunctionDataSource(directive.functionName);
|
91
91
|
}
|
92
92
|
else {
|
@@ -149,22 +149,6 @@ class ConversationResolverGenerator {
|
|
149
149
|
resolver.addJsFunctionToSlot('verifySessionOwner', verifySessionOwnerResolverFunction, conversationSessionDDBDataSource);
|
150
150
|
ctx.resolvers.addResolver('Mutation', directive.responseMutationName, resolver);
|
151
151
|
}
|
152
|
-
createAssistantStreamingResponseResolver(ctx, directive, capitalizedFieldName, initResolverFunction, authResolverFunction, verifySessionOwnerResolverFunction) {
|
153
|
-
const assistantResponseResolverResourceId = graphql_transformer_common_1.ResolverResourceIDs.ResolverResourceID('Mutation', directive.messageModel.assistantStreamingMutationField.name.value);
|
154
|
-
const assistantResponseResolverFunction = (0, assistant_streaming_mutation_resolver_1.assistantStreamingMutationResolver)(directive);
|
155
|
-
const conversationMessageDataSourceName = (0, graphql_transformer_core_2.getModelDataSourceNameForTypeName)(ctx, `ConversationMessage${capitalizedFieldName}`);
|
156
|
-
const conversationMessageDataSource = ctx.api.host.getDataSource(conversationMessageDataSourceName);
|
157
|
-
const resolver = new graphql_transformer_core_1.TransformerResolver('Mutation', directive.messageModel.assistantStreamingMutationField.name.value, assistantResponseResolverResourceId, { codeMappingTemplate: assistantResponseResolverFunction }, ['init', 'auth', 'verifySessionOwner'], ['reduceChunks'], conversationMessageDataSource, graphql_transformer_core_1.APPSYNC_JS_RUNTIME);
|
158
|
-
resolver.addJsFunctionToSlot('init', initResolverFunction);
|
159
|
-
resolver.addJsFunctionToSlot('auth', authResolverFunction);
|
160
|
-
const sessionModelName = `Conversation${capitalizedFieldName}`;
|
161
|
-
const sessionModelDDBDataSourceName = (0, graphql_transformer_core_2.getModelDataSourceNameForTypeName)(ctx, sessionModelName);
|
162
|
-
const conversationSessionDDBDataSource = ctx.api.host.getDataSource(sessionModelDDBDataSourceName);
|
163
|
-
resolver.addJsFunctionToSlot('verifySessionOwner', verifySessionOwnerResolverFunction, conversationSessionDDBDataSource);
|
164
|
-
const reduceChunksFunction = (0, assistant_streaming_mutation_reduce_chunks_resolver_1.assistantStreamingMutationReduceChunksResolver)(directive);
|
165
|
-
resolver.addJsFunctionToSlot('reduceChunks', reduceChunksFunction, conversationMessageDataSource);
|
166
|
-
ctx.resolvers.addResolver('Mutation', directive.messageModel.assistantStreamingMutationField.name.value, resolver);
|
167
|
-
}
|
168
152
|
createAssistantResponseSubscriptionResolver(ctx, directive, capitalizedFieldName) {
|
169
153
|
const onAssistantResponseSubscriptionFieldName = `onCreateAssistantResponse${capitalizedFieldName}`;
|
170
154
|
const onAssistantResponseSubscriptionResolverResourceId = graphql_transformer_common_1.ResolverResourceIDs.ResolverResourceID('Subscription', onAssistantResponseSubscriptionFieldName);
|