befly 3.18.16 → 3.18.17

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/sync/api.js +1 -12
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "3.18.16",
4
- "gitHead": "98aa4ea2914a476dfa3c8b23099a238134ca96e6",
3
+ "version": "3.18.17",
4
+ "gitHead": "6bb80da8ad441667bca408c328e11ad37d858754",
5
5
  "private": false,
6
6
  "description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
7
7
  "keywords": [
package/sync/api.js CHANGED
@@ -15,17 +15,6 @@ const getApiParentPath = (apiPath) => {
15
15
  return `/${parentSegments.join("/")}`;
16
16
  };
17
17
 
18
- const normalizeAuthForDb = (value) => {
19
- if (value === false) {
20
- return "否";
21
- }
22
-
23
- if (Array.isArray(value)) {
24
- return value.join(",");
25
- }
26
- return "是";
27
- };
28
-
29
18
  export async function syncApi(ctx, apis) {
30
19
  const allDbApis = await ctx.mysql.getAll({
31
20
  table: API_TABLE_NAME,
@@ -48,7 +37,7 @@ export async function syncApi(ctx, apis) {
48
37
  for (const api of apis) {
49
38
  scannedPathSet.add(api.apiPath);
50
39
 
51
- const auth = normalizeAuthForDb(api.auth);
40
+ const auth = api.auth === false ? "否" : Array.isArray(api.auth) ? api.auth.join(",") : "是";
52
41
  const parentPath = getApiParentPath(api.apiPath);
53
42
  const existing = existingApiMap.get(api.apiPath);
54
43