@sp-api-sdk/catalog-items-api-2022-04-01 4.2.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 (122) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +530 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1280 -0
  5. package/dist/index.d.ts +1280 -0
  6. package/dist/index.js +481 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/catalog-items-api.js +0 -283
  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/brand-refinement.js +0 -15
  16. package/dist/cjs/api-model/models/classification-refinement.js +0 -15
  17. package/dist/cjs/api-model/models/dimension.js +0 -15
  18. package/dist/cjs/api-model/models/dimensions.js +0 -15
  19. package/dist/cjs/api-model/models/error-list.js +0 -15
  20. package/dist/cjs/api-model/models/index.js +0 -45
  21. package/dist/cjs/api-model/models/item-browse-classification.js +0 -15
  22. package/dist/cjs/api-model/models/item-browse-classifications-by-marketplace.js +0 -15
  23. package/dist/cjs/api-model/models/item-classification-sales-rank.js +0 -15
  24. package/dist/cjs/api-model/models/item-contributor-role.js +0 -15
  25. package/dist/cjs/api-model/models/item-contributor.js +0 -15
  26. package/dist/cjs/api-model/models/item-dimensions-by-marketplace.js +0 -15
  27. package/dist/cjs/api-model/models/item-display-group-sales-rank.js +0 -15
  28. package/dist/cjs/api-model/models/item-identifier.js +0 -15
  29. package/dist/cjs/api-model/models/item-identifiers-by-marketplace.js +0 -15
  30. package/dist/cjs/api-model/models/item-image.js +0 -28
  31. package/dist/cjs/api-model/models/item-images-by-marketplace.js +0 -15
  32. package/dist/cjs/api-model/models/item-product-type-by-marketplace.js +0 -15
  33. package/dist/cjs/api-model/models/item-relationship.js +0 -20
  34. package/dist/cjs/api-model/models/item-relationships-by-marketplace.js +0 -15
  35. package/dist/cjs/api-model/models/item-sales-ranks-by-marketplace.js +0 -15
  36. package/dist/cjs/api-model/models/item-search-results.js +0 -15
  37. package/dist/cjs/api-model/models/item-summary-by-marketplace.js +0 -22
  38. package/dist/cjs/api-model/models/item-variation-theme.js +0 -15
  39. package/dist/cjs/api-model/models/item-vendor-details-by-marketplace.js +0 -28
  40. package/dist/cjs/api-model/models/item-vendor-details-category.js +0 -15
  41. package/dist/cjs/api-model/models/item.js +0 -15
  42. package/dist/cjs/api-model/models/model-error.js +0 -15
  43. package/dist/cjs/api-model/models/pagination.js +0 -15
  44. package/dist/cjs/api-model/models/refinements.js +0 -15
  45. package/dist/cjs/client.js +0 -28
  46. package/dist/cjs/index.js +0 -19
  47. package/dist/es/api-model/api/catalog-items-api.js +0 -273
  48. package/dist/es/api-model/api.js +0 -14
  49. package/dist/es/api-model/base.js +0 -44
  50. package/dist/es/api-model/common.js +0 -110
  51. package/dist/es/api-model/configuration.js +0 -94
  52. package/dist/es/api-model/index.js +0 -16
  53. package/dist/es/api-model/models/brand-refinement.js +0 -14
  54. package/dist/es/api-model/models/classification-refinement.js +0 -14
  55. package/dist/es/api-model/models/dimension.js +0 -14
  56. package/dist/es/api-model/models/dimensions.js +0 -14
  57. package/dist/es/api-model/models/error-list.js +0 -14
  58. package/dist/es/api-model/models/index.js +0 -29
  59. package/dist/es/api-model/models/item-browse-classification.js +0 -14
  60. package/dist/es/api-model/models/item-browse-classifications-by-marketplace.js +0 -14
  61. package/dist/es/api-model/models/item-classification-sales-rank.js +0 -14
  62. package/dist/es/api-model/models/item-contributor-role.js +0 -14
  63. package/dist/es/api-model/models/item-contributor.js +0 -14
  64. package/dist/es/api-model/models/item-dimensions-by-marketplace.js +0 -14
  65. package/dist/es/api-model/models/item-display-group-sales-rank.js +0 -14
  66. package/dist/es/api-model/models/item-identifier.js +0 -14
  67. package/dist/es/api-model/models/item-identifiers-by-marketplace.js +0 -14
  68. package/dist/es/api-model/models/item-image.js +0 -25
  69. package/dist/es/api-model/models/item-images-by-marketplace.js +0 -14
  70. package/dist/es/api-model/models/item-product-type-by-marketplace.js +0 -14
  71. package/dist/es/api-model/models/item-relationship.js +0 -17
  72. package/dist/es/api-model/models/item-relationships-by-marketplace.js +0 -14
  73. package/dist/es/api-model/models/item-sales-ranks-by-marketplace.js +0 -14
  74. package/dist/es/api-model/models/item-search-results.js +0 -14
  75. package/dist/es/api-model/models/item-summary-by-marketplace.js +0 -19
  76. package/dist/es/api-model/models/item-variation-theme.js +0 -14
  77. package/dist/es/api-model/models/item-vendor-details-by-marketplace.js +0 -25
  78. package/dist/es/api-model/models/item-vendor-details-category.js +0 -14
  79. package/dist/es/api-model/models/item.js +0 -14
  80. package/dist/es/api-model/models/model-error.js +0 -14
  81. package/dist/es/api-model/models/pagination.js +0 -14
  82. package/dist/es/api-model/models/refinements.js +0 -14
  83. package/dist/es/client.js +0 -24
  84. package/dist/es/index.js +0 -3
  85. package/dist/types/api-model/api/catalog-items-api.d.ts +0 -232
  86. package/dist/types/api-model/api.d.ts +0 -12
  87. package/dist/types/api-model/base.d.ts +0 -42
  88. package/dist/types/api-model/common.d.ts +0 -34
  89. package/dist/types/api-model/configuration.d.ts +0 -98
  90. package/dist/types/api-model/index.d.ts +0 -14
  91. package/dist/types/api-model/models/brand-refinement.d.ts +0 -24
  92. package/dist/types/api-model/models/classification-refinement.d.ts +0 -28
  93. package/dist/types/api-model/models/dimension.d.ts +0 -24
  94. package/dist/types/api-model/models/dimensions.d.ts +0 -21
  95. package/dist/types/api-model/models/error-list.d.ts +0 -20
  96. package/dist/types/api-model/models/index.d.ts +0 -29
  97. package/dist/types/api-model/models/item-browse-classification.d.ts +0 -25
  98. package/dist/types/api-model/models/item-browse-classifications-by-marketplace.d.ts +0 -25
  99. package/dist/types/api-model/models/item-classification-sales-rank.d.ts +0 -32
  100. package/dist/types/api-model/models/item-contributor-role.d.ts +0 -24
  101. package/dist/types/api-model/models/item-contributor.d.ts +0 -22
  102. package/dist/types/api-model/models/item-dimensions-by-marketplace.d.ts +0 -23
  103. package/dist/types/api-model/models/item-display-group-sales-rank.d.ts +0 -32
  104. package/dist/types/api-model/models/item-identifier.d.ts +0 -24
  105. package/dist/types/api-model/models/item-identifiers-by-marketplace.d.ts +0 -25
  106. package/dist/types/api-model/models/item-image.d.ts +0 -45
  107. package/dist/types/api-model/models/item-images-by-marketplace.d.ts +0 -25
  108. package/dist/types/api-model/models/item-product-type-by-marketplace.d.ts +0 -24
  109. package/dist/types/api-model/models/item-relationship.d.ts +0 -35
  110. package/dist/types/api-model/models/item-relationships-by-marketplace.d.ts +0 -25
  111. package/dist/types/api-model/models/item-sales-ranks-by-marketplace.d.ts +0 -30
  112. package/dist/types/api-model/models/item-search-results.d.ts +0 -29
  113. package/dist/types/api-model/models/item-summary-by-marketplace.d.ts +0 -102
  114. package/dist/types/api-model/models/item-variation-theme.d.ts +0 -24
  115. package/dist/types/api-model/models/item-vendor-details-by-marketplace.d.ts +0 -56
  116. package/dist/types/api-model/models/item-vendor-details-category.d.ts +0 -24
  117. package/dist/types/api-model/models/item.d.ts +0 -71
  118. package/dist/types/api-model/models/model-error.d.ts +0 -28
  119. package/dist/types/api-model/models/pagination.d.ts +0 -24
  120. package/dist/types/api-model/models/refinements.d.ts +0 -26
  121. package/dist/types/client.d.ts +0 -6
  122. package/dist/types/index.d.ts +0 -3
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `catalog-items-api-2022-04-01`
1
+ # `@sp-api-sdk/catalog-items-api-2022-04-01`
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sp-api-sdk/catalog-items-api-2022-04-01)](https://www.npmjs.com/package/@sp-api-sdk/catalog-items-api-2022-04-01)
4
4
  [![XO code style](https://img.shields.io/badge/code_style-xo-cyan)](https://github.com/xojs/xo)
@@ -27,10 +27,10 @@ npm install @sp-api-sdk/catalog-items-api-2022-04-01
27
27
  import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
28
28
  import {CatalogItemsApiClient} from '@sp-api-sdk/catalog-items-api-2022-04-01'
29
29
 
30
+ // `clientId` and `clientSecret` default to the `LWA_CLIENT_ID` and
31
+ // `LWA_CLIENT_SECRET` environment variables.
30
32
  const auth = new SellingPartnerApiAuth({
31
- clientId: process.env.LWA_CLIENT_ID,
32
- clientSecret: process.env.LWA_CLIENT_SECRET,
33
- refreshToken: 'Atzr|…',
33
+ refreshToken: await getRefreshTokenForSeller(sellerId),
34
34
  })
35
35
 
36
36
  const client = new CatalogItemsApiClient({
package/dist/index.cjs ADDED
@@ -0,0 +1,530 @@
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
+ CatalogItemsApi: () => CatalogItemsApi,
34
+ CatalogItemsApiAxiosParamCreator: () => CatalogItemsApiAxiosParamCreator,
35
+ CatalogItemsApiClient: () => CatalogItemsApiClient,
36
+ CatalogItemsApiFactory: () => CatalogItemsApiFactory,
37
+ CatalogItemsApiFp: () => CatalogItemsApiFp,
38
+ GetCatalogItemIncludedDataEnum: () => GetCatalogItemIncludedDataEnum,
39
+ ItemImageVariantEnum: () => ItemImageVariantEnum,
40
+ ItemRelationshipTypeEnum: () => ItemRelationshipTypeEnum,
41
+ ItemSummaryByMarketplaceItemClassificationEnum: () => ItemSummaryByMarketplaceItemClassificationEnum,
42
+ ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum: () => ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum,
43
+ SearchCatalogItemsIdentifiersTypeEnum: () => SearchCatalogItemsIdentifiersTypeEnum,
44
+ SearchCatalogItemsIncludedDataEnum: () => SearchCatalogItemsIncludedDataEnum,
45
+ clientRateLimits: () => clientRateLimits
46
+ });
47
+ module.exports = __toCommonJS(index_exports);
48
+
49
+ // src/client.ts
50
+ var import_common2 = require("@sp-api-sdk/common");
51
+
52
+ // src/api-model/api/catalog-items-api.ts
53
+ var import_axios2 = __toESM(require("axios"), 1);
54
+
55
+ // src/api-model/base.ts
56
+ var import_axios = __toESM(require("axios"), 1);
57
+ var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
58
+ var COLLECTION_FORMATS = {
59
+ csv: ",",
60
+ ssv: " ",
61
+ tsv: " ",
62
+ pipes: "|"
63
+ };
64
+ var BaseAPI = class {
65
+ constructor(configuration, basePath = BASE_PATH, axios = import_axios.default) {
66
+ this.basePath = basePath;
67
+ this.axios = axios;
68
+ if (configuration) {
69
+ this.configuration = configuration;
70
+ this.basePath = configuration.basePath ?? basePath;
71
+ }
72
+ }
73
+ basePath;
74
+ axios;
75
+ configuration;
76
+ };
77
+ var RequiredError = class extends Error {
78
+ constructor(field, msg) {
79
+ super(msg);
80
+ this.field = field;
81
+ this.name = "RequiredError";
82
+ }
83
+ field;
84
+ };
85
+ var operationServerMap = {};
86
+
87
+ // src/api-model/common.ts
88
+ var DUMMY_BASE_URL = "https://example.com";
89
+ var assertParamExists = function(functionName, paramName, paramValue) {
90
+ if (paramValue === null || paramValue === void 0) {
91
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
92
+ }
93
+ };
94
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
95
+ if (parameter == null) return;
96
+ if (typeof parameter === "object") {
97
+ if (Array.isArray(parameter) || parameter instanceof Set) {
98
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
99
+ } else {
100
+ Object.keys(parameter).forEach(
101
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
102
+ );
103
+ }
104
+ } else {
105
+ if (urlSearchParams.has(key)) {
106
+ urlSearchParams.append(key, parameter);
107
+ } else {
108
+ urlSearchParams.set(key, parameter);
109
+ }
110
+ }
111
+ }
112
+ var setSearchParams = function(url, ...objects) {
113
+ const searchParams = new URLSearchParams(url.search);
114
+ setFlattenedQueryParams(searchParams, objects);
115
+ url.search = searchParams.toString();
116
+ };
117
+ var toPathString = function(url) {
118
+ return url.pathname + url.search + url.hash;
119
+ };
120
+ var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
121
+ return (axios = globalAxios3, basePath = BASE_PATH2) => {
122
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
123
+ return axios.request(axiosRequestArgs);
124
+ };
125
+ };
126
+
127
+ // src/api-model/api/catalog-items-api.ts
128
+ var CatalogItemsApiAxiosParamCreator = function(configuration) {
129
+ return {
130
+ /**
131
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
132
+ * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
133
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
134
+ * @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
135
+ * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
136
+ * @param {*} [options] Override http request option.
137
+ * @throws {RequiredError}
138
+ */
139
+ getCatalogItem: async (asin, marketplaceIds, includedData, locale, options = {}) => {
140
+ assertParamExists("getCatalogItem", "asin", asin);
141
+ assertParamExists("getCatalogItem", "marketplaceIds", marketplaceIds);
142
+ const localVarPath = `/catalog/2022-04-01/items/{asin}`.replace("{asin}", encodeURIComponent(String(asin)));
143
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
144
+ let baseOptions;
145
+ if (configuration) {
146
+ baseOptions = configuration.baseOptions;
147
+ }
148
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
149
+ const localVarHeaderParameter = {};
150
+ const localVarQueryParameter = {};
151
+ if (marketplaceIds) {
152
+ localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
153
+ }
154
+ if (includedData) {
155
+ localVarQueryParameter["includedData"] = includedData.join(COLLECTION_FORMATS.csv);
156
+ }
157
+ if (locale !== void 0) {
158
+ localVarQueryParameter["locale"] = locale;
159
+ }
160
+ localVarHeaderParameter["Accept"] = "application/json";
161
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
162
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
163
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
164
+ return {
165
+ url: toPathString(localVarUrlObj),
166
+ options: localVarRequestOptions
167
+ };
168
+ },
169
+ /**
170
+ * Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
171
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
172
+ * @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include &#x60;identifiers&#x60; and &#x60;keywords&#x60; in the same request.
173
+ * @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** &#x60;identifiersType&#x60; is required when &#x60;identifiers&#x60; is in the request.
174
+ * @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
175
+ * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
176
+ * @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when &#x60;identifiersType&#x60; is &#x60;SKU&#x60;.
177
+ * @param {Array<string>} [keywords] A comma-delimited list of keywords that you can use to search the Amazon catalog. **Note:** You cannot include &#x60;keywords&#x60; and &#x60;identifiers&#x60; in the same request.
178
+ * @param {Array<string>} [brandNames] A comma-delimited list of brand names that you can use to limit the search in queries based on &#x60;keywords&#x60;. **Note:** Cannot be used with &#x60;identifiers&#x60;.
179
+ * @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers that you can use to limit the search in queries based on &#x60;keywords&#x60;. **Note:** Cannot be used with &#x60;identifiers&#x60;.
180
+ * @param {number} [pageSize] The number of results to include on each page.
181
+ * @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
182
+ * @param {string} [keywordsLocale] The language of the keywords that are included in queries based on &#x60;keywords&#x60;. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with &#x60;identifiers&#x60;.
183
+ * @param {*} [options] Override http request option.
184
+ * @throws {RequiredError}
185
+ */
186
+ searchCatalogItems: async (marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options = {}) => {
187
+ assertParamExists("searchCatalogItems", "marketplaceIds", marketplaceIds);
188
+ const localVarPath = `/catalog/2022-04-01/items`;
189
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
190
+ let baseOptions;
191
+ if (configuration) {
192
+ baseOptions = configuration.baseOptions;
193
+ }
194
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
195
+ const localVarHeaderParameter = {};
196
+ const localVarQueryParameter = {};
197
+ if (identifiers) {
198
+ localVarQueryParameter["identifiers"] = identifiers.join(COLLECTION_FORMATS.csv);
199
+ }
200
+ if (identifiersType !== void 0) {
201
+ localVarQueryParameter["identifiersType"] = identifiersType;
202
+ }
203
+ if (marketplaceIds) {
204
+ localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
205
+ }
206
+ if (includedData) {
207
+ localVarQueryParameter["includedData"] = includedData.join(COLLECTION_FORMATS.csv);
208
+ }
209
+ if (locale !== void 0) {
210
+ localVarQueryParameter["locale"] = locale;
211
+ }
212
+ if (sellerId !== void 0) {
213
+ localVarQueryParameter["sellerId"] = sellerId;
214
+ }
215
+ if (keywords) {
216
+ localVarQueryParameter["keywords"] = keywords.join(COLLECTION_FORMATS.csv);
217
+ }
218
+ if (brandNames) {
219
+ localVarQueryParameter["brandNames"] = brandNames.join(COLLECTION_FORMATS.csv);
220
+ }
221
+ if (classificationIds) {
222
+ localVarQueryParameter["classificationIds"] = classificationIds.join(COLLECTION_FORMATS.csv);
223
+ }
224
+ if (pageSize !== void 0) {
225
+ localVarQueryParameter["pageSize"] = pageSize;
226
+ }
227
+ if (pageToken !== void 0) {
228
+ localVarQueryParameter["pageToken"] = pageToken;
229
+ }
230
+ if (keywordsLocale !== void 0) {
231
+ localVarQueryParameter["keywordsLocale"] = keywordsLocale;
232
+ }
233
+ localVarHeaderParameter["Accept"] = "application/json";
234
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
235
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
236
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
237
+ return {
238
+ url: toPathString(localVarUrlObj),
239
+ options: localVarRequestOptions
240
+ };
241
+ }
242
+ };
243
+ };
244
+ var CatalogItemsApiFp = function(configuration) {
245
+ const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration);
246
+ return {
247
+ /**
248
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
249
+ * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
250
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
251
+ * @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
252
+ * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
253
+ * @param {*} [options] Override http request option.
254
+ * @throws {RequiredError}
255
+ */
256
+ async getCatalogItem(asin, marketplaceIds, includedData, locale, options) {
257
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogItem(asin, marketplaceIds, includedData, locale, options);
258
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
259
+ const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.getCatalogItem"]?.[localVarOperationServerIndex]?.url;
260
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
261
+ },
262
+ /**
263
+ * Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
264
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
265
+ * @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search the Amazon catalog. **Note:** You cannot include &#x60;identifiers&#x60; and &#x60;keywords&#x60; in the same request.
266
+ * @param {SearchCatalogItemsIdentifiersTypeEnum} [identifiersType] The type of product identifiers that you can use to search the Amazon catalog. **Note:** &#x60;identifiersType&#x60; is required when &#x60;identifiers&#x60; is in the request.
267
+ * @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response.
268
+ * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.
269
+ * @param {string} [sellerId] A selling partner identifier, such as a seller account or vendor code. **Note:** Required when &#x60;identifiersType&#x60; is &#x60;SKU&#x60;.
270
+ * @param {Array<string>} [keywords] A comma-delimited list of keywords that you can use to search the Amazon catalog. **Note:** You cannot include &#x60;keywords&#x60; and &#x60;identifiers&#x60; in the same request.
271
+ * @param {Array<string>} [brandNames] A comma-delimited list of brand names that you can use to limit the search in queries based on &#x60;keywords&#x60;. **Note:** Cannot be used with &#x60;identifiers&#x60;.
272
+ * @param {Array<string>} [classificationIds] A comma-delimited list of classification identifiers that you can use to limit the search in queries based on &#x60;keywords&#x60;. **Note:** Cannot be used with &#x60;identifiers&#x60;.
273
+ * @param {number} [pageSize] The number of results to include on each page.
274
+ * @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
275
+ * @param {string} [keywordsLocale] The language of the keywords that are included in queries based on &#x60;keywords&#x60;. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with &#x60;identifiers&#x60;.
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ async searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options) {
280
+ const localVarAxiosArgs = await localVarAxiosParamCreator.searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options);
281
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
282
+ const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.searchCatalogItems"]?.[localVarOperationServerIndex]?.url;
283
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
284
+ }
285
+ };
286
+ };
287
+ var CatalogItemsApiFactory = function(configuration, basePath, axios) {
288
+ const localVarFp = CatalogItemsApiFp(configuration);
289
+ return {
290
+ /**
291
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
292
+ * @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ */
296
+ getCatalogItem(requestParameters, options) {
297
+ return localVarFp.getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(axios, basePath));
298
+ },
299
+ /**
300
+ * Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
301
+ * @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
302
+ * @param {*} [options] Override http request option.
303
+ * @throws {RequiredError}
304
+ */
305
+ searchCatalogItems(requestParameters, options) {
306
+ return localVarFp.searchCatalogItems(requestParameters.marketplaceIds, requestParameters.identifiers, requestParameters.identifiersType, requestParameters.includedData, requestParameters.locale, requestParameters.sellerId, requestParameters.keywords, requestParameters.brandNames, requestParameters.classificationIds, requestParameters.pageSize, requestParameters.pageToken, requestParameters.keywordsLocale, options).then((request) => request(axios, basePath));
307
+ }
308
+ };
309
+ };
310
+ var CatalogItemsApi = class extends BaseAPI {
311
+ /**
312
+ * Retrieves details for an item in the Amazon catalog. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
313
+ * @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters.
314
+ * @param {*} [options] Override http request option.
315
+ * @throws {RequiredError}
316
+ */
317
+ getCatalogItem(requestParameters, options) {
318
+ return CatalogItemsApiFp(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath));
319
+ }
320
+ /**
321
+ * Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
322
+ * @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters.
323
+ * @param {*} [options] Override http request option.
324
+ * @throws {RequiredError}
325
+ */
326
+ searchCatalogItems(requestParameters, options) {
327
+ return CatalogItemsApiFp(this.configuration).searchCatalogItems(requestParameters.marketplaceIds, requestParameters.identifiers, requestParameters.identifiersType, requestParameters.includedData, requestParameters.locale, requestParameters.sellerId, requestParameters.keywords, requestParameters.brandNames, requestParameters.classificationIds, requestParameters.pageSize, requestParameters.pageToken, requestParameters.keywordsLocale, options).then((request) => request(this.axios, this.basePath));
328
+ }
329
+ };
330
+ var GetCatalogItemIncludedDataEnum = {
331
+ Attributes: "attributes",
332
+ Classifications: "classifications",
333
+ Dimensions: "dimensions",
334
+ Identifiers: "identifiers",
335
+ Images: "images",
336
+ ProductTypes: "productTypes",
337
+ Relationships: "relationships",
338
+ SalesRanks: "salesRanks",
339
+ Summaries: "summaries",
340
+ VendorDetails: "vendorDetails"
341
+ };
342
+ var SearchCatalogItemsIdentifiersTypeEnum = {
343
+ Asin: "ASIN",
344
+ Ean: "EAN",
345
+ Gtin: "GTIN",
346
+ Isbn: "ISBN",
347
+ Jan: "JAN",
348
+ Minsan: "MINSAN",
349
+ Sku: "SKU",
350
+ Upc: "UPC"
351
+ };
352
+ var SearchCatalogItemsIncludedDataEnum = {
353
+ Attributes: "attributes",
354
+ Classifications: "classifications",
355
+ Dimensions: "dimensions",
356
+ Identifiers: "identifiers",
357
+ Images: "images",
358
+ ProductTypes: "productTypes",
359
+ Relationships: "relationships",
360
+ SalesRanks: "salesRanks",
361
+ Summaries: "summaries",
362
+ VendorDetails: "vendorDetails"
363
+ };
364
+
365
+ // src/api-model/configuration.ts
366
+ var Configuration = class {
367
+ /**
368
+ * parameter for apiKey security
369
+ * @param name security name
370
+ */
371
+ apiKey;
372
+ /**
373
+ * parameter for basic security
374
+ */
375
+ username;
376
+ /**
377
+ * parameter for basic security
378
+ */
379
+ password;
380
+ /**
381
+ * parameter for oauth2 security
382
+ * @param name security name
383
+ * @param scopes oauth2 scope
384
+ */
385
+ accessToken;
386
+ /**
387
+ * parameter for aws4 signature security
388
+ * @param {Object} AWS4Signature - AWS4 Signature security
389
+ * @param {string} options.region - aws region
390
+ * @param {string} options.service - name of the service.
391
+ * @param {string} credentials.accessKeyId - aws access key id
392
+ * @param {string} credentials.secretAccessKey - aws access key
393
+ * @param {string} credentials.sessionToken - aws session token
394
+ * @memberof Configuration
395
+ */
396
+ awsv4;
397
+ /**
398
+ * override base path
399
+ */
400
+ basePath;
401
+ /**
402
+ * override server index
403
+ */
404
+ serverIndex;
405
+ /**
406
+ * base options for axios calls
407
+ */
408
+ baseOptions;
409
+ /**
410
+ * The FormData constructor that will be used to create multipart form data
411
+ * requests. You can inject this here so that execution environments that
412
+ * do not support the FormData class can still run the generated client.
413
+ *
414
+ * @type {new () => FormData}
415
+ */
416
+ formDataCtor;
417
+ constructor(param = {}) {
418
+ this.apiKey = param.apiKey;
419
+ this.username = param.username;
420
+ this.password = param.password;
421
+ this.accessToken = param.accessToken;
422
+ this.awsv4 = param.awsv4;
423
+ this.basePath = param.basePath;
424
+ this.serverIndex = param.serverIndex;
425
+ this.baseOptions = {
426
+ ...param.baseOptions,
427
+ headers: {
428
+ ...param.baseOptions?.headers
429
+ }
430
+ };
431
+ this.formDataCtor = param.formDataCtor;
432
+ }
433
+ /**
434
+ * Check if the given MIME is a JSON MIME.
435
+ * JSON MIME examples:
436
+ * application/json
437
+ * application/json; charset=UTF8
438
+ * APPLICATION/JSON
439
+ * application/vnd.company+json
440
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
441
+ * @return True if the given MIME is JSON, false otherwise.
442
+ */
443
+ isJsonMime(mime) {
444
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
445
+ return mime !== null && jsonMime.test(mime);
446
+ }
447
+ };
448
+
449
+ // src/api-model/models/item-image.ts
450
+ var ItemImageVariantEnum = {
451
+ Main: "MAIN",
452
+ Pt01: "PT01",
453
+ Pt02: "PT02",
454
+ Pt03: "PT03",
455
+ Pt04: "PT04",
456
+ Pt05: "PT05",
457
+ Pt06: "PT06",
458
+ Pt07: "PT07",
459
+ Pt08: "PT08",
460
+ Swch: "SWCH"
461
+ };
462
+
463
+ // src/api-model/models/item-relationship.ts
464
+ var ItemRelationshipTypeEnum = {
465
+ Variation: "VARIATION",
466
+ PackageHierarchy: "PACKAGE_HIERARCHY"
467
+ };
468
+
469
+ // src/api-model/models/item-summary-by-marketplace.ts
470
+ var ItemSummaryByMarketplaceItemClassificationEnum = {
471
+ BaseProduct: "BASE_PRODUCT",
472
+ Other: "OTHER",
473
+ ProductBundle: "PRODUCT_BUNDLE",
474
+ VariationParent: "VARIATION_PARENT"
475
+ };
476
+
477
+ // src/api-model/models/item-vendor-details-by-marketplace.ts
478
+ var ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum = {
479
+ Allocated: "ALLOCATED",
480
+ BasicReplenishment: "BASIC_REPLENISHMENT",
481
+ InSeason: "IN_SEASON",
482
+ LimitedReplenishment: "LIMITED_REPLENISHMENT",
483
+ ManufacturerOutOfStock: "MANUFACTURER_OUT_OF_STOCK",
484
+ NewProduct: "NEW_PRODUCT",
485
+ NonReplenishable: "NON_REPLENISHABLE",
486
+ NonStockupable: "NON_STOCKUPABLE",
487
+ Obsolete: "OBSOLETE",
488
+ PlannedReplenishment: "PLANNED_REPLENISHMENT"
489
+ };
490
+
491
+ // src/client.ts
492
+ var clientRateLimits = [
493
+ {
494
+ method: "get",
495
+ // eslint-disable-next-line prefer-regex-literals
496
+ urlRegex: new RegExp("^/catalog/2022-04-01/items$"),
497
+ rate: 2,
498
+ burst: 2
499
+ },
500
+ {
501
+ method: "get",
502
+ // eslint-disable-next-line prefer-regex-literals
503
+ urlRegex: new RegExp("^/catalog/2022-04-01/items/[^/]*$"),
504
+ rate: 2,
505
+ burst: 2
506
+ }
507
+ ];
508
+ var CatalogItemsApiClient = class extends CatalogItemsApi {
509
+ constructor(configuration) {
510
+ const { axios, endpoint } = (0, import_common2.createAxiosInstance)(configuration, clientRateLimits);
511
+ super(new Configuration(), endpoint, axios);
512
+ }
513
+ };
514
+ // Annotate the CommonJS export names for ESM import in node:
515
+ 0 && (module.exports = {
516
+ CatalogItemsApi,
517
+ CatalogItemsApiAxiosParamCreator,
518
+ CatalogItemsApiClient,
519
+ CatalogItemsApiFactory,
520
+ CatalogItemsApiFp,
521
+ GetCatalogItemIncludedDataEnum,
522
+ ItemImageVariantEnum,
523
+ ItemRelationshipTypeEnum,
524
+ ItemSummaryByMarketplaceItemClassificationEnum,
525
+ ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum,
526
+ SearchCatalogItemsIdentifiersTypeEnum,
527
+ SearchCatalogItemsIncludedDataEnum,
528
+ clientRateLimits
529
+ });
530
+ //# sourceMappingURL=index.cjs.map