@longvansoftware/service-js-client 2.5.8 → 2.6.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.
@@ -24,3 +24,4 @@ export declare const UPDATE_CPU: DocumentNode;
24
24
  export declare const UPDATE_RAM: DocumentNode;
25
25
  export declare const CREATE_COMPUTING_FOR_EC: DocumentNode;
26
26
  export declare const UPDATE_CLIENT_GROUP_ID_DYNAMIC: (fields?: string[]) => DocumentNode;
27
+ export declare const SHUTDOWN: DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPDATE_CLIENT_GROUP_ID_DYNAMIC = exports.CREATE_COMPUTING_FOR_EC = exports.UPDATE_RAM = exports.UPDATE_CPU = 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;
3
+ exports.SHUTDOWN = exports.UPDATE_CLIENT_GROUP_ID_DYNAMIC = exports.CREATE_COMPUTING_FOR_EC = exports.UPDATE_RAM = exports.UPDATE_CPU = 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!, $serviceId: String!) {
@@ -102,13 +102,13 @@ exports.ROLLBACK_SNAPSHOT = (0, graphql_tag_1.gql) `
102
102
  exports.DELETE_SNAPSHOT = (0, graphql_tag_1.gql) `
103
103
  mutation DeleteSnapshot(
104
104
  $computingId: String!
105
- $snapshotId: String!
105
+ $id: String!
106
106
  $serviceId: String!
107
107
  $updateBy: String
108
108
  ) {
109
109
  deleteSnapshot(
110
110
  computingId: $computingId
111
- snapshotId: $snapshotId
111
+ id: $id
112
112
  serviceId: $serviceId
113
113
  updateBy: $updateBy
114
114
  )
@@ -376,3 +376,18 @@ const UPDATE_CLIENT_GROUP_ID_DYNAMIC = (fields = []) => {
376
376
  `;
377
377
  };
378
378
  exports.UPDATE_CLIENT_GROUP_ID_DYNAMIC = UPDATE_CLIENT_GROUP_ID_DYNAMIC;
379
+ exports.SHUTDOWN = (0, graphql_tag_1.gql) `
380
+ mutation shutdown(
381
+ $computingId: String!
382
+ $isForceShutdown: Boolean!
383
+ $actor: String!
384
+ $serviceId: String!
385
+ ) {
386
+ shutdown(
387
+ computingId: $computingId
388
+ isForceShutdown: $isForceShutdown
389
+ actor: $actor
390
+ serviceId: $serviceId
391
+ )
392
+ }
393
+ `;
@@ -472,8 +472,8 @@ const CALCULATE_RESOURCE_CHANGE_PRICE = (fields = []) => {
472
472
  const fieldStr = fields.join("\n ");
473
473
  const hasFields = fields.length > 0;
474
474
  return (0, graphql_tag_1.gql) `
475
- query calculateResourceChangePrice($partnerId: String! $storeId: String! $productIds: [String] $quantity: BigDecimal! $unit: String!) {
476
- calculateResourceChangePrice(partnerId: $partnerId storeId: $storeId productIds: $productIds quantity: $quantity unit: $unit) ${hasFields ? `{ ${fieldStr} }` : ""}
475
+ query calculateResourceChangePrice($partnerId: String! $storeId: String! $productIds: [String] $quantity: BigDecimal! $unit: String! $serviceId: String) {
476
+ calculateResourceChangePrice(partnerId: $partnerId storeId: $storeId productIds: $productIds quantity: $quantity unit: $unit serviceId: $serviceId) ${hasFields ? `{ ${fieldStr} }` : ""}
477
477
  }
478
478
  `;
479
479
  };
@@ -64,4 +64,5 @@ export declare class ComputingService extends Service {
64
64
  updateClientGroupIdDynamic(computingIds: [string] | null, groupId: string, updateBy: string, fields: string[]): Promise<any>;
65
65
  createComputingForEC(createComputingInputForEC: any, createBy: string): Promise<any>;
66
66
  computingDetailDynamic(computingId: string, serviceId: string, fields: string[]): Promise<any>;
67
+ shutdown(computingId: string, isForceShutdown: boolean, actor: string, serviceId: string): Promise<any>;
67
68
  }
@@ -248,7 +248,7 @@ class ComputingService extends serviceSDK_1.Service {
248
248
  const mutation = mutations_1.DELETE_SNAPSHOT;
249
249
  const variables = {
250
250
  computingId: payload.computingId,
251
- snapshotId: payload.snapshotId,
251
+ id: payload.id,
252
252
  serviceId: payload.serviceId,
253
253
  updateBy,
254
254
  };
@@ -975,5 +975,24 @@ class ComputingService extends serviceSDK_1.Service {
975
975
  }
976
976
  });
977
977
  }
978
+ shutdown(computingId, isForceShutdown, actor, serviceId) {
979
+ return __awaiter(this, void 0, void 0, function* () {
980
+ const mutation = mutations_1.SHUTDOWN;
981
+ const variables = {
982
+ computingId,
983
+ isForceShutdown,
984
+ actor,
985
+ serviceId
986
+ };
987
+ try {
988
+ const response = yield this.graphqlMutationV2(mutation, variables);
989
+ return response.shutdown;
990
+ }
991
+ catch (error) {
992
+ console.log(`Error fetching get shutdown method: ${error}`);
993
+ throw error;
994
+ }
995
+ });
996
+ }
978
997
  }
979
998
  exports.ComputingService = ComputingService;
@@ -18,5 +18,5 @@ export declare class OrderGraphQLService extends Service {
18
18
  addItemIntoOrderByProductJsonResource(serviceId: string, orderId: string, itemInput: any, durationQuantity: number, durationUnit: string, actorId: string, fields: string[]): Promise<any>;
19
19
  updateOrderLineItemParentId(orderLineItemChildIds: string[], orderLineItemParentId: string, updateBy: string): Promise<any>;
20
20
  updateProductOptionOrderLineItem(orderLineItemId: string, productOptionUpdate: any, updateBy: string): Promise<any>;
21
- calculateResourceChangePrice(productIds: string[], quantity: string, unit: string, storeId: string, fields: string[]): Promise<any>;
21
+ calculateResourceChangePrice(productIds: string[], quantity: string, unit: string, storeId: string, fields: string[], serviceId: string): Promise<any>;
22
22
  }
@@ -285,7 +285,7 @@ class OrderGraphQLService extends serviceSDK_1.Service {
285
285
  }
286
286
  });
287
287
  }
288
- calculateResourceChangePrice(productIds, quantity, unit, storeId, fields) {
288
+ calculateResourceChangePrice(productIds, quantity, unit, storeId, fields, serviceId) {
289
289
  return __awaiter(this, void 0, void 0, function* () {
290
290
  const query = (0, queries_1.CALCULATE_RESOURCE_CHANGE_PRICE)(fields);
291
291
  const variables = {
@@ -293,7 +293,8 @@ class OrderGraphQLService extends serviceSDK_1.Service {
293
293
  storeId: storeId ? storeId : this.storeId,
294
294
  productIds,
295
295
  quantity,
296
- unit
296
+ unit,
297
+ serviceId
297
298
  };
298
299
  try {
299
300
  const response = yield this.graphqlQueryV2(query, variables);
@@ -13,6 +13,7 @@ export interface CreateSnapShot {
13
13
  }
14
14
  export interface RollBackSnapShot {
15
15
  computingId: string;
16
+ id: string;
16
17
  snapshotId: string;
17
18
  serviceId: string;
18
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.5.8",
3
+ "version": "2.6.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [