export { C as CreateScreenRuleDTO, a as ScreenRuleBodyComponent, S as ScreenRuleHeaderComponent } from '../../_screen-rule-FlIJzVXA.mjs'; /** Available provider options in the Chat Config API. */ type ProviderName = 'whatsapp' | 'gmail' | 'outlook' | 'messenger' | 'direct' | 'yunique'; interface Provider { id: string; name: string; configurationsSchema: Record | null; defaultSession: number; type: string; createdAt: string; updatedAt: string; } type ProviderListResponse = Provider[]; interface GetProviderConfigurationsParams { id: string | string[]; companyId?: string; } interface WhatsAppProviderSettings { pin: string; csat: boolean; phone: string; wabaId: string; csatTTL: number; isEnabledMarketingMessagesAPI: boolean; phoneId: string; appToken: string; csatAnswer: string; debugToken: string; accessToken: string; alias: string; } interface WidgetProviderFunctionValues { chat: TValue; voice: TValue; whatsapp: TValue; } interface WidgetProviderFunctions extends WidgetProviderFunctionValues { voice_in_chat: boolean; } interface WidgetProviderAuthSettings { name: boolean; nameValidationQuestion: string; phone: boolean; phoneValidationQuestion: string; email: boolean; emailValidationQuestion: string; company: boolean; subject: boolean; cpfValidationQuestion: string; } interface WidgetProviderVoiceConfiguration { id: number; attendanceGroupId: string; voiceTimeout: number; description: string; surname: string; icon: string; } interface WidgetProviderThemeColors { primary: string; secondary: string; accent: string; neutral: string; } interface WidgetProviderThemeSettings { name: string; hexColors: WidgetProviderThemeColors; tailwindColors: WidgetProviderThemeColors; textColor: string; type: string; } interface WidgetProviderWhatsappSettings { phone: string; } interface WidgetProviderSettings { name: string; type: string; hidePoweredByOpens: boolean; showToClientEndChatOption: boolean; showToClientRecordAudioOption: boolean; hideBottomNavigation: boolean; hideCloseButton: boolean; openYuniqueWidget: boolean; fontChoice: string; useLogoAsUserImage: boolean; removeFileButton: boolean; position: string; positionMarginLeft: number; positionMarginTop: number; iconImage: string; customIconImage: string; functionsIcons: WidgetProviderFunctionValues; functionsIconsDisplays: WidgetProviderFunctionValues; functionsDescriptions: WidgetProviderFunctionValues; functionsNames: WidgetProviderFunctionValues; functionsColors: WidgetProviderFunctionValues; functions: WidgetProviderFunctions; auth: WidgetProviderAuthSettings; initialFlow: boolean; initialFlowId: string | null; textVoiceLines: string[]; voiceConfig: Record; iconSize: string; theme: WidgetProviderThemeSettings; flow?: any; locale: string; voiceRemoteAddress: string; voiceDevice: string; voiceCode: string; buttonType: string; whatsapp: WidgetProviderWhatsappSettings; customButtonIcon: string; logoUrl: string; } /** A provider configuration entity returned by the Chat Config API. */ type ProviderConfiguration = { id: string; isAssistanceEnabled: boolean; rewind: number; companyId: string; active: boolean; priority: number | null; providerId: string; configurations: WhatsAppProviderSettings | WidgetProviderSettings; inbound: boolean; outbound: boolean; deletedAt: string | null; csatConditionalRulesEnabled: boolean; csatFeedbackTTL: number | null; createdAt: string; updatedAt: string; }; /** Response returned by the Chat Config API when listing provider configurations. */ interface ProviderConfigurationsResponse { data: ProviderConfiguration[]; } /** Query parameters for retrieving provider configuration display info. */ interface GetProviderDisplayInfoParams { /** Provider identifier (e.g. `whatsapp`, `gmail`, `outlook`). */ provider: ProviderName | string; /** Configuration identifier. */ configId: string; } /** * Normalized display info for a provider configuration. * `channel` is the human-facing address (phone, email, handle) when available; otherwise `null`. */ interface ProviderDisplayInfoResponse { id: string; provider: ProviderName | string; name: string; channel: string | null; } /** * Provider entity nested in `GET /config/provider/:providerId` via the * Sequelize association `providers` (`Configs.belongsTo(Providers)`). * `id` is the integer primary key of the `Providers` table. */ interface ConfigProvider { /** Provider primary key (`Providers.id`, integer). */ id: number | string; /** Provider name (e.g. `whatsapp`, `gmail`, `outlook`, `messenger`, `direct`, `yunique`). */ name: string; /** Provider channel type (e.g. `chat`, `email`). */ type: string; /** Default session TTL in seconds. */ defaultSession: number; /** JSON schema describing provider-specific `configurations` fields, when available. */ configurationsSchema: Record | null; createdAt: string; updatedAt: string; } /** * A configuration row from the `Configs` table. * Returned by `GET /config/:configId` and inside * `GET /config/provider/:providerId` (`{ configurations: Config[] }`). * When listed by provider, each item includes the nested `providers` association. */ interface Config { /** Configuration UUID (`Configs.id`). */ id: string; isAssistanceEnabled: boolean; rewind: number | null; /** Company UUID resolved from the auth token on list-by-provider. */ companyId: string; active: boolean; /** Provider-specific settings JSON (shape varies by provider). */ configurations: Record; priority: number | null; /** Foreign key to `Providers.id`. */ providerId: number | string; inbound: boolean; outbound: boolean; deletedAt: string | null; csatConditionalRulesEnabled: boolean; csatFeedbackTTL: number | null; createdAt: string; updatedAt: string; /** Nested provider loaded by `GET /config/provider/:providerId`. */ providers: ConfigProvider; } /** * Response of `GET /config/provider/:providerId`. * Always wrapped as `{ configurations }` (empty array when none match). */ interface ConfigListByProviderResponse { configurations: Config[]; } /** * Optional query filters for `GET /config/provider/:providerId`. * Filters map to `Configs` columns, except `providerType` / `providerName` * which filter the nested `providers` association (`type` / `name`). * The backend applies filters with truthiness checks, so `false` / `0` values * are ignored and do not filter. */ interface GetConfigsByProviderParams { /** Filter by `Configs.isAssistanceEnabled`. */ isAssistanceEnabled?: boolean; /** Filter by `Configs.rewind`. */ rewind?: number; /** Filter by `Configs.active`. */ active?: boolean; /** Filter by `Configs.priority`. */ priority?: number; /** Filter by `Configs.inbound` (e.g. inbound WhatsApp channels). */ inbound?: boolean; /** Filter by `Configs.outbound`. */ outbound?: boolean; /** Filter by nested `providers.type` (e.g. `chat`, `email`). */ providerType?: string; /** Filter by nested `providers.name` (e.g. `whatsapp`). */ providerName?: string; } /** Query parameters for listing queue memberships of a member. */ interface GetMemberQueuesRequest { memberId: string; association?: boolean; } /** Queue membership entry returned by the Chat Config API. */ interface QueueMember { id: string; memberId: string; priority: number; permission: string; lastAttendance: string | null; lastInvite: string | null; paused: boolean; activeChat: number; online: boolean; companyId: string; avatar: string; username: string; createdAt: string; updatedAt: string; queueId: string; queue?: Queue; } /** Distribution type associated with a queue. */ type DistributionType = { id: string; alias: string; description: string; createdAt: string; updatedAt: string; }; /** Queue entity returned by the Chat Config API. */ interface Queue { id: string; distributionTypeId: string; companyId: string; name: string; strategy: 'leastrecent' | 'roundrobin' | 'random'; defaultQueue: boolean; unlimitedService: boolean; serviceLimit: number; timeLimit: number; skipOncallUsers: boolean; csat: boolean; csatAnswer: string; csatTTL: number; csatConditionalRulesEnabled: boolean; csatFeedbackTTL: number | null; outsideBusinessHourMessage: string; createCallbackOnExpired: boolean; createCallbackOnOutsideBusinessHours: boolean; archived: boolean; isPrivate: boolean; createdAt: string; updatedAt: string; members: QueueMember[]; distributionType: DistributionType; csatConditionalRules: Record[]; } interface QueueListResponse { queues: Queue[]; } interface GetServiceGroupsParams { id: string | string[]; companyId?: string; } interface ServiceGroup extends Queue { } interface ServiceGroupsResponse { data: ServiceGroup[]; } /** Representation of a button in a Meta template. */ interface MetaTemplateButton { /** Unique identifier of the button. */ id: string; /** Type of the button (e.g. 'URL', 'PHONE_NUMBER', 'QUICK_REPLY'). */ type: string; /** Text displayed on the button. */ text: string; /** Value of the button (e.g. URL or phone number). */ value?: string | null; /** Dynamic variable of the button. */ variable?: string | null; /** ID of the template configuration to which the button belongs. */ templateConfigId: string; /** Creation date of the record. */ createdAt?: string; /** Update date of the record. */ updatedAt?: string; } /** Detailed configuration of a Meta template. */ interface MetaTemplateConfigResponse { /** Unique identifier of the template configuration. */ id: string; /** Name of the template in Meta. */ name: string; /** Identifier of the template in Meta. */ templateId: string; /** Company identifier in Meta. */ companyId: string; /** Format of the template (e.g. TEXT, IMAGE, VIDEO). */ format?: string | null; /** Content of the template header. */ headerContent?: string | null; /** Defines if the header has dynamic content (parameters). */ isDynamicHeader: boolean; /** Type of the header (e.g. TEXT, IMAGE, DOCUMENT, VIDEO). */ headerType?: string | null; /** Content of the template body. */ bodyContent?: string | null; /** Type of the body (e.g. TEXT). */ bodyType?: string | null; /** Content of the template footer. */ footerContent?: string | null; /** Type of the footer (e.g. TEXT). */ footerType?: string | null; /** ID of the configuration associated with the template. */ configId?: string | null; /** ID of the provider associated with the template. */ providerId?: string | null; /** Creation date of the record. */ createdAt?: string; /** Update date of the record. */ updatedAt?: string; /** List of buttons in the template. */ buttons?: MetaTemplateButton[]; } /** Response containing the list of template configurations associated with a configuration. */ interface MetaTemplateConfigsResponse { /** List of Meta template configurations. */ templatesConfig: MetaTemplateConfigResponse[]; } /** Request payload for finding or creating a queue rule. */ interface FindOrCreateQueueRuleRequest { companyId: string; queueId: string; configId: string; } /** Response returned when finding or creating a queue rule. */ interface QueueRule extends Rule { flow?: Rule[]; } /** Known rule action values used by the Chat Config API. */ type RuleAction = 'queue' | 'interactiveMessage' | 'message' | 'automaticMessage' | 'automatic-message' | 'callOnQueue' | 'ura' | 'webhook' | 'questionnaire' | 'flow' | 'csat'; /** Archive filter for listing rules. Matches `GET /rules/paginated` query validation. */ type RuleArchiveStatus = 'archived' | 'unarchived' | 'all'; /** Associations that can be eager-loaded when listing paginated rules. */ type RuleAssociation = 'flow'; /** HTTP method used by webhook and questionnaire outbound requests. */ type RuleHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | string; /** Interactive presentation for URA rules (`settings.interactiveType`). */ type RuleInteractiveType = 'button' | 'list'; /** Validation action taken after a questionnaire answer is validated. */ type RuleQuestionnaireValidationAction = 'nextQuestion' | 'sendToRule' | 'terminateChat' | 'nextFlow' | 'addAutoTags' | string; /** Built-in regex validation kinds for questionnaire questions. */ type RuleQuestionnaireValidationRegexType = 'email' | 'cpf' | 'lettersOnly' | 'numbersOnly' | 'customExpression' | '' | string; /** Question input type for questionnaire questions. */ type RuleQuestionnaireQuestionType = 'interactive_menu' | string; /** Request query parameters for listing root rules. */ type GetRootRulesRequest = { companyId: string; offset: number; limit: number; name?: string; }; /** * Request query parameters for listing paginated rules (`GET /rules/paginated`). * `offset` defaults to `0` and `limit` defaults to `50` (max `100`) on the API. */ type GetRulesRequest = { companyId: string; offset?: number; limit?: number; name?: string; isRoot?: boolean; action?: RuleAction[]; archiveStatus?: RuleArchiveStatus; associations?: RuleAssociation[]; }; /** * Request query parameters for counting rules (`GET /rules/count`). * Shares the filter fields of `GetRulesRequest`, excluding pagination and associations. */ type GetRulesCountRequest = { companyId: string; name?: string; isRoot?: boolean; action?: RuleAction[]; archiveStatus?: RuleArchiveStatus; }; /** * Request query parameters for fetching a rule by id (`GET /rules/:id`). * When `rootOnly` is omitted the API defaults to `true` (no recursive flow tree). * Pass `rootOnly: false` to expand nested `flow` via `buildRuleTree`. */ type GetRuleByIdRequest = { rootOnly?: boolean; includeFlow?: boolean; collapseDistinctId?: boolean; distinctId?: boolean | string; expand?: RuleAssociation[]; }; /** Automatic message payload stored on a rule. */ interface RuleAutomaticMessage { messageBody: string; caption?: string | null; messageType?: string; } /** Call-on-queue payload stored on a rule. */ interface RuleCallOnQueue { id: string; attendanceGroupId?: string; voiceTimeout?: number; minutesToExpire?: number; callToActionMessage?: string; } /** Custom HTTP header used by webhook requests. */ interface RuleWebhookHeader { key: string; value: string; } /** Mapping from a webhook JSON response path into a context key. */ interface RuleWebhookResponseMapping { replaceValue: string; jsonPath: string; newJsonKey: string; } /** Webhook configuration stored on a rule. */ interface RuleWebhook { customHeaders: RuleWebhookHeader[]; webhookMethodType: RuleHttpMethod; webhookEndpoint: string; webhookResponseMappings: RuleWebhookResponseMapping[]; } /** Interactive option used by questionnaire `interactive_menu` questions. */ interface RuleQuestionnaireInteractiveOption { id: string; text: string; } /** Single question inside a questionnaire rule. */ interface RuleQuestionnaireQuestion { questionText: string; isResponsePrivateEnabled?: boolean; isEnabledCustomDebounce?: boolean; customDebounceSeconds?: number; hasValidation?: boolean; isUsingCustomValidation?: boolean; customValidationUrl?: string; customValidationMethod?: string; validationRegexType?: RuleQuestionnaireValidationRegexType; validationRegexPattern?: string; maxValidationAttempts?: number; onValidationFailureReply?: string; onValidationSuccessAction?: RuleQuestionnaireValidationAction; onValidationSuccessActionTarget?: string; onValidationFailureAction?: RuleQuestionnaireValidationAction; onValidationFailureActionTarget?: string; onValidationFailureMessage?: string; onValidationSuccessAutoTagIds?: number[]; onValidationFailureAutoTagIds?: number[]; questionType?: RuleQuestionnaireQuestionType; interactiveOptions?: RuleQuestionnaireInteractiveOption[]; } /** HTTP header sent with the questionnaire outbound request. */ interface RuleQuestionnaireHeader { id?: number; key: string; value: string; } /** Body/query field sent with the questionnaire outbound request. */ interface RuleQuestionnaireBodyField { id?: number; key: string; value: string; isFilledByAnswer?: boolean; answerIndex?: number | null; } /** * Questionnaire configuration stored on a rule. * The API may return `null`, a full object, or an empty object `{}`. */ interface RuleQuestionnaire { questions?: RuleQuestionnaireQuestion[]; questionHeaders?: RuleQuestionnaireHeader[]; questionBodyFields?: RuleQuestionnaireBodyField[]; questionEndpoint?: string; questionMethodType?: RuleHttpMethod | ''; } /** Text-response behavior for Meta flow rules (`settings.flow.textResponse`). */ interface RuleFlowTextResponse { behavior: 'require_flow' | 'redirect_rule'; sendReminder?: boolean; reminderMessage?: string; targetRuleId?: string; } /** Meta interactive flow configuration (`settings.flow`). */ interface RuleFlowSettings { configId: string; metaFlowId: string; flowAction: 'navigate' | 'data_exchange'; flowCta: string; flowBody: string; webhookUrl?: string; firstScreen?: string; flowHeader?: string; flowFooter?: string; contextKey?: string; textResponse?: RuleFlowTextResponse; } /** * Rule settings JSON. * Common keys: `interactiveType` (URA) and `flow` (action `flow`). */ interface RuleSettings { interactiveType?: RuleInteractiveType; flow?: RuleFlowSettings; [key: string]: unknown; } /** Rule entity returned by the Chat Config API. */ interface Rule { id: string; companyId: string; name: string; action: RuleAction | string; message: string | null; automaticMessage: RuleAutomaticMessage | null; callOnQueue: RuleCallOnQueue | null; uraDescription: string | null; interactiveMessageId: string | null; configId: string | null; queueId: string | null; redirectQueue: string | null; redirectRuleId: string | null; questionnaire: RuleQuestionnaire | null; webhook: RuleWebhook | null; isRoot: boolean; redirectDefault: boolean; redirectTimeout: number; delay: number | null; disableTyping: boolean; settings: RuleSettings | null; archivedAt: string | null; autoTagEnabled: boolean; autoTagIds: number[]; createdAt: string; updatedAt: string; flow?: Rule[]; } /** Response returned by `GET /rules/:id`. */ type RuleResponse = Rule; /** Response returned by the Chat Config API when listing paginated rules. */ type RulesResponse = { data: Rule[]; }; /** Response returned by the Chat Config API when counting rules. */ type RulesCountResponse = { total: number; }; /** Response returned by the Chat Config API when listing root rules. */ type RootRulesResponse = RulesResponse; export type { Config, ConfigListByProviderResponse, ConfigProvider, DistributionType, FindOrCreateQueueRuleRequest, GetConfigsByProviderParams, GetMemberQueuesRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRootRulesRequest, GetRuleByIdRequest, GetRulesCountRequest, GetRulesRequest, GetServiceGroupsParams, MetaTemplateButton, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, Provider, ProviderConfiguration, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, ProviderName, Queue, QueueListResponse, QueueMember, QueueRule, RootRulesResponse, Rule, RuleAction, RuleArchiveStatus, RuleAssociation, RuleAutomaticMessage, RuleCallOnQueue, RuleFlowSettings, RuleFlowTextResponse, RuleHttpMethod, RuleInteractiveType, RuleQuestionnaire, RuleQuestionnaireBodyField, RuleQuestionnaireHeader, RuleQuestionnaireInteractiveOption, RuleQuestionnaireQuestion, RuleQuestionnaireQuestionType, RuleQuestionnaireValidationAction, RuleQuestionnaireValidationRegexType, RuleResponse, RuleSettings, RuleWebhook, RuleWebhookHeader, RuleWebhookResponseMapping, RulesCountResponse, RulesResponse, ServiceGroup, ServiceGroupsResponse, WhatsAppProviderSettings, WidgetProviderSettings };