@helpai/elements 0.26.0 → 0.27.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/configurator.mjs +10 -8
- package/elements-web-component.esm.js +18 -18
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +23 -23
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +23 -23
- package/elements.esm.js.map +3 -3
- package/elements.js +18 -18
- package/elements.js.map +3 -3
- package/index.d.ts +10 -9
- package/index.mjs +75 -73
- package/package.json +1 -1
- package/schema.d.ts +1 -1
- package/schema.json +10 -10
- package/schema.mjs +10 -8
- package/web-component.mjs +75 -73
package/configurator.mjs
CHANGED
|
@@ -572,9 +572,11 @@ var modulesSchema = z14.array(moduleSchema).max(4).describe(
|
|
|
572
572
|
// src/schema/widget/tracking.ts
|
|
573
573
|
import { z as z15 } from "zod";
|
|
574
574
|
var trackingSchema = z15.object({
|
|
575
|
-
enabled: z15.boolean().optional().describe(
|
|
575
|
+
enabled: z15.boolean().optional().describe(
|
|
576
|
+
"Master switch. Default `true` \u2014 the widget always fires; the data module gates ingestion per deployment server-side. Set `false` to silence the client entirely."
|
|
577
|
+
),
|
|
576
578
|
endpoint: z15.url().max(2048).optional().describe(
|
|
577
|
-
"Pixel collector URL. Default: `${dataBaseUrl}/elements
|
|
579
|
+
"Pixel collector URL. Default: `${dataBaseUrl}/pai/elements-px.gif` (e.g. `https://help.ai/api/data/pai/elements-px.gif`). Must be a full URL."
|
|
578
580
|
),
|
|
579
581
|
sampleRate: z15.number().min(0).max(1).optional().describe("Per-visitor sampling 0..1 (decided once per page load, keeping funnels intact). Default `1`."),
|
|
580
582
|
token: z15.string().max(512).optional().describe(
|
|
@@ -588,16 +590,16 @@ var trackingSchema = z15.object({
|
|
|
588
590
|
|
|
589
591
|
// src/schema/widget.ts
|
|
590
592
|
var endpointsSchema = z16.object({
|
|
591
|
-
upload: z16.string().min(1).max(2048).default("/
|
|
592
|
-
transcribe: z16.string().min(1).max(2048).default("/
|
|
593
|
-
submitForm: z16.string().min(1).max(2048).default("/submit-form").describe(
|
|
593
|
+
upload: z16.string().min(1).max(2048).default("/pai/upload-file"),
|
|
594
|
+
transcribe: z16.string().min(1).max(2048).default("/pai/transcribe-audio"),
|
|
595
|
+
submitForm: z16.string().min(1).max(2048).default("/pai/submit-form").describe(
|
|
594
596
|
"Form submission endpoint. The widget POSTs each completed form's values here (fire-and-forget), keyed by the same visitorId + conversationId as the conversation; the payload carries `formId` + `trigger` so the backend can route. Optional \u2014 a 404 is ignored."
|
|
595
597
|
)
|
|
596
598
|
}).loose().describe(
|
|
597
599
|
"HTTP endpoint overrides. `upload` / `transcribe` paths are appended to the agent base (`${baseUrl}/api/agent`), `submitForm` to the data base (`dataBaseUrl`); absolute URLs are accepted too."
|
|
598
600
|
).meta({
|
|
599
601
|
examples: [
|
|
600
|
-
{ upload: "/
|
|
602
|
+
{ upload: "/pai/upload-file", transcribe: "/pai/transcribe-audio" },
|
|
601
603
|
{ upload: "https://help.ai/uploads/presign" },
|
|
602
604
|
{ submitForm: "https://crm.acme.com/leads" }
|
|
603
605
|
]
|
|
@@ -647,7 +649,7 @@ var connectionConfigSchema = z16.object({
|
|
|
647
649
|
"MAIN site origin (e.g. `https://help.ai`) \u2014 the API modules derive from it: agent API at `${baseUrl}/api/agent`, data API at `${baseUrl}/api/data`. Set this to point at your staging / self-hosted / custom backend. Default: the brand's `defaultBaseUrl` baked at build time."
|
|
648
650
|
),
|
|
649
651
|
agentBaseUrl: z16.string().min(1).max(2048).optional().describe(
|
|
650
|
-
"Full agent-API base \u2014 set it to reach a STANDALONE `module-help-ai-agent-api` directly (local module on its own port, e.g. `http://localhost:3087`; routes attach as-is: `/
|
|
652
|
+
"Full agent-API base \u2014 set it to reach a STANDALONE `module-help-ai-agent-api` directly (local module on its own port, e.g. `http://localhost:3087`; routes attach as-is: `/pai/handshake`). Precedence: this option > derived from the main origin (`${baseUrl}/api/agent`). Not server-pushable."
|
|
651
653
|
),
|
|
652
654
|
dataBaseUrl: z16.string().min(1).max(2048).optional().describe(
|
|
653
655
|
"Full data-API base (e.g. `https://help.ai/api/data`, or a standalone local module like `http://localhost:3106`) \u2014 the service serving content, form definitions (`GET /forms`), and form submissions at root-level paths. Precedence: this option > server-pushed `config.dataBaseUrl` > derived from the main origin (`${baseUrl}/api/data`)."
|
|
@@ -690,7 +692,7 @@ var widgetSettingsSchema = z16.object({
|
|
|
690
692
|
modules: modulesSchema.optional(),
|
|
691
693
|
tracking: trackingSchema.optional()
|
|
692
694
|
}).loose().describe(
|
|
693
|
-
"Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/
|
|
695
|
+
"Portal-configurable widget settings \u2014 fourteen sections, one per dashboard tab. The backend pushes this same shape on `/pai/handshake` under `config`."
|
|
694
696
|
).meta({
|
|
695
697
|
examples: [
|
|
696
698
|
{ presentation: { mode: "floating", position: "bottom-right" }, theme: "auto" },
|