@aws-amplify/data-schema 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/SchemaProcessor.js +18 -3
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/cjs/ai/ModelType.js +3 -0
- package/dist/cjs/ai/ModelType.js.map +1 -1
- package/dist/esm/SchemaProcessor.mjs +18 -3
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/esm/ai/ModelType.d.ts +3 -0
- package/dist/esm/ai/ModelType.mjs +3 -0
- package/dist/esm/ai/ModelType.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/src/SchemaProcessor.ts +18 -3
- package/src/ai/ModelType.ts +3 -0
package/dist/cjs/ai/ModelType.js
CHANGED
|
@@ -16,6 +16,9 @@ const supportedModelsLookup = {
|
|
|
16
16
|
'Claude 3.5 Haiku': 'anthropic.claude-3-5-haiku-20241022-v1:0',
|
|
17
17
|
'Claude 3.5 Sonnet': 'anthropic.claude-3-5-sonnet-20240620-v1:0',
|
|
18
18
|
'Claude 3.5 Sonnet v2': 'anthropic.claude-3-5-sonnet-20241022-v2:0',
|
|
19
|
+
'Claude 3.7 Sonnet': 'anthropic.claude-3-7-sonnet-20250219-v1:0',
|
|
20
|
+
'Claude Opus 4': 'anthropic.claude-opus-4-20250514-v1:0',
|
|
21
|
+
'Claude Sonnet 4': 'anthropic.claude-sonnet-4-20250514-v1:0',
|
|
19
22
|
// Cohere models
|
|
20
23
|
'Cohere Command R': 'cohere.command-r-v1:0',
|
|
21
24
|
'Cohere Command R+': 'cohere.command-r-plus-v1:0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelType.js","sources":["../../../src/ai/ModelType.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.model = model;\nconst supportedModelsLookup = {\n // Amazon Nova models\n 'Amazon Nova Pro': 'amazon.nova-pro-v1:0',\n 'Amazon Nova Lite': 'amazon.nova-lite-v1:0',\n 'Amazon Nova Micro': 'amazon.nova-micro-v1:0',\n // Anthropic models\n 'Claude 3 Haiku': 'anthropic.claude-3-haiku-20240307-v1:0',\n 'Claude 3 Opus': 'anthropic.claude-3-opus-20240229-v1:0',\n 'Claude 3 Sonnet': 'anthropic.claude-3-sonnet-20240229-v1:0',\n 'Claude 3.5 Haiku': 'anthropic.claude-3-5-haiku-20241022-v1:0',\n 'Claude 3.5 Sonnet': 'anthropic.claude-3-5-sonnet-20240620-v1:0',\n 'Claude 3.5 Sonnet v2': 'anthropic.claude-3-5-sonnet-20241022-v2:0',\n // Cohere models\n 'Cohere Command R': 'cohere.command-r-v1:0',\n 'Cohere Command R+': 'cohere.command-r-plus-v1:0',\n // Meta models\n 'Llama 3.1 8B Instruct': 'meta.llama3-1-8b-instruct-v1:0',\n 'Llama 3.1 70B Instruct': 'meta.llama3-1-70b-instruct-v1:0',\n 'Llama 3.1 405B Instruct': 'meta.llama3-1-405b-instruct-v1:0',\n // Mistral AI models\n 'Mistral Large': 'mistral.mistral-large-2402-v1:0',\n 'Mistral Large 2': 'mistral.mistral-large-2407-v1:0',\n 'Mistral Small': 'mistral.mistral-small-2402-v1:0',\n};\n/**\n * Bedrock models currently supporting Converse API and Tool use\n * @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features}\n */\nfunction model(modelName) {\n return {\n resourcePath: supportedModelsLookup[modelName],\n };\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,KAAK,GAAG,KAAK;AACrB,MAAM,qBAAqB,GAAG;AAC9B;AACA,IAAI,iBAAiB,EAAE,sBAAsB;AAC7C,IAAI,kBAAkB,EAAE,uBAAuB;AAC/C,IAAI,mBAAmB,EAAE,wBAAwB;AACjD;AACA,IAAI,gBAAgB,EAAE,wCAAwC;AAC9D,IAAI,eAAe,EAAE,uCAAuC;AAC5D,IAAI,iBAAiB,EAAE,yCAAyC;AAChE,IAAI,kBAAkB,EAAE,0CAA0C;AAClE,IAAI,mBAAmB,EAAE,2CAA2C;AACpE,IAAI,sBAAsB,EAAE,2CAA2C;AACvE;AACA,IAAI,kBAAkB,EAAE,uBAAuB;AAC/C,IAAI,mBAAmB,EAAE,4BAA4B;AACrD;AACA,IAAI,uBAAuB,EAAE,gCAAgC;AAC7D,IAAI,wBAAwB,EAAE,iCAAiC;AAC/D,IAAI,yBAAyB,EAAE,kCAAkC;AACjE;AACA,IAAI,eAAe,EAAE,iCAAiC;AACtD,IAAI,iBAAiB,EAAE,iCAAiC;AACxD,IAAI,eAAe,EAAE,iCAAiC;AACtD,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,SAAS,EAAE;AAC1B,IAAI,OAAO;AACX,QAAQ,YAAY,EAAE,qBAAqB,CAAC,SAAS,CAAC;AACtD,KAAK;AACL;;"}
|
|
1
|
+
{"version":3,"file":"ModelType.js","sources":["../../../src/ai/ModelType.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.model = model;\nconst supportedModelsLookup = {\n // Amazon Nova models\n 'Amazon Nova Pro': 'amazon.nova-pro-v1:0',\n 'Amazon Nova Lite': 'amazon.nova-lite-v1:0',\n 'Amazon Nova Micro': 'amazon.nova-micro-v1:0',\n // Anthropic models\n 'Claude 3 Haiku': 'anthropic.claude-3-haiku-20240307-v1:0',\n 'Claude 3 Opus': 'anthropic.claude-3-opus-20240229-v1:0',\n 'Claude 3 Sonnet': 'anthropic.claude-3-sonnet-20240229-v1:0',\n 'Claude 3.5 Haiku': 'anthropic.claude-3-5-haiku-20241022-v1:0',\n 'Claude 3.5 Sonnet': 'anthropic.claude-3-5-sonnet-20240620-v1:0',\n 'Claude 3.5 Sonnet v2': 'anthropic.claude-3-5-sonnet-20241022-v2:0',\n 'Claude 3.7 Sonnet': 'anthropic.claude-3-7-sonnet-20250219-v1:0',\n 'Claude Opus 4': 'anthropic.claude-opus-4-20250514-v1:0',\n 'Claude Sonnet 4': 'anthropic.claude-sonnet-4-20250514-v1:0',\n // Cohere models\n 'Cohere Command R': 'cohere.command-r-v1:0',\n 'Cohere Command R+': 'cohere.command-r-plus-v1:0',\n // Meta models\n 'Llama 3.1 8B Instruct': 'meta.llama3-1-8b-instruct-v1:0',\n 'Llama 3.1 70B Instruct': 'meta.llama3-1-70b-instruct-v1:0',\n 'Llama 3.1 405B Instruct': 'meta.llama3-1-405b-instruct-v1:0',\n // Mistral AI models\n 'Mistral Large': 'mistral.mistral-large-2402-v1:0',\n 'Mistral Large 2': 'mistral.mistral-large-2407-v1:0',\n 'Mistral Small': 'mistral.mistral-small-2402-v1:0',\n};\n/**\n * Bedrock models currently supporting Converse API and Tool use\n * @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features}\n */\nfunction model(modelName) {\n return {\n resourcePath: supportedModelsLookup[modelName],\n };\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,KAAK,GAAG,KAAK;AACrB,MAAM,qBAAqB,GAAG;AAC9B;AACA,IAAI,iBAAiB,EAAE,sBAAsB;AAC7C,IAAI,kBAAkB,EAAE,uBAAuB;AAC/C,IAAI,mBAAmB,EAAE,wBAAwB;AACjD;AACA,IAAI,gBAAgB,EAAE,wCAAwC;AAC9D,IAAI,eAAe,EAAE,uCAAuC;AAC5D,IAAI,iBAAiB,EAAE,yCAAyC;AAChE,IAAI,kBAAkB,EAAE,0CAA0C;AAClE,IAAI,mBAAmB,EAAE,2CAA2C;AACpE,IAAI,sBAAsB,EAAE,2CAA2C;AACvE,IAAI,mBAAmB,EAAE,2CAA2C;AACpE,IAAI,eAAe,EAAE,uCAAuC;AAC5D,IAAI,iBAAiB,EAAE,yCAAyC;AAChE;AACA,IAAI,kBAAkB,EAAE,uBAAuB;AAC/C,IAAI,mBAAmB,EAAE,4BAA4B;AACrD;AACA,IAAI,uBAAuB,EAAE,gCAAgC;AAC7D,IAAI,wBAAwB,EAAE,iCAAiC;AAC/D,IAAI,yBAAyB,EAAE,kCAAkC;AACjE;AACA,IAAI,eAAe,EAAE,iCAAiC;AACtD,IAAI,iBAAiB,EAAE,iCAAiC;AACxD,IAAI,eAAe,EAAE,iCAAiC;AACtD,CAAC;AACD;AACA;AACA;AACA;AACA,SAAS,KAAK,CAAC,SAAS,EAAE;AAC1B,IAAI,OAAO;AACX,QAAQ,YAAY,EAAE,qBAAqB,CAAC,SAAS,CAAC;AACtD,KAAK;AACL;;"}
|
|
@@ -902,7 +902,13 @@ function generateInputTypes(operationName, args, getRefType) {
|
|
|
902
902
|
if (refType.type === 'CustomType') {
|
|
903
903
|
const nestedInputTypeName = `${fieldDef.data.link}Input`;
|
|
904
904
|
processedFields[fieldName] = {
|
|
905
|
-
data: {
|
|
905
|
+
data: {
|
|
906
|
+
type: 'ref',
|
|
907
|
+
link: nestedInputTypeName,
|
|
908
|
+
array: fieldDef.data.array,
|
|
909
|
+
arrayRequired: fieldDef.data.arrayRequired,
|
|
910
|
+
valueRequired: fieldDef.data.valueRequired
|
|
911
|
+
},
|
|
906
912
|
};
|
|
907
913
|
// Process the nested type if it hasn't been processed and isn't a circular reference
|
|
908
914
|
if (!parentChain.includes(nestedInputTypeName) &&
|
|
@@ -917,7 +923,13 @@ function generateInputTypes(operationName, args, getRefType) {
|
|
|
917
923
|
}
|
|
918
924
|
else if (refType.type === 'Enum') {
|
|
919
925
|
processedFields[fieldName] = {
|
|
920
|
-
data: {
|
|
926
|
+
data: {
|
|
927
|
+
type: 'ref',
|
|
928
|
+
link: fieldDef.data.link,
|
|
929
|
+
array: fieldDef.data.array,
|
|
930
|
+
arrayRequired: fieldDef.data.arrayRequired,
|
|
931
|
+
valueRequired: fieldDef.data.valueRequired
|
|
932
|
+
},
|
|
921
933
|
};
|
|
922
934
|
}
|
|
923
935
|
else {
|
|
@@ -929,7 +941,10 @@ function generateInputTypes(operationName, args, getRefType) {
|
|
|
929
941
|
// Handle inline custom types
|
|
930
942
|
const nestedInputTypeName = `${capitalize(originalTypeName)}${capitalize(fieldName)}Input`;
|
|
931
943
|
processedFields[fieldName] = {
|
|
932
|
-
data: {
|
|
944
|
+
data: {
|
|
945
|
+
type: 'ref',
|
|
946
|
+
link: nestedInputTypeName
|
|
947
|
+
},
|
|
933
948
|
};
|
|
934
949
|
if (!processedTypes.has(nestedInputTypeName)) {
|
|
935
950
|
processedTypes.add(nestedInputTypeName);
|