@botonic/core
Version:
Runtime and APIs for Botonic bots: actions, context, messaging, and integration hooks used by the **current** framework line.
31 lines (30 loc) • 1.47 kB
TypeScript
/**
* v2 `PATCH …/session/` success body: stored slice only (not full BotonicSessionBuilder JSON).
* @see openspec/specs/BE-botonic-v2-botonic-session-endpoints/spec.md
*/
import type { BotonicSession, BotonicSessionUser, UserExtraData } from '@botonic/shared';
import { WebchatClientSettings } from '@botonic/shared';
export interface BotonicSessionPatchSlice {
shadowing?: boolean;
flow_thread_id?: string;
is_first_interaction?: boolean;
custom?: Record<string, any>;
webviews_custom?: Record<string, any>;
webchat_client_settings?: WebchatClientSettings;
/** Flow Builder capture node id (`null` clears). */
capture_user_input_node_id?: string | null;
}
/**
* Mutates `session` with fields from the PATCH session response (slice), deep-merging object fields
* to mirror server `deep_merge` behavior for nested dicts.
*/
export declare function mergeBotonicSessionPatchSlice<TExtraData extends UserExtraData = UserExtraData>(session: BotonicSession<TExtraData>, slice: BotonicSessionPatchSlice): void;
/** `PATCH …/users/<user_id>/` 200 body (echo slice). */
export interface ChatUserPatchResponse {
override_name?: string;
locale?: string;
country?: string;
system_locale?: string;
extra_data?: UserExtraData;
}
export declare function mergeChatUserPatchResponseIntoSessionUser<TExtraData extends UserExtraData = UserExtraData>(user: BotonicSessionUser<TExtraData>, response: ChatUserPatchResponse): void;