@longvansoftware/service-js-client 1.4.1 → 1.4.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.
@@ -26,7 +26,7 @@ class SDK {
26
26
  this.storefrontAccessToken = storefrontAccessToken;
27
27
  this.environment = environment;
28
28
  this.token = null;
29
- //console.log("🚀 ~ SDK ~ environment:", environment);
29
+ console.log("🚀 ~ SDK ~ storeId:", storeId);
30
30
  (0, helpers_1.validateStorefrontAccessToken)(storefrontAccessToken);
31
31
  const endpoints = environment == "live"
32
32
  ? config_1.environmentEndpoints.live
@@ -34,7 +34,7 @@ export declare class ProductService extends Service {
34
34
  getSimpleProducts(variables: any): Promise<Product[] | null>;
35
35
  getProductOption(productId: string): Promise<any>;
36
36
  getPolicy(groupId: string): Promise<any>;
37
- getProducts(param: getProduct): Promise<any>;
37
+ getProducts(param: getProduct, store: string): Promise<any>;
38
38
  getHandleByServiceTypes(serviceTypes: [string]): Promise<any>;
39
39
  getResourceByProduct(productId: string): Promise<any>;
40
40
  getProductVariantById(variantId: string): Promise<any>;
@@ -128,10 +128,10 @@ class ProductService extends serviceSDK_1.Service {
128
128
  }
129
129
  });
130
130
  }
131
- getProducts(param) {
131
+ getProducts(param, store) {
132
132
  return __awaiter(this, void 0, void 0, function* () {
133
133
  const query = queries_1.GET_PRODUCTS;
134
- const variablesHandle = Object.assign({ partnerId: this.orgId, storeChannel: this.storeId }, param);
134
+ const variablesHandle = Object.assign({ partnerId: this.orgId, storeChannel: store ? store : this.storeId }, param);
135
135
  try {
136
136
  const response = yield this.graphqlQueryV2(query, variablesHandle);
137
137
  return response.getProducts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [