@aws-amplify/api 6.0.1-unstable.cfbde4c.0 → 6.0.2-unstable.b778a9e.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 (76) hide show
  1. package/dist/cjs/API.js +17 -0
  2. package/dist/cjs/API.js.map +1 -0
  3. package/dist/cjs/index.js +20 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/{lib → dist/cjs}/internals/InternalAPI.js +4 -2
  6. package/dist/cjs/internals/InternalAPI.js.map +1 -0
  7. package/dist/cjs/internals/index.js +12 -0
  8. package/dist/cjs/internals/index.js.map +1 -0
  9. package/dist/cjs/server.js +15 -0
  10. package/dist/cjs/server.js.map +1 -0
  11. package/{lib → dist/cjs}/types/index.js +6 -4
  12. package/dist/cjs/types/index.js.map +1 -0
  13. package/dist/esm/API.d.ts +5 -0
  14. package/dist/esm/API.mjs +15 -0
  15. package/dist/esm/API.mjs.map +1 -0
  16. package/dist/esm/index.d.ts +5 -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} +8 -5
  21. package/dist/esm/internals/InternalAPI.mjs.map +1 -0
  22. package/dist/esm/internals/index.d.ts +2 -0
  23. package/dist/esm/internals/index.mjs +3 -0
  24. package/dist/esm/internals/index.mjs.map +1 -0
  25. package/dist/esm/server.mjs +2 -0
  26. package/dist/esm/server.mjs.map +1 -0
  27. package/{lib-esm → dist/esm}/types/index.d.ts +1 -1
  28. package/dist/esm/types/index.mjs +2 -0
  29. package/dist/esm/types/index.mjs.map +1 -0
  30. package/internals/package.json +4 -4
  31. package/package.json +62 -26
  32. package/server/package.json +3 -4
  33. package/src/API.ts +9 -15
  34. package/src/index.ts +3 -4
  35. package/src/internals/index.ts +1 -1
  36. package/src/types/index.ts +1 -0
  37. package/lib/.tsbuildinfo +0 -3
  38. package/lib/API.d.ts +0 -5
  39. package/lib/API.js +0 -20
  40. package/lib/API.js.map +0 -1
  41. package/lib/index.d.ts +0 -5
  42. package/lib/index.js +0 -17
  43. package/lib/index.js.map +0 -1
  44. package/lib/internals/InternalAPI.d.ts +0 -42
  45. package/lib/internals/InternalAPI.js.map +0 -1
  46. package/lib/internals/generateServerClient.d.ts +0 -11
  47. package/lib/internals/generateServerClient.js +0 -27
  48. package/lib/internals/generateServerClient.js.map +0 -1
  49. package/lib/internals/index.d.ts +0 -2
  50. package/lib/internals/index.js +0 -10
  51. package/lib/internals/index.js.map +0 -1
  52. package/lib/server.d.ts +0 -1
  53. package/lib/server.js +0 -13
  54. package/lib/server.js.map +0 -1
  55. package/lib/types/index.d.ts +0 -6
  56. package/lib/types/index.js.map +0 -1
  57. package/lib-esm/.tsbuildinfo +0 -3
  58. package/lib-esm/API.d.ts +0 -5
  59. package/lib-esm/API.js +0 -17
  60. package/lib-esm/API.js.map +0 -1
  61. package/lib-esm/index.d.ts +0 -5
  62. package/lib-esm/index.js +0 -6
  63. package/lib-esm/index.js.map +0 -1
  64. package/lib-esm/internals/InternalAPI.js.map +0 -1
  65. package/lib-esm/internals/generateServerClient.d.ts +0 -11
  66. package/lib-esm/internals/generateServerClient.js +0 -24
  67. package/lib-esm/internals/generateServerClient.js.map +0 -1
  68. package/lib-esm/internals/index.d.ts +0 -2
  69. package/lib-esm/internals/index.js +0 -5
  70. package/lib-esm/internals/index.js.map +0 -1
  71. package/lib-esm/server.js +0 -4
  72. package/lib-esm/server.js.map +0 -1
  73. package/lib-esm/types/index.js +0 -9
  74. package/lib-esm/types/index.js.map +0 -1
  75. package/src/internals/generateServerClient.ts +0 -38
  76. /package/{lib-esm → dist/esm}/server.d.ts +0 -0
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.generateClient = void 0;
5
+ const internals_1 = require("@aws-amplify/api-graphql/internals");
6
+ const core_1 = require("@aws-amplify/core");
7
+ /**
8
+ * Generates an API client that can work with models or raw GraphQL
9
+ */
10
+ function generateClient(options = {}) {
11
+ return (0, internals_1.generateClient)({
12
+ ...options,
13
+ amplify: core_1.Amplify,
14
+ });
15
+ }
16
+ exports.generateClient = generateClient;
17
+ //# 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;\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(options = {}) {\n return (0, internals_1.generateClient)({\n ...options,\n amplify: core_1.Amplify,\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,MAAM,WAAW,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C;AACA;AACA;AACA,SAAS,cAAc,CAAC,OAAO,GAAG,EAAE,EAAE;AACtC,IAAI,OAAO,IAAI,WAAW,CAAC,cAAc,EAAE;AAC3C,QAAQ,GAAG,OAAO;AAClB,QAAQ,OAAO,EAAE,MAAM,CAAC,OAAO;AAC/B,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -0,0 +1,20 @@
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.ConnectionState = 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
+ Object.defineProperty(exports, "ConnectionState", { enumerable: true, get: function () { return api_graphql_1.ConnectionState; } });
12
+ var api_rest_1 = require("@aws-amplify/api-rest");
13
+ Object.defineProperty(exports, "get", { enumerable: true, get: function () { return api_rest_1.get; } });
14
+ Object.defineProperty(exports, "put", { enumerable: true, get: function () { return api_rest_1.put; } });
15
+ Object.defineProperty(exports, "post", { enumerable: true, get: function () { return api_rest_1.post; } });
16
+ Object.defineProperty(exports, "del", { enumerable: true, get: function () { return api_rest_1.del; } });
17
+ Object.defineProperty(exports, "head", { enumerable: true, get: function () { return api_rest_1.head; } });
18
+ Object.defineProperty(exports, "patch", { enumerable: true, get: function () { return api_rest_1.patch; } });
19
+ Object.defineProperty(exports, "isCancelError", { enumerable: true, get: function () { return api_rest_1.isCancelError; } });
20
+ //# 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.ConnectionState = 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; } });\nObject.defineProperty(exports, \"ConnectionState\", { enumerable: true, get: function () { return api_graphql_1.ConnectionState; } });\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,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AACrM,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,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC;AACpI,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,5 +1,7 @@
1
- "use strict";
1
+ 'use strict';
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.InternalAPI = exports.InternalAPIClass = void 0;
3
5
  const internals_1 = require("@aws-amplify/api-graphql/internals");
4
6
  const core_1 = require("@aws-amplify/core");
5
7
  const utils_1 = require("@aws-amplify/core/internals/utils");
@@ -49,4 +51,4 @@ class InternalAPIClass {
49
51
  }
50
52
  exports.InternalAPIClass = InternalAPIClass;
51
53
  exports.InternalAPI = new InternalAPIClass(null);
52
- //# 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,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 server_1 = require("@aws-amplify/api-graphql/internals/server");
11
+ Object.defineProperty(exports, "generateServerClient", { enumerable: true, get: function () { return server_1.generateClient; } });
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 server_1 = require(\"@aws-amplify/api-graphql/internals/server\");\nObject.defineProperty(exports, \"generateServerClient\", { enumerable: true, get: function () { return server_1.generateClient; } });\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,QAAQ,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;AACpE,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,QAAQ,CAAC,cAAc,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,5 @@
1
+ import { V6Client, CommonPublicClientOptions } 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>(options?: CommonPublicClientOptions): V6Client<T>;
@@ -0,0 +1,15 @@
1
+ import { generateClient as generateClient$1 } from '@aws-amplify/api-graphql/internals';
2
+ import { Amplify } from '@aws-amplify/core';
3
+
4
+ /**
5
+ * Generates an API client that can work with models or raw GraphQL
6
+ */
7
+ function generateClient(options = {}) {
8
+ return generateClient$1({
9
+ ...options,
10
+ amplify: Amplify,
11
+ });
12
+ }
13
+
14
+ export { generateClient };
15
+ //# sourceMappingURL=API.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"API.mjs","sources":["../../src/API.ts"],"sourcesContent":["import { generateClient as internalGenerateClient } 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(options = {}) {\n return internalGenerateClient({\n ...options,\n amplify: Amplify,\n });\n}\n"],"names":["internalGenerateClient"],"mappings":";;;AAEA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,GAAG,EAAE,EAAE;AAC7C,IAAI,OAAOA,gBAAsB,CAAC;AAClC,QAAQ,GAAG,OAAO;AAClB,QAAQ,OAAO,EAAE,OAAO;AACxB,KAAK,CAAC,CAAC;AACP;;;;"}
@@ -0,0 +1,5 @@
1
+ export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
2
+ export { generateClient } from './API';
3
+ export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
4
+ export type { GraphQLResult, GraphQLReturnType, CONNECTION_STATE_CHANGE, } from '@aws-amplify/api-graphql';
5
+ export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
@@ -0,0 +1,4 @@
1
+ export { generateClient } from './API.mjs';
2
+ export { ConnectionState, 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,6 +1,7 @@
1
1
  import { InternalGraphQLAPIClass } from '@aws-amplify/api-graphql/internals';
2
- import { Amplify, Cache, ConsoleLogger } from '@aws-amplify/core';
3
- 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
+
4
5
  /**
5
6
  * NOTE!
6
7
  *
@@ -15,7 +16,7 @@ const logger = new ConsoleLogger('API');
15
16
  * Use RestApi or GraphQLAPI to reduce your application bundle size
16
17
  * Export Cloud Logic APIs
17
18
  */
18
- export class InternalAPIClass {
19
+ class InternalAPIClass {
19
20
  /**
20
21
  * Initialize API with AWS configuration
21
22
  * @param {Object} options - Configuration object for API
@@ -45,5 +46,7 @@ export class InternalAPIClass {
45
46
  return this._graphqlApi.graphql(Amplify, options, additionalHeaders, apiUserAgentDetails);
46
47
  }
47
48
  }
48
- export const InternalAPI = new InternalAPIClass(null);
49
- //# sourceMappingURL=InternalAPI.js.map
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,2 @@
1
+ export { InternalAPI, InternalAPIClass } from './InternalAPI';
2
+ export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
@@ -0,0 +1,3 @@
1
+ export { InternalAPI, InternalAPIClass } from './InternalAPI.mjs';
2
+ export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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":""}
@@ -3,4 +3,4 @@
3
3
  * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
4
4
  * This will be removed in future release when CLI and customers moves to recommeneded import styles.
5
5
  */
6
- export { graphqlOperation, GraphQLAuthError, GraphQLResult, GraphQLQuery, GraphQLSubscription, } from '@aws-amplify/api-graphql';
6
+ export { graphqlOperation, GraphQLAuthError, GraphQLResult, GraphQLQuery, GraphQLSubscription, SelectionSet, } from '@aws-amplify/api-graphql';
@@ -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,16 +1,14 @@
1
1
  {
2
2
  "name": "@aws-amplify/api",
3
- "version": "6.0.1-unstable.cfbde4c.0+cfbde4c",
3
+ "version": "6.0.2-unstable.b778a9e.0+b778a9e",
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
- "react-native": {
9
- "./lib/index": "./lib-esm/index.js"
10
- },
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",
11
9
  "sideEffects": [
12
- "./lib/API.js",
13
- "./lib-esm/API.js"
10
+ "./dist/cjs/API.js",
11
+ "./dist/esm/API.mjs"
14
12
  ],
15
13
  "publishConfig": {
16
14
  "access": "public"
@@ -18,16 +16,46 @@
18
16
  "scripts": {
19
17
  "test": "npm run lint && jest -w 1 --coverage",
20
18
  "build-with-test": "npm test && npm run build",
21
- "build:cjs": "node ./build es5 && webpack && webpack --config ./webpack.config.dev.js",
22
- "build:esm": "node ./build es6",
23
- "build:cjs:watch": "node ./build es5 --watch",
24
- "build:esm:watch": "node ./build es6 --watch",
25
- "build": "npm run clean && npm run build:esm && npm run build:cjs",
26
- "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",
27
25
  "clean:size": "rimraf dual-publish-tmp tmp*",
28
26
  "format": "echo \"Not implemented\"",
29
27
  "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
30
- "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
+ }
31
59
  },
32
60
  "repository": {
33
61
  "type": "git",
@@ -40,25 +68,29 @@
40
68
  },
41
69
  "homepage": "https://aws-amplify.github.io/",
42
70
  "devDependencies": {
71
+ "@rollup/plugin-typescript": "11.1.5",
72
+ "rollup": "3.29.4",
43
73
  "typescript": "5.1.6"
44
74
  },
45
75
  "files": [
46
- "lib",
47
- "lib-esm",
76
+ "dist/cjs",
77
+ "dist/esm",
48
78
  "src",
49
79
  "index.*.d.ts",
50
80
  "internals",
51
81
  "server"
52
82
  ],
53
83
  "dependencies": {
54
- "@aws-amplify/api-graphql": "4.0.1-unstable.cfbde4c.0+cfbde4c",
55
- "@aws-amplify/api-rest": "4.0.1-unstable.cfbde4c.0+cfbde4c",
84
+ "@aws-amplify/api-graphql": "4.0.2-unstable.b778a9e.0+b778a9e",
85
+ "@aws-amplify/api-rest": "4.0.2-unstable.b778a9e.0+b778a9e",
56
86
  "tslib": "^2.5.0"
57
87
  },
58
88
  "jest": {
59
89
  "globals": {
60
90
  "ts-jest": {
61
- "diagnostics": false,
91
+ "diagnostics": {
92
+ "pathRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$"
93
+ },
62
94
  "tsConfig": {
63
95
  "lib": [
64
96
  "es5",
@@ -67,7 +99,12 @@
67
99
  "esnext.asynciterable",
68
100
  "es2017.object"
69
101
  ],
70
- "allowJs": true
102
+ "allowJs": true,
103
+ "noEmitOnError": false,
104
+ "strictNullChecks": true,
105
+ "types": [
106
+ "@types/jest"
107
+ ]
71
108
  }
72
109
  }
73
110
  },
@@ -93,11 +130,10 @@
93
130
  }
94
131
  },
95
132
  "coveragePathIgnorePatterns": [
96
- "/node_modules/",
133
+ "node_modules",
97
134
  "dist",
98
- "lib",
99
- "lib-esm"
135
+ "__tests__"
100
136
  ]
101
137
  },
102
- "gitHead": "cfbde4c7962de77bd43ba20811b84c4d7d333b42"
138
+ "gitHead": "b778a9e3b05c6f0f52fcfaab79729f4d7d439444"
103
139
  }
@@ -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
  }
package/src/API.ts CHANGED
@@ -1,23 +1,17 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { __amplify, V6Client } from '@aws-amplify/api-graphql';
4
- import {
5
- graphql as v6graphql,
6
- cancel as v6cancel,
7
- isCancelError as v6isCancelError,
8
- } from '@aws-amplify/api-graphql/internals';
3
+ import { V6Client, CommonPublicClientOptions } from '@aws-amplify/api-graphql';
4
+ import { generateClient as internalGenerateClient } from '@aws-amplify/api-graphql/internals';
9
5
  import { Amplify } from '@aws-amplify/core';
10
6
 
11
7
  /**
12
8
  * Generates an API client that can work with models or raw GraphQL
13
9
  */
14
- export function generateClient<
15
- T extends Record<any, any> = never
16
- >(): V6Client<T> {
17
- return {
18
- [__amplify]: Amplify,
19
- graphql: v6graphql,
20
- cancel: v6cancel,
21
- isCancelError: v6isCancelError,
22
- };
10
+ export function generateClient<T extends Record<any, any> = never>(
11
+ options: CommonPublicClientOptions = {}
12
+ ): V6Client<T> {
13
+ return internalGenerateClient({
14
+ ...options,
15
+ amplify: Amplify,
16
+ }) as unknown as V6Client<T>;
23
17
  }
package/src/index.ts CHANGED
@@ -1,16 +1,15 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- // TODO(v6): revisit exports
5
-
6
- export { GraphQLQuery, GraphQLSubscription } from './types';
4
+ export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
7
5
  export { generateClient } from './API';
8
6
 
9
- export { GraphQLAuthError } from '@aws-amplify/api-graphql';
7
+ export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
10
8
 
11
9
  export type {
12
10
  GraphQLResult,
13
11
  GraphQLReturnType,
12
+ CONNECTION_STATE_CHANGE,
14
13
  } from '@aws-amplify/api-graphql';
15
14
 
16
15
  export {
@@ -1,4 +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';
4
+ export { generateClient as generateServerClient } from '@aws-amplify/api-graphql/internals/server';
@@ -12,4 +12,5 @@ export {
12
12
  GraphQLResult,
13
13
  GraphQLQuery,
14
14
  GraphQLSubscription,
15
+ SelectionSet,
15
16
  } from '@aws-amplify/api-graphql';
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,20 +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
- const api_graphql_1 = require("@aws-amplify/api-graphql");
6
- const internals_1 = require("@aws-amplify/api-graphql/internals");
7
- const 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
- return {
13
- [api_graphql_1.__amplify]: core_1.Amplify,
14
- graphql: internals_1.graphql,
15
- cancel: internals_1.cancel,
16
- isCancelError: internals_1.isCancelError,
17
- };
18
- }
19
- exports.generateClient = generateClient;
20
- //# 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,0DAA+D;AAC/D,kEAI4C;AAC5C,4CAA4C;AAE5C;;GAEG;AACH,SAAgB,cAAc;IAG7B,OAAO;QACN,CAAC,uBAAS,CAAC,EAAE,cAAO;QACpB,OAAO,EAAE,mBAAS;QAClB,MAAM,EAAE,kBAAQ;QAChB,aAAa,EAAE,yBAAe;KAC9B,CAAC;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,kEAA6E;AAC7E,4CAAkE;AAClE,6DAI2C;AAG3C;;;;;;;GAOG;AAEH,MAAM,MAAM,GAAG,IAAI,oBAAa,CAAC,KAAK,CAAC,CAAC;AACxC;;;;GAIG;AACH,MAAa,gBAAgB;IAU5B;;;OAGG;IACH,YAAY,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,aAAa;QACnB,OAAO,aAAa,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAqBD,OAAO,CACN,OAAuB,EACvB,iBAA6C,EAC7C,sBAA+C;QAE/C,MAAM,mBAAmB,GAA2B;YACnD,QAAQ,EAAE,gBAAQ,CAAC,GAAG;YACtB,MAAM,EAAE,iBAAS,CAAC,OAAO;YACzB,GAAG,sBAAsB;SACzB,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC9B,cAAO,EACP,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;CACD;AArED,4CAqEC;AAEY,QAAA,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
@@ -1,11 +0,0 @@
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;
@@ -1,27 +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
- const api_graphql_1 = require("@aws-amplify/api-graphql");
6
- const internals_1 = require("@aws-amplify/api-graphql/internals");
7
- /**
8
- * @private
9
- *
10
- * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
11
- * compatible context object for config and auth fetching.
12
- *
13
- * @param params
14
- * @returns
15
- */
16
- function generateServerClient(params) {
17
- const client = {
18
- [api_graphql_1.__amplify]: params.amplify,
19
- graphql: internals_1.graphql,
20
- cancel: internals_1.cancel,
21
- isCancelError: internals_1.isCancelError,
22
- models: {},
23
- };
24
- return client;
25
- }
26
- exports.generateServerClient = generateServerClient;
27
- //# sourceMappingURL=generateServerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateServerClient.js","sourceRoot":"","sources":["../../src/internals/generateServerClient.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,0DAKkC;AAClC,kEAI4C;AAE5C;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAGlC,MAAoC;IACrC,MAAM,MAAM,GAAG;QACd,CAAC,uBAAS,CAAC,EAAE,MAAM,CAAC,OAAO;QAC3B,OAAO,EAAP,mBAAO;QACP,MAAM,EAAN,kBAAM;QACN,aAAa,EAAb,yBAAa;QACb,MAAM,EAAE,EAAE;KACH,CAAC;IAET,OAAO,MAAoB,CAAC;AAC7B,CAAC;AAbD,oDAaC"}
@@ -1,2 +0,0 @@
1
- export { InternalAPI, InternalAPIClass } from './InternalAPI';
2
- export { generateServerClient } from './generateServerClient';
@@ -1,10 +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
- var generateServerClient_1 = require("./generateServerClient");
9
- exports.generateServerClient = generateServerClient_1.generateServerClient;
10
- //# 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;AACtC,+DAA8D;AAArD,sDAAA,oBAAoB,CAAA"}
package/lib/server.d.ts DELETED
@@ -1 +0,0 @@
1
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
package/lib/server.js DELETED
@@ -1,13 +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 server_1 = require("@aws-amplify/api-rest/server");
6
- exports.get = server_1.get;
7
- exports.put = server_1.put;
8
- exports.post = server_1.post;
9
- exports.del = server_1.del;
10
- exports.head = server_1.head;
11
- exports.patch = server_1.patch;
12
- exports.isCancelError = server_1.isCancelError;
13
- //# sourceMappingURL=server.js.map
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;;AAEtC,uDAQsC;AAPrC,uBAAA,GAAG,CAAA;AACH,uBAAA,GAAG,CAAA;AACH,wBAAA,IAAI,CAAA;AACJ,uBAAA,GAAG,CAAA;AACH,wBAAA,IAAI,CAAA;AACJ,yBAAA,KAAK,CAAA;AACL,iCAAA,aAAa,CAAA"}
@@ -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.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-esm/API.js DELETED
@@ -1,17 +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
- return {
11
- [__amplify]: Amplify,
12
- graphql: v6graphql,
13
- cancel: v6cancel,
14
- isCancelError: v6isCancelError,
15
- };
16
- }
17
- //# 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,OAAO;QACN,CAAC,SAAS,CAAC,EAAE,OAAO;QACpB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,eAAe;KAC9B,CAAC;AACH,CAAC"}
@@ -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-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,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACxC;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IAU5B;;;OAGG;IACH,YAAY,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,aAAa;QACnB,OAAO,aAAa,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,SAA2B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAqBD,OAAO,CACN,OAAuB,EACvB,iBAA6C,EAC7C,sBAA+C;QAE/C,MAAM,mBAAmB,GAA2B;YACnD,QAAQ,EAAE,QAAQ,CAAC,GAAG;YACtB,MAAM,EAAE,SAAS,CAAC,OAAO;YACzB,GAAG,sBAAsB;SACzB,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAC9B,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACnB,CAAC;IACH,CAAC;CACD;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC"}
@@ -1,11 +0,0 @@
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;
@@ -1,24 +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, cancel, isCancelError, } from '@aws-amplify/api-graphql/internals';
5
- /**
6
- * @private
7
- *
8
- * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
9
- * compatible context object for config and auth fetching.
10
- *
11
- * @param params
12
- * @returns
13
- */
14
- export function generateServerClient(params) {
15
- const client = {
16
- [__amplify]: params.amplify,
17
- graphql,
18
- cancel,
19
- isCancelError,
20
- models: {},
21
- };
22
- return client;
23
- }
24
- //# sourceMappingURL=generateServerClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateServerClient.js","sourceRoot":"","sources":["../../src/internals/generateServerClient.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAIN,SAAS,GACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,OAAO,EACP,MAAM,EACN,aAAa,GACb,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAGlC,MAAoC;IACrC,MAAM,MAAM,GAAG;QACd,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO;QAC3B,OAAO;QACP,MAAM;QACN,aAAa;QACb,MAAM,EAAE,EAAE;KACH,CAAC;IAET,OAAO,MAAoB,CAAC;AAC7B,CAAC"}
@@ -1,2 +0,0 @@
1
- export { InternalAPI, InternalAPIClass } from './InternalAPI';
2
- export { generateServerClient } from './generateServerClient';
@@ -1,5 +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
- export { generateServerClient } from './generateServerClient';
5
- //# 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;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
package/lib-esm/server.js DELETED
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest/server';
4
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EACN,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,GACb,MAAM,8BAA8B,CAAC"}
@@ -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"}
@@ -1,38 +0,0 @@
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
- }
File without changes