@aws-amplify/api 6.0.17-unstable.e316a2e.0 → 6.0.17
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/InternalAPI.js +0 -1
- package/dist/cjs/internals/InternalAPI.js.map +1 -1
- package/dist/esm/API.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/internals/InternalAPI.d.ts +9 -1
- package/dist/esm/internals/InternalAPI.mjs +1 -2
- package/dist/esm/internals/InternalAPI.mjs.map +1 -1
- package/package.json +6 -5
- package/src/API.ts +2 -2
- package/src/index.ts +2 -2
- package/src/internals/InternalAPI.ts +11 -11
|
@@ -13,7 +13,6 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
13
13
|
* This can probably be pruned and/or removed. Just leaving it as much of the same
|
|
14
14
|
* state as possible for V6 to reduce number of potentially impactful changes to DataStore.
|
|
15
15
|
*/
|
|
16
|
-
new core_1.ConsoleLogger('API');
|
|
17
16
|
/**
|
|
18
17
|
* @deprecated
|
|
19
18
|
* Use RestApi or GraphQLAPI to reduce your application bundle size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAPI.js","sources":["../../../src/internals/InternalAPI.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InternalAPI = exports.InternalAPIClass = void 0;\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\n/**\n * NOTE!\n *\n * This is used only by DataStore.\n *\n * This can probably be pruned and/or removed. Just leaving it as much of the same\n * state as possible for V6 to reduce number of potentially impactful changes to DataStore.\n */\
|
|
1
|
+
{"version":3,"file":"InternalAPI.js","sources":["../../../src/internals/InternalAPI.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InternalAPI = exports.InternalAPIClass = void 0;\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\n/**\n * NOTE!\n *\n * This is used only by DataStore.\n *\n * This can probably be pruned and/or removed. Just leaving it as much of the same\n * state as possible for V6 to reduce number of potentially impactful changes to DataStore.\n */\n/**\n * @deprecated\n * Use RestApi or GraphQLAPI to reduce your application bundle size\n * Export Cloud Logic APIs\n */\nclass InternalAPIClass {\n /**\n * Initialize API\n */\n constructor() {\n this.Cache = core_1.Cache;\n this._graphqlApi = new internals_1.InternalGraphQLAPIClass();\n }\n getModuleName() {\n return 'InternalAPI';\n }\n /**\n * to get the operation type\n * @param operation\n */\n getGraphqlOperationType(operation) {\n return this._graphqlApi.getGraphqlOperationType(operation);\n }\n graphql(options, additionalHeaders, customUserAgentDetails) {\n const apiUserAgentDetails = {\n category: utils_1.Category.API,\n action: utils_1.ApiAction.GraphQl,\n ...customUserAgentDetails,\n };\n return this._graphqlApi.graphql(core_1.Amplify, options, additionalHeaders, apiUserAgentDetails);\n }\n}\nexports.InternalAPIClass = InternalAPIClass;\nexports.InternalAPI = new InternalAPIClass();\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AACxD,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,CAAC;AACvB;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAClC,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,EAAE,CAAC;AACrE,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,OAAO,aAAa,CAAC;AAC7B,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,uBAAuB,CAAC,SAAS,EAAE;AACvC,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACnE,KAAK;AACL,IAAI,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE;AAChE,QAAQ,MAAM,mBAAmB,GAAG;AACpC,YAAY,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;AAC1C,YAAY,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO;AAC7C,YAAY,GAAG,sBAAsB;AACrC,SAAS,CAAC;AACV,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AACzG,KAAK;AACL,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAC5C,OAAO,CAAC,WAAW,GAAG,IAAI,gBAAgB,EAAE;;"}
|
package/dist/esm/API.d.ts
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
1
2
|
export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
|
|
2
3
|
export { generateClient } from './API';
|
|
3
4
|
export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
|
|
4
5
|
export type { GraphQLResult, GraphQLReturnType, } from '@aws-amplify/api-graphql';
|
|
5
6
|
export { CONNECTION_STATE_CHANGE } from '@aws-amplify/api-graphql';
|
|
6
|
-
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
7
7
|
type Client<T extends Record<any, any> = never> = V6Client<T>;
|
|
8
8
|
export { Client };
|
|
9
9
|
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { AWSAppSyncRealTimeProvider, GraphQLOperation, GraphQLOptions,
|
|
1
|
+
import { AWSAppSyncRealTimeProvider, GraphQLOperation, GraphQLOptions, GraphQLQuery, GraphQLResult, GraphQLSubscription, OperationTypeNode } from '@aws-amplify/api-graphql';
|
|
2
2
|
import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { CustomHeaders } from '@aws-amplify/data-schema-types';
|
|
5
|
+
/**
|
|
6
|
+
* NOTE!
|
|
7
|
+
*
|
|
8
|
+
* This is used only by DataStore.
|
|
9
|
+
*
|
|
10
|
+
* This can probably be pruned and/or removed. Just leaving it as much of the same
|
|
11
|
+
* state as possible for V6 to reduce number of potentially impactful changes to DataStore.
|
|
12
|
+
*/
|
|
5
13
|
/**
|
|
6
14
|
* @deprecated
|
|
7
15
|
* Use RestApi or GraphQLAPI to reduce your application bundle size
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
|
|
2
|
-
import {
|
|
2
|
+
import { Cache, Amplify } from '@aws-amplify/core';
|
|
3
3
|
import { Category, ApiAction } from '@aws-amplify/core/internals/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -10,7 +10,6 @@ import { Category, ApiAction } from '@aws-amplify/core/internals/utils';
|
|
|
10
10
|
* This can probably be pruned and/or removed. Just leaving it as much of the same
|
|
11
11
|
* state as possible for V6 to reduce number of potentially impactful changes to DataStore.
|
|
12
12
|
*/
|
|
13
|
-
new ConsoleLogger('API');
|
|
14
13
|
/**
|
|
15
14
|
* @deprecated
|
|
16
15
|
* Use RestApi or GraphQLAPI to reduce your application bundle size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAPI.mjs","sources":["../../../src/internals/InternalAPI.ts"],"sourcesContent":["import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';\nimport { Amplify, Cache
|
|
1
|
+
{"version":3,"file":"InternalAPI.mjs","sources":["../../../src/internals/InternalAPI.ts"],"sourcesContent":["import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';\nimport { Amplify, Cache } from '@aws-amplify/core';\nimport { ApiAction, Category, } from '@aws-amplify/core/internals/utils';\n/**\n * NOTE!\n *\n * This is used only by DataStore.\n *\n * This can probably be pruned and/or removed. Just leaving it as much of the same\n * state as possible for V6 to reduce number of potentially impactful changes to DataStore.\n */\n/**\n * @deprecated\n * Use RestApi or GraphQLAPI to reduce your application bundle size\n * Export Cloud Logic APIs\n */\nexport class InternalAPIClass {\n /**\n * Initialize API\n */\n constructor() {\n this.Cache = Cache;\n this._graphqlApi = new InternalGraphQLAPIClass();\n }\n getModuleName() {\n return 'InternalAPI';\n }\n /**\n * to get the operation type\n * @param operation\n */\n getGraphqlOperationType(operation) {\n return this._graphqlApi.getGraphqlOperationType(operation);\n }\n graphql(options, additionalHeaders, customUserAgentDetails) {\n const apiUserAgentDetails = {\n category: Category.API,\n action: ApiAction.GraphQl,\n ...customUserAgentDetails,\n };\n return this._graphqlApi.graphql(Amplify, options, additionalHeaders, apiUserAgentDetails);\n }\n}\nexport const InternalAPI = new InternalAPIClass();\n"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,gBAAgB,CAAC;AAC9B;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAuB,EAAE,CAAC;AACzD,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,OAAO,aAAa,CAAC;AAC7B,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,uBAAuB,CAAC,SAAS,EAAE;AACvC,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AACnE,KAAK;AACL,IAAI,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE;AAChE,QAAQ,MAAM,mBAAmB,GAAG;AACpC,YAAY,QAAQ,EAAE,QAAQ,CAAC,GAAG;AAClC,YAAY,MAAM,EAAE,SAAS,CAAC,OAAO;AACrC,YAAY,GAAG,sBAAsB;AACrC,SAAS,CAAC;AACV,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AAClG,KAAK;AACL,CAAC;AACW,MAAC,WAAW,GAAG,IAAI,gBAAgB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api",
|
|
3
|
-
"version": "6.0.17
|
|
3
|
+
"version": "6.0.17",
|
|
4
4
|
"description": "Api category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
24
24
|
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
25
25
|
"format": "echo \"Not implemented\"",
|
|
26
|
-
"lint": "
|
|
26
|
+
"lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
|
|
27
|
+
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
27
28
|
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88"
|
|
28
29
|
},
|
|
29
30
|
"exports": {
|
|
@@ -78,9 +79,9 @@
|
|
|
78
79
|
"server"
|
|
79
80
|
],
|
|
80
81
|
"dependencies": {
|
|
81
|
-
"@aws-amplify/api-graphql": "4.0.17
|
|
82
|
-
"@aws-amplify/api-rest": "4.0.17
|
|
82
|
+
"@aws-amplify/api-graphql": "4.0.17",
|
|
83
|
+
"@aws-amplify/api-rest": "4.0.17",
|
|
83
84
|
"tslib": "^2.5.0"
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "c54a19c8a654a47d559cb0fd41c74bd2c3eb79ca"
|
|
86
87
|
}
|
package/src/API.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
3
|
+
import { CommonPublicClientOptions, V6Client } from '@aws-amplify/api-graphql';
|
|
4
4
|
import { generateClient as internalGenerateClient } from '@aws-amplify/api-graphql/internals';
|
|
5
5
|
import { Amplify } from '@aws-amplify/core';
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ import { Amplify } from '@aws-amplify/core';
|
|
|
8
8
|
* Generates an API client that can work with models or raw GraphQL
|
|
9
9
|
*/
|
|
10
10
|
export function generateClient<T extends Record<any, any> = never>(
|
|
11
|
-
options: CommonPublicClientOptions = {}
|
|
11
|
+
options: CommonPublicClientOptions = {},
|
|
12
12
|
): V6Client<T> {
|
|
13
13
|
return internalGenerateClient({
|
|
14
14
|
...options,
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
5
|
+
|
|
4
6
|
export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
|
|
5
7
|
export { generateClient } from './API';
|
|
6
8
|
|
|
@@ -13,8 +15,6 @@ export type {
|
|
|
13
15
|
|
|
14
16
|
export { CONNECTION_STATE_CHANGE } from '@aws-amplify/api-graphql';
|
|
15
17
|
|
|
16
|
-
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
17
|
-
|
|
18
18
|
// explicitly defaulting to `never` here resolves
|
|
19
19
|
// TS2589: Type instantiation is excessively deep and possibly infinite.
|
|
20
20
|
// When this type is used without a generic type arg, i.e. `let client: Client`
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
AWSAppSyncRealTimeProvider,
|
|
5
5
|
GraphQLOperation,
|
|
6
6
|
GraphQLOptions,
|
|
7
|
-
GraphQLResult,
|
|
8
|
-
OperationTypeNode,
|
|
9
7
|
GraphQLQuery,
|
|
8
|
+
GraphQLResult,
|
|
10
9
|
GraphQLSubscription,
|
|
10
|
+
OperationTypeNode,
|
|
11
11
|
} from '@aws-amplify/api-graphql';
|
|
12
12
|
import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
|
|
13
|
-
import { Amplify, Cache
|
|
13
|
+
import { Amplify, Cache } from '@aws-amplify/core';
|
|
14
14
|
import {
|
|
15
15
|
ApiAction,
|
|
16
16
|
Category,
|
|
@@ -28,7 +28,6 @@ import { CustomHeaders } from '@aws-amplify/data-schema-types';
|
|
|
28
28
|
* state as possible for V6 to reduce number of potentially impactful changes to DataStore.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
const logger = new ConsoleLogger('API');
|
|
32
31
|
/**
|
|
33
32
|
* @deprecated
|
|
34
33
|
* Use RestApi or GraphQLAPI to reduce your application bundle size
|
|
@@ -68,19 +67,20 @@ export class InternalAPIClass {
|
|
|
68
67
|
graphql<T>(
|
|
69
68
|
options: GraphQLOptions,
|
|
70
69
|
additionalHeaders?: CustomHeaders,
|
|
71
|
-
customUserAgentDetails?: CustomUserAgentDetails
|
|
70
|
+
customUserAgentDetails?: CustomUserAgentDetails,
|
|
72
71
|
): T extends GraphQLQuery<T>
|
|
73
72
|
? Promise<GraphQLResult<T>>
|
|
74
73
|
: T extends GraphQLSubscription<T>
|
|
75
|
-
|
|
74
|
+
? Observable<{
|
|
76
75
|
provider: AWSAppSyncRealTimeProvider;
|
|
77
76
|
value: GraphQLResult<T>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
}>
|
|
78
|
+
: Promise<GraphQLResult<any>> | Observable<object>;
|
|
79
|
+
|
|
80
|
+
graphql<_ = any>(
|
|
81
81
|
options: GraphQLOptions,
|
|
82
82
|
additionalHeaders?: CustomHeaders,
|
|
83
|
-
customUserAgentDetails?: CustomUserAgentDetails
|
|
83
|
+
customUserAgentDetails?: CustomUserAgentDetails,
|
|
84
84
|
): Promise<GraphQLResult<any>> | Observable<object> {
|
|
85
85
|
const apiUserAgentDetails: CustomUserAgentDetails = {
|
|
86
86
|
category: Category.API,
|
|
@@ -92,7 +92,7 @@ export class InternalAPIClass {
|
|
|
92
92
|
Amplify,
|
|
93
93
|
options,
|
|
94
94
|
additionalHeaders,
|
|
95
|
-
apiUserAgentDetails
|
|
95
|
+
apiUserAgentDetails,
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
}
|