@botpress/webchat 2.3.1 → 2.3.2
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/.eslintrc.js +11 -0
- package/.turbo/turbo-build.log +16 -15
- package/dist/adapters/index.d.ts +1 -6
- package/dist/adapters/target.d.ts +1 -6
- package/dist/adapters/typings.d.ts +1 -6
- package/dist/adapters/webchat-to-target.d.ts +8 -0
- package/dist/adapters/webchat.d.ts +3 -1986
- package/dist/client/state-machine.d.ts +1 -1
- package/dist/client/types.d.ts +1 -0
- package/dist/components/MessageList/MessageList.d.ts +1 -1
- package/dist/components/renderers/Audio/Audio.d.ts +1 -0
- package/dist/components/renderers/Carousel/Carousel.d.ts +1 -0
- package/dist/components/renderers/File/File.d.ts +1 -0
- package/dist/components/renderers/Image/Image.d.ts +1 -0
- package/dist/components/renderers/Location/Location.d.ts +1 -0
- package/dist/components/renderers/Video/Video.d.ts +1 -0
- package/dist/gen/signals/index.d.ts +34 -34
- package/dist/gen/signals/messageCreated.z.d.ts +34 -34
- package/dist/index.js +67478 -25250
- package/dist/index.umd.cjs +172 -127
- package/dist/schemas/init.d.ts +14 -14
- package/dist/schemas/theme.d.ts +8 -8
- package/dist/stores/offlineStore.d.ts +1 -1
- package/dist/stores/webchatStore.d.ts +2 -2
- package/dist/types/block-type.d.ts +2 -0
- package/package.json +21 -22
- package/dist/adapters/adapters/messaging-to-target.d.ts +0 -184
- package/dist/adapters/adapters/messaging-to-webchat.d.ts +0 -5
- package/dist/adapters/adapters/webchat-to-messaging.d.ts +0 -223
- package/dist/adapters/adapters/webchat-to-target.d.ts +0 -197
- package/dist/adapters/messaging.d.ts +0 -1455
- package/dist/adapters/sdk.d.ts +0 -472
- package/dist/client/inner-client/event-emitter.d.ts +0 -10
- package/dist/client/inner-client/eventsource.d.ts +0 -22
- package/dist/client/inner-client/index.d.ts +0 -42
- package/dist/client/inner-client/signal-listener.d.ts +0 -47
- package/openapi.ts +0 -35
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import * as webchat from '../webchat';
|
|
2
|
-
import * as messaging from '../messaging';
|
|
3
|
-
import * as types from '../typings';
|
|
4
|
-
export type WebChatToMessagingMessageAdapters = types.Adapter<webchat.Messages, messaging.Messages>;
|
|
5
|
-
export type WebChatToMessagingTriggerAdapters = types.Adapter<webchat.Triggers, messaging.Triggers>;
|
|
6
|
-
export declare const audioAdapter: (x: {
|
|
7
|
-
type: "audio";
|
|
8
|
-
audioUrl: string;
|
|
9
|
-
className?: string | undefined;
|
|
10
|
-
}) => {
|
|
11
|
-
type: "audio";
|
|
12
|
-
audio: string;
|
|
13
|
-
audioUrl: string;
|
|
14
|
-
className?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export declare const cardAdapter: (x: {
|
|
17
|
-
type: "card";
|
|
18
|
-
title: string;
|
|
19
|
-
actions: {
|
|
20
|
-
value: string;
|
|
21
|
-
action: "postback" | "url" | "say";
|
|
22
|
-
label: string;
|
|
23
|
-
}[];
|
|
24
|
-
className?: string | undefined;
|
|
25
|
-
subtitle?: string | undefined;
|
|
26
|
-
imageUrl?: string | undefined;
|
|
27
|
-
}) => {
|
|
28
|
-
type: "card";
|
|
29
|
-
title: string;
|
|
30
|
-
actions: ({
|
|
31
|
-
text: string;
|
|
32
|
-
title: string;
|
|
33
|
-
action: "Say something";
|
|
34
|
-
} | {
|
|
35
|
-
title: string;
|
|
36
|
-
action: "Open URL";
|
|
37
|
-
url: string;
|
|
38
|
-
} | {
|
|
39
|
-
title: string;
|
|
40
|
-
action: "Postback";
|
|
41
|
-
payload: string;
|
|
42
|
-
})[];
|
|
43
|
-
className?: string | undefined;
|
|
44
|
-
avatarUrl?: string | undefined;
|
|
45
|
-
subtitle?: string | undefined;
|
|
46
|
-
image?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
export declare const carouselAdapter: (x: {
|
|
49
|
-
type: "carousel";
|
|
50
|
-
items: {
|
|
51
|
-
title: string;
|
|
52
|
-
actions: {
|
|
53
|
-
value: string;
|
|
54
|
-
action: "postback" | "url" | "say";
|
|
55
|
-
label: string;
|
|
56
|
-
}[];
|
|
57
|
-
imageUrl?: string | undefined;
|
|
58
|
-
subtitle?: string | undefined;
|
|
59
|
-
className?: string | undefined;
|
|
60
|
-
}[];
|
|
61
|
-
className?: string | undefined;
|
|
62
|
-
}) => {
|
|
63
|
-
type: "carousel";
|
|
64
|
-
items: {
|
|
65
|
-
type: "card";
|
|
66
|
-
title: string;
|
|
67
|
-
actions: ({
|
|
68
|
-
text: string;
|
|
69
|
-
title: string;
|
|
70
|
-
action: "Say something";
|
|
71
|
-
} | {
|
|
72
|
-
title: string;
|
|
73
|
-
action: "Open URL";
|
|
74
|
-
url: string;
|
|
75
|
-
} | {
|
|
76
|
-
title: string;
|
|
77
|
-
action: "Postback";
|
|
78
|
-
payload: string;
|
|
79
|
-
})[];
|
|
80
|
-
className?: string | undefined;
|
|
81
|
-
avatarUrl?: string | undefined;
|
|
82
|
-
subtitle?: string | undefined;
|
|
83
|
-
image?: string | undefined;
|
|
84
|
-
}[];
|
|
85
|
-
className?: string | undefined;
|
|
86
|
-
};
|
|
87
|
-
export declare const choiceAdapter: (x: {
|
|
88
|
-
type: "choice";
|
|
89
|
-
text: string;
|
|
90
|
-
options: {
|
|
91
|
-
value: string;
|
|
92
|
-
label: string;
|
|
93
|
-
}[];
|
|
94
|
-
disableFreeText?: boolean | undefined;
|
|
95
|
-
className?: string | undefined;
|
|
96
|
-
}) => {
|
|
97
|
-
type: "single-choice";
|
|
98
|
-
text: string;
|
|
99
|
-
choices: {
|
|
100
|
-
title: string;
|
|
101
|
-
value: string;
|
|
102
|
-
}[];
|
|
103
|
-
disableFreeText: boolean | undefined;
|
|
104
|
-
options: {
|
|
105
|
-
value: string;
|
|
106
|
-
label: string;
|
|
107
|
-
}[];
|
|
108
|
-
className?: string | undefined;
|
|
109
|
-
};
|
|
110
|
-
export declare const dropdownAdapter: (x: {
|
|
111
|
-
type: "dropdown";
|
|
112
|
-
text: string;
|
|
113
|
-
options: {
|
|
114
|
-
value: string;
|
|
115
|
-
label: string;
|
|
116
|
-
}[];
|
|
117
|
-
className?: string | undefined;
|
|
118
|
-
}) => {
|
|
119
|
-
type: "dropdown";
|
|
120
|
-
message: string;
|
|
121
|
-
options: {
|
|
122
|
-
label: string;
|
|
123
|
-
value: string;
|
|
124
|
-
}[];
|
|
125
|
-
text: string;
|
|
126
|
-
className?: string | undefined;
|
|
127
|
-
};
|
|
128
|
-
export declare const fileAdapter: (x: {
|
|
129
|
-
type: "file";
|
|
130
|
-
fileUrl: string;
|
|
131
|
-
title?: string | undefined;
|
|
132
|
-
className?: string | undefined;
|
|
133
|
-
}) => {
|
|
134
|
-
type: "file";
|
|
135
|
-
file: string;
|
|
136
|
-
title: string | undefined;
|
|
137
|
-
fileUrl: string;
|
|
138
|
-
className?: string | undefined;
|
|
139
|
-
};
|
|
140
|
-
export declare const imageAdapter: (x: {
|
|
141
|
-
type: "image";
|
|
142
|
-
imageUrl: string;
|
|
143
|
-
className?: string | undefined;
|
|
144
|
-
}) => {
|
|
145
|
-
type: "image";
|
|
146
|
-
image: string;
|
|
147
|
-
imageUrl: string;
|
|
148
|
-
className?: string | undefined;
|
|
149
|
-
};
|
|
150
|
-
export declare const locationAdapter: (x: {
|
|
151
|
-
type: "location";
|
|
152
|
-
latitude: number;
|
|
153
|
-
longitude: number;
|
|
154
|
-
title?: string | undefined;
|
|
155
|
-
address?: string | undefined;
|
|
156
|
-
className?: string | undefined;
|
|
157
|
-
}) => {
|
|
158
|
-
type: "location";
|
|
159
|
-
latitude: number;
|
|
160
|
-
longitude: number;
|
|
161
|
-
title?: string | undefined;
|
|
162
|
-
address?: string | undefined;
|
|
163
|
-
className?: string | undefined;
|
|
164
|
-
};
|
|
165
|
-
export declare const markdownAdapter: (x: {
|
|
166
|
-
type: "markdown";
|
|
167
|
-
markdown: string;
|
|
168
|
-
className?: string | undefined;
|
|
169
|
-
}) => {
|
|
170
|
-
type: "text";
|
|
171
|
-
text: string;
|
|
172
|
-
markdown: true;
|
|
173
|
-
className?: string | undefined;
|
|
174
|
-
};
|
|
175
|
-
export declare const textAdapter: (x: {
|
|
176
|
-
type: "text";
|
|
177
|
-
text: string;
|
|
178
|
-
className?: string | undefined;
|
|
179
|
-
}) => {
|
|
180
|
-
type: "text";
|
|
181
|
-
text: string;
|
|
182
|
-
markdown: true;
|
|
183
|
-
className?: string | undefined;
|
|
184
|
-
};
|
|
185
|
-
export declare const videoAdapter: (x: {
|
|
186
|
-
type: "video";
|
|
187
|
-
videoUrl: string;
|
|
188
|
-
className?: string | undefined;
|
|
189
|
-
}) => {
|
|
190
|
-
type: "video";
|
|
191
|
-
video: string;
|
|
192
|
-
videoUrl: string;
|
|
193
|
-
className?: string | undefined;
|
|
194
|
-
};
|
|
195
|
-
export declare const messageAdapter: (message: webchat.Message) => messaging.Message;
|
|
196
|
-
export declare const webchatVisibilityAdapter: (x: {
|
|
197
|
-
type: "webchat_visibility";
|
|
198
|
-
data: {
|
|
199
|
-
visibility: "show" | "hide" | "toggle";
|
|
200
|
-
};
|
|
201
|
-
}) => {
|
|
202
|
-
type: "webchat-visibility";
|
|
203
|
-
visibility: "show" | "hide" | "toggle";
|
|
204
|
-
};
|
|
205
|
-
export declare const webchatConfigAdapter: (x: {
|
|
206
|
-
type: "webchat_config";
|
|
207
|
-
data: {
|
|
208
|
-
config: Record<string, any>;
|
|
209
|
-
};
|
|
210
|
-
}) => {
|
|
211
|
-
type: "webchat-config";
|
|
212
|
-
config: Record<string, any>;
|
|
213
|
-
};
|
|
214
|
-
export declare const customAdapter: (x: {
|
|
215
|
-
type: "custom";
|
|
216
|
-
data: {
|
|
217
|
-
event: Record<string, any>;
|
|
218
|
-
};
|
|
219
|
-
}) => {
|
|
220
|
-
type: "custom-event";
|
|
221
|
-
event: Record<string, any>;
|
|
222
|
-
};
|
|
223
|
-
export declare const triggerAdapter: (trigger: webchat.Trigger) => messaging.Trigger;
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import * as target from '../target';
|
|
2
|
-
import * as webchat from '../webchat';
|
|
3
|
-
import * as types from '../typings';
|
|
4
|
-
export type WebchatToTargetAdapters = types.Adapter<webchat.Messages, target.AdaptersOutput>;
|
|
5
|
-
export declare const audioAdapter: (webchatMessage: {
|
|
6
|
-
type: "audio";
|
|
7
|
-
audioUrl: string;
|
|
8
|
-
className?: string | undefined;
|
|
9
|
-
}) => {
|
|
10
|
-
payload: {
|
|
11
|
-
type: "audio";
|
|
12
|
-
url: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const cardAdapter: (webchatMessage: {
|
|
16
|
-
type: "card";
|
|
17
|
-
title: string;
|
|
18
|
-
actions: {
|
|
19
|
-
value: string;
|
|
20
|
-
action: "postback" | "url" | "say";
|
|
21
|
-
label: string;
|
|
22
|
-
}[];
|
|
23
|
-
className?: string | undefined;
|
|
24
|
-
subtitle?: string | undefined;
|
|
25
|
-
imageUrl?: string | undefined;
|
|
26
|
-
}) => {
|
|
27
|
-
payload: Omit<target.BubbleMessage, "block"> & {
|
|
28
|
-
block: target.ColumnMessage;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare const carouselAdapter: (webchatMessage: {
|
|
32
|
-
type: "carousel";
|
|
33
|
-
items: {
|
|
34
|
-
title: string;
|
|
35
|
-
actions: {
|
|
36
|
-
value: string;
|
|
37
|
-
action: "postback" | "url" | "say";
|
|
38
|
-
label: string;
|
|
39
|
-
}[];
|
|
40
|
-
imageUrl?: string | undefined;
|
|
41
|
-
subtitle?: string | undefined;
|
|
42
|
-
className?: string | undefined;
|
|
43
|
-
}[];
|
|
44
|
-
className?: string | undefined;
|
|
45
|
-
}) => {
|
|
46
|
-
payload: {
|
|
47
|
-
type: "carousel";
|
|
48
|
-
blocks: target.ColumnMessage[];
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export declare const choiceAdapter: (webchatMessage: {
|
|
52
|
-
type: "choice";
|
|
53
|
-
text: string;
|
|
54
|
-
options: {
|
|
55
|
-
value: string;
|
|
56
|
-
label: string;
|
|
57
|
-
}[];
|
|
58
|
-
disableFreeText?: boolean | undefined;
|
|
59
|
-
className?: string | undefined;
|
|
60
|
-
}) => {
|
|
61
|
-
disableInput: boolean | undefined;
|
|
62
|
-
payload: target.Message;
|
|
63
|
-
};
|
|
64
|
-
export declare const dropdownAdapter: (webchatMessage: {
|
|
65
|
-
type: "dropdown";
|
|
66
|
-
text: string;
|
|
67
|
-
options: {
|
|
68
|
-
value: string;
|
|
69
|
-
label: string;
|
|
70
|
-
}[];
|
|
71
|
-
className?: string | undefined;
|
|
72
|
-
}) => {
|
|
73
|
-
disableInput: true;
|
|
74
|
-
payload: Omit<target.BubbleMessage, "block"> & {
|
|
75
|
-
block: target.ColumnMessage;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
export declare const fileAdapter: (webchatMessage: {
|
|
79
|
-
type: "file";
|
|
80
|
-
fileUrl: string;
|
|
81
|
-
title?: string | undefined;
|
|
82
|
-
className?: string | undefined;
|
|
83
|
-
}) => {
|
|
84
|
-
payload: {
|
|
85
|
-
type: "file";
|
|
86
|
-
className?: string | undefined;
|
|
87
|
-
avatarUrl?: string | undefined;
|
|
88
|
-
title?: string | undefined;
|
|
89
|
-
url: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export declare const imageAdapter: (webchatMessage: {
|
|
93
|
-
type: "image";
|
|
94
|
-
imageUrl: string;
|
|
95
|
-
className?: string | undefined;
|
|
96
|
-
}) => {
|
|
97
|
-
payload: {
|
|
98
|
-
type: "image";
|
|
99
|
-
url: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
export declare const locationAdapter: (webchatMessage: {
|
|
103
|
-
type: "location";
|
|
104
|
-
latitude: number;
|
|
105
|
-
longitude: number;
|
|
106
|
-
title?: string | undefined;
|
|
107
|
-
address?: string | undefined;
|
|
108
|
-
className?: string | undefined;
|
|
109
|
-
}) => {
|
|
110
|
-
payload: {
|
|
111
|
-
type: "location";
|
|
112
|
-
latitude: number;
|
|
113
|
-
longitude: number;
|
|
114
|
-
title: string;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
export declare const markdownAdapter: (webchatMessage: {
|
|
118
|
-
type: "markdown";
|
|
119
|
-
markdown: string;
|
|
120
|
-
className?: string | undefined;
|
|
121
|
-
}) => {
|
|
122
|
-
payload: Omit<target.BubbleMessage, "block"> & {
|
|
123
|
-
block: {
|
|
124
|
-
type: "text";
|
|
125
|
-
text: string;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
export declare const textAdapter: (webchatMessage: {
|
|
130
|
-
type: "text";
|
|
131
|
-
text: string;
|
|
132
|
-
className?: string | undefined;
|
|
133
|
-
}) => {
|
|
134
|
-
payload: Omit<target.BubbleMessage, "block"> & {
|
|
135
|
-
block: {
|
|
136
|
-
type: "text";
|
|
137
|
-
text: string;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
export declare const videoAdapter: (webchatMessage: {
|
|
142
|
-
type: "video";
|
|
143
|
-
videoUrl: string;
|
|
144
|
-
className?: string | undefined;
|
|
145
|
-
}) => {
|
|
146
|
-
payload: {
|
|
147
|
-
type: "video";
|
|
148
|
-
url: string;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
export declare const blocAdapter: (webchatMessage: {
|
|
152
|
-
type: "bloc";
|
|
153
|
-
items: ({
|
|
154
|
-
type: "text";
|
|
155
|
-
payload: {
|
|
156
|
-
text: string;
|
|
157
|
-
};
|
|
158
|
-
} | {
|
|
159
|
-
type: "markdown";
|
|
160
|
-
payload: {
|
|
161
|
-
markdown: string;
|
|
162
|
-
};
|
|
163
|
-
} | {
|
|
164
|
-
type: "image";
|
|
165
|
-
payload: {
|
|
166
|
-
imageUrl: string;
|
|
167
|
-
};
|
|
168
|
-
} | {
|
|
169
|
-
type: "audio";
|
|
170
|
-
payload: {
|
|
171
|
-
audioUrl: string;
|
|
172
|
-
};
|
|
173
|
-
} | {
|
|
174
|
-
type: "video";
|
|
175
|
-
payload: {
|
|
176
|
-
videoUrl: string;
|
|
177
|
-
};
|
|
178
|
-
} | {
|
|
179
|
-
type: "file";
|
|
180
|
-
payload: {
|
|
181
|
-
fileUrl: string;
|
|
182
|
-
title?: string | undefined;
|
|
183
|
-
};
|
|
184
|
-
} | {
|
|
185
|
-
type: "location";
|
|
186
|
-
payload: {
|
|
187
|
-
latitude: number;
|
|
188
|
-
longitude: number;
|
|
189
|
-
address?: string | undefined;
|
|
190
|
-
title?: string | undefined;
|
|
191
|
-
};
|
|
192
|
-
})[];
|
|
193
|
-
className?: string | undefined;
|
|
194
|
-
}) => {
|
|
195
|
-
payload: target.ColumnMessage;
|
|
196
|
-
};
|
|
197
|
-
export declare const messageAdapter: (message: webchat.Message) => target.AdapterOutput;
|