@reviza/api-client 0.0.1 → 1.0.0-SNAPSHOT-b1d8a2de
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/App/Data/ActionLog/index.d.ts +2 -2
- package/dist/App/Data/Category/index.d.ts +3 -3
- package/dist/App/Data/Config/index.d.ts +1 -1
- package/dist/App/Data/Facility/index.d.ts +6 -6
- package/dist/App/Data/Me/index.d.ts +4 -4
- package/dist/App/Data/Notification/index.d.ts +1 -1
- package/dist/App/Data/Revision/index.d.ts +4 -4
- package/dist/App/Data/Search/index.d.ts +1 -1
- package/dist/App/Data/Subscription/index.d.ts +2 -2
- package/dist/App/Data/User/index.d.ts +2 -2
- package/dist/controllers/index.d.ts +20 -20
- package/dist/controllers/index.js +297 -74
- package/package.json +3 -3
- package/README.md +0 -1
- package/dist/Carbon/index.d.ts +0 -44
- package/dist/Carbon/index.js +0 -47
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OrganizationData } from
|
|
2
|
-
import { FacilityData } from
|
|
3
|
-
import { MapData } from
|
|
1
|
+
import { OrganizationData } from "../Organization";
|
|
2
|
+
import { FacilityData } from "../Facility";
|
|
3
|
+
import { MapData } from "../Map";
|
|
4
4
|
export type CategoryCreatePayload = {
|
|
5
5
|
name: string;
|
|
6
6
|
type_name: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FacilityTypeEnum, FacilityStateEnum, IntervalUnitEnum } from
|
|
2
|
-
import { CategoryData } from
|
|
3
|
-
import { RevisionData, RevisionIssueData } from
|
|
4
|
-
import { DocumentData } from
|
|
5
|
-
import { MapData } from
|
|
6
|
-
import { UploadedFile } from
|
|
1
|
+
import { FacilityTypeEnum, FacilityStateEnum, IntervalUnitEnum } from "../../Enum";
|
|
2
|
+
import { CategoryData } from "../Category";
|
|
3
|
+
import { RevisionData, RevisionIssueData } from "../Revision";
|
|
4
|
+
import { DocumentData } from "../Document";
|
|
5
|
+
import { MapData } from "../Map";
|
|
6
|
+
import { UploadedFile } from "../../../Illuminate/Http";
|
|
7
7
|
export type FacilityCreatePayload = {
|
|
8
8
|
name: string;
|
|
9
9
|
identification_number: string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UserRoleEnum } from
|
|
2
|
-
import { OrganizationData } from
|
|
3
|
-
import { CategoryData } from
|
|
4
|
-
import { UserPermissionData } from
|
|
1
|
+
import { UserRoleEnum } from "../../Enum";
|
|
2
|
+
import { OrganizationData } from "../Organization";
|
|
3
|
+
import { CategoryData } from "../Category";
|
|
4
|
+
import { UserPermissionData } from "../Permission";
|
|
5
5
|
export type MeData = {
|
|
6
6
|
id: number;
|
|
7
7
|
first_name: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CategoryNotificationEnum, OrganizationNotificationEnum } from
|
|
1
|
+
import { CategoryNotificationEnum, OrganizationNotificationEnum } from "../../Enum/Notifications";
|
|
2
2
|
export type CategoryNotificationData = {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FacilityStateEnum, RevisionTypeEnum } from
|
|
2
|
-
import { FacilityData } from
|
|
3
|
-
import { DocumentData } from
|
|
4
|
-
import { UserData } from
|
|
1
|
+
import { FacilityStateEnum, RevisionTypeEnum } from "../../Enum";
|
|
2
|
+
import { FacilityData } from "../Facility";
|
|
3
|
+
import { DocumentData } from "../Document";
|
|
4
|
+
import { UserData } from "../User";
|
|
5
5
|
export type RevisionCreatePayload = {
|
|
6
6
|
revision_date: string;
|
|
7
7
|
next_revision_date: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SubscriptionPlanEnum } from
|
|
2
|
-
import { UserData } from
|
|
1
|
+
import { SubscriptionPlanEnum } from "../../Enum";
|
|
2
|
+
import { UserData } from "../User";
|
|
3
3
|
export type SubscriptionCreatePayload = {
|
|
4
4
|
author_user_id: number;
|
|
5
5
|
end_date: string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { LoginPayload, LoginData, RegistrationTokenData, RegisterPayload, ForgotPasswordPayload, PasswordPayload, InvitationPayload } from
|
|
2
|
-
import { RevizaResponseData } from
|
|
3
|
-
import { DataCollection } from
|
|
4
|
-
import { CategoryData, CategoryCreatePayload, CategoryUpdatePayload, CategoryTreeData } from
|
|
5
|
-
import { ConfigData } from
|
|
6
|
-
import { FacilityListData, FacilityData, FacilityCreatePayload, FacilityUpdatePayload, FacilityPicturePayload, FacilityIssueResolvedPayload, RelatedFacilityCreatePayload } from
|
|
7
|
-
import { DemoRequestCreatePayload, DemoRequestData } from
|
|
8
|
-
import { MapExtentData, MapData } from
|
|
9
|
-
import { DocumentData, DocumentCreatePayload, DocumentUpdatePayload } from
|
|
10
|
-
import { FrontendRouteRedirectRequest, FrontendRouteRedirectData } from
|
|
11
|
-
import { MeData, MeUpdatePayload } from
|
|
12
|
-
import { UserSettingsPayload, UserData } from
|
|
13
|
-
import { NotificationSettingsData, NotificationSettingsPayload } from
|
|
14
|
-
import { OrganizationData, OrganizationUpdatePayload } from
|
|
15
|
-
import { SubscriptionData } from
|
|
16
|
-
import { UserPermissionData, UserPermissionPayload } from
|
|
17
|
-
import { RevisionData, RevisionCreatePayload, RevisionUpdatePayload, RevisionIssueData } from
|
|
18
|
-
import { SearchData } from
|
|
1
|
+
import { LoginPayload, LoginData, RegistrationTokenData, RegisterPayload, ForgotPasswordPayload, PasswordPayload, InvitationPayload } from "../App/Data/Auth";
|
|
2
|
+
import { RevizaResponseData } from "../App/Data";
|
|
3
|
+
import { DataCollection } from "../Spatie/LaravelData";
|
|
4
|
+
import { CategoryData, CategoryCreatePayload, CategoryUpdatePayload, CategoryTreeData } from "../App/Data/Category";
|
|
5
|
+
import { ConfigData } from "../App/Data/Config";
|
|
6
|
+
import { FacilityListData, FacilityData, FacilityCreatePayload, FacilityUpdatePayload, FacilityPicturePayload, FacilityIssueResolvedPayload, RelatedFacilityCreatePayload } from "../App/Data/Facility";
|
|
7
|
+
import { DemoRequestCreatePayload, DemoRequestData } from "../App/Data/Demo";
|
|
8
|
+
import { MapExtentData, MapData } from "../App/Data/Map";
|
|
9
|
+
import { DocumentData, DocumentCreatePayload, DocumentUpdatePayload } from "../App/Data/Document";
|
|
10
|
+
import { FrontendRouteRedirectRequest, FrontendRouteRedirectData } from "../App/Data/FrontendRoute";
|
|
11
|
+
import { MeData, MeUpdatePayload } from "../App/Data/Me";
|
|
12
|
+
import { UserSettingsPayload, UserData } from "../App/Data/User";
|
|
13
|
+
import { NotificationSettingsData, NotificationSettingsPayload } from "../App/Data/Notification";
|
|
14
|
+
import { OrganizationData, OrganizationUpdatePayload } from "../App/Data/Organization";
|
|
15
|
+
import { SubscriptionData } from "../App/Data/Subscription";
|
|
16
|
+
import { UserPermissionData, UserPermissionPayload } from "../App/Data/Permission";
|
|
17
|
+
import { RevisionData, RevisionCreatePayload, RevisionUpdatePayload, RevisionIssueData } from "../App/Data/Revision";
|
|
18
|
+
import { SearchData } from "../App/Data/Search";
|
|
19
19
|
type ActionFunction<P extends RouteParams | undefined> = P extends undefined ? (options?: RouteOptions) => ActionResult : (params: P, options?: RouteOptions) => ActionResult;
|
|
20
20
|
type ActionResult = RouteDefinition & {
|
|
21
21
|
url: string;
|
|
@@ -343,7 +343,7 @@ export declare namespace MeController {
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
export type MethodRoute = {
|
|
346
|
-
method:
|
|
346
|
+
method: "get" | "post" | "put" | "patch" | "delete";
|
|
347
347
|
url: string;
|
|
348
348
|
};
|
|
349
349
|
export declare const NotificationSettingsController: {
|
|
@@ -581,7 +581,7 @@ export declare namespace RevisionIssueController {
|
|
|
581
581
|
}
|
|
582
582
|
export type RouteDefinition = {
|
|
583
583
|
url: string;
|
|
584
|
-
method:
|
|
584
|
+
method: "get" | "post" | "put" | "patch" | "delete";
|
|
585
585
|
};
|
|
586
586
|
export type RouteOptions = {
|
|
587
587
|
query?: QueryParams;
|
|
@@ -1,112 +1,333 @@
|
|
|
1
1
|
export const AuthController = {
|
|
2
|
-
login: createActionWithMethods([{ method:
|
|
3
|
-
logout: createActionWithMethods([{ method:
|
|
4
|
-
verifyRegistrationToken: createActionWithMethods([{ method:
|
|
5
|
-
register: createActionWithMethods([{ method:
|
|
6
|
-
forgotPassword: createActionWithMethods([
|
|
7
|
-
|
|
2
|
+
login: createActionWithMethods([{ method: "post", url: "api/v1/login" }]),
|
|
3
|
+
logout: createActionWithMethods([{ method: "post", url: "api/v1/logout" }]),
|
|
4
|
+
verifyRegistrationToken: createActionWithMethods([{ method: "get", url: "api/v1/register/{token}" }]),
|
|
5
|
+
register: createActionWithMethods([{ method: "post", url: "api/v1/register/{token}" }]),
|
|
6
|
+
forgotPassword: createActionWithMethods([
|
|
7
|
+
{ method: "post", url: "api/v1/password/forgot" },
|
|
8
|
+
]),
|
|
9
|
+
resetPassword: createActionWithMethods([{ method: "post", url: "api/v1/password/reset/{token}" }]),
|
|
8
10
|
};
|
|
9
11
|
export const CategoryController = {
|
|
10
|
-
index: createActionWithMethods([
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
index: createActionWithMethods([
|
|
13
|
+
{ method: "get", url: "api/v1/categories" },
|
|
14
|
+
]),
|
|
15
|
+
store: createActionWithMethods([
|
|
16
|
+
{ method: "post", url: "api/v1/categories" },
|
|
17
|
+
]),
|
|
18
|
+
show: createActionWithMethods([{ method: "get", url: "api/v1/categories/{category}" }]),
|
|
19
|
+
update: createActionWithMethods([
|
|
20
|
+
{ method: "put", url: "api/v1/categories/{category}" },
|
|
21
|
+
{ method: "patch", url: "api/v1/categories/{category}" },
|
|
22
|
+
]),
|
|
23
|
+
destroy: createActionWithMethods([{ method: "delete", url: "api/v1/categories/{category}" }]),
|
|
15
24
|
};
|
|
16
25
|
export const ConfigController = {
|
|
17
|
-
config: createActionWithMethods([{ method:
|
|
26
|
+
config: createActionWithMethods([{ method: "get", url: "api/v1/config" }]),
|
|
18
27
|
};
|
|
19
28
|
export const DashboardController = {
|
|
20
|
-
categoryTree: createActionWithMethods([
|
|
21
|
-
|
|
29
|
+
categoryTree: createActionWithMethods([
|
|
30
|
+
{ method: "get", url: "api/v1/dashboard/categories/tree" },
|
|
31
|
+
]),
|
|
32
|
+
facilityList: createActionWithMethods([
|
|
33
|
+
{ method: "get", url: "api/v1/dashboard/facilities/list" },
|
|
34
|
+
]),
|
|
22
35
|
};
|
|
23
36
|
export const DemoRequestController = {
|
|
24
|
-
store: createActionWithMethods([
|
|
25
|
-
|
|
37
|
+
store: createActionWithMethods([
|
|
38
|
+
{ method: "post", url: "api/v1/request-demo" },
|
|
39
|
+
]),
|
|
40
|
+
index: createActionWithMethods([
|
|
41
|
+
{ method: "get", url: "api/v1/system/demo-requests" },
|
|
42
|
+
]),
|
|
26
43
|
};
|
|
27
44
|
export const FacilityController = {
|
|
28
|
-
getMapExtent: createActionWithMethods([
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
getMapExtent: createActionWithMethods([
|
|
46
|
+
{
|
|
47
|
+
method: "get",
|
|
48
|
+
url: "api/v1/facilities/{facility}/maps/{map}/extent",
|
|
49
|
+
},
|
|
50
|
+
]),
|
|
51
|
+
index: createActionWithMethods([{ method: "get", url: "api/v1/categories/{category}/facilities" }]),
|
|
52
|
+
store: createActionWithMethods([{ method: "post", url: "api/v1/categories/{category}/facilities" }]),
|
|
53
|
+
show: createActionWithMethods([
|
|
54
|
+
{
|
|
55
|
+
method: "get",
|
|
56
|
+
url: "api/v1/categories/{category}/facilities/{facility}",
|
|
57
|
+
},
|
|
58
|
+
]),
|
|
59
|
+
update: createActionWithMethods([
|
|
60
|
+
{
|
|
61
|
+
method: "put",
|
|
62
|
+
url: "api/v1/categories/{category}/facilities/{facility}",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
method: "patch",
|
|
66
|
+
url: "api/v1/categories/{category}/facilities/{facility}",
|
|
67
|
+
},
|
|
68
|
+
]),
|
|
69
|
+
destroy: createActionWithMethods([
|
|
70
|
+
{
|
|
71
|
+
method: "delete",
|
|
72
|
+
url: "api/v1/categories/{category}/facilities/{facility}",
|
|
73
|
+
},
|
|
74
|
+
]),
|
|
75
|
+
storePicture: createActionWithMethods([
|
|
76
|
+
{
|
|
77
|
+
method: "post",
|
|
78
|
+
url: "api/v1/categories/{category}/facilities/{facility}/picture",
|
|
79
|
+
},
|
|
80
|
+
]),
|
|
81
|
+
viewPicture: createActionWithMethods([
|
|
82
|
+
{
|
|
83
|
+
method: "get",
|
|
84
|
+
url: "api/v1/categories/{category}/facilities/{facility}/picture",
|
|
85
|
+
},
|
|
86
|
+
]),
|
|
87
|
+
deletePicture: createActionWithMethods([
|
|
88
|
+
{
|
|
89
|
+
method: "delete",
|
|
90
|
+
url: "api/v1/categories/{category}/facilities/{facility}/picture",
|
|
91
|
+
},
|
|
92
|
+
]),
|
|
93
|
+
viewQrCode: createActionWithMethods([
|
|
94
|
+
{
|
|
95
|
+
method: "get",
|
|
96
|
+
url: "api/v1/categories/{category}/facilities/{facility}/qrcode",
|
|
97
|
+
},
|
|
98
|
+
]),
|
|
99
|
+
resolveIssue: createActionWithMethods([
|
|
100
|
+
{
|
|
101
|
+
method: "post",
|
|
102
|
+
url: "api/v1/categories/{category}/facilities/{facility}/issues/{issue}/resolve",
|
|
103
|
+
},
|
|
104
|
+
]),
|
|
39
105
|
};
|
|
40
106
|
export const FacilityDocumentController = {
|
|
41
|
-
index: createActionWithMethods([
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
107
|
+
index: createActionWithMethods([
|
|
108
|
+
{
|
|
109
|
+
method: "get",
|
|
110
|
+
url: "api/v1/categories/{category}/facilities/{facility}/documents",
|
|
111
|
+
},
|
|
112
|
+
]),
|
|
113
|
+
store: createActionWithMethods([
|
|
114
|
+
{
|
|
115
|
+
method: "post",
|
|
116
|
+
url: "api/v1/categories/{category}/facilities/{facility}/documents",
|
|
117
|
+
},
|
|
118
|
+
]),
|
|
119
|
+
destroy: createActionWithMethods([
|
|
120
|
+
{
|
|
121
|
+
method: "delete",
|
|
122
|
+
url: "api/v1/categories/{category}/facilities/{facility}/documents/{document}",
|
|
123
|
+
},
|
|
124
|
+
]),
|
|
125
|
+
update: createActionWithMethods([
|
|
126
|
+
{
|
|
127
|
+
method: "post",
|
|
128
|
+
url: "api/v1/categories/{category}/facilities/{facility}/documents/{document}",
|
|
129
|
+
},
|
|
130
|
+
]),
|
|
131
|
+
download: createActionWithMethods([
|
|
132
|
+
{
|
|
133
|
+
method: "get",
|
|
134
|
+
url: "api/v1/categories/{category}/facilities/{facility}/documents/{document}/download",
|
|
135
|
+
},
|
|
136
|
+
]),
|
|
46
137
|
};
|
|
47
138
|
export const FrontendErrorController = {
|
|
48
|
-
logError: createActionWithMethods([
|
|
139
|
+
logError: createActionWithMethods([
|
|
140
|
+
{ method: "post", url: "api/v1/frontend-error" },
|
|
141
|
+
]),
|
|
49
142
|
};
|
|
50
143
|
export const FrontendRouteController = {
|
|
51
|
-
redirect: createActionWithMethods([
|
|
144
|
+
redirect: createActionWithMethods([
|
|
145
|
+
{ method: "get", url: "api/v1/frontend-route" },
|
|
146
|
+
]),
|
|
52
147
|
};
|
|
53
148
|
export const MapController = {
|
|
54
|
-
index: createActionWithMethods([{ method:
|
|
55
|
-
getTile: createActionWithMethods([
|
|
149
|
+
index: createActionWithMethods([{ method: "get", url: "api/v1/categories/{category}/maps" }]),
|
|
150
|
+
getTile: createActionWithMethods([
|
|
151
|
+
{
|
|
152
|
+
method: "get",
|
|
153
|
+
url: "api/v1/categories/{category}/maps/{map}/tile/{x}/{y}/{z}",
|
|
154
|
+
},
|
|
155
|
+
]),
|
|
56
156
|
};
|
|
57
157
|
export const MeController = {
|
|
58
|
-
me: createActionWithMethods([{ method:
|
|
59
|
-
update: createActionWithMethods([{ method:
|
|
60
|
-
tutorial: createActionWithMethods([
|
|
61
|
-
|
|
62
|
-
|
|
158
|
+
me: createActionWithMethods([{ method: "get", url: "api/v1/me" }]),
|
|
159
|
+
update: createActionWithMethods([{ method: "put", url: "api/v1/me" }]),
|
|
160
|
+
tutorial: createActionWithMethods([
|
|
161
|
+
{ method: "put", url: "api/v1/me/tutorial" },
|
|
162
|
+
]),
|
|
163
|
+
changePassword: createActionWithMethods([
|
|
164
|
+
{ method: "post", url: "api/v1/me/change-password" },
|
|
165
|
+
]),
|
|
166
|
+
updateSettings: createActionWithMethods([
|
|
167
|
+
{ method: "put", url: "api/v1/me/settings" },
|
|
168
|
+
]),
|
|
63
169
|
};
|
|
64
170
|
export const NotificationSettingsController = {
|
|
65
|
-
show: createActionWithMethods([
|
|
66
|
-
|
|
171
|
+
show: createActionWithMethods([
|
|
172
|
+
{ method: "get", url: "api/v1/me/notification-settings" },
|
|
173
|
+
]),
|
|
174
|
+
update: createActionWithMethods([
|
|
175
|
+
{ method: "put", url: "api/v1/me/notification-settings" },
|
|
176
|
+
]),
|
|
67
177
|
};
|
|
68
178
|
export const OrganizationController = {
|
|
69
|
-
index: createActionWithMethods([
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
179
|
+
index: createActionWithMethods([
|
|
180
|
+
{ method: "get", url: "api/v1/organizations" },
|
|
181
|
+
]),
|
|
182
|
+
show: createActionWithMethods([{ method: "get", url: "api/v1/organizations/{organization}" }]),
|
|
183
|
+
update: createActionWithMethods([{ method: "put", url: "api/v1/organizations/{organization}" }]),
|
|
184
|
+
getSubscriptions: createActionWithMethods([
|
|
185
|
+
{
|
|
186
|
+
method: "get",
|
|
187
|
+
url: "api/v1/organizations/{organization}/subscriptions",
|
|
188
|
+
},
|
|
189
|
+
]),
|
|
73
190
|
};
|
|
74
191
|
export const PermissionController = {
|
|
75
|
-
show: createActionWithMethods([
|
|
76
|
-
|
|
192
|
+
show: createActionWithMethods([
|
|
193
|
+
{
|
|
194
|
+
method: "get",
|
|
195
|
+
url: "api/v1/organizations/{organization}/users/{user}/permissions",
|
|
196
|
+
},
|
|
197
|
+
]),
|
|
198
|
+
update: createActionWithMethods([
|
|
199
|
+
{
|
|
200
|
+
method: "put",
|
|
201
|
+
url: "api/v1/organizations/{organization}/users/{user}/permissions",
|
|
202
|
+
},
|
|
203
|
+
]),
|
|
77
204
|
};
|
|
78
205
|
export const RelatedFacilityController = {
|
|
79
|
-
options: createActionWithMethods([
|
|
80
|
-
|
|
81
|
-
|
|
206
|
+
options: createActionWithMethods([
|
|
207
|
+
{
|
|
208
|
+
method: "get",
|
|
209
|
+
url: "api/v1/categories/{category}/facilities/{facility}/related/options",
|
|
210
|
+
},
|
|
211
|
+
]),
|
|
212
|
+
store: createActionWithMethods([
|
|
213
|
+
{
|
|
214
|
+
method: "post",
|
|
215
|
+
url: "api/v1/categories/{category}/facilities/{facility}/related",
|
|
216
|
+
},
|
|
217
|
+
]),
|
|
218
|
+
destroy: createActionWithMethods([
|
|
219
|
+
{
|
|
220
|
+
method: "delete",
|
|
221
|
+
url: "api/v1/categories/{category}/facilities/{facility}/related/{relatedFacility}",
|
|
222
|
+
},
|
|
223
|
+
]),
|
|
82
224
|
};
|
|
83
225
|
export const RevisionController = {
|
|
84
|
-
index: createActionWithMethods([
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
226
|
+
index: createActionWithMethods([
|
|
227
|
+
{
|
|
228
|
+
method: "get",
|
|
229
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions",
|
|
230
|
+
},
|
|
231
|
+
]),
|
|
232
|
+
store: createActionWithMethods([
|
|
233
|
+
{
|
|
234
|
+
method: "post",
|
|
235
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions",
|
|
236
|
+
},
|
|
237
|
+
]),
|
|
238
|
+
show: createActionWithMethods([
|
|
239
|
+
{
|
|
240
|
+
method: "get",
|
|
241
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
242
|
+
},
|
|
243
|
+
]),
|
|
244
|
+
update: createActionWithMethods([
|
|
245
|
+
{
|
|
246
|
+
method: "put",
|
|
247
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
method: "patch",
|
|
251
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
252
|
+
},
|
|
253
|
+
]),
|
|
254
|
+
destroy: createActionWithMethods([
|
|
255
|
+
{
|
|
256
|
+
method: "delete",
|
|
257
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
258
|
+
},
|
|
259
|
+
]),
|
|
89
260
|
};
|
|
90
261
|
export const RevisionDocumentController = {
|
|
91
|
-
index: createActionWithMethods([
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
262
|
+
index: createActionWithMethods([
|
|
263
|
+
{
|
|
264
|
+
method: "get",
|
|
265
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents",
|
|
266
|
+
},
|
|
267
|
+
]),
|
|
268
|
+
store: createActionWithMethods([
|
|
269
|
+
{
|
|
270
|
+
method: "post",
|
|
271
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents",
|
|
272
|
+
},
|
|
273
|
+
]),
|
|
274
|
+
destroy: createActionWithMethods([
|
|
275
|
+
{
|
|
276
|
+
method: "delete",
|
|
277
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}",
|
|
278
|
+
},
|
|
279
|
+
]),
|
|
280
|
+
update: createActionWithMethods([
|
|
281
|
+
{
|
|
282
|
+
method: "post",
|
|
283
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}",
|
|
284
|
+
},
|
|
285
|
+
]),
|
|
286
|
+
download: createActionWithMethods([
|
|
287
|
+
{
|
|
288
|
+
method: "get",
|
|
289
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}/download",
|
|
290
|
+
},
|
|
291
|
+
]),
|
|
96
292
|
};
|
|
97
293
|
export const RevisionIssueController = {
|
|
98
|
-
getForCategory: createActionWithMethods([{ method:
|
|
99
|
-
index: createActionWithMethods([
|
|
100
|
-
|
|
101
|
-
|
|
294
|
+
getForCategory: createActionWithMethods([{ method: "get", url: "api/v1/categories/{category}/issues" }]),
|
|
295
|
+
index: createActionWithMethods([
|
|
296
|
+
{
|
|
297
|
+
method: "get",
|
|
298
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues",
|
|
299
|
+
},
|
|
300
|
+
]),
|
|
301
|
+
show: createActionWithMethods([
|
|
302
|
+
{
|
|
303
|
+
method: "get",
|
|
304
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues/{issue}",
|
|
305
|
+
},
|
|
306
|
+
]),
|
|
307
|
+
destroy: createActionWithMethods([
|
|
308
|
+
{
|
|
309
|
+
method: "delete",
|
|
310
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues/{issue}",
|
|
311
|
+
},
|
|
312
|
+
]),
|
|
102
313
|
};
|
|
103
314
|
export const SearchController = {
|
|
104
|
-
search: createActionWithMethods([{ method:
|
|
315
|
+
search: createActionWithMethods([{ method: "get", url: "api/v1/search" }]),
|
|
105
316
|
};
|
|
106
317
|
export const UserController = {
|
|
107
|
-
organizationUsers: createActionWithMethods([{ method:
|
|
108
|
-
invite: createActionWithMethods([
|
|
109
|
-
|
|
318
|
+
organizationUsers: createActionWithMethods([{ method: "get", url: "api/v1/organizations/{organization}/users" }]),
|
|
319
|
+
invite: createActionWithMethods([
|
|
320
|
+
{
|
|
321
|
+
method: "post",
|
|
322
|
+
url: "api/v1/organizations/{organization}/users/invite",
|
|
323
|
+
},
|
|
324
|
+
]),
|
|
325
|
+
destroy: createActionWithMethods([
|
|
326
|
+
{
|
|
327
|
+
method: "delete",
|
|
328
|
+
url: "api/v1/organizations/{organization}/users/{user}",
|
|
329
|
+
},
|
|
330
|
+
]),
|
|
110
331
|
};
|
|
111
332
|
export function buildUrl(path, params, options) {
|
|
112
333
|
let url = path;
|
|
@@ -130,19 +351,21 @@ export function buildUrl(path, params, options) {
|
|
|
130
351
|
}
|
|
131
352
|
const queryString = searchParams.toString();
|
|
132
353
|
if (queryString) {
|
|
133
|
-
url +=
|
|
354
|
+
url += "?" + queryString;
|
|
134
355
|
}
|
|
135
356
|
}
|
|
136
|
-
return (typeof baseUrl !==
|
|
357
|
+
return (typeof baseUrl !== "undefined" ? baseUrl : "") + "/" + url;
|
|
137
358
|
}
|
|
138
359
|
export function createActionWithMethods(routes) {
|
|
139
360
|
const defaultRoute = routes[0];
|
|
140
361
|
const createFn = (route) => {
|
|
141
362
|
return ((...args) => {
|
|
142
|
-
const params = args[0] && typeof args[0] ===
|
|
363
|
+
const params = args[0] && typeof args[0] === "object" && !("query" in args[0])
|
|
143
364
|
? args[0]
|
|
144
365
|
: undefined;
|
|
145
|
-
const options = params
|
|
366
|
+
const options = params
|
|
367
|
+
? args[1]
|
|
368
|
+
: args[0];
|
|
146
369
|
const url = buildUrl(route.url, params, options);
|
|
147
370
|
return {
|
|
148
371
|
url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reviza/api-client",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-SNAPSHOT-b1d8a2de",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "tsc"
|
|
19
19
|
},
|
|
20
|
+
"author": "WD Slovensko s.r.o.",
|
|
20
21
|
"license": "ISC",
|
|
21
22
|
"private": false,
|
|
22
23
|
"dependencies": {
|
|
@@ -24,6 +25,5 @@
|
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"typescript": "^6.0.3"
|
|
27
|
-
}
|
|
28
|
-
"author": "WD Slovensko s.r.o."
|
|
28
|
+
}
|
|
29
29
|
}
|
package/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Typescript
|
package/dist/Carbon/index.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export type CarbonImmutable = Date;
|
|
2
|
-
export declare enum Month {
|
|
3
|
-
January = 1,
|
|
4
|
-
February = 2,
|
|
5
|
-
March = 3,
|
|
6
|
-
April = 4,
|
|
7
|
-
May = 5,
|
|
8
|
-
June = 6,
|
|
9
|
-
July = 7,
|
|
10
|
-
August = 8,
|
|
11
|
-
September = 9,
|
|
12
|
-
October = 10,
|
|
13
|
-
November = 11,
|
|
14
|
-
December = 12
|
|
15
|
-
}
|
|
16
|
-
export declare enum OverflowMode {
|
|
17
|
-
AnchorDay = 0,
|
|
18
|
-
NoOverflow = 1,
|
|
19
|
-
Overflow = 2
|
|
20
|
-
}
|
|
21
|
-
export declare enum Unit {
|
|
22
|
-
Microsecond = "microsecond",
|
|
23
|
-
Millisecond = "millisecond",
|
|
24
|
-
Second = "second",
|
|
25
|
-
Minute = "minute",
|
|
26
|
-
Hour = "hour",
|
|
27
|
-
Day = "day",
|
|
28
|
-
Week = "week",
|
|
29
|
-
Month = "month",
|
|
30
|
-
Quarter = "quarter",
|
|
31
|
-
Year = "year",
|
|
32
|
-
Decade = "decade",
|
|
33
|
-
Century = "century",
|
|
34
|
-
Millennium = "millennium"
|
|
35
|
-
}
|
|
36
|
-
export declare enum WeekDay {
|
|
37
|
-
Sunday = 0,
|
|
38
|
-
Monday = 1,
|
|
39
|
-
Tuesday = 2,
|
|
40
|
-
Wednesday = 3,
|
|
41
|
-
Thursday = 4,
|
|
42
|
-
Friday = 5,
|
|
43
|
-
Saturday = 6
|
|
44
|
-
}
|
package/dist/Carbon/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export var Month;
|
|
2
|
-
(function (Month) {
|
|
3
|
-
Month[Month["January"] = 1] = "January";
|
|
4
|
-
Month[Month["February"] = 2] = "February";
|
|
5
|
-
Month[Month["March"] = 3] = "March";
|
|
6
|
-
Month[Month["April"] = 4] = "April";
|
|
7
|
-
Month[Month["May"] = 5] = "May";
|
|
8
|
-
Month[Month["June"] = 6] = "June";
|
|
9
|
-
Month[Month["July"] = 7] = "July";
|
|
10
|
-
Month[Month["August"] = 8] = "August";
|
|
11
|
-
Month[Month["September"] = 9] = "September";
|
|
12
|
-
Month[Month["October"] = 10] = "October";
|
|
13
|
-
Month[Month["November"] = 11] = "November";
|
|
14
|
-
Month[Month["December"] = 12] = "December";
|
|
15
|
-
})(Month || (Month = {}));
|
|
16
|
-
export var OverflowMode;
|
|
17
|
-
(function (OverflowMode) {
|
|
18
|
-
OverflowMode[OverflowMode["AnchorDay"] = 0] = "AnchorDay";
|
|
19
|
-
OverflowMode[OverflowMode["NoOverflow"] = 1] = "NoOverflow";
|
|
20
|
-
OverflowMode[OverflowMode["Overflow"] = 2] = "Overflow";
|
|
21
|
-
})(OverflowMode || (OverflowMode = {}));
|
|
22
|
-
export var Unit;
|
|
23
|
-
(function (Unit) {
|
|
24
|
-
Unit["Microsecond"] = "microsecond";
|
|
25
|
-
Unit["Millisecond"] = "millisecond";
|
|
26
|
-
Unit["Second"] = "second";
|
|
27
|
-
Unit["Minute"] = "minute";
|
|
28
|
-
Unit["Hour"] = "hour";
|
|
29
|
-
Unit["Day"] = "day";
|
|
30
|
-
Unit["Week"] = "week";
|
|
31
|
-
Unit["Month"] = "month";
|
|
32
|
-
Unit["Quarter"] = "quarter";
|
|
33
|
-
Unit["Year"] = "year";
|
|
34
|
-
Unit["Decade"] = "decade";
|
|
35
|
-
Unit["Century"] = "century";
|
|
36
|
-
Unit["Millennium"] = "millennium";
|
|
37
|
-
})(Unit || (Unit = {}));
|
|
38
|
-
export var WeekDay;
|
|
39
|
-
(function (WeekDay) {
|
|
40
|
-
WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
|
|
41
|
-
WeekDay[WeekDay["Monday"] = 1] = "Monday";
|
|
42
|
-
WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
|
|
43
|
-
WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
|
|
44
|
-
WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
|
|
45
|
-
WeekDay[WeekDay["Friday"] = 5] = "Friday";
|
|
46
|
-
WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
|
|
47
|
-
})(WeekDay || (WeekDay = {}));
|