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.
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 +10 -2
  4. package/dist/src/generated/backend/ActionTag.js +67 -4
  5. package/dist/src/generated/backend/AppTag.d.ts +10 -2
  6. package/dist/src/generated/backend/AppTag.js +82 -4
  7. package/dist/src/generated/backend/AuditTag.d.ts +3 -1
  8. package/dist/src/generated/backend/AuditTag.js +28 -2
  9. package/dist/src/generated/backend/CategoryTag.d.ts +6 -1
  10. package/dist/src/generated/backend/CategoryTag.js +48 -2
  11. package/dist/src/generated/backend/ConfigTag.d.ts +4 -1
  12. package/dist/src/generated/backend/ConfigTag.js +32 -2
  13. package/dist/src/generated/backend/ConnectionTag.d.ts +14 -4
  14. package/dist/src/generated/backend/ConnectionTag.js +82 -5
  15. package/dist/src/generated/backend/CronjobTag.d.ts +6 -1
  16. package/dist/src/generated/backend/CronjobTag.js +48 -2
  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 +12 -2
  20. package/dist/src/generated/backend/EventTag.js +94 -4
  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 +6 -2
  24. package/dist/src/generated/backend/LogTag.js +48 -4
  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 +49 -2
  31. package/dist/src/generated/backend/PageTag.d.ts +6 -1
  32. package/dist/src/generated/backend/PageTag.js +48 -2
  33. package/dist/src/generated/backend/PlanTag.d.ts +6 -1
  34. package/dist/src/generated/backend/PlanTag.js +48 -2
  35. package/dist/src/generated/backend/RateTag.d.ts +6 -1
  36. package/dist/src/generated/backend/RateTag.js +48 -2
  37. package/dist/src/generated/backend/RoleTag.d.ts +6 -1
  38. package/dist/src/generated/backend/RoleTag.js +48 -2
  39. package/dist/src/generated/backend/SchemaTag.d.ts +8 -1
  40. package/dist/src/generated/backend/SchemaTag.js +65 -2
  41. package/dist/src/generated/backend/ScopeTag.d.ts +7 -1
  42. package/dist/src/generated/backend/ScopeTag.js +54 -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 +20 -10
  46. package/dist/src/generated/backend/StatisticTag.js +221 -20
  47. package/dist/src/generated/backend/TransactionTag.d.ts +3 -1
  48. package/dist/src/generated/backend/TransactionTag.js +28 -2
  49. package/dist/src/generated/backend/TrashTag.d.ts +4 -1
  50. package/dist/src/generated/backend/TrashTag.js +24 -2
  51. package/dist/src/generated/backend/UserTag.d.ts +6 -1
  52. package/dist/src/generated/backend/UserTag.js +48 -2
  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 +6 -1
  56. package/dist/src/generated/consumer/AppTag.js +48 -2
  57. package/dist/src/generated/consumer/EventTag.d.ts +2 -1
  58. package/dist/src/generated/consumer/EventTag.js +12 -2
  59. package/dist/src/generated/consumer/GrantTag.d.ts +3 -1
  60. package/dist/src/generated/consumer/GrantTag.js +21 -2
  61. package/dist/src/generated/consumer/LogTag.d.ts +3 -1
  62. package/dist/src/generated/consumer/LogTag.js +21 -2
  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 +3 -1
  66. package/dist/src/generated/consumer/PageTag.js +21 -2
  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 +3 -1
  70. package/dist/src/generated/consumer/PlanTag.js +21 -2
  71. package/dist/src/generated/consumer/ScopeTag.d.ts +2 -1
  72. package/dist/src/generated/consumer/ScopeTag.js +12 -2
  73. package/dist/src/generated/consumer/SubscriptionTag.d.ts +6 -1
  74. package/dist/src/generated/consumer/SubscriptionTag.js +48 -2
  75. package/dist/src/generated/consumer/TransactionTag.d.ts +3 -1
  76. package/dist/src/generated/consumer/TransactionTag.js +21 -2
  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 GrantTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Message>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async delete(grantId) {
@@ -26,6 +28,14 @@ export class GrantTag 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,19 @@ export class GrantTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<GrantCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
- async getAll() {
51
+ async getAll(startIndex, count, search) {
41
52
  const url = this.parser.url('/consumer/grant', {});
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
+ }),
46
61
  };
47
62
  try {
48
63
  const response = await this.httpClient.request(params);
@@ -51,6 +66,10 @@ export class GrantTag extends TagAbstract {
51
66
  catch (error) {
52
67
  if (axios.isAxiosError(error) && error.response) {
53
68
  switch (error.response.status) {
69
+ case 401:
70
+ throw new MessageException(error.response.data);
71
+ case 500:
72
+ throw new MessageException(error.response.data);
54
73
  default:
55
74
  throw new UnknownStatusCodeException('The server returned an unknown status code');
56
75
  }
@@ -8,12 +8,14 @@ import { LogCollection } from "./LogCollection";
8
8
  export declare class LogTag extends TagAbstract {
9
9
  /**
10
10
  * @returns {Promise<Log>}
11
+ * @throws {MessageException}
11
12
  * @throws {ClientException}
12
13
  */
13
14
  get(logId: string): Promise<Log>;
14
15
  /**
15
16
  * @returns {Promise<LogCollection>}
17
+ * @throws {MessageException}
16
18
  * @throws {ClientException}
17
19
  */
18
- getAll(): Promise<LogCollection>;
20
+ getAll(startIndex?: number, count?: number, search?: string): Promise<LogCollection>;
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 LogTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Log>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async get(logId) {
@@ -26,6 +28,14 @@ export class LogTag 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,19 @@ export class LogTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<LogCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
- async getAll() {
51
+ async getAll(startIndex, count, search) {
41
52
  const url = this.parser.url('/consumer/log', {});
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
+ }),
46
61
  };
47
62
  try {
48
63
  const response = await this.httpClient.request(params);
@@ -51,6 +66,10 @@ export class LogTag extends TagAbstract {
51
66
  catch (error) {
52
67
  if (axios.isAxiosError(error) && error.response) {
53
68
  switch (error.response.status) {
69
+ case 401:
70
+ throw new MessageException(error.response.data);
71
+ case 500:
72
+ throw new MessageException(error.response.data);
54
73
  default:
55
74
  throw new UnknownStatusCodeException('The server returned an unknown status code');
56
75
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * MessageException 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 { Message } from "./Message";
7
+ export declare class MessageException extends KnownStatusCodeException {
8
+ private payload;
9
+ constructor(payload: Message);
10
+ getPayload(): Message;
11
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * MessageException 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 MessageException extends KnownStatusCodeException {
7
+ constructor(payload) {
8
+ super();
9
+ this.payload = payload;
10
+ }
11
+ getPayload() {
12
+ return this.payload;
13
+ }
14
+ }
@@ -8,12 +8,14 @@ import { PageCollection } from "./PageCollection";
8
8
  export declare class PageTag extends TagAbstract {
9
9
  /**
10
10
  * @returns {Promise<Page>}
11
+ * @throws {MessageException}
11
12
  * @throws {ClientException}
12
13
  */
13
14
  get(pageId: string): Promise<Page>;
14
15
  /**
15
16
  * @returns {Promise<PageCollection>}
17
+ * @throws {MessageException}
16
18
  * @throws {ClientException}
17
19
  */
18
- getAll(): Promise<PageCollection>;
20
+ getAll(startIndex?: number, count?: number, search?: string): Promise<PageCollection>;
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 PageTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Page>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async get(pageId) {
@@ -26,6 +28,14 @@ export class PageTag 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,19 @@ export class PageTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<PageCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
- async getAll() {
51
+ async getAll(startIndex, count, search) {
41
52
  const url = this.parser.url('/consumer/page', {});
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
+ }),
46
61
  };
47
62
  try {
48
63
  const response = await this.httpClient.request(params);
@@ -51,6 +66,10 @@ export class PageTag extends TagAbstract {
51
66
  catch (error) {
52
67
  if (axios.isAxiosError(error) && error.response) {
53
68
  switch (error.response.status) {
69
+ case 401:
70
+ throw new MessageException(error.response.data);
71
+ case 500:
72
+ throw new MessageException(error.response.data);
54
73
  default:
55
74
  throw new UnknownStatusCodeException('The server returned an unknown status code');
56
75
  }
@@ -10,11 +10,13 @@ import { PaymentPortalResponse } from "./PaymentPortalResponse";
10
10
  export declare class PaymentTag extends TagAbstract {
11
11
  /**
12
12
  * @returns {Promise<PaymentCheckoutResponse>}
13
+ * @throws {MessageException}
13
14
  * @throws {ClientException}
14
15
  */
15
16
  checkout(provider: string, payload: PaymentCheckoutRequest): Promise<PaymentCheckoutResponse>;
16
17
  /**
17
18
  * @returns {Promise<PaymentPortalResponse>}
19
+ * @throws {MessageException}
18
20
  * @throws {ClientException}
19
21
  */
20
22
  portal(provider: string, payload: PaymentPortalRequest): Promise<PaymentPortalResponse>;
@@ -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 PaymentTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<PaymentCheckoutResponse>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async checkout(provider, payload) {
@@ -27,6 +29,10 @@ export class PaymentTag 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 500:
35
+ throw new MessageException(error.response.data);
30
36
  default:
31
37
  throw new UnknownStatusCodeException('The server returned an unknown status code');
32
38
  }
@@ -36,6 +42,7 @@ export class PaymentTag extends TagAbstract {
36
42
  }
37
43
  /**
38
44
  * @returns {Promise<PaymentPortalResponse>}
45
+ * @throws {MessageException}
39
46
  * @throws {ClientException}
40
47
  */
41
48
  async portal(provider, payload) {
@@ -55,6 +62,10 @@ export class PaymentTag extends TagAbstract {
55
62
  catch (error) {
56
63
  if (axios.isAxiosError(error) && error.response) {
57
64
  switch (error.response.status) {
65
+ case 401:
66
+ throw new MessageException(error.response.data);
67
+ case 500:
68
+ throw new MessageException(error.response.data);
58
69
  default:
59
70
  throw new UnknownStatusCodeException('The server returned an unknown status code');
60
71
  }
@@ -8,12 +8,14 @@ import { PlanCollection } from "./PlanCollection";
8
8
  export declare class PlanTag extends TagAbstract {
9
9
  /**
10
10
  * @returns {Promise<Plan>}
11
+ * @throws {MessageException}
11
12
  * @throws {ClientException}
12
13
  */
13
14
  get(planId: string): Promise<Plan>;
14
15
  /**
15
16
  * @returns {Promise<PlanCollection>}
17
+ * @throws {MessageException}
16
18
  * @throws {ClientException}
17
19
  */
18
- getAll(): Promise<PlanCollection>;
20
+ getAll(startIndex?: number, count?: number, search?: string): Promise<PlanCollection>;
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 PlanTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Plan>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async get(planId) {
@@ -26,6 +28,14 @@ export class PlanTag 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,19 @@ export class PlanTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<PlanCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
- async getAll() {
51
+ async getAll(startIndex, count, search) {
41
52
  const url = this.parser.url('/consumer/plan', {});
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
+ }),
46
61
  };
47
62
  try {
48
63
  const response = await this.httpClient.request(params);
@@ -51,6 +66,10 @@ export class PlanTag extends TagAbstract {
51
66
  catch (error) {
52
67
  if (axios.isAxiosError(error) && error.response) {
53
68
  switch (error.response.status) {
69
+ case 401:
70
+ throw new MessageException(error.response.data);
71
+ case 500:
72
+ throw new MessageException(error.response.data);
54
73
  default:
55
74
  throw new UnknownStatusCodeException('The server returned an unknown status code');
56
75
  }
@@ -7,7 +7,8 @@ import { ScopeCollection } from "./ScopeCollection";
7
7
  export declare class ScopeTag extends TagAbstract {
8
8
  /**
9
9
  * @returns {Promise<ScopeCollection>}
10
+ * @throws {MessageException}
10
11
  * @throws {ClientException}
11
12
  */
12
- getAll(): Promise<ScopeCollection>;
13
+ getAll(startIndex?: number, count?: number, search?: string): Promise<ScopeCollection>;
13
14
  }
@@ -5,17 +5,23 @@
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 ScopeTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<ScopeCollection>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
- async getAll() {
15
+ async getAll(startIndex, count, search) {
14
16
  const url = this.parser.url('/consumer/scope', {});
15
17
  let params = {
16
18
  url: url,
17
19
  method: 'GET',
18
- params: this.parser.query({}),
20
+ params: this.parser.query({
21
+ 'startIndex': startIndex,
22
+ 'count': count,
23
+ 'search': search,
24
+ }),
19
25
  };
20
26
  try {
21
27
  const response = await this.httpClient.request(params);
@@ -24,6 +30,10 @@ export class ScopeTag extends TagAbstract {
24
30
  catch (error) {
25
31
  if (axios.isAxiosError(error) && error.response) {
26
32
  switch (error.response.status) {
33
+ case 401:
34
+ throw new MessageException(error.response.data);
35
+ case 500:
36
+ throw new MessageException(error.response.data);
27
37
  default:
28
38
  throw new UnknownStatusCodeException('The server returned an unknown status code');
29
39
  }
@@ -11,27 +11,32 @@ import { Message } from "./Message";
11
11
  export declare class SubscriptionTag extends TagAbstract {
12
12
  /**
13
13
  * @returns {Promise<Message>}
14
+ * @throws {MessageException}
14
15
  * @throws {ClientException}
15
16
  */
16
17
  delete(subscriptionId: string): Promise<Message>;
17
18
  /**
18
19
  * @returns {Promise<Message>}
20
+ * @throws {MessageException}
19
21
  * @throws {ClientException}
20
22
  */
21
23
  update(subscriptionId: string, payload: EventSubscriptionUpdate): Promise<Message>;
22
24
  /**
23
25
  * @returns {Promise<EventSubscription>}
26
+ * @throws {MessageException}
24
27
  * @throws {ClientException}
25
28
  */
26
29
  get(subscriptionId: string): Promise<EventSubscription>;
27
30
  /**
28
31
  * @returns {Promise<Message>}
32
+ * @throws {MessageException}
29
33
  * @throws {ClientException}
30
34
  */
31
35
  create(payload: EventSubscriptionCreate): Promise<Message>;
32
36
  /**
33
37
  * @returns {Promise<EventSubscriptionCollection>}
38
+ * @throws {MessageException}
34
39
  * @throws {ClientException}
35
40
  */
36
- getAll(): Promise<EventSubscriptionCollection>;
41
+ getAll(startIndex?: number, count?: number, search?: string): Promise<EventSubscriptionCollection>;
37
42
  }
@@ -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 SubscriptionTag extends TagAbstract {
9
10
  /**
10
11
  * @returns {Promise<Message>}
12
+ * @throws {MessageException}
11
13
  * @throws {ClientException}
12
14
  */
13
15
  async delete(subscriptionId) {
@@ -26,6 +28,14 @@ export class SubscriptionTag 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 SubscriptionTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<Message>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
51
  async update(subscriptionId, payload) {
@@ -54,6 +65,16 @@ export class SubscriptionTag 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 SubscriptionTag extends TagAbstract {
63
84
  }
64
85
  /**
65
86
  * @returns {Promise<EventSubscription>}
87
+ * @throws {MessageException}
66
88
  * @throws {ClientException}
67
89
  */
68
90
  async get(subscriptionId) {
@@ -81,6 +103,14 @@ export class SubscriptionTag 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 SubscriptionTag 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 SubscriptionTag 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,14 +153,19 @@ export class SubscriptionTag extends TagAbstract {
116
153
  }
117
154
  /**
118
155
  * @returns {Promise<EventSubscriptionCollection>}
156
+ * @throws {MessageException}
119
157
  * @throws {ClientException}
120
158
  */
121
- async getAll() {
159
+ async getAll(startIndex, count, search) {
122
160
  const url = this.parser.url('/consumer/subscription', {});
123
161
  let params = {
124
162
  url: url,
125
163
  method: 'GET',
126
- params: this.parser.query({}),
164
+ params: this.parser.query({
165
+ 'startIndex': startIndex,
166
+ 'count': count,
167
+ 'search': search,
168
+ }),
127
169
  };
128
170
  try {
129
171
  const response = await this.httpClient.request(params);
@@ -132,6 +174,10 @@ export class SubscriptionTag extends TagAbstract {
132
174
  catch (error) {
133
175
  if (axios.isAxiosError(error) && error.response) {
134
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);
135
181
  default:
136
182
  throw new UnknownStatusCodeException('The server returned an unknown status code');
137
183
  }
@@ -8,12 +8,14 @@ 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
- getAll(): Promise<TransactionCollection>;
20
+ getAll(startIndex?: number, count?: number, search?: string): Promise<TransactionCollection>;
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 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,14 +45,19 @@ export class TransactionTag extends TagAbstract {
35
45
  }
36
46
  /**
37
47
  * @returns {Promise<TransactionCollection>}
48
+ * @throws {MessageException}
38
49
  * @throws {ClientException}
39
50
  */
40
- async getAll() {
51
+ async getAll(startIndex, count, search) {
41
52
  const url = this.parser.url('/consumer/transaction', {});
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
+ }),
46
61
  };
47
62
  try {
48
63
  const response = await this.httpClient.request(params);
@@ -51,6 +66,10 @@ export class TransactionTag extends TagAbstract {
51
66
  catch (error) {
52
67
  if (axios.isAxiosError(error) && error.response) {
53
68
  switch (error.response.status) {
69
+ case 401:
70
+ throw new MessageException(error.response.data);
71
+ case 500:
72
+ throw new MessageException(error.response.data);
54
73
  default:
55
74
  throw new UnknownStatusCodeException('The server returned an unknown status code');
56
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusio-sdk",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "SDK to talk to the Fusio API",
5
5
  "keywords": [
6
6
  "API",