@longvansoftware/storefront-js-client 3.7.8 → 3.8.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.
|
@@ -23,3 +23,6 @@ export declare const CREATE_PRODUCT_IMAGES: import("graphql").DocumentNode;
|
|
|
23
23
|
export declare const BUILD_PRODUCT_PREBUILD_BY_PRODUCT: import("graphql").DocumentNode;
|
|
24
24
|
export declare const BUILD_PRODUCT_PREBUILD_BY_STORE: import("graphql").DocumentNode;
|
|
25
25
|
export declare const REMOVE_PRODUCT_IMAGES: import("graphql").DocumentNode;
|
|
26
|
+
export declare const REMOVE_IMAGE: import("graphql").DocumentNode;
|
|
27
|
+
export declare const CREATE_PRODUCT: import("graphql").DocumentNode;
|
|
28
|
+
export declare const REMOVE_PRODUCT: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_PRODUCT_IMAGES = exports.BUILD_PRODUCT_PREBUILD_BY_STORE = exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = exports.CREATE_PRODUCT_IMAGES = 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;
|
|
3
|
+
exports.REMOVE_PRODUCT = exports.CREATE_PRODUCT = exports.REMOVE_IMAGE = exports.REMOVE_PRODUCT_IMAGES = exports.BUILD_PRODUCT_PREBUILD_BY_STORE = exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = exports.CREATE_PRODUCT_IMAGES = 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(
|
|
@@ -585,3 +585,93 @@ exports.REMOVE_PRODUCT_IMAGES = (0, graphql_tag_1.gql) `
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
`;
|
|
588
|
+
exports.REMOVE_IMAGE = (0, graphql_tag_1.gql) `
|
|
589
|
+
mutation RemoveImage($partnerId: String!, $productId: String!) {
|
|
590
|
+
removeImage(partnerId: $partnerId, productId: $productId) {
|
|
591
|
+
status
|
|
592
|
+
message
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
`;
|
|
596
|
+
exports.CREATE_PRODUCT = (0, graphql_tag_1.gql) `
|
|
597
|
+
mutation CreateProduct(
|
|
598
|
+
$partnerId: String!
|
|
599
|
+
$productInputDTO: ProductInputDTOInput
|
|
600
|
+
) {
|
|
601
|
+
createProduct(partnerId: $partnerId, productInputDTO: $productInputDTO) {
|
|
602
|
+
id
|
|
603
|
+
title
|
|
604
|
+
subType
|
|
605
|
+
description
|
|
606
|
+
sku
|
|
607
|
+
brand {
|
|
608
|
+
id
|
|
609
|
+
createStamp
|
|
610
|
+
createdBy
|
|
611
|
+
name
|
|
612
|
+
image
|
|
613
|
+
imageIcon
|
|
614
|
+
}
|
|
615
|
+
shortDescription
|
|
616
|
+
weight
|
|
617
|
+
width
|
|
618
|
+
depth
|
|
619
|
+
height
|
|
620
|
+
vat
|
|
621
|
+
unitDTO {
|
|
622
|
+
id
|
|
623
|
+
name
|
|
624
|
+
}
|
|
625
|
+
productAttributes {
|
|
626
|
+
attributeName
|
|
627
|
+
attributeValue
|
|
628
|
+
}
|
|
629
|
+
attributeDTOS {
|
|
630
|
+
id
|
|
631
|
+
key
|
|
632
|
+
extendFromSource
|
|
633
|
+
}
|
|
634
|
+
qualify
|
|
635
|
+
parentId
|
|
636
|
+
handle
|
|
637
|
+
price
|
|
638
|
+
displayPrice
|
|
639
|
+
hint
|
|
640
|
+
compareAtPrices
|
|
641
|
+
priceUnit
|
|
642
|
+
priceQuantity
|
|
643
|
+
priceType
|
|
644
|
+
salePolicy
|
|
645
|
+
priceTypeName
|
|
646
|
+
priceVaries
|
|
647
|
+
available
|
|
648
|
+
tags
|
|
649
|
+
options
|
|
650
|
+
optionsRelationship
|
|
651
|
+
compareAtPrice
|
|
652
|
+
featuredImage
|
|
653
|
+
version
|
|
654
|
+
images
|
|
655
|
+
variants {
|
|
656
|
+
id
|
|
657
|
+
handle
|
|
658
|
+
title
|
|
659
|
+
price
|
|
660
|
+
priceType
|
|
661
|
+
compareAtPrice
|
|
662
|
+
options
|
|
663
|
+
optionsIds
|
|
664
|
+
featuredImage
|
|
665
|
+
sku
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
`;
|
|
670
|
+
exports.REMOVE_PRODUCT = (0, graphql_tag_1.gql) `
|
|
671
|
+
mutation RemoveProduct($partnerId: String!, $productId: String!) {
|
|
672
|
+
removeProduct(partnerId: $partnerId, productId: $productId) {
|
|
673
|
+
status
|
|
674
|
+
message
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
`;
|
|
@@ -773,6 +773,61 @@ exports.GET_PRODUCT_BY_GROUPID = (0, graphql_tag_1.gql) `
|
|
|
773
773
|
featuredImage
|
|
774
774
|
version
|
|
775
775
|
images
|
|
776
|
+
unitDTO {
|
|
777
|
+
id
|
|
778
|
+
name
|
|
779
|
+
}
|
|
780
|
+
productAttributes {
|
|
781
|
+
attributeName
|
|
782
|
+
attributeValue
|
|
783
|
+
}
|
|
784
|
+
attributeDTOS {
|
|
785
|
+
id
|
|
786
|
+
key
|
|
787
|
+
extendFromSource
|
|
788
|
+
}
|
|
789
|
+
variants {
|
|
790
|
+
id
|
|
791
|
+
handle
|
|
792
|
+
title
|
|
793
|
+
price
|
|
794
|
+
priceType
|
|
795
|
+
compareAtPrice
|
|
796
|
+
options
|
|
797
|
+
optionsIds
|
|
798
|
+
featuredImage
|
|
799
|
+
sku
|
|
800
|
+
}
|
|
801
|
+
featureTypes {
|
|
802
|
+
id
|
|
803
|
+
name
|
|
804
|
+
position
|
|
805
|
+
type
|
|
806
|
+
subType
|
|
807
|
+
fill
|
|
808
|
+
requireData
|
|
809
|
+
otherItem
|
|
810
|
+
values
|
|
811
|
+
description
|
|
812
|
+
createStamp
|
|
813
|
+
createdBy
|
|
814
|
+
}
|
|
815
|
+
categories {
|
|
816
|
+
id
|
|
817
|
+
title
|
|
818
|
+
image
|
|
819
|
+
icon
|
|
820
|
+
parentId
|
|
821
|
+
level
|
|
822
|
+
handle
|
|
823
|
+
description
|
|
824
|
+
}
|
|
825
|
+
groups {
|
|
826
|
+
id
|
|
827
|
+
name
|
|
828
|
+
policy
|
|
829
|
+
image
|
|
830
|
+
}
|
|
776
831
|
}
|
|
777
832
|
}
|
|
778
833
|
}
|
|
@@ -72,4 +72,7 @@ export declare class ProductService extends Service {
|
|
|
72
72
|
buildProductPreBuildByProduct(productId: string): Promise<any>;
|
|
73
73
|
buildProductPreBuildByStore(storeIds: [string]): Promise<any>;
|
|
74
74
|
getProductByGroup(storeChannel: string, group: string): Promise<any>;
|
|
75
|
+
RemoveImage(productId: string): Promise<any>;
|
|
76
|
+
CreateProduct(productInputDTO: any): Promise<void>;
|
|
77
|
+
RemoveProduct(productId: string): Promise<any>;
|
|
75
78
|
}
|
|
@@ -754,7 +754,7 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
754
754
|
const variables = {
|
|
755
755
|
partnerId: this.orgId,
|
|
756
756
|
storeChannel,
|
|
757
|
-
group
|
|
757
|
+
group,
|
|
758
758
|
};
|
|
759
759
|
try {
|
|
760
760
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -765,5 +765,52 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
765
765
|
}
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
+
RemoveImage(productId) {
|
|
769
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
770
|
+
const mutation = mutations_1.REMOVE_IMAGE;
|
|
771
|
+
const variables = {
|
|
772
|
+
partnerId: this.orgId,
|
|
773
|
+
productId: productId,
|
|
774
|
+
};
|
|
775
|
+
try {
|
|
776
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
777
|
+
return response.removeImage;
|
|
778
|
+
}
|
|
779
|
+
catch (error) {
|
|
780
|
+
throw error;
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
CreateProduct(productInputDTO) {
|
|
785
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
786
|
+
const mutation = mutations_1.CREATE_PRODUCT;
|
|
787
|
+
const variables = {
|
|
788
|
+
partnerId: this.orgId,
|
|
789
|
+
productInputDTO,
|
|
790
|
+
};
|
|
791
|
+
try {
|
|
792
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
793
|
+
}
|
|
794
|
+
catch (error) {
|
|
795
|
+
throw error;
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
RemoveProduct(productId) {
|
|
800
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
801
|
+
const mutation = mutations_1.REMOVE_PRODUCT;
|
|
802
|
+
const variables = {
|
|
803
|
+
partnerId: this.orgId,
|
|
804
|
+
productId,
|
|
805
|
+
};
|
|
806
|
+
try {
|
|
807
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
808
|
+
return response;
|
|
809
|
+
}
|
|
810
|
+
catch (error) {
|
|
811
|
+
throw error;
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
}
|
|
768
815
|
}
|
|
769
816
|
exports.ProductService = ProductService;
|