@aws-amplify/api 4.0.61 → 4.0.62-unstable.2

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/CHANGELOG.md CHANGED
@@ -3,14 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.0.61](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.60...@aws-amplify/api@4.0.61) (2022-11-04)
7
-
8
- **Note:** Version bump only for package @aws-amplify/api
9
-
10
-
11
-
12
-
13
-
14
6
  ## [4.0.60](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@4.0.59...@aws-amplify/api@4.0.60) (2022-10-27)
15
7
 
16
8
  **Note:** Version bump only for package @aws-amplify/api
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "3.8.3"
3
+ }
package/lib/API.d.ts ADDED
@@ -0,0 +1,131 @@
1
+ import { AWSAppSyncRealTimeProvider } from '@aws-amplify/pubsub';
2
+ import { GraphQLOptions, GraphQLResult, GraphQLOperation, OperationTypeNode } from '@aws-amplify/api-graphql';
3
+ import Observable from 'zen-observable-ts';
4
+ import { GraphQLQuery, GraphQLSubscription } from './types';
5
+ /**
6
+ * @deprecated
7
+ * Use RestApi or GraphQLAPI to reduce your application bundle size
8
+ * Export Cloud Logic APIs
9
+ */
10
+ export declare class APIClass {
11
+ /**
12
+ * Initialize API with AWS configuration
13
+ * @param {Object} options - Configuration object for API
14
+ */
15
+ private _options;
16
+ private _restApi;
17
+ private _graphqlApi;
18
+ Auth: import("@aws-amplify/auth/lib-esm/Auth").AuthClass;
19
+ Cache: import("@aws-amplify/cache/lib-esm/types").ICache;
20
+ Credentials: import("@aws-amplify/core").CredentialsClass;
21
+ /**
22
+ * Initialize API with AWS configuration
23
+ * @param {Object} options - Configuration object for API
24
+ */
25
+ constructor(options: any);
26
+ getModuleName(): string;
27
+ /**
28
+ * Configure API part with aws configurations
29
+ * @param {Object} config - Configuration of the API
30
+ * @return {Object} - The current configuration
31
+ */
32
+ configure(options: any): any;
33
+ /**
34
+ * Make a GET request
35
+ * @param apiName - The api name of the request
36
+ * @param path - The path of the request
37
+ * @param [init] - Request extra params
38
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
39
+ */
40
+ get(apiName: string, path: string, init: {
41
+ [key: string]: any;
42
+ }): Promise<any>;
43
+ /**
44
+ * Make a POST request
45
+ * @param apiName - The api name of the request
46
+ * @param path - The path of the request
47
+ * @param [init] - Request extra params
48
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
49
+ */
50
+ post(apiName: string, path: string, init: {
51
+ [key: string]: any;
52
+ }): Promise<any>;
53
+ /**
54
+ * Make a PUT request
55
+ * @param apiName - The api name of the request
56
+ * @param path - The path of the request
57
+ * @param [init] - Request extra params
58
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
59
+ */
60
+ put(apiName: string, path: string, init: {
61
+ [key: string]: any;
62
+ }): Promise<any>;
63
+ /**
64
+ * Make a PATCH request
65
+ * @param apiName - The api name of the request
66
+ * @param path - The path of the request
67
+ * @param [init] - Request extra params
68
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
69
+ */
70
+ patch(apiName: string, path: string, init: {
71
+ [key: string]: any;
72
+ }): Promise<any>;
73
+ /**
74
+ * Make a DEL request
75
+ * @param apiName - The api name of the request
76
+ * @param path - The path of the request
77
+ * @param [init] - Request extra params
78
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
79
+ */
80
+ del(apiName: string, path: string, init: {
81
+ [key: string]: any;
82
+ }): Promise<any>;
83
+ /**
84
+ * Make a HEAD request
85
+ * @param apiName - The api name of the request
86
+ * @param path - The path of the request
87
+ * @param [init] - Request extra params
88
+ * @return A promise that resolves to an object with response status and JSON data, if successful.
89
+ */
90
+ head(apiName: string, path: string, init: {
91
+ [key: string]: any;
92
+ }): Promise<any>;
93
+ /**
94
+ * Checks to see if an error thrown is from an api request cancellation
95
+ * @param error - Any error
96
+ * @return If the error was from an api request cancellation
97
+ */
98
+ isCancel(error: any): boolean;
99
+ /**
100
+ * Cancels an inflight request for either a GraphQL request or a Rest API request.
101
+ * @param request - request to cancel
102
+ * @param [message] - custom error message
103
+ * @return If the request was cancelled
104
+ */
105
+ cancel(request: Promise<any>, message?: string): boolean;
106
+ /**
107
+ * Getting endpoint for API
108
+ * @param apiName - The name of the api
109
+ * @return The endpoint of the api
110
+ */
111
+ endpoint(apiName: string): Promise<string>;
112
+ /**
113
+ * to get the operation type
114
+ * @param operation
115
+ */
116
+ getGraphqlOperationType(operation: GraphQLOperation): OperationTypeNode;
117
+ /**
118
+ * Executes a GraphQL operation
119
+ *
120
+ * @param options - GraphQL Options
121
+ * @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config
122
+ * @returns An Observable if queryType is 'subscription', else a promise of the graphql result from the query.
123
+ */
124
+ graphql<T>(options: GraphQLOptions, additionalHeaders?: {
125
+ [key: string]: string;
126
+ }): T extends GraphQLQuery<T> ? Promise<GraphQLResult<T>> : T extends GraphQLSubscription<T> ? Observable<{
127
+ provider: AWSAppSyncRealTimeProvider;
128
+ value: GraphQLResult<T>;
129
+ }> : Promise<GraphQLResult<any>> | Observable<object>;
130
+ }
131
+ export declare const API: APIClass;
package/lib/API.js CHANGED
@@ -1,69 +1,10 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
2
  Object.defineProperty(exports, "__esModule", { value: true });
53
- /*
54
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
- *
56
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
57
- * the License. A copy of the License is located at
58
- *
59
- * http://aws.amazon.com/apache2.0/
60
- *
61
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
62
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
63
- * and limitations under the License.
64
- */
3
+ var tslib_1 = require("tslib");
4
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ // SPDX-License-Identifier: Apache-2.0
65
6
  var auth_1 = require("@aws-amplify/auth");
66
- var cache_1 = __importDefault(require("@aws-amplify/cache"));
7
+ var cache_1 = require("@aws-amplify/cache");
67
8
  var api_rest_1 = require("@aws-amplify/api-rest");
68
9
  var api_graphql_1 = require("@aws-amplify/api-graphql");
69
10
  var core_1 = require("@aws-amplify/core");
@@ -80,7 +21,7 @@ var APIClass = /** @class */ (function () {
80
21
  */
81
22
  function APIClass(options) {
82
23
  this.Auth = auth_1.Auth;
83
- this.Cache = cache_1.default;
24
+ this.Cache = cache_1.Cache;
84
25
  this.Credentials = core_1.Credentials;
85
26
  this._options = options;
86
27
  this._restApi = new api_rest_1.RestAPIClass(options);
@@ -104,7 +45,7 @@ var APIClass = /** @class */ (function () {
104
45
  this._graphqlApi.Credentials = this.Credentials;
105
46
  var restAPIConfig = this._restApi.configure(this._options);
106
47
  var graphQLAPIConfig = this._graphqlApi.configure(this._options);
107
- return __assign(__assign({}, restAPIConfig), graphQLAPIConfig);
48
+ return tslib_1.__assign(tslib_1.__assign({}, restAPIConfig), graphQLAPIConfig);
108
49
  };
109
50
  /**
110
51
  * Make a GET request
@@ -195,8 +136,8 @@ var APIClass = /** @class */ (function () {
195
136
  * @return The endpoint of the api
196
137
  */
197
138
  APIClass.prototype.endpoint = function (apiName) {
198
- return __awaiter(this, void 0, void 0, function () {
199
- return __generator(this, function (_a) {
139
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
140
+ return tslib_1.__generator(this, function (_a) {
200
141
  return [2 /*return*/, this._restApi.endpoint(apiName)];
201
142
  });
202
143
  });
package/lib/API.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,0CAAyC;AACzC,6DAAuC;AAEvC,kDAAqD;AACrD,wDAMkC;AAClC,0CAI2B;AAI3B,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,KAAK,CAAC,CAAC;AACjC;;;;GAIG;AACH;IAaC;;;OAGG;IACH,kBAAY,OAAO;QARnB,SAAI,GAAG,WAAI,CAAC;QACZ,UAAK,GAAG,eAAK,CAAC;QACd,gBAAW,GAAG,kBAAW,CAAC;QAOzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAe,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,gCAAa,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,4BAAS,GAAT,UAAU,OAAO;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE1D,6CAA6C;QAC7C,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAE7C,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI,CAA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export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
4
+ export type { GraphQLResult } from '@aws-amplify/api-graphql';
package/lib/index.js CHANGED
@@ -1,27 +1,12 @@
1
1
  "use strict";
2
- /*
3
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
- * the License. A copy of the License is located at
7
- *
8
- * http://aws.amazon.com/apache2.0/
9
- *
10
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
12
- * and limitations under the License.
13
- */
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
14
4
  Object.defineProperty(exports, "__esModule", { value: true });
15
5
  var API_1 = require("./API");
16
- var API_2 = require("./API");
17
- exports.API = API_2.API;
18
- exports.APIClass = API_2.APIClass;
6
+ exports.API = API_1.API;
7
+ exports.APIClass = API_1.APIClass;
19
8
  var api_graphql_1 = require("@aws-amplify/api-graphql");
20
9
  exports.graphqlOperation = api_graphql_1.graphqlOperation;
21
10
  exports.GraphQLAuthError = api_graphql_1.GraphQLAuthError;
22
11
  exports.GRAPHQL_AUTH_MODE = api_graphql_1.GRAPHQL_AUTH_MODE;
23
- /*
24
- * @deprecated use named import
25
- */
26
- exports.default = API_1.API;
27
12
  //# 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;;;;;;;;;;;GAWG;;AAEH,6BAA4B;AAG5B,6BAAsC;AAA7B,oBAAA,GAAG,CAAA;AAAE,yBAAA,QAAQ,CAAA;AACtB,wDAIkC;AAHjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAChB,0CAAA,iBAAiB,CAAA;AAKlB;;GAEG;AACH,kBAAe,SAAG,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAGtC,6BAAsC;AAA7B,oBAAA,GAAG,CAAA;AAAE,yBAAA,QAAQ,CAAA;AACtB,wDAIkC;AAHjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAChB,0CAAA,iBAAiB,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This exports from the types directory is a temporary workaround, since Amplify CLI currently
3
+ * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
4
+ * This will be removed in future release when CLI and customers moves to recommeneded import styles.
5
+ */
6
+ export { graphqlOperation, GraphQLAuthError, GraphQLResult, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
7
+ declare const queryType: unique symbol;
8
+ export declare type GraphQLQuery<T> = T & {
9
+ readonly [queryType]: 'query';
10
+ };
11
+ export declare type GraphQLSubscription<T> = T & {
12
+ readonly [queryType]: 'subscription';
13
+ };
@@ -1,16 +1,6 @@
1
1
  "use strict";
2
- /*
3
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
6
- * the License. A copy of the License is located at
7
- *
8
- * http://aws.amazon.com/apache2.0/
9
- *
10
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
12
- * and limitations under the License.
13
- */
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
14
4
  Object.defineProperty(exports, "__esModule", { value: true });
15
5
  /**
16
6
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAEH;;;;GAIG;AACH,wDAKkC;AAJjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAEhB,0CAAA,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC;;;;GAIG;AACH,wDAKkC;AAJjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAEhB,0CAAA,iBAAiB,CAAA"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "3.8.3"
3
+ }
package/lib-esm/API.js CHANGED
@@ -1,64 +1,8 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- /*
49
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
50
- *
51
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
52
- * the License. A copy of the License is located at
53
- *
54
- * http://aws.amazon.com/apache2.0/
55
- *
56
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
57
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
58
- * and limitations under the License.
59
- */
1
+ import { __assign, __awaiter, __generator } from "tslib";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
60
4
  import { Auth } from '@aws-amplify/auth';
61
- import Cache from '@aws-amplify/cache';
5
+ import { Cache } from '@aws-amplify/cache';
62
6
  import { RestAPIClass } from '@aws-amplify/api-rest';
63
7
  import { GraphQLAPIClass, } from '@aws-amplify/api-graphql';
64
8
  import { Amplify, ConsoleLogger as Logger, Credentials, } from '@aws-amplify/core';
@@ -1 +1 @@
1
- {"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACN,eAAe,GAKf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,OAAO,EACP,aAAa,IAAI,MAAM,EACvB,WAAW,GACX,MAAM,mBAAmB,CAAC;AAI3B,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;AACjC;;;;GAIG;AACH;IAaC;;;OAGG;IACH,kBAAY,OAAO;QARnB,SAAI,GAAG,IAAI,CAAC;QACZ,UAAK,GAAG,KAAK,CAAC;QACd,gBAAW,GAAG,WAAW,CAAC;QAOzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAEM,gCAAa,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,4BAAS,GAAT,UAAU,OAAO;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CA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oBD,0BAAO,GAAP,UACC,OAAuB,EACvB,iBAA6C;QAE7C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC7D,CAAC;IACF,eAAC;AAAD,CAAC,AA3MD,IA2MC;;AAED,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC"}
@@ -1,6 +1,4 @@
1
- import { API } from './API';
2
1
  export { GraphQLQuery, GraphQLSubscription } from './types';
3
2
  export { API, APIClass } from './API';
4
3
  export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
5
4
  export type { GraphQLResult } from '@aws-amplify/api-graphql';
6
- export default API;
package/lib-esm/index.js CHANGED
@@ -1,20 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
13
- import { API } from './API';
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
14
3
  export { API, APIClass } from './API';
15
4
  export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
16
- /*
17
- * @deprecated use named import
18
- */
19
- export default API;
20
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC;AAIlC;;GAEG;AACH,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC"}
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  /**
14
4
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
15
5
  * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAEhB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC;;;;GAIG;AACH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAEhB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/api",
3
- "version": "4.0.61",
3
+ "version": "4.0.62-unstable.2+55e13f5a7",
4
4
  "description": "Api category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -16,11 +16,8 @@
16
16
  "./lib/index": "./lib-esm/index.js"
17
17
  },
18
18
  "sideEffects": [
19
- "./src/API.ts",
20
19
  "./lib/API.js",
21
- "./lib-esm/API.js",
22
- "./dist/aws-amplify-api.js",
23
- "./dist/aws-amplify-api.min.js"
20
+ "./lib-esm/API.js"
24
21
  ],
25
22
  "publishConfig": {
26
23
  "access": "public"
@@ -35,7 +32,8 @@
35
32
  "build": "npm run clean && npm run build:esm && npm run build:cjs",
36
33
  "clean": "rimraf lib-esm lib dist",
37
34
  "format": "echo \"Not implemented\"",
38
- "lint": "tslint 'src/**/*.ts'"
35
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
36
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.93"
39
37
  },
40
38
  "repository": {
41
39
  "type": "git",
@@ -50,9 +48,16 @@
50
48
  "devDependencies": {
51
49
  "@types/zen-observable": "^0.8.0"
52
50
  },
51
+ "files": [
52
+ "lib",
53
+ "lib-esm",
54
+ "src",
55
+ "index.*.d.ts"
56
+ ],
53
57
  "dependencies": {
54
- "@aws-amplify/api-graphql": "2.3.25",
55
- "@aws-amplify/api-rest": "2.0.61"
58
+ "@aws-amplify/api-graphql": "2.3.26-unstable.2+55e13f5a7",
59
+ "@aws-amplify/api-rest": "2.0.62-unstable.2+55e13f5a7",
60
+ "tslib": "^1.8.0"
56
61
  },
57
62
  "jest": {
58
63
  "globals": {
@@ -98,5 +103,5 @@
98
103
  "lib-esm"
99
104
  ]
100
105
  },
101
- "gitHead": "f2a588ee786fe23d391d600e5eb0a3f277b4841c"
106
+ "gitHead": "55e13f5a77488793f97b9c7ffe963aaa0c687884"
102
107
  }
package/src/API.ts CHANGED
@@ -1,17 +1,7 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { Auth } from '@aws-amplify/auth';
14
- import Cache from '@aws-amplify/cache';
4
+ import { Cache } from '@aws-amplify/cache';
15
5
  import { AWSAppSyncRealTimeProvider } from '@aws-amplify/pubsub';
16
6
  import { RestAPIClass } from '@aws-amplify/api-rest';
17
7
  import {
package/src/index.ts CHANGED
@@ -1,17 +1,5 @@
1
- /*
2
- * Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
13
-
14
- import { API } from './API';
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
15
3
 
16
4
  export { GraphQLQuery, GraphQLSubscription } from './types';
17
5
  export { API, APIClass } from './API';
@@ -22,8 +10,3 @@ export {
22
10
  } from '@aws-amplify/api-graphql';
23
11
 
24
12
  export type { GraphQLResult } from '@aws-amplify/api-graphql';
25
-
26
- /*
27
- * @deprecated use named import
28
- */
29
- export default API;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
 
14
4
  /**
15
5
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
package/build.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const build = require('../../scripts/build');
4
-
5
- build(process.argv[2], process.argv[3]);