@sp-api-sdk/product-type-definitions-api-2020-09-01 4.0.17 → 5.1.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 (62) hide show
  1. package/README.md +4 -4
  2. package/dist/index.cjs +509 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +627 -0
  5. package/dist/index.d.ts +627 -0
  6. package/dist/index.js +460 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +23 -12
  9. package/dist/cjs/api-model/api/product-type-definitions-api.js +0 -278
  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/error-list.js +0 -15
  16. package/dist/cjs/api-model/models/index.js +0 -25
  17. package/dist/cjs/api-model/models/model-error.js +0 -15
  18. package/dist/cjs/api-model/models/product-type-definition.js +0 -25
  19. package/dist/cjs/api-model/models/product-type-list.js +0 -15
  20. package/dist/cjs/api-model/models/product-type-version.js +0 -15
  21. package/dist/cjs/api-model/models/product-type.js +0 -15
  22. package/dist/cjs/api-model/models/property-group.js +0 -15
  23. package/dist/cjs/api-model/models/schema-link-link.js +0 -19
  24. package/dist/cjs/api-model/models/schema-link.js +0 -15
  25. package/dist/cjs/client.js +0 -28
  26. package/dist/cjs/index.js +0 -19
  27. package/dist/es/api-model/api/product-type-definitions-api.js +0 -268
  28. package/dist/es/api-model/api.js +0 -14
  29. package/dist/es/api-model/base.js +0 -44
  30. package/dist/es/api-model/common.js +0 -110
  31. package/dist/es/api-model/configuration.js +0 -94
  32. package/dist/es/api-model/index.js +0 -16
  33. package/dist/es/api-model/models/error-list.js +0 -14
  34. package/dist/es/api-model/models/index.js +0 -9
  35. package/dist/es/api-model/models/model-error.js +0 -14
  36. package/dist/es/api-model/models/product-type-definition.js +0 -22
  37. package/dist/es/api-model/models/product-type-list.js +0 -14
  38. package/dist/es/api-model/models/product-type-version.js +0 -14
  39. package/dist/es/api-model/models/product-type.js +0 -14
  40. package/dist/es/api-model/models/property-group.js +0 -14
  41. package/dist/es/api-model/models/schema-link-link.js +0 -16
  42. package/dist/es/api-model/models/schema-link.js +0 -14
  43. package/dist/es/client.js +0 -24
  44. package/dist/es/index.js +0 -3
  45. package/dist/types/api-model/api/product-type-definitions-api.d.ts +0 -223
  46. package/dist/types/api-model/api.d.ts +0 -12
  47. package/dist/types/api-model/base.d.ts +0 -42
  48. package/dist/types/api-model/common.d.ts +0 -34
  49. package/dist/types/api-model/configuration.d.ts +0 -98
  50. package/dist/types/api-model/index.d.ts +0 -14
  51. package/dist/types/api-model/models/error-list.d.ts +0 -17
  52. package/dist/types/api-model/models/index.d.ts +0 -9
  53. package/dist/types/api-model/models/model-error.d.ts +0 -28
  54. package/dist/types/api-model/models/product-type-definition.d.ts +0 -63
  55. package/dist/types/api-model/models/product-type-list.d.ts +0 -22
  56. package/dist/types/api-model/models/product-type-version.d.ts +0 -28
  57. package/dist/types/api-model/models/product-type.d.ts +0 -28
  58. package/dist/types/api-model/models/property-group.d.ts +0 -28
  59. package/dist/types/api-model/models/schema-link-link.d.ts +0 -28
  60. package/dist/types/api-model/models/schema-link.d.ts +0 -19
  61. package/dist/types/client.d.ts +0 -6
  62. package/dist/types/index.d.ts +0 -3
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `product-type-definitions-api-2020-09-01`
1
+ # `@sp-api-sdk/product-type-definitions-api-2020-09-01`
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sp-api-sdk/product-type-definitions-api-2020-09-01)](https://www.npmjs.com/package/@sp-api-sdk/product-type-definitions-api-2020-09-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/product-type-definitions-api-2020-09-01
27
27
  import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
28
28
  import {ProductTypeDefinitionsApiClient} from '@sp-api-sdk/product-type-definitions-api-2020-09-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 ProductTypeDefinitionsApiClient({
package/dist/index.cjs ADDED
@@ -0,0 +1,509 @@
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
+ GetDefinitionsProductTypeLocaleEnum: () => GetDefinitionsProductTypeLocaleEnum,
34
+ GetDefinitionsProductTypeParentageLevelEnum: () => GetDefinitionsProductTypeParentageLevelEnum,
35
+ GetDefinitionsProductTypeRequirementsEnforcedEnum: () => GetDefinitionsProductTypeRequirementsEnforcedEnum,
36
+ GetDefinitionsProductTypeRequirementsEnum: () => GetDefinitionsProductTypeRequirementsEnum,
37
+ ProductTypeDefinitionRequirementsEnforcedEnum: () => ProductTypeDefinitionRequirementsEnforcedEnum,
38
+ ProductTypeDefinitionRequirementsEnum: () => ProductTypeDefinitionRequirementsEnum,
39
+ ProductTypeDefinitionsApi: () => ProductTypeDefinitionsApi,
40
+ ProductTypeDefinitionsApiAxiosParamCreator: () => ProductTypeDefinitionsApiAxiosParamCreator,
41
+ ProductTypeDefinitionsApiClient: () => ProductTypeDefinitionsApiClient,
42
+ ProductTypeDefinitionsApiFactory: () => ProductTypeDefinitionsApiFactory,
43
+ ProductTypeDefinitionsApiFp: () => ProductTypeDefinitionsApiFp,
44
+ SchemaLinkLinkVerbEnum: () => SchemaLinkLinkVerbEnum,
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/product-type-definitions-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/product-type-definitions-api.ts
128
+ var ProductTypeDefinitionsApiAxiosParamCreator = function(configuration) {
129
+ return {
130
+ /**
131
+ * Retrieve an Amazon product type definition. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
132
+ * @param {string} productType The Amazon product type name.
133
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.
134
+ * @param {string} [sellerId] A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner.
135
+ * @param {string} [productTypeVersion] The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided.
136
+ * @param {GetDefinitionsProductTypeRequirementsEnum} [requirements] The name of the requirements set to retrieve requirements for.
137
+ * @param {GetDefinitionsProductTypeRequirementsEnforcedEnum} [requirementsEnforced] Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates).
138
+ * @param {GetDefinitionsProductTypeLocaleEnum} [locale] Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request.
139
+ * @param {GetDefinitionsProductTypeParentageLevelEnum} [parentageLevel] The parentage level of the listing to retrieve a schema for. When provided, the schema is simplified by resolving all conditional logic related to the specified parentage level, resulting in a smaller schema with fewer conditions.
140
+ * @param {*} [options] Override http request option.
141
+ * @throws {RequiredError}
142
+ */
143
+ getDefinitionsProductType: async (productType, marketplaceIds, sellerId, productTypeVersion, requirements, requirementsEnforced, locale, parentageLevel, options = {}) => {
144
+ assertParamExists("getDefinitionsProductType", "productType", productType);
145
+ assertParamExists("getDefinitionsProductType", "marketplaceIds", marketplaceIds);
146
+ const localVarPath = `/definitions/2020-09-01/productTypes/{productType}`.replace("{productType}", encodeURIComponent(String(productType)));
147
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
148
+ let baseOptions;
149
+ if (configuration) {
150
+ baseOptions = configuration.baseOptions;
151
+ }
152
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
153
+ const localVarHeaderParameter = {};
154
+ const localVarQueryParameter = {};
155
+ if (sellerId !== void 0) {
156
+ localVarQueryParameter["sellerId"] = sellerId;
157
+ }
158
+ if (marketplaceIds) {
159
+ localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
160
+ }
161
+ if (productTypeVersion !== void 0) {
162
+ localVarQueryParameter["productTypeVersion"] = productTypeVersion;
163
+ }
164
+ if (requirements !== void 0) {
165
+ localVarQueryParameter["requirements"] = requirements;
166
+ }
167
+ if (requirementsEnforced !== void 0) {
168
+ localVarQueryParameter["requirementsEnforced"] = requirementsEnforced;
169
+ }
170
+ if (locale !== void 0) {
171
+ localVarQueryParameter["locale"] = locale;
172
+ }
173
+ if (parentageLevel !== void 0) {
174
+ localVarQueryParameter["parentageLevel"] = parentageLevel;
175
+ }
176
+ localVarHeaderParameter["Accept"] = "application/json";
177
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
178
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
179
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
180
+ return {
181
+ url: toPathString(localVarUrlObj),
182
+ options: localVarRequestOptions
183
+ };
184
+ },
185
+ /**
186
+ * Search for and return a list of Amazon product types that have definitions available. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
187
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
188
+ * @param {Array<string>} [keywords] A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;.
189
+ * @param {string} [itemName] Title of ASIN to get product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;.
190
+ * @param {string} [locale] Locale for display names in response. Defaults to primary locale of the marketplace.
191
+ * @param {string} [searchLocale] Language used for &#x60;keywords&#x60; or &#x60;itemName&#x60; parameters. Defaults to primary locale of the marketplace.
192
+ * @param {*} [options] Override http request option.
193
+ * @throws {RequiredError}
194
+ */
195
+ searchDefinitionsProductTypes: async (marketplaceIds, keywords, itemName, locale, searchLocale, options = {}) => {
196
+ assertParamExists("searchDefinitionsProductTypes", "marketplaceIds", marketplaceIds);
197
+ const localVarPath = `/definitions/2020-09-01/productTypes`;
198
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
199
+ let baseOptions;
200
+ if (configuration) {
201
+ baseOptions = configuration.baseOptions;
202
+ }
203
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
204
+ const localVarHeaderParameter = {};
205
+ const localVarQueryParameter = {};
206
+ if (keywords) {
207
+ localVarQueryParameter["keywords"] = keywords.join(COLLECTION_FORMATS.csv);
208
+ }
209
+ if (marketplaceIds) {
210
+ localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv);
211
+ }
212
+ if (itemName !== void 0) {
213
+ localVarQueryParameter["itemName"] = itemName;
214
+ }
215
+ if (locale !== void 0) {
216
+ localVarQueryParameter["locale"] = locale;
217
+ }
218
+ if (searchLocale !== void 0) {
219
+ localVarQueryParameter["searchLocale"] = searchLocale;
220
+ }
221
+ localVarHeaderParameter["Accept"] = "application/json";
222
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
223
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
224
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
225
+ return {
226
+ url: toPathString(localVarUrlObj),
227
+ options: localVarRequestOptions
228
+ };
229
+ }
230
+ };
231
+ };
232
+ var ProductTypeDefinitionsApiFp = function(configuration) {
233
+ const localVarAxiosParamCreator = ProductTypeDefinitionsApiAxiosParamCreator(configuration);
234
+ return {
235
+ /**
236
+ * Retrieve an Amazon product type definition. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
237
+ * @param {string} productType The Amazon product type name.
238
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time.
239
+ * @param {string} [sellerId] A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner.
240
+ * @param {string} [productTypeVersion] The version of the Amazon product type to retrieve. Defaults to \&quot;LATEST\&quot;. Prerelease versions of product type definitions may be retrieved with \&quot;RELEASE_CANDIDATE\&quot;. If no prerelease version is currently available, the \&quot;LATEST\&quot; live version will be provided.
241
+ * @param {GetDefinitionsProductTypeRequirementsEnum} [requirements] The name of the requirements set to retrieve requirements for.
242
+ * @param {GetDefinitionsProductTypeRequirementsEnforcedEnum} [requirementsEnforced] Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates).
243
+ * @param {GetDefinitionsProductTypeLocaleEnum} [locale] Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request.
244
+ * @param {GetDefinitionsProductTypeParentageLevelEnum} [parentageLevel] The parentage level of the listing to retrieve a schema for. When provided, the schema is simplified by resolving all conditional logic related to the specified parentage level, resulting in a smaller schema with fewer conditions.
245
+ * @param {*} [options] Override http request option.
246
+ * @throws {RequiredError}
247
+ */
248
+ async getDefinitionsProductType(productType, marketplaceIds, sellerId, productTypeVersion, requirements, requirementsEnforced, locale, parentageLevel, options) {
249
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getDefinitionsProductType(productType, marketplaceIds, sellerId, productTypeVersion, requirements, requirementsEnforced, locale, parentageLevel, options);
250
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
251
+ const localVarOperationServerBasePath = operationServerMap["ProductTypeDefinitionsApi.getDefinitionsProductType"]?.[localVarOperationServerIndex]?.url;
252
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
253
+ },
254
+ /**
255
+ * Search for and return a list of Amazon product types that have definitions available. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
256
+ * @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
257
+ * @param {Array<string>} [keywords] A comma-delimited list of keywords to search product types. **Note:** Cannot be used with &#x60;itemName&#x60;.
258
+ * @param {string} [itemName] Title of ASIN to get product type recommendation. **Note:** Cannot be used with &#x60;keywords&#x60;.
259
+ * @param {string} [locale] Locale for display names in response. Defaults to primary locale of the marketplace.
260
+ * @param {string} [searchLocale] Language used for &#x60;keywords&#x60; or &#x60;itemName&#x60; parameters. Defaults to primary locale of the marketplace.
261
+ * @param {*} [options] Override http request option.
262
+ * @throws {RequiredError}
263
+ */
264
+ async searchDefinitionsProductTypes(marketplaceIds, keywords, itemName, locale, searchLocale, options) {
265
+ const localVarAxiosArgs = await localVarAxiosParamCreator.searchDefinitionsProductTypes(marketplaceIds, keywords, itemName, locale, searchLocale, options);
266
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
267
+ const localVarOperationServerBasePath = operationServerMap["ProductTypeDefinitionsApi.searchDefinitionsProductTypes"]?.[localVarOperationServerIndex]?.url;
268
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
269
+ }
270
+ };
271
+ };
272
+ var ProductTypeDefinitionsApiFactory = function(configuration, basePath, axios) {
273
+ const localVarFp = ProductTypeDefinitionsApiFp(configuration);
274
+ return {
275
+ /**
276
+ * Retrieve an Amazon product type definition. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
277
+ * @param {ProductTypeDefinitionsApiGetDefinitionsProductTypeRequest} requestParameters Request parameters.
278
+ * @param {*} [options] Override http request option.
279
+ * @throws {RequiredError}
280
+ */
281
+ getDefinitionsProductType(requestParameters, options) {
282
+ return localVarFp.getDefinitionsProductType(requestParameters.productType, requestParameters.marketplaceIds, requestParameters.sellerId, requestParameters.productTypeVersion, requestParameters.requirements, requestParameters.requirementsEnforced, requestParameters.locale, requestParameters.parentageLevel, options).then((request) => request(axios, basePath));
283
+ },
284
+ /**
285
+ * Search for and return a list of Amazon product types that have definitions available. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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 {ProductTypeDefinitionsApiSearchDefinitionsProductTypesRequest} requestParameters Request parameters.
287
+ * @param {*} [options] Override http request option.
288
+ * @throws {RequiredError}
289
+ */
290
+ searchDefinitionsProductTypes(requestParameters, options) {
291
+ return localVarFp.searchDefinitionsProductTypes(requestParameters.marketplaceIds, requestParameters.keywords, requestParameters.itemName, requestParameters.locale, requestParameters.searchLocale, options).then((request) => request(axios, basePath));
292
+ }
293
+ };
294
+ };
295
+ var ProductTypeDefinitionsApi = class extends BaseAPI {
296
+ /**
297
+ * Retrieve an Amazon product type definition. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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 {ProductTypeDefinitionsApiGetDefinitionsProductTypeRequest} requestParameters Request parameters.
299
+ * @param {*} [options] Override http request option.
300
+ * @throws {RequiredError}
301
+ */
302
+ getDefinitionsProductType(requestParameters, options) {
303
+ return ProductTypeDefinitionsApiFp(this.configuration).getDefinitionsProductType(requestParameters.productType, requestParameters.marketplaceIds, requestParameters.sellerId, requestParameters.productTypeVersion, requestParameters.requirements, requestParameters.requirementsEnforced, requestParameters.locale, requestParameters.parentageLevel, options).then((request) => request(this.axios, this.basePath));
304
+ }
305
+ /**
306
+ * Search for and return a list of Amazon product types that have definitions available. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 5 | 10 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. 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).
307
+ * @param {ProductTypeDefinitionsApiSearchDefinitionsProductTypesRequest} requestParameters Request parameters.
308
+ * @param {*} [options] Override http request option.
309
+ * @throws {RequiredError}
310
+ */
311
+ searchDefinitionsProductTypes(requestParameters, options) {
312
+ return ProductTypeDefinitionsApiFp(this.configuration).searchDefinitionsProductTypes(requestParameters.marketplaceIds, requestParameters.keywords, requestParameters.itemName, requestParameters.locale, requestParameters.searchLocale, options).then((request) => request(this.axios, this.basePath));
313
+ }
314
+ };
315
+ var GetDefinitionsProductTypeRequirementsEnum = {
316
+ Listing: "LISTING",
317
+ ListingProductOnly: "LISTING_PRODUCT_ONLY",
318
+ ListingOfferOnly: "LISTING_OFFER_ONLY"
319
+ };
320
+ var GetDefinitionsProductTypeRequirementsEnforcedEnum = {
321
+ Enforced: "ENFORCED",
322
+ NotEnforced: "NOT_ENFORCED"
323
+ };
324
+ var GetDefinitionsProductTypeLocaleEnum = {
325
+ Default: "DEFAULT",
326
+ Ar: "ar",
327
+ ArAe: "ar_AE",
328
+ De: "de",
329
+ DeDe: "de_DE",
330
+ En: "en",
331
+ EnAe: "en_AE",
332
+ EnAu: "en_AU",
333
+ EnCa: "en_CA",
334
+ EnGb: "en_GB",
335
+ EnIn: "en_IN",
336
+ EnSg: "en_SG",
337
+ EnUs: "en_US",
338
+ Es: "es",
339
+ EsEs: "es_ES",
340
+ EsMx: "es_MX",
341
+ EsUs: "es_US",
342
+ Fr: "fr",
343
+ FrCa: "fr_CA",
344
+ FrFr: "fr_FR",
345
+ It: "it",
346
+ ItIt: "it_IT",
347
+ Ja: "ja",
348
+ JaJp: "ja_JP",
349
+ Nl: "nl",
350
+ NlNl: "nl_NL",
351
+ Pl: "pl",
352
+ PlPl: "pl_PL",
353
+ Pt: "pt",
354
+ PtBr: "pt_BR",
355
+ PtPt: "pt_PT",
356
+ Sv: "sv",
357
+ SvSe: "sv_SE",
358
+ Tr: "tr",
359
+ TrTr: "tr_TR",
360
+ Zh: "zh",
361
+ ZhCn: "zh_CN",
362
+ ZhTw: "zh_TW"
363
+ };
364
+ var GetDefinitionsProductTypeParentageLevelEnum = {
365
+ None: "NONE",
366
+ Child: "CHILD",
367
+ Parent: "PARENT"
368
+ };
369
+
370
+ // src/api-model/configuration.ts
371
+ var Configuration = class {
372
+ /**
373
+ * parameter for apiKey security
374
+ * @param name security name
375
+ */
376
+ apiKey;
377
+ /**
378
+ * parameter for basic security
379
+ */
380
+ username;
381
+ /**
382
+ * parameter for basic security
383
+ */
384
+ password;
385
+ /**
386
+ * parameter for oauth2 security
387
+ * @param name security name
388
+ * @param scopes oauth2 scope
389
+ */
390
+ accessToken;
391
+ /**
392
+ * parameter for aws4 signature security
393
+ * @param {Object} AWS4Signature - AWS4 Signature security
394
+ * @param {string} options.region - aws region
395
+ * @param {string} options.service - name of the service.
396
+ * @param {string} credentials.accessKeyId - aws access key id
397
+ * @param {string} credentials.secretAccessKey - aws access key
398
+ * @param {string} credentials.sessionToken - aws session token
399
+ * @memberof Configuration
400
+ */
401
+ awsv4;
402
+ /**
403
+ * override base path
404
+ */
405
+ basePath;
406
+ /**
407
+ * override server index
408
+ */
409
+ serverIndex;
410
+ /**
411
+ * base options for axios calls
412
+ */
413
+ baseOptions;
414
+ /**
415
+ * The FormData constructor that will be used to create multipart form data
416
+ * requests. You can inject this here so that execution environments that
417
+ * do not support the FormData class can still run the generated client.
418
+ *
419
+ * @type {new () => FormData}
420
+ */
421
+ formDataCtor;
422
+ constructor(param = {}) {
423
+ this.apiKey = param.apiKey;
424
+ this.username = param.username;
425
+ this.password = param.password;
426
+ this.accessToken = param.accessToken;
427
+ this.awsv4 = param.awsv4;
428
+ this.basePath = param.basePath;
429
+ this.serverIndex = param.serverIndex;
430
+ this.baseOptions = {
431
+ ...param.baseOptions,
432
+ headers: {
433
+ ...param.baseOptions?.headers
434
+ }
435
+ };
436
+ this.formDataCtor = param.formDataCtor;
437
+ }
438
+ /**
439
+ * Check if the given MIME is a JSON MIME.
440
+ * JSON MIME examples:
441
+ * application/json
442
+ * application/json; charset=UTF8
443
+ * APPLICATION/JSON
444
+ * application/vnd.company+json
445
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
446
+ * @return True if the given MIME is JSON, false otherwise.
447
+ */
448
+ isJsonMime(mime) {
449
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
450
+ return mime !== null && jsonMime.test(mime);
451
+ }
452
+ };
453
+
454
+ // src/api-model/models/product-type-definition.ts
455
+ var ProductTypeDefinitionRequirementsEnum = {
456
+ Listing: "LISTING",
457
+ ListingProductOnly: "LISTING_PRODUCT_ONLY",
458
+ ListingOfferOnly: "LISTING_OFFER_ONLY"
459
+ };
460
+ var ProductTypeDefinitionRequirementsEnforcedEnum = {
461
+ Enforced: "ENFORCED",
462
+ NotEnforced: "NOT_ENFORCED"
463
+ };
464
+
465
+ // src/api-model/models/schema-link-link.ts
466
+ var SchemaLinkLinkVerbEnum = {
467
+ Get: "GET"
468
+ };
469
+
470
+ // src/client.ts
471
+ var clientRateLimits = [
472
+ {
473
+ method: "get",
474
+ // eslint-disable-next-line prefer-regex-literals
475
+ urlRegex: new RegExp("^/definitions/2020-09-01/productTypes$"),
476
+ rate: 5,
477
+ burst: 10
478
+ },
479
+ {
480
+ method: "get",
481
+ // eslint-disable-next-line prefer-regex-literals
482
+ urlRegex: new RegExp("^/definitions/2020-09-01/productTypes/[^/]*$"),
483
+ rate: 5,
484
+ burst: 10
485
+ }
486
+ ];
487
+ var ProductTypeDefinitionsApiClient = class extends ProductTypeDefinitionsApi {
488
+ constructor(configuration) {
489
+ const { axios, endpoint } = (0, import_common2.createAxiosInstance)(configuration, clientRateLimits);
490
+ super(new Configuration(), endpoint, axios);
491
+ }
492
+ };
493
+ // Annotate the CommonJS export names for ESM import in node:
494
+ 0 && (module.exports = {
495
+ GetDefinitionsProductTypeLocaleEnum,
496
+ GetDefinitionsProductTypeParentageLevelEnum,
497
+ GetDefinitionsProductTypeRequirementsEnforcedEnum,
498
+ GetDefinitionsProductTypeRequirementsEnum,
499
+ ProductTypeDefinitionRequirementsEnforcedEnum,
500
+ ProductTypeDefinitionRequirementsEnum,
501
+ ProductTypeDefinitionsApi,
502
+ ProductTypeDefinitionsApiAxiosParamCreator,
503
+ ProductTypeDefinitionsApiClient,
504
+ ProductTypeDefinitionsApiFactory,
505
+ ProductTypeDefinitionsApiFp,
506
+ SchemaLinkLinkVerbEnum,
507
+ clientRateLimits
508
+ });
509
+ //# sourceMappingURL=index.cjs.map