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