All files / dingtalk-openclaw-connector/src/types index.ts

0% Statements 0/0
0% Branches 1/1
0% Functions 1/1
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53                                                                                                         
import type { BaseProbeResult } from "openclaw/plugin-sdk";
import type {
  DingtalkConfigSchema,
  DingtalkGroupSchema,
  DingtalkAccountConfigSchema,
  z,
} from "../config/schema.ts";
 
export type DingtalkConfig = z.infer<typeof DingtalkConfigSchema>;
export type DingtalkGroupConfig = z.infer<typeof DingtalkGroupSchema>;
export type DingtalkAccountConfig = z.infer<typeof DingtalkAccountConfigSchema>;
 
export type DingtalkConnectionMode = "stream";
 
export type DingtalkDefaultAccountSelectionSource =
  | "explicit-default"
  | "mapped-default"
  | "fallback";
export type DingtalkAccountSelectionSource = "explicit" | DingtalkDefaultAccountSelectionSource;
 
export type ResolvedDingtalkAccount = {
  accountId: string;
  selectionSource: DingtalkAccountSelectionSource;
  enabled: boolean;
  configured: boolean;
  name?: string;
  clientId?: string;
  clientSecret?: string;
  /** Merged config (top-level defaults + account-specific overrides) */
  config: DingtalkConfig;
};
 
export type DingtalkMessageContext = {
  conversationId: string;
  messageId: string;
  senderId: string;
  senderName?: string;
  conversationType: "1" | "2"; // 1=å•čŠ, 2=įž¤čŠ
  content: string;
  contentType: string;
  groupSubject?: string;
};
 
export type DingtalkSendResult = {
  messageId: string;
  conversationId: string;
};
 
export type DingtalkProbeResult = BaseProbeResult<string> & {
  clientId?: string;
  botName?: string;
};