befly-shared 1.2.8 → 1.3.0

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 (98) hide show
  1. package/package.json +13 -30
  2. package/utils/arrayToTree.ts +135 -0
  3. package/utils/buildTreeByParentPath.ts +127 -0
  4. package/utils/scanViewsDir.ts +148 -0
  5. package/README.md +0 -439
  6. package/dist/addonHelper.js +0 -83
  7. package/dist/arrayKeysToCamel.js +0 -18
  8. package/dist/arrayToTree.js +0 -23
  9. package/dist/calcPerfTime.js +0 -13
  10. package/dist/configTypes.js +0 -1
  11. package/dist/constants.js +0 -46
  12. package/dist/deepTransformKeys.js +0 -139
  13. package/dist/fieldClear.js +0 -57
  14. package/dist/genShortId.js +0 -12
  15. package/dist/hashPassword.js +0 -22
  16. package/dist/index.js +0 -26
  17. package/dist/keysToCamel.js +0 -21
  18. package/dist/keysToSnake.js +0 -21
  19. package/dist/layouts.js +0 -59
  20. package/dist/pickFields.js +0 -16
  21. package/dist/redisKeys.js +0 -34
  22. package/dist/regex.js +0 -202
  23. package/dist/scanConfig.js +0 -83
  24. package/dist/scanFiles.js +0 -39
  25. package/dist/scanViews.js +0 -48
  26. package/dist/withDefaultColumns.js +0 -32
  27. package/src/addonHelper.ts +0 -88
  28. package/src/arrayKeysToCamel.ts +0 -18
  29. package/src/arrayToTree.ts +0 -31
  30. package/src/calcPerfTime.ts +0 -13
  31. package/src/configTypes.ts +0 -29
  32. package/src/constants.ts +0 -60
  33. package/src/deepTransformKeys.ts +0 -172
  34. package/src/fieldClear.ts +0 -75
  35. package/src/genShortId.ts +0 -12
  36. package/src/hashPassword.ts +0 -27
  37. package/src/index.ts +0 -29
  38. package/src/keysToCamel.ts +0 -22
  39. package/src/keysToSnake.ts +0 -22
  40. package/src/layouts.ts +0 -90
  41. package/src/pickFields.ts +0 -19
  42. package/src/redisKeys.ts +0 -44
  43. package/src/regex.ts +0 -225
  44. package/src/scanConfig.ts +0 -106
  45. package/src/scanFiles.ts +0 -49
  46. package/src/scanViews.ts +0 -55
  47. package/src/withDefaultColumns.ts +0 -36
  48. package/tests/addonHelper.test.ts +0 -55
  49. package/tests/arrayKeysToCamel.test.ts +0 -21
  50. package/tests/arrayToTree.test.ts +0 -98
  51. package/tests/calcPerfTime.test.ts +0 -19
  52. package/tests/deepTransformKeys.test.ts +0 -466
  53. package/tests/fieldClear.test.ts +0 -39
  54. package/tests/keysToCamel.test.ts +0 -22
  55. package/tests/keysToSnake.test.ts +0 -22
  56. package/tests/layouts.test.ts +0 -93
  57. package/tests/pickFields.test.ts +0 -22
  58. package/tests/regex.test.ts +0 -308
  59. package/tests/scanFiles.test.ts +0 -58
  60. package/tests/types.test.ts +0 -289
  61. package/types/addon.d.ts +0 -50
  62. package/types/addonConfigMerge.d.ts +0 -17
  63. package/types/addonHelper.d.ts +0 -24
  64. package/types/api.d.ts +0 -63
  65. package/types/arrayKeysToCamel.d.ts +0 -13
  66. package/types/arrayToTree.d.ts +0 -8
  67. package/types/calcPerfTime.d.ts +0 -4
  68. package/types/common.d.ts +0 -8
  69. package/types/configMerge.d.ts +0 -49
  70. package/types/configTypes.d.ts +0 -28
  71. package/types/constants.d.ts +0 -48
  72. package/types/context.d.ts +0 -38
  73. package/types/crypto.d.ts +0 -23
  74. package/types/database.d.ts +0 -55
  75. package/types/deepTransformKeys.d.ts +0 -84
  76. package/types/fieldClear.d.ts +0 -16
  77. package/types/genShortId.d.ts +0 -10
  78. package/types/hashPassword.d.ts +0 -11
  79. package/types/index.d.ts +0 -23
  80. package/types/jwt.d.ts +0 -99
  81. package/types/keysToCamel.d.ts +0 -10
  82. package/types/keysToSnake.d.ts +0 -10
  83. package/types/layouts.d.ts +0 -29
  84. package/types/loadAndMergeConfig.d.ts +0 -7
  85. package/types/logger.d.ts +0 -22
  86. package/types/menu.d.ts +0 -49
  87. package/types/mergeConfig.d.ts +0 -7
  88. package/types/pickFields.d.ts +0 -4
  89. package/types/redisKeys.d.ts +0 -34
  90. package/types/regex.d.ts +0 -145
  91. package/types/scanConfig.d.ts +0 -7
  92. package/types/scanFiles.d.ts +0 -12
  93. package/types/scanViews.d.ts +0 -11
  94. package/types/table.d.ts +0 -49
  95. package/types/tool.d.ts +0 -67
  96. package/types/types.d.ts +0 -44
  97. package/types/validate.d.ts +0 -69
  98. package/types/withDefaultColumns.d.ts +0 -7
@@ -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
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * 为表格列添加默认配置
3
- * @param columns - 列配置数组
4
- * @param customConfig - 自定义特殊列配置,可覆盖默认的 specialColumnConfig
5
- * @returns 添加默认配置后的列数组
6
- */
7
- export declare function withDefaultColumns(columns: any[], customConfig?: Record<string, any>): any[];