@aeriajs/builtins 0.0.222 → 0.0.224
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collections/user/createAccount.d.ts +5 -4
- package/dist/collections/user/createAccount.js +11 -9
- package/dist/collections/user/createAccount.mjs +12 -10
- package/dist/collections/user/description.d.ts +1 -4
- package/dist/collections/user/description.js +1 -4
- package/dist/collections/user/description.mjs +2 -5
- package/dist/collections/user/editProfile.d.ts +117 -0
- package/dist/collections/user/editProfile.js +45 -0
- package/dist/collections/user/editProfile.mjs +45 -0
- package/dist/collections/user/getActivationLink.d.ts +1 -1
- package/dist/collections/user/getActivationLink.js +1 -1
- package/dist/collections/user/getActivationLink.mjs +1 -1
- package/dist/collections/user/getCurrentUser.d.ts +1 -4
- package/dist/collections/user/getRedefinePasswordLink.d.ts +2 -2
- package/dist/collections/user/getRedefinePasswordLink.js +1 -1
- package/dist/collections/user/getRedefinePasswordLink.mjs +1 -1
- package/dist/collections/user/index.d.ts +229 -22
- package/dist/collections/user/index.js +4 -1
- package/dist/collections/user/index.mjs +4 -1
- package/dist/index.d.ts +229 -22
- package/package.json +6 -6
|
@@ -13,12 +13,17 @@ export declare const createAccount: (payload: Partial<PackReferences<SchemaWithI
|
|
|
13
13
|
readonly details: import("@aeriajs/types").PropertyValidationError | import("@aeriajs/types").ValidationError;
|
|
14
14
|
} & {
|
|
15
15
|
httpStatus: HTTPStatus.BadRequest;
|
|
16
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
17
|
+
readonly code: ACError.OwnershipError;
|
|
18
|
+
} & {
|
|
19
|
+
httpStatus: HTTPStatus.Forbidden;
|
|
16
20
|
}> | import("@aeriajs/types").InsertReturnType<SchemaWithId<{
|
|
17
21
|
readonly $id: "user";
|
|
18
22
|
readonly icon: "users";
|
|
19
23
|
readonly required: readonly ["name", "roles", "email"];
|
|
20
24
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
21
25
|
readonly indexes: readonly ["name"];
|
|
26
|
+
readonly unique: readonly ["email"];
|
|
22
27
|
readonly properties: {
|
|
23
28
|
readonly name: {
|
|
24
29
|
readonly type: "string";
|
|
@@ -43,7 +48,6 @@ export declare const createAccount: (payload: Partial<PackReferences<SchemaWithI
|
|
|
43
48
|
readonly email: {
|
|
44
49
|
readonly type: "string";
|
|
45
50
|
readonly inputType: "email";
|
|
46
|
-
readonly unique: true;
|
|
47
51
|
};
|
|
48
52
|
readonly password: {
|
|
49
53
|
readonly type: "string";
|
|
@@ -61,9 +65,6 @@ export declare const createAccount: (payload: Partial<PackReferences<SchemaWithI
|
|
|
61
65
|
readonly picture: {
|
|
62
66
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
63
67
|
};
|
|
64
|
-
readonly group: {
|
|
65
|
-
readonly type: "string";
|
|
66
|
-
};
|
|
67
68
|
readonly self_registered: {
|
|
68
69
|
readonly type: "boolean";
|
|
69
70
|
readonly readOnly: true;
|
|
@@ -4,6 +4,7 @@ exports.createAccount = exports.CreateAccountError = void 0;
|
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
5
|
const validation_1 = require("@aeriajs/validation");
|
|
6
6
|
const bcrypt = require("bcrypt");
|
|
7
|
+
const core_1 = require("@aeriajs/core");
|
|
7
8
|
var CreateAccountError;
|
|
8
9
|
(function (CreateAccountError) {
|
|
9
10
|
CreateAccountError["SignupDisallowed"] = "SIGNUP_DISALLOWED";
|
|
@@ -15,15 +16,11 @@ const createAccount = async (payload, context) => {
|
|
|
15
16
|
code: CreateAccountError.SignupDisallowed,
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
delete userCandidate._id;
|
|
19
|
-
delete userCandidate.roles;
|
|
20
|
-
delete userCandidate.active;
|
|
21
19
|
const { error, result: user } = (0, validation_1.validate)(userCandidate, {
|
|
22
20
|
type: 'object',
|
|
23
21
|
required: [
|
|
24
22
|
'name',
|
|
25
23
|
'email',
|
|
26
|
-
'phone_number',
|
|
27
24
|
],
|
|
28
25
|
properties: {
|
|
29
26
|
name: {
|
|
@@ -32,9 +29,6 @@ const createAccount = async (payload, context) => {
|
|
|
32
29
|
email: {
|
|
33
30
|
type: 'string',
|
|
34
31
|
},
|
|
35
|
-
phone_number: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
},
|
|
38
32
|
password: {
|
|
39
33
|
type: 'string',
|
|
40
34
|
},
|
|
@@ -53,17 +47,25 @@ const createAccount = async (payload, context) => {
|
|
|
53
47
|
if (user.password) {
|
|
54
48
|
user.password = await bcrypt.hash(user.password, 10);
|
|
55
49
|
}
|
|
50
|
+
const userWithExistingEmail = await context.collections.user.model.findOne({
|
|
51
|
+
email: user.email,
|
|
52
|
+
});
|
|
53
|
+
if (userWithExistingEmail) {
|
|
54
|
+
return context.error(types_1.HTTPStatus.Forbidden, {
|
|
55
|
+
code: types_1.ACError.OwnershipError,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
56
58
|
if (!context.token.authenticated) {
|
|
57
59
|
Object.assign(user, {
|
|
58
60
|
self_registered: true,
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
|
-
return
|
|
63
|
+
return (0, core_1.insert)({
|
|
62
64
|
what: {
|
|
63
65
|
...user,
|
|
64
66
|
...defaults,
|
|
65
67
|
roles,
|
|
66
68
|
},
|
|
67
|
-
});
|
|
69
|
+
}, context);
|
|
68
70
|
};
|
|
69
71
|
exports.createAccount = createAccount;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { HTTPStatus, ACError } from "@aeriajs/types";
|
|
3
3
|
import { validate } from "@aeriajs/validation";
|
|
4
4
|
import * as bcrypt from "bcrypt";
|
|
5
|
+
import { insert as originalInsert } from "@aeriajs/core";
|
|
5
6
|
export var CreateAccountError = /* @__PURE__ */ ((CreateAccountError2) => {
|
|
6
7
|
CreateAccountError2["SignupDisallowed"] = "SIGNUP_DISALLOWED";
|
|
7
8
|
return CreateAccountError2;
|
|
@@ -13,15 +14,11 @@ export const createAccount = async (payload, context) => {
|
|
|
13
14
|
code: "SIGNUP_DISALLOWED" /* SignupDisallowed */
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
delete userCandidate._id;
|
|
17
|
-
delete userCandidate.roles;
|
|
18
|
-
delete userCandidate.active;
|
|
19
17
|
const { error, result: user } = validate(userCandidate, {
|
|
20
18
|
type: "object",
|
|
21
19
|
required: [
|
|
22
20
|
"name",
|
|
23
|
-
"email"
|
|
24
|
-
"phone_number"
|
|
21
|
+
"email"
|
|
25
22
|
],
|
|
26
23
|
properties: {
|
|
27
24
|
name: {
|
|
@@ -30,9 +27,6 @@ export const createAccount = async (payload, context) => {
|
|
|
30
27
|
email: {
|
|
31
28
|
type: "string"
|
|
32
29
|
},
|
|
33
|
-
phone_number: {
|
|
34
|
-
type: "string"
|
|
35
|
-
},
|
|
36
30
|
password: {
|
|
37
31
|
type: "string"
|
|
38
32
|
}
|
|
@@ -51,16 +45,24 @@ export const createAccount = async (payload, context) => {
|
|
|
51
45
|
if (user.password) {
|
|
52
46
|
user.password = await bcrypt.hash(user.password, 10);
|
|
53
47
|
}
|
|
48
|
+
const userWithExistingEmail = await context.collections.user.model.findOne({
|
|
49
|
+
email: user.email
|
|
50
|
+
});
|
|
51
|
+
if (userWithExistingEmail) {
|
|
52
|
+
return context.error(HTTPStatus.Forbidden, {
|
|
53
|
+
code: ACError.OwnershipError
|
|
54
|
+
});
|
|
55
|
+
}
|
|
54
56
|
if (!context.token.authenticated) {
|
|
55
57
|
Object.assign(user, {
|
|
56
58
|
self_registered: true
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
|
-
return
|
|
61
|
+
return originalInsert({
|
|
60
62
|
what: {
|
|
61
63
|
...user,
|
|
62
64
|
...defaults,
|
|
63
65
|
roles
|
|
64
66
|
}
|
|
65
|
-
});
|
|
67
|
+
}, context);
|
|
66
68
|
};
|
|
@@ -8,6 +8,7 @@ export declare const description: {
|
|
|
8
8
|
readonly required: readonly ["name", "roles", "email"];
|
|
9
9
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
10
10
|
readonly indexes: readonly ["name"];
|
|
11
|
+
readonly unique: readonly ["email"];
|
|
11
12
|
readonly properties: {
|
|
12
13
|
readonly name: {
|
|
13
14
|
readonly type: "string";
|
|
@@ -32,7 +33,6 @@ export declare const description: {
|
|
|
32
33
|
readonly email: {
|
|
33
34
|
readonly type: "string";
|
|
34
35
|
readonly inputType: "email";
|
|
35
|
-
readonly unique: true;
|
|
36
36
|
};
|
|
37
37
|
readonly password: {
|
|
38
38
|
readonly type: "string";
|
|
@@ -50,9 +50,6 @@ export declare const description: {
|
|
|
50
50
|
readonly picture: {
|
|
51
51
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
52
52
|
};
|
|
53
|
-
readonly group: {
|
|
54
|
-
readonly type: "string";
|
|
55
|
-
};
|
|
56
53
|
readonly self_registered: {
|
|
57
54
|
readonly type: "boolean";
|
|
58
55
|
readonly readOnly: true;
|
|
@@ -24,6 +24,7 @@ exports.description = (0, core_1.defineDescription)({
|
|
|
24
24
|
'picture_file',
|
|
25
25
|
],
|
|
26
26
|
indexes: ['name'],
|
|
27
|
+
unique: ['email'],
|
|
27
28
|
properties: {
|
|
28
29
|
name: {
|
|
29
30
|
type: 'string',
|
|
@@ -56,7 +57,6 @@ exports.description = (0, core_1.defineDescription)({
|
|
|
56
57
|
email: {
|
|
57
58
|
type: 'string',
|
|
58
59
|
inputType: 'email',
|
|
59
|
-
unique: true,
|
|
60
60
|
},
|
|
61
61
|
password: {
|
|
62
62
|
type: 'string',
|
|
@@ -78,9 +78,6 @@ exports.description = (0, core_1.defineDescription)({
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
|
-
group: {
|
|
82
|
-
type: 'string',
|
|
83
|
-
},
|
|
84
81
|
self_registered: {
|
|
85
82
|
type: 'boolean',
|
|
86
83
|
readOnly: true,
|
|
@@ -18,6 +18,7 @@ export const description = defineDescription({
|
|
|
18
18
|
"picture_file"
|
|
19
19
|
],
|
|
20
20
|
indexes: ["name"],
|
|
21
|
+
unique: ["email"],
|
|
21
22
|
properties: {
|
|
22
23
|
name: {
|
|
23
24
|
type: "string"
|
|
@@ -49,8 +50,7 @@ export const description = defineDescription({
|
|
|
49
50
|
},
|
|
50
51
|
email: {
|
|
51
52
|
type: "string",
|
|
52
|
-
inputType: "email"
|
|
53
|
-
unique: true
|
|
53
|
+
inputType: "email"
|
|
54
54
|
},
|
|
55
55
|
password: {
|
|
56
56
|
type: "string",
|
|
@@ -72,9 +72,6 @@ export const description = defineDescription({
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
group: {
|
|
76
|
-
type: "string"
|
|
77
|
-
},
|
|
78
75
|
self_registered: {
|
|
79
76
|
type: "boolean",
|
|
80
77
|
readOnly: true
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { HTTPStatus, ACError, type Context, type SchemaWithId, type PackReferences } from '@aeriajs/types';
|
|
2
|
+
import { type description } from './description.js';
|
|
3
|
+
export declare const editProfile: (payload: Partial<PackReferences<SchemaWithId<typeof description>>> & Record<string, unknown>, context: Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<SchemaWithId<{
|
|
4
|
+
readonly $id: "user";
|
|
5
|
+
readonly icon: "users";
|
|
6
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
7
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
8
|
+
readonly indexes: readonly ["name"];
|
|
9
|
+
readonly unique: readonly ["email"];
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly name: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
};
|
|
14
|
+
readonly given_name: {
|
|
15
|
+
readonly getter: (doc: object) => string | undefined;
|
|
16
|
+
};
|
|
17
|
+
readonly family_name: {
|
|
18
|
+
readonly getter: (doc: object) => string | undefined;
|
|
19
|
+
};
|
|
20
|
+
readonly active: {
|
|
21
|
+
readonly type: "boolean";
|
|
22
|
+
};
|
|
23
|
+
readonly roles: {
|
|
24
|
+
readonly type: "array";
|
|
25
|
+
readonly items: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
};
|
|
28
|
+
readonly uniqueItems: true;
|
|
29
|
+
readonly minItems: 1;
|
|
30
|
+
};
|
|
31
|
+
readonly email: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly inputType: "email";
|
|
34
|
+
};
|
|
35
|
+
readonly password: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly inputType: "password";
|
|
38
|
+
readonly hidden: true;
|
|
39
|
+
};
|
|
40
|
+
readonly phone_number: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly mask: "(##) #####-####";
|
|
43
|
+
};
|
|
44
|
+
readonly picture_file: {
|
|
45
|
+
readonly $ref: "file";
|
|
46
|
+
readonly accept: readonly ["image/*"];
|
|
47
|
+
};
|
|
48
|
+
readonly picture: {
|
|
49
|
+
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
50
|
+
};
|
|
51
|
+
readonly self_registered: {
|
|
52
|
+
readonly type: "boolean";
|
|
53
|
+
readonly readOnly: true;
|
|
54
|
+
};
|
|
55
|
+
readonly updated_at: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
readonly format: "date-time";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly presets: readonly ["crud", "duplicate"];
|
|
61
|
+
readonly layout: {
|
|
62
|
+
readonly name: "grid";
|
|
63
|
+
readonly options: {
|
|
64
|
+
readonly title: "name";
|
|
65
|
+
readonly badge: "roles";
|
|
66
|
+
readonly picture: "picture_file";
|
|
67
|
+
readonly information: "email";
|
|
68
|
+
readonly active: "active";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
readonly individualActions: {
|
|
72
|
+
readonly changePassword: {
|
|
73
|
+
readonly label: "change_password";
|
|
74
|
+
readonly icon: "key";
|
|
75
|
+
readonly translate: true;
|
|
76
|
+
readonly route: {
|
|
77
|
+
readonly name: "/dashboard/user/changepass";
|
|
78
|
+
readonly fetchItem: true;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly copyRedefinePasswordLink: {
|
|
82
|
+
readonly label: "copy_redefine_password_link";
|
|
83
|
+
readonly icon: "link";
|
|
84
|
+
readonly translate: true;
|
|
85
|
+
};
|
|
86
|
+
readonly copyActivationLink: {
|
|
87
|
+
readonly label: "copy_activation_link";
|
|
88
|
+
readonly icon: "link";
|
|
89
|
+
readonly translate: true;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
93
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
94
|
+
readonly tableMeta: readonly ["email"];
|
|
95
|
+
readonly formLayout: {
|
|
96
|
+
readonly fields: {
|
|
97
|
+
readonly given_name: {
|
|
98
|
+
readonly span: 3;
|
|
99
|
+
};
|
|
100
|
+
readonly family_name: {
|
|
101
|
+
readonly span: 3;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}>> | import("@aeriajs/types").Result.Error<{
|
|
106
|
+
readonly code: ACError.MalformedInput;
|
|
107
|
+
} & {
|
|
108
|
+
httpStatus: HTTPStatus.BadRequest;
|
|
109
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
110
|
+
readonly code: ACError.AuthorizationError;
|
|
111
|
+
} & {
|
|
112
|
+
httpStatus: HTTPStatus.Unauthorized;
|
|
113
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
114
|
+
readonly code: ACError.TargetImmutable;
|
|
115
|
+
} & {
|
|
116
|
+
httpStatus: HTTPStatus.Forbidden;
|
|
117
|
+
}>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editProfile = void 0;
|
|
4
|
+
const types_1 = require("@aeriajs/types");
|
|
5
|
+
const core_1 = require("@aeriajs/core");
|
|
6
|
+
const bcrypt = require("bcrypt");
|
|
7
|
+
const editProfile = async (payload, context) => {
|
|
8
|
+
const mutableProperties = context.config.security.mutableUserProperties;
|
|
9
|
+
if (!context.token.authenticated || !context.token.sub) {
|
|
10
|
+
throw new Error;
|
|
11
|
+
}
|
|
12
|
+
if (!payload._id) {
|
|
13
|
+
return context.error(types_1.HTTPStatus.BadRequest, {
|
|
14
|
+
code: types_1.ACError.MalformedInput,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (!context.token.sub.equals(payload._id)) {
|
|
18
|
+
return context.error(types_1.HTTPStatus.Unauthorized, {
|
|
19
|
+
code: types_1.ACError.AuthorizationError,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const user = await context.collections.user.model.findOne({
|
|
23
|
+
_id: context.token.sub,
|
|
24
|
+
});
|
|
25
|
+
if (!user) {
|
|
26
|
+
throw new Error;
|
|
27
|
+
}
|
|
28
|
+
if (payload.password && typeof payload.password === 'string') {
|
|
29
|
+
payload.password = await bcrypt.hash(payload.password, 10);
|
|
30
|
+
}
|
|
31
|
+
const whatPropKeyArray = Object.keys(payload).filter((prop) => prop !== '_id');
|
|
32
|
+
const hasImmutableProps = whatPropKeyArray.some((prop) => !(mutableProperties.includes(prop)));
|
|
33
|
+
if (hasImmutableProps) {
|
|
34
|
+
return context.error(types_1.HTTPStatus.Forbidden, {
|
|
35
|
+
code: types_1.ACError.TargetImmutable,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return (0, core_1.insert)({
|
|
39
|
+
what: {
|
|
40
|
+
_id: payload._id,
|
|
41
|
+
...payload,
|
|
42
|
+
},
|
|
43
|
+
}, context);
|
|
44
|
+
};
|
|
45
|
+
exports.editProfile = editProfile;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { HTTPStatus, ACError } from "@aeriajs/types";
|
|
3
|
+
import { insert as originalInsert } from "@aeriajs/core";
|
|
4
|
+
import * as bcrypt from "bcrypt";
|
|
5
|
+
export const editProfile = async (payload, context) => {
|
|
6
|
+
const mutableProperties = context.config.security.mutableUserProperties;
|
|
7
|
+
if (!context.token.authenticated || !context.token.sub) {
|
|
8
|
+
throw new Error();
|
|
9
|
+
}
|
|
10
|
+
if (!payload._id) {
|
|
11
|
+
return context.error(HTTPStatus.BadRequest, {
|
|
12
|
+
code: ACError.MalformedInput
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
if (!context.token.sub.equals(payload._id)) {
|
|
16
|
+
return context.error(HTTPStatus.Unauthorized, {
|
|
17
|
+
code: ACError.AuthorizationError
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const user = await context.collections.user.model.findOne({
|
|
21
|
+
_id: context.token.sub
|
|
22
|
+
});
|
|
23
|
+
if (!user) {
|
|
24
|
+
throw new Error();
|
|
25
|
+
}
|
|
26
|
+
if (payload.password && typeof payload.password === "string") {
|
|
27
|
+
payload.password = await bcrypt.hash(payload.password, 10);
|
|
28
|
+
}
|
|
29
|
+
const whatPropKeyArray = Object.keys(payload).filter((prop) => prop !== "_id");
|
|
30
|
+
const hasImmutableProps = whatPropKeyArray.some((prop) => !mutableProperties.includes(prop));
|
|
31
|
+
if (hasImmutableProps) {
|
|
32
|
+
return context.error(HTTPStatus.Forbidden, {
|
|
33
|
+
code: ACError.TargetImmutable
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return originalInsert(
|
|
37
|
+
{
|
|
38
|
+
what: {
|
|
39
|
+
_id: payload._id,
|
|
40
|
+
...payload
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
context
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -24,6 +24,7 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
|
|
|
24
24
|
readonly required: readonly ["name", "roles", "email"];
|
|
25
25
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
26
26
|
readonly indexes: readonly ["name"];
|
|
27
|
+
readonly unique: readonly ["email"];
|
|
27
28
|
readonly properties: {
|
|
28
29
|
readonly name: {
|
|
29
30
|
readonly type: "string";
|
|
@@ -48,7 +49,6 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
|
|
|
48
49
|
readonly email: {
|
|
49
50
|
readonly type: "string";
|
|
50
51
|
readonly inputType: "email";
|
|
51
|
-
readonly unique: true;
|
|
52
52
|
};
|
|
53
53
|
readonly password: {
|
|
54
54
|
readonly type: "string";
|
|
@@ -66,9 +66,6 @@ export declare const getCurrentUser: (_payload: undefined, context: Context<type
|
|
|
66
66
|
readonly picture: {
|
|
67
67
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
68
68
|
};
|
|
69
|
-
readonly group: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
};
|
|
72
69
|
readonly self_registered: {
|
|
73
70
|
readonly type: "boolean";
|
|
74
71
|
readonly readOnly: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@aeriajs/types';
|
|
2
|
-
import {
|
|
2
|
+
import type { ObjectId } from '@aeriajs/core';
|
|
3
3
|
import { Result, HTTPStatus } from '@aeriajs/types';
|
|
4
4
|
import { ActivationError } from './redefinePassword.js';
|
|
5
5
|
export declare const getRedefinePasswordLink: (payload: {
|
|
@@ -55,6 +55,6 @@ export declare const getRedefinePasswordLink: (payload: {
|
|
|
55
55
|
readonly _tag: "Result";
|
|
56
56
|
readonly error: undefined;
|
|
57
57
|
readonly result: {
|
|
58
|
-
readonly url:
|
|
58
|
+
readonly url: string;
|
|
59
59
|
};
|
|
60
60
|
}>;
|