@aws-amplify/api-rest 4.0.16 → 4.0.17-unstable.3d2803e.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.
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;
5
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
4
  // SPDX-License-Identifier: Apache-2.0
7
- const core_1 = require("@aws-amplify/core");
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;
8
7
  const internalPost_1 = require("../apis/common/internalPost");
9
8
  /**
10
9
  * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize
@@ -22,10 +21,7 @@ const internalPost_1 = require("../apis/common/internalPost");
22
21
  *
23
22
  * @internal
24
23
  */
25
- const post = (input) => {
26
- return (0, internalPost_1.post)(core_1.Amplify, input);
27
- };
28
- exports.post = post;
24
+ exports.post = internalPost_1.post;
29
25
  var internalPost_2 = require("../apis/common/internalPost");
30
26
  Object.defineProperty(exports, "cancel", { enumerable: true, get: function () { return internalPost_2.cancel; } });
31
27
  Object.defineProperty(exports, "updateRequestToBeCancellable", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/internals/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst core_1 = require(\"@aws-amplify/core\");\nconst internalPost_1 = require(\"../apis/common/internalPost\");\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nconst post = (input) => {\n return (0, internalPost_1.post)(core_1.Amplify, input);\n};\nexports.post = post;\nvar internalPost_2 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"cancel\", { enumerable: true, get: function () { return internalPost_2.cancel; } });\nObject.defineProperty(exports, \"updateRequestToBeCancellable\", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;AAC9E;AACA;AACA,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK;AACxB,IAAI,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAC;AACF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACnH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/internals/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.updateRequestToBeCancellable = exports.cancel = exports.post = void 0;\nconst internalPost_1 = require(\"../apis/common/internalPost\");\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nexports.post = internalPost_1.post;\nvar internalPost_2 = require(\"../apis/common/internalPost\");\nObject.defineProperty(exports, \"cancel\", { enumerable: true, get: function () { return internalPost_2.cancel; } });\nObject.defineProperty(exports, \"updateRequestToBeCancellable\", { enumerable: true, get: function () { return internalPost_2.updateRequestToBeCancellable; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;AAC9E,MAAM,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;AACnC,IAAI,cAAc,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACnH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,cAAc,CAAC,4BAA4B,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1,4 +1,3 @@
1
- import { InternalPostInput } from '../types';
2
1
  /**
3
2
  * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize
4
3
  * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:
@@ -15,5 +14,5 @@ import { InternalPostInput } from '../types';
15
14
  *
16
15
  * @internal
17
16
  */
18
- export declare const post: (input: InternalPostInput) => Promise<import("../types").RestApiResponse>;
17
+ export declare const post: (amplify: import("@aws-amplify/core").AmplifyClassV6, { url, options, abortController }: import("../types").InternalPostInput) => Promise<import("../types").RestApiResponse>;
19
18
  export { cancel, updateRequestToBeCancellable, } from '../apis/common/internalPost';
@@ -1,4 +1,3 @@
1
- import { Amplify } from '@aws-amplify/core';
2
1
  import { post as post$1 } from '../apis/common/internalPost.mjs';
3
2
  export { cancel, updateRequestToBeCancellable } from '../apis/common/internalPost.mjs';
4
3
 
@@ -20,9 +19,7 @@ export { cancel, updateRequestToBeCancellable } from '../apis/common/internalPos
20
19
  *
21
20
  * @internal
22
21
  */
23
- const post = (input) => {
24
- return post$1(Amplify, input);
25
- };
22
+ const post = post$1;
26
23
 
27
24
  export { post };
28
25
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/internals/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Amplify } from '@aws-amplify/core';\nimport { post as internalPost } from '../apis/common/internalPost';\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nexport const post = (input) => {\n return internalPost(Amplify, input);\n};\nexport { cancel, updateRequestToBeCancellable, } from '../apis/common/internalPost';\n"],"names":["internalPost"],"mappings":";;;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,CAAC,KAAK,KAAK;AAC/B,IAAI,OAAOA,MAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACxC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/internals/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { post as internalPost } from '../apis/common/internalPost';\n/**\n * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize\n * the request. In some auth modes, the IAM auth has to be disabled. Here's how to set up the request auth correctly:\n * * If auth mode is 'iam', you MUST NOT set 'authorization' header and 'x-api-key' header, since it would disable IAM\n * auth. You MUST also set 'input.options.signingServiceInfo' option.\n * * The including 'input.options.signingServiceInfo.service' and 'input.options.signingServiceInfo.region' are\n * optional. If omitted, the signing service and region will be inferred from url.\n * * If auth mode is 'none', you MUST NOT set 'options.signingServiceInfo' option.\n * * If auth mode is 'apiKey', you MUST set 'x-api-key' custom header.\n * * If auth mode is 'oidc' or 'lambda' or 'userPool', you MUST set 'authorization' header.\n *\n * To make the internal post cancellable, you must also call `updateRequestToBeCancellable()` with the promise from\n * internal post call and the abort controller supplied to the internal post call.\n *\n * @internal\n */\nexport const post = internalPost;\nexport { cancel, updateRequestToBeCancellable, } from '../apis/common/internalPost';\n"],"names":["internalPost"],"mappings":";;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAGA;;;;"}
package/package.json CHANGED
@@ -1,102 +1,102 @@
1
1
  {
2
- "name": "@aws-amplify/api-rest",
3
- "private": false,
4
- "version": "4.0.16",
5
- "description": "Api-rest category of aws-amplify",
6
- "main": "./dist/cjs/index.js",
7
- "module": "./dist/esm/index.mjs",
8
- "typings": "./dist/esm/index.d.ts",
9
- "react-native": "./src/index.ts",
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "scripts": {
14
- "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
15
- "test:watch": "tslint 'src/**/*.ts' && jest -w 1 --watch",
16
- "build-with-test": "npm test && npm build",
17
- "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
18
- "build:esm-cjs": "rollup -c rollup.config.mjs",
19
- "build:watch": "npm run build:esm-cjs -- --watch",
20
- "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
21
- "clean": "npm run clean:size && rimraf dist lib lib-esm",
22
- "clean:size": "rimraf dual-publish-tmp tmp*",
23
- "format": "echo \"Not implemented\"",
24
- "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
25
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
26
- },
27
- "exports": {
28
- ".": {
29
- "types": "./dist/esm/index.d.ts",
30
- "import": "./dist/esm/index.mjs",
31
- "require": "./dist/cjs/index.js",
32
- "react-native": "./src/index.ts"
33
- },
34
- "./server": {
35
- "types": "./dist/esm/server.d.ts",
36
- "import": "./dist/esm/server.mjs",
37
- "require": "./dist/cjs/server.js"
38
- },
39
- "./internals": {
40
- "types": "./dist/esm/internals/index.d.ts",
41
- "import": "./dist/esm/internals/index.mjs",
42
- "require": "./dist/cjs/internals/index.js",
43
- "react-native": "./src/internals/index.ts"
44
- },
45
- "./internals/server": {
46
- "types": "./dist/esm/internals/server.d.ts",
47
- "import": "./dist/esm/internals/server.mjs",
48
- "require": "./dist/cjs/internals/server.js"
49
- },
50
- "./package.json": "./package.json"
51
- },
52
- "typesVersions": {
53
- ">=4.2": {
54
- "server": [
55
- "./dist/esm/server.d.ts"
56
- ],
57
- "internals": [
58
- "./dist/esm/internals/index.d.ts"
59
- ],
60
- "internals/server": [
61
- "./dist/esm/internals/server.d.ts"
62
- ]
63
- }
64
- },
65
- "repository": {
66
- "type": "git",
67
- "url": "https://github.com/aws-amplify/amplify-js.git"
68
- },
69
- "author": "Amazon Web Services",
70
- "license": "Apache-2.0",
71
- "bugs": {
72
- "url": "https://github.com/aws/aws-amplify/issues"
73
- },
74
- "homepage": "https://aws-amplify.github.io/",
75
- "files": [
76
- "dist/cjs",
77
- "dist/esm",
78
- "src",
79
- "internals",
80
- "server"
81
- ],
82
- "dependencies": {
83
- "tslib": "^2.5.0"
84
- },
85
- "peerDependencies": {
86
- "@aws-amplify/core": "^6.0.0"
87
- },
88
- "devDependencies": {
89
- "@aws-amplify/core": "6.0.16",
90
- "@aws-amplify/react-native": "1.0.16",
91
- "typescript": "5.0.2"
92
- },
93
- "size-limit": [
94
- {
95
- "name": "API (rest client)",
96
- "path": "./dist/esm/index.mjs",
97
- "import": "{ Amplify, RestAPI }",
98
- "limit": "31.5 kB"
99
- }
100
- ],
101
- "gitHead": "0e919f6e759cb94d03e119162b530b32d48f1357"
2
+ "name": "@aws-amplify/api-rest",
3
+ "private": false,
4
+ "version": "4.0.17-unstable.3d2803e.0+3d2803e",
5
+ "description": "Api-rest category of aws-amplify",
6
+ "main": "./dist/cjs/index.js",
7
+ "module": "./dist/esm/index.mjs",
8
+ "typings": "./dist/esm/index.d.ts",
9
+ "react-native": "./src/index.ts",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
15
+ "test:watch": "tslint 'src/**/*.ts' && jest -w 1 --watch",
16
+ "build-with-test": "npm test && npm build",
17
+ "build:umd": "webpack && webpack --config ./webpack.config.dev.js",
18
+ "build:esm-cjs": "rollup -c rollup.config.mjs",
19
+ "build:watch": "npm run build:esm-cjs -- --watch",
20
+ "build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
21
+ "clean": "npm run clean:size && rimraf dist lib lib-esm",
22
+ "clean:size": "rimraf dual-publish-tmp tmp*",
23
+ "format": "echo \"Not implemented\"",
24
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
25
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
26
+ },
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/esm/index.d.ts",
30
+ "import": "./dist/esm/index.mjs",
31
+ "require": "./dist/cjs/index.js",
32
+ "react-native": "./src/index.ts"
33
+ },
34
+ "./server": {
35
+ "types": "./dist/esm/server.d.ts",
36
+ "import": "./dist/esm/server.mjs",
37
+ "require": "./dist/cjs/server.js"
38
+ },
39
+ "./internals": {
40
+ "types": "./dist/esm/internals/index.d.ts",
41
+ "import": "./dist/esm/internals/index.mjs",
42
+ "require": "./dist/cjs/internals/index.js",
43
+ "react-native": "./src/internals/index.ts"
44
+ },
45
+ "./internals/server": {
46
+ "types": "./dist/esm/internals/server.d.ts",
47
+ "import": "./dist/esm/internals/server.mjs",
48
+ "require": "./dist/cjs/internals/server.js"
49
+ },
50
+ "./package.json": "./package.json"
51
+ },
52
+ "typesVersions": {
53
+ ">=4.2": {
54
+ "server": [
55
+ "./dist/esm/server.d.ts"
56
+ ],
57
+ "internals": [
58
+ "./dist/esm/internals/index.d.ts"
59
+ ],
60
+ "internals/server": [
61
+ "./dist/esm/internals/server.d.ts"
62
+ ]
63
+ }
64
+ },
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/aws-amplify/amplify-js.git"
68
+ },
69
+ "author": "Amazon Web Services",
70
+ "license": "Apache-2.0",
71
+ "bugs": {
72
+ "url": "https://github.com/aws/aws-amplify/issues"
73
+ },
74
+ "homepage": "https://aws-amplify.github.io/",
75
+ "files": [
76
+ "dist/cjs",
77
+ "dist/esm",
78
+ "src",
79
+ "internals",
80
+ "server"
81
+ ],
82
+ "dependencies": {
83
+ "tslib": "^2.5.0"
84
+ },
85
+ "peerDependencies": {
86
+ "@aws-amplify/core": "6.0.17-unstable.3d2803e.0+3d2803e"
87
+ },
88
+ "devDependencies": {
89
+ "@aws-amplify/core": "6.0.17-unstable.3d2803e.0+3d2803e",
90
+ "@aws-amplify/react-native": "1.0.17-unstable.3d2803e.0+3d2803e",
91
+ "typescript": "5.0.2"
92
+ },
93
+ "size-limit": [
94
+ {
95
+ "name": "API (rest client)",
96
+ "path": "./dist/esm/index.mjs",
97
+ "import": "{ Amplify, RestAPI }",
98
+ "limit": "31.5 kB"
99
+ }
100
+ ],
101
+ "gitHead": "3d2803eb859c37e52f1dc9459b79d628e0377d2e"
102
102
  }
@@ -1,9 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { Amplify } from '@aws-amplify/core';
4
3
 
5
4
  import { post as internalPost } from '../apis/common/internalPost';
6
- import { InternalPostInput } from '../types';
7
5
 
8
6
  /**
9
7
  * Internal-only REST POST handler to send GraphQL request to given endpoint. By default, it will use IAM to authorize
@@ -21,9 +19,7 @@ import { InternalPostInput } from '../types';
21
19
  *
22
20
  * @internal
23
21
  */
24
- export const post = (input: InternalPostInput) => {
25
- return internalPost(Amplify, input);
26
- };
22
+ export const post = internalPost;
27
23
 
28
24
  export {
29
25
  cancel,