@wix/auto_sdk_ai-site-chat_widget-settings 1.0.3 → 1.0.4

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.
@@ -15,7 +15,7 @@ interface SetWidgetSettingsSignature {
15
15
  * Sets the widget settings for the site.
16
16
  * @param - Widget settings to update.
17
17
  */
18
- (widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage`, 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>>;
18
+ (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>>;
19
19
  }
20
20
 
21
21
  declare const getWidgetSettings: MaybeContext<BuildRESTFunction<typeof getWidgetSettings$1> & typeof getWidgetSettings$1>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.public.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.context.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.context.js';\n","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 * @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 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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetWidgetSettingsResponse,\n SetWidgetSettingsResponse,\n WidgetSettings,\n getWidgetSettings as universalGetWidgetSettings,\n setWidgetSettings as universalSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ai-site-chat' };\n\nexport function getWidgetSettings(\n httpClient: HttpClient\n): GetWidgetSettingsSignature {\n return () =>\n universalGetWidgetSettings(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetWidgetSettingsSignature {\n /**\n * Retrieves the widget settings for the site.\n */\n (): 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}\n\nexport function setWidgetSettings(\n httpClient: HttpClient\n): SetWidgetSettingsSignature {\n return (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`,\n 3\n >\n ) =>\n universalSetWidgetSettings(\n widgetSettings,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SetWidgetSettingsSignature {\n /**\n * Sets the widget settings for the site.\n * @param - Widget settings to update.\n */\n (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`,\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}\n\nexport {\n ActiveHours,\n Conditions,\n ContactForm,\n DaySchedule,\n Fields,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n IntroMessage,\n OfflineBehavior,\n Schedule,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n SettingsMessage,\n SuggestedQuestions,\n WidgetSettings,\n WorkingHoursFrame,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","import {\n getWidgetSettings as publicGetWidgetSettings,\n setWidgetSettings as publicSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicGetWidgetSettings> &\n typeof publicGetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicGetWidgetSettings);\nexport const setWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicSetWidgetSettings> &\n typeof publicSetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicSetWidgetSettings);\n\nexport { OfflineBehavior } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport {\n WidgetSettings,\n IntroMessage,\n SettingsMessage,\n SuggestedQuestions,\n ContactForm,\n Conditions,\n Fields,\n ActiveHours,\n Schedule,\n DaySchedule,\n WorkingHoursFrame,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport { OfflineBehaviorWithLiterals } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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;A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BAAuB;","names":["getWidgetSettings","setWidgetSettings","import_timestamp","import_rest_modules","payload","OfflineBehavior","getWidgetSettings","sdkTransformError","setWidgetSettings","getWidgetSettings","setWidgetSettings","import_rest_modules","getWidgetSettings","setWidgetSettings"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.public.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.context.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.context.js';\n","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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetWidgetSettingsResponse,\n SetWidgetSettingsResponse,\n WidgetSettings,\n getWidgetSettings as universalGetWidgetSettings,\n setWidgetSettings as universalSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ai-site-chat' };\n\nexport function getWidgetSettings(\n httpClient: HttpClient\n): GetWidgetSettingsSignature {\n return () =>\n universalGetWidgetSettings(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetWidgetSettingsSignature {\n /**\n * Retrieves the widget settings for the site.\n */\n (): 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}\n\nexport function setWidgetSettings(\n httpClient: HttpClient\n): SetWidgetSettingsSignature {\n return (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`\n | `offlineBehavior`,\n 3\n >\n ) =>\n universalSetWidgetSettings(\n widgetSettings,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SetWidgetSettingsSignature {\n /**\n * Sets the widget settings for the site.\n * @param - Widget settings to update.\n */\n (\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}\n\nexport {\n ActiveHours,\n Conditions,\n ContactForm,\n DaySchedule,\n Fields,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n IntroMessage,\n OfflineBehavior,\n Schedule,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n SettingsMessage,\n SuggestedQuestions,\n WidgetSettings,\n WorkingHoursFrame,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","import {\n getWidgetSettings as publicGetWidgetSettings,\n setWidgetSettings as publicSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicGetWidgetSettings> &\n typeof publicGetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicGetWidgetSettings);\nexport const setWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicSetWidgetSettings> &\n typeof publicSetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicSetWidgetSettings);\n\nexport { OfflineBehavior } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport {\n WidgetSettings,\n IntroMessage,\n SettingsMessage,\n SuggestedQuestions,\n ContactForm,\n Conditions,\n Fields,\n ActiveHours,\n Schedule,\n DaySchedule,\n WorkingHoursFrame,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport { OfflineBehaviorWithLiterals } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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;A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O,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;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,gBAkCA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;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,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;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;;;AE3VO,SAASE,mBACd,YAC4B;AAC5B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAkCO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,mBAWAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACrEA,IAAAC,uBAAiC;AAG1B,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,qBAGK,2DAAiBA,kBAAuB;","names":["getWidgetSettings","setWidgetSettings","import_timestamp","import_rest_modules","payload","OfflineBehavior","getWidgetSettings","sdkTransformError","setWidgetSettings","getWidgetSettings","setWidgetSettings","import_rest_modules","getWidgetSettings","setWidgetSettings"]}
@@ -196,10 +196,11 @@ declare function getWidgetSettings(): Promise<NonNullablePaths<GetWidgetSettings
196
196
  * @requiredField widgetSettings.contactForm.conditions
197
197
  * @requiredField widgetSettings.contactForm.fields
198
198
  * @requiredField widgetSettings.introMessage
199
+ * @requiredField widgetSettings.offlineBehavior
199
200
  * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_WRITE
200
201
  * @applicableIdentity APP
201
202
  * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings
202
203
  */
203
- declare function setWidgetSettings(widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage`, 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>>;
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>>;
204
205
 
205
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 };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","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 * @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 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;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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,S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;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAgBA,eAAsBC,mBACpB,gBAiCA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;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,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;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":["getWidgetSettings","setWidgetSettings","import_timestamp","import_rest_modules","payload","OfflineBehavior","getWidgetSettings","sdkTransformError","setWidgetSettings"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","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;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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,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ACE,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,gBAkCA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;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,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;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":["getWidgetSettings","setWidgetSettings","import_timestamp","import_rest_modules","payload","OfflineBehavior","getWidgetSettings","sdkTransformError","setWidgetSettings"]}
@@ -193,4 +193,4 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
193
193
  declare function getWidgetSettings(): __PublicMethodMetaInfo<'GET', {}, GetWidgetSettingsRequest$1, GetWidgetSettingsRequest, GetWidgetSettingsResponse$1, GetWidgetSettingsResponse>;
194
194
  declare function setWidgetSettings(): __PublicMethodMetaInfo<'POST', {}, SetWidgetSettingsRequest$1, SetWidgetSettingsRequest, SetWidgetSettingsResponse$1, SetWidgetSettingsResponse>;
195
195
 
196
- export { type __PublicMethodMetaInfo, getWidgetSettings, setWidgetSettings };
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 };
package/build/cjs/meta.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // meta.ts
21
21
  var meta_exports = {};
22
22
  __export(meta_exports, {
23
+ OfflineBehaviorOriginal: () => OfflineBehavior,
23
24
  getWidgetSettings: () => getWidgetSettings2,
24
25
  setWidgetSettings: () => setWidgetSettings2
25
26
  });
@@ -165,6 +166,16 @@ function setWidgetSettings(payload) {
165
166
  return __setWidgetSettings;
166
167
  }
167
168
 
169
+ // src/innovation-widget-v1-widget-settings-widget-settings.types.ts
170
+ var OfflineBehavior = /* @__PURE__ */ ((OfflineBehavior2) => {
171
+ OfflineBehavior2["UNKNOWN_OFFLINE_BEHAVIOR"] = "UNKNOWN_OFFLINE_BEHAVIOR";
172
+ OfflineBehavior2["CHAT_ONLY"] = "CHAT_ONLY";
173
+ OfflineBehavior2["HIDE"] = "HIDE";
174
+ OfflineBehavior2["CONTACT_FORM_WITHOUT_CHAT"] = "CONTACT_FORM_WITHOUT_CHAT";
175
+ OfflineBehavior2["CONTACT_FORM_WITH_CHAT"] = "CONTACT_FORM_WITH_CHAT";
176
+ return OfflineBehavior2;
177
+ })(OfflineBehavior || {});
178
+
168
179
  // src/innovation-widget-v1-widget-settings-widget-settings.meta.ts
169
180
  function getWidgetSettings2() {
170
181
  const payload = {};
@@ -204,6 +215,7 @@ function setWidgetSettings2() {
204
215
  }
205
216
  // Annotate the CommonJS export names for ESM import in node:
206
217
  0 && (module.exports = {
218
+ OfflineBehaviorOriginal,
207
219
  getWidgetSettings,
208
220
  setWidgetSettings
209
221
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.meta.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.meta.js';\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","import * as ambassadorWixInnovationWidgetV1WidgetSettings from './innovation-widget-v1-widget-settings-widget-settings.http.js';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettingsTypes from './innovation-widget-v1-widget-settings-widget-settings.types.js';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getWidgetSettings(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.GetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.GetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.GetWidgetSettingsResponse,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.GetWidgetSettingsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixInnovationWidgetV1WidgetSettings.getWidgetSettings(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/settings',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function setWidgetSettings(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.SetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.SetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.SetWidgetSettingsResponse,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.SetWidgetSettingsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixInnovationWidgetV1WidgetSettings.setWidgetSettings(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/settings',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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,s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ings","import_timestamp","import_rest_modules","payload","getWidgetSettings","setWidgetSettings"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.http.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.types.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.meta.ts"],"sourcesContent":["export * from './src/innovation-widget-v1-widget-settings-widget-settings.meta.js';\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","export 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","import * as ambassadorWixInnovationWidgetV1WidgetSettings from './innovation-widget-v1-widget-settings-widget-settings.http.js';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettingsTypes from './innovation-widget-v1-widget-settings-widget-settings.types.js';\nimport * as ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getWidgetSettings(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.GetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.GetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.GetWidgetSettingsResponse,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.GetWidgetSettingsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixInnovationWidgetV1WidgetSettings.getWidgetSettings(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/settings',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function setWidgetSettings(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.SetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.SetWidgetSettingsRequest,\n ambassadorWixInnovationWidgetV1WidgetSettingsUniversalTypes.SetWidgetSettingsResponse,\n ambassadorWixInnovationWidgetV1WidgetSettingsTypes.SetWidgetSettingsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixInnovationWidgetV1WidgetSettings.setWidgetSettings(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/settings',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n WidgetSettings as WidgetSettingsOriginal,\n IntroMessage as IntroMessageOriginal,\n SettingsMessage as SettingsMessageOriginal,\n SuggestedQuestions as SuggestedQuestionsOriginal,\n ContactForm as ContactFormOriginal,\n Conditions as ConditionsOriginal,\n Fields as FieldsOriginal,\n ActiveHours as ActiveHoursOriginal,\n Schedule as ScheduleOriginal,\n DaySchedule as DayScheduleOriginal,\n WorkingHoursFrame as WorkingHoursFrameOriginal,\n OfflineBehavior as OfflineBehaviorOriginal,\n OfflineBehaviorWithLiterals as OfflineBehaviorWithLiteralsOriginal,\n GetWidgetSettingsRequest as GetWidgetSettingsRequestOriginal,\n GetWidgetSettingsResponse as GetWidgetSettingsResponseOriginal,\n SetWidgetSettingsRequest as SetWidgetSettingsRequestOriginal,\n SetWidgetSettingsResponse as SetWidgetSettingsResponseOriginal,\n} from './innovation-widget-v1-widget-settings-widget-settings.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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;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setWidgetSettings","import_timestamp","import_rest_modules","payload","OfflineBehavior","getWidgetSettings","setWidgetSettings"]}
@@ -15,7 +15,7 @@ interface SetWidgetSettingsSignature {
15
15
  * Sets the widget settings for the site.
16
16
  * @param - Widget settings to update.
17
17
  */
18
- (widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage`, 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>>;
18
+ (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>>;
19
19
  }
20
20
 
21
21
  declare const getWidgetSettings: MaybeContext<BuildRESTFunction<typeof getWidgetSettings$1> & typeof getWidgetSettings$1>;
@@ -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","../../src/innovation-widget-v1-widget-settings-widget-settings.public.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.context.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 * @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 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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetWidgetSettingsResponse,\n SetWidgetSettingsResponse,\n WidgetSettings,\n getWidgetSettings as universalGetWidgetSettings,\n setWidgetSettings as universalSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ai-site-chat' };\n\nexport function getWidgetSettings(\n httpClient: HttpClient\n): GetWidgetSettingsSignature {\n return () =>\n universalGetWidgetSettings(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetWidgetSettingsSignature {\n /**\n * Retrieves the widget settings for the site.\n */\n (): 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}\n\nexport function setWidgetSettings(\n httpClient: HttpClient\n): SetWidgetSettingsSignature {\n return (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`,\n 3\n >\n ) =>\n universalSetWidgetSettings(\n widgetSettings,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SetWidgetSettingsSignature {\n /**\n * Sets the widget settings for the site.\n * @param - Widget settings to update.\n */\n (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`,\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}\n\nexport {\n ActiveHours,\n Conditions,\n ContactForm,\n DaySchedule,\n Fields,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n IntroMessage,\n OfflineBehavior,\n Schedule,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n SettingsMessage,\n SuggestedQuestions,\n WidgetSettings,\n WorkingHoursFrame,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","import {\n getWidgetSettings as publicGetWidgetSettings,\n setWidgetSettings as publicSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicGetWidgetSettings> &\n typeof publicGetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicGetWidgetSettings);\nexport const setWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicSetWidgetSettings> &\n typeof publicSetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicSetWidgetSettings);\n\nexport { OfflineBehavior } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport {\n WidgetSettings,\n IntroMessage,\n SettingsMessage,\n SuggestedQuestions,\n ContactForm,\n Conditions,\n Fields,\n ActiveHours,\n Schedule,\n DaySchedule,\n WorkingHoursFrame,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport { OfflineBehaviorWithLiterals } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\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,U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BAAmB;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;AAgBA,eAAsBC,mBACpB,gBAiCA;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;;;AEzVO,SAASC,mBACd,YAC4B;AAC5B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAkCO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,mBAUAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACpEA,SAAS,wBAAwB;AAG1B,IAAMC,qBAGK,iCAAiBA,kBAAuB;AACnD,IAAMC,qBAGK,iCAAiBA,kBAAuB;","names":["payload","OfflineBehavior","getWidgetSettings","setWidgetSettings","getWidgetSettings","setWidgetSettings","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","../../src/innovation-widget-v1-widget-settings-widget-settings.public.ts","../../src/innovation-widget-v1-widget-settings-widget-settings.context.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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetWidgetSettingsResponse,\n SetWidgetSettingsResponse,\n WidgetSettings,\n getWidgetSettings as universalGetWidgetSettings,\n setWidgetSettings as universalSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ai-site-chat' };\n\nexport function getWidgetSettings(\n httpClient: HttpClient\n): GetWidgetSettingsSignature {\n return () =>\n universalGetWidgetSettings(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetWidgetSettingsSignature {\n /**\n * Retrieves the widget settings for the site.\n */\n (): 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}\n\nexport function setWidgetSettings(\n httpClient: HttpClient\n): SetWidgetSettingsSignature {\n return (\n widgetSettings: NonNullablePaths<\n WidgetSettings,\n | `activeHours`\n | `contactForm`\n | `contactForm.conditions`\n | `contactForm.fields`\n | `introMessage`\n | `offlineBehavior`,\n 3\n >\n ) =>\n universalSetWidgetSettings(\n widgetSettings,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SetWidgetSettingsSignature {\n /**\n * Sets the widget settings for the site.\n * @param - Widget settings to update.\n */\n (\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}\n\nexport {\n ActiveHours,\n Conditions,\n ContactForm,\n DaySchedule,\n Fields,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n IntroMessage,\n OfflineBehavior,\n Schedule,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n SettingsMessage,\n SuggestedQuestions,\n WidgetSettings,\n WorkingHoursFrame,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\n","import {\n getWidgetSettings as publicGetWidgetSettings,\n setWidgetSettings as publicSetWidgetSettings,\n} from './innovation-widget-v1-widget-settings-widget-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicGetWidgetSettings> &\n typeof publicGetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicGetWidgetSettings);\nexport const setWidgetSettings: MaybeContext<\n BuildRESTFunction<typeof publicSetWidgetSettings> &\n typeof publicSetWidgetSettings\n> = /*#__PURE__*/ createRESTModule(publicSetWidgetSettings);\n\nexport { OfflineBehavior } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport {\n WidgetSettings,\n IntroMessage,\n SettingsMessage,\n SuggestedQuestions,\n ContactForm,\n Conditions,\n Fields,\n ActiveHours,\n Schedule,\n DaySchedule,\n WorkingHoursFrame,\n GetWidgetSettingsRequest,\n GetWidgetSettingsResponse,\n SetWidgetSettingsRequest,\n SetWidgetSettingsResponse,\n} from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\nexport { OfflineBehaviorWithLiterals } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';\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,MAC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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;;;AE3VO,SAASC,mBACd,YAC4B;AAC5B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAkCO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CACL,mBAWAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACrEA,SAAS,wBAAwB;AAG1B,IAAMC,qBAGK,iCAAiBA,kBAAuB;AACnD,IAAMC,qBAGK,iCAAiBA,kBAAuB;","names":["payload","OfflineBehavior","getWidgetSettings","setWidgetSettings","getWidgetSettings","setWidgetSettings","getWidgetSettings","setWidgetSettings"]}
@@ -196,10 +196,11 @@ declare function getWidgetSettings(): Promise<NonNullablePaths<GetWidgetSettings
196
196
  * @requiredField widgetSettings.contactForm.conditions
197
197
  * @requiredField widgetSettings.contactForm.fields
198
198
  * @requiredField widgetSettings.introMessage
199
+ * @requiredField widgetSettings.offlineBehavior
199
200
  * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_WRITE
200
201
  * @applicableIdentity APP
201
202
  * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings
202
203
  */
203
- declare function setWidgetSettings(widgetSettings: NonNullablePaths<WidgetSettings, `activeHours` | `contactForm` | `contactForm.conditions` | `contactForm.fields` | `introMessage`, 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>>;
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>>;
204
205
 
205
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 };