import type { ExecutionContext } from './context/execution-context'; import type { Extension } from './extension'; import { ExtensionMethod } from './method'; import type { SharedExtensionMethod } from './model/model-types'; import { MethodParams } from './params'; import type { AnySchema } from './types'; export interface SystemMethodSpec { name: string; /** * The params this method takes, as a normal z.object. Today every SYSTEM method happens to declare * exactly ONE property (`invocation` / `callbackObject` / `refreshToken`) — but that is a fact about the * current seam, not a constraint of the machinery: a second property needs no change here. Omit entirely * for a method that takes no input (getOAuth2ConnectionURL). */ scheme?: AnySchema; returnType?: string; published?: boolean; run: (params: Record, ctx: ExecutionContext) => unknown; } export declare class SystemMethod extends ExtensionMethod { private readonly spec; readonly params: MethodParams; constructor(extension: Extension, spec: SystemMethodSpec); get name(): string; get registerAs(): string; get published(): boolean; /** * FIELD-BY-FIELD validation: every declared param is required, then checked against its OWN schema. The * input here is a wrapper carrying named params rather than the params themselves — `{ invocation }` / * `{ callbackObject }` / `{ refreshToken }` are separate method params. * * Deliberately not one `parse(methodData)` over the whole object, because two failures must stay * distinguishable: an ABSENT param is a malformed call (MissingMethodParamError naming the param), while a * bad VALUE is a malformed value (InvalidMethodInputError whose issue paths are relative to that param, * not to `methodData`). A whole-object parse would flatten both into the second, with `invocation.` in * front of every path. */ validate(methodData: Record): Record; execute(params: Record, ctx: ExecutionContext): unknown; toModel(): SharedExtensionMethod; }