import { BaseConnector } from '../../base/base.connector'; import type { IChatOptions, IChatProvider, ISendMessageSuccessResponse, WithPassthrough, ChatSendResult, IChatConnector } from '../../types'; import { ChannelTypeEnum } from '../../types'; import type { LineConfig } from './line.config'; import type { LineNarrowedInput } from './line.types'; /** * Token-auth chat connector. Authorization is a Bearer header * carrying a long-lived Channel Access Token from the LINE Developers Console. * Endpoint pinned to LINE's Push API (`POST /v2/bot/message/push`) — Reply, * Multicast, Broadcast, and Narrowcast APIs are out-of-scope for v1.0. * * `sendMessage()` exists alongside `.send()` as the Novu-compatible surface. */ export declare class LineChatConnector extends BaseConnector implements IChatProvider, IChatConnector { private config; readonly id: "line"; readonly channelType: ChannelTypeEnum.CHAT; constructor(config: LineConfig, fetchImpl?: typeof fetch); /** * Thinwrap-native send. Implements `IChatConnector`. * * Builds a JSON body for LINE's `POST /v2/bot/message/push` endpoint with * hand-mapped camelCase wire keys (no casing middleware). * LINE's published API style is camelCase end-to-end, so the wire keys * match the narrowed-input field names verbatim. * * Body-vs-messages contract: when `input.messages` is set, `input.body` is * **ignored** (the wire payload uses `input.messages` directly). When unset, * the connector synthesizes `messages: [{ type: 'text', text: input.body }]` * — the minimal `body: string` → `messages: LineMessage[]` bridge. */ send(input: LineNarrowedInput): Promise; /** * HTTP-layer mapping. ConnectorError carries no * `retryAfterSeconds` field — retry is consumer policy: * parsed seconds embedded in `providerMessage` text, raw header preserved on * `cause.retryAfter`. Wrapper performs no retry. * * LINE returns rich error details under `body.details` for some 400 cases. * The connector surfaces `body.message` (top-level summary) in * `providerMessage`; consumers can read `cause.body.details` for per-property * specifics. * * Status → ProviderCode table: * 401 → auth_failed * 403 → auth_failed * 400 + body.message matches /not found/i → invalid_recipient * 400 + body.message matches /userId/i → invalid_recipient * 400 (other) → invalid_request * 429 → rate_limited * 5xx → provider_unavailable * other → unknown */ private mapVendorError; sendMessage(options: IChatOptions, bridgeProviderData?: WithPassthrough>): Promise; }