@aws-amplify/graphql-api-construct 1.17.1 → 1.17.2-ai-next.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +38 -38
- package/CHANGELOG.md +10 -0
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +3 -2
- 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/runtime/bedrock_converse_adapter.d.ts +2 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +13 -14
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.js +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +3 -1
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +19 -5
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/event_tools_provider.js +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.d.ts +3 -2
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.js +3 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.d.ts +6 -3
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js +6 -5
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/user_agent_provider.d.ts +16 -0
- package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/user_agent_provider.js +48 -0
- package/node_modules/@aws-amplify/ai-constructs/package.json +2 -2
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +10 -10
- package/node_modules/@aws-amplify/graphql-conversation-transformer/API.md +3 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +21 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts +17 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.js +5 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/conversation-directive-configuration.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js +8 -8
- 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 +2 -1
- 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 +2 -2
- 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/tools/process-tools.d.ts +3 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js +23 -5
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts +1 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js +23 -4
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-field-handler.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts +3 -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 +3 -1
- 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 -9
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +6 -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 +38 -3
- package/node_modules/@aws-amplify/graphql-directives/lib/directives/conversation.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-directives/package.json +1 -1
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -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 +8 -8
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -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 +4 -4
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +4 -4
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +6 -6
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +4 -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 +5 -5
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +5 -5
- package/node_modules/@aws-amplify/graphql-transformer/API.md +3 -0
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +10 -0
- package/node_modules/@aws-amplify/graphql-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +2 -0
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +20 -18
- package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +10 -2
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +2 -2
- package/node_modules/@aws-amplify/platform-core/lib/errors/amplify_error.d.ts +11 -0
- package/node_modules/@aws-amplify/platform-core/lib/errors/amplify_error.js +19 -2
- package/node_modules/@aws-amplify/platform-core/package.json +1 -1
- package/package.json +20 -20
- package/src/amplify-graphql-api.ts +2 -0
@@ -7,7 +7,7 @@ const conversation_field_handler_1 = require("./transformer-steps/conversation-f
|
|
7
7
|
const conversation_prepare_handler_1 = require("./transformer-steps/conversation-prepare-handler");
|
8
8
|
const conversation_resolver_generator_1 = require("./transformer-steps/conversation-resolver-generator");
|
9
9
|
class ConversationTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
10
|
-
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider, functionNameMap) {
|
10
|
+
constructor(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider, outputStorageStrategy, functionNameMap) {
|
11
11
|
super('amplify-conversation-transformer', graphql_directives_1.ConversationDirective.definition);
|
12
12
|
this.directives = [];
|
13
13
|
this.field = (parent, definition, directive, context) => {
|
@@ -22,7 +22,7 @@ class ConversationTransformer extends graphql_transformer_core_1.TransformerPlug
|
|
22
22
|
};
|
23
23
|
this.fieldHandler = new conversation_field_handler_1.ConversationFieldHandler();
|
24
24
|
this.prepareHandler = new conversation_prepare_handler_1.ConversationPrepareHandler(modelTransformer, hasManyTransformer, belongsToTransformer, authProvider);
|
25
|
-
this.resolverGenerator = new conversation_resolver_generator_1.ConversationResolverGenerator(functionNameMap);
|
25
|
+
this.resolverGenerator = new conversation_resolver_generator_1.ConversationResolverGenerator(functionNameMap, outputStorageStrategy);
|
26
26
|
}
|
27
27
|
}
|
28
28
|
exports.ConversationTransformer = ConversationTransformer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grapqhl-conversation-transformer.js","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAGxE,
|
1
|
+
{"version":3,"file":"grapqhl-conversation-transformer.js","sourceRoot":"","sources":["../src/grapqhl-conversation-transformer.ts"],"names":[],"m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ools.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { JSONSchema } from '@aws-amplify/graphql-transformer-core';
|
2
2
|
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
3
|
-
import { ToolDefinition } from '../conversation-directive-configuration';
|
3
|
+
import { CustomQueryTool, ModelOperationTool, ToolDefinition } from '../conversation-directive-configuration';
|
4
4
|
export type Tool = {
|
5
5
|
name: string;
|
6
6
|
description: string;
|
@@ -9,6 +9,8 @@ export type Tool = {
|
|
9
9
|
};
|
10
10
|
graphqlRequestInputDescriptor?: GraphQLRequestInputDescriptor;
|
11
11
|
};
|
12
|
+
export declare const isModelOperationToolPredicate: (tool: ToolDefinition) => tool is ModelOperationTool;
|
13
|
+
export declare const isCustomQueryToolPredicate: (tool: ToolDefinition) => tool is CustomQueryTool;
|
12
14
|
type GraphQLRequestInputDescriptor = {
|
13
15
|
selectionSet: string;
|
14
16
|
propertyTypes: Record<string, string>;
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process-tools.d.ts","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"process-tools.d.ts","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAWzF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9G,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;IACF,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,6BAA6B,SAAU,cAAc,+BACiC,CAAC;AAEpG,eAAO,MAAM,0BAA0B,SAAU,cAAc,4BACoC,CAAC;AAEpG,KAAK,6BAA6B,GAAG;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAUF,eAAO,MAAM,YAAY,oBAAqB,cAAc,EAAE,OAAO,0BAA0B,KAAG,IAAI,EAAE,GAAG,SA0B1G,CAAC"}
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.processTools = void 0;
|
3
|
+
exports.processTools = exports.isCustomQueryToolPredicate = exports.isModelOperationToolPredicate = void 0;
|
4
4
|
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
5
5
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
6
6
|
const graphql_json_schema_type_1 = require("./graphql-json-schema-type");
|
7
|
+
const isModelOperationToolPredicate = (tool) => tool.modelName !== undefined && tool.modelOperation !== undefined && tool.queryName === undefined;
|
8
|
+
exports.isModelOperationToolPredicate = isModelOperationToolPredicate;
|
9
|
+
const isCustomQueryToolPredicate = (tool) => tool.queryName !== undefined && tool.modelName === undefined && tool.modelOperation === undefined;
|
10
|
+
exports.isCustomQueryToolPredicate = isCustomQueryToolPredicate;
|
7
11
|
const processTools = (toolDefinitions, ctx) => {
|
8
12
|
if (!toolDefinitions || toolDefinitions.length === 0) {
|
9
13
|
return undefined;
|
@@ -15,11 +19,12 @@ const processTools = (toolDefinitions, ctx) => {
|
|
15
19
|
const tools = toolDefinitions.map((toolDefinition) => {
|
16
20
|
var _a;
|
17
21
|
const { name: toolName, description } = toolDefinition;
|
18
|
-
const
|
22
|
+
const queryName = (0, exports.isModelOperationToolPredicate)(toolDefinition) ? modelListQueryName(toolDefinition, ctx) : toolDefinition.queryName;
|
23
|
+
const queryField = (_a = queryType.fields) === null || _a === void 0 ? void 0 : _a.find((field) => field.name.value === queryName);
|
19
24
|
if (!queryField) {
|
20
25
|
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool "${toolName}" defined in @conversation directive has no matching Query field definition`);
|
21
26
|
}
|
22
|
-
return createTool(toolName, description, queryField, ctx);
|
27
|
+
return createTool({ toolName, description, queryField, ctx });
|
23
28
|
});
|
24
29
|
return tools;
|
25
30
|
};
|
@@ -57,7 +62,8 @@ const getObjectTypeFromName = (name, ctx) => {
|
|
57
62
|
}
|
58
63
|
return node;
|
59
64
|
};
|
60
|
-
const createTool = (
|
65
|
+
const createTool = (input) => {
|
66
|
+
const { toolName, description, queryField, ctx } = input;
|
61
67
|
const { type: returnType, arguments: fieldArguments } = queryField;
|
62
68
|
const { properties, required } = generateToolProperties(fieldArguments, ctx, toolName, returnType);
|
63
69
|
const selectionSet = generateSelectionSet(returnType, ctx).trim();
|
@@ -65,7 +71,7 @@ const createTool = (toolName, description, queryField, ctx) => {
|
|
65
71
|
const graphqlRequestInputDescriptor = {
|
66
72
|
selectionSet,
|
67
73
|
propertyTypes,
|
68
|
-
queryName:
|
74
|
+
queryName: queryField.name.value,
|
69
75
|
};
|
70
76
|
return {
|
71
77
|
name: toolName,
|
@@ -113,4 +119,16 @@ const generatePropertyTypes = (fieldArguments, toolName, returnType) => {
|
|
113
119
|
const isModelListOperation = (toolName, responseType) => {
|
114
120
|
return (0, graphql_transformer_common_1.getBaseType)(responseType).startsWith('Model') && toolName.startsWith('list');
|
115
121
|
};
|
122
|
+
const modelListQueryName = (modelTool, ctx) => {
|
123
|
+
var _a, _b, _c;
|
124
|
+
const { modelName } = modelTool;
|
125
|
+
const model = getObjectTypeFromName(modelName, ctx);
|
126
|
+
const modelDirective = (_a = model.directives) === null || _a === void 0 ? void 0 : _a.find((directive) => directive.name.value === 'model');
|
127
|
+
const queriesArgument = (_b = modelDirective === null || modelDirective === void 0 ? void 0 : modelDirective.arguments) === null || _b === void 0 ? void 0 : _b.find((arg) => arg.name.value === 'queries');
|
128
|
+
const queriesValue = queriesArgument === null || queriesArgument === void 0 ? void 0 : queriesArgument.value;
|
129
|
+
const listField = (_c = queriesValue === null || queriesValue === void 0 ? void 0 : queriesValue.fields) === null || _c === void 0 ? void 0 : _c.find((field) => field.name.value === 'list');
|
130
|
+
const listValue = listField === null || listField === void 0 ? void 0 : listField.value;
|
131
|
+
const listQueryArgument = listValue === null || listValue === void 0 ? void 0 : listValue.value;
|
132
|
+
return listQueryArgument !== null && listQueryArgument !== void 0 ? listQueryArgument : (0, graphql_transformer_core_1.getFieldNameFor)('list', modelName);
|
133
|
+
};
|
116
134
|
//# sourceMappingURL=process-tools.js.map
|
package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/tools/process-tools.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process-tools.js","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"process-tools.js","sourceRoot":"","sources":["../../src/tools/process-tools.ts"],"names":[],"mappings":";;;AAAA,oFAA2G;AAU3G,2EAA2F;AAG3F,yEAA4E;AAWrE,MAAM,6BAA6B,GAAG,CAAC,IAAoB,EAA8B,EAAE,CAChG,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC;AADvF,QAAA,6BAA6B,iCAC0D;AAE7F,MAAM,0BAA0B,GAAG,CAAC,IAAoB,EAA2B,EAAE,CAC1F,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC;AADvF,QAAA,0BAA0B,8BAC6D;AAgB7F,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AE3C,OAAO,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,IAAA,0CAAe,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACjE,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EACL,aAAa,EACb,mBAAmB,EAEnB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;
|
1
|
+
{"version":3,"file":"conversation-field-handler.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AACxG,OAAO,EACL,aAAa,EACb,mBAAmB,EAEnB,2BAA2B,EAC3B,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AA0B7F,qBAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAAG,2BAA2B,EAC9D,UAAU,EAAE,mBAAmB,EAC/B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,yCAAyC,GACjD,kCAAkC;IA0BrC,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,uBAAuB;IAiC/B,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,uBAAuB;CAqBhC"}
|
@@ -29,6 +29,7 @@ const semver = __importStar(require("semver"));
|
|
29
29
|
const conversation_model_1 = require("../graphql-types/conversation-model");
|
30
30
|
const message_model_1 = require("../graphql-types/message-model");
|
31
31
|
const name_values_1 = require("../graphql-types/name-values");
|
32
|
+
const process_tools_1 = require("../tools/process-tools");
|
32
33
|
class ConversationFieldHandler {
|
33
34
|
getDirectiveConfig(parent, definition, directive, context) {
|
34
35
|
if (parent.name.value !== 'Mutation') {
|
@@ -55,8 +56,8 @@ class ConversationFieldHandler {
|
|
55
56
|
return config;
|
56
57
|
}
|
57
58
|
createModels(config, definition) {
|
58
|
-
if (definition.type.kind !== 'NamedType' || definition.type.name.value !== '
|
59
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be
|
59
|
+
if (definition.type.kind !== 'NamedType' || definition.type.name.value !== 'AmplifyAIConversationMessage') {
|
60
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be AmplifyAIConversationMessage');
|
60
61
|
}
|
61
62
|
const conversationMessageTypeName = (0, name_values_1.getConversationMessageTypeName)(config);
|
62
63
|
const conversationTypeName = (0, name_values_1.getConversationTypeName)(config);
|
@@ -87,6 +88,24 @@ class ConversationFieldHandler {
|
|
87
88
|
this.validateReturnType(config);
|
88
89
|
this.validateInferenceConfig(config);
|
89
90
|
this.validateHandler(config);
|
91
|
+
this.validateToolDefinitions(config);
|
92
|
+
}
|
93
|
+
validateToolDefinitions(config) {
|
94
|
+
const { tools } = config;
|
95
|
+
if (!tools)
|
96
|
+
return;
|
97
|
+
const isValidToolName = (name) => /^[a-zA-Z][a-zA-Z0-9_]*$/.test(name) && name.length >= 1 && name.length <= 64;
|
98
|
+
for (const tool of tools) {
|
99
|
+
if (!isValidToolName(tool.name)) {
|
100
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool name must be between 1 and 64 characters, start with a letter, and contain only letters, numbers, and underscores. Found: ${tool.name}`);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
const invalidToolNames = tools
|
104
|
+
.filter((tool) => !(0, process_tools_1.isModelOperationToolPredicate)(tool) && !(0, process_tools_1.isCustomQueryToolPredicate)(tool))
|
105
|
+
.map((tool) => tool.name);
|
106
|
+
if (invalidToolNames.length > 0) {
|
107
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`Tool definitions must contain a modelName and modelOperation, or queryName. Invalid tools: ${invalidToolNames.join(', ')}`);
|
108
|
+
}
|
90
109
|
}
|
91
110
|
validateHandler(config) {
|
92
111
|
if (config.handler && config.functionName) {
|
@@ -101,8 +120,8 @@ class ConversationFieldHandler {
|
|
101
120
|
}
|
102
121
|
validateReturnType(config) {
|
103
122
|
const { field } = config;
|
104
|
-
if (field.type.kind !== 'NamedType' || field.type.name.value !== '
|
105
|
-
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be
|
123
|
+
if (field.type.kind !== 'NamedType' || field.type.name.value !== 'AmplifyAIConversationMessage') {
|
124
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError('@conversation return type must be AmplifyAIConversationMessage');
|
106
125
|
}
|
107
126
|
}
|
108
127
|
validateInferenceConfig(config) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2H;AAS3H,+CAAiC;AAEjC,4EAAiG;AACjG,kEAQwC;AACxC,8DAOsC;
|
1
|
+
{"version":3,"file":"conversation-field-handler.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-field-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2H;AAS3H,+CAAiC;AAEjC,4EAAiG;AACjG,kEAQwC;AACxC,8DAOsC;AACtC,0DAAmG;AAOnG,MAAa,wBAAwB;IAWnC,kBAAkB,CAChB,MAA8D,EAC9D,UAA+B,EAC/B,SAAwB,EACxB,OAAkD;QAElD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;YACpC,MAAM,IAAI,gDAAqB,CAA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1,9 +1,11 @@
|
|
1
1
|
import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
2
|
+
import { BackendOutputEntry, BackendOutputStorageStrategy } from '@aws-amplify/plugin-types';
|
2
3
|
import * as cdk from 'aws-cdk-lib';
|
3
4
|
import { ConversationDirectiveConfiguration } from '../conversation-directive-configuration';
|
4
5
|
export declare class ConversationResolverGenerator {
|
5
6
|
private readonly functionNameMap?;
|
6
|
-
|
7
|
+
private readonly outputStorageStrategy?;
|
8
|
+
constructor(functionNameMap?: Record<string, cdk.aws_lambda.IFunction> | undefined, outputStorageStrategy?: BackendOutputStorageStrategy<BackendOutputEntry<Record<string, string>>> | undefined);
|
7
9
|
generateResolvers(directives: ConversationDirectiveConfiguration[], ctx: TransformerContextProvider): void;
|
8
10
|
private generateDataSources;
|
9
11
|
private generateResolversForDirective;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC7G,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAInC,OAAO,EAAE,kCAAkC,EAAoC,MAAM,yCAAyC,CAAC;AAoB/H,qBAAa,6BAA6B;
|
1
|
+
{"version":3,"file":"conversation-resolver-generator.d.ts","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAInC,OAAO,EAAE,kCAAkC,EAAoC,MAAM,yCAAyC,CAAC;AAoB/H,qBAAa,6BAA6B;IAEtC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC;gBADtB,eAAe,CAAC,sDAA2B,EAC3C,qBAAqB,CAAC,sFAAkD;IAS3F,iBAAiB,CAAC,UAAU,EAAE,kCAAkC,EAAE,EAAE,GAAG,EAAE,0BAA0B,GAAG,IAAI;IA6B1G,OAAO,CAAC,mBAAmB;IAmC3B,OAAO,CAAC,6BAA6B;IAqCrC,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,+BAA+B;IAmBvC,OAAO,CAAC,+BAA+B;IAgCvC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,8BAA8B;IAYtC,OAAO,CAAC,sCAAsC;IAa9C,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,2BAA2B;IAoCnC,OAAO,CAAC,uBAAuB;CAgChC"}
|
@@ -37,8 +37,9 @@ const name_values_1 = require("../graphql-types/name-values");
|
|
37
37
|
const resolvers_1 = require("../resolvers");
|
38
38
|
const process_tools_1 = require("../tools/process-tools");
|
39
39
|
class ConversationResolverGenerator {
|
40
|
-
constructor(functionNameMap) {
|
40
|
+
constructor(functionNameMap, outputStorageStrategy) {
|
41
41
|
this.functionNameMap = functionNameMap;
|
42
|
+
this.outputStorageStrategy = outputStorageStrategy;
|
42
43
|
}
|
43
44
|
generateResolvers(directives, ctx) {
|
44
45
|
for (const directive of directives) {
|
@@ -107,6 +108,7 @@ class ConversationResolverGenerator {
|
|
107
108
|
modelId,
|
108
109
|
},
|
109
110
|
],
|
111
|
+
outputStorageStrategy: this.outputStorageStrategy,
|
110
112
|
});
|
111
113
|
const functionDataSourceId = graphql_transformer_common_1.FunctionResourceIDs.FunctionDataSourceID(`${capitalizedFieldName}DefaultConversationHandler`);
|
112
114
|
const referencedFunction = defaultConversationHandler.resources.lambda;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation-resolver-generator.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA0D;AAC1D,sFAAiF;AACjF,oFAAyH;
|
1
|
+
{"version":3,"file":"conversation-resolver-generator.js","sourceRoot":"","sources":["../../src/transformer-steps/conversation-resolver-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA0D;AAC1D,sFAAiF;AACjF,oFAAyH;AAGzH,iDAAmC;AAEnC,2EAAoF;AACpF,0DAAkC;AAElC,8DAMsC;AACtC,4CAUsB;AACtB,0DAAsD;AACtD,MAAa,6BAA6B;IACxC,YACmB,eAA2C,EAC3C,qBAAwE;QADxE,oBAAe,GAAf,eAAe,CAA4B;QAC3C,0BAAqB,GAArB,qBAAqB,CAAmD;IACxF,CAAC;IAQJ,iBAAiB,CAAC,UAAgD,EAAE,GAA+B;QACjG,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAIlC,SAAS,CAAC,QAAQ,GAAG,IAAA,4BAAY,EAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAIxD,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAGjE,IAAI,CAAC,2BAA2B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAGjD,IAAI,CAAC,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAG5C,IAAI,CAAC,6BAA6B,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAGnD,IAAI,CAAC,sCAAsC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAI5D,IAAI,CAAC,8BAA8B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;SACrD;IACH,CAAC;IAEO,mBAAmB,CACzB,SAA6C,EAC7C,GAA+B;QAG/B,MAAM,iBAAiB,GAAG,IAAA,kCAAoB,EAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC,WAAW,CA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AiB,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACjF,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,8CAAiB,CAAC,UAAU,CAAC,2BAA2B,CAAC;SACpF,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;QAErF,MAAM,QAAQ,GAAG;YACf,SAAS;YACT,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,UAAU,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE;YACrC,qBAAqB,EAAE,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,8CAAiB,CAAC,UAAU,CAAC,6BAA6B,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;gBAChI,iBAAiB,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,8CAAiB,CAAC,UAAU,CAAC,0BAA0B,CAAC;gBACtF,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,8CAAiB,CAAC,UAAU,CAAC,2BAA2B,CAAC;aACzF,CAAC;SACH,CAAC;QAEF,IAAA,mDAAuB,EAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;CACF;AA9TD,sEA8TC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-conversation-transformer",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.7.0-ai-next.1",
|
4
4
|
"description": "Amplify GraphQL @conversation transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -24,13 +24,14 @@
|
|
24
24
|
"extract-api": "ts-node ../../scripts/extract-api.ts"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@aws-amplify/ai-constructs": "0.8.
|
28
|
-
"@aws-amplify/graphql-directives": "2.
|
29
|
-
"@aws-amplify/graphql-index-transformer": "3.0.
|
30
|
-
"@aws-amplify/graphql-model-transformer": "3.1.0",
|
31
|
-
"@aws-amplify/graphql-relational-transformer": "3.1.0",
|
32
|
-
"@aws-amplify/graphql-transformer-core": "3.3.0",
|
27
|
+
"@aws-amplify/ai-constructs": "^0.8.1",
|
28
|
+
"@aws-amplify/graphql-directives": "2.6.0-ai-next.0",
|
29
|
+
"@aws-amplify/graphql-index-transformer": "3.0.9-ai-next.0",
|
30
|
+
"@aws-amplify/graphql-model-transformer": "3.1.1-ai-next.0",
|
31
|
+
"@aws-amplify/graphql-relational-transformer": "3.1.1-ai-next.0",
|
32
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1-ai-next.0",
|
33
33
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
34
|
+
"@aws-amplify/plugin-types": "^1.0.0",
|
34
35
|
"graphql": "^15.5.0",
|
35
36
|
"graphql-mapping-template": "5.0.1",
|
36
37
|
"graphql-transformer-common": "5.1.1",
|
@@ -38,7 +39,7 @@
|
|
38
39
|
"semver": "^7.6.3"
|
39
40
|
},
|
40
41
|
"devDependencies": {
|
41
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
42
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8-ai-next.0",
|
42
43
|
"esbuild": "^0.24.0"
|
43
44
|
},
|
44
45
|
"peerDependencies": {
|
@@ -80,5 +81,6 @@
|
|
80
81
|
"coveragePathIgnorePatterns": [
|
81
82
|
"/__tests__/"
|
82
83
|
]
|
83
|
-
}
|
84
|
+
},
|
85
|
+
"gitHead": "36882132e2ef7488396485a3b37f1d452bbd15a9"
|
84
86
|
}
|
@@ -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
|
+
## [3.1.4-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-default-value-transformer@3.1.3...@aws-amplify/graphql-default-value-transformer@3.1.4-ai-next.0) (2024-11-12)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @aws-amplify/graphql-default-value-transformer
|
9
|
+
|
6
10
|
## [3.1.3](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-default-value-transformer@3.1.2...@aws-amplify/graphql-default-value-transformer@3.1.3) (2024-11-08)
|
7
11
|
|
8
12
|
**Note:** Version bump only for package @aws-amplify/graphql-default-value-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-default-value-transformer",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.4-ai-next.0",
|
4
4
|
"description": "Amplify GraphQL default value transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -30,8 +30,8 @@
|
|
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-transformer-core": "3.3.0",
|
33
|
+
"@aws-amplify/graphql-directives": "2.6.0-ai-next.0",
|
34
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1-ai-next.0",
|
35
35
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
36
36
|
"graphql": "^15.5.0",
|
37
37
|
"graphql-mapping-template": "5.0.1",
|
@@ -39,8 +39,8 @@
|
|
39
39
|
"libphonenumber-js": "1.9.47"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
|
-
"@aws-amplify/graphql-model-transformer": "3.1.0",
|
43
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
42
|
+
"@aws-amplify/graphql-model-transformer": "3.1.1-ai-next.0",
|
43
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8-ai-next.0"
|
44
44
|
},
|
45
45
|
"jest": {
|
46
46
|
"transform": {
|
@@ -3,6 +3,12 @@
|
|
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
|
+
# [2.6.0-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-directives@2.5.0...@aws-amplify/graphql-directives@2.6.0-ai-next.0) (2024-11-12)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- **conversation:** require auth input for conversation directive ([#3007](https://github.com/aws-amplify/amplify-category-api/issues/3007)) ([39cca3f](https://github.com/aws-amplify/amplify-category-api/commit/39cca3f18d02e9092828901ba799932f6e77f232))
|
11
|
+
|
6
12
|
# [2.5.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-directives@2.4.0...@aws-amplify/graphql-directives@2.5.0) (2024-11-08)
|
7
13
|
|
8
14
|
### Features
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/directives/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/directives/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAmExC,eAAO,MAAM,qBAAqB,EAAE,SAInC,CAAC"}
|
@@ -6,20 +6,55 @@ const definition = `
|
|
6
6
|
directive @${name}(
|
7
7
|
aiModel: String!
|
8
8
|
systemPrompt: String!
|
9
|
+
auth: ConversationAuth!
|
9
10
|
functionName: String
|
10
11
|
handler: ConversationHandlerFunctionConfiguration
|
11
12
|
tools: [ToolMap]
|
12
13
|
inferenceConfiguration: ConversationInferenceConfiguration
|
13
14
|
) on FIELD_DEFINITION
|
14
|
-
|
15
|
+
|
16
|
+
input ConversationAuth {
|
17
|
+
strategy: ConversationAuthStrategy!
|
18
|
+
provider: ConversationAuthProvider!
|
19
|
+
}
|
20
|
+
|
21
|
+
enum ConversationAuthStrategy {
|
22
|
+
owner
|
23
|
+
}
|
24
|
+
|
25
|
+
enum ConversationAuthProvider {
|
26
|
+
userPools
|
27
|
+
}
|
28
|
+
|
15
29
|
input ConversationHandlerFunctionConfiguration {
|
16
30
|
functionName: String!
|
17
31
|
eventVersion: String!
|
18
32
|
}
|
19
33
|
|
34
|
+
# The configuration for a tool.
|
35
|
+
# This is a fake union (GraphQL doesn't support unions in inputs). It is best thought of as:
|
36
|
+
# type ToolMap =
|
37
|
+
# ({ queryName: string; } | { modelName: string; modelOperation: ConversationToolModelOperation; })
|
38
|
+
# & { name: string; description: string; }
|
39
|
+
# The conversation transformer validates the input to ensure it conforms to the expected shape.
|
20
40
|
input ToolMap {
|
21
|
-
name
|
22
|
-
|
41
|
+
# The name of the tool. This is included in the tool definition provided to the AI model.
|
42
|
+
name: String!
|
43
|
+
# The description of the tool. This is included in the tool definition provided to the AI model.
|
44
|
+
description: String!
|
45
|
+
|
46
|
+
# The name of the GraphQL query that is invoked when the tool is used.
|
47
|
+
queryName: String
|
48
|
+
|
49
|
+
# The name of the Amplify model used by the tool.
|
50
|
+
modelName: String
|
51
|
+
# The model generated operation for the provided Amplify model that is invoked when the tool is used.
|
52
|
+
modelOperation: ConversationToolModelOperation
|
53
|
+
}
|
54
|
+
|
55
|
+
# The model generated operation for the provided Amplify model.
|
56
|
+
enum ConversationToolModelOperation {
|
57
|
+
list
|
23
58
|
}
|
24
59
|
|
25
60
|
input ConversationInferenceConfiguration {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/directives/conversation.ts"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,cAAc,CAAC;AAC5B,MAAM,UAAU,GAAiB;eAClB,IAAI
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/directives/conversation.ts"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,cAAc,CAAC;AAC5B,MAAM,UAAU,GAAiB;eAClB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DlB,CAAC;AAEF,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEP,QAAA,qBAAqB,GAAc;IAC9C,IAAI;IACJ,UAAU;IACV,QAAQ;CACT,CAAC"}
|
@@ -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
|
+
## [3.1.6-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-function-transformer@3.1.5...@aws-amplify/graphql-function-transformer@3.1.6-ai-next.0) (2024-11-12)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @aws-amplify/graphql-function-transformer
|
9
|
+
|
6
10
|
## [3.1.5](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-function-transformer@3.1.4...@aws-amplify/graphql-function-transformer@3.1.5) (2024-11-08)
|
7
11
|
|
8
12
|
**Note:** Version bump only for package @aws-amplify/graphql-function-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-function-transformer",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.6-ai-next.0",
|
4
4
|
"description": "Amplify GraphQL @function transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -29,15 +29,15 @@
|
|
29
29
|
"extract-api": "ts-node ../../scripts/extract-api.ts"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@aws-amplify/graphql-directives": "2.
|
33
|
-
"@aws-amplify/graphql-transformer-core": "3.3.0",
|
32
|
+
"@aws-amplify/graphql-directives": "2.6.0-ai-next.0",
|
33
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1-ai-next.0",
|
34
34
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
35
35
|
"graphql": "^15.5.0",
|
36
36
|
"graphql-mapping-template": "5.0.1",
|
37
37
|
"graphql-transformer-common": "5.1.1"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
40
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8-ai-next.0"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
43
|
"aws-cdk-lib": "^2.158.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
|
+
## [0.2.7-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-generation-transformer@0.2.6...@aws-amplify/graphql-generation-transformer@0.2.7-ai-next.0) (2024-11-12)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @aws-amplify/graphql-generation-transformer
|
9
|
+
|
6
10
|
## [0.2.6](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-generation-transformer@0.2.5...@aws-amplify/graphql-generation-transformer@0.2.6) (2024-11-08)
|
7
11
|
|
8
12
|
**Note:** Version bump only for package @aws-amplify/graphql-generation-transformer
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@aws-amplify/graphql-generation-transformer",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.7-ai-next.0",
|
4
4
|
"description": "Amplify GraphQL @generation transformer",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"extract-api": "ts-node ../../scripts/extract-api.ts"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@aws-amplify/graphql-directives": "2.
|
28
|
-
"@aws-amplify/graphql-transformer-core": "3.3.0",
|
27
|
+
"@aws-amplify/graphql-directives": "2.6.0-ai-next.0",
|
28
|
+
"@aws-amplify/graphql-transformer-core": "3.3.1-ai-next.0",
|
29
29
|
"@aws-amplify/graphql-transformer-interfaces": "4.2.0",
|
30
30
|
"graphql": "^15.5.0",
|
31
31
|
"graphql-mapping-template": "5.0.1",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"immer": "^9.0.12"
|
34
34
|
},
|
35
35
|
"devDependencies": {
|
36
|
-
"@aws-amplify/graphql-transformer-test-utils": "1.0.
|
36
|
+
"@aws-amplify/graphql-transformer-test-utils": "1.0.8-ai-next.0"
|
37
37
|
},
|
38
38
|
"peerDependencies": {
|
39
39
|
"aws-cdk-lib": "^2.158.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
|
+
## [3.0.9-ai-next.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-http-transformer@3.0.8...@aws-amplify/graphql-http-transformer@3.0.9-ai-next.0) (2024-11-12)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @aws-amplify/graphql-http-transformer
|
9
|
+
|
6
10
|
## [3.0.8](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-http-transformer@3.0.7...@aws-amplify/graphql-http-transformer@3.0.8) (2024-11-08)
|
7
11
|
|
8
12
|
**Note:** Version bump only for package @aws-amplify/graphql-http-transformer
|