@longvansoftware/storefront-js-client 1.8.2 → 1.8.3
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.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const environmentEndpoints: {
|
|
|
14
14
|
paymentV2: string;
|
|
15
15
|
warehouseV2: string;
|
|
16
16
|
deepLinkVietQr: string;
|
|
17
|
+
shareZalo: string;
|
|
17
18
|
};
|
|
18
19
|
live: {
|
|
19
20
|
product: string;
|
|
@@ -30,5 +31,6 @@ export declare const environmentEndpoints: {
|
|
|
30
31
|
paymentV2: string;
|
|
31
32
|
warehouseV2: string;
|
|
32
33
|
deepLinkVietQr: string;
|
|
34
|
+
shareZalo: string;
|
|
33
35
|
};
|
|
34
36
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.environmentEndpoints = {
|
|
|
17
17
|
paymentV2: "https://payment.dev.longvan.vn/graphql",
|
|
18
18
|
warehouseV2: "https://portal.dev.longvan.vn/facility-api",
|
|
19
19
|
deepLinkVietQr: "https://api.vietqr.io/v2",
|
|
20
|
+
shareZalo: "https://com-hub.longvan.vn/com-hub/v1/web-hook/zalo/zns/62661ed100adf430d79fb9e5"
|
|
20
21
|
},
|
|
21
22
|
live: {
|
|
22
23
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -33,5 +34,6 @@ exports.environmentEndpoints = {
|
|
|
33
34
|
paymentV2: "https://payment-staging.longvan.vn/graphql",
|
|
34
35
|
warehouseV2: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/product-inventory",
|
|
35
36
|
deepLinkVietQr: "https://api.vietqr.io/v2",
|
|
37
|
+
shareZalo: "https://com-hub.longvan.vn/com-hub/v1/web-hook/zalo/zns/62661ed100adf430d79fb9e5"
|
|
36
38
|
},
|
|
37
39
|
};
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { ImageService } from "./image";
|
|
|
12
12
|
import { PaymentServiceV2 } from "./paymentV2";
|
|
13
13
|
import { WarehouseServiceV2 } from "./warehouseV2";
|
|
14
14
|
import { DeepLinkVietQrService } from "./deepLinkVietQr";
|
|
15
|
+
import { ShareZaloService } from "./shareZalo";
|
|
15
16
|
export interface Endpoints {
|
|
16
17
|
product: string;
|
|
17
18
|
crm: string;
|
|
@@ -27,6 +28,7 @@ export interface Endpoints {
|
|
|
27
28
|
paymentV2: string;
|
|
28
29
|
warehouseV2: string;
|
|
29
30
|
deepLinkVietQr: string;
|
|
31
|
+
shareZalo: string;
|
|
30
32
|
}
|
|
31
33
|
export declare class SDK {
|
|
32
34
|
orgId: string;
|
|
@@ -46,6 +48,7 @@ export declare class SDK {
|
|
|
46
48
|
paymentV2: PaymentServiceV2;
|
|
47
49
|
warehouseV2: WarehouseServiceV2;
|
|
48
50
|
deepLinkVietQr: DeepLinkVietQrService;
|
|
51
|
+
shareZalo: ShareZaloService;
|
|
49
52
|
token: string | null;
|
|
50
53
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
51
54
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -17,6 +17,7 @@ const image_1 = require("./image");
|
|
|
17
17
|
const paymentV2_1 = require("./paymentV2");
|
|
18
18
|
const warehouseV2_1 = require("./warehouseV2");
|
|
19
19
|
const deepLinkVietQr_1 = require("./deepLinkVietQr");
|
|
20
|
+
const shareZalo_1 = require("./shareZalo");
|
|
20
21
|
class SDK {
|
|
21
22
|
constructor(orgId, storeId, environment) {
|
|
22
23
|
this.orgId = orgId;
|
|
@@ -38,6 +39,7 @@ class SDK {
|
|
|
38
39
|
this.paymentV2 = new paymentV2_1.PaymentServiceV2(endpoints.paymentV2, orgId, storeId);
|
|
39
40
|
this.warehouseV2 = new warehouseV2_1.WarehouseServiceV2(endpoints.warehouseV2, orgId, storeId);
|
|
40
41
|
this.deepLinkVietQr = new deepLinkVietQr_1.DeepLinkVietQrService(endpoints.deepLinkVietQr, orgId, storeId);
|
|
42
|
+
this.shareZalo = new shareZalo_1.ShareZaloService(endpoints.shareZalo, orgId, storeId);
|
|
41
43
|
// Initialize other services here
|
|
42
44
|
}
|
|
43
45
|
setToken(token) {
|
|
@@ -57,6 +59,7 @@ class SDK {
|
|
|
57
59
|
this.warehouseV2.setToken(token);
|
|
58
60
|
this.deepLinkVietQr.setToken(token);
|
|
59
61
|
this.campaign.setToken(token);
|
|
62
|
+
this.shareZalo.setToken(token);
|
|
60
63
|
// Set token for other services here
|
|
61
64
|
}
|
|
62
65
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ShareZaloService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class ShareZaloService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
shareOrder(dataRequet) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = ``;
|
|
21
|
+
const method = "POST";
|
|
22
|
+
try {
|
|
23
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, dataRequet);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ShareZaloService = ShareZaloService;
|