@aeriajs/builtins 0.0.161 → 0.0.163

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.
@@ -1,6 +1,7 @@
1
1
  import type { RouteContext, SchemaWithId, TokenRecipient } from '@aeriajs/types';
2
2
  import type { description } from './collections/user/description.js';
3
- export type TokenableUser = Pick<SchemaWithId<typeof description>, '_id' | 'name' | 'email' | 'roles' | 'active'>;
3
+ type User = SchemaWithId<typeof description>;
4
+ export type TokenableUser = Pick<User, '_id' | 'name' | 'email' | 'roles' | 'active'>;
4
5
  export type SuccessfulAuthentication = {
5
6
  user: TokenableUser & {
6
7
  _id: null;
@@ -25,3 +26,4 @@ export declare const defaultSuccessfulAuthentication: () => Promise<{
25
26
  content: string;
26
27
  };
27
28
  }>;
29
+ export {};
@@ -24,16 +24,11 @@ const successfulAuthentication = async (user, context) => {
24
24
  });
25
25
  }
26
26
  if (context.config.tokenUserProperties) {
27
- const pick = (obj, properties) => properties.reduce((a, prop) => {
28
- if ('prop' in obj) {
29
- return a;
30
- }
31
- return {
32
- ...a,
33
- [prop]: obj[prop],
34
- };
35
- }, {});
36
- tokenContent.userinfo = pick(user, context.config.tokenUserProperties);
27
+ const userinfo = {};
28
+ for (const prop of context.config.tokenUserProperties) {
29
+ userinfo[prop] = user[prop];
30
+ }
31
+ tokenContent.userinfo = userinfo;
37
32
  }
38
33
  const token = await (0, core_1.signToken)(tokenContent);
39
34
  return {
@@ -21,16 +21,11 @@ export const successfulAuthentication = async (user, context) => {
21
21
  });
22
22
  }
23
23
  if (context.config.tokenUserProperties) {
24
- const pick = (obj, properties) => properties.reduce((a, prop) => {
25
- if ("prop" in obj) {
26
- return a;
27
- }
28
- return {
29
- ...a,
30
- [prop]: obj[prop]
31
- };
32
- }, {});
33
- tokenContent.userinfo = pick(user, context.config.tokenUserProperties);
24
+ const userinfo = {};
25
+ for (const prop of context.config.tokenUserProperties) {
26
+ userinfo[prop] = user[prop];
27
+ }
28
+ tokenContent.userinfo = userinfo;
34
29
  }
35
30
  const token = await signToken(tokenContent);
36
31
  return {
@@ -28,10 +28,10 @@ export declare const description: {
28
28
  readonly type: "boolean";
29
29
  };
30
30
  readonly link: {
31
- readonly getter: (value: any) => Promise<string>;
31
+ readonly getter: (doc: object) => Promise<string | undefined>;
32
32
  };
33
33
  readonly download_link: {
34
- readonly getter: (value: any) => Promise<string>;
34
+ readonly getter: (doc: object) => Promise<string | undefined>;
35
35
  };
36
36
  };
37
37
  readonly actions: {
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.description = void 0;
4
+ const mongodb_1 = require("mongodb");
4
5
  const core_1 = require("@aeriajs/core");
5
6
  const entrypoint_1 = require("@aeriajs/entrypoint");
6
7
  const link = async (_id) => {
7
8
  const config = await (0, entrypoint_1.getConfig)();
8
9
  return `${config.publicUrl || ''}/file/${_id}`;
9
10
  };
10
- const timestamp = (lastModified) => lastModified
11
+ const timestamp = (lastModified) => lastModified instanceof Date
11
12
  ? new Date(lastModified).getTime()
12
13
  : 'fresh';
13
14
  exports.description = (0, core_1.defineDescription)({
@@ -44,13 +45,17 @@ exports.description = (0, core_1.defineDescription)({
44
45
  type: 'boolean',
45
46
  },
46
47
  link: {
47
- getter: async (value) => {
48
- return `${await link(value._id)}/${timestamp(value.last_modified)}`;
48
+ getter: async (doc) => {
49
+ if ('_id' in doc && 'last_modified' in doc && doc._id instanceof mongodb_1.ObjectId) {
50
+ return `${await link(doc._id)}/${timestamp(doc.last_modified)}`;
51
+ }
49
52
  },
50
53
  },
51
54
  download_link: {
52
- getter: async (value) => {
53
- return `${await link(value._id)}/download/${timestamp(value.last_modified)}`;
55
+ getter: async (doc) => {
56
+ if ('_id' in doc && 'last_modified' in doc && doc._id instanceof mongodb_1.ObjectId) {
57
+ return `${await link(doc._id)}/download/${timestamp(doc.last_modified)}`;
58
+ }
54
59
  },
55
60
  },
56
61
  },
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
+ import { ObjectId } from "mongodb";
2
3
  import { defineDescription } from "@aeriajs/core";
3
4
  import { getConfig } from "@aeriajs/entrypoint";
4
5
  const link = async (_id) => {
5
6
  const config = await getConfig();
6
7
  return `${config.publicUrl || ""}/file/${_id}`;
7
8
  };
8
- const timestamp = (lastModified) => lastModified ? new Date(lastModified).getTime() : "fresh";
9
+ const timestamp = (lastModified) => lastModified instanceof Date ? new Date(lastModified).getTime() : "fresh";
9
10
  export const description = defineDescription({
10
11
  $id: "file",
11
12
  icon: "paperclip",
@@ -40,13 +41,17 @@ export const description = defineDescription({
40
41
  type: "boolean"
41
42
  },
42
43
  link: {
43
- getter: async (value) => {
44
- return `${await link(value._id)}/${timestamp(value.last_modified)}`;
44
+ getter: async (doc) => {
45
+ if ("_id" in doc && "last_modified" in doc && doc._id instanceof ObjectId) {
46
+ return `${await link(doc._id)}/${timestamp(doc.last_modified)}`;
47
+ }
45
48
  }
46
49
  },
47
50
  download_link: {
48
- getter: async (value) => {
49
- return `${await link(value._id)}/download/${timestamp(value.last_modified)}`;
51
+ getter: async (doc) => {
52
+ if ("_id" in doc && "last_modified" in doc && doc._id instanceof ObjectId) {
53
+ return `${await link(doc._id)}/download/${timestamp(doc.last_modified)}`;
54
+ }
50
55
  }
51
56
  }
52
57
  },
@@ -127,10 +127,10 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
127
127
  readonly type: "boolean";
128
128
  };
129
129
  readonly link: {
130
- readonly getter: (value: any) => Promise<string>;
130
+ readonly getter: (doc: object) => Promise<string | undefined>;
131
131
  };
132
132
  readonly download_link: {
133
- readonly getter: (value: any) => Promise<string>;
133
+ readonly getter: (doc: object) => Promise<string | undefined>;
134
134
  };
135
135
  };
136
136
  readonly actions: {
@@ -184,10 +184,10 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
184
184
  readonly type: "boolean";
185
185
  };
186
186
  readonly link: {
187
- readonly getter: (value: any) => Promise<string>;
187
+ readonly getter: (doc: object) => Promise<string | undefined>;
188
188
  };
189
189
  readonly download_link: {
190
- readonly getter: (value: any) => Promise<string>;
190
+ readonly getter: (doc: object) => Promise<string | undefined>;
191
191
  };
192
192
  };
193
193
  readonly actions: {
@@ -279,10 +279,10 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
279
279
  readonly type: "boolean";
280
280
  };
281
281
  readonly link: {
282
- readonly getter: (value: any) => Promise<string>;
282
+ readonly getter: (doc: object) => Promise<string | undefined>;
283
283
  };
284
284
  readonly download_link: {
285
- readonly getter: (value: any) => Promise<string>;
285
+ readonly getter: (doc: object) => Promise<string | undefined>;
286
286
  };
287
287
  };
288
288
  readonly actions: {
@@ -330,10 +330,10 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
330
330
  readonly type: "boolean";
331
331
  };
332
332
  readonly link: {
333
- readonly getter: (value: any) => Promise<string>;
333
+ readonly getter: (doc: object) => Promise<string | undefined>;
334
334
  };
335
335
  readonly download_link: {
336
- readonly getter: (value: any) => Promise<string>;
336
+ readonly getter: (doc: object) => Promise<string | undefined>;
337
337
  };
338
338
  };
339
339
  readonly actions: {
@@ -387,10 +387,10 @@ export declare const file: Omit<import("@aeriajs/types").Collection<{
387
387
  readonly type: "boolean";
388
388
  };
389
389
  readonly link: {
390
- readonly getter: (value: any) => Promise<string>;
390
+ readonly getter: (doc: object) => Promise<string | undefined>;
391
391
  };
392
392
  readonly download_link: {
393
- readonly getter: (value: any) => Promise<string>;
393
+ readonly getter: (doc: object) => Promise<string | undefined>;
394
394
  };
395
395
  };
396
396
  readonly actions: {
@@ -34,10 +34,10 @@ export declare const insert: (payload: {
34
34
  readonly type: "boolean";
35
35
  };
36
36
  readonly link: {
37
- readonly getter: (value: any) => Promise<string>;
37
+ readonly getter: (doc: object) => Promise<string | undefined>;
38
38
  };
39
39
  readonly download_link: {
40
- readonly getter: (value: any) => Promise<string>;
40
+ readonly getter: (doc: object) => Promise<string | undefined>;
41
41
  };
42
42
  };
43
43
  readonly actions: {
@@ -28,15 +28,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<{
28
28
  };
29
29
  functions: {
30
30
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
31
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
32
- readonly _tag: "Error";
33
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
34
- readonly result: undefined;
35
- } | {
36
- readonly _tag: "Result";
37
- readonly error: undefined;
38
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
39
- }>;
31
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
40
32
  readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
41
33
  };
42
34
  exposedFunctions: {
@@ -101,15 +93,7 @@ export declare const log: Omit<import("@aeriajs/types").Collection<{
101
93
  };
102
94
  functions: {
103
95
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
104
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
105
- readonly _tag: "Error";
106
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
107
- readonly result: undefined;
108
- } | {
109
- readonly _tag: "Result";
110
- readonly error: undefined;
111
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
112
- }>;
96
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
113
97
  readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
114
98
  };
115
99
  contracts: {
@@ -13,10 +13,10 @@ export declare const description: {
13
13
  readonly type: "string";
14
14
  };
15
15
  readonly given_name: {
16
- readonly getter: (document: any) => any;
16
+ readonly getter: (doc: object) => string | undefined;
17
17
  };
18
18
  readonly family_name: {
19
- readonly getter: (document: any) => any;
19
+ readonly getter: (doc: object) => string | undefined;
20
20
  };
21
21
  readonly active: {
22
22
  readonly type: "boolean";
@@ -47,7 +47,7 @@ export declare const description: {
47
47
  readonly accept: readonly ["image/*"];
48
48
  };
49
49
  readonly picture: {
50
- readonly getter: (value: any) => any;
50
+ readonly getter: (doc: object) => string | undefined;
51
51
  };
52
52
  readonly group: {
53
53
  readonly type: "string";
@@ -28,13 +28,17 @@ exports.description = (0, core_1.defineDescription)({
28
28
  type: 'string',
29
29
  },
30
30
  given_name: {
31
- getter: (document) => {
32
- return document.name?.split(' ')[0];
31
+ getter: (doc) => {
32
+ if ('name' in doc && typeof doc.name === 'string') {
33
+ return doc.name.split(' ')[0];
34
+ }
33
35
  },
34
36
  },
35
37
  family_name: {
36
- getter: (document) => {
37
- return document.name?.split(' ')[1];
38
+ getter: (doc) => {
39
+ if ('name' in doc && typeof doc.name === 'string') {
40
+ return doc.name.split(' ')[1];
41
+ }
38
42
  },
39
43
  },
40
44
  active: {
@@ -66,8 +70,10 @@ exports.description = (0, core_1.defineDescription)({
66
70
  accept: ['image/*'],
67
71
  },
68
72
  picture: {
69
- getter: (value) => {
70
- return value.picture_file?.link;
73
+ getter: (doc) => {
74
+ if ('picture_file' in doc && doc.picture_file instanceof Object && 'link' in doc.picture_file && typeof doc.picture_file.link === 'string') {
75
+ return doc.picture_file.link;
76
+ }
71
77
  },
72
78
  },
73
79
  group: {
@@ -22,13 +22,17 @@ export const description = defineDescription({
22
22
  type: "string"
23
23
  },
24
24
  given_name: {
25
- getter: (document) => {
26
- return document.name?.split(" ")[0];
25
+ getter: (doc) => {
26
+ if ("name" in doc && typeof doc.name === "string") {
27
+ return doc.name.split(" ")[0];
28
+ }
27
29
  }
28
30
  },
29
31
  family_name: {
30
- getter: (document) => {
31
- return document.name?.split(" ")[1];
32
+ getter: (doc) => {
33
+ if ("name" in doc && typeof doc.name === "string") {
34
+ return doc.name.split(" ")[1];
35
+ }
32
36
  }
33
37
  },
34
38
  active: {
@@ -60,8 +64,10 @@ export const description = defineDescription({
60
64
  accept: ["image/*"]
61
65
  },
62
66
  picture: {
63
- getter: (value) => {
64
- return value.picture_file?.link;
67
+ getter: (doc) => {
68
+ if ("picture_file" in doc && doc.picture_file instanceof Object && "link" in doc.picture_file && typeof doc.picture_file.link === "string") {
69
+ return doc.picture_file.link;
70
+ }
65
71
  }
66
72
  },
67
73
  group: {
@@ -19,10 +19,10 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
19
19
  readonly type: "string";
20
20
  };
21
21
  readonly given_name: {
22
- readonly getter: (document: any) => any;
22
+ readonly getter: (doc: object) => string | undefined;
23
23
  };
24
24
  readonly family_name: {
25
- readonly getter: (document: any) => any;
25
+ readonly getter: (doc: object) => string | undefined;
26
26
  };
27
27
  readonly active: {
28
28
  readonly type: "boolean";
@@ -53,7 +53,7 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
53
53
  readonly accept: readonly ["image/*"];
54
54
  };
55
55
  readonly picture: {
56
- readonly getter: (value: any) => any;
56
+ readonly getter: (doc: object) => string | undefined;
57
57
  };
58
58
  readonly group: {
59
59
  readonly type: "string";
@@ -11,10 +11,10 @@ export declare const user: {
11
11
  readonly type: "string";
12
12
  };
13
13
  readonly given_name: {
14
- readonly getter: (document: any) => any;
14
+ readonly getter: (doc: object) => string | undefined;
15
15
  };
16
16
  readonly family_name: {
17
- readonly getter: (document: any) => any;
17
+ readonly getter: (doc: object) => string | undefined;
18
18
  };
19
19
  readonly active: {
20
20
  readonly type: "boolean";
@@ -45,7 +45,7 @@ export declare const user: {
45
45
  readonly accept: readonly ["image/*"];
46
46
  };
47
47
  readonly picture: {
48
- readonly getter: (value: any) => any;
48
+ readonly getter: (doc: object) => string | undefined;
49
49
  };
50
50
  readonly group: {
51
51
  readonly type: "string";
@@ -102,15 +102,7 @@ export declare const user: {
102
102
  };
103
103
  functions: {
104
104
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
105
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
106
- readonly _tag: "Error";
107
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
108
- readonly result: undefined;
109
- } | {
110
- readonly _tag: "Result";
111
- readonly error: undefined;
112
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
113
- }>;
105
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
114
106
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
115
107
  readonly _tag: "Result";
116
108
  readonly error: undefined;
@@ -267,10 +259,10 @@ export declare const user: {
267
259
  readonly type: "string";
268
260
  };
269
261
  readonly given_name: {
270
- readonly getter: (document: any) => any;
262
+ readonly getter: (doc: object) => string | undefined;
271
263
  };
272
264
  readonly family_name: {
273
- readonly getter: (document: any) => any;
265
+ readonly getter: (doc: object) => string | undefined;
274
266
  };
275
267
  readonly active: {
276
268
  readonly type: "boolean";
@@ -301,7 +293,7 @@ export declare const user: {
301
293
  readonly accept: readonly ["image/*"];
302
294
  };
303
295
  readonly picture: {
304
- readonly getter: (value: any) => any;
296
+ readonly getter: (doc: object) => string | undefined;
305
297
  };
306
298
  readonly group: {
307
299
  readonly type: "string";
@@ -395,10 +387,10 @@ export declare const user: {
395
387
  readonly type: "string";
396
388
  };
397
389
  readonly given_name: {
398
- readonly getter: (document: any) => any;
390
+ readonly getter: (doc: object) => string | undefined;
399
391
  };
400
392
  readonly family_name: {
401
- readonly getter: (document: any) => any;
393
+ readonly getter: (doc: object) => string | undefined;
402
394
  };
403
395
  readonly active: {
404
396
  readonly type: "boolean";
@@ -429,7 +421,7 @@ export declare const user: {
429
421
  readonly accept: readonly ["image/*"];
430
422
  };
431
423
  readonly picture: {
432
- readonly getter: (value: any) => any;
424
+ readonly getter: (doc: object) => string | undefined;
433
425
  };
434
426
  readonly group: {
435
427
  readonly type: "string";
@@ -495,10 +487,10 @@ export declare const user: {
495
487
  readonly type: "string";
496
488
  };
497
489
  readonly given_name: {
498
- readonly getter: (document: any) => any;
490
+ readonly getter: (doc: object) => string | undefined;
499
491
  };
500
492
  readonly family_name: {
501
- readonly getter: (document: any) => any;
493
+ readonly getter: (doc: object) => string | undefined;
502
494
  };
503
495
  readonly active: {
504
496
  readonly type: "boolean";
@@ -529,7 +521,7 @@ export declare const user: {
529
521
  readonly accept: readonly ["image/*"];
530
522
  };
531
523
  readonly picture: {
532
- readonly getter: (value: any) => any;
524
+ readonly getter: (doc: object) => string | undefined;
533
525
  };
534
526
  readonly group: {
535
527
  readonly type: "string";
@@ -586,15 +578,7 @@ export declare const user: {
586
578
  };
587
579
  functions: {
588
580
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
589
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
590
- readonly _tag: "Error";
591
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
592
- readonly result: undefined;
593
- } | {
594
- readonly _tag: "Result";
595
- readonly error: undefined;
596
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
597
- }>;
581
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
598
582
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
599
583
  readonly _tag: "Result";
600
584
  readonly error: undefined;
@@ -751,10 +735,10 @@ export declare const user: {
751
735
  readonly type: "string";
752
736
  };
753
737
  readonly given_name: {
754
- readonly getter: (document: any) => any;
738
+ readonly getter: (doc: object) => string | undefined;
755
739
  };
756
740
  readonly family_name: {
757
- readonly getter: (document: any) => any;
741
+ readonly getter: (doc: object) => string | undefined;
758
742
  };
759
743
  readonly active: {
760
744
  readonly type: "boolean";
@@ -785,7 +769,7 @@ export declare const user: {
785
769
  readonly accept: readonly ["image/*"];
786
770
  };
787
771
  readonly picture: {
788
- readonly getter: (value: any) => any;
772
+ readonly getter: (doc: object) => string | undefined;
789
773
  };
790
774
  readonly group: {
791
775
  readonly type: "string";
package/dist/index.d.ts CHANGED
@@ -40,10 +40,10 @@ export declare const collections: {
40
40
  readonly type: "boolean";
41
41
  };
42
42
  readonly link: {
43
- readonly getter: (value: any) => Promise<string>;
43
+ readonly getter: (doc: object) => Promise<string | undefined>;
44
44
  };
45
45
  readonly download_link: {
46
- readonly getter: (value: any) => Promise<string>;
46
+ readonly getter: (doc: object) => Promise<string | undefined>;
47
47
  };
48
48
  };
49
49
  readonly actions: {
@@ -97,10 +97,10 @@ export declare const collections: {
97
97
  readonly type: "boolean";
98
98
  };
99
99
  readonly link: {
100
- readonly getter: (value: any) => Promise<string>;
100
+ readonly getter: (doc: object) => Promise<string | undefined>;
101
101
  };
102
102
  readonly download_link: {
103
- readonly getter: (value: any) => Promise<string>;
103
+ readonly getter: (doc: object) => Promise<string | undefined>;
104
104
  };
105
105
  };
106
106
  readonly actions: {
@@ -192,10 +192,10 @@ export declare const collections: {
192
192
  readonly type: "boolean";
193
193
  };
194
194
  readonly link: {
195
- readonly getter: (value: any) => Promise<string>;
195
+ readonly getter: (doc: object) => Promise<string | undefined>;
196
196
  };
197
197
  readonly download_link: {
198
- readonly getter: (value: any) => Promise<string>;
198
+ readonly getter: (doc: object) => Promise<string | undefined>;
199
199
  };
200
200
  };
201
201
  readonly actions: {
@@ -243,10 +243,10 @@ export declare const collections: {
243
243
  readonly type: "boolean";
244
244
  };
245
245
  readonly link: {
246
- readonly getter: (value: any) => Promise<string>;
246
+ readonly getter: (doc: object) => Promise<string | undefined>;
247
247
  };
248
248
  readonly download_link: {
249
- readonly getter: (value: any) => Promise<string>;
249
+ readonly getter: (doc: object) => Promise<string | undefined>;
250
250
  };
251
251
  };
252
252
  readonly actions: {
@@ -300,10 +300,10 @@ export declare const collections: {
300
300
  readonly type: "boolean";
301
301
  };
302
302
  readonly link: {
303
- readonly getter: (value: any) => Promise<string>;
303
+ readonly getter: (doc: object) => Promise<string | undefined>;
304
304
  };
305
305
  readonly download_link: {
306
- readonly getter: (value: any) => Promise<string>;
306
+ readonly getter: (doc: object) => Promise<string | undefined>;
307
307
  };
308
308
  };
309
309
  readonly actions: {
@@ -492,15 +492,7 @@ export declare const collections: {
492
492
  };
493
493
  functions: {
494
494
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
495
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
496
- readonly _tag: "Error";
497
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
498
- readonly result: undefined;
499
- } | {
500
- readonly _tag: "Result";
501
- readonly error: undefined;
502
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
503
- }>;
495
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
504
496
  readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
505
497
  };
506
498
  exposedFunctions: {
@@ -565,15 +557,7 @@ export declare const collections: {
565
557
  };
566
558
  functions: {
567
559
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
568
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
569
- readonly _tag: "Error";
570
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
571
- readonly result: undefined;
572
- } | {
573
- readonly _tag: "Result";
574
- readonly error: undefined;
575
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
576
- }>;
560
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
577
561
  readonly insert: (payload: import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").InsertOptions) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
578
562
  };
579
563
  contracts: {
@@ -706,10 +690,10 @@ export declare const collections: {
706
690
  readonly type: "string";
707
691
  };
708
692
  readonly given_name: {
709
- readonly getter: (document: any) => any;
693
+ readonly getter: (doc: object) => string | undefined;
710
694
  };
711
695
  readonly family_name: {
712
- readonly getter: (document: any) => any;
696
+ readonly getter: (doc: object) => string | undefined;
713
697
  };
714
698
  readonly active: {
715
699
  readonly type: "boolean";
@@ -740,7 +724,7 @@ export declare const collections: {
740
724
  readonly accept: readonly ["image/*"];
741
725
  };
742
726
  readonly picture: {
743
- readonly getter: (value: any) => any;
727
+ readonly getter: (doc: object) => string | undefined;
744
728
  };
745
729
  readonly group: {
746
730
  readonly type: "string";
@@ -797,15 +781,7 @@ export declare const collections: {
797
781
  };
798
782
  functions: {
799
783
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
800
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
801
- readonly _tag: "Error";
802
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
803
- readonly result: undefined;
804
- } | {
805
- readonly _tag: "Result";
806
- readonly error: undefined;
807
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
808
- }>;
784
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
809
785
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
810
786
  readonly _tag: "Result";
811
787
  readonly error: undefined;
@@ -962,10 +938,10 @@ export declare const collections: {
962
938
  readonly type: "string";
963
939
  };
964
940
  readonly given_name: {
965
- readonly getter: (document: any) => any;
941
+ readonly getter: (doc: object) => string | undefined;
966
942
  };
967
943
  readonly family_name: {
968
- readonly getter: (document: any) => any;
944
+ readonly getter: (doc: object) => string | undefined;
969
945
  };
970
946
  readonly active: {
971
947
  readonly type: "boolean";
@@ -996,7 +972,7 @@ export declare const collections: {
996
972
  readonly accept: readonly ["image/*"];
997
973
  };
998
974
  readonly picture: {
999
- readonly getter: (value: any) => any;
975
+ readonly getter: (doc: object) => string | undefined;
1000
976
  };
1001
977
  readonly group: {
1002
978
  readonly type: "string";
@@ -1090,10 +1066,10 @@ export declare const collections: {
1090
1066
  readonly type: "string";
1091
1067
  };
1092
1068
  readonly given_name: {
1093
- readonly getter: (document: any) => any;
1069
+ readonly getter: (doc: object) => string | undefined;
1094
1070
  };
1095
1071
  readonly family_name: {
1096
- readonly getter: (document: any) => any;
1072
+ readonly getter: (doc: object) => string | undefined;
1097
1073
  };
1098
1074
  readonly active: {
1099
1075
  readonly type: "boolean";
@@ -1124,7 +1100,7 @@ export declare const collections: {
1124
1100
  readonly accept: readonly ["image/*"];
1125
1101
  };
1126
1102
  readonly picture: {
1127
- readonly getter: (value: any) => any;
1103
+ readonly getter: (doc: object) => string | undefined;
1128
1104
  };
1129
1105
  readonly group: {
1130
1106
  readonly type: "string";
@@ -1190,10 +1166,10 @@ export declare const collections: {
1190
1166
  readonly type: "string";
1191
1167
  };
1192
1168
  readonly given_name: {
1193
- readonly getter: (document: any) => any;
1169
+ readonly getter: (doc: object) => string | undefined;
1194
1170
  };
1195
1171
  readonly family_name: {
1196
- readonly getter: (document: any) => any;
1172
+ readonly getter: (doc: object) => string | undefined;
1197
1173
  };
1198
1174
  readonly active: {
1199
1175
  readonly type: "boolean";
@@ -1224,7 +1200,7 @@ export declare const collections: {
1224
1200
  readonly accept: readonly ["image/*"];
1225
1201
  };
1226
1202
  readonly picture: {
1227
- readonly getter: (value: any) => any;
1203
+ readonly getter: (doc: object) => string | undefined;
1228
1204
  };
1229
1205
  readonly group: {
1230
1206
  readonly type: "string";
@@ -1281,15 +1257,7 @@ export declare const collections: {
1281
1257
  };
1282
1258
  functions: {
1283
1259
  readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
1284
- readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<{
1285
- readonly _tag: "Error";
1286
- readonly error: import("@aeriajs/types").ACError.InvalidLimit | import("@aeriajs/types").ACError.OwnershipError;
1287
- readonly result: undefined;
1288
- } | {
1289
- readonly _tag: "Result";
1290
- readonly error: undefined;
1291
- readonly result: import("@aeriajs/types").SchemaWithId<any>[];
1292
- }>;
1260
+ readonly getAll: (payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").Result.Either<any, any>>;
1293
1261
  readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
1294
1262
  readonly _tag: "Result";
1295
1263
  readonly error: undefined;
@@ -1446,10 +1414,10 @@ export declare const collections: {
1446
1414
  readonly type: "string";
1447
1415
  };
1448
1416
  readonly given_name: {
1449
- readonly getter: (document: any) => any;
1417
+ readonly getter: (doc: object) => string | undefined;
1450
1418
  };
1451
1419
  readonly family_name: {
1452
- readonly getter: (document: any) => any;
1420
+ readonly getter: (doc: object) => string | undefined;
1453
1421
  };
1454
1422
  readonly active: {
1455
1423
  readonly type: "boolean";
@@ -1480,7 +1448,7 @@ export declare const collections: {
1480
1448
  readonly accept: readonly ["image/*"];
1481
1449
  };
1482
1450
  readonly picture: {
1483
- readonly getter: (value: any) => any;
1451
+ readonly getter: (doc: object) => string | undefined;
1484
1452
  };
1485
1453
  readonly group: {
1486
1454
  readonly type: "string";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.161",
3
+ "version": "0.0.163",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -45,11 +45,11 @@
45
45
  "mongodb": "^6.5.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@aeriajs/core": "^0.0.161",
49
- "@aeriajs/common": "^0.0.98",
50
- "@aeriajs/entrypoint": "^0.0.100",
51
- "@aeriajs/types": "^0.0.84",
52
- "@aeriajs/validation": "^0.0.101"
48
+ "@aeriajs/core": "^0.0.163",
49
+ "@aeriajs/common": "^0.0.99",
50
+ "@aeriajs/entrypoint": "^0.0.101",
51
+ "@aeriajs/types": "^0.0.85",
52
+ "@aeriajs/validation": "^0.0.102"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",