@aws-amplify/api 4.0.62-unstable.4 → 4.0.63

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/index.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./dist/aws-amplify-api.min.js');
5
+ } else {
6
+ module.exports = require('./dist/aws-amplify-api.js');
7
+ }
package/lib/API.js CHANGED
@@ -1,10 +1,69 @@
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
+ };
2
52
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
- // SPDX-License-Identifier: Apache-2.0
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
+ */
6
65
  var auth_1 = require("@aws-amplify/auth");
7
- var cache_1 = require("@aws-amplify/cache");
66
+ var cache_1 = __importDefault(require("@aws-amplify/cache"));
8
67
  var api_rest_1 = require("@aws-amplify/api-rest");
9
68
  var api_graphql_1 = require("@aws-amplify/api-graphql");
10
69
  var core_1 = require("@aws-amplify/core");
@@ -21,7 +80,7 @@ var APIClass = /** @class */ (function () {
21
80
  */
22
81
  function APIClass(options) {
23
82
  this.Auth = auth_1.Auth;
24
- this.Cache = cache_1.Cache;
83
+ this.Cache = cache_1.default;
25
84
  this.Credentials = core_1.Credentials;
26
85
  this._options = options;
27
86
  this._restApi = new api_rest_1.RestAPIClass(options);
@@ -45,7 +104,7 @@ var APIClass = /** @class */ (function () {
45
104
  this._graphqlApi.Credentials = this.Credentials;
46
105
  var restAPIConfig = this._restApi.configure(this._options);
47
106
  var graphQLAPIConfig = this._graphqlApi.configure(this._options);
48
- return tslib_1.__assign(tslib_1.__assign({}, restAPIConfig), graphQLAPIConfig);
107
+ return __assign(__assign({}, restAPIConfig), graphQLAPIConfig);
49
108
  };
50
109
  /**
51
110
  * Make a GET request
@@ -136,8 +195,8 @@ var APIClass = /** @class */ (function () {
136
195
  * @return The endpoint of the api
137
196
  */
138
197
  APIClass.prototype.endpoint = function (apiName) {
139
- return tslib_1.__awaiter(this, void 0, void 0, function () {
140
- return tslib_1.__generator(this, function (_a) {
198
+ return __awaiter(this, void 0, void 0, function () {
199
+ return __generator(this, function (_a) {
141
200
  return [2 /*return*/, this._restApi.endpoint(apiName)];
142
201
  });
143
202
  });
package/lib/API.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,0CAAyC;AACzC,4CAA2C;AAE3C,kDAAqD;AACrD,wDAMkC;AAClC,0CAI2B;AAI3B,IAAM,MAAM,GAAG,IAAI,oBAAM,CAAC,KAAK,CAAC,CAAC;AACjC;;;;GAIG;AACH;IAaC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ACpD,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;SACjD;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED;;;;OAIG;IACG,2BAAQ,GAAd,UAAe,OAAe;;;gBAC7B,sBAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAC;;;KACvC;IAED;;;OAGG;IACH,0CAAuB,GAAvB,UAAwB,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAoBD,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;AA3MY,4BAAQ;AA6MR,QAAA,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACtC,cAAO,CAAC,QAAQ,CAAC,WAAG,CAAC,CAAC"}
package/lib/index.js CHANGED
@@ -1,12 +1,27 @@
1
1
  "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
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
+ */
4
14
  Object.defineProperty(exports, "__esModule", { value: true });
5
15
  var API_1 = require("./API");
6
- exports.API = API_1.API;
7
- exports.APIClass = API_1.APIClass;
16
+ var API_2 = require("./API");
17
+ exports.API = API_2.API;
18
+ exports.APIClass = API_2.APIClass;
8
19
  var api_graphql_1 = require("@aws-amplify/api-graphql");
9
20
  exports.graphqlOperation = api_graphql_1.graphqlOperation;
10
21
  exports.GraphQLAuthError = api_graphql_1.GraphQLAuthError;
11
22
  exports.GRAPHQL_AUTH_MODE = api_graphql_1.GRAPHQL_AUTH_MODE;
23
+ /*
24
+ * @deprecated use named import
25
+ */
26
+ exports.default = API_1.API;
12
27
  //# 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;;AAGtC,6BAAsC;AAA7B,oBAAA,GAAG,CAAA;AAAE,yBAAA,QAAQ,CAAA;AACtB,wDAIkC;AAHjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAChB,0CAAA,iBAAiB,CAAA"}
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,6 +1,16 @@
1
1
  "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
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
+ */
4
14
  Object.defineProperty(exports, "__esModule", { value: true });
5
15
  /**
6
16
  * 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,qEAAqE;AACrE,sCAAsC;;AAEtC;;;;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;;;;;;;;;;;GAWG;;AAEH;;;;GAIG;AACH,wDAKkC;AAJjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA;AAEhB,0CAAA,iBAAiB,CAAA"}
package/lib-esm/API.js CHANGED
@@ -1,8 +1,64 @@
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
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
+ */
4
60
  import { Auth } from '@aws-amplify/auth';
5
- import { Cache } from '@aws-amplify/cache';
61
+ import Cache from '@aws-amplify/cache';
6
62
  import { RestAPIClass } from '@aws-amplify/api-rest';
7
63
  import { GraphQLAPIClass, } from '@aws-amplify/api-graphql';
8
64
  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,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,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,KA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BAAQ,GAAd,UAAe,OAAe;;;gBAC7B,sBAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAC;;;KACvC;IAED;;;OAGG;IACH,0CAAuB,GAAvB,UAAwB,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAoBD,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,4 +1,6 @@
1
+ import { API } from './API';
1
2
  export { GraphQLQuery, GraphQLSubscription } from './types';
2
3
  export { API, APIClass } from './API';
3
4
  export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
4
5
  export type { GraphQLResult } from '@aws-amplify/api-graphql';
6
+ export default API;
package/lib-esm/index.js CHANGED
@@ -1,5 +1,20 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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';
3
14
  export { API, APIClass } from './API';
4
15
  export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
16
+ /*
17
+ * @deprecated use named import
18
+ */
19
+ export default API;
5
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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
+ {"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,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
  /**
4
14
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
5
15
  * 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,qEAAqE;AACrE,sCAAsC;AAEtC;;;;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;;;;;;;;;;;GAWG;AAEH;;;;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.62-unstable.4+751349a34",
3
+ "version": "4.0.63",
4
4
  "description": "Api category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -16,8 +16,11 @@
16
16
  "./lib/index": "./lib-esm/index.js"
17
17
  },
18
18
  "sideEffects": [
19
+ "./src/API.ts",
19
20
  "./lib/API.js",
20
- "./lib-esm/API.js"
21
+ "./lib-esm/API.js",
22
+ "./dist/aws-amplify-api.js",
23
+ "./dist/aws-amplify-api.min.js"
21
24
  ],
22
25
  "publishConfig": {
23
26
  "access": "public"
@@ -32,8 +35,7 @@
32
35
  "build": "npm run clean && npm run build:esm && npm run build:cjs",
33
36
  "clean": "rimraf lib-esm lib dist",
34
37
  "format": "echo \"Not implemented\"",
35
- "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
36
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.93"
38
+ "lint": "tslint 'src/**/*.ts'"
37
39
  },
38
40
  "repository": {
39
41
  "type": "git",
@@ -48,16 +50,9 @@
48
50
  "devDependencies": {
49
51
  "@types/zen-observable": "^0.8.0"
50
52
  },
51
- "files": [
52
- "lib",
53
- "lib-esm",
54
- "src",
55
- "index.*.d.ts"
56
- ],
57
53
  "dependencies": {
58
- "@aws-amplify/api-graphql": "2.3.26-unstable.4+751349a34",
59
- "@aws-amplify/api-rest": "2.0.62-unstable.4+751349a34",
60
- "tslib": "^1.8.0"
54
+ "@aws-amplify/api-graphql": "2.3.27",
55
+ "@aws-amplify/api-rest": "2.0.63"
61
56
  },
62
57
  "jest": {
63
58
  "globals": {
@@ -103,5 +98,5 @@
103
98
  "lib-esm"
104
99
  ]
105
100
  },
106
- "gitHead": "751349a340e10c0dded302db94bc5c2095f5651a"
101
+ "gitHead": "66b579d31fceaaba7f128b6cd9950dac3d4ef3cb"
107
102
  }
package/src/API.ts CHANGED
@@ -1,7 +1,17 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
  import { Auth } from '@aws-amplify/auth';
4
- import { Cache } from '@aws-amplify/cache';
14
+ import Cache from '@aws-amplify/cache';
5
15
  import { AWSAppSyncRealTimeProvider } from '@aws-amplify/pubsub';
6
16
  import { RestAPIClass } from '@aws-amplify/api-rest';
7
17
  import {
package/src/index.ts CHANGED
@@ -1,5 +1,17 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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';
3
15
 
4
16
  export { GraphQLQuery, GraphQLSubscription } from './types';
5
17
  export { API, APIClass } from './API';
@@ -10,3 +22,8 @@ export {
10
22
  } from '@aws-amplify/api-graphql';
11
23
 
12
24
  export type { GraphQLResult } from '@aws-amplify/api-graphql';
25
+
26
+ /*
27
+ * @deprecated use named import
28
+ */
29
+ export default API;
@@ -1,5 +1,15 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
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
+ */
3
13
 
4
14
  /**
5
15
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
@@ -0,0 +1,6 @@
1
+ var config = require('./webpack.config.js');
2
+
3
+ var entry = {
4
+ 'aws-amplify-api': './lib-esm/index.js',
5
+ };
6
+ module.exports = Object.assign(config, { entry, mode: 'development' });
package/lib/.tsbuildinfo DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "version": "3.8.3"
3
- }
package/lib/API.d.ts DELETED
@@ -1,131 +0,0 @@
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/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { GraphQLQuery, GraphQLSubscription } from './types';
2
- export { API, APIClass } from './API';
3
- export { graphqlOperation, GraphQLAuthError, GRAPHQL_AUTH_MODE, } from '@aws-amplify/api-graphql';
4
- export type { GraphQLResult } from '@aws-amplify/api-graphql';
@@ -1,13 +0,0 @@
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,3 +0,0 @@
1
- {
2
- "version": "3.8.3"
3
- }