fusio-sdk 5.0.4 → 5.0.5
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/BackendBackupExport.d.ts +7 -0
- package/dist/BackendBackupExport.js +5 -0
- package/dist/BackendBackupImport.d.ts +7 -0
- package/dist/BackendBackupImport.js +5 -0
- package/dist/BackendBackupImportResult.d.ts +9 -0
- package/dist/BackendBackupImportResult.js +5 -0
- package/dist/BackendBackupTag.d.ts +22 -0
- package/dist/BackendBackupTag.js +81 -0
- package/dist/BackendTag.d.ts +2 -0
- package/dist/BackendTag.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BackendBackupTag 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 { BackendBackupExport } from "./BackendBackupExport";
|
|
7
|
+
import { BackendBackupImport } from "./BackendBackupImport";
|
|
8
|
+
import { BackendBackupImportResult } from "./BackendBackupImportResult";
|
|
9
|
+
export declare class BackendBackupTag extends TagAbstract {
|
|
10
|
+
/**
|
|
11
|
+
* @returns {Promise<BackendBackupImportResult>}
|
|
12
|
+
* @throws {CommonMessageExceptionException}
|
|
13
|
+
* @throws {ClientException}
|
|
14
|
+
*/
|
|
15
|
+
import(payload: BackendBackupImport): Promise<BackendBackupImportResult>;
|
|
16
|
+
/**
|
|
17
|
+
* @returns {Promise<BackendBackupExport>}
|
|
18
|
+
* @throws {CommonMessageExceptionException}
|
|
19
|
+
* @throws {ClientException}
|
|
20
|
+
*/
|
|
21
|
+
export(): Promise<BackendBackupExport>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BackendBackupTag 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 BackendBackupTag extends TagAbstract {
|
|
10
|
+
/**
|
|
11
|
+
* @returns {Promise<BackendBackupImportResult>}
|
|
12
|
+
* @throws {CommonMessageExceptionException}
|
|
13
|
+
* @throws {ClientException}
|
|
14
|
+
*/
|
|
15
|
+
async import(payload) {
|
|
16
|
+
const url = this.parser.url('/backend/backup/import', {});
|
|
17
|
+
let params = {
|
|
18
|
+
url: url,
|
|
19
|
+
method: 'POST',
|
|
20
|
+
params: this.parser.query({}, []),
|
|
21
|
+
data: payload
|
|
22
|
+
};
|
|
23
|
+
try {
|
|
24
|
+
const response = await this.httpClient.request(params);
|
|
25
|
+
return response.data;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof ClientException) {
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
else if (axios.isAxiosError(error) && error.response) {
|
|
32
|
+
switch (error.response.status) {
|
|
33
|
+
case 401:
|
|
34
|
+
throw new CommonMessageException(error.response.data);
|
|
35
|
+
case 500:
|
|
36
|
+
throw new CommonMessageException(error.response.data);
|
|
37
|
+
default:
|
|
38
|
+
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
throw new ClientException('An unknown error occurred: ' + String(error));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @returns {Promise<BackendBackupExport>}
|
|
48
|
+
* @throws {CommonMessageExceptionException}
|
|
49
|
+
* @throws {ClientException}
|
|
50
|
+
*/
|
|
51
|
+
async export() {
|
|
52
|
+
const url = this.parser.url('/backend/backup/export', {});
|
|
53
|
+
let params = {
|
|
54
|
+
url: url,
|
|
55
|
+
method: 'POST',
|
|
56
|
+
params: this.parser.query({}, []),
|
|
57
|
+
};
|
|
58
|
+
try {
|
|
59
|
+
const response = await this.httpClient.request(params);
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof ClientException) {
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
else if (axios.isAxiosError(error) && error.response) {
|
|
67
|
+
switch (error.response.status) {
|
|
68
|
+
case 401:
|
|
69
|
+
throw new CommonMessageException(error.response.data);
|
|
70
|
+
case 500:
|
|
71
|
+
throw new CommonMessageException(error.response.data);
|
|
72
|
+
default:
|
|
73
|
+
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new ClientException('An unknown error occurred: ' + String(error));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
package/dist/BackendTag.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { BackendAccountTag } from "./BackendAccountTag";
|
|
|
7
7
|
import { BackendActionTag } from "./BackendActionTag";
|
|
8
8
|
import { BackendAppTag } from "./BackendAppTag";
|
|
9
9
|
import { BackendAuditTag } from "./BackendAuditTag";
|
|
10
|
+
import { BackendBackupTag } from "./BackendBackupTag";
|
|
10
11
|
import { BackendCategoryTag } from "./BackendCategoryTag";
|
|
11
12
|
import { BackendConfigTag } from "./BackendConfigTag";
|
|
12
13
|
import { BackendConnectionTag } from "./BackendConnectionTag";
|
|
@@ -52,6 +53,7 @@ export declare class BackendTag extends TagAbstract {
|
|
|
52
53
|
log(): BackendLogTag;
|
|
53
54
|
identity(): BackendIdentityTag;
|
|
54
55
|
generator(): BackendGeneratorTag;
|
|
56
|
+
backup(): BackendBackupTag;
|
|
55
57
|
event(): BackendEventTag;
|
|
56
58
|
dashboard(): BackendDashboardTag;
|
|
57
59
|
cronjob(): BackendCronjobTag;
|
package/dist/BackendTag.js
CHANGED
|
@@ -7,6 +7,7 @@ import { BackendAccountTag } from "./BackendAccountTag";
|
|
|
7
7
|
import { BackendActionTag } from "./BackendActionTag";
|
|
8
8
|
import { BackendAppTag } from "./BackendAppTag";
|
|
9
9
|
import { BackendAuditTag } from "./BackendAuditTag";
|
|
10
|
+
import { BackendBackupTag } from "./BackendBackupTag";
|
|
10
11
|
import { BackendCategoryTag } from "./BackendCategoryTag";
|
|
11
12
|
import { BackendConfigTag } from "./BackendConfigTag";
|
|
12
13
|
import { BackendConnectionTag } from "./BackendConnectionTag";
|
|
@@ -90,6 +91,9 @@ export class BackendTag extends TagAbstract {
|
|
|
90
91
|
generator() {
|
|
91
92
|
return new BackendGeneratorTag(this.httpClient, this.parser);
|
|
92
93
|
}
|
|
94
|
+
backup() {
|
|
95
|
+
return new BackendBackupTag(this.httpClient, this.parser);
|
|
96
|
+
}
|
|
93
97
|
event() {
|
|
94
98
|
return new BackendEventTag(this.httpClient, this.parser);
|
|
95
99
|
}
|