fusio-sdk 5.0.4 → 5.0.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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BackendBackupExport automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendBackupExport {
6
+ export?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendBackupExport 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
+ * BackendBackupImport automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendBackupImport {
6
+ import?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendBackupImport 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
+ * BackendBackupImportResult automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface BackendBackupImportResult {
6
+ success?: boolean;
7
+ message?: string;
8
+ logs?: Array<string>;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BackendBackupImportResult automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -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
+ }
@@ -32,6 +32,8 @@ export class BackendGeneratorTag extends TagAbstract {
32
32
  }
33
33
  else if (axios.isAxiosError(error) && error.response) {
34
34
  switch (error.response.status) {
35
+ case 400:
36
+ throw new CommonMessageException(error.response.data);
35
37
  case 401:
36
38
  throw new CommonMessageException(error.response.data);
37
39
  case 500:
@@ -70,6 +72,8 @@ export class BackendGeneratorTag extends TagAbstract {
70
72
  }
71
73
  else if (axios.isAxiosError(error) && error.response) {
72
74
  switch (error.response.status) {
75
+ case 400:
76
+ throw new CommonMessageException(error.response.data);
73
77
  case 401:
74
78
  throw new CommonMessageException(error.response.data);
75
79
  case 500:
@@ -107,6 +111,8 @@ export class BackendGeneratorTag extends TagAbstract {
107
111
  }
108
112
  else if (axios.isAxiosError(error) && error.response) {
109
113
  switch (error.response.status) {
114
+ case 400:
115
+ throw new CommonMessageException(error.response.data);
110
116
  case 401:
111
117
  throw new CommonMessageException(error.response.data);
112
118
  case 500:
@@ -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;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusio-sdk",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "SDK to talk to the Fusio API",
5
5
  "keywords": [
6
6
  "API",