@teemill/product-catalog 1.10.0 → 1.11.1
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 +1 -0
- package/.openapi-generator/VERSION +1 -1
- package/README.md +2 -2
- package/dist/apis/ProductsApi.d.ts +1 -1
- package/dist/apis/ProductsApi.js +216 -410
- package/dist/apis/VariantsApi.d.ts +1 -1
- package/dist/apis/VariantsApi.js +83 -187
- package/dist/esm/apis/ProductsApi.d.ts +107 -0
- package/dist/esm/apis/ProductsApi.js +300 -0
- package/dist/esm/apis/VariantsApi.d.ts +50 -0
- package/dist/esm/apis/VariantsApi.js +127 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +4 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/ApiError.d.ts +37 -0
- package/dist/esm/models/ApiError.js +42 -0
- package/dist/esm/models/Attribute.d.ts +50 -0
- package/dist/esm/models/Attribute.js +49 -0
- package/dist/esm/models/AttributeThumbnail.d.ts +46 -0
- package/dist/esm/models/AttributeThumbnail.js +48 -0
- package/dist/esm/models/CreateProductRequest.d.ts +88 -0
- package/dist/esm/models/CreateProductRequest.js +63 -0
- package/dist/esm/models/CreateProductRequestAdditionalFilesInner.d.ts +31 -0
- package/dist/esm/models/CreateProductRequestAdditionalFilesInner.js +43 -0
- package/dist/esm/models/CreateProductRequestImagesInner.d.ts +31 -0
- package/dist/esm/models/CreateProductRequestImagesInner.js +38 -0
- package/dist/esm/models/CreateProductRequestSeoMetadata.d.ts +31 -0
- package/dist/esm/models/CreateProductRequestSeoMetadata.js +38 -0
- package/dist/esm/models/CreateProductRequestVariantsInner.d.ts +59 -0
- package/dist/esm/models/CreateProductRequestVariantsInner.js +57 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +63 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.js +67 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +37 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.js +46 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.d.ts +31 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.js +43 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +37 -0
- package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.js +46 -0
- package/dist/esm/models/CreateProductVariant.d.ts +59 -0
- package/dist/esm/models/CreateProductVariant.js +54 -0
- package/dist/esm/models/CreateProductVariantApplicationsInner.d.ts +54 -0
- package/dist/esm/models/CreateProductVariantApplicationsInner.js +58 -0
- package/dist/esm/models/CreateProductVariantAttributesInner.d.ts +37 -0
- package/dist/esm/models/CreateProductVariantAttributesInner.js +44 -0
- package/dist/esm/models/CreateProductVariantRetailPrice.d.ts +37 -0
- package/dist/esm/models/CreateProductVariantRetailPrice.js +44 -0
- package/dist/esm/models/Image.d.ts +67 -0
- package/dist/esm/models/Image.js +50 -0
- package/dist/esm/models/ImportProducts200Response.d.ts +31 -0
- package/dist/esm/models/ImportProducts200Response.js +38 -0
- package/dist/esm/models/ModelFile.d.ts +31 -0
- package/dist/esm/models/ModelFile.js +38 -0
- package/dist/esm/models/Price.d.ts +37 -0
- package/dist/esm/models/Price.js +40 -0
- package/dist/esm/models/Product.d.ts +113 -0
- package/dist/esm/models/Product.js +71 -0
- package/dist/esm/models/ProductAdditionalFilesInner.d.ts +37 -0
- package/dist/esm/models/ProductAdditionalFilesInner.js +40 -0
- package/dist/esm/models/ProductsResponse.d.ts +38 -0
- package/dist/esm/models/ProductsResponse.js +41 -0
- package/dist/esm/models/SeoMetadata.d.ts +31 -0
- package/dist/esm/models/SeoMetadata.js +38 -0
- package/dist/esm/models/Stock.d.ts +31 -0
- package/dist/esm/models/Stock.js +38 -0
- package/dist/esm/models/UpdateProductRequest.d.ts +87 -0
- package/dist/esm/models/UpdateProductRequest.js +58 -0
- package/dist/esm/models/Variant.d.ts +114 -0
- package/dist/esm/models/Variant.js +71 -0
- package/dist/esm/models/VariantProduct.d.ts +37 -0
- package/dist/esm/models/VariantProduct.js +40 -0
- package/dist/esm/models/VariantsResponse.d.ts +38 -0
- package/dist/esm/models/VariantsResponse.js +41 -0
- package/dist/esm/models/index.d.ts +23 -0
- package/dist/esm/models/index.js +25 -0
- package/dist/esm/runtime.d.ts +187 -0
- package/dist/esm/runtime.js +333 -0
- package/dist/models/ApiError.d.ts +1 -1
- package/dist/models/ApiError.js +1 -1
- package/dist/models/Attribute.d.ts +1 -1
- package/dist/models/Attribute.js +2 -2
- package/dist/models/AttributeThumbnail.d.ts +1 -1
- package/dist/models/AttributeThumbnail.js +1 -1
- package/dist/models/CreateProductRequest.d.ts +1 -1
- package/dist/models/CreateProductRequest.js +4 -4
- package/dist/models/CreateProductRequestAdditionalFilesInner.js +2 -2
- package/dist/models/CreateProductRequestImagesInner.d.ts +1 -1
- package/dist/models/CreateProductRequestImagesInner.js +1 -1
- package/dist/models/CreateProductRequestSeoMetadata.d.ts +1 -1
- package/dist/models/CreateProductRequestSeoMetadata.js +1 -1
- package/dist/models/CreateProductRequestVariantsInner.js +6 -6
- package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +2 -2
- package/dist/models/CreateProductRequestVariantsInnerRetailPrice.js +1 -1
- package/dist/models/CreateProductVariant.d.ts +1 -1
- package/dist/models/CreateProductVariant.js +5 -5
- package/dist/models/CreateProductVariantApplicationsInner.d.ts +2 -11
- package/dist/models/CreateProductVariantApplicationsInner.js +2 -10
- package/dist/models/CreateProductVariantAttributesInner.d.ts +1 -1
- package/dist/models/CreateProductVariantAttributesInner.js +1 -1
- package/dist/models/CreateProductVariantRetailPrice.d.ts +1 -1
- package/dist/models/CreateProductVariantRetailPrice.js +1 -1
- package/dist/models/Image.d.ts +1 -1
- package/dist/models/Image.js +1 -1
- package/dist/models/ImportProducts200Response.d.ts +1 -1
- package/dist/models/ImportProducts200Response.js +1 -1
- package/dist/models/ModelFile.d.ts +1 -1
- package/dist/models/ModelFile.js +1 -1
- package/dist/models/Price.d.ts +1 -1
- package/dist/models/Price.js +1 -1
- package/dist/models/Product.d.ts +2 -2
- package/dist/models/Product.js +5 -5
- package/dist/models/ProductAdditionalFilesInner.d.ts +1 -1
- package/dist/models/ProductAdditionalFilesInner.js +1 -1
- package/dist/models/ProductsResponse.d.ts +1 -1
- package/dist/models/ProductsResponse.js +2 -2
- package/dist/models/SeoMetadata.d.ts +1 -1
- package/dist/models/SeoMetadata.js +1 -1
- package/dist/models/Stock.d.ts +1 -1
- package/dist/models/Stock.js +1 -1
- package/dist/models/UpdateProductRequest.d.ts +1 -1
- package/dist/models/UpdateProductRequest.js +3 -3
- package/dist/models/Variant.d.ts +2 -2
- package/dist/models/Variant.js +6 -6
- package/dist/models/VariantProduct.d.ts +1 -1
- package/dist/models/VariantProduct.js +1 -1
- package/dist/models/VariantsResponse.d.ts +1 -1
- package/dist/models/VariantsResponse.js +2 -2
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +223 -439
- package/package.json +4 -2
- package/src/apis/ProductsApi.ts +1 -1
- package/src/apis/VariantsApi.ts +1 -1
- package/src/models/ApiError.ts +1 -1
- package/src/models/Attribute.ts +1 -1
- package/src/models/AttributeThumbnail.ts +1 -1
- package/src/models/CreateProductRequest.ts +1 -1
- package/src/models/CreateProductRequestImagesInner.ts +1 -1
- package/src/models/CreateProductRequestSeoMetadata.ts +1 -1
- package/src/models/CreateProductVariant.ts +1 -1
- package/src/models/CreateProductVariantApplicationsInner.ts +2 -12
- package/src/models/CreateProductVariantAttributesInner.ts +1 -1
- package/src/models/CreateProductVariantRetailPrice.ts +1 -1
- package/src/models/Image.ts +1 -1
- package/src/models/ImportProducts200Response.ts +1 -1
- package/src/models/ModelFile.ts +1 -1
- package/src/models/Price.ts +1 -1
- package/src/models/Product.ts +2 -2
- package/src/models/ProductAdditionalFilesInner.ts +1 -1
- package/src/models/ProductsResponse.ts +1 -1
- package/src/models/SeoMetadata.ts +1 -1
- package/src/models/Stock.ts +1 -1
- package/src/models/UpdateProductRequest.ts +1 -1
- package/src/models/Variant.ts +2 -2
- package/src/models/VariantProduct.ts +1 -1
- package/src/models/VariantsResponse.ts +1 -1
- package/src/runtime.ts +1 -1
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +2 -2
package/dist/apis/ProductsApi.js
CHANGED
|
@@ -5,39 +5,13 @@
|
|
|
5
5
|
* Product Catalog API
|
|
6
6
|
* 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.
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 1.
|
|
8
|
+
* The version of the OpenAPI document: 1.11.1
|
|
9
9
|
* Contact: hello@teemill.com
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
12
|
* https://openapi-generator.tech
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
|
-
var __extends = (this && this.__extends) || (function () {
|
|
16
|
-
var extendStatics = function (d, b) {
|
|
17
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
-
return extendStatics(d, b);
|
|
21
|
-
};
|
|
22
|
-
return function (d, b) {
|
|
23
|
-
if (typeof b !== "function" && b !== null)
|
|
24
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __assign = (this && this.__assign) || function () {
|
|
31
|
-
__assign = Object.assign || function(t) {
|
|
32
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
-
s = arguments[i];
|
|
34
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35
|
-
t[p] = s[p];
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
};
|
|
39
|
-
return __assign.apply(this, arguments);
|
|
40
|
-
};
|
|
41
15
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
16
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
17
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -47,452 +21,284 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
47
21
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
22
|
});
|
|
49
23
|
};
|
|
50
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
-
function step(op) {
|
|
55
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
-
switch (op[0]) {
|
|
60
|
-
case 0: case 1: t = op; break;
|
|
61
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
-
default:
|
|
65
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
-
if (t[2]) _.ops.pop();
|
|
70
|
-
_.trys.pop(); continue;
|
|
71
|
-
}
|
|
72
|
-
op = body.call(thisArg, _);
|
|
73
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
25
|
exports.ProductsApi = void 0;
|
|
79
|
-
|
|
80
|
-
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
81
28
|
/**
|
|
82
29
|
*
|
|
83
30
|
*/
|
|
84
|
-
|
|
85
|
-
__extends(ProductsApi, _super);
|
|
86
|
-
function ProductsApi() {
|
|
87
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
88
|
-
}
|
|
31
|
+
class ProductsApi extends runtime.BaseAPI {
|
|
89
32
|
/**
|
|
90
33
|
* 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.
|
|
91
34
|
* Create product
|
|
92
35
|
*/
|
|
93
|
-
|
|
94
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
120
|
-
}
|
|
121
|
-
return [4 /*yield*/, this.request({
|
|
122
|
-
path: "/v1/catalog/products",
|
|
123
|
-
method: 'POST',
|
|
124
|
-
headers: headerParameters,
|
|
125
|
-
query: queryParameters,
|
|
126
|
-
body: (0, index_1.CreateProductRequestToJSON)(requestParameters.createProductRequest),
|
|
127
|
-
}, initOverrides)];
|
|
128
|
-
case 3:
|
|
129
|
-
response = _c.sent();
|
|
130
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductFromJSON)(jsonValue); })];
|
|
131
|
-
}
|
|
132
|
-
});
|
|
36
|
+
createProductRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
39
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling createProduct.');
|
|
40
|
+
}
|
|
41
|
+
const queryParameters = {};
|
|
42
|
+
if (requestParameters.project !== undefined) {
|
|
43
|
+
queryParameters['project'] = requestParameters.project;
|
|
44
|
+
}
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
47
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
48
|
+
// oauth required
|
|
49
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
50
|
+
}
|
|
51
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
52
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
53
|
+
}
|
|
54
|
+
const response = yield this.request({
|
|
55
|
+
path: `/v1/catalog/products`,
|
|
56
|
+
method: 'POST',
|
|
57
|
+
headers: headerParameters,
|
|
58
|
+
query: queryParameters,
|
|
59
|
+
body: (0, index_1.CreateProductRequestToJSON)(requestParameters.createProductRequest),
|
|
60
|
+
}, initOverrides);
|
|
61
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductFromJSON)(jsonValue));
|
|
133
62
|
});
|
|
134
|
-
}
|
|
63
|
+
}
|
|
135
64
|
/**
|
|
136
65
|
* 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.
|
|
137
66
|
* Create product
|
|
138
67
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
switch (_a.label) {
|
|
145
|
-
case 0: return [4 /*yield*/, this.createProductRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
146
|
-
case 1:
|
|
147
|
-
response = _a.sent();
|
|
148
|
-
return [4 /*yield*/, response.value()];
|
|
149
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
150
|
-
}
|
|
151
|
-
});
|
|
68
|
+
createProduct(project, optionalParameters = {}, initOverrides) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const response = yield this.createProductRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
|
|
71
|
+
return yield response.value();
|
|
152
72
|
});
|
|
153
|
-
}
|
|
73
|
+
}
|
|
154
74
|
/**
|
|
155
75
|
* Deletes a catalog product
|
|
156
76
|
* Delete catalog product
|
|
157
77
|
*/
|
|
158
|
-
|
|
159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
186
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
187
|
-
}
|
|
188
|
-
return [4 /*yield*/, this.request({
|
|
189
|
-
path: "/v1/catalog/products/{productId}".replace("{".concat("productId", "}"), encodeURIComponent(String(requestParameters.productId))),
|
|
190
|
-
method: 'DELETE',
|
|
191
|
-
headers: headerParameters,
|
|
192
|
-
query: queryParameters,
|
|
193
|
-
}, initOverrides)];
|
|
194
|
-
case 3:
|
|
195
|
-
response = _c.sent();
|
|
196
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
197
|
-
}
|
|
198
|
-
});
|
|
78
|
+
deleteProductRaw(requestParameters, initOverrides) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
81
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling deleteProduct.');
|
|
82
|
+
}
|
|
83
|
+
if (requestParameters.productId === null || requestParameters.productId === undefined) {
|
|
84
|
+
throw new runtime.RequiredError('productId', 'Required parameter requestParameters.productId was null or undefined when calling deleteProduct.');
|
|
85
|
+
}
|
|
86
|
+
const queryParameters = {};
|
|
87
|
+
if (requestParameters.project !== undefined) {
|
|
88
|
+
queryParameters['project'] = requestParameters.project;
|
|
89
|
+
}
|
|
90
|
+
const headerParameters = {};
|
|
91
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
92
|
+
// oauth required
|
|
93
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
94
|
+
}
|
|
95
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
96
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
97
|
+
}
|
|
98
|
+
const response = yield this.request({
|
|
99
|
+
path: `/v1/catalog/products/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))),
|
|
100
|
+
method: 'DELETE',
|
|
101
|
+
headers: headerParameters,
|
|
102
|
+
query: queryParameters,
|
|
103
|
+
}, initOverrides);
|
|
104
|
+
return new runtime.VoidApiResponse(response);
|
|
199
105
|
});
|
|
200
|
-
}
|
|
106
|
+
}
|
|
201
107
|
/**
|
|
202
108
|
* Deletes a catalog product
|
|
203
109
|
* Delete catalog product
|
|
204
110
|
*/
|
|
205
|
-
|
|
206
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
project: project, productId: productId,
|
|
211
|
-
}, initOverrides)];
|
|
212
|
-
case 1:
|
|
213
|
-
_a.sent();
|
|
214
|
-
return [2 /*return*/];
|
|
215
|
-
}
|
|
216
|
-
});
|
|
111
|
+
deleteProduct(project, productId, initOverrides) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
yield this.deleteProductRaw({
|
|
114
|
+
project: project, productId: productId,
|
|
115
|
+
}, initOverrides);
|
|
217
116
|
});
|
|
218
|
-
}
|
|
117
|
+
}
|
|
219
118
|
/**
|
|
220
119
|
* Gets a product by a given ID.
|
|
221
120
|
* Get product
|
|
222
121
|
*/
|
|
223
|
-
|
|
224
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
254
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
255
|
-
}
|
|
256
|
-
return [4 /*yield*/, this.request({
|
|
257
|
-
path: "/v1/catalog/products/{productId}".replace("{".concat("productId", "}"), encodeURIComponent(String(requestParameters.productId))),
|
|
258
|
-
method: 'GET',
|
|
259
|
-
headers: headerParameters,
|
|
260
|
-
query: queryParameters,
|
|
261
|
-
}, initOverrides)];
|
|
262
|
-
case 3:
|
|
263
|
-
response = _c.sent();
|
|
264
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductFromJSON)(jsonValue); })];
|
|
265
|
-
}
|
|
266
|
-
});
|
|
122
|
+
getProductRaw(requestParameters, initOverrides) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
125
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getProduct.');
|
|
126
|
+
}
|
|
127
|
+
if (requestParameters.productId === null || requestParameters.productId === undefined) {
|
|
128
|
+
throw new runtime.RequiredError('productId', 'Required parameter requestParameters.productId was null or undefined when calling getProduct.');
|
|
129
|
+
}
|
|
130
|
+
const queryParameters = {};
|
|
131
|
+
if (requestParameters.project !== undefined) {
|
|
132
|
+
queryParameters['project'] = requestParameters.project;
|
|
133
|
+
}
|
|
134
|
+
if (requestParameters.fields !== undefined) {
|
|
135
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
136
|
+
}
|
|
137
|
+
const headerParameters = {};
|
|
138
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
139
|
+
// oauth required
|
|
140
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
141
|
+
}
|
|
142
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
143
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
144
|
+
}
|
|
145
|
+
const response = yield this.request({
|
|
146
|
+
path: `/v1/catalog/products/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))),
|
|
147
|
+
method: 'GET',
|
|
148
|
+
headers: headerParameters,
|
|
149
|
+
query: queryParameters,
|
|
150
|
+
}, initOverrides);
|
|
151
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductFromJSON)(jsonValue));
|
|
267
152
|
});
|
|
268
|
-
}
|
|
153
|
+
}
|
|
269
154
|
/**
|
|
270
155
|
* Gets a product by a given ID.
|
|
271
156
|
* Get product
|
|
272
157
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
return __generator(this, function (_a) {
|
|
278
|
-
switch (_a.label) {
|
|
279
|
-
case 0: return [4 /*yield*/, this.getProductRaw(__assign({ project: project, productId: productId }, optionalParameters), initOverrides)];
|
|
280
|
-
case 1:
|
|
281
|
-
response = _a.sent();
|
|
282
|
-
return [4 /*yield*/, response.value()];
|
|
283
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
158
|
+
getProduct(project, productId, optionalParameters = {}, initOverrides) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
const response = yield this.getProductRaw(Object.assign({ project: project, productId: productId }, optionalParameters), initOverrides);
|
|
161
|
+
return yield response.value();
|
|
286
162
|
});
|
|
287
|
-
}
|
|
163
|
+
}
|
|
288
164
|
/**
|
|
289
165
|
* Lists all enabled store listing products attached to the given project.
|
|
290
166
|
* List products
|
|
291
167
|
*/
|
|
292
|
-
|
|
293
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
329
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
330
|
-
}
|
|
331
|
-
return [4 /*yield*/, this.request({
|
|
332
|
-
path: "/v1/catalog/products",
|
|
333
|
-
method: 'GET',
|
|
334
|
-
headers: headerParameters,
|
|
335
|
-
query: queryParameters,
|
|
336
|
-
}, initOverrides)];
|
|
337
|
-
case 3:
|
|
338
|
-
response = _c.sent();
|
|
339
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductsResponseFromJSON)(jsonValue); })];
|
|
340
|
-
}
|
|
341
|
-
});
|
|
168
|
+
getProductsRaw(requestParameters, initOverrides) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
171
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getProducts.');
|
|
172
|
+
}
|
|
173
|
+
const queryParameters = {};
|
|
174
|
+
if (requestParameters.project !== undefined) {
|
|
175
|
+
queryParameters['project'] = requestParameters.project;
|
|
176
|
+
}
|
|
177
|
+
if (requestParameters.pageToken !== undefined) {
|
|
178
|
+
queryParameters['pageToken'] = requestParameters.pageToken;
|
|
179
|
+
}
|
|
180
|
+
if (requestParameters.search !== undefined) {
|
|
181
|
+
queryParameters['search'] = requestParameters.search;
|
|
182
|
+
}
|
|
183
|
+
if (requestParameters.pageSize !== undefined) {
|
|
184
|
+
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
185
|
+
}
|
|
186
|
+
if (requestParameters.fields !== undefined) {
|
|
187
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
188
|
+
}
|
|
189
|
+
const headerParameters = {};
|
|
190
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
191
|
+
// oauth required
|
|
192
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
193
|
+
}
|
|
194
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
195
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
196
|
+
}
|
|
197
|
+
const response = yield this.request({
|
|
198
|
+
path: `/v1/catalog/products`,
|
|
199
|
+
method: 'GET',
|
|
200
|
+
headers: headerParameters,
|
|
201
|
+
query: queryParameters,
|
|
202
|
+
}, initOverrides);
|
|
203
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductsResponseFromJSON)(jsonValue));
|
|
342
204
|
});
|
|
343
|
-
}
|
|
205
|
+
}
|
|
344
206
|
/**
|
|
345
207
|
* Lists all enabled store listing products attached to the given project.
|
|
346
208
|
* List products
|
|
347
209
|
*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return __generator(this, function (_a) {
|
|
353
|
-
switch (_a.label) {
|
|
354
|
-
case 0: return [4 /*yield*/, this.getProductsRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
355
|
-
case 1:
|
|
356
|
-
response = _a.sent();
|
|
357
|
-
return [4 /*yield*/, response.value()];
|
|
358
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
359
|
-
}
|
|
360
|
-
});
|
|
210
|
+
getProducts(project, optionalParameters = {}, initOverrides) {
|
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
const response = yield this.getProductsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
|
|
213
|
+
return yield response.value();
|
|
361
214
|
});
|
|
362
|
-
}
|
|
215
|
+
}
|
|
363
216
|
/**
|
|
364
217
|
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
365
218
|
* Import products
|
|
366
219
|
*/
|
|
367
|
-
|
|
368
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
394
|
-
}
|
|
395
|
-
return [4 /*yield*/, this.request({
|
|
396
|
-
path: "/v1/catalog/products/import",
|
|
397
|
-
method: 'POST',
|
|
398
|
-
headers: headerParameters,
|
|
399
|
-
query: queryParameters,
|
|
400
|
-
body: requestParameters.body,
|
|
401
|
-
}, initOverrides)];
|
|
402
|
-
case 3:
|
|
403
|
-
response = _c.sent();
|
|
404
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ImportProducts200ResponseFromJSON)(jsonValue); })];
|
|
405
|
-
}
|
|
406
|
-
});
|
|
220
|
+
importProductsRaw(requestParameters, initOverrides) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
223
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling importProducts.');
|
|
224
|
+
}
|
|
225
|
+
const queryParameters = {};
|
|
226
|
+
if (requestParameters.project !== undefined) {
|
|
227
|
+
queryParameters['project'] = requestParameters.project;
|
|
228
|
+
}
|
|
229
|
+
const headerParameters = {};
|
|
230
|
+
headerParameters['Content-Type'] = 'text/csv';
|
|
231
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
232
|
+
// oauth required
|
|
233
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
234
|
+
}
|
|
235
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
236
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
237
|
+
}
|
|
238
|
+
const response = yield this.request({
|
|
239
|
+
path: `/v1/catalog/products/import`,
|
|
240
|
+
method: 'POST',
|
|
241
|
+
headers: headerParameters,
|
|
242
|
+
query: queryParameters,
|
|
243
|
+
body: requestParameters.body,
|
|
244
|
+
}, initOverrides);
|
|
245
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ImportProducts200ResponseFromJSON)(jsonValue));
|
|
407
246
|
});
|
|
408
|
-
}
|
|
247
|
+
}
|
|
409
248
|
/**
|
|
410
249
|
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
411
250
|
* Import products
|
|
412
251
|
*/
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
return __generator(this, function (_a) {
|
|
418
|
-
switch (_a.label) {
|
|
419
|
-
case 0: return [4 /*yield*/, this.importProductsRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
420
|
-
case 1:
|
|
421
|
-
response = _a.sent();
|
|
422
|
-
return [4 /*yield*/, response.value()];
|
|
423
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
424
|
-
}
|
|
425
|
-
});
|
|
252
|
+
importProducts(project, optionalParameters = {}, initOverrides) {
|
|
253
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
+
const response = yield this.importProductsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
|
|
255
|
+
return yield response.value();
|
|
426
256
|
});
|
|
427
|
-
}
|
|
257
|
+
}
|
|
428
258
|
/**
|
|
429
259
|
* Updates a product by a given ID.
|
|
430
260
|
* Update product
|
|
431
261
|
*/
|
|
432
|
-
|
|
433
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
462
|
-
}
|
|
463
|
-
return [4 /*yield*/, this.request({
|
|
464
|
-
path: "/v1/catalog/products/{productId}".replace("{".concat("productId", "}"), encodeURIComponent(String(requestParameters.productId))),
|
|
465
|
-
method: 'PATCH',
|
|
466
|
-
headers: headerParameters,
|
|
467
|
-
query: queryParameters,
|
|
468
|
-
body: (0, index_1.UpdateProductRequestToJSON)(requestParameters.updateProductRequest),
|
|
469
|
-
}, initOverrides)];
|
|
470
|
-
case 3:
|
|
471
|
-
response = _c.sent();
|
|
472
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductFromJSON)(jsonValue); })];
|
|
473
|
-
}
|
|
474
|
-
});
|
|
262
|
+
updateProductRaw(requestParameters, initOverrides) {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
265
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling updateProduct.');
|
|
266
|
+
}
|
|
267
|
+
if (requestParameters.productId === null || requestParameters.productId === undefined) {
|
|
268
|
+
throw new runtime.RequiredError('productId', 'Required parameter requestParameters.productId was null or undefined when calling updateProduct.');
|
|
269
|
+
}
|
|
270
|
+
const queryParameters = {};
|
|
271
|
+
if (requestParameters.project !== undefined) {
|
|
272
|
+
queryParameters['project'] = requestParameters.project;
|
|
273
|
+
}
|
|
274
|
+
const headerParameters = {};
|
|
275
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
276
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
277
|
+
// oauth required
|
|
278
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
279
|
+
}
|
|
280
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
281
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
282
|
+
}
|
|
283
|
+
const response = yield this.request({
|
|
284
|
+
path: `/v1/catalog/products/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))),
|
|
285
|
+
method: 'PATCH',
|
|
286
|
+
headers: headerParameters,
|
|
287
|
+
query: queryParameters,
|
|
288
|
+
body: (0, index_1.UpdateProductRequestToJSON)(requestParameters.updateProductRequest),
|
|
289
|
+
}, initOverrides);
|
|
290
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProductFromJSON)(jsonValue));
|
|
475
291
|
});
|
|
476
|
-
}
|
|
292
|
+
}
|
|
477
293
|
/**
|
|
478
294
|
* Updates a product by a given ID.
|
|
479
295
|
* Update product
|
|
480
296
|
*/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return __generator(this, function (_a) {
|
|
486
|
-
switch (_a.label) {
|
|
487
|
-
case 0: return [4 /*yield*/, this.updateProductRaw(__assign({ project: project, productId: productId }, optionalParameters), initOverrides)];
|
|
488
|
-
case 1:
|
|
489
|
-
response = _a.sent();
|
|
490
|
-
return [4 /*yield*/, response.value()];
|
|
491
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
492
|
-
}
|
|
493
|
-
});
|
|
297
|
+
updateProduct(project, productId, optionalParameters = {}, initOverrides) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
const response = yield this.updateProductRaw(Object.assign({ project: project, productId: productId }, optionalParameters), initOverrides);
|
|
300
|
+
return yield response.value();
|
|
494
301
|
});
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
}(runtime.BaseAPI));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
498
304
|
exports.ProductsApi = ProductsApi;
|