@aws-amplify/api-graphql 4.0.19 → 4.0.20-api-graphql-eslint.dd94c10.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/Providers/AWSAppSyncRealTimeProvider/index.js +40 -31
- package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
- package/dist/cjs/internals/APIClient.js +36 -20
- package/dist/cjs/internals/APIClient.js.map +1 -1
- package/dist/cjs/internals/InternalGraphQLAPI.js +10 -9
- package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -1
- package/dist/cjs/internals/generateClient.js +5 -5
- package/dist/cjs/internals/generateClient.js.map +1 -1
- package/dist/cjs/internals/operations/custom.js +4 -20
- package/dist/cjs/internals/operations/custom.js.map +1 -1
- package/dist/cjs/internals/operations/list.js +1 -1
- package/dist/cjs/internals/operations/list.js.map +1 -1
- package/dist/cjs/internals/server/generateClientWithAmplifyInstance.js +3 -3
- package/dist/cjs/internals/server/generateClientWithAmplifyInstance.js.map +1 -1
- package/dist/cjs/internals/server/generateModelsProperty.js +1 -1
- package/dist/cjs/internals/server/generateModelsProperty.js.map +1 -1
- package/dist/cjs/internals/utils/clientProperties/generateEnumsProperty.js.map +1 -0
- package/dist/cjs/internals/utils/{generateModelsProperty.js → clientProperties/generateModelsProperty.js} +7 -7
- package/dist/cjs/internals/utils/clientProperties/generateModelsProperty.js.map +1 -0
- package/dist/cjs/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.js.map +1 -0
- package/dist/cjs/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js.map +1 -0
- package/dist/cjs/internals/v6.js +0 -2
- package/dist/cjs/internals/v6.js.map +1 -1
- package/dist/cjs/utils/errors/repackageAuthError.js +1 -1
- package/dist/cjs/utils/errors/repackageAuthError.js.map +1 -1
- package/dist/esm/GraphQLAPI.d.ts +2 -2
- package/dist/esm/GraphQLAPI.mjs.map +1 -1
- package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +8 -8
- package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs +40 -31
- package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs.map +1 -1
- package/dist/esm/internals/APIClient.d.ts +6 -5
- package/dist/esm/internals/APIClient.mjs +35 -20
- package/dist/esm/internals/APIClient.mjs.map +1 -1
- package/dist/esm/internals/InternalGraphQLAPI.d.ts +1 -1
- package/dist/esm/internals/InternalGraphQLAPI.mjs +10 -9
- package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -1
- package/dist/esm/internals/generateClient.mjs +5 -5
- package/dist/esm/internals/generateClient.mjs.map +1 -1
- package/dist/esm/internals/generateCustomOperationsProperty.d.ts +2 -2
- package/dist/esm/internals/operations/custom.d.ts +1 -1
- package/dist/esm/internals/operations/custom.mjs +5 -21
- package/dist/esm/internals/operations/custom.mjs.map +1 -1
- package/dist/esm/internals/operations/get.d.ts +1 -1
- package/dist/esm/internals/operations/get.mjs.map +1 -1
- package/dist/esm/internals/operations/indexQuery.d.ts +3 -3
- package/dist/esm/internals/operations/indexQuery.mjs.map +1 -1
- package/dist/esm/internals/operations/list.d.ts +1 -1
- package/dist/esm/internals/operations/list.mjs +1 -1
- package/dist/esm/internals/operations/list.mjs.map +1 -1
- package/dist/esm/internals/operations/subscription.d.ts +1 -1
- package/dist/esm/internals/operations/subscription.mjs.map +1 -1
- package/dist/esm/internals/server/generateClientWithAmplifyInstance.d.ts +1 -1
- package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs +3 -3
- package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs.map +1 -1
- package/dist/esm/internals/server/generateModelsProperty.d.ts +1 -2
- package/dist/esm/internals/server/generateModelsProperty.mjs +1 -1
- package/dist/esm/internals/server/generateModelsProperty.mjs.map +1 -1
- package/dist/esm/internals/types.d.ts +2 -2
- package/dist/esm/internals/utils/clientProperties/generateEnumsProperty.mjs.map +1 -0
- package/dist/esm/internals/utils/{generateModelsProperty.d.ts → clientProperties/generateModelsProperty.d.ts} +1 -1
- package/dist/esm/internals/utils/{generateModelsProperty.mjs → clientProperties/generateModelsProperty.mjs} +7 -7
- package/dist/esm/internals/utils/clientProperties/generateModelsProperty.mjs.map +1 -0
- package/dist/esm/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.mjs.map +1 -0
- package/dist/esm/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.mjs.map +1 -0
- package/dist/esm/internals/v6.d.ts +1 -1
- package/dist/esm/internals/v6.mjs +0 -2
- package/dist/esm/internals/v6.mjs.map +1 -1
- package/dist/esm/types/index.d.ts +33 -35
- package/dist/esm/utils/ConnectionStateMonitor.d.ts +2 -2
- package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -1
- package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -1
- package/dist/esm/utils/errors/repackageAuthError.d.ts +2 -2
- package/dist/esm/utils/errors/repackageAuthError.mjs +1 -1
- package/dist/esm/utils/errors/repackageAuthError.mjs.map +1 -1
- package/dist/esm/utils/findIndexByFields.d.ts +1 -1
- package/package.json +8 -7
- package/src/GraphQLAPI.ts +4 -3
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +84 -64
- package/src/internals/APIClient.ts +60 -28
- package/src/internals/InternalGraphQLAPI.ts +26 -30
- package/src/internals/clientUtils.ts +1 -1
- package/src/internals/generateClient.ts +13 -11
- package/src/internals/generateCustomOperationsProperty.ts +7 -6
- package/src/internals/operations/custom.ts +21 -35
- package/src/internals/operations/get.ts +9 -8
- package/src/internals/operations/indexQuery.ts +12 -11
- package/src/internals/operations/list.ts +11 -15
- package/src/internals/operations/observeQuery.ts +3 -1
- package/src/internals/operations/subscription.ts +12 -10
- package/src/internals/server/generateClientWithAmplifyInstance.ts +9 -9
- package/src/internals/server/generateModelsProperty.ts +7 -4
- package/src/internals/types.ts +2 -2
- package/src/internals/utils/{generateEnumsProperty.ts → clientProperties/generateEnumsProperty.ts} +7 -6
- package/src/internals/utils/{generateModelsProperty.ts → clientProperties/generateModelsProperty.ts} +10 -9
- package/src/internals/v6.ts +6 -4
- package/src/server/generateClient.ts +4 -1
- package/src/types/PubSub.ts +1 -0
- package/src/types/index.ts +51 -47
- package/src/utils/ConnectionStateMonitor.ts +8 -3
- package/src/utils/ReachabilityMonitor/index.native.ts +1 -1
- package/src/utils/ReachabilityMonitor/index.ts +1 -0
- package/src/utils/ReconnectionMonitor.ts +1 -0
- package/src/utils/errors/repackageAuthError.ts +6 -7
- package/src/utils/findIndexByFields.ts +1 -1
- package/src/utils/resolveConfig.ts +1 -0
- package/src/utils/resolveLibraryOptions.ts +1 -0
- package/src/utils/resolveOwnerFields.ts +7 -5
- package/src/utils/resolvePKFields.ts +1 -0
- package/dist/cjs/internals/utils/generateEnumsProperty.js.map +0 -1
- package/dist/cjs/internals/utils/generateModelsProperty.js.map +0 -1
- package/dist/cjs/internals/utils/isApiGraphQLProviderConfig.js.map +0 -1
- package/dist/cjs/internals/utils/isConfigureEventWithResourceConfig.js.map +0 -1
- package/dist/esm/internals/utils/generateEnumsProperty.mjs.map +0 -1
- package/dist/esm/internals/utils/generateModelsProperty.mjs.map +0 -1
- package/dist/esm/internals/utils/isApiGraphQLProviderConfig.mjs.map +0 -1
- package/dist/esm/internals/utils/isConfigureEventWithResourceConfig.mjs.map +0 -1
- /package/dist/cjs/internals/utils/{generateEnumsProperty.js → clientProperties/generateEnumsProperty.js} +0 -0
- /package/dist/cjs/internals/utils/{isApiGraphQLProviderConfig.js → runtimeTypeGuards/isApiGraphQLProviderConfig.js} +0 -0
- /package/dist/cjs/internals/utils/{isConfigureEventWithResourceConfig.js → runtimeTypeGuards/isConfigureEventWithResourceConfig.js} +0 -0
- /package/dist/esm/internals/utils/{generateEnumsProperty.d.ts → clientProperties/generateEnumsProperty.d.ts} +0 -0
- /package/dist/esm/internals/utils/{generateEnumsProperty.mjs → clientProperties/generateEnumsProperty.mjs} +0 -0
- /package/dist/esm/internals/utils/{isApiGraphQLProviderConfig.d.ts → runtimeTypeGuards/isApiGraphQLProviderConfig.d.ts} +0 -0
- /package/dist/esm/internals/utils/{isApiGraphQLProviderConfig.mjs → runtimeTypeGuards/isApiGraphQLProviderConfig.mjs} +0 -0
- /package/dist/esm/internals/utils/{isConfigureEventWithResourceConfig.d.ts → runtimeTypeGuards/isConfigureEventWithResourceConfig.d.ts} +0 -0
- /package/dist/esm/internals/utils/{isConfigureEventWithResourceConfig.mjs → runtimeTypeGuards/isConfigureEventWithResourceConfig.mjs} +0 -0
- /package/src/internals/utils/{isApiGraphQLProviderConfig.ts → runtimeTypeGuards/isApiGraphQLProviderConfig.ts} +0 -0
- /package/src/internals/utils/{isConfigureEventWithResourceConfig.ts → runtimeTypeGuards/isConfigureEventWithResourceConfig.ts} +0 -0
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
AmplifyErrorParams,
|
|
6
|
-
GraphQLAuthMode,
|
|
7
|
-
} from '@aws-amplify/core/internals/utils';
|
|
4
|
+
import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
interface ErrorObject {
|
|
10
7
|
errors: AmplifyErrorParams[];
|
|
11
|
-
}
|
|
8
|
+
}
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* Checks to see if the given response or subscription message contains an
|
|
@@ -27,12 +24,13 @@ export function repackageUnauthError<T extends ErrorObject>(content: T): T {
|
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
26
|
}
|
|
27
|
+
|
|
30
28
|
return content;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
function isUnauthError(error: any): boolean {
|
|
34
32
|
// Error pattern corresponding to appsync calls
|
|
35
|
-
if (error?.
|
|
33
|
+
if (error?.originalError?.name?.startsWith('UnauthorizedException')) {
|
|
36
34
|
return true;
|
|
37
35
|
}
|
|
38
36
|
// Error pattern corresponding to appsync subscriptions
|
|
@@ -42,5 +40,6 @@ function isUnauthError(error: any): boolean {
|
|
|
42
40
|
) {
|
|
43
41
|
return true;
|
|
44
42
|
}
|
|
43
|
+
|
|
45
44
|
return false;
|
|
46
45
|
}
|
|
@@ -9,5 +9,6 @@ import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
|
9
9
|
export const resolveLibraryOptions = (amplify: AmplifyClassV6) => {
|
|
10
10
|
const headers = amplify.libraryOptions?.API?.GraphQL?.headers;
|
|
11
11
|
const withCredentials = amplify.libraryOptions?.API?.GraphQL?.withCredentials;
|
|
12
|
+
|
|
12
13
|
return { headers, withCredentials };
|
|
13
14
|
};
|
|
@@ -9,20 +9,20 @@ type ModelIntrospectionSchema = Exclude<
|
|
|
9
9
|
>;
|
|
10
10
|
type Model = ModelIntrospectionSchema['models'][string];
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface AuthAttribute {
|
|
13
13
|
type: 'auth';
|
|
14
14
|
properties: {
|
|
15
15
|
rules: AuthRule[];
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Only the portions of an Auth rule we care about.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
interface AuthRule {
|
|
23
23
|
allow: string;
|
|
24
24
|
ownerField?: string;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Given an introspection schema model, returns all owner fields.
|
|
@@ -41,6 +41,7 @@ export function resolveOwnerFields(model: Model): string[] {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
|
|
44
45
|
return Array.from(ownerFields);
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -55,11 +56,12 @@ function isAuthAttribute(attribute: any): attribute is AuthAttribute {
|
|
|
55
56
|
if (attribute?.type === 'auth') {
|
|
56
57
|
if (typeof attribute?.properties === 'object') {
|
|
57
58
|
if (Array.isArray(attribute?.properties?.rules)) {
|
|
58
|
-
return (attribute?.properties?.rules as
|
|
59
|
+
return (attribute?.properties?.rules as any[]).every(
|
|
59
60
|
rule => !!rule.allow,
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
|
|
64
66
|
return false;
|
|
65
67
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumsProperty.js","sources":["../../../../src/internals/utils/generateEnumsProperty.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.generateEnumsProperty = void 0;\nconst generateEnumsProperty = (graphqlConfig) => {\n const modelIntrospection = graphqlConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const enums = {};\n for (const [_, enumData] of Object.entries(modelIntrospection.enums)) {\n enums[enumData.name] = {\n values: () => enumData.values,\n };\n }\n return enums;\n};\nexports.generateEnumsProperty = generateEnumsProperty;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,KAAK,CAAC,CAAC;AACvC,MAAM,qBAAqB,GAAG,CAAC,aAAa,KAAK;AACjD,IAAI,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,CAAC;AAChE,IAAI,IAAI,CAAC,kBAAkB,EAAE;AAC7B,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;AACrB,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;AAC1E,QAAQ,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG;AAC/B,YAAY,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM;AACzC,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AACF,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.js","sources":["../../../../src/internals/utils/generateModelsProperty.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateModelsProperty = void 0;\nconst APIClient_1 = require(\"../APIClient\");\nconst list_1 = require(\"../operations/list\");\nconst indexQuery_1 = require(\"../operations/indexQuery\");\nconst get_1 = require(\"../operations/get\");\nconst subscription_1 = require(\"../operations/subscription\");\nconst observeQuery_1 = require(\"../operations/observeQuery\");\nconst clientUtils_1 = require(\"../clientUtils\");\nfunction generateModelsProperty(client, apiGraphQLConfig) {\n const models = {};\n const modelIntrospection = apiGraphQLConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const SUBSCRIPTION_OPS = ['ONCREATE', 'ONUPDATE', 'ONDELETE'];\n for (const model of Object.values(modelIntrospection.models)) {\n const { name } = model;\n models[name] = {};\n Object.entries(APIClient_1.graphQLOperationsInfo).forEach(([key, { operationPrefix }]) => {\n const operation = key;\n if (operation === 'LIST') {\n models[name][operationPrefix] = (0, list_1.listFactory)(client, modelIntrospection, model);\n }\n else if (SUBSCRIPTION_OPS.includes(operation)) {\n models[name][operationPrefix] = (0, subscription_1.subscriptionFactory)(client, modelIntrospection, model, operation);\n }\n else if (operation === 'OBSERVE_QUERY') {\n models[name][operationPrefix] = (0, observeQuery_1.observeQueryFactory)(models, model);\n }\n else {\n models[name][operationPrefix] = (0, get_1.getFactory)(client, modelIntrospection, model, operation);\n }\n });\n const secondaryIdxs = (0, clientUtils_1.getSecondaryIndexesFromSchemaModel)(model);\n for (const idx of secondaryIdxs) {\n models[name][idx.queryField] = (0, indexQuery_1.indexQueryFactory)(client, modelIntrospection, model, idx);\n }\n }\n return models;\n}\nexports.generateModelsProperty = generateModelsProperty;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,sBAAsB,GAAG,KAAK,CAAC,CAAC;AACxC,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACzD,MAAM,KAAK,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC3C,MAAM,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC7D,MAAM,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAChD,SAAS,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,EAAE;AAC1D,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB,IAAI,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,kBAAkB,CAAC;AACnE,IAAI,IAAI,CAAC,kBAAkB,EAAE;AAC7B,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAClE,IAAI,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;AAClE,QAAQ,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;AAC/B,QAAQ,MAAM,CAAC,IAAI,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,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACvH,SAAS;AACT,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isApiGraphQLProviderConfig.js","sources":["../../../../src/internals/utils/isApiGraphQLProviderConfig.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.isApiGraphQLConfig = void 0;\nfunction isApiGraphQLConfig(apiGraphQLConfig) {\n return apiGraphQLConfig !== undefined;\n}\nexports.isApiGraphQLConfig = isApiGraphQLConfig;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,SAAS,kBAAkB,CAAC,gBAAgB,EAAE;AAC9C,IAAI,OAAO,gBAAgB,KAAK,SAAS,CAAC;AAC1C,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConfigureEventWithResourceConfig.js","sources":["../../../../src/internals/utils/isConfigureEventWithResourceConfig.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.isConfigureEventWithResourceConfig = void 0;\nfunction isConfigureEventWithResourceConfig(payload) {\n return payload.event === 'configure';\n}\nexports.isConfigureEventWithResourceConfig = isConfigureEventWithResourceConfig;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kCAAkC,GAAG,KAAK,CAAC,CAAC;AACpD,SAAS,kCAAkC,CAAC,OAAO,EAAE;AACrD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;AACzC,CAAC;AACD,OAAO,CAAC,kCAAkC,GAAG,kCAAkC;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumsProperty.mjs","sources":["../../../../src/internals/utils/generateEnumsProperty.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const generateEnumsProperty = (graphqlConfig) => {\n const modelIntrospection = graphqlConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const enums = {};\n for (const [_, enumData] of Object.entries(modelIntrospection.enums)) {\n enums[enumData.name] = {\n values: () => enumData.values,\n };\n }\n return enums;\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,qBAAqB,GAAG,CAAC,aAAa,KAAK;AACxD,IAAI,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,CAAC;AAChE,IAAI,IAAI,CAAC,kBAAkB,EAAE;AAC7B,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;AACrB,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;AAC1E,QAAQ,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG;AAC/B,YAAY,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM;AACzC,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.mjs","sources":["../../../../src/internals/utils/generateModelsProperty.ts"],"sourcesContent":["import { graphQLOperationsInfo } from '../APIClient';\nimport { listFactory } from '../operations/list';\nimport { indexQueryFactory } from '../operations/indexQuery';\nimport { getFactory } from '../operations/get';\nimport { subscriptionFactory } from '../operations/subscription';\nimport { observeQueryFactory } from '../operations/observeQuery';\nimport { getSecondaryIndexesFromSchemaModel } from '../clientUtils';\nexport function generateModelsProperty(client, apiGraphQLConfig) {\n const models = {};\n const modelIntrospection = apiGraphQLConfig.modelIntrospection;\n if (!modelIntrospection) {\n return {};\n }\n const SUBSCRIPTION_OPS = ['ONCREATE', 'ONUPDATE', 'ONDELETE'];\n for (const model of Object.values(modelIntrospection.models)) {\n const { name } = model;\n models[name] = {};\n Object.entries(graphQLOperationsInfo).forEach(([key, { operationPrefix }]) => {\n const operation = key;\n if (operation === 'LIST') {\n models[name][operationPrefix] = listFactory(client, modelIntrospection, model);\n }\n else if (SUBSCRIPTION_OPS.includes(operation)) {\n models[name][operationPrefix] = subscriptionFactory(client, modelIntrospection, model, operation);\n }\n else if (operation === 'OBSERVE_QUERY') {\n models[name][operationPrefix] = observeQueryFactory(models, model);\n }\n else {\n models[name][operationPrefix] = getFactory(client, modelIntrospection, model, operation);\n }\n });\n const secondaryIdxs = getSecondaryIndexesFromSchemaModel(model);\n for (const idx of secondaryIdxs) {\n models[name][idx.queryField] = indexQueryFactory(client, modelIntrospection, model, idx);\n }\n }\n return models;\n}\n"],"names":[],"mappings":";;;;;;;;AAOO,SAAS,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,EAAE;AACjE,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB,IAAI,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,kBAAkB,CAAC;AACnE,IAAI,IAAI,CAAC,kBAAkB,EAAE;AAC7B,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG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AAM,GAAG,IAAI,aAAa,EAAE;AACzC,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACrG,SAAS;AACT,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isApiGraphQLProviderConfig.mjs","sources":["../../../../src/internals/utils/isApiGraphQLProviderConfig.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function isApiGraphQLConfig(apiGraphQLConfig) {\n return apiGraphQLConfig !== undefined;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACO,SAAS,kBAAkB,CAAC,gBAAgB,EAAE;AACrD,IAAI,OAAO,gBAAgB,KAAK,SAAS,CAAC;AAC1C;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConfigureEventWithResourceConfig.mjs","sources":["../../../../src/internals/utils/isConfigureEventWithResourceConfig.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function isConfigureEventWithResourceConfig(payload) {\n return payload.event === 'configure';\n}\n"],"names":[],"mappings":"AAAA;AACA;AACO,SAAS,kCAAkC,CAAC,OAAO,EAAE;AAC5D,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;AACzC;;;;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|