fusio-sdk 3.0.5 → 3.0.7

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 (77) hide show
  1. package/dist/src/generated/backend/AccountTag.d.ts +3 -0
  2. package/dist/src/generated/backend/AccountTag.js +20 -0
  3. package/dist/src/generated/backend/ActionTag.d.ts +9 -1
  4. package/dist/src/generated/backend/ActionTag.js +58 -2
  5. package/dist/src/generated/backend/AppTag.d.ts +8 -0
  6. package/dist/src/generated/backend/AppTag.js +63 -0
  7. package/dist/src/generated/backend/AuditTag.d.ts +2 -0
  8. package/dist/src/generated/backend/AuditTag.js +15 -0
  9. package/dist/src/generated/backend/CategoryTag.d.ts +5 -0
  10. package/dist/src/generated/backend/CategoryTag.js +42 -0
  11. package/dist/src/generated/backend/ConfigTag.d.ts +3 -0
  12. package/dist/src/generated/backend/ConfigTag.js +26 -0
  13. package/dist/src/generated/backend/ConnectionTag.d.ts +12 -2
  14. package/dist/src/generated/backend/ConnectionTag.js +72 -1
  15. package/dist/src/generated/backend/CronjobTag.d.ts +5 -0
  16. package/dist/src/generated/backend/CronjobTag.js +42 -0
  17. package/dist/src/generated/backend/DashboardTag.d.ts +1 -0
  18. package/dist/src/generated/backend/DashboardTag.js +6 -0
  19. package/dist/src/generated/backend/EventTag.d.ts +11 -1
  20. package/dist/src/generated/backend/EventTag.js +82 -2
  21. package/dist/src/generated/backend/GeneratorTag.d.ts +4 -0
  22. package/dist/src/generated/backend/GeneratorTag.js +21 -0
  23. package/dist/src/generated/backend/LogTag.d.ts +4 -0
  24. package/dist/src/generated/backend/LogTag.js +25 -0
  25. package/dist/src/generated/backend/MarketplaceTag.d.ts +5 -0
  26. package/dist/src/generated/backend/MarketplaceTag.js +40 -0
  27. package/dist/src/generated/backend/MessageException.d.ts +11 -0
  28. package/dist/src/generated/backend/MessageException.js +14 -0
  29. package/dist/src/generated/backend/OperationTag.d.ts +6 -1
  30. package/dist/src/generated/backend/OperationTag.js +43 -2
  31. package/dist/src/generated/backend/PageTag.d.ts +5 -0
  32. package/dist/src/generated/backend/PageTag.js +42 -0
  33. package/dist/src/generated/backend/PlanTag.d.ts +5 -0
  34. package/dist/src/generated/backend/PlanTag.js +42 -0
  35. package/dist/src/generated/backend/RateTag.d.ts +5 -0
  36. package/dist/src/generated/backend/RateTag.js +42 -0
  37. package/dist/src/generated/backend/RoleTag.d.ts +5 -0
  38. package/dist/src/generated/backend/RoleTag.js +42 -0
  39. package/dist/src/generated/backend/SchemaTag.d.ts +8 -1
  40. package/dist/src/generated/backend/SchemaTag.js +59 -2
  41. package/dist/src/generated/backend/ScopeTag.d.ts +7 -1
  42. package/dist/src/generated/backend/ScopeTag.js +48 -2
  43. package/dist/src/generated/backend/SdkTag.d.ts +2 -0
  44. package/dist/src/generated/backend/SdkTag.js +11 -0
  45. package/dist/src/generated/backend/StatisticTag.d.ts +10 -0
  46. package/dist/src/generated/backend/StatisticTag.js +51 -0
  47. package/dist/src/generated/backend/TransactionTag.d.ts +2 -0
  48. package/dist/src/generated/backend/TransactionTag.js +15 -0
  49. package/dist/src/generated/backend/TrashTag.d.ts +3 -0
  50. package/dist/src/generated/backend/TrashTag.js +18 -0
  51. package/dist/src/generated/backend/UserTag.d.ts +5 -0
  52. package/dist/src/generated/backend/UserTag.js +42 -0
  53. package/dist/src/generated/consumer/AccountTag.d.ts +12 -0
  54. package/dist/src/generated/consumer/AccountTag.js +77 -0
  55. package/dist/src/generated/consumer/AppTag.d.ts +5 -0
  56. package/dist/src/generated/consumer/AppTag.js +42 -0
  57. package/dist/src/generated/consumer/EventTag.d.ts +1 -0
  58. package/dist/src/generated/consumer/EventTag.js +6 -0
  59. package/dist/src/generated/consumer/GrantTag.d.ts +2 -0
  60. package/dist/src/generated/consumer/GrantTag.js +15 -0
  61. package/dist/src/generated/consumer/LogTag.d.ts +2 -0
  62. package/dist/src/generated/consumer/LogTag.js +15 -0
  63. package/dist/src/generated/consumer/MessageException.d.ts +11 -0
  64. package/dist/src/generated/consumer/MessageException.js +14 -0
  65. package/dist/src/generated/consumer/PageTag.d.ts +2 -0
  66. package/dist/src/generated/consumer/PageTag.js +15 -0
  67. package/dist/src/generated/consumer/PaymentTag.d.ts +2 -0
  68. package/dist/src/generated/consumer/PaymentTag.js +11 -0
  69. package/dist/src/generated/consumer/PlanTag.d.ts +2 -0
  70. package/dist/src/generated/consumer/PlanTag.js +15 -0
  71. package/dist/src/generated/consumer/ScopeTag.d.ts +1 -0
  72. package/dist/src/generated/consumer/ScopeTag.js +6 -0
  73. package/dist/src/generated/consumer/SubscriptionTag.d.ts +5 -0
  74. package/dist/src/generated/consumer/SubscriptionTag.js +42 -0
  75. package/dist/src/generated/consumer/TransactionTag.d.ts +2 -0
  76. package/dist/src/generated/consumer/TransactionTag.js +15 -0
  77. package/package.json +1 -1
@@ -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 StatisticTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<StatisticChart>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async getUsedPoints(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -39,6 +41,10 @@ export class StatisticTag extends TagAbstract {
39
41
  catch (error) {
40
42
  if (axios.isAxiosError(error) && error.response) {
41
43
  switch (error.response.status) {
44
+ case 401:
45
+ throw new MessageException(error.response.data);
46
+ case 500:
47
+ throw new MessageException(error.response.data);
42
48
  default:
43
49
  throw new UnknownStatusCodeException('The server returned an unknown status code');
44
50
  }
@@ -48,6 +54,7 @@ export class StatisticTag extends TagAbstract {
48
54
  }
49
55
  /**
50
56
  * @returns {Promise<StatisticChart>}
57
+ * @throws {MessageException}
51
58
  * @throws {ClientException}
52
59
  */
53
60
  async getTimePerRoute(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -79,6 +86,10 @@ export class StatisticTag extends TagAbstract {
79
86
  catch (error) {
80
87
  if (axios.isAxiosError(error) && error.response) {
81
88
  switch (error.response.status) {
89
+ case 401:
90
+ throw new MessageException(error.response.data);
91
+ case 500:
92
+ throw new MessageException(error.response.data);
82
93
  default:
83
94
  throw new UnknownStatusCodeException('The server returned an unknown status code');
84
95
  }
@@ -88,6 +99,7 @@ export class StatisticTag extends TagAbstract {
88
99
  }
89
100
  /**
90
101
  * @returns {Promise<StatisticChart>}
102
+ * @throws {MessageException}
91
103
  * @throws {ClientException}
92
104
  */
93
105
  async getTimeAverage(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -119,6 +131,10 @@ export class StatisticTag extends TagAbstract {
119
131
  catch (error) {
120
132
  if (axios.isAxiosError(error) && error.response) {
121
133
  switch (error.response.status) {
134
+ case 401:
135
+ throw new MessageException(error.response.data);
136
+ case 500:
137
+ throw new MessageException(error.response.data);
122
138
  default:
123
139
  throw new UnknownStatusCodeException('The server returned an unknown status code');
124
140
  }
@@ -128,6 +144,7 @@ export class StatisticTag extends TagAbstract {
128
144
  }
129
145
  /**
130
146
  * @returns {Promise<StatisticChart>}
147
+ * @throws {MessageException}
131
148
  * @throws {ClientException}
132
149
  */
133
150
  async getMostUsedRoutes(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -159,6 +176,10 @@ export class StatisticTag extends TagAbstract {
159
176
  catch (error) {
160
177
  if (axios.isAxiosError(error) && error.response) {
161
178
  switch (error.response.status) {
179
+ case 401:
180
+ throw new MessageException(error.response.data);
181
+ case 500:
182
+ throw new MessageException(error.response.data);
162
183
  default:
163
184
  throw new UnknownStatusCodeException('The server returned an unknown status code');
164
185
  }
@@ -168,6 +189,7 @@ export class StatisticTag extends TagAbstract {
168
189
  }
169
190
  /**
170
191
  * @returns {Promise<StatisticChart>}
192
+ * @throws {MessageException}
171
193
  * @throws {ClientException}
172
194
  */
173
195
  async getMostUsedApps(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -199,6 +221,10 @@ export class StatisticTag extends TagAbstract {
199
221
  catch (error) {
200
222
  if (axios.isAxiosError(error) && error.response) {
201
223
  switch (error.response.status) {
224
+ case 401:
225
+ throw new MessageException(error.response.data);
226
+ case 500:
227
+ throw new MessageException(error.response.data);
202
228
  default:
203
229
  throw new UnknownStatusCodeException('The server returned an unknown status code');
204
230
  }
@@ -208,6 +234,7 @@ export class StatisticTag extends TagAbstract {
208
234
  }
209
235
  /**
210
236
  * @returns {Promise<StatisticChart>}
237
+ * @throws {MessageException}
211
238
  * @throws {ClientException}
212
239
  */
213
240
  async getIssuedTokens(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -239,6 +266,10 @@ export class StatisticTag extends TagAbstract {
239
266
  catch (error) {
240
267
  if (axios.isAxiosError(error) && error.response) {
241
268
  switch (error.response.status) {
269
+ case 401:
270
+ throw new MessageException(error.response.data);
271
+ case 500:
272
+ throw new MessageException(error.response.data);
242
273
  default:
243
274
  throw new UnknownStatusCodeException('The server returned an unknown status code');
244
275
  }
@@ -248,6 +279,7 @@ export class StatisticTag extends TagAbstract {
248
279
  }
249
280
  /**
250
281
  * @returns {Promise<StatisticChart>}
282
+ * @throws {MessageException}
251
283
  * @throws {ClientException}
252
284
  */
253
285
  async getIncomingTransactions(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -279,6 +311,10 @@ export class StatisticTag extends TagAbstract {
279
311
  catch (error) {
280
312
  if (axios.isAxiosError(error) && error.response) {
281
313
  switch (error.response.status) {
314
+ case 401:
315
+ throw new MessageException(error.response.data);
316
+ case 500:
317
+ throw new MessageException(error.response.data);
282
318
  default:
283
319
  throw new UnknownStatusCodeException('The server returned an unknown status code');
284
320
  }
@@ -288,6 +324,7 @@ export class StatisticTag extends TagAbstract {
288
324
  }
289
325
  /**
290
326
  * @returns {Promise<StatisticChart>}
327
+ * @throws {MessageException}
291
328
  * @throws {ClientException}
292
329
  */
293
330
  async getIncomingRequests(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -319,6 +356,10 @@ export class StatisticTag extends TagAbstract {
319
356
  catch (error) {
320
357
  if (axios.isAxiosError(error) && error.response) {
321
358
  switch (error.response.status) {
359
+ case 401:
360
+ throw new MessageException(error.response.data);
361
+ case 500:
362
+ throw new MessageException(error.response.data);
322
363
  default:
323
364
  throw new UnknownStatusCodeException('The server returned an unknown status code');
324
365
  }
@@ -328,6 +369,7 @@ export class StatisticTag extends TagAbstract {
328
369
  }
329
370
  /**
330
371
  * @returns {Promise<StatisticChart>}
372
+ * @throws {MessageException}
331
373
  * @throws {ClientException}
332
374
  */
333
375
  async getErrorsPerRoute(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -359,6 +401,10 @@ export class StatisticTag extends TagAbstract {
359
401
  catch (error) {
360
402
  if (axios.isAxiosError(error) && error.response) {
361
403
  switch (error.response.status) {
404
+ case 401:
405
+ throw new MessageException(error.response.data);
406
+ case 500:
407
+ throw new MessageException(error.response.data);
362
408
  default:
363
409
  throw new UnknownStatusCodeException('The server returned an unknown status code');
364
410
  }
@@ -368,6 +414,7 @@ export class StatisticTag extends TagAbstract {
368
414
  }
369
415
  /**
370
416
  * @returns {Promise<StatisticCount>}
417
+ * @throws {MessageException}
371
418
  * @throws {ClientException}
372
419
  */
373
420
  async getCountRequests(startIndex, count, search, from, to, routeId, appId, userId, ip, userAgent, method, path, header, body) {
@@ -399,6 +446,10 @@ export class StatisticTag extends TagAbstract {
399
446
  catch (error) {
400
447
  if (axios.isAxiosError(error) && error.response) {
401
448
  switch (error.response.status) {
449
+ case 401:
450
+ throw new MessageException(error.response.data);
451
+ case 500:
452
+ throw new MessageException(error.response.data);
402
453
  default:
403
454
  throw new UnknownStatusCodeException('The server returned an unknown status code');
404
455
  }
@@ -8,11 +8,13 @@ import { TransactionCollection } from "./TransactionCollection";
8
8
  export declare class TransactionTag extends TagAbstract {
9
9
  /**
10
10
  * @returns {Promise<Transaction>}
11
+ * @throws {MessageException}
11
12
  * @throws {ClientException}
12
13
  */
13
14
  get(transactionId: string): Promise<Transaction>;
14
15
  /**
15
16
  * @returns {Promise<TransactionCollection>}
17
+ * @throws {MessageException}
16
18
  * @throws {ClientException}
17
19
  */
18
20
  getAll(startIndex?: number, count?: number, search?: string, from?: string, to?: string, planId?: number, userId?: number, appId?: number, status?: string, provider?: string): Promise<TransactionCollection>;
@@ -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 TransactionTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Transaction>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async get(transactionId) {
@@ -26,6 +28,14 @@ export class TransactionTag 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,6 +45,7 @@ export class TransactionTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<TransactionCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
51
  async getAll(startIndex, count, search, from, to, planId, userId, appId, status, provider) {
@@ -62,6 +73,10 @@ export class TransactionTag extends TagAbstract {
62
73
  catch (error) {
63
74
  if (axios.isAxiosError(error) && error.response) {
64
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);
65
80
  default:
66
81
  throw new UnknownStatusCodeException('The server returned an unknown status code');
67
82
  }
@@ -10,16 +10,19 @@ import { TrashTypes } from "./TrashTypes";
10
10
  export declare class TrashTag extends TagAbstract {
11
11
  /**
12
12
  * @returns {Promise<Message>}
13
+ * @throws {MessageException}
13
14
  * @throws {ClientException}
14
15
  */
15
16
  restore(type: string, payload: TrashRestore): Promise<Message>;
16
17
  /**
17
18
  * @returns {Promise<TrashDataCollection>}
19
+ * @throws {MessageException}
18
20
  * @throws {ClientException}
19
21
  */
20
22
  getAllByType(type: string, startIndex?: number, count?: number, search?: string): Promise<TrashDataCollection>;
21
23
  /**
22
24
  * @returns {Promise<TrashTypes>}
25
+ * @throws {MessageException}
23
26
  * @throws {ClientException}
24
27
  */
25
28
  getTypes(): Promise<TrashTypes>;
@@ -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 TrashTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Message>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async restore(type, payload) {
@@ -27,6 +29,12 @@ export class TrashTag extends TagAbstract {
27
29
  catch (error) {
28
30
  if (axios.isAxiosError(error) && error.response) {
29
31
  switch (error.response.status) {
32
+ case 400:
33
+ throw new MessageException(error.response.data);
34
+ case 401:
35
+ throw new MessageException(error.response.data);
36
+ case 500:
37
+ throw new MessageException(error.response.data);
30
38
  default:
31
39
  throw new UnknownStatusCodeException('The server returned an unknown status code');
32
40
  }
@@ -36,6 +44,7 @@ export class TrashTag extends TagAbstract {
36
44
  }
37
45
  /**
38
46
  * @returns {Promise<TrashDataCollection>}
47
+ * @throws {MessageException}
39
48
  * @throws {ClientException}
40
49
  */
41
50
  async getAllByType(type, startIndex, count, search) {
@@ -58,6 +67,10 @@ export class TrashTag extends TagAbstract {
58
67
  catch (error) {
59
68
  if (axios.isAxiosError(error) && error.response) {
60
69
  switch (error.response.status) {
70
+ case 401:
71
+ throw new MessageException(error.response.data);
72
+ case 500:
73
+ throw new MessageException(error.response.data);
61
74
  default:
62
75
  throw new UnknownStatusCodeException('The server returned an unknown status code');
63
76
  }
@@ -67,6 +80,7 @@ export class TrashTag extends TagAbstract {
67
80
  }
68
81
  /**
69
82
  * @returns {Promise<TrashTypes>}
83
+ * @throws {MessageException}
70
84
  * @throws {ClientException}
71
85
  */
72
86
  async getTypes() {
@@ -83,6 +97,10 @@ export class TrashTag extends TagAbstract {
83
97
  catch (error) {
84
98
  if (axios.isAxiosError(error) && error.response) {
85
99
  switch (error.response.status) {
100
+ case 401:
101
+ throw new MessageException(error.response.data);
102
+ case 500:
103
+ throw new MessageException(error.response.data);
86
104
  default:
87
105
  throw new UnknownStatusCodeException('The server returned an unknown status code');
88
106
  }
@@ -11,26 +11,31 @@ import { UserUpdate } from "./UserUpdate";
11
11
  export declare class UserTag extends TagAbstract {
12
12
  /**
13
13
  * @returns {Promise<Message>}
14
+ * @throws {MessageException}
14
15
  * @throws {ClientException}
15
16
  */
16
17
  delete(userId: string): Promise<Message>;
17
18
  /**
18
19
  * @returns {Promise<Message>}
20
+ * @throws {MessageException}
19
21
  * @throws {ClientException}
20
22
  */
21
23
  update(userId: string, payload: UserUpdate): Promise<Message>;
22
24
  /**
23
25
  * @returns {Promise<User>}
26
+ * @throws {MessageException}
24
27
  * @throws {ClientException}
25
28
  */
26
29
  get(userId: string): Promise<User>;
27
30
  /**
28
31
  * @returns {Promise<Message>}
32
+ * @throws {MessageException}
29
33
  * @throws {ClientException}
30
34
  */
31
35
  create(payload: UserCreate): Promise<Message>;
32
36
  /**
33
37
  * @returns {Promise<UserCollection>}
38
+ * @throws {MessageException}
34
39
  * @throws {ClientException}
35
40
  */
36
41
  getAll(startIndex?: number, count?: number, search?: string): Promise<UserCollection>;
@@ -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 UserTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Message>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async delete(userId) {
@@ -26,6 +28,14 @@ export class UserTag 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,6 +45,7 @@ export class UserTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<Message>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
51
  async update(userId, payload) {
@@ -54,6 +65,16 @@ export class UserTag 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 UserTag extends TagAbstract {
63
84
  }
64
85
  /**
65
86
  * @returns {Promise<User>}
87
+ * @throws {MessageException}
66
88
  * @throws {ClientException}
67
89
  */
68
90
  async get(userId) {
@@ -81,6 +103,14 @@ export class UserTag 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 UserTag extends TagAbstract {
90
120
  }
91
121
  /**
92
122
  * @returns {Promise<Message>}
123
+ * @throws {MessageException}
93
124
  * @throws {ClientException}
94
125
  */
95
126
  async create(payload) {
@@ -107,6 +138,12 @@ export class UserTag extends TagAbstract {
107
138
  catch (error) {
108
139
  if (axios.isAxiosError(error) && error.response) {
109
140
  switch (error.response.status) {
141
+ case 400:
142
+ throw new MessageException(error.response.data);
143
+ case 401:
144
+ throw new MessageException(error.response.data);
145
+ case 500:
146
+ throw new MessageException(error.response.data);
110
147
  default:
111
148
  throw new UnknownStatusCodeException('The server returned an unknown status code');
112
149
  }
@@ -116,6 +153,7 @@ export class UserTag extends TagAbstract {
116
153
  }
117
154
  /**
118
155
  * @returns {Promise<UserCollection>}
156
+ * @throws {MessageException}
119
157
  * @throws {ClientException}
120
158
  */
121
159
  async getAll(startIndex, count, search) {
@@ -136,6 +174,10 @@ export class UserTag extends TagAbstract {
136
174
  catch (error) {
137
175
  if (axios.isAxiosError(error) && error.response) {
138
176
  switch (error.response.status) {
177
+ case 401:
178
+ throw new MessageException(error.response.data);
179
+ case 500:
180
+ throw new MessageException(error.response.data);
139
181
  default:
140
182
  throw new UnknownStatusCodeException('The server returned an unknown status code');
141
183
  }
@@ -20,61 +20,73 @@ import { UserRegister } from "./UserRegister";
20
20
  export declare class AccountTag extends TagAbstract {
21
21
  /**
22
22
  * @returns {Promise<Message>}
23
+ * @throws {MessageException}
23
24
  * @throws {ClientException}
24
25
  */
25
26
  executePasswordReset(payload: UserPasswordReset): Promise<Message>;
26
27
  /**
27
28
  * @returns {Promise<Message>}
29
+ * @throws {MessageException}
28
30
  * @throws {ClientException}
29
31
  */
30
32
  requestPasswordReset(payload: UserEmail): Promise<Message>;
31
33
  /**
32
34
  * @returns {Promise<Message>}
35
+ * @throws {MessageException}
33
36
  * @throws {ClientException}
34
37
  */
35
38
  register(payload: UserRegister): Promise<Message>;
36
39
  /**
37
40
  * @returns {Promise<UserJWT>}
41
+ * @throws {MessageException}
38
42
  * @throws {ClientException}
39
43
  */
40
44
  provider(provider: string, payload: UserProvider): Promise<UserJWT>;
41
45
  /**
42
46
  * @returns {Promise<UserJWT>}
47
+ * @throws {MessageException}
43
48
  * @throws {ClientException}
44
49
  */
45
50
  refresh(payload: UserRefresh): Promise<UserJWT>;
46
51
  /**
47
52
  * @returns {Promise<UserJWT>}
53
+ * @throws {MessageException}
48
54
  * @throws {ClientException}
49
55
  */
50
56
  login(payload: UserLogin): Promise<UserJWT>;
51
57
  /**
52
58
  * @returns {Promise<AuthorizeResponse>}
59
+ * @throws {MessageException}
53
60
  * @throws {ClientException}
54
61
  */
55
62
  authorize(payload: AuthorizeRequest): Promise<AuthorizeResponse>;
56
63
  /**
57
64
  * @returns {Promise<AuthorizeMeta>}
65
+ * @throws {MessageException}
58
66
  * @throws {ClientException}
59
67
  */
60
68
  getApp(): Promise<AuthorizeMeta>;
61
69
  /**
62
70
  * @returns {Promise<Message>}
71
+ * @throws {MessageException}
63
72
  * @throws {ClientException}
64
73
  */
65
74
  activate(payload: UserActivate): Promise<Message>;
66
75
  /**
67
76
  * @returns {Promise<Message>}
77
+ * @throws {MessageException}
68
78
  * @throws {ClientException}
69
79
  */
70
80
  changePassword(payload: AccountChangePassword): Promise<Message>;
71
81
  /**
72
82
  * @returns {Promise<Message>}
83
+ * @throws {MessageException}
73
84
  * @throws {ClientException}
74
85
  */
75
86
  update(payload: UserAccount): Promise<Message>;
76
87
  /**
77
88
  * @returns {Promise<UserAccount>}
89
+ * @throws {MessageException}
78
90
  * @throws {ClientException}
79
91
  */
80
92
  get(): Promise<UserAccount>;