@reviza/api-client 1.0.0-SNAPSHOT-0e36d7bd → 1.0.0-SNAPSHOT-2fc8f338
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/Revision/index.d.ts +2 -4
- package/dist/controllers/index.d.ts +21 -1
- package/dist/controllers/index.js +24 -13
- package/dist/index.d.ts +14 -13
- package/dist/index.js +47 -24
- package/package.json +1 -1
|
@@ -3,7 +3,6 @@ import { FacilityData } from "../Facility";
|
|
|
3
3
|
import { DocumentData } from "../Document";
|
|
4
4
|
import { UserData } from "../User";
|
|
5
5
|
export type RevisionCreatePayload = {
|
|
6
|
-
facility_ids: number[];
|
|
7
6
|
revision_date: string;
|
|
8
7
|
next_revision_date: string;
|
|
9
8
|
state: FacilityStateEnum;
|
|
@@ -15,7 +14,7 @@ export type RevisionCreatePayload = {
|
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
17
16
|
* Includes:
|
|
18
|
-
* -
|
|
17
|
+
* - facility
|
|
19
18
|
* - issues
|
|
20
19
|
* - documents
|
|
21
20
|
* - authorUser
|
|
@@ -29,7 +28,7 @@ export type RevisionData = {
|
|
|
29
28
|
custom_revision_type: string | null;
|
|
30
29
|
next_revision_type: RevisionTypeEnum;
|
|
31
30
|
next_custom_revision_type: string | null;
|
|
32
|
-
|
|
31
|
+
facility?: FacilityData;
|
|
33
32
|
issues: RevisionIssueData[];
|
|
34
33
|
documents: DocumentData[];
|
|
35
34
|
author_user?: UserData | null;
|
|
@@ -63,7 +62,6 @@ export type RevisionIssueUpdatePayload = {
|
|
|
63
62
|
description: string;
|
|
64
63
|
};
|
|
65
64
|
export type RevisionUpdatePayload = {
|
|
66
|
-
facility_ids: number[];
|
|
67
65
|
revision_date: string;
|
|
68
66
|
next_revision_date: string;
|
|
69
67
|
state: FacilityStateEnum;
|
|
@@ -15,7 +15,7 @@ import { NotificationSettingsData, NotificationSettingsPayload } from "../App/Da
|
|
|
15
15
|
import { OrganizationData, OrganizationUpdatePayload } from "../App/Data/Organization";
|
|
16
16
|
import { SubscriptionData } from "../App/Data/Subscription";
|
|
17
17
|
import { UserPermissionData, UserPermissionPayload } from "../App/Data/Permission";
|
|
18
|
-
import {
|
|
18
|
+
import { RevisionData, RevisionCreatePayload, RevisionUpdatePayload, RevisionIssueData } from "../App/Data/Revision";
|
|
19
19
|
import { SearchData } from "../App/Data/Search";
|
|
20
20
|
type ActionFunction<P extends RouteParams | undefined> = P extends undefined ? (options?: RouteOptions) => ActionResult : (params: P, options?: RouteOptions) => ActionResult;
|
|
21
21
|
type ActionResult = RouteDefinition & {
|
|
@@ -442,23 +442,35 @@ export declare namespace RelatedFacilityController {
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
export declare const RevisionController: {
|
|
445
|
+
readonly index: ActionWithMethods<{
|
|
446
|
+
category: string | number;
|
|
447
|
+
facility: string | number;
|
|
448
|
+
}, string>;
|
|
445
449
|
readonly store: ActionWithMethods<{
|
|
446
450
|
category: string | number;
|
|
451
|
+
facility: string | number;
|
|
447
452
|
}, string>;
|
|
448
453
|
readonly show: ActionWithMethods<{
|
|
449
454
|
category: string | number;
|
|
455
|
+
facility: string | number;
|
|
450
456
|
revision: string | number;
|
|
451
457
|
}, string>;
|
|
452
458
|
readonly update: ActionWithMethods<{
|
|
453
459
|
category: string | number;
|
|
460
|
+
facility: string | number;
|
|
454
461
|
revision: string | number;
|
|
455
462
|
}, string>;
|
|
456
463
|
readonly destroy: ActionWithMethods<{
|
|
457
464
|
category: string | number;
|
|
465
|
+
facility: string | number;
|
|
458
466
|
revision: string | number;
|
|
459
467
|
}, string>;
|
|
460
468
|
};
|
|
461
469
|
export declare namespace RevisionController {
|
|
470
|
+
namespace index {
|
|
471
|
+
type Request = object;
|
|
472
|
+
type Response = RevizaResponseData<DataCollection<number, RevisionData> | null>;
|
|
473
|
+
}
|
|
462
474
|
namespace store {
|
|
463
475
|
type Request = RevisionCreatePayload;
|
|
464
476
|
type Response = RevizaResponseData<RevisionData>;
|
|
@@ -479,24 +491,29 @@ export declare namespace RevisionController {
|
|
|
479
491
|
export declare const RevisionDocumentController: {
|
|
480
492
|
readonly index: ActionWithMethods<{
|
|
481
493
|
category: string | number;
|
|
494
|
+
facility: string | number;
|
|
482
495
|
revision: string | number;
|
|
483
496
|
}, string>;
|
|
484
497
|
readonly store: ActionWithMethods<{
|
|
485
498
|
category: string | number;
|
|
499
|
+
facility: string | number;
|
|
486
500
|
revision: string | number;
|
|
487
501
|
}, string>;
|
|
488
502
|
readonly destroy: ActionWithMethods<{
|
|
489
503
|
category: string | number;
|
|
504
|
+
facility: string | number;
|
|
490
505
|
revision: string | number;
|
|
491
506
|
document: string | number;
|
|
492
507
|
}, string>;
|
|
493
508
|
readonly update: ActionWithMethods<{
|
|
494
509
|
category: string | number;
|
|
510
|
+
facility: string | number;
|
|
495
511
|
revision: string | number;
|
|
496
512
|
document: string | number;
|
|
497
513
|
}, string>;
|
|
498
514
|
readonly download: ActionWithMethods<{
|
|
499
515
|
category: string | number;
|
|
516
|
+
facility: string | number;
|
|
500
517
|
revision: string | number;
|
|
501
518
|
document: string | number;
|
|
502
519
|
}, string>;
|
|
@@ -529,15 +546,18 @@ export declare const RevisionIssueController: {
|
|
|
529
546
|
}, string>;
|
|
530
547
|
readonly index: ActionWithMethods<{
|
|
531
548
|
category: string | number;
|
|
549
|
+
facility: string | number;
|
|
532
550
|
revision: string | number;
|
|
533
551
|
}, string>;
|
|
534
552
|
readonly show: ActionWithMethods<{
|
|
535
553
|
category: string | number;
|
|
554
|
+
facility: string | number;
|
|
536
555
|
revision: string | number;
|
|
537
556
|
issue: string | number;
|
|
538
557
|
}, string>;
|
|
539
558
|
readonly destroy: ActionWithMethods<{
|
|
540
559
|
category: string | number;
|
|
560
|
+
facility: string | number;
|
|
541
561
|
revision: string | number;
|
|
542
562
|
issue: string | number;
|
|
543
563
|
}, string>;
|
|
@@ -223,27 +223,38 @@ export const RelatedFacilityController = {
|
|
|
223
223
|
]),
|
|
224
224
|
};
|
|
225
225
|
export const RevisionController = {
|
|
226
|
-
|
|
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
|
+
]),
|
|
227
238
|
show: createActionWithMethods([
|
|
228
239
|
{
|
|
229
240
|
method: "get",
|
|
230
|
-
url: "api/v1/categories/{category}/revisions/{revision}",
|
|
241
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
231
242
|
},
|
|
232
243
|
]),
|
|
233
244
|
update: createActionWithMethods([
|
|
234
245
|
{
|
|
235
246
|
method: "put",
|
|
236
|
-
url: "api/v1/categories/{category}/revisions/{revision}",
|
|
247
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
237
248
|
},
|
|
238
249
|
{
|
|
239
250
|
method: "patch",
|
|
240
|
-
url: "api/v1/categories/{category}/revisions/{revision}",
|
|
251
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
241
252
|
},
|
|
242
253
|
]),
|
|
243
254
|
destroy: createActionWithMethods([
|
|
244
255
|
{
|
|
245
256
|
method: "delete",
|
|
246
|
-
url: "api/v1/categories/{category}/revisions/{revision}",
|
|
257
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}",
|
|
247
258
|
},
|
|
248
259
|
]),
|
|
249
260
|
};
|
|
@@ -251,31 +262,31 @@ export const RevisionDocumentController = {
|
|
|
251
262
|
index: createActionWithMethods([
|
|
252
263
|
{
|
|
253
264
|
method: "get",
|
|
254
|
-
url: "api/v1/categories/{category}/revisions/{revision}/documents",
|
|
265
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents",
|
|
255
266
|
},
|
|
256
267
|
]),
|
|
257
268
|
store: createActionWithMethods([
|
|
258
269
|
{
|
|
259
270
|
method: "post",
|
|
260
|
-
url: "api/v1/categories/{category}/revisions/{revision}/documents",
|
|
271
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents",
|
|
261
272
|
},
|
|
262
273
|
]),
|
|
263
274
|
destroy: createActionWithMethods([
|
|
264
275
|
{
|
|
265
276
|
method: "delete",
|
|
266
|
-
url: "api/v1/categories/{category}/revisions/{revision}/documents/{document}",
|
|
277
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}",
|
|
267
278
|
},
|
|
268
279
|
]),
|
|
269
280
|
update: createActionWithMethods([
|
|
270
281
|
{
|
|
271
282
|
method: "post",
|
|
272
|
-
url: "api/v1/categories/{category}/revisions/{revision}/documents/{document}",
|
|
283
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}",
|
|
273
284
|
},
|
|
274
285
|
]),
|
|
275
286
|
download: createActionWithMethods([
|
|
276
287
|
{
|
|
277
288
|
method: "get",
|
|
278
|
-
url: "api/v1/categories/{category}/revisions/{revision}/documents/{document}/download",
|
|
289
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/documents/{document}/download",
|
|
279
290
|
},
|
|
280
291
|
]),
|
|
281
292
|
};
|
|
@@ -284,19 +295,19 @@ export const RevisionIssueController = {
|
|
|
284
295
|
index: createActionWithMethods([
|
|
285
296
|
{
|
|
286
297
|
method: "get",
|
|
287
|
-
url: "api/v1/categories/{category}/revisions/{revision}/issues",
|
|
298
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues",
|
|
288
299
|
},
|
|
289
300
|
]),
|
|
290
301
|
show: createActionWithMethods([
|
|
291
302
|
{
|
|
292
303
|
method: "get",
|
|
293
|
-
url: "api/v1/categories/{category}/revisions/{revision}/issues/{issue}",
|
|
304
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues/{issue}",
|
|
294
305
|
},
|
|
295
306
|
]),
|
|
296
307
|
destroy: createActionWithMethods([
|
|
297
308
|
{
|
|
298
309
|
method: "delete",
|
|
299
|
-
url: "api/v1/categories/{category}/revisions/{revision}/issues/{issue}",
|
|
310
|
+
url: "api/v1/categories/{category}/facilities/{facility}/revisions/{revision}/issues/{issue}",
|
|
300
311
|
},
|
|
301
312
|
]),
|
|
302
313
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { ActionLogController, MapController as SystemMapController, Notification
|
|
|
13
13
|
* or the boundary will be missing and the server will reject the request.
|
|
14
14
|
*
|
|
15
15
|
* Array values are appended with the `key[]` convention expected by Laravel.
|
|
16
|
-
* Boolean values are
|
|
16
|
+
* Boolean values are serialised as `"1"` / `"0"`.
|
|
17
17
|
* `null` / `undefined` values are skipped.
|
|
18
18
|
*/
|
|
19
19
|
export declare function toFormData(data: object): FormData;
|
|
@@ -112,23 +112,24 @@ export declare function createRevizaApi(http?: AxiosInstance): {
|
|
|
112
112
|
download(category: number, facility: number, document: number, preview: boolean, config?: AxiosRequestConfig): Promise<FacilityDocumentController.download.Response>;
|
|
113
113
|
};
|
|
114
114
|
revisions: {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
index(category: number, facility: number, config?: AxiosRequestConfig): Promise<RevisionController.index.Response>;
|
|
116
|
+
show(category: number, facility: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionController.show.Response>;
|
|
117
|
+
store(category: number, facility: number, data: RevisionController.store.Request, config?: AxiosRequestConfig): Promise<RevisionController.store.Response>;
|
|
118
|
+
update(category: number, facility: number, revision: number, data: RevisionController.update.Request, config?: AxiosRequestConfig): Promise<RevisionController.update.Response>;
|
|
119
|
+
destroy(category: number, facility: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionController.destroy.Response>;
|
|
119
120
|
};
|
|
120
121
|
revisionIssues: {
|
|
121
|
-
index(category: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.index.Response>;
|
|
122
|
-
show(category: number, revision: number, issue: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.show.Response>;
|
|
123
|
-
destroy(category: number, revision: number, issue: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.destroy.Response>;
|
|
122
|
+
index(category: number, facility: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.index.Response>;
|
|
123
|
+
show(category: number, facility: number, revision: number, issue: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.show.Response>;
|
|
124
|
+
destroy(category: number, facility: number, revision: number, issue: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.destroy.Response>;
|
|
124
125
|
getForCategory(category: number, config?: AxiosRequestConfig): Promise<RevisionIssueController.getForCategory.Response>;
|
|
125
126
|
};
|
|
126
127
|
revisionDocuments: {
|
|
127
|
-
index(category: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionDocumentController.index.Response>;
|
|
128
|
-
store(category: number, revision: number, data: RevisionDocumentController.store.Request, config?: AxiosRequestConfig): Promise<RevisionDocumentController.store.Response>;
|
|
129
|
-
update(category: number, revision: number, document: number, data: RevisionDocumentController.update.Request, config?: AxiosRequestConfig): Promise<RevisionDocumentController.update.Response>;
|
|
130
|
-
destroy(category: number, revision: number, document: number, config?: AxiosRequestConfig): Promise<RevisionDocumentController.destroy.Response>;
|
|
131
|
-
download(category: number, revision: number, document: number, preview: boolean, config?: AxiosRequestConfig): Promise<FacilityDocumentController.download.Response>;
|
|
128
|
+
index(category: number, facility: number, revision: number, config?: AxiosRequestConfig): Promise<RevisionDocumentController.index.Response>;
|
|
129
|
+
store(category: number, facility: number, revision: number, data: RevisionDocumentController.store.Request, config?: AxiosRequestConfig): Promise<RevisionDocumentController.store.Response>;
|
|
130
|
+
update(category: number, facility: number, revision: number, document: number, data: RevisionDocumentController.update.Request, config?: AxiosRequestConfig): Promise<RevisionDocumentController.update.Response>;
|
|
131
|
+
destroy(category: number, facility: number, revision: number, document: number, config?: AxiosRequestConfig): Promise<RevisionDocumentController.destroy.Response>;
|
|
132
|
+
download(category: number, facility: number, revision: number, document: number, preview: boolean, config?: AxiosRequestConfig): Promise<FacilityDocumentController.download.Response>;
|
|
132
133
|
};
|
|
133
134
|
system: {
|
|
134
135
|
notifications: {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { ActionLogController, MapController as SystemMapController, Notification
|
|
|
14
14
|
* or the boundary will be missing and the server will reject the request.
|
|
15
15
|
*
|
|
16
16
|
* Array values are appended with the `key[]` convention expected by Laravel.
|
|
17
|
-
* Boolean values are
|
|
17
|
+
* Boolean values are serialised as `"1"` / `"0"`.
|
|
18
18
|
* `null` / `undefined` values are skipped.
|
|
19
19
|
*/
|
|
20
20
|
export function toFormData(data) {
|
|
@@ -290,29 +290,33 @@ export function createRevizaApi(http = axios) {
|
|
|
290
290
|
},
|
|
291
291
|
},
|
|
292
292
|
revisions: {
|
|
293
|
-
|
|
294
|
-
return request(RevisionController.
|
|
293
|
+
index(category, facility, config) {
|
|
294
|
+
return request(RevisionController.index({ category, facility }), undefined, config);
|
|
295
295
|
},
|
|
296
|
-
|
|
297
|
-
return request(RevisionController.
|
|
296
|
+
show(category, facility, revision, config) {
|
|
297
|
+
return request(RevisionController.show({ category, facility, revision }), undefined, config);
|
|
298
|
+
},
|
|
299
|
+
store(category, facility, data, config) {
|
|
300
|
+
return request(RevisionController.store({ category, facility }), data, config);
|
|
298
301
|
},
|
|
299
|
-
update(category, revision, data, config) {
|
|
300
|
-
return request(RevisionController.update({ category, revision }), data, config);
|
|
302
|
+
update(category, facility, revision, data, config) {
|
|
303
|
+
return request(RevisionController.update({ category, facility, revision }), data, config);
|
|
301
304
|
},
|
|
302
|
-
destroy(category, revision, config) {
|
|
303
|
-
return request(RevisionController.destroy({ category, revision }), undefined, config);
|
|
305
|
+
destroy(category, facility, revision, config) {
|
|
306
|
+
return request(RevisionController.destroy({ category, facility, revision }), undefined, config);
|
|
304
307
|
},
|
|
305
308
|
},
|
|
306
309
|
revisionIssues: {
|
|
307
|
-
index(category, revision, config) {
|
|
308
|
-
return request(RevisionIssueController.index({ category, revision }), undefined, config);
|
|
310
|
+
index(category, facility, revision, config) {
|
|
311
|
+
return request(RevisionIssueController.index({ category, facility, revision }), undefined, config);
|
|
309
312
|
},
|
|
310
|
-
show(category, revision, issue, config) {
|
|
311
|
-
return request(RevisionIssueController.show({ category, revision, issue }), undefined, config);
|
|
313
|
+
show(category, facility, revision, issue, config) {
|
|
314
|
+
return request(RevisionIssueController.show({ category, facility, revision, issue }), undefined, config);
|
|
312
315
|
},
|
|
313
|
-
destroy(category, revision, issue, config) {
|
|
316
|
+
destroy(category, facility, revision, issue, config) {
|
|
314
317
|
return request(RevisionIssueController.destroy({
|
|
315
318
|
category,
|
|
319
|
+
facility,
|
|
316
320
|
revision,
|
|
317
321
|
issue
|
|
318
322
|
}), undefined, config);
|
|
@@ -322,22 +326,41 @@ export function createRevizaApi(http = axios) {
|
|
|
322
326
|
}
|
|
323
327
|
},
|
|
324
328
|
revisionDocuments: {
|
|
325
|
-
index(category, revision, config) {
|
|
326
|
-
return request(RevisionDocumentController.index({ category, revision }), undefined, config);
|
|
329
|
+
index(category, facility, revision, config) {
|
|
330
|
+
return request(RevisionDocumentController.index({ category, facility, revision }), undefined, config);
|
|
327
331
|
},
|
|
328
|
-
store(category, revision, data, config) {
|
|
332
|
+
store(category, facility, revision, data, config) {
|
|
329
333
|
config = { ...config, headers: { 'Content-Type': 'multipart/form-data' } };
|
|
330
|
-
return request(RevisionDocumentController.store({
|
|
334
|
+
return request(RevisionDocumentController.store({
|
|
335
|
+
category,
|
|
336
|
+
facility,
|
|
337
|
+
revision
|
|
338
|
+
}), toFormData(data), config);
|
|
331
339
|
},
|
|
332
|
-
update(category, revision, document, data, config) {
|
|
333
|
-
return request(RevisionDocumentController.update({
|
|
340
|
+
update(category, facility, revision, document, data, config) {
|
|
341
|
+
return request(RevisionDocumentController.update({
|
|
342
|
+
category,
|
|
343
|
+
facility,
|
|
344
|
+
revision,
|
|
345
|
+
document
|
|
346
|
+
}), data, config);
|
|
334
347
|
},
|
|
335
|
-
destroy(category, revision, document, config) {
|
|
336
|
-
return request(RevisionDocumentController.destroy({
|
|
348
|
+
destroy(category, facility, revision, document, config) {
|
|
349
|
+
return request(RevisionDocumentController.destroy({
|
|
350
|
+
category,
|
|
351
|
+
facility,
|
|
352
|
+
revision,
|
|
353
|
+
document
|
|
354
|
+
}), undefined, config);
|
|
337
355
|
},
|
|
338
|
-
download(category, revision, document, preview, config) {
|
|
356
|
+
download(category, facility, revision, document, preview, config) {
|
|
339
357
|
config = { ...config, responseType: "blob", params: { preview: preview } };
|
|
340
|
-
return request(RevisionDocumentController.download({
|
|
358
|
+
return request(RevisionDocumentController.download({
|
|
359
|
+
category,
|
|
360
|
+
facility,
|
|
361
|
+
revision,
|
|
362
|
+
document
|
|
363
|
+
}), undefined, config);
|
|
341
364
|
},
|
|
342
365
|
},
|
|
343
366
|
// ── System (admin) endpoints ───────────────────────────────────────────
|