@longvansoftware/storefront-js-client 3.5.2 → 3.5.4
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.
|
@@ -18,3 +18,4 @@ export declare const UPDATE_PRODUCT_VAT: import("graphql").DocumentNode;
|
|
|
18
18
|
export declare const CREATE_GROUP: import("graphql").DocumentNode;
|
|
19
19
|
export declare const CREATE_CATEGORY: import("graphql").DocumentNode;
|
|
20
20
|
export declare const CREATE_BRAND: import("graphql").DocumentNode;
|
|
21
|
+
export declare const CREATE_UNIT: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.CREATE_UNIT = 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(
|
|
@@ -169,6 +169,14 @@ exports.CREATE_PRODUCT_FROM_TEMPLATE = (0, graphql_tag_1.gql) `
|
|
|
169
169
|
price
|
|
170
170
|
displayPrice
|
|
171
171
|
hint
|
|
172
|
+
attributeDTOS {
|
|
173
|
+
id
|
|
174
|
+
key
|
|
175
|
+
value {
|
|
176
|
+
name
|
|
177
|
+
value
|
|
178
|
+
}
|
|
179
|
+
}
|
|
172
180
|
compareAtPrices
|
|
173
181
|
priceUnit
|
|
174
182
|
priceQuantity
|
|
@@ -237,7 +245,6 @@ exports.ADD_PRODUCT_ATTRIBUTE = (0, graphql_tag_1.gql) `
|
|
|
237
245
|
addProductAttribute(productId: $productId, key: $key, values: $values) {
|
|
238
246
|
id
|
|
239
247
|
key
|
|
240
|
-
extendFromSource
|
|
241
248
|
value {
|
|
242
249
|
name
|
|
243
250
|
value
|
|
@@ -257,11 +264,13 @@ exports.SAVE_PRODUCT_DRAFT = (0, graphql_tag_1.gql) `
|
|
|
257
264
|
mutation SaveProductDraft(
|
|
258
265
|
$partnerId: String!
|
|
259
266
|
$productId: String!
|
|
267
|
+
$productInputDTOS: [ProductInputDTOInput]
|
|
260
268
|
$storeId: String!
|
|
261
269
|
) {
|
|
262
270
|
saveProductDraft(
|
|
263
271
|
partnerId: $partnerId
|
|
264
272
|
productId: $productId
|
|
273
|
+
productInputDTOS: $productInputDTOS
|
|
265
274
|
storeId: $storeId
|
|
266
275
|
) {
|
|
267
276
|
status
|
|
@@ -300,7 +309,6 @@ exports.UPDATE_PRODUCT_ATTRIBUTE = (0, graphql_tag_1.gql) `
|
|
|
300
309
|
) {
|
|
301
310
|
id
|
|
302
311
|
key
|
|
303
|
-
extendFromSource
|
|
304
312
|
value {
|
|
305
313
|
name
|
|
306
314
|
value
|
|
@@ -330,32 +338,27 @@ exports.CREATE_PRODUCT_VARIANT = (0, graphql_tag_1.gql) `
|
|
|
330
338
|
$attributes: [AttributeDTOInput]
|
|
331
339
|
) {
|
|
332
340
|
createProductVariant(partnerId: $partnerId, attributes: $attributes) {
|
|
333
|
-
id
|
|
334
341
|
title
|
|
335
|
-
subType
|
|
336
|
-
description
|
|
337
342
|
sku
|
|
338
|
-
|
|
343
|
+
partyId
|
|
339
344
|
vat
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
salePolicy
|
|
350
|
-
priceTypeName
|
|
345
|
+
unit
|
|
346
|
+
version
|
|
347
|
+
status
|
|
348
|
+
display
|
|
349
|
+
qualify
|
|
350
|
+
subType
|
|
351
|
+
type
|
|
352
|
+
templateFor
|
|
353
|
+
isDraft
|
|
351
354
|
slug
|
|
352
|
-
supplierIds
|
|
353
355
|
categoryIds
|
|
354
356
|
productGroupIds
|
|
355
357
|
tagIds
|
|
356
358
|
featureIds
|
|
357
359
|
brandId
|
|
358
|
-
|
|
360
|
+
variant
|
|
361
|
+
parentId
|
|
359
362
|
}
|
|
360
363
|
}
|
|
361
364
|
`;
|
|
@@ -441,3 +444,11 @@ exports.CREATE_BRAND = (0, graphql_tag_1.gql) `
|
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
446
|
`;
|
|
447
|
+
exports.CREATE_UNIT = (0, graphql_tag_1.gql) `
|
|
448
|
+
mutation CreateUnit($partnerId: String!, $name: String!) {
|
|
449
|
+
createUnit(partnerId: $partnerId, name: $name) {
|
|
450
|
+
id
|
|
451
|
+
name
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
`;
|
|
@@ -56,7 +56,7 @@ export declare class ProductService extends Service {
|
|
|
56
56
|
getBrand(): Promise<any>;
|
|
57
57
|
getTags(): Promise<any>;
|
|
58
58
|
addProductAttribute(productId: string, key: string, values: [string]): Promise<any>;
|
|
59
|
-
saveProductDraft(productId: string): Promise<any>;
|
|
59
|
+
saveProductDraft(productId: string, productInputDTOS: [any]): Promise<any>;
|
|
60
60
|
updateProductBrand(productId: string, brandId: string, updatedBy: string): Promise<any>;
|
|
61
61
|
updateProductAttribute(productId: string, attributeId: string, key: string, values: [string]): Promise<any>;
|
|
62
62
|
removeProductAttribute(productId: string, key: string): Promise<any>;
|
|
@@ -65,5 +65,6 @@ export declare class ProductService extends Service {
|
|
|
65
65
|
updateProductVAT(productId: string, vat: number, updatedBy: string): Promise<any>;
|
|
66
66
|
createGroup(name: string, createdBy: string): Promise<any>;
|
|
67
67
|
createCategory(name: string, createdBy: string): Promise<any>;
|
|
68
|
-
createBrand(brandName: string,
|
|
68
|
+
createBrand(brandName: string, createdBy: string): Promise<any>;
|
|
69
|
+
createUnit(name: string): Promise<any>;
|
|
69
70
|
}
|
|
@@ -494,12 +494,13 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
saveProductDraft(productId) {
|
|
497
|
+
saveProductDraft(productId, productInputDTOS) {
|
|
498
498
|
return __awaiter(this, void 0, void 0, function* () {
|
|
499
499
|
const mutaion = mutations_1.SAVE_PRODUCT_DRAFT;
|
|
500
500
|
const variables = {
|
|
501
501
|
partnerId: this.orgId,
|
|
502
502
|
productId: productId,
|
|
503
|
+
productInputDTOS: productInputDTOS,
|
|
503
504
|
storeId: this.storeId,
|
|
504
505
|
};
|
|
505
506
|
try {
|
|
@@ -647,13 +648,13 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
647
648
|
}
|
|
648
649
|
});
|
|
649
650
|
}
|
|
650
|
-
createBrand(brandName,
|
|
651
|
+
createBrand(brandName, createdBy) {
|
|
651
652
|
return __awaiter(this, void 0, void 0, function* () {
|
|
652
653
|
const mutaion = mutations_1.CREATE_BRAND;
|
|
653
654
|
const variables = {
|
|
654
655
|
partnerId: this.orgId,
|
|
655
656
|
brandName,
|
|
656
|
-
|
|
657
|
+
createdBy,
|
|
657
658
|
};
|
|
658
659
|
try {
|
|
659
660
|
const response = yield this.graphqlMutation(mutaion, variables);
|
|
@@ -664,5 +665,21 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
664
665
|
}
|
|
665
666
|
});
|
|
666
667
|
}
|
|
668
|
+
createUnit(name) {
|
|
669
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
670
|
+
const mutation = mutations_1.CREATE_UNIT;
|
|
671
|
+
const variables = {
|
|
672
|
+
partnerId: this.orgId,
|
|
673
|
+
name
|
|
674
|
+
};
|
|
675
|
+
try {
|
|
676
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
677
|
+
return response.createUnit;
|
|
678
|
+
}
|
|
679
|
+
catch (error) {
|
|
680
|
+
throw error;
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
667
684
|
}
|
|
668
685
|
exports.ProductService = ProductService;
|