@aws-amplify/api 6.0.1 → 6.0.2-unstable.51ed7b4.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 -10
- package/dist/cjs/API.js.map +1 -1
- package/dist/cjs/internals/index.js +2 -2
- package/dist/cjs/internals/index.js.map +1 -1
- package/dist/esm/API.d.ts +2 -2
- package/dist/esm/API.mjs +6 -11
- package/dist/esm/API.mjs.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/internals/index.d.ts +1 -1
- package/dist/esm/internals/index.mjs +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/API.ts +9 -15
- package/src/index.ts +1 -3
- package/src/internals/index.ts +1 -1
- package/src/types/index.ts +1 -0
- package/dist/cjs/internals/generateServerClient.js +0 -29
- package/dist/cjs/internals/generateServerClient.js.map +0 -1
- package/dist/esm/internals/generateServerClient.d.ts +0 -11
- package/dist/esm/internals/generateServerClient.mjs +0 -27
- package/dist/esm/internals/generateServerClient.mjs.map +0 -1
- package/src/internals/generateServerClient.ts +0 -38
package/dist/cjs/API.js
CHANGED
|
@@ -2,21 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.generateClient = void 0;
|
|
5
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
-
const api_graphql_1 = require("@aws-amplify/api-graphql");
|
|
8
5
|
const internals_1 = require("@aws-amplify/api-graphql/internals");
|
|
9
6
|
const core_1 = require("@aws-amplify/core");
|
|
10
7
|
/**
|
|
11
8
|
* Generates an API client that can work with models or raw GraphQL
|
|
12
9
|
*/
|
|
13
|
-
function generateClient() {
|
|
14
|
-
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isCancelError: internals_1.isCancelError,
|
|
19
|
-
};
|
|
10
|
+
function generateClient(options = {}) {
|
|
11
|
+
return (0, internals_1.generateClient)({
|
|
12
|
+
...options,
|
|
13
|
+
amplify: core_1.Amplify,
|
|
14
|
+
});
|
|
20
15
|
}
|
|
21
16
|
exports.generateClient = generateClient;
|
|
22
17
|
//# sourceMappingURL=API.js.map
|
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;\
|
|
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 */\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,SAAS,cAAc,CAAC,OAAO,GAAG,EAAE,EAAE;AACtC,IAAI,OAAO,IAAI,WAAW,CAAC,cAAc,EAAE;AAC3C,QAAQ,GAAG,OAAO;AAClB,QAAQ,OAAO,EAAE,MAAM,CAAC,OAAO;AAC/B,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
|
|
@@ -7,6 +7,6 @@ exports.generateServerClient = exports.InternalAPIClass = exports.InternalAPI =
|
|
|
7
7
|
var InternalAPI_1 = require("./InternalAPI");
|
|
8
8
|
Object.defineProperty(exports, "InternalAPI", { enumerable: true, get: function () { return InternalAPI_1.InternalAPI; } });
|
|
9
9
|
Object.defineProperty(exports, "InternalAPIClass", { enumerable: true, get: function () { return InternalAPI_1.InternalAPIClass; } });
|
|
10
|
-
var
|
|
11
|
-
Object.defineProperty(exports, "generateServerClient", { enumerable: true, get: function () { return
|
|
10
|
+
var server_1 = require("@aws-amplify/api-graphql/internals/server");
|
|
11
|
+
Object.defineProperty(exports, "generateServerClient", { enumerable: true, get: function () { return server_1.generateClient; } });
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/internals/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClient = exports.InternalAPIClass = exports.InternalAPI = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar InternalAPI_1 = require(\"./InternalAPI\");\nObject.defineProperty(exports, \"InternalAPI\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPI; } });\nObject.defineProperty(exports, \"InternalAPIClass\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPIClass; } });\nvar
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/internals/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClient = exports.InternalAPIClass = exports.InternalAPI = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar InternalAPI_1 = require(\"./InternalAPI\");\nObject.defineProperty(exports, \"InternalAPI\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPI; } });\nObject.defineProperty(exports, \"InternalAPIClass\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPIClass; } });\nvar server_1 = require(\"@aws-amplify/api-graphql/internals/server\");\nObject.defineProperty(exports, \"generateServerClient\", { enumerable: true, get: function () { return server_1.generateClient; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC;AACvF;AACA;AACA,IAAI,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5H,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;AACtI,IAAI,QAAQ,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;AACpE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;;"}
|
package/dist/esm/API.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V6Client } from '@aws-amplify/api-graphql';
|
|
1
|
+
import { V6Client, CommonPublicClientOptions } from '@aws-amplify/api-graphql';
|
|
2
2
|
/**
|
|
3
3
|
* Generates an API client that can work with models or raw GraphQL
|
|
4
4
|
*/
|
|
5
|
-
export declare function generateClient<T extends Record<any, any> = never>(): V6Client<T>;
|
|
5
|
+
export declare function generateClient<T extends Record<any, any> = never>(options?: CommonPublicClientOptions): V6Client<T>;
|
package/dist/esm/API.mjs
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { graphql, cancel, isCancelError } from '@aws-amplify/api-graphql/internals';
|
|
1
|
+
import { generateClient as generateClient$1 } from '@aws-amplify/api-graphql/internals';
|
|
3
2
|
import { Amplify } from '@aws-amplify/core';
|
|
4
3
|
|
|
5
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
7
4
|
/**
|
|
8
5
|
* Generates an API client that can work with models or raw GraphQL
|
|
9
6
|
*/
|
|
10
|
-
function generateClient() {
|
|
11
|
-
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
isCancelError: isCancelError,
|
|
16
|
-
};
|
|
7
|
+
function generateClient(options = {}) {
|
|
8
|
+
return generateClient$1({
|
|
9
|
+
...options,
|
|
10
|
+
amplify: Amplify,
|
|
11
|
+
});
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
export { generateClient };
|
package/dist/esm/API.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.mjs","sources":["../../src/API.ts"],"sourcesContent":["
|
|
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 */\nexport function generateClient(options = {}) {\n return internalGenerateClient({\n ...options,\n amplify: Amplify,\n });\n}\n"],"names":["internalGenerateClient"],"mappings":";;;AAEA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,GAAG,EAAE,EAAE;AAC7C,IAAI,OAAOA,gBAAsB,CAAC;AAClC,QAAQ,GAAG,OAAO;AAClB,QAAQ,OAAO,EAAE,OAAO;AACxB,KAAK,CAAC,CAAC;AACP;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GraphQLQuery, GraphQLSubscription } from './types';
|
|
1
|
+
export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
|
|
2
2
|
export { generateClient } from './API';
|
|
3
3
|
export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
|
|
4
4
|
export type { GraphQLResult, GraphQLReturnType, CONNECTION_STATE_CHANGE, } from '@aws-amplify/api-graphql';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { InternalAPI, InternalAPIClass } from './InternalAPI';
|
|
2
|
-
export { generateServerClient } from '
|
|
2
|
+
export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { InternalAPI, InternalAPIClass } from './InternalAPI.mjs';
|
|
2
|
-
export { generateServerClient } from '
|
|
2
|
+
export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
|
|
4
4
|
* This will be removed in future release when CLI and customers moves to recommeneded import styles.
|
|
5
5
|
*/
|
|
6
|
-
export { graphqlOperation, GraphQLAuthError, GraphQLResult, GraphQLQuery, GraphQLSubscription, } from '@aws-amplify/api-graphql';
|
|
6
|
+
export { graphqlOperation, GraphQLAuthError, GraphQLResult, GraphQLQuery, GraphQLSubscription, SelectionSet, } from '@aws-amplify/api-graphql';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2-unstable.51ed7b4.0+51ed7b4",
|
|
4
4
|
"description": "Api category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"server"
|
|
82
82
|
],
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@aws-amplify/api-graphql": "4.0.
|
|
85
|
-
"@aws-amplify/api-rest": "4.0.
|
|
84
|
+
"@aws-amplify/api-graphql": "4.0.2-unstable.51ed7b4.0+51ed7b4",
|
|
85
|
+
"@aws-amplify/api-rest": "4.0.2-unstable.51ed7b4.0+51ed7b4",
|
|
86
86
|
"tslib": "^2.5.0"
|
|
87
87
|
},
|
|
88
88
|
"jest": {
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"__tests__"
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "51ed7b4ecb1a47b6a17635011169056bec518df9"
|
|
139
139
|
}
|
package/src/API.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
graphql as v6graphql,
|
|
6
|
-
cancel as v6cancel,
|
|
7
|
-
isCancelError as v6isCancelError,
|
|
8
|
-
} from '@aws-amplify/api-graphql/internals';
|
|
3
|
+
import { V6Client, CommonPublicClientOptions } from '@aws-amplify/api-graphql';
|
|
4
|
+
import { generateClient as internalGenerateClient } from '@aws-amplify/api-graphql/internals';
|
|
9
5
|
import { Amplify } from '@aws-amplify/core';
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Generates an API client that can work with models or raw GraphQL
|
|
13
9
|
*/
|
|
14
|
-
export function generateClient<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isCancelError: v6isCancelError,
|
|
22
|
-
};
|
|
10
|
+
export function generateClient<T extends Record<any, any> = never>(
|
|
11
|
+
options: CommonPublicClientOptions = {}
|
|
12
|
+
): V6Client<T> {
|
|
13
|
+
return internalGenerateClient({
|
|
14
|
+
...options,
|
|
15
|
+
amplify: Amplify,
|
|
16
|
+
}) as unknown as V6Client<T>;
|
|
23
17
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { GraphQLQuery, GraphQLSubscription } from './types';
|
|
4
|
+
export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
|
|
7
5
|
export { generateClient } from './API';
|
|
8
6
|
|
|
9
7
|
export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
|
package/src/internals/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export { InternalAPI, InternalAPIClass } from './InternalAPI';
|
|
4
|
-
export { generateServerClient } from '
|
|
4
|
+
export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
|
package/src/types/index.ts
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateServerClient = void 0;
|
|
7
|
-
const api_graphql_1 = require("@aws-amplify/api-graphql");
|
|
8
|
-
const internals_1 = require("@aws-amplify/api-graphql/internals");
|
|
9
|
-
/**
|
|
10
|
-
* @private
|
|
11
|
-
*
|
|
12
|
-
* Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
|
|
13
|
-
* compatible context object for config and auth fetching.
|
|
14
|
-
*
|
|
15
|
-
* @param params
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
function generateServerClient(params) {
|
|
19
|
-
const client = {
|
|
20
|
-
[api_graphql_1.__amplify]: params.amplify,
|
|
21
|
-
graphql: internals_1.graphql,
|
|
22
|
-
cancel: internals_1.cancel,
|
|
23
|
-
isCancelError: internals_1.isCancelError,
|
|
24
|
-
models: {},
|
|
25
|
-
};
|
|
26
|
-
return client;
|
|
27
|
-
}
|
|
28
|
-
exports.generateServerClient = generateServerClient;
|
|
29
|
-
//# sourceMappingURL=generateServerClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateServerClient.js","sources":["../../../src/internals/generateServerClient.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.generateServerClient = void 0;\nconst api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\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 generateServerClient(params) {\n const client = {\n [api_graphql_1.__amplify]: params.amplify,\n graphql: internals_1.graphql,\n cancel: internals_1.cancel,\n isCancelError: internals_1.isCancelError,\n models: {},\n };\n return client;\n}\nexports.generateServerClient = generateServerClient;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,oBAAoB,GAAG,KAAK,CAAC,CAAC;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,MAAM,EAAE;AACtC,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACjD,QAAQ,OAAO,EAAE,WAAW,CAAC,OAAO;AACpC,QAAQ,MAAM,EAAE,WAAW,CAAC,MAAM;AAClC,QAAQ,aAAa,EAAE,WAAW,CAAC,aAAa;AAChD,QAAQ,MAAM,EAAE,EAAE;AAClB,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ServerClientGenerationParams, V6Client, V6ClientSSR } from '@aws-amplify/api-graphql';
|
|
2
|
-
/**
|
|
3
|
-
* @private
|
|
4
|
-
*
|
|
5
|
-
* Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
|
|
6
|
-
* compatible context object for config and auth fetching.
|
|
7
|
-
*
|
|
8
|
-
* @param params
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare function generateServerClient<T extends Record<any, any> = never, ClientType extends V6ClientSSR<T> | V6Client<T> = V6ClientSSR<T>>(params: ServerClientGenerationParams): ClientType;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { __amplify } from '@aws-amplify/api-graphql';
|
|
2
|
-
import { graphql, cancel, isCancelError } from '@aws-amplify/api-graphql/internals';
|
|
3
|
-
|
|
4
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
*
|
|
9
|
-
* Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
|
|
10
|
-
* compatible context object for config and auth fetching.
|
|
11
|
-
*
|
|
12
|
-
* @param params
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
function generateServerClient(params) {
|
|
16
|
-
const client = {
|
|
17
|
-
[__amplify]: params.amplify,
|
|
18
|
-
graphql,
|
|
19
|
-
cancel,
|
|
20
|
-
isCancelError,
|
|
21
|
-
models: {},
|
|
22
|
-
};
|
|
23
|
-
return client;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { generateServerClient };
|
|
27
|
-
//# sourceMappingURL=generateServerClient.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateServerClient.mjs","sources":["../../../src/internals/generateServerClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __amplify, } from '@aws-amplify/api-graphql';\nimport { graphql, cancel, isCancelError, } from '@aws-amplify/api-graphql/internals';\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 generateServerClient(params) {\n const client = {\n [__amplify]: params.amplify,\n graphql,\n cancel,\n isCancelError,\n models: {},\n };\n return client;\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,MAAM,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG;AACnB,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,OAAO,MAAM,CAAC;AAClB;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ServerClientGenerationParams,
|
|
6
|
-
V6Client,
|
|
7
|
-
V6ClientSSR,
|
|
8
|
-
__amplify,
|
|
9
|
-
} from '@aws-amplify/api-graphql';
|
|
10
|
-
import {
|
|
11
|
-
graphql,
|
|
12
|
-
cancel,
|
|
13
|
-
isCancelError,
|
|
14
|
-
} from '@aws-amplify/api-graphql/internals';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @private
|
|
18
|
-
*
|
|
19
|
-
* Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
|
|
20
|
-
* compatible context object for config and auth fetching.
|
|
21
|
-
*
|
|
22
|
-
* @param params
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export function generateServerClient<
|
|
26
|
-
T extends Record<any, any> = never,
|
|
27
|
-
ClientType extends V6ClientSSR<T> | V6Client<T> = V6ClientSSR<T>
|
|
28
|
-
>(params: ServerClientGenerationParams): ClientType {
|
|
29
|
-
const client = {
|
|
30
|
-
[__amplify]: params.amplify,
|
|
31
|
-
graphql,
|
|
32
|
-
cancel,
|
|
33
|
-
isCancelError,
|
|
34
|
-
models: {},
|
|
35
|
-
} as any;
|
|
36
|
-
|
|
37
|
-
return client as ClientType;
|
|
38
|
-
}
|