@teemill/product-catalog 1.11.1 → 1.12.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/.openapi-generator/FILES +7 -29
- package/.openapi-generator/VERSION +1 -1
- package/README.md +3 -3
- package/api.ts +1592 -0
- package/base.ts +86 -0
- package/common.ts +150 -0
- package/configuration.ts +110 -0
- package/dist/api.d.ts +1120 -0
- package/dist/api.js +819 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +65 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +161 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +43 -0
- package/dist/esm/api.d.ts +1120 -0
- package/dist/esm/api.js +808 -0
- package/dist/esm/base.d.ts +66 -0
- package/dist/esm/base.js +60 -0
- package/dist/esm/common.d.ts +65 -0
- package/dist/esm/common.js +149 -0
- package/dist/esm/configuration.d.ts +91 -0
- package/dist/esm/configuration.js +39 -0
- package/dist/esm/index.d.ts +13 -3
- package/dist/esm/index.js +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +15 -5
- package/git_push.sh +57 -0
- package/index.ts +18 -0
- package/package.json +15 -3
- package/tsconfig.json +4 -6
- package/dist/apis/ProductsApi.d.ts +0 -107
- package/dist/apis/ProductsApi.js +0 -304
- package/dist/apis/VariantsApi.d.ts +0 -50
- package/dist/apis/VariantsApi.js +0 -131
- package/dist/apis/index.d.ts +0 -2
- package/dist/apis/index.js +0 -20
- package/dist/esm/apis/ProductsApi.d.ts +0 -107
- package/dist/esm/apis/ProductsApi.js +0 -300
- package/dist/esm/apis/VariantsApi.d.ts +0 -50
- package/dist/esm/apis/VariantsApi.js +0 -127
- package/dist/esm/apis/index.d.ts +0 -2
- package/dist/esm/apis/index.js +0 -4
- package/dist/esm/models/ApiError.d.ts +0 -37
- package/dist/esm/models/ApiError.js +0 -42
- package/dist/esm/models/Attribute.d.ts +0 -50
- package/dist/esm/models/Attribute.js +0 -49
- package/dist/esm/models/AttributeThumbnail.d.ts +0 -46
- package/dist/esm/models/AttributeThumbnail.js +0 -48
- package/dist/esm/models/CreateProductRequest.d.ts +0 -88
- package/dist/esm/models/CreateProductRequest.js +0 -63
- package/dist/esm/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
- package/dist/esm/models/CreateProductRequestAdditionalFilesInner.js +0 -43
- package/dist/esm/models/CreateProductRequestImagesInner.d.ts +0 -31
- package/dist/esm/models/CreateProductRequestImagesInner.js +0 -38
- package/dist/esm/models/CreateProductRequestSeoMetadata.d.ts +0 -31
- package/dist/esm/models/CreateProductRequestSeoMetadata.js +0 -38
- package/dist/esm/models/CreateProductRequestVariantsInner.d.ts +0 -59
- package/dist/esm/models/CreateProductRequestVariantsInner.js +0 -57
- package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
- package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -67
- package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
- package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -46
- package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
- package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.js +0 -43
- package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
- package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -46
- package/dist/esm/models/CreateProductVariant.d.ts +0 -59
- package/dist/esm/models/CreateProductVariant.js +0 -54
- package/dist/esm/models/CreateProductVariantApplicationsInner.d.ts +0 -54
- package/dist/esm/models/CreateProductVariantApplicationsInner.js +0 -58
- package/dist/esm/models/CreateProductVariantAttributesInner.d.ts +0 -37
- package/dist/esm/models/CreateProductVariantAttributesInner.js +0 -44
- package/dist/esm/models/CreateProductVariantRetailPrice.d.ts +0 -37
- package/dist/esm/models/CreateProductVariantRetailPrice.js +0 -44
- package/dist/esm/models/Image.d.ts +0 -67
- package/dist/esm/models/Image.js +0 -50
- package/dist/esm/models/ImportProducts200Response.d.ts +0 -31
- package/dist/esm/models/ImportProducts200Response.js +0 -38
- package/dist/esm/models/ModelFile.d.ts +0 -31
- package/dist/esm/models/ModelFile.js +0 -38
- package/dist/esm/models/Price.d.ts +0 -37
- package/dist/esm/models/Price.js +0 -40
- package/dist/esm/models/Product.d.ts +0 -113
- package/dist/esm/models/Product.js +0 -71
- package/dist/esm/models/ProductAdditionalFilesInner.d.ts +0 -37
- package/dist/esm/models/ProductAdditionalFilesInner.js +0 -40
- package/dist/esm/models/ProductsResponse.d.ts +0 -38
- package/dist/esm/models/ProductsResponse.js +0 -41
- package/dist/esm/models/SeoMetadata.d.ts +0 -31
- package/dist/esm/models/SeoMetadata.js +0 -38
- package/dist/esm/models/Stock.d.ts +0 -31
- package/dist/esm/models/Stock.js +0 -38
- package/dist/esm/models/UpdateProductRequest.d.ts +0 -87
- package/dist/esm/models/UpdateProductRequest.js +0 -58
- package/dist/esm/models/Variant.d.ts +0 -114
- package/dist/esm/models/Variant.js +0 -71
- package/dist/esm/models/VariantProduct.d.ts +0 -37
- package/dist/esm/models/VariantProduct.js +0 -40
- package/dist/esm/models/VariantsResponse.d.ts +0 -38
- package/dist/esm/models/VariantsResponse.js +0 -41
- package/dist/esm/models/index.d.ts +0 -23
- package/dist/esm/models/index.js +0 -25
- package/dist/esm/runtime.d.ts +0 -187
- package/dist/esm/runtime.js +0 -333
- package/dist/models/ApiError.d.ts +0 -37
- package/dist/models/ApiError.js +0 -49
- package/dist/models/Attribute.d.ts +0 -50
- package/dist/models/Attribute.js +0 -56
- package/dist/models/AttributeThumbnail.d.ts +0 -46
- package/dist/models/AttributeThumbnail.js +0 -55
- package/dist/models/CreateProductRequest.d.ts +0 -88
- package/dist/models/CreateProductRequest.js +0 -70
- package/dist/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
- package/dist/models/CreateProductRequestAdditionalFilesInner.js +0 -50
- package/dist/models/CreateProductRequestImagesInner.d.ts +0 -31
- package/dist/models/CreateProductRequestImagesInner.js +0 -45
- package/dist/models/CreateProductRequestSeoMetadata.d.ts +0 -31
- package/dist/models/CreateProductRequestSeoMetadata.js +0 -45
- package/dist/models/CreateProductRequestVariantsInner.d.ts +0 -59
- package/dist/models/CreateProductRequestVariantsInner.js +0 -64
- package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
- package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -74
- package/dist/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
- package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -53
- package/dist/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
- package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +0 -50
- package/dist/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
- package/dist/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -53
- package/dist/models/CreateProductVariant.d.ts +0 -59
- package/dist/models/CreateProductVariant.js +0 -61
- package/dist/models/CreateProductVariantApplicationsInner.d.ts +0 -54
- package/dist/models/CreateProductVariantApplicationsInner.js +0 -65
- package/dist/models/CreateProductVariantAttributesInner.d.ts +0 -37
- package/dist/models/CreateProductVariantAttributesInner.js +0 -51
- package/dist/models/CreateProductVariantRetailPrice.d.ts +0 -37
- package/dist/models/CreateProductVariantRetailPrice.js +0 -51
- package/dist/models/Image.d.ts +0 -67
- package/dist/models/Image.js +0 -57
- package/dist/models/ImportProducts200Response.d.ts +0 -31
- package/dist/models/ImportProducts200Response.js +0 -45
- package/dist/models/ModelFile.d.ts +0 -31
- package/dist/models/ModelFile.js +0 -45
- package/dist/models/Price.d.ts +0 -37
- package/dist/models/Price.js +0 -47
- package/dist/models/Product.d.ts +0 -113
- package/dist/models/Product.js +0 -78
- package/dist/models/ProductAdditionalFilesInner.d.ts +0 -37
- package/dist/models/ProductAdditionalFilesInner.js +0 -47
- package/dist/models/ProductsResponse.d.ts +0 -38
- package/dist/models/ProductsResponse.js +0 -48
- package/dist/models/SeoMetadata.d.ts +0 -31
- package/dist/models/SeoMetadata.js +0 -45
- package/dist/models/Stock.d.ts +0 -31
- package/dist/models/Stock.js +0 -45
- package/dist/models/UpdateProductRequest.d.ts +0 -87
- package/dist/models/UpdateProductRequest.js +0 -65
- package/dist/models/Variant.d.ts +0 -114
- package/dist/models/Variant.js +0 -78
- package/dist/models/VariantProduct.d.ts +0 -37
- package/dist/models/VariantProduct.js +0 -47
- package/dist/models/VariantsResponse.d.ts +0 -38
- package/dist/models/VariantsResponse.js +0 -48
- package/dist/models/index.d.ts +0 -23
- package/dist/models/index.js +0 -41
- package/dist/runtime.d.ts +0 -187
- package/dist/runtime.js +0 -349
- package/src/apis/ProductsApi.ts +0 -453
- package/src/apis/VariantsApi.ts +0 -186
- package/src/apis/index.ts +0 -4
- package/src/index.ts +0 -5
- package/src/models/ApiError.ts +0 -69
- package/src/models/Attribute.ts +0 -93
- package/src/models/AttributeThumbnail.ts +0 -80
- package/src/models/CreateProductRequest.ts +0 -153
- package/src/models/CreateProductRequestAdditionalFilesInner.ts +0 -65
- package/src/models/CreateProductRequestImagesInner.ts +0 -60
- package/src/models/CreateProductRequestSeoMetadata.ts +0 -60
- package/src/models/CreateProductRequestVariantsInner.ts +0 -124
- package/src/models/CreateProductRequestVariantsInnerApplicationsInner.ts +0 -108
- package/src/models/CreateProductRequestVariantsInnerAttributesInner.ts +0 -75
- package/src/models/CreateProductRequestVariantsInnerImagesInner.ts +0 -65
- package/src/models/CreateProductRequestVariantsInnerRetailPrice.ts +0 -75
- package/src/models/CreateProductVariant.ts +0 -119
- package/src/models/CreateProductVariantApplicationsInner.ts +0 -93
- package/src/models/CreateProductVariantAttributesInner.ts +0 -70
- package/src/models/CreateProductVariantRetailPrice.ts +0 -70
- package/src/models/Image.ts +0 -108
- package/src/models/ImportProducts200Response.ts +0 -60
- package/src/models/ModelFile.ts +0 -60
- package/src/models/Price.ts +0 -68
- package/src/models/Product.ts +0 -190
- package/src/models/ProductAdditionalFilesInner.ts +0 -68
- package/src/models/ProductsResponse.ts +0 -75
- package/src/models/SeoMetadata.ts +0 -60
- package/src/models/Stock.ts +0 -60
- package/src/models/UpdateProductRequest.ts +0 -145
- package/src/models/Variant.ts +0 -195
- package/src/models/VariantProduct.ts +0 -68
- package/src/models/VariantsResponse.ts +0 -75
- package/src/models/index.ts +0 -25
- package/src/runtime.ts +0 -441
package/dist/esm/api.js
ADDED
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.12.0
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import globalAxios from 'axios';
|
|
24
|
+
// Some imports not used depending on template conditions
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { BASE_PATH, BaseAPI, operationServerMap } from './base';
|
|
29
|
+
export const AttributeThumbnailTypeEnum = {
|
|
30
|
+
Text: 'text',
|
|
31
|
+
Color: 'color',
|
|
32
|
+
Image: 'image'
|
|
33
|
+
};
|
|
34
|
+
export const CreateProductVariantApplicationsInnerPlacementEnum = {
|
|
35
|
+
Front: 'front',
|
|
36
|
+
Back: 'back',
|
|
37
|
+
Left: 'left',
|
|
38
|
+
Right: 'right',
|
|
39
|
+
Neck: 'neck'
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* ProductsApi - axios parameter creator
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export const ProductsApiAxiosParamCreator = function (configuration) {
|
|
46
|
+
return {
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
|
|
49
|
+
* @summary Create product
|
|
50
|
+
* @param {string} project What project it is
|
|
51
|
+
* @param {CreateProductRequest} [createProductRequest]
|
|
52
|
+
* @param {*} [options] Override http request option.
|
|
53
|
+
* @throws {RequiredError}
|
|
54
|
+
*/
|
|
55
|
+
createProduct: (project_1, createProductRequest_1, ...args_1) => __awaiter(this, [project_1, createProductRequest_1, ...args_1], void 0, function* (project, createProductRequest, options = {}) {
|
|
56
|
+
// verify required parameter 'project' is not null or undefined
|
|
57
|
+
assertParamExists('createProduct', 'project', project);
|
|
58
|
+
const localVarPath = `/v1/catalog/products`;
|
|
59
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
60
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
61
|
+
let baseOptions;
|
|
62
|
+
if (configuration) {
|
|
63
|
+
baseOptions = configuration.baseOptions;
|
|
64
|
+
}
|
|
65
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
66
|
+
const localVarHeaderParameter = {};
|
|
67
|
+
const localVarQueryParameter = {};
|
|
68
|
+
// authentication session-oauth required
|
|
69
|
+
// oauth required
|
|
70
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
71
|
+
// authentication api-key required
|
|
72
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
73
|
+
if (project !== undefined) {
|
|
74
|
+
localVarQueryParameter['project'] = project;
|
|
75
|
+
}
|
|
76
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
77
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
78
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
79
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
80
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createProductRequest, localVarRequestOptions, configuration);
|
|
81
|
+
return {
|
|
82
|
+
url: toPathString(localVarUrlObj),
|
|
83
|
+
options: localVarRequestOptions,
|
|
84
|
+
};
|
|
85
|
+
}),
|
|
86
|
+
/**
|
|
87
|
+
* Deletes a catalog product
|
|
88
|
+
* @summary Delete catalog product
|
|
89
|
+
* @param {string} project What project it is
|
|
90
|
+
* @param {string} productId Product\'s unique identifier
|
|
91
|
+
* @param {*} [options] Override http request option.
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
*/
|
|
94
|
+
deleteProduct: (project_2, productId_1, ...args_2) => __awaiter(this, [project_2, productId_1, ...args_2], void 0, function* (project, productId, options = {}) {
|
|
95
|
+
// verify required parameter 'project' is not null or undefined
|
|
96
|
+
assertParamExists('deleteProduct', 'project', project);
|
|
97
|
+
// verify required parameter 'productId' is not null or undefined
|
|
98
|
+
assertParamExists('deleteProduct', 'productId', productId);
|
|
99
|
+
const localVarPath = `/v1/catalog/products/{productId}`
|
|
100
|
+
.replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
|
|
101
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
102
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
103
|
+
let baseOptions;
|
|
104
|
+
if (configuration) {
|
|
105
|
+
baseOptions = configuration.baseOptions;
|
|
106
|
+
}
|
|
107
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
108
|
+
const localVarHeaderParameter = {};
|
|
109
|
+
const localVarQueryParameter = {};
|
|
110
|
+
// authentication session-oauth required
|
|
111
|
+
// oauth required
|
|
112
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
113
|
+
// authentication api-key required
|
|
114
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
115
|
+
if (project !== undefined) {
|
|
116
|
+
localVarQueryParameter['project'] = project;
|
|
117
|
+
}
|
|
118
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
119
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
120
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
121
|
+
return {
|
|
122
|
+
url: toPathString(localVarUrlObj),
|
|
123
|
+
options: localVarRequestOptions,
|
|
124
|
+
};
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* Gets a product by a given ID.
|
|
128
|
+
* @summary Get product
|
|
129
|
+
* @param {string} project What project it is
|
|
130
|
+
* @param {string} productId Product\'s unique identifier
|
|
131
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
132
|
+
* @param {*} [options] Override http request option.
|
|
133
|
+
* @throws {RequiredError}
|
|
134
|
+
*/
|
|
135
|
+
getProduct: (project_3, productId_2, fields_1, ...args_3) => __awaiter(this, [project_3, productId_2, fields_1, ...args_3], void 0, function* (project, productId, fields, options = {}) {
|
|
136
|
+
// verify required parameter 'project' is not null or undefined
|
|
137
|
+
assertParamExists('getProduct', 'project', project);
|
|
138
|
+
// verify required parameter 'productId' is not null or undefined
|
|
139
|
+
assertParamExists('getProduct', 'productId', productId);
|
|
140
|
+
const localVarPath = `/v1/catalog/products/{productId}`
|
|
141
|
+
.replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
|
|
142
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
143
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
144
|
+
let baseOptions;
|
|
145
|
+
if (configuration) {
|
|
146
|
+
baseOptions = configuration.baseOptions;
|
|
147
|
+
}
|
|
148
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
149
|
+
const localVarHeaderParameter = {};
|
|
150
|
+
const localVarQueryParameter = {};
|
|
151
|
+
// authentication session-oauth required
|
|
152
|
+
// oauth required
|
|
153
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
154
|
+
// authentication api-key required
|
|
155
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
156
|
+
if (project !== undefined) {
|
|
157
|
+
localVarQueryParameter['project'] = project;
|
|
158
|
+
}
|
|
159
|
+
if (fields !== undefined) {
|
|
160
|
+
localVarQueryParameter['fields'] = fields;
|
|
161
|
+
}
|
|
162
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
163
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
164
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
165
|
+
return {
|
|
166
|
+
url: toPathString(localVarUrlObj),
|
|
167
|
+
options: localVarRequestOptions,
|
|
168
|
+
};
|
|
169
|
+
}),
|
|
170
|
+
/**
|
|
171
|
+
* Lists all enabled store listing products attached to the given project.
|
|
172
|
+
* @summary List products
|
|
173
|
+
* @param {string} project What project it is
|
|
174
|
+
* @param {number} [pageToken] Page reference token
|
|
175
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
176
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
177
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
178
|
+
* @param {*} [options] Override http request option.
|
|
179
|
+
* @throws {RequiredError}
|
|
180
|
+
*/
|
|
181
|
+
getProducts: (project_4, pageToken_1, search_1, pageSize_1, fields_2, ...args_4) => __awaiter(this, [project_4, pageToken_1, search_1, pageSize_1, fields_2, ...args_4], void 0, function* (project, pageToken, search, pageSize, fields, options = {}) {
|
|
182
|
+
// verify required parameter 'project' is not null or undefined
|
|
183
|
+
assertParamExists('getProducts', 'project', project);
|
|
184
|
+
const localVarPath = `/v1/catalog/products`;
|
|
185
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
186
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
187
|
+
let baseOptions;
|
|
188
|
+
if (configuration) {
|
|
189
|
+
baseOptions = configuration.baseOptions;
|
|
190
|
+
}
|
|
191
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
192
|
+
const localVarHeaderParameter = {};
|
|
193
|
+
const localVarQueryParameter = {};
|
|
194
|
+
// authentication session-oauth required
|
|
195
|
+
// oauth required
|
|
196
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
197
|
+
// authentication api-key required
|
|
198
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
199
|
+
if (project !== undefined) {
|
|
200
|
+
localVarQueryParameter['project'] = project;
|
|
201
|
+
}
|
|
202
|
+
if (pageToken !== undefined) {
|
|
203
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
204
|
+
}
|
|
205
|
+
if (search !== undefined) {
|
|
206
|
+
localVarQueryParameter['search'] = search;
|
|
207
|
+
}
|
|
208
|
+
if (pageSize !== undefined) {
|
|
209
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
210
|
+
}
|
|
211
|
+
if (fields !== undefined) {
|
|
212
|
+
localVarQueryParameter['fields'] = fields;
|
|
213
|
+
}
|
|
214
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
215
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
216
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
217
|
+
return {
|
|
218
|
+
url: toPathString(localVarUrlObj),
|
|
219
|
+
options: localVarRequestOptions,
|
|
220
|
+
};
|
|
221
|
+
}),
|
|
222
|
+
/**
|
|
223
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
224
|
+
* @summary Import products
|
|
225
|
+
* @param {string} project What project it is
|
|
226
|
+
* @param {string} [body] A data URL of a CSV file containing data for one or more products.
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
*/
|
|
230
|
+
importProducts: (project_5, body_1, ...args_5) => __awaiter(this, [project_5, body_1, ...args_5], void 0, function* (project, body, options = {}) {
|
|
231
|
+
// verify required parameter 'project' is not null or undefined
|
|
232
|
+
assertParamExists('importProducts', 'project', project);
|
|
233
|
+
const localVarPath = `/v1/catalog/products/import`;
|
|
234
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
235
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
236
|
+
let baseOptions;
|
|
237
|
+
if (configuration) {
|
|
238
|
+
baseOptions = configuration.baseOptions;
|
|
239
|
+
}
|
|
240
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
241
|
+
const localVarHeaderParameter = {};
|
|
242
|
+
const localVarQueryParameter = {};
|
|
243
|
+
// authentication session-oauth required
|
|
244
|
+
// oauth required
|
|
245
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
246
|
+
// authentication api-key required
|
|
247
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
248
|
+
if (project !== undefined) {
|
|
249
|
+
localVarQueryParameter['project'] = project;
|
|
250
|
+
}
|
|
251
|
+
localVarHeaderParameter['Content-Type'] = 'text/csv';
|
|
252
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
253
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
254
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
255
|
+
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
|
|
256
|
+
return {
|
|
257
|
+
url: toPathString(localVarUrlObj),
|
|
258
|
+
options: localVarRequestOptions,
|
|
259
|
+
};
|
|
260
|
+
}),
|
|
261
|
+
/**
|
|
262
|
+
* Updates a product by a given ID.
|
|
263
|
+
* @summary Update product
|
|
264
|
+
* @param {string} project What project it is
|
|
265
|
+
* @param {string} productId Product\'s unique identifier
|
|
266
|
+
* @param {UpdateProductRequest} [updateProductRequest]
|
|
267
|
+
* @param {*} [options] Override http request option.
|
|
268
|
+
* @throws {RequiredError}
|
|
269
|
+
*/
|
|
270
|
+
updateProduct: (project_6, productId_3, updateProductRequest_1, ...args_6) => __awaiter(this, [project_6, productId_3, updateProductRequest_1, ...args_6], void 0, function* (project, productId, updateProductRequest, options = {}) {
|
|
271
|
+
// verify required parameter 'project' is not null or undefined
|
|
272
|
+
assertParamExists('updateProduct', 'project', project);
|
|
273
|
+
// verify required parameter 'productId' is not null or undefined
|
|
274
|
+
assertParamExists('updateProduct', 'productId', productId);
|
|
275
|
+
const localVarPath = `/v1/catalog/products/{productId}`
|
|
276
|
+
.replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
|
|
277
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
278
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
279
|
+
let baseOptions;
|
|
280
|
+
if (configuration) {
|
|
281
|
+
baseOptions = configuration.baseOptions;
|
|
282
|
+
}
|
|
283
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
284
|
+
const localVarHeaderParameter = {};
|
|
285
|
+
const localVarQueryParameter = {};
|
|
286
|
+
// authentication session-oauth required
|
|
287
|
+
// oauth required
|
|
288
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
289
|
+
// authentication api-key required
|
|
290
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
291
|
+
if (project !== undefined) {
|
|
292
|
+
localVarQueryParameter['project'] = project;
|
|
293
|
+
}
|
|
294
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
295
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
296
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
297
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
298
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateProductRequest, localVarRequestOptions, configuration);
|
|
299
|
+
return {
|
|
300
|
+
url: toPathString(localVarUrlObj),
|
|
301
|
+
options: localVarRequestOptions,
|
|
302
|
+
};
|
|
303
|
+
}),
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* ProductsApi - functional programming interface
|
|
308
|
+
* @export
|
|
309
|
+
*/
|
|
310
|
+
export const ProductsApiFp = function (configuration) {
|
|
311
|
+
const localVarAxiosParamCreator = ProductsApiAxiosParamCreator(configuration);
|
|
312
|
+
return {
|
|
313
|
+
/**
|
|
314
|
+
* Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
|
|
315
|
+
* @summary Create product
|
|
316
|
+
* @param {string} project What project it is
|
|
317
|
+
* @param {CreateProductRequest} [createProductRequest]
|
|
318
|
+
* @param {*} [options] Override http request option.
|
|
319
|
+
* @throws {RequiredError}
|
|
320
|
+
*/
|
|
321
|
+
createProduct(project, createProductRequest, options) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
var _a, _b, _c;
|
|
324
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createProduct(project, createProductRequest, options);
|
|
325
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
326
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.createProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
327
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
/**
|
|
331
|
+
* Deletes a catalog product
|
|
332
|
+
* @summary Delete catalog product
|
|
333
|
+
* @param {string} project What project it is
|
|
334
|
+
* @param {string} productId Product\'s unique identifier
|
|
335
|
+
* @param {*} [options] Override http request option.
|
|
336
|
+
* @throws {RequiredError}
|
|
337
|
+
*/
|
|
338
|
+
deleteProduct(project, productId, options) {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
var _a, _b, _c;
|
|
341
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteProduct(project, productId, options);
|
|
342
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
343
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.deleteProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
344
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
/**
|
|
348
|
+
* Gets a product by a given ID.
|
|
349
|
+
* @summary Get product
|
|
350
|
+
* @param {string} project What project it is
|
|
351
|
+
* @param {string} productId Product\'s unique identifier
|
|
352
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
353
|
+
* @param {*} [options] Override http request option.
|
|
354
|
+
* @throws {RequiredError}
|
|
355
|
+
*/
|
|
356
|
+
getProduct(project, productId, fields, options) {
|
|
357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
var _a, _b, _c;
|
|
359
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getProduct(project, productId, fields, options);
|
|
360
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
361
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.getProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
362
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* Lists all enabled store listing products attached to the given project.
|
|
367
|
+
* @summary List products
|
|
368
|
+
* @param {string} project What project it is
|
|
369
|
+
* @param {number} [pageToken] Page reference token
|
|
370
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
371
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
372
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
373
|
+
* @param {*} [options] Override http request option.
|
|
374
|
+
* @throws {RequiredError}
|
|
375
|
+
*/
|
|
376
|
+
getProducts(project, pageToken, search, pageSize, fields, options) {
|
|
377
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
378
|
+
var _a, _b, _c;
|
|
379
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getProducts(project, pageToken, search, pageSize, fields, options);
|
|
380
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
381
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.getProducts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
382
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
383
|
+
});
|
|
384
|
+
},
|
|
385
|
+
/**
|
|
386
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
387
|
+
* @summary Import products
|
|
388
|
+
* @param {string} project What project it is
|
|
389
|
+
* @param {string} [body] A data URL of a CSV file containing data for one or more products.
|
|
390
|
+
* @param {*} [options] Override http request option.
|
|
391
|
+
* @throws {RequiredError}
|
|
392
|
+
*/
|
|
393
|
+
importProducts(project, body, options) {
|
|
394
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
var _a, _b, _c;
|
|
396
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.importProducts(project, body, options);
|
|
397
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
398
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.importProducts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
399
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
400
|
+
});
|
|
401
|
+
},
|
|
402
|
+
/**
|
|
403
|
+
* Updates a product by a given ID.
|
|
404
|
+
* @summary Update product
|
|
405
|
+
* @param {string} project What project it is
|
|
406
|
+
* @param {string} productId Product\'s unique identifier
|
|
407
|
+
* @param {UpdateProductRequest} [updateProductRequest]
|
|
408
|
+
* @param {*} [options] Override http request option.
|
|
409
|
+
* @throws {RequiredError}
|
|
410
|
+
*/
|
|
411
|
+
updateProduct(project, productId, updateProductRequest, options) {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
var _a, _b, _c;
|
|
414
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateProduct(project, productId, updateProductRequest, options);
|
|
415
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
416
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ProductsApi.updateProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
417
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
418
|
+
});
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* ProductsApi - factory interface
|
|
424
|
+
* @export
|
|
425
|
+
*/
|
|
426
|
+
export const ProductsApiFactory = function (configuration, basePath, axios) {
|
|
427
|
+
const localVarFp = ProductsApiFp(configuration);
|
|
428
|
+
return {
|
|
429
|
+
/**
|
|
430
|
+
* Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
|
|
431
|
+
* @summary Create product
|
|
432
|
+
* @param {string} project What project it is
|
|
433
|
+
* @param {CreateProductRequest} [createProductRequest]
|
|
434
|
+
* @param {*} [options] Override http request option.
|
|
435
|
+
* @throws {RequiredError}
|
|
436
|
+
*/
|
|
437
|
+
createProduct(project, createProductRequest, options) {
|
|
438
|
+
return localVarFp.createProduct(project, createProductRequest, options).then((request) => request(axios, basePath));
|
|
439
|
+
},
|
|
440
|
+
/**
|
|
441
|
+
* Deletes a catalog product
|
|
442
|
+
* @summary Delete catalog product
|
|
443
|
+
* @param {string} project What project it is
|
|
444
|
+
* @param {string} productId Product\'s unique identifier
|
|
445
|
+
* @param {*} [options] Override http request option.
|
|
446
|
+
* @throws {RequiredError}
|
|
447
|
+
*/
|
|
448
|
+
deleteProduct(project, productId, options) {
|
|
449
|
+
return localVarFp.deleteProduct(project, productId, options).then((request) => request(axios, basePath));
|
|
450
|
+
},
|
|
451
|
+
/**
|
|
452
|
+
* Gets a product by a given ID.
|
|
453
|
+
* @summary Get product
|
|
454
|
+
* @param {string} project What project it is
|
|
455
|
+
* @param {string} productId Product\'s unique identifier
|
|
456
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
457
|
+
* @param {*} [options] Override http request option.
|
|
458
|
+
* @throws {RequiredError}
|
|
459
|
+
*/
|
|
460
|
+
getProduct(project, productId, fields, options) {
|
|
461
|
+
return localVarFp.getProduct(project, productId, fields, options).then((request) => request(axios, basePath));
|
|
462
|
+
},
|
|
463
|
+
/**
|
|
464
|
+
* Lists all enabled store listing products attached to the given project.
|
|
465
|
+
* @summary List products
|
|
466
|
+
* @param {string} project What project it is
|
|
467
|
+
* @param {number} [pageToken] Page reference token
|
|
468
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
469
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
470
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
471
|
+
* @param {*} [options] Override http request option.
|
|
472
|
+
* @throws {RequiredError}
|
|
473
|
+
*/
|
|
474
|
+
getProducts(project, pageToken, search, pageSize, fields, options) {
|
|
475
|
+
return localVarFp.getProducts(project, pageToken, search, pageSize, fields, options).then((request) => request(axios, basePath));
|
|
476
|
+
},
|
|
477
|
+
/**
|
|
478
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
479
|
+
* @summary Import products
|
|
480
|
+
* @param {string} project What project it is
|
|
481
|
+
* @param {string} [body] A data URL of a CSV file containing data for one or more products.
|
|
482
|
+
* @param {*} [options] Override http request option.
|
|
483
|
+
* @throws {RequiredError}
|
|
484
|
+
*/
|
|
485
|
+
importProducts(project, body, options) {
|
|
486
|
+
return localVarFp.importProducts(project, body, options).then((request) => request(axios, basePath));
|
|
487
|
+
},
|
|
488
|
+
/**
|
|
489
|
+
* Updates a product by a given ID.
|
|
490
|
+
* @summary Update product
|
|
491
|
+
* @param {string} project What project it is
|
|
492
|
+
* @param {string} productId Product\'s unique identifier
|
|
493
|
+
* @param {UpdateProductRequest} [updateProductRequest]
|
|
494
|
+
* @param {*} [options] Override http request option.
|
|
495
|
+
* @throws {RequiredError}
|
|
496
|
+
*/
|
|
497
|
+
updateProduct(project, productId, updateProductRequest, options) {
|
|
498
|
+
return localVarFp.updateProduct(project, productId, updateProductRequest, options).then((request) => request(axios, basePath));
|
|
499
|
+
},
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* ProductsApi - object-oriented interface
|
|
504
|
+
* @export
|
|
505
|
+
* @class ProductsApi
|
|
506
|
+
* @extends {BaseAPI}
|
|
507
|
+
*/
|
|
508
|
+
export class ProductsApi extends BaseAPI {
|
|
509
|
+
/**
|
|
510
|
+
* Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
|
|
511
|
+
* @summary Create product
|
|
512
|
+
* @param {string} project What project it is
|
|
513
|
+
* @param {CreateProductRequest} [createProductRequest]
|
|
514
|
+
* @param {*} [options] Override http request option.
|
|
515
|
+
* @throws {RequiredError}
|
|
516
|
+
* @memberof ProductsApi
|
|
517
|
+
*/
|
|
518
|
+
createProduct(project, createProductRequest, options) {
|
|
519
|
+
return ProductsApiFp(this.configuration).createProduct(project, createProductRequest, options).then((request) => request(this.axios, this.basePath));
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Deletes a catalog product
|
|
523
|
+
* @summary Delete catalog product
|
|
524
|
+
* @param {string} project What project it is
|
|
525
|
+
* @param {string} productId Product\'s unique identifier
|
|
526
|
+
* @param {*} [options] Override http request option.
|
|
527
|
+
* @throws {RequiredError}
|
|
528
|
+
* @memberof ProductsApi
|
|
529
|
+
*/
|
|
530
|
+
deleteProduct(project, productId, options) {
|
|
531
|
+
return ProductsApiFp(this.configuration).deleteProduct(project, productId, options).then((request) => request(this.axios, this.basePath));
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Gets a product by a given ID.
|
|
535
|
+
* @summary Get product
|
|
536
|
+
* @param {string} project What project it is
|
|
537
|
+
* @param {string} productId Product\'s unique identifier
|
|
538
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
539
|
+
* @param {*} [options] Override http request option.
|
|
540
|
+
* @throws {RequiredError}
|
|
541
|
+
* @memberof ProductsApi
|
|
542
|
+
*/
|
|
543
|
+
getProduct(project, productId, fields, options) {
|
|
544
|
+
return ProductsApiFp(this.configuration).getProduct(project, productId, fields, options).then((request) => request(this.axios, this.basePath));
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Lists all enabled store listing products attached to the given project.
|
|
548
|
+
* @summary List products
|
|
549
|
+
* @param {string} project What project it is
|
|
550
|
+
* @param {number} [pageToken] Page reference token
|
|
551
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
552
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
553
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
554
|
+
* @param {*} [options] Override http request option.
|
|
555
|
+
* @throws {RequiredError}
|
|
556
|
+
* @memberof ProductsApi
|
|
557
|
+
*/
|
|
558
|
+
getProducts(project, pageToken, search, pageSize, fields, options) {
|
|
559
|
+
return ProductsApiFp(this.configuration).getProducts(project, pageToken, search, pageSize, fields, options).then((request) => request(this.axios, this.basePath));
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
563
|
+
* @summary Import products
|
|
564
|
+
* @param {string} project What project it is
|
|
565
|
+
* @param {string} [body] A data URL of a CSV file containing data for one or more products.
|
|
566
|
+
* @param {*} [options] Override http request option.
|
|
567
|
+
* @throws {RequiredError}
|
|
568
|
+
* @memberof ProductsApi
|
|
569
|
+
*/
|
|
570
|
+
importProducts(project, body, options) {
|
|
571
|
+
return ProductsApiFp(this.configuration).importProducts(project, body, options).then((request) => request(this.axios, this.basePath));
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Updates a product by a given ID.
|
|
575
|
+
* @summary Update product
|
|
576
|
+
* @param {string} project What project it is
|
|
577
|
+
* @param {string} productId Product\'s unique identifier
|
|
578
|
+
* @param {UpdateProductRequest} [updateProductRequest]
|
|
579
|
+
* @param {*} [options] Override http request option.
|
|
580
|
+
* @throws {RequiredError}
|
|
581
|
+
* @memberof ProductsApi
|
|
582
|
+
*/
|
|
583
|
+
updateProduct(project, productId, updateProductRequest, options) {
|
|
584
|
+
return ProductsApiFp(this.configuration).updateProduct(project, productId, updateProductRequest, options).then((request) => request(this.axios, this.basePath));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* VariantsApi - axios parameter creator
|
|
589
|
+
* @export
|
|
590
|
+
*/
|
|
591
|
+
export const VariantsApiAxiosParamCreator = function (configuration) {
|
|
592
|
+
return {
|
|
593
|
+
/**
|
|
594
|
+
* Gets a variant by a given ID.
|
|
595
|
+
* @summary Get variant
|
|
596
|
+
* @param {string} project What project it is
|
|
597
|
+
* @param {string} variantId Variants unique identifier
|
|
598
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
599
|
+
* @param {*} [options] Override http request option.
|
|
600
|
+
* @throws {RequiredError}
|
|
601
|
+
*/
|
|
602
|
+
getVariant: (project_1, variantId_1, fields_1, ...args_1) => __awaiter(this, [project_1, variantId_1, fields_1, ...args_1], void 0, function* (project, variantId, fields, options = {}) {
|
|
603
|
+
// verify required parameter 'project' is not null or undefined
|
|
604
|
+
assertParamExists('getVariant', 'project', project);
|
|
605
|
+
// verify required parameter 'variantId' is not null or undefined
|
|
606
|
+
assertParamExists('getVariant', 'variantId', variantId);
|
|
607
|
+
const localVarPath = `/v1/catalog/variants/{variantId}`
|
|
608
|
+
.replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
|
|
609
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
610
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
611
|
+
let baseOptions;
|
|
612
|
+
if (configuration) {
|
|
613
|
+
baseOptions = configuration.baseOptions;
|
|
614
|
+
}
|
|
615
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
616
|
+
const localVarHeaderParameter = {};
|
|
617
|
+
const localVarQueryParameter = {};
|
|
618
|
+
// authentication session-oauth required
|
|
619
|
+
// oauth required
|
|
620
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
621
|
+
// authentication api-key required
|
|
622
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
623
|
+
if (project !== undefined) {
|
|
624
|
+
localVarQueryParameter['project'] = project;
|
|
625
|
+
}
|
|
626
|
+
if (fields !== undefined) {
|
|
627
|
+
localVarQueryParameter['fields'] = fields;
|
|
628
|
+
}
|
|
629
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
630
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
631
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
632
|
+
return {
|
|
633
|
+
url: toPathString(localVarUrlObj),
|
|
634
|
+
options: localVarRequestOptions,
|
|
635
|
+
};
|
|
636
|
+
}),
|
|
637
|
+
/**
|
|
638
|
+
* Lists all variants that belong to enabled products attached to the given project.
|
|
639
|
+
* @summary List variants
|
|
640
|
+
* @param {string} project What project it is
|
|
641
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
642
|
+
* @param {number} [pageToken] Page reference token
|
|
643
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
644
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
645
|
+
* @param {*} [options] Override http request option.
|
|
646
|
+
* @throws {RequiredError}
|
|
647
|
+
*/
|
|
648
|
+
listVariants: (project_2, search_1, pageToken_1, pageSize_1, fields_2, ...args_2) => __awaiter(this, [project_2, search_1, pageToken_1, pageSize_1, fields_2, ...args_2], void 0, function* (project, search, pageToken, pageSize, fields, options = {}) {
|
|
649
|
+
// verify required parameter 'project' is not null or undefined
|
|
650
|
+
assertParamExists('listVariants', 'project', project);
|
|
651
|
+
const localVarPath = `/v1/catalog/variants`;
|
|
652
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
653
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
654
|
+
let baseOptions;
|
|
655
|
+
if (configuration) {
|
|
656
|
+
baseOptions = configuration.baseOptions;
|
|
657
|
+
}
|
|
658
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
659
|
+
const localVarHeaderParameter = {};
|
|
660
|
+
const localVarQueryParameter = {};
|
|
661
|
+
// authentication session-oauth required
|
|
662
|
+
// oauth required
|
|
663
|
+
yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
664
|
+
// authentication api-key required
|
|
665
|
+
yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
|
|
666
|
+
if (project !== undefined) {
|
|
667
|
+
localVarQueryParameter['project'] = project;
|
|
668
|
+
}
|
|
669
|
+
if (search !== undefined) {
|
|
670
|
+
localVarQueryParameter['search'] = search;
|
|
671
|
+
}
|
|
672
|
+
if (pageToken !== undefined) {
|
|
673
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
674
|
+
}
|
|
675
|
+
if (pageSize !== undefined) {
|
|
676
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
677
|
+
}
|
|
678
|
+
if (fields !== undefined) {
|
|
679
|
+
localVarQueryParameter['fields'] = fields;
|
|
680
|
+
}
|
|
681
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
682
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
683
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
684
|
+
return {
|
|
685
|
+
url: toPathString(localVarUrlObj),
|
|
686
|
+
options: localVarRequestOptions,
|
|
687
|
+
};
|
|
688
|
+
}),
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* VariantsApi - functional programming interface
|
|
693
|
+
* @export
|
|
694
|
+
*/
|
|
695
|
+
export const VariantsApiFp = function (configuration) {
|
|
696
|
+
const localVarAxiosParamCreator = VariantsApiAxiosParamCreator(configuration);
|
|
697
|
+
return {
|
|
698
|
+
/**
|
|
699
|
+
* Gets a variant by a given ID.
|
|
700
|
+
* @summary Get variant
|
|
701
|
+
* @param {string} project What project it is
|
|
702
|
+
* @param {string} variantId Variants unique identifier
|
|
703
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
704
|
+
* @param {*} [options] Override http request option.
|
|
705
|
+
* @throws {RequiredError}
|
|
706
|
+
*/
|
|
707
|
+
getVariant(project, variantId, fields, options) {
|
|
708
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
709
|
+
var _a, _b, _c;
|
|
710
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getVariant(project, variantId, fields, options);
|
|
711
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
712
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['VariantsApi.getVariant']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
713
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
714
|
+
});
|
|
715
|
+
},
|
|
716
|
+
/**
|
|
717
|
+
* Lists all variants that belong to enabled products attached to the given project.
|
|
718
|
+
* @summary List variants
|
|
719
|
+
* @param {string} project What project it is
|
|
720
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
721
|
+
* @param {number} [pageToken] Page reference token
|
|
722
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
723
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
724
|
+
* @param {*} [options] Override http request option.
|
|
725
|
+
* @throws {RequiredError}
|
|
726
|
+
*/
|
|
727
|
+
listVariants(project, search, pageToken, pageSize, fields, options) {
|
|
728
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
729
|
+
var _a, _b, _c;
|
|
730
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listVariants(project, search, pageToken, pageSize, fields, options);
|
|
731
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
732
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['VariantsApi.listVariants']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
733
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
734
|
+
});
|
|
735
|
+
},
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* VariantsApi - factory interface
|
|
740
|
+
* @export
|
|
741
|
+
*/
|
|
742
|
+
export const VariantsApiFactory = function (configuration, basePath, axios) {
|
|
743
|
+
const localVarFp = VariantsApiFp(configuration);
|
|
744
|
+
return {
|
|
745
|
+
/**
|
|
746
|
+
* Gets a variant by a given ID.
|
|
747
|
+
* @summary Get variant
|
|
748
|
+
* @param {string} project What project it is
|
|
749
|
+
* @param {string} variantId Variants unique identifier
|
|
750
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
751
|
+
* @param {*} [options] Override http request option.
|
|
752
|
+
* @throws {RequiredError}
|
|
753
|
+
*/
|
|
754
|
+
getVariant(project, variantId, fields, options) {
|
|
755
|
+
return localVarFp.getVariant(project, variantId, fields, options).then((request) => request(axios, basePath));
|
|
756
|
+
},
|
|
757
|
+
/**
|
|
758
|
+
* Lists all variants that belong to enabled products attached to the given project.
|
|
759
|
+
* @summary List variants
|
|
760
|
+
* @param {string} project What project it is
|
|
761
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
762
|
+
* @param {number} [pageToken] Page reference token
|
|
763
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
764
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
765
|
+
* @param {*} [options] Override http request option.
|
|
766
|
+
* @throws {RequiredError}
|
|
767
|
+
*/
|
|
768
|
+
listVariants(project, search, pageToken, pageSize, fields, options) {
|
|
769
|
+
return localVarFp.listVariants(project, search, pageToken, pageSize, fields, options).then((request) => request(axios, basePath));
|
|
770
|
+
},
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
/**
|
|
774
|
+
* VariantsApi - object-oriented interface
|
|
775
|
+
* @export
|
|
776
|
+
* @class VariantsApi
|
|
777
|
+
* @extends {BaseAPI}
|
|
778
|
+
*/
|
|
779
|
+
export class VariantsApi extends BaseAPI {
|
|
780
|
+
/**
|
|
781
|
+
* Gets a variant by a given ID.
|
|
782
|
+
* @summary Get variant
|
|
783
|
+
* @param {string} project What project it is
|
|
784
|
+
* @param {string} variantId Variants unique identifier
|
|
785
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
786
|
+
* @param {*} [options] Override http request option.
|
|
787
|
+
* @throws {RequiredError}
|
|
788
|
+
* @memberof VariantsApi
|
|
789
|
+
*/
|
|
790
|
+
getVariant(project, variantId, fields, options) {
|
|
791
|
+
return VariantsApiFp(this.configuration).getVariant(project, variantId, fields, options).then((request) => request(this.axios, this.basePath));
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Lists all variants that belong to enabled products attached to the given project.
|
|
795
|
+
* @summary List variants
|
|
796
|
+
* @param {string} project What project it is
|
|
797
|
+
* @param {string} [search] Search term to filter based on product tags.
|
|
798
|
+
* @param {number} [pageToken] Page reference token
|
|
799
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
800
|
+
* @param {string} [fields] Filter response fields to only include a subset of the resource.
|
|
801
|
+
* @param {*} [options] Override http request option.
|
|
802
|
+
* @throws {RequiredError}
|
|
803
|
+
* @memberof VariantsApi
|
|
804
|
+
*/
|
|
805
|
+
listVariants(project, search, pageToken, pageSize, fields, options) {
|
|
806
|
+
return VariantsApiFp(this.configuration).listVariants(project, search, pageToken, pageSize, fields, options).then((request) => request(this.axios, this.basePath));
|
|
807
|
+
}
|
|
808
|
+
}
|