@botonic/shared 2.26.0 → 2.28.0
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/CHANGELOG.md +25 -2
- package/README.md +9 -0
- package/package.json +1 -2
- package/src/lib/domain/botonic/index.d.ts +5 -4
- package/src/lib/domain/botonic/index.js +5 -4
- package/src/lib/domain/botonic/index.js.map +1 -1
- package/src/lib/domain/botonic/outputs.d.ts +11 -4
- package/src/lib/domain/botonic/outputs.js +7 -1
- package/src/lib/domain/botonic/outputs.js.map +1 -1
- package/src/lib/domain/botonic/session.d.ts +63 -0
- package/src/lib/domain/botonic/session.js +2 -0
- package/src/lib/domain/botonic/session.js.map +1 -0
- package/src/lib/domain/botonic/settings.d.ts +18 -0
- package/src/lib/domain/botonic/settings.js +2 -0
- package/src/lib/domain/botonic/settings.js.map +1 -0
- package/src/lib/domain/botonic/types.d.ts +8 -3
- package/src/lib/domain/botonic/types.js +8 -1
- package/src/lib/domain/botonic/types.js.map +1 -1
- package/src/lib/domain/botonic/webchat-client-settings.d.ts +22 -0
- package/src/lib/domain/botonic/webchat-client-settings.js +29 -0
- package/src/lib/domain/botonic/webchat-client-settings.js.map +1 -0
- package/src/lib/domain/botonic/webviews-session.d.ts +20 -0
- package/src/lib/domain/botonic/webviews-session.js +2 -0
- package/src/lib/domain/botonic/webviews-session.js.map +1 -0
- package/src/lib/domain/botonic/whatsapp-outputs/whatsapp-button-list/index.d.ts +1 -1
- package/src/lib/domain/index.d.ts +1 -2
- package/src/lib/domain/index.js +1 -4
- package/src/lib/domain/index.js.map +1 -1
- package/src/lib/hubtype-analytics-types.d.ts +2 -2
- package/src/lib/index.d.ts +3 -3
- package/src/lib/index.js +6 -6
- package/src/lib/index.js.map +1 -1
- package/src/lib/services/handoff.d.ts +18 -0
- package/src/lib/services/handoff.js +23 -0
- package/src/lib/services/handoff.js.map +1 -0
- package/src/lib/services/index.d.ts +2 -0
- package/src/lib/services/index.js +3 -0
- package/src/lib/services/index.js.map +1 -0
- package/src/lib/services/webchat-api.d.ts +8 -5
- package/src/lib/domain/botonic/legacy/index.d.ts +0 -2
- package/src/lib/domain/botonic/legacy/index.js +0 -3
- package/src/lib/domain/botonic/legacy/index.js.map +0 -1
- package/src/lib/domain/botonic/legacy/input-adapter.d.ts +0 -25
- package/src/lib/domain/botonic/legacy/input-adapter.js +0 -203
- package/src/lib/domain/botonic/legacy/input-adapter.js.map +0 -1
- package/src/lib/domain/botonic/legacy/types.d.ts +0 -32
- package/src/lib/domain/botonic/legacy/types.js +0 -2
- package/src/lib/domain/botonic/legacy/types.js.map +0 -1
- package/src/lib/domain/server/bot-server-message.d.ts +0 -65
- package/src/lib/domain/server/bot-server-message.js +0 -106
- package/src/lib/domain/server/bot-server-message.js.map +0 -1
- package/src/lib/domain/server/botonic-context/botonic-context-input.d.ts +0 -99
- package/src/lib/domain/server/botonic-context/botonic-context-input.js +0 -124
- package/src/lib/domain/server/botonic-context/botonic-context-input.js.map +0 -1
- package/src/lib/domain/server/botonic-context/botonic-context-session.d.ts +0 -146
- package/src/lib/domain/server/botonic-context/botonic-context-session.js +0 -209
- package/src/lib/domain/server/botonic-context/botonic-context-session.js.map +0 -1
- package/src/lib/domain/server/botonic-context/botonic-context.d.ts +0 -56
- package/src/lib/domain/server/botonic-context/botonic-context.js +0 -23
- package/src/lib/domain/server/botonic-context/botonic-context.js.map +0 -1
- package/src/lib/domain/server/botonic-context/factory.d.ts +0 -23
- package/src/lib/domain/server/botonic-context/factory.js +0 -31
- package/src/lib/domain/server/botonic-context/factory.js.map +0 -1
- package/src/lib/domain/server/botonic-context/index.d.ts +0 -5
- package/src/lib/domain/server/botonic-context/index.js +0 -6
- package/src/lib/domain/server/botonic-context/index.js.map +0 -1
- package/src/lib/domain/server/botonic-context/types.d.ts +0 -20
- package/src/lib/domain/server/botonic-context/types.js +0 -6
- package/src/lib/domain/server/botonic-context/types.js.map +0 -1
- package/src/lib/domain/server/factory.d.ts +0 -166
- package/src/lib/domain/server/factory.js +0 -166
- package/src/lib/domain/server/factory.js.map +0 -1
- package/src/lib/domain/server/index.d.ts +0 -3
- package/src/lib/domain/server/index.js +0 -4
- package/src/lib/domain/server/index.js.map +0 -1
- package/src/lib/domain/webchat/factory.d.ts +0 -81
- package/src/lib/domain/webchat/factory.js +0 -73
- package/src/lib/domain/webchat/factory.js.map +0 -1
- package/src/lib/domain/webchat/index.d.ts +0 -4
- package/src/lib/domain/webchat/index.js +0 -5
- package/src/lib/domain/webchat/index.js.map +0 -1
- package/src/lib/domain/webchat/realtime/factory.d.ts +0 -52
- package/src/lib/domain/webchat/realtime/factory.js +0 -66
- package/src/lib/domain/webchat/realtime/factory.js.map +0 -1
- package/src/lib/domain/webchat/realtime/index.d.ts +0 -2
- package/src/lib/domain/webchat/realtime/index.js +0 -3
- package/src/lib/domain/webchat/realtime/index.js.map +0 -1
- package/src/lib/domain/webchat/realtime/realtime-response-message.d.ts +0 -47
- package/src/lib/domain/webchat/realtime/realtime-response-message.js +0 -68
- package/src/lib/domain/webchat/realtime/realtime-response-message.js.map +0 -1
- package/src/lib/domain/webchat/user/factory.d.ts +0 -52
- package/src/lib/domain/webchat/user/factory.js +0 -59
- package/src/lib/domain/webchat/user/factory.js.map +0 -1
- package/src/lib/domain/webchat/user/index.d.ts +0 -2
- package/src/lib/domain/webchat/user/index.js +0 -3
- package/src/lib/domain/webchat/user/index.js.map +0 -1
- package/src/lib/domain/webchat/user/user-input-message.d.ts +0 -34
- package/src/lib/domain/webchat/user/user-input-message.js +0 -59
- package/src/lib/domain/webchat/user/user-input-message.js.map +0 -1
- package/src/lib/domain/webchat/webchat-message.d.ts +0 -55
- package/src/lib/domain/webchat/webchat-message.js +0 -69
- package/src/lib/domain/webchat/webchat-message.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/legacy/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter: convert RequestInputLegacy (ImpMsg flat) → RequestInputV2 (v2 BotonicInput).
|
|
3
|
-
* normalizeToV2Input is used inside CoreBot.input(); not exported to handlers.
|
|
4
|
-
* Constructs inputs using BotonicInput* and *Data classes where supported.
|
|
5
|
-
* Aligns with RequestInputLegacy (legacy) vs RequestInputV2 (v2) format: flat fields → nested data,
|
|
6
|
-
* message_id → provider_id, attachment_data → attachment_content, empty strings → null where specified.
|
|
7
|
-
*/
|
|
8
|
-
import type { RequestInputV2 } from '../../server/botonic-context/botonic-context-input';
|
|
9
|
-
import { RequestInputLegacy } from './types';
|
|
10
|
-
/**
|
|
11
|
-
* Returns true if the payload looks like InputLegacy (flat data string, payload at top level)
|
|
12
|
-
* rather than Input (nested data object).
|
|
13
|
-
*/
|
|
14
|
-
export declare function isInputLegacy(payload: unknown): payload is RequestInputLegacy;
|
|
15
|
-
/**
|
|
16
|
-
* Converts InputLegacy to Input (v2) for the pipeline.
|
|
17
|
-
* Used at lambda handler level so CoreBot always receives Input.
|
|
18
|
-
*/
|
|
19
|
-
export declare function legacyInputToInput(legacy: RequestInputLegacy): RequestInputV2;
|
|
20
|
-
/**
|
|
21
|
-
* Normalizes request input to RequestInputV2.
|
|
22
|
-
* If legacy shape, converts with legacyInputToInput; otherwise returns as RequestInputV2.
|
|
23
|
-
* Used inside CoreBot.input(); not exposed to handlers.
|
|
24
|
-
*/
|
|
25
|
-
export declare function normalizeToV2Input(requestInput: RequestInputLegacy | RequestInputV2): RequestInputV2;
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter: convert RequestInputLegacy (ImpMsg flat) → RequestInputV2 (v2 BotonicInput).
|
|
3
|
-
* normalizeToV2Input is used inside CoreBot.input(); not exported to handlers.
|
|
4
|
-
* Constructs inputs using BotonicInput* and *Data classes where supported.
|
|
5
|
-
* Aligns with RequestInputLegacy (legacy) vs RequestInputV2 (v2) format: flat fields → nested data,
|
|
6
|
-
* message_id → provider_id, attachment_data → attachment_content, empty strings → null where specified.
|
|
7
|
-
*/
|
|
8
|
-
import { InputType } from '../../server/botonic-context/botonic-context-input';
|
|
9
|
-
import { BotonicInputAudio, BotonicInputContact, BotonicInputDocument, BotonicInputImage, BotonicInputLocation, BotonicInputPostback, BotonicInputText, BotonicInputTypingEvent, BotonicInputVideo, } from '../inputs';
|
|
10
|
-
import { BotonicAudioData, BotonicContactData, BotonicCustomData, BotonicDocumentData, BotonicImageData, BotonicLocationData, BotonicPostbackData, BotonicTextData, BotonicTypingEventData, BotonicVideoData, MessageType, TypingEventName, } from '../types';
|
|
11
|
-
function buildBase(legacy) {
|
|
12
|
-
var _a, _b, _c, _d;
|
|
13
|
-
return Object.assign(Object.assign(Object.assign({ message_id: (_a = legacy.message_id) !== null && _a !== void 0 ? _a : '', conversation_id: (_b = legacy.conversation_id) !== null && _b !== void 0 ? _b : '', bot_interaction_id: (_c = legacy.bot_interaction_id) !== null && _c !== void 0 ? _c : '', provider_id: (_d = legacy.message_id) !== null && _d !== void 0 ? _d : '' }, (legacy.sent_by != null && { sent_by: legacy.sent_by })), (legacy.context && { context: legacy.context })), (legacy.nluResolution && { nluResolution: legacy.nluResolution }));
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns true if the payload looks like InputLegacy (flat data string, payload at top level)
|
|
17
|
-
* rather than Input (nested data object).
|
|
18
|
-
*/
|
|
19
|
-
export function isInputLegacy(payload) {
|
|
20
|
-
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
const p = payload;
|
|
24
|
-
if (typeof p.type !== 'string')
|
|
25
|
-
return true;
|
|
26
|
-
// Input has data as object; InputLegacy has data as string or undefined
|
|
27
|
-
if (p.data !== undefined && typeof p.data === 'object' && p.data !== null) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
// ---------------------------------------------------------------------------
|
|
33
|
-
// Legacy → Input conversion helpers (one per type)
|
|
34
|
-
// ---------------------------------------------------------------------------
|
|
35
|
-
function legacyTextToInput(base, legacy) {
|
|
36
|
-
var _a;
|
|
37
|
-
const text = (_a = legacy.text) !== null && _a !== void 0 ? _a : legacy.data;
|
|
38
|
-
const payload = legacy.payload;
|
|
39
|
-
const textData = new BotonicTextData(typeof text === 'string' ? text : String(text !== null && text !== void 0 ? text : ''), payload != null ? String(payload) : undefined);
|
|
40
|
-
const input = new BotonicInputText(textData);
|
|
41
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
42
|
-
}
|
|
43
|
-
function legacyPostbackToInput(base, legacy) {
|
|
44
|
-
const payload = legacy.payload;
|
|
45
|
-
const referral = legacy.referral;
|
|
46
|
-
// Per spec: null payload in legacy becomes empty string in v2.
|
|
47
|
-
const payloadStr = payload != null ? String(payload) : '';
|
|
48
|
-
const postbackData = new BotonicPostbackData(payloadStr, referral != null ? String(referral) : undefined);
|
|
49
|
-
const input = new BotonicInputPostback(postbackData);
|
|
50
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
51
|
-
}
|
|
52
|
-
function legacyImageToInput(base, legacy) {
|
|
53
|
-
return legacyAttachmentToInput(base, InputType.Image, legacy);
|
|
54
|
-
}
|
|
55
|
-
function legacyAudioToInput(base, legacy) {
|
|
56
|
-
return legacyAttachmentToInput(base, InputType.Audio, legacy);
|
|
57
|
-
}
|
|
58
|
-
function legacyVideoToInput(base, legacy) {
|
|
59
|
-
return legacyAttachmentToInput(base, InputType.Video, legacy);
|
|
60
|
-
}
|
|
61
|
-
function legacyDocumentToInput(base, legacy) {
|
|
62
|
-
return legacyAttachmentToInput(base, InputType.Document, legacy);
|
|
63
|
-
}
|
|
64
|
-
const ATTACHMENT_LEGACY_TO_INPUT = {
|
|
65
|
-
[InputType.Image]: { InputCls: BotonicInputImage, DataCls: BotonicImageData },
|
|
66
|
-
[InputType.Audio]: { InputCls: BotonicInputAudio, DataCls: BotonicAudioData },
|
|
67
|
-
[InputType.Video]: { InputCls: BotonicInputVideo, DataCls: BotonicVideoData },
|
|
68
|
-
[InputType.Document]: {
|
|
69
|
-
InputCls: BotonicInputDocument,
|
|
70
|
-
DataCls: BotonicDocumentData,
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Media types: legacy attachment_url / data (URL string) and attachment_data (base64) map to
|
|
75
|
-
* v2 attachment_url / attachment_content; attachment_data renamed to attachment_content. Caption optional.
|
|
76
|
-
*/
|
|
77
|
-
function legacyAttachmentToInput(base, legacyType, legacy) {
|
|
78
|
-
var _a;
|
|
79
|
-
const attachmentUrl = (_a = legacy.attachment_url) !== null && _a !== void 0 ? _a : (typeof legacy.data === 'string' && !legacy.attachment_data
|
|
80
|
-
? legacy.data
|
|
81
|
-
: undefined);
|
|
82
|
-
const attachmentContent = typeof legacy.attachment_data === 'string'
|
|
83
|
-
? legacy.attachment_data
|
|
84
|
-
: undefined;
|
|
85
|
-
const caption = legacy.caption;
|
|
86
|
-
if (attachmentUrl !== undefined || attachmentContent !== undefined) {
|
|
87
|
-
const { InputCls, DataCls } = ATTACHMENT_LEGACY_TO_INPUT[legacyType];
|
|
88
|
-
const input = new InputCls(new DataCls(attachmentUrl, attachmentContent, caption));
|
|
89
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
90
|
-
}
|
|
91
|
-
return Object.assign(Object.assign({}, base), { type: legacyType, data: Object.assign({ attachment_url: undefined, attachment_content: undefined }, (caption != null && { caption })) });
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Location: legacy latitude/longitude (or "lat,lng" in data). Per spec: empty/whitespace title and url → null.
|
|
95
|
-
*/
|
|
96
|
-
function legacyLocationToInput(base, legacy) {
|
|
97
|
-
let lat;
|
|
98
|
-
let lng;
|
|
99
|
-
if (typeof legacy.latitude === 'number' &&
|
|
100
|
-
typeof legacy.longitude === 'number') {
|
|
101
|
-
lat = legacy.latitude;
|
|
102
|
-
lng = legacy.longitude;
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
const data = legacy.data;
|
|
106
|
-
const parts = typeof data === 'string' ? data.split(',') : [];
|
|
107
|
-
lat = Number.parseFloat(parts[0]);
|
|
108
|
-
lng = Number.parseFloat(parts[1]);
|
|
109
|
-
}
|
|
110
|
-
const locationData = new BotonicLocationData(Number.isFinite(lat) ? lat : 0, Number.isFinite(lng) ? lng : 0, legacy.title, legacy.address, legacy.url);
|
|
111
|
-
const input = new BotonicInputLocation(locationData);
|
|
112
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
113
|
-
}
|
|
114
|
-
function legacyCustomToInput(base, legacy) {
|
|
115
|
-
const data = legacy.data;
|
|
116
|
-
try {
|
|
117
|
-
const parsed = typeof data === 'string' ? JSON.parse(data) : {};
|
|
118
|
-
const customData = new BotonicCustomData('custom', parsed);
|
|
119
|
-
return Object.assign(Object.assign({}, base), { type: MessageType.Custom, data: customData });
|
|
120
|
-
}
|
|
121
|
-
catch (_a) {
|
|
122
|
-
const customData = new BotonicCustomData('custom', { raw: data });
|
|
123
|
-
return Object.assign(Object.assign({}, base), { type: MessageType.Custom, data: customData });
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Contact: per spec empty strings for last_name and phone_number → null.
|
|
128
|
-
*/
|
|
129
|
-
function legacyContactToInput(base, legacy) {
|
|
130
|
-
const firstName = typeof legacy.first_name === 'string' ? legacy.first_name : '';
|
|
131
|
-
const contactData = new BotonicContactData(firstName, legacy.last_name, legacy.phone_number, legacy.vcard);
|
|
132
|
-
const input = new BotonicInputContact(contactData);
|
|
133
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Typing: ImpMsgStartTyping → typing_on, ImpMsgSendPaused → typing_off.
|
|
137
|
-
* Legacy type Event with data string "typing_off"/"typing_on" also supported.
|
|
138
|
-
*/
|
|
139
|
-
function legacyEventToInput(base, legacy, eventName) {
|
|
140
|
-
const resolved = eventName !== null && eventName !== void 0 ? eventName : (typeof legacy.data === 'string' &&
|
|
141
|
-
legacy.data === TypingEventName.TypingOff
|
|
142
|
-
? TypingEventName.TypingOff
|
|
143
|
-
: TypingEventName.TypingOn);
|
|
144
|
-
const typingData = new BotonicTypingEventData(resolved);
|
|
145
|
-
const input = new BotonicInputTypingEvent(typingData);
|
|
146
|
-
return Object.assign(Object.assign({}, base), { type: input.type, data: input.data });
|
|
147
|
-
}
|
|
148
|
-
function legacyDefaultToInput(base, legacy) {
|
|
149
|
-
var _a;
|
|
150
|
-
const data = legacy.data;
|
|
151
|
-
// TODO: use BotonicInputText for fallback when default branch is normalized to a class-based path
|
|
152
|
-
return Object.assign(Object.assign({}, base), { type: (_a = legacy.type) !== null && _a !== void 0 ? _a : MessageType.Text, data: { text: typeof data === 'string' ? data : String(data !== null && data !== void 0 ? data : '') } });
|
|
153
|
-
}
|
|
154
|
-
// ---------------------------------------------------------------------------
|
|
155
|
-
// Main adapter
|
|
156
|
-
// ---------------------------------------------------------------------------
|
|
157
|
-
/**
|
|
158
|
-
* Converts InputLegacy to Input (v2) for the pipeline.
|
|
159
|
-
* Used at lambda handler level so CoreBot always receives Input.
|
|
160
|
-
*/
|
|
161
|
-
export function legacyInputToInput(legacy) {
|
|
162
|
-
const base = buildBase(legacy);
|
|
163
|
-
switch (legacy.type) {
|
|
164
|
-
case InputType.Text:
|
|
165
|
-
return legacyTextToInput(base, legacy);
|
|
166
|
-
case InputType.Postback:
|
|
167
|
-
return legacyPostbackToInput(base, legacy);
|
|
168
|
-
case InputType.Image:
|
|
169
|
-
return legacyImageToInput(base, legacy);
|
|
170
|
-
case InputType.Audio:
|
|
171
|
-
return legacyAudioToInput(base, legacy);
|
|
172
|
-
case InputType.Video:
|
|
173
|
-
return legacyVideoToInput(base, legacy);
|
|
174
|
-
case InputType.Document:
|
|
175
|
-
return legacyDocumentToInput(base, legacy);
|
|
176
|
-
case InputType.Location:
|
|
177
|
-
return legacyLocationToInput(base, legacy);
|
|
178
|
-
case InputType.Contact:
|
|
179
|
-
return legacyContactToInput(base, legacy);
|
|
180
|
-
case InputType.Custom:
|
|
181
|
-
return legacyCustomToInput(base, legacy);
|
|
182
|
-
case InputType.Event:
|
|
183
|
-
return legacyEventToInput(base, legacy);
|
|
184
|
-
case InputType.StartTyping:
|
|
185
|
-
return legacyEventToInput(base, legacy, TypingEventName.TypingOn);
|
|
186
|
-
case InputType.SendPaused:
|
|
187
|
-
return legacyEventToInput(base, legacy, TypingEventName.TypingOff);
|
|
188
|
-
default:
|
|
189
|
-
return legacyDefaultToInput(base, legacy);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Normalizes request input to RequestInputV2.
|
|
194
|
-
* If legacy shape, converts with legacyInputToInput; otherwise returns as RequestInputV2.
|
|
195
|
-
* Used inside CoreBot.input(); not exposed to handlers.
|
|
196
|
-
*/
|
|
197
|
-
export function normalizeToV2Input(requestInput) {
|
|
198
|
-
if (isInputLegacy(requestInput)) {
|
|
199
|
-
return legacyInputToInput(requestInput);
|
|
200
|
-
}
|
|
201
|
-
return requestInput;
|
|
202
|
-
}
|
|
203
|
-
//# sourceMappingURL=input-adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-adapter.js","sourceRoot":"","sources":["../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/legacy/input-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAA;AAC9E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,E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AqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAC5C,KAAK,SAAS,CAAC,QAAQ;YACrB,OAAO,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAC5C,KAAK,SAAS,CAAC,OAAO;YACpB,OAAO,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAC3C,KAAK,SAAS,CAAC,MAAM;YACnB,OAAO,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAC1C,KAAK,SAAS,CAAC,KAAK;YAClB,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACzC,KAAK,SAAS,CAAC,WAAW;YACxB,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;QACnE,KAAK,SAAS,CAAC,UAAU;YACvB,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;QACpE;YACE,OAAO,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC7C,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,YAAiD;IAEjD,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,YAA8B,CAAA;AACvC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { InputContext, InputType, NluResolution, SentBy } from '../../server/botonic-context/botonic-context-input';
|
|
2
|
-
export interface RequestInputLegacy {
|
|
3
|
-
src?: string;
|
|
4
|
-
/** Older shape: single string (e.g. text content, "lat,lng", or attachment URL). */
|
|
5
|
-
data?: string;
|
|
6
|
-
payload?: string;
|
|
7
|
-
referral?: string;
|
|
8
|
-
type: InputType;
|
|
9
|
-
message_id?: string;
|
|
10
|
-
sent_by?: SentBy;
|
|
11
|
-
nluResolution?: NluResolution;
|
|
12
|
-
bot_interaction_id?: string;
|
|
13
|
-
conversation_id?: string;
|
|
14
|
-
context?: InputContext;
|
|
15
|
-
/** Text message (ImpMsgText). */
|
|
16
|
-
text?: string;
|
|
17
|
-
/** Media: attachment_url or attachment_data (ImpMsgImage/Audio/Video/Document). */
|
|
18
|
-
attachment_url?: string;
|
|
19
|
-
attachment_data?: string;
|
|
20
|
-
caption?: string;
|
|
21
|
-
/** Location (ImpMsgLocation). */
|
|
22
|
-
latitude?: number;
|
|
23
|
-
longitude?: number;
|
|
24
|
-
title?: string;
|
|
25
|
-
address?: string;
|
|
26
|
-
url?: string;
|
|
27
|
-
/** Contact (ImpMsgContact). */
|
|
28
|
-
first_name?: string;
|
|
29
|
-
last_name?: string;
|
|
30
|
-
phone_number?: string;
|
|
31
|
-
vcard?: string;
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../../libs/botonic/shared/src/lib/domain/botonic/legacy/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { BotMessageMetadata, BotonicButtonMessageData, BotonicCarouselData, BotonicCustomData, BotonicLocationData, BotonicTextData, BotonicTypingEventData, BotonicWhatsappButtonListData, BotonicWhatsappCatalogData, BotonicWhatsappCTAUrlButtonData, BotonicWhatsappMediaCarouselData, BotonicWhatsappProductCarouselData, BotonicWhatsappProductData, BotonicWhatsappProductListData, BotonicWhatsappTemplateData, MessageType, OutputMessageType, OutputMessageTypeMap } from '../botonic';
|
|
2
|
-
import { BotonicOutput, BotonicOutputAudioData, BotonicOutputDocumentData, BotonicOutputImageData, BotonicOutputVideoData } from '../botonic/outputs';
|
|
3
|
-
export declare abstract class BotServerMessage<T extends OutputMessageType = OutputMessageType> extends BotonicOutput<T> implements BotMessageMetadata {
|
|
4
|
-
readonly bot_interaction_id?: string;
|
|
5
|
-
readonly feedback_enabled?: boolean;
|
|
6
|
-
readonly inference_id?: string;
|
|
7
|
-
readonly typing?: number;
|
|
8
|
-
readonly delay?: number;
|
|
9
|
-
constructor(type: T, data: OutputMessageTypeMap[T], metadata?: BotMessageMetadata);
|
|
10
|
-
}
|
|
11
|
-
export declare class BotServerMessageText extends BotServerMessage<MessageType.Text> {
|
|
12
|
-
constructor(data: BotonicTextData, metadata?: BotMessageMetadata);
|
|
13
|
-
}
|
|
14
|
-
export declare class BotServerMessageAudio extends BotServerMessage<MessageType.Audio> {
|
|
15
|
-
constructor(data: BotonicOutputAudioData, metadata?: BotMessageMetadata);
|
|
16
|
-
}
|
|
17
|
-
export declare class BotServerMessageImage extends BotServerMessage<MessageType.Image> {
|
|
18
|
-
constructor(data: BotonicOutputImageData, metadata?: BotMessageMetadata);
|
|
19
|
-
}
|
|
20
|
-
export declare class BotServerMessageVideo extends BotServerMessage<MessageType.Video> {
|
|
21
|
-
constructor(data: BotonicOutputVideoData, metadata?: BotMessageMetadata);
|
|
22
|
-
}
|
|
23
|
-
export declare class BotServerMessageDocument extends BotServerMessage<MessageType.Document> {
|
|
24
|
-
constructor(data: BotonicOutputDocumentData, metadata?: BotMessageMetadata);
|
|
25
|
-
}
|
|
26
|
-
export declare class BotServerMessageLocation extends BotServerMessage<MessageType.Location> {
|
|
27
|
-
constructor(data: BotonicLocationData, metadata?: BotMessageMetadata);
|
|
28
|
-
}
|
|
29
|
-
export declare class BotServerMessageButtonMessage extends BotServerMessage<MessageType.ButtonMessage> {
|
|
30
|
-
constructor(data: BotonicButtonMessageData, metadata?: BotMessageMetadata);
|
|
31
|
-
}
|
|
32
|
-
export declare class BotServerMessageCarousel extends BotServerMessage<MessageType.Carousel> {
|
|
33
|
-
constructor(data: BotonicCarouselData, metadata?: BotMessageMetadata);
|
|
34
|
-
}
|
|
35
|
-
export declare class BotServerMessageCustom extends BotServerMessage<MessageType.Custom> {
|
|
36
|
-
constructor(data: BotonicCustomData, metadata?: BotMessageMetadata);
|
|
37
|
-
}
|
|
38
|
-
export declare class BotServerMessageTypingEvent extends BotServerMessage<MessageType.TypingEvent> {
|
|
39
|
-
constructor(data: BotonicTypingEventData, metadata?: BotMessageMetadata);
|
|
40
|
-
}
|
|
41
|
-
export declare class BotServerMessageWhatsappButtonList extends BotServerMessage<MessageType.WhatsappButtonList> {
|
|
42
|
-
constructor(data: BotonicWhatsappButtonListData, metadata?: BotMessageMetadata);
|
|
43
|
-
}
|
|
44
|
-
export declare class BotServerMessageWhatsappCTAUrlButton extends BotServerMessage<MessageType.WhatsappCTAUrlButton> {
|
|
45
|
-
constructor(data: BotonicWhatsappCTAUrlButtonData, metadata?: BotMessageMetadata);
|
|
46
|
-
}
|
|
47
|
-
export declare class BotServerMessageWhatsappCatalog extends BotServerMessage<MessageType.WhatsappCatalog> {
|
|
48
|
-
constructor(data: BotonicWhatsappCatalogData, metadata?: BotMessageMetadata);
|
|
49
|
-
}
|
|
50
|
-
export declare class BotServerMessageWhatsappProduct extends BotServerMessage<MessageType.WhatsappProduct> {
|
|
51
|
-
constructor(data: BotonicWhatsappProductData, metadata?: BotMessageMetadata);
|
|
52
|
-
}
|
|
53
|
-
export declare class BotServerMessageWhatsappProductList extends BotServerMessage<MessageType.WhatsappProductList> {
|
|
54
|
-
constructor(data: BotonicWhatsappProductListData, metadata?: BotMessageMetadata);
|
|
55
|
-
}
|
|
56
|
-
export declare class BotServerMessageWhatsappProductCarousel extends BotServerMessage<MessageType.WhatsappProductCarousel> {
|
|
57
|
-
constructor(data: BotonicWhatsappProductCarouselData, metadata?: BotMessageMetadata);
|
|
58
|
-
}
|
|
59
|
-
export declare class BotServerMessageWhatsappMediaCarousel extends BotServerMessage<MessageType.WhatsappMediaCarousel> {
|
|
60
|
-
constructor(data: BotonicWhatsappMediaCarouselData, metadata?: BotMessageMetadata);
|
|
61
|
-
}
|
|
62
|
-
export declare class BotServerMessageWhatsappTemplate extends BotServerMessage<MessageType.WhatsappTemplate> {
|
|
63
|
-
constructor(data: BotonicWhatsappTemplateData, metadata?: BotMessageMetadata);
|
|
64
|
-
}
|
|
65
|
-
export type BotServerMessageType = BotServerMessageText | BotServerMessageAudio | BotServerMessageImage | BotServerMessageVideo | BotServerMessageDocument | BotServerMessageLocation | BotServerMessageButtonMessage | BotServerMessageCarousel | BotServerMessageCustom | BotServerMessageTypingEvent | BotServerMessageWhatsappButtonList | BotServerMessageWhatsappCTAUrlButton | BotServerMessageWhatsappCatalog | BotServerMessageWhatsappProduct | BotServerMessageWhatsappProductList | BotServerMessageWhatsappProductCarousel | BotServerMessageWhatsappMediaCarousel | BotServerMessageWhatsappTemplate;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { MessageType, } from '../botonic';
|
|
2
|
-
import { BotonicOutput, } from '../botonic/outputs';
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// BOT SERVER MESSAGE (extends Output + adds bot-specific metadata)
|
|
5
|
-
// ============================================================================
|
|
6
|
-
export class BotServerMessage extends BotonicOutput {
|
|
7
|
-
constructor(type, data, metadata = {}) {
|
|
8
|
-
super(type, data);
|
|
9
|
-
this.bot_interaction_id = metadata.bot_interaction_id;
|
|
10
|
-
this.feedback_enabled = metadata.feedback_enabled;
|
|
11
|
-
this.inference_id = metadata.inference_id;
|
|
12
|
-
this.typing = metadata.typing;
|
|
13
|
-
this.delay = metadata.delay;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export class BotServerMessageText extends BotServerMessage {
|
|
17
|
-
constructor(data, metadata = {}) {
|
|
18
|
-
super(MessageType.Text, data, metadata);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export class BotServerMessageAudio extends BotServerMessage {
|
|
22
|
-
constructor(data, metadata = {}) {
|
|
23
|
-
super(MessageType.Audio, data, metadata);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class BotServerMessageImage extends BotServerMessage {
|
|
27
|
-
constructor(data, metadata = {}) {
|
|
28
|
-
super(MessageType.Image, data, metadata);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export class BotServerMessageVideo extends BotServerMessage {
|
|
32
|
-
constructor(data, metadata = {}) {
|
|
33
|
-
super(MessageType.Video, data, metadata);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class BotServerMessageDocument extends BotServerMessage {
|
|
37
|
-
constructor(data, metadata = {}) {
|
|
38
|
-
super(MessageType.Document, data, metadata);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export class BotServerMessageLocation extends BotServerMessage {
|
|
42
|
-
constructor(data, metadata = {}) {
|
|
43
|
-
super(MessageType.Location, data, metadata);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export class BotServerMessageButtonMessage extends BotServerMessage {
|
|
47
|
-
constructor(data, metadata = {}) {
|
|
48
|
-
super(MessageType.ButtonMessage, data, metadata);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export class BotServerMessageCarousel extends BotServerMessage {
|
|
52
|
-
constructor(data, metadata = {}) {
|
|
53
|
-
super(MessageType.Carousel, data, metadata);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
export class BotServerMessageCustom extends BotServerMessage {
|
|
57
|
-
constructor(data, metadata = {}) {
|
|
58
|
-
super(MessageType.Custom, data, metadata);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export class BotServerMessageTypingEvent extends BotServerMessage {
|
|
62
|
-
constructor(data, metadata = {}) {
|
|
63
|
-
super(MessageType.TypingEvent, data, metadata);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export class BotServerMessageWhatsappButtonList extends BotServerMessage {
|
|
67
|
-
constructor(data, metadata = {}) {
|
|
68
|
-
super(MessageType.WhatsappButtonList, data, metadata);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export class BotServerMessageWhatsappCTAUrlButton extends BotServerMessage {
|
|
72
|
-
constructor(data, metadata = {}) {
|
|
73
|
-
super(MessageType.WhatsappCTAUrlButton, data, metadata);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export class BotServerMessageWhatsappCatalog extends BotServerMessage {
|
|
77
|
-
constructor(data, metadata = {}) {
|
|
78
|
-
super(MessageType.WhatsappCatalog, data, metadata);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export class BotServerMessageWhatsappProduct extends BotServerMessage {
|
|
82
|
-
constructor(data, metadata = {}) {
|
|
83
|
-
super(MessageType.WhatsappProduct, data, metadata);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
export class BotServerMessageWhatsappProductList extends BotServerMessage {
|
|
87
|
-
constructor(data, metadata = {}) {
|
|
88
|
-
super(MessageType.WhatsappProductList, data, metadata);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
export class BotServerMessageWhatsappProductCarousel extends BotServerMessage {
|
|
92
|
-
constructor(data, metadata = {}) {
|
|
93
|
-
super(MessageType.WhatsappProductCarousel, data, metadata);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export class BotServerMessageWhatsappMediaCarousel extends BotServerMessage {
|
|
97
|
-
constructor(data, metadata = {}) {
|
|
98
|
-
super(MessageType.WhatsappMediaCarousel, data, metadata);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
export class BotServerMessageWhatsappTemplate extends BotServerMessage {
|
|
102
|
-
constructor(data, metadata = {}) {
|
|
103
|
-
super(MessageType.WhatsappTemplate, data, metadata);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=bot-server-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bot-server-message.js","sourceRoot":"","sources":["../../../../../../../../libs/botonic/shared/src/lib/domain/server/bot-server-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,WAAW,GAGZ,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,aAAa,GAKd,MAAM,oBAAoB,CAAA;AAE3B,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAE/E,MA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,QAAQ,CAAC,CAAA;IACzD,CAAC;CACF;AAED,MAAM,OAAO,+BAAgC,SAAQ,gBAA6C;IAChG,YACE,IAAgC,EAChC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACpD,CAAC;CACF;AAED,MAAM,OAAO,+BAAgC,SAAQ,gBAA6C;IAChG,YACE,IAAgC,EAChC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACpD,CAAC;CACF;AAED,MAAM,OAAO,mCAAoC,SAAQ,gBAAiD;IACxG,YACE,IAAoC,EACpC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACxD,CAAC;CACF;AAED,MAAM,OAAO,uCAAwC,SAAQ,gBAAqD;IAChH,YACE,IAAwC,EACxC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,uBAAuB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC5D,CAAC;CACF;AAED,MAAM,OAAO,qCAAsC,SAAQ,gBAAmD;IAC5G,YACE,IAAsC,EACtC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,qBAAqB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC1D,CAAC;CACF;AAED,MAAM,OAAO,gCAAiC,SAAQ,gBAA8C;IAClG,YACE,IAAiC,EACjC,WAA+B,EAAE;QAEjC,KAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;CACF"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { RequestInputLegacy } from '../../botonic/legacy/types';
|
|
2
|
-
import type { BotonicData } from '../../botonic/types';
|
|
3
|
-
import { MessageType } from '../../botonic/types';
|
|
4
|
-
export declare enum HelpdeskEvent {
|
|
5
|
-
StatusChanged = "status_changed",
|
|
6
|
-
AgentMessageCreated = "agent_message_created",
|
|
7
|
-
QueuePositionChanged = "queue_position_changed"
|
|
8
|
-
}
|
|
9
|
-
export declare enum InputType {
|
|
10
|
-
Text = "text",
|
|
11
|
-
Image = "image",
|
|
12
|
-
Video = "video",
|
|
13
|
-
Audio = "audio",
|
|
14
|
-
Document = "document",
|
|
15
|
-
Location = "location",
|
|
16
|
-
Contact = "contact",
|
|
17
|
-
Custom = "custom",
|
|
18
|
-
Raw = "raw",
|
|
19
|
-
CaseEventQueuePosition = "case_event_queue_position",
|
|
20
|
-
Postback = "postback",
|
|
21
|
-
Event = "event",
|
|
22
|
-
/** Legacy typing: maps to v2 typing event_name "typing_on". */
|
|
23
|
-
StartTyping = "start_typing",
|
|
24
|
-
/** Legacy typing: maps to v2 typing event_name "typing_off". */
|
|
25
|
-
SendPaused = "send_paused"
|
|
26
|
-
}
|
|
27
|
-
export declare enum NluType {
|
|
28
|
-
Keyword = "keyword",
|
|
29
|
-
SmartIntent = "smart-intent",
|
|
30
|
-
Intent = "intent"
|
|
31
|
-
}
|
|
32
|
-
export interface NluResolution {
|
|
33
|
-
type: NluType;
|
|
34
|
-
matchedValue: string;
|
|
35
|
-
payload?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface CampaignV2 {
|
|
38
|
-
id: string;
|
|
39
|
-
name: string;
|
|
40
|
-
agent_context?: string;
|
|
41
|
-
end_date?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface InputContext {
|
|
44
|
-
campaigns_v2?: CampaignV2[];
|
|
45
|
-
}
|
|
46
|
-
export type SentBy = 'enduser' | 'agent' | 'bot';
|
|
47
|
-
export interface RequestInputV2 {
|
|
48
|
-
type: MessageType;
|
|
49
|
-
data: BotonicData;
|
|
50
|
-
provider_id?: string;
|
|
51
|
-
sent_by?: string;
|
|
52
|
-
message_id?: string;
|
|
53
|
-
bot_interaction_id?: string;
|
|
54
|
-
conversation_id?: string;
|
|
55
|
-
context?: InputContext;
|
|
56
|
-
/** Bot-side: NLU resolution set by plugins. */
|
|
57
|
-
nluResolution?: NluResolution;
|
|
58
|
-
}
|
|
59
|
-
/** BotonicRequestInput = RequestInputLegacy | RequestInputV2 (before normalization). */
|
|
60
|
-
export type BotonicRequestInput = RequestInputLegacy | RequestInputV2;
|
|
61
|
-
/**
|
|
62
|
-
* Runtime class that wraps Input and exposes accessor methods for common attributes.
|
|
63
|
-
* Use this as BotRequest.input so consumers can call request.input.text,
|
|
64
|
-
* request.input.payload, etc.
|
|
65
|
-
*/
|
|
66
|
-
export declare class BotonicContextInput implements RequestInputV2 {
|
|
67
|
-
private rawInput;
|
|
68
|
-
constructor(rawInput: RequestInputV2);
|
|
69
|
-
get type(): MessageType;
|
|
70
|
-
set type(v: MessageType);
|
|
71
|
-
get data(): BotonicData;
|
|
72
|
-
get providerId(): string | undefined;
|
|
73
|
-
get sentBy(): string | undefined;
|
|
74
|
-
get messageId(): string | undefined;
|
|
75
|
-
get botInteractionId(): string | undefined;
|
|
76
|
-
get conversationId(): string | undefined;
|
|
77
|
-
get context(): InputContext | undefined;
|
|
78
|
-
get nluResolution(): NluResolution | undefined;
|
|
79
|
-
set nluResolution(v: NluResolution | undefined);
|
|
80
|
-
private getKeyDataStringValue;
|
|
81
|
-
get text(): string | undefined;
|
|
82
|
-
set text(value: string);
|
|
83
|
-
get payload(): string | undefined;
|
|
84
|
-
set payload(value: string | undefined);
|
|
85
|
-
get referral(): string | undefined;
|
|
86
|
-
get attachmentUrl(): string | undefined;
|
|
87
|
-
/** True when the input is text with string data present. */
|
|
88
|
-
hasInputText(): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Replace the current input with a synthetic postback so type and data stay in sync.
|
|
91
|
-
* Use for redirect flow instead of mutating payload/type/text individually.
|
|
92
|
-
*/
|
|
93
|
-
setAsPostback(payload: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* Replace the current input with synthetic text so type and data stay in sync.
|
|
96
|
-
* Use when converting e.g. WhatsApp referral to text input.
|
|
97
|
-
*/
|
|
98
|
-
setAsText(text: string): void;
|
|
99
|
-
}
|