@aws-amplify/api 6.0.1-console-preview.3d7f188.0 → 6.0.1-mjs-test.20ead30.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.
Files changed (72) hide show
  1. package/dist/cjs/API.js +22 -0
  2. package/dist/cjs/API.js.map +1 -0
  3. package/dist/cjs/index.js +19 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/{lib → dist/cjs}/internals/InternalAPI.js +22 -18
  6. package/dist/cjs/internals/InternalAPI.js.map +1 -0
  7. package/dist/cjs/internals/generateServerClient.js +29 -0
  8. package/dist/cjs/internals/generateServerClient.js.map +1 -0
  9. package/dist/cjs/internals/index.js +12 -0
  10. package/dist/cjs/internals/index.js.map +1 -0
  11. package/dist/cjs/server.js +15 -0
  12. package/dist/cjs/server.js.map +1 -0
  13. package/{lib → dist/cjs}/types/index.js +6 -4
  14. package/dist/cjs/types/index.js.map +1 -0
  15. package/dist/esm/API.mjs +20 -0
  16. package/dist/esm/API.mjs.map +1 -0
  17. package/dist/esm/index.mjs +4 -0
  18. package/dist/esm/index.mjs.map +1 -0
  19. package/{lib-esm → dist/esm}/internals/InternalAPI.d.ts +1 -1
  20. package/{lib-esm/internals/InternalAPI.js → dist/esm/internals/InternalAPI.mjs} +22 -18
  21. package/dist/esm/internals/InternalAPI.mjs.map +1 -0
  22. package/dist/esm/internals/generateServerClient.d.ts +11 -0
  23. package/dist/esm/internals/generateServerClient.mjs +27 -0
  24. package/dist/esm/internals/generateServerClient.mjs.map +1 -0
  25. package/{lib → dist/esm}/internals/index.d.ts +1 -0
  26. package/dist/esm/internals/index.mjs +3 -0
  27. package/dist/esm/internals/index.mjs.map +1 -0
  28. package/dist/esm/server.d.ts +1 -0
  29. package/dist/esm/server.mjs +2 -0
  30. package/dist/esm/server.mjs.map +1 -0
  31. package/dist/esm/types/index.mjs +2 -0
  32. package/dist/esm/types/index.mjs.map +1 -0
  33. package/internals/package.json +4 -4
  34. package/package.json +69 -35
  35. package/server/package.json +3 -4
  36. package/src/internals/generateServerClient.ts +38 -0
  37. package/src/internals/index.ts +1 -0
  38. package/src/server.ts +0 -32
  39. package/index.v37.d.ts +0 -12
  40. package/lib/.tsbuildinfo +0 -3
  41. package/lib/API.d.ts +0 -5
  42. package/lib/API.js +0 -21
  43. package/lib/API.js.map +0 -1
  44. package/lib/index.d.ts +0 -5
  45. package/lib/index.js +0 -17
  46. package/lib/index.js.map +0 -1
  47. package/lib/internals/InternalAPI.d.ts +0 -42
  48. package/lib/internals/InternalAPI.js.map +0 -1
  49. package/lib/internals/index.js +0 -8
  50. package/lib/internals/index.js.map +0 -1
  51. package/lib/server.d.ts +0 -9
  52. package/lib/server.js +0 -29
  53. package/lib/server.js.map +0 -1
  54. package/lib/types/index.d.ts +0 -6
  55. package/lib/types/index.js.map +0 -1
  56. package/lib-esm/.tsbuildinfo +0 -3
  57. package/lib-esm/API.js +0 -18
  58. package/lib-esm/API.js.map +0 -1
  59. package/lib-esm/index.js +0 -6
  60. package/lib-esm/index.js.map +0 -1
  61. package/lib-esm/internals/InternalAPI.js.map +0 -1
  62. package/lib-esm/internals/index.d.ts +0 -1
  63. package/lib-esm/internals/index.js +0 -4
  64. package/lib-esm/internals/index.js.map +0 -1
  65. package/lib-esm/server.d.ts +0 -9
  66. package/lib-esm/server.js +0 -19
  67. package/lib-esm/server.js.map +0 -1
  68. package/lib-esm/types/index.js +0 -9
  69. package/lib-esm/types/index.js.map +0 -1
  70. /package/{lib-esm → dist/esm}/API.d.ts +0 -0
  71. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  72. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.generateClient = void 0;
5
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ // SPDX-License-Identifier: Apache-2.0
7
+ const api_graphql_1 = require("@aws-amplify/api-graphql");
8
+ const internals_1 = require("@aws-amplify/api-graphql/internals");
9
+ const core_1 = require("@aws-amplify/core");
10
+ /**
11
+ * Generates an API client that can work with models or raw GraphQL
12
+ */
13
+ function generateClient() {
14
+ return {
15
+ [api_graphql_1.__amplify]: core_1.Amplify,
16
+ graphql: internals_1.graphql,
17
+ cancel: internals_1.cancel,
18
+ isCancelError: internals_1.isCancelError,
19
+ };
20
+ }
21
+ exports.generateClient = generateClient;
22
+ //# sourceMappingURL=API.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"API.js","sources":["../../src/API.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateClient = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\nconst core_1 = require(\"@aws-amplify/core\");\n/**\n * Generates an API client that can work with models or raw GraphQL\n */\nfunction generateClient() {\n return {\n [api_graphql_1.__amplify]: core_1.Amplify,\n graphql: internals_1.graphql,\n cancel: internals_1.cancel,\n isCancelError: internals_1.isCancelError,\n };\n}\nexports.generateClient = generateClient;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC;AACA;AACA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C;AACA;AACA;AACA,SAAS,cAAc,GAAG;AAC1B,IAAI,OAAO;AACX,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACjD,QAAQ,OAAO,EAAE,WAAW,CAAC,OAAO;AACpC,QAAQ,MAAM,EAAE,WAAW,CAAC,MAAM;AAClC,QAAQ,aAAa,EAAE,WAAW,CAAC,aAAa;AAChD,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isCancelError = exports.patch = exports.head = exports.del = exports.post = exports.put = exports.get = exports.GraphQLAuthError = exports.generateClient = void 0;
7
+ var API_1 = require("./API");
8
+ Object.defineProperty(exports, "generateClient", { enumerable: true, get: function () { return API_1.generateClient; } });
9
+ var api_graphql_1 = require("@aws-amplify/api-graphql");
10
+ Object.defineProperty(exports, "GraphQLAuthError", { enumerable: true, get: function () { return api_graphql_1.GraphQLAuthError; } });
11
+ var api_rest_1 = require("@aws-amplify/api-rest");
12
+ Object.defineProperty(exports, "get", { enumerable: true, get: function () { return api_rest_1.get; } });
13
+ Object.defineProperty(exports, "put", { enumerable: true, get: function () { return api_rest_1.put; } });
14
+ Object.defineProperty(exports, "post", { enumerable: true, get: function () { return api_rest_1.post; } });
15
+ Object.defineProperty(exports, "del", { enumerable: true, get: function () { return api_rest_1.del; } });
16
+ Object.defineProperty(exports, "head", { enumerable: true, get: function () { return api_rest_1.head; } });
17
+ Object.defineProperty(exports, "patch", { enumerable: true, get: function () { return api_rest_1.patch; } });
18
+ Object.defineProperty(exports, "isCancelError", { enumerable: true, get: function () { return api_rest_1.isCancelError; } });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCancelError = exports.patch = exports.head = exports.del = exports.post = exports.put = exports.get = exports.GraphQLAuthError = exports.generateClient = void 0;\nvar API_1 = require(\"./API\");\nObject.defineProperty(exports, \"generateClient\", { enumerable: true, get: function () { return API_1.generateClient; } });\nvar api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nObject.defineProperty(exports, \"GraphQLAuthError\", { enumerable: true, get: function () { return api_graphql_1.GraphQLAuthError; } });\nvar api_rest_1 = require(\"@aws-amplify/api-rest\");\nObject.defineProperty(exports, \"get\", { enumerable: true, get: function () { return api_rest_1.get; } });\nObject.defineProperty(exports, \"put\", { enumerable: true, get: function () { return api_rest_1.put; } });\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return api_rest_1.post; } });\nObject.defineProperty(exports, \"del\", { enumerable: true, get: function () { return api_rest_1.del; } });\nObject.defineProperty(exports, \"head\", { enumerable: true, get: function () { return api_rest_1.head; } });\nObject.defineProperty(exports, \"patch\", { enumerable: true, get: function () { return api_rest_1.patch; } });\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return api_rest_1.isCancelError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAC3K,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;AAC1H,IAAI,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;AACtI,IAAI,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3G,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3G,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,9 +1,10 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var internals_1 = require("@aws-amplify/api-graphql/internals");
5
- var core_1 = require("@aws-amplify/core");
6
- var utils_1 = require("@aws-amplify/core/internals/utils");
4
+ exports.InternalAPI = exports.InternalAPIClass = void 0;
5
+ const internals_1 = require("@aws-amplify/api-graphql/internals");
6
+ const core_1 = require("@aws-amplify/core");
7
+ const utils_1 = require("@aws-amplify/core/internals/utils");
7
8
  /**
8
9
  * NOTE!
9
10
  *
@@ -12,39 +13,42 @@ var utils_1 = require("@aws-amplify/core/internals/utils");
12
13
  * This can probably be pruned and/or removed. Just leaving it as much of the same
13
14
  * state as possible for V6 to reduce number of potentially impactful changes to DataStore.
14
15
  */
15
- var logger = new core_1.ConsoleLogger('API');
16
+ const logger = new core_1.ConsoleLogger('API');
16
17
  /**
17
18
  * @deprecated
18
19
  * Use RestApi or GraphQLAPI to reduce your application bundle size
19
20
  * Export Cloud Logic APIs
20
21
  */
21
- var InternalAPIClass = /** @class */ (function () {
22
+ class InternalAPIClass {
22
23
  /**
23
24
  * Initialize API with AWS configuration
24
25
  * @param {Object} options - Configuration object for API
25
26
  */
26
- function InternalAPIClass(options) {
27
+ constructor(options) {
27
28
  this.Cache = core_1.Cache;
28
29
  this._options = options;
29
30
  this._graphqlApi = new internals_1.InternalGraphQLAPIClass(options);
30
31
  logger.debug('API Options', this._options);
31
32
  }
32
- InternalAPIClass.prototype.getModuleName = function () {
33
+ getModuleName() {
33
34
  return 'InternalAPI';
34
- };
35
+ }
35
36
  /**
36
37
  * to get the operation type
37
38
  * @param operation
38
39
  */
39
- InternalAPIClass.prototype.getGraphqlOperationType = function (operation) {
40
+ getGraphqlOperationType(operation) {
40
41
  return this._graphqlApi.getGraphqlOperationType(operation);
41
- };
42
- InternalAPIClass.prototype.graphql = function (options, additionalHeaders, customUserAgentDetails) {
43
- var apiUserAgentDetails = tslib_1.__assign({ category: utils_1.Category.API, action: utils_1.ApiAction.GraphQl }, customUserAgentDetails);
42
+ }
43
+ graphql(options, additionalHeaders, customUserAgentDetails) {
44
+ const apiUserAgentDetails = {
45
+ category: utils_1.Category.API,
46
+ action: utils_1.ApiAction.GraphQl,
47
+ ...customUserAgentDetails,
48
+ };
44
49
  return this._graphqlApi.graphql(core_1.Amplify, options, additionalHeaders, apiUserAgentDetails);
45
- };
46
- return InternalAPIClass;
47
- }());
50
+ }
51
+ }
48
52
  exports.InternalAPIClass = InternalAPIClass;
49
53
  exports.InternalAPI = new InternalAPIClass(null);
50
- //# sourceMappingURL=InternalAPI.js.map
54
+ //# sourceMappingURL=InternalAPI.js.map
@@ -0,0 +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 */\nconst logger = new core_1.ConsoleLogger('API');\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 with AWS configuration\n * @param {Object} options - Configuration object for API\n */\n constructor(options) {\n this.Cache = core_1.Cache;\n this._options = options;\n this._graphqlApi = new internals_1.InternalGraphQLAPIClass(options);\n logger.debug('API Options', this._options);\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(null);\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,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,CAAC;AACvB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAClC,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAChC,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC5E,QAAQ,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnD,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,CAAC,IAAI,CAAC;;"}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateServerClient = void 0;
7
+ const api_graphql_1 = require("@aws-amplify/api-graphql");
8
+ const internals_1 = require("@aws-amplify/api-graphql/internals");
9
+ /**
10
+ * @private
11
+ *
12
+ * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
13
+ * compatible context object for config and auth fetching.
14
+ *
15
+ * @param params
16
+ * @returns
17
+ */
18
+ function generateServerClient(params) {
19
+ const client = {
20
+ [api_graphql_1.__amplify]: params.amplify,
21
+ graphql: internals_1.graphql,
22
+ cancel: internals_1.cancel,
23
+ isCancelError: internals_1.isCancelError,
24
+ models: {},
25
+ };
26
+ return client;
27
+ }
28
+ exports.generateServerClient = generateServerClient;
29
+ //# sourceMappingURL=generateServerClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateServerClient.js","sources":["../../../src/internals/generateServerClient.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClient = void 0;\nconst api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nconst internals_1 = require(\"@aws-amplify/api-graphql/internals\");\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nfunction generateServerClient(params) {\n const client = {\n [api_graphql_1.__amplify]: params.amplify,\n graphql: internals_1.graphql,\n cancel: internals_1.cancel,\n isCancelError: internals_1.isCancelError,\n models: {},\n };\n return client;\n}\nexports.generateServerClient = generateServerClient;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,oBAAoB,GAAG,KAAK,CAAC,CAAC;AACtC,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,MAAM,EAAE;AACtC,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACjD,QAAQ,OAAO,EAAE,WAAW,CAAC,OAAO;AACpC,QAAQ,MAAM,EAAE,WAAW,CAAC,MAAM;AAClC,QAAQ,aAAa,EAAE,WAAW,CAAC,aAAa;AAChD,QAAQ,MAAM,EAAE,EAAE;AAClB,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;;"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.generateServerClient = exports.InternalAPIClass = exports.InternalAPI = void 0;
5
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ // SPDX-License-Identifier: Apache-2.0
7
+ var InternalAPI_1 = require("./InternalAPI");
8
+ Object.defineProperty(exports, "InternalAPI", { enumerable: true, get: function () { return InternalAPI_1.InternalAPI; } });
9
+ Object.defineProperty(exports, "InternalAPIClass", { enumerable: true, get: function () { return InternalAPI_1.InternalAPIClass; } });
10
+ var generateServerClient_1 = require("./generateServerClient");
11
+ Object.defineProperty(exports, "generateServerClient", { enumerable: true, get: function () { return generateServerClient_1.generateServerClient; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/internals/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClient = exports.InternalAPIClass = exports.InternalAPI = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar InternalAPI_1 = require(\"./InternalAPI\");\nObject.defineProperty(exports, \"InternalAPI\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPI; } });\nObject.defineProperty(exports, \"InternalAPIClass\", { enumerable: true, get: function () { return InternalAPI_1.InternalAPIClass; } });\nvar generateServerClient_1 = require(\"./generateServerClient\");\nObject.defineProperty(exports, \"generateServerClient\", { enumerable: true, get: function () { return generateServerClient_1.generateServerClient; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC;AACvF;AACA;AACA,IAAI,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5H,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;AACtI,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC/D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC;;"}
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isCancelError = exports.patch = exports.head = exports.del = exports.post = exports.put = exports.get = void 0;
7
+ var server_1 = require("@aws-amplify/api-rest/server");
8
+ Object.defineProperty(exports, "get", { enumerable: true, get: function () { return server_1.get; } });
9
+ Object.defineProperty(exports, "put", { enumerable: true, get: function () { return server_1.put; } });
10
+ Object.defineProperty(exports, "post", { enumerable: true, get: function () { return server_1.post; } });
11
+ Object.defineProperty(exports, "del", { enumerable: true, get: function () { return server_1.del; } });
12
+ Object.defineProperty(exports, "head", { enumerable: true, get: function () { return server_1.head; } });
13
+ Object.defineProperty(exports, "patch", { enumerable: true, get: function () { return server_1.patch; } });
14
+ Object.defineProperty(exports, "isCancelError", { enumerable: true, get: function () { return server_1.isCancelError; } });
15
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["../../src/server.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCancelError = exports.patch = exports.head = exports.del = exports.post = exports.put = exports.get = void 0;\nvar server_1 = require(\"@aws-amplify/api-rest/server\");\nObject.defineProperty(exports, \"get\", { enumerable: true, get: function () { return server_1.get; } });\nObject.defineProperty(exports, \"put\", { enumerable: true, get: function () { return server_1.put; } });\nObject.defineProperty(exports, \"post\", { enumerable: true, get: function () { return server_1.post; } });\nObject.defineProperty(exports, \"del\", { enumerable: true, get: function () { return server_1.del; } });\nObject.defineProperty(exports, \"head\", { enumerable: true, get: function () { return server_1.head; } });\nObject.defineProperty(exports, \"patch\", { enumerable: true, get: function () { return server_1.patch; } });\nObject.defineProperty(exports, \"isCancelError\", { enumerable: true, get: function () { return server_1.isCancelError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;AACvH,IAAI,QAAQ,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACvG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACvG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;AACvG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACzG,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3G,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,13 +1,15 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
4
  // SPDX-License-Identifier: Apache-2.0
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GraphQLAuthError = exports.graphqlOperation = void 0;
5
7
  /**
6
8
  * This exports from the types directory is a temporary workaround, since Amplify CLI currently
7
9
  * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
8
10
  * This will be removed in future release when CLI and customers moves to recommeneded import styles.
9
11
  */
10
12
  var api_graphql_1 = require("@aws-amplify/api-graphql");
11
- exports.graphqlOperation = api_graphql_1.graphqlOperation;
12
- exports.GraphQLAuthError = api_graphql_1.GraphQLAuthError;
13
- //# sourceMappingURL=index.js.map
13
+ Object.defineProperty(exports, "graphqlOperation", { enumerable: true, get: function () { return api_graphql_1.graphqlOperation; } });
14
+ Object.defineProperty(exports, "GraphQLAuthError", { enumerable: true, get: function () { return api_graphql_1.GraphQLAuthError; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/types/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GraphQLAuthError = exports.graphqlOperation = void 0;\n/**\n * This exports from the types directory is a temporary workaround, since Amplify CLI currently\n * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863\n * This will be removed in future release when CLI and customers moves to recommeneded import styles.\n */\nvar api_graphql_1 = require(\"@aws-amplify/api-graphql\");\nObject.defineProperty(exports, \"graphqlOperation\", { enumerable: true, get: function () { return api_graphql_1.graphqlOperation; } });\nObject.defineProperty(exports, \"GraphQLAuthError\", { enumerable: true, get: function () { return api_graphql_1.GraphQLAuthError; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACxD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;AACtI,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC;;"}
@@ -0,0 +1,20 @@
1
+ import { __amplify } from '@aws-amplify/api-graphql';
2
+ import { graphql, cancel, isCancelError } from '@aws-amplify/api-graphql/internals';
3
+ import { Amplify } from '@aws-amplify/core';
4
+
5
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ // SPDX-License-Identifier: Apache-2.0
7
+ /**
8
+ * Generates an API client that can work with models or raw GraphQL
9
+ */
10
+ function generateClient() {
11
+ return {
12
+ [__amplify]: Amplify,
13
+ graphql: graphql,
14
+ cancel: cancel,
15
+ isCancelError: isCancelError,
16
+ };
17
+ }
18
+
19
+ export { generateClient };
20
+ //# sourceMappingURL=API.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"API.mjs","sources":["../../src/API.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __amplify } from '@aws-amplify/api-graphql';\nimport { graphql as v6graphql, cancel as v6cancel, isCancelError as v6isCancelError, } from '@aws-amplify/api-graphql/internals';\nimport { Amplify } from '@aws-amplify/core';\n/**\n * Generates an API client that can work with models or raw GraphQL\n */\nexport function generateClient() {\n return {\n [__amplify]: Amplify,\n graphql: v6graphql,\n cancel: v6cancel,\n isCancelError: v6isCancelError,\n };\n}\n"],"names":["v6graphql","v6cancel","v6isCancelError"],"mappings":";;;;AAAA;AACA;AAIA;AACA;AACA;AACO,SAAS,cAAc,GAAG;AACjC,IAAI,OAAO;AACX,QAAQ,CAAC,SAAS,GAAG,OAAO;AAC5B,QAAQ,OAAO,EAAEA,OAAS;AAC1B,QAAQ,MAAM,EAAEC,MAAQ;AACxB,QAAQ,aAAa,EAAEC,aAAe;AACtC,KAAK,CAAC;AACN;;;;"}
@@ -0,0 +1,4 @@
1
+ export { generateClient } from './API.mjs';
2
+ export { GraphQLAuthError } from '@aws-amplify/api-graphql';
3
+ export { del, get, head, isCancelError, patch, post, put } from '@aws-amplify/api-rest';
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -13,7 +13,7 @@ export declare class InternalAPIClass {
13
13
  */
14
14
  private _options;
15
15
  private _graphqlApi;
16
- Cache: import("@aws-amplify/core/lib-esm/Cache/StorageCache").StorageCache;
16
+ Cache: import("@aws-amplify/core/dist/esm/Cache/StorageCache").StorageCache;
17
17
  /**
18
18
  * Initialize API with AWS configuration
19
19
  * @param {Object} options - Configuration object for API
@@ -1,7 +1,7 @@
1
- import { __assign } from "tslib";
2
1
  import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
3
- import { Amplify, Cache, ConsoleLogger } from '@aws-amplify/core';
4
- import { ApiAction, Category, } from '@aws-amplify/core/internals/utils';
2
+ import { ConsoleLogger, Cache, Amplify } from '@aws-amplify/core';
3
+ import { Category, ApiAction } from '@aws-amplify/core/internals/utils';
4
+
5
5
  /**
6
6
  * NOTE!
7
7
  *
@@ -10,39 +10,43 @@ import { ApiAction, Category, } 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
- var logger = new ConsoleLogger('API');
13
+ const logger = new ConsoleLogger('API');
14
14
  /**
15
15
  * @deprecated
16
16
  * Use RestApi or GraphQLAPI to reduce your application bundle size
17
17
  * Export Cloud Logic APIs
18
18
  */
19
- var InternalAPIClass = /** @class */ (function () {
19
+ class InternalAPIClass {
20
20
  /**
21
21
  * Initialize API with AWS configuration
22
22
  * @param {Object} options - Configuration object for API
23
23
  */
24
- function InternalAPIClass(options) {
24
+ constructor(options) {
25
25
  this.Cache = Cache;
26
26
  this._options = options;
27
27
  this._graphqlApi = new InternalGraphQLAPIClass(options);
28
28
  logger.debug('API Options', this._options);
29
29
  }
30
- InternalAPIClass.prototype.getModuleName = function () {
30
+ getModuleName() {
31
31
  return 'InternalAPI';
32
- };
32
+ }
33
33
  /**
34
34
  * to get the operation type
35
35
  * @param operation
36
36
  */
37
- InternalAPIClass.prototype.getGraphqlOperationType = function (operation) {
37
+ getGraphqlOperationType(operation) {
38
38
  return this._graphqlApi.getGraphqlOperationType(operation);
39
- };
40
- InternalAPIClass.prototype.graphql = function (options, additionalHeaders, customUserAgentDetails) {
41
- var apiUserAgentDetails = __assign({ category: Category.API, action: ApiAction.GraphQl }, customUserAgentDetails);
39
+ }
40
+ graphql(options, additionalHeaders, customUserAgentDetails) {
41
+ const apiUserAgentDetails = {
42
+ category: Category.API,
43
+ action: ApiAction.GraphQl,
44
+ ...customUserAgentDetails,
45
+ };
42
46
  return this._graphqlApi.graphql(Amplify, options, additionalHeaders, apiUserAgentDetails);
43
- };
44
- return InternalAPIClass;
45
- }());
46
- export { InternalAPIClass };
47
- export var InternalAPI = new InternalAPIClass(null);
48
- //# sourceMappingURL=InternalAPI.js.map
47
+ }
48
+ }
49
+ const InternalAPI = new InternalAPIClass(null);
50
+
51
+ export { InternalAPI, InternalAPIClass };
52
+ //# sourceMappingURL=InternalAPI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalAPI.mjs","sources":["../../../src/internals/InternalAPI.ts"],"sourcesContent":["import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';\nimport { Amplify, Cache, ConsoleLogger } 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 */\nconst logger = new ConsoleLogger('API');\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 with AWS configuration\n * @param {Object} options - Configuration object for API\n */\n constructor(options) {\n this.Cache = Cache;\n this._options = options;\n this._graphqlApi = new InternalGraphQLAPIClass(options);\n logger.debug('API Options', this._options);\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(null);\n"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACxC;AACA;AACA;AACA;AACA;AACO,MAAM,gBAAgB,CAAC;AAC9B;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAChC,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAChE,QAAQ,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnD,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,CAAC,IAAI;;;;"}
@@ -0,0 +1,11 @@
1
+ import { ServerClientGenerationParams, V6Client, V6ClientSSR } from '@aws-amplify/api-graphql';
2
+ /**
3
+ * @private
4
+ *
5
+ * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
6
+ * compatible context object for config and auth fetching.
7
+ *
8
+ * @param params
9
+ * @returns
10
+ */
11
+ export declare function generateServerClient<T extends Record<any, any> = never, ClientType extends V6ClientSSR<T> | V6Client<T> = V6ClientSSR<T>>(params: ServerClientGenerationParams): ClientType;
@@ -0,0 +1,27 @@
1
+ import { __amplify } from '@aws-amplify/api-graphql';
2
+ import { graphql, cancel, isCancelError } from '@aws-amplify/api-graphql/internals';
3
+
4
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
+ // SPDX-License-Identifier: Apache-2.0
6
+ /**
7
+ * @private
8
+ *
9
+ * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
10
+ * compatible context object for config and auth fetching.
11
+ *
12
+ * @param params
13
+ * @returns
14
+ */
15
+ function generateServerClient(params) {
16
+ const client = {
17
+ [__amplify]: params.amplify,
18
+ graphql,
19
+ cancel,
20
+ isCancelError,
21
+ models: {},
22
+ };
23
+ return client;
24
+ }
25
+
26
+ export { generateServerClient };
27
+ //# sourceMappingURL=generateServerClient.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateServerClient.mjs","sources":["../../../src/internals/generateServerClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __amplify, } from '@aws-amplify/api-graphql';\nimport { graphql, cancel, isCancelError, } from '@aws-amplify/api-graphql/internals';\n/**\n * @private\n *\n * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`\n * compatible context object for config and auth fetching.\n *\n * @param params\n * @returns\n */\nexport function generateServerClient(params) {\n const client = {\n [__amplify]: params.amplify,\n graphql,\n cancel,\n isCancelError,\n models: {},\n };\n return client;\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,MAAM,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO;AACnC,QAAQ,OAAO;AACf,QAAQ,MAAM;AACd,QAAQ,aAAa;AACrB,QAAQ,MAAM,EAAE,EAAE;AAClB,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC;AAClB;;;;"}
@@ -1 +1,2 @@
1
1
  export { InternalAPI, InternalAPIClass } from './InternalAPI';
2
+ export { generateServerClient } from './generateServerClient';
@@ -0,0 +1,3 @@
1
+ export { InternalAPI, InternalAPIClass } from './InternalAPI.mjs';
2
+ export { generateServerClient } from './generateServerClient.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1 @@
1
+ export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
@@ -0,0 +1,2 @@
1
+ export { del, get, head, isCancelError, patch, post, put } from '@aws-amplify/api-rest/server';
2
+ //# sourceMappingURL=server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { GraphQLAuthError, graphqlOperation } from '@aws-amplify/api-graphql';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@aws-amplify/api/internals",
3
- "types": "../lib-esm/internals/index.d.ts",
4
- "main": "../lib/internals/index.js",
5
- "module": "../lib-esm/internals/index.js",
6
- "react-native": "../lib-esm/internals/index.js",
3
+ "types": "../dist/esm/internals/index.d.ts",
4
+ "main": "../dist/cjs/internals/index.js",
5
+ "module": "../dist/esm/internals/index.mjs",
6
+ "react-native": "../src/internals/index.ts",
7
7
  "sideEffects": false
8
8
  }
package/package.json CHANGED
@@ -1,23 +1,14 @@
1
1
  {
2
2
  "name": "@aws-amplify/api",
3
- "version": "6.0.1-console-preview.3d7f188.0+3d7f188",
3
+ "version": "6.0.1-mjs-test.20ead30.0+20ead30",
4
4
  "description": "Api category of aws-amplify",
5
- "main": "./lib/index.js",
6
- "module": "./lib-esm/index.js",
7
- "typings": "./lib-esm/index.d.ts",
8
- "typesVersions": {
9
- "<3.8": {
10
- "lib-esm/index.d.ts": [
11
- "index.v37.d.ts"
12
- ]
13
- }
14
- },
15
- "react-native": {
16
- "./lib/index": "./lib-esm/index.js"
17
- },
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.mjs",
7
+ "typings": "./dist/esm/index.d.ts",
8
+ "react-native": "./src/index.ts",
18
9
  "sideEffects": [
19
- "./lib/API.js",
20
- "./lib-esm/API.js"
10
+ "./dist/cjs/API.js",
11
+ "./dist/esm/API.mjs"
21
12
  ],
22
13
  "publishConfig": {
23
14
  "access": "public"
@@ -25,16 +16,46 @@
25
16
  "scripts": {
26
17
  "test": "npm run lint && jest -w 1 --coverage",
27
18
  "build-with-test": "npm test && npm run build",
28
- "build:cjs": "node ./build es5 && webpack && webpack --config ./webpack.config.dev.js",
29
- "build:esm": "node ./build es6",
30
- "build:cjs:watch": "node ./build es5 --watch",
31
- "build:esm:watch": "node ./build es6 --watch",
32
- "build": "npm run clean && npm run build:esm && npm run build:cjs",
33
- "clean": "npm run clean:size && rimraf lib-esm lib dist",
19
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
20
+ "build:esm-cjs": "rollup -c rollup.config.mjs",
21
+ "build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
22
+ "build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
23
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
24
+ "clean": "npm run clean:size && rimraf dist lib lib-esm",
34
25
  "clean:size": "rimraf dual-publish-tmp tmp*",
35
26
  "format": "echo \"Not implemented\"",
36
27
  "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
37
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88"
28
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 88"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/esm/index.d.ts",
33
+ "import": "./dist/esm/index.mjs",
34
+ "require": "./dist/cjs/index.js",
35
+ "react-native": "./src/index.ts"
36
+ },
37
+ "./internals": {
38
+ "types": "./dist/esm/internals/index.d.ts",
39
+ "import": "./dist/esm/internals/index.mjs",
40
+ "require": "./dist/cjs/internals/index.js",
41
+ "react-native": "./src/internals/index.ts"
42
+ },
43
+ "./server": {
44
+ "types": "./dist/esm/server.d.ts",
45
+ "import": "./dist/esm/server.mjs",
46
+ "require": "./dist/cjs/server.js"
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "typesVersions": {
51
+ ">=4.2": {
52
+ "internals": [
53
+ "./dist/esm/internals/index.d.ts"
54
+ ],
55
+ "server": [
56
+ "./dist/esm/server.d.ts"
57
+ ]
58
+ }
38
59
  },
39
60
  "repository": {
40
61
  "type": "git",
@@ -47,25 +68,29 @@
47
68
  },
48
69
  "homepage": "https://aws-amplify.github.io/",
49
70
  "devDependencies": {
71
+ "@rollup/plugin-typescript": "11.1.5",
72
+ "rollup": "3.29.4",
50
73
  "typescript": "5.1.6"
51
74
  },
52
75
  "files": [
53
- "lib",
54
- "lib-esm",
76
+ "dist/cjs",
77
+ "dist/esm",
55
78
  "src",
56
79
  "index.*.d.ts",
57
80
  "internals",
58
81
  "server"
59
82
  ],
60
83
  "dependencies": {
61
- "@aws-amplify/api-graphql": "4.0.1-console-preview.3d7f188.0+3d7f188",
62
- "@aws-amplify/api-rest": "4.0.1-console-preview.3d7f188.0+3d7f188",
63
- "tslib": "^2.6.1"
84
+ "@aws-amplify/api-graphql": "4.0.1-mjs-test.20ead30.0+20ead30",
85
+ "@aws-amplify/api-rest": "4.0.1-mjs-test.20ead30.0+20ead30",
86
+ "tslib": "^2.5.0"
64
87
  },
65
88
  "jest": {
66
89
  "globals": {
67
90
  "ts-jest": {
68
- "diagnostics": false,
91
+ "diagnostics": {
92
+ "pathRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$"
93
+ },
69
94
  "tsConfig": {
70
95
  "lib": [
71
96
  "es5",
@@ -74,7 +99,12 @@
74
99
  "esnext.asynciterable",
75
100
  "es2017.object"
76
101
  ],
77
- "allowJs": true
102
+ "allowJs": true,
103
+ "noEmitOnError": false,
104
+ "strictNullChecks": true,
105
+ "types": [
106
+ "@types/jest"
107
+ ]
78
108
  }
79
109
  }
80
110
  },
@@ -82,6 +112,11 @@
82
112
  "^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
83
113
  },
84
114
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
115
+ "testPathIgnorePatterns": [
116
+ "<rootDir>/__tests__/helpers.ts",
117
+ "<rootDir>/__tests__/fixtures/",
118
+ "<rootDir>/__tests__/utils/"
119
+ ],
85
120
  "moduleFileExtensions": [
86
121
  "ts",
87
122
  "tsx",
@@ -100,11 +135,10 @@
100
135
  }
101
136
  },
102
137
  "coveragePathIgnorePatterns": [
103
- "/node_modules/",
104
- "dist",
105
- "lib",
106
- "lib-esm"
138
+ "<rootDir>/node_modules/",
139
+ "<rootDir>/dist",
140
+ "<rootDir>/__tests__"
107
141
  ]
108
142
  },
109
- "gitHead": "3d7f18818c2f9e0790157aac2d0a0bfe90f21aff"
143
+ "gitHead": "20ead30dfcde204f693f598b063bc05745404e03"
110
144
  }
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@aws-amplify/api/server",
3
- "types": "../lib-esm/server.d.ts",
4
- "main": "../lib/server.js",
5
- "module": "../lib-esm/server.js",
6
- "react-native": "../lib-esm/server.js",
3
+ "types": "../dist/esm/server.d.ts",
4
+ "main": "../dist/cjs/server.js",
5
+ "module": "../dist/esm/server.mjs",
7
6
  "sideEffects": false
8
7
  }
@@ -0,0 +1,38 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import {
5
+ ServerClientGenerationParams,
6
+ V6Client,
7
+ V6ClientSSR,
8
+ __amplify,
9
+ } from '@aws-amplify/api-graphql';
10
+ import {
11
+ graphql,
12
+ cancel,
13
+ isCancelError,
14
+ } from '@aws-amplify/api-graphql/internals';
15
+
16
+ /**
17
+ * @private
18
+ *
19
+ * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
20
+ * compatible context object for config and auth fetching.
21
+ *
22
+ * @param params
23
+ * @returns
24
+ */
25
+ export function generateServerClient<
26
+ T extends Record<any, any> = never,
27
+ ClientType extends V6ClientSSR<T> | V6Client<T> = V6ClientSSR<T>
28
+ >(params: ServerClientGenerationParams): ClientType {
29
+ const client = {
30
+ [__amplify]: params.amplify,
31
+ graphql,
32
+ cancel,
33
+ isCancelError,
34
+ models: {},
35
+ } as any;
36
+
37
+ return client as ClientType;
38
+ }
@@ -1,3 +1,4 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { InternalAPI, InternalAPIClass } from './InternalAPI';
4
+ export { generateServerClient } from './generateServerClient';
package/src/server.ts CHANGED
@@ -1,38 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export { GraphQLQuery, GraphQLSubscription } from './types';
5
- import {
6
- graphql,
7
- cancel,
8
- isCancelError,
9
- } from '@aws-amplify/api-graphql/internals';
10
- import {
11
- AmplifyServer,
12
- getAmplifyServerContext,
13
- } from '@aws-amplify/core/internals/adapter-core';
14
-
15
- import { __amplify, V6Client } from '@aws-amplify/api-graphql';
16
-
17
- export type {
18
- GraphQLResult,
19
- GraphQLReturnType,
20
- } from '@aws-amplify/api-graphql';
21
-
22
- /**
23
- * Generates an API client that can work with models or raw GraphQL
24
- */
25
- export function generateClient<T extends Record<any, any> = never>(
26
- contextSpec: AmplifyServer.ContextSpec
27
- ): V6Client<T> {
28
- return {
29
- [__amplify]: getAmplifyServerContext(contextSpec).amplify,
30
- graphql,
31
- cancel,
32
- isCancelError,
33
- };
34
- }
35
-
36
4
  export {
37
5
  get,
38
6
  put,
package/index.v37.d.ts DELETED
@@ -1,12 +0,0 @@
1
- // the original ts3.7 version declaration file, used by "typesVersions" field in package.json
2
- // https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#file-redirects
3
- // can consider using third-party tool like downlevel-dts in the build process to automate this.
4
- import { API } from './lib-esm/API';
5
- export { API, APIClass } from './lib-esm/API';
6
- export {
7
- graphqlOperation,
8
- GraphQLAuthError,
9
- GRAPHQL_AUTH_MODE,
10
- GraphQLResult,
11
- } from '@aws-amplify/api-graphql';
12
- export default API;
package/lib/.tsbuildinfo DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "version": "3.8.3"
3
- }
package/lib/API.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { V6Client } from '@aws-amplify/api-graphql';
2
- /**
3
- * Generates an API client that can work with models or raw GraphQL
4
- */
5
- export declare function generateClient<T extends Record<any, any> = never>(): V6Client<T>;
package/lib/API.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
- var api_graphql_1 = require("@aws-amplify/api-graphql");
6
- var internals_1 = require("@aws-amplify/api-graphql/internals");
7
- var core_1 = require("@aws-amplify/core");
8
- /**
9
- * Generates an API client that can work with models or raw GraphQL
10
- */
11
- function generateClient() {
12
- var _a;
13
- return _a = {},
14
- _a[api_graphql_1.__amplify] = core_1.Amplify,
15
- _a.graphql = internals_1.graphql,
16
- _a.cancel = internals_1.cancel,
17
- _a.isCancelError = internals_1.isCancelError,
18
- _a;
19
- }
20
- exports.generateClient = generateClient;
21
- //# sourceMappingURL=API.js.map
package/lib/API.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,wDAA+D;AAC/D,gEAI4C;AAC5C,0CAA4C;AAE5C;;GAEG;AACH,SAAgB,cAAc;;IAG7B;QACC,GAAC,uBAAS,IAAG,cAAO;QACpB,UAAO,GAAE,mBAAS;QAClB,SAAM,GAAE,kBAAQ;QAChB,gBAAa,GAAE,yBAAe;WAC7B;AACH,CAAC;AATD,wCASC"}
package/lib/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { GraphQLQuery, GraphQLSubscription } from './types';
2
- export { generateClient } from './API';
3
- export { GraphQLAuthError } from '@aws-amplify/api-graphql';
4
- export type { GraphQLResult, GraphQLReturnType, } from '@aws-amplify/api-graphql';
5
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
package/lib/index.js DELETED
@@ -1,17 +0,0 @@
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 API_1 = require("./API");
6
- exports.generateClient = API_1.generateClient;
7
- var api_graphql_1 = require("@aws-amplify/api-graphql");
8
- exports.GraphQLAuthError = api_graphql_1.GraphQLAuthError;
9
- var api_rest_1 = require("@aws-amplify/api-rest");
10
- exports.get = api_rest_1.get;
11
- exports.put = api_rest_1.put;
12
- exports.post = api_rest_1.post;
13
- exports.del = api_rest_1.del;
14
- exports.head = api_rest_1.head;
15
- exports.patch = api_rest_1.patch;
16
- exports.isCancelError = api_rest_1.isCancelError;
17
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAKtC,6BAAuC;AAA9B,+BAAA,cAAc,CAAA;AAEvB,wDAA4D;AAAnD,yCAAA,gBAAgB,CAAA;AAOzB,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"}
@@ -1,42 +0,0 @@
1
- import { AWSAppSyncRealTimeProvider, GraphQLOperation, GraphQLOptions, GraphQLResult, OperationTypeNode, GraphQLQuery, GraphQLSubscription } from '@aws-amplify/api-graphql';
2
- import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
3
- import { Observable } from 'rxjs';
4
- /**
5
- * @deprecated
6
- * Use RestApi or GraphQLAPI to reduce your application bundle size
7
- * Export Cloud Logic APIs
8
- */
9
- export declare class InternalAPIClass {
10
- /**
11
- * Initialize API with AWS configuration
12
- * @param {Object} options - Configuration object for API
13
- */
14
- private _options;
15
- private _graphqlApi;
16
- Cache: import("@aws-amplify/core/lib-esm/Cache/StorageCache").StorageCache;
17
- /**
18
- * Initialize API with AWS configuration
19
- * @param {Object} options - Configuration object for API
20
- */
21
- constructor(options: any);
22
- getModuleName(): string;
23
- /**
24
- * to get the operation type
25
- * @param operation
26
- */
27
- getGraphqlOperationType(operation: GraphQLOperation): OperationTypeNode;
28
- /**
29
- * Executes a GraphQL operation
30
- *
31
- * @param options - GraphQL Options
32
- * @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config
33
- * @returns An Observable if queryType is 'subscription', else a promise of the graphql result from the query.
34
- */
35
- graphql<T>(options: GraphQLOptions, additionalHeaders?: {
36
- [key: string]: string;
37
- }, customUserAgentDetails?: CustomUserAgentDetails): T extends GraphQLQuery<T> ? Promise<GraphQLResult<T>> : T extends GraphQLSubscription<T> ? Observable<{
38
- provider: AWSAppSyncRealTimeProvider;
39
- value: GraphQLResult<T>;
40
- }> : Promise<GraphQLResult<any>> | Observable<object>;
41
- }
42
- export declare const InternalAPI: InternalAPIClass;
@@ -1 +0,0 @@
1
- {"version":3,"file":"InternalAPI.js","sourceRoot":"","sources":["../../src/internals/InternalAPI.ts"],"names":[],"mappings":";;;AAWA,gEAA6E;AAC7E,0CAAkE;AAClE,2DAI2C;AAG3C;;;;;;;GAOG;AAEH,IAAM,MAAM,GAAG,IAAI,oBAAa,CAAC,KAAK,CAAC,CAAC;AACxC;;;;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,cAAO,EACP,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;IACF,uBAAC;AAAD,CAAC,AArED,IAqEC;AArEY,4CAAgB;AAuEhB,QAAA,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
- var InternalAPI_1 = require("./InternalAPI");
6
- exports.InternalAPI = InternalAPI_1.InternalAPI;
7
- exports.InternalAPIClass = InternalAPI_1.InternalAPIClass;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,6CAA8D;AAArD,oCAAA,WAAW,CAAA;AAAE,yCAAA,gBAAgB,CAAA"}
package/lib/server.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export { GraphQLQuery, GraphQLSubscription } from './types';
2
- import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
3
- import { V6Client } from '@aws-amplify/api-graphql';
4
- export type { GraphQLResult, GraphQLReturnType, } from '@aws-amplify/api-graphql';
5
- /**
6
- * Generates an API client that can work with models or raw GraphQL
7
- */
8
- export declare function generateClient<T extends Record<any, any> = never>(contextSpec: AmplifyServer.ContextSpec): V6Client<T>;
9
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
package/lib/server.js DELETED
@@ -1,29 +0,0 @@
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 internals_1 = require("@aws-amplify/api-graphql/internals");
6
- var adapter_core_1 = require("@aws-amplify/core/internals/adapter-core");
7
- var api_graphql_1 = require("@aws-amplify/api-graphql");
8
- /**
9
- * Generates an API client that can work with models or raw GraphQL
10
- */
11
- function generateClient(contextSpec) {
12
- var _a;
13
- return _a = {},
14
- _a[api_graphql_1.__amplify] = adapter_core_1.getAmplifyServerContext(contextSpec).amplify,
15
- _a.graphql = internals_1.graphql,
16
- _a.cancel = internals_1.cancel,
17
- _a.isCancelError = internals_1.isCancelError,
18
- _a;
19
- }
20
- exports.generateClient = generateClient;
21
- var server_1 = require("@aws-amplify/api-rest/server");
22
- exports.get = server_1.get;
23
- exports.put = server_1.put;
24
- exports.post = server_1.post;
25
- exports.del = server_1.del;
26
- exports.head = server_1.head;
27
- exports.patch = server_1.patch;
28
- exports.isCancelError = server_1.isCancelError;
29
- //# sourceMappingURL=server.js.map
package/lib/server.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAGtC,gEAI4C;AAC5C,yEAGkD;AAElD,wDAA+D;AAO/D;;GAEG;AACH,SAAgB,cAAc,CAC7B,WAAsC;;IAEtC;QACC,GAAC,uBAAS,IAAG,sCAAuB,CAAC,WAAW,CAAC,CAAC,OAAO;QACzD,UAAO,sBAAA;QACP,SAAM,qBAAA;QACN,gBAAa,4BAAA;WACZ;AACH,CAAC;AATD,wCASC;AAED,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"}
@@ -1,6 +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, GraphQLQuery, GraphQLSubscription, } from '@aws-amplify/api-graphql';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC;;;;GAIG;AACH,wDAMkC;AALjC,yCAAA,gBAAgB,CAAA;AAChB,yCAAA,gBAAgB,CAAA"}
@@ -1,3 +0,0 @@
1
- {
2
- "version": "3.8.3"
3
- }
package/lib-esm/API.js DELETED
@@ -1,18 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { __amplify } from '@aws-amplify/api-graphql';
4
- import { graphql as v6graphql, cancel as v6cancel, isCancelError as v6isCancelError, } from '@aws-amplify/api-graphql/internals';
5
- import { Amplify } from '@aws-amplify/core';
6
- /**
7
- * Generates an API client that can work with models or raw GraphQL
8
- */
9
- export function generateClient() {
10
- var _a;
11
- return _a = {},
12
- _a[__amplify] = Amplify,
13
- _a.graphql = v6graphql,
14
- _a.cancel = v6cancel,
15
- _a.isCancelError = v6isCancelError,
16
- _a;
17
- }
18
- //# sourceMappingURL=API.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"API.js","sourceRoot":"","sources":["../src/API.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAY,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACN,OAAO,IAAI,SAAS,EACpB,MAAM,IAAI,QAAQ,EAClB,aAAa,IAAI,eAAe,GAChC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,cAAc;;IAG7B;QACC,GAAC,SAAS,IAAG,OAAO;QACpB,UAAO,GAAE,SAAS;QAClB,SAAM,GAAE,QAAQ;QAChB,gBAAa,GAAE,eAAe;WAC7B;AACH,CAAC"}
package/lib-esm/index.js DELETED
@@ -1,6 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export { generateClient } from './API';
4
- export { GraphQLAuthError } from '@aws-amplify/api-graphql';
5
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAO5D,OAAO,EACN,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,GACb,MAAM,uBAAuB,CAAC"}
@@ -1 +0,0 @@
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,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EACN,SAAS,EACT,QAAQ,GAER,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;GAOG;AAEH,IAAM,MAAM,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACxC;;;;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,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;IACF,uBAAC;AAAD,CAAC,AArED,IAqEC;;AAED,MAAM,CAAC,IAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export { InternalAPI, InternalAPIClass } from './InternalAPI';
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export { InternalAPI, InternalAPIClass } from './InternalAPI';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,9 +0,0 @@
1
- export { GraphQLQuery, GraphQLSubscription } from './types';
2
- import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
3
- import { V6Client } from '@aws-amplify/api-graphql';
4
- export type { GraphQLResult, GraphQLReturnType, } from '@aws-amplify/api-graphql';
5
- /**
6
- * Generates an API client that can work with models or raw GraphQL
7
- */
8
- export declare function generateClient<T extends Record<any, any> = never>(contextSpec: AmplifyServer.ContextSpec): V6Client<T>;
9
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
package/lib-esm/server.js DELETED
@@ -1,19 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { graphql, cancel, isCancelError, } from '@aws-amplify/api-graphql/internals';
4
- import { getAmplifyServerContext, } from '@aws-amplify/core/internals/adapter-core';
5
- import { __amplify } from '@aws-amplify/api-graphql';
6
- /**
7
- * Generates an API client that can work with models or raw GraphQL
8
- */
9
- export function generateClient(contextSpec) {
10
- var _a;
11
- return _a = {},
12
- _a[__amplify] = getAmplifyServerContext(contextSpec).amplify,
13
- _a.graphql = graphql,
14
- _a.cancel = cancel,
15
- _a.isCancelError = isCancelError,
16
- _a;
17
- }
18
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
19
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EACN,OAAO,EACP,MAAM,EACN,aAAa,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEN,uBAAuB,GACvB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,SAAS,EAAY,MAAM,0BAA0B,CAAC;AAO/D;;GAEG;AACH,MAAM,UAAU,cAAc,CAC7B,WAAsC;;IAEtC;QACC,GAAC,SAAS,IAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC,OAAO;QACzD,UAAO,UAAA;QACP,SAAM,SAAA;QACN,gBAAa,gBAAA;WACZ;AACH,CAAC;AAED,OAAO,EACN,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,GACb,MAAM,8BAA8B,CAAC"}
@@ -1,9 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * This exports from the types directory is a temporary workaround, since Amplify CLI currently
5
- * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
6
- * This will be removed in future release when CLI and customers moves to recommeneded import styles.
7
- */
8
- export { graphqlOperation, GraphQLAuthError, } from '@aws-amplify/api-graphql';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,GAIhB,MAAM,0BAA0B,CAAC"}
File without changes
File without changes
File without changes