@longvansoftware/service-js-client 1.1.4 → 1.1.5
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 +2 -0
- package/dist/config/config.js +3 -1
- package/dist/src/graphql/computing/queries.js +3 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +3 -0
- package/dist/src/lib/dns/index.d.ts +6 -0
- package/dist/src/lib/dns/index.js +36 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
@@ -10,6 +10,7 @@ export declare const environmentEndpoints: {
|
|
10
10
|
warehouse: string;
|
11
11
|
computing: string;
|
12
12
|
cloud: string;
|
13
|
+
dns: string;
|
13
14
|
};
|
14
15
|
live: {
|
15
16
|
product: string;
|
@@ -22,5 +23,6 @@ export declare const environmentEndpoints: {
|
|
22
23
|
warehouse: string;
|
23
24
|
computing: string;
|
24
25
|
cloud: string;
|
26
|
+
dns: string;
|
25
27
|
};
|
26
28
|
};
|
package/dist/config/config.js
CHANGED
@@ -13,6 +13,7 @@ exports.environmentEndpoints = {
|
|
13
13
|
warehouse: "https://facility-api-v2.dev.longvan.vn/facility-api/public-facility/1.0.0",
|
14
14
|
computing: "https://api-gateway.dev.longvan.vn/computing-service/graphql",
|
15
15
|
cloud: "https://api-gateway.dev.longvan.vn/cloud-service-api/graphql",
|
16
|
+
dns: "https://admin-dev.longvan.net/powerdns/dns",
|
16
17
|
},
|
17
18
|
live: {
|
18
19
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
@@ -24,6 +25,7 @@ exports.environmentEndpoints = {
|
|
24
25
|
service: "https://portal.longvan.vn/service-api/graphql",
|
25
26
|
warehouse: "https://facility-api-v2.longvan.vn/facility-api/public-facility/1.0.0",
|
26
27
|
computing: "https://api-gateway.longvan.vn/computing-service/graphql",
|
27
|
-
cloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql"
|
28
|
+
cloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql",
|
29
|
+
dns: "https://admin.longvan.net/powerdns/dns",
|
28
30
|
},
|
29
31
|
};
|
package/dist/src/lib/SDK.d.ts
CHANGED
@@ -8,6 +8,7 @@ import { CrmService } from "../lib/crm/index";
|
|
8
8
|
import { WarehouseService } from "../lib/warehouse/index";
|
9
9
|
import { ComputingService } from "../lib/computing/index";
|
10
10
|
import { CloudService } from "./cloud";
|
11
|
+
import { DnsService } from "../lib/dns/index";
|
11
12
|
export interface Endpoints {
|
12
13
|
product: string;
|
13
14
|
crm: string;
|
@@ -19,6 +20,7 @@ export interface Endpoints {
|
|
19
20
|
warehouse: string;
|
20
21
|
computing: string;
|
21
22
|
cloud: string;
|
23
|
+
dns: string;
|
22
24
|
}
|
23
25
|
export declare class SDK {
|
24
26
|
orgId: string;
|
@@ -35,6 +37,7 @@ export declare class SDK {
|
|
35
37
|
warehouse: WarehouseService;
|
36
38
|
computing: ComputingService;
|
37
39
|
cloud: CloudService;
|
40
|
+
dns: DnsService;
|
38
41
|
token: string | null;
|
39
42
|
constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
|
40
43
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
@@ -14,6 +14,7 @@ const index_7 = require("../lib/crm/index");
|
|
14
14
|
const index_8 = require("../lib/warehouse/index");
|
15
15
|
const index_9 = require("../lib/computing/index");
|
16
16
|
const cloud_1 = require("./cloud");
|
17
|
+
const index_10 = require("../lib/dns/index");
|
17
18
|
class SDK {
|
18
19
|
constructor(orgId, storeId, storefrontAccessToken, environment) {
|
19
20
|
this.orgId = orgId;
|
@@ -37,6 +38,7 @@ class SDK {
|
|
37
38
|
this.warehouse = new index_8.WarehouseService(endpoints.warehouse, orgId, storeId);
|
38
39
|
this.computing = new index_9.ComputingService(endpoints.computing, orgId, storeId);
|
39
40
|
this.cloud = new cloud_1.CloudService(endpoints.cloud, orgId, storeId);
|
41
|
+
this.dns = new index_10.DnsService(endpoints.dns, orgId, storeId);
|
40
42
|
// Initialize other services here
|
41
43
|
}
|
42
44
|
setToken(token) {
|
@@ -52,6 +54,7 @@ class SDK {
|
|
52
54
|
this.warehouse.setToken(token);
|
53
55
|
this.computing.setToken(token);
|
54
56
|
this.cloud.setToken(token);
|
57
|
+
this.dns.setToken(token);
|
55
58
|
// Set token for other services here
|
56
59
|
}
|
57
60
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
@@ -0,0 +1,36 @@
|
|
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.DnsService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class DnsService extends serviceSDK_1.Service {
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
16
|
+
super(endpoint, orgId, storeId);
|
17
|
+
}
|
18
|
+
setToken(token) {
|
19
|
+
this.token = token;
|
20
|
+
}
|
21
|
+
getDomain(params) {
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
23
|
+
const endpoint = `/domain`;
|
24
|
+
const method = "POST";
|
25
|
+
try {
|
26
|
+
const response = yield this.restApiCallWithToken(endpoint, method, params);
|
27
|
+
return response;
|
28
|
+
}
|
29
|
+
catch (error) {
|
30
|
+
console.log(`Error in addVoucher: ${error}`);
|
31
|
+
throw error;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}
|
36
|
+
exports.DnsService = DnsService;
|