@teemill/product-catalog 1.0.2

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.
Files changed (54) hide show
  1. package/.openapi-generator/FILES +22 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +45 -0
  5. package/dist/apis/ProductsApi.d.ts +49 -0
  6. package/dist/apis/ProductsApi.js +199 -0
  7. package/dist/apis/VariantsApi.d.ts +49 -0
  8. package/dist/apis/VariantsApi.js +199 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +20 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +21 -0
  13. package/dist/models/ApiError.d.ts +37 -0
  14. package/dist/models/ApiError.js +53 -0
  15. package/dist/models/Attribute.d.ts +37 -0
  16. package/dist/models/Attribute.js +52 -0
  17. package/dist/models/Image.d.ts +67 -0
  18. package/dist/models/Image.js +62 -0
  19. package/dist/models/Price.d.ts +37 -0
  20. package/dist/models/Price.js +52 -0
  21. package/dist/models/Product.d.ts +93 -0
  22. package/dist/models/Product.js +73 -0
  23. package/dist/models/ProductsResponse.d.ts +38 -0
  24. package/dist/models/ProductsResponse.js +53 -0
  25. package/dist/models/Stock.d.ts +31 -0
  26. package/dist/models/Stock.js +50 -0
  27. package/dist/models/Variant.d.ts +114 -0
  28. package/dist/models/Variant.js +81 -0
  29. package/dist/models/VariantProduct.d.ts +37 -0
  30. package/dist/models/VariantProduct.js +52 -0
  31. package/dist/models/VariantsResponse.d.ts +38 -0
  32. package/dist/models/VariantsResponse.js +53 -0
  33. package/dist/models/index.d.ts +10 -0
  34. package/dist/models/index.js +28 -0
  35. package/dist/runtime.d.ts +182 -0
  36. package/dist/runtime.js +562 -0
  37. package/package.json +19 -0
  38. package/src/apis/ProductsApi.ts +149 -0
  39. package/src/apis/VariantsApi.ts +149 -0
  40. package/src/apis/index.ts +4 -0
  41. package/src/index.ts +5 -0
  42. package/src/models/ApiError.ts +74 -0
  43. package/src/models/Attribute.ts +73 -0
  44. package/src/models/Image.ts +113 -0
  45. package/src/models/Price.ts +73 -0
  46. package/src/models/Product.ts +159 -0
  47. package/src/models/ProductsResponse.ts +80 -0
  48. package/src/models/Stock.ts +65 -0
  49. package/src/models/Variant.ts +200 -0
  50. package/src/models/VariantProduct.ts +73 -0
  51. package/src/models/VariantsResponse.ts +80 -0
  52. package/src/models/index.ts +12 -0
  53. package/src/runtime.ts +431 -0
  54. package/tsconfig.json +20 -0
@@ -0,0 +1,22 @@
1
+ .gitignore
2
+ .npmignore
3
+ .openapi-generator-ignore
4
+ README.md
5
+ package.json
6
+ src/apis/ProductsApi.ts
7
+ src/apis/VariantsApi.ts
8
+ src/apis/index.ts
9
+ src/index.ts
10
+ src/models/ApiError.ts
11
+ src/models/Attribute.ts
12
+ src/models/Image.ts
13
+ src/models/Price.ts
14
+ src/models/Product.ts
15
+ src/models/ProductsResponse.ts
16
+ src/models/Stock.ts
17
+ src/models/Variant.ts
18
+ src/models/VariantProduct.ts
19
+ src/models/VariantsResponse.ts
20
+ src/models/index.ts
21
+ src/runtime.ts
22
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 7.1.0-SNAPSHOT
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ ## @teemill/product-catalog@1.0.2
2
+
3
+ This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
+
5
+ Environment
6
+ * Node.js
7
+ * Webpack
8
+ * Browserify
9
+
10
+ Language level
11
+ * ES5 - you must have a Promises/A+ library installed
12
+ * ES6
13
+
14
+ Module system
15
+ * CommonJS
16
+ * ES6 module system
17
+
18
+ It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
19
+
20
+ ### Building
21
+
22
+ To build and compile the typescript sources to javascript use:
23
+ ```
24
+ npm install
25
+ npm run build
26
+ ```
27
+
28
+ ### Publishing
29
+
30
+ First build the package then run ```npm publish```
31
+
32
+ ### Consuming
33
+
34
+ navigate to the folder of your consuming project and run one of the following commands.
35
+
36
+ _published:_
37
+
38
+ ```
39
+ npm install @teemill/product-catalog@1.0.2 --save
40
+ ```
41
+
42
+ _unPublished (not recommended):_
43
+
44
+ ```
45
+ npm install PATH_TO_GENERATED_PACKAGE --save
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Product Catalog API
3
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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 { Product, ProductsResponse } from '../models/index';
14
+ export interface GetProductRequest {
15
+ project: string;
16
+ productId: string;
17
+ fields?: string;
18
+ }
19
+ export interface GetProductsRequest {
20
+ project: string;
21
+ pageToken?: number;
22
+ pageSize?: number;
23
+ fields?: string;
24
+ }
25
+ /**
26
+ *
27
+ */
28
+ export declare class ProductsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Gets a product by the given id
31
+ * Get product
32
+ */
33
+ getProductRaw(requestParameters: GetProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>>;
34
+ /**
35
+ * Gets a product by the given id
36
+ * Get product
37
+ */
38
+ getProduct(requestParameters: GetProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Product>;
39
+ /**
40
+ * Lists all products
41
+ * List products
42
+ */
43
+ getProductsRaw(requestParameters: GetProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductsResponse>>;
44
+ /**
45
+ * Lists all products
46
+ * List products
47
+ */
48
+ getProducts(requestParameters: GetProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductsResponse>;
49
+ }
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Product Catalog API
6
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ 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;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.ProductsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var ProductsApi = /** @class */ (function (_super) {
74
+ __extends(ProductsApi, _super);
75
+ function ProductsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Gets a product by the given id
80
+ * Get product
81
+ */
82
+ ProductsApi.prototype.getProductRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, response;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
+ case 0:
88
+ if (requestParameters.project === null || requestParameters.project === undefined) {
89
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getProduct.');
90
+ }
91
+ if (requestParameters.productId === null || requestParameters.productId === undefined) {
92
+ throw new runtime.RequiredError('productId', 'Required parameter requestParameters.productId was null or undefined when calling getProduct.');
93
+ }
94
+ queryParameters = {};
95
+ if (requestParameters.project !== undefined) {
96
+ queryParameters['project'] = requestParameters.project;
97
+ }
98
+ if (requestParameters.fields !== undefined) {
99
+ queryParameters['fields'] = requestParameters.fields;
100
+ }
101
+ headerParameters = {};
102
+ if (this.configuration && this.configuration.apiKey) {
103
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
104
+ }
105
+ return [4 /*yield*/, this.request({
106
+ path: "/v1/catalog/products/{productId}".replace("{".concat("productId", "}"), encodeURIComponent(String(requestParameters.productId))),
107
+ method: 'GET',
108
+ headers: headerParameters,
109
+ query: queryParameters,
110
+ }, initOverrides)];
111
+ case 1:
112
+ response = _a.sent();
113
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductFromJSON)(jsonValue); })];
114
+ }
115
+ });
116
+ });
117
+ };
118
+ /**
119
+ * Gets a product by the given id
120
+ * Get product
121
+ */
122
+ ProductsApi.prototype.getProduct = function (requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function () {
124
+ var response;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.getProductRaw(requestParameters, initOverrides)];
128
+ case 1:
129
+ response = _a.sent();
130
+ return [4 /*yield*/, response.value()];
131
+ case 2: return [2 /*return*/, _a.sent()];
132
+ }
133
+ });
134
+ });
135
+ };
136
+ /**
137
+ * Lists all products
138
+ * List products
139
+ */
140
+ ProductsApi.prototype.getProductsRaw = function (requestParameters, initOverrides) {
141
+ return __awaiter(this, void 0, void 0, function () {
142
+ var queryParameters, headerParameters, response;
143
+ return __generator(this, function (_a) {
144
+ switch (_a.label) {
145
+ case 0:
146
+ if (requestParameters.project === null || requestParameters.project === undefined) {
147
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getProducts.');
148
+ }
149
+ queryParameters = {};
150
+ if (requestParameters.project !== undefined) {
151
+ queryParameters['project'] = requestParameters.project;
152
+ }
153
+ if (requestParameters.pageToken !== undefined) {
154
+ queryParameters['pageToken'] = requestParameters.pageToken;
155
+ }
156
+ if (requestParameters.pageSize !== undefined) {
157
+ queryParameters['pageSize'] = requestParameters.pageSize;
158
+ }
159
+ if (requestParameters.fields !== undefined) {
160
+ queryParameters['fields'] = requestParameters.fields;
161
+ }
162
+ headerParameters = {};
163
+ if (this.configuration && this.configuration.apiKey) {
164
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
165
+ }
166
+ return [4 /*yield*/, this.request({
167
+ path: "/v1/catalog/products",
168
+ method: 'GET',
169
+ headers: headerParameters,
170
+ query: queryParameters,
171
+ }, initOverrides)];
172
+ case 1:
173
+ response = _a.sent();
174
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ProductsResponseFromJSON)(jsonValue); })];
175
+ }
176
+ });
177
+ });
178
+ };
179
+ /**
180
+ * Lists all products
181
+ * List products
182
+ */
183
+ ProductsApi.prototype.getProducts = function (requestParameters, initOverrides) {
184
+ return __awaiter(this, void 0, void 0, function () {
185
+ var response;
186
+ return __generator(this, function (_a) {
187
+ switch (_a.label) {
188
+ case 0: return [4 /*yield*/, this.getProductsRaw(requestParameters, initOverrides)];
189
+ case 1:
190
+ response = _a.sent();
191
+ return [4 /*yield*/, response.value()];
192
+ case 2: return [2 /*return*/, _a.sent()];
193
+ }
194
+ });
195
+ });
196
+ };
197
+ return ProductsApi;
198
+ }(runtime.BaseAPI));
199
+ exports.ProductsApi = ProductsApi;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Product Catalog API
3
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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 { Variant, VariantsResponse } from '../models/index';
14
+ export interface GetVariantRequest {
15
+ project: string;
16
+ variantId: string;
17
+ fields?: string;
18
+ }
19
+ export interface ListVariantsRequest {
20
+ project: string;
21
+ pageToken?: number;
22
+ pageSize?: number;
23
+ fields?: string;
24
+ }
25
+ /**
26
+ *
27
+ */
28
+ export declare class VariantsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Gets a variant by the given id
31
+ * Get variant
32
+ */
33
+ getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>>;
34
+ /**
35
+ * Gets a variant by the given id
36
+ * Get variant
37
+ */
38
+ getVariant(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Variant>;
39
+ /**
40
+ * Lists all variants
41
+ * List variants
42
+ */
43
+ listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>>;
44
+ /**
45
+ * Lists all variants
46
+ * List variants
47
+ */
48
+ listVariants(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantsResponse>;
49
+ }
@@ -0,0 +1,199 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Product Catalog API
6
+ * Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.2
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ 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;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.VariantsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var VariantsApi = /** @class */ (function (_super) {
74
+ __extends(VariantsApi, _super);
75
+ function VariantsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Gets a variant by the given id
80
+ * Get variant
81
+ */
82
+ VariantsApi.prototype.getVariantRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, response;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
+ case 0:
88
+ if (requestParameters.project === null || requestParameters.project === undefined) {
89
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling getVariant.');
90
+ }
91
+ if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
92
+ throw new runtime.RequiredError('variantId', 'Required parameter requestParameters.variantId was null or undefined when calling getVariant.');
93
+ }
94
+ queryParameters = {};
95
+ if (requestParameters.project !== undefined) {
96
+ queryParameters['project'] = requestParameters.project;
97
+ }
98
+ if (requestParameters.fields !== undefined) {
99
+ queryParameters['fields'] = requestParameters.fields;
100
+ }
101
+ headerParameters = {};
102
+ if (this.configuration && this.configuration.apiKey) {
103
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
104
+ }
105
+ return [4 /*yield*/, this.request({
106
+ path: "/v1/catalog/variants/{variantId}".replace("{".concat("variantId", "}"), encodeURIComponent(String(requestParameters.variantId))),
107
+ method: 'GET',
108
+ headers: headerParameters,
109
+ query: queryParameters,
110
+ }, initOverrides)];
111
+ case 1:
112
+ response = _a.sent();
113
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantFromJSON)(jsonValue); })];
114
+ }
115
+ });
116
+ });
117
+ };
118
+ /**
119
+ * Gets a variant by the given id
120
+ * Get variant
121
+ */
122
+ VariantsApi.prototype.getVariant = function (requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function () {
124
+ var response;
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.getVariantRaw(requestParameters, initOverrides)];
128
+ case 1:
129
+ response = _a.sent();
130
+ return [4 /*yield*/, response.value()];
131
+ case 2: return [2 /*return*/, _a.sent()];
132
+ }
133
+ });
134
+ });
135
+ };
136
+ /**
137
+ * Lists all variants
138
+ * List variants
139
+ */
140
+ VariantsApi.prototype.listVariantsRaw = function (requestParameters, initOverrides) {
141
+ return __awaiter(this, void 0, void 0, function () {
142
+ var queryParameters, headerParameters, response;
143
+ return __generator(this, function (_a) {
144
+ switch (_a.label) {
145
+ case 0:
146
+ if (requestParameters.project === null || requestParameters.project === undefined) {
147
+ throw new runtime.RequiredError('project', 'Required parameter requestParameters.project was null or undefined when calling listVariants.');
148
+ }
149
+ queryParameters = {};
150
+ if (requestParameters.project !== undefined) {
151
+ queryParameters['project'] = requestParameters.project;
152
+ }
153
+ if (requestParameters.pageToken !== undefined) {
154
+ queryParameters['pageToken'] = requestParameters.pageToken;
155
+ }
156
+ if (requestParameters.pageSize !== undefined) {
157
+ queryParameters['pageSize'] = requestParameters.pageSize;
158
+ }
159
+ if (requestParameters.fields !== undefined) {
160
+ queryParameters['fields'] = requestParameters.fields;
161
+ }
162
+ headerParameters = {};
163
+ if (this.configuration && this.configuration.apiKey) {
164
+ headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
165
+ }
166
+ return [4 /*yield*/, this.request({
167
+ path: "/v1/catalog/variants",
168
+ method: 'GET',
169
+ headers: headerParameters,
170
+ query: queryParameters,
171
+ }, initOverrides)];
172
+ case 1:
173
+ response = _a.sent();
174
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VariantsResponseFromJSON)(jsonValue); })];
175
+ }
176
+ });
177
+ });
178
+ };
179
+ /**
180
+ * Lists all variants
181
+ * List variants
182
+ */
183
+ VariantsApi.prototype.listVariants = function (requestParameters, initOverrides) {
184
+ return __awaiter(this, void 0, void 0, function () {
185
+ var response;
186
+ return __generator(this, function (_a) {
187
+ switch (_a.label) {
188
+ case 0: return [4 /*yield*/, this.listVariantsRaw(requestParameters, initOverrides)];
189
+ case 1:
190
+ response = _a.sent();
191
+ return [4 /*yield*/, response.value()];
192
+ case 2: return [2 /*return*/, _a.sent()];
193
+ }
194
+ });
195
+ });
196
+ };
197
+ return VariantsApi;
198
+ }(runtime.BaseAPI));
199
+ exports.VariantsApi = VariantsApi;
@@ -0,0 +1,2 @@
1
+ export * from './ProductsApi';
2
+ export * from './VariantsApi';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./ProductsApi"), exports);
20
+ __exportStar(require("./VariantsApi"), exports);
@@ -0,0 +1,3 @@
1
+ export * from './runtime';
2
+ export * from './apis/index';
3
+ export * from './models/index';
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./runtime"), exports);
20
+ __exportStar(require("./apis/index"), exports);
21
+ __exportStar(require("./models/index"), exports);