@longvansoftware/service-js-client 1.9.1 → 1.9.3
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/computing/mutations.d.ts +1 -0
- package/dist/src/graphql/computing/mutations.js +28 -1
- package/dist/src/graphql/computing/queries.d.ts +2 -0
- package/dist/src/graphql/computing/queries.js +29 -1
- package/dist/src/lib/computing/index.d.ts +3 -0
- package/dist/src/lib/computing/index.js +46 -0
- package/dist/src/lib/orderGraphQL/index.js +2 -2
- package/dist/src/lib/serviceSDK.js +6 -0
- package/package.json +1 -1
@@ -12,3 +12,4 @@ export declare const CREATE_CLUSTER: import("graphql").DocumentNode;
|
|
12
12
|
export declare const ADD_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
|
13
13
|
export declare const REMOVE_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
|
14
14
|
export declare const STOP_USE_COMPUTING: import("graphql").DocumentNode;
|
15
|
+
export declare const ADD_PORT_NAT: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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.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!) {
|
@@ -181,3 +181,30 @@ exports.STOP_USE_COMPUTING = (0, graphql_tag_1.gql) `
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
`;
|
184
|
+
exports.ADD_PORT_NAT = (0, graphql_tag_1.gql) `
|
185
|
+
mutation AddPortNat(
|
186
|
+
$edgeId: String!
|
187
|
+
$serviceId: String
|
188
|
+
$computingId: String
|
189
|
+
$originalAddress: String!
|
190
|
+
$originalPort: String!
|
191
|
+
$translatedAddress: String!
|
192
|
+
$translatedPort: String!
|
193
|
+
$action: String!
|
194
|
+
$description: String
|
195
|
+
$createBy: String
|
196
|
+
) {
|
197
|
+
addPortNat(
|
198
|
+
edgeId: $edgeId
|
199
|
+
serviceId: $serviceId
|
200
|
+
computingId: $computingId
|
201
|
+
originalAddress: $originalAddress
|
202
|
+
originalPort: $originalPort
|
203
|
+
translatedAddress: $translatedAddress
|
204
|
+
translatedPort: $translatedPort
|
205
|
+
action: $action
|
206
|
+
description: $description
|
207
|
+
createBy: $createBy
|
208
|
+
)
|
209
|
+
}
|
210
|
+
`;
|
@@ -16,3 +16,5 @@ export declare const GET_CLUSTERS: import("graphql").DocumentNode;
|
|
16
16
|
export declare const GET_CLUSTER: import("graphql").DocumentNode;
|
17
17
|
export declare const GET_COMPUTING_BY_CLUSTER: import("graphql").DocumentNode;
|
18
18
|
export declare const GET_COMPUTING_BY_SERVICE: import("graphql").DocumentNode;
|
19
|
+
export declare const GET_EDGES: import("graphql").DocumentNode;
|
20
|
+
export declare const GET_PORT_NATS_BY_SERVICE_ID: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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_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!) {
|
@@ -379,3 +379,31 @@ exports.GET_COMPUTING_BY_SERVICE = (0, graphql_tag_1.gql) `
|
|
379
379
|
}
|
380
380
|
}
|
381
381
|
`;
|
382
|
+
exports.GET_EDGES = (0, graphql_tag_1.gql) `
|
383
|
+
query getEdges($serviceId: String!) {
|
384
|
+
getEdges(serviceId: $serviceId) {
|
385
|
+
id
|
386
|
+
name
|
387
|
+
status
|
388
|
+
partnerId
|
389
|
+
createdStamp
|
390
|
+
description
|
391
|
+
}
|
392
|
+
}
|
393
|
+
`;
|
394
|
+
exports.GET_PORT_NATS_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
|
395
|
+
query getPortNatsByServiceId($serviceId: String!) {
|
396
|
+
getPortNatsByServiceId(serviceId: $serviceId) {
|
397
|
+
id
|
398
|
+
action
|
399
|
+
protocol
|
400
|
+
originalAddress
|
401
|
+
originalPort
|
402
|
+
translatedAddress
|
403
|
+
translatedPort
|
404
|
+
description
|
405
|
+
status
|
406
|
+
domain
|
407
|
+
}
|
408
|
+
}
|
409
|
+
`;
|
@@ -42,4 +42,7 @@ export declare class ComputingService extends Service {
|
|
42
42
|
getComputingByCluster(clusterId: string): Promise<any>;
|
43
43
|
getComputingByService(serviceId: string): Promise<any>;
|
44
44
|
stopUseComputing(computingId: string, userId: string): Promise<any>;
|
45
|
+
getEdges(serviceId: string): Promise<any>;
|
46
|
+
addPortNat(data: any): Promise<any>;
|
47
|
+
getPortNatsByServiceId(serviceId: any): Promise<any>;
|
45
48
|
}
|
@@ -583,5 +583,51 @@ class ComputingService extends serviceSDK_1.Service {
|
|
583
583
|
}
|
584
584
|
});
|
585
585
|
}
|
586
|
+
getEdges(serviceId) {
|
587
|
+
return __awaiter(this, void 0, void 0, function* () {
|
588
|
+
const query = queries_1.GET_EDGES;
|
589
|
+
const variables = {
|
590
|
+
serviceId
|
591
|
+
};
|
592
|
+
try {
|
593
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
594
|
+
return response.getEdges;
|
595
|
+
}
|
596
|
+
catch (error) {
|
597
|
+
console.log(`Error fetching get getEdges method: ${error}`);
|
598
|
+
throw error;
|
599
|
+
}
|
600
|
+
});
|
601
|
+
}
|
602
|
+
addPortNat(data) {
|
603
|
+
return __awaiter(this, void 0, void 0, function* () {
|
604
|
+
const mutation = mutations_1.ADD_PORT_NAT;
|
605
|
+
const variables = Object.assign({}, data);
|
606
|
+
try {
|
607
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
608
|
+
return response.addPortNat;
|
609
|
+
}
|
610
|
+
catch (error) {
|
611
|
+
console.log(`Error fetching get addPortNat method: ${error}`);
|
612
|
+
throw error;
|
613
|
+
}
|
614
|
+
});
|
615
|
+
}
|
616
|
+
getPortNatsByServiceId(serviceId) {
|
617
|
+
return __awaiter(this, void 0, void 0, function* () {
|
618
|
+
const query = queries_1.GET_PORT_NATS_BY_SERVICE_ID;
|
619
|
+
const variables = {
|
620
|
+
serviceId
|
621
|
+
};
|
622
|
+
try {
|
623
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
624
|
+
return response.getPortNatsByServiceId;
|
625
|
+
}
|
626
|
+
catch (error) {
|
627
|
+
console.log(`Error fetching get getPortNatsByServiceId method: ${error}`);
|
628
|
+
throw error;
|
629
|
+
}
|
630
|
+
});
|
631
|
+
}
|
586
632
|
}
|
587
633
|
exports.ComputingService = ComputingService;
|
@@ -108,7 +108,7 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
108
108
|
const variables = {
|
109
109
|
serviceId,
|
110
110
|
actorId,
|
111
|
-
cartId
|
111
|
+
cartId,
|
112
112
|
};
|
113
113
|
try {
|
114
114
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
@@ -127,7 +127,7 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
127
127
|
partnerId: this.orgId,
|
128
128
|
orderLineItemId,
|
129
129
|
optionId,
|
130
|
-
updateBy
|
130
|
+
updateBy,
|
131
131
|
};
|
132
132
|
try {
|
133
133
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
@@ -48,6 +48,7 @@ class Service {
|
|
48
48
|
${query}
|
49
49
|
`,
|
50
50
|
variables,
|
51
|
+
fetchPolicy: "no-cache",
|
51
52
|
context: {
|
52
53
|
method: "POST",
|
53
54
|
headers: {
|
@@ -75,6 +76,7 @@ class Service {
|
|
75
76
|
${mutation}
|
76
77
|
`,
|
77
78
|
variables,
|
79
|
+
fetchPolicy: "no-cache",
|
78
80
|
context: {
|
79
81
|
method: "POST",
|
80
82
|
headers: {
|
@@ -136,6 +138,7 @@ class Service {
|
|
136
138
|
${query}
|
137
139
|
`,
|
138
140
|
variables,
|
141
|
+
fetchPolicy: "no-cache",
|
139
142
|
context: {
|
140
143
|
method: "POST",
|
141
144
|
headers: {
|
@@ -164,6 +167,7 @@ class Service {
|
|
164
167
|
${mutation}
|
165
168
|
`,
|
166
169
|
variables,
|
170
|
+
fetchPolicy: "no-cache",
|
167
171
|
context: {
|
168
172
|
method: "POST",
|
169
173
|
headers: {
|
@@ -192,6 +196,7 @@ class Service {
|
|
192
196
|
${query}
|
193
197
|
`,
|
194
198
|
variables,
|
199
|
+
fetchPolicy: "no-cache",
|
195
200
|
context: {
|
196
201
|
method: "POST",
|
197
202
|
headers,
|
@@ -217,6 +222,7 @@ class Service {
|
|
217
222
|
${mutation}
|
218
223
|
`,
|
219
224
|
variables,
|
225
|
+
fetchPolicy: "no-cache",
|
220
226
|
context: {
|
221
227
|
method: "POST",
|
222
228
|
headers,
|