@datenkraft/bb-fulfillment-api-ts-client
Version:
The fulfillment API TS Client enables you to work with the fulfillment API
271 lines (270 loc) • 18 kB
JavaScript
;
/* 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.ShopApi = exports.ShopApiFactory = exports.ShopApiFp = exports.ShopApiAxiosParamCreator = 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");
/**
* ShopApi - axios parameter creator
* @export
*/
const ShopApiAxiosParamCreator = function (configuration) {
return {
/**
* Get a list of shops the used identity is assigned to.
* @summary Get a list of shops the used identity is assigned to.
* @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} [filterMetaShopifyShopDomain] A filter for the Shopify hostname of the shop.
* @param {boolean} [filterMetaShopifyDefaultShop] A filter for Shopify default shops.\\ Note: For shops that are part of a Shopify installation that uses multiple shops, only shops where meta.shopifyShopDefault is true will be considered as default shops.\\ All shops that are used for a single shop Shopify installation will also be considered as default shops.
* @param {string} [filterMetaShopifyOrderCountryCode] A filter for the Shopify order country code (ISO 3166-1 alpha-2).
* @param {string} [filterShopCode] A filter for one or more shopCode(s) of the shop(s) (optional).
* @param {string} [filterProjectId] A filter for the projectId of a shop (optional).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShopCollection: (page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/shop`;
// 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 (filterMetaShopifyShopDomain !== undefined) {
localVarQueryParameter['filter[meta][shopifyShopDomain]'] = filterMetaShopifyShopDomain;
}
if (filterMetaShopifyDefaultShop !== undefined) {
localVarQueryParameter['filter[meta][shopifyDefaultShop]'] = filterMetaShopifyDefaultShop;
}
if (filterMetaShopifyOrderCountryCode !== undefined) {
localVarQueryParameter['filter[meta][shopifyOrderCountryCode]'] = filterMetaShopifyOrderCountryCode;
}
if (filterShopCode !== undefined) {
localVarQueryParameter['filter[shopCode]'] = filterShopCode;
}
if (filterProjectId !== undefined) {
localVarQueryParameter['filter[projectId]'] = filterProjectId;
}
(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,
};
}),
/**
* Set one or more fields of a shop. Only a limited set of fields can be updated.
* @summary Update a shop
* @param {string} shopId Shop Id
* @param {UpdateShop} updateShop
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchShop: (shopId, updateShop, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'shopId' is not null or undefined
(0, common_1.assertParamExists)('patchShop', 'shopId', shopId);
// verify required parameter 'updateShop' is not null or undefined
(0, common_1.assertParamExists)('patchShop', 'updateShop', updateShop);
const localVarPath = `/shop/{shopId}`
.replace(`{${"shopId"}}`, encodeURIComponent(String(shopId)));
// 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);
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)(updateShop, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.ShopApiAxiosParamCreator = ShopApiAxiosParamCreator;
/**
* ShopApi - functional programming interface
* @export
*/
const ShopApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ShopApiAxiosParamCreator)(configuration);
return {
/**
* Get a list of shops the used identity is assigned to.
* @summary Get a list of shops the used identity is assigned to.
* @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} [filterMetaShopifyShopDomain] A filter for the Shopify hostname of the shop.
* @param {boolean} [filterMetaShopifyDefaultShop] A filter for Shopify default shops.\\ Note: For shops that are part of a Shopify installation that uses multiple shops, only shops where meta.shopifyShopDefault is true will be considered as default shops.\\ All shops that are used for a single shop Shopify installation will also be considered as default shops.
* @param {string} [filterMetaShopifyOrderCountryCode] A filter for the Shopify order country code (ISO 3166-1 alpha-2).
* @param {string} [filterShopCode] A filter for one or more shopCode(s) of the shop(s) (optional).
* @param {string} [filterProjectId] A filter for the projectId of a shop (optional).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Set one or more fields of a shop. Only a limited set of fields can be updated.
* @summary Update a shop
* @param {string} shopId Shop Id
* @param {UpdateShop} updateShop
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchShop(shopId, updateShop, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.patchShop(shopId, updateShop, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
};
};
exports.ShopApiFp = ShopApiFp;
/**
* ShopApi - factory interface
* @export
*/
const ShopApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ShopApiFp)(configuration);
return {
/**
* Get a list of shops the used identity is assigned to.
* @summary Get a list of shops the used identity is assigned to.
* @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} [filterMetaShopifyShopDomain] A filter for the Shopify hostname of the shop.
* @param {boolean} [filterMetaShopifyDefaultShop] A filter for Shopify default shops.\\ Note: For shops that are part of a Shopify installation that uses multiple shops, only shops where meta.shopifyShopDefault is true will be considered as default shops.\\ All shops that are used for a single shop Shopify installation will also be considered as default shops.
* @param {string} [filterMetaShopifyOrderCountryCode] A filter for the Shopify order country code (ISO 3166-1 alpha-2).
* @param {string} [filterShopCode] A filter for one or more shopCode(s) of the shop(s) (optional).
* @param {string} [filterProjectId] A filter for the projectId of a shop (optional).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options) {
return localVarFp.getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options).then((request) => request(axios, basePath));
},
/**
* Set one or more fields of a shop. Only a limited set of fields can be updated.
* @summary Update a shop
* @param {string} shopId Shop Id
* @param {UpdateShop} updateShop
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchShop(shopId, updateShop, options) {
return localVarFp.patchShop(shopId, updateShop, options).then((request) => request(axios, basePath));
},
};
};
exports.ShopApiFactory = ShopApiFactory;
/**
* ShopApi - object-oriented interface
* @export
* @class ShopApi
* @extends {BaseAPI}
*/
class ShopApi extends base_1.BaseAPI {
/**
* Get a list of shops the used identity is assigned to.
* @summary Get a list of shops the used identity is assigned to.
* @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} [filterMetaShopifyShopDomain] A filter for the Shopify hostname of the shop.
* @param {boolean} [filterMetaShopifyDefaultShop] A filter for Shopify default shops.\\ Note: For shops that are part of a Shopify installation that uses multiple shops, only shops where meta.shopifyShopDefault is true will be considered as default shops.\\ All shops that are used for a single shop Shopify installation will also be considered as default shops.
* @param {string} [filterMetaShopifyOrderCountryCode] A filter for the Shopify order country code (ISO 3166-1 alpha-2).
* @param {string} [filterShopCode] A filter for one or more shopCode(s) of the shop(s) (optional).
* @param {string} [filterProjectId] A filter for the projectId of a shop (optional).
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShopApi
*/
getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options) {
return (0, exports.ShopApiFp)(this.configuration).getShopCollection(page, pageSize, paginationMode, filterMetaShopifyShopDomain, filterMetaShopifyDefaultShop, filterMetaShopifyOrderCountryCode, filterShopCode, filterProjectId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Set one or more fields of a shop. Only a limited set of fields can be updated.
* @summary Update a shop
* @param {string} shopId Shop Id
* @param {UpdateShop} updateShop
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ShopApi
*/
patchShop(shopId, updateShop, options) {
return (0, exports.ShopApiFp)(this.configuration).patchShop(shopId, updateShop, options).then((request) => request(this.axios, this.basePath));
}
}
exports.ShopApi = ShopApi;