@helpai/elements 0.21.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startConversationResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-B8UxV4b5.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startConversationResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-D7_pjSGq.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /**
@@ -56,9 +56,9 @@ declare const presentationSchema: z.ZodObject<{
56
56
  inset: z.ZodOptional<z.ZodString>;
57
57
  initialSize: z.ZodDefault<z.ZodEnum<{
58
58
  fullscreen: "fullscreen";
59
+ normal: "normal";
59
60
  expanded: "expanded";
60
61
  auto: "auto";
61
- normal: "normal";
62
62
  }>>;
63
63
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
64
64
  }, z.core.$loose>>;
@@ -148,9 +148,9 @@ declare const launcherSizeSchema: z.ZodEnum<{
148
148
  }>;
149
149
  type LauncherSize = z.infer<typeof launcherSizeSchema>;
150
150
  declare const calloutShapeSchema: z.ZodEnum<{
151
- callout: "callout";
152
151
  pill: "pill";
153
152
  bubble: "bubble";
153
+ callout: "callout";
154
154
  }>;
155
155
  type CalloutShape = z.infer<typeof calloutShapeSchema>;
156
156
  declare const calloutPositionSchema: z.ZodEnum<{
@@ -162,9 +162,9 @@ type CalloutPosition = z.infer<typeof calloutPositionSchema>;
162
162
  declare const launcherCalloutSchema: z.ZodObject<{
163
163
  text: z.ZodDefault<z.ZodString>;
164
164
  shape: z.ZodDefault<z.ZodEnum<{
165
- callout: "callout";
166
165
  pill: "pill";
167
166
  bubble: "bubble";
167
+ callout: "callout";
168
168
  }>>;
169
169
  position: z.ZodDefault<z.ZodEnum<{
170
170
  auto: "auto";
@@ -195,9 +195,9 @@ declare const launcherOptionsSchema: z.ZodObject<{
195
195
  callout: z.ZodOptional<z.ZodObject<{
196
196
  text: z.ZodDefault<z.ZodString>;
197
197
  shape: z.ZodDefault<z.ZodEnum<{
198
- callout: "callout";
199
198
  pill: "pill";
200
199
  bubble: "bubble";
200
+ callout: "callout";
201
201
  }>>;
202
202
  position: z.ZodDefault<z.ZodEnum<{
203
203
  auto: "auto";
@@ -240,9 +240,9 @@ type LauncherOptions = z.infer<typeof launcherOptionsSchema>;
240
240
 
241
241
  declare const initialSizeSchema: z.ZodEnum<{
242
242
  fullscreen: "fullscreen";
243
+ normal: "normal";
243
244
  expanded: "expanded";
244
245
  auto: "auto";
245
- normal: "normal";
246
246
  }>;
247
247
  declare const resizeOptionsSchema: z.ZodObject<{
248
248
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -269,9 +269,9 @@ declare const sizeOptionsSchema: z.ZodObject<{
269
269
  inset: z.ZodOptional<z.ZodString>;
270
270
  initialSize: z.ZodDefault<z.ZodEnum<{
271
271
  fullscreen: "fullscreen";
272
+ normal: "normal";
272
273
  expanded: "expanded";
273
274
  auto: "auto";
274
- normal: "normal";
275
275
  }>>;
276
276
  autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
277
277
  }, z.core.$loose>;
@@ -323,43 +323,43 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
323
323
  */
324
324
 
325
325
  declare const actionNameSchema: z.ZodEnum<{
326
- close: "close";
327
326
  expand: "expand";
328
327
  fullscreen: "fullscreen";
329
328
  popOut: "popOut";
330
- clear: "clear";
331
- theme: "theme";
329
+ close: "close";
332
330
  language: "language";
331
+ theme: "theme";
333
332
  textSize: "textSize";
334
333
  history: "history";
334
+ clear: "clear";
335
335
  sound: "sound";
336
336
  }>;
337
337
  type ActionName = z.infer<typeof actionNameSchema>;
338
338
  declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
339
- close: "close";
340
339
  expand: "expand";
341
340
  fullscreen: "fullscreen";
342
341
  popOut: "popOut";
343
- clear: "clear";
344
- theme: "theme";
342
+ close: "close";
345
343
  language: "language";
344
+ theme: "theme";
346
345
  textSize: "textSize";
347
346
  history: "history";
347
+ clear: "clear";
348
348
  sound: "sound";
349
349
  }>>;
350
350
  type HeaderActions = z.infer<typeof headerActionsSchema>;
351
351
  /** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
352
352
  declare const headerSchema: z.ZodObject<{
353
353
  actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
354
- close: "close";
355
354
  expand: "expand";
356
355
  fullscreen: "fullscreen";
357
356
  popOut: "popOut";
358
- clear: "clear";
359
- theme: "theme";
357
+ close: "close";
360
358
  language: "language";
359
+ theme: "theme";
361
360
  textSize: "textSize";
362
361
  history: "history";
362
+ clear: "clear";
363
363
  sound: "sound";
364
364
  }>>>;
365
365
  }, z.core.$loose>;
@@ -375,33 +375,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
375
375
  */
376
376
 
377
377
  declare const feedbackEventSchema: z.ZodEnum<{
378
- voiceStart: "voiceStart";
379
- voiceStop: "voiceStop";
380
378
  error: "error";
381
379
  messageReceived: "messageReceived";
382
380
  messageSent: "messageSent";
381
+ voiceStart: "voiceStart";
382
+ voiceStop: "voiceStop";
383
383
  }>;
384
384
  type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
385
385
  declare const soundOptionsSchema: z.ZodObject<{
386
386
  enabled: z.ZodDefault<z.ZodBoolean>;
387
387
  volume: z.ZodDefault<z.ZodNumber>;
388
388
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
389
- voiceStart: "voiceStart";
390
- voiceStop: "voiceStop";
391
389
  error: "error";
392
390
  messageReceived: "messageReceived";
393
391
  messageSent: "messageSent";
392
+ voiceStart: "voiceStart";
393
+ voiceStop: "voiceStop";
394
394
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
395
395
  }, z.core.$loose>;
396
396
  type SoundOptions = z.infer<typeof soundOptionsSchema>;
397
397
  declare const hapticsOptionsSchema: z.ZodObject<{
398
398
  enabled: z.ZodDefault<z.ZodBoolean>;
399
399
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
400
- voiceStart: "voiceStart";
401
- voiceStop: "voiceStop";
402
400
  error: "error";
403
401
  messageReceived: "messageReceived";
404
402
  messageSent: "messageSent";
403
+ voiceStart: "voiceStart";
404
+ voiceStop: "voiceStop";
405
405
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
406
406
  }, z.core.$loose>;
407
407
  type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
@@ -410,21 +410,21 @@ declare const feedbackSchema: z.ZodObject<{
410
410
  enabled: z.ZodDefault<z.ZodBoolean>;
411
411
  volume: z.ZodDefault<z.ZodNumber>;
412
412
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
413
- voiceStart: "voiceStart";
414
- voiceStop: "voiceStop";
415
413
  error: "error";
416
414
  messageReceived: "messageReceived";
417
415
  messageSent: "messageSent";
416
+ voiceStart: "voiceStart";
417
+ voiceStop: "voiceStop";
418
418
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
419
419
  }, z.core.$loose>>;
420
420
  haptics: z.ZodOptional<z.ZodObject<{
421
421
  enabled: z.ZodDefault<z.ZodBoolean>;
422
422
  events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
423
- voiceStart: "voiceStart";
424
- voiceStop: "voiceStop";
425
423
  error: "error";
426
424
  messageReceived: "messageReceived";
427
425
  messageSent: "messageSent";
426
+ voiceStart: "voiceStart";
427
+ voiceStop: "voiceStop";
428
428
  }> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
429
429
  }, z.core.$loose>>;
430
430
  }, z.core.$loose>;
@@ -544,16 +544,16 @@ type FooterOptions = z.infer<typeof footerSchema>;
544
544
 
545
545
  declare const fieldTypeSchema: z.ZodEnum<{
546
546
  number: "number";
547
- select: "select";
548
- textarea: "textarea";
549
- time: "time";
550
547
  text: "text";
551
- checkbox: "checkbox";
552
- radio: "radio";
553
548
  url: "url";
554
549
  email: "email";
555
550
  tel: "tel";
556
551
  date: "date";
552
+ time: "time";
553
+ textarea: "textarea";
554
+ select: "select";
555
+ radio: "radio";
556
+ checkbox: "checkbox";
557
557
  multiselect: "multiselect";
558
558
  }>;
559
559
  type FieldType = z.infer<typeof fieldTypeSchema>;
@@ -578,16 +578,16 @@ declare const formFieldSchema: z.ZodObject<{
578
578
  label: z.ZodString;
579
579
  type: z.ZodEnum<{
580
580
  number: "number";
581
- select: "select";
582
- textarea: "textarea";
583
- time: "time";
584
581
  text: "text";
585
- checkbox: "checkbox";
586
- radio: "radio";
587
582
  url: "url";
588
583
  email: "email";
589
584
  tel: "tel";
590
585
  date: "date";
586
+ time: "time";
587
+ textarea: "textarea";
588
+ select: "select";
589
+ radio: "radio";
590
+ checkbox: "checkbox";
591
591
  multiselect: "multiselect";
592
592
  }>;
593
593
  placeholder: z.ZodOptional<z.ZodString>;
@@ -638,16 +638,16 @@ declare const formDefSchema: z.ZodObject<{
638
638
  label: z.ZodString;
639
639
  type: z.ZodEnum<{
640
640
  number: "number";
641
- select: "select";
642
- textarea: "textarea";
643
- time: "time";
644
641
  text: "text";
645
- checkbox: "checkbox";
646
- radio: "radio";
647
642
  url: "url";
648
643
  email: "email";
649
644
  tel: "tel";
650
645
  date: "date";
646
+ time: "time";
647
+ textarea: "textarea";
648
+ select: "select";
649
+ radio: "radio";
650
+ checkbox: "checkbox";
651
651
  multiselect: "multiselect";
652
652
  }>;
653
653
  placeholder: z.ZodOptional<z.ZodString>;
@@ -696,16 +696,16 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
696
696
  label: z.ZodString;
697
697
  type: z.ZodEnum<{
698
698
  number: "number";
699
- select: "select";
700
- textarea: "textarea";
701
- time: "time";
702
699
  text: "text";
703
- checkbox: "checkbox";
704
- radio: "radio";
705
700
  url: "url";
706
701
  email: "email";
707
702
  tel: "tel";
708
703
  date: "date";
704
+ time: "time";
705
+ textarea: "textarea";
706
+ select: "select";
707
+ radio: "radio";
708
+ checkbox: "checkbox";
709
709
  multiselect: "multiselect";
710
710
  }>;
711
711
  placeholder: z.ZodOptional<z.ZodString>;
@@ -777,18 +777,18 @@ type I18nOptions = z.infer<typeof i18nSchema>;
777
777
  */
778
778
 
779
779
  declare const moduleLayoutSchema: z.ZodEnum<{
780
- home: "home";
781
780
  chat: "chat";
782
781
  help: "help";
782
+ home: "home";
783
783
  news: "news";
784
784
  }>;
785
785
  type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
786
786
  declare const moduleSchema: z.ZodObject<{
787
787
  label: z.ZodString;
788
788
  layout: z.ZodEnum<{
789
- home: "home";
790
789
  chat: "chat";
791
790
  help: "help";
791
+ home: "home";
792
792
  news: "news";
793
793
  }>;
794
794
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -814,9 +814,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
814
814
  declare const modulesSchema: z.ZodArray<z.ZodObject<{
815
815
  label: z.ZodString;
816
816
  layout: z.ZodEnum<{
817
- home: "home";
818
817
  chat: "chat";
819
818
  help: "help";
819
+ home: "home";
820
820
  news: "news";
821
821
  }>;
822
822
  contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -840,6 +840,23 @@ declare const modulesSchema: z.ZodArray<z.ZodObject<{
840
840
  }, z.core.$loose>>;
841
841
  type ModulesOptions = z.infer<typeof modulesSchema>;
842
842
 
843
+ /**
844
+ * Tracking section schema — built-in anonymous usage analytics for the
845
+ * widget owner (utm.gif-style pixel hits). Off by default; a deployment
846
+ * turns it on to get event / page / device / locale insights without
847
+ * wiring its own analytics. No message content or form values ever ride
848
+ * a hit — payload fields pass a static per-event allowlist in the
849
+ * runtime tracker.
850
+ */
851
+
852
+ declare const trackingSchema: z.ZodObject<{
853
+ enabled: z.ZodOptional<z.ZodBoolean>;
854
+ endpoint: z.ZodOptional<z.ZodURL>;
855
+ sampleRate: z.ZodOptional<z.ZodNumber>;
856
+ token: z.ZodOptional<z.ZodString>;
857
+ }, z.core.$loose>;
858
+ type TrackingSettings = z.infer<typeof trackingSchema>;
859
+
843
860
  /**
844
861
  * Per-mode widget-settings projection.
845
862
  *
@@ -881,4 +898,4 @@ declare const ALL_MODES: readonly Mode[];
881
898
  */
882
899
  declare function emitJsonSchema(): unknown;
883
900
 
884
- export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FieldOption, type FieldType, type FieldValidation, type FooterOptions, type FormCondition, type FormDef, type FormField, type Forms, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type LauncherCallout, type LauncherOptions, type LauncherSize, type LauncherVariant, type Mode, type ModuleLayout, type ModuleOptions, type ModulesOptions, type Position, type PoweredBy, type Presentation, type ResizeOptions, type ResponseMode, type SendButtonOptions, type SizeOptions, type SoundOptions, type StringsOverride, type ThemeOverrides, type ThemePreference, type VoiceMode, actionNameSchema, attachmentLimitsSchema, behaviorSchema, calloutPositionSchema, calloutShapeSchema, composerOptionsSchema, emitJsonSchema, featureFlagsSchema, feedbackEventSchema, feedbackSchema, fieldOptionSchema, fieldTypeSchema, fieldValidationSchema, footerSchema, formConditionSchema, formDefSchema, formFieldSchema, formTriggerSchema, formsSchema, hapticsOptionsSchema, headerActionsSchema, headerSchema, i18nSchema, initialSizeSchema, launcherCalloutSchema, launcherOptionsSchema, launcherSizeSchema, launcherVariantSchema, modeSchema, moduleLayoutSchema, moduleSchema, modulesSchema, positionSchema, poweredBySchema, presentationSchema, resizeOptionsSchema, responseModeSchema, sendButtonIconSchema, sendButtonOptionsSchema, sendButtonShapeSchema, sendButtonVariantSchema, sizeOptionsSchema, soundOptionsSchema, stringsOverrideSchema, themeFieldSchema, themeOverridesSchema, themePreferenceSchema, toolRefSchema, voiceModeSchema, widgetSettingsSchemaForMode };
901
+ export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FieldOption, type FieldType, type FieldValidation, type FooterOptions, type FormCondition, type FormDef, type FormField, type Forms, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type LauncherCallout, type LauncherOptions, type LauncherSize, type LauncherVariant, type Mode, type ModuleLayout, type ModuleOptions, type ModulesOptions, type Position, type PoweredBy, type Presentation, type ResizeOptions, type ResponseMode, type SendButtonOptions, type SizeOptions, type SoundOptions, type StringsOverride, type ThemeOverrides, type ThemePreference, type TrackingSettings, type VoiceMode, actionNameSchema, attachmentLimitsSchema, behaviorSchema, calloutPositionSchema, calloutShapeSchema, composerOptionsSchema, emitJsonSchema, featureFlagsSchema, feedbackEventSchema, feedbackSchema, fieldOptionSchema, fieldTypeSchema, fieldValidationSchema, footerSchema, formConditionSchema, formDefSchema, formFieldSchema, formTriggerSchema, formsSchema, hapticsOptionsSchema, headerActionsSchema, headerSchema, i18nSchema, initialSizeSchema, launcherCalloutSchema, launcherOptionsSchema, launcherSizeSchema, launcherVariantSchema, modeSchema, moduleLayoutSchema, moduleSchema, modulesSchema, positionSchema, poweredBySchema, presentationSchema, resizeOptionsSchema, responseModeSchema, sendButtonIconSchema, sendButtonOptionsSchema, sendButtonShapeSchema, sendButtonVariantSchema, sizeOptionsSchema, soundOptionsSchema, stringsOverrideSchema, themeFieldSchema, themeOverridesSchema, themePreferenceSchema, toolRefSchema, trackingSchema, voiceModeSchema, widgetSettingsSchemaForMode };
package/schema.json CHANGED
@@ -1839,6 +1839,43 @@
1839
1839
  ]
1840
1840
  ]
1841
1841
  },
1842
+ "tracking": {
1843
+ "type": "object",
1844
+ "properties": {
1845
+ "enabled": {
1846
+ "description": "Master switch. Default `false` — no hits are sent until the deployment turns tracking on.",
1847
+ "type": "boolean"
1848
+ },
1849
+ "endpoint": {
1850
+ "description": "Pixel collector URL. Default: `https://t.<brand domain>/api/ai-elements/px.gif`. Must be a full URL.",
1851
+ "type": "string",
1852
+ "maxLength": 2048,
1853
+ "format": "uri"
1854
+ },
1855
+ "sampleRate": {
1856
+ "description": "Per-visitor sampling 0..1 (decided once per page load, keeping funnels intact). Default `1`.",
1857
+ "type": "number",
1858
+ "minimum": 0,
1859
+ "maximum": 1
1860
+ },
1861
+ "token": {
1862
+ "description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/start-conversation` response — never set by hand (see `docs/api/tracking-collector.md`).",
1863
+ "type": "string",
1864
+ "maxLength": 512
1865
+ }
1866
+ },
1867
+ "additionalProperties": {},
1868
+ "description": "Anonymous usage tracking for the widget owner — GA-style pixel events (open, send, form submit, …) with page / device / locale dimensions. Never includes message content; visitors are identified only by the widget's anonymous visitorId.",
1869
+ "examples": [
1870
+ {
1871
+ "enabled": true
1872
+ },
1873
+ {
1874
+ "enabled": true,
1875
+ "sampleRate": 0.5
1876
+ }
1877
+ ]
1878
+ },
1842
1879
  "site": {
1843
1880
  "description": "Site config — applies in `mode: \"page\"`. Comes from the start-conversation response, not user-edited."
1844
1881
  },
@@ -3556,6 +3593,43 @@
3556
3593
  }
3557
3594
  ]
3558
3595
  ]
3596
+ },
3597
+ "tracking": {
3598
+ "type": "object",
3599
+ "properties": {
3600
+ "enabled": {
3601
+ "description": "Master switch. Default `false` — no hits are sent until the deployment turns tracking on.",
3602
+ "type": "boolean"
3603
+ },
3604
+ "endpoint": {
3605
+ "description": "Pixel collector URL. Default: `https://t.<brand domain>/api/ai-elements/px.gif`. Must be a full URL.",
3606
+ "type": "string",
3607
+ "maxLength": 2048,
3608
+ "format": "uri"
3609
+ },
3610
+ "sampleRate": {
3611
+ "description": "Per-visitor sampling 0..1 (decided once per page load, keeping funnels intact). Default `1`.",
3612
+ "type": "number",
3613
+ "minimum": 0,
3614
+ "maximum": 1
3615
+ },
3616
+ "token": {
3617
+ "description": "Anti-forgery token, echoed as `tk=` on every hit. Server-issued in the `/start-conversation` response — never set by hand (see `docs/api/tracking-collector.md`).",
3618
+ "type": "string",
3619
+ "maxLength": 512
3620
+ }
3621
+ },
3622
+ "additionalProperties": {},
3623
+ "description": "Anonymous usage tracking for the widget owner — GA-style pixel events (open, send, form submit, …) with page / device / locale dimensions. Never includes message content; visitors are identified only by the widget's anonymous visitorId.",
3624
+ "examples": [
3625
+ {
3626
+ "enabled": true
3627
+ },
3628
+ {
3629
+ "enabled": true,
3630
+ "sampleRate": 0.5
3631
+ }
3632
+ ]
3559
3633
  }
3560
3634
  },
3561
3635
  "additionalProperties": {}