@longvansoftware/storefront-js-client 1.2.2 → 1.2.3

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.
@@ -8,3 +8,4 @@ export declare const GET_BRANDS_QUERY = "\nquery GetBrands($partnerId: String!,
8
8
  export declare const GET_BRANDS_BY_CATEGORY_QUERY = "\nquery GetBrandsByCategory($partnerId: String!, $storeChannel: String!, $categoryId: String!) {\n\tgetBrandsByCategory(partnerId: $partnerId, storeChannel: $storeChannel, categoryId: $categoryId) {\n\t\tid\n\t\tname\n\t\timage\n\t\timageIcon\n\t}\n}\n";
9
9
  export declare const GET_BRAND_DETAIL_QUERY = "\n query GetBrandDetail($partnerId: String!, $brandId: String!, $storeChannel: String!) {\n getDetail(partnerId: $partnerId, brandId: $brandId, storeChannel: $storeChannel) {\n id\n name\n image\n imageIcon\n }\n }\n";
10
10
  export declare const GET_PRODUCT_OPTION: import("graphql").DocumentNode;
11
+ export declare const GET_POLICY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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_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(
@@ -413,3 +413,12 @@ exports.GET_PRODUCT_OPTION = (0, graphql_tag_1.gql) `
413
413
  }
414
414
  }
415
415
  `;
416
+ exports.GET_POLICY = (0, graphql_tag_1.gql) `
417
+ query GetPolicy(
418
+ $groupId: String!
419
+ ) {
420
+ getPolicy(groupId: $groupId) {
421
+ value
422
+ }
423
+ }
424
+ `;
@@ -33,4 +33,5 @@ export declare class ProductService extends Service {
33
33
  */
34
34
  getSimpleProducts(variables: any): Promise<Product[] | null>;
35
35
  getProductOption(productId: string): Promise<any>;
36
+ getPolicy(groupId: string): Promise<any>;
36
37
  }
@@ -112,5 +112,21 @@ class ProductService extends service_1.Service {
112
112
  }
113
113
  });
114
114
  }
115
+ getPolicy(groupId) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const query = queries_1.GET_POLICY;
118
+ const variablesHandle = {
119
+ groupId
120
+ };
121
+ try {
122
+ const response = yield this.graphqlQuery(query, variablesHandle);
123
+ return response.getPolicy;
124
+ }
125
+ catch (error) {
126
+ console.log(`Error fetching getPolicy: ${error}`);
127
+ throw error;
128
+ }
129
+ });
130
+ }
115
131
  }
116
132
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [