@aws-amplify/graphql-api-construct 1.15.1-ai-streaming.4 → 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 -15
- 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 -19
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.d.ts +0 -2
- 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 +3 -34
- 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 +0 -6
- 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 -17
- 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 -100
- 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 -121
- 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,4 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { ConversationTurnEvent } from './types.js';
|
3
2
|
import type { ContentBlock } from '@aws-sdk/client-bedrock-runtime';
|
4
3
|
import { GraphqlRequestExecutor } from './graphql_request_executor';
|
@@ -16,11 +15,10 @@ export type MutationResponseInput = {
|
|
16
15
|
export declare class ConversationTurnResponseSender {
|
17
16
|
private readonly event;
|
18
17
|
private readonly graphqlRequestExecutor;
|
19
|
-
private readonly logger;
|
20
18
|
/**
|
21
19
|
* Creates conversation turn response sender.
|
22
20
|
*/
|
23
|
-
constructor(event: ConversationTurnEvent, graphqlRequestExecutor?: GraphqlRequestExecutor
|
21
|
+
constructor(event: ConversationTurnEvent, graphqlRequestExecutor?: GraphqlRequestExecutor);
|
24
22
|
sendResponse: (message: ContentBlock[]) => Promise<void>;
|
25
23
|
private createMutationRequest;
|
26
24
|
}
|
@@ -10,14 +10,15 @@ class ConversationTurnResponseSender {
|
|
10
10
|
/**
|
11
11
|
* Creates conversation turn response sender.
|
12
12
|
*/
|
13
|
-
constructor(event, graphqlRequestExecutor = new graphql_request_executor_1.GraphqlRequestExecutor(event.graphqlApiEndpoint, event.request.headers.authorization
|
13
|
+
constructor(event, graphqlRequestExecutor = new graphql_request_executor_1.GraphqlRequestExecutor(event.graphqlApiEndpoint, event.request.headers.authorization)) {
|
14
14
|
this.event = event;
|
15
15
|
this.graphqlRequestExecutor = graphqlRequestExecutor;
|
16
|
-
this.logger = logger;
|
17
16
|
this.sendResponse = async (message) => {
|
18
|
-
const
|
19
|
-
this.
|
20
|
-
|
17
|
+
const { query, variables } = this.createMutationRequest(message);
|
18
|
+
await this.graphqlRequestExecutor.executeGraphql({
|
19
|
+
query,
|
20
|
+
variables,
|
21
|
+
});
|
21
22
|
};
|
22
23
|
this.createMutationRequest = (content) => {
|
23
24
|
const query = `
|
@@ -49,4 +50,4 @@ class ConversationTurnResponseSender {
|
|
49
50
|
}
|
50
51
|
}
|
51
52
|
exports.ConversationTurnResponseSender = ConversationTurnResponseSender;
|
52
|
-
//# sourceMappingURL=data:application/json;base64,
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVyc2F0aW9uX3R1cm5fcmVzcG9uc2Vfc2VuZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbnZlcnNhdGlvbi9ydW50aW1lL2NvbnZlcnNhdGlvbl90dXJuX3Jlc3BvbnNlX3NlbmRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSx5RUFBb0U7QUFVcEU7OztHQUdHO0FBQ0gsTUFBYSw4QkFBOEI7SUFDekM7O09BRUc7SUFDSCxZQUNtQixLQUE0QixFQUM1Qix5QkFBeUIsSUFBSSxpREFBc0IsQ0FDbEUsS0FBSyxDQUFDLGtCQUFrQixFQUN4QixLQUFLLENBQUMsT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mlhYmxlcyB9O1xuICB9O1xufVxuIl19
|
package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/default_handler.d.ts
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
* This is an entry point for Amplify provided implementation.
|
4
4
|
*/
|
5
5
|
export declare const handler: (event: import("./types.js").ConversationTurnEvent, props?: {
|
6
|
-
tools?: import("./types.js").ExecutableTool
|
6
|
+
tools?: import("./types.js").ExecutableTool[] | undefined;
|
7
7
|
} | undefined) => Promise<void>;
|
8
8
|
//# sourceMappingURL=default_handler.d.ts.map
|
@@ -22,11 +22,11 @@ class ConversationTurnEventToolsProvider {
|
|
22
22
|
const tools = (_a = toolsConfiguration.dataTools) === null || _a === void 0 ? void 0 : _a.map((tool) => {
|
23
23
|
const { name, description, inputSchema } = tool;
|
24
24
|
const query = this.graphQlQueryFactory.createQuery(tool);
|
25
|
-
return new graphql_tool_1.GraphQlTool(name, description, inputSchema, graphqlApiEndpoint, query, this.event.request.headers.authorization
|
25
|
+
return new graphql_tool_1.GraphQlTool(name, description, inputSchema, graphqlApiEndpoint, query, this.event.request.headers.authorization);
|
26
26
|
});
|
27
27
|
return tools !== null && tools !== void 0 ? tools : [];
|
28
28
|
};
|
29
29
|
}
|
30
30
|
}
|
31
31
|
exports.ConversationTurnEventToolsProvider = ConversationTurnEventToolsProvider;
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfdG9vbHNfcHJvdmlkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY29udmVyc2F0aW9uL3J1bnRpbWUvZXZlbnQtdG9vbHMtcHJvdmlkZXIvZXZlbnRfdG9vbHNfcHJvdmlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsaURBQTZDO0FBQzdDLG1FQUE4RDtBQUU5RD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VyYXRpb24uZGF0YVRvb2xzPy5tYXAoKHRvb2wpID0+IHtcbiAgICAgIGNvbnN0IHsgbmFtZSwgZGVzY3JpcHRpb24sIGlucHV0U2NoZW1hIH0gPSB0b29sO1xuICAgICAgY29uc3QgcXVlcnkgPSB0aGlzLmdyYXBoUWxRdWVyeUZhY3RvcnkuY3JlYXRlUXVlcnkodG9vbCk7XG4gICAgICByZXR1cm4gbmV3IEdyYXBoUWxUb29sKFxuICAgICAgICBuYW1lLFxuICAgICAgICBkZXNjcmlwdGlvbixcbiAgICAgICAgaW5wdXRTY2hlbWEsXG4gICAgICAgIGdyYXBocWxBcGlFbmRwb2ludCxcbiAgICAgICAgcXVlcnksXG4gICAgICAgIHRoaXMuZXZlbnQucmVxdWVzdC5oZWFkZXJzLmF1dGhvcml6YXRpb25cbiAgICAgICk7XG4gICAgfSk7XG4gICAgcmV0dXJuIHRvb2xzID8/IFtdO1xuICB9O1xufVxuIl19
|
@@ -1,22 +1,22 @@
|
|
1
|
-
import { ExecutableTool
|
2
|
-
import type { ToolResultContentBlock } from '@aws-sdk/client-bedrock-runtime';
|
1
|
+
import { ExecutableTool } from '../types';
|
2
|
+
import type { ToolInputSchema, ToolResultContentBlock } from '@aws-sdk/client-bedrock-runtime';
|
3
|
+
import { DocumentType } from '@smithy/types';
|
3
4
|
import { GraphqlRequestExecutor } from '../graphql_request_executor';
|
4
5
|
/**
|
5
6
|
* A tool that use GraphQl queries.
|
6
7
|
*/
|
7
|
-
export declare class GraphQlTool implements ExecutableTool
|
8
|
+
export declare class GraphQlTool implements ExecutableTool {
|
8
9
|
name: string;
|
9
10
|
description: string;
|
10
|
-
inputSchema: ToolInputSchema
|
11
|
+
inputSchema: ToolInputSchema;
|
11
12
|
readonly graphQlEndpoint: string;
|
12
13
|
private readonly query;
|
13
14
|
readonly accessToken: string;
|
14
|
-
readonly userAgent: string;
|
15
15
|
private readonly graphqlRequestExecutor;
|
16
16
|
/**
|
17
17
|
* Creates GraphQl Tool
|
18
18
|
*/
|
19
|
-
constructor(name: string, description: string, inputSchema: ToolInputSchema
|
20
|
-
execute: (input:
|
19
|
+
constructor(name: string, description: string, inputSchema: ToolInputSchema, graphQlEndpoint: string, query: string, accessToken: string, graphqlRequestExecutor?: GraphqlRequestExecutor);
|
20
|
+
execute: (input: DocumentType | undefined) => Promise<ToolResultContentBlock>;
|
21
21
|
}
|
22
22
|
//# sourceMappingURL=graphql_tool.d.ts.map
|
@@ -9,14 +9,13 @@ class GraphQlTool {
|
|
9
9
|
/**
|
10
10
|
* Creates GraphQl Tool
|
11
11
|
*/
|
12
|
-
constructor(name, description, inputSchema, graphQlEndpoint, query, accessToken,
|
12
|
+
constructor(name, description, inputSchema, graphQlEndpoint, query, accessToken, graphqlRequestExecutor = new graphql_request_executor_1.GraphqlRequestExecutor(graphQlEndpoint, accessToken)) {
|
13
13
|
this.name = name;
|
14
14
|
this.description = description;
|
15
15
|
this.inputSchema = inputSchema;
|
16
16
|
this.graphQlEndpoint = graphQlEndpoint;
|
17
17
|
this.query = query;
|
18
18
|
this.accessToken = accessToken;
|
19
|
-
this.userAgent = userAgent;
|
20
19
|
this.graphqlRequestExecutor = graphqlRequestExecutor;
|
21
20
|
this.execute = async (input) => {
|
22
21
|
if (!input) {
|
@@ -31,4 +30,4 @@ class GraphQlTool {
|
|
31
30
|
}
|
32
31
|
}
|
33
32
|
exports.GraphQlTool = GraphQlTool;
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JhcGhxbF90b29sLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbnZlcnNhdGlvbi9ydW50aW1lL2V2ZW50LXRvb2xzLXByb3ZpZGVyL2dyYXBocWxfdG9vbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFNQSwwRUFBcUU7QUFFckU7O0dBR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gICAgdGhyb3cgRXJyb3IoYEdyYXBoUWwgdG9vbCAnJHt0aGlzLm5hbWV9JyByZXF1aXJlcyBpbnB1dCB0byBleGVjdXRlLmApO1xuICAgIH1cblxuICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5ncmFwaHFsUmVxdWVzdEV4ZWN1dG9yLmV4ZWN1dGVHcmFwaHFsPFxuICAgICAgRG9jdW1lbnRUeXBlLFxuICAgICAgRG9jdW1lbnRUeXBlXG4gICAgPih7XG4gICAgICBxdWVyeTogdGhpcy5xdWVyeSxcbiAgICAgIHZhcmlhYmxlczogaW5wdXQsXG4gICAgfSk7XG4gICAgcmV0dXJuIHsganNvbjogcmVzcG9uc2UgYXMgRG9jdW1lbnRUeXBlIH07XG4gIH07XG59XG4iXX0=
|
@@ -11,12 +11,11 @@ export type GraphqlRequest<TVariables> = {
|
|
11
11
|
export declare class GraphqlRequestExecutor {
|
12
12
|
private readonly graphQlEndpoint;
|
13
13
|
private readonly accessToken;
|
14
|
-
private readonly userAgent;
|
15
14
|
private readonly _fetch;
|
16
15
|
/**
|
17
16
|
* Creates GraphQL request executor.
|
18
17
|
*/
|
19
|
-
constructor(graphQlEndpoint: string, accessToken: string,
|
18
|
+
constructor(graphQlEndpoint: string, accessToken: string, _fetch?: typeof fetch);
|
20
19
|
executeGraphql: <TVariables, TReturn>(request: GraphqlRequest<TVariables>) => Promise<TReturn>;
|
21
20
|
}
|
22
21
|
//# sourceMappingURL=graphql_request_executor.d.ts.map
|
package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js
CHANGED
@@ -10,10 +10,9 @@ class GraphqlRequestExecutor {
|
|
10
10
|
/**
|
11
11
|
* Creates GraphQL request executor.
|
12
12
|
*/
|
13
|
-
constructor(graphQlEndpoint, accessToken,
|
13
|
+
constructor(graphQlEndpoint, accessToken, _fetch = fetch) {
|
14
14
|
this.graphQlEndpoint = graphQlEndpoint;
|
15
15
|
this.accessToken = accessToken;
|
16
|
-
this.userAgent = userAgent;
|
17
16
|
this._fetch = _fetch;
|
18
17
|
this.executeGraphql = async (request) => {
|
19
18
|
const httpRequest = new Request(this.graphQlEndpoint, {
|
@@ -21,7 +20,6 @@ class GraphqlRequestExecutor {
|
|
21
20
|
headers: {
|
22
21
|
'Content-Type': 'application/graphql',
|
23
22
|
Authorization: this.accessToken,
|
24
|
-
'x-amz-user-agent': this.userAgent,
|
25
23
|
},
|
26
24
|
body: JSON.stringify({
|
27
25
|
query: request.query,
|
@@ -44,4 +42,4 @@ class GraphqlRequestExecutor {
|
|
44
42
|
}
|
45
43
|
}
|
46
44
|
exports.GraphqlRequestExecutor = GraphqlRequestExecutor;
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JhcGhxbF9yZXF1ZXN0X2V4ZWN1dG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbnZlcnNhdGlvbi9ydW50aW1lL2dyYXBocWxfcmVxdWVzdF9leGVjdXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFLQTs7OztHQUlHO0FBQ0gsTUFBYSxzQkFBc0I7SUFDakM7O09BRUc7SUFDSCxZQUNtQixlQUF1QixFQUN2QixXQUFtQixFQUNuQixTQUFTLEtBQUs7UUFGZCxvQkFBZSxHQUFmLGVBQWUsQ0FBUTtRQUN2QixnQkFBVyxHQUFYLFdBQVcsQ0FBUTtRQUNuQixXQUFNLEdBQU4sTUFBTSxDQUFRO1FBR2pDLG1CQUFjLEdBQUcsS0FBSyxFQUNwQixPQUFtQyxFQUNqQixFQUFFO1lBQ3BCLE1BQU0sV0FBVyxHQUFHLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxlQUFlLEVBQUU7Z0JBQ3BELE1BQU0sRUFBRSxNQUFNO2dCQUNkLE9BQU8sRUFBRT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mV3IEVycm9yKFxuICAgICAgICBgR3JhcGhRTCByZXF1ZXN0IGZhaWxlZCwgcmVzcG9uc2UgaGVhZGVycz0ke0pTT04uc3RyaW5naWZ5KFxuICAgICAgICAgIHJlc3BvbnNlSGVhZGVyc1xuICAgICAgICApfSwgYm9keT0ke0pTT04uc3RyaW5naWZ5KGJvZHkpfWBcbiAgICAgICk7XG4gICAgfVxuICAgIHJldHVybiBib2R5IGFzIFRSZXR1cm47XG4gIH07XG59XG4iXX0=
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { ConversationMessage, ConversationMessageContentBlock, ConversationTurnEvent, ExecutableTool,
|
1
|
+
import { ConversationMessage, ConversationMessageContentBlock, ConversationTurnEvent, ExecutableTool, ToolDefinition, ToolExecutionInput, ToolInputSchema, ToolResultContentBlock } from './types.js';
|
2
2
|
import { handleConversationTurnEvent } from './conversation_turn_executor.js';
|
3
|
-
|
4
|
-
export { ConversationMessage, ConversationMessageContentBlock, ConversationTurnEvent, createExecutableTool, ExecutableTool, FromJSONSchema, JSONSchema, handleConversationTurnEvent, ToolDefinition, ToolInputSchema, ToolResultContentBlock, };
|
3
|
+
export { ConversationMessage, ConversationMessageContentBlock, ConversationTurnEvent, ExecutableTool, handleConversationTurnEvent, ToolDefinition, ToolExecutionInput, ToolInputSchema, ToolResultContentBlock, };
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1,8 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.handleConversationTurnEvent =
|
3
|
+
exports.handleConversationTurnEvent = void 0;
|
4
4
|
const conversation_turn_executor_js_1 = require("./conversation_turn_executor.js");
|
5
5
|
Object.defineProperty(exports, "handleConversationTurnEvent", { enumerable: true, get: function () { return conversation_turn_executor_js_1.handleConversationTurnEvent; } });
|
6
|
-
|
7
|
-
Object.defineProperty(exports, "createExecutableTool", { enumerable: true, get: function () { return executable_tool_factory_js_1.createExecutableTool; } });
|
8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oZW1hLFxuICBUb29sUmVzdWx0Q29udGVudEJsb2NrLFxufTtcbiJdfQ==
|
@@ -1,11 +1,8 @@
|
|
1
1
|
import * as bedrock from '@aws-sdk/client-bedrock-runtime';
|
2
|
-
import * as
|
3
|
-
export type
|
4
|
-
export type FromJSONSchema<TJSONSchema extends JSONSchema> = jsonSchemaToTypeScript.FromSchema<TJSONSchema>;
|
5
|
-
export type ToolInputSchema<TJSONSchema extends JSONSchema> = {
|
6
|
-
json: TJSONSchema;
|
7
|
-
};
|
2
|
+
import * as smithy from '@smithy/types';
|
3
|
+
export type ToolInputSchema = bedrock.ToolInputSchema;
|
8
4
|
export type ToolResultContentBlock = bedrock.ToolResultContentBlock;
|
5
|
+
export type ToolExecutionInput = smithy.DocumentType;
|
9
6
|
export type ConversationMessage = {
|
10
7
|
role: 'user' | 'assistant';
|
11
8
|
content: Array<ConversationMessageContentBlock>;
|
@@ -16,22 +13,15 @@ export type ConversationMessageContentBlock = bedrock.ContentBlock | {
|
|
16
13
|
bytes: string;
|
17
14
|
};
|
18
15
|
};
|
19
|
-
text?: never;
|
20
|
-
document?: never;
|
21
|
-
toolUse?: never;
|
22
|
-
toolResult?: never;
|
23
|
-
guardContent?: never;
|
24
|
-
$unknown?: never;
|
25
16
|
};
|
26
|
-
export type ToolDefinition
|
17
|
+
export type ToolDefinition = {
|
27
18
|
name: string;
|
28
19
|
description: string;
|
29
|
-
inputSchema: ToolInputSchema
|
20
|
+
inputSchema: ToolInputSchema;
|
30
21
|
};
|
31
22
|
export type ConversationTurnEvent = {
|
32
23
|
conversationId: string;
|
33
24
|
currentMessageId: string;
|
34
|
-
streamResponse?: boolean;
|
35
25
|
responseMutation: {
|
36
26
|
name: string;
|
37
27
|
inputTypeName: string;
|
@@ -49,7 +39,9 @@ export type ConversationTurnEvent = {
|
|
49
39
|
};
|
50
40
|
};
|
51
41
|
request: {
|
52
|
-
headers:
|
42
|
+
headers: {
|
43
|
+
authorization: string;
|
44
|
+
};
|
53
45
|
};
|
54
46
|
/**
|
55
47
|
* @deprecated This field is going to be removed in upcoming releases.
|
@@ -73,21 +65,7 @@ export type ConversationTurnEvent = {
|
|
73
65
|
clientTools?: Array<ToolDefinition>;
|
74
66
|
};
|
75
67
|
};
|
76
|
-
export type ExecutableTool
|
77
|
-
execute: (input:
|
68
|
+
export type ExecutableTool = ToolDefinition & {
|
69
|
+
execute: (input: ToolExecutionInput | undefined) => Promise<ToolResultContentBlock>;
|
78
70
|
};
|
79
|
-
export type StreamingResponseChunk = {
|
80
|
-
conversationId: string;
|
81
|
-
associatedUserMessageId: string;
|
82
|
-
contentBlockIndex: number;
|
83
|
-
} & ({
|
84
|
-
contentBlockText: string;
|
85
|
-
contentBlockDeltaIndex: number;
|
86
|
-
} | {
|
87
|
-
contentBlockDoneAtIndex: number;
|
88
|
-
} | {
|
89
|
-
contentBlockToolUse: string;
|
90
|
-
} | {
|
91
|
-
stopReason: string;
|
92
|
-
});
|
93
71
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29udmVyc2F0aW9uL3J1bnRpbWUvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIGJlZHJvY2sgZnJvbSAnQGF3cy1zZGsvY2xpZW50LWJlZHJvY2stcnVudGltZSc7XG5pbXBvcnQgKiBhcyBzbWl0aHkgZnJvbSAnQHNtaXRoeS90eXBlcyc7XG5cbi8qXG4gIE5vdGljZTogVGhpcyBmaWxlIGNvbnRhaW5zIHR5cGVzIHRoYXQgYXJlIGV4cG9zZWQ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iAgbWVzc2FnZUhpc3RvcnlRdWVyeToge1xuICAgIGdldFF1ZXJ5TmFtZTogc3RyaW5nO1xuICAgIGdldFF1ZXJ5SW5wdXRUeXBlTmFtZTogc3RyaW5nO1xuICAgIGxpc3RRdWVyeU5hbWU6IHN0cmluZztcbiAgICBsaXN0UXVlcnlJbnB1dFR5cGVOYW1lOiBzdHJpbmc7XG4gICAgbGlzdFF1ZXJ5TGltaXQ/OiBudW1iZXI7XG4gIH07XG4gIHRvb2xzQ29uZmlndXJhdGlvbj86IHtcbiAgICBkYXRhVG9vbHM/OiBBcnJheTxcbiAgICAgIFRvb2xEZWZpbml0aW9uICYge1xuICAgICAgICBncmFwaHFsUmVxdWVzdElucHV0RGVzY3JpcHRvcjoge1xuICAgICAgICAgIHF1ZXJ5TmFtZTogc3RyaW5nO1xuICAgICAgICAgIHNlbGVjdGlvblNldDogc3RyaW5nO1xuICAgICAgICAgIHByb3BlcnR5VHlwZXM6IFJlY29yZDxzdHJpbmcsIHN0cmluZz47XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgPjtcbiAgICBjbGllbnRUb29scz86IEFycmF5PFRvb2xEZWZpbml0aW9uPjtcbiAgfTtcbn07XG5cbmV4cG9ydCB0eXBlIEV4ZWN1dGFibGVUb29sID0gVG9vbERlZmluaXRpb24gJiB7XG4gIGV4ZWN1dGU6IChcbiAgICBpbnB1dDogVG9vbEV4ZWN1dGlvbklucHV0IHwgdW5kZWZpbmVkXG4gICkgPT4gUHJvbWlzZTxUb29sUmVzdWx0Q29udGVudEJsb2NrPjtcbn07XG4iXX0=
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/ai-constructs",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.2.0",
|
4
4
|
"type": "commonjs",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -26,16 +26,9 @@
|
|
26
26
|
},
|
27
27
|
"license": "Apache-2.0",
|
28
28
|
"dependencies": {
|
29
|
-
"@aws-amplify/backend-output-schemas": "^1.3.0",
|
30
|
-
"@aws-amplify/platform-core": "^1.1.0",
|
31
29
|
"@aws-amplify/plugin-types": "^1.0.1",
|
32
30
|
"@aws-sdk/client-bedrock-runtime": "^3.622.0",
|
33
|
-
"@smithy/types": "^3.3.0"
|
34
|
-
"json-schema-to-ts": "^3.1.1"
|
35
|
-
},
|
36
|
-
"devDependencies": {
|
37
|
-
"@aws-amplify/backend-output-storage": "^1.1.2",
|
38
|
-
"typescript": "^5.0.0"
|
31
|
+
"@smithy/types": "^3.3.0"
|
39
32
|
},
|
40
33
|
"peerDependencies": {
|
41
34
|
"aws-cdk-lib": "^2.152.0",
|
@@ -3,6 +3,10 @@
|
|
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
|
+
## [4.1.4](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-auth-transformer@4.1.3...@aws-amplify/graphql-auth-transformer@4.1.4) (2024-10-17)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @aws-amplify/graphql-auth-transformer
|
9
|
+
|
6
10
|
## [4.1.3](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-auth-transformer@4.1.2...@aws-amplify/graphql-auth-transformer@4.1.3) (2024-10-10)
|
7
11
|
|
8
12
|
### Bug Fixes
|
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2017 - 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|