@aws-amplify/api-graphql 4.6.7-graphql-multi-client.93b5136.0 → 4.6.7-graphql-multi-client.ba4c61d.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V6Client } from '../types';
|
|
2
|
-
import { ClientGenerationParams
|
|
2
|
+
import { ClientGenerationParams } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* @private
|
|
5
5
|
*
|
|
@@ -9,4 +9,4 @@ import { ClientGenerationParams, CommonPublicClientOptions } from './types';
|
|
|
9
9
|
* @param params
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
|
-
export declare function generateClient<T extends Record<any, any> = never, Options extends
|
|
12
|
+
export declare function generateClient<T extends Record<any, any> = never, Options extends ClientGenerationParams = ClientGenerationParams>(params: Options): V6Client<T, Options>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { InternalGraphQLAPI, InternalGraphQLAPIClass, } from './InternalGraphQLAPI';
|
|
2
2
|
export { graphql, cancel, isCancelError } from './v6';
|
|
3
3
|
export { generateClient } from './generateClient';
|
|
4
|
-
export { CommonPublicClientOptions } from './types';
|
|
4
|
+
export { CommonPublicClientOptions, DefaultCommonClientOptions } from './types';
|
|
@@ -9,16 +9,17 @@ import { CustomHeaders } from '@aws-amplify/data-schema/runtime';
|
|
|
9
9
|
export type ClientGenerationParams = {
|
|
10
10
|
amplify: AmplifyClassV6;
|
|
11
11
|
} & CommonPublicClientOptions;
|
|
12
|
-
|
|
13
|
-
* Common options that can be used on public `generateClient()` interfaces.
|
|
14
|
-
*/
|
|
15
|
-
export type CommonPublicClientOptions = {
|
|
12
|
+
export interface DefaultCommonClientOptions {
|
|
16
13
|
endpoint?: never;
|
|
17
14
|
authMode?: GraphQLAuthMode;
|
|
18
|
-
authToken?: string;
|
|
19
15
|
apiKey?: string;
|
|
16
|
+
authToken?: string;
|
|
20
17
|
headers?: CustomHeaders;
|
|
21
|
-
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Common options that can be used on public `generateClient()` interfaces.
|
|
21
|
+
*/
|
|
22
|
+
export type CommonPublicClientOptions = DefaultCommonClientOptions | {
|
|
22
23
|
endpoint: string;
|
|
23
24
|
authMode: 'apiKey';
|
|
24
25
|
apiKey: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql",
|
|
3
|
-
"version": "4.6.7-graphql-multi-client.
|
|
3
|
+
"version": "4.6.7-graphql-multi-client.ba4c61d.0+ba4c61d",
|
|
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.64-graphql-multi-client.
|
|
88
|
-
"@aws-amplify/core": "6.7.4-graphql-multi-client.
|
|
87
|
+
"@aws-amplify/api-rest": "4.0.64-graphql-multi-client.ba4c61d.0+ba4c61d",
|
|
88
|
+
"@aws-amplify/core": "6.7.4-graphql-multi-client.ba4c61d.0+ba4c61d",
|
|
89
89
|
"@aws-amplify/data-schema": "^1.7.0",
|
|
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": "ba4c61dd1dd3014c8f3dfc1ebfc66bcf8170eaa9"
|
|
105
105
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { isApiGraphQLConfig } from './utils/runtimeTypeGuards/isApiGraphQLProviderConfig';
|
|
25
25
|
import { isConfigureEventWithResourceConfig } from './utils/runtimeTypeGuards/isConfigureEventWithResourceConfig';
|
|
26
26
|
import { cancel, graphql, isCancelError } from './v6';
|
|
27
|
-
import { ClientGenerationParams
|
|
27
|
+
import { ClientGenerationParams } from './types';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @private
|
|
@@ -37,8 +37,8 @@ import { ClientGenerationParams, CommonPublicClientOptions } from './types';
|
|
|
37
37
|
*/
|
|
38
38
|
export function generateClient<
|
|
39
39
|
T extends Record<any, any> = never,
|
|
40
|
-
Options extends
|
|
41
|
-
>(params:
|
|
40
|
+
Options extends ClientGenerationParams = ClientGenerationParams,
|
|
41
|
+
>(params: Options): V6Client<T, Options> {
|
|
42
42
|
const client = {
|
|
43
43
|
[__amplify]: params.amplify,
|
|
44
44
|
[__authMode]: params.authMode,
|
package/src/internals/index.ts
CHANGED
package/src/internals/types.ts
CHANGED
|
@@ -13,17 +13,19 @@ export type ClientGenerationParams = {
|
|
|
13
13
|
amplify: AmplifyClassV6;
|
|
14
14
|
} & CommonPublicClientOptions;
|
|
15
15
|
|
|
16
|
+
export interface DefaultCommonClientOptions {
|
|
17
|
+
endpoint?: never;
|
|
18
|
+
authMode?: GraphQLAuthMode;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
authToken?: string;
|
|
21
|
+
headers?: CustomHeaders;
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* Common options that can be used on public `generateClient()` interfaces.
|
|
18
26
|
*/
|
|
19
27
|
export type CommonPublicClientOptions =
|
|
20
|
-
|
|
|
21
|
-
endpoint?: never;
|
|
22
|
-
authMode?: GraphQLAuthMode;
|
|
23
|
-
authToken?: string;
|
|
24
|
-
apiKey?: string;
|
|
25
|
-
headers?: CustomHeaders;
|
|
26
|
-
}
|
|
28
|
+
| DefaultCommonClientOptions
|
|
27
29
|
| {
|
|
28
30
|
endpoint: string;
|
|
29
31
|
authMode: 'apiKey';
|