@aws-amplify/core 6.4.1-unstable.925d248.0 → 6.4.1
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/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/utils/globalHelpers/index.js +9 -0
- package/dist/cjs/utils/globalHelpers/index.js.map +1 -1
- package/dist/esm/Platform/version.d.ts +1 -1
- package/dist/esm/Platform/version.mjs +1 -1
- package/dist/esm/Platform/version.mjs.map +1 -1
- package/dist/esm/singleton/API/types.d.ts +30 -3
- package/dist/esm/utils/cryptoSecureRandomInt.d.ts +1 -1
- package/dist/esm/utils/globalHelpers/index.d.ts +1 -1
- package/dist/esm/utils/globalHelpers/index.mjs +9 -0
- package/dist/esm/utils/globalHelpers/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/singleton/API/types.ts +39 -6
- package/src/utils/globalHelpers/index.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.6.1
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.6.1';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
|
|
@@ -13,6 +13,15 @@ const getCrypto = () => {
|
|
|
13
13
|
if (typeof crypto === 'object') {
|
|
14
14
|
return crypto;
|
|
15
15
|
}
|
|
16
|
+
try {
|
|
17
|
+
const crypto = require('node:crypto').webcrypto;
|
|
18
|
+
if (typeof crypto === 'object') {
|
|
19
|
+
return crypto;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (_) {
|
|
23
|
+
// no-op
|
|
24
|
+
}
|
|
16
25
|
throw new errors_1.AmplifyError({
|
|
17
26
|
name: 'MissingPolyfill',
|
|
18
27
|
message: 'Cannot resolve the `crypto` function from the environment.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/utils/globalHelpers/index.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.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst errors_1 = require(\"../../errors\");\nconst getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\nexports.getAtob = getAtob;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACzC,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;AACzE,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AAC9B,MAAM,OAAO,GAAG,MAAM;AACtB;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,MAAM,OAAO,GAAG,MAAM;AACtB;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/utils/globalHelpers/index.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.getAtob = exports.getBtoa = exports.getCrypto = void 0;\nconst errors_1 = require(\"../../errors\");\nconst getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n try {\n const crypto = require('node:crypto').webcrypto;\n if (typeof crypto === 'object') {\n return crypto;\n }\n }\n catch (_) {\n // no-op\n }\n throw new errors_1.AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexports.getCrypto = getCrypto;\nconst getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexports.getBtoa = getBtoa;\nconst getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new errors_1.AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\nexports.getAtob = getAtob;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACzC,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;AACzE,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,IAAI;AACR,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC;AACxD,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACxC,YAAY,OAAO,MAAM,CAAC;AAC1B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,CAAC,EAAE;AACd;AACA,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AAC9B,MAAM,OAAO,GAAG,MAAM;AACtB;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,MAAM,OAAO,GAAG,MAAM;AACtB;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC;AACpC,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.6.1
|
|
1
|
+
export declare const version = "6.6.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.1
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.1';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -88,6 +88,8 @@ export interface ModelIntrospectionSchema {
|
|
|
88
88
|
queries?: CustomOperations;
|
|
89
89
|
mutations?: CustomOperations;
|
|
90
90
|
subscriptions?: CustomOperations;
|
|
91
|
+
conversations?: SchemaConversationRoutes;
|
|
92
|
+
generations?: SchemaGenerationRoutes;
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
95
|
* Top-level Entities on a Schema
|
|
@@ -96,6 +98,24 @@ export type SchemaModels = Record<string, SchemaModel>;
|
|
|
96
98
|
export type SchemaNonModels = Record<string, SchemaNonModel>;
|
|
97
99
|
export type SchemaEnums = Record<string, SchemaEnum>;
|
|
98
100
|
export type CustomOperations = Record<string, CustomOperation>;
|
|
101
|
+
type SchemaConversationRoutes = Record<string, SchemaConversationRoute>;
|
|
102
|
+
type SchemaGenerationRoutes = Record<string, CustomOperation>;
|
|
103
|
+
interface SchemaConversationRoute {
|
|
104
|
+
name: string;
|
|
105
|
+
models: SchemaModels;
|
|
106
|
+
nonModels: SchemaNonModels;
|
|
107
|
+
enums: SchemaEnums;
|
|
108
|
+
conversation: SchemaConversation;
|
|
109
|
+
message: SchemaConversationMessage;
|
|
110
|
+
}
|
|
111
|
+
interface SchemaConversation {
|
|
112
|
+
modelName: string;
|
|
113
|
+
}
|
|
114
|
+
interface SchemaConversationMessage {
|
|
115
|
+
modelName: string;
|
|
116
|
+
subscribe: CustomOperation;
|
|
117
|
+
send: CustomOperation;
|
|
118
|
+
}
|
|
99
119
|
export interface SchemaModel {
|
|
100
120
|
name: string;
|
|
101
121
|
attributes?: ModelAttribute[];
|
|
@@ -134,7 +154,7 @@ export interface CustomOperation {
|
|
|
134
154
|
export type CustomOperationArguments = Record<string, CustomOperationArgument>;
|
|
135
155
|
export interface CustomOperationArgument {
|
|
136
156
|
name: string;
|
|
137
|
-
type:
|
|
157
|
+
type: InputFieldType;
|
|
138
158
|
isArray: boolean;
|
|
139
159
|
isRequired: boolean;
|
|
140
160
|
isArrayNullable?: boolean;
|
|
@@ -159,9 +179,15 @@ export interface ModelFieldType {
|
|
|
159
179
|
export interface NonModelFieldType {
|
|
160
180
|
nonModel: string;
|
|
161
181
|
}
|
|
162
|
-
|
|
182
|
+
interface EnumType {
|
|
163
183
|
enum: string;
|
|
164
|
-
}
|
|
184
|
+
}
|
|
185
|
+
interface InputType {
|
|
186
|
+
input: string;
|
|
187
|
+
}
|
|
188
|
+
type ScalarType = 'ID' | 'String' | 'Int' | 'Float' | 'AWSDate' | 'AWSTime' | 'AWSDateTime' | 'AWSTimestamp' | 'AWSEmail' | 'AWSURL' | 'AWSIPAddress' | 'Boolean' | 'AWSJSON' | 'AWSPhone';
|
|
189
|
+
type FieldType = ScalarType | EnumType | ModelFieldType | NonModelFieldType;
|
|
190
|
+
type InputFieldType = ScalarType | EnumType | InputType;
|
|
165
191
|
export type FieldAttribute = ModelAttribute;
|
|
166
192
|
/**
|
|
167
193
|
* Field-level Relationship Definitions
|
|
@@ -193,3 +219,4 @@ export interface PrimaryKeyInfo {
|
|
|
193
219
|
primaryKeyFieldName: string;
|
|
194
220
|
sortKeyFieldNames: string[];
|
|
195
221
|
}
|
|
222
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function cryptoSecureRandomInt():
|
|
1
|
+
export declare function cryptoSecureRandomInt(): any;
|
|
@@ -12,6 +12,15 @@ const getCrypto = () => {
|
|
|
12
12
|
if (typeof crypto === 'object') {
|
|
13
13
|
return crypto;
|
|
14
14
|
}
|
|
15
|
+
try {
|
|
16
|
+
const crypto = require('node:crypto').webcrypto;
|
|
17
|
+
if (typeof crypto === 'object') {
|
|
18
|
+
return crypto;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (_) {
|
|
22
|
+
// no-op
|
|
23
|
+
}
|
|
15
24
|
throw new AmplifyError({
|
|
16
25
|
name: 'MissingPolyfill',
|
|
17
26
|
message: 'Cannot resolve the `crypto` function from the environment.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../src/utils/globalHelpers/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyError } from '../../errors';\nexport const getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n throw new AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexport const getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexport const getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAEY,MAAC,SAAS,GAAG,MAAM;AAC/B,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;AACzE,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC,CAAC;AACP,EAAE;AACU,MAAC,OAAO,GAAG,MAAM;AAC7B;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,EAAE;AACU,MAAC,OAAO,GAAG,MAAM;AAC7B;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/utils/globalHelpers/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyError } from '../../errors';\nexport const getCrypto = () => {\n if (typeof window === 'object' && typeof window.crypto === 'object') {\n return window.crypto;\n }\n // Next.js global polyfill\n if (typeof crypto === 'object') {\n return crypto;\n }\n try {\n const crypto = require('node:crypto').webcrypto;\n if (typeof crypto === 'object') {\n return crypto;\n }\n }\n catch (_) {\n // no-op\n }\n throw new AmplifyError({\n name: 'MissingPolyfill',\n message: 'Cannot resolve the `crypto` function from the environment.',\n });\n};\nexport const getBtoa = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa;\n }\n // Next.js global polyfill\n if (typeof btoa === 'function') {\n return btoa;\n }\n throw new AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `btoa` function from the environment.',\n });\n};\nexport const getAtob = () => {\n // browser\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return window.atob;\n }\n // Next.js global polyfill\n if (typeof atob === 'function') {\n return atob;\n }\n throw new AmplifyError({\n name: 'Base64EncoderError',\n message: 'Cannot resolve the `atob` function from the environment.',\n });\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAEY,MAAC,SAAS,GAAG,MAAM;AAC/B,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;AACzE,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC;AAC7B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,IAAI,IAAI;AACR,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC;AACxD,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACxC,YAAY,OAAO,MAAM,CAAC;AAC1B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,CAAC,EAAE;AACd;AACA,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK,CAAC,CAAC;AACP,EAAE;AACU,MAAC,OAAO,GAAG,MAAM;AAC7B;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP,EAAE;AACU,MAAC,OAAO,GAAG,MAAM;AAC7B;AACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC;AAC3B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,MAAM,IAAI,YAAY,CAAC;AAC3B,QAAQ,IAAI,EAAE,oBAAoB;AAClC,QAAQ,OAAO,EAAE,0DAA0D;AAC3E,KAAK,CAAC,CAAC;AACP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/core",
|
|
3
|
-
"version": "6.4.1
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "Core category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"uuid": "^9.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@aws-amplify/react-native": "1.1.
|
|
63
|
+
"@aws-amplify/react-native": "1.1.5",
|
|
64
64
|
"@types/js-cookie": "3.0.2",
|
|
65
65
|
"genversion": "^2.2.0",
|
|
66
66
|
"typescript": "5.0.2"
|
|
@@ -192,5 +192,5 @@
|
|
|
192
192
|
]
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
|
-
"gitHead": "
|
|
195
|
+
"gitHead": "1c379970ce9e32c402b0c23f207c246eb8ffac24"
|
|
196
196
|
}
|
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '6.6.1
|
|
2
|
+
export const version = '6.6.1';
|
|
@@ -111,6 +111,8 @@ export interface ModelIntrospectionSchema {
|
|
|
111
111
|
queries?: CustomOperations;
|
|
112
112
|
mutations?: CustomOperations;
|
|
113
113
|
subscriptions?: CustomOperations;
|
|
114
|
+
conversations?: SchemaConversationRoutes;
|
|
115
|
+
generations?: SchemaGenerationRoutes;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
/**
|
|
@@ -120,6 +122,27 @@ export type SchemaModels = Record<string, SchemaModel>;
|
|
|
120
122
|
export type SchemaNonModels = Record<string, SchemaNonModel>;
|
|
121
123
|
export type SchemaEnums = Record<string, SchemaEnum>;
|
|
122
124
|
export type CustomOperations = Record<string, CustomOperation>;
|
|
125
|
+
type SchemaConversationRoutes = Record<string, SchemaConversationRoute>;
|
|
126
|
+
type SchemaGenerationRoutes = Record<string, CustomOperation>;
|
|
127
|
+
|
|
128
|
+
interface SchemaConversationRoute {
|
|
129
|
+
name: string;
|
|
130
|
+
models: SchemaModels;
|
|
131
|
+
nonModels: SchemaNonModels;
|
|
132
|
+
enums: SchemaEnums;
|
|
133
|
+
conversation: SchemaConversation;
|
|
134
|
+
message: SchemaConversationMessage;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface SchemaConversation {
|
|
138
|
+
modelName: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface SchemaConversationMessage {
|
|
142
|
+
modelName: string;
|
|
143
|
+
subscribe: CustomOperation;
|
|
144
|
+
send: CustomOperation;
|
|
145
|
+
}
|
|
123
146
|
|
|
124
147
|
export interface SchemaModel {
|
|
125
148
|
name: string;
|
|
@@ -164,7 +187,7 @@ export type CustomOperationArguments = Record<string, CustomOperationArgument>;
|
|
|
164
187
|
|
|
165
188
|
export interface CustomOperationArgument {
|
|
166
189
|
name: string;
|
|
167
|
-
type:
|
|
190
|
+
type: InputFieldType;
|
|
168
191
|
isArray: boolean;
|
|
169
192
|
isRequired: boolean;
|
|
170
193
|
isArrayNullable?: boolean;
|
|
@@ -192,7 +215,15 @@ export interface NonModelFieldType {
|
|
|
192
215
|
nonModel: string;
|
|
193
216
|
}
|
|
194
217
|
|
|
195
|
-
|
|
218
|
+
interface EnumType {
|
|
219
|
+
enum: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface InputType {
|
|
223
|
+
input: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
type ScalarType =
|
|
196
227
|
| 'ID'
|
|
197
228
|
| 'String'
|
|
198
229
|
| 'Int'
|
|
@@ -206,10 +237,12 @@ export type FieldType =
|
|
|
206
237
|
| 'AWSIPAddress'
|
|
207
238
|
| 'Boolean'
|
|
208
239
|
| 'AWSJSON'
|
|
209
|
-
| 'AWSPhone'
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
240
|
+
| 'AWSPhone';
|
|
241
|
+
|
|
242
|
+
type FieldType = ScalarType | EnumType | ModelFieldType | NonModelFieldType;
|
|
243
|
+
|
|
244
|
+
type InputFieldType = ScalarType | EnumType | InputType;
|
|
245
|
+
|
|
213
246
|
export type FieldAttribute = ModelAttribute;
|
|
214
247
|
|
|
215
248
|
/**
|
|
@@ -13,6 +13,16 @@ export const getCrypto = () => {
|
|
|
13
13
|
return crypto;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
try {
|
|
17
|
+
const crypto = require('node:crypto').webcrypto;
|
|
18
|
+
|
|
19
|
+
if (typeof crypto === 'object') {
|
|
20
|
+
return crypto;
|
|
21
|
+
}
|
|
22
|
+
} catch (_) {
|
|
23
|
+
// no-op
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
throw new AmplifyError({
|
|
17
27
|
name: 'MissingPolyfill',
|
|
18
28
|
message: 'Cannot resolve the `crypto` function from the environment.',
|