fusio-sdk 3.0.5 → 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 +8 -0
- package/dist/src/generated/backend/ActionTag.js +57 -0
- package/dist/src/generated/backend/AppTag.d.ts +8 -0
- package/dist/src/generated/backend/AppTag.js +63 -0
- package/dist/src/generated/backend/AuditTag.d.ts +2 -0
- package/dist/src/generated/backend/AuditTag.js +15 -0
- package/dist/src/generated/backend/CategoryTag.d.ts +5 -0
- package/dist/src/generated/backend/CategoryTag.js +42 -0
- package/dist/src/generated/backend/ConfigTag.d.ts +3 -0
- package/dist/src/generated/backend/ConfigTag.js +26 -0
- package/dist/src/generated/backend/ConnectionTag.d.ts +12 -2
- package/dist/src/generated/backend/ConnectionTag.js +72 -1
- package/dist/src/generated/backend/CronjobTag.d.ts +5 -0
- package/dist/src/generated/backend/CronjobTag.js +42 -0
- 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 +10 -0
- package/dist/src/generated/backend/EventTag.js +81 -0
- 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 +4 -0
- package/dist/src/generated/backend/LogTag.js +25 -0
- 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 +5 -0
- package/dist/src/generated/backend/OperationTag.js +42 -0
- package/dist/src/generated/backend/PageTag.d.ts +5 -0
- package/dist/src/generated/backend/PageTag.js +42 -0
- package/dist/src/generated/backend/PlanTag.d.ts +5 -0
- package/dist/src/generated/backend/PlanTag.js +42 -0
- package/dist/src/generated/backend/RateTag.d.ts +5 -0
- package/dist/src/generated/backend/RateTag.js +42 -0
- package/dist/src/generated/backend/RoleTag.d.ts +5 -0
- package/dist/src/generated/backend/RoleTag.js +42 -0
- package/dist/src/generated/backend/SchemaTag.d.ts +7 -0
- package/dist/src/generated/backend/SchemaTag.js +58 -0
- package/dist/src/generated/backend/ScopeTag.d.ts +6 -0
- package/dist/src/generated/backend/ScopeTag.js +47 -0
- 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 +10 -0
- package/dist/src/generated/backend/StatisticTag.js +51 -0
- package/dist/src/generated/backend/TransactionTag.d.ts +2 -0
- package/dist/src/generated/backend/TransactionTag.js +15 -0
- package/dist/src/generated/backend/TrashTag.d.ts +3 -0
- package/dist/src/generated/backend/TrashTag.js +18 -0
- package/dist/src/generated/backend/UserTag.d.ts +5 -0
- package/dist/src/generated/backend/UserTag.js +42 -0
- 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 +5 -0
- package/dist/src/generated/consumer/AppTag.js +42 -0
- package/dist/src/generated/consumer/EventTag.d.ts +1 -0
- package/dist/src/generated/consumer/EventTag.js +6 -0
- package/dist/src/generated/consumer/GrantTag.d.ts +2 -0
- package/dist/src/generated/consumer/GrantTag.js +15 -0
- package/dist/src/generated/consumer/LogTag.d.ts +2 -0
- package/dist/src/generated/consumer/LogTag.js +15 -0
- 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 +2 -0
- package/dist/src/generated/consumer/PageTag.js +15 -0
- 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 +2 -0
- package/dist/src/generated/consumer/PlanTag.js +15 -0
- package/dist/src/generated/consumer/ScopeTag.d.ts +1 -0
- package/dist/src/generated/consumer/ScopeTag.js +6 -0
- package/dist/src/generated/consumer/SubscriptionTag.d.ts +5 -0
- package/dist/src/generated/consumer/SubscriptionTag.js +42 -0
- package/dist/src/generated/consumer/TransactionTag.d.ts +2 -0
- package/dist/src/generated/consumer/TransactionTag.js +15 -0
- package/package.json +1 -1
|
@@ -11,26 +11,31 @@ import { OperationUpdate } from "./OperationUpdate";
|
|
|
11
11
|
export declare class OperationTag extends TagAbstract {
|
|
12
12
|
/**
|
|
13
13
|
* @returns {Promise<Message>}
|
|
14
|
+
* @throws {MessageException}
|
|
14
15
|
* @throws {ClientException}
|
|
15
16
|
*/
|
|
16
17
|
delete(operationId: string): Promise<Message>;
|
|
17
18
|
/**
|
|
18
19
|
* @returns {Promise<Message>}
|
|
20
|
+
* @throws {MessageException}
|
|
19
21
|
* @throws {ClientException}
|
|
20
22
|
*/
|
|
21
23
|
update(operationId: string, payload: OperationUpdate): Promise<Message>;
|
|
22
24
|
/**
|
|
23
25
|
* @returns {Promise<Operation>}
|
|
26
|
+
* @throws {MessageException}
|
|
24
27
|
* @throws {ClientException}
|
|
25
28
|
*/
|
|
26
29
|
get(operationId: string): Promise<Operation>;
|
|
27
30
|
/**
|
|
28
31
|
* @returns {Promise<Message>}
|
|
32
|
+
* @throws {MessageException}
|
|
29
33
|
* @throws {ClientException}
|
|
30
34
|
*/
|
|
31
35
|
create(payload: OperationCreate): Promise<Message>;
|
|
32
36
|
/**
|
|
33
37
|
* @returns {Promise<OperationCollection>}
|
|
38
|
+
* @throws {MessageException}
|
|
34
39
|
* @throws {ClientException}
|
|
35
40
|
*/
|
|
36
41
|
getAll(categoryId?: number, startIndex?: number, count?: number, search?: string): Promise<OperationCollection>;
|
|
@@ -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 OperationTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async delete(operationId) {
|
|
@@ -26,6 +28,14 @@ export class OperationTag 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 OperationTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<Message>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
51
|
async update(operationId, payload) {
|
|
@@ -54,6 +65,16 @@ export class OperationTag 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 OperationTag extends TagAbstract {
|
|
|
63
84
|
}
|
|
64
85
|
/**
|
|
65
86
|
* @returns {Promise<Operation>}
|
|
87
|
+
* @throws {MessageException}
|
|
66
88
|
* @throws {ClientException}
|
|
67
89
|
*/
|
|
68
90
|
async get(operationId) {
|
|
@@ -81,6 +103,14 @@ export class OperationTag 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 OperationTag 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 OperationTag 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 OperationTag extends TagAbstract {
|
|
|
116
153
|
}
|
|
117
154
|
/**
|
|
118
155
|
* @returns {Promise<OperationCollection>}
|
|
156
|
+
* @throws {MessageException}
|
|
119
157
|
* @throws {ClientException}
|
|
120
158
|
*/
|
|
121
159
|
async getAll(categoryId, startIndex, count, search) {
|
|
@@ -137,6 +175,10 @@ export class OperationTag extends TagAbstract {
|
|
|
137
175
|
catch (error) {
|
|
138
176
|
if (axios.isAxiosError(error) && error.response) {
|
|
139
177
|
switch (error.response.status) {
|
|
178
|
+
case 401:
|
|
179
|
+
throw new MessageException(error.response.data);
|
|
180
|
+
case 500:
|
|
181
|
+
throw new MessageException(error.response.data);
|
|
140
182
|
default:
|
|
141
183
|
throw new UnknownStatusCodeException('The server returned an unknown status code');
|
|
142
184
|
}
|
|
@@ -11,26 +11,31 @@ import { PageUpdate } from "./PageUpdate";
|
|
|
11
11
|
export declare class PageTag extends TagAbstract {
|
|
12
12
|
/**
|
|
13
13
|
* @returns {Promise<Message>}
|
|
14
|
+
* @throws {MessageException}
|
|
14
15
|
* @throws {ClientException}
|
|
15
16
|
*/
|
|
16
17
|
delete(pageId: string): Promise<Message>;
|
|
17
18
|
/**
|
|
18
19
|
* @returns {Promise<Message>}
|
|
20
|
+
* @throws {MessageException}
|
|
19
21
|
* @throws {ClientException}
|
|
20
22
|
*/
|
|
21
23
|
update(pageId: string, payload: PageUpdate): Promise<Message>;
|
|
22
24
|
/**
|
|
23
25
|
* @returns {Promise<Page>}
|
|
26
|
+
* @throws {MessageException}
|
|
24
27
|
* @throws {ClientException}
|
|
25
28
|
*/
|
|
26
29
|
get(pageId: string): Promise<Page>;
|
|
27
30
|
/**
|
|
28
31
|
* @returns {Promise<Message>}
|
|
32
|
+
* @throws {MessageException}
|
|
29
33
|
* @throws {ClientException}
|
|
30
34
|
*/
|
|
31
35
|
create(payload: PageCreate): Promise<Message>;
|
|
32
36
|
/**
|
|
33
37
|
* @returns {Promise<PageCollection>}
|
|
38
|
+
* @throws {MessageException}
|
|
34
39
|
* @throws {ClientException}
|
|
35
40
|
*/
|
|
36
41
|
getAll(startIndex?: number, count?: number, search?: string): Promise<PageCollection>;
|
|
@@ -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<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async delete(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,6 +45,7 @@ export class PageTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<Message>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
51
|
async update(pageId, payload) {
|
|
@@ -54,6 +65,16 @@ export class PageTag 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 PageTag extends TagAbstract {
|
|
|
63
84
|
}
|
|
64
85
|
/**
|
|
65
86
|
* @returns {Promise<Page>}
|
|
87
|
+
* @throws {MessageException}
|
|
66
88
|
* @throws {ClientException}
|
|
67
89
|
*/
|
|
68
90
|
async get(pageId) {
|
|
@@ -81,6 +103,14 @@ export class PageTag 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 PageTag 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 PageTag 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 PageTag extends TagAbstract {
|
|
|
116
153
|
}
|
|
117
154
|
/**
|
|
118
155
|
* @returns {Promise<PageCollection>}
|
|
156
|
+
* @throws {MessageException}
|
|
119
157
|
* @throws {ClientException}
|
|
120
158
|
*/
|
|
121
159
|
async getAll(startIndex, count, search) {
|
|
@@ -136,6 +174,10 @@ export class PageTag 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
|
}
|
|
@@ -11,26 +11,31 @@ import { PlanUpdate } from "./PlanUpdate";
|
|
|
11
11
|
export declare class PlanTag extends TagAbstract {
|
|
12
12
|
/**
|
|
13
13
|
* @returns {Promise<Message>}
|
|
14
|
+
* @throws {MessageException}
|
|
14
15
|
* @throws {ClientException}
|
|
15
16
|
*/
|
|
16
17
|
delete(planId: string): Promise<Message>;
|
|
17
18
|
/**
|
|
18
19
|
* @returns {Promise<Message>}
|
|
20
|
+
* @throws {MessageException}
|
|
19
21
|
* @throws {ClientException}
|
|
20
22
|
*/
|
|
21
23
|
update(planId: string, payload: PlanUpdate): Promise<Message>;
|
|
22
24
|
/**
|
|
23
25
|
* @returns {Promise<Plan>}
|
|
26
|
+
* @throws {MessageException}
|
|
24
27
|
* @throws {ClientException}
|
|
25
28
|
*/
|
|
26
29
|
get(planId: string): Promise<Plan>;
|
|
27
30
|
/**
|
|
28
31
|
* @returns {Promise<Message>}
|
|
32
|
+
* @throws {MessageException}
|
|
29
33
|
* @throws {ClientException}
|
|
30
34
|
*/
|
|
31
35
|
create(payload: PlanCreate): Promise<Message>;
|
|
32
36
|
/**
|
|
33
37
|
* @returns {Promise<PlanCollection>}
|
|
38
|
+
* @throws {MessageException}
|
|
34
39
|
* @throws {ClientException}
|
|
35
40
|
*/
|
|
36
41
|
getAll(startIndex?: number, count?: number, search?: string): Promise<PlanCollection>;
|
|
@@ -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<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async delete(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,6 +45,7 @@ export class PlanTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<Message>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
51
|
async update(planId, payload) {
|
|
@@ -54,6 +65,16 @@ export class PlanTag 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 PlanTag extends TagAbstract {
|
|
|
63
84
|
}
|
|
64
85
|
/**
|
|
65
86
|
* @returns {Promise<Plan>}
|
|
87
|
+
* @throws {MessageException}
|
|
66
88
|
* @throws {ClientException}
|
|
67
89
|
*/
|
|
68
90
|
async get(planId) {
|
|
@@ -81,6 +103,14 @@ export class PlanTag 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 PlanTag 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 PlanTag 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 PlanTag extends TagAbstract {
|
|
|
116
153
|
}
|
|
117
154
|
/**
|
|
118
155
|
* @returns {Promise<PlanCollection>}
|
|
156
|
+
* @throws {MessageException}
|
|
119
157
|
* @throws {ClientException}
|
|
120
158
|
*/
|
|
121
159
|
async getAll(startIndex, count, search) {
|
|
@@ -136,6 +174,10 @@ export class PlanTag 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
|
}
|
|
@@ -11,26 +11,31 @@ import { RateUpdate } from "./RateUpdate";
|
|
|
11
11
|
export declare class RateTag extends TagAbstract {
|
|
12
12
|
/**
|
|
13
13
|
* @returns {Promise<Message>}
|
|
14
|
+
* @throws {MessageException}
|
|
14
15
|
* @throws {ClientException}
|
|
15
16
|
*/
|
|
16
17
|
delete(rateId: string): Promise<Message>;
|
|
17
18
|
/**
|
|
18
19
|
* @returns {Promise<Message>}
|
|
20
|
+
* @throws {MessageException}
|
|
19
21
|
* @throws {ClientException}
|
|
20
22
|
*/
|
|
21
23
|
update(rateId: string, payload: RateUpdate): Promise<Message>;
|
|
22
24
|
/**
|
|
23
25
|
* @returns {Promise<Rate>}
|
|
26
|
+
* @throws {MessageException}
|
|
24
27
|
* @throws {ClientException}
|
|
25
28
|
*/
|
|
26
29
|
get(rateId: string): Promise<Rate>;
|
|
27
30
|
/**
|
|
28
31
|
* @returns {Promise<Message>}
|
|
32
|
+
* @throws {MessageException}
|
|
29
33
|
* @throws {ClientException}
|
|
30
34
|
*/
|
|
31
35
|
create(payload: RateCreate): Promise<Message>;
|
|
32
36
|
/**
|
|
33
37
|
* @returns {Promise<RateCollection>}
|
|
38
|
+
* @throws {MessageException}
|
|
34
39
|
* @throws {ClientException}
|
|
35
40
|
*/
|
|
36
41
|
getAll(startIndex?: number, count?: number, search?: string): Promise<RateCollection>;
|
|
@@ -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 RateTag extends TagAbstract {
|
|
9
10
|
/**
|
|
10
11
|
* @returns {Promise<Message>}
|
|
12
|
+
* @throws {MessageException}
|
|
11
13
|
* @throws {ClientException}
|
|
12
14
|
*/
|
|
13
15
|
async delete(rateId) {
|
|
@@ -26,6 +28,14 @@ export class RateTag 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 RateTag extends TagAbstract {
|
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* @returns {Promise<Message>}
|
|
48
|
+
* @throws {MessageException}
|
|
38
49
|
* @throws {ClientException}
|
|
39
50
|
*/
|
|
40
51
|
async update(rateId, payload) {
|
|
@@ -54,6 +65,16 @@ export class RateTag 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 RateTag extends TagAbstract {
|
|
|
63
84
|
}
|
|
64
85
|
/**
|
|
65
86
|
* @returns {Promise<Rate>}
|
|
87
|
+
* @throws {MessageException}
|
|
66
88
|
* @throws {ClientException}
|
|
67
89
|
*/
|
|
68
90
|
async get(rateId) {
|
|
@@ -81,6 +103,14 @@ export class RateTag 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 RateTag 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 RateTag 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 RateTag extends TagAbstract {
|
|
|
116
153
|
}
|
|
117
154
|
/**
|
|
118
155
|
* @returns {Promise<RateCollection>}
|
|
156
|
+
* @throws {MessageException}
|
|
119
157
|
* @throws {ClientException}
|
|
120
158
|
*/
|
|
121
159
|
async getAll(startIndex, count, search) {
|
|
@@ -136,6 +174,10 @@ export class RateTag 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
|
}
|
|
@@ -11,26 +11,31 @@ import { RoleUpdate } from "./RoleUpdate";
|
|
|
11
11
|
export declare class RoleTag extends TagAbstract {
|
|
12
12
|
/**
|
|
13
13
|
* @returns {Promise<Message>}
|
|
14
|
+
* @throws {MessageException}
|
|
14
15
|
* @throws {ClientException}
|
|
15
16
|
*/
|
|
16
17
|
delete(roleId: string): Promise<Message>;
|
|
17
18
|
/**
|
|
18
19
|
* @returns {Promise<Message>}
|
|
20
|
+
* @throws {MessageException}
|
|
19
21
|
* @throws {ClientException}
|
|
20
22
|
*/
|
|
21
23
|
update(roleId: string, payload: RoleUpdate): Promise<Message>;
|
|
22
24
|
/**
|
|
23
25
|
* @returns {Promise<Role>}
|
|
26
|
+
* @throws {MessageException}
|
|
24
27
|
* @throws {ClientException}
|
|
25
28
|
*/
|
|
26
29
|
get(roleId: string): Promise<Role>;
|
|
27
30
|
/**
|
|
28
31
|
* @returns {Promise<Message>}
|
|
32
|
+
* @throws {MessageException}
|
|
29
33
|
* @throws {ClientException}
|
|
30
34
|
*/
|
|
31
35
|
create(payload: RoleCreate): Promise<Message>;
|
|
32
36
|
/**
|
|
33
37
|
* @returns {Promise<RoleCollection>}
|
|
38
|
+
* @throws {MessageException}
|
|
34
39
|
* @throws {ClientException}
|
|
35
40
|
*/
|
|
36
41
|
getAll(startIndex?: number, count?: number, search?: string): Promise<RoleCollection>;
|