import { SchemaDefinition } from '../../schema'; import { z } from '../../zui'; import { BaseConfig, BaseEvents, BaseActions, BaseMessages, BaseChannels, BaseStates, BaseEntities, BaseConfigs } from './generic'; export type TagDefinition = { title?: string; description?: string; }; export type ConfigurationDefinition = SchemaDefinition & { identifier?: { required?: boolean; linkTemplateScript?: string; }; }; export type AdditionalConfigurationDefinition = ConfigurationDefinition & { title?: string; description?: string; }; export type EventDefinition = SchemaDefinition & { title?: string; description?: string; attributes?: Record; }; export type MessageDefinition = SchemaDefinition; export type ChannelDefinition = { title?: string; description?: string; messages: { [K in keyof TChannel]: MessageDefinition; }; message?: { tags?: Record; }; conversation?: Partial<{ tags: Record; /** * @deprecated */ creation: { enabled: boolean; requiredTags: string[]; }; }>; }; export type ActionDefinition = { title?: string; description?: string; input: SchemaDefinition; output: SchemaDefinition; billable?: boolean; cacheable?: boolean; attributes?: Record; }; export type StateType = 'integration' | 'conversation' | 'user'; export type StateDefinition = SchemaDefinition & { type: StateType; }; export type UserDefinition = Partial<{ tags: Record; /** * @deprecated */ creation: { enabled: boolean; requiredTags: string[]; }; }>; export type SecretDefinition = { optional?: boolean; description?: string; }; export type EntityDefinition = SchemaDefinition & { title?: string; description?: string; }; export type ResolvedInterface = { actions: { [K in keyof TActions]: ActionDefinition; }; events: { [K in keyof TEvents]: EventDefinition; }; channels: { [K in keyof TChannels]: ChannelDefinition; }; }; /** * A.K.A. Interface Implementation Statetement * Used by an integration to explicitly declare that it implements an interface */ export type InterfaceExtension = { id?: string; name: string; version: string; entities: { [K in keyof TEntities]: { name: string; }; }; actions: { [K in keyof TActions]: { name: string; }; }; events: { [K in keyof TEvents]: { name: string; }; }; channels: { [K in keyof TChannels]: { name: string; }; }; };