import type { Adapter } from "./adapter.js"; import type { ControlTransport } from "./control.js"; export interface ControlVerificationAbandonment { id: string; abandonedAt: string; } export interface ControlVerificationCommand { operationId: string; challengeId: string; expected: { gatewayInstanceId: string; configVersion: string; }; action: "submit" | "request-sms"; data?: Record; } export interface ControlVerificationChallenge { id: string; createdAt: number; expiresAt: number; request: Adapter.VerificationRequest; } export interface ControlVerificationSnapshot { gatewayInstanceId: string; configVersion: string; challenges: ControlVerificationChallenge[]; } export interface ControlVerificationOperation { id: string; challengeId: string; gatewayInstanceId: string; configVersion: string; action: "submit" | "request-sms"; status: "running" | "succeeded" | "rejected" | "unknown"; startedAt: string; finishedAt?: string; acknowledgement?: { acceptedAt: string; }; resolution?: { outcome: "succeeded" | "rejected"; confirmedAt: string; }; } /** 封存仅阻止这个编号迟到执行,不证明平台从未发生过动作。 */ export declare function isControlVerificationAbandonment(input: unknown): input is ControlVerificationAbandonment; /** 只校验有界 JSON,不调用输入访问器;网关仍负责最终权限与挑战检查。 */ export declare function isControlVerificationCommand(input: unknown): input is ControlVerificationCommand; export declare function isControlVerificationOperation(input: unknown): input is ControlVerificationOperation; export declare function isControlVerificationSnapshot(input: unknown): input is ControlVerificationSnapshot; export declare function controlVerificationOutcome(operation: ControlVerificationOperation): ControlVerificationOperation["status"] | "acknowledged"; /** 所有请求只发一次;答案只在当前调用内存在,不保存或自动重放。 */ export declare class ControlVerificationClient { private readonly transport; constructor(transport: ControlTransport); pending(): Promise; operation(id: string): Promise; reconcile(id: string): Promise; acknowledge(id: string, acceptUnknownOutcome: true): Promise; abandon(id: string, confirm: true): Promise; abandonment(id: string): Promise; execute(command: ControlVerificationCommand): Promise; }