@longvansoftware/service-js-client 2.6.6 → 2.6.8

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.
@@ -7,3 +7,4 @@ export declare const UPDATE_REMOTE_ACCESS: import("graphql").DocumentNode;
7
7
  export declare const DELETE_REMOTE_ACCESS: import("graphql").DocumentNode;
8
8
  export declare const IMPORT_PRIVATE_KEY: import("graphql").DocumentNode;
9
9
  export declare const UPDATE_REMOTE_ACCESS_PRIVATE_KEY: import("graphql").DocumentNode;
10
+ export declare const DELETE_PRIVATE_KEY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPDATE_REMOTE_ACCESS_PRIVATE_KEY = exports.IMPORT_PRIVATE_KEY = exports.DELETE_REMOTE_ACCESS = exports.UPDATE_REMOTE_ACCESS = exports.UPDATE_REMOTE_ACCESS_INFO = exports.UPDATE_REMOTE_ACCESS_TYPE = exports.UPDATE_REMOTE_ACCESS_DESCRIPTION = exports.UPDATE_REMOTE_ACCESS_NAME = exports.CREATE_REMOTE_ACCESS = void 0;
3
+ exports.DELETE_PRIVATE_KEY = exports.UPDATE_REMOTE_ACCESS_PRIVATE_KEY = exports.IMPORT_PRIVATE_KEY = exports.DELETE_REMOTE_ACCESS = exports.UPDATE_REMOTE_ACCESS = exports.UPDATE_REMOTE_ACCESS_INFO = exports.UPDATE_REMOTE_ACCESS_TYPE = exports.UPDATE_REMOTE_ACCESS_DESCRIPTION = exports.UPDATE_REMOTE_ACCESS_NAME = exports.CREATE_REMOTE_ACCESS = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CREATE_REMOTE_ACCESS = (0, graphql_tag_1.gql) `
6
6
  mutation CreateRemoteAccess(
@@ -104,3 +104,8 @@ exports.UPDATE_REMOTE_ACCESS_PRIVATE_KEY = (0, graphql_tag_1.gql) `
104
104
  )
105
105
  }
106
106
  `;
107
+ exports.DELETE_PRIVATE_KEY = (0, graphql_tag_1.gql) `
108
+ mutation DeletePrivateKey($privateKeyId: String!, $updatedBy: String!) {
109
+ deletePrivateKey(privateKeyId: $privateKeyId, updatedBy: $updatedBy)
110
+ }
111
+ `;
@@ -22,4 +22,5 @@ export declare class RemoteAccessService extends Service {
22
22
  getPrivateKeyById(privateKeyId: string): Promise<any>;
23
23
  getPrivateKeysByUserId(userId: string): Promise<any>;
24
24
  updateRemoteAccessPrivateKey(remoteAccessId: string, privateKeyId: string, updatedBy: string): Promise<any>;
25
+ deletePrivateKey(privateKeyId: string, updatedBy: string): Promise<any>;
25
26
  }
@@ -185,7 +185,7 @@ class RemoteAccessService extends serviceSDK_1.Service {
185
185
  const mutation = mutations_1.IMPORT_PRIVATE_KEY;
186
186
  const variables = { importPrivateKeyInput };
187
187
  try {
188
- const response = yield this.graphqlMutation(mutation, variables);
188
+ const response = yield this.graphqlMutationV2(mutation, variables);
189
189
  return response.importPrivateKey;
190
190
  }
191
191
  catch (error) {
@@ -213,7 +213,7 @@ class RemoteAccessService extends serviceSDK_1.Service {
213
213
  const query = queries_1.GET_PRIVATE_KEYS_BY_USER_ID;
214
214
  const variables = { userId };
215
215
  try {
216
- const response = yield this.graphqlQuery(query, variables);
216
+ const response = yield this.graphqlQueryV2(query, variables);
217
217
  return response.getPrivateKeysByUserId;
218
218
  }
219
219
  catch (error) {
@@ -240,5 +240,22 @@ class RemoteAccessService extends serviceSDK_1.Service {
240
240
  }
241
241
  });
242
242
  }
243
+ deletePrivateKey(privateKeyId, updatedBy) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ const mutation = mutations_1.DELETE_PRIVATE_KEY;
246
+ const variables = {
247
+ privateKeyId,
248
+ updatedBy,
249
+ };
250
+ try {
251
+ const response = yield this.graphqlMutationV2(mutation, variables);
252
+ return response.deletePrivateKey;
253
+ }
254
+ catch (error) {
255
+ console.log(`Error in deletePrivateKey : ${error}`);
256
+ throw error;
257
+ }
258
+ });
259
+ }
243
260
  }
244
261
  exports.RemoteAccessService = RemoteAccessService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [