befly 3.22.2 → 3.22.4

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/checks/config.js CHANGED
@@ -17,6 +17,7 @@ const configSchema = z
17
17
  appName: noTrimString,
18
18
  appPort: z.int().min(1).max(65535),
19
19
  appHost: noTrimString,
20
+ apiHost: noTrimString,
20
21
  publicHost: noTrimString,
21
22
  devEmail: z.union([z.literal(""), z.email()]),
22
23
  devPassword: z.string().min(6),
@@ -8,6 +8,7 @@
8
8
  "bodyLimit": 1048576,
9
9
  "uploadMaxSize": 20,
10
10
  "tz": "Asia/Shanghai",
11
+ "apiHost": "http://127.0.0.1",
11
12
  "publicDir": "./public",
12
13
  "publicHost": "http://127.0.0.1:3000",
13
14
  "logger": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "3.22.2",
4
- "gitHead": "89a9ea96f129aa223da7a627ec8e7fb572438292",
3
+ "version": "3.22.4",
4
+ "gitHead": "8d10717424ced255e301cb474d356863ab12509a",
5
5
  "private": false,
6
6
  "description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
7
7
  "keywords": [
@@ -52,8 +52,8 @@
52
52
  "test": "bun test"
53
53
  },
54
54
  "dependencies": {
55
- "fast-xml-parser": "^5.5.9",
56
- "nodemailer": "^8.0.4",
55
+ "fast-xml-parser": "^5.5.10",
56
+ "nodemailer": "^8.0.5",
57
57
  "pathe": "^2.0.3",
58
58
  "ua-parser-js": "^2.0.9",
59
59
  "zod": "^4.0.0"
@@ -6,6 +6,9 @@ import { printSyncDbProcessLog } from "./report.js";
6
6
  import { toSyncDbFieldDef } from "./transform.js";
7
7
 
8
8
  const SYNC_DB_MANAGED_FIELD_NAMES = new Set(["id", "created_at", "updated_at", "deleted_at", "state"]);
9
+ const SYNC_DB_HEAD_FIELD_NAME = "id";
10
+ const SYNC_DB_TAIL_FIELD_NAMES = ["createdAt", "updatedAt", "deletedAt", "state"];
11
+ const SYNC_DB_TAIL_FIELD_NAME_SET = new Set(SYNC_DB_TAIL_FIELD_NAMES);
9
12
 
10
13
  function shouldSkipSyncDbColumn(columnMeta, beflyMode) {
11
14
  if (beflyMode !== "manual") {
@@ -25,13 +28,31 @@ function shouldSkipSyncDbFieldName(fieldName, beflyMode) {
25
28
  }
26
29
 
27
30
  function sortSyncDbObjectKeys(source) {
28
- const entries = Object.entries(source).sort(([left], [right]) => left.localeCompare(right));
29
31
  const output = {};
30
32
 
31
- for (const [key, value] of entries) {
33
+ if (Object.hasOwn(source, SYNC_DB_HEAD_FIELD_NAME)) {
34
+ output[SYNC_DB_HEAD_FIELD_NAME] = source[SYNC_DB_HEAD_FIELD_NAME];
35
+ }
36
+
37
+ for (const [key, value] of Object.entries(source)) {
38
+ if (key === SYNC_DB_HEAD_FIELD_NAME) {
39
+ continue;
40
+ }
41
+ if (SYNC_DB_TAIL_FIELD_NAME_SET.has(key)) {
42
+ continue;
43
+ }
44
+
32
45
  output[key] = value;
33
46
  }
34
47
 
48
+ for (const fieldName of SYNC_DB_TAIL_FIELD_NAMES) {
49
+ if (!Object.hasOwn(source, fieldName)) {
50
+ continue;
51
+ }
52
+
53
+ output[fieldName] = source[fieldName];
54
+ }
55
+
35
56
  return output;
36
57
  }
37
58