UNPKG

@datenkraft/bb-fulfillment-api-ts-client

Version:

The fulfillment API TS Client enables you to work with the fulfillment API

573 lines 52.2 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Fulfillment API * - alpha: Currently developed API version. Subject to major changes. - beta: A semi-stable early access version. New features can be added. Breaking changes are possible. - stable: The API is recommended for use in production. [Changelog](https://fulfillment-api.steve.niceshops.com/v2/docs/changelog.html) All data is transferred in UTF-8 encoding.\\ The API uses stateless HTTP. No cookies have to be kept.\\ Authentication via OAuth2 client credentials flow. [Privacy Policy](https://www.niceshops.com/en/dienstleistungen/data-privacy-policy) [Fulfillment API PHP client @Packagist](https://packagist.org/packages/datenkraft/bb-fulfillment-api-php-client) * * The version of the OpenAPI document: v2.beta * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProductApi = exports.ProductApiFactory = exports.ProductApiFp = exports.ProductApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // URLSearchParams not necessarily used // @ts-ignore const url_1 = require("url"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * ProductApi - axios parameter creator * @export */ const ProductApiAxiosParamCreator = function (configuration) { return { /** * Get a product by product number. * @summary Get a product by product number. * @param {string} productNumber The product number as defined during the creation of the product. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProduct: (productNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productNumber' is not null or undefined (0, common_1.assertParamExists)('getProduct', 'productNumber', productNumber); const localVarPath = `/product/{productNumber}` .replace(`{${"productNumber"}}`, encodeURIComponent(String(productNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a list of products. * @summary Get a list of products. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productNumber - stocked - reserved - available - incoming - locked The default sort order is stocked:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterSearch] Filter for product search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields productTitle, productNumber and ean. - Each search term filters the response for products where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the product is not included in the results. * @param {'self' | 'nice' | 'bundle'} [filterSource] Filter for product source. * @param {string} [filterProductNumber] Filter for product number(s) (comma-separated, max. 100). * @param {'_availableOrInStock' | '_notAvailableAndOutOfStock'} [filterProductAvailabilityStatus] Filter for productAvailabilityStatus \\ By default, all products are returned. \\ Use \'_availableOrInStock\' to only return products that are available or in stock. \\ Use \'_notAvailableAndOutOfStock\' to only return products that are not available and out of stock. * @param {'standard' | 'sample' | 'sellable_sample' | 'tester' | 'packing_material' | 'booking_seminar' | 'booking_appointment' | 'promo_material' | 'raw_material' | 'working_material' | 'service_principal' | 'service_ancillary' | 'inquiry_testdrive' | 'inquiry_raffle' | 'chilled_product' | 'limited_edition' | 'voucher_print' | 'voucher_digital' | 'bundle' | 'print_greetingcard' | 'personalized' | 'other_services'} [filterProductType] Filter for product type. * @param {boolean} [filterHasProductImage] A filter to only return products where a product image is present. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductCollection: (page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/product`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (filterShopCode !== undefined) { localVarQueryParameter['filter[shopCode]'] = filterShopCode; } if (filterSearch !== undefined) { localVarQueryParameter['filter[search]'] = filterSearch; } if (filterSource !== undefined) { localVarQueryParameter['filter[source]'] = filterSource; } if (filterProductNumber !== undefined) { localVarQueryParameter['filter[productNumber]'] = filterProductNumber; } if (filterProductAvailabilityStatus !== undefined) { localVarQueryParameter['filter[productAvailabilityStatus]'] = filterProductAvailabilityStatus; } if (filterProductType !== undefined) { localVarQueryParameter['filter[productType]'] = filterProductType; } if (filterHasProductImage !== undefined) { localVarQueryParameter['filter[hasProductImage]'] = filterHasProductImage; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Read a journal collection for a specific product showing the history of stock changes. _Only products with the source \'self\' can be queried._ * @summary Read a journal collection for a specific product showing the history of stock changes. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use:\\ - default: The total number of items in the collection will not be calculated.\\ - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterDateFrom] The start date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterDateTo] The end date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterReason] Filter journal entries for one or more reasons - expired: Taking an expired product off the books - damaged: Taking a damaged product off the books - own_withdrawl: Product taken for own use - correction: Manual correction - niceshops_order: Product sold via a shop from niceshops - inbound: Restocking the product - fulfillment: steve fulfilled an order - return: A customer sent the product back to our warehouse * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductJournalCollection: (productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productNumber' is not null or undefined (0, common_1.assertParamExists)('getProductJournalCollection', 'productNumber', productNumber); const localVarPath = `/product/{productNumber}/journal` .replace(`{${"productNumber"}}`, encodeURIComponent(String(productNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } if (filterDateFrom !== undefined) { localVarQueryParameter['filter[dateFrom]'] = (filterDateFrom instanceof Date) ? filterDateFrom.toISOString().substr(0, 10) : filterDateFrom; } if (filterDateTo !== undefined) { localVarQueryParameter['filter[dateTo]'] = (filterDateTo instanceof Date) ? filterDateTo.toISOString().substr(0, 10) : filterDateTo; } if (filterReason !== undefined) { localVarQueryParameter['filter[reason]'] = filterReason; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a list of product stock references. * @summary Get a list of product stock references. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {'reserved' | 'incoming'} [filterTypeCode] Filter for a specific stock reference type. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductStockReferenceCollection: (productNumber, page, pageSize, paginationMode, shopCode, filterTypeCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productNumber' is not null or undefined (0, common_1.assertParamExists)('getProductStockReferenceCollection', 'productNumber', productNumber); const localVarPath = `/product/{productNumber}/stock-reference` .replace(`{${"productNumber"}}`, encodeURIComponent(String(productNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } if (filterTypeCode !== undefined) { localVarQueryParameter['filter[typeCode]'] = filterTypeCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Patch a product. \\ All fields in the request body are optional. Only provided fields will be updated. * @summary Patch a product. * @param {string} productNumber The product number as defined during the creation of the product. * @param {PatchProduct} patchProduct * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchProduct: (productNumber, patchProduct, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'productNumber' is not null or undefined (0, common_1.assertParamExists)('patchProduct', 'productNumber', productNumber); // verify required parameter 'patchProduct' is not null or undefined (0, common_1.assertParamExists)('patchProduct', 'patchProduct', patchProduct); const localVarPath = `/product/{productNumber}` .replace(`{${"productNumber"}}`, encodeURIComponent(String(productNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(patchProduct, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.ProductApiAxiosParamCreator = ProductApiAxiosParamCreator; /** * ProductApi - functional programming interface * @export */ const ProductApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ProductApiAxiosParamCreator)(configuration); return { /** * Get a product by product number. * @summary Get a product by product number. * @param {string} productNumber The product number as defined during the creation of the product. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProduct(productNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProduct(productNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a list of products. * @summary Get a list of products. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productNumber - stocked - reserved - available - incoming - locked The default sort order is stocked:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterSearch] Filter for product search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields productTitle, productNumber and ean. - Each search term filters the response for products where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the product is not included in the results. * @param {'self' | 'nice' | 'bundle'} [filterSource] Filter for product source. * @param {string} [filterProductNumber] Filter for product number(s) (comma-separated, max. 100). * @param {'_availableOrInStock' | '_notAvailableAndOutOfStock'} [filterProductAvailabilityStatus] Filter for productAvailabilityStatus \\ By default, all products are returned. \\ Use \'_availableOrInStock\' to only return products that are available or in stock. \\ Use \'_notAvailableAndOutOfStock\' to only return products that are not available and out of stock. * @param {'standard' | 'sample' | 'sellable_sample' | 'tester' | 'packing_material' | 'booking_seminar' | 'booking_appointment' | 'promo_material' | 'raw_material' | 'working_material' | 'service_principal' | 'service_ancillary' | 'inquiry_testdrive' | 'inquiry_raffle' | 'chilled_product' | 'limited_edition' | 'voucher_print' | 'voucher_digital' | 'bundle' | 'print_greetingcard' | 'personalized' | 'other_services'} [filterProductType] Filter for product type. * @param {boolean} [filterHasProductImage] A filter to only return products where a product image is present. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Read a journal collection for a specific product showing the history of stock changes. _Only products with the source \'self\' can be queried._ * @summary Read a journal collection for a specific product showing the history of stock changes. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use:\\ - default: The total number of items in the collection will not be calculated.\\ - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterDateFrom] The start date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterDateTo] The end date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterReason] Filter journal entries for one or more reasons - expired: Taking an expired product off the books - damaged: Taking a damaged product off the books - own_withdrawl: Product taken for own use - correction: Manual correction - niceshops_order: Product sold via a shop from niceshops - inbound: Restocking the product - fulfillment: steve fulfilled an order - return: A customer sent the product back to our warehouse * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a list of product stock references. * @summary Get a list of product stock references. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {'reserved' | 'incoming'} [filterTypeCode] Filter for a specific stock reference type. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductStockReferenceCollection(productNumber, page, pageSize, paginationMode, shopCode, filterTypeCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getProductStockReferenceCollection(productNumber, page, pageSize, paginationMode, shopCode, filterTypeCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Patch a product. \\ All fields in the request body are optional. Only provided fields will be updated. * @summary Patch a product. * @param {string} productNumber The product number as defined during the creation of the product. * @param {PatchProduct} patchProduct * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchProduct(productNumber, patchProduct, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.patchProduct(productNumber, patchProduct, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; exports.ProductApiFp = ProductApiFp; /** * ProductApi - factory interface * @export */ const ProductApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ProductApiFp)(configuration); return { /** * Get a product by product number. * @summary Get a product by product number. * @param {string} productNumber The product number as defined during the creation of the product. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProduct(productNumber, shopCode, options) { return localVarFp.getProduct(productNumber, shopCode, options).then((request) => request(axios, basePath)); }, /** * Get a list of products. * @summary Get a list of products. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productNumber - stocked - reserved - available - incoming - locked The default sort order is stocked:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterSearch] Filter for product search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields productTitle, productNumber and ean. - Each search term filters the response for products where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the product is not included in the results. * @param {'self' | 'nice' | 'bundle'} [filterSource] Filter for product source. * @param {string} [filterProductNumber] Filter for product number(s) (comma-separated, max. 100). * @param {'_availableOrInStock' | '_notAvailableAndOutOfStock'} [filterProductAvailabilityStatus] Filter for productAvailabilityStatus \\ By default, all products are returned. \\ Use \'_availableOrInStock\' to only return products that are available or in stock. \\ Use \'_notAvailableAndOutOfStock\' to only return products that are not available and out of stock. * @param {'standard' | 'sample' | 'sellable_sample' | 'tester' | 'packing_material' | 'booking_seminar' | 'booking_appointment' | 'promo_material' | 'raw_material' | 'working_material' | 'service_principal' | 'service_ancillary' | 'inquiry_testdrive' | 'inquiry_raffle' | 'chilled_product' | 'limited_edition' | 'voucher_print' | 'voucher_digital' | 'bundle' | 'print_greetingcard' | 'personalized' | 'other_services'} [filterProductType] Filter for product type. * @param {boolean} [filterHasProductImage] A filter to only return products where a product image is present. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options) { return localVarFp.getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options).then((request) => request(axios, basePath)); }, /** * Read a journal collection for a specific product showing the history of stock changes. _Only products with the source \'self\' can be queried._ * @summary Read a journal collection for a specific product showing the history of stock changes. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use:\\ - default: The total number of items in the collection will not be calculated.\\ - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterDateFrom] The start date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterDateTo] The end date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterReason] Filter journal entries for one or more reasons - expired: Taking an expired product off the books - damaged: Taking a damaged product off the books - own_withdrawl: Product taken for own use - correction: Manual correction - niceshops_order: Product sold via a shop from niceshops - inbound: Restocking the product - fulfillment: steve fulfilled an order - return: A customer sent the product back to our warehouse * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options) { return localVarFp.getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options).then((request) => request(axios, basePath)); }, /** * Get a list of product stock references. * @summary Get a list of product stock references. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {'reserved' | 'incoming'} [filterTypeCode] Filter for a specific stock reference type. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProductStockReferenceCollection(productNumber, page, pageSize, paginationMode, shopCode, filterTypeCode, options) { return localVarFp.getProductStockReferenceCollection(productNumber, page, pageSize, paginationMode, shopCode, filterTypeCode, options).then((request) => request(axios, basePath)); }, /** * Patch a product. \\ All fields in the request body are optional. Only provided fields will be updated. * @summary Patch a product. * @param {string} productNumber The product number as defined during the creation of the product. * @param {PatchProduct} patchProduct * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchProduct(productNumber, patchProduct, shopCode, options) { return localVarFp.patchProduct(productNumber, patchProduct, shopCode, options).then((request) => request(axios, basePath)); }, }; }; exports.ProductApiFactory = ProductApiFactory; /** * ProductApi - object-oriented interface * @export * @class ProductApi * @extends {BaseAPI} */ class ProductApi extends base_1.BaseAPI { /** * Get a product by product number. * @summary Get a product by product number. * @param {string} productNumber The product number as defined during the creation of the product. * @param {string} [shopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductApi */ getProduct(productNumber, shopCode, options) { return (0, exports.ProductApiFp)(this.configuration).getProduct(productNumber, shopCode, options).then((request) => request(this.axios, this.basePath)); } /** * Get a list of products. * @summary Get a list of products. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - productNumber - stocked - reserved - available - incoming - locked The default sort order is stocked:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterSearch] Filter for product search. \\ Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields productTitle, productNumber and ean. - Each search term filters the response for products where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for products where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the product is not included in the results. * @param {'self' | 'nice' | 'bundle'} [filterSource] Filter for product source. * @param {string} [filterProductNumber] Filter for product number(s) (comma-separated, max. 100). * @param {'_availableOrInStock' | '_notAvailableAndOutOfStock'} [filterProductAvailabilityStatus] Filter for productAvailabilityStatus \\ By default, all products are returned. \\ Use \'_availableOrInStock\' to only return products that are available or in stock. \\ Use \'_notAvailableAndOutOfStock\' to only return products that are not available and out of stock. * @param {'standard' | 'sample' | 'sellable_sample' | 'tester' | 'packing_material' | 'booking_seminar' | 'booking_appointment' | 'promo_material' | 'raw_material' | 'working_material' | 'service_principal' | 'service_ancillary' | 'inquiry_testdrive' | 'inquiry_raffle' | 'chilled_product' | 'limited_edition' | 'voucher_print' | 'voucher_digital' | 'bundle' | 'print_greetingcard' | 'personalized' | 'other_services'} [filterProductType] Filter for product type. * @param {boolean} [filterHasProductImage] A filter to only return products where a product image is present. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductApi */ getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options) { return (0, exports.ProductApiFp)(this.configuration).getProductCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterSearch, filterSource, filterProductNumber, filterProductAvailabilityStatus, filterProductType, filterHasProductImage, options).then((request) => request(this.axios, this.basePath)); } /** * Read a journal collection for a specific product showing the history of stock changes. _Only products with the source \'self\' can be queried._ * @summary Read a journal collection for a specific product showing the history of stock changes. * @param {string} productNumber The product number as defined during the creation of the product. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use:\\ - default: The total number of items in the collection will not be calculated.\\ - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterDateFrom] The start date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterDateTo] The end date (inclusive) in format Y-m-d (timezone CET/CEST) for which product journal entries should be returned. * @param {string} [filterReason] Filter journal entries for one or more reasons - expired: Taking an expired product off the books - damaged: Taking a damaged product off the books - own_withdrawl: Product taken for own use - correction: Manual correction - niceshops_order: Product sold via a shop from niceshops - inbound: Restocking the product - fulfillment: steve fulfilled an order - return: A customer sent the product back to our warehouse * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProductApi */ getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options) { return (0, exports.ProductApiFp)(this.configuration).getProductJournalCollection(productNumber, page, pageSize, paginationMode, shopCode, filterDateFrom, filterDateTo, filterReason, options).then((request) => request(this.axios, this.basePath)); } /** * Get a list of product stock references. * @summary Get a list of product stock references. * @param {string} productNumber The product number as defined