@wix/auto_sdk_ai-site-chat_widget-settings 1.0.4 → 1.0.6
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 +3 -3
- package/build/cjs/index.js +27 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +86 -11
- package/build/cjs/index.typings.js +27 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +84 -9
- package/build/cjs/meta.js +27 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +3 -3
- package/build/es/index.mjs +24 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +86 -11
- package/build/es/index.typings.mjs +24 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +84 -9
- package/build/es/meta.mjs +24 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -3
- package/build/internal/cjs/index.js +27 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +86 -11
- package/build/internal/cjs/index.typings.js +27 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +84 -9
- package/build/internal/cjs/meta.js +27 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +3 -3
- package/build/internal/es/index.mjs +24 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +86 -11
- package/build/internal/es/index.typings.mjs +24 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +84 -9
- package/build/internal/es/meta.mjs +24 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -7,7 +7,12 @@ interface WidgetSettings {
|
|
|
7
7
|
* @readonly
|
|
8
8
|
*/
|
|
9
9
|
_id?: string | null;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Whether the AI Site-Chat is enabled on the site.
|
|
12
|
+
* @deprecated Whether the AI Site-Chat is enabled on the site.
|
|
13
|
+
* @replacedBy active_hours
|
|
14
|
+
* @targetRemovalDate 2025-12-01
|
|
15
|
+
*/
|
|
11
16
|
enabled?: boolean;
|
|
12
17
|
/** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */
|
|
13
18
|
introMessage?: IntroMessage;
|
|
@@ -25,18 +30,18 @@ interface WidgetSettings {
|
|
|
25
30
|
_updatedDate?: Date | null;
|
|
26
31
|
/** Whether to open the AI Site-Chat automatically when the site loads. */
|
|
27
32
|
autoOpen?: boolean;
|
|
28
|
-
/** Times the AI
|
|
33
|
+
/** Times the AI Site-Chat is available on the site. */
|
|
29
34
|
activeHours?: ActiveHours;
|
|
30
35
|
/** Defines how the AI Site-Chat functions during the non-active hours. */
|
|
31
36
|
offlineBehavior?: OfflineBehaviorWithLiterals;
|
|
32
37
|
/** Whether the AI Site-Chat should send a summary of the site visitor's navigation on the site. */
|
|
33
38
|
navigationSummary?: boolean | null;
|
|
34
39
|
/**
|
|
35
|
-
* Wix Media image ID used for the AI
|
|
40
|
+
* Wix Media image ID used for the AI Site-Chat.
|
|
36
41
|
* @maxLength 500
|
|
37
42
|
*/
|
|
38
43
|
avatar?: string | null;
|
|
39
|
-
/** Whether to display example questions from the AI
|
|
44
|
+
/** Whether to display example questions from the AI Site-Chat. */
|
|
40
45
|
generatedQuestions?: boolean | null;
|
|
41
46
|
}
|
|
42
47
|
/** Intro message */
|
|
@@ -78,14 +83,20 @@ interface ContactForm {
|
|
|
78
83
|
conditions?: Conditions;
|
|
79
84
|
/** Contact form fields. */
|
|
80
85
|
fields?: Fields;
|
|
86
|
+
/** When to show contact form if site owner is available. */
|
|
87
|
+
userConditions?: UserConditions;
|
|
81
88
|
}
|
|
82
|
-
/** Contact form conditions */
|
|
89
|
+
/** Contact form conditions for AI Site-Chat */
|
|
83
90
|
interface Conditions {
|
|
84
91
|
/** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */
|
|
85
92
|
cannotAnswer?: boolean;
|
|
86
93
|
/** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */
|
|
87
94
|
requestForPerson?: boolean;
|
|
88
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Require site visitor to fill contact form before starting a conversation.
|
|
97
|
+
* @deprecated Require site visitor to fill contact form before starting a conversation.
|
|
98
|
+
* @targetRemovalDate 2025-12-01
|
|
99
|
+
*/
|
|
89
100
|
beforeChat?: boolean | null;
|
|
90
101
|
}
|
|
91
102
|
/** Contact form fields */
|
|
@@ -99,9 +110,23 @@ interface Fields {
|
|
|
99
110
|
/** Whether to include a message field in the form. */
|
|
100
111
|
message?: boolean;
|
|
101
112
|
}
|
|
113
|
+
/** Contact form conditions for when site owner is available */
|
|
114
|
+
interface UserConditions {
|
|
115
|
+
/** Show site visitor contact form before starting a conversation. */
|
|
116
|
+
beforeChat?: boolean;
|
|
117
|
+
/** Show site visitor contact form after their first message. */
|
|
118
|
+
afterFirstMessage?: boolean;
|
|
119
|
+
/** Never show site visitor contact form. */
|
|
120
|
+
never?: boolean;
|
|
121
|
+
}
|
|
102
122
|
/** Working hours settings */
|
|
103
123
|
interface ActiveHours {
|
|
104
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.
|
|
126
|
+
* @deprecated Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.
|
|
127
|
+
* @replacedBy availability
|
|
128
|
+
* @targetRemovalDate 2025-12-01
|
|
129
|
+
*/
|
|
105
130
|
always?: boolean;
|
|
106
131
|
/** Times at which the AI Assistant is online. */
|
|
107
132
|
schedule?: Schedule;
|
|
@@ -110,6 +135,8 @@ interface ActiveHours {
|
|
|
110
135
|
* @maxLength 256
|
|
111
136
|
*/
|
|
112
137
|
timeZone?: string;
|
|
138
|
+
/** Hours when AI assistant or site owner are available. */
|
|
139
|
+
mode?: ChatHandlerModeWithLiterals;
|
|
113
140
|
}
|
|
114
141
|
/** Schedule */
|
|
115
142
|
interface Schedule {
|
|
@@ -133,7 +160,7 @@ interface DaySchedule {
|
|
|
133
160
|
/** Whether the day is enabled. */
|
|
134
161
|
enabled?: boolean;
|
|
135
162
|
/**
|
|
136
|
-
* Array of times during which the AI
|
|
163
|
+
* Array of times during which the AI Site-Chat or site owner are available.
|
|
137
164
|
* @maxSize 24
|
|
138
165
|
*/
|
|
139
166
|
frames?: WorkingHoursFrame[];
|
|
@@ -144,7 +171,37 @@ interface WorkingHoursFrame {
|
|
|
144
171
|
start?: number;
|
|
145
172
|
/** End time of the active hours. */
|
|
146
173
|
end?: number;
|
|
174
|
+
/** Who is available during timeframe, AI chat or user chat */
|
|
175
|
+
frameType?: FrameHandlerTypeWithLiterals;
|
|
176
|
+
}
|
|
177
|
+
/** Who is available during timeframe, AI chat or user chat */
|
|
178
|
+
declare enum FrameHandlerType {
|
|
179
|
+
/** Unknown frame type. */
|
|
180
|
+
UNKNOWN_FRAME_TYPE = "UNKNOWN_FRAME_TYPE",
|
|
181
|
+
/** Frame type not selected. */
|
|
182
|
+
NOT_SELECTED = "NOT_SELECTED",
|
|
183
|
+
/** AI Chat available in time frame. */
|
|
184
|
+
AI_CHAT = "AI_CHAT",
|
|
185
|
+
/** Chat with human in time frame. */
|
|
186
|
+
WIX_USER_CHAT = "WIX_USER_CHAT"
|
|
147
187
|
}
|
|
188
|
+
/** @enumType */
|
|
189
|
+
type FrameHandlerTypeWithLiterals = FrameHandlerType | 'UNKNOWN_FRAME_TYPE' | 'NOT_SELECTED' | 'AI_CHAT' | 'WIX_USER_CHAT';
|
|
190
|
+
/** Chat availability options */
|
|
191
|
+
declare enum ChatHandlerMode {
|
|
192
|
+
/** Unknown availability. */
|
|
193
|
+
UNKNOWN_MODE = "UNKNOWN_MODE",
|
|
194
|
+
/** AI assistant is always available. */
|
|
195
|
+
ALWAYS_WITH_AI = "ALWAYS_WITH_AI",
|
|
196
|
+
/** Chat with site owner is always available. */
|
|
197
|
+
ALWAYS_WITH_WIX_USER = "ALWAYS_WITH_WIX_USER",
|
|
198
|
+
/** AI and site owner are available according to schedule. */
|
|
199
|
+
SCHEDULED = "SCHEDULED",
|
|
200
|
+
/** AI assistant and site owner are always offline. */
|
|
201
|
+
OFF = "OFF"
|
|
202
|
+
}
|
|
203
|
+
/** @enumType */
|
|
204
|
+
type ChatHandlerModeWithLiterals = ChatHandlerMode | 'UNKNOWN_MODE' | 'ALWAYS_WITH_AI' | 'ALWAYS_WITH_WIX_USER' | 'SCHEDULED' | 'OFF';
|
|
148
205
|
declare enum OfflineBehavior {
|
|
149
206
|
/** Unknown offline behavior. */
|
|
150
207
|
UNKNOWN_OFFLINE_BEHAVIOR = "UNKNOWN_OFFLINE_BEHAVIOR",
|
|
@@ -167,9 +224,27 @@ interface GetWidgetSettingsResponse {
|
|
|
167
224
|
/**
|
|
168
225
|
* Whether the assistant is currently online.
|
|
169
226
|
* @readonly
|
|
227
|
+
* @deprecated Whether the assistant is currently online.
|
|
228
|
+
* @replacedBy active_handlers
|
|
229
|
+
* @targetRemovalDate 2025-12-01
|
|
170
230
|
*/
|
|
171
231
|
assistantOnline?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Active chat handlers (e.g., AI assistant, site owner).
|
|
234
|
+
* @readonly
|
|
235
|
+
*/
|
|
236
|
+
activeHandlers?: ChatHandlerWithLiterals[];
|
|
172
237
|
}
|
|
238
|
+
declare enum ChatHandler {
|
|
239
|
+
/** Unknown handler. */
|
|
240
|
+
UNKNOWN_HANDLER = "UNKNOWN_HANDLER",
|
|
241
|
+
/** AI assistant is handling chats. */
|
|
242
|
+
AI = "AI",
|
|
243
|
+
/** Site owner is handling chats. */
|
|
244
|
+
WIX_USER = "WIX_USER"
|
|
245
|
+
}
|
|
246
|
+
/** @enumType */
|
|
247
|
+
type ChatHandlerWithLiterals = ChatHandler | 'UNKNOWN_HANDLER' | 'AI' | 'WIX_USER';
|
|
173
248
|
interface SetWidgetSettingsRequest {
|
|
174
249
|
/** Widget settings to update. */
|
|
175
250
|
widgetSettings: WidgetSettings;
|
|
@@ -185,7 +260,7 @@ interface SetWidgetSettingsResponse {
|
|
|
185
260
|
* @applicableIdentity APP
|
|
186
261
|
* @fqn wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings
|
|
187
262
|
*/
|
|
188
|
-
declare function getWidgetSettings(): Promise<NonNullablePaths<GetWidgetSettingsResponse, `widgetSettings.enabled` | `widgetSettings.introMessage.message.enabled` | `widgetSettings.introMessage.message.text` | `widgetSettings.introMessage.suggestions.enabled` | `widgetSettings.introMessage.suggestions.questions` | `widgetSettings.contactForm.conditions.cannotAnswer` | `widgetSettings.contactForm.conditions.requestForPerson` | `widgetSettings.contactForm.fields.name` | `widgetSettings.contactForm.fields.email` | `widgetSettings.contactForm.fields.phone` | `widgetSettings.contactForm.fields.message` | `widgetSettings.autoOpen` | `widgetSettings.activeHours.always` | `widgetSettings.activeHours.schedule.monday.enabled` | `widgetSettings.activeHours.schedule.monday.frames` | `widgetSettings.activeHours.schedule.monday.frames.${number}.start` | `widgetSettings.activeHours.schedule.monday.frames.${number}.end` | `widgetSettings.activeHours.timeZone` | `widgetSettings.offlineBehavior` | `assistantOnline`, 8>>;
|
|
263
|
+
declare function getWidgetSettings(): Promise<NonNullablePaths<GetWidgetSettingsResponse, `widgetSettings.enabled` | `widgetSettings.introMessage.message.enabled` | `widgetSettings.introMessage.message.text` | `widgetSettings.introMessage.suggestions.enabled` | `widgetSettings.introMessage.suggestions.questions` | `widgetSettings.contactForm.conditions.cannotAnswer` | `widgetSettings.contactForm.conditions.requestForPerson` | `widgetSettings.contactForm.fields.name` | `widgetSettings.contactForm.fields.email` | `widgetSettings.contactForm.fields.phone` | `widgetSettings.contactForm.fields.message` | `widgetSettings.contactForm.userConditions.beforeChat` | `widgetSettings.contactForm.userConditions.afterFirstMessage` | `widgetSettings.contactForm.userConditions.never` | `widgetSettings.autoOpen` | `widgetSettings.activeHours.always` | `widgetSettings.activeHours.schedule.monday.enabled` | `widgetSettings.activeHours.schedule.monday.frames` | `widgetSettings.activeHours.schedule.monday.frames.${number}.start` | `widgetSettings.activeHours.schedule.monday.frames.${number}.end` | `widgetSettings.activeHours.schedule.monday.frames.${number}.frameType` | `widgetSettings.activeHours.timeZone` | `widgetSettings.activeHours.mode` | `widgetSettings.offlineBehavior` | `assistantOnline` | `activeHandlers`, 8>>;
|
|
189
264
|
/**
|
|
190
265
|
* Sets the widget settings for the site.
|
|
191
266
|
* @param widgetSettings - Widget settings to update.
|
|
@@ -201,6 +276,6 @@ declare function getWidgetSettings(): Promise<NonNullablePaths<GetWidgetSettings
|
|
|
201
276
|
* @applicableIdentity APP
|
|
202
277
|
* @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings
|
|
203
278
|
*/
|
|
204
|
-
declare function setWidgetSettings(widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage` | `offlineBehavior`, 3>): Promise<NonNullablePaths<SetWidgetSettingsResponse, `widgetSettings.enabled` | `widgetSettings.introMessage.message.enabled` | `widgetSettings.introMessage.message.text` | `widgetSettings.introMessage.suggestions.enabled` | `widgetSettings.introMessage.suggestions.questions` | `widgetSettings.contactForm.conditions.cannotAnswer` | `widgetSettings.contactForm.conditions.requestForPerson` | `widgetSettings.contactForm.fields.name` | `widgetSettings.contactForm.fields.email` | `widgetSettings.contactForm.fields.phone` | `widgetSettings.contactForm.fields.message` | `widgetSettings.autoOpen` | `widgetSettings.activeHours.always` | `widgetSettings.activeHours.schedule.monday.enabled` | `widgetSettings.activeHours.schedule.monday.frames` | `widgetSettings.activeHours.schedule.monday.frames.${number}.start` | `widgetSettings.activeHours.schedule.monday.frames.${number}.end` | `widgetSettings.activeHours.timeZone` | `widgetSettings.offlineBehavior`, 8>>;
|
|
279
|
+
declare function setWidgetSettings(widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage` | `offlineBehavior`, 3>): Promise<NonNullablePaths<SetWidgetSettingsResponse, `widgetSettings.enabled` | `widgetSettings.introMessage.message.enabled` | `widgetSettings.introMessage.message.text` | `widgetSettings.introMessage.suggestions.enabled` | `widgetSettings.introMessage.suggestions.questions` | `widgetSettings.contactForm.conditions.cannotAnswer` | `widgetSettings.contactForm.conditions.requestForPerson` | `widgetSettings.contactForm.fields.name` | `widgetSettings.contactForm.fields.email` | `widgetSettings.contactForm.fields.phone` | `widgetSettings.contactForm.fields.message` | `widgetSettings.contactForm.userConditions.beforeChat` | `widgetSettings.contactForm.userConditions.afterFirstMessage` | `widgetSettings.contactForm.userConditions.never` | `widgetSettings.autoOpen` | `widgetSettings.activeHours.always` | `widgetSettings.activeHours.schedule.monday.enabled` | `widgetSettings.activeHours.schedule.monday.frames` | `widgetSettings.activeHours.schedule.monday.frames.${number}.start` | `widgetSettings.activeHours.schedule.monday.frames.${number}.end` | `widgetSettings.activeHours.schedule.monday.frames.${number}.frameType` | `widgetSettings.activeHours.timeZone` | `widgetSettings.activeHours.mode` | `widgetSettings.offlineBehavior`, 8>>;
|
|
205
280
|
|
|
206
|
-
export { type ActiveHours, type Conditions, type ContactForm, type DaySchedule, type Fields, type GetWidgetSettingsRequest, type GetWidgetSettingsResponse, type IntroMessage, OfflineBehavior, type OfflineBehaviorWithLiterals, type Schedule, type SetWidgetSettingsRequest, type SetWidgetSettingsResponse, type SettingsMessage, type SuggestedQuestions, type WidgetSettings, type WorkingHoursFrame, getWidgetSettings, setWidgetSettings };
|
|
281
|
+
export { type ActiveHours, ChatHandler, ChatHandlerMode, type ChatHandlerModeWithLiterals, type ChatHandlerWithLiterals, type Conditions, type ContactForm, type DaySchedule, type Fields, FrameHandlerType, type FrameHandlerTypeWithLiterals, type GetWidgetSettingsRequest, type GetWidgetSettingsResponse, type IntroMessage, OfflineBehavior, type OfflineBehaviorWithLiterals, type Schedule, type SetWidgetSettingsRequest, type SetWidgetSettingsResponse, type SettingsMessage, type SuggestedQuestions, type UserConditions, type WidgetSettings, type WorkingHoursFrame, getWidgetSettings, setWidgetSettings };
|
|
@@ -146,6 +146,21 @@ function setWidgetSettings(payload) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
// src/innovation-widget-v1-widget-settings-widget-settings.universal.ts
|
|
149
|
+
var FrameHandlerType = /* @__PURE__ */ ((FrameHandlerType2) => {
|
|
150
|
+
FrameHandlerType2["UNKNOWN_FRAME_TYPE"] = "UNKNOWN_FRAME_TYPE";
|
|
151
|
+
FrameHandlerType2["NOT_SELECTED"] = "NOT_SELECTED";
|
|
152
|
+
FrameHandlerType2["AI_CHAT"] = "AI_CHAT";
|
|
153
|
+
FrameHandlerType2["WIX_USER_CHAT"] = "WIX_USER_CHAT";
|
|
154
|
+
return FrameHandlerType2;
|
|
155
|
+
})(FrameHandlerType || {});
|
|
156
|
+
var ChatHandlerMode = /* @__PURE__ */ ((ChatHandlerMode2) => {
|
|
157
|
+
ChatHandlerMode2["UNKNOWN_MODE"] = "UNKNOWN_MODE";
|
|
158
|
+
ChatHandlerMode2["ALWAYS_WITH_AI"] = "ALWAYS_WITH_AI";
|
|
159
|
+
ChatHandlerMode2["ALWAYS_WITH_WIX_USER"] = "ALWAYS_WITH_WIX_USER";
|
|
160
|
+
ChatHandlerMode2["SCHEDULED"] = "SCHEDULED";
|
|
161
|
+
ChatHandlerMode2["OFF"] = "OFF";
|
|
162
|
+
return ChatHandlerMode2;
|
|
163
|
+
})(ChatHandlerMode || {});
|
|
149
164
|
var OfflineBehavior = /* @__PURE__ */ ((OfflineBehavior2) => {
|
|
150
165
|
OfflineBehavior2["UNKNOWN_OFFLINE_BEHAVIOR"] = "UNKNOWN_OFFLINE_BEHAVIOR";
|
|
151
166
|
OfflineBehavior2["CHAT_ONLY"] = "CHAT_ONLY";
|
|
@@ -154,6 +169,12 @@ var OfflineBehavior = /* @__PURE__ */ ((OfflineBehavior2) => {
|
|
|
154
169
|
OfflineBehavior2["CONTACT_FORM_WITH_CHAT"] = "CONTACT_FORM_WITH_CHAT";
|
|
155
170
|
return OfflineBehavior2;
|
|
156
171
|
})(OfflineBehavior || {});
|
|
172
|
+
var ChatHandler = /* @__PURE__ */ ((ChatHandler2) => {
|
|
173
|
+
ChatHandler2["UNKNOWN_HANDLER"] = "UNKNOWN_HANDLER";
|
|
174
|
+
ChatHandler2["AI"] = "AI";
|
|
175
|
+
ChatHandler2["WIX_USER"] = "WIX_USER";
|
|
176
|
+
return ChatHandler2;
|
|
177
|
+
})(ChatHandler || {});
|
|
157
178
|
async function getWidgetSettings2() {
|
|
158
179
|
const { httpClient, sideEffects } = arguments[0];
|
|
159
180
|
const payload = renameKeysFromSDKRequestToRESTRequest({});
|
|
@@ -203,6 +224,9 @@ async function setWidgetSettings2(widgetSettings) {
|
|
|
203
224
|
}
|
|
204
225
|
}
|
|
205
226
|
export {
|
|
227
|
+
ChatHandler,
|
|
228
|
+
ChatHandlerMode,
|
|
229
|
+
FrameHandlerType,
|
|
206
230
|
OfflineBehavior,
|
|
207
231
|
getWidgetSettings2 as getWidgetSettings,
|
|
208
232
|
setWidgetSettings2 as setWidgetSettings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettings from './innovation-widget-v1-widget-settings-widget-settings.http.js';\n\nexport interface WidgetSettings {\n /**\n * Widget settings ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /** Whether the AI Site-Chat is enabled on the site. */\n enabled?: boolean;\n /** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */\n introMessage?: IntroMessage;\n /** Settings for the contact form. */\n contactForm?: ContactForm;\n /**\n * Date and time the widget settings were created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the widget settings were updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether to open the AI Site-Chat automatically when the site loads. */\n autoOpen?: boolean;\n /** Times the AI assistant is available on the site. */\n activeHours?: ActiveHours;\n /** Defines how the AI Site-Chat functions during the non-active hours. */\n offlineBehavior?: OfflineBehaviorWithLiterals;\n /** Whether the AI Site-Chat should send a summary of the site visitor's navigation on the site. */\n navigationSummary?: boolean | null;\n /**\n * Wix Media image ID used for the AI assistant.\n * @maxLength 500\n */\n avatar?: string | null;\n /** Whether to display example questions from the AI assistant. */\n generatedQuestions?: boolean | null;\n}\n\n/** Intro message */\nexport interface IntroMessage {\n /** Main message settings. */\n message?: SettingsMessage;\n /** Legal disclaimer message settings. */\n legalDisclaimer?: SettingsMessage;\n /** Offline message settings. */\n offlineDisclaimer?: SettingsMessage;\n /** Message shown as popup to engage the site visitor with the AI assistant. */\n engage?: SettingsMessage;\n /** Suggested questions shown to the site visitor to help them get started. */\n suggestions?: SuggestedQuestions;\n}\n\nexport interface SettingsMessage {\n /** Whether the message is enabled. */\n enabled?: boolean;\n /**\n * Message content.\n * @maxLength 1000\n */\n text?: string;\n}\n\nexport interface SuggestedQuestions {\n /** Whether suggesting questions is enabled. */\n enabled?: boolean;\n /**\n * Suggested questions shown to the site visitor to help them get started.\n * @minSize 1\n * @maxSize 5\n */\n questions?: SettingsMessage[];\n /** Introduction message for the suggested questions. */\n introduction?: SettingsMessage;\n}\n\nexport interface ContactForm {\n /** When the AI Site-Chat should send the contact form. */\n conditions?: Conditions;\n /** Contact form fields. */\n fields?: Fields;\n}\n\n/** Contact form conditions */\nexport interface Conditions {\n /** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */\n cannotAnswer?: boolean;\n /** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */\n requestForPerson?: boolean;\n /** Require site visitor to fill contact form before starting a conversation. */\n beforeChat?: boolean | null;\n}\n\n/** Contact form fields */\nexport interface Fields {\n /** Whether to include a name field in the form. */\n name?: boolean;\n /** Whether to include an email field in the form. */\n email?: boolean;\n /** Whether to include a phone number field in the form. */\n phone?: boolean;\n /** Whether to include a message field in the form. */\n message?: boolean;\n}\n\n/** Working hours settings */\nexport interface ActiveHours {\n /** Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored. */\n always?: boolean;\n /** Times at which the AI Assistant is online. */\n schedule?: Schedule;\n /**\n * Timezone used for the schedule.\n * @maxLength 256\n */\n timeZone?: string;\n}\n\n/** Schedule */\nexport interface Schedule {\n /** Monday schedule. */\n monday?: DaySchedule;\n /** Tuesday schedule. */\n tuesday?: DaySchedule;\n /** Wednesday schedule. */\n wednesday?: DaySchedule;\n /** Thursday schedule. */\n thursday?: DaySchedule;\n /** Friday schedule. */\n friday?: DaySchedule;\n /** Saturday schedule. */\n saturday?: DaySchedule;\n /** Sunday schedule. */\n sunday?: DaySchedule;\n}\n\n/** Day schedule */\nexport interface DaySchedule {\n /** Whether the day is enabled. */\n enabled?: boolean;\n /**\n * Array of times during which the AI Assistant is active.\n * @maxSize 24\n */\n frames?: WorkingHoursFrame[];\n}\n\n/** Working hours frame */\nexport interface WorkingHoursFrame {\n /** Start time of the active hours. */\n start?: number;\n /** End time of the active hours. */\n end?: number;\n}\n\nexport enum OfflineBehavior {\n /** Unknown offline behavior. */\n UNKNOWN_OFFLINE_BEHAVIOR = 'UNKNOWN_OFFLINE_BEHAVIOR',\n /** Allows the site visitor to write messages, but doesn't send a contact form. */\n CHAT_ONLY = 'CHAT_ONLY',\n /** Hides the AI Site-Chat from the site. */\n HIDE = 'HIDE',\n /** Doesn't allow the site visitor to write messages, but does send a contact form. */\n CONTACT_FORM_WITHOUT_CHAT = 'CONTACT_FORM_WITHOUT_CHAT',\n /** Allows the site visitor to write messages and sends a contact form. */\n CONTACT_FORM_WITH_CHAT = 'CONTACT_FORM_WITH_CHAT',\n}\n\n/** @enumType */\nexport type OfflineBehaviorWithLiterals =\n | OfflineBehavior\n | 'UNKNOWN_OFFLINE_BEHAVIOR'\n | 'CHAT_ONLY'\n | 'HIDE'\n | 'CONTACT_FORM_WITHOUT_CHAT'\n | 'CONTACT_FORM_WITH_CHAT';\n\nexport interface GetWidgetSettingsRequest {}\n\nexport interface GetWidgetSettingsResponse {\n /** Retrieved widget settings. */\n widgetSettings?: WidgetSettings;\n /**\n * Whether the assistant is currently online.\n * @readonly\n */\n assistantOnline?: boolean;\n}\n\nexport interface SetWidgetSettingsRequest {\n /** Widget settings to update. */\n widgetSettings: WidgetSettings;\n}\n\nexport interface SetWidgetSettingsResponse {\n /** Updated widget settings. */\n widgetSettings?: WidgetSettings;\n}\n\n/**\n * Retrieves the widget settings for the site.\n * @public\n * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_READ\n * @applicableIdentity APP\n * @fqn wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings\n */\nexport async function getWidgetSettings(): Promise<\n NonNullablePaths<\n GetWidgetSettingsResponse,\n | `widgetSettings.enabled`\n | `widgetSettings.introMessage.message.enabled`\n | `widgetSettings.introMessage.message.text`\n | `widgetSettings.introMessage.suggestions.enabled`\n | `widgetSettings.introMessage.suggestions.questions`\n | `widgetSettings.contactForm.conditions.cannotAnswer`\n | `widgetSettings.contactForm.conditions.requestForPerson`\n | `widgetSettings.contactForm.fields.name`\n | `widgetSettings.contactForm.fields.email`\n | `widgetSettings.contactForm.fields.phone`\n | `widgetSettings.contactForm.fields.message`\n | `widgetSettings.autoOpen`\n | `widgetSettings.activeHours.always`\n | `widgetSettings.activeHours.schedule.monday.enabled`\n | `widgetSettings.activeHours.schedule.monday.frames`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.start`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.end`\n | `widgetSettings.activeHours.timeZone`\n | `widgetSettings.offlineBehavior`\n | `assistantOnline`,\n 8\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixInnovationWidgetV1WidgetSettings.getWidgetSettings(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Sets the widget settings for the site.\n * @param widgetSettings - Widget settings to update.\n * @public\n * @requiredField widgetSettings\n * @requiredField widgetSettings.activeHours\n * @requiredField widgetSettings.contactForm\n * @requiredField widgetSettings.contactForm.conditions\n * @requiredField widgetSettings.contactForm.fields\n * @requiredField widgetSettings.introMessage\n * @requiredField widgetSettings.offlineBehavior\n * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_WRITE\n * @applicableIdentity APP\n * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings\n */\nexport async function setWidgetSettings(\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`\n | `offlineBehavior`,\n 3\n >\n): Promise<\n NonNullablePaths<\n SetWidgetSettingsResponse,\n | `widgetSettings.enabled`\n | `widgetSettings.introMessage.message.enabled`\n | `widgetSettings.introMessage.message.text`\n | `widgetSettings.introMessage.suggestions.enabled`\n | `widgetSettings.introMessage.suggestions.questions`\n | `widgetSettings.contactForm.conditions.cannotAnswer`\n | `widgetSettings.contactForm.conditions.requestForPerson`\n | `widgetSettings.contactForm.fields.name`\n | `widgetSettings.contactForm.fields.email`\n | `widgetSettings.contactForm.fields.phone`\n | `widgetSettings.contactForm.fields.message`\n | `widgetSettings.autoOpen`\n | `widgetSettings.activeHours.always`\n | `widgetSettings.activeHours.schedule.monday.enabled`\n | `widgetSettings.activeHours.schedule.monday.frames`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.start`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.end`\n | `widgetSettings.activeHours.timeZone`\n | `widgetSettings.offlineBehavior`,\n 8\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n widgetSettings: widgetSettings,\n });\n\n const reqOpts =\n ambassadorWixInnovationWidgetV1WidgetSettings.setWidgetSettings(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { widgetSettings: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['widgetSettings']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInnovationAssistantWidgetV1SettingsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n {\n srcPath: '/innovation/widget',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-assistant-widget',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ai-site-chat_widget-settings';\n\n/** Retrieves the widget settings for the site. */\nexport function getWidgetSettings(payload: object): RequestOptionsFactory<any> {\n function __getWidgetSettings({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.innovation.widget.v1.widget_settings',\n method: 'GET' as any,\n methodFqn:\n 'wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInnovationAssistantWidgetV1SettingsUrl({\n protoPath: '/v1/settings',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getWidgetSettings;\n}\n\n/** Sets the widget settings for the site. */\nexport function setWidgetSettings(payload: object): RequestOptionsFactory<any> {\n function __setWidgetSettings({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.innovation.widget.v1.widget_settings',\n method: 'POST' as any,\n methodFqn:\n 'wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInnovationAssistantWidgetV1SettingsUrl({\n protoPath: '/v1/settings',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __setWidgetSettings;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,iDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,S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A0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAiBA,eAAsBC,mBACpB,gBAkCA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAC0C,kBAAkB,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,gBAAgB,OAAO;AAAA,QACnD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,gBAAgB;AAAA,IACnB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","OfflineBehavior","getWidgetSettings","setWidgetSettings"]}
|
|
1
|
+
{"version":3,"sources":["../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettings from './innovation-widget-v1-widget-settings-widget-settings.http.js';\n\nexport interface WidgetSettings {\n /**\n * Widget settings ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Whether the AI Site-Chat is enabled on the site.\n * @deprecated Whether the AI Site-Chat is enabled on the site.\n * @replacedBy active_hours\n * @targetRemovalDate 2025-12-01\n */\n enabled?: boolean;\n /** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */\n introMessage?: IntroMessage;\n /** Settings for the contact form. */\n contactForm?: ContactForm;\n /**\n * Date and time the widget settings were created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the widget settings were updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether to open the AI Site-Chat automatically when the site loads. */\n autoOpen?: boolean;\n /** Times the AI Site-Chat is available on the site. */\n activeHours?: ActiveHours;\n /** Defines how the AI Site-Chat functions during the non-active hours. */\n offlineBehavior?: OfflineBehaviorWithLiterals;\n /** Whether the AI Site-Chat should send a summary of the site visitor's navigation on the site. */\n navigationSummary?: boolean | null;\n /**\n * Wix Media image ID used for the AI Site-Chat.\n * @maxLength 500\n */\n avatar?: string | null;\n /** Whether to display example questions from the AI Site-Chat. */\n generatedQuestions?: boolean | null;\n}\n\n/** Intro message */\nexport interface IntroMessage {\n /** Main message settings. */\n message?: SettingsMessage;\n /** Legal disclaimer message settings. */\n legalDisclaimer?: SettingsMessage;\n /** Offline message settings. */\n offlineDisclaimer?: SettingsMessage;\n /** Message shown as popup to engage the site visitor with the AI assistant. */\n engage?: SettingsMessage;\n /** Suggested questions shown to the site visitor to help them get started. */\n suggestions?: SuggestedQuestions;\n}\n\nexport interface SettingsMessage {\n /** Whether the message is enabled. */\n enabled?: boolean;\n /**\n * Message content.\n * @maxLength 1000\n */\n text?: string;\n}\n\nexport interface SuggestedQuestions {\n /** Whether suggesting questions is enabled. */\n enabled?: boolean;\n /**\n * Suggested questions shown to the site visitor to help them get started.\n * @minSize 1\n * @maxSize 5\n */\n questions?: SettingsMessage[];\n /** Introduction message for the suggested questions. */\n introduction?: SettingsMessage;\n}\n\nexport interface ContactForm {\n /** When the AI Site-Chat should send the contact form. */\n conditions?: Conditions;\n /** Contact form fields. */\n fields?: Fields;\n /** When to show contact form if site owner is available. */\n userConditions?: UserConditions;\n}\n\n/** Contact form conditions for AI Site-Chat */\nexport interface Conditions {\n /** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */\n cannotAnswer?: boolean;\n /** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */\n requestForPerson?: boolean;\n /**\n * Require site visitor to fill contact form before starting a conversation.\n * @deprecated Require site visitor to fill contact form before starting a conversation.\n * @targetRemovalDate 2025-12-01\n */\n beforeChat?: boolean | null;\n}\n\n/** Contact form fields */\nexport interface Fields {\n /** Whether to include a name field in the form. */\n name?: boolean;\n /** Whether to include an email field in the form. */\n email?: boolean;\n /** Whether to include a phone number field in the form. */\n phone?: boolean;\n /** Whether to include a message field in the form. */\n message?: boolean;\n}\n\n/** Contact form conditions for when site owner is available */\nexport interface UserConditions {\n /** Show site visitor contact form before starting a conversation. */\n beforeChat?: boolean;\n /** Show site visitor contact form after their first message. */\n afterFirstMessage?: boolean;\n /** Never show site visitor contact form. */\n never?: boolean;\n}\n\n/** Working hours settings */\nexport interface ActiveHours {\n /**\n * Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.\n * @deprecated Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.\n * @replacedBy availability\n * @targetRemovalDate 2025-12-01\n */\n always?: boolean;\n /** Times at which the AI Assistant is online. */\n schedule?: Schedule;\n /**\n * Timezone used for the schedule.\n * @maxLength 256\n */\n timeZone?: string;\n /** Hours when AI assistant or site owner are available. */\n mode?: ChatHandlerModeWithLiterals;\n}\n\n/** Schedule */\nexport interface Schedule {\n /** Monday schedule. */\n monday?: DaySchedule;\n /** Tuesday schedule. */\n tuesday?: DaySchedule;\n /** Wednesday schedule. */\n wednesday?: DaySchedule;\n /** Thursday schedule. */\n thursday?: DaySchedule;\n /** Friday schedule. */\n friday?: DaySchedule;\n /** Saturday schedule. */\n saturday?: DaySchedule;\n /** Sunday schedule. */\n sunday?: DaySchedule;\n}\n\n/** Day schedule */\nexport interface DaySchedule {\n /** Whether the day is enabled. */\n enabled?: boolean;\n /**\n * Array of times during which the AI Site-Chat or site owner are available.\n * @maxSize 24\n */\n frames?: WorkingHoursFrame[];\n}\n\n/** Working hours frame */\nexport interface WorkingHoursFrame {\n /** Start time of the active hours. */\n start?: number;\n /** End time of the active hours. */\n end?: number;\n /** Who is available during timeframe, AI chat or user chat */\n frameType?: FrameHandlerTypeWithLiterals;\n}\n\n/** Who is available during timeframe, AI chat or user chat */\nexport enum FrameHandlerType {\n /** Unknown frame type. */\n UNKNOWN_FRAME_TYPE = 'UNKNOWN_FRAME_TYPE',\n /** Frame type not selected. */\n NOT_SELECTED = 'NOT_SELECTED',\n /** AI Chat available in time frame. */\n AI_CHAT = 'AI_CHAT',\n /** Chat with human in time frame. */\n WIX_USER_CHAT = 'WIX_USER_CHAT',\n}\n\n/** @enumType */\nexport type FrameHandlerTypeWithLiterals =\n | FrameHandlerType\n | 'UNKNOWN_FRAME_TYPE'\n | 'NOT_SELECTED'\n | 'AI_CHAT'\n | 'WIX_USER_CHAT';\n\n/** Chat availability options */\nexport enum ChatHandlerMode {\n /** Unknown availability. */\n UNKNOWN_MODE = 'UNKNOWN_MODE',\n /** AI assistant is always available. */\n ALWAYS_WITH_AI = 'ALWAYS_WITH_AI',\n /** Chat with site owner is always available. */\n ALWAYS_WITH_WIX_USER = 'ALWAYS_WITH_WIX_USER',\n /** AI and site owner are available according to schedule. */\n SCHEDULED = 'SCHEDULED',\n /** AI assistant and site owner are always offline. */\n OFF = 'OFF',\n}\n\n/** @enumType */\nexport type ChatHandlerModeWithLiterals =\n | ChatHandlerMode\n | 'UNKNOWN_MODE'\n | 'ALWAYS_WITH_AI'\n | 'ALWAYS_WITH_WIX_USER'\n | 'SCHEDULED'\n | 'OFF';\n\nexport enum OfflineBehavior {\n /** Unknown offline behavior. */\n UNKNOWN_OFFLINE_BEHAVIOR = 'UNKNOWN_OFFLINE_BEHAVIOR',\n /** Allows the site visitor to write messages, but doesn't send a contact form. */\n CHAT_ONLY = 'CHAT_ONLY',\n /** Hides the AI Site-Chat from the site. */\n HIDE = 'HIDE',\n /** Doesn't allow the site visitor to write messages, but does send a contact form. */\n CONTACT_FORM_WITHOUT_CHAT = 'CONTACT_FORM_WITHOUT_CHAT',\n /** Allows the site visitor to write messages and sends a contact form. */\n CONTACT_FORM_WITH_CHAT = 'CONTACT_FORM_WITH_CHAT',\n}\n\n/** @enumType */\nexport type OfflineBehaviorWithLiterals =\n | OfflineBehavior\n | 'UNKNOWN_OFFLINE_BEHAVIOR'\n | 'CHAT_ONLY'\n | 'HIDE'\n | 'CONTACT_FORM_WITHOUT_CHAT'\n | 'CONTACT_FORM_WITH_CHAT';\n\nexport interface GetWidgetSettingsRequest {}\n\nexport interface GetWidgetSettingsResponse {\n /** Retrieved widget settings. */\n widgetSettings?: WidgetSettings;\n /**\n * Whether the assistant is currently online.\n * @readonly\n * @deprecated Whether the assistant is currently online.\n * @replacedBy active_handlers\n * @targetRemovalDate 2025-12-01\n */\n assistantOnline?: boolean;\n /**\n * Active chat handlers (e.g., AI assistant, site owner).\n * @readonly\n */\n activeHandlers?: ChatHandlerWithLiterals[];\n}\n\nexport enum ChatHandler {\n /** Unknown handler. */\n UNKNOWN_HANDLER = 'UNKNOWN_HANDLER',\n /** AI assistant is handling chats. */\n AI = 'AI',\n /** Site owner is handling chats. */\n WIX_USER = 'WIX_USER',\n}\n\n/** @enumType */\nexport type ChatHandlerWithLiterals =\n | ChatHandler\n | 'UNKNOWN_HANDLER'\n | 'AI'\n | 'WIX_USER';\n\nexport interface SetWidgetSettingsRequest {\n /** Widget settings to update. */\n widgetSettings: WidgetSettings;\n}\n\nexport interface SetWidgetSettingsResponse {\n /** Updated widget settings. */\n widgetSettings?: WidgetSettings;\n}\n\n/**\n * Retrieves the widget settings for the site.\n * @public\n * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_READ\n * @applicableIdentity APP\n * @fqn wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings\n */\nexport async function getWidgetSettings(): Promise<\n NonNullablePaths<\n GetWidgetSettingsResponse,\n | `widgetSettings.enabled`\n | `widgetSettings.introMessage.message.enabled`\n | `widgetSettings.introMessage.message.text`\n | `widgetSettings.introMessage.suggestions.enabled`\n | `widgetSettings.introMessage.suggestions.questions`\n | `widgetSettings.contactForm.conditions.cannotAnswer`\n | `widgetSettings.contactForm.conditions.requestForPerson`\n | `widgetSettings.contactForm.fields.name`\n | `widgetSettings.contactForm.fields.email`\n | `widgetSettings.contactForm.fields.phone`\n | `widgetSettings.contactForm.fields.message`\n | `widgetSettings.contactForm.userConditions.beforeChat`\n | `widgetSettings.contactForm.userConditions.afterFirstMessage`\n | `widgetSettings.contactForm.userConditions.never`\n | `widgetSettings.autoOpen`\n | `widgetSettings.activeHours.always`\n | `widgetSettings.activeHours.schedule.monday.enabled`\n | `widgetSettings.activeHours.schedule.monday.frames`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.start`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.end`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.frameType`\n | `widgetSettings.activeHours.timeZone`\n | `widgetSettings.activeHours.mode`\n | `widgetSettings.offlineBehavior`\n | `assistantOnline`\n | `activeHandlers`,\n 8\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixInnovationWidgetV1WidgetSettings.getWidgetSettings(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Sets the widget settings for the site.\n * @param widgetSettings - Widget settings to update.\n * @public\n * @requiredField widgetSettings\n * @requiredField widgetSettings.activeHours\n * @requiredField widgetSettings.contactForm\n * @requiredField widgetSettings.contactForm.conditions\n * @requiredField widgetSettings.contactForm.fields\n * @requiredField widgetSettings.introMessage\n * @requiredField widgetSettings.offlineBehavior\n * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_WRITE\n * @applicableIdentity APP\n * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings\n */\nexport async function setWidgetSettings(\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`\n | `offlineBehavior`,\n 3\n >\n): Promise<\n NonNullablePaths<\n SetWidgetSettingsResponse,\n | `widgetSettings.enabled`\n | `widgetSettings.introMessage.message.enabled`\n | `widgetSettings.introMessage.message.text`\n | `widgetSettings.introMessage.suggestions.enabled`\n | `widgetSettings.introMessage.suggestions.questions`\n | `widgetSettings.contactForm.conditions.cannotAnswer`\n | `widgetSettings.contactForm.conditions.requestForPerson`\n | `widgetSettings.contactForm.fields.name`\n | `widgetSettings.contactForm.fields.email`\n | `widgetSettings.contactForm.fields.phone`\n | `widgetSettings.contactForm.fields.message`\n | `widgetSettings.contactForm.userConditions.beforeChat`\n | `widgetSettings.contactForm.userConditions.afterFirstMessage`\n | `widgetSettings.contactForm.userConditions.never`\n | `widgetSettings.autoOpen`\n | `widgetSettings.activeHours.always`\n | `widgetSettings.activeHours.schedule.monday.enabled`\n | `widgetSettings.activeHours.schedule.monday.frames`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.start`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.end`\n | `widgetSettings.activeHours.schedule.monday.frames.${number}.frameType`\n | `widgetSettings.activeHours.timeZone`\n | `widgetSettings.activeHours.mode`\n | `widgetSettings.offlineBehavior`,\n 8\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n widgetSettings: widgetSettings,\n });\n\n const reqOpts =\n ambassadorWixInnovationWidgetV1WidgetSettings.setWidgetSettings(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { widgetSettings: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['widgetSettings']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInnovationAssistantWidgetV1SettingsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wix-assistant-widget',\n destPath: '',\n },\n {\n srcPath: '/innovation/widget',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/wix-assistant-widget',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ai-site-chat_widget-settings';\n\n/** Retrieves the widget settings for the site. */\nexport function getWidgetSettings(payload: object): RequestOptionsFactory<any> {\n function __getWidgetSettings({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.innovation.widget.v1.widget_settings',\n method: 'GET' as any,\n methodFqn:\n 'wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInnovationAssistantWidgetV1SettingsUrl({\n protoPath: '/v1/settings',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getWidgetSettings;\n}\n\n/** Sets the widget settings for the site. */\nexport function setWidgetSettings(payload: object): RequestOptionsFactory<any> {\n function __setWidgetSettings({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.innovation.widget.v1.widget_settings',\n method: 'POST' as any,\n methodFqn:\n 'wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInnovationAssistantWidgetV1SettingsUrl({\n protoPath: '/v1/settings',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'widgetSettings.createdDate' },\n { path: 'widgetSettings.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __setWidgetSettings;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,iDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AA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IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAiBA,eAAsBC,mBACpB,gBAuCA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAC0C,kBAAkB,OAAO;AAEzE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,gBAAgB,OAAO;AAAA,QACnD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,gBAAgB;AAAA,IACnB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","FrameHandlerType","ChatHandlerMode","OfflineBehavior","ChatHandler","getWidgetSettings","setWidgetSettings"]}
|
package/build/es/meta.d.mts
CHANGED
|
@@ -8,7 +8,12 @@ interface WidgetSettings {
|
|
|
8
8
|
* @readonly
|
|
9
9
|
*/
|
|
10
10
|
id?: string | null;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Whether the AI Site-Chat is enabled on the site.
|
|
13
|
+
* @deprecated Whether the AI Site-Chat is enabled on the site.
|
|
14
|
+
* @replacedBy active_hours
|
|
15
|
+
* @targetRemovalDate 2025-12-01
|
|
16
|
+
*/
|
|
12
17
|
enabled?: boolean;
|
|
13
18
|
/** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */
|
|
14
19
|
introMessage?: IntroMessage;
|
|
@@ -26,18 +31,18 @@ interface WidgetSettings {
|
|
|
26
31
|
updatedDate?: Date | null;
|
|
27
32
|
/** Whether to open the AI Site-Chat automatically when the site loads. */
|
|
28
33
|
autoOpen?: boolean;
|
|
29
|
-
/** Times the AI
|
|
34
|
+
/** Times the AI Site-Chat is available on the site. */
|
|
30
35
|
activeHours?: ActiveHours;
|
|
31
36
|
/** Defines how the AI Site-Chat functions during the non-active hours. */
|
|
32
37
|
offlineBehavior?: OfflineBehaviorWithLiterals;
|
|
33
38
|
/** Whether the AI Site-Chat should send a summary of the site visitor's navigation on the site. */
|
|
34
39
|
navigationSummary?: boolean | null;
|
|
35
40
|
/**
|
|
36
|
-
* Wix Media image ID used for the AI
|
|
41
|
+
* Wix Media image ID used for the AI Site-Chat.
|
|
37
42
|
* @maxLength 500
|
|
38
43
|
*/
|
|
39
44
|
avatar?: string | null;
|
|
40
|
-
/** Whether to display example questions from the AI
|
|
45
|
+
/** Whether to display example questions from the AI Site-Chat. */
|
|
41
46
|
generatedQuestions?: boolean | null;
|
|
42
47
|
}
|
|
43
48
|
/** Intro message */
|
|
@@ -79,14 +84,20 @@ interface ContactForm {
|
|
|
79
84
|
conditions?: Conditions;
|
|
80
85
|
/** Contact form fields. */
|
|
81
86
|
fields?: Fields;
|
|
87
|
+
/** When to show contact form if site owner is available. */
|
|
88
|
+
userConditions?: UserConditions;
|
|
82
89
|
}
|
|
83
|
-
/** Contact form conditions */
|
|
90
|
+
/** Contact form conditions for AI Site-Chat */
|
|
84
91
|
interface Conditions {
|
|
85
92
|
/** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */
|
|
86
93
|
cannotAnswer?: boolean;
|
|
87
94
|
/** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */
|
|
88
95
|
requestForPerson?: boolean;
|
|
89
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Require site visitor to fill contact form before starting a conversation.
|
|
98
|
+
* @deprecated Require site visitor to fill contact form before starting a conversation.
|
|
99
|
+
* @targetRemovalDate 2025-12-01
|
|
100
|
+
*/
|
|
90
101
|
beforeChat?: boolean | null;
|
|
91
102
|
}
|
|
92
103
|
/** Contact form fields */
|
|
@@ -100,9 +111,23 @@ interface Fields {
|
|
|
100
111
|
/** Whether to include a message field in the form. */
|
|
101
112
|
message?: boolean;
|
|
102
113
|
}
|
|
114
|
+
/** Contact form conditions for when site owner is available */
|
|
115
|
+
interface UserConditions {
|
|
116
|
+
/** Show site visitor contact form before starting a conversation. */
|
|
117
|
+
beforeChat?: boolean;
|
|
118
|
+
/** Show site visitor contact form after their first message. */
|
|
119
|
+
afterFirstMessage?: boolean;
|
|
120
|
+
/** Never show site visitor contact form. */
|
|
121
|
+
never?: boolean;
|
|
122
|
+
}
|
|
103
123
|
/** Working hours settings */
|
|
104
124
|
interface ActiveHours {
|
|
105
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.
|
|
127
|
+
* @deprecated Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored.
|
|
128
|
+
* @replacedBy availability
|
|
129
|
+
* @targetRemovalDate 2025-12-01
|
|
130
|
+
*/
|
|
106
131
|
always?: boolean;
|
|
107
132
|
/** Times at which the AI Assistant is online. */
|
|
108
133
|
schedule?: Schedule;
|
|
@@ -111,6 +136,8 @@ interface ActiveHours {
|
|
|
111
136
|
* @maxLength 256
|
|
112
137
|
*/
|
|
113
138
|
timeZone?: string;
|
|
139
|
+
/** Hours when AI assistant or site owner are available. */
|
|
140
|
+
mode?: ChatHandlerModeWithLiterals;
|
|
114
141
|
}
|
|
115
142
|
/** Schedule */
|
|
116
143
|
interface Schedule {
|
|
@@ -134,7 +161,7 @@ interface DaySchedule {
|
|
|
134
161
|
/** Whether the day is enabled. */
|
|
135
162
|
enabled?: boolean;
|
|
136
163
|
/**
|
|
137
|
-
* Array of times during which the AI
|
|
164
|
+
* Array of times during which the AI Site-Chat or site owner are available.
|
|
138
165
|
* @maxSize 24
|
|
139
166
|
*/
|
|
140
167
|
frames?: WorkingHoursFrame[];
|
|
@@ -145,7 +172,37 @@ interface WorkingHoursFrame {
|
|
|
145
172
|
start?: number;
|
|
146
173
|
/** End time of the active hours. */
|
|
147
174
|
end?: number;
|
|
175
|
+
/** Who is available during timeframe, AI chat or user chat */
|
|
176
|
+
frameType?: FrameHandlerTypeWithLiterals;
|
|
177
|
+
}
|
|
178
|
+
/** Who is available during timeframe, AI chat or user chat */
|
|
179
|
+
declare enum FrameHandlerType {
|
|
180
|
+
/** Unknown frame type. */
|
|
181
|
+
UNKNOWN_FRAME_TYPE = "UNKNOWN_FRAME_TYPE",
|
|
182
|
+
/** Frame type not selected. */
|
|
183
|
+
NOT_SELECTED = "NOT_SELECTED",
|
|
184
|
+
/** AI Chat available in time frame. */
|
|
185
|
+
AI_CHAT = "AI_CHAT",
|
|
186
|
+
/** Chat with human in time frame. */
|
|
187
|
+
WIX_USER_CHAT = "WIX_USER_CHAT"
|
|
148
188
|
}
|
|
189
|
+
/** @enumType */
|
|
190
|
+
type FrameHandlerTypeWithLiterals = FrameHandlerType | 'UNKNOWN_FRAME_TYPE' | 'NOT_SELECTED' | 'AI_CHAT' | 'WIX_USER_CHAT';
|
|
191
|
+
/** Chat availability options */
|
|
192
|
+
declare enum ChatHandlerMode {
|
|
193
|
+
/** Unknown availability. */
|
|
194
|
+
UNKNOWN_MODE = "UNKNOWN_MODE",
|
|
195
|
+
/** AI assistant is always available. */
|
|
196
|
+
ALWAYS_WITH_AI = "ALWAYS_WITH_AI",
|
|
197
|
+
/** Chat with site owner is always available. */
|
|
198
|
+
ALWAYS_WITH_WIX_USER = "ALWAYS_WITH_WIX_USER",
|
|
199
|
+
/** AI and site owner are available according to schedule. */
|
|
200
|
+
SCHEDULED = "SCHEDULED",
|
|
201
|
+
/** AI assistant and site owner are always offline. */
|
|
202
|
+
OFF = "OFF"
|
|
203
|
+
}
|
|
204
|
+
/** @enumType */
|
|
205
|
+
type ChatHandlerModeWithLiterals = ChatHandlerMode | 'UNKNOWN_MODE' | 'ALWAYS_WITH_AI' | 'ALWAYS_WITH_WIX_USER' | 'SCHEDULED' | 'OFF';
|
|
149
206
|
declare enum OfflineBehavior {
|
|
150
207
|
/** Unknown offline behavior. */
|
|
151
208
|
UNKNOWN_OFFLINE_BEHAVIOR = "UNKNOWN_OFFLINE_BEHAVIOR",
|
|
@@ -168,9 +225,27 @@ interface GetWidgetSettingsResponse {
|
|
|
168
225
|
/**
|
|
169
226
|
* Whether the assistant is currently online.
|
|
170
227
|
* @readonly
|
|
228
|
+
* @deprecated Whether the assistant is currently online.
|
|
229
|
+
* @replacedBy active_handlers
|
|
230
|
+
* @targetRemovalDate 2025-12-01
|
|
171
231
|
*/
|
|
172
232
|
assistantOnline?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Active chat handlers (e.g., AI assistant, site owner).
|
|
235
|
+
* @readonly
|
|
236
|
+
*/
|
|
237
|
+
activeHandlers?: ChatHandlerWithLiterals[];
|
|
173
238
|
}
|
|
239
|
+
declare enum ChatHandler {
|
|
240
|
+
/** Unknown handler. */
|
|
241
|
+
UNKNOWN_HANDLER = "UNKNOWN_HANDLER",
|
|
242
|
+
/** AI assistant is handling chats. */
|
|
243
|
+
AI = "AI",
|
|
244
|
+
/** Site owner is handling chats. */
|
|
245
|
+
WIX_USER = "WIX_USER"
|
|
246
|
+
}
|
|
247
|
+
/** @enumType */
|
|
248
|
+
type ChatHandlerWithLiterals = ChatHandler | 'UNKNOWN_HANDLER' | 'AI' | 'WIX_USER';
|
|
174
249
|
interface SetWidgetSettingsRequest {
|
|
175
250
|
/** Widget settings to update. */
|
|
176
251
|
widgetSettings: WidgetSettings;
|
|
@@ -193,4 +268,4 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
|
|
|
193
268
|
declare function getWidgetSettings(): __PublicMethodMetaInfo<'GET', {}, GetWidgetSettingsRequest$1, GetWidgetSettingsRequest, GetWidgetSettingsResponse$1, GetWidgetSettingsResponse>;
|
|
194
269
|
declare function setWidgetSettings(): __PublicMethodMetaInfo<'POST', {}, SetWidgetSettingsRequest$1, SetWidgetSettingsRequest, SetWidgetSettingsResponse$1, SetWidgetSettingsResponse>;
|
|
195
270
|
|
|
196
|
-
export { type ActiveHours as ActiveHoursOriginal, type Conditions as ConditionsOriginal, type ContactForm as ContactFormOriginal, type DaySchedule as DayScheduleOriginal, type Fields as FieldsOriginal, type GetWidgetSettingsRequest as GetWidgetSettingsRequestOriginal, type GetWidgetSettingsResponse as GetWidgetSettingsResponseOriginal, type IntroMessage as IntroMessageOriginal, OfflineBehavior as OfflineBehaviorOriginal, type OfflineBehaviorWithLiterals as OfflineBehaviorWithLiteralsOriginal, type Schedule as ScheduleOriginal, type SetWidgetSettingsRequest as SetWidgetSettingsRequestOriginal, type SetWidgetSettingsResponse as SetWidgetSettingsResponseOriginal, type SettingsMessage as SettingsMessageOriginal, type SuggestedQuestions as SuggestedQuestionsOriginal, type WidgetSettings as WidgetSettingsOriginal, type WorkingHoursFrame as WorkingHoursFrameOriginal, type __PublicMethodMetaInfo, getWidgetSettings, setWidgetSettings };
|
|
271
|
+
export { type ActiveHours as ActiveHoursOriginal, ChatHandlerMode as ChatHandlerModeOriginal, type ChatHandlerModeWithLiterals as ChatHandlerModeWithLiteralsOriginal, ChatHandler as ChatHandlerOriginal, type ChatHandlerWithLiterals as ChatHandlerWithLiteralsOriginal, type Conditions as ConditionsOriginal, type ContactForm as ContactFormOriginal, type DaySchedule as DayScheduleOriginal, type Fields as FieldsOriginal, FrameHandlerType as FrameHandlerTypeOriginal, type FrameHandlerTypeWithLiterals as FrameHandlerTypeWithLiteralsOriginal, type GetWidgetSettingsRequest as GetWidgetSettingsRequestOriginal, type GetWidgetSettingsResponse as GetWidgetSettingsResponseOriginal, type IntroMessage as IntroMessageOriginal, OfflineBehavior as OfflineBehaviorOriginal, type OfflineBehaviorWithLiterals as OfflineBehaviorWithLiteralsOriginal, type Schedule as ScheduleOriginal, type SetWidgetSettingsRequest as SetWidgetSettingsRequestOriginal, type SetWidgetSettingsResponse as SetWidgetSettingsResponseOriginal, type SettingsMessage as SettingsMessageOriginal, type SuggestedQuestions as SuggestedQuestionsOriginal, type UserConditions as UserConditionsOriginal, type WidgetSettings as WidgetSettingsOriginal, type WorkingHoursFrame as WorkingHoursFrameOriginal, type __PublicMethodMetaInfo, getWidgetSettings, setWidgetSettings };
|
package/build/es/meta.mjs
CHANGED
|
@@ -139,6 +139,21 @@ function setWidgetSettings(payload) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// src/innovation-widget-v1-widget-settings-widget-settings.types.ts
|
|
142
|
+
var FrameHandlerType = /* @__PURE__ */ ((FrameHandlerType2) => {
|
|
143
|
+
FrameHandlerType2["UNKNOWN_FRAME_TYPE"] = "UNKNOWN_FRAME_TYPE";
|
|
144
|
+
FrameHandlerType2["NOT_SELECTED"] = "NOT_SELECTED";
|
|
145
|
+
FrameHandlerType2["AI_CHAT"] = "AI_CHAT";
|
|
146
|
+
FrameHandlerType2["WIX_USER_CHAT"] = "WIX_USER_CHAT";
|
|
147
|
+
return FrameHandlerType2;
|
|
148
|
+
})(FrameHandlerType || {});
|
|
149
|
+
var ChatHandlerMode = /* @__PURE__ */ ((ChatHandlerMode2) => {
|
|
150
|
+
ChatHandlerMode2["UNKNOWN_MODE"] = "UNKNOWN_MODE";
|
|
151
|
+
ChatHandlerMode2["ALWAYS_WITH_AI"] = "ALWAYS_WITH_AI";
|
|
152
|
+
ChatHandlerMode2["ALWAYS_WITH_WIX_USER"] = "ALWAYS_WITH_WIX_USER";
|
|
153
|
+
ChatHandlerMode2["SCHEDULED"] = "SCHEDULED";
|
|
154
|
+
ChatHandlerMode2["OFF"] = "OFF";
|
|
155
|
+
return ChatHandlerMode2;
|
|
156
|
+
})(ChatHandlerMode || {});
|
|
142
157
|
var OfflineBehavior = /* @__PURE__ */ ((OfflineBehavior2) => {
|
|
143
158
|
OfflineBehavior2["UNKNOWN_OFFLINE_BEHAVIOR"] = "UNKNOWN_OFFLINE_BEHAVIOR";
|
|
144
159
|
OfflineBehavior2["CHAT_ONLY"] = "CHAT_ONLY";
|
|
@@ -147,6 +162,12 @@ var OfflineBehavior = /* @__PURE__ */ ((OfflineBehavior2) => {
|
|
|
147
162
|
OfflineBehavior2["CONTACT_FORM_WITH_CHAT"] = "CONTACT_FORM_WITH_CHAT";
|
|
148
163
|
return OfflineBehavior2;
|
|
149
164
|
})(OfflineBehavior || {});
|
|
165
|
+
var ChatHandler = /* @__PURE__ */ ((ChatHandler2) => {
|
|
166
|
+
ChatHandler2["UNKNOWN_HANDLER"] = "UNKNOWN_HANDLER";
|
|
167
|
+
ChatHandler2["AI"] = "AI";
|
|
168
|
+
ChatHandler2["WIX_USER"] = "WIX_USER";
|
|
169
|
+
return ChatHandler2;
|
|
170
|
+
})(ChatHandler || {});
|
|
150
171
|
|
|
151
172
|
// src/innovation-widget-v1-widget-settings-widget-settings.meta.ts
|
|
152
173
|
function getWidgetSettings2() {
|
|
@@ -186,6 +207,9 @@ function setWidgetSettings2() {
|
|
|
186
207
|
};
|
|
187
208
|
}
|
|
188
209
|
export {
|
|
210
|
+
ChatHandlerMode as ChatHandlerModeOriginal,
|
|
211
|
+
ChatHandler as ChatHandlerOriginal,
|
|
212
|
+
FrameHandlerType as FrameHandlerTypeOriginal,
|
|
189
213
|
OfflineBehavior as OfflineBehaviorOriginal,
|
|
190
214
|
getWidgetSettings2 as getWidgetSettings,
|
|
191
215
|
setWidgetSettings2 as setWidgetSettings
|