fusio-sdk 5.1.2 → 5.1.3

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.
Files changed (40) hide show
  1. package/dist/BackendMarketplaceActionTag.d.ts +36 -0
  2. package/dist/BackendMarketplaceActionTag.js +173 -0
  3. package/dist/BackendMarketplaceAppTag.d.ts +35 -0
  4. package/dist/BackendMarketplaceAppTag.js +172 -0
  5. package/dist/BackendMarketplaceTag.d.ts +4 -34
  6. package/dist/BackendMarketplaceTag.js +6 -197
  7. package/dist/Client.d.ts +1 -1
  8. package/dist/Client.js +2 -2
  9. package/dist/MarketplaceAction.d.ts +10 -0
  10. package/dist/MarketplaceAction.js +5 -0
  11. package/dist/MarketplaceActionCollection.d.ts +7 -0
  12. package/dist/{BackendMarketplaceRemoteApp.js → MarketplaceActionCollection.js} +1 -1
  13. package/dist/MarketplaceActionConfig.d.ts +5 -0
  14. package/dist/MarketplaceActionConfig.js +5 -0
  15. package/dist/MarketplaceApp.d.ts +10 -0
  16. package/dist/MarketplaceApp.js +5 -0
  17. package/dist/MarketplaceAppCollection.d.ts +7 -0
  18. package/dist/{BackendMarketplaceCollectionApps.js → MarketplaceAppCollection.js} +1 -1
  19. package/dist/MarketplaceCollection.d.ts +10 -0
  20. package/dist/{BackendMarketplaceApp.js → MarketplaceCollection.js} +1 -1
  21. package/dist/MarketplaceInstall.d.ts +7 -0
  22. package/dist/MarketplaceInstall.js +5 -0
  23. package/dist/MarketplaceMessage.d.ts +8 -0
  24. package/dist/MarketplaceMessage.js +5 -0
  25. package/dist/MarketplaceMessageException.d.ts +11 -0
  26. package/dist/MarketplaceMessageException.js +14 -0
  27. package/dist/MarketplaceObject.d.ts +17 -0
  28. package/dist/MarketplaceObject.js +5 -0
  29. package/dist/MarketplaceUser.d.ts +9 -0
  30. package/dist/MarketplaceUser.js +5 -0
  31. package/package.json +1 -1
  32. package/dist/BackendMarketplaceApp.d.ts +0 -13
  33. package/dist/BackendMarketplaceCollection.d.ts +0 -8
  34. package/dist/BackendMarketplaceCollection.js +0 -5
  35. package/dist/BackendMarketplaceCollectionApps.d.ts +0 -6
  36. package/dist/BackendMarketplaceInstall.d.ts +0 -7
  37. package/dist/BackendMarketplaceInstall.js +0 -5
  38. package/dist/BackendMarketplaceLocalApp.d.ts +0 -8
  39. package/dist/BackendMarketplaceLocalApp.js +0 -5
  40. package/dist/BackendMarketplaceRemoteApp.d.ts +0 -8
@@ -0,0 +1,36 @@
1
+ /**
2
+ * BackendMarketplaceActionTag 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 { CommonMessage } from "./CommonMessage";
7
+ import { MarketplaceAction } from "./MarketplaceAction";
8
+ import { MarketplaceActionCollection } from "./MarketplaceActionCollection";
9
+ import { MarketplaceInstall } from "./MarketplaceInstall";
10
+ import { MarketplaceMessage } from "./MarketplaceMessage";
11
+ export declare class BackendMarketplaceActionTag extends TagAbstract {
12
+ /**
13
+ * @returns {Promise<CommonMessage>}
14
+ * @throws {CommonMessageExceptionException}
15
+ * @throws {ClientException}
16
+ */
17
+ upgrade(user: string, name: string): Promise<CommonMessage>;
18
+ /**
19
+ * @returns {Promise<MarketplaceAction>}
20
+ * @throws {MarketplaceMessageExceptionException}
21
+ * @throws {ClientException}
22
+ */
23
+ get(user: string, name: string): Promise<MarketplaceAction>;
24
+ /**
25
+ * @returns {Promise<MarketplaceMessage>}
26
+ * @throws {MarketplaceMessageExceptionException}
27
+ * @throws {ClientException}
28
+ */
29
+ install(payload: MarketplaceInstall): Promise<MarketplaceMessage>;
30
+ /**
31
+ * @returns {Promise<MarketplaceActionCollection>}
32
+ * @throws {MarketplaceMessageExceptionException}
33
+ * @throws {ClientException}
34
+ */
35
+ getAll(startIndex?: number, query?: string): Promise<MarketplaceActionCollection>;
36
+ }
@@ -0,0 +1,173 @@
1
+ /**
2
+ * BackendMarketplaceActionTag 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
+ import { MarketplaceMessageException } from "./MarketplaceMessageException";
10
+ export class BackendMarketplaceActionTag extends TagAbstract {
11
+ /**
12
+ * @returns {Promise<CommonMessage>}
13
+ * @throws {CommonMessageExceptionException}
14
+ * @throws {ClientException}
15
+ */
16
+ async upgrade(user, name) {
17
+ const url = this.parser.url('/backend/marketplace/action/:user/:name', {
18
+ 'user': user,
19
+ 'name': name,
20
+ });
21
+ let params = {
22
+ url: url,
23
+ method: 'PUT',
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 400:
37
+ throw new CommonMessageException(error.response.data);
38
+ case 401:
39
+ throw new CommonMessageException(error.response.data);
40
+ case 404:
41
+ throw new CommonMessageException(error.response.data);
42
+ case 410:
43
+ throw new CommonMessageException(error.response.data);
44
+ case 500:
45
+ throw new CommonMessageException(error.response.data);
46
+ default:
47
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
48
+ }
49
+ }
50
+ else {
51
+ throw new ClientException('An unknown error occurred: ' + String(error));
52
+ }
53
+ }
54
+ }
55
+ /**
56
+ * @returns {Promise<MarketplaceAction>}
57
+ * @throws {MarketplaceMessageExceptionException}
58
+ * @throws {ClientException}
59
+ */
60
+ async get(user, name) {
61
+ const url = this.parser.url('/backend/marketplace/action/:user/:name', {
62
+ 'user': user,
63
+ 'name': name,
64
+ });
65
+ let params = {
66
+ url: url,
67
+ method: 'GET',
68
+ params: this.parser.query({}, []),
69
+ };
70
+ try {
71
+ const response = await this.httpClient.request(params);
72
+ return response.data;
73
+ }
74
+ catch (error) {
75
+ if (error instanceof ClientException) {
76
+ throw error;
77
+ }
78
+ else if (axios.isAxiosError(error) && error.response) {
79
+ switch (error.response.status) {
80
+ case 401:
81
+ throw new MarketplaceMessageException(error.response.data);
82
+ case 404:
83
+ throw new MarketplaceMessageException(error.response.data);
84
+ case 410:
85
+ throw new MarketplaceMessageException(error.response.data);
86
+ case 500:
87
+ throw new MarketplaceMessageException(error.response.data);
88
+ default:
89
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
90
+ }
91
+ }
92
+ else {
93
+ throw new ClientException('An unknown error occurred: ' + String(error));
94
+ }
95
+ }
96
+ }
97
+ /**
98
+ * @returns {Promise<MarketplaceMessage>}
99
+ * @throws {MarketplaceMessageExceptionException}
100
+ * @throws {ClientException}
101
+ */
102
+ async install(payload) {
103
+ const url = this.parser.url('/backend/marketplace/action', {});
104
+ let params = {
105
+ url: url,
106
+ method: 'POST',
107
+ params: this.parser.query({}, []),
108
+ data: payload
109
+ };
110
+ try {
111
+ const response = await this.httpClient.request(params);
112
+ return response.data;
113
+ }
114
+ catch (error) {
115
+ if (error instanceof ClientException) {
116
+ throw error;
117
+ }
118
+ else if (axios.isAxiosError(error) && error.response) {
119
+ switch (error.response.status) {
120
+ case 400:
121
+ throw new MarketplaceMessageException(error.response.data);
122
+ case 401:
123
+ throw new MarketplaceMessageException(error.response.data);
124
+ case 500:
125
+ throw new MarketplaceMessageException(error.response.data);
126
+ default:
127
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
128
+ }
129
+ }
130
+ else {
131
+ throw new ClientException('An unknown error occurred: ' + String(error));
132
+ }
133
+ }
134
+ }
135
+ /**
136
+ * @returns {Promise<MarketplaceActionCollection>}
137
+ * @throws {MarketplaceMessageExceptionException}
138
+ * @throws {ClientException}
139
+ */
140
+ async getAll(startIndex, query) {
141
+ const url = this.parser.url('/backend/marketplace/action', {});
142
+ let params = {
143
+ url: url,
144
+ method: 'GET',
145
+ params: this.parser.query({
146
+ 'startIndex': startIndex,
147
+ 'query': query,
148
+ }, []),
149
+ };
150
+ try {
151
+ const response = await this.httpClient.request(params);
152
+ return response.data;
153
+ }
154
+ catch (error) {
155
+ if (error instanceof ClientException) {
156
+ throw error;
157
+ }
158
+ else if (axios.isAxiosError(error) && error.response) {
159
+ switch (error.response.status) {
160
+ case 401:
161
+ throw new MarketplaceMessageException(error.response.data);
162
+ case 500:
163
+ throw new MarketplaceMessageException(error.response.data);
164
+ default:
165
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
166
+ }
167
+ }
168
+ else {
169
+ throw new ClientException('An unknown error occurred: ' + String(error));
170
+ }
171
+ }
172
+ }
173
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * BackendMarketplaceAppTag 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 { MarketplaceApp } from "./MarketplaceApp";
7
+ import { MarketplaceAppCollection } from "./MarketplaceAppCollection";
8
+ import { MarketplaceInstall } from "./MarketplaceInstall";
9
+ import { MarketplaceMessage } from "./MarketplaceMessage";
10
+ export declare class BackendMarketplaceAppTag extends TagAbstract {
11
+ /**
12
+ * @returns {Promise<MarketplaceMessage>}
13
+ * @throws {MarketplaceMessageExceptionException}
14
+ * @throws {ClientException}
15
+ */
16
+ upgrade(user: string, name: string): Promise<MarketplaceMessage>;
17
+ /**
18
+ * @returns {Promise<MarketplaceApp>}
19
+ * @throws {MarketplaceMessageExceptionException}
20
+ * @throws {ClientException}
21
+ */
22
+ get(user: string, name: string): Promise<MarketplaceApp>;
23
+ /**
24
+ * @returns {Promise<MarketplaceMessage>}
25
+ * @throws {MarketplaceMessageExceptionException}
26
+ * @throws {ClientException}
27
+ */
28
+ install(payload: MarketplaceInstall): Promise<MarketplaceMessage>;
29
+ /**
30
+ * @returns {Promise<MarketplaceAppCollection>}
31
+ * @throws {MarketplaceMessageExceptionException}
32
+ * @throws {ClientException}
33
+ */
34
+ getAll(startIndex?: number, query?: string): Promise<MarketplaceAppCollection>;
35
+ }
@@ -0,0 +1,172 @@
1
+ /**
2
+ * BackendMarketplaceAppTag 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 { MarketplaceMessageException } from "./MarketplaceMessageException";
9
+ export class BackendMarketplaceAppTag extends TagAbstract {
10
+ /**
11
+ * @returns {Promise<MarketplaceMessage>}
12
+ * @throws {MarketplaceMessageExceptionException}
13
+ * @throws {ClientException}
14
+ */
15
+ async upgrade(user, name) {
16
+ const url = this.parser.url('/backend/marketplace/app/:user/:name', {
17
+ 'user': user,
18
+ 'name': name,
19
+ });
20
+ let params = {
21
+ url: url,
22
+ method: 'PUT',
23
+ params: this.parser.query({}, []),
24
+ };
25
+ try {
26
+ const response = await this.httpClient.request(params);
27
+ return response.data;
28
+ }
29
+ catch (error) {
30
+ if (error instanceof ClientException) {
31
+ throw error;
32
+ }
33
+ else if (axios.isAxiosError(error) && error.response) {
34
+ switch (error.response.status) {
35
+ case 400:
36
+ throw new MarketplaceMessageException(error.response.data);
37
+ case 401:
38
+ throw new MarketplaceMessageException(error.response.data);
39
+ case 404:
40
+ throw new MarketplaceMessageException(error.response.data);
41
+ case 410:
42
+ throw new MarketplaceMessageException(error.response.data);
43
+ case 500:
44
+ throw new MarketplaceMessageException(error.response.data);
45
+ default:
46
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
47
+ }
48
+ }
49
+ else {
50
+ throw new ClientException('An unknown error occurred: ' + String(error));
51
+ }
52
+ }
53
+ }
54
+ /**
55
+ * @returns {Promise<MarketplaceApp>}
56
+ * @throws {MarketplaceMessageExceptionException}
57
+ * @throws {ClientException}
58
+ */
59
+ async get(user, name) {
60
+ const url = this.parser.url('/backend/marketplace/app/:user/:name', {
61
+ 'user': user,
62
+ 'name': name,
63
+ });
64
+ let params = {
65
+ url: url,
66
+ method: 'GET',
67
+ params: this.parser.query({}, []),
68
+ };
69
+ try {
70
+ const response = await this.httpClient.request(params);
71
+ return response.data;
72
+ }
73
+ catch (error) {
74
+ if (error instanceof ClientException) {
75
+ throw error;
76
+ }
77
+ else if (axios.isAxiosError(error) && error.response) {
78
+ switch (error.response.status) {
79
+ case 401:
80
+ throw new MarketplaceMessageException(error.response.data);
81
+ case 404:
82
+ throw new MarketplaceMessageException(error.response.data);
83
+ case 410:
84
+ throw new MarketplaceMessageException(error.response.data);
85
+ case 500:
86
+ throw new MarketplaceMessageException(error.response.data);
87
+ default:
88
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
89
+ }
90
+ }
91
+ else {
92
+ throw new ClientException('An unknown error occurred: ' + String(error));
93
+ }
94
+ }
95
+ }
96
+ /**
97
+ * @returns {Promise<MarketplaceMessage>}
98
+ * @throws {MarketplaceMessageExceptionException}
99
+ * @throws {ClientException}
100
+ */
101
+ async install(payload) {
102
+ const url = this.parser.url('/backend/marketplace/app', {});
103
+ let params = {
104
+ url: url,
105
+ method: 'POST',
106
+ params: this.parser.query({}, []),
107
+ data: payload
108
+ };
109
+ try {
110
+ const response = await this.httpClient.request(params);
111
+ return response.data;
112
+ }
113
+ catch (error) {
114
+ if (error instanceof ClientException) {
115
+ throw error;
116
+ }
117
+ else if (axios.isAxiosError(error) && error.response) {
118
+ switch (error.response.status) {
119
+ case 400:
120
+ throw new MarketplaceMessageException(error.response.data);
121
+ case 401:
122
+ throw new MarketplaceMessageException(error.response.data);
123
+ case 500:
124
+ throw new MarketplaceMessageException(error.response.data);
125
+ default:
126
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
127
+ }
128
+ }
129
+ else {
130
+ throw new ClientException('An unknown error occurred: ' + String(error));
131
+ }
132
+ }
133
+ }
134
+ /**
135
+ * @returns {Promise<MarketplaceAppCollection>}
136
+ * @throws {MarketplaceMessageExceptionException}
137
+ * @throws {ClientException}
138
+ */
139
+ async getAll(startIndex, query) {
140
+ const url = this.parser.url('/backend/marketplace/app', {});
141
+ let params = {
142
+ url: url,
143
+ method: 'GET',
144
+ params: this.parser.query({
145
+ 'startIndex': startIndex,
146
+ 'query': query,
147
+ }, []),
148
+ };
149
+ try {
150
+ const response = await this.httpClient.request(params);
151
+ return response.data;
152
+ }
153
+ catch (error) {
154
+ if (error instanceof ClientException) {
155
+ throw error;
156
+ }
157
+ else if (axios.isAxiosError(error) && error.response) {
158
+ switch (error.response.status) {
159
+ case 401:
160
+ throw new MarketplaceMessageException(error.response.data);
161
+ case 500:
162
+ throw new MarketplaceMessageException(error.response.data);
163
+ default:
164
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
165
+ }
166
+ }
167
+ else {
168
+ throw new ClientException('An unknown error occurred: ' + String(error));
169
+ }
170
+ }
171
+ }
172
+ }
@@ -3,39 +3,9 @@
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  import { TagAbstract } from "sdkgen-client";
6
- import { BackendMarketplaceCollection } from "./BackendMarketplaceCollection";
7
- import { BackendMarketplaceInstall } from "./BackendMarketplaceInstall";
8
- import { BackendMarketplaceLocalApp } from "./BackendMarketplaceLocalApp";
9
- import { CommonMessage } from "./CommonMessage";
6
+ import { BackendMarketplaceActionTag } from "./BackendMarketplaceActionTag";
7
+ import { BackendMarketplaceAppTag } from "./BackendMarketplaceAppTag";
10
8
  export declare class BackendMarketplaceTag extends TagAbstract {
11
- /**
12
- * @returns {Promise<CommonMessage>}
13
- * @throws {CommonMessageExceptionException}
14
- * @throws {ClientException}
15
- */
16
- remove(appName: string): Promise<CommonMessage>;
17
- /**
18
- * @returns {Promise<CommonMessage>}
19
- * @throws {CommonMessageExceptionException}
20
- * @throws {ClientException}
21
- */
22
- update(appName: string): Promise<CommonMessage>;
23
- /**
24
- * @returns {Promise<BackendMarketplaceLocalApp>}
25
- * @throws {CommonMessageExceptionException}
26
- * @throws {ClientException}
27
- */
28
- get(appName: string): Promise<BackendMarketplaceLocalApp>;
29
- /**
30
- * @returns {Promise<CommonMessage>}
31
- * @throws {CommonMessageExceptionException}
32
- * @throws {ClientException}
33
- */
34
- install(payload: BackendMarketplaceInstall): Promise<CommonMessage>;
35
- /**
36
- * @returns {Promise<BackendMarketplaceCollection>}
37
- * @throws {CommonMessageExceptionException}
38
- * @throws {ClientException}
39
- */
40
- getAll(): Promise<BackendMarketplaceCollection>;
9
+ app(): BackendMarketplaceAppTag;
10
+ action(): BackendMarketplaceActionTag;
41
11
  }
@@ -2,205 +2,14 @@
2
2
  * BackendMarketplaceTag automatically generated by SDKgen please do not edit this file manually
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
- import axios from "axios";
6
5
  import { TagAbstract } from "sdkgen-client";
7
- import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
8
- import { CommonMessageException } from "./CommonMessageException";
6
+ import { BackendMarketplaceActionTag } from "./BackendMarketplaceActionTag";
7
+ import { BackendMarketplaceAppTag } from "./BackendMarketplaceAppTag";
9
8
  export class BackendMarketplaceTag extends TagAbstract {
10
- /**
11
- * @returns {Promise<CommonMessage>}
12
- * @throws {CommonMessageExceptionException}
13
- * @throws {ClientException}
14
- */
15
- async remove(appName) {
16
- const url = this.parser.url('/backend/marketplace/:app_name', {
17
- 'app_name': appName,
18
- });
19
- let params = {
20
- url: url,
21
- method: 'DELETE',
22
- params: this.parser.query({}, []),
23
- };
24
- try {
25
- const response = await this.httpClient.request(params);
26
- return response.data;
27
- }
28
- catch (error) {
29
- if (error instanceof ClientException) {
30
- throw error;
31
- }
32
- else if (axios.isAxiosError(error) && error.response) {
33
- switch (error.response.status) {
34
- case 400:
35
- throw new CommonMessageException(error.response.data);
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
- }
9
+ app() {
10
+ return new BackendMarketplaceAppTag(this.httpClient, this.parser);
48
11
  }
49
- /**
50
- * @returns {Promise<CommonMessage>}
51
- * @throws {CommonMessageExceptionException}
52
- * @throws {ClientException}
53
- */
54
- async update(appName) {
55
- const url = this.parser.url('/backend/marketplace/:app_name', {
56
- 'app_name': appName,
57
- });
58
- let params = {
59
- url: url,
60
- method: 'PUT',
61
- params: this.parser.query({}, []),
62
- };
63
- try {
64
- const response = await this.httpClient.request(params);
65
- return response.data;
66
- }
67
- catch (error) {
68
- if (error instanceof ClientException) {
69
- throw error;
70
- }
71
- else if (axios.isAxiosError(error) && error.response) {
72
- switch (error.response.status) {
73
- case 400:
74
- throw new CommonMessageException(error.response.data);
75
- case 401:
76
- throw new CommonMessageException(error.response.data);
77
- case 404:
78
- throw new CommonMessageException(error.response.data);
79
- case 410:
80
- throw new CommonMessageException(error.response.data);
81
- case 500:
82
- throw new CommonMessageException(error.response.data);
83
- default:
84
- throw new UnknownStatusCodeException('The server returned an unknown status code');
85
- }
86
- }
87
- else {
88
- throw new ClientException('An unknown error occurred: ' + String(error));
89
- }
90
- }
91
- }
92
- /**
93
- * @returns {Promise<BackendMarketplaceLocalApp>}
94
- * @throws {CommonMessageExceptionException}
95
- * @throws {ClientException}
96
- */
97
- async get(appName) {
98
- const url = this.parser.url('/backend/marketplace/:app_name', {
99
- 'app_name': appName,
100
- });
101
- let params = {
102
- url: url,
103
- method: 'GET',
104
- params: this.parser.query({}, []),
105
- };
106
- try {
107
- const response = await this.httpClient.request(params);
108
- return response.data;
109
- }
110
- catch (error) {
111
- if (error instanceof ClientException) {
112
- throw error;
113
- }
114
- else if (axios.isAxiosError(error) && error.response) {
115
- switch (error.response.status) {
116
- case 401:
117
- throw new CommonMessageException(error.response.data);
118
- case 404:
119
- throw new CommonMessageException(error.response.data);
120
- case 410:
121
- throw new CommonMessageException(error.response.data);
122
- case 500:
123
- throw new CommonMessageException(error.response.data);
124
- default:
125
- throw new UnknownStatusCodeException('The server returned an unknown status code');
126
- }
127
- }
128
- else {
129
- throw new ClientException('An unknown error occurred: ' + String(error));
130
- }
131
- }
132
- }
133
- /**
134
- * @returns {Promise<CommonMessage>}
135
- * @throws {CommonMessageExceptionException}
136
- * @throws {ClientException}
137
- */
138
- async install(payload) {
139
- const url = this.parser.url('/backend/marketplace', {});
140
- let params = {
141
- url: url,
142
- method: 'POST',
143
- params: this.parser.query({}, []),
144
- data: payload
145
- };
146
- try {
147
- const response = await this.httpClient.request(params);
148
- return response.data;
149
- }
150
- catch (error) {
151
- if (error instanceof ClientException) {
152
- throw error;
153
- }
154
- else if (axios.isAxiosError(error) && error.response) {
155
- switch (error.response.status) {
156
- case 400:
157
- throw new CommonMessageException(error.response.data);
158
- case 401:
159
- throw new CommonMessageException(error.response.data);
160
- case 500:
161
- throw new CommonMessageException(error.response.data);
162
- default:
163
- throw new UnknownStatusCodeException('The server returned an unknown status code');
164
- }
165
- }
166
- else {
167
- throw new ClientException('An unknown error occurred: ' + String(error));
168
- }
169
- }
170
- }
171
- /**
172
- * @returns {Promise<BackendMarketplaceCollection>}
173
- * @throws {CommonMessageExceptionException}
174
- * @throws {ClientException}
175
- */
176
- async getAll() {
177
- const url = this.parser.url('/backend/marketplace', {});
178
- let params = {
179
- url: url,
180
- method: 'GET',
181
- params: this.parser.query({}, []),
182
- };
183
- try {
184
- const response = await this.httpClient.request(params);
185
- return response.data;
186
- }
187
- catch (error) {
188
- if (error instanceof ClientException) {
189
- throw error;
190
- }
191
- else if (axios.isAxiosError(error) && error.response) {
192
- switch (error.response.status) {
193
- case 401:
194
- throw new CommonMessageException(error.response.data);
195
- case 500:
196
- throw new CommonMessageException(error.response.data);
197
- default:
198
- throw new UnknownStatusCodeException('The server returned an unknown status code');
199
- }
200
- }
201
- else {
202
- throw new ClientException('An unknown error occurred: ' + String(error));
203
- }
204
- }
12
+ action() {
13
+ return new BackendMarketplaceActionTag(this.httpClient, this.parser);
205
14
  }
206
15
  }
package/dist/Client.d.ts CHANGED
@@ -12,5 +12,5 @@ export declare class Client extends ClientAbstract {
12
12
  system(): SystemTag;
13
13
  consumer(): ConsumerTag;
14
14
  backend(): BackendTag;
15
- static build(): Client;
15
+ static build(baseUrl: string): Client;
16
16
  }
package/dist/Client.js CHANGED
@@ -21,7 +21,7 @@ export class Client extends ClientAbstract {
21
21
  backend() {
22
22
  return new BackendTag(this.httpClient, this.parser);
23
23
  }
24
- static build() {
25
- return new Client('https://api.sdkgen.app/', new Anonymous());
24
+ static build(baseUrl) {
25
+ return new Client(baseUrl, new Anonymous());
26
26
  }
27
27
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * MarketplaceAction automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { MarketplaceObject } from "./MarketplaceObject";
6
+ import { MarketplaceActionConfig } from "./MarketplaceActionConfig";
7
+ export interface MarketplaceAction extends MarketplaceObject {
8
+ class?: string;
9
+ config?: MarketplaceActionConfig;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceAction 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
+ * MarketplaceActionCollection automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { MarketplaceCollection } from "./MarketplaceCollection";
6
+ import { MarketplaceAction } from "./MarketplaceAction";
7
+ export type MarketplaceActionCollection = MarketplaceCollection<MarketplaceAction>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * BackendMarketplaceRemoteApp automatically generated by SDKgen please do not edit this file manually
2
+ * MarketplaceActionCollection automatically generated by SDKgen please do not edit this file manually
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceActionConfig automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export type MarketplaceActionConfig = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceActionConfig 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
+ * MarketplaceApp automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { MarketplaceObject } from "./MarketplaceObject";
6
+ export interface MarketplaceApp extends MarketplaceObject {
7
+ scopes?: Array<string>;
8
+ downloadUrl?: string;
9
+ hash?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceApp 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
+ * MarketplaceAppCollection automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { MarketplaceCollection } from "./MarketplaceCollection";
6
+ import { MarketplaceApp } from "./MarketplaceApp";
7
+ export type MarketplaceAppCollection = MarketplaceCollection<MarketplaceApp>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * BackendMarketplaceCollectionApps automatically generated by SDKgen please do not edit this file manually
2
+ * MarketplaceAppCollection automatically generated by SDKgen please do not edit this file manually
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * MarketplaceCollection automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface MarketplaceCollection<T> {
6
+ totalResults?: number;
7
+ startIndex?: number;
8
+ itemsPerPage?: number;
9
+ entry?: Array<T>;
10
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * BackendMarketplaceApp automatically generated by SDKgen please do not edit this file manually
2
+ * MarketplaceCollection automatically generated by SDKgen please do not edit this file manually
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MarketplaceInstall automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface MarketplaceInstall {
6
+ name?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceInstall automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MarketplaceMessage automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface MarketplaceMessage {
6
+ success?: boolean;
7
+ message?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceMessage automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * MarketplaceMessageException automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { KnownStatusCodeException } from "sdkgen-client";
6
+ import { MarketplaceMessage } from "./MarketplaceMessage";
7
+ export declare class MarketplaceMessageException extends KnownStatusCodeException {
8
+ private payload;
9
+ constructor(payload: MarketplaceMessage);
10
+ getPayload(): MarketplaceMessage;
11
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * MarketplaceMessageException automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { KnownStatusCodeException } from "sdkgen-client";
6
+ export class MarketplaceMessageException extends KnownStatusCodeException {
7
+ constructor(payload) {
8
+ super('The server returned an error');
9
+ this.payload = payload;
10
+ }
11
+ getPayload() {
12
+ return this.payload;
13
+ }
14
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * MarketplaceObject automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { MarketplaceUser } from "./MarketplaceUser";
6
+ export interface MarketplaceObject {
7
+ id?: number;
8
+ name?: string;
9
+ author?: MarketplaceUser;
10
+ version?: string;
11
+ icon?: string;
12
+ summary?: string;
13
+ description?: string;
14
+ cost?: number;
15
+ updateDate?: string;
16
+ insertDate?: string;
17
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceObject 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
+ * MarketplaceUser automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface MarketplaceUser {
6
+ id?: number;
7
+ name?: string;
8
+ verified?: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MarketplaceUser automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusio-sdk",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "SDK to talk to the Fusio API",
5
5
  "keywords": [
6
6
  "API",
@@ -1,13 +0,0 @@
1
- /**
2
- * BackendMarketplaceApp automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- export interface BackendMarketplaceApp {
6
- version?: string;
7
- description?: string;
8
- screenshot?: string;
9
- website?: string;
10
- downloadUrl?: string;
11
- sha1Hash?: string;
12
- startUrl?: string;
13
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * BackendMarketplaceCollection automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- import { BackendMarketplaceCollectionApps } from "./BackendMarketplaceCollectionApps";
6
- export interface BackendMarketplaceCollection {
7
- apps?: BackendMarketplaceCollectionApps;
8
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * BackendMarketplaceCollection automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- export {};
@@ -1,6 +0,0 @@
1
- /**
2
- * BackendMarketplaceCollectionApps automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- import { BackendMarketplaceRemoteApp } from "./BackendMarketplaceRemoteApp";
6
- export type BackendMarketplaceCollectionApps = Record<string, BackendMarketplaceRemoteApp>;
@@ -1,7 +0,0 @@
1
- /**
2
- * BackendMarketplaceInstall automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- export interface BackendMarketplaceInstall {
6
- name?: string;
7
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * BackendMarketplaceInstall automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * BackendMarketplaceLocalApp automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- import { BackendMarketplaceApp } from "./BackendMarketplaceApp";
6
- export interface BackendMarketplaceLocalApp extends BackendMarketplaceApp {
7
- remote?: BackendMarketplaceApp;
8
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * BackendMarketplaceLocalApp automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * BackendMarketplaceRemoteApp automatically generated by SDKgen please do not edit this file manually
3
- * {@link https://sdkgen.app}
4
- */
5
- import { BackendMarketplaceApp } from "./BackendMarketplaceApp";
6
- export interface BackendMarketplaceRemoteApp extends BackendMarketplaceApp {
7
- local?: BackendMarketplaceApp;
8
- }