@aws-amplify/data-schema 1.25.3 → 1.25.4
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/CombineSchema.js.map +1 -1
- package/dist/cjs/ModelRelationshipField.js.map +1 -1
- package/dist/cjs/RefType.js.map +1 -1
- package/dist/cjs/ai/ModelType.js +3 -0
- package/dist/cjs/ai/ModelType.js.map +1 -1
- package/dist/cjs/runtime/internals/APIClient.js +0 -5
- package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
- package/dist/cjs/runtime/internals/operations/indexQuery.js +2 -0
- package/dist/cjs/runtime/internals/operations/indexQuery.js.map +1 -1
- package/dist/esm/CombineSchema.d.ts +2 -2
- package/dist/esm/CombineSchema.mjs.map +1 -1
- package/dist/esm/ModelRelationshipField.d.ts +2 -2
- package/dist/esm/ModelRelationshipField.mjs.map +1 -1
- package/dist/esm/RefType.d.ts +2 -2
- package/dist/esm/RefType.mjs.map +1 -1
- package/dist/esm/ai/ModelType.d.ts +2 -0
- package/dist/esm/ai/ModelType.mjs +3 -0
- package/dist/esm/ai/ModelType.mjs.map +1 -1
- package/dist/esm/runtime/internals/APIClient.mjs +0 -5
- package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
- package/dist/esm/runtime/internals/operations/indexQuery.mjs +2 -0
- package/dist/esm/runtime/internals/operations/indexQuery.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/CombineSchema.ts +2 -2
- package/src/ModelRelationshipField.ts +4 -4
- package/src/RefType.ts +2 -2
- package/src/ai/ModelType.ts +3 -0
- package/src/runtime/internals/APIClient.ts +0 -5
- package/src/runtime/internals/operations/indexQuery.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/data-schema",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"types": "./dist/esm/index.d.ts",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
14
|
-
"build": "
|
|
15
|
-
"build:watch": "
|
|
14
|
+
"build": "yarn clean && yarn build:esm-cjs",
|
|
15
|
+
"build:watch": "yarn build:esm-cjs -- --watch",
|
|
16
16
|
"clean": "rimraf dist",
|
|
17
17
|
"docs": "api-extractor run && api-documenter markdown --input-folder temp --output-folder docs",
|
|
18
18
|
"docs:temp": "api-extractor run && api-documenter markdown --input-folder temp --output-folder temp/docs",
|
|
19
|
-
"check:api": "rimraf temp &&
|
|
19
|
+
"check:api": "rimraf temp && yarn docs:temp && tsx ../../scripts/shallow-dir-diff.ts docs temp/docs",
|
|
20
20
|
"lint": "eslint .",
|
|
21
21
|
"test": "jest --coverage"
|
|
22
22
|
},
|
package/src/CombineSchema.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GenericModelSchema } from './ModelSchema';
|
|
2
2
|
import { brand, Brand, IndexLimitUnion } from './util';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const _COMBINED_SCHEMA_LIMIT = 50;
|
|
5
5
|
|
|
6
6
|
export type CombinedSchemaIndexesUnion = IndexLimitUnion<
|
|
7
|
-
typeof
|
|
7
|
+
typeof _COMBINED_SCHEMA_LIMIT
|
|
8
8
|
>[number];
|
|
9
9
|
|
|
10
10
|
const CombinedSchemaBrandName = 'CombinedSchema';
|
|
@@ -7,7 +7,7 @@ import { AllowModifier, Authorization, allow } from './Authorization';
|
|
|
7
7
|
*/
|
|
8
8
|
export const __auth = Symbol('__auth');
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const _brandName = 'modelRelationshipField';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Model relationship types
|
|
@@ -86,7 +86,7 @@ export type ModelRelationshipField<
|
|
|
86
86
|
> = Omit<ModelRelationshipFieldFunctions<T, RM, K>, K> & {
|
|
87
87
|
// This is a lie. This property is never set at runtime. It's just used to smuggle auth types through.
|
|
88
88
|
[__auth]?: Auth;
|
|
89
|
-
} & Brand<typeof
|
|
89
|
+
} & Brand<typeof _brandName>;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Internal representation of Model Field that exposes the `data` property.
|
|
@@ -100,7 +100,7 @@ export type InternalRelationshipField = ModelRelationshipField<
|
|
|
100
100
|
data: ModelRelationshipFieldData;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
const
|
|
103
|
+
const _relationshipModifiers = [
|
|
104
104
|
'required',
|
|
105
105
|
'valueRequired',
|
|
106
106
|
'authorization',
|
|
@@ -108,7 +108,7 @@ const relationshipModifiers = [
|
|
|
108
108
|
|
|
109
109
|
const relationModifierMap: Record<
|
|
110
110
|
`${ModelRelationshipTypes}`,
|
|
111
|
-
(typeof
|
|
111
|
+
(typeof _relationshipModifiers)[number][]
|
|
112
112
|
> = {
|
|
113
113
|
belongsTo: ['authorization'],
|
|
114
114
|
hasMany: ['valueRequired', 'authorization'],
|
package/src/RefType.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Brand } from './util';
|
|
|
3
3
|
import { AllowModifier, Authorization, allow } from './Authorization';
|
|
4
4
|
import { __auth } from './ModelField';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const _brandName = 'ref';
|
|
7
7
|
|
|
8
8
|
type RefTypeData = {
|
|
9
9
|
type: 'ref';
|
|
@@ -72,7 +72,7 @@ export type RefType<
|
|
|
72
72
|
> & {
|
|
73
73
|
// This is a lie. This property is never set at runtime. It's just used to smuggle auth types through.
|
|
74
74
|
[__auth]?: Auth;
|
|
75
|
-
} & Brand<typeof
|
|
75
|
+
} & Brand<typeof _brandName>;
|
|
76
76
|
|
|
77
77
|
function brandedBuilder<T extends RefTypeParamShape>(
|
|
78
78
|
builder: Record<keyof RefType<T> & string, any>,
|
package/src/ai/ModelType.ts
CHANGED
|
@@ -22,6 +22,9 @@ const supportedModelsLookup = {
|
|
|
22
22
|
'Claude Haiku 4.5': 'global.anthropic.claude-haiku-4-5-20251001-v1:0',
|
|
23
23
|
'Claude Sonnet 4.5': 'global.anthropic.claude-sonnet-4-5-20250929-v1:0',
|
|
24
24
|
'Claude Opus 4.5': 'global.anthropic.claude-opus-4-5-20251101-v1:0',
|
|
25
|
+
// Claude 4.6 models (require global inference profiles)
|
|
26
|
+
'Claude Sonnet 4.6': 'global.anthropic.claude-sonnet-4-6',
|
|
27
|
+
'Claude Opus 4.6': 'global.anthropic.claude-opus-4-6-v1',
|
|
25
28
|
// Cohere models
|
|
26
29
|
'Cohere Command R': 'cohere.command-r-v1:0',
|
|
27
30
|
'Cohere Command R+': 'cohere.command-r-plus-v1:0',
|
|
@@ -239,7 +239,6 @@ export function initializeModel(
|
|
|
239
239
|
case connectionType.BELONGS_TO: {
|
|
240
240
|
const sortKeyValues = relatedModelSKFieldNames.reduce(
|
|
241
241
|
// TODO(Eslint): is this implementation correct?
|
|
242
|
-
// eslint-disable-next-line array-callback-return
|
|
243
242
|
(acc: Record<string, any>, curVal) => {
|
|
244
243
|
if (record[curVal]) {
|
|
245
244
|
acc[curVal] = record[curVal];
|
|
@@ -1042,12 +1041,10 @@ export function generateGraphQLDocument(
|
|
|
1042
1041
|
});
|
|
1043
1042
|
graphQLOperationType ?? (graphQLOperationType = 'mutation');
|
|
1044
1043
|
// TODO(Eslint): this this case clause correct without the break statement?
|
|
1045
|
-
// eslint-disable-next-line no-fallthrough
|
|
1046
1044
|
case 'GET':
|
|
1047
1045
|
graphQLArguments ?? (graphQLArguments = getPkArgs);
|
|
1048
1046
|
graphQLSelectionSet ?? (graphQLSelectionSet = selectionSetFields);
|
|
1049
1047
|
// TODO(Eslint): this this case clause correct without the break statement?
|
|
1050
|
-
// eslint-disable-next-line no-fallthrough
|
|
1051
1048
|
case 'LIST':
|
|
1052
1049
|
graphQLArguments ??
|
|
1053
1050
|
(graphQLArguments = {
|
|
@@ -1066,7 +1063,6 @@ export function generateGraphQLDocument(
|
|
|
1066
1063
|
graphQLSelectionSet ??
|
|
1067
1064
|
(graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);
|
|
1068
1065
|
// TODO(Eslint): this this case clause correct without the break statement?
|
|
1069
|
-
// eslint-disable-next-line no-fallthrough
|
|
1070
1066
|
case 'INDEX_QUERY':
|
|
1071
1067
|
graphQLArguments ??
|
|
1072
1068
|
(graphQLArguments = {
|
|
@@ -1080,7 +1076,6 @@ export function generateGraphQLDocument(
|
|
|
1080
1076
|
graphQLSelectionSet ??
|
|
1081
1077
|
(graphQLSelectionSet = `items { ${selectionSetFields} } nextToken __typename`);
|
|
1082
1078
|
// TODO(Eslint): this this case clause correct without the break statement?
|
|
1083
|
-
// eslint-disable-next-line no-fallthrough
|
|
1084
1079
|
case 'ONCREATE':
|
|
1085
1080
|
case 'ONUPDATE':
|
|
1086
1081
|
case 'ONDELETE':
|
|
@@ -213,6 +213,7 @@ function _indexQuery(
|
|
|
213
213
|
? flattenedResult
|
|
214
214
|
: modelInitializer(flattenedResult),
|
|
215
215
|
nextToken: data[key]?.nextToken,
|
|
216
|
+
errors,
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
}
|
|
@@ -221,6 +222,7 @@ function _indexQuery(
|
|
|
221
222
|
return {
|
|
222
223
|
data: data[key],
|
|
223
224
|
nextToken: data[key]?.nextToken,
|
|
225
|
+
errors,
|
|
224
226
|
};
|
|
225
227
|
} else {
|
|
226
228
|
// `data` is `null` or an empty object:
|