@reviza/api-client 1.0.0-SNAPSHOT-43ce7889 → 1.0.0-SNAPSHOT-e2dc8703
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/controllers/index.d.ts +31 -27
- package/dist/controllers/index.js +20 -18
- package/dist/index.d.ts +6 -4
- package/dist/index.js +12 -10
- package/package.json +1 -1
|
@@ -6,9 +6,9 @@ import { ConfigData } from "../App/Data/Config";
|
|
|
6
6
|
import { FacilityListData, FacilityData, FacilityCreatePayload, FacilityUpdatePayload, FacilityIssueResolvedPayload, RelatedFacilityCreatePayload } from "../App/Data/Facility";
|
|
7
7
|
import { DemoRequestCreatePayload, DemoRequestData } from "../App/Data/Demo";
|
|
8
8
|
import { MapExtentData, MapData } from "../App/Data/Map";
|
|
9
|
-
import { PicturePayload } from "../App/Data/Picture";
|
|
10
9
|
import { StreamedResponse } from "../Symfony/Component/HttpFoundation";
|
|
11
10
|
import { DocumentData, DocumentCreatePayload, DocumentUpdatePayload } from "../App/Data/Document";
|
|
11
|
+
import { PicturePayload } from "../App/Data/Picture";
|
|
12
12
|
import { FrontendRouteRedirectRequest, FrontendRouteRedirectData } from "../App/Data/FrontendRoute";
|
|
13
13
|
import { MeData, MeUpdatePayload } from "../App/Data/Me";
|
|
14
14
|
import { UserSettingsPayload, UserData } from "../App/Data/User";
|
|
@@ -160,20 +160,6 @@ export declare const FacilityController: {
|
|
|
160
160
|
category: string | number;
|
|
161
161
|
facility: string | number;
|
|
162
162
|
}, string>;
|
|
163
|
-
readonly storePicture: ActionWithMethods<{
|
|
164
|
-
category: string | number;
|
|
165
|
-
facility: string | number;
|
|
166
|
-
}, string>;
|
|
167
|
-
readonly viewPicture: ActionWithMethods<{
|
|
168
|
-
category: string | number;
|
|
169
|
-
facility: string | number;
|
|
170
|
-
picture: string | number;
|
|
171
|
-
}, string>;
|
|
172
|
-
readonly deletePicture: ActionWithMethods<{
|
|
173
|
-
category: string | number;
|
|
174
|
-
facility: string | number;
|
|
175
|
-
picture: string | number;
|
|
176
|
-
}, string>;
|
|
177
163
|
readonly viewQrCode: ActionWithMethods<{
|
|
178
164
|
category: string | number;
|
|
179
165
|
facility: string | number;
|
|
@@ -209,18 +195,6 @@ export declare namespace FacilityController {
|
|
|
209
195
|
type Request = object;
|
|
210
196
|
type Response = RevizaResponseData<null>;
|
|
211
197
|
}
|
|
212
|
-
namespace storePicture {
|
|
213
|
-
type Request = PicturePayload;
|
|
214
|
-
type Response = RevizaResponseData<FacilityData | null>;
|
|
215
|
-
}
|
|
216
|
-
namespace viewPicture {
|
|
217
|
-
type Request = object;
|
|
218
|
-
type Response = StreamedResponse;
|
|
219
|
-
}
|
|
220
|
-
namespace deletePicture {
|
|
221
|
-
type Request = object;
|
|
222
|
-
type Response = RevizaResponseData<FacilityData | null>;
|
|
223
|
-
}
|
|
224
198
|
namespace viewQrCode {
|
|
225
199
|
type Request = object;
|
|
226
200
|
type Response = StreamedResponse;
|
|
@@ -277,6 +251,36 @@ export declare namespace FacilityDocumentController {
|
|
|
277
251
|
type Response = StreamedResponse;
|
|
278
252
|
}
|
|
279
253
|
}
|
|
254
|
+
export declare const FacilityPictureController: {
|
|
255
|
+
readonly store: ActionWithMethods<{
|
|
256
|
+
category: string | number;
|
|
257
|
+
facility: string | number;
|
|
258
|
+
}, string>;
|
|
259
|
+
readonly show: ActionWithMethods<{
|
|
260
|
+
category: string | number;
|
|
261
|
+
facility: string | number;
|
|
262
|
+
picture: string | number;
|
|
263
|
+
}, string>;
|
|
264
|
+
readonly destroy: ActionWithMethods<{
|
|
265
|
+
category: string | number;
|
|
266
|
+
facility: string | number;
|
|
267
|
+
picture: string | number;
|
|
268
|
+
}, string>;
|
|
269
|
+
};
|
|
270
|
+
export declare namespace FacilityPictureController {
|
|
271
|
+
namespace store {
|
|
272
|
+
type Request = PicturePayload;
|
|
273
|
+
type Response = RevizaResponseData<undefined | null>;
|
|
274
|
+
}
|
|
275
|
+
namespace show {
|
|
276
|
+
type Request = object;
|
|
277
|
+
type Response = StreamedResponse;
|
|
278
|
+
}
|
|
279
|
+
namespace destroy {
|
|
280
|
+
type Request = object;
|
|
281
|
+
type Response = RevizaResponseData<null>;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
280
284
|
export declare const FrontendErrorController: {
|
|
281
285
|
readonly logError: ActionWithMethods<undefined, string>;
|
|
282
286
|
};
|
|
@@ -72,24 +72,6 @@ export const FacilityController = {
|
|
|
72
72
|
url: "api/v1/categories/{category}/facilities/{facility}",
|
|
73
73
|
},
|
|
74
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/{picture}",
|
|
85
|
-
},
|
|
86
|
-
]),
|
|
87
|
-
deletePicture: createActionWithMethods([
|
|
88
|
-
{
|
|
89
|
-
method: "delete",
|
|
90
|
-
url: "api/v1/categories/{category}/facilities/{facility}/picture/{picture}",
|
|
91
|
-
},
|
|
92
|
-
]),
|
|
93
75
|
viewQrCode: createActionWithMethods([
|
|
94
76
|
{
|
|
95
77
|
method: "get",
|
|
@@ -135,6 +117,26 @@ export const FacilityDocumentController = {
|
|
|
135
117
|
},
|
|
136
118
|
]),
|
|
137
119
|
};
|
|
120
|
+
export const FacilityPictureController = {
|
|
121
|
+
store: createActionWithMethods([
|
|
122
|
+
{
|
|
123
|
+
method: "post",
|
|
124
|
+
url: "api/v1/categories/{category}/facilities/{facility}/pictures",
|
|
125
|
+
},
|
|
126
|
+
]),
|
|
127
|
+
show: createActionWithMethods([
|
|
128
|
+
{
|
|
129
|
+
method: "get",
|
|
130
|
+
url: "api/v1/categories/{category}/facilities/{facility}/pictures/{picture}",
|
|
131
|
+
},
|
|
132
|
+
]),
|
|
133
|
+
destroy: createActionWithMethods([
|
|
134
|
+
{
|
|
135
|
+
method: "delete",
|
|
136
|
+
url: "api/v1/categories/{category}/facilities/{facility}/pictures/{picture}",
|
|
137
|
+
},
|
|
138
|
+
]),
|
|
139
|
+
};
|
|
138
140
|
export const FrontendErrorController = {
|
|
139
141
|
logError: createActionWithMethods([
|
|
140
142
|
{ method: "post", url: "api/v1/frontend-error" },
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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, DashboardController, DemoRequestController, FacilityController, FacilityDocumentController, FrontendErrorController, FrontendRouteController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UserController } from "./controllers";
|
|
5
|
+
import { AuthController, CategoryController, ConfigController, DashboardController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, FrontendErrorController, FrontendRouteController, 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
7
|
/**
|
|
8
8
|
* Convert a typed payload that contains `File` / `Blob` fields into a
|
|
@@ -94,11 +94,13 @@ export declare function createRevizaApi(http?: AxiosInstance): {
|
|
|
94
94
|
destroy(category: number, facility: number, config?: AxiosRequestConfig): Promise<FacilityController.destroy.Response>;
|
|
95
95
|
resolveIssue(category: number, facility: number, issue: number, data: FacilityController.resolveIssue.Request, config?: AxiosRequestConfig): Promise<FacilityController.resolveIssue.Response>;
|
|
96
96
|
qrCode(category: number, facility: number, config?: AxiosRequestConfig): Promise<FacilityController.viewQrCode.Response>;
|
|
97
|
-
viewPicture(category: number, facility: number, picture: number, config?: AxiosRequestConfig): Promise<FacilityController.viewQrCode.Response>;
|
|
98
|
-
storePicture(category: number, facility: number, data: FacilityController.storePicture.Request, config?: AxiosRequestConfig): Promise<FacilityController.storePicture.Response>;
|
|
99
|
-
deletePicture(category: number, facility: number, picture: number, config?: AxiosRequestConfig): Promise<FacilityController.deletePicture.Response>;
|
|
100
97
|
mapExtent(facility: number, map: number, config?: AxiosRequestConfig): Promise<FacilityController.getMapExtent.Response>;
|
|
101
98
|
};
|
|
99
|
+
facilityPictures: {
|
|
100
|
+
show(category: number, facility: number, picture: number, config?: AxiosRequestConfig): Promise<FacilityPictureController.show.Response>;
|
|
101
|
+
store(category: number, facility: number, data: FacilityController.store.Request, config?: AxiosRequestConfig): Promise<FacilityPictureController.store.Response>;
|
|
102
|
+
destroy(category: number, facility: number, picture: number, config?: AxiosRequestConfig): Promise<FacilityPictureController.destroy.Response>;
|
|
103
|
+
};
|
|
102
104
|
relatedFacilities: {
|
|
103
105
|
options(category: number, facility: number, config?: AxiosRequestConfig): Promise<RelatedFacilityController.options.Response>;
|
|
104
106
|
store(category: number, facility: number, data: RelatedFacilityController.store.Request, config?: AxiosRequestConfig): Promise<RelatedFacilityController.store.Response>;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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, DashboardController, DemoRequestController, FacilityController, FacilityDocumentController, FrontendErrorController, FrontendRouteController, MapController, MeController, NotificationSettingsController, OrganizationController, PermissionController, RelatedFacilityController, RevisionController, RevisionDocumentController, RevisionIssueController, SearchController, UserController, } from "./controllers";
|
|
5
|
+
import { AuthController, CategoryController, ConfigController, DashboardController, DemoRequestController, FacilityController, FacilityDocumentController, FacilityPictureController, FrontendErrorController, FrontendRouteController, 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
7
|
// ── helpers ───────────────────────────────────────────────────────────────────
|
|
8
8
|
/**
|
|
@@ -244,19 +244,21 @@ export function createRevizaApi(http = axios) {
|
|
|
244
244
|
config = { responseType: "blob", ...config };
|
|
245
245
|
return request(FacilityController.viewQrCode({ category, facility }), undefined, config);
|
|
246
246
|
},
|
|
247
|
-
|
|
247
|
+
mapExtent(facility, map, config) {
|
|
248
|
+
return request(FacilityController.getMapExtent({ facility, map }), undefined, config);
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
facilityPictures: {
|
|
252
|
+
show(category, facility, picture, config) {
|
|
248
253
|
config = { responseType: "blob", ...config };
|
|
249
|
-
return request(
|
|
254
|
+
return request(FacilityPictureController.show({ category, facility, picture }), undefined, config);
|
|
250
255
|
},
|
|
251
|
-
|
|
256
|
+
store(category, facility, data, config) {
|
|
252
257
|
config = { ...config, headers: { 'Content-Type': 'multipart/form-data' } };
|
|
253
|
-
return request(
|
|
254
|
-
},
|
|
255
|
-
deletePicture(category, facility, picture, config) {
|
|
256
|
-
return request(FacilityController.deletePicture({ category, facility, picture }), undefined, config);
|
|
258
|
+
return request(FacilityPictureController.store({ category, facility }), toFormData(data), config);
|
|
257
259
|
},
|
|
258
|
-
|
|
259
|
-
return request(
|
|
260
|
+
destroy(category, facility, picture, config) {
|
|
261
|
+
return request(FacilityPictureController.destroy({ category, facility, picture }), undefined, config);
|
|
260
262
|
},
|
|
261
263
|
},
|
|
262
264
|
relatedFacilities: {
|