befly-shared 1.2.8 → 1.3.1
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/package.json +13 -30
- package/utils/arrayToTree.ts +135 -0
- package/utils/buildTreeByParentPath.ts +127 -0
- package/utils/scanViewsDir.ts +148 -0
- package/README.md +0 -439
- package/dist/addonHelper.js +0 -83
- package/dist/arrayKeysToCamel.js +0 -18
- package/dist/arrayToTree.js +0 -23
- package/dist/calcPerfTime.js +0 -13
- package/dist/configTypes.js +0 -1
- package/dist/constants.js +0 -46
- package/dist/deepTransformKeys.js +0 -139
- package/dist/fieldClear.js +0 -57
- package/dist/genShortId.js +0 -12
- package/dist/hashPassword.js +0 -22
- package/dist/index.js +0 -26
- package/dist/keysToCamel.js +0 -21
- package/dist/keysToSnake.js +0 -21
- package/dist/layouts.js +0 -59
- package/dist/pickFields.js +0 -16
- package/dist/redisKeys.js +0 -34
- package/dist/regex.js +0 -202
- package/dist/scanConfig.js +0 -83
- package/dist/scanFiles.js +0 -39
- package/dist/scanViews.js +0 -48
- package/dist/withDefaultColumns.js +0 -32
- package/src/addonHelper.ts +0 -88
- package/src/arrayKeysToCamel.ts +0 -18
- package/src/arrayToTree.ts +0 -31
- package/src/calcPerfTime.ts +0 -13
- package/src/configTypes.ts +0 -29
- package/src/constants.ts +0 -60
- package/src/deepTransformKeys.ts +0 -172
- package/src/fieldClear.ts +0 -75
- package/src/genShortId.ts +0 -12
- package/src/hashPassword.ts +0 -27
- package/src/index.ts +0 -29
- package/src/keysToCamel.ts +0 -22
- package/src/keysToSnake.ts +0 -22
- package/src/layouts.ts +0 -90
- package/src/pickFields.ts +0 -19
- package/src/redisKeys.ts +0 -44
- package/src/regex.ts +0 -225
- package/src/scanConfig.ts +0 -106
- package/src/scanFiles.ts +0 -49
- package/src/scanViews.ts +0 -55
- package/src/withDefaultColumns.ts +0 -36
- package/tests/addonHelper.test.ts +0 -55
- package/tests/arrayKeysToCamel.test.ts +0 -21
- package/tests/arrayToTree.test.ts +0 -98
- package/tests/calcPerfTime.test.ts +0 -19
- package/tests/deepTransformKeys.test.ts +0 -466
- package/tests/fieldClear.test.ts +0 -39
- package/tests/keysToCamel.test.ts +0 -22
- package/tests/keysToSnake.test.ts +0 -22
- package/tests/layouts.test.ts +0 -93
- package/tests/pickFields.test.ts +0 -22
- package/tests/regex.test.ts +0 -308
- package/tests/scanFiles.test.ts +0 -58
- package/tests/types.test.ts +0 -289
- package/types/addon.d.ts +0 -50
- package/types/addonConfigMerge.d.ts +0 -17
- package/types/addonHelper.d.ts +0 -24
- package/types/api.d.ts +0 -63
- package/types/arrayKeysToCamel.d.ts +0 -13
- package/types/arrayToTree.d.ts +0 -8
- package/types/calcPerfTime.d.ts +0 -4
- package/types/common.d.ts +0 -8
- package/types/configMerge.d.ts +0 -49
- package/types/configTypes.d.ts +0 -28
- package/types/constants.d.ts +0 -48
- package/types/context.d.ts +0 -38
- package/types/crypto.d.ts +0 -23
- package/types/database.d.ts +0 -55
- package/types/deepTransformKeys.d.ts +0 -84
- package/types/fieldClear.d.ts +0 -16
- package/types/genShortId.d.ts +0 -10
- package/types/hashPassword.d.ts +0 -11
- package/types/index.d.ts +0 -23
- package/types/jwt.d.ts +0 -99
- package/types/keysToCamel.d.ts +0 -10
- package/types/keysToSnake.d.ts +0 -10
- package/types/layouts.d.ts +0 -29
- package/types/loadAndMergeConfig.d.ts +0 -7
- package/types/logger.d.ts +0 -22
- package/types/menu.d.ts +0 -49
- package/types/mergeConfig.d.ts +0 -7
- package/types/pickFields.d.ts +0 -4
- package/types/redisKeys.d.ts +0 -34
- package/types/regex.d.ts +0 -145
- package/types/scanConfig.d.ts +0 -7
- package/types/scanFiles.d.ts +0 -12
- package/types/scanViews.d.ts +0 -11
- package/types/table.d.ts +0 -49
- package/types/tool.d.ts +0 -67
- package/types/types.d.ts +0 -44
- package/types/validate.d.ts +0 -69
- package/types/withDefaultColumns.d.ts +0 -7
package/types/validate.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 验证相关类型定义
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 字段类型
|
|
7
|
-
*/
|
|
8
|
-
export type FieldType = 'string' | 'number' | 'text' | 'array_string' | 'array_text';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 字段定义类型(对象格式)
|
|
12
|
-
*/
|
|
13
|
-
export interface FieldDefinition {
|
|
14
|
-
/** 字段标签/描述 */
|
|
15
|
-
name: string;
|
|
16
|
-
/** 字段详细说明 */
|
|
17
|
-
detail: string;
|
|
18
|
-
/** 字段类型 */
|
|
19
|
-
type: FieldType;
|
|
20
|
-
/** 最小值/最小长度 */
|
|
21
|
-
min: number | null;
|
|
22
|
-
/** 最大值/最大长度 */
|
|
23
|
-
max: number | null;
|
|
24
|
-
/** 默认值 */
|
|
25
|
-
default: any;
|
|
26
|
-
/** 是否创建索引 */
|
|
27
|
-
index: boolean;
|
|
28
|
-
/** 是否唯一 */
|
|
29
|
-
unique: boolean;
|
|
30
|
-
/** 是否允许为空 */
|
|
31
|
-
nullable: boolean;
|
|
32
|
-
/** 是否无符号(仅 number 类型) */
|
|
33
|
-
unsigned: boolean;
|
|
34
|
-
/** 正则验证 */
|
|
35
|
-
regexp: string | null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 表定义类型(对象格式)
|
|
40
|
-
*/
|
|
41
|
-
export type TableDefinition = Record<string, FieldDefinition>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 验证结果类型
|
|
45
|
-
*/
|
|
46
|
-
export interface ValidateResult {
|
|
47
|
-
/** 状态码:0=通过,1=失败 */
|
|
48
|
-
code: 0 | 1;
|
|
49
|
-
/** 是否失败 */
|
|
50
|
-
failed: boolean;
|
|
51
|
-
/** 第一个错误 */
|
|
52
|
-
firstError: string | null;
|
|
53
|
-
/** 所有错误 */
|
|
54
|
-
errors: string[];
|
|
55
|
-
/** 错误字段列表 */
|
|
56
|
-
errorFields: string[];
|
|
57
|
-
/** 字段错误映射 */
|
|
58
|
-
fieldErrors: Record<string, string>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 单值验证结果
|
|
63
|
-
*/
|
|
64
|
-
export interface SingleResult {
|
|
65
|
-
/** 转换后的值 */
|
|
66
|
-
value: any;
|
|
67
|
-
/** 错误信息(null 表示通过) */
|
|
68
|
-
error: string | null;
|
|
69
|
-
}
|