@longvansoftware/storefront-js-client 3.5.0 → 3.5.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.
- package/dist/src/graphql/product/mutations.d.ts +13 -0
- package/dist/src/graphql/product/mutations.js +339 -1
- package/dist/src/graphql/product/queries.d.ts +4 -0
- package/dist/src/graphql/product/queries.js +74 -1
- package/dist/src/lib/product/index.d.ts +17 -0
- package/dist/src/lib/product/index.js +282 -0
- package/package.json +1 -1
|
@@ -5,3 +5,16 @@ export declare const UPDATE_CATEGORY: import("graphql").DocumentNode;
|
|
|
5
5
|
export declare const UPDATE_SHORT_DESCRIPTION: import("graphql").DocumentNode;
|
|
6
6
|
export declare const UPDATE_UNIT: import("graphql").DocumentNode;
|
|
7
7
|
export declare const CLEAR_ALL_CACHES: import("graphql").DocumentNode;
|
|
8
|
+
export declare const CREATE_PRODUCT_TEMPLATES_BY_PARTNER: import("graphql").DocumentNode;
|
|
9
|
+
export declare const CREATE_PRODUCT_FROM_TEMPLATE: import("graphql").DocumentNode;
|
|
10
|
+
export declare const ADD_PRODUCT_ATTRIBUTE: import("graphql").DocumentNode;
|
|
11
|
+
export declare const SAVE_PRODUCT_DRAFT: import("graphql").DocumentNode;
|
|
12
|
+
export declare const UPDATE_PRODUCT_BRAND: import("graphql").DocumentNode;
|
|
13
|
+
export declare const UPDATE_PRODUCT_ATTRIBUTE: import("graphql").DocumentNode;
|
|
14
|
+
export declare const REMOVE_PRODUCT_ATTRIBUTE: import("graphql").DocumentNode;
|
|
15
|
+
export declare const CREATE_PRODUCT_VARIANT: import("graphql").DocumentNode;
|
|
16
|
+
export declare const UPDATE_PRODUCT_SKU: import("graphql").DocumentNode;
|
|
17
|
+
export declare const UPDATE_PRODUCT_VAT: import("graphql").DocumentNode;
|
|
18
|
+
export declare const CREATE_GROUP: import("graphql").DocumentNode;
|
|
19
|
+
export declare const CREATE_CATEGORY: import("graphql").DocumentNode;
|
|
20
|
+
export declare const CREATE_BRAND: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
|
|
3
|
+
exports.CREATE_BRAND = exports.CREATE_CATEGORY = exports.CREATE_GROUP = exports.UPDATE_PRODUCT_VAT = exports.UPDATE_PRODUCT_SKU = exports.CREATE_PRODUCT_VARIANT = exports.REMOVE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_BRAND = exports.SAVE_PRODUCT_DRAFT = exports.ADD_PRODUCT_ATTRIBUTE = exports.CREATE_PRODUCT_FROM_TEMPLATE = exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.UPDATE_PRODUCT_TITLE = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation UpdateProductTitle(
|
|
@@ -103,3 +103,341 @@ exports.CLEAR_ALL_CACHES = (0, graphql_tag_1.gql) `
|
|
|
103
103
|
clearAllCaches
|
|
104
104
|
}
|
|
105
105
|
`;
|
|
106
|
+
exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = (0, graphql_tag_1.gql) `
|
|
107
|
+
mutation CreateProductTemplatesByPartner($partnerId: String!) {
|
|
108
|
+
createProductTemplatesByPartner(partnerId: $partnerId) {
|
|
109
|
+
id
|
|
110
|
+
title
|
|
111
|
+
subType
|
|
112
|
+
description
|
|
113
|
+
sku
|
|
114
|
+
shortDescription
|
|
115
|
+
weight
|
|
116
|
+
width
|
|
117
|
+
depth
|
|
118
|
+
height
|
|
119
|
+
vat
|
|
120
|
+
qualify
|
|
121
|
+
parentId
|
|
122
|
+
handle
|
|
123
|
+
price
|
|
124
|
+
displayPrice
|
|
125
|
+
hint
|
|
126
|
+
compareAtPrices
|
|
127
|
+
priceUnit
|
|
128
|
+
priceQuantity
|
|
129
|
+
priceType
|
|
130
|
+
salePolicy
|
|
131
|
+
priceTypeName
|
|
132
|
+
priceVaries
|
|
133
|
+
available
|
|
134
|
+
tags
|
|
135
|
+
options
|
|
136
|
+
optionsRelationship
|
|
137
|
+
compareAtPrice
|
|
138
|
+
featuredImage
|
|
139
|
+
version
|
|
140
|
+
images
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
exports.CREATE_PRODUCT_FROM_TEMPLATE = (0, graphql_tag_1.gql) `
|
|
145
|
+
mutation CreateProductFromTemplate(
|
|
146
|
+
$partnerId: String!
|
|
147
|
+
$templateId: String
|
|
148
|
+
$createdBy: String!
|
|
149
|
+
) {
|
|
150
|
+
createProductFromTemplate(
|
|
151
|
+
partnerId: $partnerId
|
|
152
|
+
templateId: $templateId
|
|
153
|
+
createdBy: $createdBy
|
|
154
|
+
) {
|
|
155
|
+
id
|
|
156
|
+
title
|
|
157
|
+
subType
|
|
158
|
+
description
|
|
159
|
+
sku
|
|
160
|
+
shortDescription
|
|
161
|
+
weight
|
|
162
|
+
width
|
|
163
|
+
depth
|
|
164
|
+
height
|
|
165
|
+
vat
|
|
166
|
+
qualify
|
|
167
|
+
parentId
|
|
168
|
+
handle
|
|
169
|
+
price
|
|
170
|
+
displayPrice
|
|
171
|
+
hint
|
|
172
|
+
compareAtPrices
|
|
173
|
+
priceUnit
|
|
174
|
+
priceQuantity
|
|
175
|
+
priceType
|
|
176
|
+
salePolicy
|
|
177
|
+
priceTypeName
|
|
178
|
+
priceVaries
|
|
179
|
+
available
|
|
180
|
+
tags
|
|
181
|
+
options
|
|
182
|
+
optionsRelationship
|
|
183
|
+
compareAtPrice
|
|
184
|
+
featuredImage
|
|
185
|
+
version
|
|
186
|
+
images
|
|
187
|
+
variants {
|
|
188
|
+
id
|
|
189
|
+
handle
|
|
190
|
+
title
|
|
191
|
+
price
|
|
192
|
+
priceType
|
|
193
|
+
compareAtPrice
|
|
194
|
+
options
|
|
195
|
+
optionsIds
|
|
196
|
+
featuredImage
|
|
197
|
+
sku
|
|
198
|
+
}
|
|
199
|
+
featureTypes {
|
|
200
|
+
id
|
|
201
|
+
name
|
|
202
|
+
position
|
|
203
|
+
type
|
|
204
|
+
subType
|
|
205
|
+
fill
|
|
206
|
+
requireData
|
|
207
|
+
otherItem
|
|
208
|
+
values
|
|
209
|
+
createStamp
|
|
210
|
+
createdBy
|
|
211
|
+
}
|
|
212
|
+
categories {
|
|
213
|
+
id
|
|
214
|
+
title
|
|
215
|
+
image
|
|
216
|
+
icon
|
|
217
|
+
parentId
|
|
218
|
+
level
|
|
219
|
+
handle
|
|
220
|
+
description
|
|
221
|
+
}
|
|
222
|
+
groups {
|
|
223
|
+
id
|
|
224
|
+
name
|
|
225
|
+
policy
|
|
226
|
+
image
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
`;
|
|
231
|
+
exports.ADD_PRODUCT_ATTRIBUTE = (0, graphql_tag_1.gql) `
|
|
232
|
+
mutation AddProductAttribute(
|
|
233
|
+
$productId: String!
|
|
234
|
+
$key: String!
|
|
235
|
+
$values: [String]!
|
|
236
|
+
) {
|
|
237
|
+
addProductAttribute(productId: $productId, key: $key, values: $values) {
|
|
238
|
+
id
|
|
239
|
+
key
|
|
240
|
+
extendFromSource
|
|
241
|
+
value {
|
|
242
|
+
name
|
|
243
|
+
value
|
|
244
|
+
}
|
|
245
|
+
metadata {
|
|
246
|
+
type
|
|
247
|
+
dataFrom
|
|
248
|
+
description
|
|
249
|
+
requiredData
|
|
250
|
+
otherItem
|
|
251
|
+
fill
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
`;
|
|
256
|
+
exports.SAVE_PRODUCT_DRAFT = (0, graphql_tag_1.gql) `
|
|
257
|
+
mutation SaveProductDraft(
|
|
258
|
+
$partnerId: String!
|
|
259
|
+
$productId: String!
|
|
260
|
+
$storeId: String!
|
|
261
|
+
) {
|
|
262
|
+
saveProductDraft(
|
|
263
|
+
partnerId: $partnerId
|
|
264
|
+
productId: $productId
|
|
265
|
+
storeId: $storeId
|
|
266
|
+
) {
|
|
267
|
+
status
|
|
268
|
+
message
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
`;
|
|
272
|
+
exports.UPDATE_PRODUCT_BRAND = (0, graphql_tag_1.gql) `
|
|
273
|
+
mutation UpdateProductBrand(
|
|
274
|
+
$productId: String!
|
|
275
|
+
$brandId: String!
|
|
276
|
+
$updatedBy: String!
|
|
277
|
+
) {
|
|
278
|
+
updateProductBrand(
|
|
279
|
+
productId: $productId
|
|
280
|
+
brandId: $brandId
|
|
281
|
+
updatedBy: $updatedBy
|
|
282
|
+
) {
|
|
283
|
+
status
|
|
284
|
+
message
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
`;
|
|
288
|
+
exports.UPDATE_PRODUCT_ATTRIBUTE = (0, graphql_tag_1.gql) `
|
|
289
|
+
mutation UpdateProductAttribute(
|
|
290
|
+
$productId: String!
|
|
291
|
+
$attributeId: String!
|
|
292
|
+
$key: String!
|
|
293
|
+
$values: [String]!
|
|
294
|
+
) {
|
|
295
|
+
updateProductAttribute(
|
|
296
|
+
productId: $productId
|
|
297
|
+
attributeId: $attributeId
|
|
298
|
+
key: $key
|
|
299
|
+
values: $values
|
|
300
|
+
) {
|
|
301
|
+
id
|
|
302
|
+
key
|
|
303
|
+
extendFromSource
|
|
304
|
+
value {
|
|
305
|
+
name
|
|
306
|
+
value
|
|
307
|
+
}
|
|
308
|
+
metadata {
|
|
309
|
+
type
|
|
310
|
+
dataFrom
|
|
311
|
+
description
|
|
312
|
+
requiredData
|
|
313
|
+
otherItem
|
|
314
|
+
fill
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
exports.REMOVE_PRODUCT_ATTRIBUTE = (0, graphql_tag_1.gql) `
|
|
320
|
+
mutation RemoveProductAttribute($productId: String!, $key: String!) {
|
|
321
|
+
removeProductAttribute(productId: $productId, key: $key) {
|
|
322
|
+
status
|
|
323
|
+
message
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
`;
|
|
327
|
+
exports.CREATE_PRODUCT_VARIANT = (0, graphql_tag_1.gql) `
|
|
328
|
+
mutation CreateProductVariant(
|
|
329
|
+
$partnerId: String!
|
|
330
|
+
$attributes: [AttributeDTOInput]
|
|
331
|
+
) {
|
|
332
|
+
createProductVariant(partnerId: $partnerId, attributes: $attributes) {
|
|
333
|
+
id
|
|
334
|
+
title
|
|
335
|
+
subType
|
|
336
|
+
description
|
|
337
|
+
sku
|
|
338
|
+
shortDescription
|
|
339
|
+
vat
|
|
340
|
+
parentId
|
|
341
|
+
handle
|
|
342
|
+
price
|
|
343
|
+
displayPrice
|
|
344
|
+
hint
|
|
345
|
+
compareAtPrices
|
|
346
|
+
priceUnit
|
|
347
|
+
priceQuantity
|
|
348
|
+
priceType
|
|
349
|
+
salePolicy
|
|
350
|
+
priceTypeName
|
|
351
|
+
slug
|
|
352
|
+
supplierIds
|
|
353
|
+
categoryIds
|
|
354
|
+
productGroupIds
|
|
355
|
+
tagIds
|
|
356
|
+
featureIds
|
|
357
|
+
brandId
|
|
358
|
+
unit
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
`;
|
|
362
|
+
exports.UPDATE_PRODUCT_SKU = (0, graphql_tag_1.gql) `
|
|
363
|
+
mutation UpdateProductSKU(
|
|
364
|
+
$partnerId: String!
|
|
365
|
+
$productId: String!
|
|
366
|
+
$sku: String!
|
|
367
|
+
$updatedBy: String!
|
|
368
|
+
) {
|
|
369
|
+
updateProductSKU(
|
|
370
|
+
partnerId: $partnerId
|
|
371
|
+
productId: $productId
|
|
372
|
+
sku: $sku
|
|
373
|
+
updatedBy: $updatedBy
|
|
374
|
+
) {
|
|
375
|
+
status
|
|
376
|
+
message
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
`;
|
|
380
|
+
exports.UPDATE_PRODUCT_VAT = (0, graphql_tag_1.gql) `
|
|
381
|
+
mutation UpdateProductVAT(
|
|
382
|
+
$productId: String!
|
|
383
|
+
$vat: BigDecimal!
|
|
384
|
+
$updatedBy: String!
|
|
385
|
+
) {
|
|
386
|
+
updateProductVAT(productId: $productId, vat: $vat, updatedBy: $updatedBy) {
|
|
387
|
+
status
|
|
388
|
+
message
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
`;
|
|
392
|
+
exports.CREATE_GROUP = (0, graphql_tag_1.gql) `
|
|
393
|
+
mutation CreateGroup(
|
|
394
|
+
$partnerId: String!
|
|
395
|
+
$name: String!
|
|
396
|
+
$createdBy: String!
|
|
397
|
+
) {
|
|
398
|
+
createGroup(partnerId: $partnerId, name: $name, createdBy: $createdBy) {
|
|
399
|
+
id
|
|
400
|
+
name
|
|
401
|
+
policy
|
|
402
|
+
image
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
`;
|
|
406
|
+
exports.CREATE_CATEGORY = (0, graphql_tag_1.gql) `
|
|
407
|
+
mutation CreateCategory(
|
|
408
|
+
$partnerId: String!
|
|
409
|
+
$name: String!
|
|
410
|
+
$createdBy: String!
|
|
411
|
+
) {
|
|
412
|
+
createCategory(partnerId: $partnerId, name: $name, createdBy: $createdBy) {
|
|
413
|
+
id
|
|
414
|
+
title
|
|
415
|
+
image
|
|
416
|
+
icon
|
|
417
|
+
parentId
|
|
418
|
+
level
|
|
419
|
+
handle
|
|
420
|
+
description
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
`;
|
|
424
|
+
exports.CREATE_BRAND = (0, graphql_tag_1.gql) `
|
|
425
|
+
mutation CreateBrand(
|
|
426
|
+
$partnerId: String!
|
|
427
|
+
$brandName: String!
|
|
428
|
+
$createdBy: String!
|
|
429
|
+
) {
|
|
430
|
+
createBrand(
|
|
431
|
+
partnerId: $partnerId
|
|
432
|
+
brandName: $brandName
|
|
433
|
+
createdBy: $createdBy
|
|
434
|
+
) {
|
|
435
|
+
id
|
|
436
|
+
createStamp
|
|
437
|
+
createdBy
|
|
438
|
+
name
|
|
439
|
+
image
|
|
440
|
+
imageIcon
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
`;
|
|
@@ -15,3 +15,7 @@ export declare const GET_PRODUCT_IMAGE: import("graphql").DocumentNode;
|
|
|
15
15
|
export declare const GET_PRODUCT: import("graphql").DocumentNode;
|
|
16
16
|
export declare const GET_UNITS: import("graphql").DocumentNode;
|
|
17
17
|
export declare const GET_PRODUCT_VARIANT_BY_ID: import("graphql").DocumentNode;
|
|
18
|
+
export declare const GET_PRODUCT_TEMPLATES: import("graphql").DocumentNode;
|
|
19
|
+
export declare const GET_GROUPS: import("graphql").DocumentNode;
|
|
20
|
+
export declare const GET_BRAND: import("graphql").DocumentNode;
|
|
21
|
+
export declare const GET_TAGS: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
3
|
+
exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
|
6
6
|
// query GetProductById(
|
|
@@ -620,3 +620,76 @@ exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
`;
|
|
623
|
+
exports.GET_PRODUCT_TEMPLATES = (0, graphql_tag_1.gql) `
|
|
624
|
+
query GetProductTemplates($partnerId: String!, $groupId: String!) {
|
|
625
|
+
getProductTemplates(partnerId: $partnerId, groupId: $groupId) {
|
|
626
|
+
id
|
|
627
|
+
title
|
|
628
|
+
subType
|
|
629
|
+
description
|
|
630
|
+
sku
|
|
631
|
+
shortDescription
|
|
632
|
+
weight
|
|
633
|
+
width
|
|
634
|
+
depth
|
|
635
|
+
height
|
|
636
|
+
vat
|
|
637
|
+
qualify
|
|
638
|
+
parentId
|
|
639
|
+
handle
|
|
640
|
+
price
|
|
641
|
+
displayPrice
|
|
642
|
+
hint
|
|
643
|
+
compareAtPrices
|
|
644
|
+
priceUnit
|
|
645
|
+
priceQuantity
|
|
646
|
+
priceType
|
|
647
|
+
salePolicy
|
|
648
|
+
priceTypeName
|
|
649
|
+
priceVaries
|
|
650
|
+
available
|
|
651
|
+
tags
|
|
652
|
+
options
|
|
653
|
+
optionsRelationship
|
|
654
|
+
compareAtPrice
|
|
655
|
+
featuredImage
|
|
656
|
+
version
|
|
657
|
+
images
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
`;
|
|
661
|
+
exports.GET_GROUPS = (0, graphql_tag_1.gql) `
|
|
662
|
+
query GetGroups($partnerId: String!, $storeChannel: String!) {
|
|
663
|
+
getGroups(partnerId: $partnerId, storeChannel: $storeChannel) {
|
|
664
|
+
id
|
|
665
|
+
name
|
|
666
|
+
policy
|
|
667
|
+
image
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
`;
|
|
671
|
+
exports.GET_BRAND = (0, graphql_tag_1.gql) `
|
|
672
|
+
query GetBrands($partnerId: String!) {
|
|
673
|
+
getBrands(partnerId: $partnerId) {
|
|
674
|
+
id
|
|
675
|
+
createStamp
|
|
676
|
+
createdBy
|
|
677
|
+
name
|
|
678
|
+
image
|
|
679
|
+
imageIcon
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
`;
|
|
683
|
+
exports.GET_TAGS = (0, graphql_tag_1.gql) `
|
|
684
|
+
query GetTags($partnerId: String!, $storeChannel: String!) {
|
|
685
|
+
getTags(partnerId: $partnerId, storeChannel: $storeChannel) {
|
|
686
|
+
id
|
|
687
|
+
name
|
|
688
|
+
slug
|
|
689
|
+
type
|
|
690
|
+
scope
|
|
691
|
+
storeIds
|
|
692
|
+
selected
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
`;
|
|
@@ -49,4 +49,21 @@ export declare class ProductService extends Service {
|
|
|
49
49
|
getUnits(): Promise<any>;
|
|
50
50
|
clearAllCaches(): Promise<any>;
|
|
51
51
|
getProductVariantById(variantId: string): Promise<any>;
|
|
52
|
+
createProductTemplatesByPartner(): Promise<any>;
|
|
53
|
+
createProductFromTemplate(templateId: string, createdBy: string): Promise<any>;
|
|
54
|
+
getProductTemplates(groupId: string): Promise<any>;
|
|
55
|
+
getGroups(): Promise<any>;
|
|
56
|
+
getBrand(): Promise<any>;
|
|
57
|
+
getTags(): Promise<any>;
|
|
58
|
+
addProductAttribute(productId: string, key: string, values: [string]): Promise<any>;
|
|
59
|
+
saveProductDraft(productId: string): Promise<any>;
|
|
60
|
+
updateProductBrand(productId: string, brandId: string, updatedBy: string): Promise<any>;
|
|
61
|
+
updateProductAttribute(productId: string, attributeId: string, key: string, values: [string]): Promise<any>;
|
|
62
|
+
removeProductAttribute(productId: string, key: string): Promise<any>;
|
|
63
|
+
createProductVariant(attributes: [any]): Promise<any>;
|
|
64
|
+
updateProductSKU(productId: string, sku: string, updatedBy: string): Promise<any>;
|
|
65
|
+
updateProductVAT(productId: string, vat: number, updatedBy: string): Promise<any>;
|
|
66
|
+
createGroup(name: string, createdBy: string): Promise<any>;
|
|
67
|
+
createCategory(name: string, createdBy: string): Promise<any>;
|
|
68
|
+
createBrand(brandName: string, createBy: string): Promise<any>;
|
|
52
69
|
}
|
|
@@ -382,5 +382,287 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
+
createProductTemplatesByPartner() {
|
|
386
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
+
const mutation = mutations_1.CREATE_PRODUCT_TEMPLATES_BY_PARTNER;
|
|
388
|
+
const variables = {
|
|
389
|
+
partnerId: this.orgId,
|
|
390
|
+
};
|
|
391
|
+
try {
|
|
392
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
393
|
+
return response.createProductTemplatesByPartner;
|
|
394
|
+
}
|
|
395
|
+
catch (error) {
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
createProductFromTemplate(templateId, createdBy) {
|
|
401
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
+
const mutaion = mutations_1.CREATE_PRODUCT_FROM_TEMPLATE;
|
|
403
|
+
const variables = {
|
|
404
|
+
partnerId: this.orgId,
|
|
405
|
+
templateId,
|
|
406
|
+
createdBy,
|
|
407
|
+
};
|
|
408
|
+
try {
|
|
409
|
+
const response = yield this.graphqlMutation(mutaion, variables);
|
|
410
|
+
return response.createProductFromTemplate;
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
throw error;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
getProductTemplates(groupId) {
|
|
418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
419
|
+
const query = queries_1.GET_PRODUCT_TEMPLATES;
|
|
420
|
+
const variables = {
|
|
421
|
+
partnerId: this.orgId,
|
|
422
|
+
groupId: groupId,
|
|
423
|
+
};
|
|
424
|
+
try {
|
|
425
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
426
|
+
return response.getProductTemplates;
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
throw error;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
getGroups() {
|
|
434
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
+
const query = queries_1.GET_GROUPS;
|
|
436
|
+
const variables = {
|
|
437
|
+
partnerId: this.orgId,
|
|
438
|
+
storeChannel: this.storeId,
|
|
439
|
+
};
|
|
440
|
+
try {
|
|
441
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
442
|
+
return response.getGroups;
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
throw error;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
getBrand() {
|
|
450
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
451
|
+
const query = queries_1.GET_BRAND;
|
|
452
|
+
const variables = {
|
|
453
|
+
partnerId: this.orgId,
|
|
454
|
+
};
|
|
455
|
+
try {
|
|
456
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
457
|
+
return response.getBrands;
|
|
458
|
+
}
|
|
459
|
+
catch (error) {
|
|
460
|
+
throw error;
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
getTags() {
|
|
465
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
466
|
+
const query = queries_1.GET_TAGS;
|
|
467
|
+
const variables = {
|
|
468
|
+
partnerId: this.orgId,
|
|
469
|
+
storeChannel: this.storeId,
|
|
470
|
+
};
|
|
471
|
+
try {
|
|
472
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
473
|
+
return response.getTags;
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
throw error;
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
addProductAttribute(productId, key, values) {
|
|
481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
+
const mutaion = mutations_1.ADD_PRODUCT_ATTRIBUTE;
|
|
483
|
+
const variables = {
|
|
484
|
+
productId,
|
|
485
|
+
key,
|
|
486
|
+
values,
|
|
487
|
+
};
|
|
488
|
+
try {
|
|
489
|
+
const response = yield this.graphqlMutation(mutaion, variables);
|
|
490
|
+
return response.addProductAttribute;
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
throw error;
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
saveProductDraft(productId) {
|
|
498
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
+
const mutaion = mutations_1.SAVE_PRODUCT_DRAFT;
|
|
500
|
+
const variables = {
|
|
501
|
+
partnerId: this.orgId,
|
|
502
|
+
productId: productId,
|
|
503
|
+
storeId: this.storeId,
|
|
504
|
+
};
|
|
505
|
+
try {
|
|
506
|
+
const response = yield this.graphqlMutation(mutaion, variables);
|
|
507
|
+
return response.saveProductDraft;
|
|
508
|
+
}
|
|
509
|
+
catch (error) {
|
|
510
|
+
throw error;
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
updateProductBrand(productId, brandId, updatedBy) {
|
|
515
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
516
|
+
const mutation = mutations_1.UPDATE_PRODUCT_BRAND;
|
|
517
|
+
const variables = {
|
|
518
|
+
productId,
|
|
519
|
+
brandId,
|
|
520
|
+
updatedBy,
|
|
521
|
+
};
|
|
522
|
+
try {
|
|
523
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
524
|
+
return response.updateProductBrand;
|
|
525
|
+
}
|
|
526
|
+
catch (error) {
|
|
527
|
+
throw error;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
updateProductAttribute(productId, attributeId, key, values) {
|
|
532
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
+
const mutation = mutations_1.UPDATE_PRODUCT_ATTRIBUTE;
|
|
534
|
+
const variables = {
|
|
535
|
+
productId,
|
|
536
|
+
attributeId,
|
|
537
|
+
key,
|
|
538
|
+
values,
|
|
539
|
+
};
|
|
540
|
+
try {
|
|
541
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
542
|
+
return response.updateProductAttribute;
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
throw error;
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
removeProductAttribute(productId, key) {
|
|
550
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
551
|
+
const mutation = mutations_1.REMOVE_PRODUCT_ATTRIBUTE;
|
|
552
|
+
const variables = {
|
|
553
|
+
productId,
|
|
554
|
+
key,
|
|
555
|
+
};
|
|
556
|
+
try {
|
|
557
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
558
|
+
return response.removeProductAttribute;
|
|
559
|
+
}
|
|
560
|
+
catch (error) {
|
|
561
|
+
throw error;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
createProductVariant(attributes) {
|
|
566
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
567
|
+
const mutation = mutations_1.CREATE_PRODUCT_VARIANT;
|
|
568
|
+
const variables = {
|
|
569
|
+
partnerId: this.orgId,
|
|
570
|
+
attributes,
|
|
571
|
+
};
|
|
572
|
+
try {
|
|
573
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
574
|
+
return response.createProductVariant;
|
|
575
|
+
}
|
|
576
|
+
catch (error) {
|
|
577
|
+
throw error;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
updateProductSKU(productId, sku, updatedBy) {
|
|
582
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
583
|
+
const mutation = mutations_1.UPDATE_PRODUCT_SKU;
|
|
584
|
+
const variables = {
|
|
585
|
+
partnerId: this.orgId,
|
|
586
|
+
productId,
|
|
587
|
+
sku,
|
|
588
|
+
updatedBy,
|
|
589
|
+
};
|
|
590
|
+
try {
|
|
591
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
592
|
+
return response.updateProductSKU;
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
throw error;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
updateProductVAT(productId, vat, updatedBy) {
|
|
600
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
601
|
+
const mutation = mutations_1.UPDATE_PRODUCT_VAT;
|
|
602
|
+
const variables = {
|
|
603
|
+
productId,
|
|
604
|
+
vat,
|
|
605
|
+
updatedBy,
|
|
606
|
+
};
|
|
607
|
+
try {
|
|
608
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
609
|
+
return response.updateProductVAT;
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
throw error;
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
createGroup(name, createdBy) {
|
|
617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
618
|
+
const mutaion = mutations_1.CREATE_GROUP;
|
|
619
|
+
const variables = {
|
|
620
|
+
partnerId: this.orgId,
|
|
621
|
+
name,
|
|
622
|
+
createdBy,
|
|
623
|
+
};
|
|
624
|
+
try {
|
|
625
|
+
const response = yield this.graphqlMutation(mutaion, variables);
|
|
626
|
+
return response.createGroup;
|
|
627
|
+
}
|
|
628
|
+
catch (error) {
|
|
629
|
+
throw error;
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
createCategory(name, createdBy) {
|
|
634
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
635
|
+
const mutation = mutations_1.CREATE_CATEGORY;
|
|
636
|
+
const variables = {
|
|
637
|
+
partnerId: this.orgId,
|
|
638
|
+
name,
|
|
639
|
+
createdBy,
|
|
640
|
+
};
|
|
641
|
+
try {
|
|
642
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
643
|
+
return response.createCategory;
|
|
644
|
+
}
|
|
645
|
+
catch (error) {
|
|
646
|
+
throw error;
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
createBrand(brandName, createBy) {
|
|
651
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
652
|
+
const mutaion = mutations_1.CREATE_BRAND;
|
|
653
|
+
const variables = {
|
|
654
|
+
partnerId: this.orgId,
|
|
655
|
+
brandName,
|
|
656
|
+
createBy,
|
|
657
|
+
};
|
|
658
|
+
try {
|
|
659
|
+
const response = yield this.graphqlMutation(mutaion, variables);
|
|
660
|
+
return response.createBrand;
|
|
661
|
+
}
|
|
662
|
+
catch (error) {
|
|
663
|
+
throw error;
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
}
|
|
385
667
|
}
|
|
386
668
|
exports.ProductService = ProductService;
|