@aeriajs/builtins 0.0.10 → 0.0.13

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.
@@ -106,7 +106,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<{
106
106
  readonly presets: readonly ["view"];
107
107
  readonly filters: readonly ["context", "message", "owner"];
108
108
  }> | null>;
109
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | null, context: import("@aeriajs/types").Context<{
109
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
110
110
  readonly $id: "log";
111
111
  readonly required: readonly ["context", "message"];
112
112
  readonly properties: {
@@ -348,7 +348,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<{
348
348
  readonly presets: readonly ["view"];
349
349
  readonly filters: readonly ["context", "message", "owner"];
350
350
  }> | null>;
351
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | null, context: import("@aeriajs/types").Context<{
351
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
352
352
  readonly $id: "log";
353
353
  readonly required: readonly ["context", "message"];
354
354
  readonly properties: {
@@ -455,4 +455,225 @@ export declare const log: Omit<import("@aeriajs/types").Collection<{
455
455
  readonly filters: readonly ["context", "message", "owner"];
456
456
  }>, options?: import("@aeriajs/api").InsertOptions | undefined) => Promise<import("@aeriajs/types").Right<any> | import("@aeriajs/types").Left<import("@aeriajs/types").ACErrors | import("@aeriajs/types").ValidationError>>;
457
457
  };
458
+ functionContracts: Partial<{
459
+ readonly get: import("@aeriajs/types").Contract;
460
+ readonly getAll: import("@aeriajs/types").Contract;
461
+ readonly insert: import("@aeriajs/types").Contract;
462
+ }>;
463
+ accessControl: import("@aeriajs/types").AccessControl<{
464
+ description: {
465
+ readonly $id: "log";
466
+ readonly required: readonly ["context", "message"];
467
+ readonly properties: {
468
+ readonly owner: {
469
+ readonly $ref: "user";
470
+ readonly noForm: true;
471
+ };
472
+ readonly context: {
473
+ readonly type: "string";
474
+ };
475
+ readonly message: {
476
+ readonly type: "string";
477
+ };
478
+ readonly details: {
479
+ readonly type: "object";
480
+ readonly variable: true;
481
+ };
482
+ readonly created_at: {
483
+ readonly type: "string";
484
+ readonly format: "date-time";
485
+ };
486
+ };
487
+ readonly icon: "magnifying-glass";
488
+ readonly presets: readonly ["view"];
489
+ readonly filters: readonly ["context", "message", "owner"];
490
+ };
491
+ functions: {
492
+ readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<{
493
+ readonly $id: "log";
494
+ readonly required: readonly ["context", "message"];
495
+ readonly properties: {
496
+ readonly owner: {
497
+ readonly $ref: "user";
498
+ readonly noForm: true;
499
+ };
500
+ readonly context: {
501
+ readonly type: "string";
502
+ };
503
+ readonly message: {
504
+ readonly type: "string";
505
+ };
506
+ readonly details: {
507
+ readonly type: "object";
508
+ readonly variable: true;
509
+ };
510
+ readonly created_at: {
511
+ readonly type: "string";
512
+ readonly format: "date-time";
513
+ };
514
+ };
515
+ readonly icon: "magnifying-glass";
516
+ readonly presets: readonly ["view"];
517
+ readonly filters: readonly ["context", "message", "owner"];
518
+ }>>, context: import("@aeriajs/types").Context<{
519
+ readonly $id: "log";
520
+ readonly required: readonly ["context", "message"];
521
+ readonly properties: {
522
+ readonly owner: {
523
+ readonly $ref: "user";
524
+ readonly noForm: true;
525
+ };
526
+ readonly context: {
527
+ readonly type: "string";
528
+ };
529
+ readonly message: {
530
+ readonly type: "string";
531
+ };
532
+ readonly details: {
533
+ readonly type: "object";
534
+ readonly variable: true;
535
+ };
536
+ readonly created_at: {
537
+ readonly type: "string";
538
+ readonly format: "date-time";
539
+ };
540
+ };
541
+ readonly icon: "magnifying-glass";
542
+ readonly presets: readonly ["view"];
543
+ readonly filters: readonly ["context", "message", "owner"];
544
+ }>, options?: import("@aeriajs/api").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<{
545
+ readonly $id: "log";
546
+ readonly required: readonly ["context", "message"];
547
+ readonly properties: {
548
+ readonly owner: {
549
+ readonly $ref: "user";
550
+ readonly noForm: true;
551
+ };
552
+ readonly context: {
553
+ readonly type: "string";
554
+ };
555
+ readonly message: {
556
+ readonly type: "string";
557
+ };
558
+ readonly details: {
559
+ readonly type: "object";
560
+ readonly variable: true;
561
+ };
562
+ readonly created_at: {
563
+ readonly type: "string";
564
+ readonly format: "date-time";
565
+ };
566
+ };
567
+ readonly icon: "magnifying-glass";
568
+ readonly presets: readonly ["view"];
569
+ readonly filters: readonly ["context", "message", "owner"];
570
+ }> | null>;
571
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
572
+ readonly $id: "log";
573
+ readonly required: readonly ["context", "message"];
574
+ readonly properties: {
575
+ readonly owner: {
576
+ readonly $ref: "user";
577
+ readonly noForm: true;
578
+ };
579
+ readonly context: {
580
+ readonly type: "string";
581
+ };
582
+ readonly message: {
583
+ readonly type: "string";
584
+ };
585
+ readonly details: {
586
+ readonly type: "object";
587
+ readonly variable: true;
588
+ };
589
+ readonly created_at: {
590
+ readonly type: "string";
591
+ readonly format: "date-time";
592
+ };
593
+ };
594
+ readonly icon: "magnifying-glass";
595
+ readonly presets: readonly ["view"];
596
+ readonly filters: readonly ["context", "message", "owner"];
597
+ }>, options?: import("@aeriajs/api").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<{
598
+ readonly $id: "log";
599
+ readonly required: readonly ["context", "message"];
600
+ readonly properties: {
601
+ readonly owner: {
602
+ readonly $ref: "user";
603
+ readonly noForm: true;
604
+ };
605
+ readonly context: {
606
+ readonly type: "string";
607
+ };
608
+ readonly message: {
609
+ readonly type: "string";
610
+ };
611
+ readonly details: {
612
+ readonly type: "object";
613
+ readonly variable: true;
614
+ };
615
+ readonly created_at: {
616
+ readonly type: "string";
617
+ readonly format: "date-time";
618
+ };
619
+ };
620
+ readonly icon: "magnifying-glass";
621
+ readonly presets: readonly ["view"];
622
+ readonly filters: readonly ["context", "message", "owner"];
623
+ }>[]>;
624
+ readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<{
625
+ readonly $id: "log";
626
+ readonly required: readonly ["context", "message"];
627
+ readonly properties: {
628
+ readonly owner: {
629
+ readonly $ref: "user";
630
+ readonly noForm: true;
631
+ };
632
+ readonly context: {
633
+ readonly type: "string";
634
+ };
635
+ readonly message: {
636
+ readonly type: "string";
637
+ };
638
+ readonly details: {
639
+ readonly type: "object";
640
+ readonly variable: true;
641
+ };
642
+ readonly created_at: {
643
+ readonly type: "string";
644
+ readonly format: "date-time";
645
+ };
646
+ };
647
+ readonly icon: "magnifying-glass";
648
+ readonly presets: readonly ["view"];
649
+ readonly filters: readonly ["context", "message", "owner"];
650
+ }>>, context: import("@aeriajs/types").Context<{
651
+ readonly $id: "log";
652
+ readonly required: readonly ["context", "message"];
653
+ readonly properties: {
654
+ readonly owner: {
655
+ readonly $ref: "user";
656
+ readonly noForm: true;
657
+ };
658
+ readonly context: {
659
+ readonly type: "string";
660
+ };
661
+ readonly message: {
662
+ readonly type: "string";
663
+ };
664
+ readonly details: {
665
+ readonly type: "object";
666
+ readonly variable: true;
667
+ };
668
+ readonly created_at: {
669
+ readonly type: "string";
670
+ readonly format: "date-time";
671
+ };
672
+ };
673
+ readonly icon: "magnifying-glass";
674
+ readonly presets: readonly ["view"];
675
+ readonly filters: readonly ["context", "message", "owner"];
676
+ }>, options?: import("@aeriajs/api").InsertOptions | undefined) => Promise<import("@aeriajs/types").Right<any> | import("@aeriajs/types").Left<import("@aeriajs/types").ACErrors | import("@aeriajs/types").ValidationError>>;
677
+ };
678
+ }>;
458
679
  };
@@ -54,4 +54,37 @@ export declare const resourceUsage: Omit<import("@aeriajs/types").Collection<{
54
54
  };
55
55
  }>, ...args: any[]) => any;
56
56
  };
57
+ functionContracts: Partial<{
58
+ [x: string]: import("@aeriajs/types").Contract;
59
+ }>;
60
+ accessControl: import("@aeriajs/types").AccessControl<{
61
+ description: {
62
+ readonly $id: "resourceUsage";
63
+ readonly required: readonly [];
64
+ readonly properties: {
65
+ readonly hits: {
66
+ readonly type: "integer";
67
+ };
68
+ readonly last_maximum_reach: {
69
+ readonly type: "string";
70
+ readonly format: "date-time";
71
+ };
72
+ };
73
+ };
74
+ functions: {
75
+ [P: string]: (payload: any, context: import("@aeriajs/types").Context<{
76
+ readonly $id: "resourceUsage";
77
+ readonly required: readonly [];
78
+ readonly properties: {
79
+ readonly hits: {
80
+ readonly type: "integer";
81
+ };
82
+ readonly last_maximum_reach: {
83
+ readonly type: "string";
84
+ readonly format: "date-time";
85
+ };
86
+ };
87
+ }>, ...args: any[]) => any;
88
+ };
89
+ }>;
57
90
  };
@@ -394,7 +394,7 @@ export declare const user: {
394
394
  };
395
395
  };
396
396
  }> | null>;
397
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | null, context: import("@aeriajs/types").Context<{
397
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
398
398
  readonly $id: "user";
399
399
  readonly required: readonly ["name", "roles", "email"];
400
400
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -1940,12 +1940,12 @@ export declare const user: {
1940
1940
  readonly getActivationLink: (userId: import("bson").ObjectId) => Promise<string>;
1941
1941
  };
1942
1942
  accessControl: {
1943
- roles: {
1944
- root: {
1945
- grantEverything: true;
1943
+ readonly roles: {
1944
+ readonly root: {
1945
+ readonly grantEverything: true;
1946
1946
  };
1947
- guest: {
1948
- grant: "authenticate"[];
1947
+ readonly guest: {
1948
+ readonly grant: readonly ["authenticate"];
1949
1949
  };
1950
1950
  };
1951
1951
  };
@@ -2444,7 +2444,7 @@ export declare const user: {
2444
2444
  };
2445
2445
  };
2446
2446
  }> | null>;
2447
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | null, context: import("@aeriajs/types").Context<{
2447
+ readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
2448
2448
  readonly $id: "user";
2449
2449
  readonly required: readonly ["name", "roles", "email"];
2450
2450
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -3989,4 +3989,27 @@ export declare const user: {
3989
3989
  }>>;
3990
3990
  readonly getActivationLink: (userId: import("bson").ObjectId) => Promise<string>;
3991
3991
  };
3992
+ functionContracts: Partial<{
3993
+ readonly get: import("@aeriajs/types").Contract;
3994
+ readonly getAll: import("@aeriajs/types").Contract;
3995
+ readonly remove: import("@aeriajs/types").Contract;
3996
+ readonly upload: import("@aeriajs/types").Contract;
3997
+ readonly removeFile: import("@aeriajs/types").Contract;
3998
+ readonly insert: import("@aeriajs/types").Contract;
3999
+ readonly authenticate: import("@aeriajs/types").Contract;
4000
+ readonly activate: import("@aeriajs/types").Contract;
4001
+ readonly createAccount: import("@aeriajs/types").Contract;
4002
+ readonly getInfo: import("@aeriajs/types").Contract;
4003
+ readonly getActivationLink: import("@aeriajs/types").Contract;
4004
+ }>;
4005
+ accessControl: {
4006
+ readonly roles: {
4007
+ readonly root: {
4008
+ readonly grantEverything: true;
4009
+ };
4010
+ readonly guest: {
4011
+ readonly grant: readonly ["authenticate"];
4012
+ };
4013
+ };
4014
+ };
3992
4015
  };
@@ -44,8 +44,7 @@ const describe = async (contextOrPayload) => {
44
44
  result.roles = await (0, access_control_1.getAvailableRoles)();
45
45
  }
46
46
  if (props.router) {
47
- const router = await (0, entrypoint_1.getRouter)();
48
- result.router = router.routesMeta;
47
+ result.router = await (0, api_1.getEndpoints)();
49
48
  }
50
49
  if (props.noSerialize || !('response' in contextOrPayload)) {
51
50
  return result;
@@ -168,14 +168,14 @@ function _ts_generator(thisArg, body) {
168
168
  };
169
169
  }
170
170
  }
171
- import { createContext, preloadDescription } from "@aeriajs/api";
172
- import { getCollections, getRouter } from "@aeriajs/entrypoint";
171
+ import { createContext, preloadDescription, getEndpoints } from "@aeriajs/api";
172
+ import { getCollections } from "@aeriajs/entrypoint";
173
173
  import { serialize, isLeft, left, unwrapEither } from "@aeriajs/common";
174
174
  import { getAvailableRoles } from "@aeriajs/access-control";
175
175
  import { authenticate } from "../collections/user/authenticate.mjs";
176
176
  export var describe = function() {
177
177
  var _ref = _async_to_generator(function(contextOrPayload) {
178
- var _props_collections, result, props, authEither, _tmp, error, auth, collections, retrievedCollections, descriptions, _tmp1, _tmp2, _i, collectionName, candidate, collection, rawDescription, description, router;
178
+ var _props_collections, result, props, authEither, _tmp, error, auth, collections, retrievedCollections, descriptions, _tmp1, _tmp2, _i, collectionName, candidate, collection, rawDescription, description;
179
179
  return _ts_generator(this, function(_state) {
180
180
  switch(_state.label){
181
181
  case 0:
@@ -275,11 +275,10 @@ export var describe = function() {
275
275
  ];
276
276
  return [
277
277
  4,
278
- getRouter()
278
+ getEndpoints()
279
279
  ];
280
280
  case 11:
281
- router = _state.sent();
282
- result.router = router.routesMeta;
281
+ result.router = _state.sent();
283
282
  _state.label = 12;
284
283
  case 12:
285
284
  if (props.noSerialize || !("response" in contextOrPayload)) {