vome-core 0.1.14 → 0.1.16

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 (153) hide show
  1. package/dist/admin/config/plugin-dev.js +1 -1
  2. package/dist/admin/crud/config.js +1 -1
  3. package/dist/admin/crud/confirm.js +1 -1
  4. package/dist/admin/crud/dict.js +1 -1
  5. package/dist/admin/crud/index.js +1 -1
  6. package/dist/admin/crud/key.js +1 -1
  7. package/dist/admin/crud/mitt.js +1 -1
  8. package/dist/admin/crud/plugins.js +1 -1
  9. package/dist/admin/crud/span.js +1 -1
  10. package/dist/admin/crud/style.js +1 -1
  11. package/dist/admin/crud/validate.js +1 -1
  12. package/dist/admin/directives/perm.js +1 -1
  13. package/dist/admin/hooks/useUpload.js +1 -1
  14. package/dist/admin/lib/browser.js +1 -1
  15. package/dist/admin/lib/cn.js +1 -1
  16. package/dist/admin/lib/dialog-float.js +1 -1
  17. package/dist/admin/lib/export-excel.js +1 -1
  18. package/dist/admin/lib/import-excel.js +1 -1
  19. package/dist/admin/lib/json.js +1 -1
  20. package/dist/admin/lib/menu.js +1 -1
  21. package/dist/admin/lib/tree.js +1 -1
  22. package/dist/admin/lib/upload.js +1 -1
  23. package/dist/admin/lib/video-frame.js +1 -1
  24. package/dist/agent/index.d.ts +3 -1
  25. package/dist/client/vite-resolve.d.ts +1 -1
  26. package/dist/client/vite-resolve.js +1 -1
  27. package/dist/config/index.d.ts +10 -1
  28. package/dist/index.d.ts +13 -1
  29. package/dist/index.js +1 -1
  30. package/dist/server/index.d.ts +17 -1
  31. package/dist/server/index.js +1 -1
  32. package/dist/shared/excel.js +1 -1
  33. package/dist/shared/index.js +1 -1
  34. package/dist/shared/locale-json.js +1 -1
  35. package/dist/shared/tree.js +1 -1
  36. package/package.json +7 -5
  37. package/typings/comm/crud.ts +29 -0
  38. package/typings/comm/page.ts +18 -0
  39. package/typings/comm/scan.ts +6 -0
  40. package/typings/common.ts +4 -0
  41. package/typings/context/data.ts +10 -0
  42. package/typings/ext/market-seat.ts +42 -0
  43. package/typings/ext/market.ts +55 -0
  44. package/typings/ext/module.ts +64 -0
  45. package/typings/ext/plugin.ts +38 -0
  46. package/typings/ioc/metadata.ts +34 -0
  47. package/typings/logger/config.ts +6 -0
  48. package/typings/routing/crud.ts +162 -0
  49. package/typings/routing/eps.ts +72 -0
  50. package/typings/routing/meta.ts +63 -0
  51. package/typings/routing/register.ts +21 -0
  52. package/typings/routing/scan-context.ts +7 -0
  53. package/dist/ai.d.ts +0 -1
  54. package/dist/src/admin/config/plugin-dev.d.ts +0 -52
  55. package/dist/src/agent/index.d.ts +0 -3
  56. package/dist/src/config/index.d.ts +0 -10
  57. package/dist/src/index.d.ts +0 -12
  58. package/dist/src/server/index.d.ts +0 -17
  59. package/dist/src/shared/excel.d.ts +0 -23
  60. package/dist/src/shared/tree.d.ts +0 -18
  61. package/src/shared/excel.d.ts +0 -23
  62. package/src/shared/excel.ts +0 -123
  63. package/src/shared/index.ts +0 -30
  64. package/src/shared/locale-json.ts +0 -79
  65. package/src/shared/tree.d.ts +0 -18
  66. package/src/shared/tree.ts +0 -50
  67. /package/dist/{src/agent → agent}/constants.d.ts +0 -0
  68. /package/dist/{src/agent → agent}/protocol.d.ts +0 -0
  69. /package/dist/{src/agent → agent}/types.d.ts +0 -0
  70. /package/dist/{src/ai → ai}/adapters/anthropic-gemini.d.ts +0 -0
  71. /package/dist/{src/ai → ai}/adapters/auth-headers.d.ts +0 -0
  72. /package/dist/{src/ai → ai}/adapters/index.d.ts +0 -0
  73. /package/dist/{src/ai → ai}/adapters/openai-compatible.d.ts +0 -0
  74. /package/dist/{src/ai → ai}/call-log-helpers.d.ts +0 -0
  75. /package/dist/{src/ai → ai}/index.d.ts +0 -0
  76. /package/dist/{src/ai → ai}/normalize.d.ts +0 -0
  77. /package/dist/{src/ai → ai}/sse.d.ts +0 -0
  78. /package/dist/{src/ai → ai}/transport.d.ts +0 -0
  79. /package/dist/{src/ai → ai}/types.d.ts +0 -0
  80. /package/dist/{src/auth → auth}/define-macro.d.ts +0 -0
  81. /package/dist/{src/auth → auth}/index.d.ts +0 -0
  82. /package/dist/{src/comm → comm}/daily-log.d.ts +0 -0
  83. /package/dist/{src/comm → comm}/env.d.ts +0 -0
  84. /package/dist/{src/comm → comm}/format-time.d.ts +0 -0
  85. /package/dist/{src/comm → comm}/merge.d.ts +0 -0
  86. /package/dist/{src/comm → comm}/scan.d.ts +0 -0
  87. /package/dist/{src/comm → comm}/startBanner.d.ts +0 -0
  88. /package/dist/{src/core → core}/app.d.ts +0 -0
  89. /package/dist/{src/core → core}/config.d.ts +0 -0
  90. /package/dist/{src/core → core}/context/index.d.ts +0 -0
  91. /package/dist/{src/core → core}/host-infra.d.ts +0 -0
  92. /package/dist/{src/core → core}/index.d.ts +0 -0
  93. /package/dist/{src/core → core}/plugins/async-context.d.ts +0 -0
  94. /package/dist/{src/core → core}/plugins/error.d.ts +0 -0
  95. /package/dist/{src/core → core}/plugins/logging.d.ts +0 -0
  96. /package/dist/{src/core → core}/plugins/openapi.d.ts +0 -0
  97. /package/dist/{src/core → core}/vome-config.d.ts +0 -0
  98. /package/dist/{src/ext → ext}/base-plugin.d.ts +0 -0
  99. /package/dist/{src/ext → ext}/host-identity.d.ts +0 -0
  100. /package/dist/{src/ext → ext}/index.d.ts +0 -0
  101. /package/dist/{src/ext → ext}/load-plugin.d.ts +0 -0
  102. /package/dist/{src/ext → ext}/market-crypto.d.ts +0 -0
  103. /package/dist/{src/ext → ext}/market-package.d.ts +0 -0
  104. /package/dist/{src/ext → ext}/market-runtime.d.ts +0 -0
  105. /package/dist/{src/ext → ext}/market-seat.d.ts +0 -0
  106. /package/dist/{src/ext → ext}/micro-apps.d.ts +0 -0
  107. /package/dist/{src/ext → ext}/module-gateway.d.ts +0 -0
  108. /package/dist/{src/ext → ext}/module-install-gate.d.ts +0 -0
  109. /package/dist/{src/ext → ext}/module-install.d.ts +0 -0
  110. /package/dist/{src/ext → ext}/module-registry.d.ts +0 -0
  111. /package/dist/{src/ext → ext}/path.d.ts +0 -0
  112. /package/dist/{src/ioc → ioc}/container.d.ts +0 -0
  113. /package/dist/{src/ioc → ioc}/decorators.d.ts +0 -0
  114. /package/dist/{src/ioc → ioc}/host.d.ts +0 -0
  115. /package/dist/{src/ioc → ioc}/index.d.ts +0 -0
  116. /package/dist/{src/ioc → ioc}/metadata.d.ts +0 -0
  117. /package/dist/{src/ioc → ioc}/scope.d.ts +0 -0
  118. /package/dist/{src/logger → logger}/bootstrap.d.ts +0 -0
  119. /package/dist/{src/logger → logger}/exception.d.ts +0 -0
  120. /package/dist/{src/logger → logger}/index.d.ts +0 -0
  121. /package/dist/{src/logger → logger}/logger.d.ts +0 -0
  122. /package/dist/{src/logger → logger}/pino.d.ts +0 -0
  123. /package/dist/{src/orm → orm}/base-columns.d.ts +0 -0
  124. /package/dist/{src/orm → orm}/column-comments.d.ts +0 -0
  125. /package/dist/{src/orm → orm}/crud-config.d.ts +0 -0
  126. /package/dist/{src/orm → orm}/crud-register.d.ts +0 -0
  127. /package/dist/{src/orm → orm}/data-scope.d.ts +0 -0
  128. /package/dist/{src/orm → orm}/db-store.d.ts +0 -0
  129. /package/dist/{src/orm → orm}/declarative-select.d.ts +0 -0
  130. /package/dist/{src/orm → orm}/entity-schema.d.ts +0 -0
  131. /package/dist/{src/orm → orm}/field-ref.d.ts +0 -0
  132. /package/dist/{src/orm → orm}/import-excel.d.ts +0 -0
  133. /package/dist/{src/orm → orm}/index.d.ts +0 -0
  134. /package/dist/{src/orm → orm}/join-tables.d.ts +0 -0
  135. /package/dist/{src/orm → orm}/query-builder.d.ts +0 -0
  136. /package/dist/{src/orm → orm}/query-op.d.ts +0 -0
  137. /package/dist/{src/orm → orm}/repository.d.ts +0 -0
  138. /package/dist/{src/orm → orm}/service.d.ts +0 -0
  139. /package/dist/{src/orm → orm}/tenant.d.ts +0 -0
  140. /package/dist/{src/routing → routing}/base.d.ts +0 -0
  141. /package/dist/{src/routing → routing}/context.d.ts +0 -0
  142. /package/dist/{src/routing → routing}/crud-summary.d.ts +0 -0
  143. /package/dist/{src/routing → routing}/decorators.d.ts +0 -0
  144. /package/dist/{src/routing → routing}/eps.d.ts +0 -0
  145. /package/dist/{src/routing → routing}/index.d.ts +0 -0
  146. /package/dist/{src/routing → routing}/metadata.d.ts +0 -0
  147. /package/dist/{src/routing → routing}/openapi-tags.d.ts +0 -0
  148. /package/dist/{src/routing → routing}/path-utils.d.ts +0 -0
  149. /package/dist/{src/routing → routing}/perm.d.ts +0 -0
  150. /package/dist/{src/routing → routing}/public-routes.d.ts +0 -0
  151. /package/dist/{src/routing → routing}/register.d.ts +0 -0
  152. /package/dist/{src/shared → shared}/index.d.ts +0 -0
  153. /package/dist/{src/shared → shared}/locale-json.d.ts +0 -0
@@ -1,79 +0,0 @@
1
- import { createHash } from 'node:crypto'
2
-
3
- /** 嵌套对象 → 点分扁平 key */
4
- export function flattenLocale(
5
- input: Record<string, unknown>,
6
- prefix = '',
7
- ): Record<string, string> {
8
- const out: Record<string, string> = {}
9
- for (const [k, v] of Object.entries(input)) {
10
- const key = prefix ? `${prefix}.${k}` : k
11
- if (v != null && typeof v === 'object' && !Array.isArray(v)) {
12
- Object.assign(out, flattenLocale(v as Record<string, unknown>, key))
13
- } else if (typeof v === 'string') {
14
- out[key] = v
15
- } else if (v != null) {
16
- out[key] = String(v)
17
- }
18
- }
19
- return out
20
- }
21
-
22
- /** 点分扁平 → 嵌套对象 */
23
- export function unflattenLocale(
24
- flat: Record<string, string>,
25
- ): Record<string, unknown> {
26
- const root: Record<string, unknown> = {}
27
- for (const [path, value] of Object.entries(flat)) {
28
- const parts = path.split('.').filter(Boolean)
29
- if (!parts.length) continue
30
- let cur: Record<string, unknown> = root
31
- for (let i = 0; i < parts.length - 1; i++) {
32
- const p = parts[i]!
33
- const next = cur[p]
34
- if (!next || typeof next !== 'object' || Array.isArray(next)) {
35
- cur[p] = {}
36
- }
37
- cur = cur[p] as Record<string, unknown>
38
- }
39
- cur[parts[parts.length - 1]!] = value
40
- }
41
- return root
42
- }
43
-
44
- export function hashLocaleJson(obj: Record<string, unknown>): string {
45
- const flat = flattenLocale(obj)
46
- const keys = Object.keys(flat).sort()
47
- const payload = keys.map((k) => `${k}=${flat[k]}`).join('\n')
48
- return createHash('sha256').update(payload).digest('hex').slice(0, 32)
49
- }
50
-
51
- /** 从模型回复中尽量抠出 JSON 对象 */
52
- export function extractJsonObject(text: string): Record<string, unknown> {
53
- const raw = String(text || '').trim()
54
- if (!raw) throw new Error('AI 返回空内容')
55
- try {
56
- const parsed = JSON.parse(raw) as unknown
57
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
58
- return parsed as Record<string, unknown>
59
- }
60
- } catch {
61
- /* try fence / substring */
62
- }
63
- const fence = raw.match(/```(?:json)?\s*([\s\S]*?)```/i)
64
- if (fence?.[1]) {
65
- const parsed = JSON.parse(fence[1].trim()) as unknown
66
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
67
- return parsed as Record<string, unknown>
68
- }
69
- }
70
- const start = raw.indexOf('{')
71
- const end = raw.lastIndexOf('}')
72
- if (start >= 0 && end > start) {
73
- const parsed = JSON.parse(raw.slice(start, end + 1)) as unknown
74
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
75
- return parsed as Record<string, unknown>
76
- }
77
- }
78
- throw new Error('AI 返回无法解析为 JSON 对象')
79
- }
@@ -1,18 +0,0 @@
1
- /** 扁平列表 → 树(parentId) */
2
- export declare function deepTree<T extends {
3
- id?: number | string;
4
- parentId?: number | string | null;
5
- children?: T[];
6
- orderNum?: number;
7
- }>(list: T[], sort?: 'asc' | 'desc'): T[];
8
- /** 树 → 扁平(带 depth / hasChildren),按 expanded 展开 */
9
- export declare function flattenTree<T extends {
10
- id: number | string;
11
- children?: T[];
12
- }>(nodes: T[], expanded: Set<string | number>, depth?: number, out?: Array<T & {
13
- depth: number;
14
- hasChildren: boolean;
15
- }>): Array<T & {
16
- depth: number;
17
- hasChildren: boolean;
18
- }>;
@@ -1,50 +0,0 @@
1
- /** 扁平列表 → 树(parentId) */
2
- export function deepTree<
3
- T extends {
4
- id?: number | string
5
- parentId?: number | string | null
6
- children?: T[]
7
- orderNum?: number
8
- },
9
- >(list: T[], sort: 'asc' | 'desc' = 'asc'): T[] {
10
- const map = new Map<string | number, T>()
11
- for (const row of list) {
12
- if (row.id == null) continue
13
- map.set(row.id, { ...row, children: [] })
14
- }
15
- const roots: T[] = []
16
- for (const node of map.values()) {
17
- const pid = node.parentId
18
- if (pid != null && pid !== '' && map.has(pid as string | number)) {
19
- map.get(pid as string | number)!.children!.push(node)
20
- } else {
21
- roots.push(node)
22
- }
23
- }
24
- const sortRec = (arr: T[]) => {
25
- arr.sort((a, b) => {
26
- const ao = a.orderNum ?? 0
27
- const bo = b.orderNum ?? 0
28
- const d = sort === 'desc' ? bo - ao : ao - bo
29
- return d || Number(a.id) - Number(b.id)
30
- })
31
- for (const n of arr) if (n.children?.length) sortRec(n.children)
32
- }
33
- sortRec(roots)
34
- return roots
35
- }
36
-
37
- /** 树 → 扁平(带 depth / hasChildren),按 expanded 展开 */
38
- export function flattenTree<T extends { id: number | string; children?: T[] }>(
39
- nodes: T[],
40
- expanded: Set<string | number>,
41
- depth = 0,
42
- out: Array<T & { depth: number; hasChildren: boolean }> = [],
43
- ): Array<T & { depth: number; hasChildren: boolean }> {
44
- for (const n of nodes) {
45
- const kids = n.children || []
46
- out.push({ ...n, depth, hasChildren: kids.length > 0 })
47
- if (kids.length && expanded.has(n.id)) flattenTree(kids, expanded, depth + 1, out)
48
- }
49
- return out
50
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes