@asaidimu/hestia 1.3.0 → 1.4.1
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/index.cjs +3 -3
- package/index.d.cts +866 -14
- package/index.d.mts +503 -12
- package/index.mjs +3 -3
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -261,6 +261,366 @@ interface ChangePasswordRequest {
|
|
|
261
261
|
new: string;
|
|
262
262
|
}
|
|
263
263
|
//#endregion
|
|
264
|
+
//#region core/routes.gen.d.ts
|
|
265
|
+
declare const ROUTE_TABLE: {
|
|
266
|
+
readonly "system:apikeys:key:create": {
|
|
267
|
+
readonly method: "POST";
|
|
268
|
+
readonly route: "/system/apikeys/key/create";
|
|
269
|
+
readonly arguments: readonly [];
|
|
270
|
+
};
|
|
271
|
+
readonly "system:apikeys:key:delete": {
|
|
272
|
+
readonly method: "DELETE";
|
|
273
|
+
readonly route: "/system/apikeys/key/delete/{key_id}";
|
|
274
|
+
readonly arguments: readonly ["key_id"];
|
|
275
|
+
};
|
|
276
|
+
readonly "system:apikeys:key:get": {
|
|
277
|
+
readonly method: "GET";
|
|
278
|
+
readonly route: "/system/apikeys/key/get/{key_id}";
|
|
279
|
+
readonly arguments: readonly ["key_id"];
|
|
280
|
+
};
|
|
281
|
+
readonly "system:apikeys:key:list": {
|
|
282
|
+
readonly method: "GET";
|
|
283
|
+
readonly route: "/system/apikeys/key/list";
|
|
284
|
+
readonly arguments: readonly [];
|
|
285
|
+
};
|
|
286
|
+
readonly "system:apikeys:key:rotate": {
|
|
287
|
+
readonly method: "POST";
|
|
288
|
+
readonly route: "/system/apikeys/key/rotate/{key_id}";
|
|
289
|
+
readonly arguments: readonly ["key_id"];
|
|
290
|
+
};
|
|
291
|
+
readonly "system:apikeys:key:update": {
|
|
292
|
+
readonly method: "PATCH";
|
|
293
|
+
readonly route: "/system/apikeys/key/update/{key_id}";
|
|
294
|
+
readonly arguments: readonly ["key_id"];
|
|
295
|
+
};
|
|
296
|
+
readonly "system:audit:log:export": {
|
|
297
|
+
readonly method: "PATCH";
|
|
298
|
+
readonly route: "/system/audit/log/export";
|
|
299
|
+
readonly arguments: readonly [];
|
|
300
|
+
};
|
|
301
|
+
readonly "system:audit:log:query": {
|
|
302
|
+
readonly method: "POST";
|
|
303
|
+
readonly route: "/system/audit/log/query";
|
|
304
|
+
readonly arguments: readonly [];
|
|
305
|
+
};
|
|
306
|
+
readonly "system:audit:log:stream": {
|
|
307
|
+
readonly method: "GET";
|
|
308
|
+
readonly route: "/system/audit/log/stream";
|
|
309
|
+
readonly arguments: readonly [];
|
|
310
|
+
};
|
|
311
|
+
readonly "system:auth:bootstrap:password:set": {
|
|
312
|
+
readonly method: "PATCH";
|
|
313
|
+
readonly route: "/system/auth/bootstrap/password/set";
|
|
314
|
+
readonly arguments: readonly [];
|
|
315
|
+
};
|
|
316
|
+
readonly "system:auth:password:confirm": {
|
|
317
|
+
readonly method: "PATCH";
|
|
318
|
+
readonly route: "/system/auth/password/confirm";
|
|
319
|
+
readonly arguments: readonly [];
|
|
320
|
+
};
|
|
321
|
+
readonly "system:auth:password:reset": {
|
|
322
|
+
readonly method: "POST";
|
|
323
|
+
readonly route: "/system/auth/password/reset";
|
|
324
|
+
readonly arguments: readonly [];
|
|
325
|
+
};
|
|
326
|
+
readonly "system:auth:session:create": {
|
|
327
|
+
readonly method: "POST";
|
|
328
|
+
readonly route: "/system/auth/session/create";
|
|
329
|
+
readonly arguments: readonly [];
|
|
330
|
+
};
|
|
331
|
+
readonly "system:auth:session:delete": {
|
|
332
|
+
readonly method: "DELETE";
|
|
333
|
+
readonly route: "/system/auth/session/delete";
|
|
334
|
+
readonly arguments: readonly [];
|
|
335
|
+
};
|
|
336
|
+
readonly "system:auth:token:elevate": {
|
|
337
|
+
readonly method: "POST";
|
|
338
|
+
readonly route: "/system/auth/token/elevate";
|
|
339
|
+
readonly arguments: readonly [];
|
|
340
|
+
};
|
|
341
|
+
readonly "system:auth:user:register": {
|
|
342
|
+
readonly method: "POST";
|
|
343
|
+
readonly route: "/system/auth/user/register";
|
|
344
|
+
readonly arguments: readonly [];
|
|
345
|
+
};
|
|
346
|
+
readonly "system:blobs:blob:delete": {
|
|
347
|
+
readonly method: "DELETE";
|
|
348
|
+
readonly route: "/system/blobs/blob/delete/{ns}/{key}";
|
|
349
|
+
readonly arguments: readonly ["ns", "key"];
|
|
350
|
+
};
|
|
351
|
+
readonly "system:blobs:blob:download": {
|
|
352
|
+
readonly method: "GET";
|
|
353
|
+
readonly route: "/system/blobs/blob/download/{ns}/{key}";
|
|
354
|
+
readonly arguments: readonly ["ns", "key"];
|
|
355
|
+
};
|
|
356
|
+
readonly "system:blobs:blob:head": {
|
|
357
|
+
readonly method: "POST";
|
|
358
|
+
readonly route: "/system/blobs/blob/head/{ns}/{key}";
|
|
359
|
+
readonly arguments: readonly ["ns", "key"];
|
|
360
|
+
};
|
|
361
|
+
readonly "system:blobs:blob:list": {
|
|
362
|
+
readonly method: "POST";
|
|
363
|
+
readonly route: "/system/blobs/blob/list/{ns}";
|
|
364
|
+
readonly arguments: readonly ["ns"];
|
|
365
|
+
};
|
|
366
|
+
readonly "system:blobs:blob:update": {
|
|
367
|
+
readonly method: "PATCH";
|
|
368
|
+
readonly route: "/system/blobs/blob/update/{ns}/{key}";
|
|
369
|
+
readonly arguments: readonly ["ns", "key"];
|
|
370
|
+
};
|
|
371
|
+
readonly "system:blobs:blob:upload": {
|
|
372
|
+
readonly method: "POST";
|
|
373
|
+
readonly route: "/system/blobs/blob/upload/{ns}/{key}";
|
|
374
|
+
readonly arguments: readonly ["ns", "key"];
|
|
375
|
+
};
|
|
376
|
+
readonly "system:blobs:namespace:create": {
|
|
377
|
+
readonly method: "POST";
|
|
378
|
+
readonly route: "/system/blobs/namespace/create";
|
|
379
|
+
readonly arguments: readonly [];
|
|
380
|
+
};
|
|
381
|
+
readonly "system:blobs:namespace:delete": {
|
|
382
|
+
readonly method: "DELETE";
|
|
383
|
+
readonly route: "/system/blobs/namespace/delete/{ns}";
|
|
384
|
+
readonly arguments: readonly ["ns"];
|
|
385
|
+
};
|
|
386
|
+
readonly "system:blobs:namespace:list": {
|
|
387
|
+
readonly method: "POST";
|
|
388
|
+
readonly route: "/system/blobs/namespace/list";
|
|
389
|
+
readonly arguments: readonly [];
|
|
390
|
+
};
|
|
391
|
+
readonly "system:collections:collection:create": {
|
|
392
|
+
readonly method: "POST";
|
|
393
|
+
readonly route: "/system/collections/collection/create";
|
|
394
|
+
readonly arguments: readonly [];
|
|
395
|
+
};
|
|
396
|
+
readonly "system:collections:collection:delete": {
|
|
397
|
+
readonly method: "DELETE";
|
|
398
|
+
readonly route: "/system/collections/collection/delete/{name}";
|
|
399
|
+
readonly arguments: readonly ["name"];
|
|
400
|
+
};
|
|
401
|
+
readonly "system:collections:collection:get": {
|
|
402
|
+
readonly method: "GET";
|
|
403
|
+
readonly route: "/system/collections/collection/get/{name}";
|
|
404
|
+
readonly arguments: readonly ["name"];
|
|
405
|
+
};
|
|
406
|
+
readonly "system:collections:collection:list": {
|
|
407
|
+
readonly method: "GET";
|
|
408
|
+
readonly route: "/system/collections/collection/list";
|
|
409
|
+
readonly arguments: readonly [];
|
|
410
|
+
};
|
|
411
|
+
readonly "system:collections:document:create": {
|
|
412
|
+
readonly method: "POST";
|
|
413
|
+
readonly route: "/system/collections/document/create/{name}";
|
|
414
|
+
readonly arguments: readonly ["name"];
|
|
415
|
+
};
|
|
416
|
+
readonly "system:collections:document:delete": {
|
|
417
|
+
readonly method: "DELETE";
|
|
418
|
+
readonly route: "/system/collections/document/delete/{name}/{doc_id}";
|
|
419
|
+
readonly arguments: readonly ["name", "doc_id"];
|
|
420
|
+
};
|
|
421
|
+
readonly "system:collections:document:get": {
|
|
422
|
+
readonly method: "GET";
|
|
423
|
+
readonly route: "/system/collections/document/get/{name}/{doc_id}";
|
|
424
|
+
readonly arguments: readonly ["name", "doc_id"];
|
|
425
|
+
};
|
|
426
|
+
readonly "system:collections:document:query": {
|
|
427
|
+
readonly method: "POST";
|
|
428
|
+
readonly route: "/system/collections/document/query/{name}";
|
|
429
|
+
readonly arguments: readonly ["name"];
|
|
430
|
+
};
|
|
431
|
+
readonly "system:collections:document:update": {
|
|
432
|
+
readonly method: "PATCH";
|
|
433
|
+
readonly route: "/system/collections/document/update/{name}/{doc_id}";
|
|
434
|
+
readonly arguments: readonly ["name", "doc_id"];
|
|
435
|
+
};
|
|
436
|
+
readonly "system:core:capability:list": {
|
|
437
|
+
readonly method: "GET";
|
|
438
|
+
readonly route: "/system/core/capability/list";
|
|
439
|
+
readonly arguments: readonly [];
|
|
440
|
+
};
|
|
441
|
+
readonly "system:core:capability:set": {
|
|
442
|
+
readonly method: "PATCH";
|
|
443
|
+
readonly route: "/system/core/capability/set";
|
|
444
|
+
readonly arguments: readonly [];
|
|
445
|
+
};
|
|
446
|
+
readonly "system:core:docs:list": {
|
|
447
|
+
readonly method: "GET";
|
|
448
|
+
readonly route: "/system/core/docs/list";
|
|
449
|
+
readonly arguments: readonly [];
|
|
450
|
+
};
|
|
451
|
+
readonly "system:core:health:check": {
|
|
452
|
+
readonly method: "GET";
|
|
453
|
+
readonly route: "/system/core/health/check";
|
|
454
|
+
readonly arguments: readonly [];
|
|
455
|
+
};
|
|
456
|
+
readonly "system:core:heartbeat": {
|
|
457
|
+
readonly method: "GET";
|
|
458
|
+
readonly route: "/system/core/heartbeat";
|
|
459
|
+
readonly arguments: readonly [];
|
|
460
|
+
};
|
|
461
|
+
readonly "system:core:reset": {
|
|
462
|
+
readonly method: "GET";
|
|
463
|
+
readonly route: "/system/core/reset";
|
|
464
|
+
readonly arguments: readonly [];
|
|
465
|
+
};
|
|
466
|
+
readonly "system:notifications:notification:list": {
|
|
467
|
+
readonly method: "GET";
|
|
468
|
+
readonly route: "/system/notifications/notification/list";
|
|
469
|
+
readonly arguments: readonly [];
|
|
470
|
+
};
|
|
471
|
+
readonly "system:notifications:notification:read": {
|
|
472
|
+
readonly method: "PATCH";
|
|
473
|
+
readonly route: "/system/notifications/notification/read/{notification_id}";
|
|
474
|
+
readonly arguments: readonly ["notification_id"];
|
|
475
|
+
};
|
|
476
|
+
readonly "system:notifications:read:all": {
|
|
477
|
+
readonly method: "PATCH";
|
|
478
|
+
readonly route: "/system/notifications/read/all";
|
|
479
|
+
readonly arguments: readonly [];
|
|
480
|
+
};
|
|
481
|
+
readonly "system:notifications:unread:count": {
|
|
482
|
+
readonly method: "GET";
|
|
483
|
+
readonly route: "/system/notifications/unread/count";
|
|
484
|
+
readonly arguments: readonly [];
|
|
485
|
+
};
|
|
486
|
+
readonly "system:policies:binding:get": {
|
|
487
|
+
readonly method: "GET";
|
|
488
|
+
readonly route: "/system/policies/binding/get/{name}";
|
|
489
|
+
readonly arguments: readonly ["name"];
|
|
490
|
+
};
|
|
491
|
+
readonly "system:policies:binding:list": {
|
|
492
|
+
readonly method: "GET";
|
|
493
|
+
readonly route: "/system/policies/binding/list";
|
|
494
|
+
readonly arguments: readonly [];
|
|
495
|
+
};
|
|
496
|
+
readonly "system:policies:policy:create": {
|
|
497
|
+
readonly method: "POST";
|
|
498
|
+
readonly route: "/system/policies/policy/create/{name}";
|
|
499
|
+
readonly arguments: readonly ["name"];
|
|
500
|
+
};
|
|
501
|
+
readonly "system:policies:policy:list": {
|
|
502
|
+
readonly method: "GET";
|
|
503
|
+
readonly route: "/system/policies/policy/list";
|
|
504
|
+
readonly arguments: readonly [];
|
|
505
|
+
};
|
|
506
|
+
readonly "system:policies:policy:update": {
|
|
507
|
+
readonly method: "PATCH";
|
|
508
|
+
readonly route: "/system/policies/policy/update/{name}";
|
|
509
|
+
readonly arguments: readonly ["name"];
|
|
510
|
+
};
|
|
511
|
+
readonly "system:policies:reload": {
|
|
512
|
+
readonly method: "GET";
|
|
513
|
+
readonly route: "/system/policies/reload";
|
|
514
|
+
readonly arguments: readonly [];
|
|
515
|
+
};
|
|
516
|
+
readonly "system:policies:rule:create": {
|
|
517
|
+
readonly method: "POST";
|
|
518
|
+
readonly route: "/system/policies/rule/create/{name}";
|
|
519
|
+
readonly arguments: readonly ["name"];
|
|
520
|
+
};
|
|
521
|
+
readonly "system:policies:rule:delete": {
|
|
522
|
+
readonly method: "DELETE";
|
|
523
|
+
readonly route: "/system/policies/rule/delete/{name}";
|
|
524
|
+
readonly arguments: readonly ["name"];
|
|
525
|
+
};
|
|
526
|
+
readonly "system:policies:rule:get": {
|
|
527
|
+
readonly method: "GET";
|
|
528
|
+
readonly route: "/system/policies/rule/get/{name}";
|
|
529
|
+
readonly arguments: readonly ["name"];
|
|
530
|
+
};
|
|
531
|
+
readonly "system:policies:rule:list": {
|
|
532
|
+
readonly method: "GET";
|
|
533
|
+
readonly route: "/system/policies/rule/list";
|
|
534
|
+
readonly arguments: readonly [];
|
|
535
|
+
};
|
|
536
|
+
readonly "system:policies:rule:update": {
|
|
537
|
+
readonly method: "PATCH";
|
|
538
|
+
readonly route: "/system/policies/rule/update/{name}";
|
|
539
|
+
readonly arguments: readonly ["name"];
|
|
540
|
+
};
|
|
541
|
+
readonly "system:policies:rule:validate": {
|
|
542
|
+
readonly method: "POST";
|
|
543
|
+
readonly route: "/system/policies/rule/validate";
|
|
544
|
+
readonly arguments: readonly [];
|
|
545
|
+
};
|
|
546
|
+
readonly "system:scheduler:job:list": {
|
|
547
|
+
readonly method: "GET";
|
|
548
|
+
readonly route: "/system/scheduler/job/list";
|
|
549
|
+
readonly arguments: readonly [];
|
|
550
|
+
};
|
|
551
|
+
readonly "system:schedules:schedule:create": {
|
|
552
|
+
readonly method: "POST";
|
|
553
|
+
readonly route: "/system/schedules/schedule/create";
|
|
554
|
+
readonly arguments: readonly [];
|
|
555
|
+
};
|
|
556
|
+
readonly "system:schedules:schedule:delete": {
|
|
557
|
+
readonly method: "DELETE";
|
|
558
|
+
readonly route: "/system/schedules/schedule/delete/{id}";
|
|
559
|
+
readonly arguments: readonly ["id"];
|
|
560
|
+
};
|
|
561
|
+
readonly "system:schedules:schedule:get": {
|
|
562
|
+
readonly method: "GET";
|
|
563
|
+
readonly route: "/system/schedules/schedule/get/{id}";
|
|
564
|
+
readonly arguments: readonly ["id"];
|
|
565
|
+
};
|
|
566
|
+
readonly "system:schedules:schedule:list": {
|
|
567
|
+
readonly method: "GET";
|
|
568
|
+
readonly route: "/system/schedules/schedule/list";
|
|
569
|
+
readonly arguments: readonly [];
|
|
570
|
+
};
|
|
571
|
+
readonly "system:schedules:schedule:update": {
|
|
572
|
+
readonly method: "PATCH";
|
|
573
|
+
readonly route: "/system/schedules/schedule/update";
|
|
574
|
+
readonly arguments: readonly [];
|
|
575
|
+
};
|
|
576
|
+
readonly "system:settings:delete": {
|
|
577
|
+
readonly method: "DELETE";
|
|
578
|
+
readonly route: "/system/settings/delete/{key}";
|
|
579
|
+
readonly arguments: readonly ["key"];
|
|
580
|
+
};
|
|
581
|
+
readonly "system:settings:get": {
|
|
582
|
+
readonly method: "GET";
|
|
583
|
+
readonly route: "/system/settings/get/{key}";
|
|
584
|
+
readonly arguments: readonly ["key"];
|
|
585
|
+
};
|
|
586
|
+
readonly "system:settings:list": {
|
|
587
|
+
readonly method: "GET";
|
|
588
|
+
readonly route: "/system/settings/list";
|
|
589
|
+
readonly arguments: readonly [];
|
|
590
|
+
};
|
|
591
|
+
readonly "system:settings:set": {
|
|
592
|
+
readonly method: "POST";
|
|
593
|
+
readonly route: "/system/settings/set/{key}";
|
|
594
|
+
readonly arguments: readonly ["key"];
|
|
595
|
+
};
|
|
596
|
+
readonly "system:users:password:change": {
|
|
597
|
+
readonly method: "PATCH";
|
|
598
|
+
readonly route: "/system/users/password/change/{user_id}";
|
|
599
|
+
readonly arguments: readonly ["user_id"];
|
|
600
|
+
};
|
|
601
|
+
readonly "system:users:user:delete": {
|
|
602
|
+
readonly method: "DELETE";
|
|
603
|
+
readonly route: "/system/users/user/delete/{user_id}";
|
|
604
|
+
readonly arguments: readonly ["user_id"];
|
|
605
|
+
};
|
|
606
|
+
readonly "system:users:user:get": {
|
|
607
|
+
readonly method: "GET";
|
|
608
|
+
readonly route: "/system/users/user/get/{user_id}";
|
|
609
|
+
readonly arguments: readonly ["user_id"];
|
|
610
|
+
};
|
|
611
|
+
readonly "system:users:user:query": {
|
|
612
|
+
readonly method: "POST";
|
|
613
|
+
readonly route: "/system/users/user/query";
|
|
614
|
+
readonly arguments: readonly [];
|
|
615
|
+
};
|
|
616
|
+
readonly "system:users:user:update": {
|
|
617
|
+
readonly method: "PATCH";
|
|
618
|
+
readonly route: "/system/users/user/update/{user_id}";
|
|
619
|
+
readonly arguments: readonly ["user_id"];
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
type RouteName = keyof typeof ROUTE_TABLE;
|
|
623
|
+
//#endregion
|
|
264
624
|
//#region core/client.d.ts
|
|
265
625
|
interface IdentityProvider {
|
|
266
626
|
identity(): UserIdentity | null;
|
|
@@ -300,11 +660,12 @@ interface DispatchInput {
|
|
|
300
660
|
signal?: AbortSignal;
|
|
301
661
|
notifyAuthStateChange?: boolean;
|
|
302
662
|
}
|
|
303
|
-
interface Transport {
|
|
663
|
+
interface Transport<R extends string = RouteName> {
|
|
304
664
|
base(): string;
|
|
305
665
|
prefix(): string;
|
|
666
|
+
routeUrl(name: R, args?: Record<string, string>): string;
|
|
306
667
|
ready(): Promise<void>;
|
|
307
|
-
dispatch<T>(name:
|
|
668
|
+
dispatch<T>(name: R, input?: DispatchInput): Promise<HestiaResponse<T>>;
|
|
308
669
|
get<T>(path: string, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
309
670
|
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
310
671
|
patch<T>(path: string, body?: unknown, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
@@ -313,14 +674,15 @@ interface Transport {
|
|
|
313
674
|
check<T>(path: string, body?: unknown, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
314
675
|
openStream(path: string, handlers: StreamHandlers, options?: StreamOptions): Promise<void>;
|
|
315
676
|
}
|
|
316
|
-
declare class HttpTransport implements Transport {
|
|
677
|
+
declare class HttpTransport<R extends string = RouteName> implements Transport<R> {
|
|
317
678
|
private baseUrl;
|
|
318
679
|
private apiPrefix;
|
|
319
680
|
private onAuthStateChanged?;
|
|
320
681
|
private raw;
|
|
321
682
|
constructor(baseUrl: string, apiPrefix: string, onAuthStateChanged?: (() => void) | undefined);
|
|
322
683
|
private substituteArgs;
|
|
323
|
-
dispatch<T>(name:
|
|
684
|
+
dispatch<T>(name: R, input?: DispatchInput): Promise<HestiaResponse<T>>;
|
|
685
|
+
routeUrl(name: R, args?: Record<string, string>): string;
|
|
324
686
|
base(): string;
|
|
325
687
|
prefix(): string;
|
|
326
688
|
ready(): Promise<void>;
|
|
@@ -356,7 +718,7 @@ interface WailsTransportConfig {
|
|
|
356
718
|
identityProvider?: IdentityProvider;
|
|
357
719
|
onUnauthorized?: () => void;
|
|
358
720
|
}
|
|
359
|
-
declare class WailsTransport implements Transport {
|
|
721
|
+
declare class WailsTransport implements Transport<RouteName> {
|
|
360
722
|
private baseUrl;
|
|
361
723
|
private apiPrefix;
|
|
362
724
|
private init;
|
|
@@ -369,12 +731,13 @@ declare class WailsTransport implements Transport {
|
|
|
369
731
|
private resolveService;
|
|
370
732
|
base(): string;
|
|
371
733
|
prefix(): string;
|
|
734
|
+
routeUrl(name: RouteName, args?: Record<string, string>): string;
|
|
372
735
|
/**
|
|
373
736
|
* Polls window.go until Wails bindings are available.
|
|
374
737
|
* Concurrent callers share the single initialization attempt.
|
|
375
738
|
*/
|
|
376
739
|
ready(timeoutMs?: number): Promise<void>;
|
|
377
|
-
dispatch<T>(name:
|
|
740
|
+
dispatch<T>(name: RouteName, input?: DispatchInput): Promise<HestiaResponse<T>>;
|
|
378
741
|
check<T>(path: string, body?: unknown, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
379
742
|
get<T>(path: string, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
380
743
|
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<HestiaResponse<T>>;
|
|
@@ -573,30 +936,49 @@ declare class HestiaKeyStore implements DocumentStore<APIKey, QueryDSL<APIKey>,
|
|
|
573
936
|
}
|
|
574
937
|
//#endregion
|
|
575
938
|
//#region system/operations/types.d.ts
|
|
576
|
-
interface
|
|
939
|
+
interface Binding {
|
|
577
940
|
name: string;
|
|
578
941
|
description?: string;
|
|
579
|
-
intentType?: string;
|
|
580
942
|
}
|
|
581
943
|
//#endregion
|
|
582
944
|
//#region system/operations/store.d.ts
|
|
583
945
|
declare class HestiaOperations {
|
|
584
946
|
private client;
|
|
585
947
|
constructor(client: Transport);
|
|
586
|
-
list(): Promise<Page<
|
|
587
|
-
read(name: string): Promise<Document<
|
|
948
|
+
list(): Promise<Page<Binding>>;
|
|
949
|
+
read(name: string): Promise<Document<Binding> | undefined>;
|
|
588
950
|
}
|
|
589
951
|
//#endregion
|
|
590
952
|
//#region system/policies/types.d.ts
|
|
953
|
+
interface RateLimitConfig {
|
|
954
|
+
enabled: boolean;
|
|
955
|
+
identity: string;
|
|
956
|
+
capacity: number;
|
|
957
|
+
refill: number;
|
|
958
|
+
period: number;
|
|
959
|
+
}
|
|
960
|
+
interface ThrottleAction {
|
|
961
|
+
message?: string;
|
|
962
|
+
input?: Record<string, unknown>;
|
|
963
|
+
}
|
|
964
|
+
interface ThrottleConfig {
|
|
965
|
+
limit: number;
|
|
966
|
+
window: number;
|
|
967
|
+
action?: ThrottleAction;
|
|
968
|
+
}
|
|
591
969
|
interface Policy {
|
|
592
970
|
id: string;
|
|
593
971
|
operationName: string;
|
|
594
972
|
ruleName: string;
|
|
595
973
|
enabled: boolean;
|
|
596
974
|
protected: boolean;
|
|
975
|
+
rateLimit?: RateLimitConfig;
|
|
976
|
+
throttle?: ThrottleConfig;
|
|
597
977
|
}
|
|
598
978
|
interface CreatePolicyRequest {
|
|
599
979
|
ruleName: string;
|
|
980
|
+
rateLimit?: RateLimitConfig;
|
|
981
|
+
throttle?: ThrottleConfig;
|
|
600
982
|
}
|
|
601
983
|
interface UpdatePolicyRuleRequest {
|
|
602
984
|
ruleName: string;
|
|
@@ -604,6 +986,12 @@ interface UpdatePolicyRuleRequest {
|
|
|
604
986
|
interface SetPolicyEnabledRequest {
|
|
605
987
|
enabled: boolean;
|
|
606
988
|
}
|
|
989
|
+
interface UpdatePolicyRequest {
|
|
990
|
+
ruleName?: string;
|
|
991
|
+
enabled?: boolean;
|
|
992
|
+
rateLimit?: RateLimitConfig | null;
|
|
993
|
+
throttle?: ThrottleConfig | null;
|
|
994
|
+
}
|
|
607
995
|
//#endregion
|
|
608
996
|
//#region system/policies/store.d.ts
|
|
609
997
|
declare class HestiaPolicies implements DocumentStore<Policy, QueryDSL<Policy>, string, QueryDSL<Policy>, Record<string, unknown>, string, string, Record<string, unknown>> {
|
|
@@ -619,7 +1007,7 @@ declare class HestiaPolicies implements DocumentStore<Policy, QueryDSL<Policy>,
|
|
|
619
1007
|
options?: string;
|
|
620
1008
|
}): Promise<Document<Policy> | undefined>;
|
|
621
1009
|
update(props: {
|
|
622
|
-
data:
|
|
1010
|
+
data: UpdatePolicyRequest;
|
|
623
1011
|
options?: string;
|
|
624
1012
|
}): Promise<Document<Policy> | undefined>;
|
|
625
1013
|
setEnabled(name: string, enabled: boolean): Promise<Document<Policy>>;
|
|
@@ -909,6 +1297,106 @@ declare class HestiaCollections implements DocumentStore<CollectionMeta, Record<
|
|
|
909
1297
|
documents<T extends Record<string, any>>(collectionName: string): HestiaCollection<T>;
|
|
910
1298
|
}
|
|
911
1299
|
//#endregion
|
|
1300
|
+
//#region system/notifications/types.d.ts
|
|
1301
|
+
interface Notification {
|
|
1302
|
+
_id_: string;
|
|
1303
|
+
user_id: string;
|
|
1304
|
+
type: string;
|
|
1305
|
+
subject: string;
|
|
1306
|
+
body?: string;
|
|
1307
|
+
data?: Record<string, unknown>;
|
|
1308
|
+
read: boolean;
|
|
1309
|
+
created_at: number;
|
|
1310
|
+
_metadata_: Record<string, unknown>;
|
|
1311
|
+
}
|
|
1312
|
+
interface UnreadCount {
|
|
1313
|
+
count: number;
|
|
1314
|
+
}
|
|
1315
|
+
//#endregion
|
|
1316
|
+
//#region system/notifications/store.d.ts
|
|
1317
|
+
declare class HestiaNotificationStore {
|
|
1318
|
+
private client;
|
|
1319
|
+
constructor(client: Transport);
|
|
1320
|
+
list(): Promise<Document<Notification>[]>;
|
|
1321
|
+
markRead(notificationId: string): Promise<void>;
|
|
1322
|
+
markAllRead(): Promise<void>;
|
|
1323
|
+
countUnread(): Promise<number>;
|
|
1324
|
+
}
|
|
1325
|
+
//#endregion
|
|
1326
|
+
//#region system/schedules/types.d.ts
|
|
1327
|
+
/** A schedule document stored in the system. */
|
|
1328
|
+
interface Schedule {
|
|
1329
|
+
_id_: string;
|
|
1330
|
+
/** Owner of this schedule. */
|
|
1331
|
+
user_id: string;
|
|
1332
|
+
/** System message name to dispatch when the cron fires. */
|
|
1333
|
+
message: string;
|
|
1334
|
+
/** Input payload passed to the message handler. String values may contain Go templates (`{{ .schedule._id }}`, `{{ .now }}`). */
|
|
1335
|
+
input?: Record<string, unknown>;
|
|
1336
|
+
/** Cron expression (e.g. `@every 5m`, `0 * * * *`). */
|
|
1337
|
+
cron: string;
|
|
1338
|
+
/** When true the schedule is paused and will not fire. */
|
|
1339
|
+
disabled?: boolean;
|
|
1340
|
+
tenant_id?: string;
|
|
1341
|
+
created_at: number;
|
|
1342
|
+
_metadata_: Record<string, unknown>;
|
|
1343
|
+
}
|
|
1344
|
+
/** Payload for `schedule:create`. */
|
|
1345
|
+
interface CreateSchedulePayload {
|
|
1346
|
+
/** Override the owner (defaults to the authenticated user). */
|
|
1347
|
+
user_id?: string;
|
|
1348
|
+
/** System message name to dispatch on each tick. */
|
|
1349
|
+
message: string;
|
|
1350
|
+
/** Input payload. String values are resolved as Go templates against `{ .schedule, .now }`. */
|
|
1351
|
+
input?: Record<string, unknown>;
|
|
1352
|
+
/** Cron expression. */
|
|
1353
|
+
cron: string;
|
|
1354
|
+
/** Start the schedule in a disabled state. */
|
|
1355
|
+
disabled?: boolean;
|
|
1356
|
+
}
|
|
1357
|
+
/** Payload for `schedule:update`. All fields optional — only provided fields are patched. */
|
|
1358
|
+
interface UpdateSchedulePayload {
|
|
1359
|
+
message?: string;
|
|
1360
|
+
input?: Record<string, unknown>;
|
|
1361
|
+
cron?: string;
|
|
1362
|
+
disabled?: boolean;
|
|
1363
|
+
}
|
|
1364
|
+
//#endregion
|
|
1365
|
+
//#region system/schedules/store.d.ts
|
|
1366
|
+
/** CRUD store for cron-triggered schedules. */
|
|
1367
|
+
declare class HestiaScheduleStore {
|
|
1368
|
+
private client;
|
|
1369
|
+
constructor(client: Transport);
|
|
1370
|
+
/** Create a new schedule and register the cron job. Returns the new schedule ID. */
|
|
1371
|
+
create(payload: CreateSchedulePayload): Promise<string>;
|
|
1372
|
+
/** List all schedules visible to the current tenant. */
|
|
1373
|
+
list(): Promise<Document<Schedule>[]>;
|
|
1374
|
+
/** Get a single schedule by ID. Returns null if not found. */
|
|
1375
|
+
get(id: string): Promise<Document<Schedule> | null>;
|
|
1376
|
+
/** Update fields on a schedule. The cron job is re-registered with the new values. */
|
|
1377
|
+
update(id: string, payload: UpdateSchedulePayload): Promise<void>;
|
|
1378
|
+
/** Delete a schedule and unregister its cron job. */
|
|
1379
|
+
delete(id: string): Promise<void>;
|
|
1380
|
+
}
|
|
1381
|
+
//#endregion
|
|
1382
|
+
//#region system/settings/types.d.ts
|
|
1383
|
+
interface SettingDocument {
|
|
1384
|
+
_id_: string;
|
|
1385
|
+
key: string;
|
|
1386
|
+
value: Record<string, unknown>;
|
|
1387
|
+
_metadata_: Record<string, unknown>;
|
|
1388
|
+
}
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region system/settings/store.d.ts
|
|
1391
|
+
declare class HestiaSettingStore {
|
|
1392
|
+
private client;
|
|
1393
|
+
constructor(client: Transport);
|
|
1394
|
+
list(): Promise<Document<SettingDocument>[]>;
|
|
1395
|
+
get(key: string): Promise<Document<SettingDocument> | undefined>;
|
|
1396
|
+
set(key: string, value: Record<string, unknown>): Promise<void>;
|
|
1397
|
+
delete(key: string): Promise<void>;
|
|
1398
|
+
}
|
|
1399
|
+
//#endregion
|
|
912
1400
|
//#region system/capabilities/store.d.ts
|
|
913
1401
|
declare class HestiaCapabilities implements DocumentStore<any, Record<string, unknown>, string, Record<string, unknown>, Record<string, unknown>, string, string, Record<string, unknown>> {
|
|
914
1402
|
private client;
|
|
@@ -960,6 +1448,9 @@ declare class HestiaClient {
|
|
|
960
1448
|
readonly collections: HestiaCollections;
|
|
961
1449
|
readonly blobs: HestiaBlobClient;
|
|
962
1450
|
readonly capabilities: HestiaCapabilities;
|
|
1451
|
+
readonly notifications: HestiaNotificationStore;
|
|
1452
|
+
readonly schedules: HestiaScheduleStore;
|
|
1453
|
+
readonly settings: HestiaSettingStore;
|
|
963
1454
|
private tokenProvider;
|
|
964
1455
|
private onAuthStateChanged?;
|
|
965
1456
|
constructor(config: HestiaConfig);
|
|
@@ -990,4 +1481,4 @@ interface ArrayPagerOptions<T extends Record<string, any>, F = any> {
|
|
|
990
1481
|
}
|
|
991
1482
|
declare function createArrayPager<T extends Record<string, any>, F = any>(options: ArrayPagerOptions<T, F>): PagedData<T>;
|
|
992
1483
|
//#endregion
|
|
993
|
-
export { APIKey, APIKeyWithSecret, ArrayPagerOptions, AuditEntry, BlobDocument, BlobMeta, BlobNamespace, BootstrapPasswordRequest, ChangePasswordRequest, CollectionDocument, CollectionMeta, CreateKeyRequest, CreateNamespaceRequest, CreatePolicyRequest, CreateRuleRequest, CreateUserRequest, DispatchInput, Document, DocumentStore, FetchResult, HestiaAuth, HestiaBlobClient, HestiaClient, HestiaCollection, HestiaCollections, HestiaKeyStore, HestiaLogs, HestiaNetworkClient, HestiaOperations, HestiaPolicies, HestiaResponse, HestiaRules, HestiaUsers, HttpTransport, IdentityProvider, ListBlobsRequest, LogFilter, LoginRequest, LoginResult, NamespaceInfo,
|
|
1484
|
+
export { APIKey, APIKeyWithSecret, ArrayPagerOptions, AuditEntry, Binding, BlobDocument, BlobMeta, BlobNamespace, BootstrapPasswordRequest, ChangePasswordRequest, CollectionDocument, CollectionMeta, CreateKeyRequest, CreateNamespaceRequest, CreatePolicyRequest, CreateRuleRequest, CreateSchedulePayload, CreateUserRequest, DispatchInput, Document, DocumentStore, FetchResult, HestiaAuth, HestiaBlobClient, HestiaClient, HestiaCollection, HestiaCollections, HestiaKeyStore, HestiaLogs, HestiaNetworkClient, HestiaNotificationStore, HestiaOperations, HestiaPolicies, HestiaResponse, HestiaRules, HestiaScheduleStore, HestiaSettingStore, HestiaUsers, HttpTransport, IdentityProvider, ListBlobsRequest, LogFilter, LoginRequest, LoginResult, NamespaceInfo, Notification, Page, PagedData, PagerRefreshOptions, PaginationInfo, Policy, PolicyRule, RateLimitConfig, RegisterRequest, ReloadResult, RequestLogEntry, RequestOptions, RuleNode, Schedule, ServerHealth, SetPolicyEnabledRequest, SettingDocument, StoreEvent, StreamHandlers, StreamOptions, ThrottleAction, ThrottleConfig, Transport, UnreadCount, UpdateKeyRequest, UpdatePolicyRequest, UpdatePolicyRuleRequest, UpdateRuleRequest, UpdateSchedulePayload, UpdateUserRequest, UserData, UserIdentity, ValidateRuleRequest, ValidateRuleResult, WailsTransport, createArrayPager, createPagedController, internalError, notFound, parseErrorBody, permissionDenied, toSystemError };
|