@reviza/api-client 1.2.0-SNAPSHOT-ab6869d0 → 1.2.0-SNAPSHOT-254b6ab7

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.
@@ -116,6 +116,22 @@ export type RevisionIssueData = {
116
116
  updated_at: string;
117
117
  deleted_at: string | null;
118
118
  };
119
+ /**
120
+ * Includes:
121
+ * - issues
122
+ */
123
+ export type RevisionIssueGroupData = {
124
+ group_key: string | null;
125
+ group_number: number | null;
126
+ number: number;
127
+ state: RevisionIssueStateEnum;
128
+ description: string;
129
+ note: string | null;
130
+ resolve_deadline: string | null;
131
+ resolved_date: string | null;
132
+ resolved_note: string | null;
133
+ issues: RevisionIssueData[];
134
+ };
119
135
  export type RevisionIssueGroupFacilityData = {
120
136
  facility_id: number;
121
137
  name: string;
@@ -0,0 +1,91 @@
1
+ import { RevizaResponseData } from "../../App/Data";
2
+ import { DataCollection } from "../../Spatie/LaravelData";
3
+ import { CategoryTreeData, FacilityTreeRequestPayload, FacilityTreeData } from "../../App/Data/Frontend";
4
+ import { FrontendRouteRedirectRequest, FrontendRouteRedirectData } from "../../App/Data/FrontendRoute";
5
+ import { UserUiSettingsData, UserUiSettingsUpdatePayload } from "../../App/Data/Ui";
6
+ export declare const FrontendController: {
7
+ readonly categoryTree: ((options?: import("../").RouteOptions) => import("../").RouteDefinition & {
8
+ url: string;
9
+ }) & {
10
+ [x: string]: (options?: import("../").RouteOptions) => import("../").RouteDefinition & {
11
+ url: string;
12
+ };
13
+ };
14
+ readonly facilityTree: ((params: {
15
+ category: string | number;
16
+ }, options?: import("../").RouteOptions) => import("../").RouteDefinition & {
17
+ url: string;
18
+ }) & {
19
+ [x: string]: (params: {
20
+ category: string | number;
21
+ }, options?: import("../").RouteOptions) => import("../").RouteDefinition & {
22
+ url: string;
23
+ };
24
+ };
25
+ };
26
+ export declare namespace FrontendController {
27
+ namespace categoryTree {
28
+ type Request = object;
29
+ type Response = RevizaResponseData<DataCollection<number, CategoryTreeData>>;
30
+ }
31
+ namespace facilityTree {
32
+ type Request = FacilityTreeRequestPayload;
33
+ type Response = RevizaResponseData<DataCollection<number, FacilityTreeData>>;
34
+ }
35
+ }
36
+ export declare const FrontendErrorController: {
37
+ readonly logError: ((options?: import("../").RouteOptions) => import("../").RouteDefinition & {
38
+ url: string;
39
+ }) & {
40
+ [x: string]: (options?: import("../").RouteOptions) => import("../").RouteDefinition & {
41
+ url: string;
42
+ };
43
+ };
44
+ };
45
+ export declare namespace FrontendErrorController {
46
+ namespace logError {
47
+ type Request = object;
48
+ type Response = RevizaResponseData<null>;
49
+ }
50
+ }
51
+ export declare const FrontendRouteController: {
52
+ readonly redirect: ((options?: import("../").RouteOptions) => import("../").RouteDefinition & {
53
+ url: string;
54
+ }) & {
55
+ [x: string]: (options?: import("../").RouteOptions) => import("../").RouteDefinition & {
56
+ url: string;
57
+ };
58
+ };
59
+ };
60
+ export declare namespace FrontendRouteController {
61
+ namespace redirect {
62
+ type Request = FrontendRouteRedirectRequest;
63
+ type Response = RevizaResponseData<FrontendRouteRedirectData | null>;
64
+ }
65
+ }
66
+ export declare const FrontendSettingsController: {
67
+ readonly show: ((options?: import("../").RouteOptions) => import("../").RouteDefinition & {
68
+ url: string;
69
+ }) & {
70
+ [x: string]: (options?: import("../").RouteOptions) => import("../").RouteDefinition & {
71
+ url: string;
72
+ };
73
+ };
74
+ readonly update: ((options?: import("../").RouteOptions) => import("../").RouteDefinition & {
75
+ url: string;
76
+ }) & {
77
+ [x: string]: (options?: import("../").RouteOptions) => import("../").RouteDefinition & {
78
+ url: string;
79
+ };
80
+ };
81
+ };
82
+ export declare namespace FrontendSettingsController {
83
+ namespace show {
84
+ type Request = object;
85
+ type Response = RevizaResponseData<UserUiSettingsData>;
86
+ }
87
+ namespace update {
88
+ type Request = UserUiSettingsUpdatePayload;
89
+ type Response = RevizaResponseData<UserUiSettingsData>;
90
+ }
91
+ }
@@ -0,0 +1,30 @@
1
+ import { createActionWithMethods } from "../";
2
+ export const FrontendController = {
3
+ categoryTree: createActionWithMethods([
4
+ { method: "get", url: "api/v1/frontend/categories/tree" },
5
+ ]),
6
+ facilityTree: createActionWithMethods([
7
+ {
8
+ method: "get",
9
+ url: "api/v1/frontend/categories/{category}/facilities/tree",
10
+ },
11
+ ]),
12
+ };
13
+ export const FrontendErrorController = {
14
+ logError: createActionWithMethods([
15
+ { method: "post", url: "api/v1/frontend/error" },
16
+ ]),
17
+ };
18
+ export const FrontendRouteController = {
19
+ redirect: createActionWithMethods([
20
+ { method: "get", url: "api/v1/frontend/route" },
21
+ ]),
22
+ };
23
+ export const FrontendSettingsController = {
24
+ show: createActionWithMethods([
25
+ { method: "get", url: "api/v1/frontend/ui-settings/tables" },
26
+ ]),
27
+ update: createActionWithMethods([
28
+ { method: "put", url: "api/v1/frontend/ui-settings/tables" },
29
+ ]),
30
+ };
@@ -9,17 +9,14 @@ import { FacilityData, FacilityCreatePayload, FacilityUpdatePayload, RelatedFaci
9
9
  import { StreamedResponse } from "../Symfony/Component/HttpFoundation";
10
10
  import { DocumentData, DocumentCreatePayload, DocumentUpdatePayload } from "../App/Data/Document";
11
11
  import { PicturePayload } from "../App/Data/Picture";
12
- import { CategoryTreeData, FacilityTreeRequestPayload, FacilityTreeData } from "../App/Data/Frontend";
13
- import { FrontendRouteRedirectRequest, FrontendRouteRedirectData } from "../App/Data/FrontendRoute";
14
12
  import { MeData, MeUpdatePayload } from "../App/Data/Me";
15
13
  import { UserSettingsPayload, UserData } from "../App/Data/User";
16
14
  import { NotificationSettingsData, NotificationSettingsPayload } from "../App/Data/Notification";
17
15
  import { OrganizationData, OrganizationUpdatePayload } from "../App/Data/Organization";
18
16
  import { SubscriptionData } from "../App/Data/Subscription";
19
17
  import { UserPermissionData, UserPermissionPayload } from "../App/Data/Permission";
20
- import { RevisionCreatePayload, RevisionData, RevisionUpdatePayload, RevisionIssueData, FacilityIssueResolvePayload } from "../App/Data/Revision";
18
+ import { RevisionCreatePayload, RevisionData, RevisionUpdatePayload, RevisionIssueGroupData, FacilityIssueResolvePayload, RevisionIssueData } from "../App/Data/Revision";
21
19
  import { SearchData } from "../App/Data/Search";
22
- import { UserUiSettingsData, UserUiSettingsUpdatePayload } from "../App/Data/Ui";
23
20
  type ActionFunction<P extends RouteParams | undefined> = P extends undefined ? (options?: RouteOptions) => ActionResult : (params: P, options?: RouteOptions) => ActionResult;
24
21
  type ActionResult = RouteDefinition & {
25
22
  url: string;
@@ -260,40 +257,6 @@ export declare namespace FacilityPictureController {
260
257
  type Response = RevizaResponseData<null>;
261
258
  }
262
259
  }
263
- export declare const FrontendController: {
264
- readonly categoryTree: ActionWithMethods<undefined, string>;
265
- readonly facilityTree: ActionWithMethods<{
266
- category: string | number;
267
- }, string>;
268
- };
269
- export declare namespace FrontendController {
270
- namespace categoryTree {
271
- type Request = object;
272
- type Response = RevizaResponseData<DataCollection<number, CategoryTreeData>>;
273
- }
274
- namespace facilityTree {
275
- type Request = FacilityTreeRequestPayload;
276
- type Response = RevizaResponseData<DataCollection<number, FacilityTreeData>>;
277
- }
278
- }
279
- export declare const FrontendErrorController: {
280
- readonly logError: ActionWithMethods<undefined, string>;
281
- };
282
- export declare namespace FrontendErrorController {
283
- namespace logError {
284
- type Request = object;
285
- type Response = RevizaResponseData<null>;
286
- }
287
- }
288
- export declare const FrontendRouteController: {
289
- readonly redirect: ActionWithMethods<undefined, string>;
290
- };
291
- export declare namespace FrontendRouteController {
292
- namespace redirect {
293
- type Request = FrontendRouteRedirectRequest;
294
- type Response = RevizaResponseData<FrontendRouteRedirectData | null>;
295
- }
296
- }
297
260
  export declare const MapController: {
298
261
  readonly index: ActionWithMethods<{
299
262
  category: string | number;
@@ -551,7 +514,7 @@ export declare const RevisionIssueController: {
551
514
  export declare namespace RevisionIssueController {
552
515
  namespace getForCategory {
553
516
  type Request = object;
554
- type Response = RevizaResponseData<DataCollection<number, RevisionIssueData> | null>;
517
+ type Response = RevizaResponseData<DataCollection<number, RevisionIssueGroupData> | null>;
555
518
  }
556
519
  namespace resolveIssue {
557
520
  type Request = FacilityIssueResolvePayload;
@@ -587,20 +550,6 @@ export declare namespace SearchController {
587
550
  type Response = RevizaResponseData<DataCollection<number, SearchData>>;
588
551
  }
589
552
  }
590
- export declare const UiSettingsController: {
591
- readonly show: ActionWithMethods<undefined, string>;
592
- readonly update: ActionWithMethods<undefined, string>;
593
- };
594
- export declare namespace UiSettingsController {
595
- namespace show {
596
- type Request = object;
597
- type Response = RevizaResponseData<UserUiSettingsData>;
598
- }
599
- namespace update {
600
- type Request = UserUiSettingsUpdatePayload;
601
- type Response = RevizaResponseData<UserUiSettingsData>;
602
- }
603
- }
604
553
  export declare const UserController: {
605
554
  readonly organizationUsers: ActionWithMethods<{
606
555
  organization: string | number;
@@ -123,27 +123,6 @@ export const FacilityPictureController = {
123
123
  },
124
124
  ]),
125
125
  };
126
- export const FrontendController = {
127
- categoryTree: createActionWithMethods([
128
- { method: "get", url: "api/v1/frontend/categories/tree" },
129
- ]),
130
- facilityTree: createActionWithMethods([
131
- {
132
- method: "get",
133
- url: "api/v1/frontend/categories/{category}/facilities/tree",
134
- },
135
- ]),
136
- };
137
- export const FrontendErrorController = {
138
- logError: createActionWithMethods([
139
- { method: "post", url: "api/v1/frontend-error" },
140
- ]),
141
- };
142
- export const FrontendRouteController = {
143
- redirect: createActionWithMethods([
144
- { method: "get", url: "api/v1/frontend-route" },
145
- ]),
146
- };
147
126
  export const MapController = {
148
127
  index: createActionWithMethods([{ method: "get", url: "api/v1/categories/{category}/maps" }]),
149
128
  getTile: createActionWithMethods([
@@ -308,14 +287,6 @@ export const RevisionIssueController = {
308
287
  export const SearchController = {
309
288
  search: createActionWithMethods([{ method: "get", url: "api/v1/search" }]),
310
289
  };
311
- export const UiSettingsController = {
312
- show: createActionWithMethods([
313
- { method: "get", url: "api/v1/me/ui-settings/tables" },
314
- ]),
315
- update: createActionWithMethods([
316
- { method: "put", url: "api/v1/me/ui-settings/tables" },
317
- ]),
318
- };
319
290
  export const UserController = {
320
291
  organizationUsers: createActionWithMethods([{ method: "get", url: "api/v1/organizations/{organization}/users" }]),
321
292
  invite: createActionWithMethods([
package/dist/index.d.ts CHANGED
@@ -2,8 +2,9 @@
2
2
  * Typed API client — wraps generated controller actions with axios.
3
3
  */
4
4
  import { type AxiosInstance, type AxiosRequestConfig } from "axios";
5
- import { AuthController, CategoryController, ConfigController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, FrontendController, FrontendErrorController, FrontendRouteController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UiSettingsController, UserController } from "./controllers";
5
+ import { AuthController, CategoryController, ConfigController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UserController } from "./controllers";
6
6
  import { ActionLogController, MapController as SystemMapController, NotificationController, OrganizationController as SystemOrganizationController, PermissionController as SystemPermissionController, UserController as SystemUserController } from "./controllers/System/index.js";
7
+ import { FrontendController, FrontendErrorController, FrontendRouteController, FrontendSettingsController } from "./controllers/Frontend";
7
8
  /**
8
9
  * Convert a typed payload that contains `File` / `Blob` fields into a
9
10
  * `FormData` object ready for multipart upload.
@@ -30,13 +31,17 @@ export declare class ValidationError<T> extends ApiError {
30
31
  constructor(message: string, errors: Partial<Record<keyof T, string>>);
31
32
  }
32
33
  export declare function createRevizaApi(http?: AxiosInstance): {
33
- frontendError(data: any, config?: AxiosRequestConfig): Promise<FrontendErrorController.logError.Response>;
34
34
  config(config?: AxiosRequestConfig): Promise<ConfigController.config.Response>;
35
35
  frontendRoute(config?: AxiosRequestConfig): Promise<FrontendRouteController.redirect.Response>;
36
36
  search(config?: AxiosRequestConfig): Promise<SearchController.search.Response>;
37
37
  frontend: {
38
+ error(data: any, config?: AxiosRequestConfig): Promise<FrontendErrorController.logError.Response>;
38
39
  categoryTree(config?: AxiosRequestConfig): Promise<FrontendController.categoryTree.Response>;
39
40
  facilityTree(category: number, data: FrontendController.facilityTree.Request, config?: AxiosRequestConfig): Promise<FrontendController.facilityTree.Response>;
41
+ settings: {
42
+ show(config?: AxiosRequestConfig): Promise<FrontendSettingsController.show.Response>;
43
+ update(data: FrontendSettingsController.update.Request, config?: AxiosRequestConfig): Promise<FrontendSettingsController.update.Response>;
44
+ };
40
45
  };
41
46
  demo: {
42
47
  index(config?: AxiosRequestConfig): Promise<DemoRequestController.index.Response>;
@@ -56,10 +61,6 @@ export declare function createRevizaApi(http?: AxiosInstance): {
56
61
  changePassword(data: MeController.changePassword.Request, config?: AxiosRequestConfig): Promise<MeController.changePassword.Response>;
57
62
  updateSettings(data: MeController.updateSettings.Request, config?: AxiosRequestConfig): Promise<MeController.updateSettings.Response>;
58
63
  tutorial(config?: AxiosRequestConfig): Promise<MeController.tutorial.Response>;
59
- uiSettings: {
60
- show(config?: AxiosRequestConfig): Promise<UiSettingsController.show.Response>;
61
- update(data: UiSettingsController.update.Request, config?: AxiosRequestConfig): Promise<UiSettingsController.update.Response>;
62
- };
63
64
  };
64
65
  notificationSettings: {
65
66
  show(config?: AxiosRequestConfig): Promise<NotificationSettingsController.show.Response>;
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
  * Typed API client — wraps generated controller actions with axios.
3
3
  */
4
4
  import axios, { isAxiosError } from "axios";
5
- import { AuthController, CategoryController, ConfigController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, FrontendController, FrontendErrorController, FrontendRouteController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UiSettingsController, UserController, } from "./controllers";
5
+ import { AuthController, CategoryController, ConfigController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UserController, } from "./controllers";
6
6
  import { ActionLogController, MapController as SystemMapController, NotificationController, OrganizationController as SystemOrganizationController, PermissionController as SystemPermissionController, UserController as SystemUserController, } from "./controllers/System/index.js";
7
+ import { FrontendController, FrontendErrorController, FrontendRouteController, FrontendSettingsController, } from "./controllers/Frontend";
7
8
  // ── helpers ───────────────────────────────────────────────────────────────────
8
9
  /**
9
10
  * Convert a typed payload that contains `File` / `Blob` fields into a
@@ -93,9 +94,6 @@ function makeRequest(http) {
93
94
  export function createRevizaApi(http = axios) {
94
95
  const request = makeRequest(http);
95
96
  return {
96
- frontendError(data, config) {
97
- return request(FrontendErrorController.logError(), data, config);
98
- },
99
97
  config(config) {
100
98
  return request(ConfigController.config(), undefined, config);
101
99
  },
@@ -106,11 +104,22 @@ export function createRevizaApi(http = axios) {
106
104
  return request(SearchController.search(), undefined, config);
107
105
  },
108
106
  frontend: {
107
+ error(data, config) {
108
+ return request(FrontendErrorController.logError(), data, config);
109
+ },
109
110
  categoryTree(config) {
110
111
  return request(FrontendController.categoryTree(), undefined, config);
111
112
  },
112
113
  facilityTree(category, data, config) {
113
114
  return request(FrontendController.facilityTree({ category }), data, config);
115
+ },
116
+ settings: {
117
+ show(config) {
118
+ return request(FrontendSettingsController.show(), undefined, config);
119
+ },
120
+ update(data, config) {
121
+ return request(FrontendSettingsController.update(), data, config);
122
+ }
114
123
  }
115
124
  },
116
125
  demo: {
@@ -156,14 +165,6 @@ export function createRevizaApi(http = axios) {
156
165
  },
157
166
  tutorial(config) {
158
167
  return request(MeController.tutorial(), undefined, config);
159
- },
160
- uiSettings: {
161
- show(config) {
162
- return request(UiSettingsController.show(), config);
163
- },
164
- update(data, config) {
165
- return request(UiSettingsController.update(), data, config);
166
- }
167
168
  }
168
169
  },
169
170
  notificationSettings: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reviza/api-client",
3
- "version": "1.2.0-SNAPSHOT-ab6869d0",
3
+ "version": "1.2.0-SNAPSHOT-254b6ab7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",