befly 3.16.9 → 3.16.11
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/README.md +0 -129
- package/befly.js +12769 -0
- package/befly.min.js +47 -0
- package/package.json +18 -29
- package/dist/befly.config.d.ts +0 -7
- package/dist/befly.config.js +0 -128
- package/dist/befly.js +0 -17276
- package/dist/befly.min.js +0 -23
- package/dist/checks/checkApi.d.ts +0 -1
- package/dist/checks/checkApi.js +0 -124
- package/dist/checks/checkConfig.d.ts +0 -9
- package/dist/checks/checkConfig.js +0 -255
- package/dist/checks/checkHook.d.ts +0 -1
- package/dist/checks/checkHook.js +0 -132
- package/dist/checks/checkMenu.d.ts +0 -3
- package/dist/checks/checkMenu.js +0 -106
- package/dist/checks/checkPlugin.d.ts +0 -1
- package/dist/checks/checkPlugin.js +0 -132
- package/dist/checks/checkTable.d.ts +0 -7
- package/dist/checks/checkTable.js +0 -431
- package/dist/configs/presetRegexp.d.ts +0 -145
- package/dist/configs/presetRegexp.js +0 -218
- package/dist/hooks/auth.d.ts +0 -3
- package/dist/hooks/auth.js +0 -24
- package/dist/hooks/cors.d.ts +0 -7
- package/dist/hooks/cors.js +0 -36
- package/dist/hooks/parser.d.ts +0 -10
- package/dist/hooks/parser.js +0 -76
- package/dist/hooks/permission.d.ts +0 -10
- package/dist/hooks/permission.js +0 -64
- package/dist/hooks/validator.d.ts +0 -7
- package/dist/hooks/validator.js +0 -52
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -316
- package/dist/lib/asyncContext.d.ts +0 -21
- package/dist/lib/asyncContext.js +0 -27
- package/dist/lib/cacheHelper.d.ts +0 -128
- package/dist/lib/cacheHelper.js +0 -477
- package/dist/lib/cacheKeys.d.ts +0 -27
- package/dist/lib/cacheKeys.js +0 -37
- package/dist/lib/cipher.d.ts +0 -153
- package/dist/lib/cipher.js +0 -237
- package/dist/lib/connect.d.ts +0 -95
- package/dist/lib/connect.js +0 -313
- package/dist/lib/dbHelper.d.ts +0 -229
- package/dist/lib/dbHelper.js +0 -1069
- package/dist/lib/dbUtils.d.ts +0 -91
- package/dist/lib/dbUtils.js +0 -544
- package/dist/lib/jwt.d.ts +0 -13
- package/dist/lib/jwt.js +0 -77
- package/dist/lib/logger.d.ts +0 -46
- package/dist/lib/logger.js +0 -731
- package/dist/lib/redisHelper.d.ts +0 -193
- package/dist/lib/redisHelper.js +0 -598
- package/dist/lib/sqlBuilder.d.ts +0 -160
- package/dist/lib/sqlBuilder.js +0 -837
- package/dist/lib/sqlCheck.d.ts +0 -23
- package/dist/lib/sqlCheck.js +0 -119
- package/dist/lib/validator.d.ts +0 -45
- package/dist/lib/validator.js +0 -424
- package/dist/loader/loadApis.d.ts +0 -12
- package/dist/loader/loadApis.js +0 -71
- package/dist/loader/loadHooks.d.ts +0 -7
- package/dist/loader/loadHooks.js +0 -50
- package/dist/loader/loadPlugins.d.ts +0 -8
- package/dist/loader/loadPlugins.js +0 -69
- package/dist/paths.d.ts +0 -93
- package/dist/paths.js +0 -100
- package/dist/plugins/cache.d.ts +0 -10
- package/dist/plugins/cache.js +0 -24
- package/dist/plugins/cipher.d.ts +0 -7
- package/dist/plugins/cipher.js +0 -14
- package/dist/plugins/config.d.ts +0 -3
- package/dist/plugins/config.js +0 -9
- package/dist/plugins/db.d.ts +0 -10
- package/dist/plugins/db.js +0 -48
- package/dist/plugins/jwt.d.ts +0 -6
- package/dist/plugins/jwt.js +0 -13
- package/dist/plugins/logger.d.ts +0 -10
- package/dist/plugins/logger.js +0 -21
- package/dist/plugins/redis.d.ts +0 -10
- package/dist/plugins/redis.js +0 -40
- package/dist/plugins/tool.d.ts +0 -75
- package/dist/plugins/tool.js +0 -105
- package/dist/router/api.d.ts +0 -14
- package/dist/router/api.js +0 -109
- package/dist/router/static.d.ts +0 -9
- package/dist/router/static.js +0 -56
- package/dist/scripts/ensureDist.d.ts +0 -1
- package/dist/scripts/ensureDist.js +0 -296
- package/dist/sync/syncApi.d.ts +0 -3
- package/dist/sync/syncApi.js +0 -140
- package/dist/sync/syncCache.d.ts +0 -2
- package/dist/sync/syncCache.js +0 -14
- package/dist/sync/syncDev.d.ts +0 -6
- package/dist/sync/syncDev.js +0 -166
- package/dist/sync/syncMenu.d.ts +0 -14
- package/dist/sync/syncMenu.js +0 -308
- package/dist/sync/syncTable.d.ts +0 -126
- package/dist/sync/syncTable.js +0 -1129
- package/dist/types/api.d.ts +0 -175
- package/dist/types/api.js +0 -4
- package/dist/types/befly.d.ts +0 -231
- package/dist/types/befly.js +0 -4
- package/dist/types/cache.d.ts +0 -96
- package/dist/types/cache.js +0 -4
- package/dist/types/cipher.d.ts +0 -27
- package/dist/types/cipher.js +0 -7
- package/dist/types/common.d.ts +0 -127
- package/dist/types/common.js +0 -5
- package/dist/types/context.d.ts +0 -39
- package/dist/types/context.js +0 -4
- package/dist/types/coreError.d.ts +0 -31
- package/dist/types/coreError.js +0 -38
- package/dist/types/crypto.d.ts +0 -20
- package/dist/types/crypto.js +0 -4
- package/dist/types/database.d.ts +0 -182
- package/dist/types/database.js +0 -4
- package/dist/types/hook.d.ts +0 -30
- package/dist/types/hook.js +0 -19
- package/dist/types/jwt.d.ts +0 -76
- package/dist/types/jwt.js +0 -4
- package/dist/types/logger.d.ts +0 -95
- package/dist/types/logger.js +0 -6
- package/dist/types/plugin.d.ts +0 -27
- package/dist/types/plugin.js +0 -17
- package/dist/types/redis.d.ts +0 -80
- package/dist/types/redis.js +0 -4
- package/dist/types/roleApisCache.d.ts +0 -21
- package/dist/types/roleApisCache.js +0 -8
- package/dist/types/sync.d.ts +0 -93
- package/dist/types/sync.js +0 -4
- package/dist/types/table.d.ts +0 -34
- package/dist/types/table.js +0 -4
- package/dist/types/validate.d.ts +0 -113
- package/dist/types/validate.js +0 -4
- package/dist/utils/calcPerfTime.d.ts +0 -4
- package/dist/utils/calcPerfTime.js +0 -13
- package/dist/utils/cors.d.ts +0 -8
- package/dist/utils/cors.js +0 -17
- package/dist/utils/dbFieldRules.d.ts +0 -31
- package/dist/utils/dbFieldRules.js +0 -94
- package/dist/utils/fieldClear.d.ts +0 -11
- package/dist/utils/fieldClear.js +0 -57
- package/dist/utils/formatYmdHms.d.ts +0 -1
- package/dist/utils/formatYmdHms.js +0 -20
- package/dist/utils/getClientIp.d.ts +0 -6
- package/dist/utils/getClientIp.js +0 -39
- package/dist/utils/importDefault.d.ts +0 -1
- package/dist/utils/importDefault.js +0 -53
- package/dist/utils/isDirentDirectory.d.ts +0 -3
- package/dist/utils/isDirentDirectory.js +0 -18
- package/dist/utils/loadMenuConfigs.d.ts +0 -11
- package/dist/utils/loadMenuConfigs.js +0 -130
- package/dist/utils/loggerUtils.d.ts +0 -18
- package/dist/utils/loggerUtils.js +0 -171
- package/dist/utils/mergeAndConcat.d.ts +0 -7
- package/dist/utils/mergeAndConcat.js +0 -77
- package/dist/utils/normalizeFieldDefinition.d.ts +0 -18
- package/dist/utils/normalizeFieldDefinition.js +0 -27
- package/dist/utils/processInfo.d.ts +0 -26
- package/dist/utils/processInfo.js +0 -41
- package/dist/utils/response.d.ts +0 -20
- package/dist/utils/response.js +0 -96
- package/dist/utils/scanAddons.d.ts +0 -15
- package/dist/utils/scanAddons.js +0 -35
- package/dist/utils/scanCoreBuiltins.d.ts +0 -3
- package/dist/utils/scanCoreBuiltins.js +0 -72
- package/dist/utils/scanFiles.d.ts +0 -32
- package/dist/utils/scanFiles.js +0 -124
- package/dist/utils/scanSources.d.ts +0 -10
- package/dist/utils/scanSources.js +0 -46
- package/dist/utils/sortModules.d.ts +0 -28
- package/dist/utils/sortModules.js +0 -105
- package/dist/utils/sqlUtil.d.ts +0 -33
- package/dist/utils/sqlUtil.js +0 -146
- package/dist/utils/util.d.ts +0 -172
- package/dist/utils/util.js +0 -517
package/dist/lib/sqlBuilder.d.ts
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SQL 构造器 - TypeScript 版本
|
|
3
|
-
* 提供链式 API 构建 SQL 查询
|
|
4
|
-
*/
|
|
5
|
-
import type { WhereConditions, SqlQuery, InsertData, UpdateData, SqlValue } from "../types/common";
|
|
6
|
-
/**
|
|
7
|
-
* SQL 构建器类
|
|
8
|
-
*/
|
|
9
|
-
export declare class SqlBuilder {
|
|
10
|
-
private _select;
|
|
11
|
-
private _from;
|
|
12
|
-
private _where;
|
|
13
|
-
private _joins;
|
|
14
|
-
private _orderBy;
|
|
15
|
-
private _groupBy;
|
|
16
|
-
private _having;
|
|
17
|
-
private _limit;
|
|
18
|
-
private _offset;
|
|
19
|
-
private _params;
|
|
20
|
-
private _quoteIdent;
|
|
21
|
-
constructor(options?: {
|
|
22
|
-
quoteIdent?: (identifier: string) => string;
|
|
23
|
-
});
|
|
24
|
-
private _isQuotedIdent;
|
|
25
|
-
private _startsWithQuote;
|
|
26
|
-
/**
|
|
27
|
-
* 重置构建器状态
|
|
28
|
-
*/
|
|
29
|
-
reset(): this;
|
|
30
|
-
/**
|
|
31
|
-
* 转义字段名
|
|
32
|
-
*/
|
|
33
|
-
private _escapeField;
|
|
34
|
-
private _validateIdentifierPart;
|
|
35
|
-
/**
|
|
36
|
-
* 转义表名
|
|
37
|
-
*/
|
|
38
|
-
private _escapeTable;
|
|
39
|
-
/**
|
|
40
|
-
* 验证参数
|
|
41
|
-
*/
|
|
42
|
-
private _validateParam;
|
|
43
|
-
/**
|
|
44
|
-
* 处理单个操作符条件
|
|
45
|
-
*/
|
|
46
|
-
private _applyOperator;
|
|
47
|
-
/**
|
|
48
|
-
* 处理复杂的 WHERE 条件对象
|
|
49
|
-
*/
|
|
50
|
-
private _processWhereConditions;
|
|
51
|
-
/**
|
|
52
|
-
* 获取 WHERE 条件(供 DbHelper 使用)
|
|
53
|
-
*/
|
|
54
|
-
getWhereConditions(): {
|
|
55
|
-
sql: string;
|
|
56
|
-
params: SqlValue[];
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* SELECT 字段
|
|
60
|
-
*/
|
|
61
|
-
select(fields?: string | string[]): this;
|
|
62
|
-
/**
|
|
63
|
-
* SELECT 原始表达式(不做转义)
|
|
64
|
-
*/
|
|
65
|
-
selectRaw(expr: string): this;
|
|
66
|
-
/**
|
|
67
|
-
* FROM 表名
|
|
68
|
-
*/
|
|
69
|
-
from(table: string): this;
|
|
70
|
-
/**
|
|
71
|
-
* FROM 原始表达式(不做转义)
|
|
72
|
-
*/
|
|
73
|
-
fromRaw(tableExpr: string): this;
|
|
74
|
-
/**
|
|
75
|
-
* WHERE 条件
|
|
76
|
-
*/
|
|
77
|
-
where(condition: WhereConditions): this;
|
|
78
|
-
where(field: string, value: SqlValue): this;
|
|
79
|
-
/**
|
|
80
|
-
* WHERE 原始片段(不做转义),可附带参数。
|
|
81
|
-
*/
|
|
82
|
-
whereRaw(sql: string, params?: SqlValue[]): this;
|
|
83
|
-
/**
|
|
84
|
-
* LEFT JOIN
|
|
85
|
-
*/
|
|
86
|
-
leftJoin(table: string, on: string): this;
|
|
87
|
-
/**
|
|
88
|
-
* RIGHT JOIN
|
|
89
|
-
*/
|
|
90
|
-
rightJoin(table: string, on: string): this;
|
|
91
|
-
/**
|
|
92
|
-
* INNER JOIN
|
|
93
|
-
*/
|
|
94
|
-
innerJoin(table: string, on: string): this;
|
|
95
|
-
/**
|
|
96
|
-
* ORDER BY
|
|
97
|
-
* @param fields - 格式为 ["field#ASC", "field2#DESC"]
|
|
98
|
-
*/
|
|
99
|
-
orderBy(fields: string[]): this;
|
|
100
|
-
/**
|
|
101
|
-
* GROUP BY
|
|
102
|
-
*/
|
|
103
|
-
groupBy(field: string | string[]): this;
|
|
104
|
-
/**
|
|
105
|
-
* HAVING
|
|
106
|
-
*/
|
|
107
|
-
having(condition: string): this;
|
|
108
|
-
/**
|
|
109
|
-
* LIMIT
|
|
110
|
-
*/
|
|
111
|
-
limit(count: number, offset?: number): this;
|
|
112
|
-
/**
|
|
113
|
-
* OFFSET
|
|
114
|
-
*/
|
|
115
|
-
offset(count: number): this;
|
|
116
|
-
/**
|
|
117
|
-
* 构建 SELECT 查询
|
|
118
|
-
*/
|
|
119
|
-
toSelectSql(): SqlQuery;
|
|
120
|
-
/**
|
|
121
|
-
* 构建 INSERT 查询
|
|
122
|
-
*/
|
|
123
|
-
toInsertSql(table: string, data: InsertData): SqlQuery;
|
|
124
|
-
/**
|
|
125
|
-
* 构建 UPDATE 查询
|
|
126
|
-
*/
|
|
127
|
-
toUpdateSql(table: string, data: UpdateData): SqlQuery;
|
|
128
|
-
/**
|
|
129
|
-
* 构建 DELETE 查询
|
|
130
|
-
*/
|
|
131
|
-
toDeleteSql(table: string): SqlQuery;
|
|
132
|
-
/**
|
|
133
|
-
* 构建 COUNT 查询
|
|
134
|
-
*/
|
|
135
|
-
toCountSql(): SqlQuery;
|
|
136
|
-
static toDeleteInSql(options: {
|
|
137
|
-
table: string;
|
|
138
|
-
idField: string;
|
|
139
|
-
ids: SqlValue[];
|
|
140
|
-
quoteIdent: (identifier: string) => string;
|
|
141
|
-
}): SqlQuery;
|
|
142
|
-
static toUpdateCaseByIdSql(options: {
|
|
143
|
-
table: string;
|
|
144
|
-
idField: string;
|
|
145
|
-
rows: Array<{
|
|
146
|
-
id: SqlValue;
|
|
147
|
-
data: Record<string, SqlValue>;
|
|
148
|
-
}>;
|
|
149
|
-
fields: string[];
|
|
150
|
-
quoteIdent: (identifier: string) => string;
|
|
151
|
-
updatedAtField: string;
|
|
152
|
-
updatedAtValue: SqlValue;
|
|
153
|
-
stateField?: string;
|
|
154
|
-
stateGtZero?: boolean;
|
|
155
|
-
}): SqlQuery;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* 创建新的 SQL 构建器实例
|
|
159
|
-
*/
|
|
160
|
-
export declare function createQueryBuilder(): SqlBuilder;
|