@wix/auto_sdk_forms_interactive-form-sessions 1.0.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/build/cjs/index.d.ts +56 -0
- package/build/cjs/index.js +538 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1082 -0
- package/build/cjs/index.typings.js +489 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +494 -0
- package/build/cjs/meta.js +357 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +56 -0
- package/build/es/index.mjs +505 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +1082 -0
- package/build/es/index.typings.mjs +456 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +494 -0
- package/build/es/meta.mjs +326 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +56 -0
- package/build/internal/cjs/index.js +538 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1082 -0
- package/build/internal/cjs/index.typings.js +489 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +494 -0
- package/build/internal/cjs/meta.js +357 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +56 -0
- package/build/internal/es/index.mjs +505 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +1082 -0
- package/build/internal/es/index.typings.mjs +456 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +494 -0
- package/build/internal/es/meta.mjs +326 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.http.ts
|
|
9
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
10
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
11
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
12
|
+
function resolveWixFormsAiV1InteractiveFormSessionsServiceUrl(opts) {
|
|
13
|
+
const domainToMappings = {
|
|
14
|
+
"bo._base_domain_": [
|
|
15
|
+
{
|
|
16
|
+
srcPath: "/_api/form-ai-assistant",
|
|
17
|
+
destPath: ""
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"wixbo.ai": [
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/_api/form-ai-assistant",
|
|
23
|
+
destPath: ""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"wix-bo.com": [
|
|
27
|
+
{
|
|
28
|
+
srcPath: "/_api/form-ai-assistant",
|
|
29
|
+
destPath: ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"*.wixforms.com": [
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/_api/form-ai-assistant",
|
|
35
|
+
destPath: ""
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"manage._base_domain_": [
|
|
39
|
+
{
|
|
40
|
+
srcPath: "/_api/form-ai-assistant",
|
|
41
|
+
destPath: ""
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
_: [
|
|
45
|
+
{
|
|
46
|
+
srcPath: "/_api/form-ai-assistant",
|
|
47
|
+
destPath: ""
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"www.wixapis.com": [
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/forms/ai/v1/chat-settings",
|
|
53
|
+
destPath: "/v1/chat-settings"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"*.dev.wix-code.com": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/_api/form-ai-assistant",
|
|
59
|
+
destPath: ""
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
64
|
+
}
|
|
65
|
+
var PACKAGE_NAME = "@wix/auto_sdk_forms_interactive-form-sessions";
|
|
66
|
+
function createInteractiveFormSession(payload) {
|
|
67
|
+
function __createInteractiveFormSession({ host }) {
|
|
68
|
+
const metadata = {
|
|
69
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
70
|
+
method: "POST",
|
|
71
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.CreateInteractiveFormSession",
|
|
72
|
+
packageName: PACKAGE_NAME,
|
|
73
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
74
|
+
protoPath: "/v1/interactive-form-sessions",
|
|
75
|
+
data: payload,
|
|
76
|
+
host
|
|
77
|
+
}),
|
|
78
|
+
data: payload,
|
|
79
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
80
|
+
{
|
|
81
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
82
|
+
paths: [
|
|
83
|
+
{ path: "responseChunks.numberInputDetails.multipleOf" },
|
|
84
|
+
{
|
|
85
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
path: "responseChunks.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
])
|
|
96
|
+
};
|
|
97
|
+
return metadata;
|
|
98
|
+
}
|
|
99
|
+
return __createInteractiveFormSession;
|
|
100
|
+
}
|
|
101
|
+
function createInteractiveFormSessionStreamed(payload) {
|
|
102
|
+
function __createInteractiveFormSessionStreamed({ host }) {
|
|
103
|
+
const metadata = {
|
|
104
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
105
|
+
method: "POST",
|
|
106
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.CreateInteractiveFormSessionStreamed",
|
|
107
|
+
packageName: PACKAGE_NAME,
|
|
108
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
109
|
+
protoPath: "/v1/interactive-form-sessions/create-streamed",
|
|
110
|
+
data: payload,
|
|
111
|
+
host
|
|
112
|
+
}),
|
|
113
|
+
data: payload,
|
|
114
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
115
|
+
{
|
|
116
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
117
|
+
paths: [
|
|
118
|
+
{ path: "responseChunk.numberInputDetails.multipleOf" },
|
|
119
|
+
{
|
|
120
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
path: "responseChunk.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
])
|
|
131
|
+
};
|
|
132
|
+
return metadata;
|
|
133
|
+
}
|
|
134
|
+
return __createInteractiveFormSessionStreamed;
|
|
135
|
+
}
|
|
136
|
+
function sendUserMessage(payload) {
|
|
137
|
+
function __sendUserMessage({ host }) {
|
|
138
|
+
const metadata = {
|
|
139
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
140
|
+
method: "POST",
|
|
141
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.SendUserMessage",
|
|
142
|
+
packageName: PACKAGE_NAME,
|
|
143
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
144
|
+
protoPath: "/v1/interactive-form-sessions/{interactiveFormSessionId}/send-user-message",
|
|
145
|
+
data: payload,
|
|
146
|
+
host
|
|
147
|
+
}),
|
|
148
|
+
data: payload,
|
|
149
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
150
|
+
{
|
|
151
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
152
|
+
paths: [
|
|
153
|
+
{ path: "responseChunks.numberInputDetails.multipleOf" },
|
|
154
|
+
{
|
|
155
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
path: "responseChunks.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
])
|
|
166
|
+
};
|
|
167
|
+
return metadata;
|
|
168
|
+
}
|
|
169
|
+
return __sendUserMessage;
|
|
170
|
+
}
|
|
171
|
+
function sendUserMessageStreamed(payload) {
|
|
172
|
+
function __sendUserMessageStreamed({ host }) {
|
|
173
|
+
const metadata = {
|
|
174
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
175
|
+
method: "POST",
|
|
176
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.SendUserMessageStreamed",
|
|
177
|
+
packageName: PACKAGE_NAME,
|
|
178
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
179
|
+
protoPath: "/v1/interactive-form-sessions/{interactiveFormSessionId}/send-user-message-streamed",
|
|
180
|
+
data: payload,
|
|
181
|
+
host
|
|
182
|
+
}),
|
|
183
|
+
data: payload,
|
|
184
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
185
|
+
{
|
|
186
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
187
|
+
paths: [
|
|
188
|
+
{ path: "responseChunk.numberInputDetails.multipleOf" },
|
|
189
|
+
{
|
|
190
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
path: "responseChunk.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
])
|
|
201
|
+
};
|
|
202
|
+
return metadata;
|
|
203
|
+
}
|
|
204
|
+
return __sendUserMessageStreamed;
|
|
205
|
+
}
|
|
206
|
+
function reportConversation(payload) {
|
|
207
|
+
function __reportConversation({ host }) {
|
|
208
|
+
const metadata = {
|
|
209
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
210
|
+
method: "POST",
|
|
211
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.ReportConversation",
|
|
212
|
+
packageName: PACKAGE_NAME,
|
|
213
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
214
|
+
protoPath: "/v1/interactive-form-sessions/report",
|
|
215
|
+
data: payload,
|
|
216
|
+
host
|
|
217
|
+
}),
|
|
218
|
+
data: payload
|
|
219
|
+
};
|
|
220
|
+
return metadata;
|
|
221
|
+
}
|
|
222
|
+
return __reportConversation;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.universal.ts
|
|
226
|
+
var ChunkType = /* @__PURE__ */ ((ChunkType2) => {
|
|
227
|
+
ChunkType2["UNKNOWN_CHUNK_TYPE"] = "UNKNOWN_CHUNK_TYPE";
|
|
228
|
+
ChunkType2["TEXT"] = "TEXT";
|
|
229
|
+
ChunkType2["TEXT_DATA"] = "TEXT_DATA";
|
|
230
|
+
ChunkType2["MULTI_SELECT_INPUT"] = "MULTI_SELECT_INPUT";
|
|
231
|
+
ChunkType2["NUMBER_INPUT"] = "NUMBER_INPUT";
|
|
232
|
+
ChunkType2["SEPARATOR"] = "SEPARATOR";
|
|
233
|
+
ChunkType2["SINGLE_SELECT_INPUT"] = "SINGLE_SELECT_INPUT";
|
|
234
|
+
ChunkType2["ERROR"] = "ERROR";
|
|
235
|
+
ChunkType2["SUBMISSION"] = "SUBMISSION";
|
|
236
|
+
ChunkType2["IMPORTANT_TEXT"] = "IMPORTANT_TEXT";
|
|
237
|
+
ChunkType2["DEBUG"] = "DEBUG";
|
|
238
|
+
ChunkType2["END_OF_RESPONSE"] = "END_OF_RESPONSE";
|
|
239
|
+
ChunkType2["FILE_UPLOAD"] = "FILE_UPLOAD";
|
|
240
|
+
ChunkType2["SIGNATURE"] = "SIGNATURE";
|
|
241
|
+
return ChunkType2;
|
|
242
|
+
})(ChunkType || {});
|
|
243
|
+
var Style = /* @__PURE__ */ ((Style2) => {
|
|
244
|
+
Style2["UNKNOWN_STYLE"] = "UNKNOWN_STYLE";
|
|
245
|
+
Style2["NORMAL"] = "NORMAL";
|
|
246
|
+
Style2["BOLD"] = "BOLD";
|
|
247
|
+
return Style2;
|
|
248
|
+
})(Style || {});
|
|
249
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
250
|
+
Type2["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
251
|
+
Type2["PARAGRAPH"] = "PARAGRAPH";
|
|
252
|
+
return Type2;
|
|
253
|
+
})(Type || {});
|
|
254
|
+
var Role = /* @__PURE__ */ ((Role2) => {
|
|
255
|
+
Role2["UNKNOWN_ROLE"] = "UNKNOWN_ROLE";
|
|
256
|
+
Role2["USER"] = "USER";
|
|
257
|
+
Role2["ASSISTANT"] = "ASSISTANT";
|
|
258
|
+
Role2["FUNCTION_CALL"] = "FUNCTION_CALL";
|
|
259
|
+
Role2["FUNCTION_CALL_OUTPUT"] = "FUNCTION_CALL_OUTPUT";
|
|
260
|
+
Role2["DEVELOPER"] = "DEVELOPER";
|
|
261
|
+
return Role2;
|
|
262
|
+
})(Role || {});
|
|
263
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
264
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
265
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
266
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
267
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
268
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
269
|
+
return WebhookIdentityType2;
|
|
270
|
+
})(WebhookIdentityType || {});
|
|
271
|
+
async function createInteractiveFormSession2(formId, options) {
|
|
272
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
273
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
274
|
+
formId,
|
|
275
|
+
promptId: options?.promptId,
|
|
276
|
+
currentValues: options?.currentValues,
|
|
277
|
+
dryRun: options?.dryRun,
|
|
278
|
+
currentTime: options?.currentTime,
|
|
279
|
+
clientTime: options?.clientTime
|
|
280
|
+
});
|
|
281
|
+
const reqOpts = createInteractiveFormSession(
|
|
282
|
+
payload
|
|
283
|
+
);
|
|
284
|
+
sideEffects?.onSiteCall?.();
|
|
285
|
+
try {
|
|
286
|
+
const result = await httpClient.request(reqOpts);
|
|
287
|
+
sideEffects?.onSuccess?.(result);
|
|
288
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.interactiveFormSession;
|
|
289
|
+
} catch (err) {
|
|
290
|
+
const transformedError = sdkTransformError(
|
|
291
|
+
err,
|
|
292
|
+
{
|
|
293
|
+
spreadPathsToArguments: {},
|
|
294
|
+
explicitPathsToArguments: {
|
|
295
|
+
formId: "$[0]",
|
|
296
|
+
promptId: "$[1].promptId",
|
|
297
|
+
currentValues: "$[1].currentValues",
|
|
298
|
+
dryRun: "$[1].dryRun",
|
|
299
|
+
currentTime: "$[1].currentTime",
|
|
300
|
+
clientTime: "$[1].clientTime"
|
|
301
|
+
},
|
|
302
|
+
singleArgumentUnchanged: false
|
|
303
|
+
},
|
|
304
|
+
["formId", "options"]
|
|
305
|
+
);
|
|
306
|
+
sideEffects?.onError?.(err);
|
|
307
|
+
throw transformedError;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
async function createInteractiveFormSessionStreamed2(formId, options) {
|
|
311
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
312
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
313
|
+
formId,
|
|
314
|
+
promptId: options?.promptId,
|
|
315
|
+
currentValues: options?.currentValues,
|
|
316
|
+
dryRun: options?.dryRun,
|
|
317
|
+
currentTime: options?.currentTime,
|
|
318
|
+
clientTime: options?.clientTime
|
|
319
|
+
});
|
|
320
|
+
const reqOpts = createInteractiveFormSessionStreamed(
|
|
321
|
+
payload
|
|
322
|
+
);
|
|
323
|
+
sideEffects?.onSiteCall?.();
|
|
324
|
+
try {
|
|
325
|
+
const result = await httpClient.request(reqOpts);
|
|
326
|
+
sideEffects?.onSuccess?.(result);
|
|
327
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
328
|
+
} catch (err) {
|
|
329
|
+
const transformedError = sdkTransformError(
|
|
330
|
+
err,
|
|
331
|
+
{
|
|
332
|
+
spreadPathsToArguments: {},
|
|
333
|
+
explicitPathsToArguments: {
|
|
334
|
+
formId: "$[0]",
|
|
335
|
+
promptId: "$[1].promptId",
|
|
336
|
+
currentValues: "$[1].currentValues",
|
|
337
|
+
dryRun: "$[1].dryRun",
|
|
338
|
+
currentTime: "$[1].currentTime",
|
|
339
|
+
clientTime: "$[1].clientTime"
|
|
340
|
+
},
|
|
341
|
+
singleArgumentUnchanged: false
|
|
342
|
+
},
|
|
343
|
+
["formId", "options"]
|
|
344
|
+
);
|
|
345
|
+
sideEffects?.onError?.(err);
|
|
346
|
+
throw transformedError;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
async function sendUserMessage2(interactiveFormSessionId, options) {
|
|
350
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
351
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
352
|
+
interactiveFormSessionId,
|
|
353
|
+
input: options?.input,
|
|
354
|
+
currentValues: options?.currentValues
|
|
355
|
+
});
|
|
356
|
+
const reqOpts = sendUserMessage(payload);
|
|
357
|
+
sideEffects?.onSiteCall?.();
|
|
358
|
+
try {
|
|
359
|
+
const result = await httpClient.request(reqOpts);
|
|
360
|
+
sideEffects?.onSuccess?.(result);
|
|
361
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
362
|
+
} catch (err) {
|
|
363
|
+
const transformedError = sdkTransformError(
|
|
364
|
+
err,
|
|
365
|
+
{
|
|
366
|
+
spreadPathsToArguments: {},
|
|
367
|
+
explicitPathsToArguments: {
|
|
368
|
+
interactiveFormSessionId: "$[0]",
|
|
369
|
+
input: "$[1].input",
|
|
370
|
+
currentValues: "$[1].currentValues"
|
|
371
|
+
},
|
|
372
|
+
singleArgumentUnchanged: false
|
|
373
|
+
},
|
|
374
|
+
["interactiveFormSessionId", "options"]
|
|
375
|
+
);
|
|
376
|
+
sideEffects?.onError?.(err);
|
|
377
|
+
throw transformedError;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
async function sendUserMessageStreamed2(interactiveFormSessionId, options) {
|
|
381
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
382
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
383
|
+
interactiveFormSessionId,
|
|
384
|
+
input: options?.input,
|
|
385
|
+
currentValues: options?.currentValues
|
|
386
|
+
});
|
|
387
|
+
const reqOpts = sendUserMessageStreamed(
|
|
388
|
+
payload
|
|
389
|
+
);
|
|
390
|
+
sideEffects?.onSiteCall?.();
|
|
391
|
+
try {
|
|
392
|
+
const result = await httpClient.request(reqOpts);
|
|
393
|
+
sideEffects?.onSuccess?.(result);
|
|
394
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
395
|
+
} catch (err) {
|
|
396
|
+
const transformedError = sdkTransformError(
|
|
397
|
+
err,
|
|
398
|
+
{
|
|
399
|
+
spreadPathsToArguments: {},
|
|
400
|
+
explicitPathsToArguments: {
|
|
401
|
+
interactiveFormSessionId: "$[0]",
|
|
402
|
+
input: "$[1].input",
|
|
403
|
+
currentValues: "$[1].currentValues"
|
|
404
|
+
},
|
|
405
|
+
singleArgumentUnchanged: false
|
|
406
|
+
},
|
|
407
|
+
["interactiveFormSessionId", "options"]
|
|
408
|
+
);
|
|
409
|
+
sideEffects?.onError?.(err);
|
|
410
|
+
throw transformedError;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
async function reportConversation2(options) {
|
|
414
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
415
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
416
|
+
interactiveFormSessionId: options?.interactiveFormSessionId,
|
|
417
|
+
description: options?.description,
|
|
418
|
+
viewerDebugUrl: options?.viewerDebugUrl
|
|
419
|
+
});
|
|
420
|
+
const reqOpts = reportConversation(payload);
|
|
421
|
+
sideEffects?.onSiteCall?.();
|
|
422
|
+
try {
|
|
423
|
+
const result = await httpClient.request(reqOpts);
|
|
424
|
+
sideEffects?.onSuccess?.(result);
|
|
425
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
426
|
+
} catch (err) {
|
|
427
|
+
const transformedError = sdkTransformError(
|
|
428
|
+
err,
|
|
429
|
+
{
|
|
430
|
+
spreadPathsToArguments: {},
|
|
431
|
+
explicitPathsToArguments: {
|
|
432
|
+
interactiveFormSessionId: "$[0].interactiveFormSessionId",
|
|
433
|
+
description: "$[0].description",
|
|
434
|
+
viewerDebugUrl: "$[0].viewerDebugUrl"
|
|
435
|
+
},
|
|
436
|
+
singleArgumentUnchanged: false
|
|
437
|
+
},
|
|
438
|
+
["options"]
|
|
439
|
+
);
|
|
440
|
+
sideEffects?.onError?.(err);
|
|
441
|
+
throw transformedError;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.public.ts
|
|
446
|
+
function createInteractiveFormSession3(httpClient) {
|
|
447
|
+
return (formId, options) => createInteractiveFormSession2(
|
|
448
|
+
formId,
|
|
449
|
+
options,
|
|
450
|
+
// @ts-ignore
|
|
451
|
+
{ httpClient }
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
function createInteractiveFormSessionStreamed3(httpClient) {
|
|
455
|
+
return (formId, options) => createInteractiveFormSessionStreamed2(
|
|
456
|
+
formId,
|
|
457
|
+
options,
|
|
458
|
+
// @ts-ignore
|
|
459
|
+
{ httpClient }
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
function sendUserMessage3(httpClient) {
|
|
463
|
+
return (interactiveFormSessionId, options) => sendUserMessage2(
|
|
464
|
+
interactiveFormSessionId,
|
|
465
|
+
options,
|
|
466
|
+
// @ts-ignore
|
|
467
|
+
{ httpClient }
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
function sendUserMessageStreamed3(httpClient) {
|
|
471
|
+
return (interactiveFormSessionId, options) => sendUserMessageStreamed2(
|
|
472
|
+
interactiveFormSessionId,
|
|
473
|
+
options,
|
|
474
|
+
// @ts-ignore
|
|
475
|
+
{ httpClient }
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
function reportConversation3(httpClient) {
|
|
479
|
+
return (options) => reportConversation2(
|
|
480
|
+
options,
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
{ httpClient }
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.context.ts
|
|
487
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
488
|
+
var createInteractiveFormSession4 = /* @__PURE__ */ createRESTModule(createInteractiveFormSession3);
|
|
489
|
+
var createInteractiveFormSessionStreamed4 = /* @__PURE__ */ createRESTModule(createInteractiveFormSessionStreamed3);
|
|
490
|
+
var sendUserMessage4 = /* @__PURE__ */ createRESTModule(sendUserMessage3);
|
|
491
|
+
var sendUserMessageStreamed4 = /* @__PURE__ */ createRESTModule(sendUserMessageStreamed3);
|
|
492
|
+
var reportConversation4 = /* @__PURE__ */ createRESTModule(reportConversation3);
|
|
493
|
+
export {
|
|
494
|
+
ChunkType,
|
|
495
|
+
Role,
|
|
496
|
+
Style,
|
|
497
|
+
Type,
|
|
498
|
+
WebhookIdentityType,
|
|
499
|
+
createInteractiveFormSession4 as createInteractiveFormSession,
|
|
500
|
+
createInteractiveFormSessionStreamed4 as createInteractiveFormSessionStreamed,
|
|
501
|
+
reportConversation4 as reportConversation,
|
|
502
|
+
sendUserMessage4 as sendUserMessage,
|
|
503
|
+
sendUserMessageStreamed4 as sendUserMessageStreamed
|
|
504
|
+
};
|
|
505
|
+
//# sourceMappingURL=index.mjs.map
|