@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Product Catalog API
|
|
3
3
|
* 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.
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.11.1
|
|
6
6
|
* Contact: hello@teemill.com
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/apis/VariantsApi.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,189 +21,111 @@ 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.VariantsApi = 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(VariantsApi, _super);
|
|
86
|
-
function VariantsApi() {
|
|
87
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
88
|
-
}
|
|
31
|
+
class VariantsApi extends runtime.BaseAPI {
|
|
89
32
|
/**
|
|
90
33
|
* Gets a variant by a given ID.
|
|
91
34
|
* Get variant
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
124
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
125
|
-
}
|
|
126
|
-
return [4 /*yield*/, this.request({
|
|
127
|
-
path: "/v1/catalog/variants/{variantId}".replace("{".concat("variantId", "}"), encodeURIComponent(String(requestParameters.variantId))),
|
|
128
|
-
method: 'GET',
|
|
129
|
-
headers: headerParameters,
|
|
130
|
-
query: queryParameters,
|
|
131
|
-
}, initOverrides)];
|
|
132
|
-
case 3:
|
|
133
|
-
response = _c.sent();
|
|
134
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantFromJSON)(jsonValue); })];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
36
|
+
getVariantRaw(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 getVariant.');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
|
|
42
|
+
throw new runtime.RequiredError('variantId', 'Required parameter requestParameters.variantId was null or undefined when calling getVariant.');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
if (requestParameters.project !== undefined) {
|
|
46
|
+
queryParameters['project'] = requestParameters.project;
|
|
47
|
+
}
|
|
48
|
+
if (requestParameters.fields !== undefined) {
|
|
49
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
50
|
+
}
|
|
51
|
+
const headerParameters = {};
|
|
52
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
53
|
+
// oauth required
|
|
54
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
55
|
+
}
|
|
56
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
57
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
58
|
+
}
|
|
59
|
+
const response = yield this.request({
|
|
60
|
+
path: `/v1/catalog/variants/{variantId}`.replace(`{${"variantId"}}`, encodeURIComponent(String(requestParameters.variantId))),
|
|
61
|
+
method: 'GET',
|
|
62
|
+
headers: headerParameters,
|
|
63
|
+
query: queryParameters,
|
|
64
|
+
}, initOverrides);
|
|
65
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.VariantFromJSON)(jsonValue));
|
|
137
66
|
});
|
|
138
|
-
}
|
|
67
|
+
}
|
|
139
68
|
/**
|
|
140
69
|
* Gets a variant by a given ID.
|
|
141
70
|
* Get variant
|
|
142
71
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return __generator(this, function (_a) {
|
|
148
|
-
switch (_a.label) {
|
|
149
|
-
case 0: return [4 /*yield*/, this.getVariantRaw(__assign({ project: project, variantId: variantId }, optionalParameters), initOverrides)];
|
|
150
|
-
case 1:
|
|
151
|
-
response = _a.sent();
|
|
152
|
-
return [4 /*yield*/, response.value()];
|
|
153
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
154
|
-
}
|
|
155
|
-
});
|
|
72
|
+
getVariant(project, variantId, optionalParameters = {}, initOverrides) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const response = yield this.getVariantRaw(Object.assign({ project: project, variantId: variantId }, optionalParameters), initOverrides);
|
|
75
|
+
return yield response.value();
|
|
156
76
|
});
|
|
157
|
-
}
|
|
77
|
+
}
|
|
158
78
|
/**
|
|
159
79
|
* Lists all variants that belong to enabled products attached to the given project.
|
|
160
80
|
* List variants
|
|
161
81
|
*/
|
|
162
|
-
|
|
163
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
199
|
-
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
200
|
-
}
|
|
201
|
-
return [4 /*yield*/, this.request({
|
|
202
|
-
path: "/v1/catalog/variants",
|
|
203
|
-
method: 'GET',
|
|
204
|
-
headers: headerParameters,
|
|
205
|
-
query: queryParameters,
|
|
206
|
-
}, initOverrides)];
|
|
207
|
-
case 3:
|
|
208
|
-
response = _c.sent();
|
|
209
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantsResponseFromJSON)(jsonValue); })];
|
|
210
|
-
}
|
|
211
|
-
});
|
|
82
|
+
listVariantsRaw(requestParameters, initOverrides) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
85
|
+
throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listVariants.');
|
|
86
|
+
}
|
|
87
|
+
const queryParameters = {};
|
|
88
|
+
if (requestParameters.project !== undefined) {
|
|
89
|
+
queryParameters['project'] = requestParameters.project;
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters.search !== undefined) {
|
|
92
|
+
queryParameters['search'] = requestParameters.search;
|
|
93
|
+
}
|
|
94
|
+
if (requestParameters.pageToken !== undefined) {
|
|
95
|
+
queryParameters['pageToken'] = requestParameters.pageToken;
|
|
96
|
+
}
|
|
97
|
+
if (requestParameters.pageSize !== undefined) {
|
|
98
|
+
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
99
|
+
}
|
|
100
|
+
if (requestParameters.fields !== undefined) {
|
|
101
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
102
|
+
}
|
|
103
|
+
const headerParameters = {};
|
|
104
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
105
|
+
// oauth required
|
|
106
|
+
headerParameters["Authorization"] = yield this.configuration.accessToken("session-oauth", []);
|
|
107
|
+
}
|
|
108
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
109
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
110
|
+
}
|
|
111
|
+
const response = yield this.request({
|
|
112
|
+
path: `/v1/catalog/variants`,
|
|
113
|
+
method: 'GET',
|
|
114
|
+
headers: headerParameters,
|
|
115
|
+
query: queryParameters,
|
|
116
|
+
}, initOverrides);
|
|
117
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.VariantsResponseFromJSON)(jsonValue));
|
|
212
118
|
});
|
|
213
|
-
}
|
|
119
|
+
}
|
|
214
120
|
/**
|
|
215
121
|
* Lists all variants that belong to enabled products attached to the given project.
|
|
216
122
|
* List variants
|
|
217
123
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return __generator(this, function (_a) {
|
|
223
|
-
switch (_a.label) {
|
|
224
|
-
case 0: return [4 /*yield*/, this.listVariantsRaw(__assign({ project: project }, optionalParameters), initOverrides)];
|
|
225
|
-
case 1:
|
|
226
|
-
response = _a.sent();
|
|
227
|
-
return [4 /*yield*/, response.value()];
|
|
228
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
124
|
+
listVariants(project, optionalParameters = {}, initOverrides) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const response = yield this.listVariantsRaw(Object.assign({ project: project }, optionalParameters), initOverrides);
|
|
127
|
+
return yield response.value();
|
|
231
128
|
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
}(runtime.BaseAPI));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
235
131
|
exports.VariantsApi = VariantsApi;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product Catalog API
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.11.1
|
|
6
|
+
* Contact: hello@teemill.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CreateProductRequest, ImportProducts200Response, Product, ProductsResponse, UpdateProductRequest } from '../models/index';
|
|
14
|
+
export interface CreateProductOperationRequest {
|
|
15
|
+
project: string;
|
|
16
|
+
createProductRequest?: CreateProductRequest;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteProductRequest {
|
|
19
|
+
project: string;
|
|
20
|
+
productId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GetProductRequest {
|
|
23
|
+
project: string;
|
|
24
|
+
productId: string;
|
|
25
|
+
fields?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GetProductsRequest {
|
|
28
|
+
project: string;
|
|
29
|
+
pageToken?: number;
|
|
30
|
+
search?: string;
|
|
31
|
+
pageSize?: number;
|
|
32
|
+
fields?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ImportProductsRequest {
|
|
35
|
+
project: string;
|
|
36
|
+
body?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface UpdateProductOperationRequest {
|
|
39
|
+
project: string;
|
|
40
|
+
productId: string;
|
|
41
|
+
updateProductRequest?: UpdateProductRequest;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare class ProductsApi extends runtime.BaseAPI {
|
|
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
|
+
* Create product
|
|
50
|
+
*/
|
|
51
|
+
createProductRaw(requestParameters: CreateProductOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>>;
|
|
52
|
+
/**
|
|
53
|
+
* 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.
|
|
54
|
+
* Create product
|
|
55
|
+
*/
|
|
56
|
+
createProduct(project: string, optionalParameters?: runtime.OptionalOnly<CreateProductOperationRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Product>;
|
|
57
|
+
/**
|
|
58
|
+
* Deletes a catalog product
|
|
59
|
+
* Delete catalog product
|
|
60
|
+
*/
|
|
61
|
+
deleteProductRaw(requestParameters: DeleteProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a catalog product
|
|
64
|
+
* Delete catalog product
|
|
65
|
+
*/
|
|
66
|
+
deleteProduct(project: string, productId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Gets a product by a given ID.
|
|
69
|
+
* Get product
|
|
70
|
+
*/
|
|
71
|
+
getProductRaw(requestParameters: GetProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets a product by a given ID.
|
|
74
|
+
* Get product
|
|
75
|
+
*/
|
|
76
|
+
getProduct(project: string, productId: string, optionalParameters?: runtime.OptionalOnly<GetProductRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Product>;
|
|
77
|
+
/**
|
|
78
|
+
* Lists all enabled store listing products attached to the given project.
|
|
79
|
+
* List products
|
|
80
|
+
*/
|
|
81
|
+
getProductsRaw(requestParameters: GetProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductsResponse>>;
|
|
82
|
+
/**
|
|
83
|
+
* Lists all enabled store listing products attached to the given project.
|
|
84
|
+
* List products
|
|
85
|
+
*/
|
|
86
|
+
getProducts(project: string, optionalParameters?: runtime.OptionalOnly<GetProductsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
89
|
+
* Import products
|
|
90
|
+
*/
|
|
91
|
+
importProductsRaw(requestParameters: ImportProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ImportProducts200Response>>;
|
|
92
|
+
/**
|
|
93
|
+
* Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
|
|
94
|
+
* Import products
|
|
95
|
+
*/
|
|
96
|
+
importProducts(project: string, optionalParameters?: runtime.OptionalOnly<ImportProductsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ImportProducts200Response>;
|
|
97
|
+
/**
|
|
98
|
+
* Updates a product by a given ID.
|
|
99
|
+
* Update product
|
|
100
|
+
*/
|
|
101
|
+
updateProductRaw(requestParameters: UpdateProductOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>>;
|
|
102
|
+
/**
|
|
103
|
+
* Updates a product by a given ID.
|
|
104
|
+
* Update product
|
|
105
|
+
*/
|
|
106
|
+
updateProduct(project: string, productId: string, optionalParameters?: runtime.OptionalOnly<UpdateProductOperationRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Product>;
|
|
107
|
+
}
|