@aeriajs/server 0.0.224 → 0.0.225
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/constants.d.ts +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.mjs +8 -1
- package/dist/handler.js +2 -0
- package/dist/handler.mjs +4 -2
- package/dist/init.d.ts +6 -5
- package/package.json +9 -9
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/constants.mjs
CHANGED
|
@@ -6,6 +6,13 @@ export const DEFAULT_API_CONFIG = {
|
|
|
6
6
|
security: {
|
|
7
7
|
tokenExpiration: 36e3,
|
|
8
8
|
linkTokenExpiration: 36e3,
|
|
9
|
-
paginationLimit: 100
|
|
9
|
+
paginationLimit: 100,
|
|
10
|
+
mutableUserProperties: [
|
|
11
|
+
"email",
|
|
12
|
+
"name",
|
|
13
|
+
"password",
|
|
14
|
+
"phone_number",
|
|
15
|
+
"picture_file"
|
|
16
|
+
]
|
|
10
17
|
}
|
|
11
18
|
};
|
package/dist/handler.js
CHANGED
|
@@ -31,10 +31,12 @@ const safeHandle = (fn, context) => async () => {
|
|
|
31
31
|
if (context.request.headers['sec-fetch-mode'] === 'cors') {
|
|
32
32
|
return types_1.Result.error({
|
|
33
33
|
code: types_1.ACError.UnknownError,
|
|
34
|
+
message: String(error),
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
return context.error(types_1.HTTPStatus.InternalServerError, {
|
|
37
38
|
code: types_1.ACError.UnknownError,
|
|
39
|
+
message: String(error),
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
42
|
};
|
package/dist/handler.mjs
CHANGED
|
@@ -32,11 +32,13 @@ export const safeHandle = (fn, context) => async () => {
|
|
|
32
32
|
}
|
|
33
33
|
if (context.request.headers["sec-fetch-mode"] === "cors") {
|
|
34
34
|
return Result.error({
|
|
35
|
-
code: ACError.UnknownError
|
|
35
|
+
code: ACError.UnknownError,
|
|
36
|
+
message: String(error)
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
return context.error(HTTPStatus.InternalServerError, {
|
|
39
|
-
code: ACError.UnknownError
|
|
40
|
+
code: ACError.UnknownError,
|
|
41
|
+
message: String(error)
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
};
|
package/dist/init.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import type { RouteContext, Collection, GenericRequest, ApiConfig, Authenticated
|
|
|
2
2
|
import { ACError, HTTPStatus } from '@aeriajs/types';
|
|
3
3
|
import { type createRouter } from '@aeriajs/http';
|
|
4
4
|
import { DEFAULT_API_CONFIG } from './constants.js';
|
|
5
|
-
|
|
5
|
+
type DeepPartial<T> = T extends object ? {
|
|
6
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
7
|
+
} : T;
|
|
8
|
+
export type InitApiConfig = Omit<ApiConfig, keyof typeof DEFAULT_API_CONFIG> & DeepPartial<Pick<ApiConfig, keyof typeof DEFAULT_API_CONFIG>>;
|
|
6
9
|
export type InitOptions = {
|
|
7
10
|
config?: InitApiConfig;
|
|
8
11
|
router?: ReturnType<typeof createRouter>;
|
|
@@ -21,6 +24,7 @@ export declare const getToken: (request: GenericRequest, context: RouteContext)
|
|
|
21
24
|
readonly required: readonly ["name", "roles", "email"];
|
|
22
25
|
readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
|
|
23
26
|
readonly indexes: readonly ["name"];
|
|
27
|
+
readonly unique: readonly ["email"];
|
|
24
28
|
readonly properties: {
|
|
25
29
|
readonly name: {
|
|
26
30
|
readonly type: "string";
|
|
@@ -45,7 +49,6 @@ export declare const getToken: (request: GenericRequest, context: RouteContext)
|
|
|
45
49
|
readonly email: {
|
|
46
50
|
readonly type: "string";
|
|
47
51
|
readonly inputType: "email";
|
|
48
|
-
readonly unique: true;
|
|
49
52
|
};
|
|
50
53
|
readonly password: {
|
|
51
54
|
readonly type: "string";
|
|
@@ -63,9 +66,6 @@ export declare const getToken: (request: GenericRequest, context: RouteContext)
|
|
|
63
66
|
readonly picture: {
|
|
64
67
|
readonly getter: (doc: object) => Promise<string> | undefined;
|
|
65
68
|
};
|
|
66
|
-
readonly group: {
|
|
67
|
-
readonly type: "string";
|
|
68
|
-
};
|
|
69
69
|
readonly self_registered: {
|
|
70
70
|
readonly type: "boolean";
|
|
71
71
|
readonly readOnly: true;
|
|
@@ -138,3 +138,4 @@ export declare const init: (_options?: InitOptions) => {
|
|
|
138
138
|
listen: () => import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
139
139
|
}>;
|
|
140
140
|
};
|
|
141
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.225",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"mongodb": "^6.5.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@aeriajs/core": "^0.0.
|
|
37
|
-
"@aeriajs/builtins": "^0.0.
|
|
38
|
-
"@aeriajs/common": "^0.0.
|
|
39
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
40
|
-
"@aeriajs/http": "^0.0.
|
|
41
|
-
"@aeriajs/node-http": "^0.0.
|
|
42
|
-
"@aeriajs/server": "^0.0.
|
|
43
|
-
"@aeriajs/types": "^0.0.
|
|
36
|
+
"@aeriajs/core": "^0.0.223",
|
|
37
|
+
"@aeriajs/builtins": "^0.0.223",
|
|
38
|
+
"@aeriajs/common": "^0.0.129",
|
|
39
|
+
"@aeriajs/entrypoint": "^0.0.132",
|
|
40
|
+
"@aeriajs/http": "^0.0.156",
|
|
41
|
+
"@aeriajs/node-http": "^0.0.156",
|
|
42
|
+
"@aeriajs/server": "^0.0.225",
|
|
43
|
+
"@aeriajs/types": "^0.0.111",
|
|
44
44
|
"mongodb": "^6.5.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|