@aws-amplify/api-graphql 4.0.15 → 4.0.16-eslint-test.319d1b3.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/internals/generateClient.js +40 -1
- package/dist/cjs/internals/generateClient.js.map +1 -1
- package/dist/cjs/internals/generateModelsProperty.js +2 -12
- package/dist/cjs/internals/generateModelsProperty.js.map +1 -1
- package/dist/esm/internals/generateClient.mjs +40 -1
- package/dist/esm/internals/generateClient.mjs.map +1 -1
- package/dist/esm/internals/generateModelsProperty.d.ts +2 -2
- package/dist/esm/internals/generateModelsProperty.mjs +2 -12
- package/dist/esm/internals/generateModelsProperty.mjs.map +1 -1
- package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs +2 -3
- package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs.map +1 -1
- package/package.json +4 -4
- package/src/internals/generateClient.ts +64 -1
- package/src/internals/generateModelsProperty.ts +3 -14
|
@@ -7,6 +7,7 @@ exports.generateClient = void 0;
|
|
|
7
7
|
const v6_1 = require("./v6");
|
|
8
8
|
const generateModelsProperty_1 = require("./generateModelsProperty");
|
|
9
9
|
const types_1 = require("../types");
|
|
10
|
+
const core_1 = require("@aws-amplify/core");
|
|
10
11
|
/**
|
|
11
12
|
* @private
|
|
12
13
|
*
|
|
@@ -27,8 +28,46 @@ function generateClient(params) {
|
|
|
27
28
|
isCancelError: v6_1.isCancelError,
|
|
28
29
|
models: {},
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
const config = params.amplify.getConfig();
|
|
32
|
+
if (!config.API?.GraphQL) {
|
|
33
|
+
// This happens when the `Amplify.configure()` call gets evaluated after the `generateClient()` call.
|
|
34
|
+
//
|
|
35
|
+
// Cause: when the `generateClient()` and the `Amplify.configure()` calls are located in
|
|
36
|
+
// different source files, script bundlers may randomly arrange their orders in the production
|
|
37
|
+
// bundle.
|
|
38
|
+
//
|
|
39
|
+
// With the current implementation, the `client.models` instance created by `generateClient()`
|
|
40
|
+
// will be rebuilt on every `Amplify.configure()` call that's provided with a valid GraphQL
|
|
41
|
+
// provider configuration.
|
|
42
|
+
//
|
|
43
|
+
// TODO: revisit, and reverify this approach when enabling multiple clients for multi-endpoints
|
|
44
|
+
// configuration.
|
|
45
|
+
client.models = emptyModels;
|
|
46
|
+
generateModelsPropertyOnAmplifyConfigure(client);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
client.models = (0, generateModelsProperty_1.generateModelsProperty)(client, config.API?.GraphQL);
|
|
50
|
+
}
|
|
31
51
|
return client;
|
|
32
52
|
}
|
|
33
53
|
exports.generateClient = generateClient;
|
|
54
|
+
const generateModelsPropertyOnAmplifyConfigure = (clientRef) => {
|
|
55
|
+
core_1.Hub.listen('core', coreEvent => {
|
|
56
|
+
if (!isConfigureEvent(coreEvent.payload)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const { data: resourceConfig } = coreEvent.payload;
|
|
60
|
+
if (resourceConfig.API?.GraphQL) {
|
|
61
|
+
clientRef.models = (0, generateModelsProperty_1.generateModelsProperty)(clientRef, resourceConfig.API?.GraphQL);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
function isConfigureEvent(payload) {
|
|
66
|
+
return payload.event === 'configure';
|
|
67
|
+
}
|
|
68
|
+
const emptyModels = new Proxy({}, {
|
|
69
|
+
get() {
|
|
70
|
+
throw new Error('Could not generate client. This is likely due to Amplify.configure() not being called prior to generateClient().');
|
|
71
|
+
},
|
|
72
|
+
});
|
|
34
73
|
//# sourceMappingURL=generateClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateClient.js","sources":["../../../src/internals/generateClient.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateClient = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst v6_1 = require(\"./v6\");\nconst generateModelsProperty_1 = require(\"./generateModelsProperty\");\nconst types_1 = require(\"../types\");\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nfunction generateClient(params) {\n const client = {\n [types_1.__amplify]: params.amplify,\n [types_1.__authMode]: params.authMode,\n [types_1.__authToken]: params.authToken,\n [types_1.__headers]: params.headers,\n graphql: v6_1.graphql,\n cancel: v6_1.cancel,\n isCancelError: v6_1.isCancelError,\n models: {},\n };\n client.models = (0, generateModelsProperty_1.generateModelsProperty)(client,
|
|
1
|
+
{"version":3,"file":"generateClient.js","sources":["../../../src/internals/generateClient.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateClient = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst v6_1 = require(\"./v6\");\nconst generateModelsProperty_1 = require(\"./generateModelsProperty\");\nconst types_1 = require(\"../types\");\nconst core_1 = require(\"@aws-amplify/core\");\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nfunction generateClient(params) {\n const client = {\n [types_1.__amplify]: params.amplify,\n [types_1.__authMode]: params.authMode,\n [types_1.__authToken]: params.authToken,\n [types_1.__headers]: params.headers,\n graphql: v6_1.graphql,\n cancel: v6_1.cancel,\n isCancelError: v6_1.isCancelError,\n models: {},\n };\n const config = params.amplify.getConfig();\n if (!config.API?.GraphQL) {\n // This happens when the `Amplify.configure()` call gets evaluated after the `generateClient()` call.\n //\n // Cause: when the `generateClient()` and the `Amplify.configure()` calls are located in\n // different source files, script bundlers may randomly arrange their orders in the production\n // bundle.\n //\n // With the current implementation, the `client.models` instance created by `generateClient()`\n // will be rebuilt on every `Amplify.configure()` call that's provided with a valid GraphQL\n // provider configuration.\n //\n // TODO: revisit, and reverify this approach when enabling multiple clients for multi-endpoints\n // configuration.\n client.models = emptyModels;\n generateModelsPropertyOnAmplifyConfigure(client);\n }\n else {\n client.models = (0, generateModelsProperty_1.generateModelsProperty)(client, config.API?.GraphQL);\n }\n return client;\n}\nexports.generateClient = generateClient;\nconst generateModelsPropertyOnAmplifyConfigure = (clientRef) => {\n core_1.Hub.listen('core', coreEvent => {\n if (!isConfigureEvent(coreEvent.payload)) {\n return;\n }\n const { data: resourceConfig } = coreEvent.payload;\n if (resourceConfig.API?.GraphQL) {\n clientRef.models = (0, generateModelsProperty_1.generateModelsProperty)(clientRef, resourceConfig.API?.GraphQL);\n }\n });\n};\nfunction isConfigureEvent(payload) {\n return payload.event === 'configure';\n}\nconst emptyModels = new Proxy({}, {\n get() {\n throw new Error('Could not generate client. This is likely due to Amplify.configure() not being called prior to generateClient().');\n },\n});\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC;AACA;AACA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACrE,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,MAAM,EAAE;AAChC,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AAC3C,QAAQ,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,QAAQ;AAC7C,QAAQ,CAAC,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS;AAC/C,QAAQ,CAAC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AAC3C,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO;AAC7B,QAAQ,MAAM,EAAE,IAAI,CAAC,MAAM;AAC3B,QAAQ,aAAa,EAAE,IAAI,CAAC,aAAa;AACzC,QAAQ,MAAM,EAAE,EAAE;AAClB,KAAK,CAAC;AACN,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;AAC9C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC;AACpC,QAAQ,wCAAwC,CAAC,MAAM,CAAC,CAAC;AACzD,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,CAAC,MAAM,GAAG,IAAI,wBAAwB,CAAC,sBAAsB,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC1G,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC;AACxC,MAAM,wCAAwC,GAAG,CAAC,SAAS,KAAK;AAChE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI;AAC3C,QAAQ,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AAClD,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC;AAC3D,QAAQ,IAAI,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE;AACzC,YAAY,SAAS,CAAC,MAAM,GAAG,IAAI,wBAAwB,CAAC,sBAAsB,EAAE,SAAS,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5H,SAAS;AACT,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;AACzC,CAAC;AACD,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE;AAClC,IAAI,GAAG,GAAG;AACV,QAAQ,MAAM,IAAI,KAAK,CAAC,kHAAkH,CAAC,CAAC;AAC5I,KAAK;AACL,CAAC,CAAC;;"}
|
|
@@ -7,19 +7,9 @@ const list_1 = require("./operations/list");
|
|
|
7
7
|
const get_1 = require("./operations/get");
|
|
8
8
|
const subscription_1 = require("./operations/subscription");
|
|
9
9
|
const observeQuery_1 = require("./operations/observeQuery");
|
|
10
|
-
function generateModelsProperty(client,
|
|
10
|
+
function generateModelsProperty(client, graphqlConfig) {
|
|
11
11
|
const models = {};
|
|
12
|
-
const
|
|
13
|
-
if (!config.API?.GraphQL) {
|
|
14
|
-
// breaks compatibility with certain bundler, e.g. Vite where component files are evaluated before
|
|
15
|
-
// the entry point causing false positive errors. Revisit how to better handle this post-launch
|
|
16
|
-
// throw new Error(
|
|
17
|
-
// 'The API configuration is missing. This is likely due to Amplify.configure() not being called
|
|
18
|
-
// prior to generateClient().'
|
|
19
|
-
// );
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
const modelIntrospection = config.API.GraphQL.modelIntrospection;
|
|
12
|
+
const modelIntrospection = graphqlConfig.modelIntrospection;
|
|
23
13
|
if (!modelIntrospection) {
|
|
24
14
|
return {};
|
|
25
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.js","sources":["../../../src/internals/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 get_1 = require(\"./operations/get\");\nconst subscription_1 = require(\"./operations/subscription\");\nconst observeQuery_1 = require(\"./operations/observeQuery\");\nfunction generateModelsProperty(client,
|
|
1
|
+
{"version":3,"file":"generateModelsProperty.js","sources":["../../../src/internals/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 get_1 = require(\"./operations/get\");\nconst subscription_1 = require(\"./operations/subscription\");\nconst observeQuery_1 = require(\"./operations/observeQuery\");\nfunction generateModelsProperty(client, graphqlConfig) {\n const models = {};\n const modelIntrospection = graphqlConfig.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 }\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,aAAa,CAAC,CAAC;AAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC1C,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC5D,SAAS,sBAAsB,CAAC,MAAM,EAAE,aAAa,EAAE;AACvD,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB,IAAI,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,CAAC;AAChE,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,CAAC,GAAG,EAAE,CAAC;AAC1B,QAAQ,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,eAAe,EAAE,CAAC,KAAK;AAClG,YAAY,MAAM,SAAS,GAAG,GAAG,CAAC;AAClC,YAAY,IAAI,SAAS,KAAK,MAAM,EAAE;AACtC,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAC3G,aAAa;AACb,iBAAiB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC3D,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACtI,aAAa;AACb,iBAAiB,IAAI,SAAS,KAAK,eAAe,EAAE;AACpD,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACvG,aAAa;AACb,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACpH,aAAa;AACb,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { graphql, cancel, isCancelError } from './v6.mjs';
|
|
2
2
|
import { generateModelsProperty } from './generateModelsProperty.mjs';
|
|
3
3
|
import { __amplify, __authMode, __authToken, __headers } from '../types/index.mjs';
|
|
4
|
+
import { Hub } from '@aws-amplify/core';
|
|
4
5
|
|
|
5
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -24,9 +25,47 @@ function generateClient(params) {
|
|
|
24
25
|
isCancelError,
|
|
25
26
|
models: {},
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
+
const config = params.amplify.getConfig();
|
|
29
|
+
if (!config.API?.GraphQL) {
|
|
30
|
+
// This happens when the `Amplify.configure()` call gets evaluated after the `generateClient()` call.
|
|
31
|
+
//
|
|
32
|
+
// Cause: when the `generateClient()` and the `Amplify.configure()` calls are located in
|
|
33
|
+
// different source files, script bundlers may randomly arrange their orders in the production
|
|
34
|
+
// bundle.
|
|
35
|
+
//
|
|
36
|
+
// With the current implementation, the `client.models` instance created by `generateClient()`
|
|
37
|
+
// will be rebuilt on every `Amplify.configure()` call that's provided with a valid GraphQL
|
|
38
|
+
// provider configuration.
|
|
39
|
+
//
|
|
40
|
+
// TODO: revisit, and reverify this approach when enabling multiple clients for multi-endpoints
|
|
41
|
+
// configuration.
|
|
42
|
+
client.models = emptyModels;
|
|
43
|
+
generateModelsPropertyOnAmplifyConfigure(client);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
client.models = generateModelsProperty(client, config.API?.GraphQL);
|
|
47
|
+
}
|
|
28
48
|
return client;
|
|
29
49
|
}
|
|
50
|
+
const generateModelsPropertyOnAmplifyConfigure = (clientRef) => {
|
|
51
|
+
Hub.listen('core', coreEvent => {
|
|
52
|
+
if (!isConfigureEvent(coreEvent.payload)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const { data: resourceConfig } = coreEvent.payload;
|
|
56
|
+
if (resourceConfig.API?.GraphQL) {
|
|
57
|
+
clientRef.models = generateModelsProperty(clientRef, resourceConfig.API?.GraphQL);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
function isConfigureEvent(payload) {
|
|
62
|
+
return payload.event === 'configure';
|
|
63
|
+
}
|
|
64
|
+
const emptyModels = new Proxy({}, {
|
|
65
|
+
get() {
|
|
66
|
+
throw new Error('Could not generate client. This is likely due to Amplify.configure() not being called prior to generateClient().');
|
|
67
|
+
},
|
|
68
|
+
});
|
|
30
69
|
|
|
31
70
|
export { generateClient };
|
|
32
71
|
//# sourceMappingURL=generateClient.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateClient.mjs","sources":["../../../src/internals/generateClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { graphql, cancel, isCancelError } from './v6';\nimport { generateModelsProperty } from './generateModelsProperty';\nimport { __amplify, __authMode, __authToken, __headers, } from '../types';\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nexport function generateClient(params) {\n const client = {\n [__amplify]: params.amplify,\n [__authMode]: params.authMode,\n [__authToken]: params.authToken,\n [__headers]: params.headers,\n graphql,\n cancel,\n isCancelError,\n models: {},\n };\n client.models = generateModelsProperty(client,
|
|
1
|
+
{"version":3,"file":"generateClient.mjs","sources":["../../../src/internals/generateClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { graphql, cancel, isCancelError } from './v6';\nimport { generateModelsProperty } from './generateModelsProperty';\nimport { __amplify, __authMode, __authToken, __headers, } from '../types';\nimport { Hub } from '@aws-amplify/core';\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nexport function generateClient(params) {\n const client = {\n [__amplify]: params.amplify,\n [__authMode]: params.authMode,\n [__authToken]: params.authToken,\n [__headers]: params.headers,\n graphql,\n cancel,\n isCancelError,\n models: {},\n };\n const config = params.amplify.getConfig();\n if (!config.API?.GraphQL) {\n // This happens when the `Amplify.configure()` call gets evaluated after the `generateClient()` call.\n //\n // Cause: when the `generateClient()` and the `Amplify.configure()` calls are located in\n // different source files, script bundlers may randomly arrange their orders in the production\n // bundle.\n //\n // With the current implementation, the `client.models` instance created by `generateClient()`\n // will be rebuilt on every `Amplify.configure()` call that's provided with a valid GraphQL\n // provider configuration.\n //\n // TODO: revisit, and reverify this approach when enabling multiple clients for multi-endpoints\n // configuration.\n client.models = emptyModels;\n generateModelsPropertyOnAmplifyConfigure(client);\n }\n else {\n client.models = generateModelsProperty(client, config.API?.GraphQL);\n }\n return client;\n}\nconst generateModelsPropertyOnAmplifyConfigure = (clientRef) => {\n Hub.listen('core', coreEvent => {\n if (!isConfigureEvent(coreEvent.payload)) {\n return;\n }\n const { data: resourceConfig } = coreEvent.payload;\n if (resourceConfig.API?.GraphQL) {\n clientRef.models = generateModelsProperty(clientRef, resourceConfig.API?.GraphQL);\n }\n });\n};\nfunction isConfigureEvent(payload) {\n return payload.event === 'configure';\n}\nconst emptyModels = new Proxy({}, {\n get() {\n throw new Error('Could not generate client. This is likely due to Amplify.configure() not being called prior to generateClient().');\n },\n});\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE;AACvC,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACnC,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,QAAQ;AACrC,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS;AACvC,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACnC,QAAQ,OAAO;AACf,QAAQ,MAAM;AACd,QAAQ,aAAa;AACrB,QAAQ,MAAM,EAAE,EAAE;AAClB,KAAK,CAAC;AACN,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;AAC9C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC;AACpC,QAAQ,wCAAwC,CAAC,MAAM,CAAC,CAAC;AACzD,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,CAAC,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5E,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,MAAM,wCAAwC,GAAG,CAAC,SAAS,KAAK;AAChE,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI;AACpC,QAAQ,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;AAClD,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC;AAC3D,QAAQ,IAAI,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE;AACzC,YAAY,SAAS,CAAC,MAAM,GAAG,sBAAsB,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9F,SAAS;AACT,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,SAAS,gBAAgB,CAAC,OAAO,EAAE;AACnC,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;AACzC,CAAC;AACD,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE;AAClC,IAAI,GAAG,GAAG;AACV,QAAQ,MAAM,IAAI,KAAK,CAAC,kHAAkH,CAAC,CAAC;AAC5I,KAAK;AACL,CAAC,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ModelTypes } from '@aws-amplify/data-schema-types';
|
|
2
|
-
import { ClientGenerationParams } from './types';
|
|
3
2
|
import { V6Client } from '../types';
|
|
4
|
-
|
|
3
|
+
import { GraphQLProviderConfig } from '@aws-amplify/core';
|
|
4
|
+
export declare function generateModelsProperty<T extends Record<any, any> = never>(client: V6Client<Record<string, any>>, graphqlConfig: GraphQLProviderConfig['GraphQL']): ModelTypes<T>;
|
|
@@ -4,19 +4,9 @@ import { getFactory } from './operations/get.mjs';
|
|
|
4
4
|
import { subscriptionFactory } from './operations/subscription.mjs';
|
|
5
5
|
import { observeQueryFactory } from './operations/observeQuery.mjs';
|
|
6
6
|
|
|
7
|
-
function generateModelsProperty(client,
|
|
7
|
+
function generateModelsProperty(client, graphqlConfig) {
|
|
8
8
|
const models = {};
|
|
9
|
-
const
|
|
10
|
-
if (!config.API?.GraphQL) {
|
|
11
|
-
// breaks compatibility with certain bundler, e.g. Vite where component files are evaluated before
|
|
12
|
-
// the entry point causing false positive errors. Revisit how to better handle this post-launch
|
|
13
|
-
// throw new Error(
|
|
14
|
-
// 'The API configuration is missing. This is likely due to Amplify.configure() not being called
|
|
15
|
-
// prior to generateClient().'
|
|
16
|
-
// );
|
|
17
|
-
return {};
|
|
18
|
-
}
|
|
19
|
-
const modelIntrospection = config.API.GraphQL.modelIntrospection;
|
|
9
|
+
const modelIntrospection = graphqlConfig.modelIntrospection;
|
|
20
10
|
if (!modelIntrospection) {
|
|
21
11
|
return {};
|
|
22
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateModelsProperty.mjs","sources":["../../../src/internals/generateModelsProperty.ts"],"sourcesContent":["import { graphQLOperationsInfo } from './APIClient';\nimport { listFactory } from './operations/list';\nimport { getFactory } from './operations/get';\nimport { subscriptionFactory } from './operations/subscription';\nimport { observeQueryFactory } from './operations/observeQuery';\nexport function generateModelsProperty(client,
|
|
1
|
+
{"version":3,"file":"generateModelsProperty.mjs","sources":["../../../src/internals/generateModelsProperty.ts"],"sourcesContent":["import { graphQLOperationsInfo } from './APIClient';\nimport { listFactory } from './operations/list';\nimport { getFactory } from './operations/get';\nimport { subscriptionFactory } from './operations/subscription';\nimport { observeQueryFactory } from './operations/observeQuery';\nexport function generateModelsProperty(client, graphqlConfig) {\n const models = {};\n const modelIntrospection = graphqlConfig.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 }\n return models;\n}\n"],"names":[],"mappings":";;;;;;AAKO,SAAS,sBAAsB,CAAC,MAAM,EAAE,aAAa,EAAE;AAC9D,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB,IAAI,MAAM,kBAAkB,GAAG,aAAa,CAAC,kBAAkB,CAAC;AAChE,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,CAAC,GAAG,EAAE,CAAC;AAC1B,QAAQ,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,eAAe,EAAE,CAAC,KAAK;AACtF,YAAY,MAAM,SAAS,GAAG,GAAG,CAAC;AAClC,YAAY,IAAI,SAAS,KAAK,MAAM,EAAE;AACtC,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAC/F,aAAa;AACb,iBAAiB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AAC3D,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAClH,aAAa;AACb,iBAAiB,IAAI,SAAS,KAAK,eAAe,EAAE;AACpD,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACnF,aAAa;AACb,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACzG,aAAa;AACb,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import '../InternalGraphQLAPI.mjs';
|
|
2
2
|
import { graphql, cancel, isCancelError } from '../v6.mjs';
|
|
3
|
-
import
|
|
4
|
-
import 'rxjs';
|
|
5
|
-
import '../../utils/resolveConfig.mjs';
|
|
3
|
+
import '../generateClient.mjs';
|
|
6
4
|
import { generateModelsProperty } from './generateModelsProperty.mjs';
|
|
5
|
+
import { __amplify, __authMode, __authToken } from '../../types/index.mjs';
|
|
7
6
|
|
|
8
7
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
9
8
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateClientWithAmplifyInstance.mjs","sources":["../../../../src/internals/server/generateClientWithAmplifyInstance.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { graphql, cancel, isCancelError } from '..';\nimport { generateModelsProperty } from './generateModelsProperty';\nimport { __amplify, __authMode, __authToken, } from '../../types';\n/**\n * @private\n *\n * Used internally by `adapter-nextjs` package.\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nexport function generateClientWithAmplifyInstance(params) {\n const client = {\n [__amplify]: params.amplify,\n [__authMode]: params.authMode,\n [__authToken]: params.authToken,\n graphql,\n cancel,\n isCancelError,\n };\n client.models = generateModelsProperty(client, params);\n return client;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateClientWithAmplifyInstance.mjs","sources":["../../../../src/internals/server/generateClientWithAmplifyInstance.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { graphql, cancel, isCancelError } from '..';\nimport { generateModelsProperty } from './generateModelsProperty';\nimport { __amplify, __authMode, __authToken, } from '../../types';\n/**\n * @private\n *\n * Used internally by `adapter-nextjs` package.\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nexport function generateClientWithAmplifyInstance(params) {\n const client = {\n [__amplify]: params.amplify,\n [__authMode]: params.authMode,\n [__authToken]: params.authToken,\n graphql,\n cancel,\n isCancelError,\n };\n client.models = generateModelsProperty(client, params);\n return client;\n}\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iCAAiC,CAAC,MAAM,EAAE;AAC1D,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACnC,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,QAAQ;AACrC,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS;AACvC,QAAQ,OAAO;AACf,QAAQ,MAAM;AACd,QAAQ,aAAa;AACrB,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3D,IAAI,OAAO,MAAM,CAAC;AAClB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.16-eslint-test.319d1b3.0+319d1b3",
|
|
4
4
|
"description": "Api-graphql category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"server"
|
|
85
85
|
],
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@aws-amplify/api-rest": "4.0.
|
|
88
|
-
"@aws-amplify/core": "6.0.
|
|
87
|
+
"@aws-amplify/api-rest": "4.0.16-eslint-test.319d1b3.0+319d1b3",
|
|
88
|
+
"@aws-amplify/core": "6.0.16-eslint-test.319d1b3.0+319d1b3",
|
|
89
89
|
"@aws-amplify/data-schema-types": "^0.6.10",
|
|
90
90
|
"@aws-sdk/types": "3.387.0",
|
|
91
91
|
"graphql": "15.8.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"limit": "91.7 kB"
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "319d1b319047d9c34f0537e8059424729cc768c4"
|
|
105
105
|
}
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
__headers,
|
|
11
11
|
} from '../types';
|
|
12
12
|
import { ClientGenerationParams } from './types';
|
|
13
|
+
import { ModelTypes } from '@aws-amplify/data-schema-types';
|
|
14
|
+
import { Hub, HubCapsule, ResourcesConfig } from '@aws-amplify/core';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* @private
|
|
@@ -34,7 +36,68 @@ export function generateClient<T extends Record<any, any> = never>(
|
|
|
34
36
|
models: {},
|
|
35
37
|
} as any;
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
const config = params.amplify.getConfig();
|
|
40
|
+
|
|
41
|
+
if (!config.API?.GraphQL) {
|
|
42
|
+
// This happens when the `Amplify.configure()` call gets evaluated after the `generateClient()` call.
|
|
43
|
+
//
|
|
44
|
+
// Cause: when the `generateClient()` and the `Amplify.configure()` calls are located in
|
|
45
|
+
// different source files, script bundlers may randomly arrange their orders in the production
|
|
46
|
+
// bundle.
|
|
47
|
+
//
|
|
48
|
+
// With the current implementation, the `client.models` instance created by `generateClient()`
|
|
49
|
+
// will be rebuilt on every `Amplify.configure()` call that's provided with a valid GraphQL
|
|
50
|
+
// provider configuration.
|
|
51
|
+
//
|
|
52
|
+
// TODO: revisit, and reverify this approach when enabling multiple clients for multi-endpoints
|
|
53
|
+
// configuration.
|
|
54
|
+
client.models = emptyModels as ModelTypes<never>;
|
|
55
|
+
generateModelsPropertyOnAmplifyConfigure<T>(client);
|
|
56
|
+
} else {
|
|
57
|
+
client.models = generateModelsProperty<T>(
|
|
58
|
+
client,
|
|
59
|
+
config.API?.GraphQL,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
38
62
|
|
|
39
63
|
return client as V6Client<T>;
|
|
40
64
|
}
|
|
65
|
+
|
|
66
|
+
const generateModelsPropertyOnAmplifyConfigure = <
|
|
67
|
+
T extends Record<any, any> = never,
|
|
68
|
+
>(clientRef: any) => {
|
|
69
|
+
Hub.listen('core', coreEvent => {
|
|
70
|
+
if (!isConfigureEvent(coreEvent.payload)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const { data: resourceConfig } = coreEvent.payload;
|
|
75
|
+
|
|
76
|
+
if (resourceConfig.API?.GraphQL) {
|
|
77
|
+
clientRef.models = generateModelsProperty<T>(
|
|
78
|
+
clientRef,
|
|
79
|
+
resourceConfig.API?.GraphQL,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
function isConfigureEvent(
|
|
86
|
+
payload: HubCapsule<'core', { event: string; data?: unknown }>['payload'],
|
|
87
|
+
): payload is {
|
|
88
|
+
event: 'configure';
|
|
89
|
+
data: ResourcesConfig;
|
|
90
|
+
} {
|
|
91
|
+
return payload.event === 'configure';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const emptyModels = new Proxy(
|
|
95
|
+
{},
|
|
96
|
+
{
|
|
97
|
+
get() {
|
|
98
|
+
throw new Error(
|
|
99
|
+
'Could not generate client. This is likely due to Amplify.configure() not being called prior to generateClient().',
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
);
|
|
@@ -10,27 +10,16 @@ import { getFactory } from './operations/get';
|
|
|
10
10
|
import { subscriptionFactory } from './operations/subscription';
|
|
11
11
|
import { observeQueryFactory } from './operations/observeQuery';
|
|
12
12
|
import { ModelIntrospectionSchema } from '@aws-amplify/core/internals/utils';
|
|
13
|
+
import { GraphQLProviderConfig } from '@aws-amplify/core';
|
|
13
14
|
|
|
14
15
|
export function generateModelsProperty<T extends Record<any, any> = never>(
|
|
15
16
|
client: V6Client<Record<string, any>>,
|
|
16
|
-
|
|
17
|
+
graphqlConfig: GraphQLProviderConfig['GraphQL'],
|
|
17
18
|
): ModelTypes<T> {
|
|
18
19
|
const models = {} as any;
|
|
19
|
-
const config = params.amplify.getConfig();
|
|
20
|
-
|
|
21
|
-
if (!config.API?.GraphQL) {
|
|
22
|
-
// breaks compatibility with certain bundler, e.g. Vite where component files are evaluated before
|
|
23
|
-
// the entry point causing false positive errors. Revisit how to better handle this post-launch
|
|
24
|
-
|
|
25
|
-
// throw new Error(
|
|
26
|
-
// 'The API configuration is missing. This is likely due to Amplify.configure() not being called
|
|
27
|
-
// prior to generateClient().'
|
|
28
|
-
// );
|
|
29
|
-
return {} as ModelTypes<never>;
|
|
30
|
-
}
|
|
31
20
|
|
|
32
21
|
const modelIntrospection: ModelIntrospectionSchema | undefined =
|
|
33
|
-
|
|
22
|
+
graphqlConfig.modelIntrospection;
|
|
34
23
|
|
|
35
24
|
if (!modelIntrospection) {
|
|
36
25
|
return {} as ModelTypes<never>;
|