@aeriajs/builtins 0.0.75 → 0.0.77
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/file/description.d.ts +2 -2
- package/dist/collections/file/description.js +2 -2
- package/dist/collections/file/description.mjs +2 -2
- package/dist/collections/file/download.js +3 -2
- package/dist/collections/file/download.mjs +3 -3
- package/dist/collections/file/index.d.ts +36 -36
- package/dist/collections/file/insert.d.ts +2 -2
- package/dist/collections/file/insert.js +3 -2
- package/dist/collections/file/insert.mjs +3 -3
- package/dist/collections/file/remove.js +3 -2
- package/dist/collections/file/remove.mjs +3 -3
- package/dist/collections/file/removeAll.js +3 -2
- package/dist/collections/file/removeAll.mjs +3 -3
- package/dist/collections/log/index.d.ts +1 -1
- package/dist/collections/resourceUsage/index.d.ts +1 -1
- package/dist/collections/user/activate.d.ts +1 -1
- package/dist/collections/user/activate.js +3 -2
- package/dist/collections/user/activate.mjs +3 -3
- package/dist/collections/user/authenticate.js +4 -8
- package/dist/collections/user/authenticate.mjs +0 -4
- package/dist/collections/user/createAccount.js +3 -3
- package/dist/collections/user/createAccount.mjs +2 -3
- package/dist/collections/user/description.d.ts +2 -2
- package/dist/collections/user/description.js +2 -2
- package/dist/collections/user/description.mjs +2 -2
- package/dist/collections/user/getCurrentUser.d.ts +107 -0
- package/dist/collections/user/getCurrentUser.js +26 -0
- package/dist/collections/user/getCurrentUser.mjs +23 -0
- package/dist/collections/user/getInfo.js +3 -2
- package/dist/collections/user/getInfo.mjs +3 -3
- package/dist/collections/user/index.d.ts +486 -69
- package/dist/collections/user/index.js +14 -8
- package/dist/collections/user/index.mjs +14 -8
- package/dist/collections/user/insert.d.ts +2 -2
- package/dist/collections/user/insert.js +0 -3
- package/dist/collections/user/insert.mjs +1 -4
- package/dist/functions/describe.d.ts +2 -2
- package/dist/functions/describe.js +1 -2
- package/dist/functions/describe.mjs +1 -2
- package/dist/index.d.ts +524 -107
- package/package.json +6 -8
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.user = void 0;
|
|
4
4
|
const core_1 = require("@aeriajs/core");
|
|
5
|
+
const common_1 = require("@aeriajs/common");
|
|
5
6
|
const description_js_1 = require("./description.js");
|
|
6
7
|
const authenticate_js_1 = require("./authenticate.js");
|
|
7
8
|
const activate_js_1 = require("./activate.js");
|
|
8
9
|
const insert_js_1 = require("./insert.js");
|
|
9
10
|
const createAccount_js_1 = require("./createAccount.js");
|
|
10
11
|
const getInfo_js_1 = require("./getInfo.js");
|
|
12
|
+
const getCurrentUser_js_1 = require("./getCurrentUser.js");
|
|
11
13
|
const getActivationLink_js_1 = require("./getActivationLink.js");
|
|
12
14
|
exports.user = (0, core_1.defineCollection)({
|
|
13
15
|
description: description_js_1.description,
|
|
@@ -22,16 +24,20 @@ exports.user = (0, core_1.defineCollection)({
|
|
|
22
24
|
activate: activate_js_1.activate,
|
|
23
25
|
createAccount: createAccount_js_1.createAccount,
|
|
24
26
|
getInfo: getInfo_js_1.getInfo,
|
|
27
|
+
getCurrentUser: getCurrentUser_js_1.getCurrentUser,
|
|
25
28
|
getActivationLink: getActivationLink_js_1.getActivationLink,
|
|
26
29
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
functionContracts: {
|
|
31
|
+
getCurrentUser: {
|
|
32
|
+
response: [
|
|
33
|
+
(0, common_1.leftSchema)({
|
|
34
|
+
type: 'object',
|
|
35
|
+
variable: true,
|
|
36
|
+
}),
|
|
37
|
+
(0, common_1.rightSchema)({
|
|
38
|
+
$ref: 'user',
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
35
41
|
},
|
|
36
42
|
},
|
|
37
43
|
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { defineCollection, get, getAll, remove, upload, removeFile } from "@aeriajs/core";
|
|
3
|
+
import { leftSchema, rightSchema } from "@aeriajs/common";
|
|
3
4
|
import { description } from "./description.mjs";
|
|
4
5
|
import { authenticate } from "./authenticate.mjs";
|
|
5
6
|
import { activate } from "./activate.mjs";
|
|
6
7
|
import { insert } from "./insert.mjs";
|
|
7
8
|
import { createAccount } from "./createAccount.mjs";
|
|
8
9
|
import { getInfo } from "./getInfo.mjs";
|
|
10
|
+
import { getCurrentUser } from "./getCurrentUser.mjs";
|
|
9
11
|
import { getActivationLink } from "./getActivationLink.mjs";
|
|
10
12
|
export const user = defineCollection({
|
|
11
13
|
description,
|
|
@@ -20,16 +22,20 @@ export const user = defineCollection({
|
|
|
20
22
|
activate,
|
|
21
23
|
createAccount,
|
|
22
24
|
getInfo,
|
|
25
|
+
getCurrentUser,
|
|
23
26
|
getActivationLink
|
|
24
27
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
functionContracts: {
|
|
29
|
+
getCurrentUser: {
|
|
30
|
+
response: [
|
|
31
|
+
leftSchema({
|
|
32
|
+
type: "object",
|
|
33
|
+
variable: true
|
|
34
|
+
}),
|
|
35
|
+
rightSchema({
|
|
36
|
+
$ref: "user"
|
|
37
|
+
})
|
|
38
|
+
]
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
});
|
|
@@ -76,12 +76,12 @@ export declare const insert: (payload: {
|
|
|
76
76
|
};
|
|
77
77
|
readonly individualActions: {
|
|
78
78
|
readonly 'ui:spawnEdit': {
|
|
79
|
-
readonly
|
|
79
|
+
readonly label: "action.edit";
|
|
80
80
|
readonly icon: "pencil";
|
|
81
81
|
readonly translate: true;
|
|
82
82
|
};
|
|
83
83
|
readonly 'route:/dashboard/user/changepass': {
|
|
84
|
-
readonly
|
|
84
|
+
readonly label: "change_password";
|
|
85
85
|
readonly icon: "key";
|
|
86
86
|
readonly fetchItem: true;
|
|
87
87
|
readonly translate: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import {
|
|
2
|
+
import { insert as originalInsert } from "@aeriajs/core";
|
|
3
3
|
import * as bcrypt from "bcrypt";
|
|
4
4
|
export const insert = async (payload, context) => {
|
|
5
5
|
if (payload.what.password) {
|
|
@@ -7,6 +7,3 @@ export const insert = async (payload, context) => {
|
|
|
7
7
|
}
|
|
8
8
|
return originalInsert(payload, context);
|
|
9
9
|
};
|
|
10
|
-
defineFunctionAttributes(insert, {
|
|
11
|
-
exposed: true
|
|
12
|
-
});
|
|
@@ -85,12 +85,12 @@ export declare const describe: (contextOrPayload: RouteContext | Payload) => Pro
|
|
|
85
85
|
};
|
|
86
86
|
readonly individualActions: {
|
|
87
87
|
readonly 'ui:spawnEdit': {
|
|
88
|
-
readonly
|
|
88
|
+
readonly label: "action.edit";
|
|
89
89
|
readonly icon: "pencil";
|
|
90
90
|
readonly translate: true;
|
|
91
91
|
};
|
|
92
92
|
readonly 'route:/dashboard/user/changepass': {
|
|
93
|
-
readonly
|
|
93
|
+
readonly label: "change_password";
|
|
94
94
|
readonly icon: "key";
|
|
95
95
|
readonly fetchItem: true;
|
|
96
96
|
readonly translate: true;
|
|
@@ -4,7 +4,6 @@ exports.describe = void 0;
|
|
|
4
4
|
const core_1 = require("@aeriajs/core");
|
|
5
5
|
const entrypoint_1 = require("@aeriajs/entrypoint");
|
|
6
6
|
const common_1 = require("@aeriajs/common");
|
|
7
|
-
const access_control_1 = require("@aeriajs/access-control");
|
|
8
7
|
const authenticate_js_1 = require("../collections/user/authenticate.js");
|
|
9
8
|
const describe = async (contextOrPayload) => {
|
|
10
9
|
const result = {};
|
|
@@ -49,7 +48,7 @@ const describe = async (contextOrPayload) => {
|
|
|
49
48
|
const userRoles = 'enum' in userRolesProperty.items
|
|
50
49
|
? userRolesProperty.items.enum
|
|
51
50
|
: [];
|
|
52
|
-
result.roles = Array.from(new Set(userRoles.concat(await (0,
|
|
51
|
+
result.roles = Array.from(new Set(userRoles.concat(await (0, entrypoint_1.getAvailableRoles)())));
|
|
53
52
|
}
|
|
54
53
|
if (props.router) {
|
|
55
54
|
result.router = await (0, core_1.getEndpoints)();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { createContext, preloadDescription, getEndpoints } from "@aeriajs/core";
|
|
3
|
-
import { getCollections } from "@aeriajs/entrypoint";
|
|
3
|
+
import { getCollections, getAvailableRoles } from "@aeriajs/entrypoint";
|
|
4
4
|
import { serialize, isLeft, left, unwrapEither } from "@aeriajs/common";
|
|
5
|
-
import { getAvailableRoles } from "@aeriajs/access-control";
|
|
6
5
|
import { authenticate } from "../collections/user/authenticate.mjs";
|
|
7
6
|
export const describe = async (contextOrPayload) => {
|
|
8
7
|
const result = {};
|