@aws-amplify/api 6.0.1-console-preview.11cf989.0 → 6.0.1-console-preview.4ae78ed.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/lib/API.d.ts +3 -1
- package/lib/API.js +2 -0
- package/lib/API.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/internals/InternalAPI.d.ts +0 -13
- package/lib/internals/InternalAPI.js +0 -18
- package/lib/internals/InternalAPI.js.map +1 -1
- package/lib/server.d.ts +1 -0
- package/lib/server.js +13 -0
- package/lib/server.js.map +1 -0
- package/lib-esm/API.d.ts +3 -1
- package/lib-esm/API.js +3 -1
- package/lib-esm/API.js.map +1 -1
- package/lib-esm/index.d.ts +3 -0
- package/lib-esm/index.js +1 -0
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/internals/InternalAPI.d.ts +0 -13
- package/lib-esm/internals/InternalAPI.js +0 -18
- package/lib-esm/internals/InternalAPI.js.map +1 -1
- package/lib-esm/server.d.ts +1 -0
- package/lib-esm/server.js +4 -0
- package/lib-esm/server.js.map +1 -0
- package/package.json +4 -4
- package/src/API.ts +9 -1
- package/src/index.ts +10 -0
- package/src/internals/InternalAPI.ts +0 -19
- package/src/server.ts +12 -0
package/lib/API.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AWSAppSyncRealTimeProvider, GraphQLOptions, GraphQLResult, GraphQLQuery, GraphQLSubscription } from '@aws-amplify/api-graphql';
|
|
2
|
-
import { graphql as v6graphql } from '@aws-amplify/api-graphql/internals';
|
|
2
|
+
import { graphql as v6graphql, cancel as v6cancel, isCancelError as v6isCancelError } from '@aws-amplify/api-graphql/internals';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { InternalAPIClass } from './internals/InternalAPI';
|
|
5
5
|
/**
|
|
@@ -35,6 +35,8 @@ declare type ExcludeNeverFields<O> = {
|
|
|
35
35
|
};
|
|
36
36
|
declare type V6Client<T extends Record<any, any> = never> = ExcludeNeverFields<{
|
|
37
37
|
graphql: typeof v6graphql;
|
|
38
|
+
cancel: typeof v6cancel;
|
|
39
|
+
isCancelError: typeof v6isCancelError;
|
|
38
40
|
}>;
|
|
39
41
|
export declare const API: APIClass;
|
|
40
42
|
export {};
|
package/lib/API.js
CHANGED
package/lib/API.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;;AASA,
|
|
1
|
+
{"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;;AASA,gEAI4C;AAE5C,uDAA2D;AAE3D;;;;GAIG;AACH;IAA8B,oCAAgB;IAA9C;;IA0CA,CAAC;IAzCO,gCAAa,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAoBD,0BAAO,GAAP,UACC,OAAuB,EACvB,iBAA6C;QAE7C,OAAO,iBAAM,OAAO,YAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,iCAAc,GAAd;QACC,IAAM,MAAM,GAAkB;YAC7B,OAAO,EAAE,mBAAS;YAClB,MAAM,EAAE,kBAAQ;YAChB,aAAa,EAAE,yBAAe;SAC9B,CAAC;QAEF,OAAO,MAAqB,CAAC;IAC9B,CAAC;IACF,eAAC;AAAD,CAAC,AA1CD,CAA8B,8BAAgB,GA0C7C;AA1CY,4BAAQ;AA0DR,QAAA,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { GraphQLQuery, GraphQLSubscription } from './types';
|
|
|
2
2
|
export { GraphQLAuthError } from '@aws-amplify/api-graphql';
|
|
3
3
|
export type { GraphQLResult } from '@aws-amplify/api-graphql';
|
|
4
4
|
declare const generateClient: <T extends Record<any, any> = never>() => {
|
|
5
|
+
cancel: typeof import("@aws-amplify/api-graphql/lib-esm/internals").cancel;
|
|
5
6
|
graphql: typeof import("@aws-amplify/api-graphql/lib-esm/internals").graphql;
|
|
7
|
+
isCancelError: typeof import("@aws-amplify/api-graphql/lib-esm/internals").isCancelError;
|
|
6
8
|
};
|
|
7
9
|
export { generateClient };
|
|
10
|
+
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
|
package/lib/index.js
CHANGED
|
@@ -7,4 +7,12 @@ var api_graphql_1 = require("@aws-amplify/api-graphql");
|
|
|
7
7
|
exports.GraphQLAuthError = api_graphql_1.GraphQLAuthError;
|
|
8
8
|
var generateClient = API_1.API.generateClient;
|
|
9
9
|
exports.generateClient = generateClient;
|
|
10
|
+
var api_rest_1 = require("@aws-amplify/api-rest");
|
|
11
|
+
exports.get = api_rest_1.get;
|
|
12
|
+
exports.put = api_rest_1.put;
|
|
13
|
+
exports.post = api_rest_1.post;
|
|
14
|
+
exports.del = api_rest_1.del;
|
|
15
|
+
exports.head = api_rest_1.head;
|
|
16
|
+
exports.patch = api_rest_1.patch;
|
|
17
|
+
exports.isCancelError = api_rest_1.isCancelError;
|
|
10
18
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAKtC,6BAA4B;AAE5B,wDAA4D;AAAnD,yCAAA,gBAAgB,CAAA;AAIzB,IAAM,cAAc,GAAG,SAAG,CAAC,cAAc,CAAC;AAEjC,wCAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAKtC,6BAA4B;AAE5B,wDAA4D;AAAnD,yCAAA,gBAAgB,CAAA;AAIzB,IAAM,cAAc,GAAG,SAAG,CAAC,cAAc,CAAC;AAEjC,wCAAc;AAEvB,kDAQ+B;AAP9B,yBAAA,GAAG,CAAA;AACH,yBAAA,GAAG,CAAA;AACH,0BAAA,IAAI,CAAA;AACJ,yBAAA,GAAG,CAAA;AACH,0BAAA,IAAI,CAAA;AACJ,2BAAA,KAAK,CAAA;AACL,mCAAA,aAAa,CAAA"}
|
|
@@ -20,19 +20,6 @@ export declare class InternalAPIClass {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(options: any);
|
|
22
22
|
getModuleName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
25
|
-
* @param error - Any error
|
|
26
|
-
* @return If the error was from an api request cancellation
|
|
27
|
-
*/
|
|
28
|
-
isCancel(error: any): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Cancels an inflight request for either a GraphQL request or a Rest API request.
|
|
31
|
-
* @param request - request to cancel
|
|
32
|
-
* @param [message] - custom error message
|
|
33
|
-
* @return If the request was cancelled
|
|
34
|
-
*/
|
|
35
|
-
cancel(request: Promise<any>, message?: string): boolean;
|
|
36
23
|
/**
|
|
37
24
|
* to get the operation type
|
|
38
25
|
* @param operation
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var internals_1 = require("@aws-amplify/api-graphql/internals");
|
|
5
|
-
var api_rest_1 = require("@aws-amplify/api-rest");
|
|
6
5
|
var core_1 = require("@aws-amplify/core");
|
|
7
6
|
var utils_1 = require("@aws-amplify/core/internals/utils");
|
|
8
7
|
var logger = new utils_1.ConsoleLogger('API');
|
|
@@ -25,23 +24,6 @@ var InternalAPIClass = /** @class */ (function () {
|
|
|
25
24
|
InternalAPIClass.prototype.getModuleName = function () {
|
|
26
25
|
return 'InternalAPI';
|
|
27
26
|
};
|
|
28
|
-
/**
|
|
29
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
30
|
-
* @param error - Any error
|
|
31
|
-
* @return If the error was from an api request cancellation
|
|
32
|
-
*/
|
|
33
|
-
InternalAPIClass.prototype.isCancel = function (error) {
|
|
34
|
-
return api_rest_1.isCancel(error);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Cancels an inflight request for either a GraphQL request or a Rest API request.
|
|
38
|
-
* @param request - request to cancel
|
|
39
|
-
* @param [message] - custom error message
|
|
40
|
-
* @return If the request was cancelled
|
|
41
|
-
*/
|
|
42
|
-
InternalAPIClass.prototype.cancel = function (request, message) {
|
|
43
|
-
return api_rest_1.cancel(request, message);
|
|
44
|
-
};
|
|
45
27
|
/**
|
|
46
28
|
* to get the operation type
|
|
47
29
|
* @param operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAPI.js","sourceRoot":"","sources":["../../src/internals/InternalAPI.ts"],"names":[],"mappings":";;;AAWA,gEAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"InternalAPI.js","sourceRoot":"","sources":["../../src/internals/InternalAPI.ts"],"names":[],"mappings":";;;AAWA,gEAA6E;AAC7E,0CAA0C;AAC1C,2DAK2C;AAG3C,IAAM,MAAM,GAAG,IAAI,qBAAM,CAAC,KAAK,CAAC,CAAC;AACjC;;;;GAIG;AACH;IAUC;;;OAGG;IACH,0BAAY,OAAO;QANnB,UAAK,GAAG,YAAK,CAAC;QAOb,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,mCAAuB,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,wCAAa,GAApB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,kDAAuB,GAAvB,UAAwB,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAqBD,kCAAO,GAAP,UACC,OAAuB,EACvB,iBAA6C,EAC7C,sBAA+C;QAE/C,IAAM,mBAAmB,sBACxB,QAAQ,EAAE,gBAAQ,CAAC,GAAG,EACtB,MAAM,EAAE,iBAAS,CAAC,OAAO,IACtB,sBAAsB,CACzB,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC9B,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;IACF,uBAAC;AAAD,CAAC,AApED,IAoEC;AApEY,4CAAgB;AAsEhB,QAAA,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
|
package/lib/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
|
package/lib/server.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
var server_1 = require("@aws-amplify/api-rest/server");
|
|
6
|
+
exports.get = server_1.get;
|
|
7
|
+
exports.put = server_1.put;
|
|
8
|
+
exports.post = server_1.post;
|
|
9
|
+
exports.del = server_1.del;
|
|
10
|
+
exports.head = server_1.head;
|
|
11
|
+
exports.patch = server_1.patch;
|
|
12
|
+
exports.isCancelError = server_1.isCancelError;
|
|
13
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,uDAQsC;AAPrC,uBAAA,GAAG,CAAA;AACH,uBAAA,GAAG,CAAA;AACH,wBAAA,IAAI,CAAA;AACJ,uBAAA,GAAG,CAAA;AACH,wBAAA,IAAI,CAAA;AACJ,yBAAA,KAAK,CAAA;AACL,iCAAA,aAAa,CAAA"}
|
package/lib-esm/API.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AWSAppSyncRealTimeProvider, GraphQLOptions, GraphQLResult, GraphQLQuery, GraphQLSubscription } from '@aws-amplify/api-graphql';
|
|
2
|
-
import { graphql as v6graphql } from '@aws-amplify/api-graphql/internals';
|
|
2
|
+
import { graphql as v6graphql, cancel as v6cancel, isCancelError as v6isCancelError } from '@aws-amplify/api-graphql/internals';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { InternalAPIClass } from './internals/InternalAPI';
|
|
5
5
|
/**
|
|
@@ -35,6 +35,8 @@ declare type ExcludeNeverFields<O> = {
|
|
|
35
35
|
};
|
|
36
36
|
declare type V6Client<T extends Record<any, any> = never> = ExcludeNeverFields<{
|
|
37
37
|
graphql: typeof v6graphql;
|
|
38
|
+
cancel: typeof v6cancel;
|
|
39
|
+
isCancelError: typeof v6isCancelError;
|
|
38
40
|
}>;
|
|
39
41
|
export declare const API: APIClass;
|
|
40
42
|
export {};
|
package/lib-esm/API.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
-
import { graphql as v6graphql } from '@aws-amplify/api-graphql/internals';
|
|
2
|
+
import { graphql as v6graphql, cancel as v6cancel, isCancelError as v6isCancelError, } from '@aws-amplify/api-graphql/internals';
|
|
3
3
|
import { InternalAPIClass } from './internals/InternalAPI';
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated
|
|
@@ -23,6 +23,8 @@ var APIClass = /** @class */ (function (_super) {
|
|
|
23
23
|
APIClass.prototype.generateClient = function () {
|
|
24
24
|
var client = {
|
|
25
25
|
graphql: v6graphql,
|
|
26
|
+
cancel: v6cancel,
|
|
27
|
+
isCancelError: v6isCancelError,
|
|
26
28
|
};
|
|
27
29
|
return client;
|
|
28
30
|
};
|
package/lib-esm/API.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";AASA,OAAO,EACN,OAAO,IAAI,SAAS,EACpB,MAAM,IAAI,QAAQ,EAClB,aAAa,IAAI,eAAe,GAChC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH;IAA8B,4BAAgB;IAA9C;;IA0CA,CAAC;IAzCO,gCAAa,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAoBD,0BAAO,GAAP,UACC,OAAuB,EACvB,iBAA6C;QAE7C,OAAO,iBAAM,OAAO,YAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,iCAAc,GAAd;QACC,IAAM,MAAM,GAAkB;YAC7B,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,QAAQ;YAChB,aAAa,EAAE,eAAe;SAC9B,CAAC;QAEF,OAAO,MAAqB,CAAC;IAC9B,CAAC;IACF,eAAC;AAAD,CAAC,AA1CD,CAA8B,gBAAgB,GA0C7C;;AAgBD,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC"}
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { GraphQLQuery, GraphQLSubscription } from './types';
|
|
|
2
2
|
export { GraphQLAuthError } from '@aws-amplify/api-graphql';
|
|
3
3
|
export type { GraphQLResult } from '@aws-amplify/api-graphql';
|
|
4
4
|
declare const generateClient: <T extends Record<any, any> = never>() => {
|
|
5
|
+
cancel: typeof import("@aws-amplify/api-graphql/lib-esm/internals").cancel;
|
|
5
6
|
graphql: typeof import("@aws-amplify/api-graphql/lib-esm/internals").graphql;
|
|
7
|
+
isCancelError: typeof import("@aws-amplify/api-graphql/lib-esm/internals").isCancelError;
|
|
6
8
|
};
|
|
7
9
|
export { generateClient };
|
|
10
|
+
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
|
package/lib-esm/index.js
CHANGED
|
@@ -4,4 +4,5 @@ import { API } from './API';
|
|
|
4
4
|
export { GraphQLAuthError } from '@aws-amplify/api-graphql';
|
|
5
5
|
var generateClient = API.generateClient;
|
|
6
6
|
export { generateClient };
|
|
7
|
+
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/lib-esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,IAAM,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,IAAM,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,OAAO,EACN,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,GACb,MAAM,uBAAuB,CAAC"}
|
|
@@ -20,19 +20,6 @@ export declare class InternalAPIClass {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(options: any);
|
|
22
22
|
getModuleName(): string;
|
|
23
|
-
/**
|
|
24
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
25
|
-
* @param error - Any error
|
|
26
|
-
* @return If the error was from an api request cancellation
|
|
27
|
-
*/
|
|
28
|
-
isCancel(error: any): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Cancels an inflight request for either a GraphQL request or a Rest API request.
|
|
31
|
-
* @param request - request to cancel
|
|
32
|
-
* @param [message] - custom error message
|
|
33
|
-
* @return If the request was cancelled
|
|
34
|
-
*/
|
|
35
|
-
cancel(request: Promise<any>, message?: string): boolean;
|
|
36
23
|
/**
|
|
37
24
|
* to get the operation type
|
|
38
25
|
* @param operation
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
|
|
3
|
-
import { cancel, isCancel } from '@aws-amplify/api-rest';
|
|
4
3
|
import { Cache } from '@aws-amplify/core';
|
|
5
4
|
import { ApiAction, Category, ConsoleLogger as Logger, } from '@aws-amplify/core/internals/utils';
|
|
6
5
|
var logger = new Logger('API');
|
|
@@ -23,23 +22,6 @@ var InternalAPIClass = /** @class */ (function () {
|
|
|
23
22
|
InternalAPIClass.prototype.getModuleName = function () {
|
|
24
23
|
return 'InternalAPI';
|
|
25
24
|
};
|
|
26
|
-
/**
|
|
27
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
28
|
-
* @param error - Any error
|
|
29
|
-
* @return If the error was from an api request cancellation
|
|
30
|
-
*/
|
|
31
|
-
InternalAPIClass.prototype.isCancel = function (error) {
|
|
32
|
-
return isCancel(error);
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Cancels an inflight request for either a GraphQL request or a Rest API request.
|
|
36
|
-
* @param request - request to cancel
|
|
37
|
-
* @param [message] - custom error message
|
|
38
|
-
* @return If the request was cancelled
|
|
39
|
-
*/
|
|
40
|
-
InternalAPIClass.prototype.cancel = function (request, message) {
|
|
41
|
-
return cancel(request, message);
|
|
42
|
-
};
|
|
43
25
|
/**
|
|
44
26
|
* to get the operation type
|
|
45
27
|
* @param operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAPI.js","sourceRoot":"","sources":["../../src/internals/InternalAPI.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InternalAPI.js","sourceRoot":"","sources":["../../src/internals/InternalAPI.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACN,SAAS,EACT,QAAQ,EACR,aAAa,IAAI,MAAM,GAEvB,MAAM,mCAAmC,CAAC;AAG3C,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC;;;;GAIG;AACH;IAUC;;;OAGG;IACH,0BAAY,OAAO;QANnB,UAAK,GAAG,KAAK,CAAC;QAOb,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,wCAAa,GAApB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,kDAAuB,GAAvB,UAAwB,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAqBD,kCAAO,GAAP,UACC,OAAuB,EACvB,iBAA6C,EAC7C,sBAA+C;QAE/C,IAAM,mBAAmB,cACxB,QAAQ,EAAE,QAAQ,CAAC,GAAG,EACtB,MAAM,EAAE,SAAS,CAAC,OAAO,IACtB,sBAAsB,CACzB,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC9B,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;IACF,uBAAC;AAAD,CAAC,AApED,IAoEC;;AAED,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EACN,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,GACb,MAAM,8BAA8B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api",
|
|
3
|
-
"version": "6.0.1-console-preview.
|
|
3
|
+
"version": "6.0.1-console-preview.4ae78ed.0+4ae78ed",
|
|
4
4
|
"description": "Api category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"internals"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@aws-amplify/api-graphql": "4.0.1-console-preview.
|
|
62
|
-
"@aws-amplify/api-rest": "4.0.1-console-preview.
|
|
61
|
+
"@aws-amplify/api-graphql": "4.0.1-console-preview.4ae78ed.0+4ae78ed",
|
|
62
|
+
"@aws-amplify/api-rest": "4.0.1-console-preview.4ae78ed.0+4ae78ed",
|
|
63
63
|
"tslib": "^2.6.1"
|
|
64
64
|
},
|
|
65
65
|
"size-limit": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"lib-esm"
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "4ae78ed23fc03ae718488c98fc48782d2bd6f5f3"
|
|
118
118
|
}
|
package/src/API.ts
CHANGED
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
GraphQLQuery,
|
|
8
8
|
GraphQLSubscription,
|
|
9
9
|
} from '@aws-amplify/api-graphql';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
graphql as v6graphql,
|
|
12
|
+
cancel as v6cancel,
|
|
13
|
+
isCancelError as v6isCancelError,
|
|
14
|
+
} from '@aws-amplify/api-graphql/internals';
|
|
11
15
|
import { Observable } from 'rxjs';
|
|
12
16
|
import { InternalAPIClass } from './internals/InternalAPI';
|
|
13
17
|
|
|
@@ -52,6 +56,8 @@ export class APIClass extends InternalAPIClass {
|
|
|
52
56
|
generateClient<T extends Record<any, any> = never>(): V6Client<T> {
|
|
53
57
|
const client: V6Client<any> = {
|
|
54
58
|
graphql: v6graphql,
|
|
59
|
+
cancel: v6cancel,
|
|
60
|
+
isCancelError: v6isCancelError,
|
|
55
61
|
};
|
|
56
62
|
|
|
57
63
|
return client as V6Client<T>;
|
|
@@ -68,6 +74,8 @@ type ExcludeNeverFields<O> = {
|
|
|
68
74
|
// If no T is passed, ExcludeNeverFields removes "models" from the client
|
|
69
75
|
declare type V6Client<T extends Record<any, any> = never> = ExcludeNeverFields<{
|
|
70
76
|
graphql: typeof v6graphql;
|
|
77
|
+
cancel: typeof v6cancel;
|
|
78
|
+
isCancelError: typeof v6isCancelError;
|
|
71
79
|
}>;
|
|
72
80
|
|
|
73
81
|
export const API = new APIClass(null);
|
package/src/index.ts
CHANGED
|
@@ -13,3 +13,13 @@ export type { GraphQLResult } from '@aws-amplify/api-graphql';
|
|
|
13
13
|
const generateClient = API.generateClient;
|
|
14
14
|
|
|
15
15
|
export { generateClient };
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
get,
|
|
19
|
+
put,
|
|
20
|
+
post,
|
|
21
|
+
del,
|
|
22
|
+
head,
|
|
23
|
+
patch,
|
|
24
|
+
isCancelError,
|
|
25
|
+
} from '@aws-amplify/api-rest';
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
GraphQLSubscription,
|
|
11
11
|
} from '@aws-amplify/api-graphql';
|
|
12
12
|
import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
|
|
13
|
-
import { cancel, isCancel } from '@aws-amplify/api-rest';
|
|
14
13
|
import { Cache } from '@aws-amplify/core';
|
|
15
14
|
import {
|
|
16
15
|
ApiAction,
|
|
@@ -50,24 +49,6 @@ export class InternalAPIClass {
|
|
|
50
49
|
return 'InternalAPI';
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
/**
|
|
54
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
55
|
-
* @param error - Any error
|
|
56
|
-
* @return If the error was from an api request cancellation
|
|
57
|
-
*/
|
|
58
|
-
isCancel(error: any): boolean {
|
|
59
|
-
return isCancel(error);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Cancels an inflight request for either a GraphQL request or a Rest API request.
|
|
63
|
-
* @param request - request to cancel
|
|
64
|
-
* @param [message] - custom error message
|
|
65
|
-
* @return If the request was cancelled
|
|
66
|
-
*/
|
|
67
|
-
cancel(request: Promise<any>, message?: string): boolean {
|
|
68
|
-
return cancel(request, message);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
52
|
/**
|
|
72
53
|
* to get the operation type
|
|
73
54
|
* @param operation
|
package/src/server.ts
ADDED