@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.
- package/dist/config/config.js +2 -2
- package/dist/src/graphql/paymentV2/queries.d.ts +1 -0
- package/dist/src/graphql/paymentV2/queries.js +12 -1
- package/dist/src/lib/paymentV2/index.d.ts +1 -0
- package/dist/src/lib/paymentV2/index.js +15 -0
- package/dist/src/lib/warehouse/index.d.ts +1 -2
- package/dist/src/lib/warehouse/index.js +4 -4
- package/package.json +1 -1
package/dist/config/config.js
CHANGED
|
@@ -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,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(
|
|
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(
|
|
34
|
+
getInventory(sku, warehouseId) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const endpoint =
|
|
37
|
-
const method = "
|
|
36
|
+
const endpoint = `/${sku}/${warehouseId}`;
|
|
37
|
+
const method = "GET";
|
|
38
38
|
try {
|
|
39
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method
|
|
39
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
40
40
|
return response;
|
|
41
41
|
}
|
|
42
42
|
catch (error) {
|