@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.
@@ -6,5 +6,6 @@ export declare const DEFAULT_API_CONFIG: {
6
6
  tokenExpiration: number;
7
7
  linkTokenExpiration: number;
8
8
  paginationLimit: number;
9
+ mutableUserProperties: ("name" | "email" | "password" | "phone_number" | "picture_file")[];
9
10
  };
10
11
  };
package/dist/constants.js CHANGED
@@ -9,5 +9,12 @@ exports.DEFAULT_API_CONFIG = {
9
9
  tokenExpiration: 36000,
10
10
  linkTokenExpiration: 36000,
11
11
  paginationLimit: 100,
12
+ mutableUserProperties: [
13
+ 'email',
14
+ 'name',
15
+ 'password',
16
+ 'phone_number',
17
+ 'picture_file',
18
+ ],
12
19
  },
13
20
  };
@@ -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
- export type InitApiConfig = Omit<ApiConfig, keyof typeof DEFAULT_API_CONFIG> & Partial<Pick<ApiConfig, keyof typeof DEFAULT_API_CONFIG>>;
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.224",
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.222",
37
- "@aeriajs/builtins": "^0.0.222",
38
- "@aeriajs/common": "^0.0.128",
39
- "@aeriajs/entrypoint": "^0.0.131",
40
- "@aeriajs/http": "^0.0.155",
41
- "@aeriajs/node-http": "^0.0.155",
42
- "@aeriajs/server": "^0.0.224",
43
- "@aeriajs/types": "^0.0.110",
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": {