@aeriajs/builtins 0.0.221 → 0.0.223
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/getCurrentUser.d.ts +1 -4
- package/dist/collections/user/index.d.ts +227 -20
- package/dist/collections/user/index.js +4 -1
- package/dist/collections/user/index.mjs +4 -1
- package/dist/index.d.ts +227 -20
- 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;
|
|
@@ -6,6 +6,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
6
6
|
readonly required: readonly ["name", "roles", "email"];
|
|
7
7
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
8
8
|
readonly indexes: readonly ["name"];
|
|
9
|
+
readonly unique: readonly ["email"];
|
|
9
10
|
readonly properties: {
|
|
10
11
|
readonly name: {
|
|
11
12
|
readonly type: "string";
|
|
@@ -30,7 +31,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
30
31
|
readonly email: {
|
|
31
32
|
readonly type: "string";
|
|
32
33
|
readonly inputType: "email";
|
|
33
|
-
readonly unique: true;
|
|
34
34
|
};
|
|
35
35
|
readonly password: {
|
|
36
36
|
readonly type: "string";
|
|
@@ -48,9 +48,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
48
48
|
readonly picture: {
|
|
49
49
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
50
50
|
};
|
|
51
|
-
readonly group: {
|
|
52
|
-
readonly type: "string";
|
|
53
|
-
};
|
|
54
51
|
readonly self_registered: {
|
|
55
52
|
readonly type: "boolean";
|
|
56
53
|
readonly readOnly: true;
|
|
@@ -112,6 +109,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
112
109
|
readonly required: readonly ["name", "roles", "email"];
|
|
113
110
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
114
111
|
readonly indexes: readonly ["name"];
|
|
112
|
+
readonly unique: readonly ["email"];
|
|
115
113
|
readonly properties: {
|
|
116
114
|
readonly name: {
|
|
117
115
|
readonly type: "string";
|
|
@@ -136,7 +134,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
136
134
|
readonly email: {
|
|
137
135
|
readonly type: "string";
|
|
138
136
|
readonly inputType: "email";
|
|
139
|
-
readonly unique: true;
|
|
140
137
|
};
|
|
141
138
|
readonly password: {
|
|
142
139
|
readonly type: "string";
|
|
@@ -154,9 +151,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
154
151
|
readonly picture: {
|
|
155
152
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
156
153
|
};
|
|
157
|
-
readonly group: {
|
|
158
|
-
readonly type: "string";
|
|
159
|
-
};
|
|
160
154
|
readonly self_registered: {
|
|
161
155
|
readonly type: "boolean";
|
|
162
156
|
readonly readOnly: true;
|
|
@@ -250,6 +244,223 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
250
244
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
251
245
|
}>>;
|
|
252
246
|
readonly insert: (payload: NoInfer<import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>, context: Omit<Context, "token">) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>;
|
|
247
|
+
readonly editProfile: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
|
|
248
|
+
readonly $id: "user";
|
|
249
|
+
readonly icon: "users";
|
|
250
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
251
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
252
|
+
readonly indexes: readonly ["name"];
|
|
253
|
+
readonly unique: readonly ["email"];
|
|
254
|
+
readonly properties: {
|
|
255
|
+
readonly name: {
|
|
256
|
+
readonly type: "string";
|
|
257
|
+
};
|
|
258
|
+
readonly given_name: {
|
|
259
|
+
readonly getter: (doc: object) => string | undefined;
|
|
260
|
+
};
|
|
261
|
+
readonly family_name: {
|
|
262
|
+
readonly getter: (doc: object) => string | undefined;
|
|
263
|
+
};
|
|
264
|
+
readonly active: {
|
|
265
|
+
readonly type: "boolean";
|
|
266
|
+
};
|
|
267
|
+
readonly roles: {
|
|
268
|
+
readonly type: "array";
|
|
269
|
+
readonly items: {
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
};
|
|
272
|
+
readonly uniqueItems: true;
|
|
273
|
+
readonly minItems: 1;
|
|
274
|
+
};
|
|
275
|
+
readonly email: {
|
|
276
|
+
readonly type: "string";
|
|
277
|
+
readonly inputType: "email";
|
|
278
|
+
};
|
|
279
|
+
readonly password: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly inputType: "password";
|
|
282
|
+
readonly hidden: true;
|
|
283
|
+
};
|
|
284
|
+
readonly phone_number: {
|
|
285
|
+
readonly type: "string";
|
|
286
|
+
readonly mask: "(##) #####-####";
|
|
287
|
+
};
|
|
288
|
+
readonly picture_file: {
|
|
289
|
+
readonly $ref: "file";
|
|
290
|
+
readonly accept: readonly ["image/*"];
|
|
291
|
+
};
|
|
292
|
+
readonly picture: {
|
|
293
|
+
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
294
|
+
};
|
|
295
|
+
readonly self_registered: {
|
|
296
|
+
readonly type: "boolean";
|
|
297
|
+
readonly readOnly: true;
|
|
298
|
+
};
|
|
299
|
+
readonly updated_at: {
|
|
300
|
+
readonly type: "string";
|
|
301
|
+
readonly format: "date-time";
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
readonly presets: readonly ["crud", "duplicate"];
|
|
305
|
+
readonly layout: {
|
|
306
|
+
readonly name: "grid";
|
|
307
|
+
readonly options: {
|
|
308
|
+
readonly title: "name";
|
|
309
|
+
readonly badge: "roles";
|
|
310
|
+
readonly picture: "picture_file";
|
|
311
|
+
readonly information: "email";
|
|
312
|
+
readonly active: "active";
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
readonly individualActions: {
|
|
316
|
+
readonly changePassword: {
|
|
317
|
+
readonly label: "change_password";
|
|
318
|
+
readonly icon: "key";
|
|
319
|
+
readonly translate: true;
|
|
320
|
+
readonly route: {
|
|
321
|
+
readonly name: "/dashboard/user/changepass";
|
|
322
|
+
readonly fetchItem: true;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
readonly copyRedefinePasswordLink: {
|
|
326
|
+
readonly label: "copy_redefine_password_link";
|
|
327
|
+
readonly icon: "link";
|
|
328
|
+
readonly translate: true;
|
|
329
|
+
};
|
|
330
|
+
readonly copyActivationLink: {
|
|
331
|
+
readonly label: "copy_activation_link";
|
|
332
|
+
readonly icon: "link";
|
|
333
|
+
readonly translate: true;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
337
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
338
|
+
readonly tableMeta: readonly ["email"];
|
|
339
|
+
readonly formLayout: {
|
|
340
|
+
readonly fields: {
|
|
341
|
+
readonly given_name: {
|
|
342
|
+
readonly span: 3;
|
|
343
|
+
};
|
|
344
|
+
readonly family_name: {
|
|
345
|
+
readonly span: 3;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
}>>> & Record<string, unknown>, context: Omit<Context, "token">) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
350
|
+
readonly $id: "user";
|
|
351
|
+
readonly icon: "users";
|
|
352
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
353
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
354
|
+
readonly indexes: readonly ["name"];
|
|
355
|
+
readonly unique: readonly ["email"];
|
|
356
|
+
readonly properties: {
|
|
357
|
+
readonly name: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
};
|
|
360
|
+
readonly given_name: {
|
|
361
|
+
readonly getter: (doc: object) => string | undefined;
|
|
362
|
+
};
|
|
363
|
+
readonly family_name: {
|
|
364
|
+
readonly getter: (doc: object) => string | undefined;
|
|
365
|
+
};
|
|
366
|
+
readonly active: {
|
|
367
|
+
readonly type: "boolean";
|
|
368
|
+
};
|
|
369
|
+
readonly roles: {
|
|
370
|
+
readonly type: "array";
|
|
371
|
+
readonly items: {
|
|
372
|
+
readonly type: "string";
|
|
373
|
+
};
|
|
374
|
+
readonly uniqueItems: true;
|
|
375
|
+
readonly minItems: 1;
|
|
376
|
+
};
|
|
377
|
+
readonly email: {
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
readonly inputType: "email";
|
|
380
|
+
};
|
|
381
|
+
readonly password: {
|
|
382
|
+
readonly type: "string";
|
|
383
|
+
readonly inputType: "password";
|
|
384
|
+
readonly hidden: true;
|
|
385
|
+
};
|
|
386
|
+
readonly phone_number: {
|
|
387
|
+
readonly type: "string";
|
|
388
|
+
readonly mask: "(##) #####-####";
|
|
389
|
+
};
|
|
390
|
+
readonly picture_file: {
|
|
391
|
+
readonly $ref: "file";
|
|
392
|
+
readonly accept: readonly ["image/*"];
|
|
393
|
+
};
|
|
394
|
+
readonly picture: {
|
|
395
|
+
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
396
|
+
};
|
|
397
|
+
readonly self_registered: {
|
|
398
|
+
readonly type: "boolean";
|
|
399
|
+
readonly readOnly: true;
|
|
400
|
+
};
|
|
401
|
+
readonly updated_at: {
|
|
402
|
+
readonly type: "string";
|
|
403
|
+
readonly format: "date-time";
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
readonly presets: readonly ["crud", "duplicate"];
|
|
407
|
+
readonly layout: {
|
|
408
|
+
readonly name: "grid";
|
|
409
|
+
readonly options: {
|
|
410
|
+
readonly title: "name";
|
|
411
|
+
readonly badge: "roles";
|
|
412
|
+
readonly picture: "picture_file";
|
|
413
|
+
readonly information: "email";
|
|
414
|
+
readonly active: "active";
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
readonly individualActions: {
|
|
418
|
+
readonly changePassword: {
|
|
419
|
+
readonly label: "change_password";
|
|
420
|
+
readonly icon: "key";
|
|
421
|
+
readonly translate: true;
|
|
422
|
+
readonly route: {
|
|
423
|
+
readonly name: "/dashboard/user/changepass";
|
|
424
|
+
readonly fetchItem: true;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
readonly copyRedefinePasswordLink: {
|
|
428
|
+
readonly label: "copy_redefine_password_link";
|
|
429
|
+
readonly icon: "link";
|
|
430
|
+
readonly translate: true;
|
|
431
|
+
};
|
|
432
|
+
readonly copyActivationLink: {
|
|
433
|
+
readonly label: "copy_activation_link";
|
|
434
|
+
readonly icon: "link";
|
|
435
|
+
readonly translate: true;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
439
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
440
|
+
readonly tableMeta: readonly ["email"];
|
|
441
|
+
readonly formLayout: {
|
|
442
|
+
readonly fields: {
|
|
443
|
+
readonly given_name: {
|
|
444
|
+
readonly span: 3;
|
|
445
|
+
};
|
|
446
|
+
readonly family_name: {
|
|
447
|
+
readonly span: 3;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
}>> | import("@aeriajs/types").Result.Error<{
|
|
452
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
453
|
+
} & {
|
|
454
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
455
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
456
|
+
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
457
|
+
} & {
|
|
458
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
459
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
460
|
+
readonly code: import("@aeriajs/types").ACError.TargetImmutable;
|
|
461
|
+
} & {
|
|
462
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
463
|
+
}>>;
|
|
253
464
|
readonly authenticate: (payload: {
|
|
254
465
|
email: string;
|
|
255
466
|
password: string;
|
|
@@ -326,6 +537,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
326
537
|
readonly required: readonly ["name", "roles", "email"];
|
|
327
538
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
328
539
|
readonly indexes: readonly ["name"];
|
|
540
|
+
readonly unique: readonly ["email"];
|
|
329
541
|
readonly properties: {
|
|
330
542
|
readonly name: {
|
|
331
543
|
readonly type: "string";
|
|
@@ -350,7 +562,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
350
562
|
readonly email: {
|
|
351
563
|
readonly type: "string";
|
|
352
564
|
readonly inputType: "email";
|
|
353
|
-
readonly unique: true;
|
|
354
565
|
};
|
|
355
566
|
readonly password: {
|
|
356
567
|
readonly type: "string";
|
|
@@ -368,9 +579,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
368
579
|
readonly picture: {
|
|
369
580
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
370
581
|
};
|
|
371
|
-
readonly group: {
|
|
372
|
-
readonly type: "string";
|
|
373
|
-
};
|
|
374
582
|
readonly self_registered: {
|
|
375
583
|
readonly type: "boolean";
|
|
376
584
|
readonly readOnly: true;
|
|
@@ -434,12 +642,17 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
434
642
|
readonly details: import("@aeriajs/types").PropertyValidationError | import("@aeriajs/types").ValidationError;
|
|
435
643
|
} & {
|
|
436
644
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
645
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
646
|
+
readonly code: import("@aeriajs/types").ACError.OwnershipError;
|
|
647
|
+
} & {
|
|
648
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
437
649
|
}> | import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
438
650
|
readonly $id: "user";
|
|
439
651
|
readonly icon: "users";
|
|
440
652
|
readonly required: readonly ["name", "roles", "email"];
|
|
441
653
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
442
654
|
readonly indexes: readonly ["name"];
|
|
655
|
+
readonly unique: readonly ["email"];
|
|
443
656
|
readonly properties: {
|
|
444
657
|
readonly name: {
|
|
445
658
|
readonly type: "string";
|
|
@@ -464,7 +677,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
464
677
|
readonly email: {
|
|
465
678
|
readonly type: "string";
|
|
466
679
|
readonly inputType: "email";
|
|
467
|
-
readonly unique: true;
|
|
468
680
|
};
|
|
469
681
|
readonly password: {
|
|
470
682
|
readonly type: "string";
|
|
@@ -482,9 +694,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
482
694
|
readonly picture: {
|
|
483
695
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
484
696
|
};
|
|
485
|
-
readonly group: {
|
|
486
|
-
readonly type: "string";
|
|
487
|
-
};
|
|
488
697
|
readonly self_registered: {
|
|
489
698
|
readonly type: "boolean";
|
|
490
699
|
readonly readOnly: true;
|
|
@@ -583,6 +792,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
583
792
|
readonly required: readonly ["name", "roles", "email"];
|
|
584
793
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
585
794
|
readonly indexes: readonly ["name"];
|
|
795
|
+
readonly unique: readonly ["email"];
|
|
586
796
|
readonly properties: {
|
|
587
797
|
readonly name: {
|
|
588
798
|
readonly type: "string";
|
|
@@ -607,7 +817,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
607
817
|
readonly email: {
|
|
608
818
|
readonly type: "string";
|
|
609
819
|
readonly inputType: "email";
|
|
610
|
-
readonly unique: true;
|
|
611
820
|
};
|
|
612
821
|
readonly password: {
|
|
613
822
|
readonly type: "string";
|
|
@@ -625,9 +834,6 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
625
834
|
readonly picture: {
|
|
626
835
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
627
836
|
};
|
|
628
|
-
readonly group: {
|
|
629
|
-
readonly type: "string";
|
|
630
|
-
};
|
|
631
837
|
readonly self_registered: {
|
|
632
838
|
readonly type: "boolean";
|
|
633
839
|
readonly readOnly: true;
|
|
@@ -839,6 +1045,7 @@ export declare const user: Omit<Collection<never>, "functions" | "description" |
|
|
|
839
1045
|
readonly upload?: import("@aeriajs/types").Contract | undefined;
|
|
840
1046
|
readonly removeFile?: import("@aeriajs/types").Contract | undefined;
|
|
841
1047
|
readonly insert?: import("@aeriajs/types").Contract | undefined;
|
|
1048
|
+
readonly editProfile?: import("@aeriajs/types").Contract | undefined;
|
|
842
1049
|
readonly authenticate?: import("@aeriajs/types").Contract | undefined;
|
|
843
1050
|
readonly activate?: import("@aeriajs/types").Contract | undefined;
|
|
844
1051
|
readonly createAccount?: import("@aeriajs/types").Contract | undefined;
|
|
@@ -12,6 +12,7 @@ const getCurrentUser_js_1 = require("./getCurrentUser.js");
|
|
|
12
12
|
const getActivationLink_js_1 = require("./getActivationLink.js");
|
|
13
13
|
const redefinePassword_js_1 = require("./redefinePassword.js");
|
|
14
14
|
const getRedefinePasswordLink_js_1 = require("./getRedefinePasswordLink.js");
|
|
15
|
+
const editProfile_js_1 = require("./editProfile.js");
|
|
15
16
|
const functions = {
|
|
16
17
|
get: core_1.get,
|
|
17
18
|
getAll: core_1.getAll,
|
|
@@ -19,6 +20,7 @@ const functions = {
|
|
|
19
20
|
upload: core_1.upload,
|
|
20
21
|
removeFile: core_1.removeFile,
|
|
21
22
|
insert: insert_js_1.insert,
|
|
23
|
+
editProfile: editProfile_js_1.editProfile,
|
|
22
24
|
authenticate: authenticate_js_1.authenticate,
|
|
23
25
|
activate: activate_js_1.activate,
|
|
24
26
|
createAccount: createAccount_js_1.createAccount,
|
|
@@ -34,7 +36,8 @@ const exposedFunctions = {
|
|
|
34
36
|
remove: ['root'],
|
|
35
37
|
upload: true,
|
|
36
38
|
removeFile: true,
|
|
37
|
-
insert:
|
|
39
|
+
insert: ['root'],
|
|
40
|
+
editProfile: true,
|
|
38
41
|
authenticate: 'unauthenticated',
|
|
39
42
|
activate: [
|
|
40
43
|
'unauthenticated',
|
|
@@ -10,6 +10,7 @@ import { getCurrentUser } from "./getCurrentUser.mjs";
|
|
|
10
10
|
import { getActivationLink } from "./getActivationLink.mjs";
|
|
11
11
|
import { redefinePassword } from "./redefinePassword.mjs";
|
|
12
12
|
import { getRedefinePasswordLink } from "./getRedefinePasswordLink.mjs";
|
|
13
|
+
import { editProfile } from "./editProfile.mjs";
|
|
13
14
|
const functions = {
|
|
14
15
|
get,
|
|
15
16
|
getAll,
|
|
@@ -17,6 +18,7 @@ const functions = {
|
|
|
17
18
|
upload,
|
|
18
19
|
removeFile,
|
|
19
20
|
insert,
|
|
21
|
+
editProfile,
|
|
20
22
|
authenticate,
|
|
21
23
|
activate,
|
|
22
24
|
createAccount,
|
|
@@ -32,7 +34,8 @@ const exposedFunctions = {
|
|
|
32
34
|
remove: ["root"],
|
|
33
35
|
upload: true,
|
|
34
36
|
removeFile: true,
|
|
35
|
-
insert:
|
|
37
|
+
insert: ["root"],
|
|
38
|
+
editProfile: true,
|
|
36
39
|
authenticate: "unauthenticated",
|
|
37
40
|
activate: [
|
|
38
41
|
"unauthenticated",
|
package/dist/index.d.ts
CHANGED
|
@@ -470,6 +470,7 @@ export declare const collections: {
|
|
|
470
470
|
readonly required: readonly ["name", "roles", "email"];
|
|
471
471
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
472
472
|
readonly indexes: readonly ["name"];
|
|
473
|
+
readonly unique: readonly ["email"];
|
|
473
474
|
readonly properties: {
|
|
474
475
|
readonly name: {
|
|
475
476
|
readonly type: "string";
|
|
@@ -494,7 +495,6 @@ export declare const collections: {
|
|
|
494
495
|
readonly email: {
|
|
495
496
|
readonly type: "string";
|
|
496
497
|
readonly inputType: "email";
|
|
497
|
-
readonly unique: true;
|
|
498
498
|
};
|
|
499
499
|
readonly password: {
|
|
500
500
|
readonly type: "string";
|
|
@@ -512,9 +512,6 @@ export declare const collections: {
|
|
|
512
512
|
readonly picture: {
|
|
513
513
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
514
514
|
};
|
|
515
|
-
readonly group: {
|
|
516
|
-
readonly type: "string";
|
|
517
|
-
};
|
|
518
515
|
readonly self_registered: {
|
|
519
516
|
readonly type: "boolean";
|
|
520
517
|
readonly readOnly: true;
|
|
@@ -576,6 +573,7 @@ export declare const collections: {
|
|
|
576
573
|
readonly required: readonly ["name", "roles", "email"];
|
|
577
574
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
578
575
|
readonly indexes: readonly ["name"];
|
|
576
|
+
readonly unique: readonly ["email"];
|
|
579
577
|
readonly properties: {
|
|
580
578
|
readonly name: {
|
|
581
579
|
readonly type: "string";
|
|
@@ -600,7 +598,6 @@ export declare const collections: {
|
|
|
600
598
|
readonly email: {
|
|
601
599
|
readonly type: "string";
|
|
602
600
|
readonly inputType: "email";
|
|
603
|
-
readonly unique: true;
|
|
604
601
|
};
|
|
605
602
|
readonly password: {
|
|
606
603
|
readonly type: "string";
|
|
@@ -618,9 +615,6 @@ export declare const collections: {
|
|
|
618
615
|
readonly picture: {
|
|
619
616
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
620
617
|
};
|
|
621
|
-
readonly group: {
|
|
622
|
-
readonly type: "string";
|
|
623
|
-
};
|
|
624
618
|
readonly self_registered: {
|
|
625
619
|
readonly type: "boolean";
|
|
626
620
|
readonly readOnly: true;
|
|
@@ -714,6 +708,223 @@ export declare const collections: {
|
|
|
714
708
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
715
709
|
}>>;
|
|
716
710
|
readonly insert: (payload: NoInfer<import("@aeriajs/types").InsertPayload<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>>;
|
|
711
|
+
readonly editProfile: (payload: Partial<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
|
|
712
|
+
readonly $id: "user";
|
|
713
|
+
readonly icon: "users";
|
|
714
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
715
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
716
|
+
readonly indexes: readonly ["name"];
|
|
717
|
+
readonly unique: readonly ["email"];
|
|
718
|
+
readonly properties: {
|
|
719
|
+
readonly name: {
|
|
720
|
+
readonly type: "string";
|
|
721
|
+
};
|
|
722
|
+
readonly given_name: {
|
|
723
|
+
readonly getter: (doc: object) => string | undefined;
|
|
724
|
+
};
|
|
725
|
+
readonly family_name: {
|
|
726
|
+
readonly getter: (doc: object) => string | undefined;
|
|
727
|
+
};
|
|
728
|
+
readonly active: {
|
|
729
|
+
readonly type: "boolean";
|
|
730
|
+
};
|
|
731
|
+
readonly roles: {
|
|
732
|
+
readonly type: "array";
|
|
733
|
+
readonly items: {
|
|
734
|
+
readonly type: "string";
|
|
735
|
+
};
|
|
736
|
+
readonly uniqueItems: true;
|
|
737
|
+
readonly minItems: 1;
|
|
738
|
+
};
|
|
739
|
+
readonly email: {
|
|
740
|
+
readonly type: "string";
|
|
741
|
+
readonly inputType: "email";
|
|
742
|
+
};
|
|
743
|
+
readonly password: {
|
|
744
|
+
readonly type: "string";
|
|
745
|
+
readonly inputType: "password";
|
|
746
|
+
readonly hidden: true;
|
|
747
|
+
};
|
|
748
|
+
readonly phone_number: {
|
|
749
|
+
readonly type: "string";
|
|
750
|
+
readonly mask: "(##) #####-####";
|
|
751
|
+
};
|
|
752
|
+
readonly picture_file: {
|
|
753
|
+
readonly $ref: "file";
|
|
754
|
+
readonly accept: readonly ["image/*"];
|
|
755
|
+
};
|
|
756
|
+
readonly picture: {
|
|
757
|
+
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
758
|
+
};
|
|
759
|
+
readonly self_registered: {
|
|
760
|
+
readonly type: "boolean";
|
|
761
|
+
readonly readOnly: true;
|
|
762
|
+
};
|
|
763
|
+
readonly updated_at: {
|
|
764
|
+
readonly type: "string";
|
|
765
|
+
readonly format: "date-time";
|
|
766
|
+
};
|
|
767
|
+
};
|
|
768
|
+
readonly presets: readonly ["crud", "duplicate"];
|
|
769
|
+
readonly layout: {
|
|
770
|
+
readonly name: "grid";
|
|
771
|
+
readonly options: {
|
|
772
|
+
readonly title: "name";
|
|
773
|
+
readonly badge: "roles";
|
|
774
|
+
readonly picture: "picture_file";
|
|
775
|
+
readonly information: "email";
|
|
776
|
+
readonly active: "active";
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
readonly individualActions: {
|
|
780
|
+
readonly changePassword: {
|
|
781
|
+
readonly label: "change_password";
|
|
782
|
+
readonly icon: "key";
|
|
783
|
+
readonly translate: true;
|
|
784
|
+
readonly route: {
|
|
785
|
+
readonly name: "/dashboard/user/changepass";
|
|
786
|
+
readonly fetchItem: true;
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
readonly copyRedefinePasswordLink: {
|
|
790
|
+
readonly label: "copy_redefine_password_link";
|
|
791
|
+
readonly icon: "link";
|
|
792
|
+
readonly translate: true;
|
|
793
|
+
};
|
|
794
|
+
readonly copyActivationLink: {
|
|
795
|
+
readonly label: "copy_activation_link";
|
|
796
|
+
readonly icon: "link";
|
|
797
|
+
readonly translate: true;
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
801
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
802
|
+
readonly tableMeta: readonly ["email"];
|
|
803
|
+
readonly formLayout: {
|
|
804
|
+
readonly fields: {
|
|
805
|
+
readonly given_name: {
|
|
806
|
+
readonly span: 3;
|
|
807
|
+
};
|
|
808
|
+
readonly family_name: {
|
|
809
|
+
readonly span: 3;
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
}>>> & Record<string, unknown>, context: Omit<import("@aeriajs/types").Context, "token">) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
814
|
+
readonly $id: "user";
|
|
815
|
+
readonly icon: "users";
|
|
816
|
+
readonly required: readonly ["name", "roles", "email"];
|
|
817
|
+
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
818
|
+
readonly indexes: readonly ["name"];
|
|
819
|
+
readonly unique: readonly ["email"];
|
|
820
|
+
readonly properties: {
|
|
821
|
+
readonly name: {
|
|
822
|
+
readonly type: "string";
|
|
823
|
+
};
|
|
824
|
+
readonly given_name: {
|
|
825
|
+
readonly getter: (doc: object) => string | undefined;
|
|
826
|
+
};
|
|
827
|
+
readonly family_name: {
|
|
828
|
+
readonly getter: (doc: object) => string | undefined;
|
|
829
|
+
};
|
|
830
|
+
readonly active: {
|
|
831
|
+
readonly type: "boolean";
|
|
832
|
+
};
|
|
833
|
+
readonly roles: {
|
|
834
|
+
readonly type: "array";
|
|
835
|
+
readonly items: {
|
|
836
|
+
readonly type: "string";
|
|
837
|
+
};
|
|
838
|
+
readonly uniqueItems: true;
|
|
839
|
+
readonly minItems: 1;
|
|
840
|
+
};
|
|
841
|
+
readonly email: {
|
|
842
|
+
readonly type: "string";
|
|
843
|
+
readonly inputType: "email";
|
|
844
|
+
};
|
|
845
|
+
readonly password: {
|
|
846
|
+
readonly type: "string";
|
|
847
|
+
readonly inputType: "password";
|
|
848
|
+
readonly hidden: true;
|
|
849
|
+
};
|
|
850
|
+
readonly phone_number: {
|
|
851
|
+
readonly type: "string";
|
|
852
|
+
readonly mask: "(##) #####-####";
|
|
853
|
+
};
|
|
854
|
+
readonly picture_file: {
|
|
855
|
+
readonly $ref: "file";
|
|
856
|
+
readonly accept: readonly ["image/*"];
|
|
857
|
+
};
|
|
858
|
+
readonly picture: {
|
|
859
|
+
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
860
|
+
};
|
|
861
|
+
readonly self_registered: {
|
|
862
|
+
readonly type: "boolean";
|
|
863
|
+
readonly readOnly: true;
|
|
864
|
+
};
|
|
865
|
+
readonly updated_at: {
|
|
866
|
+
readonly type: "string";
|
|
867
|
+
readonly format: "date-time";
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
readonly presets: readonly ["crud", "duplicate"];
|
|
871
|
+
readonly layout: {
|
|
872
|
+
readonly name: "grid";
|
|
873
|
+
readonly options: {
|
|
874
|
+
readonly title: "name";
|
|
875
|
+
readonly badge: "roles";
|
|
876
|
+
readonly picture: "picture_file";
|
|
877
|
+
readonly information: "email";
|
|
878
|
+
readonly active: "active";
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
readonly individualActions: {
|
|
882
|
+
readonly changePassword: {
|
|
883
|
+
readonly label: "change_password";
|
|
884
|
+
readonly icon: "key";
|
|
885
|
+
readonly translate: true;
|
|
886
|
+
readonly route: {
|
|
887
|
+
readonly name: "/dashboard/user/changepass";
|
|
888
|
+
readonly fetchItem: true;
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
readonly copyRedefinePasswordLink: {
|
|
892
|
+
readonly label: "copy_redefine_password_link";
|
|
893
|
+
readonly icon: "link";
|
|
894
|
+
readonly translate: true;
|
|
895
|
+
};
|
|
896
|
+
readonly copyActivationLink: {
|
|
897
|
+
readonly label: "copy_activation_link";
|
|
898
|
+
readonly icon: "link";
|
|
899
|
+
readonly translate: true;
|
|
900
|
+
};
|
|
901
|
+
};
|
|
902
|
+
readonly filters: readonly ["name", "roles", "email", "phone_number"];
|
|
903
|
+
readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
|
|
904
|
+
readonly tableMeta: readonly ["email"];
|
|
905
|
+
readonly formLayout: {
|
|
906
|
+
readonly fields: {
|
|
907
|
+
readonly given_name: {
|
|
908
|
+
readonly span: 3;
|
|
909
|
+
};
|
|
910
|
+
readonly family_name: {
|
|
911
|
+
readonly span: 3;
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
}>> | import("@aeriajs/types").Result.Error<{
|
|
916
|
+
readonly code: import("@aeriajs/types").ACError.MalformedInput;
|
|
917
|
+
} & {
|
|
918
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
919
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
920
|
+
readonly code: import("@aeriajs/types").ACError.AuthorizationError;
|
|
921
|
+
} & {
|
|
922
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Unauthorized;
|
|
923
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
924
|
+
readonly code: import("@aeriajs/types").ACError.TargetImmutable;
|
|
925
|
+
} & {
|
|
926
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
927
|
+
}>>;
|
|
717
928
|
readonly authenticate: (payload: {
|
|
718
929
|
email: string;
|
|
719
930
|
password: string;
|
|
@@ -790,6 +1001,7 @@ export declare const collections: {
|
|
|
790
1001
|
readonly required: readonly ["name", "roles", "email"];
|
|
791
1002
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
792
1003
|
readonly indexes: readonly ["name"];
|
|
1004
|
+
readonly unique: readonly ["email"];
|
|
793
1005
|
readonly properties: {
|
|
794
1006
|
readonly name: {
|
|
795
1007
|
readonly type: "string";
|
|
@@ -814,7 +1026,6 @@ export declare const collections: {
|
|
|
814
1026
|
readonly email: {
|
|
815
1027
|
readonly type: "string";
|
|
816
1028
|
readonly inputType: "email";
|
|
817
|
-
readonly unique: true;
|
|
818
1029
|
};
|
|
819
1030
|
readonly password: {
|
|
820
1031
|
readonly type: "string";
|
|
@@ -832,9 +1043,6 @@ export declare const collections: {
|
|
|
832
1043
|
readonly picture: {
|
|
833
1044
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
834
1045
|
};
|
|
835
|
-
readonly group: {
|
|
836
|
-
readonly type: "string";
|
|
837
|
-
};
|
|
838
1046
|
readonly self_registered: {
|
|
839
1047
|
readonly type: "boolean";
|
|
840
1048
|
readonly readOnly: true;
|
|
@@ -898,12 +1106,17 @@ export declare const collections: {
|
|
|
898
1106
|
readonly details: import("@aeriajs/types").PropertyValidationError | import("@aeriajs/types").ValidationError;
|
|
899
1107
|
} & {
|
|
900
1108
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest;
|
|
1109
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
1110
|
+
readonly code: import("@aeriajs/types").ACError.OwnershipError;
|
|
1111
|
+
} & {
|
|
1112
|
+
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
901
1113
|
}> | import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
902
1114
|
readonly $id: "user";
|
|
903
1115
|
readonly icon: "users";
|
|
904
1116
|
readonly required: readonly ["name", "roles", "email"];
|
|
905
1117
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
906
1118
|
readonly indexes: readonly ["name"];
|
|
1119
|
+
readonly unique: readonly ["email"];
|
|
907
1120
|
readonly properties: {
|
|
908
1121
|
readonly name: {
|
|
909
1122
|
readonly type: "string";
|
|
@@ -928,7 +1141,6 @@ export declare const collections: {
|
|
|
928
1141
|
readonly email: {
|
|
929
1142
|
readonly type: "string";
|
|
930
1143
|
readonly inputType: "email";
|
|
931
|
-
readonly unique: true;
|
|
932
1144
|
};
|
|
933
1145
|
readonly password: {
|
|
934
1146
|
readonly type: "string";
|
|
@@ -946,9 +1158,6 @@ export declare const collections: {
|
|
|
946
1158
|
readonly picture: {
|
|
947
1159
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
948
1160
|
};
|
|
949
|
-
readonly group: {
|
|
950
|
-
readonly type: "string";
|
|
951
|
-
};
|
|
952
1161
|
readonly self_registered: {
|
|
953
1162
|
readonly type: "boolean";
|
|
954
1163
|
readonly readOnly: true;
|
|
@@ -1047,6 +1256,7 @@ export declare const collections: {
|
|
|
1047
1256
|
readonly required: readonly ["name", "roles", "email"];
|
|
1048
1257
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
1049
1258
|
readonly indexes: readonly ["name"];
|
|
1259
|
+
readonly unique: readonly ["email"];
|
|
1050
1260
|
readonly properties: {
|
|
1051
1261
|
readonly name: {
|
|
1052
1262
|
readonly type: "string";
|
|
@@ -1071,7 +1281,6 @@ export declare const collections: {
|
|
|
1071
1281
|
readonly email: {
|
|
1072
1282
|
readonly type: "string";
|
|
1073
1283
|
readonly inputType: "email";
|
|
1074
|
-
readonly unique: true;
|
|
1075
1284
|
};
|
|
1076
1285
|
readonly password: {
|
|
1077
1286
|
readonly type: "string";
|
|
@@ -1089,9 +1298,6 @@ export declare const collections: {
|
|
|
1089
1298
|
readonly picture: {
|
|
1090
1299
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
1091
1300
|
};
|
|
1092
|
-
readonly group: {
|
|
1093
|
-
readonly type: "string";
|
|
1094
|
-
};
|
|
1095
1301
|
readonly self_registered: {
|
|
1096
1302
|
readonly type: "boolean";
|
|
1097
1303
|
readonly readOnly: true;
|
|
@@ -1303,6 +1509,7 @@ export declare const collections: {
|
|
|
1303
1509
|
readonly upload?: import("@aeriajs/types").Contract | undefined;
|
|
1304
1510
|
readonly removeFile?: import("@aeriajs/types").Contract | undefined;
|
|
1305
1511
|
readonly insert?: import("@aeriajs/types").Contract | undefined;
|
|
1512
|
+
readonly editProfile?: import("@aeriajs/types").Contract | undefined;
|
|
1306
1513
|
readonly authenticate?: import("@aeriajs/types").Contract | undefined;
|
|
1307
1514
|
readonly activate?: import("@aeriajs/types").Contract | undefined;
|
|
1308
1515
|
readonly createAccount?: import("@aeriajs/types").Contract | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/builtins",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.223",
|
|
4
4
|
"description": "## Installation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"mongodb": "^6.5.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@aeriajs/core": "^0.0.
|
|
59
|
-
"@aeriajs/common": "^0.0.
|
|
60
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
61
|
-
"@aeriajs/types": "^0.0.
|
|
62
|
-
"@aeriajs/validation": "^0.0.
|
|
58
|
+
"@aeriajs/core": "^0.0.223",
|
|
59
|
+
"@aeriajs/common": "^0.0.129",
|
|
60
|
+
"@aeriajs/entrypoint": "^0.0.132",
|
|
61
|
+
"@aeriajs/types": "^0.0.111",
|
|
62
|
+
"@aeriajs/validation": "^0.0.144"
|
|
63
63
|
}
|
|
64
64
|
}
|