@longvansoftware/storefront-js-client 1.7.9 → 1.8.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.
package/dist/config/config.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const environmentEndpoints: {
|
|
|
13
13
|
image: string;
|
|
14
14
|
paymentV2: string;
|
|
15
15
|
warehouseV2: string;
|
|
16
|
+
deepLinkVietQr: string;
|
|
16
17
|
};
|
|
17
18
|
live: {
|
|
18
19
|
product: string;
|
|
@@ -28,5 +29,6 @@ export declare const environmentEndpoints: {
|
|
|
28
29
|
image: string;
|
|
29
30
|
paymentV2: string;
|
|
30
31
|
warehouseV2: string;
|
|
32
|
+
deepLinkVietQr: string;
|
|
31
33
|
};
|
|
32
34
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -15,7 +15,8 @@ exports.environmentEndpoints = {
|
|
|
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
17
|
paymentV2: "https://payment.dev.longvan.vn/graphql",
|
|
18
|
-
warehouseV2: "https://portal.dev.longvan.vn/facility-api"
|
|
18
|
+
warehouseV2: "https://portal.dev.longvan.vn/facility-api",
|
|
19
|
+
deepLinkVietQr: "https://api.vietqr.io/v2",
|
|
19
20
|
},
|
|
20
21
|
live: {
|
|
21
22
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -30,6 +31,7 @@ exports.environmentEndpoints = {
|
|
|
30
31
|
campaign: "https://crm.longvan.vn/campaign-gateway/graphql",
|
|
31
32
|
image: "https://product-service.dev.longvan.vn/product-service/v1/products",
|
|
32
33
|
paymentV2: "https://payment-staging.longvan.vn/graphql",
|
|
33
|
-
warehouseV2: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/product-inventory"
|
|
34
|
+
warehouseV2: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/product-inventory",
|
|
35
|
+
deepLinkVietQr: "https://api.vietqr.io/v2",
|
|
34
36
|
},
|
|
35
37
|
};
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { CampaignService } from "./campaign";
|
|
|
11
11
|
import { ImageService } from "./image";
|
|
12
12
|
import { PaymentServiceV2 } from "./paymentV2";
|
|
13
13
|
import { WarehouseServiceV2 } from "./warehouseV2";
|
|
14
|
+
import { DeepLinkVietQrService } from "./deepLinkVietQr";
|
|
14
15
|
export interface Endpoints {
|
|
15
16
|
product: string;
|
|
16
17
|
crm: string;
|
|
@@ -25,6 +26,7 @@ export interface Endpoints {
|
|
|
25
26
|
image: string;
|
|
26
27
|
paymentV2: string;
|
|
27
28
|
warehouseV2: string;
|
|
29
|
+
deepLinkVietQr: string;
|
|
28
30
|
}
|
|
29
31
|
export declare class SDK {
|
|
30
32
|
orgId: string;
|
|
@@ -43,6 +45,7 @@ export declare class SDK {
|
|
|
43
45
|
image: ImageService;
|
|
44
46
|
paymentV2: PaymentServiceV2;
|
|
45
47
|
warehouseV2: WarehouseServiceV2;
|
|
48
|
+
deepLinkVietQr: DeepLinkVietQrService;
|
|
46
49
|
token: string | null;
|
|
47
50
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
48
51
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -16,6 +16,7 @@ const campaign_1 = require("./campaign");
|
|
|
16
16
|
const image_1 = require("./image");
|
|
17
17
|
const paymentV2_1 = require("./paymentV2");
|
|
18
18
|
const warehouseV2_1 = require("./warehouseV2");
|
|
19
|
+
const deepLinkVietQr_1 = require("./deepLinkVietQr");
|
|
19
20
|
class SDK {
|
|
20
21
|
constructor(orgId, storeId, environment) {
|
|
21
22
|
this.orgId = orgId;
|
|
@@ -36,6 +37,7 @@ class SDK {
|
|
|
36
37
|
this.image = new image_1.ImageService(endpoints.image, orgId, storeId);
|
|
37
38
|
this.paymentV2 = new paymentV2_1.PaymentServiceV2(endpoints.paymentV2, orgId, storeId);
|
|
38
39
|
this.warehouseV2 = new warehouseV2_1.WarehouseServiceV2(endpoints.warehouseV2, orgId, storeId);
|
|
40
|
+
this.deepLinkVietQr = new deepLinkVietQr_1.DeepLinkVietQrService(endpoints.deepLinkVietQr, orgId, storeId);
|
|
39
41
|
// Initialize other services here
|
|
40
42
|
}
|
|
41
43
|
setToken(token) {
|
|
@@ -53,6 +55,8 @@ class SDK {
|
|
|
53
55
|
this.image.setToken(token);
|
|
54
56
|
this.paymentV2.setToken(token);
|
|
55
57
|
this.warehouseV2.setToken(token);
|
|
58
|
+
this.deepLinkVietQr.setToken(token);
|
|
59
|
+
this.campaign.setToken(token);
|
|
56
60
|
// Set token for other services here
|
|
57
61
|
}
|
|
58
62
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
@@ -70,6 +74,8 @@ class SDK {
|
|
|
70
74
|
this.image.setStoreId(storeId);
|
|
71
75
|
this.paymentV2.setStoreId(storeId);
|
|
72
76
|
this.warehouseV2.setStoreId(storeId);
|
|
77
|
+
this.deepLinkVietQr.setStoreId(storeId);
|
|
78
|
+
this.campaign.setStoreId(storeId);
|
|
73
79
|
// Set storeId for other services here
|
|
74
80
|
}
|
|
75
81
|
setOrgId(orgId) {
|
|
@@ -85,6 +91,8 @@ class SDK {
|
|
|
85
91
|
this.image.setOrgId(orgId);
|
|
86
92
|
this.paymentV2.setOrgId(orgId);
|
|
87
93
|
this.warehouseV2.setOrgId(orgId);
|
|
94
|
+
this.deepLinkVietQr.setOrgId(orgId);
|
|
95
|
+
this.campaign.setOrgId(orgId);
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
98
|
exports.SDK = SDK;
|
|
@@ -0,0 +1,45 @@
|
|
|
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.DeepLinkVietQrService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class DeepLinkVietQrService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
getAndroidBank() {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = `/android-app-deeplinks`;
|
|
21
|
+
const method = "GET";
|
|
22
|
+
try {
|
|
23
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getIosBank() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const endpoint = `/ios-app-deeplinks`;
|
|
34
|
+
const method = "GET";
|
|
35
|
+
try {
|
|
36
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.DeepLinkVietQrService = DeepLinkVietQrService;
|