UNPKG

@sp-api-sdk/catalog-items-api-2022-04-01

Version:

Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog. For more information, refer to the Catalog Items API Use Case Guide.

530 lines (518 loc) 30.1 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var index_exports = {}; __export(index_exports, { CatalogItemsApi: () => CatalogItemsApi, CatalogItemsApiAxiosParamCreator: () => CatalogItemsApiAxiosParamCreator, CatalogItemsApiClient: () => CatalogItemsApiClient, CatalogItemsApiFactory: () => CatalogItemsApiFactory, CatalogItemsApiFp: () => CatalogItemsApiFp, GetCatalogItemIncludedDataEnum: () => GetCatalogItemIncludedDataEnum, ItemImageVariantEnum: () => ItemImageVariantEnum, ItemRelationshipTypeEnum: () => ItemRelationshipTypeEnum, ItemSummaryByMarketplaceItemClassificationEnum: () => ItemSummaryByMarketplaceItemClassificationEnum, ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum: () => ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum, SearchCatalogItemsIdentifiersTypeEnum: () => SearchCatalogItemsIdentifiersTypeEnum, SearchCatalogItemsIncludedDataEnum: () => SearchCatalogItemsIncludedDataEnum, clientRateLimits: () => clientRateLimits }); module.exports = __toCommonJS(index_exports); // src/client.ts var import_common2 = require("@sp-api-sdk/common"); // src/api-model/api/catalog-items-api.ts var import_axios2 = __toESM(require("axios"), 1); // src/api-model/base.ts var import_axios = __toESM(require("axios"), 1); var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, ""); var COLLECTION_FORMATS = { csv: ",", ssv: " ", tsv: " ", pipes: "|" }; var BaseAPI = class { constructor(configuration, basePath = BASE_PATH, axios = import_axios.default) { this.basePath = basePath; this.axios = axios; if (configuration) { this.configuration = configuration; this.basePath = configuration.basePath ?? basePath; } } basePath; axios; configuration; }; var RequiredError = class extends Error { constructor(field, msg) { super(msg); this.field = field; this.name = "RequiredError"; } field; }; var operationServerMap = {}; // src/api-model/common.ts var DUMMY_BASE_URL = "https://example.com"; var assertParamExists = function(functionName, paramName, paramValue) { if (paramValue === null || paramValue === void 0) { throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); } }; function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { if (parameter == null) return; if (typeof parameter === "object") { if (Array.isArray(parameter) || parameter instanceof Set) { parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); } else { Object.keys(parameter).forEach( (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`) ); } } else { if (urlSearchParams.has(key)) { urlSearchParams.append(key, parameter); } else { urlSearchParams.set(key, parameter); } } } var setSearchParams = function(url, ...objects) { const searchParams = new URLSearchParams(url.search); setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); }; var toPathString = function(url) { return url.pathname + url.search + url.hash; }; var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) { return (axios = globalAxios3, basePath = BASE_PATH2) => { const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url }; return axios.request(axiosRequestArgs); }; }; // src/api-model/api/catalog-items-api.ts var CatalogItemsApiAxiosParamCreator = function(configuration) { return { /** * 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). * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @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). * @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response. * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCatalogItem: async (asin, marketplaceIds, includedData, locale, options = {}) => { assertParamExists("getCatalogItem", "asin", asin); assertParamExists("getCatalogItem", "marketplaceIds", marketplaceIds); const localVarPath = `/catalog/2022-04-01/items/{asin}`.replace("{asin}", encodeURIComponent(String(asin))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (marketplaceIds) { localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv); } if (includedData) { localVarQueryParameter["includedData"] = includedData.join(COLLECTION_FORMATS.csv); } if (locale !== void 0) { localVarQueryParameter["locale"] = locale; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * 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). * @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). * @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. * @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. * @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response. * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace. * @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;. * @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. * @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;. * @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;. * @param {number} [pageSize] The number of results to include on each page. * @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results. * @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;. * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchCatalogItems: async (marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options = {}) => { assertParamExists("searchCatalogItems", "marketplaceIds", marketplaceIds); const localVarPath = `/catalog/2022-04-01/items`; const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (identifiers) { localVarQueryParameter["identifiers"] = identifiers.join(COLLECTION_FORMATS.csv); } if (identifiersType !== void 0) { localVarQueryParameter["identifiersType"] = identifiersType; } if (marketplaceIds) { localVarQueryParameter["marketplaceIds"] = marketplaceIds.join(COLLECTION_FORMATS.csv); } if (includedData) { localVarQueryParameter["includedData"] = includedData.join(COLLECTION_FORMATS.csv); } if (locale !== void 0) { localVarQueryParameter["locale"] = locale; } if (sellerId !== void 0) { localVarQueryParameter["sellerId"] = sellerId; } if (keywords) { localVarQueryParameter["keywords"] = keywords.join(COLLECTION_FORMATS.csv); } if (brandNames) { localVarQueryParameter["brandNames"] = brandNames.join(COLLECTION_FORMATS.csv); } if (classificationIds) { localVarQueryParameter["classificationIds"] = classificationIds.join(COLLECTION_FORMATS.csv); } if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (pageToken !== void 0) { localVarQueryParameter["pageToken"] = pageToken; } if (keywordsLocale !== void 0) { localVarQueryParameter["keywordsLocale"] = keywordsLocale; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; } }; }; var CatalogItemsApiFp = function(configuration) { const localVarAxiosParamCreator = CatalogItemsApiAxiosParamCreator(configuration); return { /** * 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). * @param {string} asin The Amazon Standard Identification Number (ASIN) of the item. * @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). * @param {Array<GetCatalogItemIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response. * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getCatalogItem(asin, marketplaceIds, includedData, locale, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogItem(asin, marketplaceIds, includedData, locale, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.getCatalogItem"]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * 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). * @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). * @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. * @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. * @param {Array<SearchCatalogItemsIncludedDataEnum>} [includedData] A comma-delimited list of datasets to include in the response. * @param {string} [locale] The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace. * @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;. * @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. * @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;. * @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;. * @param {number} [pageSize] The number of results to include on each page. * @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results. * @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;. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.searchCatalogItems(marketplaceIds, identifiers, identifiersType, includedData, locale, sellerId, keywords, brandNames, classificationIds, pageSize, pageToken, keywordsLocale, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CatalogItemsApi.searchCatalogItems"]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); } }; }; var CatalogItemsApiFactory = function(configuration, basePath, axios) { const localVarFp = CatalogItemsApiFp(configuration); return { /** * 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). * @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCatalogItem(requestParameters, options) { return localVarFp.getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(axios, basePath)); }, /** * 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). * @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchCatalogItems(requestParameters, options) { 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)); } }; }; var CatalogItemsApi = class extends BaseAPI { /** * 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). * @param {CatalogItemsApiGetCatalogItemRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCatalogItem(requestParameters, options) { return CatalogItemsApiFp(this.configuration).getCatalogItem(requestParameters.asin, requestParameters.marketplaceIds, requestParameters.includedData, requestParameters.locale, options).then((request) => request(this.axios, this.basePath)); } /** * 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). * @param {CatalogItemsApiSearchCatalogItemsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ searchCatalogItems(requestParameters, options) { 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)); } }; var GetCatalogItemIncludedDataEnum = { Attributes: "attributes", Classifications: "classifications", Dimensions: "dimensions", Identifiers: "identifiers", Images: "images", ProductTypes: "productTypes", Relationships: "relationships", SalesRanks: "salesRanks", Summaries: "summaries", VendorDetails: "vendorDetails" }; var SearchCatalogItemsIdentifiersTypeEnum = { Asin: "ASIN", Ean: "EAN", Gtin: "GTIN", Isbn: "ISBN", Jan: "JAN", Minsan: "MINSAN", Sku: "SKU", Upc: "UPC" }; var SearchCatalogItemsIncludedDataEnum = { Attributes: "attributes", Classifications: "classifications", Dimensions: "dimensions", Identifiers: "identifiers", Images: "images", ProductTypes: "productTypes", Relationships: "relationships", SalesRanks: "salesRanks", Summaries: "summaries", VendorDetails: "vendorDetails" }; // src/api-model/configuration.ts var Configuration = class { /** * parameter for apiKey security * @param name security name */ apiKey; /** * parameter for basic security */ username; /** * parameter for basic security */ password; /** * parameter for oauth2 security * @param name security name * @param scopes oauth2 scope */ accessToken; /** * parameter for aws4 signature security * @param {Object} AWS4Signature - AWS4 Signature security * @param {string} options.region - aws region * @param {string} options.service - name of the service. * @param {string} credentials.accessKeyId - aws access key id * @param {string} credentials.secretAccessKey - aws access key * @param {string} credentials.sessionToken - aws session token * @memberof Configuration */ awsv4; /** * override base path */ basePath; /** * override server index */ serverIndex; /** * base options for axios calls */ baseOptions; /** * The FormData constructor that will be used to create multipart form data * requests. You can inject this here so that execution environments that * do not support the FormData class can still run the generated client. * * @type {new () => FormData} */ formDataCtor; constructor(param = {}) { this.apiKey = param.apiKey; this.username = param.username; this.password = param.password; this.accessToken = param.accessToken; this.awsv4 = param.awsv4; this.basePath = param.basePath; this.serverIndex = param.serverIndex; this.baseOptions = { ...param.baseOptions, headers: { ...param.baseOptions?.headers } }; this.formDataCtor = param.formDataCtor; } /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param mime - MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ isJsonMime(mime) { const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; return mime !== null && jsonMime.test(mime); } }; // src/api-model/models/item-image.ts var ItemImageVariantEnum = { Main: "MAIN", Pt01: "PT01", Pt02: "PT02", Pt03: "PT03", Pt04: "PT04", Pt05: "PT05", Pt06: "PT06", Pt07: "PT07", Pt08: "PT08", Swch: "SWCH" }; // src/api-model/models/item-relationship.ts var ItemRelationshipTypeEnum = { Variation: "VARIATION", PackageHierarchy: "PACKAGE_HIERARCHY" }; // src/api-model/models/item-summary-by-marketplace.ts var ItemSummaryByMarketplaceItemClassificationEnum = { BaseProduct: "BASE_PRODUCT", Other: "OTHER", ProductBundle: "PRODUCT_BUNDLE", VariationParent: "VARIATION_PARENT" }; // src/api-model/models/item-vendor-details-by-marketplace.ts var ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum = { Allocated: "ALLOCATED", BasicReplenishment: "BASIC_REPLENISHMENT", InSeason: "IN_SEASON", LimitedReplenishment: "LIMITED_REPLENISHMENT", ManufacturerOutOfStock: "MANUFACTURER_OUT_OF_STOCK", NewProduct: "NEW_PRODUCT", NonReplenishable: "NON_REPLENISHABLE", NonStockupable: "NON_STOCKUPABLE", Obsolete: "OBSOLETE", PlannedReplenishment: "PLANNED_REPLENISHMENT" }; // src/client.ts var clientRateLimits = [ { method: "get", // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp("^/catalog/2022-04-01/items$"), rate: 2, burst: 2 }, { method: "get", // eslint-disable-next-line prefer-regex-literals urlRegex: new RegExp("^/catalog/2022-04-01/items/[^/]*$"), rate: 2, burst: 2 } ]; var CatalogItemsApiClient = class extends CatalogItemsApi { constructor(configuration) { const { axios, endpoint } = (0, import_common2.createAxiosInstance)(configuration, clientRateLimits); super(new Configuration(), endpoint, axios); } }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { CatalogItemsApi, CatalogItemsApiAxiosParamCreator, CatalogItemsApiClient, CatalogItemsApiFactory, CatalogItemsApiFp, GetCatalogItemIncludedDataEnum, ItemImageVariantEnum, ItemRelationshipTypeEnum, ItemSummaryByMarketplaceItemClassificationEnum, ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum, SearchCatalogItemsIdentifiersTypeEnum, SearchCatalogItemsIncludedDataEnum, clientRateLimits }); //# sourceMappingURL=index.cjs.map