@sp-api-sdk/catalog-items-api-v0 5.0.0 → 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.
package/dist/index.js CHANGED
@@ -1,268 +1,254 @@
1
- // src/client.ts
2
1
  import { createAxiosInstance } from "@sp-api-sdk/common";
3
-
4
- // src/api-model/api/catalog-items-api.ts
5
- import globalAxios2 from "axios";
6
-
7
- // src/api-model/base.ts
8
2
  import globalAxios from "axios";
9
- var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
3
+ //#region src/api-model/base.ts
4
+ const BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
10
5
  var BaseAPI = class {
11
- constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
12
- this.basePath = basePath;
13
- this.axios = axios;
14
- if (configuration) {
15
- this.configuration = configuration;
16
- this.basePath = configuration.basePath ?? basePath;
17
- }
18
- }
19
- basePath;
20
- axios;
21
- configuration;
6
+ basePath;
7
+ axios;
8
+ configuration;
9
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
10
+ this.basePath = basePath;
11
+ this.axios = axios;
12
+ if (configuration) {
13
+ this.configuration = configuration;
14
+ this.basePath = configuration.basePath ?? basePath;
15
+ }
16
+ }
22
17
  };
23
18
  var RequiredError = class extends Error {
24
- constructor(field, msg) {
25
- super(msg);
26
- this.field = field;
27
- this.name = "RequiredError";
28
- }
29
- field;
19
+ field;
20
+ constructor(field, msg) {
21
+ super(msg);
22
+ this.field = field;
23
+ this.name = "RequiredError";
24
+ }
30
25
  };
31
- var operationServerMap = {};
32
-
33
- // src/api-model/common.ts
34
- var DUMMY_BASE_URL = "https://example.com";
35
- var assertParamExists = function(functionName, paramName, paramValue) {
36
- if (paramValue === null || paramValue === void 0) {
37
- throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
38
- }
26
+ const operationServerMap = {};
27
+ //#endregion
28
+ //#region src/api-model/common.ts
29
+ const DUMMY_BASE_URL = "https://example.com";
30
+ /**
31
+ *
32
+ * @throws {RequiredError}
33
+ */
34
+ const assertParamExists = function(functionName, paramName, paramValue) {
35
+ if (paramValue === null || paramValue === void 0) throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
39
36
  };
40
37
  function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
41
- if (parameter == null) return;
42
- if (typeof parameter === "object") {
43
- if (Array.isArray(parameter) || parameter instanceof Set) {
44
- parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
45
- } else {
46
- Object.keys(parameter).forEach(
47
- (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
48
- );
49
- }
50
- } else {
51
- if (urlSearchParams.has(key)) {
52
- urlSearchParams.append(key, parameter);
53
- } else {
54
- urlSearchParams.set(key, parameter);
55
- }
56
- }
38
+ if (parameter == null) return;
39
+ if (typeof parameter === "object") if (Array.isArray(parameter) || parameter instanceof Set) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
40
+ else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
41
+ else if (urlSearchParams.has(key)) urlSearchParams.append(key, parameter);
42
+ else urlSearchParams.set(key, parameter);
57
43
  }
58
- var setSearchParams = function(url, ...objects) {
59
- const searchParams = new URLSearchParams(url.search);
60
- setFlattenedQueryParams(searchParams, objects);
61
- url.search = searchParams.toString();
44
+ const setSearchParams = function(url, ...objects) {
45
+ const searchParams = new URLSearchParams(url.search);
46
+ setFlattenedQueryParams(searchParams, objects);
47
+ url.search = searchParams.toString();
62
48
  };
63
- var toPathString = function(url) {
64
- return url.pathname + url.search + url.hash;
49
+ const toPathString = function(url) {
50
+ return url.pathname + url.search + url.hash;
65
51
  };
66
- var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
67
- return (axios = globalAxios3, basePath = BASE_PATH2) => {
68
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
69
- return axios.request(axiosRequestArgs);
70
- };
52
+ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
53
+ return (axios = globalAxios, basePath = BASE_PATH) => {
54
+ const axiosRequestArgs = {
55
+ ...axiosArgs.options,
56
+ url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url
57
+ };
58
+ return axios.request(axiosRequestArgs);
59
+ };
71
60
  };
72
-
73
- // src/api-model/api/catalog-items-api.ts
74
- var CatalogItemsApiAxiosParamCreator = function(configuration) {
75
- return {
76
- /**
77
- * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
78
- * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
79
- * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
80
- * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
81
- * @param {*} [options] Override http request option.
82
- * @throws {RequiredError}
83
- */
84
- listCatalogCategories: async (marketplaceId, aSIN, sellerSKU, options = {}) => {
85
- assertParamExists("listCatalogCategories", "marketplaceId", marketplaceId);
86
- const localVarPath = `/catalog/v0/categories`;
87
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
88
- let baseOptions;
89
- if (configuration) {
90
- baseOptions = configuration.baseOptions;
91
- }
92
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
93
- const localVarHeaderParameter = {};
94
- const localVarQueryParameter = {};
95
- if (marketplaceId !== void 0) {
96
- localVarQueryParameter["MarketplaceId"] = marketplaceId;
97
- }
98
- if (aSIN !== void 0) {
99
- localVarQueryParameter["ASIN"] = aSIN;
100
- }
101
- if (sellerSKU !== void 0) {
102
- localVarQueryParameter["SellerSKU"] = sellerSKU;
103
- }
104
- localVarHeaderParameter["Accept"] = "application/json";
105
- setSearchParams(localVarUrlObj, localVarQueryParameter);
106
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
107
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
108
- return {
109
- url: toPathString(localVarUrlObj),
110
- options: localVarRequestOptions
111
- };
112
- }
113
- };
61
+ //#endregion
62
+ //#region src/api-model/api/catalog-items-api.ts
63
+ /**
64
+ * CatalogItemsApi - axios parameter creator
65
+ */
66
+ const CatalogItemsApiAxiosParamCreator = function(configuration) {
67
+ return {
68
+ /**
69
+ * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
70
+ * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
71
+ * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
72
+ * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
73
+ * @param {*} [options] Override http request option.
74
+ * @throws {RequiredError}
75
+ */
76
+ listCatalogCategories: async (marketplaceId, aSIN, sellerSKU, options = {}) => {
77
+ assertParamExists("listCatalogCategories", "marketplaceId", marketplaceId);
78
+ const localVarUrlObj = new URL(`/catalog/v0/categories`, DUMMY_BASE_URL);
79
+ let baseOptions;
80
+ if (configuration) baseOptions = configuration.baseOptions;
81
+ const localVarRequestOptions = {
82
+ method: "GET",
83
+ ...baseOptions,
84
+ ...options
85
+ };
86
+ const localVarHeaderParameter = {};
87
+ const localVarQueryParameter = {};
88
+ if (marketplaceId !== void 0) localVarQueryParameter["MarketplaceId"] = marketplaceId;
89
+ if (aSIN !== void 0) localVarQueryParameter["ASIN"] = aSIN;
90
+ if (sellerSKU !== void 0) localVarQueryParameter["SellerSKU"] = sellerSKU;
91
+ localVarHeaderParameter["Accept"] = "application/json";
92
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
93
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
94
+ localVarRequestOptions.headers = {
95
+ ...localVarHeaderParameter,
96
+ ...headersFromBaseOptions,
97
+ ...options.headers
98
+ };
99
+ return {
100
+ url: toPathString(localVarUrlObj),
101
+ options: localVarRequestOptions
102
+ };
103
+ } };
114
104
  };
115
- var CatalogItemsApiFp = function(configuration) {
116
- const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration);
117
- return {
118
- /**
119
- * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
120
- * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
121
- * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
122
- * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
123
- * @param {*} [options] Override http request option.
124
- * @throws {RequiredError}
125
- */
126
- async listCatalogCategories(marketplaceId, aSIN, sellerSKU, options) {
127
- const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options);
128
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
129
- const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.listCatalogCategories"]?.[localVarOperationServerIndex]?.url;
130
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
131
- }
132
- };
105
+ /**
106
+ * CatalogItemsApi - functional programming interface
107
+ */
108
+ const CatalogItemsApiFp = function(configuration) {
109
+ const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration);
110
+ return {
111
+ /**
112
+ * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
113
+ * @param {string} marketplaceId A marketplace identifier. Specifies the marketplace for the item.
114
+ * @param {string} [aSIN] The Amazon Standard Identification Number (ASIN) of the item.
115
+ * @param {string} [sellerSKU] Used to identify items in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
116
+ * @param {*} [options] Override http request option.
117
+ * @throws {RequiredError}
118
+ */
119
+ async listCatalogCategories(marketplaceId, aSIN, sellerSKU, options) {
120
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listCatalogCategories(marketplaceId, aSIN, sellerSKU, options);
121
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
122
+ const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.listCatalogCategories"]?.[localVarOperationServerIndex]?.url;
123
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
124
+ } };
133
125
  };
134
- var CatalogItemsApiFactory = function(configuration, basePath, axios) {
135
- const localVarFp = CatalogItemsApiFp(configuration);
136
- return {
137
- /**
138
- * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
139
- * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
140
- * @param {*} [options] Override http request option.
141
- * @throws {RequiredError}
142
- */
143
- listCatalogCategories(requestParameters, options) {
144
- return localVarFp.listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(axios, basePath));
145
- }
146
- };
126
+ /**
127
+ * CatalogItemsApi - factory interface
128
+ */
129
+ const CatalogItemsApiFactory = function(configuration, basePath, axios) {
130
+ const localVarFp = CatalogItemsApiFp(configuration);
131
+ return {
132
+ /**
133
+ * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
134
+ * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ */
138
+ listCatalogCategories(requestParameters, options) {
139
+ return localVarFp.listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(axios, basePath));
140
+ } };
147
141
  };
142
+ /**
143
+ * CatalogItemsApi - object-oriented interface
144
+ */
148
145
  var CatalogItemsApi = class extends BaseAPI {
149
- /**
150
- * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
151
- * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
152
- * @param {*} [options] Override http request option.
153
- * @throws {RequiredError}
154
- */
155
- listCatalogCategories(requestParameters, options) {
156
- return CatalogItemsApiFp(this.configuration).listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(this.axios, this.basePath));
157
- }
146
+ /**
147
+ * Returns the parent categories to which an item belongs, based on the specified ASIN or SellerSKU. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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-in-the-sp-api).
148
+ * @param {CatalogItemsApiListCatalogCategoriesRequest} requestParameters Request parameters.
149
+ * @param {*} [options] Override http request option.
150
+ * @throws {RequiredError}
151
+ */
152
+ listCatalogCategories(requestParameters, options) {
153
+ return CatalogItemsApiFp(this.configuration).listCatalogCategories(requestParameters.marketplaceId, requestParameters.aSIN, requestParameters.sellerSKU, options).then((request) => request(this.axios, this.basePath));
154
+ }
158
155
  };
159
-
160
- // src/api-model/configuration.ts
156
+ //#endregion
157
+ //#region src/api-model/configuration.ts
161
158
  var Configuration = class {
162
- /**
163
- * parameter for apiKey security
164
- * @param name security name
165
- */
166
- apiKey;
167
- /**
168
- * parameter for basic security
169
- */
170
- username;
171
- /**
172
- * parameter for basic security
173
- */
174
- password;
175
- /**
176
- * parameter for oauth2 security
177
- * @param name security name
178
- * @param scopes oauth2 scope
179
- */
180
- accessToken;
181
- /**
182
- * parameter for aws4 signature security
183
- * @param {Object} AWS4Signature - AWS4 Signature security
184
- * @param {string} options.region - aws region
185
- * @param {string} options.service - name of the service.
186
- * @param {string} credentials.accessKeyId - aws access key id
187
- * @param {string} credentials.secretAccessKey - aws access key
188
- * @param {string} credentials.sessionToken - aws session token
189
- * @memberof Configuration
190
- */
191
- awsv4;
192
- /**
193
- * override base path
194
- */
195
- basePath;
196
- /**
197
- * override server index
198
- */
199
- serverIndex;
200
- /**
201
- * base options for axios calls
202
- */
203
- baseOptions;
204
- /**
205
- * The FormData constructor that will be used to create multipart form data
206
- * requests. You can inject this here so that execution environments that
207
- * do not support the FormData class can still run the generated client.
208
- *
209
- * @type {new () => FormData}
210
- */
211
- formDataCtor;
212
- constructor(param = {}) {
213
- this.apiKey = param.apiKey;
214
- this.username = param.username;
215
- this.password = param.password;
216
- this.accessToken = param.accessToken;
217
- this.awsv4 = param.awsv4;
218
- this.basePath = param.basePath;
219
- this.serverIndex = param.serverIndex;
220
- this.baseOptions = {
221
- ...param.baseOptions,
222
- headers: {
223
- ...param.baseOptions?.headers
224
- }
225
- };
226
- this.formDataCtor = param.formDataCtor;
227
- }
228
- /**
229
- * Check if the given MIME is a JSON MIME.
230
- * JSON MIME examples:
231
- * application/json
232
- * application/json; charset=UTF8
233
- * APPLICATION/JSON
234
- * application/vnd.company+json
235
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
236
- * @return True if the given MIME is JSON, false otherwise.
237
- */
238
- isJsonMime(mime) {
239
- const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
240
- return mime !== null && jsonMime.test(mime);
241
- }
159
+ /**
160
+ * parameter for apiKey security
161
+ * @param name security name
162
+ */
163
+ apiKey;
164
+ /**
165
+ * parameter for basic security
166
+ */
167
+ username;
168
+ /**
169
+ * parameter for basic security
170
+ */
171
+ password;
172
+ /**
173
+ * parameter for oauth2 security
174
+ * @param name security name
175
+ * @param scopes oauth2 scope
176
+ */
177
+ accessToken;
178
+ /**
179
+ * parameter for aws4 signature security
180
+ * @param {Object} AWS4Signature - AWS4 Signature security
181
+ * @param {string} options.region - aws region
182
+ * @param {string} options.service - name of the service.
183
+ * @param {string} credentials.accessKeyId - aws access key id
184
+ * @param {string} credentials.secretAccessKey - aws access key
185
+ * @param {string} credentials.sessionToken - aws session token
186
+ * @memberof Configuration
187
+ */
188
+ awsv4;
189
+ /**
190
+ * override base path
191
+ */
192
+ basePath;
193
+ /**
194
+ * override server index
195
+ */
196
+ serverIndex;
197
+ /**
198
+ * base options for axios calls
199
+ */
200
+ baseOptions;
201
+ /**
202
+ * The FormData constructor that will be used to create multipart form data
203
+ * requests. You can inject this here so that execution environments that
204
+ * do not support the FormData class can still run the generated client.
205
+ *
206
+ * @type {new () => FormData}
207
+ */
208
+ formDataCtor;
209
+ constructor(param = {}) {
210
+ this.apiKey = param.apiKey;
211
+ this.username = param.username;
212
+ this.password = param.password;
213
+ this.accessToken = param.accessToken;
214
+ this.awsv4 = param.awsv4;
215
+ this.basePath = param.basePath;
216
+ this.serverIndex = param.serverIndex;
217
+ this.baseOptions = {
218
+ ...param.baseOptions,
219
+ headers: { ...param.baseOptions?.headers }
220
+ };
221
+ this.formDataCtor = param.formDataCtor;
222
+ }
223
+ /**
224
+ * Check if the given MIME is a JSON MIME.
225
+ * JSON MIME examples:
226
+ * application/json
227
+ * application/json; charset=UTF8
228
+ * APPLICATION/JSON
229
+ * application/vnd.company+json
230
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
231
+ * @return True if the given MIME is JSON, false otherwise.
232
+ */
233
+ isJsonMime(mime) {
234
+ return mime !== null && /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i.test(mime);
235
+ }
242
236
  };
243
-
244
- // src/client.ts
245
- var clientRateLimits = [
246
- {
247
- method: "get",
248
- // eslint-disable-next-line prefer-regex-literals
249
- urlRegex: new RegExp("^/catalog/v0/categories$"),
250
- rate: 1,
251
- burst: 2
252
- }
253
- ];
237
+ //#endregion
238
+ //#region src/client.ts
239
+ const clientRateLimits = [{
240
+ method: "get",
241
+ urlRegex: /^\/catalog\/v0\/categories$/v,
242
+ rate: 1,
243
+ burst: 2
244
+ }];
254
245
  var CatalogItemsApiClient = class extends CatalogItemsApi {
255
- constructor(configuration) {
256
- const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
257
- super(new Configuration(), endpoint, axios);
258
- }
259
- };
260
- export {
261
- CatalogItemsApi,
262
- CatalogItemsApiAxiosParamCreator,
263
- CatalogItemsApiClient,
264
- CatalogItemsApiFactory,
265
- CatalogItemsApiFp,
266
- clientRateLimits
246
+ constructor(configuration) {
247
+ const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
248
+ super(new Configuration(), endpoint, axios);
249
+ }
267
250
  };
251
+ //#endregion
252
+ export { CatalogItemsApi, CatalogItemsApiAxiosParamCreator, CatalogItemsApiClient, CatalogItemsApiFactory, CatalogItemsApiFp, clientRateLimits };
253
+
268
254
  //# sourceMappingURL=index.js.map