@longvansoftware/service-js-client 2.6.3 → 2.6.6

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.
@@ -5,3 +5,5 @@ export declare const UPDATE_REMOTE_ACCESS_TYPE: import("graphql").DocumentNode;
5
5
  export declare const UPDATE_REMOTE_ACCESS_INFO: import("graphql").DocumentNode;
6
6
  export declare const UPDATE_REMOTE_ACCESS: import("graphql").DocumentNode;
7
7
  export declare const DELETE_REMOTE_ACCESS: import("graphql").DocumentNode;
8
+ export declare const IMPORT_PRIVATE_KEY: import("graphql").DocumentNode;
9
+ export declare const UPDATE_REMOTE_ACCESS_PRIVATE_KEY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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(
@@ -87,3 +87,20 @@ exports.DELETE_REMOTE_ACCESS = (0, graphql_tag_1.gql) `
87
87
  deleteRemoteAccess(remoteAccessId: $remoteAccessId, updatedBy: $updatedBy)
88
88
  }
89
89
  `;
90
+ exports.IMPORT_PRIVATE_KEY = (0, graphql_tag_1.gql) `
91
+ mutation ImportPrivateKey($importPrivateKeyInput: ImportPrivateKeyInput!) {
92
+ importPrivateKey(importPrivateKeyInput: $importPrivateKeyInput) {
93
+ id
94
+ name
95
+ userId
96
+ }
97
+ }
98
+ `;
99
+ exports.UPDATE_REMOTE_ACCESS_PRIVATE_KEY = (0, graphql_tag_1.gql) `
100
+ mutation UpdateRemoteAccessPrivateKey($remoteAccessId: String!, $privateKeyId: String!, $updatedBy: String!) {
101
+ updateRemoteAccessPrivateKey(
102
+ updateRemoteAccessPrivateKeyReq: { remoteAccessId: $remoteAccessId, privateKeyId: $privateKeyId }
103
+ updatedBy: $updatedBy
104
+ )
105
+ }
106
+ `;
@@ -1,2 +1,4 @@
1
1
  export declare const GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE: import("graphql").DocumentNode;
2
2
  export declare const GET_CONNECTION_INFO_FROM_REMOTE_ACCESS_BY_ID: import("graphql").DocumentNode;
3
+ export declare const GET_PRIVATE_KEY_BY_ID: import("graphql").DocumentNode;
4
+ export declare const GET_PRIVATE_KEYS_BY_USER_ID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_CONNECTION_INFO_FROM_REMOTE_ACCESS_BY_ID = exports.GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE = void 0;
3
+ exports.GET_PRIVATE_KEYS_BY_USER_ID = exports.GET_PRIVATE_KEY_BY_ID = exports.GET_CONNECTION_INFO_FROM_REMOTE_ACCESS_BY_ID = exports.GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE = (0, graphql_tag_1.gql) `
6
6
  query GetRemoteAccessByTargetIdAndTargetType(
@@ -18,6 +18,7 @@ exports.GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE = (0, graphql_tag_1.gql) `
18
18
  targetType
19
19
  type
20
20
  status
21
+ authenticationMethod
21
22
  }
22
23
  }
23
24
  `;
@@ -29,6 +30,35 @@ exports.GET_CONNECTION_INFO_FROM_REMOTE_ACCESS_BY_ID = (0, graphql_tag_1.gql) `
29
30
  port
30
31
  username
31
32
  password
33
+ privateKey {
34
+ privateKeyOutput {
35
+ id
36
+ name
37
+ userId
38
+ }
39
+ key
40
+ }
41
+ }
42
+ }
43
+ `;
44
+ exports.GET_PRIVATE_KEY_BY_ID = (0, graphql_tag_1.gql) `
45
+ query GetPrivateKeyById($privateKeyId: String!) {
46
+ getPrivateKeyById(privateKeyId: $privateKeyId) {
47
+ key
48
+ privateKeyOutput {
49
+ id
50
+ name
51
+ userId
52
+ }
53
+ }
54
+ }
55
+ `;
56
+ exports.GET_PRIVATE_KEYS_BY_USER_ID = (0, graphql_tag_1.gql) `
57
+ query GetPrivateKeysByUserId($userId: String!) {
58
+ getPrivateKeysByUserId(userId: $userId) {
59
+ id
60
+ name
61
+ userId
32
62
  }
33
63
  }
34
64
  `;
@@ -13,4 +13,13 @@ export declare class RemoteAccessService extends Service {
13
13
  updateRemoteAccessInfo(remoteAccessId: string, remoteAccessInfoInput: any, updatedBy: string): Promise<any>;
14
14
  updateRemoteAccess(remoteAccessId: string, updateRemoteAccessDTO: UpdateRemoteAccessDTO, updatedBy: string): Promise<any>;
15
15
  deleteRemoteAccess(remoteAccessId: string, updatedBy: string): Promise<any>;
16
+ importPrivateKey(importPrivateKeyInput: {
17
+ name: string;
18
+ key: string;
19
+ userId: string;
20
+ createdBy: string;
21
+ }): Promise<any>;
22
+ getPrivateKeyById(privateKeyId: string): Promise<any>;
23
+ getPrivateKeysByUserId(userId: string): Promise<any>;
24
+ updateRemoteAccessPrivateKey(remoteAccessId: string, privateKeyId: string, updatedBy: string): Promise<any>;
16
25
  }
@@ -177,5 +177,68 @@ class RemoteAccessService extends serviceSDK_1.Service {
177
177
  }
178
178
  });
179
179
  }
180
+ // ============================
181
+ // Private Key APIs
182
+ // ============================
183
+ importPrivateKey(importPrivateKeyInput) {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ const mutation = mutations_1.IMPORT_PRIVATE_KEY;
186
+ const variables = { importPrivateKeyInput };
187
+ try {
188
+ const response = yield this.graphqlMutation(mutation, variables);
189
+ return response.importPrivateKey;
190
+ }
191
+ catch (error) {
192
+ console.log(`Error in importPrivateKey : ${error}`);
193
+ throw error;
194
+ }
195
+ });
196
+ }
197
+ getPrivateKeyById(privateKeyId) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ const query = queries_1.GET_PRIVATE_KEY_BY_ID;
200
+ const variables = { privateKeyId };
201
+ try {
202
+ const response = yield this.graphqlQueryV2(query, variables);
203
+ return response.getPrivateKeyById;
204
+ }
205
+ catch (error) {
206
+ console.log(`Error in getPrivateKeyById : ${error}`);
207
+ throw error;
208
+ }
209
+ });
210
+ }
211
+ getPrivateKeysByUserId(userId) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const query = queries_1.GET_PRIVATE_KEYS_BY_USER_ID;
214
+ const variables = { userId };
215
+ try {
216
+ const response = yield this.graphqlQuery(query, variables);
217
+ return response.getPrivateKeysByUserId;
218
+ }
219
+ catch (error) {
220
+ console.log(`Error in getPrivateKeysByUserId : ${error}`);
221
+ throw error;
222
+ }
223
+ });
224
+ }
225
+ updateRemoteAccessPrivateKey(remoteAccessId, privateKeyId, updatedBy) {
226
+ return __awaiter(this, void 0, void 0, function* () {
227
+ const mutation = mutations_1.UPDATE_REMOTE_ACCESS_PRIVATE_KEY;
228
+ const variables = {
229
+ remoteAccessId,
230
+ privateKeyId,
231
+ updatedBy,
232
+ };
233
+ try {
234
+ const response = yield this.graphqlMutationV2(mutation, variables);
235
+ return response.updateRemoteAccessPrivateKey;
236
+ }
237
+ catch (error) {
238
+ console.log(`Error in updateRemoteAccessPrivateKey : ${error}`);
239
+ throw error;
240
+ }
241
+ });
242
+ }
180
243
  }
181
244
  exports.RemoteAccessService = RemoteAccessService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.6.3",
3
+ "version": "2.6.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [