@sp-api-sdk/fba-inventory-api-v1 3.0.22 → 4.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 (85) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +553 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/{types/api-model/api/fba-inventory-api.d.ts → index.d.cts} +623 -24
  5. package/dist/index.d.ts +846 -0
  6. package/dist/index.js +509 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/fba-inventory-api.js +0 -355
  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/add-inventory-request.js +0 -15
  16. package/dist/cjs/api-model/models/add-inventory-response.js +0 -15
  17. package/dist/cjs/api-model/models/create-inventory-item-request.js +0 -15
  18. package/dist/cjs/api-model/models/create-inventory-item-response.js +0 -15
  19. package/dist/cjs/api-model/models/delete-inventory-item-response.js +0 -15
  20. package/dist/cjs/api-model/models/get-inventory-summaries-response.js +0 -15
  21. package/dist/cjs/api-model/models/get-inventory-summaries-result.js +0 -15
  22. package/dist/cjs/api-model/models/granularity.js +0 -15
  23. package/dist/cjs/api-model/models/index.js +0 -33
  24. package/dist/cjs/api-model/models/inventory-details.js +0 -15
  25. package/dist/cjs/api-model/models/inventory-item.js +0 -15
  26. package/dist/cjs/api-model/models/inventory-summary.js +0 -15
  27. package/dist/cjs/api-model/models/model-error.js +0 -15
  28. package/dist/cjs/api-model/models/pagination.js +0 -15
  29. package/dist/cjs/api-model/models/researching-quantity-entry.js +0 -21
  30. package/dist/cjs/api-model/models/researching-quantity.js +0 -15
  31. package/dist/cjs/api-model/models/reserved-quantity.js +0 -15
  32. package/dist/cjs/api-model/models/unfulfillable-quantity.js +0 -15
  33. package/dist/cjs/client.js +0 -21
  34. package/dist/cjs/index.js +0 -19
  35. package/dist/es/api-model/api/fba-inventory-api.js +0 -345
  36. package/dist/es/api-model/api.js +0 -14
  37. package/dist/es/api-model/base.js +0 -44
  38. package/dist/es/api-model/common.js +0 -110
  39. package/dist/es/api-model/configuration.js +0 -94
  40. package/dist/es/api-model/index.js +0 -16
  41. package/dist/es/api-model/models/add-inventory-request.js +0 -14
  42. package/dist/es/api-model/models/add-inventory-response.js +0 -14
  43. package/dist/es/api-model/models/create-inventory-item-request.js +0 -14
  44. package/dist/es/api-model/models/create-inventory-item-response.js +0 -14
  45. package/dist/es/api-model/models/delete-inventory-item-response.js +0 -14
  46. package/dist/es/api-model/models/get-inventory-summaries-response.js +0 -14
  47. package/dist/es/api-model/models/get-inventory-summaries-result.js +0 -14
  48. package/dist/es/api-model/models/granularity.js +0 -14
  49. package/dist/es/api-model/models/index.js +0 -17
  50. package/dist/es/api-model/models/inventory-details.js +0 -14
  51. package/dist/es/api-model/models/inventory-item.js +0 -14
  52. package/dist/es/api-model/models/inventory-summary.js +0 -14
  53. package/dist/es/api-model/models/model-error.js +0 -14
  54. package/dist/es/api-model/models/pagination.js +0 -14
  55. package/dist/es/api-model/models/researching-quantity-entry.js +0 -18
  56. package/dist/es/api-model/models/researching-quantity.js +0 -14
  57. package/dist/es/api-model/models/reserved-quantity.js +0 -14
  58. package/dist/es/api-model/models/unfulfillable-quantity.js +0 -14
  59. package/dist/es/client.js +0 -17
  60. package/dist/es/index.js +0 -3
  61. package/dist/types/api-model/api.d.ts +0 -12
  62. package/dist/types/api-model/base.d.ts +0 -42
  63. package/dist/types/api-model/common.d.ts +0 -34
  64. package/dist/types/api-model/configuration.d.ts +0 -98
  65. package/dist/types/api-model/index.d.ts +0 -14
  66. package/dist/types/api-model/models/add-inventory-request.d.ts +0 -21
  67. package/dist/types/api-model/models/add-inventory-response.d.ts +0 -20
  68. package/dist/types/api-model/models/create-inventory-item-request.d.ts +0 -28
  69. package/dist/types/api-model/models/create-inventory-item-response.d.ts +0 -20
  70. package/dist/types/api-model/models/delete-inventory-item-response.d.ts +0 -20
  71. package/dist/types/api-model/models/get-inventory-summaries-response.d.ts +0 -24
  72. package/dist/types/api-model/models/get-inventory-summaries-result.d.ts +0 -23
  73. package/dist/types/api-model/models/granularity.d.ts +0 -24
  74. package/dist/types/api-model/models/index.d.ts +0 -17
  75. package/dist/types/api-model/models/inventory-details.d.ts +0 -38
  76. package/dist/types/api-model/models/inventory-item.d.ts +0 -28
  77. package/dist/types/api-model/models/inventory-summary.d.ts +0 -50
  78. package/dist/types/api-model/models/model-error.d.ts +0 -28
  79. package/dist/types/api-model/models/pagination.d.ts +0 -20
  80. package/dist/types/api-model/models/researching-quantity-entry.d.ts +0 -30
  81. package/dist/types/api-model/models/researching-quantity.d.ts +0 -25
  82. package/dist/types/api-model/models/reserved-quantity.d.ts +0 -32
  83. package/dist/types/api-model/models/unfulfillable-quantity.d.ts +0 -44
  84. package/dist/types/client.d.ts +0 -6
  85. package/dist/types/index.d.ts +0 -3
package/dist/index.js ADDED
@@ -0,0 +1,509 @@
1
+ // src/client.ts
2
+ import { createAxiosInstance } from "@sp-api-sdk/common";
3
+
4
+ // src/api-model/api/fba-inventory-api.ts
5
+ import globalAxios2 from "axios";
6
+
7
+ // src/api-model/base.ts
8
+ import globalAxios from "axios";
9
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
+ var COLLECTION_FORMATS = {
11
+ csv: ",",
12
+ ssv: " ",
13
+ tsv: " ",
14
+ pipes: "|"
15
+ };
16
+ var BaseAPI = class {
17
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
18
+ this.basePath = basePath;
19
+ this.axios = axios;
20
+ if (configuration) {
21
+ this.configuration = configuration;
22
+ this.basePath = configuration.basePath ?? basePath;
23
+ }
24
+ }
25
+ basePath;
26
+ axios;
27
+ configuration;
28
+ };
29
+ var RequiredError = class extends Error {
30
+ constructor(field, msg) {
31
+ super(msg);
32
+ this.field = field;
33
+ this.name = "RequiredError";
34
+ }
35
+ field;
36
+ };
37
+ var operationServerMap = {};
38
+
39
+ // src/api-model/common.ts
40
+ var DUMMY_BASE_URL = "https://example.com";
41
+ var assertParamExists = function(functionName, paramName, paramValue) {
42
+ if (paramValue === null || paramValue === void 0) {
43
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
44
+ }
45
+ };
46
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
47
+ if (parameter == null) return;
48
+ if (typeof parameter === "object") {
49
+ if (Array.isArray(parameter) || parameter instanceof Set) {
50
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
51
+ } else {
52
+ Object.keys(parameter).forEach(
53
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
54
+ );
55
+ }
56
+ } else {
57
+ if (urlSearchParams.has(key)) {
58
+ urlSearchParams.append(key, parameter);
59
+ } else {
60
+ urlSearchParams.set(key, parameter);
61
+ }
62
+ }
63
+ }
64
+ var setSearchParams = function(url, ...objects) {
65
+ const searchParams = new URLSearchParams(url.search);
66
+ setFlattenedQueryParams(searchParams, objects);
67
+ url.search = searchParams.toString();
68
+ };
69
+ var replaceWithSerializableTypeIfNeeded = function(key, value) {
70
+ if (value instanceof Set) {
71
+ return Array.from(value);
72
+ } else {
73
+ return value;
74
+ }
75
+ };
76
+ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
77
+ const nonString = typeof value !== "string";
78
+ const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
79
+ return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
80
+ };
81
+ var toPathString = function(url) {
82
+ return url.pathname + url.search + url.hash;
83
+ };
84
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
85
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
86
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
87
+ return axios.request(axiosRequestArgs);
88
+ };
89
+ };
90
+
91
+ // src/api-model/api/fba-inventory-api.ts
92
+ var FbaInventoryApiAxiosParamCreator = function(configuration) {
93
+ return {
94
+ /**
95
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
96
+ * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
97
+ * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ */
101
+ addInventory: async (xAmznIdempotencyToken, addInventoryRequestBody, options = {}) => {
102
+ assertParamExists("addInventory", "xAmznIdempotencyToken", xAmznIdempotencyToken);
103
+ assertParamExists("addInventory", "addInventoryRequestBody", addInventoryRequestBody);
104
+ const localVarPath = `/fba/inventory/v1/items/inventory`;
105
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
106
+ let baseOptions;
107
+ if (configuration) {
108
+ baseOptions = configuration.baseOptions;
109
+ }
110
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
111
+ const localVarHeaderParameter = {};
112
+ const localVarQueryParameter = {};
113
+ localVarHeaderParameter["Content-Type"] = "application/json";
114
+ localVarHeaderParameter["Accept"] = "application/json";
115
+ if (xAmznIdempotencyToken != null) {
116
+ localVarHeaderParameter["x-amzn-idempotency-token"] = String(xAmznIdempotencyToken);
117
+ }
118
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
119
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
120
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
121
+ localVarRequestOptions.data = serializeDataIfNeeded(addInventoryRequestBody, localVarRequestOptions, configuration);
122
+ return {
123
+ url: toPathString(localVarUrlObj),
124
+ options: localVarRequestOptions
125
+ };
126
+ },
127
+ /**
128
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
129
+ * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
130
+ * @param {*} [options] Override http request option.
131
+ * @throws {RequiredError}
132
+ */
133
+ createInventoryItem: async (createInventoryItemRequestBody, options = {}) => {
134
+ assertParamExists("createInventoryItem", "createInventoryItemRequestBody", createInventoryItemRequestBody);
135
+ const localVarPath = `/fba/inventory/v1/items`;
136
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
137
+ let baseOptions;
138
+ if (configuration) {
139
+ baseOptions = configuration.baseOptions;
140
+ }
141
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
142
+ const localVarHeaderParameter = {};
143
+ const localVarQueryParameter = {};
144
+ localVarHeaderParameter["Content-Type"] = "application/json";
145
+ localVarHeaderParameter["Accept"] = "application/json";
146
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
147
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
148
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
149
+ localVarRequestOptions.data = serializeDataIfNeeded(createInventoryItemRequestBody, localVarRequestOptions, configuration);
150
+ return {
151
+ url: toPathString(localVarUrlObj),
152
+ options: localVarRequestOptions
153
+ };
154
+ },
155
+ /**
156
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
157
+ * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
158
+ * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
159
+ * @param {*} [options] Override http request option.
160
+ * @throws {RequiredError}
161
+ */
162
+ deleteInventoryItem: async (sellerSku, marketplaceId, options = {}) => {
163
+ assertParamExists("deleteInventoryItem", "sellerSku", sellerSku);
164
+ assertParamExists("deleteInventoryItem", "marketplaceId", marketplaceId);
165
+ const localVarPath = `/fba/inventory/v1/items/{sellerSku}`.replace("{sellerSku}", encodeURIComponent(String(sellerSku)));
166
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
167
+ let baseOptions;
168
+ if (configuration) {
169
+ baseOptions = configuration.baseOptions;
170
+ }
171
+ const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
172
+ const localVarHeaderParameter = {};
173
+ const localVarQueryParameter = {};
174
+ if (marketplaceId !== void 0) {
175
+ localVarQueryParameter["marketplaceId"] = marketplaceId;
176
+ }
177
+ localVarHeaderParameter["Accept"] = "application/json";
178
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
179
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
180
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
181
+ return {
182
+ url: toPathString(localVarUrlObj),
183
+ options: localVarRequestOptions
184
+ };
185
+ },
186
+ /**
187
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | 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).
188
+ * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
189
+ * @param {string} granularityId The granularity ID for the inventory aggregation level.
190
+ * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
191
+ * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
192
+ * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
193
+ * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
194
+ * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
195
+ * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ */
199
+ getInventorySummaries: async (granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options = {}) => {
200
+ assertParamExists("getInventorySummaries", "granularityType", granularityType);
201
+ assertParamExists("getInventorySummaries", "granularityId", granularityId);
202
+ assertParamExists("getInventorySummaries", "marketplaceIds", marketplaceIds);
203
+ const localVarPath = `/fba/inventory/v1/summaries`;
204
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
205
+ let baseOptions;
206
+ if (configuration) {
207
+ baseOptions = configuration.baseOptions;
208
+ }
209
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
210
+ const localVarHeaderParameter = {};
211
+ const localVarQueryParameter = {};
212
+ if (details !== void 0) {
213
+ localVarQueryParameter["details"] = details;
214
+ }
215
+ if (granularityType !== void 0) {
216
+ localVarQueryParameter["granularityType"] = granularityType;
217
+ }
218
+ if (granularityId !== void 0) {
219
+ localVarQueryParameter["granularityId"] = granularityId;
220
+ }
221
+ if (startDateTime !== void 0) {
222
+ localVarQueryParameter["startDateTime"] = startDateTime instanceof Date ? startDateTime.toISOString() : startDateTime;
223
+ }
224
+ if (sellerSkus) {
225
+ localVarQueryParameter["sellerSkus"] = sellerSkus.join(COLLECTION_FORMATS.csv);
226
+ }
227
+ if (sellerSku !== void 0) {
228
+ localVarQueryParameter["sellerSku"] = sellerSku;
229
+ }
230
+ if (nextToken !== void 0) {
231
+ localVarQueryParameter["nextToken"] = nextToken;
232
+ }
233
+ if (marketplaceIds) {
234
+ localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
235
+ }
236
+ localVarHeaderParameter["Accept"] = "application/json";
237
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
238
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
239
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
240
+ return {
241
+ url: toPathString(localVarUrlObj),
242
+ options: localVarRequestOptions
243
+ };
244
+ }
245
+ };
246
+ };
247
+ var FbaInventoryApiFp = function(configuration) {
248
+ const localVarAxiosParamCreator = FbaInventoryApiAxiosParamCreator(configuration);
249
+ return {
250
+ /**
251
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
252
+ * @param {string} xAmznIdempotencyToken A unique token/requestId provided with each call to ensure idempotency.
253
+ * @param {AddInventoryRequest} addInventoryRequestBody List of items to add to Sandbox inventory.
254
+ * @param {*} [options] Override http request option.
255
+ * @throws {RequiredError}
256
+ */
257
+ async addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options) {
258
+ const localVarAxiosArgs = await localVarAxiosParamCreator.addInventory(xAmznIdempotencyToken, addInventoryRequestBody, options);
259
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
260
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.addInventory"]?.[localVarOperationServerIndex]?.url;
261
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
262
+ },
263
+ /**
264
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
265
+ * @param {CreateInventoryItemRequest} createInventoryItemRequestBody CreateInventoryItem Request Body Parameter.
266
+ * @param {*} [options] Override http request option.
267
+ * @throws {RequiredError}
268
+ */
269
+ async createInventoryItem(createInventoryItemRequestBody, options) {
270
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createInventoryItem(createInventoryItemRequestBody, options);
271
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
272
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.createInventoryItem"]?.[localVarOperationServerIndex]?.url;
273
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
274
+ },
275
+ /**
276
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
277
+ * @param {string} sellerSku A single seller SKU used for querying the specified seller SKU inventory summaries.
278
+ * @param {string} marketplaceId The marketplace ID for the marketplace for which the sellerSku is to be deleted.
279
+ * @param {*} [options] Override http request option.
280
+ * @throws {RequiredError}
281
+ */
282
+ async deleteInventoryItem(sellerSku, marketplaceId, options) {
283
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInventoryItem(sellerSku, marketplaceId, options);
284
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
285
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.deleteInventoryItem"]?.[localVarOperationServerIndex]?.url;
286
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
287
+ },
288
+ /**
289
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | 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).
290
+ * @param {GetInventorySummariesGranularityTypeEnum} granularityType The granularity type for the inventory aggregation level.
291
+ * @param {string} granularityId The granularity ID for the inventory aggregation level.
292
+ * @param {Array<string>} marketplaceIds The marketplace ID for the marketplace for which to return inventory summaries.
293
+ * @param {boolean} [details] true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).
294
+ * @param {string} [startDateTime] A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.
295
+ * @param {Array<string>} [sellerSkus] A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.
296
+ * @param {string} [sellerSku] A single seller SKU used for querying the specified seller SKU inventory summaries.
297
+ * @param {string} [nextToken] String token returned in the response of your previous request. The string token will expire 30 seconds after being created.
298
+ * @param {*} [options] Override http request option.
299
+ * @throws {RequiredError}
300
+ */
301
+ async getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options) {
302
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getInventorySummaries(granularityType, granularityId, marketplaceIds, details, startDateTime, sellerSkus, sellerSku, nextToken, options);
303
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
304
+ const localVarOperationServerBasePath = operationServerMap["FbaInventoryApi.getInventorySummaries"]?.[localVarOperationServerIndex]?.url;
305
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
306
+ }
307
+ };
308
+ };
309
+ var FbaInventoryApiFactory = function(configuration, basePath, axios) {
310
+ const localVarFp = FbaInventoryApiFp(configuration);
311
+ return {
312
+ /**
313
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
314
+ * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
315
+ * @param {*} [options] Override http request option.
316
+ * @throws {RequiredError}
317
+ */
318
+ addInventory(requestParameters, options) {
319
+ return localVarFp.addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(axios, basePath));
320
+ },
321
+ /**
322
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
323
+ * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
324
+ * @param {*} [options] Override http request option.
325
+ * @throws {RequiredError}
326
+ */
327
+ createInventoryItem(requestParameters, options) {
328
+ return localVarFp.createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(axios, basePath));
329
+ },
330
+ /**
331
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
332
+ * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
333
+ * @param {*} [options] Override http request option.
334
+ * @throws {RequiredError}
335
+ */
336
+ deleteInventoryItem(requestParameters, options) {
337
+ return localVarFp.deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
338
+ },
339
+ /**
340
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | 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).
341
+ * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
342
+ * @param {*} [options] Override http request option.
343
+ * @throws {RequiredError}
344
+ */
345
+ getInventorySummaries(requestParameters, options) {
346
+ return localVarFp.getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(axios, basePath));
347
+ }
348
+ };
349
+ };
350
+ var FbaInventoryApi = class extends BaseAPI {
351
+ /**
352
+ * Requests that Amazon add items to the Sandbox Inventory with desired amount of quantity in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
353
+ * @param {FbaInventoryApiAddInventoryRequest} requestParameters Request parameters.
354
+ * @param {*} [options] Override http request option.
355
+ * @throws {RequiredError}
356
+ */
357
+ addInventory(requestParameters, options) {
358
+ return FbaInventoryApiFp(this.configuration).addInventory(requestParameters.xAmznIdempotencyToken, requestParameters.addInventoryRequestBody, options).then((request) => request(this.axios, this.basePath));
359
+ }
360
+ /**
361
+ * Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
362
+ * @param {FbaInventoryApiCreateInventoryItemRequest} requestParameters Request parameters.
363
+ * @param {*} [options] Override http request option.
364
+ * @throws {RequiredError}
365
+ */
366
+ createInventoryItem(requestParameters, options) {
367
+ return FbaInventoryApiFp(this.configuration).createInventoryItem(requestParameters.createInventoryItemRequestBody, options).then((request) => request(this.axios, this.basePath));
368
+ }
369
+ /**
370
+ * Requests that Amazon Deletes an item from the Sandbox Inventory in the sandbox environment. This is a sandbox-only operation and must be directed to a sandbox endpoint. Refer to [Selling Partner API sandbox](https://developer-docs.amazon.com/sp-api/docs/the-selling-partner-api-sandbox) for more information.
371
+ * @param {FbaInventoryApiDeleteInventoryItemRequest} requestParameters Request parameters.
372
+ * @param {*} [options] Override http request option.
373
+ * @throws {RequiredError}
374
+ */
375
+ deleteInventoryItem(requestParameters, options) {
376
+ return FbaInventoryApiFp(this.configuration).deleteInventoryItem(requestParameters.sellerSku, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
377
+ }
378
+ /**
379
+ * Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the startDateTime, sellerSkus and sellerSku parameters: - All inventory summaries with available details are returned when the startDateTime, sellerSkus and sellerSku parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus and sellerSku parameters are ignored. Important: To avoid errors, use both startDateTime and nextToken to get the next page of inventory summaries that have changed after the date and time specified. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. The sellerSku parameter is ignored. - When the sellerSku parameter is provided, the operation returns inventory summaries for only the specified sellerSku. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). Usage Plan: | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | 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).
380
+ * @param {FbaInventoryApiGetInventorySummariesRequest} requestParameters Request parameters.
381
+ * @param {*} [options] Override http request option.
382
+ * @throws {RequiredError}
383
+ */
384
+ getInventorySummaries(requestParameters, options) {
385
+ return FbaInventoryApiFp(this.configuration).getInventorySummaries(requestParameters.granularityType, requestParameters.granularityId, requestParameters.marketplaceIds, requestParameters.details, requestParameters.startDateTime, requestParameters.sellerSkus, requestParameters.sellerSku, requestParameters.nextToken, options).then((request) => request(this.axios, this.basePath));
386
+ }
387
+ };
388
+ var GetInventorySummariesGranularityTypeEnum = {
389
+ Marketplace: "Marketplace"
390
+ };
391
+
392
+ // src/api-model/configuration.ts
393
+ var Configuration = class {
394
+ /**
395
+ * parameter for apiKey security
396
+ * @param name security name
397
+ */
398
+ apiKey;
399
+ /**
400
+ * parameter for basic security
401
+ */
402
+ username;
403
+ /**
404
+ * parameter for basic security
405
+ */
406
+ password;
407
+ /**
408
+ * parameter for oauth2 security
409
+ * @param name security name
410
+ * @param scopes oauth2 scope
411
+ */
412
+ accessToken;
413
+ /**
414
+ * parameter for aws4 signature security
415
+ * @param {Object} AWS4Signature - AWS4 Signature security
416
+ * @param {string} options.region - aws region
417
+ * @param {string} options.service - name of the service.
418
+ * @param {string} credentials.accessKeyId - aws access key id
419
+ * @param {string} credentials.secretAccessKey - aws access key
420
+ * @param {string} credentials.sessionToken - aws session token
421
+ * @memberof Configuration
422
+ */
423
+ awsv4;
424
+ /**
425
+ * override base path
426
+ */
427
+ basePath;
428
+ /**
429
+ * override server index
430
+ */
431
+ serverIndex;
432
+ /**
433
+ * base options for axios calls
434
+ */
435
+ baseOptions;
436
+ /**
437
+ * The FormData constructor that will be used to create multipart form data
438
+ * requests. You can inject this here so that execution environments that
439
+ * do not support the FormData class can still run the generated client.
440
+ *
441
+ * @type {new () => FormData}
442
+ */
443
+ formDataCtor;
444
+ constructor(param = {}) {
445
+ this.apiKey = param.apiKey;
446
+ this.username = param.username;
447
+ this.password = param.password;
448
+ this.accessToken = param.accessToken;
449
+ this.awsv4 = param.awsv4;
450
+ this.basePath = param.basePath;
451
+ this.serverIndex = param.serverIndex;
452
+ this.baseOptions = {
453
+ ...param.baseOptions,
454
+ headers: {
455
+ ...param.baseOptions?.headers
456
+ }
457
+ };
458
+ this.formDataCtor = param.formDataCtor;
459
+ }
460
+ /**
461
+ * Check if the given MIME is a JSON MIME.
462
+ * JSON MIME examples:
463
+ * application/json
464
+ * application/json; charset=UTF8
465
+ * APPLICATION/JSON
466
+ * application/vnd.company+json
467
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
468
+ * @return True if the given MIME is JSON, false otherwise.
469
+ */
470
+ isJsonMime(mime) {
471
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
472
+ return mime !== null && jsonMime.test(mime);
473
+ }
474
+ };
475
+
476
+ // src/api-model/models/researching-quantity-entry.ts
477
+ var ResearchingQuantityEntryNameEnum = {
478
+ ResearchingQuantityInShortTerm: "researchingQuantityInShortTerm",
479
+ ResearchingQuantityInMidTerm: "researchingQuantityInMidTerm",
480
+ ResearchingQuantityInLongTerm: "researchingQuantityInLongTerm"
481
+ };
482
+
483
+ // src/client.ts
484
+ var clientRateLimits = [
485
+ {
486
+ method: "get",
487
+ // eslint-disable-next-line prefer-regex-literals
488
+ urlRegex: new RegExp("^/fba/inventory/v1/summaries$"),
489
+ rate: 2,
490
+ burst: 2
491
+ }
492
+ ];
493
+ var FbaInventoryApiClient = class extends FbaInventoryApi {
494
+ constructor(configuration) {
495
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
496
+ super(new Configuration(), endpoint, axios);
497
+ }
498
+ };
499
+ export {
500
+ FbaInventoryApi,
501
+ FbaInventoryApiAxiosParamCreator,
502
+ FbaInventoryApiClient,
503
+ FbaInventoryApiFactory,
504
+ FbaInventoryApiFp,
505
+ GetInventorySummariesGranularityTypeEnum,
506
+ ResearchingQuantityEntryNameEnum,
507
+ clientRateLimits
508
+ };
509
+ //# sourceMappingURL=index.js.map