@longvansoftware/service-js-client 2.7.9 → 2.8.0
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.js +22 -22
- package/dist/src/graphql/computing/queries.js +2 -2
- package/dist/src/graphql/quicklab_service/mutations.js +2 -0
- package/dist/src/graphql/quicklab_service/queries.d.ts +3 -0
- package/dist/src/graphql/quicklab_service/queries.js +25 -1
- package/dist/src/lib/auth/index.js +8 -1
- package/dist/src/lib/computing/index.d.ts +1 -1
- package/dist/src/lib/computing/index.js +2 -2
- package/dist/src/lib/quicklab_service/index.d.ts +4 -1
- package/dist/src/lib/quicklab_service/index.js +47 -3
- package/package.json +1 -1
package/dist/config/config.js
CHANGED
|
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.environmentEndpoints = void 0;
|
|
4
4
|
exports.environmentEndpoints = {
|
|
5
5
|
dev: {
|
|
6
|
-
product: "https://
|
|
7
|
-
crm: "https://
|
|
8
|
-
auth: "https://
|
|
9
|
-
order: "https://
|
|
10
|
-
user: "https://
|
|
11
|
-
payment: "https://
|
|
12
|
-
service: "https://
|
|
13
|
-
warehouse: "https://
|
|
14
|
-
computing: "https://api-gateway.
|
|
15
|
-
cloud: "https://api-gateway.
|
|
6
|
+
product: "https://api-gateway.longvan.dev/product-service/graphql",
|
|
7
|
+
crm: "https://api-gateway.longvan.dev/crm-graph-gateway/graphql",
|
|
8
|
+
auth: "https://api-gateway.longvan.dev/authorization-gateway/graphql",
|
|
9
|
+
order: "https://api-gateway.longvan.dev/v2",
|
|
10
|
+
user: "https://api-gateway.longvan.dev/user-gateway/graphql",
|
|
11
|
+
payment: "https://api-gateway.longvan.dev/invoice-gateway/graphql",
|
|
12
|
+
service: "https://api-gateway.longvan.dev/service-api/graphql",
|
|
13
|
+
warehouse: "https://api-gateway.longvan.dev/facility-api/public-facility/1.0.0",
|
|
14
|
+
computing: "https://api-gateway.longvan.dev/computing-service/graphql",
|
|
15
|
+
cloud: "https://api-gateway.longvan.dev/cloud-service-api/graphql",
|
|
16
16
|
dns: "https://admin-dev.longvan.net/powerdns/dns",
|
|
17
|
-
crm_camping: "https://
|
|
18
|
-
order_graphQL: "https://api-gateway.
|
|
19
|
-
order_cloud_rest: "https://api-gateway.
|
|
20
|
-
paymentLV: "https://
|
|
21
|
-
resource_permission: "https://api-gateway.
|
|
22
|
-
cloud_rest: "https://api-gateway.
|
|
23
|
-
accounting_service: "https://api-gateway.
|
|
24
|
-
quicklab_service: "https://
|
|
25
|
-
remote_access_service: "https://api-gateway.
|
|
17
|
+
crm_camping: "https://api-gateway.longvan.dev/campaign-gateway/graphql",
|
|
18
|
+
order_graphQL: "https://api-gateway.longvan.dev/order-cloud-service/graphql",
|
|
19
|
+
order_cloud_rest: "https://api-gateway.longvan.dev/order-cloud-service",
|
|
20
|
+
paymentLV: "https://api-gateway.longvan.dev/graphql",
|
|
21
|
+
resource_permission: "https://api-gateway.longvan.dev/resource-permission-api/graphql",
|
|
22
|
+
cloud_rest: "https://api-gateway.longvan.dev/cloud-service-api/v1",
|
|
23
|
+
accounting_service: "https://api-gateway.longvan.dev/accounting-service/graphql/",
|
|
24
|
+
quicklab_service: "https://api-gateway.longvan.dev/quicklab-api/graphql",
|
|
25
|
+
remote_access_service: "https://api-gateway.longvan.dev/remote-access-service/graphql",
|
|
26
26
|
// storage_s3: "https://portal.dev.longvan.vn/storage-s3-api/graphql",
|
|
27
|
-
storage_s3: "https://
|
|
28
|
-
content_api: "https://
|
|
27
|
+
storage_s3: "https://api-gateway.longvan.dev/storage-s3-api/graphql",
|
|
28
|
+
content_api: "https://api-gateway.longvan.dev/content-api/graphql"
|
|
29
29
|
},
|
|
30
30
|
live: {
|
|
31
31
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -51,5 +51,5 @@ exports.environmentEndpoints = {
|
|
|
51
51
|
// storage_s3: "https://portal.longvan.vn/storage-s3-api/graphql",
|
|
52
52
|
storage_s3: "https://storage-s3-api.longvan.vn/storage-s3-api/graphql",
|
|
53
53
|
content_api: "https://portal.longvan.vn/content-api/graphql"
|
|
54
|
-
}
|
|
54
|
+
}
|
|
55
55
|
};
|
|
@@ -603,7 +603,7 @@ const COMPUTING_DETAIL_DYNAMIC = (fields = []) => {
|
|
|
603
603
|
};
|
|
604
604
|
exports.COMPUTING_DETAIL_DYNAMIC = COMPUTING_DETAIL_DYNAMIC;
|
|
605
605
|
exports.IS_TEMPLATE_SUPPORT_EXTEND_DISK_AUTO = (0, graphql_tag_1.gql) `
|
|
606
|
-
query IsTemplateSupportExtendDiskAuto($
|
|
607
|
-
isTemplateSupportExtendDiskAuto(
|
|
606
|
+
query IsTemplateSupportExtendDiskAuto($computingId: String!, $diskIndex: Int!) {
|
|
607
|
+
isTemplateSupportExtendDiskAuto(computingId: $computingId, diskIndex: $diskIndex)
|
|
608
608
|
}
|
|
609
609
|
`;
|
|
@@ -139,6 +139,7 @@ const CREATE_COMPUTING_LAB_BY_TEMPLATE_ID = (fields = []) => {
|
|
|
139
139
|
$timeUse: BigDecimal!
|
|
140
140
|
$createBy: String!
|
|
141
141
|
$price: BigDecimal
|
|
142
|
+
$typeLabSessionCode: String
|
|
142
143
|
){
|
|
143
144
|
createComputingLabByTemplateId (
|
|
144
145
|
templateId: $templateId
|
|
@@ -148,6 +149,7 @@ const CREATE_COMPUTING_LAB_BY_TEMPLATE_ID = (fields = []) => {
|
|
|
148
149
|
timeUse: $timeUse
|
|
149
150
|
createBy: $createBy
|
|
150
151
|
price: $price
|
|
152
|
+
typeLabSessionCode: $typeLabSessionCode
|
|
151
153
|
)
|
|
152
154
|
${hasFields ? `{ ${fieldStr} }` : ""}
|
|
153
155
|
} `;
|
|
@@ -8,3 +8,6 @@ export declare const GET_LAB_DOING_AND_DONE_BY_USERID: (fields?: string[]) => Do
|
|
|
8
8
|
export declare const CALCULATE_COMPUTING_LAB_ACTION_PRICING: (fields?: string[]) => DocumentNode;
|
|
9
9
|
export declare const GET_SESSION_LAB: (fields?: string[]) => DocumentNode;
|
|
10
10
|
export declare const FILTER_COMPUTING_LAB: (fields?: string[]) => DocumentNode;
|
|
11
|
+
export declare const GET_TYPE_LAB_SESSIONS: DocumentNode;
|
|
12
|
+
export declare const UPDATE_COMPUTING_LAB_TYPE_LAB_SESSION_CODE: DocumentNode;
|
|
13
|
+
export declare const STOP_COMPUTING_LAB_BY_TYPE_LAB_SESSION_CODE: DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FILTER_COMPUTING_LAB = exports.GET_SESSION_LAB = exports.CALCULATE_COMPUTING_LAB_ACTION_PRICING = exports.GET_LAB_DOING_AND_DONE_BY_USERID = exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = exports.GET_LAB_SESSIONS_BY_USER_ID = exports.GET_TYPE_LAB_SESSION = exports.GET_TEMPLATE_BY_ARTICLE_ID = void 0;
|
|
3
|
+
exports.STOP_COMPUTING_LAB_BY_TYPE_LAB_SESSION_CODE = exports.UPDATE_COMPUTING_LAB_TYPE_LAB_SESSION_CODE = exports.GET_TYPE_LAB_SESSIONS = exports.FILTER_COMPUTING_LAB = exports.GET_SESSION_LAB = exports.CALCULATE_COMPUTING_LAB_ACTION_PRICING = exports.GET_LAB_DOING_AND_DONE_BY_USERID = exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = exports.GET_LAB_SESSIONS_BY_USER_ID = exports.GET_TYPE_LAB_SESSION = exports.GET_TEMPLATE_BY_ARTICLE_ID = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
// Danh sách template của bài lab
|
|
6
6
|
exports.GET_TEMPLATE_BY_ARTICLE_ID = (0, graphql_tag_1.gql) `
|
|
@@ -178,3 +178,27 @@ const FILTER_COMPUTING_LAB = (fields = []) => {
|
|
|
178
178
|
`;
|
|
179
179
|
};
|
|
180
180
|
exports.FILTER_COMPUTING_LAB = FILTER_COMPUTING_LAB;
|
|
181
|
+
exports.GET_TYPE_LAB_SESSIONS = (0, graphql_tag_1.gql) `
|
|
182
|
+
query GetTypeLabSessions {
|
|
183
|
+
getTypeLabSessions {
|
|
184
|
+
name
|
|
185
|
+
code
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
exports.UPDATE_COMPUTING_LAB_TYPE_LAB_SESSION_CODE = (0, graphql_tag_1.gql) `
|
|
190
|
+
mutation UpdateComputingLabTypeLabSessionCode($partnerId: String!, $userId: String!, $computingId: String!, $typeLabSessionCode: String!, $updateBy: String!) {
|
|
191
|
+
updateComputingLabTypeLabSessionCode(partnerId: $partnerId, userId: $userId, computingId: $computingId, typeLabSessionCode: $typeLabSessionCode, updateBy: $updateBy) {
|
|
192
|
+
status
|
|
193
|
+
message
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
`;
|
|
197
|
+
exports.STOP_COMPUTING_LAB_BY_TYPE_LAB_SESSION_CODE = (0, graphql_tag_1.gql) `
|
|
198
|
+
mutation StopComputingLabByTypeLabSessionCode($partnerId: String!, $userId: String!, $computingId: String!, $updateBy: String!) {
|
|
199
|
+
stopComputingLabByTypeLabSessionCode(partnerId: $partnerId, userId: $userId, computingId: $computingId, updateBy: $updateBy) {
|
|
200
|
+
status
|
|
201
|
+
message
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
@@ -54,7 +54,14 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
54
54
|
register(registerRequest) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
const variables = { orgId: this.orgId, registerRequest };
|
|
57
|
-
|
|
57
|
+
try {
|
|
58
|
+
const response = yield this.graphqlMutation(mutations_1.REGISTER_MUTATION, variables);
|
|
59
|
+
return response.register;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.log(`Error in register: ${error}`);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
getUserDetail(accessToken) {
|
|
@@ -68,5 +68,5 @@ export declare class ComputingService extends Service {
|
|
|
68
68
|
addDisk(computingId: string, size: number, unit: string, datastoreId: string): Promise<any>;
|
|
69
69
|
extendDisk(computingId: string): Promise<any>;
|
|
70
70
|
resizeDisk(computingId: string, diskIndex: number, size: number, unit: string): Promise<any>;
|
|
71
|
-
isTemplateSupportExtendDiskAuto(
|
|
71
|
+
isTemplateSupportExtendDiskAuto(computingId: string, diskIndex: number): Promise<any>;
|
|
72
72
|
}
|
|
@@ -1048,11 +1048,11 @@ class ComputingService extends serviceSDK_1.Service {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
|
-
isTemplateSupportExtendDiskAuto(
|
|
1051
|
+
isTemplateSupportExtendDiskAuto(computingId, diskIndex) {
|
|
1052
1052
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1053
1053
|
const query = queries_1.IS_TEMPLATE_SUPPORT_EXTEND_DISK_AUTO;
|
|
1054
1054
|
const variables = {
|
|
1055
|
-
|
|
1055
|
+
computingId,
|
|
1056
1056
|
diskIndex
|
|
1057
1057
|
};
|
|
1058
1058
|
try {
|
|
@@ -17,10 +17,13 @@ export declare class QuicklabService extends Service {
|
|
|
17
17
|
stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
|
|
18
18
|
getLabDoingAndDoneByUserId(userId: string, fields: string[]): Promise<any>;
|
|
19
19
|
calculateComputingLabActionPricing(userId: string, timeUse: number | string, action: string, productId: string, computingId: string, price: number | string, fields: string[]): Promise<any>;
|
|
20
|
-
createComputingLabByTemplateId(templateId: string, userId: string, productId: string, province: string, timeUse: number | string, createBy: string, price: number | string, fields?: string[]): Promise<any>;
|
|
20
|
+
createComputingLabByTemplateId(templateId: string, userId: string, productId: string, province: string, timeUse: number | string, createBy: string, price: number | string, typeLabSessionCode: string, fields?: string[]): Promise<any>;
|
|
21
21
|
getSessionLab(userId: string, computingId: string, fields: string[]): Promise<any>;
|
|
22
22
|
removeComputingLab(userId: string, computingId: string, updateBy: string): Promise<any>;
|
|
23
23
|
offComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string): Promise<any>;
|
|
24
24
|
filterComputingLab(id: string, search: string, createdStampFrom: string, createdStampTo: string, offset: number, maxResult: number, userId: string, fields?: string[]): Promise<any>;
|
|
25
25
|
onComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string, price: number | string): Promise<any>;
|
|
26
|
+
getLabSessions(): Promise<any>;
|
|
27
|
+
updateComputingLabTypeLabSessionCode(userId: string, computingId: string, typeLabSessionCode: string, updateBy: string): Promise<any>;
|
|
28
|
+
stopComputingLabByTypeLabSessionCode(userId: string, computingId: string, updateBy: string): Promise<any>;
|
|
26
29
|
}
|
|
@@ -221,8 +221,8 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
createComputingLabByTemplateId(templateId_1, userId_1, productId_1, province_1, timeUse_1, createBy_1, price_1) {
|
|
225
|
-
return __awaiter(this, arguments, void 0, function* (templateId, userId, productId, province, timeUse, createBy, price, fields = []) {
|
|
224
|
+
createComputingLabByTemplateId(templateId_1, userId_1, productId_1, province_1, timeUse_1, createBy_1, price_1, typeLabSessionCode_1) {
|
|
225
|
+
return __awaiter(this, arguments, void 0, function* (templateId, userId, productId, province, timeUse, createBy, price, typeLabSessionCode, fields = []) {
|
|
226
226
|
const mutation = (0, mutations_1.CREATE_COMPUTING_LAB_BY_TEMPLATE_ID)(fields);
|
|
227
227
|
const variables = {
|
|
228
228
|
templateId,
|
|
@@ -231,7 +231,8 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
231
231
|
province,
|
|
232
232
|
timeUse: Number(timeUse),
|
|
233
233
|
createBy,
|
|
234
|
-
price: price != null ? Number(price) : null
|
|
234
|
+
price: price != null ? Number(price) : null,
|
|
235
|
+
typeLabSessionCode: typeLabSessionCode || null
|
|
235
236
|
};
|
|
236
237
|
try {
|
|
237
238
|
const response = yield this.graphqlMutation(mutation, variables);
|
|
@@ -346,5 +347,48 @@ class QuicklabService extends serviceSDK_1.Service {
|
|
|
346
347
|
}
|
|
347
348
|
});
|
|
348
349
|
}
|
|
350
|
+
getLabSessions() {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
+
try {
|
|
353
|
+
const response = yield this.graphqlMutationV2(queries_1.GET_TYPE_LAB_SESSIONS, {});
|
|
354
|
+
return response.getTypeLabSessions;
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
console.log(`Error in getTypeLabSessions: ${error}`);
|
|
358
|
+
throw error;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
updateComputingLabTypeLabSessionCode(userId, computingId, typeLabSessionCode, updateBy) {
|
|
363
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
364
|
+
const variables = { partnerId: this.orgId, userId, computingId, typeLabSessionCode, updateBy };
|
|
365
|
+
try {
|
|
366
|
+
const response = yield this.graphqlMutation(queries_1.UPDATE_COMPUTING_LAB_TYPE_LAB_SESSION_CODE, variables);
|
|
367
|
+
return response.updateComputingLabTypeLabSessionCode;
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
console.log(`Error in updateComputingLabTypeLabSessionCode: ${error}`);
|
|
371
|
+
throw error;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
stopComputingLabByTypeLabSessionCode(userId, computingId, updateBy) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
const variables = {
|
|
378
|
+
partnerId: this.orgId,
|
|
379
|
+
userId,
|
|
380
|
+
computingId,
|
|
381
|
+
updateBy
|
|
382
|
+
};
|
|
383
|
+
try {
|
|
384
|
+
const response = yield this.graphqlMutation(queries_1.STOP_COMPUTING_LAB_BY_TYPE_LAB_SESSION_CODE, variables);
|
|
385
|
+
return response.stopComputingLabByTypeLabSessionCode;
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
console.log(`Error in stopComputingLabByTypeLabSessionCode: ${error}`);
|
|
389
|
+
throw error;
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
}
|
|
349
393
|
}
|
|
350
394
|
exports.QuicklabService = QuicklabService;
|