@teemill/product-catalog 1.11.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/.openapi-generator/FILES +6 -29
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +3 -3
  4. package/api.ts +1598 -0
  5. package/base.ts +86 -0
  6. package/common.ts +150 -0
  7. package/configuration.ts +110 -0
  8. package/dist/api.d.ts +1126 -0
  9. package/dist/api.js +819 -0
  10. package/dist/base.d.ts +66 -0
  11. package/dist/base.js +65 -0
  12. package/dist/common.d.ts +65 -0
  13. package/dist/common.js +161 -0
  14. package/dist/configuration.d.ts +91 -0
  15. package/dist/configuration.js +43 -0
  16. package/dist/esm/api.d.ts +1126 -0
  17. package/dist/esm/api.js +808 -0
  18. package/dist/esm/base.d.ts +66 -0
  19. package/dist/esm/base.js +60 -0
  20. package/dist/esm/common.d.ts +65 -0
  21. package/dist/esm/common.js +149 -0
  22. package/dist/esm/configuration.d.ts +91 -0
  23. package/dist/esm/configuration.js +39 -0
  24. package/dist/esm/index.d.ts +13 -3
  25. package/dist/esm/index.js +13 -3
  26. package/dist/index.d.ts +13 -3
  27. package/dist/index.js +15 -5
  28. package/git_push.sh +57 -0
  29. package/index.ts +18 -0
  30. package/package.json +15 -3
  31. package/tsconfig.json +4 -6
  32. package/dist/apis/ProductsApi.d.ts +0 -107
  33. package/dist/apis/ProductsApi.js +0 -304
  34. package/dist/apis/VariantsApi.d.ts +0 -50
  35. package/dist/apis/VariantsApi.js +0 -131
  36. package/dist/apis/index.d.ts +0 -2
  37. package/dist/apis/index.js +0 -20
  38. package/dist/esm/apis/ProductsApi.d.ts +0 -107
  39. package/dist/esm/apis/ProductsApi.js +0 -300
  40. package/dist/esm/apis/VariantsApi.d.ts +0 -50
  41. package/dist/esm/apis/VariantsApi.js +0 -127
  42. package/dist/esm/apis/index.d.ts +0 -2
  43. package/dist/esm/apis/index.js +0 -4
  44. package/dist/esm/models/ApiError.d.ts +0 -37
  45. package/dist/esm/models/ApiError.js +0 -42
  46. package/dist/esm/models/Attribute.d.ts +0 -50
  47. package/dist/esm/models/Attribute.js +0 -49
  48. package/dist/esm/models/AttributeThumbnail.d.ts +0 -46
  49. package/dist/esm/models/AttributeThumbnail.js +0 -48
  50. package/dist/esm/models/CreateProductRequest.d.ts +0 -88
  51. package/dist/esm/models/CreateProductRequest.js +0 -63
  52. package/dist/esm/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
  53. package/dist/esm/models/CreateProductRequestAdditionalFilesInner.js +0 -43
  54. package/dist/esm/models/CreateProductRequestImagesInner.d.ts +0 -31
  55. package/dist/esm/models/CreateProductRequestImagesInner.js +0 -38
  56. package/dist/esm/models/CreateProductRequestSeoMetadata.d.ts +0 -31
  57. package/dist/esm/models/CreateProductRequestSeoMetadata.js +0 -38
  58. package/dist/esm/models/CreateProductRequestVariantsInner.d.ts +0 -59
  59. package/dist/esm/models/CreateProductRequestVariantsInner.js +0 -57
  60. package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
  61. package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -67
  62. package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
  63. package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -46
  64. package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
  65. package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.js +0 -43
  66. package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
  67. package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -46
  68. package/dist/esm/models/CreateProductVariant.d.ts +0 -59
  69. package/dist/esm/models/CreateProductVariant.js +0 -54
  70. package/dist/esm/models/CreateProductVariantApplicationsInner.d.ts +0 -54
  71. package/dist/esm/models/CreateProductVariantApplicationsInner.js +0 -58
  72. package/dist/esm/models/CreateProductVariantAttributesInner.d.ts +0 -37
  73. package/dist/esm/models/CreateProductVariantAttributesInner.js +0 -44
  74. package/dist/esm/models/CreateProductVariantRetailPrice.d.ts +0 -37
  75. package/dist/esm/models/CreateProductVariantRetailPrice.js +0 -44
  76. package/dist/esm/models/Image.d.ts +0 -67
  77. package/dist/esm/models/Image.js +0 -50
  78. package/dist/esm/models/ImportProducts200Response.d.ts +0 -31
  79. package/dist/esm/models/ImportProducts200Response.js +0 -38
  80. package/dist/esm/models/ModelFile.d.ts +0 -31
  81. package/dist/esm/models/ModelFile.js +0 -38
  82. package/dist/esm/models/Price.d.ts +0 -37
  83. package/dist/esm/models/Price.js +0 -40
  84. package/dist/esm/models/Product.d.ts +0 -113
  85. package/dist/esm/models/Product.js +0 -71
  86. package/dist/esm/models/ProductAdditionalFilesInner.d.ts +0 -37
  87. package/dist/esm/models/ProductAdditionalFilesInner.js +0 -40
  88. package/dist/esm/models/ProductsResponse.d.ts +0 -38
  89. package/dist/esm/models/ProductsResponse.js +0 -41
  90. package/dist/esm/models/SeoMetadata.d.ts +0 -31
  91. package/dist/esm/models/SeoMetadata.js +0 -38
  92. package/dist/esm/models/Stock.d.ts +0 -31
  93. package/dist/esm/models/Stock.js +0 -38
  94. package/dist/esm/models/UpdateProductRequest.d.ts +0 -87
  95. package/dist/esm/models/UpdateProductRequest.js +0 -58
  96. package/dist/esm/models/Variant.d.ts +0 -114
  97. package/dist/esm/models/Variant.js +0 -71
  98. package/dist/esm/models/VariantProduct.d.ts +0 -37
  99. package/dist/esm/models/VariantProduct.js +0 -40
  100. package/dist/esm/models/VariantsResponse.d.ts +0 -38
  101. package/dist/esm/models/VariantsResponse.js +0 -41
  102. package/dist/esm/models/index.d.ts +0 -23
  103. package/dist/esm/models/index.js +0 -25
  104. package/dist/esm/runtime.d.ts +0 -187
  105. package/dist/esm/runtime.js +0 -333
  106. package/dist/models/ApiError.d.ts +0 -37
  107. package/dist/models/ApiError.js +0 -49
  108. package/dist/models/Attribute.d.ts +0 -50
  109. package/dist/models/Attribute.js +0 -56
  110. package/dist/models/AttributeThumbnail.d.ts +0 -46
  111. package/dist/models/AttributeThumbnail.js +0 -55
  112. package/dist/models/CreateProductRequest.d.ts +0 -88
  113. package/dist/models/CreateProductRequest.js +0 -70
  114. package/dist/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
  115. package/dist/models/CreateProductRequestAdditionalFilesInner.js +0 -50
  116. package/dist/models/CreateProductRequestImagesInner.d.ts +0 -31
  117. package/dist/models/CreateProductRequestImagesInner.js +0 -45
  118. package/dist/models/CreateProductRequestSeoMetadata.d.ts +0 -31
  119. package/dist/models/CreateProductRequestSeoMetadata.js +0 -45
  120. package/dist/models/CreateProductRequestVariantsInner.d.ts +0 -59
  121. package/dist/models/CreateProductRequestVariantsInner.js +0 -64
  122. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
  123. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -74
  124. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
  125. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -53
  126. package/dist/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
  127. package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +0 -50
  128. package/dist/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
  129. package/dist/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -53
  130. package/dist/models/CreateProductVariant.d.ts +0 -59
  131. package/dist/models/CreateProductVariant.js +0 -61
  132. package/dist/models/CreateProductVariantApplicationsInner.d.ts +0 -54
  133. package/dist/models/CreateProductVariantApplicationsInner.js +0 -65
  134. package/dist/models/CreateProductVariantAttributesInner.d.ts +0 -37
  135. package/dist/models/CreateProductVariantAttributesInner.js +0 -51
  136. package/dist/models/CreateProductVariantRetailPrice.d.ts +0 -37
  137. package/dist/models/CreateProductVariantRetailPrice.js +0 -51
  138. package/dist/models/Image.d.ts +0 -67
  139. package/dist/models/Image.js +0 -57
  140. package/dist/models/ImportProducts200Response.d.ts +0 -31
  141. package/dist/models/ImportProducts200Response.js +0 -45
  142. package/dist/models/ModelFile.d.ts +0 -31
  143. package/dist/models/ModelFile.js +0 -45
  144. package/dist/models/Price.d.ts +0 -37
  145. package/dist/models/Price.js +0 -47
  146. package/dist/models/Product.d.ts +0 -113
  147. package/dist/models/Product.js +0 -78
  148. package/dist/models/ProductAdditionalFilesInner.d.ts +0 -37
  149. package/dist/models/ProductAdditionalFilesInner.js +0 -47
  150. package/dist/models/ProductsResponse.d.ts +0 -38
  151. package/dist/models/ProductsResponse.js +0 -48
  152. package/dist/models/SeoMetadata.d.ts +0 -31
  153. package/dist/models/SeoMetadata.js +0 -45
  154. package/dist/models/Stock.d.ts +0 -31
  155. package/dist/models/Stock.js +0 -45
  156. package/dist/models/UpdateProductRequest.d.ts +0 -87
  157. package/dist/models/UpdateProductRequest.js +0 -65
  158. package/dist/models/Variant.d.ts +0 -114
  159. package/dist/models/Variant.js +0 -78
  160. package/dist/models/VariantProduct.d.ts +0 -37
  161. package/dist/models/VariantProduct.js +0 -47
  162. package/dist/models/VariantsResponse.d.ts +0 -38
  163. package/dist/models/VariantsResponse.js +0 -48
  164. package/dist/models/index.d.ts +0 -23
  165. package/dist/models/index.js +0 -41
  166. package/dist/runtime.d.ts +0 -187
  167. package/dist/runtime.js +0 -349
  168. package/src/apis/ProductsApi.ts +0 -453
  169. package/src/apis/VariantsApi.ts +0 -186
  170. package/src/apis/index.ts +0 -4
  171. package/src/index.ts +0 -5
  172. package/src/models/ApiError.ts +0 -69
  173. package/src/models/Attribute.ts +0 -93
  174. package/src/models/AttributeThumbnail.ts +0 -80
  175. package/src/models/CreateProductRequest.ts +0 -153
  176. package/src/models/CreateProductRequestAdditionalFilesInner.ts +0 -65
  177. package/src/models/CreateProductRequestImagesInner.ts +0 -60
  178. package/src/models/CreateProductRequestSeoMetadata.ts +0 -60
  179. package/src/models/CreateProductRequestVariantsInner.ts +0 -124
  180. package/src/models/CreateProductRequestVariantsInnerApplicationsInner.ts +0 -108
  181. package/src/models/CreateProductRequestVariantsInnerAttributesInner.ts +0 -75
  182. package/src/models/CreateProductRequestVariantsInnerImagesInner.ts +0 -65
  183. package/src/models/CreateProductRequestVariantsInnerRetailPrice.ts +0 -75
  184. package/src/models/CreateProductVariant.ts +0 -119
  185. package/src/models/CreateProductVariantApplicationsInner.ts +0 -93
  186. package/src/models/CreateProductVariantAttributesInner.ts +0 -70
  187. package/src/models/CreateProductVariantRetailPrice.ts +0 -70
  188. package/src/models/Image.ts +0 -108
  189. package/src/models/ImportProducts200Response.ts +0 -60
  190. package/src/models/ModelFile.ts +0 -60
  191. package/src/models/Price.ts +0 -68
  192. package/src/models/Product.ts +0 -190
  193. package/src/models/ProductAdditionalFilesInner.ts +0 -68
  194. package/src/models/ProductsResponse.ts +0 -75
  195. package/src/models/SeoMetadata.ts +0 -60
  196. package/src/models/Stock.ts +0 -60
  197. package/src/models/UpdateProductRequest.ts +0 -145
  198. package/src/models/Variant.ts +0 -195
  199. package/src/models/VariantProduct.ts +0 -68
  200. package/src/models/VariantsResponse.ts +0 -75
  201. package/src/models/index.ts +0 -25
  202. package/src/runtime.ts +0 -441
package/tsconfig.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "declaration": true,
4
- "target": "es6",
4
+ "target": "ES6",
5
5
  "module": "commonjs",
6
- "moduleResolution": "node",
6
+ "noImplicitAny": true,
7
7
  "outDir": "dist",
8
- "lib": [
9
- "esnext",
10
- "dom"
11
- ],
8
+ "rootDir": ".",
9
+ "moduleResolution": "node",
12
10
  "typeRoots": [
13
11
  "node_modules/@types"
14
12
  ]
@@ -1,107 +0,0 @@
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
- }
@@ -1,304 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Product Catalog API
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
- *
8
- * The version of the OpenAPI document: 1.11.1
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ProductsApi = void 0;
26
- const runtime = require("../runtime");
27
- const index_1 = require("../models/index");
28
- /**
29
- *
30
- */
31
- class ProductsApi extends runtime.BaseAPI {
32
- /**
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.
34
- * Create product
35
- */
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));
62
- });
63
- }
64
- /**
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.
66
- * Create product
67
- */
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();
72
- });
73
- }
74
- /**
75
- * Deletes a catalog product
76
- * Delete catalog product
77
- */
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);
105
- });
106
- }
107
- /**
108
- * Deletes a catalog product
109
- * Delete catalog product
110
- */
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);
116
- });
117
- }
118
- /**
119
- * Gets a product by a given ID.
120
- * Get product
121
- */
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));
152
- });
153
- }
154
- /**
155
- * Gets a product by a given ID.
156
- * Get product
157
- */
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();
162
- });
163
- }
164
- /**
165
- * Lists all enabled store listing products attached to the given project.
166
- * List products
167
- */
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));
204
- });
205
- }
206
- /**
207
- * Lists all enabled store listing products attached to the given project.
208
- * List products
209
- */
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();
214
- });
215
- }
216
- /**
217
- * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
218
- * Import products
219
- */
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));
246
- });
247
- }
248
- /**
249
- * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
250
- * Import products
251
- */
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();
256
- });
257
- }
258
- /**
259
- * Updates a product by a given ID.
260
- * Update product
261
- */
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));
291
- });
292
- }
293
- /**
294
- * Updates a product by a given ID.
295
- * Update product
296
- */
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();
301
- });
302
- }
303
- }
304
- exports.ProductsApi = ProductsApi;
@@ -1,50 +0,0 @@
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 { 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
- search?: string;
22
- pageToken?: number;
23
- pageSize?: number;
24
- fields?: string;
25
- }
26
- /**
27
- *
28
- */
29
- export declare class VariantsApi extends runtime.BaseAPI {
30
- /**
31
- * Gets a variant by a given ID.
32
- * Get variant
33
- */
34
- getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>>;
35
- /**
36
- * Gets a variant by a given ID.
37
- * Get variant
38
- */
39
- getVariant(project: string, variantId: string, optionalParameters?: runtime.OptionalOnly<GetVariantRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Variant>;
40
- /**
41
- * Lists all variants that belong to enabled products attached to the given project.
42
- * List variants
43
- */
44
- listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>>;
45
- /**
46
- * Lists all variants that belong to enabled products attached to the given project.
47
- * List variants
48
- */
49
- listVariants(project: string, optionalParameters?: runtime.OptionalOnly<ListVariantsRequest>, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantsResponse>;
50
- }
@@ -1,131 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Product Catalog API
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
- *
8
- * The version of the OpenAPI document: 1.11.1
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.VariantsApi = void 0;
26
- const runtime = require("../runtime");
27
- const index_1 = require("../models/index");
28
- /**
29
- *
30
- */
31
- class VariantsApi extends runtime.BaseAPI {
32
- /**
33
- * Gets a variant by a given ID.
34
- * Get variant
35
- */
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));
66
- });
67
- }
68
- /**
69
- * Gets a variant by a given ID.
70
- * Get variant
71
- */
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();
76
- });
77
- }
78
- /**
79
- * Lists all variants that belong to enabled products attached to the given project.
80
- * List variants
81
- */
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));
118
- });
119
- }
120
- /**
121
- * Lists all variants that belong to enabled products attached to the given project.
122
- * List variants
123
- */
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();
128
- });
129
- }
130
- }
131
- exports.VariantsApi = VariantsApi;
@@ -1,2 +0,0 @@
1
- export * from './ProductsApi';
2
- export * from './VariantsApi';
@@ -1,20 +0,0 @@
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);