@aws-amplify/api 6.1.8 → 6.1.9-graphql-multi-client.93b5136.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/API.js +5 -2
- package/dist/cjs/API.js.map +1 -1
- package/dist/esm/API.d.ts +3 -2
- package/dist/esm/API.mjs +5 -2
- package/dist/esm/API.mjs.map +1 -1
- package/package.json +5 -4
- package/src/API.ts +15 -7
package/dist/cjs/API.js
CHANGED
|
@@ -4,15 +4,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.generateClient = void 0;
|
|
5
5
|
const internals_1 = require("@aws-amplify/api-graphql/internals");
|
|
6
6
|
const core_1 = require("@aws-amplify/core");
|
|
7
|
+
// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on
|
|
8
|
+
// defining these signatures separately. Not sure why offhand. This is worth
|
|
9
|
+
// some investigation later.
|
|
7
10
|
/**
|
|
8
11
|
* Generates an API client that can work with models or raw GraphQL
|
|
9
12
|
*
|
|
10
13
|
* @returns {@link V6Client}
|
|
11
14
|
* @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.
|
|
12
15
|
*/
|
|
13
|
-
function generateClient(options
|
|
16
|
+
function generateClient(options) {
|
|
14
17
|
return (0, internals_1.generateClient)({
|
|
15
|
-
...options,
|
|
18
|
+
...(options || {}),
|
|
16
19
|
amplify: core_1.Amplify,
|
|
17
20
|
});
|
|
18
21
|
}
|
package/dist/cjs/API.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.js","sources":["../../src/API.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateClient = void 0;\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\n/**\n * Generates an API client that can work with models or raw GraphQL\n *\n * @returns {@link V6Client}\n * @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.\n */\nfunction generateClient(options
|
|
1
|
+
{"version":3,"file":"API.js","sources":["../../src/API.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateClient = void 0;\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\n// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on\n// defining these signatures separately. Not sure why offhand. This is worth\n// some investigation later.\n/**\n * Generates an API client that can work with models or raw GraphQL\n *\n * @returns {@link V6Client}\n * @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.\n */\nfunction generateClient(options) {\n return (0, internals_1.generateClient)({\n ...(options || {}),\n amplify: core_1.Amplify,\n });\n}\nexports.generateClient = generateClient;\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,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,OAAO,EAAE;AACjC,IAAI,OAAO,IAAI,WAAW,CAAC,cAAc,EAAE;AAC3C,QAAQ,IAAI,OAAO,IAAI,EAAE,CAAC;AAC1B,QAAQ,OAAO,EAAE,MAAM,CAAC,OAAO;AAC/B,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
|
package/dist/esm/API.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V6Client } from '@aws-amplify/api-graphql';
|
|
2
|
+
import { CommonPublicClientOptions } from '@aws-amplify/api-graphql/internals';
|
|
2
3
|
/**
|
|
3
4
|
* Generates an API client that can work with models or raw GraphQL
|
|
4
5
|
*
|
|
5
6
|
* @returns {@link V6Client}
|
|
6
7
|
* @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.
|
|
7
8
|
*/
|
|
8
|
-
export declare function generateClient<T extends Record<any, any> = never>(options?:
|
|
9
|
+
export declare function generateClient<T extends Record<any, any> = never, Options extends CommonPublicClientOptions = object>(options?: Options): V6Client<T, Options>;
|
package/dist/esm/API.mjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { generateClient as generateClient$1 } from '@aws-amplify/api-graphql/internals';
|
|
2
2
|
import { Amplify } from '@aws-amplify/core';
|
|
3
3
|
|
|
4
|
+
// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on
|
|
5
|
+
// defining these signatures separately. Not sure why offhand. This is worth
|
|
6
|
+
// some investigation later.
|
|
4
7
|
/**
|
|
5
8
|
* Generates an API client that can work with models or raw GraphQL
|
|
6
9
|
*
|
|
7
10
|
* @returns {@link V6Client}
|
|
8
11
|
* @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.
|
|
9
12
|
*/
|
|
10
|
-
function generateClient(options
|
|
13
|
+
function generateClient(options) {
|
|
11
14
|
return generateClient$1({
|
|
12
|
-
...options,
|
|
15
|
+
...(options || {}),
|
|
13
16
|
amplify: Amplify,
|
|
14
17
|
});
|
|
15
18
|
}
|
package/dist/esm/API.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.mjs","sources":["../../src/API.ts"],"sourcesContent":["import { generateClient as internalGenerateClient } from '@aws-amplify/api-graphql/internals';\nimport { Amplify } from '@aws-amplify/core';\n/**\n * Generates an API client that can work with models or raw GraphQL\n *\n * @returns {@link V6Client}\n * @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.\n */\nexport function generateClient(options
|
|
1
|
+
{"version":3,"file":"API.mjs","sources":["../../src/API.ts"],"sourcesContent":["import { generateClient as internalGenerateClient, } from '@aws-amplify/api-graphql/internals';\nimport { Amplify } from '@aws-amplify/core';\n// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on\n// defining these signatures separately. Not sure why offhand. This is worth\n// some investigation later.\n/**\n * Generates an API client that can work with models or raw GraphQL\n *\n * @returns {@link V6Client}\n * @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.\n */\nexport function generateClient(options) {\n return internalGenerateClient({\n ...(options || {}),\n amplify: Amplify,\n });\n}\n"],"names":["internalGenerateClient"],"mappings":";;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE;AACxC,IAAI,OAAOA,gBAAsB,CAAC;AAClC,QAAQ,IAAI,OAAO,IAAI,EAAE,CAAC;AAC1B,QAAQ,OAAO,EAAE,OAAO;AACxB,KAAK,CAAC,CAAC;AACP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.9-graphql-multi-client.93b5136.0+93b5136",
|
|
4
4
|
"description": "Api category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"homepage": "https://aws-amplify.github.io/",
|
|
70
70
|
"devDependencies": {
|
|
71
|
+
"jest-fetch-mock": "3.0.3",
|
|
71
72
|
"typescript": "5.0.2"
|
|
72
73
|
},
|
|
73
74
|
"files": [
|
|
@@ -79,9 +80,9 @@
|
|
|
79
80
|
"server"
|
|
80
81
|
],
|
|
81
82
|
"dependencies": {
|
|
82
|
-
"@aws-amplify/api-graphql": "4.6.
|
|
83
|
-
"@aws-amplify/api-rest": "4.0.
|
|
83
|
+
"@aws-amplify/api-graphql": "4.6.7-graphql-multi-client.93b5136.0+93b5136",
|
|
84
|
+
"@aws-amplify/api-rest": "4.0.64-graphql-multi-client.93b5136.0+93b5136",
|
|
84
85
|
"tslib": "^2.5.0"
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "93b51360e57e283a7d4ed64c6b701d85ec71e94b"
|
|
87
88
|
}
|
package/src/API.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { V6Client } from '@aws-amplify/api-graphql';
|
|
4
|
+
import {
|
|
5
|
+
CommonPublicClientOptions,
|
|
6
|
+
generateClient as internalGenerateClient,
|
|
7
|
+
} from '@aws-amplify/api-graphql/internals';
|
|
5
8
|
import { Amplify } from '@aws-amplify/core';
|
|
6
9
|
|
|
10
|
+
// NOTE: The type narrowing on CommonPublicClientOptions seems to hinge on
|
|
11
|
+
// defining these signatures separately. Not sure why offhand. This is worth
|
|
12
|
+
// some investigation later.
|
|
13
|
+
|
|
7
14
|
/**
|
|
8
15
|
* Generates an API client that can work with models or raw GraphQL
|
|
9
16
|
*
|
|
10
17
|
* @returns {@link V6Client}
|
|
11
18
|
* @throws {@link Error} - Throws error when client cannot be generated due to configuration issues.
|
|
12
19
|
*/
|
|
13
|
-
export function generateClient<
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
export function generateClient<
|
|
21
|
+
T extends Record<any, any> = never,
|
|
22
|
+
Options extends CommonPublicClientOptions = object,
|
|
23
|
+
>(options?: Options): V6Client<T, Options> {
|
|
16
24
|
return internalGenerateClient({
|
|
17
|
-
...options,
|
|
25
|
+
...(options || ({} as any)),
|
|
18
26
|
amplify: Amplify,
|
|
19
|
-
}) as unknown as V6Client<T>;
|
|
27
|
+
}) as unknown as V6Client<T, Options>;
|
|
20
28
|
}
|