@longvansoftware/service-js-client 1.13.4 → 1.13.6

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.
@@ -79,6 +79,10 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
79
79
  }
80
80
  type
81
81
  }
82
+ remainTotal {
83
+ amount
84
+ currencyCode
85
+ }
82
86
  }
83
87
  lineItems {
84
88
  orderLineItem {
@@ -21,3 +21,4 @@ export declare const GET_DETAIL_STORES: DocumentNode;
21
21
  export declare const GET_LIST_PRICE: DocumentNode;
22
22
  export declare const GET_TAGS: DocumentNode;
23
23
  export declare const GET_TAGS_BY_CATEGORY: DocumentNode;
24
+ export declare const GET_LIST_PRODUCTS_CONFIG_DYNAMIC: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = 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_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
3
+ exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = 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_DYNAMIC = 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(
@@ -997,3 +997,23 @@ exports.GET_TAGS_BY_CATEGORY = (0, graphql_tag_1.gql) `
997
997
  }
998
998
  }
999
999
  `;
1000
+ const GET_LIST_PRODUCTS_CONFIG_DYNAMIC = (fields = []) => {
1001
+ const fieldStr = fields.join("\n ");
1002
+ const hasFields = fields.length > 0;
1003
+ return (0, graphql_tag_1.gql) `
1004
+ query getListProductConfig(
1005
+ $partnerId: String!
1006
+ $storeChannel: String!
1007
+ $productId: String!
1008
+ ) {
1009
+ getListProductConfig(
1010
+ partnerId: $partnerId
1011
+ storeChannel: $storeChannel
1012
+ productId: $productId
1013
+ ) {
1014
+ ${hasFields ? `${fieldStr}` : ""}
1015
+ }
1016
+ }
1017
+ `;
1018
+ };
1019
+ exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = GET_LIST_PRODUCTS_CONFIG_DYNAMIC;
@@ -48,4 +48,5 @@ export declare class ProductService extends Service {
48
48
  getListPrice(productIds: string[], storeId: string): Promise<any>;
49
49
  getTags(storeId: string): Promise<any>;
50
50
  getTagsByCategory(categoryId: string, storeId: string): Promise<any>;
51
+ getListProductConfigDynamic(productId: string, store: string, fields: string[]): Promise<any>;
51
52
  }
@@ -317,5 +317,23 @@ class ProductService extends serviceSDK_1.Service {
317
317
  }
318
318
  });
319
319
  }
320
+ getListProductConfigDynamic(productId, store, fields) {
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ const query = (0, queries_1.GET_LIST_PRODUCTS_CONFIG_DYNAMIC)(fields);
323
+ const variablesHandle = {
324
+ partnerId: this.orgId,
325
+ storeChannel: store ? store : this.storeId,
326
+ productId,
327
+ };
328
+ try {
329
+ const response = yield this.graphqlQueryV2(query, variablesHandle);
330
+ return response.getListProductConfig;
331
+ }
332
+ catch (error) {
333
+ console.log(`Error fetching getListProductConfig : ${error}`);
334
+ throw error;
335
+ }
336
+ });
337
+ }
320
338
  }
321
339
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.13.4",
3
+ "version": "1.13.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [