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