@longvansoftware/storefront-js-client 1.7.6 → 1.7.7
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
|
@@ -12,6 +12,7 @@ export declare const environmentEndpoints: {
|
|
|
12
12
|
campaign: string;
|
|
13
13
|
image: string;
|
|
14
14
|
paymentV2: string;
|
|
15
|
+
warehouseV2: string;
|
|
15
16
|
};
|
|
16
17
|
live: {
|
|
17
18
|
product: string;
|
|
@@ -26,5 +27,6 @@ export declare const environmentEndpoints: {
|
|
|
26
27
|
campaign: string;
|
|
27
28
|
image: string;
|
|
28
29
|
paymentV2: string;
|
|
30
|
+
warehouseV2: string;
|
|
29
31
|
};
|
|
30
32
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -15,6 +15,7 @@ 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/public-facility/1.0.0/product-inventory-v3"
|
|
18
19
|
},
|
|
19
20
|
live: {
|
|
20
21
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -29,5 +30,6 @@ exports.environmentEndpoints = {
|
|
|
29
30
|
campaign: "https://crm.longvan.vn/campaign-gateway/graphql",
|
|
30
31
|
image: "https://product-service.dev.longvan.vn/product-service/v1/products",
|
|
31
32
|
paymentV2: "https://payment-staging.longvan.vn/graphql",
|
|
33
|
+
warehouseV2: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/product-inventory"
|
|
32
34
|
},
|
|
33
35
|
};
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { ComputingService } from "../lib/computing/index";
|
|
|
10
10
|
import { CampaignService } from "./campaign";
|
|
11
11
|
import { ImageService } from "./image";
|
|
12
12
|
import { PaymentServiceV2 } from "./paymentV2";
|
|
13
|
+
import { WarehouseServiceV2 } from "./warehouseV2";
|
|
13
14
|
export interface Endpoints {
|
|
14
15
|
product: string;
|
|
15
16
|
crm: string;
|
|
@@ -23,6 +24,7 @@ export interface Endpoints {
|
|
|
23
24
|
campaign: string;
|
|
24
25
|
image: string;
|
|
25
26
|
paymentV2: string;
|
|
27
|
+
warehouseV2: string;
|
|
26
28
|
}
|
|
27
29
|
export declare class SDK {
|
|
28
30
|
orgId: string;
|
|
@@ -40,6 +42,7 @@ export declare class SDK {
|
|
|
40
42
|
campaign: CampaignService;
|
|
41
43
|
image: ImageService;
|
|
42
44
|
paymentV2: PaymentServiceV2;
|
|
45
|
+
warehouseV2: WarehouseServiceV2;
|
|
43
46
|
token: string | null;
|
|
44
47
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
45
48
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -15,6 +15,7 @@ const index_9 = require("../lib/computing/index");
|
|
|
15
15
|
const campaign_1 = require("./campaign");
|
|
16
16
|
const image_1 = require("./image");
|
|
17
17
|
const paymentV2_1 = require("./paymentV2");
|
|
18
|
+
const warehouseV2_1 = require("./warehouseV2");
|
|
18
19
|
class SDK {
|
|
19
20
|
constructor(orgId, storeId, environment) {
|
|
20
21
|
this.orgId = orgId;
|
|
@@ -34,6 +35,7 @@ class SDK {
|
|
|
34
35
|
this.campaign = new campaign_1.CampaignService(endpoints.campaign, orgId, storeId);
|
|
35
36
|
this.image = new image_1.ImageService(endpoints.image, orgId, storeId);
|
|
36
37
|
this.paymentV2 = new paymentV2_1.PaymentServiceV2(endpoints.paymentV2, orgId, storeId);
|
|
38
|
+
this.warehouseV2 = new warehouseV2_1.WarehouseServiceV2(endpoints.warehouseV2, orgId, storeId);
|
|
37
39
|
// Initialize other services here
|
|
38
40
|
}
|
|
39
41
|
setToken(token) {
|
|
@@ -50,6 +52,7 @@ class SDK {
|
|
|
50
52
|
this.computing.setToken(token);
|
|
51
53
|
this.image.setToken(token);
|
|
52
54
|
this.paymentV2.setToken(token);
|
|
55
|
+
this.warehouseV2.setToken(token);
|
|
53
56
|
// Set token for other services here
|
|
54
57
|
}
|
|
55
58
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
@@ -66,6 +69,7 @@ class SDK {
|
|
|
66
69
|
this.warehouse.setStoreId(storeId);
|
|
67
70
|
this.image.setStoreId(storeId);
|
|
68
71
|
this.paymentV2.setStoreId(storeId);
|
|
72
|
+
this.warehouseV2.setStoreId(storeId);
|
|
69
73
|
// Set storeId for other services here
|
|
70
74
|
}
|
|
71
75
|
setOrgId(orgId) {
|
|
@@ -80,6 +84,7 @@ class SDK {
|
|
|
80
84
|
this.warehouse.setOrgId(orgId);
|
|
81
85
|
this.image.setOrgId(orgId);
|
|
82
86
|
this.paymentV2.setOrgId(orgId);
|
|
87
|
+
this.warehouseV2.setOrgId(orgId);
|
|
83
88
|
}
|
|
84
89
|
}
|
|
85
90
|
exports.SDK = SDK;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class WarehouseServiceV2 extends Service {
|
|
3
|
+
/**
|
|
4
|
+
* Constructs a new OrderService instance.
|
|
5
|
+
* @param endpoint - The endpoint URL for the service.
|
|
6
|
+
* @param orgId - The organization ID.
|
|
7
|
+
* @param storeId - The store ID.
|
|
8
|
+
*/
|
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
10
|
+
setToken(token: string): void;
|
|
11
|
+
getInventory(warehouseId: string, data: any[]): Promise<any>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.WarehouseServiceV2 = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class WarehouseServiceV2 extends serviceSDK_1.Service {
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new OrderService instance.
|
|
17
|
+
* @param endpoint - The endpoint URL for the service.
|
|
18
|
+
* @param orgId - The organization ID.
|
|
19
|
+
* @param storeId - The store ID.
|
|
20
|
+
*/
|
|
21
|
+
constructor(endpoint, orgId, storeId) {
|
|
22
|
+
super(endpoint, orgId, storeId);
|
|
23
|
+
}
|
|
24
|
+
setToken(token) {
|
|
25
|
+
this.token = token;
|
|
26
|
+
}
|
|
27
|
+
getInventory(warehouseId, data) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const endpoint = `/${warehouseId}`;
|
|
30
|
+
const method = "POST";
|
|
31
|
+
try {
|
|
32
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.WarehouseServiceV2 = WarehouseServiceV2;
|