@sp-api-sdk/easy-ship-api-2022-03-23 4.3.12 → 5.0.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 (115) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +642 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/{types/api-model/api/easy-ship-api.d.ts → index.d.cts} +819 -26
  5. package/dist/index.d.ts +1027 -0
  6. package/dist/index.js +594 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/easy-ship-api.js +0 -361
  10. package/dist/cjs/api-model/api.js +0 -30
  11. package/dist/cjs/api-model/base.js +0 -52
  12. package/dist/cjs/api-model/common.js +0 -123
  13. package/dist/cjs/api-model/configuration.js +0 -98
  14. package/dist/cjs/api-model/index.js +0 -32
  15. package/dist/cjs/api-model/models/code.js +0 -32
  16. package/dist/cjs/api-model/models/create-scheduled-package-request.js +0 -15
  17. package/dist/cjs/api-model/models/create-scheduled-packages-request.js +0 -15
  18. package/dist/cjs/api-model/models/create-scheduled-packages-response.js +0 -15
  19. package/dist/cjs/api-model/models/dimensions.js +0 -15
  20. package/dist/cjs/api-model/models/error-list.js +0 -15
  21. package/dist/cjs/api-model/models/handover-method.js +0 -23
  22. package/dist/cjs/api-model/models/index.js +0 -43
  23. package/dist/cjs/api-model/models/invoice-data.js +0 -15
  24. package/dist/cjs/api-model/models/item.js +0 -15
  25. package/dist/cjs/api-model/models/label-format.js +0 -23
  26. package/dist/cjs/api-model/models/list-handover-slots-request.js +0 -15
  27. package/dist/cjs/api-model/models/list-handover-slots-response.js +0 -15
  28. package/dist/cjs/api-model/models/model-error.js +0 -15
  29. package/dist/cjs/api-model/models/order-schedule-details.js +0 -15
  30. package/dist/cjs/api-model/models/package-details.js +0 -15
  31. package/dist/cjs/api-model/models/package-status.js +0 -33
  32. package/dist/cjs/api-model/models/package.js +0 -15
  33. package/dist/cjs/api-model/models/packages.js +0 -15
  34. package/dist/cjs/api-model/models/rejected-order.js +0 -15
  35. package/dist/cjs/api-model/models/scheduled-package-id.js +0 -15
  36. package/dist/cjs/api-model/models/time-slot.js +0 -15
  37. package/dist/cjs/api-model/models/tracking-details.js +0 -15
  38. package/dist/cjs/api-model/models/unit-of-length.js +0 -22
  39. package/dist/cjs/api-model/models/unit-of-weight.js +0 -23
  40. package/dist/cjs/api-model/models/update-package-details.js +0 -15
  41. package/dist/cjs/api-model/models/update-scheduled-packages-request.js +0 -15
  42. package/dist/cjs/api-model/models/weight.js +0 -15
  43. package/dist/cjs/client.js +0 -49
  44. package/dist/cjs/index.js +0 -19
  45. package/dist/es/api-model/api/easy-ship-api.js +0 -351
  46. package/dist/es/api-model/api.js +0 -14
  47. package/dist/es/api-model/base.js +0 -44
  48. package/dist/es/api-model/common.js +0 -110
  49. package/dist/es/api-model/configuration.js +0 -94
  50. package/dist/es/api-model/index.js +0 -16
  51. package/dist/es/api-model/models/code.js +0 -29
  52. package/dist/es/api-model/models/create-scheduled-package-request.js +0 -14
  53. package/dist/es/api-model/models/create-scheduled-packages-request.js +0 -14
  54. package/dist/es/api-model/models/create-scheduled-packages-response.js +0 -14
  55. package/dist/es/api-model/models/dimensions.js +0 -14
  56. package/dist/es/api-model/models/error-list.js +0 -14
  57. package/dist/es/api-model/models/handover-method.js +0 -20
  58. package/dist/es/api-model/models/index.js +0 -27
  59. package/dist/es/api-model/models/invoice-data.js +0 -14
  60. package/dist/es/api-model/models/item.js +0 -14
  61. package/dist/es/api-model/models/label-format.js +0 -20
  62. package/dist/es/api-model/models/list-handover-slots-request.js +0 -14
  63. package/dist/es/api-model/models/list-handover-slots-response.js +0 -14
  64. package/dist/es/api-model/models/model-error.js +0 -14
  65. package/dist/es/api-model/models/order-schedule-details.js +0 -14
  66. package/dist/es/api-model/models/package-details.js +0 -14
  67. package/dist/es/api-model/models/package-status.js +0 -30
  68. package/dist/es/api-model/models/package.js +0 -14
  69. package/dist/es/api-model/models/packages.js +0 -14
  70. package/dist/es/api-model/models/rejected-order.js +0 -14
  71. package/dist/es/api-model/models/scheduled-package-id.js +0 -14
  72. package/dist/es/api-model/models/time-slot.js +0 -14
  73. package/dist/es/api-model/models/tracking-details.js +0 -14
  74. package/dist/es/api-model/models/unit-of-length.js +0 -19
  75. package/dist/es/api-model/models/unit-of-weight.js +0 -20
  76. package/dist/es/api-model/models/update-package-details.js +0 -14
  77. package/dist/es/api-model/models/update-scheduled-packages-request.js +0 -14
  78. package/dist/es/api-model/models/weight.js +0 -14
  79. package/dist/es/client.js +0 -45
  80. package/dist/es/index.js +0 -3
  81. package/dist/types/api-model/api.d.ts +0 -12
  82. package/dist/types/api-model/base.d.ts +0 -42
  83. package/dist/types/api-model/common.d.ts +0 -34
  84. package/dist/types/api-model/configuration.d.ts +0 -98
  85. package/dist/types/api-model/index.d.ts +0 -14
  86. package/dist/types/api-model/models/code.d.ts +0 -28
  87. package/dist/types/api-model/models/create-scheduled-package-request.d.ts +0 -26
  88. package/dist/types/api-model/models/create-scheduled-packages-request.d.ts +0 -27
  89. package/dist/types/api-model/models/create-scheduled-packages-response.d.ts +0 -30
  90. package/dist/types/api-model/models/dimensions.d.ts +0 -34
  91. package/dist/types/api-model/models/error-list.d.ts +0 -20
  92. package/dist/types/api-model/models/handover-method.d.ts +0 -19
  93. package/dist/types/api-model/models/index.d.ts +0 -27
  94. package/dist/types/api-model/models/invoice-data.d.ts +0 -24
  95. package/dist/types/api-model/models/item.d.ts +0 -24
  96. package/dist/types/api-model/models/label-format.d.ts +0 -19
  97. package/dist/types/api-model/models/list-handover-slots-request.d.ts +0 -28
  98. package/dist/types/api-model/models/list-handover-slots-response.d.ts +0 -25
  99. package/dist/types/api-model/models/model-error.d.ts +0 -28
  100. package/dist/types/api-model/models/order-schedule-details.d.ts +0 -22
  101. package/dist/types/api-model/models/package-details.d.ts +0 -27
  102. package/dist/types/api-model/models/package-status.d.ts +0 -29
  103. package/dist/types/api-model/models/package.d.ts +0 -39
  104. package/dist/types/api-model/models/packages.d.ts +0 -21
  105. package/dist/types/api-model/models/rejected-order.d.ts +0 -21
  106. package/dist/types/api-model/models/scheduled-package-id.d.ts +0 -24
  107. package/dist/types/api-model/models/time-slot.d.ts +0 -30
  108. package/dist/types/api-model/models/tracking-details.d.ts +0 -20
  109. package/dist/types/api-model/models/unit-of-length.d.ts +0 -18
  110. package/dist/types/api-model/models/unit-of-weight.d.ts +0 -19
  111. package/dist/types/api-model/models/update-package-details.d.ts +0 -20
  112. package/dist/types/api-model/models/update-scheduled-packages-request.d.ts +0 -25
  113. package/dist/types/api-model/models/weight.d.ts +0 -22
  114. package/dist/types/client.d.ts +0 -6
  115. package/dist/types/index.d.ts +0 -3
package/dist/index.cjs ADDED
@@ -0,0 +1,642 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Code: () => Code,
34
+ EasyShipApi: () => EasyShipApi,
35
+ EasyShipApiAxiosParamCreator: () => EasyShipApiAxiosParamCreator,
36
+ EasyShipApiClient: () => EasyShipApiClient,
37
+ EasyShipApiFactory: () => EasyShipApiFactory,
38
+ EasyShipApiFp: () => EasyShipApiFp,
39
+ HandoverMethod: () => HandoverMethod,
40
+ LabelFormat: () => LabelFormat,
41
+ PackageStatus: () => PackageStatus,
42
+ UnitOfLength: () => UnitOfLength,
43
+ UnitOfWeight: () => UnitOfWeight,
44
+ clientRateLimits: () => clientRateLimits
45
+ });
46
+ module.exports = __toCommonJS(index_exports);
47
+
48
+ // src/client.ts
49
+ var import_common2 = require("@sp-api-sdk/common");
50
+
51
+ // src/api-model/api/easy-ship-api.ts
52
+ var import_axios2 = __toESM(require("axios"), 1);
53
+
54
+ // src/api-model/base.ts
55
+ var import_axios = __toESM(require("axios"), 1);
56
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
57
+ var BaseAPI = class {
58
+ constructor(configuration, basePath = BASE_PATH, axios = import_axios.default) {
59
+ this.basePath = basePath;
60
+ this.axios = axios;
61
+ if (configuration) {
62
+ this.configuration = configuration;
63
+ this.basePath = configuration.basePath ?? basePath;
64
+ }
65
+ }
66
+ basePath;
67
+ axios;
68
+ configuration;
69
+ };
70
+ var RequiredError = class extends Error {
71
+ constructor(field, msg) {
72
+ super(msg);
73
+ this.field = field;
74
+ this.name = "RequiredError";
75
+ }
76
+ field;
77
+ };
78
+ var operationServerMap = {};
79
+
80
+ // src/api-model/common.ts
81
+ var DUMMY_BASE_URL = "https://example.com";
82
+ var assertParamExists = function(functionName, paramName, paramValue) {
83
+ if (paramValue === null || paramValue === void 0) {
84
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
85
+ }
86
+ };
87
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter) || parameter instanceof Set) {
91
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
92
+ } else {
93
+ Object.keys(parameter).forEach(
94
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
95
+ );
96
+ }
97
+ } else {
98
+ if (urlSearchParams.has(key)) {
99
+ urlSearchParams.append(key, parameter);
100
+ } else {
101
+ urlSearchParams.set(key, parameter);
102
+ }
103
+ }
104
+ }
105
+ var setSearchParams = function(url, ...objects) {
106
+ const searchParams = new URLSearchParams(url.search);
107
+ setFlattenedQueryParams(searchParams, objects);
108
+ url.search = searchParams.toString();
109
+ };
110
+ var replaceWithSerializableTypeIfNeeded = function(key, value) {
111
+ if (value instanceof Set) {
112
+ return Array.from(value);
113
+ } else {
114
+ return value;
115
+ }
116
+ };
117
+ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
118
+ const nonString = typeof value !== "string";
119
+ const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
120
+ return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
121
+ };
122
+ var toPathString = function(url) {
123
+ return url.pathname + url.search + url.hash;
124
+ };
125
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
126
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
127
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
128
+ return axios.request(axiosRequestArgs);
129
+ };
130
+ };
131
+
132
+ // src/api-model/api/easy-ship-api.ts
133
+ var EasyShipApiAxiosParamCreator = function(configuration) {
134
+ return {
135
+ /**
136
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
137
+ * @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
138
+ * @param {*} [options] Override http request option.
139
+ * @throws {RequiredError}
140
+ */
141
+ createScheduledPackage: async (createScheduledPackageRequest, options = {}) => {
142
+ assertParamExists("createScheduledPackage", "createScheduledPackageRequest", createScheduledPackageRequest);
143
+ const localVarPath = `/easyShip/2022-03-23/package`;
144
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
145
+ let baseOptions;
146
+ if (configuration) {
147
+ baseOptions = configuration.baseOptions;
148
+ }
149
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
150
+ const localVarHeaderParameter = {};
151
+ const localVarQueryParameter = {};
152
+ localVarHeaderParameter["Content-Type"] = "application/json";
153
+ localVarHeaderParameter["Accept"] = "application/json";
154
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
155
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
156
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
157
+ localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackageRequest, localVarRequestOptions, configuration);
158
+ return {
159
+ url: toPathString(localVarUrlObj),
160
+ options: localVarRequestOptions
161
+ };
162
+ },
163
+ /**
164
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
165
+ * @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
166
+ * @param {*} [options] Override http request option.
167
+ * @throws {RequiredError}
168
+ */
169
+ createScheduledPackageBulk: async (createScheduledPackagesRequest, options = {}) => {
170
+ assertParamExists("createScheduledPackageBulk", "createScheduledPackagesRequest", createScheduledPackagesRequest);
171
+ const localVarPath = `/easyShip/2022-03-23/packages/bulk`;
172
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
173
+ let baseOptions;
174
+ if (configuration) {
175
+ baseOptions = configuration.baseOptions;
176
+ }
177
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
178
+ const localVarHeaderParameter = {};
179
+ const localVarQueryParameter = {};
180
+ localVarHeaderParameter["Content-Type"] = "application/json";
181
+ localVarHeaderParameter["Accept"] = "application/json";
182
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
183
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
184
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
185
+ localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackagesRequest, localVarRequestOptions, configuration);
186
+ return {
187
+ url: toPathString(localVarUrlObj),
188
+ options: localVarRequestOptions
189
+ };
190
+ },
191
+ /**
192
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
193
+ * @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
194
+ * @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
195
+ * @param {*} [options] Override http request option.
196
+ * @throws {RequiredError}
197
+ */
198
+ getScheduledPackage: async (amazonOrderId, marketplaceId, options = {}) => {
199
+ assertParamExists("getScheduledPackage", "amazonOrderId", amazonOrderId);
200
+ assertParamExists("getScheduledPackage", "marketplaceId", marketplaceId);
201
+ const localVarPath = `/easyShip/2022-03-23/package`;
202
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
203
+ let baseOptions;
204
+ if (configuration) {
205
+ baseOptions = configuration.baseOptions;
206
+ }
207
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
208
+ const localVarHeaderParameter = {};
209
+ const localVarQueryParameter = {};
210
+ if (amazonOrderId !== void 0) {
211
+ localVarQueryParameter["amazonOrderId"] = amazonOrderId;
212
+ }
213
+ if (marketplaceId !== void 0) {
214
+ localVarQueryParameter["marketplaceId"] = marketplaceId;
215
+ }
216
+ localVarHeaderParameter["Accept"] = "application/json";
217
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
218
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
219
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
220
+ return {
221
+ url: toPathString(localVarUrlObj),
222
+ options: localVarRequestOptions
223
+ };
224
+ },
225
+ /**
226
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
227
+ * @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
228
+ * @param {*} [options] Override http request option.
229
+ * @throws {RequiredError}
230
+ */
231
+ listHandoverSlots: async (listHandoverSlotsRequest, options = {}) => {
232
+ const localVarPath = `/easyShip/2022-03-23/timeSlot`;
233
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
234
+ let baseOptions;
235
+ if (configuration) {
236
+ baseOptions = configuration.baseOptions;
237
+ }
238
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
239
+ const localVarHeaderParameter = {};
240
+ const localVarQueryParameter = {};
241
+ localVarHeaderParameter["Content-Type"] = "application/json";
242
+ localVarHeaderParameter["Accept"] = "application/json";
243
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
244
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
245
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
246
+ localVarRequestOptions.data = serializeDataIfNeeded(listHandoverSlotsRequest, localVarRequestOptions, configuration);
247
+ return {
248
+ url: toPathString(localVarUrlObj),
249
+ options: localVarRequestOptions
250
+ };
251
+ },
252
+ /**
253
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
254
+ * @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ */
258
+ updateScheduledPackages: async (updateScheduledPackagesRequest, options = {}) => {
259
+ const localVarPath = `/easyShip/2022-03-23/package`;
260
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
261
+ let baseOptions;
262
+ if (configuration) {
263
+ baseOptions = configuration.baseOptions;
264
+ }
265
+ const localVarRequestOptions = { method: "PATCH", ...baseOptions, ...options };
266
+ const localVarHeaderParameter = {};
267
+ const localVarQueryParameter = {};
268
+ localVarHeaderParameter["Content-Type"] = "application/json";
269
+ localVarHeaderParameter["Accept"] = "application/json";
270
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
271
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
272
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
273
+ localVarRequestOptions.data = serializeDataIfNeeded(updateScheduledPackagesRequest, localVarRequestOptions, configuration);
274
+ return {
275
+ url: toPathString(localVarUrlObj),
276
+ options: localVarRequestOptions
277
+ };
278
+ }
279
+ };
280
+ };
281
+ var EasyShipApiFp = function(configuration) {
282
+ const localVarAxiosParamCreator = EasyShipApiAxiosParamCreator(configuration);
283
+ return {
284
+ /**
285
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
286
+ * @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
287
+ * @param {*} [options] Override http request option.
288
+ * @throws {RequiredError}
289
+ */
290
+ async createScheduledPackage(createScheduledPackageRequest, options) {
291
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackage(createScheduledPackageRequest, options);
292
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
293
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackage"]?.[localVarOperationServerIndex]?.url;
294
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
295
+ },
296
+ /**
297
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
298
+ * @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
299
+ * @param {*} [options] Override http request option.
300
+ * @throws {RequiredError}
301
+ */
302
+ async createScheduledPackageBulk(createScheduledPackagesRequest, options) {
303
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackageBulk(createScheduledPackagesRequest, options);
304
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
305
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackageBulk"]?.[localVarOperationServerIndex]?.url;
306
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
307
+ },
308
+ /**
309
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
310
+ * @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
311
+ * @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ */
315
+ async getScheduledPackage(amazonOrderId, marketplaceId, options) {
316
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getScheduledPackage(amazonOrderId, marketplaceId, options);
317
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
318
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.getScheduledPackage"]?.[localVarOperationServerIndex]?.url;
319
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
320
+ },
321
+ /**
322
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
323
+ * @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
324
+ * @param {*} [options] Override http request option.
325
+ * @throws {RequiredError}
326
+ */
327
+ async listHandoverSlots(listHandoverSlotsRequest, options) {
328
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listHandoverSlots(listHandoverSlotsRequest, options);
329
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
330
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.listHandoverSlots"]?.[localVarOperationServerIndex]?.url;
331
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
332
+ },
333
+ /**
334
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
335
+ * @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
336
+ * @param {*} [options] Override http request option.
337
+ * @throws {RequiredError}
338
+ */
339
+ async updateScheduledPackages(updateScheduledPackagesRequest, options) {
340
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateScheduledPackages(updateScheduledPackagesRequest, options);
341
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
342
+ const localVarOperationServerBasePath = operationServerMap["EasyShipApi.updateScheduledPackages"]?.[localVarOperationServerIndex]?.url;
343
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
344
+ }
345
+ };
346
+ };
347
+ var EasyShipApiFactory = function(configuration, basePath, axios) {
348
+ const localVarFp = EasyShipApiFp(configuration);
349
+ return {
350
+ /**
351
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
352
+ * @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
353
+ * @param {*} [options] Override http request option.
354
+ * @throws {RequiredError}
355
+ */
356
+ createScheduledPackage(requestParameters, options) {
357
+ return localVarFp.createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(axios, basePath));
358
+ },
359
+ /**
360
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
361
+ * @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
362
+ * @param {*} [options] Override http request option.
363
+ * @throws {RequiredError}
364
+ */
365
+ createScheduledPackageBulk(requestParameters, options) {
366
+ return localVarFp.createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(axios, basePath));
367
+ },
368
+ /**
369
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
370
+ * @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
371
+ * @param {*} [options] Override http request option.
372
+ * @throws {RequiredError}
373
+ */
374
+ getScheduledPackage(requestParameters, options) {
375
+ return localVarFp.getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
376
+ },
377
+ /**
378
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
379
+ * @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
380
+ * @param {*} [options] Override http request option.
381
+ * @throws {RequiredError}
382
+ */
383
+ listHandoverSlots(requestParameters = {}, options) {
384
+ return localVarFp.listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(axios, basePath));
385
+ },
386
+ /**
387
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
388
+ * @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
389
+ * @param {*} [options] Override http request option.
390
+ * @throws {RequiredError}
391
+ */
392
+ updateScheduledPackages(requestParameters = {}, options) {
393
+ return localVarFp.updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(axios, basePath));
394
+ }
395
+ };
396
+ };
397
+ var EasyShipApi = class extends BaseAPI {
398
+ /**
399
+ * Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
400
+ * @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
401
+ * @param {*} [options] Override http request option.
402
+ * @throws {RequiredError}
403
+ */
404
+ createScheduledPackage(requestParameters, options) {
405
+ return EasyShipApiFp(this.configuration).createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(this.axios, this.basePath));
406
+ }
407
+ /**
408
+ * This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
409
+ * @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
410
+ * @param {*} [options] Override http request option.
411
+ * @throws {RequiredError}
412
+ */
413
+ createScheduledPackageBulk(requestParameters, options) {
414
+ return EasyShipApiFp(this.configuration).createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
415
+ }
416
+ /**
417
+ * Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
418
+ * @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
419
+ * @param {*} [options] Override http request option.
420
+ * @throws {RequiredError}
421
+ */
422
+ getScheduledPackage(requestParameters, options) {
423
+ return EasyShipApiFp(this.configuration).getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
424
+ }
425
+ /**
426
+ * Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
427
+ * @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
428
+ * @param {*} [options] Override http request option.
429
+ * @throws {RequiredError}
430
+ */
431
+ listHandoverSlots(requestParameters = {}, options) {
432
+ return EasyShipApiFp(this.configuration).listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(this.axios, this.basePath));
433
+ }
434
+ /**
435
+ * Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
436
+ * @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
437
+ * @param {*} [options] Override http request option.
438
+ * @throws {RequiredError}
439
+ */
440
+ updateScheduledPackages(requestParameters = {}, options) {
441
+ return EasyShipApiFp(this.configuration).updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
442
+ }
443
+ };
444
+
445
+ // src/api-model/configuration.ts
446
+ var Configuration = class {
447
+ /**
448
+ * parameter for apiKey security
449
+ * @param name security name
450
+ */
451
+ apiKey;
452
+ /**
453
+ * parameter for basic security
454
+ */
455
+ username;
456
+ /**
457
+ * parameter for basic security
458
+ */
459
+ password;
460
+ /**
461
+ * parameter for oauth2 security
462
+ * @param name security name
463
+ * @param scopes oauth2 scope
464
+ */
465
+ accessToken;
466
+ /**
467
+ * parameter for aws4 signature security
468
+ * @param {Object} AWS4Signature - AWS4 Signature security
469
+ * @param {string} options.region - aws region
470
+ * @param {string} options.service - name of the service.
471
+ * @param {string} credentials.accessKeyId - aws access key id
472
+ * @param {string} credentials.secretAccessKey - aws access key
473
+ * @param {string} credentials.sessionToken - aws session token
474
+ * @memberof Configuration
475
+ */
476
+ awsv4;
477
+ /**
478
+ * override base path
479
+ */
480
+ basePath;
481
+ /**
482
+ * override server index
483
+ */
484
+ serverIndex;
485
+ /**
486
+ * base options for axios calls
487
+ */
488
+ baseOptions;
489
+ /**
490
+ * The FormData constructor that will be used to create multipart form data
491
+ * requests. You can inject this here so that execution environments that
492
+ * do not support the FormData class can still run the generated client.
493
+ *
494
+ * @type {new () => FormData}
495
+ */
496
+ formDataCtor;
497
+ constructor(param = {}) {
498
+ this.apiKey = param.apiKey;
499
+ this.username = param.username;
500
+ this.password = param.password;
501
+ this.accessToken = param.accessToken;
502
+ this.awsv4 = param.awsv4;
503
+ this.basePath = param.basePath;
504
+ this.serverIndex = param.serverIndex;
505
+ this.baseOptions = {
506
+ ...param.baseOptions,
507
+ headers: {
508
+ ...param.baseOptions?.headers
509
+ }
510
+ };
511
+ this.formDataCtor = param.formDataCtor;
512
+ }
513
+ /**
514
+ * Check if the given MIME is a JSON MIME.
515
+ * JSON MIME examples:
516
+ * application/json
517
+ * application/json; charset=UTF8
518
+ * APPLICATION/JSON
519
+ * application/vnd.company+json
520
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
521
+ * @return True if the given MIME is JSON, false otherwise.
522
+ */
523
+ isJsonMime(mime) {
524
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
525
+ return mime !== null && jsonMime.test(mime);
526
+ }
527
+ };
528
+
529
+ // src/api-model/models/code.ts
530
+ var Code = {
531
+ InvalidInput: "InvalidInput",
532
+ InvalidTimeSlotId: "InvalidTimeSlotId",
533
+ ScheduledPackageAlreadyExists: "ScheduledPackageAlreadyExists",
534
+ ScheduleWindowExpired: "ScheduleWindowExpired",
535
+ RetryableAfterGettingNewSlots: "RetryableAfterGettingNewSlots",
536
+ TimeSlotNotAvailable: "TimeSlotNotAvailable",
537
+ ResourceNotFound: "ResourceNotFound",
538
+ InvalidOrderState: "InvalidOrderState",
539
+ RegionNotSupported: "RegionNotSupported",
540
+ OrderNotEligibleForRescheduling: "OrderNotEligibleForRescheduling",
541
+ InternalServerError: "InternalServerError"
542
+ };
543
+
544
+ // src/api-model/models/handover-method.ts
545
+ var HandoverMethod = {
546
+ Pickup: "PICKUP",
547
+ Dropoff: "DROPOFF"
548
+ };
549
+
550
+ // src/api-model/models/label-format.ts
551
+ var LabelFormat = {
552
+ Pdf: "PDF",
553
+ Zpl: "ZPL"
554
+ };
555
+
556
+ // src/api-model/models/package-status.ts
557
+ var PackageStatus = {
558
+ ReadyForPickup: "ReadyForPickup",
559
+ PickedUp: "PickedUp",
560
+ AtOriginFc: "AtOriginFC",
561
+ AtDestinationFc: "AtDestinationFC",
562
+ Delivered: "Delivered",
563
+ Rejected: "Rejected",
564
+ Undeliverable: "Undeliverable",
565
+ ReturnedToSeller: "ReturnedToSeller",
566
+ LostInTransit: "LostInTransit",
567
+ LabelCanceled: "LabelCanceled",
568
+ DamagedInTransit: "DamagedInTransit",
569
+ OutForDelivery: "OutForDelivery"
570
+ };
571
+
572
+ // src/api-model/models/unit-of-length.ts
573
+ var UnitOfLength = {
574
+ Cm: "cm"
575
+ };
576
+
577
+ // src/api-model/models/unit-of-weight.ts
578
+ var UnitOfWeight = {
579
+ Grams: "grams",
580
+ G: "g"
581
+ };
582
+
583
+ // src/client.ts
584
+ var clientRateLimits = [
585
+ {
586
+ method: "post",
587
+ // eslint-disable-next-line prefer-regex-literals
588
+ urlRegex: new RegExp("^/easyShip/2022-03-23/timeSlot$"),
589
+ rate: 1,
590
+ burst: 5
591
+ },
592
+ {
593
+ method: "get",
594
+ // eslint-disable-next-line prefer-regex-literals
595
+ urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
596
+ rate: 1,
597
+ burst: 5
598
+ },
599
+ {
600
+ method: "post",
601
+ // eslint-disable-next-line prefer-regex-literals
602
+ urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
603
+ rate: 1,
604
+ burst: 5
605
+ },
606
+ {
607
+ method: "patch",
608
+ // eslint-disable-next-line prefer-regex-literals
609
+ urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
610
+ rate: 1,
611
+ burst: 5
612
+ },
613
+ {
614
+ method: "post",
615
+ // eslint-disable-next-line prefer-regex-literals
616
+ urlRegex: new RegExp("^/easyShip/2022-03-23/packages/bulk$"),
617
+ rate: 1,
618
+ burst: 5
619
+ }
620
+ ];
621
+ var EasyShipApiClient = class extends EasyShipApi {
622
+ constructor(configuration) {
623
+ const { axios, endpoint } = (0, import_common2.createAxiosInstance)(configuration, clientRateLimits);
624
+ super(new Configuration(), endpoint, axios);
625
+ }
626
+ };
627
+ // Annotate the CommonJS export names for ESM import in node:
628
+ 0 && (module.exports = {
629
+ Code,
630
+ EasyShipApi,
631
+ EasyShipApiAxiosParamCreator,
632
+ EasyShipApiClient,
633
+ EasyShipApiFactory,
634
+ EasyShipApiFp,
635
+ HandoverMethod,
636
+ LabelFormat,
637
+ PackageStatus,
638
+ UnitOfLength,
639
+ UnitOfWeight,
640
+ clientRateLimits
641
+ });
642
+ //# sourceMappingURL=index.cjs.map