@wix/auto_sdk_ai-site-chat_widget-settings 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.d.ts +6 -0
  11. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.js +10 -0
  12. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.js.map +1 -0
  13. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.d.ts +5 -0
  14. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.js +136 -0
  15. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.js.map +1 -0
  16. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.d.ts +14 -0
  17. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.js +66 -0
  18. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.js.map +1 -0
  19. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.d.ts +21 -0
  20. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.js +20 -0
  21. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.js.map +1 -0
  22. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.d.ts +213 -0
  23. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.js +17 -0
  24. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.js.map +1 -0
  25. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.d.ts +244 -0
  26. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.js +118 -0
  27. package/build/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.context.d.ts +6 -0
  39. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.context.js +6 -0
  40. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.context.js.map +1 -0
  41. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.http.d.ts +5 -0
  42. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.http.js +131 -0
  43. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.http.js.map +1 -0
  44. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.d.ts +14 -0
  45. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.js +38 -0
  46. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.js.map +1 -0
  47. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.public.d.ts +21 -0
  48. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.public.js +14 -0
  49. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.public.js.map +1 -0
  50. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.types.d.ts +213 -0
  51. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.types.js +14 -0
  52. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.types.js.map +1 -0
  53. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.d.ts +244 -0
  54. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.js +90 -0
  55. package/build/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.d.ts +6 -0
  66. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.js +10 -0
  67. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.context.js.map +1 -0
  68. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.d.ts +5 -0
  69. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.js +136 -0
  70. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.http.js.map +1 -0
  71. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.d.ts +14 -0
  72. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.js +66 -0
  73. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.meta.js.map +1 -0
  74. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.d.ts +21 -0
  75. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.js +20 -0
  76. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.public.js.map +1 -0
  77. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.d.ts +213 -0
  78. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.js +17 -0
  79. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.types.js.map +1 -0
  80. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.d.ts +244 -0
  81. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.js +118 -0
  82. package/build/internal/cjs/src/innovation-widget-v1-widget-settings-widget-settings.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.context.d.ts +6 -0
  93. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.context.js +6 -0
  94. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.context.js.map +1 -0
  95. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.http.d.ts +5 -0
  96. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.http.js +131 -0
  97. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.http.js.map +1 -0
  98. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.d.ts +14 -0
  99. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.js +38 -0
  100. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.meta.js.map +1 -0
  101. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.public.d.ts +21 -0
  102. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.public.js +14 -0
  103. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.public.js.map +1 -0
  104. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.types.d.ts +213 -0
  105. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.types.js +14 -0
  106. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.types.js.map +1 -0
  107. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.d.ts +244 -0
  108. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.js +90 -0
  109. package/build/internal/es/src/innovation-widget-v1-widget-settings-widget-settings.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,14 @@
1
+ import { getWidgetSettings as universalGetWidgetSettings, setWidgetSettings as universalSetWidgetSettings, } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';
2
+ export const __metadata = { PACKAGE_NAME: '@wix/ai-site-chat' };
3
+ export function getWidgetSettings(httpClient) {
4
+ return () => universalGetWidgetSettings(
5
+ // @ts-ignore
6
+ { httpClient });
7
+ }
8
+ export function setWidgetSettings(httpClient) {
9
+ return (widgetSettings) => universalSetWidgetSettings(widgetSettings,
10
+ // @ts-ignore
11
+ { httpClient });
12
+ }
13
+ export { OfflineBehavior, } from './innovation-widget-v1-widget-settings-widget-settings.universal.js';
14
+ //# sourceMappingURL=innovation-widget-v1-widget-settings-widget-settings.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innovation-widget-v1-widget-settings-widget-settings.public.js","sourceRoot":"","sources":["../../../src/innovation-widget-v1-widget-settings-widget-settings.public.ts"],"names":[],"mappings":"AACA,OAAO,EAML,iBAAiB,IAAI,0BAA0B,EAC/C,iBAAiB,IAAI,0BAA0B,GAChD,MAAM,qEAAqE,CAAC;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEhE,MAAM,UAAU,iBAAiB,CAC/B,UAAsB;IAEtB,OAAO,GAAG,EAAE,CACV,0BAA0B;IACxB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAWD,MAAM,UAAU,iBAAiB,CAC/B,UAAsB;IAEtB,OAAO,CAAC,cAA8B,EAAE,EAAE,CACxC,0BAA0B,CACxB,cAAc;IACd,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAYD,OAAO,EAWL,eAAe,GAQhB,MAAM,qEAAqE,CAAC"}
@@ -0,0 +1,213 @@
1
+ export interface WidgetSettings {
2
+ /**
3
+ * Widget settings ID.
4
+ * @readonly
5
+ */
6
+ id?: string | null;
7
+ /** Whether the AI Site-Chat is enabled on the site. */
8
+ enabled?: boolean;
9
+ /** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */
10
+ introMessage?: IntroMessage;
11
+ /** Settings for the contact form. */
12
+ contactForm?: ContactForm;
13
+ /**
14
+ * Date and time the widget settings were created.
15
+ * @readonly
16
+ */
17
+ createdDate?: Date | null;
18
+ /**
19
+ * Date and time the widget settings were updated.
20
+ * @readonly
21
+ */
22
+ updatedDate?: Date | null;
23
+ /** Whether to open the AI Site-Chat automatically when the site loads. */
24
+ autoOpen?: boolean;
25
+ /** Times the AI assistant is available on the site. */
26
+ activeHours?: ActiveHours;
27
+ /** Defines what the AI Site-Chat provides during the non-active hours. */
28
+ offlineBehavior?: OfflineBehavior;
29
+ /** Extended fields. */
30
+ extendedFields?: ExtendedFields;
31
+ }
32
+ /** Intro message */
33
+ export interface IntroMessage {
34
+ /** Main message settings. */
35
+ message?: SettingsMessage;
36
+ /** Legal disclaimer message settings. */
37
+ legalDisclaimer?: SettingsMessage;
38
+ /** Offline message settings. */
39
+ offlineDisclaimer?: SettingsMessage;
40
+ }
41
+ export interface SettingsMessage {
42
+ /** Whether the message is enabled. */
43
+ enabled?: boolean;
44
+ /** Message content. */
45
+ text?: string;
46
+ }
47
+ export interface ContactForm {
48
+ /** When the AI Site-Chat should send the contact form. */
49
+ conditions?: Conditions;
50
+ /** Contact form fields. */
51
+ fields?: Fields;
52
+ }
53
+ /** Contact form conditions */
54
+ export interface Conditions {
55
+ /** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */
56
+ cannotAnswer?: boolean;
57
+ /** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */
58
+ requestForPerson?: boolean;
59
+ }
60
+ /** Contact form fields */
61
+ export interface Fields {
62
+ /** Whether to include a name field in the form. */
63
+ name?: boolean;
64
+ /** Whether to include an email field in the form. */
65
+ email?: boolean;
66
+ /** Whether to include a phone number field in the form. */
67
+ phone?: boolean;
68
+ /** Whether to include a message field in the form. */
69
+ message?: boolean;
70
+ }
71
+ /** Working hours settings */
72
+ export interface ActiveHours {
73
+ /** Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored. */
74
+ always?: boolean;
75
+ /** Times at which the AI Assistant is online. */
76
+ schedule?: Schedule;
77
+ /** Timezone used for the schedule. */
78
+ timeZone?: string;
79
+ }
80
+ /** Schedule */
81
+ export interface Schedule {
82
+ /** Monday schedule. */
83
+ monday?: DaySchedule;
84
+ /** Tuesday schedule. */
85
+ tuesday?: DaySchedule;
86
+ /** Wednesday schedule. */
87
+ wednesday?: DaySchedule;
88
+ /** Thursday schedule. */
89
+ thursday?: DaySchedule;
90
+ /** Friday schedule. */
91
+ friday?: DaySchedule;
92
+ /** Saturday schedule. */
93
+ saturday?: DaySchedule;
94
+ /** Sunday schedule. */
95
+ sunday?: DaySchedule;
96
+ }
97
+ /** Day schedule */
98
+ export interface DaySchedule {
99
+ /** Whether the day is enabled. */
100
+ enabled?: boolean;
101
+ /** Array of times during which the AI Assistant is active. */
102
+ frames?: WorkingHoursFrame[];
103
+ }
104
+ /** Working hours frame */
105
+ export interface WorkingHoursFrame {
106
+ /** Start time of the active hours. */
107
+ start?: number;
108
+ /** End time of the active hours. */
109
+ end?: number;
110
+ }
111
+ export declare enum OfflineBehavior {
112
+ /** Unknown offline behavior. */
113
+ UNKNOWN_OFFLINE_BEHAVIOR = "UNKNOWN_OFFLINE_BEHAVIOR",
114
+ /** Allows the site visitor to write messages, but doesn't send a contact form. */
115
+ CHAT_ONLY = "CHAT_ONLY",
116
+ /** Hides the AI Site-Chat from the site. */
117
+ HIDE = "HIDE",
118
+ /** Doesn't allow the site visitor to write messages, but does send a contact form. */
119
+ CONTACT_FORM_WITHOUT_CHAT = "CONTACT_FORM_WITHOUT_CHAT",
120
+ /** Allows the site visitor to write messages and sends a contact form. */
121
+ CONTACT_FORM_WITH_CHAT = "CONTACT_FORM_WITH_CHAT"
122
+ }
123
+ export interface ExtendedFields {
124
+ /**
125
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
126
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
127
+ *
128
+ * You can only access fields for which you have the appropriate permissions.
129
+ *
130
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
131
+ */
132
+ namespaces?: Record<string, Record<string, any>>;
133
+ }
134
+ export interface GetWidgetSettingsRequest {
135
+ }
136
+ export interface GetWidgetSettingsResponse {
137
+ /** Retrieved widget settings. */
138
+ widgetSettings?: WidgetSettings;
139
+ /**
140
+ * Whether the assistant is currently online.
141
+ * @readonly
142
+ */
143
+ assistantOnline?: boolean;
144
+ }
145
+ export interface SetWidgetSettingsRequest {
146
+ /** Widget settings to update. */
147
+ widgetSettings: WidgetSettings;
148
+ }
149
+ export interface SetWidgetSettingsResponse {
150
+ /** Updated widget settings. */
151
+ widgetSettings?: WidgetSettings;
152
+ }
153
+ interface SettingsMessageNonNullableFields {
154
+ enabled: boolean;
155
+ text: string;
156
+ }
157
+ interface IntroMessageNonNullableFields {
158
+ message?: SettingsMessageNonNullableFields;
159
+ legalDisclaimer?: SettingsMessageNonNullableFields;
160
+ offlineDisclaimer?: SettingsMessageNonNullableFields;
161
+ }
162
+ interface ConditionsNonNullableFields {
163
+ cannotAnswer: boolean;
164
+ requestForPerson: boolean;
165
+ }
166
+ interface FieldsNonNullableFields {
167
+ name: boolean;
168
+ email: boolean;
169
+ phone: boolean;
170
+ message: boolean;
171
+ }
172
+ interface ContactFormNonNullableFields {
173
+ conditions?: ConditionsNonNullableFields;
174
+ fields?: FieldsNonNullableFields;
175
+ }
176
+ interface WorkingHoursFrameNonNullableFields {
177
+ start: number;
178
+ end: number;
179
+ }
180
+ interface DayScheduleNonNullableFields {
181
+ enabled: boolean;
182
+ frames: WorkingHoursFrameNonNullableFields[];
183
+ }
184
+ interface ScheduleNonNullableFields {
185
+ monday?: DayScheduleNonNullableFields;
186
+ tuesday?: DayScheduleNonNullableFields;
187
+ wednesday?: DayScheduleNonNullableFields;
188
+ thursday?: DayScheduleNonNullableFields;
189
+ friday?: DayScheduleNonNullableFields;
190
+ saturday?: DayScheduleNonNullableFields;
191
+ sunday?: DayScheduleNonNullableFields;
192
+ }
193
+ interface ActiveHoursNonNullableFields {
194
+ always: boolean;
195
+ schedule?: ScheduleNonNullableFields;
196
+ timeZone: string;
197
+ }
198
+ interface WidgetSettingsNonNullableFields {
199
+ enabled: boolean;
200
+ introMessage?: IntroMessageNonNullableFields;
201
+ contactForm?: ContactFormNonNullableFields;
202
+ autoOpen: boolean;
203
+ activeHours?: ActiveHoursNonNullableFields;
204
+ offlineBehavior: OfflineBehavior;
205
+ }
206
+ export interface GetWidgetSettingsResponseNonNullableFields {
207
+ widgetSettings?: WidgetSettingsNonNullableFields;
208
+ assistantOnline: boolean;
209
+ }
210
+ export interface SetWidgetSettingsResponseNonNullableFields {
211
+ widgetSettings?: WidgetSettingsNonNullableFields;
212
+ }
213
+ export {};
@@ -0,0 +1,14 @@
1
+ export var OfflineBehavior;
2
+ (function (OfflineBehavior) {
3
+ /** Unknown offline behavior. */
4
+ OfflineBehavior["UNKNOWN_OFFLINE_BEHAVIOR"] = "UNKNOWN_OFFLINE_BEHAVIOR";
5
+ /** Allows the site visitor to write messages, but doesn't send a contact form. */
6
+ OfflineBehavior["CHAT_ONLY"] = "CHAT_ONLY";
7
+ /** Hides the AI Site-Chat from the site. */
8
+ OfflineBehavior["HIDE"] = "HIDE";
9
+ /** Doesn't allow the site visitor to write messages, but does send a contact form. */
10
+ OfflineBehavior["CONTACT_FORM_WITHOUT_CHAT"] = "CONTACT_FORM_WITHOUT_CHAT";
11
+ /** Allows the site visitor to write messages and sends a contact form. */
12
+ OfflineBehavior["CONTACT_FORM_WITH_CHAT"] = "CONTACT_FORM_WITH_CHAT";
13
+ })(OfflineBehavior || (OfflineBehavior = {}));
14
+ //# sourceMappingURL=innovation-widget-v1-widget-settings-widget-settings.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innovation-widget-v1-widget-settings-widget-settings.types.js","sourceRoot":"","sources":["../../../src/innovation-widget-v1-widget-settings-widget-settings.types.ts"],"names":[],"mappings":"AAwHA,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,gCAAgC;IAChC,wEAAqD,CAAA;IACrD,kFAAkF;IAClF,0CAAuB,CAAA;IACvB,4CAA4C;IAC5C,gCAAa,CAAA;IACb,sFAAsF;IACtF,0EAAuD,CAAA;IACvD,0EAA0E;IAC1E,oEAAiD,CAAA;AACnD,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B"}
@@ -0,0 +1,244 @@
1
+ export interface WidgetSettings {
2
+ /**
3
+ * Widget settings ID.
4
+ * @readonly
5
+ */
6
+ _id?: string | null;
7
+ /** Whether the AI Site-Chat is enabled on the site. */
8
+ enabled?: boolean;
9
+ /** AI Site-Chat introduction. This is shown in the chat when a site visitor starts a new conversation. */
10
+ introMessage?: IntroMessage;
11
+ /** Settings for the contact form. */
12
+ contactForm?: ContactForm;
13
+ /**
14
+ * Date and time the widget settings were created.
15
+ * @readonly
16
+ */
17
+ _createdDate?: Date | null;
18
+ /**
19
+ * Date and time the widget settings were updated.
20
+ * @readonly
21
+ */
22
+ _updatedDate?: Date | null;
23
+ /** Whether to open the AI Site-Chat automatically when the site loads. */
24
+ autoOpen?: boolean;
25
+ /** Times the AI assistant is available on the site. */
26
+ activeHours?: ActiveHours;
27
+ /** Defines what the AI Site-Chat provides during the non-active hours. */
28
+ offlineBehavior?: OfflineBehavior;
29
+ /** Extended fields. */
30
+ extendedFields?: ExtendedFields;
31
+ }
32
+ /** Intro message */
33
+ export interface IntroMessage {
34
+ /** Main message settings. */
35
+ message?: SettingsMessage;
36
+ /** Legal disclaimer message settings. */
37
+ legalDisclaimer?: SettingsMessage;
38
+ /** Offline message settings. */
39
+ offlineDisclaimer?: SettingsMessage;
40
+ }
41
+ export interface SettingsMessage {
42
+ /** Whether the message is enabled. */
43
+ enabled?: boolean;
44
+ /** Message content. */
45
+ text?: string;
46
+ }
47
+ export interface ContactForm {
48
+ /** When the AI Site-Chat should send the contact form. */
49
+ conditions?: Conditions;
50
+ /** Contact form fields. */
51
+ fields?: Fields;
52
+ }
53
+ /** Contact form conditions */
54
+ export interface Conditions {
55
+ /** Whether the AI Site-Chat should send the contact form if the AI is unable to answer the site visitor's question. */
56
+ cannotAnswer?: boolean;
57
+ /** Whether the AI Site-Chat should send the contact form if the site visitor requests to chat with a real person. */
58
+ requestForPerson?: boolean;
59
+ }
60
+ /** Contact form fields */
61
+ export interface Fields {
62
+ /** Whether to include a name field in the form. */
63
+ name?: boolean;
64
+ /** Whether to include an email field in the form. */
65
+ email?: boolean;
66
+ /** Whether to include a phone number field in the form. */
67
+ phone?: boolean;
68
+ /** Whether to include a message field in the form. */
69
+ message?: boolean;
70
+ }
71
+ /** Working hours settings */
72
+ export interface ActiveHours {
73
+ /** Whether the AI Assistant is always online. If `true`, `schedule` and `timeZone` are ignored. */
74
+ always?: boolean;
75
+ /** Times at which the AI Assistant is online. */
76
+ schedule?: Schedule;
77
+ /** Timezone used for the schedule. */
78
+ timeZone?: string;
79
+ }
80
+ /** Schedule */
81
+ export interface Schedule {
82
+ /** Monday schedule. */
83
+ monday?: DaySchedule;
84
+ /** Tuesday schedule. */
85
+ tuesday?: DaySchedule;
86
+ /** Wednesday schedule. */
87
+ wednesday?: DaySchedule;
88
+ /** Thursday schedule. */
89
+ thursday?: DaySchedule;
90
+ /** Friday schedule. */
91
+ friday?: DaySchedule;
92
+ /** Saturday schedule. */
93
+ saturday?: DaySchedule;
94
+ /** Sunday schedule. */
95
+ sunday?: DaySchedule;
96
+ }
97
+ /** Day schedule */
98
+ export interface DaySchedule {
99
+ /** Whether the day is enabled. */
100
+ enabled?: boolean;
101
+ /** Array of times during which the AI Assistant is active. */
102
+ frames?: WorkingHoursFrame[];
103
+ }
104
+ /** Working hours frame */
105
+ export interface WorkingHoursFrame {
106
+ /** Start time of the active hours. */
107
+ start?: number;
108
+ /** End time of the active hours. */
109
+ end?: number;
110
+ }
111
+ export declare enum OfflineBehavior {
112
+ /** Unknown offline behavior. */
113
+ UNKNOWN_OFFLINE_BEHAVIOR = "UNKNOWN_OFFLINE_BEHAVIOR",
114
+ /** Allows the site visitor to write messages, but doesn't send a contact form. */
115
+ CHAT_ONLY = "CHAT_ONLY",
116
+ /** Hides the AI Site-Chat from the site. */
117
+ HIDE = "HIDE",
118
+ /** Doesn't allow the site visitor to write messages, but does send a contact form. */
119
+ CONTACT_FORM_WITHOUT_CHAT = "CONTACT_FORM_WITHOUT_CHAT",
120
+ /** Allows the site visitor to write messages and sends a contact form. */
121
+ CONTACT_FORM_WITH_CHAT = "CONTACT_FORM_WITH_CHAT"
122
+ }
123
+ export interface ExtendedFields {
124
+ /**
125
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
126
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
127
+ *
128
+ * You can only access fields for which you have the appropriate permissions.
129
+ *
130
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
131
+ */
132
+ namespaces?: Record<string, Record<string, any>>;
133
+ }
134
+ export interface GetWidgetSettingsRequest {
135
+ }
136
+ export interface GetWidgetSettingsResponse {
137
+ /** Retrieved widget settings. */
138
+ widgetSettings?: WidgetSettings;
139
+ /**
140
+ * Whether the assistant is currently online.
141
+ * @readonly
142
+ */
143
+ assistantOnline?: boolean;
144
+ }
145
+ export interface SetWidgetSettingsRequest {
146
+ /** Widget settings to update. */
147
+ widgetSettings: WidgetSettings;
148
+ }
149
+ export interface SetWidgetSettingsResponse {
150
+ /** Updated widget settings. */
151
+ widgetSettings?: WidgetSettings;
152
+ }
153
+ interface SettingsMessageNonNullableFields {
154
+ enabled: boolean;
155
+ text: string;
156
+ }
157
+ interface IntroMessageNonNullableFields {
158
+ message?: SettingsMessageNonNullableFields;
159
+ legalDisclaimer?: SettingsMessageNonNullableFields;
160
+ offlineDisclaimer?: SettingsMessageNonNullableFields;
161
+ }
162
+ interface ConditionsNonNullableFields {
163
+ cannotAnswer: boolean;
164
+ requestForPerson: boolean;
165
+ }
166
+ interface FieldsNonNullableFields {
167
+ name: boolean;
168
+ email: boolean;
169
+ phone: boolean;
170
+ message: boolean;
171
+ }
172
+ interface ContactFormNonNullableFields {
173
+ conditions?: ConditionsNonNullableFields;
174
+ fields?: FieldsNonNullableFields;
175
+ }
176
+ interface WorkingHoursFrameNonNullableFields {
177
+ start: number;
178
+ end: number;
179
+ }
180
+ interface DayScheduleNonNullableFields {
181
+ enabled: boolean;
182
+ frames: WorkingHoursFrameNonNullableFields[];
183
+ }
184
+ interface ScheduleNonNullableFields {
185
+ monday?: DayScheduleNonNullableFields;
186
+ tuesday?: DayScheduleNonNullableFields;
187
+ wednesday?: DayScheduleNonNullableFields;
188
+ thursday?: DayScheduleNonNullableFields;
189
+ friday?: DayScheduleNonNullableFields;
190
+ saturday?: DayScheduleNonNullableFields;
191
+ sunday?: DayScheduleNonNullableFields;
192
+ }
193
+ interface ActiveHoursNonNullableFields {
194
+ always: boolean;
195
+ schedule?: ScheduleNonNullableFields;
196
+ timeZone: string;
197
+ }
198
+ interface WidgetSettingsNonNullableFields {
199
+ enabled: boolean;
200
+ introMessage?: IntroMessageNonNullableFields;
201
+ contactForm?: ContactFormNonNullableFields;
202
+ autoOpen: boolean;
203
+ activeHours?: ActiveHoursNonNullableFields;
204
+ offlineBehavior: OfflineBehavior;
205
+ }
206
+ export interface GetWidgetSettingsResponseNonNullableFields {
207
+ widgetSettings?: WidgetSettingsNonNullableFields;
208
+ assistantOnline: boolean;
209
+ }
210
+ export interface SetWidgetSettingsResponseNonNullableFields {
211
+ widgetSettings?: WidgetSettingsNonNullableFields;
212
+ }
213
+ /**
214
+ * Retrieves the widget settings for the site.
215
+ * @public
216
+ * @documentationMaturity preview
217
+ * @permissionId INNOVATION_LAB.CHAT_WIDGET
218
+ * @permissionScope Manage Bookings Services and Settings
219
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
220
+ * @permissionScope Manage Portfolio
221
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
222
+ * @permissionScope Manage Restaurants - all permissions
223
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
224
+ * @applicableIdentity APP
225
+ * @applicableIdentity VISITOR
226
+ * @fqn wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings
227
+ */
228
+ export declare function getWidgetSettings(): Promise<GetWidgetSettingsResponse & GetWidgetSettingsResponseNonNullableFields>;
229
+ /**
230
+ * Sets the widget settings for the site.
231
+ * @param widgetSettings - Widget settings to update.
232
+ * @public
233
+ * @documentationMaturity preview
234
+ * @requiredField widgetSettings
235
+ * @requiredField widgetSettings.activeHours
236
+ * @requiredField widgetSettings.contactForm
237
+ * @requiredField widgetSettings.contactForm.conditions
238
+ * @requiredField widgetSettings.contactForm.fields
239
+ * @requiredField widgetSettings.introMessage
240
+ * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_SET
241
+ * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings
242
+ */
243
+ export declare function setWidgetSettings(widgetSettings: WidgetSettings): Promise<SetWidgetSettingsResponse & SetWidgetSettingsResponseNonNullableFields>;
244
+ export {};
@@ -0,0 +1,90 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
3
+ import * as ambassadorWixInnovationWidgetV1WidgetSettings from './innovation-widget-v1-widget-settings-widget-settings.http.js';
4
+ export var OfflineBehavior;
5
+ (function (OfflineBehavior) {
6
+ /** Unknown offline behavior. */
7
+ OfflineBehavior["UNKNOWN_OFFLINE_BEHAVIOR"] = "UNKNOWN_OFFLINE_BEHAVIOR";
8
+ /** Allows the site visitor to write messages, but doesn't send a contact form. */
9
+ OfflineBehavior["CHAT_ONLY"] = "CHAT_ONLY";
10
+ /** Hides the AI Site-Chat from the site. */
11
+ OfflineBehavior["HIDE"] = "HIDE";
12
+ /** Doesn't allow the site visitor to write messages, but does send a contact form. */
13
+ OfflineBehavior["CONTACT_FORM_WITHOUT_CHAT"] = "CONTACT_FORM_WITHOUT_CHAT";
14
+ /** Allows the site visitor to write messages and sends a contact form. */
15
+ OfflineBehavior["CONTACT_FORM_WITH_CHAT"] = "CONTACT_FORM_WITH_CHAT";
16
+ })(OfflineBehavior || (OfflineBehavior = {}));
17
+ /**
18
+ * Retrieves the widget settings for the site.
19
+ * @public
20
+ * @documentationMaturity preview
21
+ * @permissionId INNOVATION_LAB.CHAT_WIDGET
22
+ * @permissionScope Manage Bookings Services and Settings
23
+ * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
24
+ * @permissionScope Manage Portfolio
25
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
26
+ * @permissionScope Manage Restaurants - all permissions
27
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
28
+ * @applicableIdentity APP
29
+ * @applicableIdentity VISITOR
30
+ * @fqn wix.innovation.assistant.widget.v1.Settings.GetWidgetSettings
31
+ */
32
+ export async function getWidgetSettings() {
33
+ // @ts-ignore
34
+ const { httpClient, sideEffects } = arguments[0];
35
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
36
+ const reqOpts = ambassadorWixInnovationWidgetV1WidgetSettings.getWidgetSettings(payload);
37
+ sideEffects?.onSiteCall?.();
38
+ try {
39
+ const result = await httpClient.request(reqOpts);
40
+ sideEffects?.onSuccess?.(result);
41
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
42
+ }
43
+ catch (err) {
44
+ const transformedError = sdkTransformError(err, {
45
+ spreadPathsToArguments: {},
46
+ explicitPathsToArguments: {},
47
+ singleArgumentUnchanged: false,
48
+ }, []);
49
+ sideEffects?.onError?.(err);
50
+ throw transformedError;
51
+ }
52
+ }
53
+ /**
54
+ * Sets the widget settings for the site.
55
+ * @param widgetSettings - Widget settings to update.
56
+ * @public
57
+ * @documentationMaturity preview
58
+ * @requiredField widgetSettings
59
+ * @requiredField widgetSettings.activeHours
60
+ * @requiredField widgetSettings.contactForm
61
+ * @requiredField widgetSettings.contactForm.conditions
62
+ * @requiredField widgetSettings.contactForm.fields
63
+ * @requiredField widgetSettings.introMessage
64
+ * @permissionId INNOVATION_LAB.CHAT_WIDGET_SETTINGS_SET
65
+ * @fqn wix.innovation.assistant.widget.v1.Settings.SetWidgetSettings
66
+ */
67
+ export async function setWidgetSettings(widgetSettings) {
68
+ // @ts-ignore
69
+ const { httpClient, sideEffects } = arguments[1];
70
+ const payload = renameKeysFromSDKRequestToRESTRequest({
71
+ widgetSettings: widgetSettings,
72
+ });
73
+ const reqOpts = ambassadorWixInnovationWidgetV1WidgetSettings.setWidgetSettings(payload);
74
+ sideEffects?.onSiteCall?.();
75
+ try {
76
+ const result = await httpClient.request(reqOpts);
77
+ sideEffects?.onSuccess?.(result);
78
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
79
+ }
80
+ catch (err) {
81
+ const transformedError = sdkTransformError(err, {
82
+ spreadPathsToArguments: {},
83
+ explicitPathsToArguments: { widgetSettings: '$[0]' },
84
+ singleArgumentUnchanged: false,
85
+ }, ['widgetSettings']);
86
+ sideEffects?.onError?.(err);
87
+ throw transformedError;
88
+ }
89
+ }
90
+ //# sourceMappingURL=innovation-widget-v1-widget-settings-widget-settings.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innovation-widget-v1-widget-settings-widget-settings.universal.js","sourceRoot":"","sources":["../../../src/innovation-widget-v1-widget-settings-widget-settings.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,6CAA6C,MAAM,gEAAgE,CAAC;AA0HhI,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,gCAAgC;IAChC,wEAAqD,CAAA;IACrD,kFAAkF;IAClF,0CAAuB,CAAA;IACvB,4CAA4C;IAC5C,gCAAa,CAAA;IACb,sFAAsF;IACtF,0EAAuD,CAAA;IACvD,0EAA0E;IAC1E,oEAAiD,CAAA;AACnD,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B;AA4GD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IAGrC,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,qCAAqC,CAAC,EAAE,CAAC,CAAC;IAE1D,MAAM,OAAO,GACX,6CAA6C,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE3E,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,uCAAuC,CAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE;YAC5B,uBAAuB,EAAE,KAAK;SAC/B,EACD,EAAE,CACH,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,cAA8B;IAI9B,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,qCAAqC,CAAC;QACpD,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;IAEH,MAAM,OAAO,GACX,6CAA6C,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE3E,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,uCAAuC,CAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,iBAAiB,CACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE;YACpD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,gBAAgB,CAAC,CACnB,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/innovation-widget-v1-widget-settings-widget-settings.context.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/innovation-widget-v1-widget-settings-widget-settings.context.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wGAAsF"}
@@ -0,0 +1 @@
1
+ export * from './src/innovation-widget-v1-widget-settings-widget-settings.universal.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/innovation-widget-v1-widget-settings-widget-settings.universal.js"), exports);
18
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0GAAwF"}
@@ -0,0 +1 @@
1
+ export * from './src/innovation-widget-v1-widget-settings-widget-settings.meta.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/innovation-widget-v1-widget-settings-widget-settings.meta.js"), exports);
18
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qGAAmF"}