@telnyx/ai-chat-widget 3.2.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,172 +0,0 @@
1
- import { JSX } from 'react/jsx-runtime';
2
- import * as React_2 from 'react';
3
- import { SVGProps } from 'react';
4
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
5
-
6
- declare type BaseProps = {
7
- /**
8
- * The endpoint to use for the chat widget
9
- * @default `flow`
10
- */
11
- endpoint: 'flow' | 'aida';
12
- /**
13
- * The base URL of the flow to execute, Defaults to `https://api.telnyx.com/v2/flow`
14
- * @required
15
- */
16
- chatAPIUrl: string;
17
- /**
18
- * The base URL of the feedback to send, Defaults to `https://api.telnyx.com/v2/ai/chatbot/feedback`
19
- * @required
20
- */
21
- feedbackAPIUrl: string;
22
- /**
23
- * The user info to send with the feedback
24
- * @required
25
- * The user info contains the user ID, token, api access key, api v2 token, two factor authentication, role, and expires at
26
- * @example
27
- * {
28
- * id: '123',
29
- * token: '123',
30
- * apiAccessKey: '123',
31
- * api_v2_token: '123',
32
- * twoFactorAuth: '123',
33
- * role: 'admin',
34
- * expiresAt: '2025-01-01',
35
- * }
36
- * We use the api_v2_token to authenticate the user with the flow API.
37
- * @info If you include in api_v2_token, it'll be sent as an authentication header in both EventSource and Feedback API.
38
- */
39
- user: UserInfo;
40
- /**
41
- * The placeholders to be used in the chat widget
42
- * @default ["Type your message here..."]
43
- */
44
- placeholders?: string[];
45
- /**
46
- * The action to be performed when the user clicks the help button
47
- */
48
- onHelpAction?: () => void;
49
- };
50
-
51
- export declare const ChatWidget: ({ endpoint, chatAPIUrl, feedbackAPIUrl, user, onHelpAction, open, setOpen, placeholders, mountPosition, mountDirection, offsetX, offsetY, icon, }: ChatWidgetProps) => JSX.Element;
52
-
53
- declare interface ChatWidgetNoMounting extends BaseProps {
54
- open?: never;
55
- setOpen?: never;
56
- mountPosition?: never;
57
- mountDirection?: never;
58
- offsetX?: never;
59
- offsetY?: never;
60
- /**
61
- * The icon to be used in the chat widget
62
- * @default `RCSIcon`
63
- */
64
- icon?: typeof RCSIcon;
65
- }
66
-
67
- declare type ChatWidgetProps = ChatWidgetNoMounting | ChatWidgetWithMounting;
68
-
69
- declare interface ChatWidgetWithMounting extends BaseProps, MountingProps {
70
- }
71
-
72
- declare type MountingProps = {
73
- open: boolean;
74
- setOpen: (open: boolean) => void;
75
- /**
76
- * The offset of the widget on the x axis
77
- * @default 0
78
- */
79
- offsetX?: number;
80
- /**
81
- * The offset of the widget on the y axis
82
- * @default 0
83
- */
84
- offsetY?: number;
85
- /**
86
- * The position of the widget
87
- * Values: `top-left`, `top`, `top-right`, `right`, `bottom-right`, `bottom`, `bottom-left`, `left`
88
- * @default `bottom-right`
89
- */
90
- mountPosition: WidgetMountPosition;
91
- /**
92
- * The direction, inside or outside the container
93
- * Values: `inside`, `outside`
94
- * @default `inside`
95
- */
96
- mountDirection: WidgetMountDirection;
97
- icon?: never;
98
- };
99
-
100
- declare type Props = {
101
- ref?: React.RefObject<SVGSVGElement>;
102
- } & SVGProps<SVGSVGElement>;
103
-
104
- declare const RCSIcon: (props: Props) => JSX.Element;
105
-
106
- export declare const Tooltip: React_2.FC<TooltipPrimitive.TooltipProps>;
107
-
108
- export declare const TooltipContent: {
109
- ({ className, sideOffset, ...props }: React_2.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>): JSX.Element;
110
- displayName: string;
111
- };
112
-
113
- export declare const TooltipProvider: React_2.FC<TooltipPrimitive.TooltipProviderProps>;
114
-
115
- export declare const TooltipTrigger: React_2.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
116
-
117
- declare type UserInfo = {
118
- /**
119
- * The user ID
120
- * @required
121
- */
122
- id: string | null;
123
- /**
124
- * The user token
125
- * @required
126
- */
127
- token: string | null;
128
- /**
129
- * The user API access key
130
- * @required
131
- */
132
- apiAccessKey: string | null;
133
- /**
134
- * The user API v2 token
135
- * @required
136
- */
137
- api_v2_token: string | null;
138
- /**
139
- * The user two factor authentication
140
- */
141
- twoFactorAuth?: boolean | null;
142
- /**
143
- * The user role
144
- */
145
- role?: string | null;
146
- /**
147
- * The user expires at
148
- */
149
- expiresAt?: number | null;
150
- };
151
-
152
- declare const WIDGET_MOUNT_DIRECTION: {
153
- readonly INSIDE: "inside";
154
- readonly OUTSIDE: "outside";
155
- };
156
-
157
- declare const WIDGET_MOUNT_POSITIONS: {
158
- readonly TOP_LEFT: "top-left";
159
- readonly TOP: "top";
160
- readonly TOP_RIGHT: "top-right";
161
- readonly RIGHT: "right";
162
- readonly BOTTOM_RIGHT: "bottom-right";
163
- readonly BOTTOM: "bottom";
164
- readonly BOTTOM_LEFT: "bottom-left";
165
- readonly LEFT: "left";
166
- };
167
-
168
- declare type WidgetMountDirection = (typeof WIDGET_MOUNT_DIRECTION)[keyof typeof WIDGET_MOUNT_DIRECTION];
169
-
170
- declare type WidgetMountPosition = (typeof WIDGET_MOUNT_POSITIONS)[keyof typeof WIDGET_MOUNT_POSITIONS];
171
-
172
- export { }