@longvansoftware/storefront-js-client 4.4.9 → 4.5.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 +2 -0
- package/dist/config/config.js +2 -0
- package/dist/src/graphql/cloudCloud/mutations.d.ts +1 -0
- package/dist/src/graphql/cloudCloud/mutations.js +20 -1
- package/dist/src/graphql/cloudCloud/queries.js +2 -2
- package/dist/src/graphql/truedoc/queries.d.ts +1 -0
- package/dist/src/graphql/truedoc/queries.js +18 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +5 -0
- package/dist/src/lib/cloudCloud/index.d.ts +1 -0
- package/dist/src/lib/cloudCloud/index.js +12 -0
- package/dist/src/lib/truedoc/index.d.ts +5 -0
- package/dist/src/lib/truedoc/index.js +35 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare const environmentEndpoints: {
|
|
|
31
31
|
fileService: string;
|
|
32
32
|
orderCloud: string;
|
|
33
33
|
cloudCloud: string;
|
|
34
|
+
truedoc: string;
|
|
34
35
|
};
|
|
35
36
|
live: {
|
|
36
37
|
product: string;
|
|
@@ -60,5 +61,6 @@ export declare const environmentEndpoints: {
|
|
|
60
61
|
fileService: string;
|
|
61
62
|
orderCloud: string;
|
|
62
63
|
cloudCloud: string;
|
|
64
|
+
truedoc: string;
|
|
63
65
|
};
|
|
64
66
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -34,6 +34,7 @@ exports.environmentEndpoints = {
|
|
|
34
34
|
fileService: "https://fileservice.dev.longvan.vn/omnichannel",
|
|
35
35
|
orderCloud: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
|
|
36
36
|
cloudCloud: "https://api-gateway.dev.longvan.vn/cloud-service-api/graphql",
|
|
37
|
+
truedoc: "https://api-gateway.dev.truedoc.vn/bmlconnector/graphql",
|
|
37
38
|
},
|
|
38
39
|
live: {
|
|
39
40
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -63,5 +64,6 @@ exports.environmentEndpoints = {
|
|
|
63
64
|
fileService: "https://fileservice.longvan.vn/longvan",
|
|
64
65
|
orderCloud: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
|
|
65
66
|
cloudCloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql",
|
|
67
|
+
truedoc: "https://api-gateway.truedoc.vn/bmlconnector/graphql",
|
|
66
68
|
},
|
|
67
69
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPDATE_DESCRIPTION = void 0;
|
|
3
|
+
exports.UPDATE_SERVICE_RESOURCE = exports.UPDATE_DESCRIPTION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.UPDATE_DESCRIPTION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation UpdateDescription(
|
|
@@ -15,3 +15,22 @@ exports.UPDATE_DESCRIPTION = (0, graphql_tag_1.gql) `
|
|
|
15
15
|
)
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
|
+
exports.UPDATE_SERVICE_RESOURCE = (0, graphql_tag_1.gql) `
|
|
19
|
+
mutation UpdateServiceResource(
|
|
20
|
+
$serviceId: String!
|
|
21
|
+
$keyId: String!
|
|
22
|
+
$name: String
|
|
23
|
+
$value: String
|
|
24
|
+
$unit: String
|
|
25
|
+
$actorId: String!
|
|
26
|
+
) {
|
|
27
|
+
updateServiceResource(
|
|
28
|
+
serviceId: $serviceId
|
|
29
|
+
keyId: $keyId
|
|
30
|
+
name: $name
|
|
31
|
+
value: $value
|
|
32
|
+
unit: $unit
|
|
33
|
+
actorId: $actorId
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
@@ -70,8 +70,8 @@ exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
|
|
|
70
70
|
}
|
|
71
71
|
`;
|
|
72
72
|
exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
|
|
73
|
-
query ServiceDetail($serviceId: String
|
|
74
|
-
serviceDetail(serviceId: $serviceId
|
|
73
|
+
query ServiceDetail($serviceId: String) {
|
|
74
|
+
serviceDetail(serviceId: $serviceId) {
|
|
75
75
|
service {
|
|
76
76
|
productConfiguration {
|
|
77
77
|
productId
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET_CUSTOMER_INFOR: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_CUSTOMER_INFOR = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_CUSTOMER_INFOR = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetCustomerInfo($bmlToken: String!) {
|
|
7
|
+
getCustomerInfo(bmlToken: $bmlToken) {
|
|
8
|
+
id
|
|
9
|
+
name
|
|
10
|
+
email
|
|
11
|
+
phone
|
|
12
|
+
tier
|
|
13
|
+
gender
|
|
14
|
+
tdAccessToken
|
|
15
|
+
dob
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { StoreService } from "./store";
|
|
|
25
25
|
import { FileServiceSerVice } from "./fileService";
|
|
26
26
|
import { OrderCloudService } from "./orderCloud";
|
|
27
27
|
import { CloudCloudService } from "./cloudCloud";
|
|
28
|
+
import { TruedocService } from "./truedoc";
|
|
28
29
|
export interface Endpoints {
|
|
29
30
|
product: string;
|
|
30
31
|
crm: string;
|
|
@@ -53,6 +54,7 @@ export interface Endpoints {
|
|
|
53
54
|
fileService: string;
|
|
54
55
|
orderCloud: string;
|
|
55
56
|
cloudCloud: string;
|
|
57
|
+
truedoc: string;
|
|
56
58
|
}
|
|
57
59
|
export declare class SDK {
|
|
58
60
|
orgId: string;
|
|
@@ -85,6 +87,7 @@ export declare class SDK {
|
|
|
85
87
|
fileService: FileServiceSerVice;
|
|
86
88
|
orderCloud: OrderCloudService;
|
|
87
89
|
cloudCloud: CloudCloudService;
|
|
90
|
+
truedoc: TruedocService;
|
|
88
91
|
token: string | null;
|
|
89
92
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
90
93
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -30,6 +30,7 @@ const store_1 = require("./store");
|
|
|
30
30
|
const fileService_1 = require("./fileService");
|
|
31
31
|
const orderCloud_1 = require("./orderCloud");
|
|
32
32
|
const cloudCloud_1 = require("./cloudCloud");
|
|
33
|
+
const truedoc_1 = require("./truedoc");
|
|
33
34
|
class SDK {
|
|
34
35
|
constructor(orgId, storeId, environment) {
|
|
35
36
|
this.orgId = orgId;
|
|
@@ -64,6 +65,7 @@ class SDK {
|
|
|
64
65
|
this.fileService = new fileService_1.FileServiceSerVice(endpoints.fileService, orgId, storeId);
|
|
65
66
|
this.orderCloud = new orderCloud_1.OrderCloudService(endpoints.orderCloud, orgId, storeId);
|
|
66
67
|
this.cloudCloud = new cloudCloud_1.CloudCloudService(endpoints.cloudCloud, orgId, storeId);
|
|
68
|
+
this.truedoc = new truedoc_1.TruedocService(endpoints.truedoc, orgId, storeId);
|
|
67
69
|
// Initialize other services here
|
|
68
70
|
}
|
|
69
71
|
setToken(token) {
|
|
@@ -97,6 +99,7 @@ class SDK {
|
|
|
97
99
|
this.fileService.setToken(token);
|
|
98
100
|
this.orderCloud.setToken(token);
|
|
99
101
|
this.cloudCloud.setToken(token);
|
|
102
|
+
this.truedoc.setToken(token);
|
|
100
103
|
}
|
|
101
104
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
102
105
|
// src/service.ts
|
|
@@ -127,6 +130,7 @@ class SDK {
|
|
|
127
130
|
this.fileService.setStoreId(storeId);
|
|
128
131
|
this.orderCloud.setStoreId(storeId);
|
|
129
132
|
this.cloudCloud.setStoreId(storeId);
|
|
133
|
+
this.truedoc.setStoreId(storeId);
|
|
130
134
|
// Set storeId for other services here
|
|
131
135
|
}
|
|
132
136
|
setOrgId(orgId) {
|
|
@@ -156,6 +160,7 @@ class SDK {
|
|
|
156
160
|
this.fileService.setOrgId(orgId);
|
|
157
161
|
this.orderCloud.setOrgId(orgId);
|
|
158
162
|
this.cloudCloud.setOrgId(orgId);
|
|
163
|
+
this.truedoc.setOrgId(orgId);
|
|
159
164
|
}
|
|
160
165
|
}
|
|
161
166
|
exports.SDK = SDK;
|
|
@@ -6,4 +6,5 @@ export declare class CloudCloudService extends Service {
|
|
|
6
6
|
updateDescription(serviceId: string, description: string, updatedBy: string): Promise<any>;
|
|
7
7
|
searchServiceByPhone(phone: string, serviceScope: string): Promise<any>;
|
|
8
8
|
getListLabService(productId: string): Promise<any>;
|
|
9
|
+
updateServiceResource(data: Record<string, any>): Promise<any>;
|
|
9
10
|
}
|
|
@@ -95,5 +95,17 @@ class CloudCloudService extends serviceSDK_1.Service {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
updateServiceResource(data) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const mutation = mutations_1.UPDATE_SERVICE_RESOURCE;
|
|
101
|
+
try {
|
|
102
|
+
const response = yield this.graphqlMutationV2(mutation, data);
|
|
103
|
+
return response.updateServiceResource;
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
98
110
|
}
|
|
99
111
|
exports.CloudCloudService = CloudCloudService;
|
|
@@ -0,0 +1,35 @@
|
|
|
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.TruedocService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/truedoc/queries");
|
|
15
|
+
class TruedocService extends serviceSDK_1.Service {
|
|
16
|
+
constructor(endpoint, orgId, storeId) {
|
|
17
|
+
super(endpoint, orgId, storeId);
|
|
18
|
+
}
|
|
19
|
+
getCustomerInfo(bmlToken) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const query = queries_1.GET_CUSTOMER_INFOR;
|
|
22
|
+
const variables = {
|
|
23
|
+
bmlToken,
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
const response = yield this.graphqlQueryV4(query, variables);
|
|
27
|
+
return response.getCustomerInfo;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.TruedocService = TruedocService;
|