feat(core): add shared types, config validation, and error utilities

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-03-10 16:47:26 +00:00
parent b02dff9808
commit c5a1b800fc
9 changed files with 446 additions and 0 deletions

82
src/types/sage.ts Normal file
View File

@@ -0,0 +1,82 @@
export interface SageConfig {
url: string;
user: string;
password: string;
endpoint: string;
poolAlias: string;
language: string;
rejectUnauthorized: boolean;
}
export interface RestQueryOptions {
entity: string;
representation?: string;
where?: string;
orderBy?: string;
count?: number;
nextUrl?: string;
select?: string;
}
export interface RestQueryResult {
records: unknown[];
pagination: {
returned: number;
hasMore: boolean;
nextUrl?: string;
};
}
export interface RestDetailResult {
record: unknown;
}
export interface SoapCallContext {
codeLang: string;
poolAlias: string;
poolId: string;
requestConfig: string;
}
export interface SoapReadOptions {
publicName: string;
objectName?: string;
key: Record<string, string>;
}
export interface SoapQueryOptions {
publicName: string;
objectName?: string;
listSize?: number;
inputXml?: string;
}
export interface SoapResult {
status: number;
data: unknown;
messages: SoapMessage[];
technicalInfos: SoapTechInfo[];
}
export interface SoapMessage {
type: number;
message: string;
}
export interface SoapTechInfo {
type: string;
message: string;
}
export interface ToolResponse {
records?: unknown[];
record?: unknown;
pagination?: { returned: number; hasMore: boolean; nextUrl?: string };
error?: string;
hint?: string;
}
export interface HealthStatus {
rest: { status: string; latencyMs: number; endpoint: string };
soap: { status: string; latencyMs: number; poolAlias: string };
}