@longvansoftware/storefront-js-client 1.6.9 → 1.7.1

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.
@@ -14,7 +14,7 @@ exports.environmentEndpoints = {
14
14
  computing: "https://api-gateway.dev.longvan.vn/computing-service/graphql",
15
15
  campaign: "https://crm.dev.longvan.vn/campaign-gateway/graphql",
16
16
  image: "https://product-service.dev.longvan.vn/product-service/v1/products",
17
- paymentV2: "https://payment.dev.longvan.vn/graphql"
17
+ paymentV2: "https://payment.dev.longvan.vn/graphql",
18
18
  },
19
19
  live: {
20
20
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -22,12 +22,12 @@ exports.environmentEndpoints = {
22
22
  auth: "https://crm.longvan.vn/authorization-gateway/graphql",
23
23
  order: "https://storefront.longvan.vn/v2",
24
24
  user: "https://user.longvan.vn/user-gateway/graphql",
25
- payment: "https://portal.longvan.vn/invoice-gateway/graphql",
25
+ payment: "https://portal-staging.longvan.vn/invoice-gateway/graphql",
26
26
  service: "https://portal.longvan.vn/service-api/graphql",
27
27
  warehouse: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/inventory-item",
28
28
  computing: "https://api-gateway.longvan.vn/computing-service/graphql",
29
29
  campaign: "https://crm.longvan.vn/campaign-gateway/graphql",
30
30
  image: "https://product-service.dev.longvan.vn/product-service/v1/products",
31
- paymentV2: "https://payment.dev.longvan.vn/graphql"
31
+ paymentV2: "https://payment-staging.longvan.vn/graphql",
32
32
  },
33
33
  };
@@ -44,4 +44,5 @@ export declare class SDK {
44
44
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
45
45
  setToken(token: string): void;
46
46
  setStoreId(storeId: string): void;
47
+ setOrgId(orgId: string): void;
47
48
  }
@@ -68,5 +68,18 @@ class SDK {
68
68
  this.paymentV2.setStoreId(storeId);
69
69
  // Set storeId for other services here
70
70
  }
71
+ setOrgId(orgId) {
72
+ this.orgId = orgId;
73
+ this.product.setOrgId(orgId);
74
+ this.auth.setOrgId(orgId);
75
+ this.order.setOrgId(orgId);
76
+ this.user.setOrgId(orgId);
77
+ this.payment.setOrgId(orgId);
78
+ this.crm.setOrgId(orgId);
79
+ this.service.setOrgId(orgId);
80
+ this.warehouse.setOrgId(orgId);
81
+ this.image.setOrgId(orgId);
82
+ this.paymentV2.setOrgId(orgId);
83
+ }
71
84
  }
72
85
  exports.SDK = SDK;
@@ -9,6 +9,7 @@ export declare class Service {
9
9
  constructor(endpoint: string, orgId: string, storeId: string);
10
10
  setToken(token: string): void;
11
11
  setStoreId(storeId: string): void;
12
+ setOrgId(orgId: string): void;
12
13
  protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
13
14
  protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
14
15
  protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
@@ -40,6 +40,9 @@ class Service {
40
40
  setStoreId(storeId) {
41
41
  this.storeId = storeId;
42
42
  }
43
+ setOrgId(orgId) {
44
+ this.orgId = orgId;
45
+ }
43
46
  graphqlQuery(query, variables) {
44
47
  return __awaiter(this, void 0, void 0, function* () {
45
48
  try {
@@ -195,7 +198,7 @@ class Service {
195
198
  method: "POST",
196
199
  headers: {
197
200
  "Content-Type": "application/json",
198
- // PartnerId: this.orgId, -> payment bị thừa partnerId -> lỗi
201
+ // PartnerId: this.orgId, -> payment bị thừa partnerId -> lỗi
199
202
  Authorization: "Bearer " + this.token,
200
203
  },
201
204
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.6.9",
3
+ "version": "1.7.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [