@longvansoftware/storefront-js-client 4.5.0 → 4.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.
@@ -1 +1,2 @@
1
1
  export declare const UPDATE_DESCRIPTION: import("graphql").DocumentNode;
2
+ export declare const UPDATE_SERVICE_RESOURCE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPDATE_DESCRIPTION = void 0;
3
+ exports.UPDATE_SERVICE_RESOURCE = exports.UPDATE_DESCRIPTION = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.UPDATE_DESCRIPTION = (0, graphql_tag_1.gql) `
6
6
  mutation UpdateDescription(
@@ -15,3 +15,22 @@ exports.UPDATE_DESCRIPTION = (0, graphql_tag_1.gql) `
15
15
  )
16
16
  }
17
17
  `;
18
+ exports.UPDATE_SERVICE_RESOURCE = (0, graphql_tag_1.gql) `
19
+ mutation UpdateServiceResource(
20
+ $serviceId: String!
21
+ $keyId: String!
22
+ $name: String
23
+ $value: String
24
+ $unit: String
25
+ $actorId: String!
26
+ ) {
27
+ updateServiceResource(
28
+ serviceId: $serviceId
29
+ keyId: $keyId
30
+ name: $name
31
+ value: $value
32
+ unit: $unit
33
+ actorId: $actorId
34
+ )
35
+ }
36
+ `;
@@ -28,3 +28,6 @@ export declare const CREATE_PRODUCT: import("graphql").DocumentNode;
28
28
  export declare const REMOVE_PRODUCT: import("graphql").DocumentNode;
29
29
  export declare const UPDATE_PRODUCT_SUBTYPE: import("graphql").DocumentNode;
30
30
  export declare const UPDATE_ATTRIBUTE_METADATA: import("graphql").DocumentNode;
31
+ export declare const CREATE_TAG: import("graphql").DocumentNode;
32
+ export declare const ADD_PRODUCT_TAG: import("graphql").DocumentNode;
33
+ export declare const REMOVE_PRODUCT_TAG: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPDATE_ATTRIBUTE_METADATA = exports.UPDATE_PRODUCT_SUBTYPE = 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;
3
+ exports.REMOVE_PRODUCT_TAG = exports.ADD_PRODUCT_TAG = exports.CREATE_TAG = exports.UPDATE_ATTRIBUTE_METADATA = exports.UPDATE_PRODUCT_SUBTYPE = 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(
@@ -701,3 +701,54 @@ exports.UPDATE_ATTRIBUTE_METADATA = (0, graphql_tag_1.gql) `
701
701
  }
702
702
  }
703
703
  `;
704
+ exports.CREATE_TAG = (0, graphql_tag_1.gql) `
705
+ mutation CreateTag(
706
+ $partnerId: String!
707
+ $name: String!
708
+ $slug: String!
709
+ $createdBy: String!
710
+ ) {
711
+ createTag(
712
+ partnerId: $partnerId
713
+ name: $name
714
+ slug: $slug
715
+ createdBy: $createdBy
716
+ ) {
717
+ id
718
+ name
719
+ slug
720
+ type
721
+ scope
722
+ storeIds
723
+ selected
724
+ }
725
+ }
726
+ `;
727
+ exports.ADD_PRODUCT_TAG = (0, graphql_tag_1.gql) `
728
+ mutation AddProductTag(
729
+ $productId: String!
730
+ $tagId: String!
731
+ $updatedBy: String!
732
+ ) {
733
+ addProductTag(productId: $productId, tagId: $tagId, updatedBy: $updatedBy) {
734
+ status
735
+ message
736
+ }
737
+ }
738
+ `;
739
+ exports.REMOVE_PRODUCT_TAG = (0, graphql_tag_1.gql) `
740
+ mutation RemoveProductTag(
741
+ $productId: String!
742
+ $tagId: String!
743
+ $updatedBy: String!
744
+ ) {
745
+ removeProductTag(
746
+ productId: $productId
747
+ tagId: $tagId
748
+ updatedBy: $updatedBy
749
+ ) {
750
+ status
751
+ message
752
+ }
753
+ }
754
+ `;
@@ -23,3 +23,4 @@ export declare const GET_TAGS: import("graphql").DocumentNode;
23
23
  export declare const GET_PRODUCT_BY_GROUPID: import("graphql").DocumentNode;
24
24
  export declare const GET_CATEGORY_BY_ID: import("graphql").DocumentNode;
25
25
  export declare const GET_CATEGORY_BY_HANDLE: import("graphql").DocumentNode;
26
+ export declare const GET_TAGS_BY_PRODUCT: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = 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_SIMPLE_PRODUCT_BY_ID_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
3
+ exports.GET_TAGS_BY_PRODUCT = exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = 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_SIMPLE_PRODUCT_BY_ID_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(
@@ -120,7 +120,15 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
120
120
  compareAtPrice
121
121
  featuredImage
122
122
  images
123
- tags
123
+ tags {
124
+ id
125
+ name
126
+ slug
127
+ type
128
+ scope
129
+ storeIds
130
+ selected
131
+ }
124
132
  brand {
125
133
  id
126
134
  createStamp
@@ -241,7 +249,15 @@ exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
241
249
  compareAtPrice
242
250
  featuredImage
243
251
  images
244
- tags
252
+ tags {
253
+ id
254
+ name
255
+ slug
256
+ type
257
+ scope
258
+ storeIds
259
+ selected
260
+ }
245
261
  version
246
262
  brand {
247
263
  id
@@ -376,7 +392,15 @@ exports.GET_PRODUCT_BY_SLUG_QUERY = (0, graphql_tag_1.gql) `
376
392
  priceTypeName
377
393
  priceVaries
378
394
  available
379
- tags
395
+ tags {
396
+ id
397
+ name
398
+ slug
399
+ type
400
+ scope
401
+ storeIds
402
+ selected
403
+ }
380
404
  options
381
405
  optionsRelationship
382
406
  compareAtPrice
@@ -487,7 +511,7 @@ exports.GET_SIMPLE_PRODUCTS_QUERY = (0, graphql_tag_1.gql) `
487
511
  onlyPromotion: $onlyPromotion
488
512
  currentPage: $currentPage
489
513
  maxResult: $maxResult
490
- feature:$feature
514
+ feature: $feature
491
515
  ) {
492
516
  total
493
517
  currentPage
@@ -787,7 +811,15 @@ exports.GET_PRODUCT = (0, graphql_tag_1.gql) `
787
811
  priceTypeName
788
812
  priceVaries
789
813
  available
790
- tags
814
+ tags {
815
+ id
816
+ name
817
+ slug
818
+ type
819
+ scope
820
+ storeIds
821
+ selected
822
+ }
791
823
  options
792
824
  optionsRelationship
793
825
  compareAtPrice
@@ -861,7 +893,7 @@ exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
861
893
  priceTypeName
862
894
  priceVaries
863
895
  available
864
- tags
896
+
865
897
  options
866
898
  optionsRelationship
867
899
  compareAtPrice
@@ -896,7 +928,6 @@ exports.GET_PRODUCT_TEMPLATES = (0, graphql_tag_1.gql) `
896
928
  priceTypeName
897
929
  priceVaries
898
930
  available
899
- tags
900
931
  options
901
932
  optionsRelationship
902
933
  compareAtPrice
@@ -982,7 +1013,15 @@ exports.GET_PRODUCT_BY_GROUPID = (0, graphql_tag_1.gql) `
982
1013
  priceTypeName
983
1014
  priceVaries
984
1015
  available
985
- tags
1016
+ tags {
1017
+ id
1018
+ name
1019
+ slug
1020
+ type
1021
+ scope
1022
+ storeIds
1023
+ selected
1024
+ }
986
1025
  options
987
1026
  optionsRelationship
988
1027
  compareAtPrice
@@ -1112,3 +1151,24 @@ exports.GET_CATEGORY_BY_HANDLE = (0, graphql_tag_1.gql) `
1112
1151
  }
1113
1152
  }
1114
1153
  `;
1154
+ exports.GET_TAGS_BY_PRODUCT = (0, graphql_tag_1.gql) `
1155
+ query GetTagsByProduct(
1156
+ $partnerId: String!
1157
+ $storeChannel: String!
1158
+ $productId: String!
1159
+ ) {
1160
+ getTagsByProduct(
1161
+ partnerId: $partnerId
1162
+ storeChannel: $storeChannel
1163
+ productId: $productId
1164
+ ) {
1165
+ id
1166
+ name
1167
+ slug
1168
+ type
1169
+ scope
1170
+ storeIds
1171
+ selected
1172
+ }
1173
+ }
1174
+ `;
@@ -6,4 +6,5 @@ export declare class CloudCloudService extends Service {
6
6
  updateDescription(serviceId: string, description: string, updatedBy: string): Promise<any>;
7
7
  searchServiceByPhone(phone: string, serviceScope: string): Promise<any>;
8
8
  getListLabService(productId: string): Promise<any>;
9
+ updateServiceResource(data: Record<string, any>): Promise<any>;
9
10
  }
@@ -95,5 +95,17 @@ class CloudCloudService extends serviceSDK_1.Service {
95
95
  }
96
96
  });
97
97
  }
98
+ updateServiceResource(data) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ const mutation = mutations_1.UPDATE_SERVICE_RESOURCE;
101
+ try {
102
+ const response = yield this.graphqlMutationV2(mutation, data);
103
+ return response.updateServiceResource;
104
+ }
105
+ catch (error) {
106
+ throw error;
107
+ }
108
+ });
109
+ }
98
110
  }
99
111
  exports.CloudCloudService = CloudCloudService;
@@ -81,4 +81,8 @@ export declare class ProductService extends Service {
81
81
  getCategoryById(categoryId: string): Promise<any>;
82
82
  getCategoryByHandle(handle: string): Promise<any>;
83
83
  updateAttributeMetadata(productId: string, attributeId: string, attributeMetadata: any): Promise<any>;
84
+ createTag(dataTag: any): Promise<any>;
85
+ addProductTag(dataTag: any): Promise<any>;
86
+ removeProductTag(dataTag: any): Promise<any>;
87
+ getTagsByProduct(productId: string): Promise<any>;
84
88
  }
@@ -913,5 +913,59 @@ class ProductService extends serviceSDK_1.Service {
913
913
  }
914
914
  });
915
915
  }
916
+ createTag(dataTag) {
917
+ return __awaiter(this, void 0, void 0, function* () {
918
+ const mutation = mutations_1.CREATE_TAG;
919
+ const variables = Object.assign({ partnerId: this.orgId }, dataTag);
920
+ try {
921
+ const response = yield this.graphqlMutation(mutation, variables);
922
+ return response.createTag;
923
+ }
924
+ catch (error) {
925
+ throw error;
926
+ }
927
+ });
928
+ }
929
+ addProductTag(dataTag) {
930
+ return __awaiter(this, void 0, void 0, function* () {
931
+ const mutation = mutations_1.ADD_PRODUCT_TAG;
932
+ try {
933
+ const response = yield this.graphqlMutation(mutation, dataTag);
934
+ return response.addProductTag;
935
+ }
936
+ catch (error) {
937
+ throw error;
938
+ }
939
+ });
940
+ }
941
+ removeProductTag(dataTag) {
942
+ return __awaiter(this, void 0, void 0, function* () {
943
+ const mutation = mutations_1.REMOVE_PRODUCT_TAG;
944
+ try {
945
+ const response = yield this.graphqlMutation(mutation, dataTag);
946
+ return response.removeProductTag;
947
+ }
948
+ catch (error) {
949
+ throw error;
950
+ }
951
+ });
952
+ }
953
+ getTagsByProduct(productId) {
954
+ return __awaiter(this, void 0, void 0, function* () {
955
+ const queries = queries_1.GET_TAGS_BY_PRODUCT;
956
+ const variables = {
957
+ partnerId: this.orgId,
958
+ storeChannel: this.storeId,
959
+ productId,
960
+ };
961
+ try {
962
+ const response = yield this.graphqlQuery(queries, variables);
963
+ return response.getTagsByProduct;
964
+ }
965
+ catch (error) {
966
+ throw error;
967
+ }
968
+ });
969
+ }
916
970
  }
917
971
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [