@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,56 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { CreateInteractiveFormSessionOptions, InteractiveFormSession, CreateInteractiveFormSessionStreamedOptions, CreateInteractiveFormSessionStreamedResponse, SendUserMessageOptions, SendUserMessageResponse, SendUserMessageApplicationErrors, SendUserMessageStreamedOptions, SendUserMessageStreamedResponse, SendUserMessageStreamedApplicationErrors, ReportConversationOptions, ReportConversationResponse } from './index.typings.js';
|
|
3
|
+
export { AcknowledgmentResponse, ActionEvent, AssistantOptions, Call, CallToolsRequest, CallToolsResponse, ChunkType, ChunkTypeWithLiterals, ClientTime, ContextMessage, ContextMessageOptionsOneOf, ConverseRequest, ConverseRequestRequestOneOf, ConverseResponse, ConverseResponseResponseOneOf, CreateInteractiveFormSessionRequest, CreateInteractiveFormSessionResponse, CreateInteractiveFormSessionStreamedRequest, CustomValue, DebugDetails, DeveloperOptions, DomainEvent, DomainEventBodyOneOf, EndOfResponseDetails, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ErrorDetails, FileUploadDetails, FunctionCallOptions, FunctionCallOutputOptions, GetStateRequest, GetStateResponse, IdentificationData, IdentificationDataIdOneOf, ImportantTextDetails, InteractiveFormSessionResponseChunk, InteractiveFormSessionResponseChunkOfOneOf, MeaningfulInput, MessageEnvelope, MultiSelectInputDetails, NumberInputDetails, NumberRangeLimit, NumberRangeLimitEndOneOf, Option, OutputInteractiveFormSessionStreamedRequest, OutputInteractiveFormSessionStreamedResponse, RelayAssistantMessageRequest, ReportConversationRequest, Response, RestoreInfo, Role, RoleWithLiterals, SendUserMessageRequest, SendUserMessageStreamedRequest, SeparatorDetails, SignatureDetails, SingleSelectInputDetails, Style, StyleWithLiterals, SubmissionDetails, TextDataDetails, TextDetails, Tool, Type, TypeWithLiterals, Usage, UsageRequest, UserOptions, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function createInteractiveFormSession$1(httpClient: HttpClient): CreateInteractiveFormSessionSignature;
|
|
6
|
+
interface CreateInteractiveFormSessionSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Starts interactive form session for a given form
|
|
9
|
+
* @param - Interactive form session to be created.
|
|
10
|
+
* @returns Interactive form session created
|
|
11
|
+
*/
|
|
12
|
+
(formId: string, options?: CreateInteractiveFormSessionOptions): Promise<NonNullablePaths<InteractiveFormSession, `_id` | `formId`, 2>>;
|
|
13
|
+
}
|
|
14
|
+
declare function createInteractiveFormSessionStreamed$1(httpClient: HttpClient): CreateInteractiveFormSessionStreamedSignature;
|
|
15
|
+
interface CreateInteractiveFormSessionStreamedSignature {
|
|
16
|
+
/**
|
|
17
|
+
* Starts interactive form session for a given form with streamed response
|
|
18
|
+
* @param - Interactive form session to be created.
|
|
19
|
+
*/
|
|
20
|
+
(formId: string, options?: CreateInteractiveFormSessionStreamedOptions): Promise<NonNullablePaths<CreateInteractiveFormSessionStreamedResponse, `responseChunk.textDetails.text` | `responseChunk.textDetails.style` | `responseChunk.textDataDetails.fieldTarget` | `responseChunk.textDataDetails.text` | `responseChunk.textDataDetails.displayValue` | `responseChunk.multiSelectInputDetails.fieldTarget` | `responseChunk.multiSelectInputDetails.options` | `responseChunk.multiSelectInputDetails.options.${number}.value` | `responseChunk.multiSelectInputDetails.options.${number}.label` | `responseChunk.multiSelectInputDetails.allowedCustomValue.description` | `responseChunk.numberInputDetails.fieldTarget` | `responseChunk.separatorDetails.type` | `responseChunk.singleSelectInputDetails.fieldTarget` | `responseChunk.singleSelectInputDetails.options` | `responseChunk.errorDetails.messageText` | `responseChunk.submissionDetails.submissionId` | `responseChunk.importantTextDetails.fieldTarget` | `responseChunk.importantTextDetails.text` | `responseChunk.endOfResponseDetails.success` | `responseChunk.fileUploadDetails.fieldTarget` | `responseChunk.signatureDetails.fieldTarget` | `responseChunk.chunkType` | `responseChunk.meaningfulInput.startOffset` | `responseChunk.meaningfulInput.length` | `interactiveFormSession._id` | `interactiveFormSession.formId`, 6>>;
|
|
21
|
+
}
|
|
22
|
+
declare function sendUserMessage$1(httpClient: HttpClient): SendUserMessageSignature;
|
|
23
|
+
interface SendUserMessageSignature {
|
|
24
|
+
/**
|
|
25
|
+
* Sends user message to the interactive form session
|
|
26
|
+
* @param - Interactive form session id
|
|
27
|
+
*/
|
|
28
|
+
(interactiveFormSessionId: string, options?: SendUserMessageOptions): Promise<NonNullablePaths<SendUserMessageResponse, `interactiveFormSession._id` | `interactiveFormSession.formId` | `responseChunks` | `responseChunks.${number}.textDetails.text` | `responseChunks.${number}.textDetails.style` | `responseChunks.${number}.textDataDetails.fieldTarget` | `responseChunks.${number}.textDataDetails.text` | `responseChunks.${number}.textDataDetails.displayValue` | `responseChunks.${number}.multiSelectInputDetails.fieldTarget` | `responseChunks.${number}.multiSelectInputDetails.allowedCustomValue.description` | `responseChunks.${number}.numberInputDetails.fieldTarget` | `responseChunks.${number}.separatorDetails.type` | `responseChunks.${number}.singleSelectInputDetails.fieldTarget` | `responseChunks.${number}.errorDetails.messageText` | `responseChunks.${number}.submissionDetails.submissionId` | `responseChunks.${number}.importantTextDetails.fieldTarget` | `responseChunks.${number}.importantTextDetails.text` | `responseChunks.${number}.endOfResponseDetails.success` | `responseChunks.${number}.fileUploadDetails.fieldTarget` | `responseChunks.${number}.signatureDetails.fieldTarget` | `responseChunks.${number}.chunkType` | `responseChunks.${number}.meaningfulInput.startOffset` | `responseChunks.${number}.meaningfulInput.length`, 6> & {
|
|
29
|
+
__applicationErrorsType?: SendUserMessageApplicationErrors;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
declare function sendUserMessageStreamed$1(httpClient: HttpClient): SendUserMessageStreamedSignature;
|
|
33
|
+
interface SendUserMessageStreamedSignature {
|
|
34
|
+
/**
|
|
35
|
+
* Sends user message to the interactive form session with streamed response
|
|
36
|
+
* @param - Interactive form session id
|
|
37
|
+
*/
|
|
38
|
+
(interactiveFormSessionId: string, options?: SendUserMessageStreamedOptions): Promise<NonNullablePaths<SendUserMessageStreamedResponse, `responseChunk.textDetails.text` | `responseChunk.textDetails.style` | `responseChunk.textDataDetails.fieldTarget` | `responseChunk.textDataDetails.text` | `responseChunk.textDataDetails.displayValue` | `responseChunk.multiSelectInputDetails.fieldTarget` | `responseChunk.multiSelectInputDetails.options` | `responseChunk.multiSelectInputDetails.options.${number}.value` | `responseChunk.multiSelectInputDetails.options.${number}.label` | `responseChunk.multiSelectInputDetails.allowedCustomValue.description` | `responseChunk.numberInputDetails.fieldTarget` | `responseChunk.separatorDetails.type` | `responseChunk.singleSelectInputDetails.fieldTarget` | `responseChunk.singleSelectInputDetails.options` | `responseChunk.errorDetails.messageText` | `responseChunk.submissionDetails.submissionId` | `responseChunk.importantTextDetails.fieldTarget` | `responseChunk.importantTextDetails.text` | `responseChunk.endOfResponseDetails.success` | `responseChunk.fileUploadDetails.fieldTarget` | `responseChunk.signatureDetails.fieldTarget` | `responseChunk.chunkType` | `responseChunk.meaningfulInput.startOffset` | `responseChunk.meaningfulInput.length` | `interactiveFormSession._id` | `interactiveFormSession.formId`, 6> & {
|
|
39
|
+
__applicationErrorsType?: SendUserMessageStreamedApplicationErrors;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
declare function reportConversation$1(httpClient: HttpClient): ReportConversationSignature;
|
|
43
|
+
interface ReportConversationSignature {
|
|
44
|
+
/**
|
|
45
|
+
* Report conversation for quality assurance
|
|
46
|
+
*/
|
|
47
|
+
(options?: ReportConversationOptions): Promise<ReportConversationResponse>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const createInteractiveFormSession: MaybeContext<BuildRESTFunction<typeof createInteractiveFormSession$1> & typeof createInteractiveFormSession$1>;
|
|
51
|
+
declare const createInteractiveFormSessionStreamed: MaybeContext<BuildRESTFunction<typeof createInteractiveFormSessionStreamed$1> & typeof createInteractiveFormSessionStreamed$1>;
|
|
52
|
+
declare const sendUserMessage: MaybeContext<BuildRESTFunction<typeof sendUserMessage$1> & typeof sendUserMessage$1>;
|
|
53
|
+
declare const sendUserMessageStreamed: MaybeContext<BuildRESTFunction<typeof sendUserMessageStreamed$1> & typeof sendUserMessageStreamed$1>;
|
|
54
|
+
declare const reportConversation: MaybeContext<BuildRESTFunction<typeof reportConversation$1> & typeof reportConversation$1>;
|
|
55
|
+
|
|
56
|
+
export { CreateInteractiveFormSessionOptions, CreateInteractiveFormSessionStreamedOptions, CreateInteractiveFormSessionStreamedResponse, InteractiveFormSession, ReportConversationOptions, ReportConversationResponse, SendUserMessageApplicationErrors, SendUserMessageOptions, SendUserMessageResponse, SendUserMessageStreamedApplicationErrors, SendUserMessageStreamedOptions, SendUserMessageStreamedResponse, createInteractiveFormSession, createInteractiveFormSessionStreamed, reportConversation, sendUserMessage, sendUserMessageStreamed };
|
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ChunkType: () => ChunkType,
|
|
24
|
+
Role: () => Role,
|
|
25
|
+
Style: () => Style,
|
|
26
|
+
Type: () => Type,
|
|
27
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
28
|
+
createInteractiveFormSession: () => createInteractiveFormSession4,
|
|
29
|
+
createInteractiveFormSessionStreamed: () => createInteractiveFormSessionStreamed4,
|
|
30
|
+
reportConversation: () => reportConversation4,
|
|
31
|
+
sendUserMessage: () => sendUserMessage4,
|
|
32
|
+
sendUserMessageStreamed: () => sendUserMessageStreamed4
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
|
+
|
|
36
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.universal.ts
|
|
37
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
38
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
39
|
+
|
|
40
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.http.ts
|
|
41
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
42
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
43
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
44
|
+
function resolveWixFormsAiV1InteractiveFormSessionsServiceUrl(opts) {
|
|
45
|
+
const domainToMappings = {
|
|
46
|
+
"bo._base_domain_": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/form-ai-assistant",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"wixbo.ai": [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/form-ai-assistant",
|
|
55
|
+
destPath: ""
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"wix-bo.com": [
|
|
59
|
+
{
|
|
60
|
+
srcPath: "/_api/form-ai-assistant",
|
|
61
|
+
destPath: ""
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"*.wixforms.com": [
|
|
65
|
+
{
|
|
66
|
+
srcPath: "/_api/form-ai-assistant",
|
|
67
|
+
destPath: ""
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"manage._base_domain_": [
|
|
71
|
+
{
|
|
72
|
+
srcPath: "/_api/form-ai-assistant",
|
|
73
|
+
destPath: ""
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
_: [
|
|
77
|
+
{
|
|
78
|
+
srcPath: "/_api/form-ai-assistant",
|
|
79
|
+
destPath: ""
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"www.wixapis.com": [
|
|
83
|
+
{
|
|
84
|
+
srcPath: "/forms/ai/v1/chat-settings",
|
|
85
|
+
destPath: "/v1/chat-settings"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"*.dev.wix-code.com": [
|
|
89
|
+
{
|
|
90
|
+
srcPath: "/_api/form-ai-assistant",
|
|
91
|
+
destPath: ""
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
96
|
+
}
|
|
97
|
+
var PACKAGE_NAME = "@wix/auto_sdk_forms_interactive-form-sessions";
|
|
98
|
+
function createInteractiveFormSession(payload) {
|
|
99
|
+
function __createInteractiveFormSession({ host }) {
|
|
100
|
+
const metadata = {
|
|
101
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
102
|
+
method: "POST",
|
|
103
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.CreateInteractiveFormSession",
|
|
104
|
+
packageName: PACKAGE_NAME,
|
|
105
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
106
|
+
protoPath: "/v1/interactive-form-sessions",
|
|
107
|
+
data: payload,
|
|
108
|
+
host
|
|
109
|
+
}),
|
|
110
|
+
data: payload,
|
|
111
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
112
|
+
{
|
|
113
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
114
|
+
paths: [
|
|
115
|
+
{ path: "responseChunks.numberInputDetails.multipleOf" },
|
|
116
|
+
{
|
|
117
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
path: "responseChunks.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
])
|
|
128
|
+
};
|
|
129
|
+
return metadata;
|
|
130
|
+
}
|
|
131
|
+
return __createInteractiveFormSession;
|
|
132
|
+
}
|
|
133
|
+
function createInteractiveFormSessionStreamed(payload) {
|
|
134
|
+
function __createInteractiveFormSessionStreamed({ host }) {
|
|
135
|
+
const metadata = {
|
|
136
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
137
|
+
method: "POST",
|
|
138
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.CreateInteractiveFormSessionStreamed",
|
|
139
|
+
packageName: PACKAGE_NAME,
|
|
140
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
141
|
+
protoPath: "/v1/interactive-form-sessions/create-streamed",
|
|
142
|
+
data: payload,
|
|
143
|
+
host
|
|
144
|
+
}),
|
|
145
|
+
data: payload,
|
|
146
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
147
|
+
{
|
|
148
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
149
|
+
paths: [
|
|
150
|
+
{ path: "responseChunk.numberInputDetails.multipleOf" },
|
|
151
|
+
{
|
|
152
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
path: "responseChunk.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
])
|
|
163
|
+
};
|
|
164
|
+
return metadata;
|
|
165
|
+
}
|
|
166
|
+
return __createInteractiveFormSessionStreamed;
|
|
167
|
+
}
|
|
168
|
+
function sendUserMessage(payload) {
|
|
169
|
+
function __sendUserMessage({ host }) {
|
|
170
|
+
const metadata = {
|
|
171
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
172
|
+
method: "POST",
|
|
173
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.SendUserMessage",
|
|
174
|
+
packageName: PACKAGE_NAME,
|
|
175
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
176
|
+
protoPath: "/v1/interactive-form-sessions/{interactiveFormSessionId}/send-user-message",
|
|
177
|
+
data: payload,
|
|
178
|
+
host
|
|
179
|
+
}),
|
|
180
|
+
data: payload,
|
|
181
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
182
|
+
{
|
|
183
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
184
|
+
paths: [
|
|
185
|
+
{ path: "responseChunks.numberInputDetails.multipleOf" },
|
|
186
|
+
{
|
|
187
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
path: "responseChunks.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
path: "responseChunks.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
])
|
|
198
|
+
};
|
|
199
|
+
return metadata;
|
|
200
|
+
}
|
|
201
|
+
return __sendUserMessage;
|
|
202
|
+
}
|
|
203
|
+
function sendUserMessageStreamed(payload) {
|
|
204
|
+
function __sendUserMessageStreamed({ host }) {
|
|
205
|
+
const metadata = {
|
|
206
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
207
|
+
method: "POST",
|
|
208
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.SendUserMessageStreamed",
|
|
209
|
+
packageName: PACKAGE_NAME,
|
|
210
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
211
|
+
protoPath: "/v1/interactive-form-sessions/{interactiveFormSessionId}/send-user-message-streamed",
|
|
212
|
+
data: payload,
|
|
213
|
+
host
|
|
214
|
+
}),
|
|
215
|
+
data: payload,
|
|
216
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
217
|
+
{
|
|
218
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
219
|
+
paths: [
|
|
220
|
+
{ path: "responseChunk.numberInputDetails.multipleOf" },
|
|
221
|
+
{
|
|
222
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxInclusiveValue"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
path: "responseChunk.numberInputDetails.rangeLimit.maxExclusiveValue"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
path: "responseChunk.numberInputDetails.rangeLimit.minInclusiveValue"
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
])
|
|
233
|
+
};
|
|
234
|
+
return metadata;
|
|
235
|
+
}
|
|
236
|
+
return __sendUserMessageStreamed;
|
|
237
|
+
}
|
|
238
|
+
function reportConversation(payload) {
|
|
239
|
+
function __reportConversation({ host }) {
|
|
240
|
+
const metadata = {
|
|
241
|
+
entityFqdn: "wix.forms.ai.v1.interactive_form_session",
|
|
242
|
+
method: "POST",
|
|
243
|
+
methodFqn: "wix.forms.ai.v1.InteractiveFormSessionsService.ReportConversation",
|
|
244
|
+
packageName: PACKAGE_NAME,
|
|
245
|
+
url: resolveWixFormsAiV1InteractiveFormSessionsServiceUrl({
|
|
246
|
+
protoPath: "/v1/interactive-form-sessions/report",
|
|
247
|
+
data: payload,
|
|
248
|
+
host
|
|
249
|
+
}),
|
|
250
|
+
data: payload
|
|
251
|
+
};
|
|
252
|
+
return metadata;
|
|
253
|
+
}
|
|
254
|
+
return __reportConversation;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.universal.ts
|
|
258
|
+
var ChunkType = /* @__PURE__ */ ((ChunkType2) => {
|
|
259
|
+
ChunkType2["UNKNOWN_CHUNK_TYPE"] = "UNKNOWN_CHUNK_TYPE";
|
|
260
|
+
ChunkType2["TEXT"] = "TEXT";
|
|
261
|
+
ChunkType2["TEXT_DATA"] = "TEXT_DATA";
|
|
262
|
+
ChunkType2["MULTI_SELECT_INPUT"] = "MULTI_SELECT_INPUT";
|
|
263
|
+
ChunkType2["NUMBER_INPUT"] = "NUMBER_INPUT";
|
|
264
|
+
ChunkType2["SEPARATOR"] = "SEPARATOR";
|
|
265
|
+
ChunkType2["SINGLE_SELECT_INPUT"] = "SINGLE_SELECT_INPUT";
|
|
266
|
+
ChunkType2["ERROR"] = "ERROR";
|
|
267
|
+
ChunkType2["SUBMISSION"] = "SUBMISSION";
|
|
268
|
+
ChunkType2["IMPORTANT_TEXT"] = "IMPORTANT_TEXT";
|
|
269
|
+
ChunkType2["DEBUG"] = "DEBUG";
|
|
270
|
+
ChunkType2["END_OF_RESPONSE"] = "END_OF_RESPONSE";
|
|
271
|
+
ChunkType2["FILE_UPLOAD"] = "FILE_UPLOAD";
|
|
272
|
+
ChunkType2["SIGNATURE"] = "SIGNATURE";
|
|
273
|
+
return ChunkType2;
|
|
274
|
+
})(ChunkType || {});
|
|
275
|
+
var Style = /* @__PURE__ */ ((Style2) => {
|
|
276
|
+
Style2["UNKNOWN_STYLE"] = "UNKNOWN_STYLE";
|
|
277
|
+
Style2["NORMAL"] = "NORMAL";
|
|
278
|
+
Style2["BOLD"] = "BOLD";
|
|
279
|
+
return Style2;
|
|
280
|
+
})(Style || {});
|
|
281
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
282
|
+
Type2["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
283
|
+
Type2["PARAGRAPH"] = "PARAGRAPH";
|
|
284
|
+
return Type2;
|
|
285
|
+
})(Type || {});
|
|
286
|
+
var Role = /* @__PURE__ */ ((Role2) => {
|
|
287
|
+
Role2["UNKNOWN_ROLE"] = "UNKNOWN_ROLE";
|
|
288
|
+
Role2["USER"] = "USER";
|
|
289
|
+
Role2["ASSISTANT"] = "ASSISTANT";
|
|
290
|
+
Role2["FUNCTION_CALL"] = "FUNCTION_CALL";
|
|
291
|
+
Role2["FUNCTION_CALL_OUTPUT"] = "FUNCTION_CALL_OUTPUT";
|
|
292
|
+
Role2["DEVELOPER"] = "DEVELOPER";
|
|
293
|
+
return Role2;
|
|
294
|
+
})(Role || {});
|
|
295
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
296
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
297
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
298
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
299
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
300
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
301
|
+
return WebhookIdentityType2;
|
|
302
|
+
})(WebhookIdentityType || {});
|
|
303
|
+
async function createInteractiveFormSession2(formId, options) {
|
|
304
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
305
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
306
|
+
formId,
|
|
307
|
+
promptId: options?.promptId,
|
|
308
|
+
currentValues: options?.currentValues,
|
|
309
|
+
dryRun: options?.dryRun,
|
|
310
|
+
currentTime: options?.currentTime,
|
|
311
|
+
clientTime: options?.clientTime
|
|
312
|
+
});
|
|
313
|
+
const reqOpts = createInteractiveFormSession(
|
|
314
|
+
payload
|
|
315
|
+
);
|
|
316
|
+
sideEffects?.onSiteCall?.();
|
|
317
|
+
try {
|
|
318
|
+
const result = await httpClient.request(reqOpts);
|
|
319
|
+
sideEffects?.onSuccess?.(result);
|
|
320
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.interactiveFormSession;
|
|
321
|
+
} catch (err) {
|
|
322
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
323
|
+
err,
|
|
324
|
+
{
|
|
325
|
+
spreadPathsToArguments: {},
|
|
326
|
+
explicitPathsToArguments: {
|
|
327
|
+
formId: "$[0]",
|
|
328
|
+
promptId: "$[1].promptId",
|
|
329
|
+
currentValues: "$[1].currentValues",
|
|
330
|
+
dryRun: "$[1].dryRun",
|
|
331
|
+
currentTime: "$[1].currentTime",
|
|
332
|
+
clientTime: "$[1].clientTime"
|
|
333
|
+
},
|
|
334
|
+
singleArgumentUnchanged: false
|
|
335
|
+
},
|
|
336
|
+
["formId", "options"]
|
|
337
|
+
);
|
|
338
|
+
sideEffects?.onError?.(err);
|
|
339
|
+
throw transformedError;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async function createInteractiveFormSessionStreamed2(formId, options) {
|
|
343
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
344
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
345
|
+
formId,
|
|
346
|
+
promptId: options?.promptId,
|
|
347
|
+
currentValues: options?.currentValues,
|
|
348
|
+
dryRun: options?.dryRun,
|
|
349
|
+
currentTime: options?.currentTime,
|
|
350
|
+
clientTime: options?.clientTime
|
|
351
|
+
});
|
|
352
|
+
const reqOpts = createInteractiveFormSessionStreamed(
|
|
353
|
+
payload
|
|
354
|
+
);
|
|
355
|
+
sideEffects?.onSiteCall?.();
|
|
356
|
+
try {
|
|
357
|
+
const result = await httpClient.request(reqOpts);
|
|
358
|
+
sideEffects?.onSuccess?.(result);
|
|
359
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
360
|
+
} catch (err) {
|
|
361
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
362
|
+
err,
|
|
363
|
+
{
|
|
364
|
+
spreadPathsToArguments: {},
|
|
365
|
+
explicitPathsToArguments: {
|
|
366
|
+
formId: "$[0]",
|
|
367
|
+
promptId: "$[1].promptId",
|
|
368
|
+
currentValues: "$[1].currentValues",
|
|
369
|
+
dryRun: "$[1].dryRun",
|
|
370
|
+
currentTime: "$[1].currentTime",
|
|
371
|
+
clientTime: "$[1].clientTime"
|
|
372
|
+
},
|
|
373
|
+
singleArgumentUnchanged: false
|
|
374
|
+
},
|
|
375
|
+
["formId", "options"]
|
|
376
|
+
);
|
|
377
|
+
sideEffects?.onError?.(err);
|
|
378
|
+
throw transformedError;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
async function sendUserMessage2(interactiveFormSessionId, options) {
|
|
382
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
383
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
384
|
+
interactiveFormSessionId,
|
|
385
|
+
input: options?.input,
|
|
386
|
+
currentValues: options?.currentValues
|
|
387
|
+
});
|
|
388
|
+
const reqOpts = sendUserMessage(payload);
|
|
389
|
+
sideEffects?.onSiteCall?.();
|
|
390
|
+
try {
|
|
391
|
+
const result = await httpClient.request(reqOpts);
|
|
392
|
+
sideEffects?.onSuccess?.(result);
|
|
393
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
394
|
+
} catch (err) {
|
|
395
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
396
|
+
err,
|
|
397
|
+
{
|
|
398
|
+
spreadPathsToArguments: {},
|
|
399
|
+
explicitPathsToArguments: {
|
|
400
|
+
interactiveFormSessionId: "$[0]",
|
|
401
|
+
input: "$[1].input",
|
|
402
|
+
currentValues: "$[1].currentValues"
|
|
403
|
+
},
|
|
404
|
+
singleArgumentUnchanged: false
|
|
405
|
+
},
|
|
406
|
+
["interactiveFormSessionId", "options"]
|
|
407
|
+
);
|
|
408
|
+
sideEffects?.onError?.(err);
|
|
409
|
+
throw transformedError;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
async function sendUserMessageStreamed2(interactiveFormSessionId, options) {
|
|
413
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
414
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
415
|
+
interactiveFormSessionId,
|
|
416
|
+
input: options?.input,
|
|
417
|
+
currentValues: options?.currentValues
|
|
418
|
+
});
|
|
419
|
+
const reqOpts = sendUserMessageStreamed(
|
|
420
|
+
payload
|
|
421
|
+
);
|
|
422
|
+
sideEffects?.onSiteCall?.();
|
|
423
|
+
try {
|
|
424
|
+
const result = await httpClient.request(reqOpts);
|
|
425
|
+
sideEffects?.onSuccess?.(result);
|
|
426
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
427
|
+
} catch (err) {
|
|
428
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
429
|
+
err,
|
|
430
|
+
{
|
|
431
|
+
spreadPathsToArguments: {},
|
|
432
|
+
explicitPathsToArguments: {
|
|
433
|
+
interactiveFormSessionId: "$[0]",
|
|
434
|
+
input: "$[1].input",
|
|
435
|
+
currentValues: "$[1].currentValues"
|
|
436
|
+
},
|
|
437
|
+
singleArgumentUnchanged: false
|
|
438
|
+
},
|
|
439
|
+
["interactiveFormSessionId", "options"]
|
|
440
|
+
);
|
|
441
|
+
sideEffects?.onError?.(err);
|
|
442
|
+
throw transformedError;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
async function reportConversation2(options) {
|
|
446
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
447
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
448
|
+
interactiveFormSessionId: options?.interactiveFormSessionId,
|
|
449
|
+
description: options?.description,
|
|
450
|
+
viewerDebugUrl: options?.viewerDebugUrl
|
|
451
|
+
});
|
|
452
|
+
const reqOpts = reportConversation(payload);
|
|
453
|
+
sideEffects?.onSiteCall?.();
|
|
454
|
+
try {
|
|
455
|
+
const result = await httpClient.request(reqOpts);
|
|
456
|
+
sideEffects?.onSuccess?.(result);
|
|
457
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
458
|
+
} catch (err) {
|
|
459
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
460
|
+
err,
|
|
461
|
+
{
|
|
462
|
+
spreadPathsToArguments: {},
|
|
463
|
+
explicitPathsToArguments: {
|
|
464
|
+
interactiveFormSessionId: "$[0].interactiveFormSessionId",
|
|
465
|
+
description: "$[0].description",
|
|
466
|
+
viewerDebugUrl: "$[0].viewerDebugUrl"
|
|
467
|
+
},
|
|
468
|
+
singleArgumentUnchanged: false
|
|
469
|
+
},
|
|
470
|
+
["options"]
|
|
471
|
+
);
|
|
472
|
+
sideEffects?.onError?.(err);
|
|
473
|
+
throw transformedError;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.public.ts
|
|
478
|
+
function createInteractiveFormSession3(httpClient) {
|
|
479
|
+
return (formId, options) => createInteractiveFormSession2(
|
|
480
|
+
formId,
|
|
481
|
+
options,
|
|
482
|
+
// @ts-ignore
|
|
483
|
+
{ httpClient }
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
function createInteractiveFormSessionStreamed3(httpClient) {
|
|
487
|
+
return (formId, options) => createInteractiveFormSessionStreamed2(
|
|
488
|
+
formId,
|
|
489
|
+
options,
|
|
490
|
+
// @ts-ignore
|
|
491
|
+
{ httpClient }
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
function sendUserMessage3(httpClient) {
|
|
495
|
+
return (interactiveFormSessionId, options) => sendUserMessage2(
|
|
496
|
+
interactiveFormSessionId,
|
|
497
|
+
options,
|
|
498
|
+
// @ts-ignore
|
|
499
|
+
{ httpClient }
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
function sendUserMessageStreamed3(httpClient) {
|
|
503
|
+
return (interactiveFormSessionId, options) => sendUserMessageStreamed2(
|
|
504
|
+
interactiveFormSessionId,
|
|
505
|
+
options,
|
|
506
|
+
// @ts-ignore
|
|
507
|
+
{ httpClient }
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
function reportConversation3(httpClient) {
|
|
511
|
+
return (options) => reportConversation2(
|
|
512
|
+
options,
|
|
513
|
+
// @ts-ignore
|
|
514
|
+
{ httpClient }
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// src/forms-ai-v1-interactive-form-session-interactive-form-sessions.context.ts
|
|
519
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
520
|
+
var createInteractiveFormSession4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(createInteractiveFormSession3);
|
|
521
|
+
var createInteractiveFormSessionStreamed4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(createInteractiveFormSessionStreamed3);
|
|
522
|
+
var sendUserMessage4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(sendUserMessage3);
|
|
523
|
+
var sendUserMessageStreamed4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(sendUserMessageStreamed3);
|
|
524
|
+
var reportConversation4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(reportConversation3);
|
|
525
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
526
|
+
0 && (module.exports = {
|
|
527
|
+
ChunkType,
|
|
528
|
+
Role,
|
|
529
|
+
Style,
|
|
530
|
+
Type,
|
|
531
|
+
WebhookIdentityType,
|
|
532
|
+
createInteractiveFormSession,
|
|
533
|
+
createInteractiveFormSessionStreamed,
|
|
534
|
+
reportConversation,
|
|
535
|
+
sendUserMessage,
|
|
536
|
+
sendUserMessageStreamed
|
|
537
|
+
});
|
|
538
|
+
//# sourceMappingURL=index.js.map
|