@longvansoftware/service-js-client 1.10.10 → 1.11.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/src/graphql/cloud/queries.d.ts +1 -0
- package/dist/src/graphql/cloud/queries.js +6 -1
- package/dist/src/graphql/computing/mutations.d.ts +22 -18
- package/dist/src/graphql/computing/mutations.js +35 -1
- package/dist/src/graphql/computing/queries.d.ts +27 -25
- package/dist/src/graphql/computing/queries.js +11 -1
- package/dist/src/graphql/product/queries.d.ts +2 -2
- package/dist/src/graphql/product/queries.js +6 -6
- package/dist/src/lib/cloud/index.d.ts +1 -0
- package/dist/src/lib/cloud/index.js +14 -0
- package/dist/src/lib/computing/index.d.ts +5 -1
- package/dist/src/lib/computing/index.js +69 -1
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +1 -1
@@ -14,3 +14,4 @@ export declare const GET_OWNERS_BY_CUSTOMER_ID: import("graphql").DocumentNode;
|
|
14
14
|
export declare const GET_CONTACTS_BY_OWNER_ID: import("graphql").DocumentNode;
|
15
15
|
export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
|
16
16
|
export declare const GET_DOMAIN_SUPPLIER: import("graphql").DocumentNode;
|
17
|
+
export declare const CHECK_DOMAIN_EXIST: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_DOMAIN_SUPPLIER = exports.GET_WHOIS_DOMAIN_INFO = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL = void 0;
|
3
|
+
exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = exports.GET_WHOIS_DOMAIN_INFO = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query ServiceDetail($serviceId: String) {
|
@@ -286,3 +286,8 @@ exports.GET_DOMAIN_SUPPLIER = (0, graphql_tag_1.gql) `
|
|
286
286
|
getDomainSupplier(serviceId: $serviceId)
|
287
287
|
}
|
288
288
|
`;
|
289
|
+
exports.CHECK_DOMAIN_EXIST = (0, graphql_tag_1.gql) `
|
290
|
+
query CheckDomainExist($domainName: String!) {
|
291
|
+
checkDomainExist(domainName: $domainName)
|
292
|
+
}
|
293
|
+
`;
|
@@ -1,18 +1,22 @@
|
|
1
|
-
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
6
|
-
export declare const
|
7
|
-
export declare const
|
8
|
-
export declare const
|
9
|
-
export declare const
|
10
|
-
export declare const
|
11
|
-
export declare const
|
12
|
-
export declare const
|
13
|
-
export declare const
|
14
|
-
export declare const
|
15
|
-
export declare const
|
16
|
-
export declare const
|
17
|
-
export declare const
|
18
|
-
export declare const
|
1
|
+
import { DocumentNode } from "graphql";
|
2
|
+
export declare const RESTARTVM: DocumentNode;
|
3
|
+
export declare const UPDATE_DESCRIPTION_PORTNAT: DocumentNode;
|
4
|
+
export declare const CREATE_PORT_NAT: DocumentNode;
|
5
|
+
export declare const UPDATE_PORT_NAT: DocumentNode;
|
6
|
+
export declare const REMOVE_PORT_NAT: DocumentNode;
|
7
|
+
export declare const POWER_ON: DocumentNode;
|
8
|
+
export declare const POWER_OFF: DocumentNode;
|
9
|
+
export declare const CREATE_SNAP_SHOT: DocumentNode;
|
10
|
+
export declare const ROLLBACK_SNAPSHOT: DocumentNode;
|
11
|
+
export declare const DELETE_SNAPSHOT: DocumentNode;
|
12
|
+
export declare const CREATE_CLUSTER: DocumentNode;
|
13
|
+
export declare const ADD_COMPUTING_IN_CLUSTER: DocumentNode;
|
14
|
+
export declare const REMOVE_COMPUTING_IN_CLUSTER: DocumentNode;
|
15
|
+
export declare const STOP_USE_COMPUTING: DocumentNode;
|
16
|
+
export declare const ADD_PORT_NAT: DocumentNode;
|
17
|
+
export declare const UPDATE_DESCRIPTION_COMPUTING: DocumentNode;
|
18
|
+
export declare const CREATE_COMPUTING_FOR_DC: DocumentNode;
|
19
|
+
export declare const UPDATE_NAME_COMPUTING: DocumentNode;
|
20
|
+
export declare const COMPUTING_WAITING_REVOKE: (fields?: string[]) => DocumentNode;
|
21
|
+
export declare const RESTORE_COMPUTING_WAITING_REVOKE: (fields?: string[]) => DocumentNode;
|
22
|
+
export declare const DELETE_COMPUTING: (fields?: string[]) => DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.UPDATE_NAME_COMPUTING = exports.CREATE_COMPUTING_FOR_DC = exports.UPDATE_DESCRIPTION_COMPUTING = exports.ADD_PORT_NAT = exports.STOP_USE_COMPUTING = exports.REMOVE_COMPUTING_IN_CLUSTER = exports.ADD_COMPUTING_IN_CLUSTER = exports.CREATE_CLUSTER = exports.DELETE_SNAPSHOT = exports.ROLLBACK_SNAPSHOT = exports.CREATE_SNAP_SHOT = exports.POWER_OFF = exports.POWER_ON = exports.REMOVE_PORT_NAT = exports.UPDATE_PORT_NAT = exports.CREATE_PORT_NAT = exports.UPDATE_DESCRIPTION_PORTNAT = exports.RESTARTVM = void 0;
|
3
|
+
exports.DELETE_COMPUTING = exports.RESTORE_COMPUTING_WAITING_REVOKE = exports.COMPUTING_WAITING_REVOKE = exports.UPDATE_NAME_COMPUTING = exports.CREATE_COMPUTING_FOR_DC = exports.UPDATE_DESCRIPTION_COMPUTING = exports.ADD_PORT_NAT = exports.STOP_USE_COMPUTING = exports.REMOVE_COMPUTING_IN_CLUSTER = exports.ADD_COMPUTING_IN_CLUSTER = exports.CREATE_CLUSTER = exports.DELETE_SNAPSHOT = exports.ROLLBACK_SNAPSHOT = exports.CREATE_SNAP_SHOT = exports.POWER_OFF = exports.POWER_ON = exports.REMOVE_PORT_NAT = exports.UPDATE_PORT_NAT = exports.CREATE_PORT_NAT = exports.UPDATE_DESCRIPTION_PORTNAT = exports.RESTARTVM = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.RESTARTVM = (0, graphql_tag_1.gql) `
|
6
6
|
mutation Restart($computingId: String!, $actor: String!) {
|
@@ -230,6 +230,7 @@ exports.CREATE_COMPUTING_FOR_DC = (0, graphql_tag_1.gql) `
|
|
230
230
|
$ram: RamInput!
|
231
231
|
$resourcePoolId: String!
|
232
232
|
$disks: [DiskInput!]!
|
233
|
+
$createBy: createBy
|
233
234
|
) {
|
234
235
|
createComputingForDC(
|
235
236
|
createComputingInputForDC: {
|
@@ -244,6 +245,7 @@ exports.CREATE_COMPUTING_FOR_DC = (0, graphql_tag_1.gql) `
|
|
244
245
|
resourcePoolId: $resourcePoolId
|
245
246
|
disks: $disks
|
246
247
|
}
|
248
|
+
createBy: $createBy
|
247
249
|
) {
|
248
250
|
computingId
|
249
251
|
message
|
@@ -263,3 +265,35 @@ exports.UPDATE_NAME_COMPUTING = (0, graphql_tag_1.gql) `
|
|
263
265
|
)
|
264
266
|
}
|
265
267
|
`;
|
268
|
+
const COMPUTING_WAITING_REVOKE = (fields = []) => {
|
269
|
+
const fieldStr = fields.join("\n ");
|
270
|
+
const hasFields = fields.length > 0;
|
271
|
+
return (0, graphql_tag_1.gql) `
|
272
|
+
mutation ComputingWaitingRevoke($computingId: String! $userId: String!) {
|
273
|
+
computingWaitingRevoke(computingId: $computingId, userId: $userId)
|
274
|
+
${hasFields ? `{ ${fieldStr} }` : ""}
|
275
|
+
}
|
276
|
+
`;
|
277
|
+
};
|
278
|
+
exports.COMPUTING_WAITING_REVOKE = COMPUTING_WAITING_REVOKE;
|
279
|
+
const RESTORE_COMPUTING_WAITING_REVOKE = (fields = []) => {
|
280
|
+
const fieldStr = fields.join("\n ");
|
281
|
+
const hasFields = fields.length > 0;
|
282
|
+
return (0, graphql_tag_1.gql) `
|
283
|
+
mutation RestoreComputingWaitingRevoke($computingId: String! $userId: String!) {
|
284
|
+
restoreComputingWaitingRevoke(computingId: $computingId, userId: $userId)
|
285
|
+
${hasFields ? `{ ${fieldStr} }` : ""}
|
286
|
+
}
|
287
|
+
`;
|
288
|
+
};
|
289
|
+
exports.RESTORE_COMPUTING_WAITING_REVOKE = RESTORE_COMPUTING_WAITING_REVOKE;
|
290
|
+
const DELETE_COMPUTING = (fields = []) => {
|
291
|
+
const fieldStr = fields.join("\n ");
|
292
|
+
const hasFields = fields.length > 0;
|
293
|
+
return (0, graphql_tag_1.gql) `
|
294
|
+
mutation DeleteComputing($computingId: String! $userId: String!) {
|
295
|
+
deleteComputing(computingId: $computingId, userId: $userId) ${hasFields ? `{ ${fieldStr} }` : ""}
|
296
|
+
}
|
297
|
+
`;
|
298
|
+
};
|
299
|
+
exports.DELETE_COMPUTING = DELETE_COMPUTING;
|
@@ -1,25 +1,27 @@
|
|
1
|
-
|
2
|
-
export declare const
|
3
|
-
export declare const
|
4
|
-
export declare const
|
5
|
-
export declare const
|
6
|
-
export declare const
|
7
|
-
export declare const
|
8
|
-
export declare const
|
9
|
-
export declare const
|
10
|
-
export declare const
|
11
|
-
export declare const
|
12
|
-
export declare const
|
13
|
-
export declare const
|
14
|
-
export declare const
|
15
|
-
export declare const
|
16
|
-
export declare const
|
17
|
-
export declare const
|
18
|
-
export declare const
|
19
|
-
export declare const
|
20
|
-
export declare const
|
21
|
-
export declare const
|
22
|
-
export declare const
|
23
|
-
export declare const
|
24
|
-
export declare const
|
25
|
-
export declare const
|
1
|
+
import { DocumentNode } from "graphql";
|
2
|
+
export declare const COMPUTING_DETAIL: DocumentNode;
|
3
|
+
export declare const PORTNATS: DocumentNode;
|
4
|
+
export declare const SNAP_SHOTS: DocumentNode;
|
5
|
+
export declare const RAM_USAGE_START_TIME: DocumentNode;
|
6
|
+
export declare const CPU_USAGE_START_TIME: DocumentNode;
|
7
|
+
export declare const NETWORK_USAGE_START_TIME: DocumentNode;
|
8
|
+
export declare const DISK_USAGE_START_TIME: DocumentNode;
|
9
|
+
export declare const RAM_USAGE_DATE_RANGE: DocumentNode;
|
10
|
+
export declare const CPU_USAGE_DATE_RANGE: DocumentNode;
|
11
|
+
export declare const NETWORK_USAGE_DATE_RANGE: DocumentNode;
|
12
|
+
export declare const DISK_USAGE_DATE_RANGE: DocumentNode;
|
13
|
+
export declare const BACKUP_POINT: DocumentNode;
|
14
|
+
export declare const GET_COMPUTINGS: DocumentNode;
|
15
|
+
export declare const GET_LAB_INSTANCE: DocumentNode;
|
16
|
+
export declare const GET_CLUSTERS: DocumentNode;
|
17
|
+
export declare const GET_CLUSTER: DocumentNode;
|
18
|
+
export declare const GET_COMPUTING_BY_CLUSTER: DocumentNode;
|
19
|
+
export declare const GET_COMPUTING_BY_SERVICE: DocumentNode;
|
20
|
+
export declare const GET_EDGES: DocumentNode;
|
21
|
+
export declare const GET_PORT_NATS_BY_SERVICE_ID: DocumentNode;
|
22
|
+
export declare const GET_TEMPLATE: DocumentNode;
|
23
|
+
export declare const GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID: DocumentNode;
|
24
|
+
export declare const GET_AVAILABLE_STORAGES_FOR_DC: DocumentNode;
|
25
|
+
export declare const GET_RESOUCE_POOL_BY_SERVICE: DocumentNode;
|
26
|
+
export declare const GET_CONSOLE: DocumentNode;
|
27
|
+
export declare const GET_COMPUTING_WAIT_REVOKE: (fields?: string[]) => DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_CONSOLE = exports.GET_RESOUCE_POOL_BY_SERVICE = exports.GET_AVAILABLE_STORAGES_FOR_DC = exports.GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID = exports.GET_TEMPLATE = exports.GET_PORT_NATS_BY_SERVICE_ID = exports.GET_EDGES = exports.GET_COMPUTING_BY_SERVICE = exports.GET_COMPUTING_BY_CLUSTER = exports.GET_CLUSTER = exports.GET_CLUSTERS = exports.GET_LAB_INSTANCE = exports.GET_COMPUTINGS = exports.BACKUP_POINT = exports.DISK_USAGE_DATE_RANGE = exports.NETWORK_USAGE_DATE_RANGE = exports.CPU_USAGE_DATE_RANGE = exports.RAM_USAGE_DATE_RANGE = exports.DISK_USAGE_START_TIME = exports.NETWORK_USAGE_START_TIME = exports.CPU_USAGE_START_TIME = exports.RAM_USAGE_START_TIME = exports.SNAP_SHOTS = exports.PORTNATS = exports.COMPUTING_DETAIL = void 0;
|
3
|
+
exports.GET_COMPUTING_WAIT_REVOKE = exports.GET_CONSOLE = exports.GET_RESOUCE_POOL_BY_SERVICE = exports.GET_AVAILABLE_STORAGES_FOR_DC = exports.GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID = exports.GET_TEMPLATE = exports.GET_PORT_NATS_BY_SERVICE_ID = exports.GET_EDGES = exports.GET_COMPUTING_BY_SERVICE = exports.GET_COMPUTING_BY_CLUSTER = exports.GET_CLUSTER = exports.GET_CLUSTERS = exports.GET_LAB_INSTANCE = exports.GET_COMPUTINGS = exports.BACKUP_POINT = exports.DISK_USAGE_DATE_RANGE = exports.NETWORK_USAGE_DATE_RANGE = exports.CPU_USAGE_DATE_RANGE = exports.RAM_USAGE_DATE_RANGE = exports.DISK_USAGE_START_TIME = exports.NETWORK_USAGE_START_TIME = exports.CPU_USAGE_START_TIME = exports.RAM_USAGE_START_TIME = exports.SNAP_SHOTS = exports.PORTNATS = exports.COMPUTING_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.COMPUTING_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query ComputingDetail($computingId: String!) {
|
@@ -530,3 +530,13 @@ exports.GET_CONSOLE = (0, graphql_tag_1.gql) `
|
|
530
530
|
}
|
531
531
|
}
|
532
532
|
`;
|
533
|
+
const GET_COMPUTING_WAIT_REVOKE = (fields = []) => {
|
534
|
+
const fieldStr = fields.join("\n ");
|
535
|
+
const hasFields = fields.length > 0;
|
536
|
+
return (0, graphql_tag_1.gql) `
|
537
|
+
query GetComputingWaitRevoke($serviceId: String!) {
|
538
|
+
getComputingWaitRevoke(serviceId: $serviceId) ${hasFields ? `{ ${fieldStr} }` : ""}
|
539
|
+
}
|
540
|
+
`;
|
541
|
+
};
|
542
|
+
exports.GET_COMPUTING_WAIT_REVOKE = GET_COMPUTING_WAIT_REVOKE;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DocumentNode } from "graphql";
|
2
2
|
export declare const GET_PRODUCT_BY_ID_QUERY: DocumentNode;
|
3
|
-
export declare const GET_PRODUCT_BY_ID_QUERY_DYNAMIC: (fields
|
3
|
+
export declare const GET_PRODUCT_BY_ID_QUERY_DYNAMIC: (fields?: string[]) => DocumentNode;
|
4
4
|
export declare const GET_PRODUCT_BY_SLUG_QUERY: DocumentNode;
|
5
5
|
export declare const GET_SIMPLE_PRODUCTS_QUERY: DocumentNode;
|
6
6
|
export declare const GET_CATEGORIES_QUERY: DocumentNode;
|
@@ -12,7 +12,7 @@ export declare const GET_BRAND_DETAIL_QUERY = "\n query GetBrandDetail($partner
|
|
12
12
|
export declare const GET_PRODUCT_OPTION: DocumentNode;
|
13
13
|
export declare const GET_POLICY: DocumentNode;
|
14
14
|
export declare const GET_PRODUCTS: DocumentNode;
|
15
|
-
export declare const GET_PRODUCTS_DYNAMIC: (fields
|
15
|
+
export declare const GET_PRODUCTS_DYNAMIC: (fields?: string[]) => DocumentNode;
|
16
16
|
export declare const GET_HANDLE_BY_SERVICETYPE: DocumentNode;
|
17
17
|
export declare const GET_RESOURCE_BY_PRODUCT: DocumentNode;
|
18
18
|
export declare const GET_PRODUCT_VARIANT_BY_ID: DocumentNode;
|
@@ -192,8 +192,9 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
|
|
192
192
|
}
|
193
193
|
}
|
194
194
|
`;
|
195
|
-
const GET_PRODUCT_BY_ID_QUERY_DYNAMIC = (fields) => {
|
195
|
+
const GET_PRODUCT_BY_ID_QUERY_DYNAMIC = (fields = []) => {
|
196
196
|
const fieldStr = fields.join("\n ");
|
197
|
+
const hasFields = fields.length > 0;
|
197
198
|
return (0, graphql_tag_1.gql) `
|
198
199
|
query GetProductById(
|
199
200
|
$partnerId: String!
|
@@ -204,9 +205,7 @@ const GET_PRODUCT_BY_ID_QUERY_DYNAMIC = (fields) => {
|
|
204
205
|
partnerId: $partnerId
|
205
206
|
storeChannel: $storeChannel
|
206
207
|
productId: $productId
|
207
|
-
) {
|
208
|
-
${fieldStr}
|
209
|
-
}
|
208
|
+
) ${hasFields ? `{ ${fieldStr} }` : ""}
|
210
209
|
}
|
211
210
|
`;
|
212
211
|
};
|
@@ -687,8 +686,9 @@ exports.GET_PRODUCTS = (0, graphql_tag_1.gql) `
|
|
687
686
|
}
|
688
687
|
}
|
689
688
|
`;
|
690
|
-
const GET_PRODUCTS_DYNAMIC = (fields) => {
|
689
|
+
const GET_PRODUCTS_DYNAMIC = (fields = []) => {
|
691
690
|
const fieldStr = fields.join("\n ");
|
691
|
+
const hasFields = fields.length > 0;
|
692
692
|
return (0, graphql_tag_1.gql) `
|
693
693
|
query GetProducts(
|
694
694
|
$partnerId: String!
|
@@ -773,7 +773,7 @@ const GET_PRODUCTS_DYNAMIC = (fields) => {
|
|
773
773
|
maxResult
|
774
774
|
totalPage
|
775
775
|
data {
|
776
|
-
${fieldStr}
|
776
|
+
${hasFields ? `${fieldStr}` : ""}
|
777
777
|
}
|
778
778
|
}
|
779
779
|
}
|
@@ -35,4 +35,5 @@ export declare class CloudService extends Service {
|
|
35
35
|
getContactsByOwnerId(ownerId: string): Promise<any>;
|
36
36
|
getWhoisDomainInfo(domainName: string): Promise<any>;
|
37
37
|
getDomainSupplier(serviceId: string): Promise<any>;
|
38
|
+
checkDomainExist(domainName: string): Promise<any>;
|
38
39
|
}
|
@@ -425,5 +425,19 @@ class CloudService extends serviceSDK_1.Service {
|
|
425
425
|
}
|
426
426
|
});
|
427
427
|
}
|
428
|
+
checkDomainExist(domainName) {
|
429
|
+
return __awaiter(this, void 0, void 0, function* () {
|
430
|
+
const query = queries_1.CHECK_DOMAIN_EXIST;
|
431
|
+
const variables = { domainName };
|
432
|
+
try {
|
433
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
434
|
+
return response.checkDomainExist;
|
435
|
+
}
|
436
|
+
catch (error) {
|
437
|
+
console.log(`Error in checkDomainExist: ${error}`);
|
438
|
+
throw error;
|
439
|
+
}
|
440
|
+
});
|
441
|
+
}
|
428
442
|
}
|
429
443
|
exports.CloudService = CloudService;
|
@@ -50,7 +50,11 @@ export declare class ComputingService extends Service {
|
|
50
50
|
getAvailableSubnetIPsByResourcePoolId(resourcePoolId: string): Promise<any>;
|
51
51
|
getAvailableStoragesForDC(resourcePoolId: string): Promise<any>;
|
52
52
|
getResourcePoolsByService(serviceId: string): Promise<any>;
|
53
|
-
createComputingForDC(data: any): Promise<any>;
|
53
|
+
createComputingForDC(data: any, createBy: string): Promise<any>;
|
54
54
|
updateNameComputing(computingId: string, name: string, updateBy: string): Promise<any>;
|
55
55
|
getConsole(computingId: string): Promise<any>;
|
56
|
+
getComputingWaitRevoke(serviceId: string, fields: string[]): Promise<any>;
|
57
|
+
computingWaitingRevoke(computingId: string, userId: string, fields: string[]): Promise<any>;
|
58
|
+
restoreComputingWaitingRevoke(computingId: string, userId: string, fields: string[]): Promise<any>;
|
59
|
+
deleteComputing(computingId: string, userId: string, fields: string[]): Promise<any>;
|
56
60
|
}
|
@@ -709,7 +709,7 @@ class ComputingService extends serviceSDK_1.Service {
|
|
709
709
|
}
|
710
710
|
});
|
711
711
|
}
|
712
|
-
createComputingForDC(data) {
|
712
|
+
createComputingForDC(data, createBy) {
|
713
713
|
return __awaiter(this, void 0, void 0, function* () {
|
714
714
|
const mutation = mutations_1.CREATE_COMPUTING_FOR_DC;
|
715
715
|
const variables = {
|
@@ -723,6 +723,7 @@ class ComputingService extends serviceSDK_1.Service {
|
|
723
723
|
ram: data === null || data === void 0 ? void 0 : data.ram,
|
724
724
|
resourcePoolId: data === null || data === void 0 ? void 0 : data.resourcePoolId,
|
725
725
|
disks: data === null || data === void 0 ? void 0 : data.disks,
|
726
|
+
createBy,
|
726
727
|
};
|
727
728
|
try {
|
728
729
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
@@ -768,5 +769,72 @@ class ComputingService extends serviceSDK_1.Service {
|
|
768
769
|
}
|
769
770
|
});
|
770
771
|
}
|
772
|
+
getComputingWaitRevoke(serviceId, fields) {
|
773
|
+
return __awaiter(this, void 0, void 0, function* () {
|
774
|
+
const query = (0, queries_1.GET_COMPUTING_WAIT_REVOKE)(fields);
|
775
|
+
const variables = {
|
776
|
+
serviceId,
|
777
|
+
};
|
778
|
+
try {
|
779
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
780
|
+
return response.getComputingWaitRevoke;
|
781
|
+
}
|
782
|
+
catch (error) {
|
783
|
+
console.log(`Error fetching get getComputingWaitRevoke method: ${error}`);
|
784
|
+
throw error;
|
785
|
+
}
|
786
|
+
});
|
787
|
+
}
|
788
|
+
computingWaitingRevoke(computingId, userId, fields) {
|
789
|
+
return __awaiter(this, void 0, void 0, function* () {
|
790
|
+
const query = (0, mutations_1.COMPUTING_WAITING_REVOKE)(fields);
|
791
|
+
const variables = {
|
792
|
+
computingId,
|
793
|
+
userId,
|
794
|
+
};
|
795
|
+
try {
|
796
|
+
const response = yield this.graphqlMutationV2(query, variables);
|
797
|
+
return response.computingWaitingRevoke;
|
798
|
+
}
|
799
|
+
catch (error) {
|
800
|
+
console.log(`Error fetching get computingWaitingRevoke method: ${error}`);
|
801
|
+
throw error;
|
802
|
+
}
|
803
|
+
});
|
804
|
+
}
|
805
|
+
restoreComputingWaitingRevoke(computingId, userId, fields) {
|
806
|
+
return __awaiter(this, void 0, void 0, function* () {
|
807
|
+
const query = (0, mutations_1.RESTORE_COMPUTING_WAITING_REVOKE)(fields);
|
808
|
+
const variables = {
|
809
|
+
computingId,
|
810
|
+
userId,
|
811
|
+
};
|
812
|
+
try {
|
813
|
+
const response = yield this.graphqlMutationV2(query, variables);
|
814
|
+
return response.restoreComputingWaitingRevoke;
|
815
|
+
}
|
816
|
+
catch (error) {
|
817
|
+
console.log(`Error fetching get restoreComputingWaitingRevoke method: ${error}`);
|
818
|
+
throw error;
|
819
|
+
}
|
820
|
+
});
|
821
|
+
}
|
822
|
+
deleteComputing(computingId, userId, fields) {
|
823
|
+
return __awaiter(this, void 0, void 0, function* () {
|
824
|
+
const query = (0, mutations_1.DELETE_COMPUTING)(fields);
|
825
|
+
const variables = {
|
826
|
+
computingId,
|
827
|
+
userId,
|
828
|
+
};
|
829
|
+
try {
|
830
|
+
const response = yield this.graphqlMutationV2(query, variables);
|
831
|
+
return response.deleteComputing;
|
832
|
+
}
|
833
|
+
catch (error) {
|
834
|
+
console.log(`Error fetching get deleteComputing method: ${error}`);
|
835
|
+
throw error;
|
836
|
+
}
|
837
|
+
});
|
838
|
+
}
|
771
839
|
}
|
772
840
|
exports.ComputingService = ComputingService;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function buildFieldString(fields: (string | Record<string, any>)[], indent?: number): string;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.buildFieldString = void 0;
|
4
|
+
function buildFieldString(fields, indent = 6) {
|
5
|
+
const space = " ".repeat(indent);
|
6
|
+
return fields
|
7
|
+
.map((field) => {
|
8
|
+
if (typeof field === "string")
|
9
|
+
return `${space}${field}`;
|
10
|
+
const [key, value] = Object.entries(field)[0];
|
11
|
+
const nested = buildFieldString(value, indent + 2);
|
12
|
+
return `${space}${key} {\n${nested}\n${space}}`;
|
13
|
+
})
|
14
|
+
.join("\n");
|
15
|
+
}
|
16
|
+
exports.buildFieldString = buildFieldString;
|