@longvansoftware/storefront-js-client 1.6.7 → 1.6.8

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.
@@ -10,7 +10,7 @@ exports.environmentEndpoints = {
10
10
  user: "https://user.dev.longvan.vn/user-gateway/graphql",
11
11
  payment: "https://portal.dev.longvan.vn/invoice-gateway/graphql",
12
12
  service: "https://portal.dev.longvan.vn/service-api/graphql",
13
- warehouse: "https://portal.dev.longvan.vn/facility-api/public-facility/1.0.0",
13
+ warehouse: "https://portal.dev.longvan.vn/facility-api/public-facility/1.0.0/inventory-item",
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",
@@ -24,7 +24,7 @@ exports.environmentEndpoints = {
24
24
  user: "https://user.longvan.vn/user-gateway/graphql",
25
25
  payment: "https://portal.longvan.vn/invoice-gateway/graphql",
26
26
  service: "https://portal.longvan.vn/service-api/graphql",
27
- warehouse: "https://portal.longvan.vn/facility-api/public-facility/1.0.0",
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",
@@ -1 +1,2 @@
1
1
  export declare const PAYMENTS_BY_ORDERS: import("graphql").DocumentNode;
2
+ export declare const PAYMENT_METHODS: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PAYMENTS_BY_ORDERS = void 0;
3
+ exports.PAYMENT_METHODS = exports.PAYMENTS_BY_ORDERS = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.PAYMENTS_BY_ORDERS = (0, graphql_tag_1.gql) `
6
6
  query PaymentsByOrders($orderIds: [String!]!) {
@@ -37,3 +37,14 @@ exports.PAYMENTS_BY_ORDERS = (0, graphql_tag_1.gql) `
37
37
  }
38
38
  }
39
39
  `;
40
+ exports.PAYMENT_METHODS = (0, graphql_tag_1.gql) `
41
+ query PaymentMethods($partnerCode: String) {
42
+ paymentMethods(partnerCode: $partnerCode) {
43
+ id
44
+ code
45
+ name
46
+ description
47
+ image
48
+ }
49
+ }
50
+ `;
@@ -3,4 +3,5 @@ export declare class PaymentServiceV2 extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  paymentsByOrders(orderIds: [string]): Promise<any>;
5
5
  cancelPayment(paymentId: string, reason: string): Promise<any>;
6
+ paymentMethods(): Promise<any>;
6
7
  }
@@ -48,5 +48,20 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
48
48
  }
49
49
  });
50
50
  }
51
+ paymentMethods() {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const query = queries_1.PAYMENT_METHODS;
54
+ const variables = {
55
+ partnerCode: this.orgId
56
+ };
57
+ try {
58
+ const response = yield this.graphqlQueryV3(query, variables);
59
+ return response.paymentMethods;
60
+ }
61
+ catch (error) {
62
+ throw error;
63
+ }
64
+ });
65
+ }
51
66
  }
52
67
  exports.PaymentServiceV2 = PaymentServiceV2;
@@ -1,4 +1,3 @@
1
- import { ListProduct } from "../../types/warehouse";
2
1
  import { Service } from "../serviceSDK";
3
2
  export declare class WarehouseService extends Service {
4
3
  /**
@@ -16,5 +15,5 @@ export declare class WarehouseService extends Service {
16
15
  * @returns A promise that resolves with the created order.
17
16
  * @throws If an error occurs while creating the order.
18
17
  */
19
- getInventory(warehouseId: string, listProduct: ListProduct[]): Promise<any>;
18
+ getInventory(sku: string, warehouseId: string): Promise<any>;
20
19
  }
@@ -31,12 +31,12 @@ class WarehouseService extends serviceSDK_1.Service {
31
31
  * @returns A promise that resolves with the created order.
32
32
  * @throws If an error occurs while creating the order.
33
33
  */
34
- getInventory(warehouseId, listProduct) {
34
+ getInventory(sku, warehouseId) {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- const endpoint = `/product-inventory/${warehouseId}`;
37
- const method = "POST";
36
+ const endpoint = `/${sku}/${warehouseId}`;
37
+ const method = "GET";
38
38
  try {
39
- const response = yield this.restApiCallWithNoToken(endpoint, method, listProduct);
39
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
40
40
  return response;
41
41
  }
42
42
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [