fusio-sdk 5.0.8 → 5.1.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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BackendConnectionRedirectResponse automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendConnectionRedirectResponse {
6
+ redirectUri?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendConnectionRedirectResponse automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -9,6 +9,7 @@ import { BackendConnectionCreate } from "./BackendConnectionCreate";
9
9
  import { BackendConnectionIndex } from "./BackendConnectionIndex";
10
10
  import { BackendConnectionIntrospectionEntities } from "./BackendConnectionIntrospectionEntities";
11
11
  import { BackendConnectionIntrospectionEntity } from "./BackendConnectionIntrospectionEntity";
12
+ import { BackendConnectionRedirectResponse } from "./BackendConnectionRedirectResponse";
12
13
  import { BackendConnectionUpdate } from "./BackendConnectionUpdate";
13
14
  import { CommonFormContainer } from "./CommonFormContainer";
14
15
  import { CommonMessage } from "./CommonMessage";
@@ -26,11 +27,11 @@ export declare class BackendConnectionTag extends TagAbstract {
26
27
  */
27
28
  getIntrospection(connectionId: string): Promise<BackendConnectionIntrospectionEntities>;
28
29
  /**
29
- * @returns {Promise<CommonMessage>}
30
+ * @returns {Promise<BackendConnectionRedirectResponse>}
30
31
  * @throws {CommonMessageExceptionException}
31
32
  * @throws {ClientException}
32
33
  */
33
- getRedirect(connectionId: string): Promise<CommonMessage>;
34
+ getRedirect(connectionId: string): Promise<BackendConnectionRedirectResponse>;
34
35
  /**
35
36
  * @returns {Promise<CommonMessage>}
36
37
  * @throws {CommonMessageExceptionException}
@@ -87,7 +87,7 @@ export class BackendConnectionTag extends TagAbstract {
87
87
  }
88
88
  }
89
89
  /**
90
- * @returns {Promise<CommonMessage>}
90
+ * @returns {Promise<BackendConnectionRedirectResponse>}
91
91
  * @throws {CommonMessageExceptionException}
92
92
  * @throws {ClientException}
93
93
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BackendDatabaseConnections automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendDatabaseConnections {
6
+ connections?: Array<string>;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseConnections automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseRow automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export type BackendDatabaseRow = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseRow automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BackendDatabaseRows automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { CommonCollection } from "./CommonCollection";
6
+ import { BackendDatabaseRow } from "./BackendDatabaseRow";
7
+ export type BackendDatabaseRows = CommonCollection<BackendDatabaseRow>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseRows automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * BackendDatabaseTable automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { BackendDatabaseTableColumn } from "./BackendDatabaseTableColumn";
6
+ import { BackendDatabaseTableIndex } from "./BackendDatabaseTableIndex";
7
+ import { BackendDatabaseTableForeignKeyConstraint } from "./BackendDatabaseTableForeignKeyConstraint";
8
+ export interface BackendDatabaseTable {
9
+ name?: string;
10
+ columns?: Array<BackendDatabaseTableColumn>;
11
+ primaryKey?: string;
12
+ indexes?: Array<BackendDatabaseTableIndex>;
13
+ foreignKeys?: Array<BackendDatabaseTableForeignKeyConstraint>;
14
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseTable automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * BackendDatabaseTableColumn automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendDatabaseTableColumn {
6
+ name?: string;
7
+ type?: string;
8
+ length?: number;
9
+ precision?: number;
10
+ scale?: number;
11
+ unsigned?: boolean;
12
+ fixed?: boolean;
13
+ notNull?: boolean;
14
+ autoIncrement?: boolean;
15
+ default?: any;
16
+ comment?: string;
17
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseTableColumn automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * BackendDatabaseTableForeignKeyConstraint automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendDatabaseTableForeignKeyConstraint {
6
+ name?: string;
7
+ foreignTable?: string;
8
+ localColumnNames?: Array<string>;
9
+ foreignColumnNames?: Array<string>;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseTableForeignKeyConstraint automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * BackendDatabaseTableIndex automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendDatabaseTableIndex {
6
+ name?: string;
7
+ unique?: boolean;
8
+ columns?: Array<string>;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseTableIndex automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BackendDatabaseTables automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendDatabaseTables {
6
+ tables?: Array<string>;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendDatabaseTables automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,79 @@
1
+ /**
2
+ * BackendDatabaseTag automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { TagAbstract } from "sdkgen-client";
6
+ import { BackendDatabaseConnections } from "./BackendDatabaseConnections";
7
+ import { BackendDatabaseRow } from "./BackendDatabaseRow";
8
+ import { BackendDatabaseRows } from "./BackendDatabaseRows";
9
+ import { BackendDatabaseTable } from "./BackendDatabaseTable";
10
+ import { BackendDatabaseTables } from "./BackendDatabaseTables";
11
+ import { CommonMessage } from "./CommonMessage";
12
+ export declare class BackendDatabaseTag extends TagAbstract {
13
+ /**
14
+ * @returns {Promise<CommonMessage>}
15
+ * @throws {CommonMessageExceptionException}
16
+ * @throws {ClientException}
17
+ */
18
+ deleteRow(connectionId: string, tableName: string, id: string): Promise<CommonMessage>;
19
+ /**
20
+ * @returns {Promise<CommonMessage>}
21
+ * @throws {CommonMessageExceptionException}
22
+ * @throws {ClientException}
23
+ */
24
+ updateRow(connectionId: string, tableName: string, id: string, payload: BackendDatabaseRow): Promise<CommonMessage>;
25
+ /**
26
+ * @returns {Promise<CommonMessage>}
27
+ * @throws {CommonMessageExceptionException}
28
+ * @throws {ClientException}
29
+ */
30
+ createRow(connectionId: string, tableName: string, payload: BackendDatabaseRow): Promise<CommonMessage>;
31
+ /**
32
+ * @returns {Promise<BackendDatabaseRow>}
33
+ * @throws {CommonMessageExceptionException}
34
+ * @throws {ClientException}
35
+ */
36
+ getRow(connectionId: string, tableName: string, id: string): Promise<BackendDatabaseRow>;
37
+ /**
38
+ * @returns {Promise<BackendDatabaseRows>}
39
+ * @throws {CommonMessageExceptionException}
40
+ * @throws {ClientException}
41
+ */
42
+ getRows(connectionId: string, tableName: string): Promise<BackendDatabaseRows>;
43
+ /**
44
+ * @returns {Promise<CommonMessage>}
45
+ * @throws {CommonMessageExceptionException}
46
+ * @throws {ClientException}
47
+ */
48
+ deleteTable(connectionId: string, tableName: string): Promise<CommonMessage>;
49
+ /**
50
+ * @returns {Promise<CommonMessage>}
51
+ * @throws {CommonMessageExceptionException}
52
+ * @throws {ClientException}
53
+ */
54
+ updateTable(connectionId: string, tableName: string, payload: BackendDatabaseTable): Promise<CommonMessage>;
55
+ /**
56
+ * @returns {Promise<CommonMessage>}
57
+ * @throws {CommonMessageExceptionException}
58
+ * @throws {ClientException}
59
+ */
60
+ createTable(connectionId: string, payload: BackendDatabaseTable): Promise<CommonMessage>;
61
+ /**
62
+ * @returns {Promise<BackendDatabaseTable>}
63
+ * @throws {CommonMessageExceptionException}
64
+ * @throws {ClientException}
65
+ */
66
+ getTable(connectionId: string, tableName: string): Promise<BackendDatabaseTable>;
67
+ /**
68
+ * @returns {Promise<BackendDatabaseTables>}
69
+ * @throws {CommonMessageExceptionException}
70
+ * @throws {ClientException}
71
+ */
72
+ getTables(connectionId: string): Promise<BackendDatabaseTables>;
73
+ /**
74
+ * @returns {Promise<BackendDatabaseConnections>}
75
+ * @throws {CommonMessageExceptionException}
76
+ * @throws {ClientException}
77
+ */
78
+ getConnections(): Promise<BackendDatabaseConnections>;
79
+ }
@@ -0,0 +1,430 @@
1
+ /**
2
+ * BackendDatabaseTag automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import axios from "axios";
6
+ import { TagAbstract } from "sdkgen-client";
7
+ import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
8
+ import { CommonMessageException } from "./CommonMessageException";
9
+ export class BackendDatabaseTag extends TagAbstract {
10
+ /**
11
+ * @returns {Promise<CommonMessage>}
12
+ * @throws {CommonMessageExceptionException}
13
+ * @throws {ClientException}
14
+ */
15
+ async deleteRow(connectionId, tableName, id) {
16
+ const url = this.parser.url('/backend/database/:connection_id/:table_name/rows/:id', {
17
+ 'connection_id': connectionId,
18
+ 'table_name': tableName,
19
+ 'id': id,
20
+ });
21
+ let params = {
22
+ url: url,
23
+ method: 'DELETE',
24
+ params: this.parser.query({}, []),
25
+ };
26
+ try {
27
+ const response = await this.httpClient.request(params);
28
+ return response.data;
29
+ }
30
+ catch (error) {
31
+ if (error instanceof ClientException) {
32
+ throw error;
33
+ }
34
+ else if (axios.isAxiosError(error) && error.response) {
35
+ switch (error.response.status) {
36
+ case 401:
37
+ throw new CommonMessageException(error.response.data);
38
+ case 500:
39
+ throw new CommonMessageException(error.response.data);
40
+ default:
41
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
42
+ }
43
+ }
44
+ else {
45
+ throw new ClientException('An unknown error occurred: ' + String(error));
46
+ }
47
+ }
48
+ }
49
+ /**
50
+ * @returns {Promise<CommonMessage>}
51
+ * @throws {CommonMessageExceptionException}
52
+ * @throws {ClientException}
53
+ */
54
+ async updateRow(connectionId, tableName, id, payload) {
55
+ const url = this.parser.url('/backend/database/:connection_id/:table_name/rows/:id', {
56
+ 'connection_id': connectionId,
57
+ 'table_name': tableName,
58
+ 'id': id,
59
+ });
60
+ let params = {
61
+ url: url,
62
+ method: 'PUT',
63
+ params: this.parser.query({}, []),
64
+ data: payload
65
+ };
66
+ try {
67
+ const response = await this.httpClient.request(params);
68
+ return response.data;
69
+ }
70
+ catch (error) {
71
+ if (error instanceof ClientException) {
72
+ throw error;
73
+ }
74
+ else if (axios.isAxiosError(error) && error.response) {
75
+ switch (error.response.status) {
76
+ case 401:
77
+ throw new CommonMessageException(error.response.data);
78
+ case 500:
79
+ throw new CommonMessageException(error.response.data);
80
+ default:
81
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
82
+ }
83
+ }
84
+ else {
85
+ throw new ClientException('An unknown error occurred: ' + String(error));
86
+ }
87
+ }
88
+ }
89
+ /**
90
+ * @returns {Promise<CommonMessage>}
91
+ * @throws {CommonMessageExceptionException}
92
+ * @throws {ClientException}
93
+ */
94
+ async createRow(connectionId, tableName, payload) {
95
+ const url = this.parser.url('/backend/database/:connection_id/:table_name/rows', {
96
+ 'connection_id': connectionId,
97
+ 'table_name': tableName,
98
+ });
99
+ let params = {
100
+ url: url,
101
+ method: 'POST',
102
+ params: this.parser.query({}, []),
103
+ data: payload
104
+ };
105
+ try {
106
+ const response = await this.httpClient.request(params);
107
+ return response.data;
108
+ }
109
+ catch (error) {
110
+ if (error instanceof ClientException) {
111
+ throw error;
112
+ }
113
+ else if (axios.isAxiosError(error) && error.response) {
114
+ switch (error.response.status) {
115
+ case 401:
116
+ throw new CommonMessageException(error.response.data);
117
+ case 500:
118
+ throw new CommonMessageException(error.response.data);
119
+ default:
120
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
121
+ }
122
+ }
123
+ else {
124
+ throw new ClientException('An unknown error occurred: ' + String(error));
125
+ }
126
+ }
127
+ }
128
+ /**
129
+ * @returns {Promise<BackendDatabaseRow>}
130
+ * @throws {CommonMessageExceptionException}
131
+ * @throws {ClientException}
132
+ */
133
+ async getRow(connectionId, tableName, id) {
134
+ const url = this.parser.url('/backend/database/:connection_id/:table_name/rows/:id', {
135
+ 'connection_id': connectionId,
136
+ 'table_name': tableName,
137
+ 'id': id,
138
+ });
139
+ let params = {
140
+ url: url,
141
+ method: 'GET',
142
+ params: this.parser.query({}, []),
143
+ };
144
+ try {
145
+ const response = await this.httpClient.request(params);
146
+ return response.data;
147
+ }
148
+ catch (error) {
149
+ if (error instanceof ClientException) {
150
+ throw error;
151
+ }
152
+ else if (axios.isAxiosError(error) && error.response) {
153
+ switch (error.response.status) {
154
+ case 401:
155
+ throw new CommonMessageException(error.response.data);
156
+ case 500:
157
+ throw new CommonMessageException(error.response.data);
158
+ default:
159
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
160
+ }
161
+ }
162
+ else {
163
+ throw new ClientException('An unknown error occurred: ' + String(error));
164
+ }
165
+ }
166
+ }
167
+ /**
168
+ * @returns {Promise<BackendDatabaseRows>}
169
+ * @throws {CommonMessageExceptionException}
170
+ * @throws {ClientException}
171
+ */
172
+ async getRows(connectionId, tableName) {
173
+ const url = this.parser.url('/backend/database/:connection_id/:table_name/rows', {
174
+ 'connection_id': connectionId,
175
+ 'table_name': tableName,
176
+ });
177
+ let params = {
178
+ url: url,
179
+ method: 'GET',
180
+ params: this.parser.query({}, []),
181
+ };
182
+ try {
183
+ const response = await this.httpClient.request(params);
184
+ return response.data;
185
+ }
186
+ catch (error) {
187
+ if (error instanceof ClientException) {
188
+ throw error;
189
+ }
190
+ else if (axios.isAxiosError(error) && error.response) {
191
+ switch (error.response.status) {
192
+ case 401:
193
+ throw new CommonMessageException(error.response.data);
194
+ case 500:
195
+ throw new CommonMessageException(error.response.data);
196
+ default:
197
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
198
+ }
199
+ }
200
+ else {
201
+ throw new ClientException('An unknown error occurred: ' + String(error));
202
+ }
203
+ }
204
+ }
205
+ /**
206
+ * @returns {Promise<CommonMessage>}
207
+ * @throws {CommonMessageExceptionException}
208
+ * @throws {ClientException}
209
+ */
210
+ async deleteTable(connectionId, tableName) {
211
+ const url = this.parser.url('/backend/database/:connection_id/:table_name', {
212
+ 'connection_id': connectionId,
213
+ 'table_name': tableName,
214
+ });
215
+ let params = {
216
+ url: url,
217
+ method: 'DELETE',
218
+ params: this.parser.query({}, []),
219
+ };
220
+ try {
221
+ const response = await this.httpClient.request(params);
222
+ return response.data;
223
+ }
224
+ catch (error) {
225
+ if (error instanceof ClientException) {
226
+ throw error;
227
+ }
228
+ else if (axios.isAxiosError(error) && error.response) {
229
+ switch (error.response.status) {
230
+ case 401:
231
+ throw new CommonMessageException(error.response.data);
232
+ case 500:
233
+ throw new CommonMessageException(error.response.data);
234
+ default:
235
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
236
+ }
237
+ }
238
+ else {
239
+ throw new ClientException('An unknown error occurred: ' + String(error));
240
+ }
241
+ }
242
+ }
243
+ /**
244
+ * @returns {Promise<CommonMessage>}
245
+ * @throws {CommonMessageExceptionException}
246
+ * @throws {ClientException}
247
+ */
248
+ async updateTable(connectionId, tableName, payload) {
249
+ const url = this.parser.url('/backend/database/:connection_id/:table_name', {
250
+ 'connection_id': connectionId,
251
+ 'table_name': tableName,
252
+ });
253
+ let params = {
254
+ url: url,
255
+ method: 'PUT',
256
+ params: this.parser.query({}, []),
257
+ data: payload
258
+ };
259
+ try {
260
+ const response = await this.httpClient.request(params);
261
+ return response.data;
262
+ }
263
+ catch (error) {
264
+ if (error instanceof ClientException) {
265
+ throw error;
266
+ }
267
+ else if (axios.isAxiosError(error) && error.response) {
268
+ switch (error.response.status) {
269
+ case 401:
270
+ throw new CommonMessageException(error.response.data);
271
+ case 500:
272
+ throw new CommonMessageException(error.response.data);
273
+ default:
274
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
275
+ }
276
+ }
277
+ else {
278
+ throw new ClientException('An unknown error occurred: ' + String(error));
279
+ }
280
+ }
281
+ }
282
+ /**
283
+ * @returns {Promise<CommonMessage>}
284
+ * @throws {CommonMessageExceptionException}
285
+ * @throws {ClientException}
286
+ */
287
+ async createTable(connectionId, payload) {
288
+ const url = this.parser.url('/backend/database/:connection_id', {
289
+ 'connection_id': connectionId,
290
+ });
291
+ let params = {
292
+ url: url,
293
+ method: 'POST',
294
+ params: this.parser.query({}, []),
295
+ data: payload
296
+ };
297
+ try {
298
+ const response = await this.httpClient.request(params);
299
+ return response.data;
300
+ }
301
+ catch (error) {
302
+ if (error instanceof ClientException) {
303
+ throw error;
304
+ }
305
+ else if (axios.isAxiosError(error) && error.response) {
306
+ switch (error.response.status) {
307
+ case 401:
308
+ throw new CommonMessageException(error.response.data);
309
+ case 500:
310
+ throw new CommonMessageException(error.response.data);
311
+ default:
312
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
313
+ }
314
+ }
315
+ else {
316
+ throw new ClientException('An unknown error occurred: ' + String(error));
317
+ }
318
+ }
319
+ }
320
+ /**
321
+ * @returns {Promise<BackendDatabaseTable>}
322
+ * @throws {CommonMessageExceptionException}
323
+ * @throws {ClientException}
324
+ */
325
+ async getTable(connectionId, tableName) {
326
+ const url = this.parser.url('/backend/database/:connection_id/:table_name', {
327
+ 'connection_id': connectionId,
328
+ 'table_name': tableName,
329
+ });
330
+ let params = {
331
+ url: url,
332
+ method: 'GET',
333
+ params: this.parser.query({}, []),
334
+ };
335
+ try {
336
+ const response = await this.httpClient.request(params);
337
+ return response.data;
338
+ }
339
+ catch (error) {
340
+ if (error instanceof ClientException) {
341
+ throw error;
342
+ }
343
+ else if (axios.isAxiosError(error) && error.response) {
344
+ switch (error.response.status) {
345
+ case 401:
346
+ throw new CommonMessageException(error.response.data);
347
+ case 500:
348
+ throw new CommonMessageException(error.response.data);
349
+ default:
350
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
351
+ }
352
+ }
353
+ else {
354
+ throw new ClientException('An unknown error occurred: ' + String(error));
355
+ }
356
+ }
357
+ }
358
+ /**
359
+ * @returns {Promise<BackendDatabaseTables>}
360
+ * @throws {CommonMessageExceptionException}
361
+ * @throws {ClientException}
362
+ */
363
+ async getTables(connectionId) {
364
+ const url = this.parser.url('/backend/database/:connection_id', {
365
+ 'connection_id': connectionId,
366
+ });
367
+ let params = {
368
+ url: url,
369
+ method: 'GET',
370
+ params: this.parser.query({}, []),
371
+ };
372
+ try {
373
+ const response = await this.httpClient.request(params);
374
+ return response.data;
375
+ }
376
+ catch (error) {
377
+ if (error instanceof ClientException) {
378
+ throw error;
379
+ }
380
+ else if (axios.isAxiosError(error) && error.response) {
381
+ switch (error.response.status) {
382
+ case 401:
383
+ throw new CommonMessageException(error.response.data);
384
+ case 500:
385
+ throw new CommonMessageException(error.response.data);
386
+ default:
387
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
388
+ }
389
+ }
390
+ else {
391
+ throw new ClientException('An unknown error occurred: ' + String(error));
392
+ }
393
+ }
394
+ }
395
+ /**
396
+ * @returns {Promise<BackendDatabaseConnections>}
397
+ * @throws {CommonMessageExceptionException}
398
+ * @throws {ClientException}
399
+ */
400
+ async getConnections() {
401
+ const url = this.parser.url('/backend/database', {});
402
+ let params = {
403
+ url: url,
404
+ method: 'GET',
405
+ params: this.parser.query({}, []),
406
+ };
407
+ try {
408
+ const response = await this.httpClient.request(params);
409
+ return response.data;
410
+ }
411
+ catch (error) {
412
+ if (error instanceof ClientException) {
413
+ throw error;
414
+ }
415
+ else if (axios.isAxiosError(error) && error.response) {
416
+ switch (error.response.status) {
417
+ case 401:
418
+ throw new CommonMessageException(error.response.data);
419
+ case 500:
420
+ throw new CommonMessageException(error.response.data);
421
+ default:
422
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
423
+ }
424
+ }
425
+ else {
426
+ throw new ClientException('An unknown error occurred: ' + String(error));
427
+ }
428
+ }
429
+ }
430
+ }
@@ -13,6 +13,7 @@ import { BackendConfigTag } from "./BackendConfigTag";
13
13
  import { BackendConnectionTag } from "./BackendConnectionTag";
14
14
  import { BackendCronjobTag } from "./BackendCronjobTag";
15
15
  import { BackendDashboardTag } from "./BackendDashboardTag";
16
+ import { BackendDatabaseTag } from "./BackendDatabaseTag";
16
17
  import { BackendEventTag } from "./BackendEventTag";
17
18
  import { BackendGeneratorTag } from "./BackendGeneratorTag";
18
19
  import { BackendIdentityTag } from "./BackendIdentityTag";
@@ -55,6 +56,7 @@ export declare class BackendTag extends TagAbstract {
55
56
  generator(): BackendGeneratorTag;
56
57
  backup(): BackendBackupTag;
57
58
  event(): BackendEventTag;
59
+ database(): BackendDatabaseTag;
58
60
  dashboard(): BackendDashboardTag;
59
61
  cronjob(): BackendCronjobTag;
60
62
  connection(): BackendConnectionTag;
@@ -13,6 +13,7 @@ import { BackendConfigTag } from "./BackendConfigTag";
13
13
  import { BackendConnectionTag } from "./BackendConnectionTag";
14
14
  import { BackendCronjobTag } from "./BackendCronjobTag";
15
15
  import { BackendDashboardTag } from "./BackendDashboardTag";
16
+ import { BackendDatabaseTag } from "./BackendDatabaseTag";
16
17
  import { BackendEventTag } from "./BackendEventTag";
17
18
  import { BackendGeneratorTag } from "./BackendGeneratorTag";
18
19
  import { BackendIdentityTag } from "./BackendIdentityTag";
@@ -97,6 +98,9 @@ export class BackendTag extends TagAbstract {
97
98
  event() {
98
99
  return new BackendEventTag(this.httpClient, this.parser);
99
100
  }
101
+ database() {
102
+ return new BackendDatabaseTag(this.httpClient, this.parser);
103
+ }
100
104
  dashboard() {
101
105
  return new BackendDashboardTag(this.httpClient, this.parser);
102
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusio-sdk",
3
- "version": "5.0.8",
3
+ "version": "5.1.0",
4
4
  "description": "SDK to talk to the Fusio API",
5
5
  "keywords": [
6
6
  "API",