mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:07:41 +00:00
refactor(src): split oversized modules
This commit is contained in:
17
src/gateway/protocol/schema/primitives.ts
Normal file
17
src/gateway/protocol/schema/primitives.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import { SESSION_LABEL_MAX_LENGTH } from "../../../sessions/session-label.js";
|
||||
import { GATEWAY_CLIENT_IDS, GATEWAY_CLIENT_MODES } from "../client-info.js";
|
||||
|
||||
export const NonEmptyString = Type.String({ minLength: 1 });
|
||||
export const SessionLabelString = Type.String({
|
||||
minLength: 1,
|
||||
maxLength: SESSION_LABEL_MAX_LENGTH,
|
||||
});
|
||||
|
||||
export const GatewayClientIdSchema = Type.Union(
|
||||
Object.values(GATEWAY_CLIENT_IDS).map((value) => Type.Literal(value)),
|
||||
);
|
||||
|
||||
export const GatewayClientModeSchema = Type.Union(
|
||||
Object.values(GATEWAY_CLIENT_MODES).map((value) => Type.Literal(value)),
|
||||
);
|
||||
Reference in New Issue
Block a user