vome-core 0.1.54 → 0.1.56
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/dist/admin/config/plugin-dev.js +1 -1
- package/dist/admin/crud/components/vm-date-calendar-panel.vue +115 -87
- package/dist/admin/crud/components/vm-date-picker.vue +21 -17
- package/dist/admin/crud/components/vm-date-range.vue +8 -11
- package/dist/admin/crud/components/vm-datetime-field.vue +44 -48
- package/dist/admin/crud/components/vm-richtext-extensions.js +1 -1
- package/dist/admin/crud/config.d.ts +0 -1
- package/dist/admin/crud/config.js +1 -1
- package/dist/admin/crud/confirm.js +1 -1
- package/dist/admin/crud/dict.js +1 -1
- package/dist/admin/crud/key.d.ts +0 -2
- package/dist/admin/crud/key.js +1 -1
- package/dist/admin/crud/plugins.js +1 -1
- package/dist/admin/crud/registry.d.ts +0 -2
- package/dist/admin/crud/registry.js +0 -2
- package/dist/admin/crud/span.js +1 -1
- package/dist/admin/crud/style.d.ts +2 -2
- package/dist/admin/crud/style.js +1 -1
- package/dist/admin/crud/validate.d.ts +0 -10
- package/dist/admin/crud/validate.js +1 -1
- package/dist/admin/crud/vm-crud.vue +1 -9
- package/dist/admin/directives/perm.js +1 -1
- package/dist/admin/hooks/useUpload.js +1 -1
- package/dist/admin/lib/browser.js +1 -1
- package/dist/admin/lib/cn.js +1 -1
- package/dist/admin/lib/dialog-float.js +1 -1
- package/dist/admin/lib/export-excel.d.ts +0 -2
- package/dist/admin/lib/export-excel.js +1 -1
- package/dist/admin/lib/file-preview.d.ts +2 -4
- package/dist/admin/lib/file-preview.js +11 -11
- package/dist/admin/lib/import-excel.d.ts +3 -2
- package/dist/admin/lib/import-excel.js +1 -1
- package/dist/admin/lib/json.js +1 -1
- package/dist/admin/lib/menu.js +1 -1
- package/dist/admin/lib/tree.js +1 -1
- package/dist/admin/lib/upload.d.ts +0 -1
- package/dist/admin/lib/upload.js +1 -1
- package/dist/admin/lib/video-frame.d.ts +0 -3
- package/dist/admin/lib/video-frame.js +1 -1
- package/dist/agent/constants.d.ts +0 -7
- package/dist/agent/index.d.ts +0 -1
- package/dist/agent/index.js +2 -25
- package/dist/agent/protocol.d.ts +0 -2
- package/dist/ai/adapters/auth-headers.d.ts +2 -2
- package/dist/ai/adapters/openai-compatible.d.ts +1 -2
- package/dist/ai/index.js +0 -7
- package/dist/ai/transport.d.ts +0 -6
- package/dist/ai/types.d.ts +0 -2
- package/dist/client/vite-admin.d.ts +0 -5
- package/dist/client/vite-admin.js +0 -6
- package/dist/client/vite-plugin-eps.d.ts +0 -23
- package/dist/client/vite-plugin-eps.js +1 -1
- package/dist/comm/daily-log.d.ts +0 -2
- package/dist/comm/format-time.d.ts +0 -1
- package/dist/core/context/index.d.ts +0 -8
- package/dist/ext/load-plugin.d.ts +0 -4
- package/dist/index.js +1 -1
- package/dist/ioc/metadata.d.ts +0 -1
- package/dist/orm/column-comments.d.ts +2 -1
- package/dist/orm/field-ref.d.ts +2 -1
- package/dist/orm/import-excel.d.ts +2 -6
- package/dist/orm/join-tables.d.ts +0 -3
- package/dist/server/index.js +1 -1
- package/dist/shared/datetime-picker.d.ts +5 -22
- package/dist/shared/datetime-picker.js +1 -1
- package/dist/shared/excel.js +1 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/locale-json.js +1 -1
- package/dist/shared/tree.js +1 -1
- package/dist/typings/routing/crud.d.ts +1 -1
- package/package.json +1 -1
- package/typings/admin/comm/crud.d.ts +1 -1
- package/typings/admin/comm/crud.ts +1 -3
- package/typings/routing/crud.ts +1 -3
- package/dist/admin/crud/mitt.d.ts +0 -10
- package/dist/admin/crud/mitt.js +0 -1
- package/dist/agent/types.d.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x59abc8,_0x2587ae){const _0x72f2b3=_0x573e,_0x5b9358=_0x59abc8();while(!![]){try{const _0x153db9=-parseInt(_0x72f2b3(0x15d))/0x1*(-parseInt(_0x72f2b3(0x169))/0x2)+-parseInt(_0x72f2b3(0x15e))/0x3+parseInt(_0x72f2b3(0x16c))/0x4+-parseInt(_0x72f2b3(0x178))/0x5*(parseInt(_0x72f2b3(0x176))/0x6)+-parseInt(_0x72f2b3(0x174))/0x7*(parseInt(_0x72f2b3(0x15b))/0x8)+parseInt(_0x72f2b3(0x175))/0x9+parseInt(_0x72f2b3(0x158))/0xa;if(_0x153db9===_0x2587ae)break;else _0x5b9358['push'](_0x5b9358['shift']());}catch(_0x52eb63){_0x5b9358['push'](_0x5b9358['shift']());}}}(_0x3d13,0x29658));import{onUnmounted,ref,watch}from'vue';const FRAME_CAPTURE_TIMEOUT_MS=0x1f40;function _0x573e(_0xf9d018,_0x481521){_0xf9d018=_0xf9d018-0x156;const _0x3d13d4=_0x3d13();let _0x573e8d=_0x3d13d4[_0xf9d018];if(_0x573e['jFYUTb']===undefined){var _0x42f8b7=function(_0x142d4a){const _0x36b33c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5134a5='',_0x20eed3='';for(let _0x5132c2=0x0,_0x24e3a7,_0x5ece31,_0x5afa26=0x0;_0x5ece31=_0x142d4a['charAt'](_0x5afa26++);~_0x5ece31&&(_0x24e3a7=_0x5132c2%0x4?_0x24e3a7*0x40+_0x5ece31:_0x5ece31,_0x5132c2++%0x4)?_0x5134a5+=String['fromCharCode'](0xff&_0x24e3a7>>(-0x2*_0x5132c2&0x6)):0x0){_0x5ece31=_0x36b33c['indexOf'](_0x5ece31);}for(let _0x1dc5f3=0x0,_0x5e59f1=_0x5134a5['length'];_0x1dc5f3<_0x5e59f1;_0x1dc5f3++){_0x20eed3+='%'+('00'+_0x5134a5['charCodeAt'](_0x1dc5f3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x20eed3);};_0x573e['uFfxaK']=_0x42f8b7,_0x573e['lHjKOd']={},_0x573e['jFYUTb']=!![];}const _0x30b484=_0x3d13d4[0x0],_0x37c2e3=_0xf9d018+_0x30b484,_0x3cc35f=_0x573e['lHjKOd'][_0x37c2e3];return!_0x3cc35f?(_0x573e8d=_0x573e['uFfxaK'](_0x573e8d),_0x573e['lHjKOd'][_0x37c2e3]=_0x573e8d):_0x573e8d=_0x3cc35f,_0x573e8d;}function captureVideoFrame(_0x5134a5){const _0x449ecc=_0x573e;if(typeof document===_0x449ecc(0x179))return Promise[_0x449ecc(0x164)](null);return new Promise(_0x20eed3=>{const _0x453eea=_0x449ecc,_0x5132c2=document[_0x453eea(0x161)](_0x453eea(0x16b));_0x5132c2[_0x453eea(0x177)]=_0x453eea(0x16e),_0x5132c2[_0x453eea(0x163)]=!![],_0x5132c2[_0x453eea(0x156)]=!![],_0x5132c2[_0x453eea(0x15a)]=_0x453eea(0x168);let _0x24e3a7=![];const _0x5ece31=_0x1dc5f3=>{const _0x1da7ac=_0x453eea;if(_0x24e3a7)return;_0x24e3a7=!![],window[_0x1da7ac(0x157)](_0x5afa26),_0x5132c2[_0x1da7ac(0x159)](_0x1da7ac(0x15c)),_0x5132c2['load'](),_0x20eed3(_0x1dc5f3);},_0x5afa26=window[_0x453eea(0x16f)](()=>_0x5ece31(null),FRAME_CAPTURE_TIMEOUT_MS);_0x5132c2[_0x453eea(0x167)](_0x453eea(0x16a),()=>_0x5ece31(null),{'once':!![]}),_0x5132c2['addEventListener']('loadeddata',()=>{const _0x2ebdf7=_0x453eea;try{_0x5132c2[_0x2ebdf7(0x173)]=0.01;}catch{_0x5ece31(null);}},{'once':!![]}),_0x5132c2[_0x453eea(0x167)](_0x453eea(0x162),()=>{const _0x7a1c2a=_0x453eea;try{const _0x5e59f1=_0x5132c2[_0x7a1c2a(0x170)],_0x5b3df2=_0x5132c2['videoHeight'];if(!_0x5e59f1||!_0x5b3df2){_0x5ece31(null);return;}const _0x551495=document['createElement'](_0x7a1c2a(0x172));_0x551495[_0x7a1c2a(0x171)]=_0x5e59f1,_0x551495[_0x7a1c2a(0x166)]=_0x5b3df2;const _0x20e454=_0x551495['getContext']('2d');if(!_0x20e454){_0x5ece31(null);return;}_0x20e454[_0x7a1c2a(0x165)](_0x5132c2,0x0,0x0,_0x5e59f1,_0x5b3df2),_0x5ece31(_0x551495['toDataURL'](_0x7a1c2a(0x160),0.82));}catch{_0x5ece31(null);}},{'once':!![]}),_0x5132c2[_0x453eea(0x15c)]=_0x5134a5;});}export function useVideoFrame(_0x344f86){const _0x6a4347=ref(''),_0x169b5b=ref(![]);let _0x5e60ee=0x0;return watch(_0x344f86,_0x5c2821=>{const _0x3a4c14=_0x573e;_0x5e60ee+=0x1;const _0x1b622e=_0x5e60ee;_0x6a4347[_0x3a4c14(0x15f)]='',_0x169b5b[_0x3a4c14(0x15f)]=![];if(!_0x5c2821)return;captureVideoFrame(_0x5c2821)[_0x3a4c14(0x16d)](_0x5e788c=>{const _0x3a09a5=_0x3a4c14;if(_0x1b622e!==_0x5e60ee)return;if(_0x5e788c)_0x6a4347[_0x3a09a5(0x15f)]=_0x5e788c;else _0x169b5b['value']=!![];});},{'immediate':!![]}),onUnmounted(()=>{_0x5e60ee+=0x1;}),{'videoFrameSrc':_0x6a4347,'frameFailed':_0x169b5b};}function _0x3d13(){const _0x230ed9=['mtG0nZuXmNvjs2zNvG','C3jJ','nZqXzNv1v2rH','ndaWodaZqMfRALPp','DMfSDwu','Aw1Hz2uVANbLzW','y3jLyxrLrwXLBwvUDa','C2vLA2vK','Bxv0zwq','CMvZB2X2zq','zhjHD0LTywDL','AgvPz2H0','ywrKrxzLBNrmAxn0zw5LCG','yxv0BW','mZGYten0we5v','zxjYB3i','DMLKzw8','otuWntCYD2jXCKfI','DgHLBG','yw5VBNLTB3vZ','C2v0vgLTzw91Da','DMLKzw9xAwr0Aa','D2LKDgG','y2fUDMfZ','y3vYCMvUDfrPBwu','n3bMA2L2Aa','mtC1ndC2nMXHs3zOva','mtHLwxLdB1e','y3jVC3npCMLNAw4','mZqXotu1vgLADg9h','Dw5KzwzPBMvK','CgXHExnjBMXPBMu','y2XLyxjuAw1LB3v0','mty1mti1mgngEKXWCG','CMvTB3zLqxr0CMLIDxrL','ChjLBg9Hza'];_0x3d13=function(){return _0x230ed9;};return _0x3d13();}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
export declare const AGENT_DEFAULT_TOP_K = 5;
|
|
2
1
|
export declare const AGENT_DEFAULT_HOST = "http://127.0.0.1:3000";
|
|
3
2
|
/**
|
|
4
3
|
* 旧版:写在项目 cwd 下的清单文件名(现已迁到用户目录 `~/.vome-agent/state.json`)。
|
|
5
4
|
* 仅供本地 agent 迁移旧文件时识别。
|
|
6
5
|
*/
|
|
7
6
|
export declare const AGENT_MANIFEST_FILE = ".vome-agent.json";
|
|
8
|
-
/** 本机 agent 状态目录名(位于用户 home 下) */
|
|
9
|
-
export declare const AGENT_HOME_NAME = ".vome-agent";
|
|
10
|
-
/** 授权/会话清单文件名(位于 `~/{AGENT_HOME_NAME}/`) */
|
|
11
|
-
export declare const AGENT_STATE_FILE = "state.json";
|
|
12
7
|
/** 本地 companion(serve)默认绑定地址;与平台 host 无关 */
|
|
13
8
|
export declare const AGENT_LOCAL_HOST = "127.0.0.1";
|
|
14
9
|
/** 本地 companion 探针端口;避免与平台默认 3000 冲突 */
|
|
15
10
|
export declare const AGENT_LOCAL_DEFAULT_PORT = 17890;
|
|
16
11
|
/** 与平台 BaseController 成功码一致 */
|
|
17
12
|
export declare const AGENT_API_SUCCESS = 1000;
|
|
18
|
-
export declare const AGENT_KB_KINDS: readonly ["rule", "context", "adoption", "design"];
|
|
19
|
-
export declare const AGENT_BILLING_MODES: readonly ["token", "request", "image", "embed", "mixed"];
|
package/dist/agent/index.d.ts
CHANGED
package/dist/agent/index.js
CHANGED
|
@@ -48,40 +48,17 @@ var __export = (target, all) => {
|
|
|
48
48
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
49
|
var __promiseAll = (args) => Promise.all(args);
|
|
50
50
|
var __require = import.meta.require;
|
|
51
|
+
|
|
51
52
|
// src/agent/constants.ts
|
|
52
|
-
var AGENT_DEFAULT_TOP_K = 5;
|
|
53
53
|
var AGENT_DEFAULT_HOST = "http://127.0.0.1:3000";
|
|
54
54
|
var AGENT_MANIFEST_FILE = ".vome-agent.json";
|
|
55
|
-
var AGENT_HOME_NAME = ".vome-agent";
|
|
56
|
-
var AGENT_STATE_FILE = "state.json";
|
|
57
55
|
var AGENT_LOCAL_HOST = "127.0.0.1";
|
|
58
56
|
var AGENT_LOCAL_DEFAULT_PORT = 17890;
|
|
59
57
|
var AGENT_API_SUCCESS = 1000;
|
|
60
|
-
var AGENT_KB_KINDS = ["rule", "context", "adoption", "design"];
|
|
61
|
-
var AGENT_BILLING_MODES = [
|
|
62
|
-
"token",
|
|
63
|
-
"request",
|
|
64
|
-
"image",
|
|
65
|
-
"embed",
|
|
66
|
-
"mixed"
|
|
67
|
-
];
|
|
68
|
-
// src/agent/protocol.ts
|
|
69
|
-
function buildPromptSections(parts) {
|
|
70
|
-
return parts.filter((part) => String(part.content || "").trim()).map((part) => `## ${part.title}
|
|
71
|
-
${part.content}`).join(`
|
|
72
|
-
|
|
73
|
-
`);
|
|
74
|
-
}
|
|
75
58
|
export {
|
|
76
59
|
AGENT_API_SUCCESS,
|
|
77
|
-
AGENT_BILLING_MODES,
|
|
78
60
|
AGENT_DEFAULT_HOST,
|
|
79
|
-
AGENT_DEFAULT_TOP_K,
|
|
80
|
-
AGENT_HOME_NAME,
|
|
81
|
-
AGENT_KB_KINDS,
|
|
82
61
|
AGENT_LOCAL_DEFAULT_PORT,
|
|
83
62
|
AGENT_LOCAL_HOST,
|
|
84
|
-
AGENT_MANIFEST_FILE
|
|
85
|
-
AGENT_STATE_FILE,
|
|
86
|
-
buildPromptSections
|
|
63
|
+
AGENT_MANIFEST_FILE
|
|
87
64
|
};
|
package/dist/agent/protocol.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AgentPromptPart } from './types';
|
|
2
1
|
export type AgentApi = {
|
|
3
2
|
auth: {
|
|
4
3
|
heartbeat: (sessionId?: string) => Promise<{
|
|
@@ -19,4 +18,3 @@ export type AgentApi = {
|
|
|
19
18
|
adopt: (payload: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
|
-
export declare function buildPromptSections(parts: AgentPromptPart[]): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AiAdapterContext } from '../types';
|
|
2
|
-
|
|
2
|
+
type AuthStyle = 'openai' | 'anthropic' | 'gemini';
|
|
3
3
|
export declare function buildUpstreamHeaders(ctx: AiAdapterContext, style: AuthStyle, extra?: Record<string, string>): Record<string, string>;
|
|
4
|
-
export
|
|
4
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AiProtocolAdapter } from '../types';
|
|
2
2
|
/** OpenAI 兼容协议(HTTP 透传 + 可配置/默认响应规范化) */
|
|
3
3
|
export declare const openaiCompatibleAdapter: AiProtocolAdapter;
|
|
4
|
-
export declare function assertModeSupported(capability: AiCapability, mode: AiResultMode): void;
|
package/dist/ai/index.js
CHANGED
|
@@ -28879,8 +28879,6 @@ function buildAiCallLogResult(payload) {
|
|
|
28879
28879
|
}
|
|
28880
28880
|
export {
|
|
28881
28881
|
AI_TIMEOUT_DEFAULT_MS,
|
|
28882
|
-
AI_TIMEOUT_SYNC_MS,
|
|
28883
|
-
INTERNAL_BODY_KEYS,
|
|
28884
28882
|
appendFormFields,
|
|
28885
28883
|
buildAiCallLogRequest,
|
|
28886
28884
|
buildAiCallLogResult,
|
|
@@ -28889,10 +28887,7 @@ export {
|
|
|
28889
28887
|
defaultResponseSpec,
|
|
28890
28888
|
getAiAdapter,
|
|
28891
28889
|
getJsonPath,
|
|
28892
|
-
httpMethod,
|
|
28893
28890
|
inferAiMode,
|
|
28894
|
-
isAiCapability,
|
|
28895
|
-
joinUrl,
|
|
28896
28891
|
listAiProtocols,
|
|
28897
28892
|
mapUpstreamTaskStatus,
|
|
28898
28893
|
mergeAbortSignal,
|
|
@@ -28905,10 +28900,8 @@ export {
|
|
|
28905
28900
|
postUpstreamMultipart,
|
|
28906
28901
|
readUpstreamError,
|
|
28907
28902
|
requireAsyncSpec,
|
|
28908
|
-
requirePath,
|
|
28909
28903
|
resolveAiCapability,
|
|
28910
28904
|
resolveAiTimeoutMs,
|
|
28911
|
-
resolvePath,
|
|
28912
28905
|
resolvePollUrl,
|
|
28913
28906
|
sseResponse,
|
|
28914
28907
|
stripAiDefaultMeta,
|
package/dist/ai/transport.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { AiAdapterContext, AiInvokeInput } from './types';
|
|
2
|
-
/** 网关内部字段,不进入上游请求体 */
|
|
3
|
-
export declare const INTERNAL_BODY_KEYS: Set<string>;
|
|
4
|
-
export declare function joinUrl(base: string, path: string): string;
|
|
5
|
-
export declare function requirePath(ctx: AiAdapterContext): string;
|
|
6
|
-
export declare function httpMethod(ctx: AiAdapterContext): string;
|
|
7
|
-
export declare function resolvePath(ctx: AiAdapterContext): string;
|
|
8
2
|
export declare function readUpstreamError(res: Response): Promise<string>;
|
|
9
3
|
export declare function mergeInput(input: AiInvokeInput, defaults?: Record<string, unknown> | null): Record<string, unknown>;
|
|
10
4
|
/** input/defaults 原样透传;覆盖 model 与 override(如 stream) */
|
package/dist/ai/types.d.ts
CHANGED
|
@@ -177,7 +177,6 @@ export type AiProtocolAdapter = {
|
|
|
177
177
|
};
|
|
178
178
|
/** 上游超时:sync=360s,async=5s;stream 无默认超时 */
|
|
179
179
|
export declare const AI_TIMEOUT_DEFAULT_MS = 5000;
|
|
180
|
-
export declare const AI_TIMEOUT_SYNC_MS = 360000;
|
|
181
180
|
export declare function inferAiMode(capability: AiCapability, resultModes: string[] | null | undefined): AiResultMode;
|
|
182
181
|
export declare function resolveAiTimeoutMs(mode: AiResultMode, timeoutMs?: number, modelTimeoutMs?: number): number | null;
|
|
183
182
|
export declare function mergeAbortSignal(timeoutMs: number | null, signal?: AbortSignal): AbortSignal | undefined;
|
|
@@ -190,7 +189,6 @@ export declare function pickUpstreamTaskId(raw: Record<string, unknown>, idField
|
|
|
190
189
|
export declare function requireAsyncSpec(asyncSpec: AiAsyncSpec | null | undefined): AiAsyncSpec;
|
|
191
190
|
export declare function resolvePollUrl(baseUrl: string, pollPath: string, upstreamId: string): string;
|
|
192
191
|
export declare function mapUpstreamTaskStatus(raw?: string): AiPollTaskResult['status'];
|
|
193
|
-
export declare function isAiCapability(v: string): v is AiCapability;
|
|
194
192
|
/** 单能力模型可省略 capability */
|
|
195
193
|
export declare function resolveAiCapability(requested: string | undefined, modelCapabilities: string[] | null | undefined): AiCapability;
|
|
196
194
|
export {};
|
|
@@ -9,11 +9,6 @@ export type CreateAdminViteOptions = {
|
|
|
9
9
|
};
|
|
10
10
|
/** peer + resolve + 禁 optimize(放在 vue() 之前) */
|
|
11
11
|
export declare function createAdminResolvePlugins(opts: CreateAdminViteOptions): Plugin[];
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated 勿整包插在 vue() 前(会把 autoImport 提前)。
|
|
14
|
-
* 请用:`...createAdminResolvePlugins()` → `vue()` → `...createAdminAutoImportPlugins(root)`
|
|
15
|
-
*/
|
|
16
|
-
export declare function createAdminVitePlugins(opts: CreateAdminViteOptions): Plugin[];
|
|
17
12
|
/** optimizeDeps.esbuildOptions.plugins */
|
|
18
13
|
export declare function createAdminOptimizeDepsPlugins(opts: CreateAdminViteOptions): import("esbuild").Plugin[];
|
|
19
14
|
export declare const adminDedupe: readonly ["vue", "vue-router", "pinia", "@vueuse/core", "reka-ui", "clsx", "tailwind-merge", "@lucide/vue", "lucide-vue-next"];
|
|
@@ -24,12 +24,6 @@ export function createAdminResolvePlugins(opts) {
|
|
|
24
24
|
vomeAdminNoOptimizePlugin()
|
|
25
25
|
];
|
|
26
26
|
}
|
|
27
|
-
export function createAdminVitePlugins(opts) {
|
|
28
|
-
return [
|
|
29
|
-
...createAdminResolvePlugins(opts),
|
|
30
|
-
...createAdminAutoImportPlugins(opts.root)
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
27
|
export function createAdminOptimizeDepsPlugins(opts) {
|
|
34
28
|
const hostSrc = opts.hostSrc ?? path.resolve(opts.root, "src");
|
|
35
29
|
return [vomeHostEsbuildPlugin(hostSrc, opts.root)];
|
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
export type EpsSide = 'admin' | 'app';
|
|
3
|
-
type EpsApi = {
|
|
4
|
-
method?: string;
|
|
5
|
-
path?: string;
|
|
6
|
-
summary?: string;
|
|
7
|
-
perms?: string[];
|
|
8
|
-
};
|
|
9
|
-
type EpsColumn = {
|
|
10
|
-
propertyName?: string;
|
|
11
|
-
type?: string;
|
|
12
|
-
comment?: string;
|
|
13
|
-
nullable?: boolean;
|
|
14
|
-
};
|
|
15
|
-
type EpsEntity = {
|
|
16
|
-
module?: string;
|
|
17
|
-
prefix?: string;
|
|
18
|
-
name?: string;
|
|
19
|
-
api?: EpsApi[];
|
|
20
|
-
columns?: EpsColumn[];
|
|
21
|
-
pageColumns?: EpsColumn[];
|
|
22
|
-
};
|
|
23
|
-
/** 生成 declare namespace Eps(按 side 剥前缀) */
|
|
24
|
-
export declare function buildEpsDts(map: Record<string, EpsEntity[]>, side: EpsSide): string;
|
|
25
3
|
export type EpsVitePluginOptions = {
|
|
26
4
|
/** 生成哪一侧的 d.ts;both 时 d.ts 仍以 dtsSide 为准,json 含双侧 */
|
|
27
5
|
side?: EpsSide | 'both';
|
|
@@ -40,4 +18,3 @@ export type EpsVitePluginOptions = {
|
|
|
40
18
|
* web / uniapp 用 side:'app';admin 可用 side:'both'
|
|
41
19
|
*/
|
|
42
20
|
export declare function createEpsVitePlugin(options: EpsVitePluginOptions): Plugin;
|
|
43
|
-
export {};
|
|
@@ -20,7 +20,7 @@ function tsType(col) {
|
|
|
20
20
|
return "any";
|
|
21
21
|
return "string";
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
function buildEpsDts(map, side) {
|
|
24
24
|
const list = Object.values(map).flat().filter((e) => e.prefix);
|
|
25
25
|
const entityBlocks = [];
|
|
26
26
|
const serviceBlocks = [];
|
package/dist/comm/daily-log.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import type { ContextData } from '../../../typings/context/data';
|
|
2
2
|
export type { ContextData };
|
|
3
|
-
/** 从请求头 / 连接解析客户端 IP(不丢弃本机与内网) */
|
|
4
|
-
export declare function resolveClientIp(request: Request, server?: {
|
|
5
|
-
requestIP?: (request: Request) => {
|
|
6
|
-
address?: string;
|
|
7
|
-
} | null;
|
|
8
|
-
} | null): string;
|
|
9
3
|
/** @internal ALS 插件:从 Request 初始化上下文 */
|
|
10
4
|
export declare function initContextFromRequest(request: Request, server?: {
|
|
11
5
|
requestIP?: (request: Request) => {
|
|
12
6
|
address?: string;
|
|
13
7
|
} | null;
|
|
14
8
|
} | null): ContextData;
|
|
15
|
-
/** @internal ALS 插件:在指定上下文中执行 */
|
|
16
|
-
export declare function enterContext<T>(ctx: ContextData, fn: () => T): T;
|
|
17
9
|
/** @internal 进入请求上下文(onRequest 用,覆盖后续异步链) */
|
|
18
10
|
export declare function enterContextWith(ctx: ContextData): void;
|
|
19
11
|
declare function getContext(): ContextData | undefined;
|
|
@@ -3,10 +3,6 @@ import type { ModuleHandler } from '../../typings/ext/module';
|
|
|
3
3
|
type PluginCtor = new () => {
|
|
4
4
|
init: (info: PluginInfo, ctx?: unknown, app?: unknown, services?: Record<string, unknown>) => Promise<void>;
|
|
5
5
|
};
|
|
6
|
-
/** 混淆后 `vome-plugin-runtime` 可能进字符串数组,字面量替换失效;运行时拦截 require */
|
|
7
|
-
export declare function pluginRequire(id: string): any;
|
|
8
|
-
/** 剥 ESM、替换 CJS external(仅字符串内容 / 遗留 JSON 插件需要) */
|
|
9
|
-
export declare function normalizePluginScript(content: string): string;
|
|
10
6
|
/**
|
|
11
7
|
* 从落盘 server/index.js 加载。
|
|
12
8
|
* 读入后走内存编译,禁止 createRequire 落盘路径:
|