@teemill/product-catalog 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +7 -5
- package/.openapi-generator/VERSION +1 -1
- package/README.md +2 -2
- package/dist/apis/ProductsApi.d.ts +18 -2
- package/dist/apis/ProductsApi.js +72 -1
- package/dist/apis/VariantsApi.d.ts +1 -1
- package/dist/apis/VariantsApi.js +1 -1
- package/dist/models/ApiError.d.ts +1 -1
- package/dist/models/ApiError.js +10 -14
- package/dist/models/Attribute.d.ts +1 -1
- package/dist/models/Attribute.js +15 -18
- package/dist/models/AttributeThumbnail.d.ts +1 -1
- package/dist/models/AttributeThumbnail.js +9 -14
- package/dist/models/CreateProductRequest.d.ts +13 -7
- package/dist/models/CreateProductRequest.js +30 -31
- package/dist/models/CreateProductRequestImagesInner.d.ts +31 -0
- package/dist/models/CreateProductRequestImagesInner.js +45 -0
- package/dist/models/CreateProductRequestSeoMetadata.d.ts +1 -1
- package/dist/models/CreateProductRequestSeoMetadata.js +7 -12
- package/dist/models/CreateProductRequestVariantsInner.d.ts +1 -1
- package/dist/models/CreateProductRequestVariantsInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +1 -1
- package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +1 -1
- package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerImagesInner.d.ts +1 -1
- package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +1 -1
- package/dist/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +1 -1
- package/dist/models/CreateProductRequestVariantsInnerRetailPrice.js +1 -1
- package/dist/models/CreateProductVariant.d.ts +59 -0
- package/dist/models/CreateProductVariant.js +61 -0
- package/dist/models/CreateProductVariantApplicationsInner.d.ts +63 -0
- package/dist/models/CreateProductVariantApplicationsInner.js +73 -0
- package/dist/models/CreateProductVariantAttributesInner.d.ts +37 -0
- package/dist/models/CreateProductVariantAttributesInner.js +51 -0
- package/dist/models/CreateProductVariantRetailPrice.d.ts +37 -0
- package/dist/models/CreateProductVariantRetailPrice.js +51 -0
- package/dist/models/Image.d.ts +1 -1
- package/dist/models/Image.js +19 -24
- package/dist/models/ImportProducts200Response.d.ts +1 -1
- package/dist/models/ImportProducts200Response.js +7 -12
- package/dist/models/ModelFile.d.ts +31 -0
- package/dist/models/ModelFile.js +45 -0
- package/dist/models/Price.d.ts +1 -1
- package/dist/models/Price.js +9 -14
- package/dist/models/Product.d.ts +1 -1
- package/dist/models/Product.js +32 -35
- package/dist/models/ProductAdditionalFilesInner.d.ts +1 -1
- package/dist/models/ProductAdditionalFilesInner.js +9 -14
- package/dist/models/ProductsResponse.d.ts +1 -1
- package/dist/models/ProductsResponse.js +9 -14
- package/dist/models/SeoMetadata.d.ts +1 -1
- package/dist/models/SeoMetadata.js +7 -12
- package/dist/models/Stock.d.ts +1 -1
- package/dist/models/Stock.js +7 -12
- package/dist/models/UpdateProductRequest.d.ts +87 -0
- package/dist/models/UpdateProductRequest.js +65 -0
- package/dist/models/Variant.d.ts +1 -1
- package/dist/models/Variant.js +33 -36
- package/dist/models/VariantProduct.d.ts +1 -1
- package/dist/models/VariantProduct.js +9 -14
- package/dist/models/VariantsResponse.d.ts +1 -1
- package/dist/models/VariantsResponse.js +9 -14
- package/dist/models/index.d.ts +7 -5
- package/dist/models/index.js +7 -5
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
- package/src/apis/ProductsApi.ts +78 -1
- package/src/apis/VariantsApi.ts +1 -1
- package/src/models/ApiError.ts +10 -15
- package/src/models/Attribute.ts +14 -19
- package/src/models/AttributeThumbnail.ts +10 -15
- package/src/models/CreateProductRequest.ts +48 -45
- package/src/models/CreateProductRequestImagesInner.ts +60 -0
- package/src/models/CreateProductRequestSeoMetadata.ts +8 -13
- package/src/models/CreateProductRequestVariantsInner.ts +1 -1
- package/src/models/CreateProductRequestVariantsInnerApplicationsInner.ts +1 -1
- package/src/models/CreateProductRequestVariantsInnerAttributesInner.ts +1 -1
- package/src/models/CreateProductRequestVariantsInnerImagesInner.ts +1 -1
- package/src/models/CreateProductRequestVariantsInnerRetailPrice.ts +1 -1
- package/src/models/CreateProductVariant.ts +119 -0
- package/src/models/CreateProductVariantApplicationsInner.ts +103 -0
- package/src/models/CreateProductVariantAttributesInner.ts +70 -0
- package/src/models/CreateProductVariantRetailPrice.ts +70 -0
- package/src/models/Image.ts +20 -25
- package/src/models/ImportProducts200Response.ts +8 -13
- package/src/models/ModelFile.ts +60 -0
- package/src/models/Price.ts +10 -15
- package/src/models/Product.ts +31 -36
- package/src/models/ProductAdditionalFilesInner.ts +10 -15
- package/src/models/ProductsResponse.ts +10 -15
- package/src/models/SeoMetadata.ts +8 -13
- package/src/models/Stock.ts +8 -13
- package/src/models/UpdateProductRequest.ts +145 -0
- package/src/models/Variant.ts +32 -37
- package/src/models/VariantProduct.ts +10 -15
- package/src/models/VariantsResponse.ts +10 -15
- package/src/models/index.ts +7 -5
- package/src/runtime.ts +1 -1
package/src/models/Product.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
import type { Image } from './Image';
|
|
17
17
|
import {
|
|
18
18
|
ImageFromJSON,
|
|
@@ -128,11 +128,9 @@ export interface Product {
|
|
|
128
128
|
* Check if a given object implements the Product interface.
|
|
129
129
|
*/
|
|
130
130
|
export function instanceOfProduct(value: object): boolean {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return isInstance;
|
|
131
|
+
if (!('title' in value)) return false;
|
|
132
|
+
if (!('description' in value)) return false;
|
|
133
|
+
return true;
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
export function ProductFromJSON(json: any): Product {
|
|
@@ -140,48 +138,45 @@ export function ProductFromJSON(json: any): Product {
|
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
export function ProductFromJSONTyped(json: any, ignoreDiscriminator: boolean): Product {
|
|
143
|
-
if (
|
|
141
|
+
if (json == null) {
|
|
144
142
|
return json;
|
|
145
143
|
}
|
|
146
144
|
return {
|
|
147
145
|
|
|
148
|
-
'id':
|
|
149
|
-
'ref':
|
|
146
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
147
|
+
'ref': json['ref'] == null ? undefined : json['ref'],
|
|
150
148
|
'title': json['title'],
|
|
151
149
|
'description': json['description'],
|
|
152
|
-
'slug':
|
|
153
|
-
'seoMetadata':
|
|
154
|
-
'tags':
|
|
155
|
-
'createdAt':
|
|
156
|
-
'updatedAt':
|
|
157
|
-
'publishedAt':
|
|
158
|
-
'images':
|
|
159
|
-
'variants':
|
|
160
|
-
'additionalFiles':
|
|
150
|
+
'slug': json['slug'] == null ? undefined : json['slug'],
|
|
151
|
+
'seoMetadata': json['seoMetadata'] == null ? undefined : SeoMetadataFromJSON(json['seoMetadata']),
|
|
152
|
+
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
153
|
+
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
|
154
|
+
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
|
155
|
+
'publishedAt': json['publishedAt'] == null ? undefined : (new Date(json['publishedAt'])),
|
|
156
|
+
'images': json['images'] == null ? undefined : ((json['images'] as Array<any>).map(ImageFromJSON)),
|
|
157
|
+
'variants': json['variants'] == null ? undefined : ((json['variants'] as Array<any>).map(VariantFromJSON)),
|
|
158
|
+
'additionalFiles': json['additionalFiles'] == null ? undefined : ((json['additionalFiles'] as Array<any>).map(ProductAdditionalFilesInnerFromJSON)),
|
|
161
159
|
};
|
|
162
160
|
}
|
|
163
161
|
|
|
164
162
|
export function ProductToJSON(value?: Product | null): any {
|
|
165
|
-
if (value
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
if (value === null) {
|
|
169
|
-
return null;
|
|
163
|
+
if (value == null) {
|
|
164
|
+
return value;
|
|
170
165
|
}
|
|
171
166
|
return {
|
|
172
167
|
|
|
173
|
-
'id': value
|
|
174
|
-
'ref': value
|
|
175
|
-
'title': value
|
|
176
|
-
'description': value
|
|
177
|
-
'seoMetadata': SeoMetadataToJSON(value
|
|
178
|
-
'tags': value
|
|
179
|
-
'createdAt': value
|
|
180
|
-
'updatedAt': value
|
|
181
|
-
'publishedAt': value
|
|
182
|
-
'images': value
|
|
183
|
-
'variants': value
|
|
184
|
-
'additionalFiles': value
|
|
168
|
+
'id': value['id'],
|
|
169
|
+
'ref': value['ref'],
|
|
170
|
+
'title': value['title'],
|
|
171
|
+
'description': value['description'],
|
|
172
|
+
'seoMetadata': SeoMetadataToJSON(value['seoMetadata']),
|
|
173
|
+
'tags': value['tags'],
|
|
174
|
+
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
|
|
175
|
+
'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()),
|
|
176
|
+
'publishedAt': value['publishedAt'] == null ? undefined : ((value['publishedAt']).toISOString()),
|
|
177
|
+
'images': value['images'] == null ? undefined : ((value['images'] as Array<any>).map(ImageToJSON)),
|
|
178
|
+
'variants': value['variants'] == null ? undefined : ((value['variants'] as Array<any>).map(VariantToJSON)),
|
|
179
|
+
'additionalFiles': value['additionalFiles'] == null ? undefined : ((value['additionalFiles'] as Array<any>).map(ProductAdditionalFilesInnerToJSON)),
|
|
185
180
|
};
|
|
186
181
|
}
|
|
187
182
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @export
|
|
@@ -37,9 +37,7 @@ export interface ProductAdditionalFilesInner {
|
|
|
37
37
|
* Check if a given object implements the ProductAdditionalFilesInner interface.
|
|
38
38
|
*/
|
|
39
39
|
export function instanceOfProductAdditionalFilesInner(value: object): boolean {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return isInstance;
|
|
40
|
+
return true;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
export function ProductAdditionalFilesInnerFromJSON(json: any): ProductAdditionalFilesInner {
|
|
@@ -47,27 +45,24 @@ export function ProductAdditionalFilesInnerFromJSON(json: any): ProductAdditiona
|
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
export function ProductAdditionalFilesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductAdditionalFilesInner {
|
|
50
|
-
if (
|
|
48
|
+
if (json == null) {
|
|
51
49
|
return json;
|
|
52
50
|
}
|
|
53
51
|
return {
|
|
54
52
|
|
|
55
|
-
'id':
|
|
56
|
-
'src':
|
|
53
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
54
|
+
'src': json['src'] == null ? undefined : json['src'],
|
|
57
55
|
};
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
export function ProductAdditionalFilesInnerToJSON(value?: ProductAdditionalFilesInner | null): any {
|
|
61
|
-
if (value
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
if (value === null) {
|
|
65
|
-
return null;
|
|
59
|
+
if (value == null) {
|
|
60
|
+
return value;
|
|
66
61
|
}
|
|
67
62
|
return {
|
|
68
63
|
|
|
69
|
-
'id': value
|
|
70
|
-
'src': value
|
|
64
|
+
'id': value['id'],
|
|
65
|
+
'src': value['src'],
|
|
71
66
|
};
|
|
72
67
|
}
|
|
73
68
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
import type { Product } from './Product';
|
|
17
17
|
import {
|
|
18
18
|
ProductFromJSON,
|
|
@@ -44,9 +44,7 @@ export interface ProductsResponse {
|
|
|
44
44
|
* Check if a given object implements the ProductsResponse interface.
|
|
45
45
|
*/
|
|
46
46
|
export function instanceOfProductsResponse(value: object): boolean {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return isInstance;
|
|
47
|
+
return true;
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
export function ProductsResponseFromJSON(json: any): ProductsResponse {
|
|
@@ -54,27 +52,24 @@ export function ProductsResponseFromJSON(json: any): ProductsResponse {
|
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
export function ProductsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductsResponse {
|
|
57
|
-
if (
|
|
55
|
+
if (json == null) {
|
|
58
56
|
return json;
|
|
59
57
|
}
|
|
60
58
|
return {
|
|
61
59
|
|
|
62
|
-
'products':
|
|
63
|
-
'nextPageToken':
|
|
60
|
+
'products': json['products'] == null ? undefined : ((json['products'] as Array<any>).map(ProductFromJSON)),
|
|
61
|
+
'nextPageToken': json['nextPageToken'] == null ? undefined : json['nextPageToken'],
|
|
64
62
|
};
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
export function ProductsResponseToJSON(value?: ProductsResponse | null): any {
|
|
68
|
-
if (value
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
if (value === null) {
|
|
72
|
-
return null;
|
|
66
|
+
if (value == null) {
|
|
67
|
+
return value;
|
|
73
68
|
}
|
|
74
69
|
return {
|
|
75
70
|
|
|
76
|
-
'products': value
|
|
77
|
-
'nextPageToken': value
|
|
71
|
+
'products': value['products'] == null ? undefined : ((value['products'] as Array<any>).map(ProductToJSON)),
|
|
72
|
+
'nextPageToken': value['nextPageToken'],
|
|
78
73
|
};
|
|
79
74
|
}
|
|
80
75
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
17
|
* SEO metadata for the product
|
|
18
18
|
* @export
|
|
@@ -31,9 +31,7 @@ export interface SeoMetadata {
|
|
|
31
31
|
* Check if a given object implements the SeoMetadata interface.
|
|
32
32
|
*/
|
|
33
33
|
export function instanceOfSeoMetadata(value: object): boolean {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return isInstance;
|
|
34
|
+
return true;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
export function SeoMetadataFromJSON(json: any): SeoMetadata {
|
|
@@ -41,25 +39,22 @@ export function SeoMetadataFromJSON(json: any): SeoMetadata {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
export function SeoMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SeoMetadata {
|
|
44
|
-
if (
|
|
42
|
+
if (json == null) {
|
|
45
43
|
return json;
|
|
46
44
|
}
|
|
47
45
|
return {
|
|
48
46
|
|
|
49
|
-
'title':
|
|
47
|
+
'title': json['title'] == null ? undefined : json['title'],
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export function SeoMetadataToJSON(value?: SeoMetadata | null): any {
|
|
54
|
-
if (value
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
if (value === null) {
|
|
58
|
-
return null;
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
59
54
|
}
|
|
60
55
|
return {
|
|
61
56
|
|
|
62
|
-
'title': value
|
|
57
|
+
'title': value['title'],
|
|
63
58
|
};
|
|
64
59
|
}
|
|
65
60
|
|
package/src/models/Stock.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @export
|
|
@@ -31,9 +31,7 @@ export interface Stock {
|
|
|
31
31
|
* Check if a given object implements the Stock interface.
|
|
32
32
|
*/
|
|
33
33
|
export function instanceOfStock(value: object): boolean {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return isInstance;
|
|
34
|
+
return true;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
export function StockFromJSON(json: any): Stock {
|
|
@@ -41,25 +39,22 @@ export function StockFromJSON(json: any): Stock {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
export function StockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Stock {
|
|
44
|
-
if (
|
|
42
|
+
if (json == null) {
|
|
45
43
|
return json;
|
|
46
44
|
}
|
|
47
45
|
return {
|
|
48
46
|
|
|
49
|
-
'level':
|
|
47
|
+
'level': json['level'] == null ? undefined : json['level'],
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export function StockToJSON(value?: Stock | null): any {
|
|
54
|
-
if (value
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
if (value === null) {
|
|
58
|
-
return null;
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
59
54
|
}
|
|
60
55
|
return {
|
|
61
56
|
|
|
62
|
-
'level': value
|
|
57
|
+
'level': value['level'],
|
|
63
58
|
};
|
|
64
59
|
}
|
|
65
60
|
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { CreateProductRequestSeoMetadata } from './CreateProductRequestSeoMetadata';
|
|
17
|
+
import {
|
|
18
|
+
CreateProductRequestSeoMetadataFromJSON,
|
|
19
|
+
CreateProductRequestSeoMetadataFromJSONTyped,
|
|
20
|
+
CreateProductRequestSeoMetadataToJSON,
|
|
21
|
+
} from './CreateProductRequestSeoMetadata';
|
|
22
|
+
import type { CreateProductVariant } from './CreateProductVariant';
|
|
23
|
+
import {
|
|
24
|
+
CreateProductVariantFromJSON,
|
|
25
|
+
CreateProductVariantFromJSONTyped,
|
|
26
|
+
CreateProductVariantToJSON,
|
|
27
|
+
} from './CreateProductVariant';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @export
|
|
32
|
+
* @interface UpdateProductRequest
|
|
33
|
+
*/
|
|
34
|
+
export interface UpdateProductRequest {
|
|
35
|
+
/**
|
|
36
|
+
* Reference to the product in the GFN catalog that will be used as a base for this product. A list of available products for the given project can be obtained from the GFN Catalog API.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof UpdateProductRequest
|
|
39
|
+
*/
|
|
40
|
+
gfnProductRef?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Product title
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof UpdateProductRequest
|
|
45
|
+
*/
|
|
46
|
+
title?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Product description
|
|
49
|
+
* @type {string}
|
|
50
|
+
* @memberof UpdateProductRequest
|
|
51
|
+
*/
|
|
52
|
+
description?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the product is enabled upon creation.
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
* @memberof UpdateProductRequest
|
|
57
|
+
*/
|
|
58
|
+
enabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A custom URL slug for the product. This must be unique for each product on the project.
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof UpdateProductRequest
|
|
63
|
+
*/
|
|
64
|
+
slug?: string;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {CreateProductRequestSeoMetadata}
|
|
68
|
+
* @memberof UpdateProductRequest
|
|
69
|
+
*/
|
|
70
|
+
seoMetadata?: CreateProductRequestSeoMetadata;
|
|
71
|
+
/**
|
|
72
|
+
* Additional product tags used for searching and filtering.
|
|
73
|
+
* @type {Array<string>}
|
|
74
|
+
* @memberof UpdateProductRequest
|
|
75
|
+
*/
|
|
76
|
+
tags?: Array<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Variants
|
|
79
|
+
* @type {Array<CreateProductVariant>}
|
|
80
|
+
* @memberof UpdateProductRequest
|
|
81
|
+
*/
|
|
82
|
+
variants?: Array<CreateProductVariant>;
|
|
83
|
+
/**
|
|
84
|
+
* Images to attach to the product. For example, photos of models using/wearing the product.
|
|
85
|
+
* @type {Array<any>}
|
|
86
|
+
* @memberof UpdateProductRequest
|
|
87
|
+
*/
|
|
88
|
+
images?: Array<any>;
|
|
89
|
+
/**
|
|
90
|
+
* Additional files to attach to the product. For example, original design files e.g. PSD, AI, etc.
|
|
91
|
+
* @type {Array<any>}
|
|
92
|
+
* @memberof UpdateProductRequest
|
|
93
|
+
*/
|
|
94
|
+
additionalFiles?: Array<any>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Check if a given object implements the UpdateProductRequest interface.
|
|
99
|
+
*/
|
|
100
|
+
export function instanceOfUpdateProductRequest(value: object): boolean {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function UpdateProductRequestFromJSON(json: any): UpdateProductRequest {
|
|
105
|
+
return UpdateProductRequestFromJSONTyped(json, false);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function UpdateProductRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateProductRequest {
|
|
109
|
+
if (json == null) {
|
|
110
|
+
return json;
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
|
|
114
|
+
'gfnProductRef': json['gfnProductRef'] == null ? undefined : json['gfnProductRef'],
|
|
115
|
+
'title': json['title'] == null ? undefined : json['title'],
|
|
116
|
+
'description': json['description'] == null ? undefined : json['description'],
|
|
117
|
+
'enabled': json['enabled'] == null ? undefined : json['enabled'],
|
|
118
|
+
'slug': json['slug'] == null ? undefined : json['slug'],
|
|
119
|
+
'seoMetadata': json['seoMetadata'] == null ? undefined : CreateProductRequestSeoMetadataFromJSON(json['seoMetadata']),
|
|
120
|
+
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
121
|
+
'variants': json['variants'] == null ? undefined : ((json['variants'] as Array<any>).map(CreateProductVariantFromJSON)),
|
|
122
|
+
'images': json['images'] == null ? undefined : json['images'],
|
|
123
|
+
'additionalFiles': json['additionalFiles'] == null ? undefined : json['additionalFiles'],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function UpdateProductRequestToJSON(value?: UpdateProductRequest | null): any {
|
|
128
|
+
if (value == null) {
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
|
|
133
|
+
'gfnProductRef': value['gfnProductRef'],
|
|
134
|
+
'title': value['title'],
|
|
135
|
+
'description': value['description'],
|
|
136
|
+
'enabled': value['enabled'],
|
|
137
|
+
'slug': value['slug'],
|
|
138
|
+
'seoMetadata': CreateProductRequestSeoMetadataToJSON(value['seoMetadata']),
|
|
139
|
+
'tags': value['tags'],
|
|
140
|
+
'variants': value['variants'] == null ? undefined : ((value['variants'] as Array<any>).map(CreateProductVariantToJSON)),
|
|
141
|
+
'images': value['images'],
|
|
142
|
+
'additionalFiles': value['additionalFiles'],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
package/src/models/Variant.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Product Catalog API
|
|
5
5
|
* Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 1.
|
|
7
|
+
* The version of the OpenAPI document: 1.9.0
|
|
8
8
|
* Contact: hello@teemill.com
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
16
|
import type { Attribute } from './Attribute';
|
|
17
17
|
import {
|
|
18
18
|
AttributeFromJSON,
|
|
@@ -140,11 +140,9 @@ export interface Variant {
|
|
|
140
140
|
* Check if a given object implements the Variant interface.
|
|
141
141
|
*/
|
|
142
142
|
export function instanceOfVariant(value: object): boolean {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return isInstance;
|
|
143
|
+
if (!('attributes' in value)) return false;
|
|
144
|
+
if (!('sku' in value)) return false;
|
|
145
|
+
return true;
|
|
148
146
|
}
|
|
149
147
|
|
|
150
148
|
export function VariantFromJSON(json: any): Variant {
|
|
@@ -152,49 +150,46 @@ export function VariantFromJSON(json: any): Variant {
|
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
export function VariantFromJSONTyped(json: any, ignoreDiscriminator: boolean): Variant {
|
|
155
|
-
if (
|
|
153
|
+
if (json == null) {
|
|
156
154
|
return json;
|
|
157
155
|
}
|
|
158
156
|
return {
|
|
159
157
|
|
|
160
|
-
'id':
|
|
158
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
161
159
|
'attributes': ((json['attributes'] as Array<any>).map(AttributeFromJSON)),
|
|
162
160
|
'sku': json['sku'],
|
|
163
|
-
'ref':
|
|
164
|
-
'product':
|
|
165
|
-
'sortOrder':
|
|
166
|
-
'retailPrice':
|
|
167
|
-
'salePrice':
|
|
168
|
-
'price':
|
|
169
|
-
'stock':
|
|
170
|
-
'createdAt':
|
|
171
|
-
'updatedAt':
|
|
172
|
-
'publishedAt':
|
|
173
|
-
'images':
|
|
161
|
+
'ref': json['ref'] == null ? undefined : json['ref'],
|
|
162
|
+
'product': json['product'] == null ? undefined : VariantProductFromJSON(json['product']),
|
|
163
|
+
'sortOrder': json['sortOrder'] == null ? undefined : json['sortOrder'],
|
|
164
|
+
'retailPrice': json['retailPrice'] == null ? undefined : PriceFromJSON(json['retailPrice']),
|
|
165
|
+
'salePrice': json['salePrice'] == null ? undefined : PriceFromJSON(json['salePrice']),
|
|
166
|
+
'price': json['price'] == null ? undefined : PriceFromJSON(json['price']),
|
|
167
|
+
'stock': json['stock'] == null ? undefined : StockFromJSON(json['stock']),
|
|
168
|
+
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
|
169
|
+
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
|
170
|
+
'publishedAt': json['publishedAt'] == null ? undefined : (new Date(json['publishedAt'])),
|
|
171
|
+
'images': json['images'] == null ? undefined : ((json['images'] as Array<any>).map(ImageFromJSON)),
|
|
174
172
|
};
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
export function VariantToJSON(value?: Variant | null): any {
|
|
178
|
-
if (value
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
if (value === null) {
|
|
182
|
-
return null;
|
|
176
|
+
if (value == null) {
|
|
177
|
+
return value;
|
|
183
178
|
}
|
|
184
179
|
return {
|
|
185
180
|
|
|
186
|
-
'id': value
|
|
187
|
-
'attributes': ((value
|
|
188
|
-
'sku': value
|
|
189
|
-
'ref': value
|
|
190
|
-
'product': VariantProductToJSON(value
|
|
191
|
-
'retailPrice': PriceToJSON(value
|
|
192
|
-
'salePrice': PriceToJSON(value
|
|
193
|
-
'stock': StockToJSON(value
|
|
194
|
-
'createdAt': value
|
|
195
|
-
'updatedAt': value
|
|
196
|
-
'publishedAt': value
|
|
197
|
-
'images': value
|
|
181
|
+
'id': value['id'],
|
|
182
|
+
'attributes': ((value['attributes'] as Array<any>).map(AttributeToJSON)),
|
|
183
|
+
'sku': value['sku'],
|
|
184
|
+
'ref': value['ref'],
|
|
185
|
+
'product': VariantProductToJSON(value['product']),
|
|
186
|
+
'retailPrice': PriceToJSON(value['retailPrice']),
|
|
187
|
+
'salePrice': PriceToJSON(value['salePrice']),
|
|
188
|
+
'stock': StockToJSON(value['stock']),
|
|
189
|
+
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
|
|
190
|
+
'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()),
|
|
191
|
+
'publishedAt': value['publishedAt'] == null ? undefined : ((value['publishedAt']).toISOString()),
|
|
192
|
+
'images': value['images'] == null ? undefined : ((value['images'] as Array<any>).map(ImageToJSON)),
|
|
198
193
|
};
|
|
199
194
|
}
|
|
200
195
|
|