@aeriajs/builtins 0.0.187 → 0.0.188

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.
@@ -3,9 +3,7 @@ import type { description } from './collections/user/description.js';
3
3
  type User = SchemaWithId<typeof description>;
4
4
  export type TokenableUser = Pick<User, '_id' | 'name' | 'email' | 'roles' | 'active'>;
5
5
  export type SuccessfulAuthentication = {
6
- user: TokenableUser & {
7
- _id: null;
8
- };
6
+ user: TokenableUser;
9
7
  token: TokenRecipient;
10
8
  };
11
9
  export declare enum AuthenticationError {
@@ -42,7 +42,7 @@ const successfulAuthentication = async (user, context) => {
42
42
  exports.successfulAuthentication = successfulAuthentication;
43
43
  const defaultSuccessfulAuthentication = async () => {
44
44
  const token = await (0, core_1.signToken)({
45
- _id: null,
45
+ sub: null,
46
46
  roles: ['root'],
47
47
  userinfo: {},
48
48
  });
@@ -38,7 +38,7 @@ export const successfulAuthentication = async (user, context) => {
38
38
  };
39
39
  export const defaultSuccessfulAuthentication = async () => {
40
40
  const token = await signToken({
41
- _id: null,
41
+ sub: null,
42
42
  roles: ["root"],
43
43
  userinfo: {}
44
44
  });
@@ -258,12 +258,8 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
258
258
  removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
259
259
  readonly _tag: "Result";
260
260
  readonly error: undefined;
261
- readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
261
+ readonly result: import("mongodb").DeleteResult;
262
262
  } | import("@aeriajs/types").Result.Error<{
263
- readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
264
- } & {
265
- httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
266
- }> | import("@aeriajs/types").Result.Error<{
267
263
  readonly code: import("@aeriajs/types").ACError.OwnershipError;
268
264
  } & {
269
265
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
@@ -9,7 +9,9 @@ const insert = async (payload, context) => {
9
9
  throw new Error('');
10
10
  }
11
11
  const { content, ...what } = Object.assign({}, payload.what);
12
- what.owner = context.token.sub;
12
+ if (context.token.sub) {
13
+ what.owner = context.token.sub;
14
+ }
13
15
  const extension = what.name.split('.').at(-1);
14
16
  if (!context.config.storage) {
15
17
  throw new Error('config.storage is not set');
@@ -7,7 +7,9 @@ export const insert = async (payload, context) => {
7
7
  throw new Error("");
8
8
  }
9
9
  const { content, ...what } = Object.assign({}, payload.what);
10
- what.owner = context.token.sub;
10
+ if (context.token.sub) {
11
+ what.owner = context.token.sub;
12
+ }
11
13
  const extension = what.name.split(".").at(-1);
12
14
  if (!context.config.storage) {
13
15
  throw new Error("config.storage is not set");
@@ -1,14 +1,10 @@
1
- import type { Context, SchemaWithId, PackReferences, RemoveAllPayload } from '@aeriajs/types';
1
+ import type { Context, RemoveAllPayload } from '@aeriajs/types';
2
2
  import type { description } from './description.js';
3
3
  export declare const removeAll: (payload: RemoveAllPayload, context: Context<typeof description>) => Promise<{
4
4
  readonly _tag: "Result";
5
5
  readonly error: undefined;
6
- readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
6
+ readonly result: import("mongodb").DeleteResult;
7
7
  } | import("@aeriajs/types").Result.Error<{
8
- readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
9
- } & {
10
- httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
11
- }> | import("@aeriajs/types").Result.Error<{
12
8
  readonly code: import("@aeriajs/types").ACError.OwnershipError;
13
9
  } & {
14
10
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
@@ -22,6 +22,6 @@ const removeAll = async (payload, context) => {
22
22
  console.trace(err);
23
23
  }
24
24
  }
25
- return (0, core_1.remove)(payload, context);
25
+ return (0, core_1.removeAll)(payload, context);
26
26
  };
27
27
  exports.removeAll = removeAll;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- import { remove as originalRemoveAll } from "@aeriajs/core";
2
+ import { removeAll as originalRemoveAll } from "@aeriajs/core";
3
3
  import * as fs from "fs/promises";
4
4
  export const removeAll = async (payload, context) => {
5
5
  const files = context.collection.model.find({
@@ -1,5 +1,6 @@
1
1
  import type { Context } from '@aeriajs/types';
2
2
  import type { description } from './description.js';
3
+ import { ObjectId } from '@aeriajs/core';
3
4
  import { Result, ACError, HTTPStatus } from '@aeriajs/types';
4
5
  export declare enum ActivationError {
5
6
  UserNotFound = "USER_NOT_FOUND",
@@ -38,6 +39,6 @@ export declare const activate: (payload: {
38
39
  readonly _tag: "Result";
39
40
  readonly error: undefined;
40
41
  readonly result: {
41
- readonly userId: any;
42
+ readonly userId: ObjectId;
42
43
  };
43
44
  } | undefined>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCurrentUser = exports.ActivationError = void 0;
4
4
  const types_1 = require("@aeriajs/types");
5
+ const core_1 = require("@aeriajs/core");
5
6
  const authentication_js_1 = require("../../authentication.js");
6
7
  var ActivationError;
7
8
  (function (ActivationError) {
@@ -17,11 +18,11 @@ const getCurrentUser = async (_payload, context) => {
17
18
  const { user } = await (0, authentication_js_1.defaultSuccessfulAuthentication)();
18
19
  return types_1.Result.result(user);
19
20
  }
20
- const { error, result: user } = await context.collections.user.functions.get({
21
+ const { error, result: user } = await (0, core_1.get)({
21
22
  filters: {
22
23
  _id: context.token.sub,
23
24
  },
24
- });
25
+ }, context);
25
26
  if (error) {
26
27
  throw new Error();
27
28
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  import { Result } from "@aeriajs/types";
3
+ import { get } from "@aeriajs/core";
3
4
  import { defaultSuccessfulAuthentication } from "../../authentication.mjs";
4
5
  export var ActivationError = /* @__PURE__ */ ((ActivationError2) => {
5
6
  ActivationError2["UserNotFound"] = "USER_NOT_FOUND";
@@ -15,11 +16,11 @@ export const getCurrentUser = async (_payload, context) => {
15
16
  const { user: user2 } = await defaultSuccessfulAuthentication();
16
17
  return Result.result(user2);
17
18
  }
18
- const { error, result: user } = await context.collections.user.functions.get({
19
+ const { error, result: user } = await get({
19
20
  filters: {
20
21
  _id: context.token.sub
21
22
  }
22
- });
23
+ }, context);
23
24
  if (error) {
24
25
  throw new Error();
25
26
  }
@@ -25,7 +25,7 @@ export declare const getInfo: (payload: {
25
25
  readonly _tag: "Result";
26
26
  readonly error: undefined;
27
27
  readonly result: {
28
- readonly name: any;
29
- readonly email: any;
28
+ readonly name: string;
29
+ readonly email: string;
30
30
  };
31
31
  }>;
@@ -204,9 +204,9 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
204
204
  };
205
205
  };
206
206
  functions: {
207
- get: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
208
- getAll: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>> | undefined, context: TContext, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").GetAllReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
209
- remove: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
207
+ readonly get: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
208
+ readonly getAll: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>> | undefined, context: TContext, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").GetAllReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
209
+ readonly remove: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
210
210
  readonly _tag: "Result";
211
211
  readonly error: undefined;
212
212
  readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
@@ -219,7 +219,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
219
219
  } & {
220
220
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
221
221
  }>>;
222
- upload: <TContext extends import("@aeriajs/types").Context>(_props: unknown, context: TContext) => Promise<import("@aeriajs/types").Result.Error<{
222
+ readonly upload: <TContext extends import("@aeriajs/types").Context>(_props: unknown, context: TContext) => Promise<import("@aeriajs/types").Result.Error<{
223
223
  readonly code: import("@aeriajs/types").ACError.MalformedInput;
224
224
  readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
225
225
  } & {
@@ -231,7 +231,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
231
231
  readonly tempId: any;
232
232
  };
233
233
  }>;
234
- removeFile: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext, options?: import("@aeriajs/core").RemoveFileOptions) => Promise<{
234
+ readonly removeFile: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext, options?: import("@aeriajs/core").RemoveFileOptions) => Promise<{
235
235
  readonly _tag: "Result";
236
236
  readonly error: undefined;
237
237
  readonly result: any;
@@ -240,8 +240,8 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
240
240
  } & {
241
241
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
242
242
  }>>;
243
- insert: <TDescription extends import("@aeriajs/types").Description, TInsertPayload extends import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<TDescription>>>(payload: NoInfer<TInsertPayload>, context: import("@aeriajs/types").Context<TDescription>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<TDescription>>>;
244
- authenticate: (props: {
243
+ readonly insert: <TDescription extends import("@aeriajs/types").Description, TInsertPayload extends import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<TDescription>>>(payload: NoInfer<TInsertPayload>, context: import("@aeriajs/types").Context<TDescription>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<TDescription>>>;
244
+ readonly authenticate: (props: {
245
245
  email: string;
246
246
  password: string;
247
247
  } | {
@@ -280,7 +280,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
280
280
  } & {
281
281
  httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
282
282
  }>>;
283
- activate: (payload: {
283
+ readonly activate: (payload: {
284
284
  password: string;
285
285
  }, context: import("@aeriajs/types").Context<typeof description> & {
286
286
  request: {
@@ -312,10 +312,10 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
312
312
  readonly _tag: "Result";
313
313
  readonly error: undefined;
314
314
  readonly result: {
315
- readonly userId: any;
315
+ readonly userId: import("@aeriajs/core").ObjectId;
316
316
  };
317
317
  } | undefined>;
318
- createAccount: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof description>>> & Record<string, unknown>, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").Result.Error<{
318
+ readonly createAccount: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof description>>> & Record<string, unknown>, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").Result.Error<{
319
319
  readonly code: import("./createAccount.js").CreateAccountError;
320
320
  } & {
321
321
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
@@ -425,7 +425,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
425
425
  };
426
426
  };
427
427
  }>>>;
428
- getInfo: (payload: {
428
+ readonly getInfo: (payload: {
429
429
  userId: string;
430
430
  token: string;
431
431
  }, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").Result.Error<{
@@ -444,11 +444,11 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
444
444
  readonly _tag: "Result";
445
445
  readonly error: undefined;
446
446
  readonly result: {
447
- readonly name: any;
448
- readonly email: any;
447
+ readonly name: string;
448
+ readonly email: string;
449
449
  };
450
450
  }>;
451
- getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
451
+ readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
452
452
  readonly _tag: "Result";
453
453
  readonly error: undefined;
454
454
  readonly result: {
@@ -563,7 +563,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
563
563
  };
564
564
  }>;
565
565
  }>;
566
- getActivationLink: (payload: {
566
+ readonly getActivationLink: (payload: {
567
567
  userId: import("@aeriajs/core").ObjectId | string;
568
568
  }, context: import("@aeriajs/types").Context) => Promise<{
569
569
  readonly _tag: "Error";
@@ -582,17 +582,17 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
582
582
  }>;
583
583
  };
584
584
  contracts: {
585
- get?: import("@aeriajs/types").Contract | undefined;
586
- getAll?: import("@aeriajs/types").Contract | undefined;
587
- remove?: import("@aeriajs/types").Contract | undefined;
588
- upload?: import("@aeriajs/types").Contract | undefined;
589
- removeFile?: import("@aeriajs/types").Contract | undefined;
590
- insert?: import("@aeriajs/types").Contract | undefined;
591
- authenticate?: import("@aeriajs/types").Contract | undefined;
592
- activate?: import("@aeriajs/types").Contract | undefined;
593
- createAccount?: import("@aeriajs/types").Contract | undefined;
594
- getInfo?: import("@aeriajs/types").Contract | undefined;
595
- getCurrentUser?: import("@aeriajs/types").Contract | undefined;
596
- getActivationLink?: import("@aeriajs/types").Contract | undefined;
585
+ readonly get?: import("@aeriajs/types").Contract | undefined;
586
+ readonly getAll?: import("@aeriajs/types").Contract | undefined;
587
+ readonly remove?: import("@aeriajs/types").Contract | undefined;
588
+ readonly upload?: import("@aeriajs/types").Contract | undefined;
589
+ readonly removeFile?: import("@aeriajs/types").Contract | undefined;
590
+ readonly insert?: import("@aeriajs/types").Contract | undefined;
591
+ readonly authenticate?: import("@aeriajs/types").Contract | undefined;
592
+ readonly activate?: import("@aeriajs/types").Contract | undefined;
593
+ readonly createAccount?: import("@aeriajs/types").Contract | undefined;
594
+ readonly getInfo?: import("@aeriajs/types").Contract | undefined;
595
+ readonly getCurrentUser?: import("@aeriajs/types").Contract | undefined;
596
+ readonly getActivationLink?: import("@aeriajs/types").Contract | undefined;
597
597
  };
598
598
  };
package/dist/index.d.ts CHANGED
@@ -202,12 +202,8 @@ export declare const collections: {
202
202
  removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<typeof import("./collections/file/description.js").description>) => Promise<{
203
203
  readonly _tag: "Result";
204
204
  readonly error: undefined;
205
- readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
205
+ readonly result: import("mongodb").DeleteResult;
206
206
  } | import("@aeriajs/types").Result.Error<{
207
- readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
208
- } & {
209
- httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
210
- }> | import("@aeriajs/types").Result.Error<{
211
207
  readonly code: import("@aeriajs/types").ACError.OwnershipError;
212
208
  } & {
213
209
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
@@ -633,9 +629,9 @@ export declare const collections: {
633
629
  };
634
630
  };
635
631
  functions: {
636
- get: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
637
- getAll: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>> | undefined, context: TContext, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").GetAllReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
638
- remove: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
632
+ readonly get: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
633
+ readonly getAll: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>> | undefined, context: TContext, options?: import("@aeriajs/core").GetAllOptions) => Promise<import("@aeriajs/types").GetAllReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
634
+ readonly remove: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").RemoveOptions) => Promise<{
639
635
  readonly _tag: "Result";
640
636
  readonly error: undefined;
641
637
  readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
@@ -648,7 +644,7 @@ export declare const collections: {
648
644
  } & {
649
645
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
650
646
  }>>;
651
- upload: <TContext extends import("@aeriajs/types").Context>(_props: unknown, context: TContext) => Promise<import("@aeriajs/types").Result.Error<{
647
+ readonly upload: <TContext extends import("@aeriajs/types").Context>(_props: unknown, context: TContext) => Promise<import("@aeriajs/types").Result.Error<{
652
648
  readonly code: import("@aeriajs/types").ACError.MalformedInput;
653
649
  readonly details: import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError;
654
650
  } & {
@@ -660,7 +656,7 @@ export declare const collections: {
660
656
  readonly tempId: any;
661
657
  };
662
658
  }>;
663
- removeFile: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext, options?: import("@aeriajs/core").RemoveFileOptions) => Promise<{
659
+ readonly removeFile: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext, options?: import("@aeriajs/core").RemoveFileOptions) => Promise<{
664
660
  readonly _tag: "Result";
665
661
  readonly error: undefined;
666
662
  readonly result: any;
@@ -669,8 +665,8 @@ export declare const collections: {
669
665
  } & {
670
666
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
671
667
  }>>;
672
- insert: <TDescription extends import("@aeriajs/types").Description, TInsertPayload extends import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<TDescription>>>(payload: NoInfer<TInsertPayload>, context: import("@aeriajs/types").Context<TDescription>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<TDescription>>>;
673
- authenticate: (props: {
668
+ readonly insert: <TDescription extends import("@aeriajs/types").Description, TInsertPayload extends import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<TDescription>>>(payload: NoInfer<TInsertPayload>, context: import("@aeriajs/types").Context<TDescription>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<TDescription>>>;
669
+ readonly authenticate: (props: {
674
670
  email: string;
675
671
  password: string;
676
672
  } | {
@@ -709,7 +705,7 @@ export declare const collections: {
709
705
  } & {
710
706
  httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
711
707
  }>>;
712
- activate: (payload: {
708
+ readonly activate: (payload: {
713
709
  password: string;
714
710
  }, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description> & {
715
711
  request: {
@@ -741,10 +737,10 @@ export declare const collections: {
741
737
  readonly _tag: "Result";
742
738
  readonly error: undefined;
743
739
  readonly result: {
744
- readonly userId: any;
740
+ readonly userId: import("mongodb").ObjectId;
745
741
  };
746
742
  } | undefined>;
747
- createAccount: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof import("./collections/user/description.js").description>>> & Record<string, unknown>, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description>) => Promise<import("@aeriajs/types").Result.Error<{
743
+ readonly createAccount: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof import("./collections/user/description.js").description>>> & Record<string, unknown>, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description>) => Promise<import("@aeriajs/types").Result.Error<{
748
744
  readonly code: import("./collections/user/createAccount.js").CreateAccountError;
749
745
  } & {
750
746
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
@@ -854,7 +850,7 @@ export declare const collections: {
854
850
  };
855
851
  };
856
852
  }>>>;
857
- getInfo: (payload: {
853
+ readonly getInfo: (payload: {
858
854
  userId: string;
859
855
  token: string;
860
856
  }, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description>) => Promise<import("@aeriajs/types").Result.Error<{
@@ -873,11 +869,11 @@ export declare const collections: {
873
869
  readonly _tag: "Result";
874
870
  readonly error: undefined;
875
871
  readonly result: {
876
- readonly name: any;
877
- readonly email: any;
872
+ readonly name: string;
873
+ readonly email: string;
878
874
  };
879
875
  }>;
880
- getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description>) => Promise<{
876
+ readonly getCurrentUser: (_payload: undefined, context: import("@aeriajs/types").Context<typeof import("./collections/user/description.js").description>) => Promise<{
881
877
  readonly _tag: "Result";
882
878
  readonly error: undefined;
883
879
  readonly result: {
@@ -992,7 +988,7 @@ export declare const collections: {
992
988
  };
993
989
  }>;
994
990
  }>;
995
- getActivationLink: (payload: {
991
+ readonly getActivationLink: (payload: {
996
992
  userId: import("mongodb").ObjectId | string;
997
993
  }, context: import("@aeriajs/types").Context) => Promise<{
998
994
  readonly _tag: "Error";
@@ -1011,18 +1007,18 @@ export declare const collections: {
1011
1007
  }>;
1012
1008
  };
1013
1009
  contracts: {
1014
- get?: import("@aeriajs/types").Contract | undefined;
1015
- getAll?: import("@aeriajs/types").Contract | undefined;
1016
- remove?: import("@aeriajs/types").Contract | undefined;
1017
- upload?: import("@aeriajs/types").Contract | undefined;
1018
- removeFile?: import("@aeriajs/types").Contract | undefined;
1019
- insert?: import("@aeriajs/types").Contract | undefined;
1020
- authenticate?: import("@aeriajs/types").Contract | undefined;
1021
- activate?: import("@aeriajs/types").Contract | undefined;
1022
- createAccount?: import("@aeriajs/types").Contract | undefined;
1023
- getInfo?: import("@aeriajs/types").Contract | undefined;
1024
- getCurrentUser?: import("@aeriajs/types").Contract | undefined;
1025
- getActivationLink?: import("@aeriajs/types").Contract | undefined;
1010
+ readonly get?: import("@aeriajs/types").Contract | undefined;
1011
+ readonly getAll?: import("@aeriajs/types").Contract | undefined;
1012
+ readonly remove?: import("@aeriajs/types").Contract | undefined;
1013
+ readonly upload?: import("@aeriajs/types").Contract | undefined;
1014
+ readonly removeFile?: import("@aeriajs/types").Contract | undefined;
1015
+ readonly insert?: import("@aeriajs/types").Contract | undefined;
1016
+ readonly authenticate?: import("@aeriajs/types").Contract | undefined;
1017
+ readonly activate?: import("@aeriajs/types").Contract | undefined;
1018
+ readonly createAccount?: import("@aeriajs/types").Contract | undefined;
1019
+ readonly getInfo?: import("@aeriajs/types").Contract | undefined;
1020
+ readonly getCurrentUser?: import("@aeriajs/types").Contract | undefined;
1021
+ readonly getActivationLink?: import("@aeriajs/types").Contract | undefined;
1026
1022
  };
1027
1023
  };
1028
1024
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.187",
3
+ "version": "0.0.188",
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.187",
49
- "@aeriajs/common": "^0.0.114",
50
- "@aeriajs/entrypoint": "^0.0.117",
51
- "@aeriajs/types": "^0.0.97",
52
- "@aeriajs/validation": "^0.0.117"
48
+ "@aeriajs/core": "^0.0.188",
49
+ "@aeriajs/common": "^0.0.115",
50
+ "@aeriajs/entrypoint": "^0.0.118",
51
+ "@aeriajs/types": "^0.0.98",
52
+ "@aeriajs/validation": "^0.0.118"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",