fusio-sdk 3.0.4 → 3.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.
- package/dist/src/generated/backend/AccountTag.d.ts +3 -0
- package/dist/src/generated/backend/AccountTag.js +20 -0
- package/dist/src/generated/backend/ActionTag.d.ts +10 -2
- package/dist/src/generated/backend/ActionTag.js +67 -4
- package/dist/src/generated/backend/AppTag.d.ts +10 -2
- package/dist/src/generated/backend/AppTag.js +82 -4
- package/dist/src/generated/backend/AuditTag.d.ts +3 -1
- package/dist/src/generated/backend/AuditTag.js +28 -2
- package/dist/src/generated/backend/CategoryTag.d.ts +6 -1
- package/dist/src/generated/backend/CategoryTag.js +48 -2
- package/dist/src/generated/backend/ConfigTag.d.ts +4 -1
- package/dist/src/generated/backend/ConfigTag.js +32 -2
- package/dist/src/generated/backend/ConnectionTag.d.ts +14 -4
- package/dist/src/generated/backend/ConnectionTag.js +82 -5
- package/dist/src/generated/backend/CronjobTag.d.ts +6 -1
- package/dist/src/generated/backend/CronjobTag.js +48 -2
- package/dist/src/generated/backend/DashboardTag.d.ts +1 -0
- package/dist/src/generated/backend/DashboardTag.js +6 -0
- package/dist/src/generated/backend/EventTag.d.ts +12 -2
- package/dist/src/generated/backend/EventTag.js +94 -4
- package/dist/src/generated/backend/GeneratorTag.d.ts +4 -0
- package/dist/src/generated/backend/GeneratorTag.js +21 -0
- package/dist/src/generated/backend/LogTag.d.ts +6 -2
- package/dist/src/generated/backend/LogTag.js +48 -4
- package/dist/src/generated/backend/MarketplaceTag.d.ts +5 -0
- package/dist/src/generated/backend/MarketplaceTag.js +40 -0
- package/dist/src/generated/backend/MessageException.d.ts +11 -0
- package/dist/src/generated/backend/MessageException.js +14 -0
- package/dist/src/generated/backend/OperationTag.d.ts +6 -1
- package/dist/src/generated/backend/OperationTag.js +49 -2
- package/dist/src/generated/backend/PageTag.d.ts +6 -1
- package/dist/src/generated/backend/PageTag.js +48 -2
- package/dist/src/generated/backend/PlanTag.d.ts +6 -1
- package/dist/src/generated/backend/PlanTag.js +48 -2
- package/dist/src/generated/backend/RateTag.d.ts +6 -1
- package/dist/src/generated/backend/RateTag.js +48 -2
- package/dist/src/generated/backend/RoleTag.d.ts +6 -1
- package/dist/src/generated/backend/RoleTag.js +48 -2
- package/dist/src/generated/backend/SchemaTag.d.ts +8 -1
- package/dist/src/generated/backend/SchemaTag.js +65 -2
- package/dist/src/generated/backend/ScopeTag.d.ts +7 -1
- package/dist/src/generated/backend/ScopeTag.js +54 -2
- package/dist/src/generated/backend/SdkTag.d.ts +2 -0
- package/dist/src/generated/backend/SdkTag.js +11 -0
- package/dist/src/generated/backend/StatisticTag.d.ts +20 -10
- package/dist/src/generated/backend/StatisticTag.js +221 -20
- package/dist/src/generated/backend/TransactionTag.d.ts +3 -1
- package/dist/src/generated/backend/TransactionTag.js +28 -2
- package/dist/src/generated/backend/TrashTag.d.ts +4 -1
- package/dist/src/generated/backend/TrashTag.js +24 -2
- package/dist/src/generated/backend/UserTag.d.ts +6 -1
- package/dist/src/generated/backend/UserTag.js +48 -2
- package/dist/src/generated/consumer/AccountTag.d.ts +12 -0
- package/dist/src/generated/consumer/AccountTag.js +77 -0
- package/dist/src/generated/consumer/AppTag.d.ts +6 -1
- package/dist/src/generated/consumer/AppTag.js +48 -2
- package/dist/src/generated/consumer/EventTag.d.ts +2 -1
- package/dist/src/generated/consumer/EventTag.js +12 -2
- package/dist/src/generated/consumer/GrantTag.d.ts +3 -1
- package/dist/src/generated/consumer/GrantTag.js +21 -2
- package/dist/src/generated/consumer/LogTag.d.ts +3 -1
- package/dist/src/generated/consumer/LogTag.js +21 -2
- package/dist/src/generated/consumer/MessageException.d.ts +11 -0
- package/dist/src/generated/consumer/MessageException.js +14 -0
- package/dist/src/generated/consumer/PageTag.d.ts +3 -1
- package/dist/src/generated/consumer/PageTag.js +21 -2
- package/dist/src/generated/consumer/PaymentTag.d.ts +2 -0
- package/dist/src/generated/consumer/PaymentTag.js +11 -0
- package/dist/src/generated/consumer/PlanTag.d.ts +3 -1
- package/dist/src/generated/consumer/PlanTag.js +21 -2
- package/dist/src/generated/consumer/ScopeTag.d.ts +2 -1
- package/dist/src/generated/consumer/ScopeTag.js +12 -2
- package/dist/src/generated/consumer/SubscriptionTag.d.ts +6 -1
- package/dist/src/generated/consumer/SubscriptionTag.js +48 -2
- package/dist/src/generated/consumer/TransactionTag.d.ts +3 -1
- package/dist/src/generated/consumer/TransactionTag.js +21 -2
- package/package.json +1 -1
|
@@ -10,16 +10,19 @@ import { UserUpdate } from "./UserUpdate";
|
|
|
10
10
|
export declare class AccountTag extends TagAbstract {
|
|
11
11
|
/**
|
|
12
12
|
* @returns {Promise<Message>}
|
|
13
|
+
* @throws {MessageException}
|
|
13
14
|
* @throws {ClientException}
|
|
14
15
|
*/
|
|
15
16
|
changePassword(payload: AccountChangePassword): Promise<Message>;
|
|
16
17
|
/**
|
|
17
18
|
* @returns {Promise<Message>}
|
|
19
|
+
* @throws {MessageException}
|
|
18
20
|
* @throws {ClientException}
|
|
19
21
|
*/
|
|
20
22
|
update(payload: UserUpdate): Promise<Message>;
|
|
21
23
|
/**
|
|
22
24
|
* @returns {Promise<User>}
|
|
25
|
+
* @throws {MessageException}
|
|
23
26
|
* @throws {ClientException}
|
|
24
27
|
*/
|
|
25
28
|
get(): Promise<User>;
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import axios from "axios";
|
|
6
6
|
import { TagAbstract } from "sdkgen-client";
|
|
7
7
|
import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
|
|
8
|
+
import { MessageException } from "./MessageException";
|
|
8
9
|
export class AccountTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async changePassword(payload) {
|
|
@@ -25,6 +27,12 @@ export class AccountTag extends TagAbstract {
|
|
|
25
27
|
catch (error) {
|
|
26
28
|
if (axios.isAxiosError(error) && error.response) {
|
|
27
29
|
switch (error.response.status) {
|
|
30
|
+
case 400:
|
|
31
|
+
throw new MessageException(error.response.data);
|
|
32
|
+
case 401:
|
|
33
|
+
throw new MessageException(error.response.data);
|
|
34
|
+
case 500:
|
|
35
|
+
throw new MessageException(error.response.data);
|
|
28
36
|
default:
|
|
29
37
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
30
38
|
}
|
|
@@ -34,6 +42,7 @@ export class AccountTag extends TagAbstract {
|
|
|
34
42
|
}
|
|
35
43
|
/**
|
|
36
44
|
* @returns {Promise<Message>}
|
|
45
|
+
* @throws {MessageException}
|
|
37
46
|
* @throws {ClientException}
|
|
38
47
|
*/
|
|
39
48
|
async update(payload) {
|
|
@@ -51,6 +60,12 @@ export class AccountTag extends TagAbstract {
|
|
|
51
60
|
catch (error) {
|
|
52
61
|
if (axios.isAxiosError(error) && error.response) {
|
|
53
62
|
switch (error.response.status) {
|
|
63
|
+
case 400:
|
|
64
|
+
throw new MessageException(error.response.data);
|
|
65
|
+
case 401:
|
|
66
|
+
throw new MessageException(error.response.data);
|
|
67
|
+
case 500:
|
|
68
|
+
throw new MessageException(error.response.data);
|
|
54
69
|
default:
|
|
55
70
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
56
71
|
}
|
|
@@ -60,6 +75,7 @@ export class AccountTag extends TagAbstract {
|
|
|
60
75
|
}
|
|
61
76
|
/**
|
|
62
77
|
* @returns {Promise<User>}
|
|
78
|
+
* @throws {MessageException}
|
|
63
79
|
* @throws {ClientException}
|
|
64
80
|
*/
|
|
65
81
|
async get() {
|
|
@@ -76,6 +92,10 @@ export class AccountTag extends TagAbstract {
|
|
|
76
92
|
catch (error) {
|
|
77
93
|
if (axios.isAxiosError(error) && error.response) {
|
|
78
94
|
switch (error.response.status) {
|
|
95
|
+
case 401:
|
|
96
|
+
throw new MessageException(error.response.data);
|
|
97
|
+
case 500:
|
|
98
|
+
throw new MessageException(error.response.data);
|
|
79
99
|
default:
|
|
80
100
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
81
101
|
}
|
|
@@ -15,42 +15,50 @@ import { Message } from "./Message";
|
|
|
15
15
|
export declare class ActionTag extends TagAbstract {
|
|
16
16
|
/**
|
|
17
17
|
* @returns {Promise<Message>}
|
|
18
|
+
* @throws {MessageException}
|
|
18
19
|
* @throws {ClientException}
|
|
19
20
|
*/
|
|
20
21
|
delete(actionId: string): Promise<Message>;
|
|
21
22
|
/**
|
|
22
23
|
* @returns {Promise<Message>}
|
|
24
|
+
* @throws {MessageException}
|
|
23
25
|
* @throws {ClientException}
|
|
24
26
|
*/
|
|
25
27
|
update(actionId: string, payload: ActionUpdate): Promise<Message>;
|
|
26
28
|
/**
|
|
27
29
|
* @returns {Promise<Action>}
|
|
30
|
+
* @throws {MessageException}
|
|
28
31
|
* @throws {ClientException}
|
|
29
32
|
*/
|
|
30
33
|
get(actionId: string): Promise<Action>;
|
|
31
34
|
/**
|
|
32
35
|
* @returns {Promise<ActionExecuteResponse>}
|
|
36
|
+
* @throws {MessageException}
|
|
33
37
|
* @throws {ClientException}
|
|
34
38
|
*/
|
|
35
39
|
execute(actionId: string, payload: ActionExecuteRequest): Promise<ActionExecuteResponse>;
|
|
36
40
|
/**
|
|
37
41
|
* @returns {Promise<FormContainer>}
|
|
42
|
+
* @throws {MessageException}
|
|
38
43
|
* @throws {ClientException}
|
|
39
44
|
*/
|
|
40
|
-
getForm(): Promise<FormContainer>;
|
|
45
|
+
getForm(_class?: string): Promise<FormContainer>;
|
|
41
46
|
/**
|
|
42
47
|
* @returns {Promise<ActionIndex>}
|
|
48
|
+
* @throws {MessageException}
|
|
43
49
|
* @throws {ClientException}
|
|
44
50
|
*/
|
|
45
51
|
getClasses(): Promise<ActionIndex>;
|
|
46
52
|
/**
|
|
47
53
|
* @returns {Promise<Message>}
|
|
54
|
+
* @throws {MessageException}
|
|
48
55
|
* @throws {ClientException}
|
|
49
56
|
*/
|
|
50
57
|
create(payload: ActionCreate): Promise<Message>;
|
|
51
58
|
/**
|
|
52
59
|
* @returns {Promise<ActionCollection>}
|
|
60
|
+
* @throws {MessageException}
|
|
53
61
|
* @throws {ClientException}
|
|
54
62
|
*/
|
|
55
|
-
getAll(): Promise<ActionCollection>;
|
|
63
|
+
getAll(startIndex?: number, count?: number, categoryId?: number): Promise<ActionCollection>;
|
|
56
64
|
}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import axios from "axios";
|
|
6
6
|
import { TagAbstract } from "sdkgen-client";
|
|
7
7
|
import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
|
|
8
|
+
import { MessageException } from "./MessageException";
|
|
8
9
|
export class ActionTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async delete(actionId) {
|
|
@@ -26,6 +28,14 @@ export class ActionTag extends TagAbstract {
|
|
|
26
28
|
catch (error) {
|
|
27
29
|
if (axios.isAxiosError(error) && error.response) {
|
|
28
30
|
switch (error.response.status) {
|
|
31
|
+
case 404:
|
|
32
|
+
throw new MessageException(error.response.data);
|
|
33
|
+
case 401:
|
|
34
|
+
throw new MessageException(error.response.data);
|
|
35
|
+
case 410:
|
|
36
|
+
throw new MessageException(error.response.data);
|
|
37
|
+
case 500:
|
|
38
|
+
throw new MessageException(error.response.data);
|
|
29
39
|
default:
|
|
30
40
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
31
41
|
}
|
|
@@ -35,6 +45,7 @@ export class ActionTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<Message>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
51
|
async update(actionId, payload) {
|
|
@@ -54,6 +65,16 @@ export class ActionTag extends TagAbstract {
|
|
|
54
65
|
catch (error) {
|
|
55
66
|
if (axios.isAxiosError(error) && error.response) {
|
|
56
67
|
switch (error.response.status) {
|
|
68
|
+
case 400:
|
|
69
|
+
throw new MessageException(error.response.data);
|
|
70
|
+
case 401:
|
|
71
|
+
throw new MessageException(error.response.data);
|
|
72
|
+
case 404:
|
|
73
|
+
throw new MessageException(error.response.data);
|
|
74
|
+
case 410:
|
|
75
|
+
throw new MessageException(error.response.data);
|
|
76
|
+
case 500:
|
|
77
|
+
throw new MessageException(error.response.data);
|
|
57
78
|
default:
|
|
58
79
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
59
80
|
}
|
|
@@ -63,6 +84,7 @@ export class ActionTag extends TagAbstract {
|
|
|
63
84
|
}
|
|
64
85
|
/**
|
|
65
86
|
* @returns {Promise<Action>}
|
|
87
|
+
* @throws {MessageException}
|
|
66
88
|
* @throws {ClientException}
|
|
67
89
|
*/
|
|
68
90
|
async get(actionId) {
|
|
@@ -81,6 +103,14 @@ export class ActionTag extends TagAbstract {
|
|
|
81
103
|
catch (error) {
|
|
82
104
|
if (axios.isAxiosError(error) && error.response) {
|
|
83
105
|
switch (error.response.status) {
|
|
106
|
+
case 401:
|
|
107
|
+
throw new MessageException(error.response.data);
|
|
108
|
+
case 404:
|
|
109
|
+
throw new MessageException(error.response.data);
|
|
110
|
+
case 410:
|
|
111
|
+
throw new MessageException(error.response.data);
|
|
112
|
+
case 500:
|
|
113
|
+
throw new MessageException(error.response.data);
|
|
84
114
|
default:
|
|
85
115
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
86
116
|
}
|
|
@@ -90,6 +120,7 @@ export class ActionTag extends TagAbstract {
|
|
|
90
120
|
}
|
|
91
121
|
/**
|
|
92
122
|
* @returns {Promise<ActionExecuteResponse>}
|
|
123
|
+
* @throws {MessageException}
|
|
93
124
|
* @throws {ClientException}
|
|
94
125
|
*/
|
|
95
126
|
async execute(actionId, payload) {
|
|
@@ -109,6 +140,10 @@ export class ActionTag extends TagAbstract {
|
|
|
109
140
|
catch (error) {
|
|
110
141
|
if (axios.isAxiosError(error) && error.response) {
|
|
111
142
|
switch (error.response.status) {
|
|
143
|
+
case 401:
|
|
144
|
+
throw new MessageException(error.response.data);
|
|
145
|
+
case 500:
|
|
146
|
+
throw new MessageException(error.response.data);
|
|
112
147
|
default:
|
|
113
148
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
114
149
|
}
|
|
@@ -118,14 +153,17 @@ export class ActionTag extends TagAbstract {
|
|
|
118
153
|
}
|
|
119
154
|
/**
|
|
120
155
|
* @returns {Promise<FormContainer>}
|
|
156
|
+
* @throws {MessageException}
|
|
121
157
|
* @throws {ClientException}
|
|
122
158
|
*/
|
|
123
|
-
async getForm() {
|
|
159
|
+
async getForm(_class) {
|
|
124
160
|
const url = this.parser.url('/backend/action/form', {});
|
|
125
161
|
let params = {
|
|
126
162
|
url: url,
|
|
127
163
|
method: 'GET',
|
|
128
|
-
params: this.parser.query({
|
|
164
|
+
params: this.parser.query({
|
|
165
|
+
'class': _class,
|
|
166
|
+
}),
|
|
129
167
|
};
|
|
130
168
|
try {
|
|
131
169
|
const response = await this.httpClient.request(params);
|
|
@@ -134,6 +172,10 @@ export class ActionTag extends TagAbstract {
|
|
|
134
172
|
catch (error) {
|
|
135
173
|
if (axios.isAxiosError(error) && error.response) {
|
|
136
174
|
switch (error.response.status) {
|
|
175
|
+
case 401:
|
|
176
|
+
throw new MessageException(error.response.data);
|
|
177
|
+
case 500:
|
|
178
|
+
throw new MessageException(error.response.data);
|
|
137
179
|
default:
|
|
138
180
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
139
181
|
}
|
|
@@ -143,6 +185,7 @@ export class ActionTag extends TagAbstract {
|
|
|
143
185
|
}
|
|
144
186
|
/**
|
|
145
187
|
* @returns {Promise<ActionIndex>}
|
|
188
|
+
* @throws {MessageException}
|
|
146
189
|
* @throws {ClientException}
|
|
147
190
|
*/
|
|
148
191
|
async getClasses() {
|
|
@@ -159,6 +202,10 @@ export class ActionTag extends TagAbstract {
|
|
|
159
202
|
catch (error) {
|
|
160
203
|
if (axios.isAxiosError(error) && error.response) {
|
|
161
204
|
switch (error.response.status) {
|
|
205
|
+
case 401:
|
|
206
|
+
throw new MessageException(error.response.data);
|
|
207
|
+
case 500:
|
|
208
|
+
throw new MessageException(error.response.data);
|
|
162
209
|
default:
|
|
163
210
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
164
211
|
}
|
|
@@ -168,6 +215,7 @@ export class ActionTag extends TagAbstract {
|
|
|
168
215
|
}
|
|
169
216
|
/**
|
|
170
217
|
* @returns {Promise<Message>}
|
|
218
|
+
* @throws {MessageException}
|
|
171
219
|
* @throws {ClientException}
|
|
172
220
|
*/
|
|
173
221
|
async create(payload) {
|
|
@@ -185,6 +233,12 @@ export class ActionTag extends TagAbstract {
|
|
|
185
233
|
catch (error) {
|
|
186
234
|
if (axios.isAxiosError(error) && error.response) {
|
|
187
235
|
switch (error.response.status) {
|
|
236
|
+
case 400:
|
|
237
|
+
throw new MessageException(error.response.data);
|
|
238
|
+
case 401:
|
|
239
|
+
throw new MessageException(error.response.data);
|
|
240
|
+
case 500:
|
|
241
|
+
throw new MessageException(error.response.data);
|
|
188
242
|
default:
|
|
189
243
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
190
244
|
}
|
|
@@ -194,14 +248,19 @@ export class ActionTag extends TagAbstract {
|
|
|
194
248
|
}
|
|
195
249
|
/**
|
|
196
250
|
* @returns {Promise<ActionCollection>}
|
|
251
|
+
* @throws {MessageException}
|
|
197
252
|
* @throws {ClientException}
|
|
198
253
|
*/
|
|
199
|
-
async getAll() {
|
|
254
|
+
async getAll(startIndex, count, categoryId) {
|
|
200
255
|
const url = this.parser.url('/backend/action', {});
|
|
201
256
|
let params = {
|
|
202
257
|
url: url,
|
|
203
258
|
method: 'GET',
|
|
204
|
-
params: this.parser.query({
|
|
259
|
+
params: this.parser.query({
|
|
260
|
+
'startIndex': startIndex,
|
|
261
|
+
'count': count,
|
|
262
|
+
'categoryId': categoryId,
|
|
263
|
+
}),
|
|
205
264
|
};
|
|
206
265
|
try {
|
|
207
266
|
const response = await this.httpClient.request(params);
|
|
@@ -210,6 +269,10 @@ export class ActionTag extends TagAbstract {
|
|
|
210
269
|
catch (error) {
|
|
211
270
|
if (axios.isAxiosError(error) && error.response) {
|
|
212
271
|
switch (error.response.status) {
|
|
272
|
+
case 401:
|
|
273
|
+
throw new MessageException(error.response.data);
|
|
274
|
+
case 500:
|
|
275
|
+
throw new MessageException(error.response.data);
|
|
213
276
|
default:
|
|
214
277
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
215
278
|
}
|
|
@@ -13,42 +13,50 @@ import { Message } from "./Message";
|
|
|
13
13
|
export declare class AppTag extends TagAbstract {
|
|
14
14
|
/**
|
|
15
15
|
* @returns {Promise<Message>}
|
|
16
|
+
* @throws {MessageException}
|
|
16
17
|
* @throws {ClientException}
|
|
17
18
|
*/
|
|
18
19
|
deleteToken(appId: string, tokenId: string): Promise<Message>;
|
|
19
20
|
/**
|
|
20
21
|
* @returns {Promise<Message>}
|
|
22
|
+
* @throws {MessageException}
|
|
21
23
|
* @throws {ClientException}
|
|
22
24
|
*/
|
|
23
25
|
delete(appId: string): Promise<Message>;
|
|
24
26
|
/**
|
|
25
27
|
* @returns {Promise<Message>}
|
|
28
|
+
* @throws {MessageException}
|
|
26
29
|
* @throws {ClientException}
|
|
27
30
|
*/
|
|
28
31
|
update(appId: string, payload: AppUpdate): Promise<Message>;
|
|
29
32
|
/**
|
|
30
33
|
* @returns {Promise<App>}
|
|
34
|
+
* @throws {MessageException}
|
|
31
35
|
* @throws {ClientException}
|
|
32
36
|
*/
|
|
33
37
|
get(appId: string): Promise<App>;
|
|
34
38
|
/**
|
|
35
39
|
* @returns {Promise<Message>}
|
|
40
|
+
* @throws {MessageException}
|
|
36
41
|
* @throws {ClientException}
|
|
37
42
|
*/
|
|
38
43
|
create(payload: AppCreate): Promise<Message>;
|
|
39
44
|
/**
|
|
40
45
|
* @returns {Promise<AppCollection>}
|
|
46
|
+
* @throws {MessageException}
|
|
41
47
|
* @throws {ClientException}
|
|
42
48
|
*/
|
|
43
|
-
getAll(): Promise<AppCollection>;
|
|
49
|
+
getAll(startIndex?: number, count?: number, search?: string): Promise<AppCollection>;
|
|
44
50
|
/**
|
|
45
51
|
* @returns {Promise<AppToken>}
|
|
52
|
+
* @throws {MessageException}
|
|
46
53
|
* @throws {ClientException}
|
|
47
54
|
*/
|
|
48
55
|
getToken(tokenId: string): Promise<AppToken>;
|
|
49
56
|
/**
|
|
50
57
|
* @returns {Promise<AppTokenCollection>}
|
|
58
|
+
* @throws {MessageException}
|
|
51
59
|
* @throws {ClientException}
|
|
52
60
|
*/
|
|
53
|
-
getAllTokens(): Promise<AppTokenCollection>;
|
|
61
|
+
getAllTokens(startIndex?: number, count?: number, search?: string, from?: string, to?: string, appId?: number, userId?: number, status?: number, scope?: string, ip?: string): Promise<AppTokenCollection>;
|
|
54
62
|
}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import axios from "axios";
|
|
6
6
|
import { TagAbstract } from "sdkgen-client";
|
|
7
7
|
import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
|
|
8
|
+
import { MessageException } from "./MessageException";
|
|
8
9
|
export class AppTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async deleteToken(appId, tokenId) {
|
|
@@ -27,6 +29,14 @@ export class AppTag extends TagAbstract {
|
|
|
27
29
|
catch (error) {
|
|
28
30
|
if (axios.isAxiosError(error) && error.response) {
|
|
29
31
|
switch (error.response.status) {
|
|
32
|
+
case 401:
|
|
33
|
+
throw new MessageException(error.response.data);
|
|
34
|
+
case 404:
|
|
35
|
+
throw new MessageException(error.response.data);
|
|
36
|
+
case 410:
|
|
37
|
+
throw new MessageException(error.response.data);
|
|
38
|
+
case 500:
|
|
39
|
+
throw new MessageException(error.response.data);
|
|
30
40
|
default:
|
|
31
41
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
32
42
|
}
|
|
@@ -36,6 +46,7 @@ export class AppTag extends TagAbstract {
|
|
|
36
46
|
}
|
|
37
47
|
/**
|
|
38
48
|
* @returns {Promise<Message>}
|
|
49
|
+
* @throws {MessageException}
|
|
39
50
|
* @throws {ClientException}
|
|
40
51
|
*/
|
|
41
52
|
async delete(appId) {
|
|
@@ -54,6 +65,14 @@ export class AppTag extends TagAbstract {
|
|
|
54
65
|
catch (error) {
|
|
55
66
|
if (axios.isAxiosError(error) && error.response) {
|
|
56
67
|
switch (error.response.status) {
|
|
68
|
+
case 401:
|
|
69
|
+
throw new MessageException(error.response.data);
|
|
70
|
+
case 404:
|
|
71
|
+
throw new MessageException(error.response.data);
|
|
72
|
+
case 410:
|
|
73
|
+
throw new MessageException(error.response.data);
|
|
74
|
+
case 500:
|
|
75
|
+
throw new MessageException(error.response.data);
|
|
57
76
|
default:
|
|
58
77
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
59
78
|
}
|
|
@@ -63,6 +82,7 @@ export class AppTag extends TagAbstract {
|
|
|
63
82
|
}
|
|
64
83
|
/**
|
|
65
84
|
* @returns {Promise<Message>}
|
|
85
|
+
* @throws {MessageException}
|
|
66
86
|
* @throws {ClientException}
|
|
67
87
|
*/
|
|
68
88
|
async update(appId, payload) {
|
|
@@ -82,6 +102,16 @@ export class AppTag extends TagAbstract {
|
|
|
82
102
|
catch (error) {
|
|
83
103
|
if (axios.isAxiosError(error) && error.response) {
|
|
84
104
|
switch (error.response.status) {
|
|
105
|
+
case 400:
|
|
106
|
+
throw new MessageException(error.response.data);
|
|
107
|
+
case 401:
|
|
108
|
+
throw new MessageException(error.response.data);
|
|
109
|
+
case 404:
|
|
110
|
+
throw new MessageException(error.response.data);
|
|
111
|
+
case 410:
|
|
112
|
+
throw new MessageException(error.response.data);
|
|
113
|
+
case 500:
|
|
114
|
+
throw new MessageException(error.response.data);
|
|
85
115
|
default:
|
|
86
116
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
87
117
|
}
|
|
@@ -91,6 +121,7 @@ export class AppTag extends TagAbstract {
|
|
|
91
121
|
}
|
|
92
122
|
/**
|
|
93
123
|
* @returns {Promise<App>}
|
|
124
|
+
* @throws {MessageException}
|
|
94
125
|
* @throws {ClientException}
|
|
95
126
|
*/
|
|
96
127
|
async get(appId) {
|
|
@@ -109,6 +140,14 @@ export class AppTag extends TagAbstract {
|
|
|
109
140
|
catch (error) {
|
|
110
141
|
if (axios.isAxiosError(error) && error.response) {
|
|
111
142
|
switch (error.response.status) {
|
|
143
|
+
case 404:
|
|
144
|
+
throw new MessageException(error.response.data);
|
|
145
|
+
case 401:
|
|
146
|
+
throw new MessageException(error.response.data);
|
|
147
|
+
case 410:
|
|
148
|
+
throw new MessageException(error.response.data);
|
|
149
|
+
case 500:
|
|
150
|
+
throw new MessageException(error.response.data);
|
|
112
151
|
default:
|
|
113
152
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
114
153
|
}
|
|
@@ -118,6 +157,7 @@ export class AppTag extends TagAbstract {
|
|
|
118
157
|
}
|
|
119
158
|
/**
|
|
120
159
|
* @returns {Promise<Message>}
|
|
160
|
+
* @throws {MessageException}
|
|
121
161
|
* @throws {ClientException}
|
|
122
162
|
*/
|
|
123
163
|
async create(payload) {
|
|
@@ -135,6 +175,12 @@ export class AppTag extends TagAbstract {
|
|
|
135
175
|
catch (error) {
|
|
136
176
|
if (axios.isAxiosError(error) && error.response) {
|
|
137
177
|
switch (error.response.status) {
|
|
178
|
+
case 400:
|
|
179
|
+
throw new MessageException(error.response.data);
|
|
180
|
+
case 401:
|
|
181
|
+
throw new MessageException(error.response.data);
|
|
182
|
+
case 500:
|
|
183
|
+
throw new MessageException(error.response.data);
|
|
138
184
|
default:
|
|
139
185
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
140
186
|
}
|
|
@@ -144,14 +190,19 @@ export class AppTag extends TagAbstract {
|
|
|
144
190
|
}
|
|
145
191
|
/**
|
|
146
192
|
* @returns {Promise<AppCollection>}
|
|
193
|
+
* @throws {MessageException}
|
|
147
194
|
* @throws {ClientException}
|
|
148
195
|
*/
|
|
149
|
-
async getAll() {
|
|
196
|
+
async getAll(startIndex, count, search) {
|
|
150
197
|
const url = this.parser.url('/backend/app', {});
|
|
151
198
|
let params = {
|
|
152
199
|
url: url,
|
|
153
200
|
method: 'GET',
|
|
154
|
-
params: this.parser.query({
|
|
201
|
+
params: this.parser.query({
|
|
202
|
+
'startIndex': startIndex,
|
|
203
|
+
'count': count,
|
|
204
|
+
'search': search,
|
|
205
|
+
}),
|
|
155
206
|
};
|
|
156
207
|
try {
|
|
157
208
|
const response = await this.httpClient.request(params);
|
|
@@ -160,6 +211,10 @@ export class AppTag extends TagAbstract {
|
|
|
160
211
|
catch (error) {
|
|
161
212
|
if (axios.isAxiosError(error) && error.response) {
|
|
162
213
|
switch (error.response.status) {
|
|
214
|
+
case 401:
|
|
215
|
+
throw new MessageException(error.response.data);
|
|
216
|
+
case 500:
|
|
217
|
+
throw new MessageException(error.response.data);
|
|
163
218
|
default:
|
|
164
219
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
165
220
|
}
|
|
@@ -169,6 +224,7 @@ export class AppTag extends TagAbstract {
|
|
|
169
224
|
}
|
|
170
225
|
/**
|
|
171
226
|
* @returns {Promise<AppToken>}
|
|
227
|
+
* @throws {MessageException}
|
|
172
228
|
* @throws {ClientException}
|
|
173
229
|
*/
|
|
174
230
|
async getToken(tokenId) {
|
|
@@ -187,6 +243,12 @@ export class AppTag extends TagAbstract {
|
|
|
187
243
|
catch (error) {
|
|
188
244
|
if (axios.isAxiosError(error) && error.response) {
|
|
189
245
|
switch (error.response.status) {
|
|
246
|
+
case 401:
|
|
247
|
+
throw new MessageException(error.response.data);
|
|
248
|
+
case 404:
|
|
249
|
+
throw new MessageException(error.response.data);
|
|
250
|
+
case 500:
|
|
251
|
+
throw new MessageException(error.response.data);
|
|
190
252
|
default:
|
|
191
253
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
192
254
|
}
|
|
@@ -196,14 +258,26 @@ export class AppTag extends TagAbstract {
|
|
|
196
258
|
}
|
|
197
259
|
/**
|
|
198
260
|
* @returns {Promise<AppTokenCollection>}
|
|
261
|
+
* @throws {MessageException}
|
|
199
262
|
* @throws {ClientException}
|
|
200
263
|
*/
|
|
201
|
-
async getAllTokens() {
|
|
264
|
+
async getAllTokens(startIndex, count, search, from, to, appId, userId, status, scope, ip) {
|
|
202
265
|
const url = this.parser.url('/backend/app/token', {});
|
|
203
266
|
let params = {
|
|
204
267
|
url: url,
|
|
205
268
|
method: 'GET',
|
|
206
|
-
params: this.parser.query({
|
|
269
|
+
params: this.parser.query({
|
|
270
|
+
'startIndex': startIndex,
|
|
271
|
+
'count': count,
|
|
272
|
+
'search': search,
|
|
273
|
+
'from': from,
|
|
274
|
+
'to': to,
|
|
275
|
+
'appId': appId,
|
|
276
|
+
'userId': userId,
|
|
277
|
+
'status': status,
|
|
278
|
+
'scope': scope,
|
|
279
|
+
'ip': ip,
|
|
280
|
+
}),
|
|
207
281
|
};
|
|
208
282
|
try {
|
|
209
283
|
const response = await this.httpClient.request(params);
|
|
@@ -212,6 +286,10 @@ export class AppTag extends TagAbstract {
|
|
|
212
286
|
catch (error) {
|
|
213
287
|
if (axios.isAxiosError(error) && error.response) {
|
|
214
288
|
switch (error.response.status) {
|
|
289
|
+
case 401:
|
|
290
|
+
throw new MessageException(error.response.data);
|
|
291
|
+
case 500:
|
|
292
|
+
throw new MessageException(error.response.data);
|
|
215
293
|
default:
|
|
216
294
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
217
295
|
}
|
|
@@ -8,12 +8,14 @@ import { AuditCollection } from "./AuditCollection";
|
|
|
8
8
|
export declare class AuditTag extends TagAbstract {
|
|
9
9
|
/**
|
|
10
10
|
* @returns {Promise<Audit>}
|
|
11
|
+
* @throws {MessageException}
|
|
11
12
|
* @throws {ClientException}
|
|
12
13
|
*/
|
|
13
14
|
get(auditId: string): Promise<Audit>;
|
|
14
15
|
/**
|
|
15
16
|
* @returns {Promise<AuditCollection>}
|
|
17
|
+
* @throws {MessageException}
|
|
16
18
|
* @throws {ClientException}
|
|
17
19
|
*/
|
|
18
|
-
getAll(): Promise<AuditCollection>;
|
|
20
|
+
getAll(startIndex?: number, count?: number, search?: string, from?: string, to?: string, appId?: number, userId?: number, event?: string, ip?: string, message?: string): Promise<AuditCollection>;
|
|
19
21
|
}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import axios from "axios";
|
|
6
6
|
import { TagAbstract } from "sdkgen-client";
|
|
7
7
|
import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
|
|
8
|
+
import { MessageException } from "./MessageException";
|
|
8
9
|
export class AuditTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Audit>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async get(auditId) {
|
|
@@ -26,6 +28,14 @@ export class AuditTag extends TagAbstract {
|
|
|
26
28
|
catch (error) {
|
|
27
29
|
if (axios.isAxiosError(error) && error.response) {
|
|
28
30
|
switch (error.response.status) {
|
|
31
|
+
case 401:
|
|
32
|
+
throw new MessageException(error.response.data);
|
|
33
|
+
case 404:
|
|
34
|
+
throw new MessageException(error.response.data);
|
|
35
|
+
case 410:
|
|
36
|
+
throw new MessageException(error.response.data);
|
|
37
|
+
case 500:
|
|
38
|
+
throw new MessageException(error.response.data);
|
|
29
39
|
default:
|
|
30
40
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
31
41
|
}
|
|
@@ -35,14 +45,26 @@ export class AuditTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<AuditCollection>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
|
-
async getAll() {
|
|
51
|
+
async getAll(startIndex, count, search, from, to, appId, userId, event, ip, message) {
|
|
41
52
|
const url = this.parser.url('/backend/audit', {});
|
|
42
53
|
let params = {
|
|
43
54
|
url: url,
|
|
44
55
|
method: 'GET',
|
|
45
|
-
params: this.parser.query({
|
|
56
|
+
params: this.parser.query({
|
|
57
|
+
'startIndex': startIndex,
|
|
58
|
+
'count': count,
|
|
59
|
+
'search': search,
|
|
60
|
+
'from': from,
|
|
61
|
+
'to': to,
|
|
62
|
+
'appId': appId,
|
|
63
|
+
'userId': userId,
|
|
64
|
+
'event': event,
|
|
65
|
+
'ip': ip,
|
|
66
|
+
'message': message,
|
|
67
|
+
}),
|
|
46
68
|
};
|
|
47
69
|
try {
|
|
48
70
|
const response = await this.httpClient.request(params);
|
|
@@ -51,6 +73,10 @@ export class AuditTag extends TagAbstract {
|
|
|
51
73
|
catch (error) {
|
|
52
74
|
if (axios.isAxiosError(error) && error.response) {
|
|
53
75
|
switch (error.response.status) {
|
|
76
|
+
case 401:
|
|
77
|
+
throw new MessageException(error.response.data);
|
|
78
|
+
case 500:
|
|
79
|
+
throw new MessageException(error.response.data);
|
|
54
80
|
default:
|
|
55
81
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
56
82
|
}
|