@aeriajs/builtins 0.0.113 → 0.0.114

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,6 @@
1
1
  import type { Context } from '@aeriajs/types';
2
2
  import type { description } from './description.js';
3
- import { HTTPStatus } from '@aeriajs/types';
3
+ import { Result, ACError, HTTPStatus } from '@aeriajs/types';
4
4
  export declare enum ActivationError {
5
5
  UserNotFound = "USER_NOT_FOUND",
6
6
  AlreadyActiveUser = "ALREADY_ACTIVE_USER",
@@ -8,16 +8,36 @@ export declare enum ActivationError {
8
8
  }
9
9
  export declare const activate: (payload: {
10
10
  password: string;
11
- }, context: Context<typeof description>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
11
+ }, context: Context<typeof description> & {
12
+ request: {
13
+ query: {
14
+ u?: string;
15
+ t?: string;
16
+ };
17
+ payload: {
18
+ password?: string;
19
+ };
20
+ };
21
+ }) => Promise<import("@aeriajs/types").GenericResponse | Result.Error<{
12
22
  readonly code: ActivationError.InvalidLink;
13
23
  } & {
14
24
  httpStatus: HTTPStatus.NotFound;
15
- }> | import("@aeriajs/types").Result.Error<{
25
+ }> | Result.Error<{
16
26
  readonly code: ActivationError.UserNotFound;
17
27
  } & {
18
28
  httpStatus: HTTPStatus.NotFound;
19
- }> | import("@aeriajs/types").Result.Error<{
29
+ }> | Result.Error<{
20
30
  readonly code: ActivationError.AlreadyActiveUser;
21
31
  } & {
22
32
  httpStatus: HTTPStatus.Forbidden;
23
- }> | undefined>;
33
+ }> | Result.Error<{
34
+ readonly code: ACError.MalformedInput;
35
+ } & {
36
+ httpStatus: HTTPStatus.UnprocessableContent;
37
+ }> | {
38
+ readonly _tag: "Result";
39
+ readonly error: undefined;
40
+ readonly result: {
41
+ readonly userId: any;
42
+ };
43
+ } | undefined>;
@@ -4,6 +4,7 @@ exports.activate = exports.ActivationError = void 0;
4
4
  const core_1 = require("@aeriajs/core");
5
5
  const types_1 = require("@aeriajs/types");
6
6
  const bcrypt = require("bcrypt");
7
+ const getActivationLink_js_1 = require("./getActivationLink.js");
7
8
  var ActivationError;
8
9
  (function (ActivationError) {
9
10
  ActivationError["UserNotFound"] = "USER_NOT_FOUND";
@@ -34,7 +35,8 @@ const activate = async (payload, context) => {
34
35
  code: ActivationError.AlreadyActiveUser,
35
36
  });
36
37
  }
37
- const equal = await bcrypt.compare(user._id.toString(), token);
38
+ const activationToken = await (0, getActivationLink_js_1.getActivationToken)(userId.toString(), context);
39
+ const equal = await bcrypt.compare(activationToken, token);
38
40
  if (!equal) {
39
41
  return context.error(types_1.HTTPStatus.NotFound, {
40
42
  code: ActivationError.InvalidLink,
@@ -42,8 +44,13 @@ const activate = async (payload, context) => {
42
44
  }
43
45
  if (!user.password) {
44
46
  if (!payload.password) {
45
- return context.response.writeHead(302, {
46
- location: `/user/activation?step=password&u=${userId}&t=${token}`,
47
+ if (context.request.method === 'GET') {
48
+ return context.response.writeHead(302, {
49
+ location: `/user/activation?step=password&u=${userId}&t=${token}`,
50
+ }).end();
51
+ }
52
+ return context.error(types_1.HTTPStatus.UnprocessableContent, {
53
+ code: types_1.ACError.MalformedInput,
47
54
  });
48
55
  }
49
56
  await context.collection.model.updateOne({
@@ -63,8 +70,13 @@ const activate = async (payload, context) => {
63
70
  active: true,
64
71
  },
65
72
  });
66
- return context.response.writeHead(302, {
67
- location: '/user/activation',
73
+ if (context.request.method === 'GET') {
74
+ return context.response.writeHead(302, {
75
+ location: '/user/activation',
76
+ }).end();
77
+ }
78
+ return types_1.Result.result({
79
+ userId: user._id,
68
80
  });
69
81
  };
70
82
  exports.activate = activate;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  import { ObjectId } from "@aeriajs/core";
3
- import { HTTPStatus } from "@aeriajs/types";
3
+ import { Result, ACError, HTTPStatus } from "@aeriajs/types";
4
4
  import * as bcrypt from "bcrypt";
5
+ import { getActivationToken } from "./getActivationLink.mjs";
5
6
  export var ActivationError = /* @__PURE__ */ ((ActivationError2) => {
6
7
  ActivationError2["UserNotFound"] = "USER_NOT_FOUND";
7
8
  ActivationError2["AlreadyActiveUser"] = "ALREADY_ACTIVE_USER";
@@ -35,7 +36,8 @@ export const activate = async (payload, context) => {
35
36
  code: "ALREADY_ACTIVE_USER" /* AlreadyActiveUser */
36
37
  });
37
38
  }
38
- const equal = await bcrypt.compare(user._id.toString(), token);
39
+ const activationToken = await getActivationToken(userId.toString(), context);
40
+ const equal = await bcrypt.compare(activationToken, token);
39
41
  if (!equal) {
40
42
  return context.error(HTTPStatus.NotFound, {
41
43
  code: "INVALID_LINK" /* InvalidLink */
@@ -43,8 +45,13 @@ export const activate = async (payload, context) => {
43
45
  }
44
46
  if (!user.password) {
45
47
  if (!payload.password) {
46
- return context.response.writeHead(302, {
47
- location: `/user/activation?step=password&u=${userId}&t=${token}`
48
+ if (context.request.method === "GET") {
49
+ return context.response.writeHead(302, {
50
+ location: `/user/activation?step=password&u=${userId}&t=${token}`
51
+ }).end();
52
+ }
53
+ return context.error(HTTPStatus.UnprocessableContent, {
54
+ code: ACError.MalformedInput
48
55
  });
49
56
  }
50
57
  await context.collection.model.updateOne(
@@ -70,7 +77,12 @@ export const activate = async (payload, context) => {
70
77
  }
71
78
  }
72
79
  );
73
- return context.response.writeHead(302, {
74
- location: "/user/activation"
80
+ if (context.request.method === "GET") {
81
+ return context.response.writeHead(302, {
82
+ location: "/user/activation"
83
+ }).end();
84
+ }
85
+ return Result.result({
86
+ userId: user._id
75
87
  });
76
88
  };
@@ -86,6 +86,11 @@ export declare const description: {
86
86
  readonly fetchItem: true;
87
87
  readonly translate: true;
88
88
  };
89
+ readonly copyActivationLink: {
90
+ readonly label: "copy_activation_link";
91
+ readonly icon: "link";
92
+ readonly translate: true;
93
+ };
89
94
  };
90
95
  readonly icon: "users";
91
96
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -111,6 +111,11 @@ exports.description = (0, core_1.defineDescription)({
111
111
  fetchItem: true,
112
112
  translate: true,
113
113
  },
114
+ 'copyActivationLink': {
115
+ label: 'copy_activation_link',
116
+ icon: 'link',
117
+ translate: true,
118
+ },
114
119
  },
115
120
  icon: 'users',
116
121
  filters: [
@@ -104,6 +104,11 @@ export const description = defineDescription({
104
104
  icon: "key",
105
105
  fetchItem: true,
106
106
  translate: true
107
+ },
108
+ "copyActivationLink": {
109
+ label: "copy_activation_link",
110
+ icon: "link",
111
+ translate: true
107
112
  }
108
113
  },
109
114
  icon: "users",
@@ -1,6 +1,22 @@
1
+ import type { Context } from '@aeriajs/types';
1
2
  import type { ObjectId } from '@aeriajs/core';
2
- export declare const getActivationLink: (userId: ObjectId) => Promise<{
3
+ import { Result, HTTPStatus } from '@aeriajs/types';
4
+ import { ActivationError } from './activate.js';
5
+ export declare const getActivationToken: (strId: string, context: Context) => Promise<string>;
6
+ export declare const getActivationLink: (payload: {
7
+ userId: ObjectId | string;
8
+ }, context: Context) => Promise<{
9
+ readonly _tag: "Error";
10
+ readonly error: import("@aeriajs/types").StrictEndpointError<import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.MalformedInput, unknown, HTTPStatus.BadRequest | HTTPStatus.NotFound>;
11
+ readonly result: undefined;
12
+ } | Result.Error<{
13
+ readonly code: ActivationError.AlreadyActiveUser;
14
+ } & {
15
+ httpStatus: HTTPStatus.Forbidden;
16
+ }> | {
3
17
  readonly _tag: "Result";
4
18
  readonly error: undefined;
5
- readonly result: string;
19
+ readonly result: {
20
+ readonly url: string;
21
+ };
6
22
  }>;
@@ -1,13 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getActivationLink = void 0;
4
- const entrypoint_1 = require("@aeriajs/entrypoint");
3
+ exports.getActivationLink = exports.getActivationToken = void 0;
5
4
  const types_1 = require("@aeriajs/types");
6
5
  const bcrypt = require("bcrypt");
7
- const getActivationLink = async (userId) => {
8
- const config = await (0, entrypoint_1.getConfig)();
9
- const activationToken = await bcrypt.hash(userId.toString(), 10);
10
- const link = `${config.publicUrl}/user/activate?u=${userId.toString()}&t=${activationToken}`;
11
- return types_1.Result.result(link);
6
+ const activate_js_1 = require("./activate.js");
7
+ const getActivationToken = async (strId, context) => {
8
+ if (context.calledFunction === 'getActivationToken') {
9
+ throw new Error('cannot be called externally');
10
+ }
11
+ if (!context.config.secret) {
12
+ throw new Error('config.secret is not set');
13
+ }
14
+ return `${context.config.secret}:${strId}`;
15
+ };
16
+ exports.getActivationToken = getActivationToken;
17
+ const getActivationLink = async (payload, context) => {
18
+ const { error, result: user } = await context.collections.user.functions.get({
19
+ filters: {
20
+ _id: payload.userId,
21
+ },
22
+ project: ['active'],
23
+ });
24
+ if (error) {
25
+ return types_1.Result.error(error);
26
+ }
27
+ if (user.active) {
28
+ return context.error(types_1.HTTPStatus.Forbidden, {
29
+ code: activate_js_1.ActivationError.AlreadyActiveUser,
30
+ });
31
+ }
32
+ const activationToken = await (0, exports.getActivationToken)(payload.userId.toString(), context);
33
+ const encryptedActivationToken = await bcrypt.hash(activationToken, 10);
34
+ const url = `${context.config.publicUrl}/user/activate?u=${payload.userId.toString()}&t=${encryptedActivationToken}`;
35
+ return types_1.Result.result({
36
+ url,
37
+ });
12
38
  };
13
39
  exports.getActivationLink = getActivationLink;
@@ -1,10 +1,35 @@
1
1
  "use strict";
2
- import { getConfig } from "@aeriajs/entrypoint";
3
- import { Result } from "@aeriajs/types";
2
+ import { Result, HTTPStatus } from "@aeriajs/types";
4
3
  import * as bcrypt from "bcrypt";
5
- export const getActivationLink = async (userId) => {
6
- const config = await getConfig();
7
- const activationToken = await bcrypt.hash(userId.toString(), 10);
8
- const link = `${config.publicUrl}/user/activate?u=${userId.toString()}&t=${activationToken}`;
9
- return Result.result(link);
4
+ import { ActivationError } from "./activate.mjs";
5
+ export const getActivationToken = async (strId, context) => {
6
+ if (context.calledFunction === "getActivationToken") {
7
+ throw new Error("cannot be called externally");
8
+ }
9
+ if (!context.config.secret) {
10
+ throw new Error("config.secret is not set");
11
+ }
12
+ return `${context.config.secret}:${strId}`;
13
+ };
14
+ export const getActivationLink = async (payload, context) => {
15
+ const { error, result: user } = await context.collections.user.functions.get({
16
+ filters: {
17
+ _id: payload.userId
18
+ },
19
+ project: ["active"]
20
+ });
21
+ if (error) {
22
+ return Result.error(error);
23
+ }
24
+ if (user.active) {
25
+ return context.error(HTTPStatus.Forbidden, {
26
+ code: ActivationError.AlreadyActiveUser
27
+ });
28
+ }
29
+ const activationToken = await getActivationToken(payload.userId.toString(), context);
30
+ const encryptedActivationToken = await bcrypt.hash(activationToken, 10);
31
+ const url = `${context.config.publicUrl}/user/activate?u=${payload.userId.toString()}&t=${encryptedActivationToken}`;
32
+ return Result.result({
33
+ url
34
+ });
10
35
  };
@@ -92,6 +92,11 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
92
92
  readonly fetchItem: true;
93
93
  readonly translate: true;
94
94
  };
95
+ readonly copyActivationLink: {
96
+ readonly label: "copy_activation_link";
97
+ readonly icon: "link";
98
+ readonly translate: true;
99
+ };
95
100
  };
96
101
  readonly icon: "users";
97
102
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -4,6 +4,7 @@ exports.getInfo = exports.ActivationError = void 0;
4
4
  const bcrypt = require("bcrypt");
5
5
  const types_1 = require("@aeriajs/types");
6
6
  const core_1 = require("@aeriajs/core");
7
+ const getActivationLink_js_1 = require("./getActivationLink.js");
7
8
  var ActivationError;
8
9
  (function (ActivationError) {
9
10
  ActivationError["UserNotFound"] = "USER_NOT_FOUND";
@@ -30,7 +31,8 @@ const getInfo = async (payload, context) => {
30
31
  code: ActivationError.AlreadyActiveUser,
31
32
  });
32
33
  }
33
- const equal = await bcrypt.compare(user._id.toString(), token);
34
+ const activationToken = await (0, getActivationLink_js_1.getActivationToken)(user._id.toString(), context);
35
+ const equal = await bcrypt.compare(activationToken, token);
34
36
  if (!equal) {
35
37
  return context.error(types_1.HTTPStatus.NotFound, {
36
38
  code: ActivationError.InvalidLink,
@@ -2,6 +2,7 @@
2
2
  import * as bcrypt from "bcrypt";
3
3
  import { Result, HTTPStatus } from "@aeriajs/types";
4
4
  import { ObjectId } from "@aeriajs/core";
5
+ import { getActivationToken } from "./getActivationLink.mjs";
5
6
  export var ActivationError = /* @__PURE__ */ ((ActivationError2) => {
6
7
  ActivationError2["UserNotFound"] = "USER_NOT_FOUND";
7
8
  ActivationError2["AlreadyActiveUser"] = "ALREADY_ACTIVE_USER";
@@ -31,7 +32,8 @@ export const getInfo = async (payload, context) => {
31
32
  code: "ALREADY_ACTIVE_USER" /* AlreadyActiveUser */
32
33
  });
33
34
  }
34
- const equal = await bcrypt.compare(user._id.toString(), token);
35
+ const activationToken = await getActivationToken(user._id.toString(), context);
36
+ const equal = await bcrypt.compare(activationToken, token);
35
37
  if (!equal) {
36
38
  return context.error(HTTPStatus.NotFound, {
37
39
  code: "INVALID_LINK" /* InvalidLink */
@@ -83,6 +83,11 @@ export declare const user: {
83
83
  readonly fetchItem: true;
84
84
  readonly translate: true;
85
85
  };
86
+ readonly copyActivationLink: {
87
+ readonly label: "copy_activation_link";
88
+ readonly icon: "link";
89
+ readonly translate: true;
90
+ };
86
91
  };
87
92
  readonly icon: "users";
88
93
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -217,6 +222,11 @@ export declare const user: {
217
222
  readonly fetchItem: true;
218
223
  readonly translate: true;
219
224
  };
225
+ readonly copyActivationLink: {
226
+ readonly label: "copy_activation_link";
227
+ readonly icon: "link";
228
+ readonly translate: true;
229
+ };
220
230
  };
221
231
  readonly icon: "users";
222
232
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -317,6 +327,11 @@ export declare const user: {
317
327
  readonly fetchItem: true;
318
328
  readonly translate: true;
319
329
  };
330
+ readonly copyActivationLink: {
331
+ readonly label: "copy_activation_link";
332
+ readonly icon: "link";
333
+ readonly translate: true;
334
+ };
320
335
  };
321
336
  readonly icon: "users";
322
337
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -416,6 +431,11 @@ export declare const user: {
416
431
  readonly fetchItem: true;
417
432
  readonly translate: true;
418
433
  };
434
+ readonly copyActivationLink: {
435
+ readonly label: "copy_activation_link";
436
+ readonly icon: "link";
437
+ readonly translate: true;
438
+ };
419
439
  };
420
440
  readonly icon: "users";
421
441
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -522,6 +542,11 @@ export declare const user: {
522
542
  readonly fetchItem: true;
523
543
  readonly translate: true;
524
544
  };
545
+ readonly copyActivationLink: {
546
+ readonly label: "copy_activation_link";
547
+ readonly icon: "link";
548
+ readonly translate: true;
549
+ };
525
550
  };
526
551
  readonly icon: "users";
527
552
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -629,6 +654,11 @@ export declare const user: {
629
654
  readonly fetchItem: true;
630
655
  readonly translate: true;
631
656
  };
657
+ readonly copyActivationLink: {
658
+ readonly label: "copy_activation_link";
659
+ readonly icon: "link";
660
+ readonly translate: true;
661
+ };
632
662
  };
633
663
  readonly icon: "users";
634
664
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -672,7 +702,7 @@ export declare const user: {
672
702
  }>>;
673
703
  readonly activate: (payload: {
674
704
  password: string;
675
- }, context: import("@aeriajs/types").Context<{
705
+ }, context: import("@aeriajs/types").RouteContext<null> & import("@aeriajs/types").CollectionContext<{
676
706
  readonly $id: "user";
677
707
  readonly required: readonly ["name", "roles", "email"];
678
708
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -756,6 +786,11 @@ export declare const user: {
756
786
  readonly fetchItem: true;
757
787
  readonly translate: true;
758
788
  };
789
+ readonly copyActivationLink: {
790
+ readonly label: "copy_activation_link";
791
+ readonly icon: "link";
792
+ readonly translate: true;
793
+ };
759
794
  };
760
795
  readonly icon: "users";
761
796
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -771,7 +806,17 @@ export declare const user: {
771
806
  };
772
807
  };
773
808
  };
774
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
809
+ }, any> & {
810
+ request: {
811
+ query: {
812
+ u?: string | undefined;
813
+ t?: string | undefined;
814
+ };
815
+ payload: {
816
+ password?: string | undefined;
817
+ };
818
+ };
819
+ }) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
775
820
  readonly code: import("./activate.js").ActivationError.InvalidLink;
776
821
  } & {
777
822
  httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
@@ -783,7 +828,17 @@ export declare const user: {
783
828
  readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
784
829
  } & {
785
830
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
786
- }> | undefined>;
831
+ }> | import("@aeriajs/types").Result.Error<{
832
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
833
+ } & {
834
+ httpStatus: import("@aeriajs/types").HTTPStatus.UnprocessableContent;
835
+ }> | {
836
+ readonly _tag: "Result";
837
+ readonly error: undefined;
838
+ readonly result: {
839
+ readonly userId: any;
840
+ };
841
+ } | undefined>;
787
842
  readonly createAccount: (payload: Omit<Pick<{
788
843
  picture_file: import("@aeriajs/types").SchemaWithId<{
789
844
  readonly $id: "file";
@@ -1103,6 +1158,11 @@ export declare const user: {
1103
1158
  readonly fetchItem: true;
1104
1159
  readonly translate: true;
1105
1160
  };
1161
+ readonly copyActivationLink: {
1162
+ readonly label: "copy_activation_link";
1163
+ readonly icon: "link";
1164
+ readonly translate: true;
1165
+ };
1106
1166
  };
1107
1167
  readonly icon: "users";
1108
1168
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1215,6 +1275,11 @@ export declare const user: {
1215
1275
  readonly fetchItem: true;
1216
1276
  readonly translate: true;
1217
1277
  };
1278
+ readonly copyActivationLink: {
1279
+ readonly label: "copy_activation_link";
1280
+ readonly icon: "link";
1281
+ readonly translate: true;
1282
+ };
1218
1283
  };
1219
1284
  readonly icon: "users";
1220
1285
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1334,6 +1399,11 @@ export declare const user: {
1334
1399
  readonly fetchItem: true;
1335
1400
  readonly translate: true;
1336
1401
  };
1402
+ readonly copyActivationLink: {
1403
+ readonly label: "copy_activation_link";
1404
+ readonly icon: "link";
1405
+ readonly translate: true;
1406
+ };
1337
1407
  };
1338
1408
  readonly icon: "users";
1339
1409
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1436,6 +1506,11 @@ export declare const user: {
1436
1506
  readonly fetchItem: true;
1437
1507
  readonly translate: true;
1438
1508
  };
1509
+ readonly copyActivationLink: {
1510
+ readonly label: "copy_activation_link";
1511
+ readonly icon: "link";
1512
+ readonly translate: true;
1513
+ };
1439
1514
  };
1440
1515
  readonly icon: "users";
1441
1516
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1453,10 +1528,22 @@ export declare const user: {
1453
1528
  };
1454
1529
  }>;
1455
1530
  }>;
1456
- readonly getActivationLink: (userId: import("@aeriajs/core").ObjectId) => Promise<{
1531
+ readonly getActivationLink: (payload: {
1532
+ userId: string | import("@aeriajs/core").ObjectId;
1533
+ }, context: import("@aeriajs/types").Context) => Promise<{
1534
+ readonly _tag: "Error";
1535
+ readonly error: import("@aeriajs/types").StrictEndpointError<import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.MalformedInput, unknown, import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.NotFound>;
1536
+ readonly result: undefined;
1537
+ } | import("@aeriajs/types").Result.Error<{
1538
+ readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
1539
+ } & {
1540
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
1541
+ }> | {
1457
1542
  readonly _tag: "Result";
1458
1543
  readonly error: undefined;
1459
- readonly result: string;
1544
+ readonly result: {
1545
+ readonly url: string;
1546
+ };
1460
1547
  }>;
1461
1548
  };
1462
1549
  contracts: {
@@ -1552,6 +1639,11 @@ export declare const user: {
1552
1639
  readonly fetchItem: true;
1553
1640
  readonly translate: true;
1554
1641
  };
1642
+ readonly copyActivationLink: {
1643
+ readonly label: "copy_activation_link";
1644
+ readonly icon: "link";
1645
+ readonly translate: true;
1646
+ };
1555
1647
  };
1556
1648
  readonly icon: "users";
1557
1649
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1652,6 +1744,11 @@ export declare const user: {
1652
1744
  readonly fetchItem: true;
1653
1745
  readonly translate: true;
1654
1746
  };
1747
+ readonly copyActivationLink: {
1748
+ readonly label: "copy_activation_link";
1749
+ readonly icon: "link";
1750
+ readonly translate: true;
1751
+ };
1655
1752
  };
1656
1753
  readonly icon: "users";
1657
1754
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1786,6 +1883,11 @@ export declare const user: {
1786
1883
  readonly fetchItem: true;
1787
1884
  readonly translate: true;
1788
1885
  };
1886
+ readonly copyActivationLink: {
1887
+ readonly label: "copy_activation_link";
1888
+ readonly icon: "link";
1889
+ readonly translate: true;
1890
+ };
1789
1891
  };
1790
1892
  readonly icon: "users";
1791
1893
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1886,6 +1988,11 @@ export declare const user: {
1886
1988
  readonly fetchItem: true;
1887
1989
  readonly translate: true;
1888
1990
  };
1991
+ readonly copyActivationLink: {
1992
+ readonly label: "copy_activation_link";
1993
+ readonly icon: "link";
1994
+ readonly translate: true;
1995
+ };
1889
1996
  };
1890
1997
  readonly icon: "users";
1891
1998
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1985,6 +2092,11 @@ export declare const user: {
1985
2092
  readonly fetchItem: true;
1986
2093
  readonly translate: true;
1987
2094
  };
2095
+ readonly copyActivationLink: {
2096
+ readonly label: "copy_activation_link";
2097
+ readonly icon: "link";
2098
+ readonly translate: true;
2099
+ };
1988
2100
  };
1989
2101
  readonly icon: "users";
1990
2102
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2091,6 +2203,11 @@ export declare const user: {
2091
2203
  readonly fetchItem: true;
2092
2204
  readonly translate: true;
2093
2205
  };
2206
+ readonly copyActivationLink: {
2207
+ readonly label: "copy_activation_link";
2208
+ readonly icon: "link";
2209
+ readonly translate: true;
2210
+ };
2094
2211
  };
2095
2212
  readonly icon: "users";
2096
2213
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2198,6 +2315,11 @@ export declare const user: {
2198
2315
  readonly fetchItem: true;
2199
2316
  readonly translate: true;
2200
2317
  };
2318
+ readonly copyActivationLink: {
2319
+ readonly label: "copy_activation_link";
2320
+ readonly icon: "link";
2321
+ readonly translate: true;
2322
+ };
2201
2323
  };
2202
2324
  readonly icon: "users";
2203
2325
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2241,7 +2363,7 @@ export declare const user: {
2241
2363
  }>>;
2242
2364
  readonly activate: (payload: {
2243
2365
  password: string;
2244
- }, context: import("@aeriajs/types").Context<{
2366
+ }, context: import("@aeriajs/types").RouteContext<null> & import("@aeriajs/types").CollectionContext<{
2245
2367
  readonly $id: "user";
2246
2368
  readonly required: readonly ["name", "roles", "email"];
2247
2369
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -2325,6 +2447,11 @@ export declare const user: {
2325
2447
  readonly fetchItem: true;
2326
2448
  readonly translate: true;
2327
2449
  };
2450
+ readonly copyActivationLink: {
2451
+ readonly label: "copy_activation_link";
2452
+ readonly icon: "link";
2453
+ readonly translate: true;
2454
+ };
2328
2455
  };
2329
2456
  readonly icon: "users";
2330
2457
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2340,7 +2467,17 @@ export declare const user: {
2340
2467
  };
2341
2468
  };
2342
2469
  };
2343
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
2470
+ }, any> & {
2471
+ request: {
2472
+ query: {
2473
+ u?: string | undefined;
2474
+ t?: string | undefined;
2475
+ };
2476
+ payload: {
2477
+ password?: string | undefined;
2478
+ };
2479
+ };
2480
+ }) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
2344
2481
  readonly code: import("./activate.js").ActivationError.InvalidLink;
2345
2482
  } & {
2346
2483
  httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
@@ -2352,7 +2489,17 @@ export declare const user: {
2352
2489
  readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
2353
2490
  } & {
2354
2491
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
2355
- }> | undefined>;
2492
+ }> | import("@aeriajs/types").Result.Error<{
2493
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
2494
+ } & {
2495
+ httpStatus: import("@aeriajs/types").HTTPStatus.UnprocessableContent;
2496
+ }> | {
2497
+ readonly _tag: "Result";
2498
+ readonly error: undefined;
2499
+ readonly result: {
2500
+ readonly userId: any;
2501
+ };
2502
+ } | undefined>;
2356
2503
  readonly createAccount: (payload: Omit<Pick<{
2357
2504
  picture_file: import("@aeriajs/types").SchemaWithId<{
2358
2505
  readonly $id: "file";
@@ -2672,6 +2819,11 @@ export declare const user: {
2672
2819
  readonly fetchItem: true;
2673
2820
  readonly translate: true;
2674
2821
  };
2822
+ readonly copyActivationLink: {
2823
+ readonly label: "copy_activation_link";
2824
+ readonly icon: "link";
2825
+ readonly translate: true;
2826
+ };
2675
2827
  };
2676
2828
  readonly icon: "users";
2677
2829
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2784,6 +2936,11 @@ export declare const user: {
2784
2936
  readonly fetchItem: true;
2785
2937
  readonly translate: true;
2786
2938
  };
2939
+ readonly copyActivationLink: {
2940
+ readonly label: "copy_activation_link";
2941
+ readonly icon: "link";
2942
+ readonly translate: true;
2943
+ };
2787
2944
  };
2788
2945
  readonly icon: "users";
2789
2946
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2903,6 +3060,11 @@ export declare const user: {
2903
3060
  readonly fetchItem: true;
2904
3061
  readonly translate: true;
2905
3062
  };
3063
+ readonly copyActivationLink: {
3064
+ readonly label: "copy_activation_link";
3065
+ readonly icon: "link";
3066
+ readonly translate: true;
3067
+ };
2906
3068
  };
2907
3069
  readonly icon: "users";
2908
3070
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3005,6 +3167,11 @@ export declare const user: {
3005
3167
  readonly fetchItem: true;
3006
3168
  readonly translate: true;
3007
3169
  };
3170
+ readonly copyActivationLink: {
3171
+ readonly label: "copy_activation_link";
3172
+ readonly icon: "link";
3173
+ readonly translate: true;
3174
+ };
3008
3175
  };
3009
3176
  readonly icon: "users";
3010
3177
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3022,10 +3189,22 @@ export declare const user: {
3022
3189
  };
3023
3190
  }>;
3024
3191
  }>;
3025
- readonly getActivationLink: (userId: import("@aeriajs/core").ObjectId) => Promise<{
3192
+ readonly getActivationLink: (payload: {
3193
+ userId: string | import("@aeriajs/core").ObjectId;
3194
+ }, context: import("@aeriajs/types").Context) => Promise<{
3195
+ readonly _tag: "Error";
3196
+ readonly error: import("@aeriajs/types").StrictEndpointError<import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.MalformedInput, unknown, import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.NotFound>;
3197
+ readonly result: undefined;
3198
+ } | import("@aeriajs/types").Result.Error<{
3199
+ readonly code: import("./activate.js").ActivationError.AlreadyActiveUser;
3200
+ } & {
3201
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3202
+ }> | {
3026
3203
  readonly _tag: "Result";
3027
3204
  readonly error: undefined;
3028
- readonly result: string;
3205
+ readonly result: {
3206
+ readonly url: string;
3207
+ };
3029
3208
  }>;
3030
3209
  };
3031
3210
  contracts: {
@@ -18,8 +18,8 @@ const exposedFunctions = {
18
18
  removeFile: true,
19
19
  insert: true,
20
20
  authenticate: 'unauthenticated',
21
- activate: 'unauthenticated-only',
22
- createAccount: 'unauthenticated-only',
21
+ activate: 'unauthenticated',
22
+ createAccount: 'unauthenticated',
23
23
  getInfo: 'unauthenticated',
24
24
  getCurrentUser: true,
25
25
  getActivationLink: ['root'],
@@ -16,8 +16,8 @@ const exposedFunctions = {
16
16
  removeFile: true,
17
17
  insert: true,
18
18
  authenticate: "unauthenticated",
19
- activate: "unauthenticated-only",
20
- createAccount: "unauthenticated-only",
19
+ activate: "unauthenticated",
20
+ createAccount: "unauthenticated",
21
21
  getInfo: "unauthenticated",
22
22
  getCurrentUser: true,
23
23
  getActivationLink: ["root"]
@@ -86,6 +86,11 @@ export declare const insert: (payload: {
86
86
  readonly fetchItem: true;
87
87
  readonly translate: true;
88
88
  };
89
+ readonly copyActivationLink: {
90
+ readonly label: "copy_activation_link";
91
+ readonly icon: "link";
92
+ readonly translate: true;
93
+ };
89
94
  };
90
95
  readonly icon: "users";
91
96
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -113,6 +113,11 @@ export declare const describe: (contextOrPayload: RouteContext | Payload) => Pro
113
113
  readonly fetchItem: true;
114
114
  readonly translate: true;
115
115
  };
116
+ readonly copyActivationLink: {
117
+ readonly label: "copy_activation_link";
118
+ readonly icon: "link";
119
+ readonly translate: true;
120
+ };
116
121
  };
117
122
  readonly icon: "users";
118
123
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
package/dist/index.d.ts CHANGED
@@ -1328,6 +1328,11 @@ export declare const collections: {
1328
1328
  readonly fetchItem: true;
1329
1329
  readonly translate: true;
1330
1330
  };
1331
+ readonly copyActivationLink: {
1332
+ readonly label: "copy_activation_link";
1333
+ readonly icon: "link";
1334
+ readonly translate: true;
1335
+ };
1331
1336
  };
1332
1337
  readonly icon: "users";
1333
1338
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1462,6 +1467,11 @@ export declare const collections: {
1462
1467
  readonly fetchItem: true;
1463
1468
  readonly translate: true;
1464
1469
  };
1470
+ readonly copyActivationLink: {
1471
+ readonly label: "copy_activation_link";
1472
+ readonly icon: "link";
1473
+ readonly translate: true;
1474
+ };
1465
1475
  };
1466
1476
  readonly icon: "users";
1467
1477
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1562,6 +1572,11 @@ export declare const collections: {
1562
1572
  readonly fetchItem: true;
1563
1573
  readonly translate: true;
1564
1574
  };
1575
+ readonly copyActivationLink: {
1576
+ readonly label: "copy_activation_link";
1577
+ readonly icon: "link";
1578
+ readonly translate: true;
1579
+ };
1565
1580
  };
1566
1581
  readonly icon: "users";
1567
1582
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1661,6 +1676,11 @@ export declare const collections: {
1661
1676
  readonly fetchItem: true;
1662
1677
  readonly translate: true;
1663
1678
  };
1679
+ readonly copyActivationLink: {
1680
+ readonly label: "copy_activation_link";
1681
+ readonly icon: "link";
1682
+ readonly translate: true;
1683
+ };
1664
1684
  };
1665
1685
  readonly icon: "users";
1666
1686
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1767,6 +1787,11 @@ export declare const collections: {
1767
1787
  readonly fetchItem: true;
1768
1788
  readonly translate: true;
1769
1789
  };
1790
+ readonly copyActivationLink: {
1791
+ readonly label: "copy_activation_link";
1792
+ readonly icon: "link";
1793
+ readonly translate: true;
1794
+ };
1770
1795
  };
1771
1796
  readonly icon: "users";
1772
1797
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1874,6 +1899,11 @@ export declare const collections: {
1874
1899
  readonly fetchItem: true;
1875
1900
  readonly translate: true;
1876
1901
  };
1902
+ readonly copyActivationLink: {
1903
+ readonly label: "copy_activation_link";
1904
+ readonly icon: "link";
1905
+ readonly translate: true;
1906
+ };
1877
1907
  };
1878
1908
  readonly icon: "users";
1879
1909
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -1917,7 +1947,7 @@ export declare const collections: {
1917
1947
  }>>;
1918
1948
  readonly activate: (payload: {
1919
1949
  password: string;
1920
- }, context: import("@aeriajs/types").Context<{
1950
+ }, context: import("@aeriajs/types").RouteContext<null> & import("@aeriajs/types").CollectionContext<{
1921
1951
  readonly $id: "user";
1922
1952
  readonly required: readonly ["name", "roles", "email"];
1923
1953
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -2001,6 +2031,11 @@ export declare const collections: {
2001
2031
  readonly fetchItem: true;
2002
2032
  readonly translate: true;
2003
2033
  };
2034
+ readonly copyActivationLink: {
2035
+ readonly label: "copy_activation_link";
2036
+ readonly icon: "link";
2037
+ readonly translate: true;
2038
+ };
2004
2039
  };
2005
2040
  readonly icon: "users";
2006
2041
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2016,7 +2051,17 @@ export declare const collections: {
2016
2051
  };
2017
2052
  };
2018
2053
  };
2019
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
2054
+ }, any> & {
2055
+ request: {
2056
+ query: {
2057
+ u?: string | undefined;
2058
+ t?: string | undefined;
2059
+ };
2060
+ payload: {
2061
+ password?: string | undefined;
2062
+ };
2063
+ };
2064
+ }) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
2020
2065
  readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
2021
2066
  } & {
2022
2067
  httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
@@ -2028,7 +2073,17 @@ export declare const collections: {
2028
2073
  readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
2029
2074
  } & {
2030
2075
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
2031
- }> | undefined>;
2076
+ }> | import("@aeriajs/types").Result.Error<{
2077
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
2078
+ } & {
2079
+ httpStatus: import("@aeriajs/types").HTTPStatus.UnprocessableContent;
2080
+ }> | {
2081
+ readonly _tag: "Result";
2082
+ readonly error: undefined;
2083
+ readonly result: {
2084
+ readonly userId: any;
2085
+ };
2086
+ } | undefined>;
2032
2087
  readonly createAccount: (payload: Omit<Pick<{
2033
2088
  picture_file: import("@aeriajs/types").SchemaWithId<{
2034
2089
  readonly $id: "file";
@@ -2348,6 +2403,11 @@ export declare const collections: {
2348
2403
  readonly fetchItem: true;
2349
2404
  readonly translate: true;
2350
2405
  };
2406
+ readonly copyActivationLink: {
2407
+ readonly label: "copy_activation_link";
2408
+ readonly icon: "link";
2409
+ readonly translate: true;
2410
+ };
2351
2411
  };
2352
2412
  readonly icon: "users";
2353
2413
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2460,6 +2520,11 @@ export declare const collections: {
2460
2520
  readonly fetchItem: true;
2461
2521
  readonly translate: true;
2462
2522
  };
2523
+ readonly copyActivationLink: {
2524
+ readonly label: "copy_activation_link";
2525
+ readonly icon: "link";
2526
+ readonly translate: true;
2527
+ };
2463
2528
  };
2464
2529
  readonly icon: "users";
2465
2530
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2579,6 +2644,11 @@ export declare const collections: {
2579
2644
  readonly fetchItem: true;
2580
2645
  readonly translate: true;
2581
2646
  };
2647
+ readonly copyActivationLink: {
2648
+ readonly label: "copy_activation_link";
2649
+ readonly icon: "link";
2650
+ readonly translate: true;
2651
+ };
2582
2652
  };
2583
2653
  readonly icon: "users";
2584
2654
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2681,6 +2751,11 @@ export declare const collections: {
2681
2751
  readonly fetchItem: true;
2682
2752
  readonly translate: true;
2683
2753
  };
2754
+ readonly copyActivationLink: {
2755
+ readonly label: "copy_activation_link";
2756
+ readonly icon: "link";
2757
+ readonly translate: true;
2758
+ };
2684
2759
  };
2685
2760
  readonly icon: "users";
2686
2761
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2698,10 +2773,22 @@ export declare const collections: {
2698
2773
  };
2699
2774
  }>;
2700
2775
  }>;
2701
- readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<{
2776
+ readonly getActivationLink: (payload: {
2777
+ userId: string | import("mongodb").ObjectId;
2778
+ }, context: import("@aeriajs/types").Context) => Promise<{
2779
+ readonly _tag: "Error";
2780
+ readonly error: import("@aeriajs/types").StrictEndpointError<import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.MalformedInput, unknown, import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.NotFound>;
2781
+ readonly result: undefined;
2782
+ } | import("@aeriajs/types").Result.Error<{
2783
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
2784
+ } & {
2785
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
2786
+ }> | {
2702
2787
  readonly _tag: "Result";
2703
2788
  readonly error: undefined;
2704
- readonly result: string;
2789
+ readonly result: {
2790
+ readonly url: string;
2791
+ };
2705
2792
  }>;
2706
2793
  };
2707
2794
  contracts: {
@@ -2797,6 +2884,11 @@ export declare const collections: {
2797
2884
  readonly fetchItem: true;
2798
2885
  readonly translate: true;
2799
2886
  };
2887
+ readonly copyActivationLink: {
2888
+ readonly label: "copy_activation_link";
2889
+ readonly icon: "link";
2890
+ readonly translate: true;
2891
+ };
2800
2892
  };
2801
2893
  readonly icon: "users";
2802
2894
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -2897,6 +2989,11 @@ export declare const collections: {
2897
2989
  readonly fetchItem: true;
2898
2990
  readonly translate: true;
2899
2991
  };
2992
+ readonly copyActivationLink: {
2993
+ readonly label: "copy_activation_link";
2994
+ readonly icon: "link";
2995
+ readonly translate: true;
2996
+ };
2900
2997
  };
2901
2998
  readonly icon: "users";
2902
2999
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3031,6 +3128,11 @@ export declare const collections: {
3031
3128
  readonly fetchItem: true;
3032
3129
  readonly translate: true;
3033
3130
  };
3131
+ readonly copyActivationLink: {
3132
+ readonly label: "copy_activation_link";
3133
+ readonly icon: "link";
3134
+ readonly translate: true;
3135
+ };
3034
3136
  };
3035
3137
  readonly icon: "users";
3036
3138
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3131,6 +3233,11 @@ export declare const collections: {
3131
3233
  readonly fetchItem: true;
3132
3234
  readonly translate: true;
3133
3235
  };
3236
+ readonly copyActivationLink: {
3237
+ readonly label: "copy_activation_link";
3238
+ readonly icon: "link";
3239
+ readonly translate: true;
3240
+ };
3134
3241
  };
3135
3242
  readonly icon: "users";
3136
3243
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3230,6 +3337,11 @@ export declare const collections: {
3230
3337
  readonly fetchItem: true;
3231
3338
  readonly translate: true;
3232
3339
  };
3340
+ readonly copyActivationLink: {
3341
+ readonly label: "copy_activation_link";
3342
+ readonly icon: "link";
3343
+ readonly translate: true;
3344
+ };
3233
3345
  };
3234
3346
  readonly icon: "users";
3235
3347
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3336,6 +3448,11 @@ export declare const collections: {
3336
3448
  readonly fetchItem: true;
3337
3449
  readonly translate: true;
3338
3450
  };
3451
+ readonly copyActivationLink: {
3452
+ readonly label: "copy_activation_link";
3453
+ readonly icon: "link";
3454
+ readonly translate: true;
3455
+ };
3339
3456
  };
3340
3457
  readonly icon: "users";
3341
3458
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3443,6 +3560,11 @@ export declare const collections: {
3443
3560
  readonly fetchItem: true;
3444
3561
  readonly translate: true;
3445
3562
  };
3563
+ readonly copyActivationLink: {
3564
+ readonly label: "copy_activation_link";
3565
+ readonly icon: "link";
3566
+ readonly translate: true;
3567
+ };
3446
3568
  };
3447
3569
  readonly icon: "users";
3448
3570
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3486,7 +3608,7 @@ export declare const collections: {
3486
3608
  }>>;
3487
3609
  readonly activate: (payload: {
3488
3610
  password: string;
3489
- }, context: import("@aeriajs/types").Context<{
3611
+ }, context: import("@aeriajs/types").RouteContext<null> & import("@aeriajs/types").CollectionContext<{
3490
3612
  readonly $id: "user";
3491
3613
  readonly required: readonly ["name", "roles", "email"];
3492
3614
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -3570,6 +3692,11 @@ export declare const collections: {
3570
3692
  readonly fetchItem: true;
3571
3693
  readonly translate: true;
3572
3694
  };
3695
+ readonly copyActivationLink: {
3696
+ readonly label: "copy_activation_link";
3697
+ readonly icon: "link";
3698
+ readonly translate: true;
3699
+ };
3573
3700
  };
3574
3701
  readonly icon: "users";
3575
3702
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -3585,7 +3712,17 @@ export declare const collections: {
3585
3712
  };
3586
3713
  };
3587
3714
  };
3588
- }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
3715
+ }, any> & {
3716
+ request: {
3717
+ query: {
3718
+ u?: string | undefined;
3719
+ t?: string | undefined;
3720
+ };
3721
+ payload: {
3722
+ password?: string | undefined;
3723
+ };
3724
+ };
3725
+ }) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Result.Error<{
3589
3726
  readonly code: import("./collections/user/activate.js").ActivationError.InvalidLink;
3590
3727
  } & {
3591
3728
  httpStatus: import("@aeriajs/types").HTTPStatus.NotFound;
@@ -3597,7 +3734,17 @@ export declare const collections: {
3597
3734
  readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
3598
3735
  } & {
3599
3736
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
3600
- }> | undefined>;
3737
+ }> | import("@aeriajs/types").Result.Error<{
3738
+ readonly code: import("@aeriajs/types").ACError.MalformedInput;
3739
+ } & {
3740
+ httpStatus: import("@aeriajs/types").HTTPStatus.UnprocessableContent;
3741
+ }> | {
3742
+ readonly _tag: "Result";
3743
+ readonly error: undefined;
3744
+ readonly result: {
3745
+ readonly userId: any;
3746
+ };
3747
+ } | undefined>;
3601
3748
  readonly createAccount: (payload: Omit<Pick<{
3602
3749
  picture_file: import("@aeriajs/types").SchemaWithId<{
3603
3750
  readonly $id: "file";
@@ -3917,6 +4064,11 @@ export declare const collections: {
3917
4064
  readonly fetchItem: true;
3918
4065
  readonly translate: true;
3919
4066
  };
4067
+ readonly copyActivationLink: {
4068
+ readonly label: "copy_activation_link";
4069
+ readonly icon: "link";
4070
+ readonly translate: true;
4071
+ };
3920
4072
  };
3921
4073
  readonly icon: "users";
3922
4074
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -4029,6 +4181,11 @@ export declare const collections: {
4029
4181
  readonly fetchItem: true;
4030
4182
  readonly translate: true;
4031
4183
  };
4184
+ readonly copyActivationLink: {
4185
+ readonly label: "copy_activation_link";
4186
+ readonly icon: "link";
4187
+ readonly translate: true;
4188
+ };
4032
4189
  };
4033
4190
  readonly icon: "users";
4034
4191
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -4148,6 +4305,11 @@ export declare const collections: {
4148
4305
  readonly fetchItem: true;
4149
4306
  readonly translate: true;
4150
4307
  };
4308
+ readonly copyActivationLink: {
4309
+ readonly label: "copy_activation_link";
4310
+ readonly icon: "link";
4311
+ readonly translate: true;
4312
+ };
4151
4313
  };
4152
4314
  readonly icon: "users";
4153
4315
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -4250,6 +4412,11 @@ export declare const collections: {
4250
4412
  readonly fetchItem: true;
4251
4413
  readonly translate: true;
4252
4414
  };
4415
+ readonly copyActivationLink: {
4416
+ readonly label: "copy_activation_link";
4417
+ readonly icon: "link";
4418
+ readonly translate: true;
4419
+ };
4253
4420
  };
4254
4421
  readonly icon: "users";
4255
4422
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
@@ -4267,10 +4434,22 @@ export declare const collections: {
4267
4434
  };
4268
4435
  }>;
4269
4436
  }>;
4270
- readonly getActivationLink: (userId: import("mongodb").ObjectId) => Promise<{
4437
+ readonly getActivationLink: (payload: {
4438
+ userId: string | import("mongodb").ObjectId;
4439
+ }, context: import("@aeriajs/types").Context) => Promise<{
4440
+ readonly _tag: "Error";
4441
+ readonly error: import("@aeriajs/types").StrictEndpointError<import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.MalformedInput, unknown, import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.NotFound>;
4442
+ readonly result: undefined;
4443
+ } | import("@aeriajs/types").Result.Error<{
4444
+ readonly code: import("./collections/user/activate.js").ActivationError.AlreadyActiveUser;
4445
+ } & {
4446
+ httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
4447
+ }> | {
4271
4448
  readonly _tag: "Result";
4272
4449
  readonly error: undefined;
4273
- readonly result: string;
4450
+ readonly result: {
4451
+ readonly url: string;
4452
+ };
4274
4453
  }>;
4275
4454
  };
4276
4455
  contracts: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
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.113",
49
- "@aeriajs/common": "^0.0.72",
50
- "@aeriajs/entrypoint": "^0.0.74",
51
- "@aeriajs/types": "^0.0.63",
52
- "@aeriajs/validation": "^0.0.75"
48
+ "@aeriajs/core": "^0.0.114",
49
+ "@aeriajs/common": "^0.0.73",
50
+ "@aeriajs/entrypoint": "^0.0.75",
51
+ "@aeriajs/types": "^0.0.64",
52
+ "@aeriajs/validation": "^0.0.76"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",