@longvansoftware/service-js-client 1.0.2
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/README.md +93 -0
- package/dist/config/config.d.ts +26 -0
- package/dist/config/config.js +29 -0
- package/dist/src/graphql/auth/mutations.d.ts +7 -0
- package/dist/src/graphql/auth/mutations.js +99 -0
- package/dist/src/graphql/auth/queries.d.ts +1 -0
- package/dist/src/graphql/auth/queries.js +25 -0
- package/dist/src/graphql/cloud/mutations.d.ts +8 -0
- package/dist/src/graphql/cloud/mutations.js +115 -0
- package/dist/src/graphql/cloud/queries.d.ts +5 -0
- package/dist/src/graphql/cloud/queries.js +121 -0
- package/dist/src/graphql/computing/mutations.d.ts +10 -0
- package/dist/src/graphql/computing/mutations.js +110 -0
- package/dist/src/graphql/computing/queries.d.ts +3 -0
- package/dist/src/graphql/computing/queries.js +48 -0
- package/dist/src/graphql/crm/mutations.d.ts +8 -0
- package/dist/src/graphql/crm/mutations.js +316 -0
- package/dist/src/graphql/crm/queries.d.ts +7 -0
- package/dist/src/graphql/crm/queries.js +281 -0
- package/dist/src/graphql/payment/mutations.d.ts +1 -0
- package/dist/src/graphql/payment/mutations.js +35 -0
- package/dist/src/graphql/payment/queries.d.ts +2 -0
- package/dist/src/graphql/payment/queries.js +23 -0
- package/dist/src/graphql/product/mutations.d.ts +0 -0
- package/dist/src/graphql/product/mutations.js +1 -0
- package/dist/src/graphql/product/queries.d.ts +11 -0
- package/dist/src/graphql/product/queries.js +431 -0
- package/dist/src/graphql/service/mutations.d.ts +10 -0
- package/dist/src/graphql/service/mutations.js +284 -0
- package/dist/src/graphql/service/queries.d.ts +6 -0
- package/dist/src/graphql/service/queries.js +174 -0
- package/dist/src/graphql/user/mutations.d.ts +4 -0
- package/dist/src/graphql/user/mutations.js +118 -0
- package/dist/src/graphql/user/queries.d.ts +13 -0
- package/dist/src/graphql/user/queries.js +252 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/lib/SDK.d.ts +42 -0
- package/dist/src/lib/SDK.js +71 -0
- package/dist/src/lib/auth/index.d.ts +27 -0
- package/dist/src/lib/auth/index.js +72 -0
- package/dist/src/lib/cloud/index.d.ts +25 -0
- package/dist/src/lib/cloud/index.js +248 -0
- package/dist/src/lib/computing/index.d.ts +25 -0
- package/dist/src/lib/computing/index.js +254 -0
- package/dist/src/lib/crm/index.d.ts +21 -0
- package/dist/src/lib/crm/index.js +296 -0
- package/dist/src/lib/order/index.d.ts +452 -0
- package/dist/src/lib/order/index.js +1204 -0
- package/dist/src/lib/payment/index.d.ts +7 -0
- package/dist/src/lib/payment/index.js +69 -0
- package/dist/src/lib/product/index.d.ts +37 -0
- package/dist/src/lib/product/index.js +132 -0
- package/dist/src/lib/service/index.d.ts +94 -0
- package/dist/src/lib/service/index.js +348 -0
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/lib/serviceSDK.d.ts +18 -0
- package/dist/src/lib/serviceSDK.js +187 -0
- package/dist/src/lib/user/index.d.ts +23 -0
- package/dist/src/lib/user/index.js +345 -0
- package/dist/src/lib/warehouse/index.d.ts +20 -0
- package/dist/src/lib/warehouse/index.js +48 -0
- package/dist/src/types/auth.d.ts +82 -0
- package/dist/src/types/auth.js +2 -0
- package/dist/src/types/cloud.d.ts +40 -0
- package/dist/src/types/cloud.js +2 -0
- package/dist/src/types/computing.d.ts +16 -0
- package/dist/src/types/computing.js +2 -0
- package/dist/src/types/crm.d.ts +291 -0
- package/dist/src/types/crm.js +2 -0
- package/dist/src/types/order.d.ts +54 -0
- package/dist/src/types/order.js +2 -0
- package/dist/src/types/product.d.ts +63 -0
- package/dist/src/types/product.js +2 -0
- package/dist/src/types/service.d.ts +29 -0
- package/dist/src/types/service.js +2 -0
- package/dist/src/types/user.d.ts +95 -0
- package/dist/src/types/user.js +2 -0
- package/dist/src/types/warehouse.d.ts +5 -0
- package/dist/src/types/warehouse.js +2 -0
- package/dist/src/utils/helpers.d.ts +4 -0
- package/dist/src/utils/helpers.js +41 -0
- package/package.json +43 -0
@@ -0,0 +1,248 @@
|
|
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.CloudService = void 0;
|
13
|
+
const mutations_1 = require("../../graphql/cloud/mutations");
|
14
|
+
const queries_1 = require("../../graphql/cloud/queries");
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
16
|
+
class CloudService extends serviceSDK_1.Service {
|
17
|
+
/**
|
18
|
+
* Constructs a new OrderService instance.
|
19
|
+
* @param endpoint - The endpoint URL for the service.
|
20
|
+
* @param orgId - The organization ID.
|
21
|
+
* @param storeId - The store ID.
|
22
|
+
*/
|
23
|
+
constructor(endpoint, orgId, storeId) {
|
24
|
+
super(endpoint, orgId, storeId);
|
25
|
+
}
|
26
|
+
setToken(token) {
|
27
|
+
this.token = token;
|
28
|
+
}
|
29
|
+
serviceDetail(serviceId) {
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
31
|
+
const query = queries_1.SERVICE_DETAIL;
|
32
|
+
const variables = {
|
33
|
+
serviceId,
|
34
|
+
};
|
35
|
+
try {
|
36
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
37
|
+
return response.serviceDetail;
|
38
|
+
}
|
39
|
+
catch (error) {
|
40
|
+
console.log(`Error in serviceDetail: ${error}`);
|
41
|
+
throw error;
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
45
|
+
getMailResource(serviceId) {
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
47
|
+
const query = queries_1.GET_MAIL_RESOURCE;
|
48
|
+
const variables = {
|
49
|
+
serviceId,
|
50
|
+
};
|
51
|
+
try {
|
52
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
53
|
+
return response.getMailResource;
|
54
|
+
}
|
55
|
+
catch (error) {
|
56
|
+
console.log(`Error in getMailResource: ${error}`);
|
57
|
+
throw error;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
}
|
61
|
+
changeServiceName(serviceId, updateBy, name) {
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
63
|
+
const mutation = mutations_1.CHANGE_SERVICE_NAME;
|
64
|
+
const variables = {
|
65
|
+
serviceId,
|
66
|
+
updateBy,
|
67
|
+
name,
|
68
|
+
};
|
69
|
+
try {
|
70
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
71
|
+
return response.changeServiceName;
|
72
|
+
}
|
73
|
+
catch (error) {
|
74
|
+
console.log(`Error in changeServiceName: ${error}`);
|
75
|
+
throw error;
|
76
|
+
}
|
77
|
+
});
|
78
|
+
}
|
79
|
+
getUserMailHosting(serviceId) {
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
81
|
+
const query = queries_1.GET_USER_MAIL_HOSTING;
|
82
|
+
const variables = {
|
83
|
+
serviceId,
|
84
|
+
};
|
85
|
+
try {
|
86
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
87
|
+
return response.getUserMailHosting;
|
88
|
+
}
|
89
|
+
catch (error) {
|
90
|
+
console.log(`Error in getUserMailHosting: ${error}`);
|
91
|
+
throw error;
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
createUserMailHosting(payload) {
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
97
|
+
const mutation = mutations_1.CREATE_USER_MAIL_HOSTING;
|
98
|
+
const variables = {
|
99
|
+
serviceId: payload.serviceId,
|
100
|
+
username: payload.username,
|
101
|
+
password: payload.password,
|
102
|
+
fullName: payload.fullName,
|
103
|
+
};
|
104
|
+
try {
|
105
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
106
|
+
return response.createUserMailHosting;
|
107
|
+
}
|
108
|
+
catch (error) {
|
109
|
+
console.log(`Error in createUserMailHosting: ${error}`);
|
110
|
+
throw error;
|
111
|
+
}
|
112
|
+
});
|
113
|
+
}
|
114
|
+
updateUserPassword(payload) {
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
116
|
+
const mutation = mutations_1.UPDATE_USER_PASSWORD;
|
117
|
+
const variables = {
|
118
|
+
serviceId: payload.serviceId,
|
119
|
+
username: payload.username,
|
120
|
+
password: payload.password,
|
121
|
+
};
|
122
|
+
try {
|
123
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
124
|
+
return response.updateUserPassword;
|
125
|
+
}
|
126
|
+
catch (error) {
|
127
|
+
console.log(`Error in updateUserPassword: ${error}`);
|
128
|
+
throw error;
|
129
|
+
}
|
130
|
+
});
|
131
|
+
}
|
132
|
+
deleteUserMailHosting(payload) {
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
134
|
+
const mutation = mutations_1.DELETE_USER_MAIL_HOSTING;
|
135
|
+
const variables = {
|
136
|
+
serviceId: payload.serviceId,
|
137
|
+
username: payload.username,
|
138
|
+
};
|
139
|
+
try {
|
140
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
141
|
+
return response.deleteUserMailHosting;
|
142
|
+
}
|
143
|
+
catch (error) {
|
144
|
+
console.log(`Error in deleteUserMailHosting: ${error}`);
|
145
|
+
throw error;
|
146
|
+
}
|
147
|
+
});
|
148
|
+
}
|
149
|
+
updateDomainName(payload) {
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
151
|
+
const mutation = mutations_1.UPDATE_DOMAIN_NAME;
|
152
|
+
const variables = {
|
153
|
+
serviceId: payload.serviceId,
|
154
|
+
updateBy: payload.useUpdate,
|
155
|
+
updateData: payload.valueUpdate,
|
156
|
+
};
|
157
|
+
try {
|
158
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
159
|
+
return response.updateDomainName;
|
160
|
+
}
|
161
|
+
catch (error) {
|
162
|
+
console.log(`Error in updateDomainName: ${error}`);
|
163
|
+
throw error;
|
164
|
+
}
|
165
|
+
});
|
166
|
+
}
|
167
|
+
updateUsername(payload) {
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
169
|
+
const mutation = mutations_1.UPDATE_USER_NAME;
|
170
|
+
const variables = {
|
171
|
+
serviceId: payload.serviceId,
|
172
|
+
updateBy: payload.useUpdate,
|
173
|
+
updateData: payload.valueUpdate,
|
174
|
+
};
|
175
|
+
try {
|
176
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
177
|
+
return response.updateUsername;
|
178
|
+
}
|
179
|
+
catch (error) {
|
180
|
+
console.log(`Error in updateUsername: ${error}`);
|
181
|
+
throw error;
|
182
|
+
}
|
183
|
+
});
|
184
|
+
}
|
185
|
+
updatePassword(payload) {
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
187
|
+
const mutation = mutations_1.UPDATE_PASSWORD;
|
188
|
+
const variables = {
|
189
|
+
serviceId: payload.serviceId,
|
190
|
+
updateBy: payload.useUpdate,
|
191
|
+
updateData: payload.valueUpdate,
|
192
|
+
};
|
193
|
+
try {
|
194
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
195
|
+
return response.updatePassword;
|
196
|
+
}
|
197
|
+
catch (error) {
|
198
|
+
console.log(`Error in updatePassword: ${error}`);
|
199
|
+
throw error;
|
200
|
+
}
|
201
|
+
});
|
202
|
+
}
|
203
|
+
serviceTypes() {
|
204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
205
|
+
const query = queries_1.SERVICE_TYPE;
|
206
|
+
const variables = {};
|
207
|
+
try {
|
208
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
209
|
+
return response.serviceTypes;
|
210
|
+
}
|
211
|
+
catch (error) {
|
212
|
+
console.log(`Error in serviceTypes: ${error}`);
|
213
|
+
throw error;
|
214
|
+
}
|
215
|
+
});
|
216
|
+
}
|
217
|
+
searchService(filter) {
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
219
|
+
const query = queries_1.SEARCH_SERVICE;
|
220
|
+
const variables = {
|
221
|
+
filter,
|
222
|
+
};
|
223
|
+
try {
|
224
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
225
|
+
return response.searchService;
|
226
|
+
}
|
227
|
+
catch (error) {
|
228
|
+
console.log(`Error in searchService: ${error}`);
|
229
|
+
throw error;
|
230
|
+
}
|
231
|
+
});
|
232
|
+
}
|
233
|
+
updateDNS(payload) {
|
234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
235
|
+
const mutation = mutations_1.UPDATE_DNS;
|
236
|
+
const variables = Object.assign({}, payload);
|
237
|
+
try {
|
238
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
239
|
+
return response.updateDNS;
|
240
|
+
}
|
241
|
+
catch (error) {
|
242
|
+
console.log(`Error in updateDNS: ${error}`);
|
243
|
+
throw error;
|
244
|
+
}
|
245
|
+
});
|
246
|
+
}
|
247
|
+
}
|
248
|
+
exports.CloudService = CloudService;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { CreatePortNat, CreateSnapShot, RollBackSnapShot, UpdateDescriptionPortNat } from "../../types/computing";
|
2
|
+
import { Service } from "../serviceSDK";
|
3
|
+
export declare class ComputingService extends Service {
|
4
|
+
/**
|
5
|
+
* Constructs a new OrderService instance.
|
6
|
+
* @param endpoint - The endpoint URL for the service.
|
7
|
+
* @param orgId - The organization ID.
|
8
|
+
* @param storeId - The store ID.
|
9
|
+
*/
|
10
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
11
|
+
setToken(token: string): void;
|
12
|
+
computingDetail(computingId: string): Promise<any>;
|
13
|
+
portNats(computingId: string): Promise<any>;
|
14
|
+
restartVM(computingId: string, actor: string): Promise<any>;
|
15
|
+
updateDescriptionPortNat(payload: UpdateDescriptionPortNat, updateBy: string): Promise<any>;
|
16
|
+
createPortNat(payload: CreatePortNat, createBy: string): Promise<any>;
|
17
|
+
updatePortNat(payload: CreatePortNat, updateBy: string): Promise<any>;
|
18
|
+
removePortNat(portNatId: string, updateBy: string): Promise<any>;
|
19
|
+
startVM(computingId: string, actor: string): Promise<any>;
|
20
|
+
stopVM(computingId: string, actor: string): Promise<any>;
|
21
|
+
snapshots(computingId: string): Promise<any>;
|
22
|
+
createSnapshot(payload: CreateSnapShot, createBy: string): Promise<any>;
|
23
|
+
rollbackSnapshot(payload: RollBackSnapShot, createBy: string): Promise<any>;
|
24
|
+
deleteSnapshot(payload: RollBackSnapShot, updateBy: string): Promise<any>;
|
25
|
+
}
|
@@ -0,0 +1,254 @@
|
|
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.ComputingService = void 0;
|
13
|
+
const mutations_1 = require("../../graphql/computing/mutations");
|
14
|
+
const queries_1 = require("../../graphql/computing/queries");
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
16
|
+
class ComputingService extends serviceSDK_1.Service {
|
17
|
+
/**
|
18
|
+
* Constructs a new OrderService instance.
|
19
|
+
* @param endpoint - The endpoint URL for the service.
|
20
|
+
* @param orgId - The organization ID.
|
21
|
+
* @param storeId - The store ID.
|
22
|
+
*/
|
23
|
+
constructor(endpoint, orgId, storeId) {
|
24
|
+
super(endpoint, orgId, storeId);
|
25
|
+
}
|
26
|
+
setToken(token) {
|
27
|
+
this.token = token;
|
28
|
+
}
|
29
|
+
computingDetail(computingId) {
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
31
|
+
const query = queries_1.COMPUTING_DETAIL;
|
32
|
+
const variables = {
|
33
|
+
computingId,
|
34
|
+
};
|
35
|
+
try {
|
36
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
37
|
+
return response.computingDetail;
|
38
|
+
}
|
39
|
+
catch (error) {
|
40
|
+
console.log(`Error in computingDetail: ${error}`);
|
41
|
+
throw error;
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
45
|
+
portNats(computingId) {
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
47
|
+
const query = queries_1.PORTNATS;
|
48
|
+
const variables = {
|
49
|
+
computingId,
|
50
|
+
};
|
51
|
+
try {
|
52
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
53
|
+
return response.portNats;
|
54
|
+
}
|
55
|
+
catch (error) {
|
56
|
+
console.log(`Error in portNats: ${error}`);
|
57
|
+
throw error;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
}
|
61
|
+
restartVM(computingId, actor) {
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
63
|
+
const mutation = mutations_1.RESTARTVM;
|
64
|
+
const variables = {
|
65
|
+
computingId,
|
66
|
+
actor,
|
67
|
+
};
|
68
|
+
try {
|
69
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
70
|
+
return response.restart;
|
71
|
+
}
|
72
|
+
catch (error) {
|
73
|
+
console.log(`Error in restartVM: ${error}`);
|
74
|
+
throw error;
|
75
|
+
}
|
76
|
+
});
|
77
|
+
}
|
78
|
+
updateDescriptionPortNat(payload, updateBy) {
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
80
|
+
const mutation = mutations_1.UPDATE_DESCRIPTION_PORTNAT;
|
81
|
+
const variables = {
|
82
|
+
portNatId: payload.portNatId,
|
83
|
+
description: payload.description,
|
84
|
+
updateBy,
|
85
|
+
};
|
86
|
+
try {
|
87
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
88
|
+
return response.updateDescriptionPortNat;
|
89
|
+
}
|
90
|
+
catch (error) {
|
91
|
+
console.log(`Error in updateDescriptionPortNat: ${error}`);
|
92
|
+
throw error;
|
93
|
+
}
|
94
|
+
});
|
95
|
+
}
|
96
|
+
createPortNat(payload, createBy) {
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
98
|
+
const mutation = mutations_1.CREATE_PORT_NAT;
|
99
|
+
const variables = {
|
100
|
+
portNatId: payload.portNatId,
|
101
|
+
translatedPort: payload.translatedPort,
|
102
|
+
createBy,
|
103
|
+
};
|
104
|
+
try {
|
105
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
106
|
+
return response.createPortNat;
|
107
|
+
}
|
108
|
+
catch (error) {
|
109
|
+
console.log(`Error in createPortNat: ${error}`);
|
110
|
+
throw error;
|
111
|
+
}
|
112
|
+
});
|
113
|
+
}
|
114
|
+
updatePortNat(payload, updateBy) {
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
116
|
+
const mutation = mutations_1.UPDATE_PORT_NAT;
|
117
|
+
const variables = {
|
118
|
+
portNatId: payload.portNatId,
|
119
|
+
translatedPort: payload.translatedPort,
|
120
|
+
updateBy,
|
121
|
+
};
|
122
|
+
try {
|
123
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
124
|
+
return response.updatePortNat;
|
125
|
+
}
|
126
|
+
catch (error) {
|
127
|
+
console.log(`Error in updatePortNat: ${error}`);
|
128
|
+
throw error;
|
129
|
+
}
|
130
|
+
});
|
131
|
+
}
|
132
|
+
removePortNat(portNatId, updateBy) {
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
134
|
+
const mutation = mutations_1.REMOVE_PORT_NAT;
|
135
|
+
const variables = {
|
136
|
+
portNatId,
|
137
|
+
updateBy,
|
138
|
+
};
|
139
|
+
try {
|
140
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
141
|
+
return response.removePortNat;
|
142
|
+
}
|
143
|
+
catch (error) {
|
144
|
+
console.log(`Error in removePortNat: ${error}`);
|
145
|
+
throw error;
|
146
|
+
}
|
147
|
+
});
|
148
|
+
}
|
149
|
+
startVM(computingId, actor) {
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
151
|
+
const mutation = mutations_1.POWER_ON;
|
152
|
+
const variables = {
|
153
|
+
computingId,
|
154
|
+
actor,
|
155
|
+
};
|
156
|
+
try {
|
157
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
158
|
+
return response.powerOn;
|
159
|
+
}
|
160
|
+
catch (error) {
|
161
|
+
console.log(`Error in startVM: ${error}`);
|
162
|
+
throw error;
|
163
|
+
}
|
164
|
+
});
|
165
|
+
}
|
166
|
+
stopVM(computingId, actor) {
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
168
|
+
const mutation = mutations_1.POWER_OFF;
|
169
|
+
const variables = {
|
170
|
+
computingId,
|
171
|
+
actor,
|
172
|
+
};
|
173
|
+
try {
|
174
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
175
|
+
return response.powerOff;
|
176
|
+
}
|
177
|
+
catch (error) {
|
178
|
+
console.log(`Error in stopVM: ${error}`);
|
179
|
+
throw error;
|
180
|
+
}
|
181
|
+
});
|
182
|
+
}
|
183
|
+
snapshots(computingId) {
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
185
|
+
const query = queries_1.SNAP_SHOTS;
|
186
|
+
const variables = {
|
187
|
+
computingId,
|
188
|
+
};
|
189
|
+
try {
|
190
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
191
|
+
return response.snapshots;
|
192
|
+
}
|
193
|
+
catch (error) {
|
194
|
+
console.log(`Error in snapshots: ${error}`);
|
195
|
+
throw error;
|
196
|
+
}
|
197
|
+
});
|
198
|
+
}
|
199
|
+
createSnapshot(payload, createBy) {
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
201
|
+
const mutation = mutations_1.CREATE_SNAP_SHOT;
|
202
|
+
const variables = {
|
203
|
+
computingId: payload.computingId,
|
204
|
+
snapshotName: payload.snapshotName,
|
205
|
+
createBy,
|
206
|
+
};
|
207
|
+
try {
|
208
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
209
|
+
return response.createSnapshot;
|
210
|
+
}
|
211
|
+
catch (error) {
|
212
|
+
console.log(`Error in createSnapshot: ${error}`);
|
213
|
+
throw error;
|
214
|
+
}
|
215
|
+
});
|
216
|
+
}
|
217
|
+
rollbackSnapshot(payload, createBy) {
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
219
|
+
const mutation = mutations_1.ROLLBACK_SNAPSHOT;
|
220
|
+
const variables = {
|
221
|
+
computingId: payload.computingId,
|
222
|
+
snapshotId: payload.snapshotId,
|
223
|
+
createBy,
|
224
|
+
};
|
225
|
+
try {
|
226
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
227
|
+
return response.rollbackSnapshot;
|
228
|
+
}
|
229
|
+
catch (error) {
|
230
|
+
console.log(`Error in rollbackSnapshot: ${error}`);
|
231
|
+
throw error;
|
232
|
+
}
|
233
|
+
});
|
234
|
+
}
|
235
|
+
deleteSnapshot(payload, updateBy) {
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
237
|
+
const mutation = mutations_1.DELETE_SNAPSHOT;
|
238
|
+
const variables = {
|
239
|
+
computingId: payload.computingId,
|
240
|
+
snapshotId: payload.snapshotId,
|
241
|
+
updateBy,
|
242
|
+
};
|
243
|
+
try {
|
244
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
245
|
+
return response.deleteSnapshot;
|
246
|
+
}
|
247
|
+
catch (error) {
|
248
|
+
console.log(`Error in deleteSnapshot: ${error}`);
|
249
|
+
throw error;
|
250
|
+
}
|
251
|
+
});
|
252
|
+
}
|
253
|
+
}
|
254
|
+
exports.ComputingService = ComputingService;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { AddAttachmentRequest, AddOpportunityRequest, AddTicketRequest, GetCommentRequest, GetOpportunityRequest, getTicketRequest } from "../../types/crm";
|
2
|
+
import { Service } from "../serviceSDK";
|
3
|
+
export declare class CrmService extends Service {
|
4
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
5
|
+
setToken(token: string): void;
|
6
|
+
addOpportunity(addOpportunityRequest: AddOpportunityRequest, performerId: string): Promise<any>;
|
7
|
+
getListOpportunity(performerId: string, getOpportunityRequest: GetOpportunityRequest): Promise<any>;
|
8
|
+
getListTodo(workEffortId: string[]): Promise<any>;
|
9
|
+
getListWorkEffortType(id: string): Promise<any>;
|
10
|
+
updateStatusAttachmentById(performerId: string, attachmentId: string, status: string): Promise<any>;
|
11
|
+
updateWorkEffortDescription(performerId: string, workEffortId: string, description: string): Promise<any>;
|
12
|
+
updateWorkEffortName(performerId: string, workEffortId: string, name: string): Promise<any>;
|
13
|
+
updateWorkEffortStatus(performerId: string, workEffortId: string, source: string, status: string): Promise<any>;
|
14
|
+
addAttachmentForWorkEffort(performerId: string, workEffortId: string, attachments: [{}]): Promise<any>;
|
15
|
+
getListTicket(performerId: string, getTicketRequest: getTicketRequest): Promise<any>;
|
16
|
+
addTicket(performerId: string, addTicketRequest: AddTicketRequest, addAttachmentRequest: [AddAttachmentRequest]): Promise<any>;
|
17
|
+
getTicketById(ticketId: string): Promise<any>;
|
18
|
+
getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
|
19
|
+
getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
|
20
|
+
addComment(params: any): Promise<any>;
|
21
|
+
}
|