@guidelytech/shared 0.15.0 → 0.17.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/dist/{chunk-XJXXVV3C.js → chunk-YL65O3FS.js} +152 -13
- package/dist/chunk-YL65O3FS.js.map +1 -0
- package/dist/index.cjs +381 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +260 -647
- package/dist/index.d.ts +260 -647
- package/dist/index.js +244 -110
- package/dist/index.js.map +1 -1
- package/dist/runtime-x-0GT7HM.d.cts +3260 -0
- package/dist/runtime-x-0GT7HM.d.ts +3260 -0
- package/dist/runtime.cjs +174 -12
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +47 -1
- package/package.json +3 -3
- package/dist/chunk-OLWGMDRX.js +0 -729
- package/dist/chunk-OLWGMDRX.js.map +0 -1
- package/dist/chunk-TGIUEYXM.js +0 -1937
- package/dist/chunk-TGIUEYXM.js.map +0 -1
- package/dist/chunk-UW6NRYRY.js +0 -809
- package/dist/chunk-UW6NRYRY.js.map +0 -1
- package/dist/chunk-XJXXVV3C.js.map +0 -1
- package/dist/runtime-BM5cztmJ.d.cts +0 -5234
- package/dist/runtime-BM5cztmJ.d.ts +0 -5234
- package/dist/runtime-BeSHQtNX.d.cts +0 -5263
- package/dist/runtime-BeSHQtNX.d.ts +0 -5263
- package/dist/runtime-DjEAlb_Q.d.cts +0 -5268
- package/dist/runtime-DjEAlb_Q.d.ts +0 -5268
|
@@ -0,0 +1,3260 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** FNV-1a 32-bit hash; deterministic across SDK and server for rollout bucketing. */
|
|
4
|
+
declare function fnv1a(input: string): number;
|
|
5
|
+
/** Deterministic 0-99 bucket for percentage rollouts. */
|
|
6
|
+
declare function rolloutBucket(subject: string, salt: string): number;
|
|
7
|
+
declare function slugify(input: string): string;
|
|
8
|
+
/** URL-safe random id. Uses crypto when available, falls back to Math.random (ids are not secrets). */
|
|
9
|
+
declare function randomId(size?: number): string;
|
|
10
|
+
declare function isPlainObject(v: unknown): v is Record<string, unknown>;
|
|
11
|
+
/** Safe nested getter: get(obj, "account.plan") */
|
|
12
|
+
declare function getPath(obj: unknown, path: string): unknown;
|
|
13
|
+
declare function clamp(n: number, min: number, max: number): number;
|
|
14
|
+
/** Glob-style URL pattern match: `*` matches any chars except `/`, `**` matches anything. */
|
|
15
|
+
declare function matchUrlPattern(pattern: string, url: string): boolean;
|
|
16
|
+
declare function stripOrigin(url: string): string;
|
|
17
|
+
/** Safe regexp construction with a length cap to limit ReDoS exposure. */
|
|
18
|
+
declare function safeRegExp(source: string, flags?: string): RegExp | null;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Cross-platform helpers shared by the web SDK, the React Native SDK and (as a reference for) the
|
|
22
|
+
* native iOS/Android SDKs. Zod-free so it can ship in runtime bundles.
|
|
23
|
+
*/
|
|
24
|
+
/** Platforms a guide can be delivered to. */
|
|
25
|
+
declare const PLATFORMS: readonly ["web", "ios", "android"];
|
|
26
|
+
type Platform = (typeof PLATFORMS)[number];
|
|
27
|
+
/** Guides published before platforms existed have no `platforms` field and are web-only. */
|
|
28
|
+
declare const DEFAULT_PLATFORMS: Platform[];
|
|
29
|
+
/** Platforms a guide config targets (missing field → web only). */
|
|
30
|
+
declare function guidePlatforms(config: {
|
|
31
|
+
platforms?: readonly string[] | null;
|
|
32
|
+
}): string[];
|
|
33
|
+
declare function supportsPlatform(config: {
|
|
34
|
+
platforms?: readonly string[] | null;
|
|
35
|
+
}, platform: string): boolean;
|
|
36
|
+
/** Attribute web apps put on elements to share a target id with their mobile apps. */
|
|
37
|
+
declare const GUIDELY_ID_ATTRIBUTE = "data-guidely-id";
|
|
38
|
+
/**
|
|
39
|
+
* Extracts a Guidely target id from a trigger / advance / checklist value so the same guide works on
|
|
40
|
+
* web and mobile. Accepts a bare id (`new-deal`), `#new-deal`, or `[data-guidely-id="new-deal"]`
|
|
41
|
+
* (also `data-testid` / `data-tour`). Returns null for selectors that cannot name a single id.
|
|
42
|
+
*/
|
|
43
|
+
declare function guidelyIdFromSelector(value: string | null | undefined): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Mobile SDKs have screens instead of URLs. URL-based features (URL patterns, `url_match` triggers,
|
|
46
|
+
* multi-page steps, `url_visited` checklist tasks) match against the screen path `/<ScreenName>`.
|
|
47
|
+
*/
|
|
48
|
+
declare function screenPath(screen: string | null | undefined): string;
|
|
49
|
+
/**
|
|
50
|
+
* Compares dotted version strings numerically (`2.10.0` > `2.9.3`). Non-numeric parts compare as
|
|
51
|
+
* strings; a missing part counts as 0 (`2.1` == `2.1.0`). Returns -1, 0 or 1, or null when either
|
|
52
|
+
* side is empty.
|
|
53
|
+
*/
|
|
54
|
+
declare function compareVersions(a: unknown, b: unknown): -1 | 0 | 1 | null;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Pure checklist / survey logic shared by every renderer (web runtime, React Native, and the
|
|
58
|
+
* reference for the native SDKs). Zod-free; uses structural types so it stays in the runtime entry.
|
|
59
|
+
*/
|
|
60
|
+
type SurveyAnswer = string | number | boolean | string[];
|
|
61
|
+
type SurveyAnswers = Record<string, SurveyAnswer>;
|
|
62
|
+
interface ShowWhen {
|
|
63
|
+
questionId: string;
|
|
64
|
+
op: "equals" | "lte" | "gte" | "in";
|
|
65
|
+
value: string | number | string[];
|
|
66
|
+
}
|
|
67
|
+
/** Evaluates a question's `showWhen` condition against current answers. */
|
|
68
|
+
declare function isQuestionVisible(q: {
|
|
69
|
+
showWhen?: ShowWhen;
|
|
70
|
+
}, answers: SurveyAnswers): boolean;
|
|
71
|
+
/** Are all required tasks done? */
|
|
72
|
+
declare function isChecklistComplete(config: {
|
|
73
|
+
tasks: Array<{
|
|
74
|
+
id: string;
|
|
75
|
+
required: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
}, progress: {
|
|
78
|
+
completedTaskIds: string[];
|
|
79
|
+
}): boolean;
|
|
80
|
+
|
|
81
|
+
declare const RULE_OPERATORS: readonly ["equals", "not_equals", "contains", "not_contains", "starts_with", "ends_with", "exists", "not_exists", "gt", "gte", "lt", "lte", "in", "not_in", "regex", "is_true", "is_false", "before", "after"];
|
|
82
|
+
type RuleOperator = (typeof RULE_OPERATORS)[number];
|
|
83
|
+
declare const RULE_FIELDS: readonly ["user.attribute", "account.attribute", "user.role", "user.plan", "user.identified", "url.path", "url.full", "url.query", "device.type", "device.browser", "device.os", "visitor.firstVisit", "visitor.returning", "event.seen", "guide.completed", "guide.dismissed", "guide.seen", "checklist.completed", "audience.member", "datetime.now", "datetime.dayOfWeek", "datetime.hour", "rollout.percentage", "experiment.bucket", "environment", "locale", "app.platform", "app.screen", "app.version", "page.views", "feature.clicks"];
|
|
84
|
+
type RuleField = (typeof RULE_FIELDS)[number];
|
|
85
|
+
interface Rule {
|
|
86
|
+
id: string;
|
|
87
|
+
field: RuleField;
|
|
88
|
+
/** For attribute/query/event fields: the attribute key, query param name, event name, guide id... */
|
|
89
|
+
key?: string;
|
|
90
|
+
op: RuleOperator;
|
|
91
|
+
value?: string | number | boolean | string[];
|
|
92
|
+
/** When true, the rule is negated (exclusion rule). */
|
|
93
|
+
negate?: boolean;
|
|
94
|
+
}
|
|
95
|
+
type RuleGroup = {
|
|
96
|
+
id: string;
|
|
97
|
+
op: "and" | "or";
|
|
98
|
+
rules: Array<Rule | RuleGroup>;
|
|
99
|
+
negate?: boolean;
|
|
100
|
+
};
|
|
101
|
+
declare function isRuleGroup(r: Rule | RuleGroup): r is RuleGroup;
|
|
102
|
+
declare function emptyRuleGroup(id?: string): RuleGroup;
|
|
103
|
+
/** Everything targeting evaluation can see. Built by the SDK (browser) or the server. */
|
|
104
|
+
interface TargetingContext {
|
|
105
|
+
userId?: string | null;
|
|
106
|
+
anonymousId: string;
|
|
107
|
+
userAttributes: Record<string, unknown>;
|
|
108
|
+
accountAttributes: Record<string, unknown>;
|
|
109
|
+
url: string;
|
|
110
|
+
path: string;
|
|
111
|
+
query: Record<string, string>;
|
|
112
|
+
device: {
|
|
113
|
+
type: "desktop" | "tablet" | "mobile";
|
|
114
|
+
browser?: string;
|
|
115
|
+
os?: string;
|
|
116
|
+
};
|
|
117
|
+
firstVisit: boolean;
|
|
118
|
+
eventsSeen: Set<string> | string[];
|
|
119
|
+
completedGuides: Set<string> | string[];
|
|
120
|
+
dismissedGuides: Set<string> | string[];
|
|
121
|
+
seenGuides: Set<string> | string[];
|
|
122
|
+
completedChecklists: Set<string> | string[];
|
|
123
|
+
audienceIds: Set<string> | string[];
|
|
124
|
+
now: Date;
|
|
125
|
+
environment: string;
|
|
126
|
+
locale?: string;
|
|
127
|
+
/** `web`, `ios` or `android`. Missing means web. */
|
|
128
|
+
platform?: string;
|
|
129
|
+
/** Current screen name (mobile SDKs; set via `screen()`). */
|
|
130
|
+
screen?: string;
|
|
131
|
+
/** Host app version (mobile SDKs), e.g. `2.4.1`. */
|
|
132
|
+
appVersion?: string;
|
|
133
|
+
/** Salt for rollout (guide id). Set per guide before evaluating. */
|
|
134
|
+
rolloutSalt?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Views of tagged pages / clicks on tagged features in the last 30 days, by tag id. Only the server
|
|
137
|
+
* fills it (audience evaluation); in the browser `page.views` / `feature.clicks` read 0.
|
|
138
|
+
*/
|
|
139
|
+
tagUsage?: Record<string, number>;
|
|
140
|
+
}
|
|
141
|
+
declare function compare(op: RuleOperator, actual: unknown, expected: Rule["value"]): boolean;
|
|
142
|
+
declare function evaluateRule(rule: Rule, ctx: TargetingContext): boolean;
|
|
143
|
+
/** Evaluate a rule tree. An empty group matches everyone. */
|
|
144
|
+
declare function evaluateRules(group: RuleGroup | null | undefined, ctx: TargetingContext): boolean;
|
|
145
|
+
/** Fields whose evaluation requires server-held data. Used by docs/UI to annotate rules. */
|
|
146
|
+
declare const SERVER_ASSISTED_FIELDS: RuleField[];
|
|
147
|
+
/** Who a guide is shown to, before its targeting rules: everyone, only signed-in (identified) users, or only anonymous visitors. */
|
|
148
|
+
declare const GUIDE_VISIBILITIES: readonly ["everyone", "identified", "anonymous"];
|
|
149
|
+
type GuideVisibility = (typeof GUIDE_VISIBILITIES)[number];
|
|
150
|
+
/**
|
|
151
|
+
* Targeting with the visibility folded in as a `user.identified` rule. The server sends guides to SDKs
|
|
152
|
+
* this way, so every SDK applies it through the rules it already evaluates (SDKs that predate the field
|
|
153
|
+
* resolve it as undefined and show the guide to nobody rather than to everyone).
|
|
154
|
+
*/
|
|
155
|
+
declare function withVisibility(targeting: RuleGroup, visibility: GuideVisibility | undefined): RuleGroup;
|
|
156
|
+
declare function describeRule(rule: Rule): string;
|
|
157
|
+
|
|
158
|
+
declare const GUIDE_KINDS: readonly ["flow", "modal", "tooltip", "banner", "checklist", "survey", "announcement"];
|
|
159
|
+
type GuideKind = (typeof GUIDE_KINDS)[number];
|
|
160
|
+
declare const GUIDE_STATUSES: readonly ["draft", "published", "paused", "archived"];
|
|
161
|
+
type GuideStatus = (typeof GUIDE_STATUSES)[number];
|
|
162
|
+
declare const STEP_TYPES: readonly ["modal", "tooltip", "popover", "spotlight", "hotspot", "banner", "slideout", "checklist", "custom", "survey"];
|
|
163
|
+
type StepType = (typeof STEP_TYPES)[number];
|
|
164
|
+
declare const PLACEMENTS: readonly ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "auto"];
|
|
165
|
+
type Placement = (typeof PLACEMENTS)[number];
|
|
166
|
+
/** `guidely-id` is cross-platform: `data-guidely-id` on web, `GuidelyTarget` / `guidelyTarget()` on mobile. */
|
|
167
|
+
declare const SELECTOR_KINDS: readonly ["css", "id", "data-attr", "aria", "text", "xpath", "guidely-id"];
|
|
168
|
+
declare const SelectorStrategySchema: z.ZodObject<{
|
|
169
|
+
kind: z.ZodEnum<{
|
|
170
|
+
id: "id";
|
|
171
|
+
text: "text";
|
|
172
|
+
css: "css";
|
|
173
|
+
"data-attr": "data-attr";
|
|
174
|
+
aria: "aria";
|
|
175
|
+
xpath: "xpath";
|
|
176
|
+
"guidely-id": "guidely-id";
|
|
177
|
+
}>;
|
|
178
|
+
value: z.ZodString;
|
|
179
|
+
label: z.ZodOptional<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
type SelectorStrategy = z.infer<typeof SelectorStrategySchema>;
|
|
182
|
+
declare const TargetSchema: z.ZodObject<{
|
|
183
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
184
|
+
kind: z.ZodEnum<{
|
|
185
|
+
id: "id";
|
|
186
|
+
text: "text";
|
|
187
|
+
css: "css";
|
|
188
|
+
"data-attr": "data-attr";
|
|
189
|
+
aria: "aria";
|
|
190
|
+
xpath: "xpath";
|
|
191
|
+
"guidely-id": "guidely-id";
|
|
192
|
+
}>;
|
|
193
|
+
value: z.ZodString;
|
|
194
|
+
label: z.ZodOptional<z.ZodString>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
waitMs: z.ZodDefault<z.ZodNumber>;
|
|
197
|
+
fallback: z.ZodDefault<z.ZodEnum<{
|
|
198
|
+
skip: "skip";
|
|
199
|
+
show_as_modal: "show_as_modal";
|
|
200
|
+
end_guide: "end_guide";
|
|
201
|
+
wait: "wait";
|
|
202
|
+
}>>;
|
|
203
|
+
scrollIntoView: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
textSnapshot: z.ZodOptional<z.ZodString>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
type StepTarget = z.infer<typeof TargetSchema>;
|
|
207
|
+
declare const BUTTON_ACTIONS: readonly ["next", "back", "dismiss", "complete", "skip", "url", "start_guide", "event", "open_resource_center", "none"];
|
|
208
|
+
declare const ButtonSchema: z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
label: z.ZodString;
|
|
211
|
+
action: z.ZodEnum<{
|
|
212
|
+
skip: "skip";
|
|
213
|
+
next: "next";
|
|
214
|
+
back: "back";
|
|
215
|
+
dismiss: "dismiss";
|
|
216
|
+
complete: "complete";
|
|
217
|
+
url: "url";
|
|
218
|
+
start_guide: "start_guide";
|
|
219
|
+
event: "event";
|
|
220
|
+
open_resource_center: "open_resource_center";
|
|
221
|
+
none: "none";
|
|
222
|
+
}>;
|
|
223
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
224
|
+
link: "link";
|
|
225
|
+
primary: "primary";
|
|
226
|
+
secondary: "secondary";
|
|
227
|
+
ghost: "ghost";
|
|
228
|
+
}>>;
|
|
229
|
+
value: z.ZodOptional<z.ZodString>;
|
|
230
|
+
newTab: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
type StepButton = z.infer<typeof ButtonSchema>;
|
|
233
|
+
declare const StepBranchSchema: z.ZodObject<{
|
|
234
|
+
id: z.ZodString;
|
|
235
|
+
when: z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>;
|
|
236
|
+
goTo: z.ZodString;
|
|
237
|
+
}, z.core.$strip>;
|
|
238
|
+
declare const ADVANCE_ON: readonly ["button", "element_click", "element_visible", "event", "delay", "any"];
|
|
239
|
+
declare const StepSchema: z.ZodObject<{
|
|
240
|
+
id: z.ZodString;
|
|
241
|
+
type: z.ZodEnum<{
|
|
242
|
+
custom: "custom";
|
|
243
|
+
modal: "modal";
|
|
244
|
+
tooltip: "tooltip";
|
|
245
|
+
banner: "banner";
|
|
246
|
+
checklist: "checklist";
|
|
247
|
+
survey: "survey";
|
|
248
|
+
popover: "popover";
|
|
249
|
+
spotlight: "spotlight";
|
|
250
|
+
hotspot: "hotspot";
|
|
251
|
+
slideout: "slideout";
|
|
252
|
+
}>;
|
|
253
|
+
title: z.ZodDefault<z.ZodString>;
|
|
254
|
+
body: z.ZodDefault<z.ZodString>;
|
|
255
|
+
imageUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
256
|
+
imageAlt: z.ZodOptional<z.ZodString>;
|
|
257
|
+
videoUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
258
|
+
buttons: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
label: z.ZodString;
|
|
261
|
+
action: z.ZodEnum<{
|
|
262
|
+
skip: "skip";
|
|
263
|
+
next: "next";
|
|
264
|
+
back: "back";
|
|
265
|
+
dismiss: "dismiss";
|
|
266
|
+
complete: "complete";
|
|
267
|
+
url: "url";
|
|
268
|
+
start_guide: "start_guide";
|
|
269
|
+
event: "event";
|
|
270
|
+
open_resource_center: "open_resource_center";
|
|
271
|
+
none: "none";
|
|
272
|
+
}>;
|
|
273
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
274
|
+
link: "link";
|
|
275
|
+
primary: "primary";
|
|
276
|
+
secondary: "secondary";
|
|
277
|
+
ghost: "ghost";
|
|
278
|
+
}>>;
|
|
279
|
+
value: z.ZodOptional<z.ZodString>;
|
|
280
|
+
newTab: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
}, z.core.$strip>>>;
|
|
282
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
284
|
+
kind: z.ZodEnum<{
|
|
285
|
+
id: "id";
|
|
286
|
+
text: "text";
|
|
287
|
+
css: "css";
|
|
288
|
+
"data-attr": "data-attr";
|
|
289
|
+
aria: "aria";
|
|
290
|
+
xpath: "xpath";
|
|
291
|
+
"guidely-id": "guidely-id";
|
|
292
|
+
}>;
|
|
293
|
+
value: z.ZodString;
|
|
294
|
+
label: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, z.core.$strip>>;
|
|
296
|
+
waitMs: z.ZodDefault<z.ZodNumber>;
|
|
297
|
+
fallback: z.ZodDefault<z.ZodEnum<{
|
|
298
|
+
skip: "skip";
|
|
299
|
+
show_as_modal: "show_as_modal";
|
|
300
|
+
end_guide: "end_guide";
|
|
301
|
+
wait: "wait";
|
|
302
|
+
}>>;
|
|
303
|
+
scrollIntoView: z.ZodDefault<z.ZodBoolean>;
|
|
304
|
+
textSnapshot: z.ZodOptional<z.ZodString>;
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
|
+
placement: z.ZodDefault<z.ZodEnum<{
|
|
307
|
+
top: "top";
|
|
308
|
+
"top-start": "top-start";
|
|
309
|
+
"top-end": "top-end";
|
|
310
|
+
right: "right";
|
|
311
|
+
"right-start": "right-start";
|
|
312
|
+
"right-end": "right-end";
|
|
313
|
+
bottom: "bottom";
|
|
314
|
+
"bottom-start": "bottom-start";
|
|
315
|
+
"bottom-end": "bottom-end";
|
|
316
|
+
left: "left";
|
|
317
|
+
"left-start": "left-start";
|
|
318
|
+
"left-end": "left-end";
|
|
319
|
+
auto: "auto";
|
|
320
|
+
}>>;
|
|
321
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
322
|
+
showOverlay: z.ZodDefault<z.ZodBoolean>;
|
|
323
|
+
showProgress: z.ZodDefault<z.ZodBoolean>;
|
|
324
|
+
showClose: z.ZodDefault<z.ZodBoolean>;
|
|
325
|
+
dismissOnOutsideClick: z.ZodDefault<z.ZodBoolean>;
|
|
326
|
+
spotlightPadding: z.ZodDefault<z.ZodNumber>;
|
|
327
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
328
|
+
top: "top";
|
|
329
|
+
bottom: "bottom";
|
|
330
|
+
"top-left": "top-left";
|
|
331
|
+
"top-right": "top-right";
|
|
332
|
+
"bottom-left": "bottom-left";
|
|
333
|
+
"bottom-right": "bottom-right";
|
|
334
|
+
center: "center";
|
|
335
|
+
}>>;
|
|
336
|
+
url: z.ZodOptional<z.ZodString>;
|
|
337
|
+
advanceOn: z.ZodDefault<z.ZodEnum<{
|
|
338
|
+
any: "any";
|
|
339
|
+
button: "button";
|
|
340
|
+
event: "event";
|
|
341
|
+
element_click: "element_click";
|
|
342
|
+
element_visible: "element_visible";
|
|
343
|
+
delay: "delay";
|
|
344
|
+
}>>;
|
|
345
|
+
advanceValue: z.ZodOptional<z.ZodString>;
|
|
346
|
+
advanceDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
347
|
+
branches: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
348
|
+
id: z.ZodString;
|
|
349
|
+
when: z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>;
|
|
350
|
+
goTo: z.ZodString;
|
|
351
|
+
}, z.core.$strip>>>;
|
|
352
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
353
|
+
targeting: z.ZodOptional<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
354
|
+
hotspot: z.ZodOptional<z.ZodObject<{
|
|
355
|
+
size: z.ZodDefault<z.ZodNumber>;
|
|
356
|
+
pulse: z.ZodDefault<z.ZodBoolean>;
|
|
357
|
+
openOn: z.ZodDefault<z.ZodEnum<{
|
|
358
|
+
click: "click";
|
|
359
|
+
hover: "hover";
|
|
360
|
+
}>>;
|
|
361
|
+
}, z.core.$strip>>;
|
|
362
|
+
customHtml: z.ZodOptional<z.ZodString>;
|
|
363
|
+
code: z.ZodOptional<z.ZodString>;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
type GuideStep = z.infer<typeof StepSchema>;
|
|
366
|
+
type GuideStepInput = z.input<typeof StepSchema>;
|
|
367
|
+
declare const TRIGGER_TYPES: readonly ["page_load", "url_match", "event", "element_click", "element_visible", "manual", "delay", "after_guide", "segment_enter"];
|
|
368
|
+
declare const TriggerSchema: z.ZodObject<{
|
|
369
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
370
|
+
event: "event";
|
|
371
|
+
element_click: "element_click";
|
|
372
|
+
element_visible: "element_visible";
|
|
373
|
+
delay: "delay";
|
|
374
|
+
page_load: "page_load";
|
|
375
|
+
url_match: "url_match";
|
|
376
|
+
manual: "manual";
|
|
377
|
+
after_guide: "after_guide";
|
|
378
|
+
segment_enter: "segment_enter";
|
|
379
|
+
}>>;
|
|
380
|
+
value: z.ZodOptional<z.ZodString>;
|
|
381
|
+
delayMs: z.ZodDefault<z.ZodNumber>;
|
|
382
|
+
urlPattern: z.ZodOptional<z.ZodString>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
type TriggerConfig = z.infer<typeof TriggerSchema>;
|
|
385
|
+
declare const FrequencySchema: z.ZodObject<{
|
|
386
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
387
|
+
once: "once";
|
|
388
|
+
once_per_session: "once_per_session";
|
|
389
|
+
every_time: "every_time";
|
|
390
|
+
interval: "interval";
|
|
391
|
+
}>>;
|
|
392
|
+
intervalHours: z.ZodOptional<z.ZodNumber>;
|
|
393
|
+
maxImpressions: z.ZodOptional<z.ZodNumber>;
|
|
394
|
+
cooldownHours: z.ZodDefault<z.ZodNumber>;
|
|
395
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
396
|
+
mutuallyExclusiveWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
397
|
+
reshowAfterDismiss: z.ZodDefault<z.ZodBoolean>;
|
|
398
|
+
ignoreThrottling: z.ZodOptional<z.ZodBoolean>;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
type FrequencyConfig = z.infer<typeof FrequencySchema>;
|
|
401
|
+
declare const AppearanceSchema: z.ZodObject<{
|
|
402
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
403
|
+
auto: "auto";
|
|
404
|
+
light: "light";
|
|
405
|
+
dark: "dark";
|
|
406
|
+
}>>;
|
|
407
|
+
primaryColor: z.ZodOptional<z.ZodString>;
|
|
408
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
409
|
+
textColor: z.ZodOptional<z.ZodString>;
|
|
410
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
411
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
412
|
+
overlayOpacity: z.ZodOptional<z.ZodNumber>;
|
|
413
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
414
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
415
|
+
animation: z.ZodDefault<z.ZodEnum<{
|
|
416
|
+
none: "none";
|
|
417
|
+
fade: "fade";
|
|
418
|
+
slide: "slide";
|
|
419
|
+
}>>;
|
|
420
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
type Appearance = z.infer<typeof AppearanceSchema>;
|
|
423
|
+
declare const ChecklistTaskSchema: z.ZodObject<{
|
|
424
|
+
id: z.ZodString;
|
|
425
|
+
title: z.ZodString;
|
|
426
|
+
description: z.ZodDefault<z.ZodString>;
|
|
427
|
+
completion: z.ZodDefault<z.ZodEnum<{
|
|
428
|
+
event: "event";
|
|
429
|
+
click: "click";
|
|
430
|
+
manual: "manual";
|
|
431
|
+
guide_completed: "guide_completed";
|
|
432
|
+
url_visited: "url_visited";
|
|
433
|
+
}>>;
|
|
434
|
+
completionValue: z.ZodOptional<z.ZodString>;
|
|
435
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
436
|
+
url: "url";
|
|
437
|
+
start_guide: "start_guide";
|
|
438
|
+
event: "event";
|
|
439
|
+
none: "none";
|
|
440
|
+
}>>;
|
|
441
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
442
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
type ChecklistTask = z.infer<typeof ChecklistTaskSchema>;
|
|
445
|
+
declare const ChecklistConfigSchema: z.ZodObject<{
|
|
446
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
447
|
+
id: z.ZodString;
|
|
448
|
+
title: z.ZodString;
|
|
449
|
+
description: z.ZodDefault<z.ZodString>;
|
|
450
|
+
completion: z.ZodDefault<z.ZodEnum<{
|
|
451
|
+
event: "event";
|
|
452
|
+
click: "click";
|
|
453
|
+
manual: "manual";
|
|
454
|
+
guide_completed: "guide_completed";
|
|
455
|
+
url_visited: "url_visited";
|
|
456
|
+
}>>;
|
|
457
|
+
completionValue: z.ZodOptional<z.ZodString>;
|
|
458
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
459
|
+
url: "url";
|
|
460
|
+
start_guide: "start_guide";
|
|
461
|
+
event: "event";
|
|
462
|
+
none: "none";
|
|
463
|
+
}>>;
|
|
464
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
465
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
466
|
+
}, z.core.$strip>>;
|
|
467
|
+
ordered: z.ZodDefault<z.ZodBoolean>;
|
|
468
|
+
launcherLabel: z.ZodDefault<z.ZodString>;
|
|
469
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
470
|
+
"bottom-left": "bottom-left";
|
|
471
|
+
"bottom-right": "bottom-right";
|
|
472
|
+
}>>;
|
|
473
|
+
completionTitle: z.ZodDefault<z.ZodString>;
|
|
474
|
+
completionBody: z.ZodDefault<z.ZodString>;
|
|
475
|
+
autoOpen: z.ZodDefault<z.ZodBoolean>;
|
|
476
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
477
|
+
}, z.core.$strip>;
|
|
478
|
+
type ChecklistConfig = z.infer<typeof ChecklistConfigSchema>;
|
|
479
|
+
declare const SURVEY_QUESTION_TYPES: readonly ["nps", "csat", "thumbs", "single_choice", "multiple_choice", "text", "rating"];
|
|
480
|
+
declare const SurveyQuestionSchema: z.ZodObject<{
|
|
481
|
+
id: z.ZodString;
|
|
482
|
+
type: z.ZodEnum<{
|
|
483
|
+
text: "text";
|
|
484
|
+
nps: "nps";
|
|
485
|
+
csat: "csat";
|
|
486
|
+
thumbs: "thumbs";
|
|
487
|
+
single_choice: "single_choice";
|
|
488
|
+
multiple_choice: "multiple_choice";
|
|
489
|
+
rating: "rating";
|
|
490
|
+
}>;
|
|
491
|
+
title: z.ZodString;
|
|
492
|
+
description: z.ZodDefault<z.ZodString>;
|
|
493
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
494
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
495
|
+
id: z.ZodString;
|
|
496
|
+
label: z.ZodString;
|
|
497
|
+
}, z.core.$strip>>>;
|
|
498
|
+
scaleMax: z.ZodOptional<z.ZodNumber>;
|
|
499
|
+
lowLabel: z.ZodOptional<z.ZodString>;
|
|
500
|
+
highLabel: z.ZodOptional<z.ZodString>;
|
|
501
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
502
|
+
showWhen: z.ZodOptional<z.ZodObject<{
|
|
503
|
+
questionId: z.ZodString;
|
|
504
|
+
op: z.ZodEnum<{
|
|
505
|
+
equals: "equals";
|
|
506
|
+
lte: "lte";
|
|
507
|
+
gte: "gte";
|
|
508
|
+
in: "in";
|
|
509
|
+
}>;
|
|
510
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
511
|
+
}, z.core.$strip>>;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
type SurveyQuestion = z.infer<typeof SurveyQuestionSchema>;
|
|
514
|
+
declare const SurveyConfigSchema: z.ZodObject<{
|
|
515
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
516
|
+
id: z.ZodString;
|
|
517
|
+
type: z.ZodEnum<{
|
|
518
|
+
text: "text";
|
|
519
|
+
nps: "nps";
|
|
520
|
+
csat: "csat";
|
|
521
|
+
thumbs: "thumbs";
|
|
522
|
+
single_choice: "single_choice";
|
|
523
|
+
multiple_choice: "multiple_choice";
|
|
524
|
+
rating: "rating";
|
|
525
|
+
}>;
|
|
526
|
+
title: z.ZodString;
|
|
527
|
+
description: z.ZodDefault<z.ZodString>;
|
|
528
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
529
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
530
|
+
id: z.ZodString;
|
|
531
|
+
label: z.ZodString;
|
|
532
|
+
}, z.core.$strip>>>;
|
|
533
|
+
scaleMax: z.ZodOptional<z.ZodNumber>;
|
|
534
|
+
lowLabel: z.ZodOptional<z.ZodString>;
|
|
535
|
+
highLabel: z.ZodOptional<z.ZodString>;
|
|
536
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
537
|
+
showWhen: z.ZodOptional<z.ZodObject<{
|
|
538
|
+
questionId: z.ZodString;
|
|
539
|
+
op: z.ZodEnum<{
|
|
540
|
+
equals: "equals";
|
|
541
|
+
lte: "lte";
|
|
542
|
+
gte: "gte";
|
|
543
|
+
in: "in";
|
|
544
|
+
}>;
|
|
545
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
546
|
+
}, z.core.$strip>>;
|
|
547
|
+
}, z.core.$strip>>;
|
|
548
|
+
thankYouTitle: z.ZodDefault<z.ZodString>;
|
|
549
|
+
thankYouBody: z.ZodDefault<z.ZodString>;
|
|
550
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
551
|
+
"bottom-left": "bottom-left";
|
|
552
|
+
"bottom-right": "bottom-right";
|
|
553
|
+
center: "center";
|
|
554
|
+
}>>;
|
|
555
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
556
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
557
|
+
}, z.core.$strip>;
|
|
558
|
+
type SurveyConfig = z.infer<typeof SurveyConfigSchema>;
|
|
559
|
+
/**
|
|
560
|
+
* When any guide may show: `startAt` / `endAt` are UTC instants; `timezone` (IANA, e.g.
|
|
561
|
+
* `Europe/London`) is the zone they were entered in, kept for display only.
|
|
562
|
+
*/
|
|
563
|
+
declare const GuideScheduleSchema: z.ZodObject<{
|
|
564
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
565
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
566
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
type GuideSchedule = z.infer<typeof GuideScheduleSchema>;
|
|
569
|
+
/** Locale codes: BCP 47 language tags such as `fr`, `pt-BR`, `zh-Hans`. */
|
|
570
|
+
declare const LOCALE_PATTERN: RegExp;
|
|
571
|
+
declare const LocaleSchema: z.ZodString;
|
|
572
|
+
/**
|
|
573
|
+
* Translations of a guide's text: locale → translation key → text. Keys come from
|
|
574
|
+
* `guideTextEntries` (e.g. `steps.<stepId>.title`); missing keys fall back to the default language.
|
|
575
|
+
*/
|
|
576
|
+
declare const GuideLocalizationSchema: z.ZodObject<{
|
|
577
|
+
translations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
578
|
+
}, z.core.$strip>;
|
|
579
|
+
type GuideLocalization = z.infer<typeof GuideLocalizationSchema>;
|
|
580
|
+
/** Project.settings.localization: the language guides are written in and the languages offered for translation. */
|
|
581
|
+
declare const LocalizationSettingsSchema: z.ZodObject<{
|
|
582
|
+
defaultLocale: z.ZodDefault<z.ZodString>;
|
|
583
|
+
locales: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
584
|
+
autoTranslate: z.ZodOptional<z.ZodBoolean>;
|
|
585
|
+
requireReview: z.ZodOptional<z.ZodBoolean>;
|
|
586
|
+
}, z.core.$strip>;
|
|
587
|
+
/**
|
|
588
|
+
* Project.settings.guideThrottling: limits automatically launched guides per visitor (guides
|
|
589
|
+
* started by a button, a link, Help or `startGuide()` are never throttled; nor are banners,
|
|
590
|
+
* checklists and hotspot-only guides, which don't interrupt).
|
|
591
|
+
*/
|
|
592
|
+
declare const GuideThrottlingSchema: z.ZodObject<{
|
|
593
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
594
|
+
maxGuides: z.ZodDefault<z.ZodNumber>;
|
|
595
|
+
windowHours: z.ZodDefault<z.ZodNumber>;
|
|
596
|
+
minGapMinutes: z.ZodDefault<z.ZodNumber>;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
declare const GuideConfigSchema: z.ZodObject<{
|
|
599
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
600
|
+
id: z.ZodString;
|
|
601
|
+
type: z.ZodEnum<{
|
|
602
|
+
custom: "custom";
|
|
603
|
+
modal: "modal";
|
|
604
|
+
tooltip: "tooltip";
|
|
605
|
+
banner: "banner";
|
|
606
|
+
checklist: "checklist";
|
|
607
|
+
survey: "survey";
|
|
608
|
+
popover: "popover";
|
|
609
|
+
spotlight: "spotlight";
|
|
610
|
+
hotspot: "hotspot";
|
|
611
|
+
slideout: "slideout";
|
|
612
|
+
}>;
|
|
613
|
+
title: z.ZodDefault<z.ZodString>;
|
|
614
|
+
body: z.ZodDefault<z.ZodString>;
|
|
615
|
+
imageUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
616
|
+
imageAlt: z.ZodOptional<z.ZodString>;
|
|
617
|
+
videoUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
618
|
+
buttons: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
619
|
+
id: z.ZodString;
|
|
620
|
+
label: z.ZodString;
|
|
621
|
+
action: z.ZodEnum<{
|
|
622
|
+
skip: "skip";
|
|
623
|
+
next: "next";
|
|
624
|
+
back: "back";
|
|
625
|
+
dismiss: "dismiss";
|
|
626
|
+
complete: "complete";
|
|
627
|
+
url: "url";
|
|
628
|
+
start_guide: "start_guide";
|
|
629
|
+
event: "event";
|
|
630
|
+
open_resource_center: "open_resource_center";
|
|
631
|
+
none: "none";
|
|
632
|
+
}>;
|
|
633
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
634
|
+
link: "link";
|
|
635
|
+
primary: "primary";
|
|
636
|
+
secondary: "secondary";
|
|
637
|
+
ghost: "ghost";
|
|
638
|
+
}>>;
|
|
639
|
+
value: z.ZodOptional<z.ZodString>;
|
|
640
|
+
newTab: z.ZodOptional<z.ZodBoolean>;
|
|
641
|
+
}, z.core.$strip>>>;
|
|
642
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
643
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
644
|
+
kind: z.ZodEnum<{
|
|
645
|
+
id: "id";
|
|
646
|
+
text: "text";
|
|
647
|
+
css: "css";
|
|
648
|
+
"data-attr": "data-attr";
|
|
649
|
+
aria: "aria";
|
|
650
|
+
xpath: "xpath";
|
|
651
|
+
"guidely-id": "guidely-id";
|
|
652
|
+
}>;
|
|
653
|
+
value: z.ZodString;
|
|
654
|
+
label: z.ZodOptional<z.ZodString>;
|
|
655
|
+
}, z.core.$strip>>;
|
|
656
|
+
waitMs: z.ZodDefault<z.ZodNumber>;
|
|
657
|
+
fallback: z.ZodDefault<z.ZodEnum<{
|
|
658
|
+
skip: "skip";
|
|
659
|
+
show_as_modal: "show_as_modal";
|
|
660
|
+
end_guide: "end_guide";
|
|
661
|
+
wait: "wait";
|
|
662
|
+
}>>;
|
|
663
|
+
scrollIntoView: z.ZodDefault<z.ZodBoolean>;
|
|
664
|
+
textSnapshot: z.ZodOptional<z.ZodString>;
|
|
665
|
+
}, z.core.$strip>>;
|
|
666
|
+
placement: z.ZodDefault<z.ZodEnum<{
|
|
667
|
+
top: "top";
|
|
668
|
+
"top-start": "top-start";
|
|
669
|
+
"top-end": "top-end";
|
|
670
|
+
right: "right";
|
|
671
|
+
"right-start": "right-start";
|
|
672
|
+
"right-end": "right-end";
|
|
673
|
+
bottom: "bottom";
|
|
674
|
+
"bottom-start": "bottom-start";
|
|
675
|
+
"bottom-end": "bottom-end";
|
|
676
|
+
left: "left";
|
|
677
|
+
"left-start": "left-start";
|
|
678
|
+
"left-end": "left-end";
|
|
679
|
+
auto: "auto";
|
|
680
|
+
}>>;
|
|
681
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
682
|
+
showOverlay: z.ZodDefault<z.ZodBoolean>;
|
|
683
|
+
showProgress: z.ZodDefault<z.ZodBoolean>;
|
|
684
|
+
showClose: z.ZodDefault<z.ZodBoolean>;
|
|
685
|
+
dismissOnOutsideClick: z.ZodDefault<z.ZodBoolean>;
|
|
686
|
+
spotlightPadding: z.ZodDefault<z.ZodNumber>;
|
|
687
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
688
|
+
top: "top";
|
|
689
|
+
bottom: "bottom";
|
|
690
|
+
"top-left": "top-left";
|
|
691
|
+
"top-right": "top-right";
|
|
692
|
+
"bottom-left": "bottom-left";
|
|
693
|
+
"bottom-right": "bottom-right";
|
|
694
|
+
center: "center";
|
|
695
|
+
}>>;
|
|
696
|
+
url: z.ZodOptional<z.ZodString>;
|
|
697
|
+
advanceOn: z.ZodDefault<z.ZodEnum<{
|
|
698
|
+
any: "any";
|
|
699
|
+
button: "button";
|
|
700
|
+
event: "event";
|
|
701
|
+
element_click: "element_click";
|
|
702
|
+
element_visible: "element_visible";
|
|
703
|
+
delay: "delay";
|
|
704
|
+
}>>;
|
|
705
|
+
advanceValue: z.ZodOptional<z.ZodString>;
|
|
706
|
+
advanceDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
707
|
+
branches: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
708
|
+
id: z.ZodString;
|
|
709
|
+
when: z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>;
|
|
710
|
+
goTo: z.ZodString;
|
|
711
|
+
}, z.core.$strip>>>;
|
|
712
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
713
|
+
targeting: z.ZodOptional<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
714
|
+
hotspot: z.ZodOptional<z.ZodObject<{
|
|
715
|
+
size: z.ZodDefault<z.ZodNumber>;
|
|
716
|
+
pulse: z.ZodDefault<z.ZodBoolean>;
|
|
717
|
+
openOn: z.ZodDefault<z.ZodEnum<{
|
|
718
|
+
click: "click";
|
|
719
|
+
hover: "hover";
|
|
720
|
+
}>>;
|
|
721
|
+
}, z.core.$strip>>;
|
|
722
|
+
customHtml: z.ZodOptional<z.ZodString>;
|
|
723
|
+
code: z.ZodOptional<z.ZodString>;
|
|
724
|
+
}, z.core.$strip>>>;
|
|
725
|
+
visibility: z.ZodDefault<z.ZodEnum<{
|
|
726
|
+
everyone: "everyone";
|
|
727
|
+
identified: "identified";
|
|
728
|
+
anonymous: "anonymous";
|
|
729
|
+
}>>;
|
|
730
|
+
targeting: z.ZodDefault<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
731
|
+
trigger: z.ZodPrefault<z.ZodObject<{
|
|
732
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
733
|
+
event: "event";
|
|
734
|
+
element_click: "element_click";
|
|
735
|
+
element_visible: "element_visible";
|
|
736
|
+
delay: "delay";
|
|
737
|
+
page_load: "page_load";
|
|
738
|
+
url_match: "url_match";
|
|
739
|
+
manual: "manual";
|
|
740
|
+
after_guide: "after_guide";
|
|
741
|
+
segment_enter: "segment_enter";
|
|
742
|
+
}>>;
|
|
743
|
+
value: z.ZodOptional<z.ZodString>;
|
|
744
|
+
delayMs: z.ZodDefault<z.ZodNumber>;
|
|
745
|
+
urlPattern: z.ZodOptional<z.ZodString>;
|
|
746
|
+
}, z.core.$strip>>;
|
|
747
|
+
frequency: z.ZodPrefault<z.ZodObject<{
|
|
748
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
749
|
+
once: "once";
|
|
750
|
+
once_per_session: "once_per_session";
|
|
751
|
+
every_time: "every_time";
|
|
752
|
+
interval: "interval";
|
|
753
|
+
}>>;
|
|
754
|
+
intervalHours: z.ZodOptional<z.ZodNumber>;
|
|
755
|
+
maxImpressions: z.ZodOptional<z.ZodNumber>;
|
|
756
|
+
cooldownHours: z.ZodDefault<z.ZodNumber>;
|
|
757
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
758
|
+
mutuallyExclusiveWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
759
|
+
reshowAfterDismiss: z.ZodDefault<z.ZodBoolean>;
|
|
760
|
+
ignoreThrottling: z.ZodOptional<z.ZodBoolean>;
|
|
761
|
+
}, z.core.$strip>>;
|
|
762
|
+
appearance: z.ZodPrefault<z.ZodObject<{
|
|
763
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
764
|
+
auto: "auto";
|
|
765
|
+
light: "light";
|
|
766
|
+
dark: "dark";
|
|
767
|
+
}>>;
|
|
768
|
+
primaryColor: z.ZodOptional<z.ZodString>;
|
|
769
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
770
|
+
textColor: z.ZodOptional<z.ZodString>;
|
|
771
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
773
|
+
overlayOpacity: z.ZodOptional<z.ZodNumber>;
|
|
774
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
775
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
776
|
+
animation: z.ZodDefault<z.ZodEnum<{
|
|
777
|
+
none: "none";
|
|
778
|
+
fade: "fade";
|
|
779
|
+
slide: "slide";
|
|
780
|
+
}>>;
|
|
781
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
782
|
+
}, z.core.$strip>>;
|
|
783
|
+
checklist: z.ZodOptional<z.ZodObject<{
|
|
784
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
785
|
+
id: z.ZodString;
|
|
786
|
+
title: z.ZodString;
|
|
787
|
+
description: z.ZodDefault<z.ZodString>;
|
|
788
|
+
completion: z.ZodDefault<z.ZodEnum<{
|
|
789
|
+
event: "event";
|
|
790
|
+
click: "click";
|
|
791
|
+
manual: "manual";
|
|
792
|
+
guide_completed: "guide_completed";
|
|
793
|
+
url_visited: "url_visited";
|
|
794
|
+
}>>;
|
|
795
|
+
completionValue: z.ZodOptional<z.ZodString>;
|
|
796
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
797
|
+
url: "url";
|
|
798
|
+
start_guide: "start_guide";
|
|
799
|
+
event: "event";
|
|
800
|
+
none: "none";
|
|
801
|
+
}>>;
|
|
802
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
803
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
804
|
+
}, z.core.$strip>>;
|
|
805
|
+
ordered: z.ZodDefault<z.ZodBoolean>;
|
|
806
|
+
launcherLabel: z.ZodDefault<z.ZodString>;
|
|
807
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
808
|
+
"bottom-left": "bottom-left";
|
|
809
|
+
"bottom-right": "bottom-right";
|
|
810
|
+
}>>;
|
|
811
|
+
completionTitle: z.ZodDefault<z.ZodString>;
|
|
812
|
+
completionBody: z.ZodDefault<z.ZodString>;
|
|
813
|
+
autoOpen: z.ZodDefault<z.ZodBoolean>;
|
|
814
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
815
|
+
}, z.core.$strip>>;
|
|
816
|
+
survey: z.ZodOptional<z.ZodObject<{
|
|
817
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
818
|
+
id: z.ZodString;
|
|
819
|
+
type: z.ZodEnum<{
|
|
820
|
+
text: "text";
|
|
821
|
+
nps: "nps";
|
|
822
|
+
csat: "csat";
|
|
823
|
+
thumbs: "thumbs";
|
|
824
|
+
single_choice: "single_choice";
|
|
825
|
+
multiple_choice: "multiple_choice";
|
|
826
|
+
rating: "rating";
|
|
827
|
+
}>;
|
|
828
|
+
title: z.ZodString;
|
|
829
|
+
description: z.ZodDefault<z.ZodString>;
|
|
830
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
831
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
832
|
+
id: z.ZodString;
|
|
833
|
+
label: z.ZodString;
|
|
834
|
+
}, z.core.$strip>>>;
|
|
835
|
+
scaleMax: z.ZodOptional<z.ZodNumber>;
|
|
836
|
+
lowLabel: z.ZodOptional<z.ZodString>;
|
|
837
|
+
highLabel: z.ZodOptional<z.ZodString>;
|
|
838
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
839
|
+
showWhen: z.ZodOptional<z.ZodObject<{
|
|
840
|
+
questionId: z.ZodString;
|
|
841
|
+
op: z.ZodEnum<{
|
|
842
|
+
equals: "equals";
|
|
843
|
+
lte: "lte";
|
|
844
|
+
gte: "gte";
|
|
845
|
+
in: "in";
|
|
846
|
+
}>;
|
|
847
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
848
|
+
}, z.core.$strip>>;
|
|
849
|
+
}, z.core.$strip>>;
|
|
850
|
+
thankYouTitle: z.ZodDefault<z.ZodString>;
|
|
851
|
+
thankYouBody: z.ZodDefault<z.ZodString>;
|
|
852
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
853
|
+
"bottom-left": "bottom-left";
|
|
854
|
+
"bottom-right": "bottom-right";
|
|
855
|
+
center: "center";
|
|
856
|
+
}>>;
|
|
857
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
858
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
859
|
+
}, z.core.$strip>>;
|
|
860
|
+
urlPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
861
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
862
|
+
web: "web";
|
|
863
|
+
ios: "ios";
|
|
864
|
+
android: "android";
|
|
865
|
+
}>>>;
|
|
866
|
+
schedule: z.ZodOptional<z.ZodObject<{
|
|
867
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
868
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
869
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
870
|
+
}, z.core.$strip>>;
|
|
871
|
+
localization: z.ZodOptional<z.ZodObject<{
|
|
872
|
+
translations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
873
|
+
}, z.core.$strip>>;
|
|
874
|
+
}, z.core.$strip>;
|
|
875
|
+
type GuideConfig = z.infer<typeof GuideConfigSchema>;
|
|
876
|
+
type GuideConfigInput = z.input<typeof GuideConfigSchema>;
|
|
877
|
+
declare function defaultGuideConfig(kind: GuideKind): GuideConfig;
|
|
878
|
+
declare function defaultStep(type: StepType, overrides?: Partial<GuideStepInput>): GuideStep;
|
|
879
|
+
/** Buttons to show for a step; "back" buttons are hidden when there is no previous step to return to. */
|
|
880
|
+
declare function visibleButtons(step: GuideStep, canGoBack: boolean): GuideStep["buttons"];
|
|
881
|
+
/** Validation beyond Zod shape: returns human-readable problems that block publishing. */
|
|
882
|
+
interface ValidationIssue {
|
|
883
|
+
level: "error" | "warning";
|
|
884
|
+
stepId?: string;
|
|
885
|
+
message: string;
|
|
886
|
+
}
|
|
887
|
+
declare function validateGuideConfig(kind: GuideKind, config: GuideConfig, theme?: Partial<Pick<ProjectTheme, "primaryColor" | "backgroundColor" | "textColor">>): ValidationIssue[];
|
|
888
|
+
interface ProjectTheme {
|
|
889
|
+
primaryColor: string;
|
|
890
|
+
backgroundColor: string;
|
|
891
|
+
textColor: string;
|
|
892
|
+
borderRadius: number;
|
|
893
|
+
fontFamily: string;
|
|
894
|
+
logoUrl?: string;
|
|
895
|
+
brandName?: string;
|
|
896
|
+
customCss?: string;
|
|
897
|
+
}
|
|
898
|
+
declare const ProjectThemeSchema: z.ZodObject<{
|
|
899
|
+
primaryColor: z.ZodDefault<z.ZodString>;
|
|
900
|
+
backgroundColor: z.ZodDefault<z.ZodString>;
|
|
901
|
+
textColor: z.ZodDefault<z.ZodString>;
|
|
902
|
+
borderRadius: z.ZodDefault<z.ZodNumber>;
|
|
903
|
+
fontFamily: z.ZodDefault<z.ZodString>;
|
|
904
|
+
logoUrl: z.ZodOptional<z.ZodString>;
|
|
905
|
+
brandName: z.ZodOptional<z.ZodString>;
|
|
906
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
907
|
+
}, z.core.$strip>;
|
|
908
|
+
|
|
909
|
+
/** Reserved property names that are stripped from `properties` to avoid collecting sensitive data. */
|
|
910
|
+
declare const SENSITIVE_PROPERTY_PATTERN: RegExp;
|
|
911
|
+
declare const MAX_PROPERTY_BYTES: number;
|
|
912
|
+
/** Longest app version kept (longer values are cut). */
|
|
913
|
+
declare const MAX_APP_VERSION_LENGTH = 64;
|
|
914
|
+
/**
|
|
915
|
+
* An app version as stored and reported: trimmed, control characters removed, at most 64 characters,
|
|
916
|
+
* or null when empty. Kept verbatim otherwise (`2.4.1`, `v2.4.1`, `2026.10.26-beta+512`), so reports
|
|
917
|
+
* show what the app sent; ordering uses `compareVersions`.
|
|
918
|
+
*/
|
|
919
|
+
declare function normalizeAppVersion(input: unknown): string | null;
|
|
920
|
+
declare function sanitizeProperties(props: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
921
|
+
|
|
922
|
+
/** One parsed stack frame. `file` is the script URL (or path) as the browser reported it. */
|
|
923
|
+
interface StackFrame {
|
|
924
|
+
fn?: string;
|
|
925
|
+
file?: string;
|
|
926
|
+
line?: number;
|
|
927
|
+
col?: number;
|
|
928
|
+
/** False for library / framework frames (Sentry `in_app`); grouping skips them when an app frame exists. Unset = unknown. */
|
|
929
|
+
inApp?: boolean;
|
|
930
|
+
/** Module or package (Sentry `module`: `myapp.views`, `com.acme.Foo`), for platforms without file paths. */
|
|
931
|
+
module?: string;
|
|
932
|
+
/** JavaScript debug id of the frame's file (Sentry `debug_meta.images`); selects its source map before release + path. */
|
|
933
|
+
debugId?: string;
|
|
934
|
+
}
|
|
935
|
+
/** Properties carried by an `exception` event (see `docs/product-analytics.md`). */
|
|
936
|
+
interface ExceptionProperties {
|
|
937
|
+
type: string;
|
|
938
|
+
message: string;
|
|
939
|
+
frames: StackFrame[];
|
|
940
|
+
/** `onerror` | `unhandledrejection` | `manual` (captureException) | `console`. */
|
|
941
|
+
source?: string;
|
|
942
|
+
handled?: boolean;
|
|
943
|
+
/** App version or commit (SDK option `release`); selects the matching uploaded source maps. */
|
|
944
|
+
release?: string;
|
|
945
|
+
/** Set by the server at ingestion; groups occurrences into an issue. */
|
|
946
|
+
fingerprint?: string;
|
|
947
|
+
}
|
|
948
|
+
declare const MAX_STACK_FRAMES = 30;
|
|
949
|
+
/**
|
|
950
|
+
* `app:///<bundle>` for a React Native bundle path (`/data/…/index.android.bundle`,
|
|
951
|
+
* `main.jsbundle`), so source maps uploaded with `--url-prefix /` match on any device.
|
|
952
|
+
*/
|
|
953
|
+
declare function reactNativeBundleUrl(file: string): string;
|
|
954
|
+
/** Parses `Error.stack` from V8, SpiderMonkey, JavaScriptCore and Hermes into frames (innermost first). */
|
|
955
|
+
declare function parseStack(stack: string | undefined | null, max?: number): StackFrame[];
|
|
956
|
+
/** Replaces volatile parts of a message (numbers, ids, quoted values) so repeats group together. */
|
|
957
|
+
declare function normalizeErrorMessage(message: string): string;
|
|
958
|
+
/** Strips origin, query, hash and build hashes (`main.3f2a1b9c.js` → `main.js`) from a script URL. */
|
|
959
|
+
declare function normalizeFrameFile(file: string | undefined): string;
|
|
960
|
+
/** Source map upload limits (`POST /api/v1/sourcemaps/upload`). */
|
|
961
|
+
/** Per map, uncompressed (the CLI uploads maps gzipped). */
|
|
962
|
+
declare const SOURCEMAP_MAX_FILE_BYTES: number;
|
|
963
|
+
declare const SOURCEMAP_MAX_FILES_PER_UPLOAD = 200;
|
|
964
|
+
/**
|
|
965
|
+
* Stable issue key for an exception: error type + normalised message + the innermost frame that
|
|
966
|
+
* has a file (path without build hash + function name, or its original source + name when a source
|
|
967
|
+
* map resolved it). Line/column numbers are left out because they change with every deploy of a
|
|
968
|
+
* minified bundle.
|
|
969
|
+
*/
|
|
970
|
+
declare function fingerprintError(input: {
|
|
971
|
+
type?: string;
|
|
972
|
+
message?: string;
|
|
973
|
+
frames?: StackFrame[];
|
|
974
|
+
original?: {
|
|
975
|
+
source: string;
|
|
976
|
+
name?: string | null;
|
|
977
|
+
} | null;
|
|
978
|
+
}): string;
|
|
979
|
+
/**
|
|
980
|
+
* Applies an SDK-supplied fingerprint (Sentry `fingerprint`: `["{{ default }}", "checkout"]`) to the
|
|
981
|
+
* computed one. `{{ default }}` stands for the computed fingerprint; without it the parts replace it.
|
|
982
|
+
*/
|
|
983
|
+
declare function customFingerprint(parts: unknown, computed: string): string;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* The `detail` of an `exception` event (docs/error-monitoring/sdks.md): everything about an error
|
|
987
|
+
* beyond the indexed properties (breadcrumbs, contexts, tags, extra, the exception chain, threads,
|
|
988
|
+
* debug images…), in the Sentry event shape so the issue page renders Guidely and Sentry SDK events
|
|
989
|
+
* alike. Zod-free: SDKs use these helpers at runtime, the server schema lives in `events.ts`.
|
|
990
|
+
*/
|
|
991
|
+
/** Largest `detail` kept per occurrence (JSON characters); SDKs and the server trim to it. */
|
|
992
|
+
declare const MAX_EXCEPTION_DETAIL_BYTES: number;
|
|
993
|
+
/** A `detail` larger than this is dropped whole instead of trimmed (the event is still stored). */
|
|
994
|
+
declare const MAX_EXCEPTION_DETAIL_RAW_BYTES: number;
|
|
995
|
+
declare const MAX_BREADCRUMBS = 100;
|
|
996
|
+
declare const MAX_EXCEPTION_CHAIN = 20;
|
|
997
|
+
declare const MAX_DETAIL_FRAMES = 250;
|
|
998
|
+
declare const MAX_DETAIL_THREADS = 100;
|
|
999
|
+
declare const MAX_DEBUG_IMAGES = 500;
|
|
1000
|
+
declare const MAX_ERROR_TAGS = 50;
|
|
1001
|
+
type ErrorLevelName = "fatal" | "error" | "warning" | "info" | "debug";
|
|
1002
|
+
/** A Sentry-shaped frame (oldest call first in a stack, the crashing frame last). */
|
|
1003
|
+
interface DetailFrame {
|
|
1004
|
+
function?: string;
|
|
1005
|
+
module?: string;
|
|
1006
|
+
package?: string;
|
|
1007
|
+
filename?: string;
|
|
1008
|
+
abs_path?: string;
|
|
1009
|
+
lineno?: number;
|
|
1010
|
+
colno?: number;
|
|
1011
|
+
in_app?: boolean;
|
|
1012
|
+
instruction_addr?: string;
|
|
1013
|
+
image_addr?: string;
|
|
1014
|
+
symbol_addr?: string;
|
|
1015
|
+
platform?: string;
|
|
1016
|
+
context_line?: string;
|
|
1017
|
+
pre_context?: string[];
|
|
1018
|
+
post_context?: string[];
|
|
1019
|
+
vars?: Record<string, unknown>;
|
|
1020
|
+
[k: string]: unknown;
|
|
1021
|
+
}
|
|
1022
|
+
interface DetailMechanism {
|
|
1023
|
+
type?: string;
|
|
1024
|
+
handled?: boolean;
|
|
1025
|
+
synthetic?: boolean;
|
|
1026
|
+
source?: string;
|
|
1027
|
+
exception_id?: number;
|
|
1028
|
+
parent_id?: number;
|
|
1029
|
+
data?: Record<string, unknown>;
|
|
1030
|
+
meta?: Record<string, unknown>;
|
|
1031
|
+
[k: string]: unknown;
|
|
1032
|
+
}
|
|
1033
|
+
interface DetailException {
|
|
1034
|
+
type?: string;
|
|
1035
|
+
value?: string;
|
|
1036
|
+
module?: string;
|
|
1037
|
+
thread_id?: number | string;
|
|
1038
|
+
mechanism?: DetailMechanism;
|
|
1039
|
+
stacktrace?: {
|
|
1040
|
+
frames?: DetailFrame[];
|
|
1041
|
+
registers?: Record<string, string>;
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
interface Breadcrumb {
|
|
1045
|
+
/** Unix seconds (fractional). */
|
|
1046
|
+
timestamp?: number;
|
|
1047
|
+
type?: string;
|
|
1048
|
+
category?: string;
|
|
1049
|
+
message?: string;
|
|
1050
|
+
level?: ErrorLevelName | string;
|
|
1051
|
+
data?: Record<string, unknown>;
|
|
1052
|
+
}
|
|
1053
|
+
interface ExceptionDetail {
|
|
1054
|
+
level?: ErrorLevelName;
|
|
1055
|
+
exception?: {
|
|
1056
|
+
values: DetailException[];
|
|
1057
|
+
};
|
|
1058
|
+
threads?: {
|
|
1059
|
+
values: Array<{
|
|
1060
|
+
id?: number | string;
|
|
1061
|
+
name?: string;
|
|
1062
|
+
crashed?: boolean;
|
|
1063
|
+
current?: boolean;
|
|
1064
|
+
main?: boolean;
|
|
1065
|
+
stacktrace?: {
|
|
1066
|
+
frames?: DetailFrame[];
|
|
1067
|
+
};
|
|
1068
|
+
}>;
|
|
1069
|
+
};
|
|
1070
|
+
breadcrumbs?: {
|
|
1071
|
+
values: Breadcrumb[];
|
|
1072
|
+
};
|
|
1073
|
+
contexts?: Record<string, Record<string, unknown>>;
|
|
1074
|
+
tags?: Record<string, string>;
|
|
1075
|
+
extra?: Record<string, unknown>;
|
|
1076
|
+
user?: {
|
|
1077
|
+
id?: string;
|
|
1078
|
+
email?: string;
|
|
1079
|
+
username?: string;
|
|
1080
|
+
ip_address?: string;
|
|
1081
|
+
[k: string]: unknown;
|
|
1082
|
+
};
|
|
1083
|
+
fingerprint?: string[];
|
|
1084
|
+
debug_meta?: {
|
|
1085
|
+
images: Array<Record<string, unknown>>;
|
|
1086
|
+
};
|
|
1087
|
+
request?: {
|
|
1088
|
+
url?: string;
|
|
1089
|
+
method?: string;
|
|
1090
|
+
headers?: Record<string, string>;
|
|
1091
|
+
query_string?: string;
|
|
1092
|
+
data?: unknown;
|
|
1093
|
+
[k: string]: unknown;
|
|
1094
|
+
};
|
|
1095
|
+
transaction?: string;
|
|
1096
|
+
server_name?: string;
|
|
1097
|
+
logger?: string;
|
|
1098
|
+
dist?: string;
|
|
1099
|
+
environment?: string;
|
|
1100
|
+
platform?: string;
|
|
1101
|
+
[k: string]: unknown;
|
|
1102
|
+
}
|
|
1103
|
+
/** Tags as Sentry keeps them: at most 50, keys ≤ 32 and values ≤ 200 characters, values stringified. */
|
|
1104
|
+
declare function normalizeTags(tags: Record<string, unknown> | null | undefined): Record<string, string>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Trims a detail to `max` JSON characters, in the order the contract fixes: oldest breadcrumbs, then
|
|
1107
|
+
* frame variables and source context, then threads other than the crashed one, then extra, then
|
|
1108
|
+
* frames from the middle of long stacks. Mutates and returns `detail`.
|
|
1109
|
+
*/
|
|
1110
|
+
declare function trimExceptionDetail<T extends ExceptionDetail>(detail: T, max?: number): T;
|
|
1111
|
+
/** An `ignoreErrors` / `denyUrls` / `allowUrls` entry: a substring, or a pattern. */
|
|
1112
|
+
type ErrorFilterPattern = string | RegExp;
|
|
1113
|
+
/**
|
|
1114
|
+
* True when the SDK's filters drop an error: `ignoreErrors` matches `"<type>: <message>"` or the
|
|
1115
|
+
* message; `denyUrls` matches the innermost frame file; a non-empty `allowUrls` that doesn't match
|
|
1116
|
+
* it drops the error too. Errors without a frame file pass the URL filters. Shared by every SDK
|
|
1117
|
+
* (conformance vectors `errorFilters`).
|
|
1118
|
+
*/
|
|
1119
|
+
declare function errorFilterDrops(e: {
|
|
1120
|
+
type?: string;
|
|
1121
|
+
message?: string;
|
|
1122
|
+
file?: string | null;
|
|
1123
|
+
}, opts: {
|
|
1124
|
+
ignoreErrors?: readonly ErrorFilterPattern[];
|
|
1125
|
+
denyUrls?: readonly ErrorFilterPattern[];
|
|
1126
|
+
allowUrls?: readonly ErrorFilterPattern[];
|
|
1127
|
+
}): boolean;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Resource center structure shared by every SDK: nested collections and audience targeting.
|
|
1131
|
+
*
|
|
1132
|
+
* Audience targeting decides what the help widget lists; it is not access control. The published
|
|
1133
|
+
* config (and every article body) is the same for all visitors of an environment, and end-user
|
|
1134
|
+
* identities are self-asserted, so never rely on it to keep an article private.
|
|
1135
|
+
*/
|
|
1136
|
+
/** Collections nest at most this deep (a collection, its sections, and their sub-sections). */
|
|
1137
|
+
declare const MAX_COLLECTION_DEPTH = 3;
|
|
1138
|
+
interface RcCollectionLike {
|
|
1139
|
+
id: string;
|
|
1140
|
+
name: string;
|
|
1141
|
+
order: number;
|
|
1142
|
+
/** Parent collection; null/absent for a top-level collection. */
|
|
1143
|
+
parentId?: string | null;
|
|
1144
|
+
/** Shown only to members of any of these audiences; empty/absent means everyone. */
|
|
1145
|
+
audienceIds?: string[];
|
|
1146
|
+
}
|
|
1147
|
+
interface RcArticleLike {
|
|
1148
|
+
id: string;
|
|
1149
|
+
collectionId?: string | null;
|
|
1150
|
+
audienceIds?: string[];
|
|
1151
|
+
}
|
|
1152
|
+
interface RcSection<C extends RcCollectionLike, A extends RcArticleLike> {
|
|
1153
|
+
/** null for articles outside any (known) collection. */
|
|
1154
|
+
collection: C | null;
|
|
1155
|
+
/** Collection names from the top level down, e.g. ["Billing", "Invoices"]. */
|
|
1156
|
+
path: string[];
|
|
1157
|
+
/** 0 for a top-level collection. */
|
|
1158
|
+
depth: number;
|
|
1159
|
+
articles: A[];
|
|
1160
|
+
}
|
|
1161
|
+
type Membership = ReadonlySet<string> | readonly string[] | undefined | null;
|
|
1162
|
+
/** True when an item targeted at `required` audiences is shown to someone in `member`. */
|
|
1163
|
+
declare function matchesAudiences(required: readonly string[] | undefined | null, member: Membership): boolean;
|
|
1164
|
+
/**
|
|
1165
|
+
* Article sections in display order: each collection (depth first, siblings by `order`) with the
|
|
1166
|
+
* visible articles filed directly in it, then the uncategorized articles. A collection the viewer
|
|
1167
|
+
* isn't targeted by hides its whole subtree, and sections without visible articles are left out
|
|
1168
|
+
* (their sub-collections still appear). Unknown parents count as top level, so an old config or a
|
|
1169
|
+
* dangling reference never hides content.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function resourceCenterSections<C extends RcCollectionLike, A extends RcArticleLike>(collections: readonly C[], articles: readonly A[], member?: Membership): Array<RcSection<C, A>>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Whether one article is listed for a viewer: its own audiences and those of every collection above
|
|
1174
|
+
* it must match. For articles outside a loaded list (e.g. server search results).
|
|
1175
|
+
*/
|
|
1176
|
+
declare function isArticleListed(collections: readonly RcCollectionLike[], article: RcArticleLike, member?: Membership): boolean;
|
|
1177
|
+
/** Who an article is listed for, besides its audiences: everyone, or logged-in (identified) visitors only. */
|
|
1178
|
+
declare const ARTICLE_VISIBILITIES: readonly ["everyone", "identified"];
|
|
1179
|
+
type ArticleVisibility = (typeof ARTICLE_VISIBILITIES)[number];
|
|
1180
|
+
/**
|
|
1181
|
+
* Reserved audience every logged-in visitor belongs to. The server folds an article's visibility into
|
|
1182
|
+
* the audiences it serves and adds this one to identified visitors' memberships, so every SDK (old ones
|
|
1183
|
+
* too) applies "logged-in only" through the audience matching it already does. Anonymous visitors never
|
|
1184
|
+
* identify, so their membership is empty and these articles stay hidden.
|
|
1185
|
+
*/
|
|
1186
|
+
declare const LOGGED_IN_AUDIENCE = "$identified";
|
|
1187
|
+
/**
|
|
1188
|
+
* The audiences an article is served with. Logged-in only with no audiences becomes the reserved
|
|
1189
|
+
* audience; with audiences it is already implied, since audience membership only comes from identify.
|
|
1190
|
+
*/
|
|
1191
|
+
declare function servedArticleAudiences(audienceIds: readonly string[], visibility: ArticleVisibility | string | null | undefined): string[];
|
|
1192
|
+
/** A visitor's memberships as matched against served articles: logged-in visitors are also in `LOGGED_IN_AUDIENCE`. */
|
|
1193
|
+
declare function visitorAudiences(audienceIds: readonly string[], identified: boolean): string[];
|
|
1194
|
+
/** Ids of the articles a viewer sees (for filtering server search results the same way). */
|
|
1195
|
+
declare function visibleArticleIds(collections: readonly RcCollectionLike[], articles: readonly RcArticleLike[], member?: Membership): Set<string>;
|
|
1196
|
+
/**
|
|
1197
|
+
* A "Show me" prompt in an article body is a plain link, `<p class="gd-show-me"><a href="#guidely-show-me:<guide key>">Show me how</a></p>`,
|
|
1198
|
+
* so it survives every sanitizer and reads as a harmless link anywhere else. The widgets turn it into a
|
|
1199
|
+
* button that starts the walkthrough (a live flow guide), or hide it when that guide isn't available.
|
|
1200
|
+
*/
|
|
1201
|
+
declare const SHOW_ME_CLASS = "gd-show-me";
|
|
1202
|
+
declare const SHOW_ME_HREF_PREFIX = "#guidely-show-me:";
|
|
1203
|
+
declare function showMeHref(guideKey: string): string;
|
|
1204
|
+
/** The guide key of a Show me link's `href`, or null. */
|
|
1205
|
+
declare function showMeKeyFromHref(href: string | null | undefined): string | null;
|
|
1206
|
+
/** Guide keys of the Show me prompts in an article body, in order, without repeats (at most 10). */
|
|
1207
|
+
declare function showMeKeys(html: string | null | undefined): string[];
|
|
1208
|
+
/** The article body plays a video (uploaded, or embedded from YouTube, Vimeo, Loom or Wistia). */
|
|
1209
|
+
declare function hasVideoMedia(html: string | null | undefined): boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* Help search on the device: every word of the query starts a word of the text, in any order, or the
|
|
1212
|
+
* query appears as typed. "add user" finds "Add a new user" and "Users › Add".
|
|
1213
|
+
*/
|
|
1214
|
+
declare function matchesHelpQuery(text: string, query: string): boolean;
|
|
1215
|
+
declare const RC_MODULE_IDS: readonly ["announcements", "search", "checklists", "guides", "articles", "links", "faqs"];
|
|
1216
|
+
type ResourceCenterModuleId = (typeof RC_MODULE_IDS)[number];
|
|
1217
|
+
declare const RC_MODULE_LABELS: Record<ResourceCenterModuleId, string>;
|
|
1218
|
+
/**
|
|
1219
|
+
* The resource center's sections in display order: the configured modules (unknown ids dropped,
|
|
1220
|
+
* missing ones appended enabled, in the default order), so an old config shows every section.
|
|
1221
|
+
*/
|
|
1222
|
+
declare function orderedModules<M extends {
|
|
1223
|
+
id: string;
|
|
1224
|
+
enabled: boolean;
|
|
1225
|
+
}>(modules: readonly M[] | null | undefined): Array<M | {
|
|
1226
|
+
id: ResourceCenterModuleId;
|
|
1227
|
+
enabled: true;
|
|
1228
|
+
}>;
|
|
1229
|
+
/** Announcements a visitor sees: published (not in the future), audience-matched, newest first. */
|
|
1230
|
+
declare function visibleAnnouncements<A extends {
|
|
1231
|
+
publishedAt: string;
|
|
1232
|
+
audienceIds?: string[];
|
|
1233
|
+
}>(items: readonly A[] | null | undefined, member?: Membership, now?: number): A[];
|
|
1234
|
+
/** Unread count for the launcher badge: announcements published after the visitor last opened "What's new". */
|
|
1235
|
+
declare function unreadAnnouncements(items: readonly {
|
|
1236
|
+
publishedAt: string;
|
|
1237
|
+
}[], lastSeenAt: string | null | undefined): number;
|
|
1238
|
+
/**
|
|
1239
|
+
* A link to a help article from guide or article HTML: `<a href="#guidely-article:ID">`. A fragment
|
|
1240
|
+
* survives every sanitizer (editor, server, SDK), and the SDKs open the article in the resource
|
|
1241
|
+
* center (or Scout's Help tab) instead of following the link.
|
|
1242
|
+
*/
|
|
1243
|
+
declare const ARTICLE_HREF_PREFIX = "#guidely-article:";
|
|
1244
|
+
declare function articleHref(articleId: string): string;
|
|
1245
|
+
/** The article id of an article link's `href`, or null. */
|
|
1246
|
+
declare function articleIdFromHref(href: string | null | undefined): string | null;
|
|
1247
|
+
|
|
1248
|
+
/** How-to capture constants the browser SDK needs without zod (also exported from `@guidelytech/shared/runtime`). */
|
|
1249
|
+
/** Query parameter that starts capture mode in the SDK (separate from `guidely_authoring`, so SDKs without capture ignore it). */
|
|
1250
|
+
declare const CAPTURE_PARAM = "guidely_capture";
|
|
1251
|
+
/** Largest screenshot the capture endpoint accepts. */
|
|
1252
|
+
declare const CAPTURE_SCREENSHOT_MAX_BYTES: number;
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* How-tos: step-by-step guides with screenshots, recorded by clicking through the customer's app
|
|
1256
|
+
* (SDK capture mode) and edited in the dashboard. Each step is either an action captured in the app
|
|
1257
|
+
* (click, type, select, navigate) or a block the author added (text, heading, tip, alert).
|
|
1258
|
+
*/
|
|
1259
|
+
declare const HOWTO_STEP_KINDS: readonly ["action", "text", "heading", "tip", "alert"];
|
|
1260
|
+
type HowToStepKind = (typeof HOWTO_STEP_KINDS)[number];
|
|
1261
|
+
declare const HOWTO_ACTIONS: readonly ["click", "type", "select", "navigate"];
|
|
1262
|
+
type HowToAction = (typeof HOWTO_ACTIONS)[number];
|
|
1263
|
+
/** A rectangle as fractions (0–1) of its screenshot, so it survives any rendered size. */
|
|
1264
|
+
declare const NormalizedRectSchema: z.ZodObject<{
|
|
1265
|
+
x: z.ZodNumber;
|
|
1266
|
+
y: z.ZodNumber;
|
|
1267
|
+
width: z.ZodNumber;
|
|
1268
|
+
height: z.ZodNumber;
|
|
1269
|
+
}, z.core.$strip>;
|
|
1270
|
+
type NormalizedRect = z.infer<typeof NormalizedRectSchema>;
|
|
1271
|
+
/** The element an action was performed on, described for people (not for selecting it). */
|
|
1272
|
+
declare const CapturedElementSchema: z.ZodObject<{
|
|
1273
|
+
label: z.ZodDefault<z.ZodString>;
|
|
1274
|
+
role: z.ZodDefault<z.ZodString>;
|
|
1275
|
+
tag: z.ZodDefault<z.ZodString>;
|
|
1276
|
+
}, z.core.$strip>;
|
|
1277
|
+
type CapturedElement = z.infer<typeof CapturedElementSchema>;
|
|
1278
|
+
/**
|
|
1279
|
+
* One action the SDK recorded, sent with its screenshot as multipart form data
|
|
1280
|
+
* (`step` = this JSON, `screenshot` = the image) to `POST /api/v1/sdk/capture/steps?token=`.
|
|
1281
|
+
* Sensitive values never arrive here: the SDK drops typed text from password, payment, one-time-code
|
|
1282
|
+
* and masked fields and redacts screenshots in the browser before uploading them.
|
|
1283
|
+
*/
|
|
1284
|
+
declare const CaptureStepSchema: z.ZodObject<{
|
|
1285
|
+
clientId: z.ZodString;
|
|
1286
|
+
action: z.ZodEnum<{
|
|
1287
|
+
type: "type";
|
|
1288
|
+
click: "click";
|
|
1289
|
+
select: "select";
|
|
1290
|
+
navigate: "navigate";
|
|
1291
|
+
}>;
|
|
1292
|
+
url: z.ZodString;
|
|
1293
|
+
pageTitle: z.ZodDefault<z.ZodString>;
|
|
1294
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
1295
|
+
label: z.ZodDefault<z.ZodString>;
|
|
1296
|
+
role: z.ZodDefault<z.ZodString>;
|
|
1297
|
+
tag: z.ZodDefault<z.ZodString>;
|
|
1298
|
+
}, z.core.$strip>>;
|
|
1299
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1300
|
+
valueRedacted: z.ZodDefault<z.ZodBoolean>;
|
|
1301
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1302
|
+
kind: z.ZodEnum<{
|
|
1303
|
+
id: "id";
|
|
1304
|
+
text: "text";
|
|
1305
|
+
css: "css";
|
|
1306
|
+
"data-attr": "data-attr";
|
|
1307
|
+
aria: "aria";
|
|
1308
|
+
xpath: "xpath";
|
|
1309
|
+
"guidely-id": "guidely-id";
|
|
1310
|
+
}>;
|
|
1311
|
+
value: z.ZodString;
|
|
1312
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1313
|
+
}, z.core.$strip>>>;
|
|
1314
|
+
highlight: z.ZodOptional<z.ZodObject<{
|
|
1315
|
+
x: z.ZodNumber;
|
|
1316
|
+
y: z.ZodNumber;
|
|
1317
|
+
width: z.ZodNumber;
|
|
1318
|
+
height: z.ZodNumber;
|
|
1319
|
+
}, z.core.$strip>>;
|
|
1320
|
+
redactions: z.ZodDefault<z.ZodNumber>;
|
|
1321
|
+
occurredAt: z.ZodOptional<z.ZodString>;
|
|
1322
|
+
}, z.core.$strip>;
|
|
1323
|
+
type CaptureStep = z.infer<typeof CaptureStepSchema>;
|
|
1324
|
+
type CaptureStepInput = z.input<typeof CaptureStepSchema>;
|
|
1325
|
+
/** `GET /api/v1/sdk/capture/session?token=`: what the SDK needs to start recording. */
|
|
1326
|
+
interface CaptureSessionInfo {
|
|
1327
|
+
id: string;
|
|
1328
|
+
projectId: string;
|
|
1329
|
+
environment: string;
|
|
1330
|
+
howToId: string;
|
|
1331
|
+
howToTitle: string;
|
|
1332
|
+
/** Origin of the dashboard window that opened the app (for `postMessage`). */
|
|
1333
|
+
dashboardOrigin: string;
|
|
1334
|
+
expiresAt: string;
|
|
1335
|
+
/** Steps already recorded (a recording continues across full page loads). */
|
|
1336
|
+
stepCount: number;
|
|
1337
|
+
/** False when the server has no media storage: record steps without screenshots. */
|
|
1338
|
+
screenshots: boolean;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* A label as people would say it: icon glyphs and symbols at either end ("+ New contact", "Next →")
|
|
1343
|
+
* and required-field markers ("Email *", "Name:") removed. Falls back to the raw label when nothing
|
|
1344
|
+
* readable is left.
|
|
1345
|
+
*/
|
|
1346
|
+
declare function cleanLabel(label: string | undefined | null): string;
|
|
1347
|
+
/**
|
|
1348
|
+
* Name of the page a navigate step opens. A title like "Contacts · Northwind CRM" gives "Contacts";
|
|
1349
|
+
* a title that's just the app's name (no word of the path in it) gives the path instead, so
|
|
1350
|
+
* "/contacts/new" reads "Contacts › New". Ids in the path are skipped.
|
|
1351
|
+
*/
|
|
1352
|
+
declare function pageName(url: string, pageTitle: string | undefined | null): string;
|
|
1353
|
+
/** Plain-language instruction for a captured action, e.g. `Click “Save”` or `Type “Acme” into “Company”`. */
|
|
1354
|
+
declare function describeCaptureStep(step: Pick<CaptureStepInput, "action" | "element" | "value" | "valueRedacted" | "pageTitle" | "url">): string;
|
|
1355
|
+
/** A point as fractions (0–1) of a screenshot. */
|
|
1356
|
+
declare const NormalizedPointSchema: z.ZodObject<{
|
|
1357
|
+
x: z.ZodNumber;
|
|
1358
|
+
y: z.ZodNumber;
|
|
1359
|
+
}, z.core.$strip>;
|
|
1360
|
+
declare const ANNOTATION_COLORS: readonly ["brand", "red", "amber", "green", "black", "white"];
|
|
1361
|
+
type AnnotationColor = (typeof ANNOTATION_COLORS)[number];
|
|
1362
|
+
/**
|
|
1363
|
+
* A mark drawn over a step's screenshot, in fractions of the full image so it survives cropping and
|
|
1364
|
+
* any rendered size: an arrow, a text label or a box. `brand` uses the project's primary colour.
|
|
1365
|
+
*/
|
|
1366
|
+
declare const HowToAnnotationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1367
|
+
id: z.ZodString;
|
|
1368
|
+
type: z.ZodLiteral<"arrow">;
|
|
1369
|
+
from: z.ZodObject<{
|
|
1370
|
+
x: z.ZodNumber;
|
|
1371
|
+
y: z.ZodNumber;
|
|
1372
|
+
}, z.core.$strip>;
|
|
1373
|
+
to: z.ZodObject<{
|
|
1374
|
+
x: z.ZodNumber;
|
|
1375
|
+
y: z.ZodNumber;
|
|
1376
|
+
}, z.core.$strip>;
|
|
1377
|
+
color: z.ZodDefault<z.ZodEnum<{
|
|
1378
|
+
brand: "brand";
|
|
1379
|
+
red: "red";
|
|
1380
|
+
amber: "amber";
|
|
1381
|
+
green: "green";
|
|
1382
|
+
black: "black";
|
|
1383
|
+
white: "white";
|
|
1384
|
+
}>>;
|
|
1385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1386
|
+
id: z.ZodString;
|
|
1387
|
+
type: z.ZodLiteral<"text">;
|
|
1388
|
+
at: z.ZodObject<{
|
|
1389
|
+
x: z.ZodNumber;
|
|
1390
|
+
y: z.ZodNumber;
|
|
1391
|
+
}, z.core.$strip>;
|
|
1392
|
+
text: z.ZodString;
|
|
1393
|
+
color: z.ZodDefault<z.ZodEnum<{
|
|
1394
|
+
brand: "brand";
|
|
1395
|
+
red: "red";
|
|
1396
|
+
amber: "amber";
|
|
1397
|
+
green: "green";
|
|
1398
|
+
black: "black";
|
|
1399
|
+
white: "white";
|
|
1400
|
+
}>>;
|
|
1401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1402
|
+
id: z.ZodString;
|
|
1403
|
+
type: z.ZodLiteral<"box">;
|
|
1404
|
+
rect: z.ZodObject<{
|
|
1405
|
+
x: z.ZodNumber;
|
|
1406
|
+
y: z.ZodNumber;
|
|
1407
|
+
width: z.ZodNumber;
|
|
1408
|
+
height: z.ZodNumber;
|
|
1409
|
+
}, z.core.$strip>;
|
|
1410
|
+
color: z.ZodDefault<z.ZodEnum<{
|
|
1411
|
+
brand: "brand";
|
|
1412
|
+
red: "red";
|
|
1413
|
+
amber: "amber";
|
|
1414
|
+
green: "green";
|
|
1415
|
+
black: "black";
|
|
1416
|
+
white: "white";
|
|
1417
|
+
}>>;
|
|
1418
|
+
}, z.core.$strip>], "type">;
|
|
1419
|
+
type HowToAnnotation = z.infer<typeof HowToAnnotationSchema>;
|
|
1420
|
+
declare const MAX_ANNOTATIONS = 30;
|
|
1421
|
+
|
|
1422
|
+
/** Complaint types and limits shared by the server and the messenger runtime (zod-free). */
|
|
1423
|
+
/** Where a complaint is in its handling; the messenger shows it as Received → In review → Resolved. */
|
|
1424
|
+
declare const COMPLAINT_STATUSES: readonly ["open", "in_review", "resolved"];
|
|
1425
|
+
type ComplaintStatus = (typeof COMPLAINT_STATUSES)[number];
|
|
1426
|
+
/** Events a complaint webhook can fire on. */
|
|
1427
|
+
declare const COMPLAINT_EVENTS: readonly ["complaint.filed", "complaint.status_changed", "complaint.replied", "complaint.resolved"];
|
|
1428
|
+
type ComplaintEvent = (typeof COMPLAINT_EVENTS)[number];
|
|
1429
|
+
/** Extra questions a category asks for. */
|
|
1430
|
+
declare const COMPLAINT_FIELD_TYPES: readonly ["text", "choice"];
|
|
1431
|
+
type ComplaintFieldType = (typeof COMPLAINT_FIELD_TYPES)[number];
|
|
1432
|
+
declare const MAX_COMPLAINT_FIELDS = 8;
|
|
1433
|
+
declare const MAX_COMPLAINT_CHOICES = 12;
|
|
1434
|
+
declare const MAX_COMPLAINT_LENGTH = 4000;
|
|
1435
|
+
declare const MAX_COMPLAINT_ANSWER_LENGTH = 500;
|
|
1436
|
+
/** Largest screenshot the messenger may attach (after it scales the image down). */
|
|
1437
|
+
declare const MAX_COMPLAINT_ATTACHMENT_BYTES: number;
|
|
1438
|
+
interface ComplaintField {
|
|
1439
|
+
/** Stable id (`invoice_number`), used as the answer's key in webhook payloads. */
|
|
1440
|
+
id: string;
|
|
1441
|
+
label: string;
|
|
1442
|
+
type: ComplaintFieldType;
|
|
1443
|
+
/** Choices for `choice` questions. */
|
|
1444
|
+
options?: string[];
|
|
1445
|
+
required: boolean;
|
|
1446
|
+
}
|
|
1447
|
+
/** "CMP-1042" for complaint number 1042. */
|
|
1448
|
+
declare const complaintReference: (number: number) => string;
|
|
1449
|
+
/** A category as the messenger offers it. */
|
|
1450
|
+
interface MessengerComplaintCategory {
|
|
1451
|
+
id: string;
|
|
1452
|
+
name: string;
|
|
1453
|
+
description: string;
|
|
1454
|
+
color: string;
|
|
1455
|
+
fields: ComplaintField[];
|
|
1456
|
+
}
|
|
1457
|
+
/** Complaints block of `MessengerConfig`; absent when the project doesn't take complaints. */
|
|
1458
|
+
interface MessengerComplaintsConfig {
|
|
1459
|
+
categories: MessengerComplaintCategory[];
|
|
1460
|
+
/** Visitors the app hasn't identified may file one (with an email address). */
|
|
1461
|
+
anonymous: boolean;
|
|
1462
|
+
}
|
|
1463
|
+
/** A complaint as the person who filed it sees it (on its conversation). */
|
|
1464
|
+
interface MessengerComplaint {
|
|
1465
|
+
id: string;
|
|
1466
|
+
reference: string;
|
|
1467
|
+
status: ComplaintStatus;
|
|
1468
|
+
categoryName: string;
|
|
1469
|
+
createdAt: string;
|
|
1470
|
+
}
|
|
1471
|
+
/** Scout offered the complaint form in a reply, with this category picked. */
|
|
1472
|
+
interface MessengerComplaintOffer {
|
|
1473
|
+
categoryId: string;
|
|
1474
|
+
name: string;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/** Feedback (feature requests) types and limits shared by the server, the portal and the messenger runtime (zod-free). */
|
|
1478
|
+
/** Where a request is: shown to end users with FEEDBACK_STATUS_LABEL. */
|
|
1479
|
+
declare const FEEDBACK_STATUSES: readonly ["new", "under_review", "planned", "in_progress", "released", "declined"];
|
|
1480
|
+
type FeedbackStatus = (typeof FEEDBACK_STATUSES)[number];
|
|
1481
|
+
declare const FEEDBACK_STATUS_LABEL: Record<FeedbackStatus, string>;
|
|
1482
|
+
/** How much a voter needs it; weights 1 / 2 / 3 in the priority score. */
|
|
1483
|
+
declare const FEEDBACK_PRIORITIES: readonly ["nice_to_have", "important", "critical"];
|
|
1484
|
+
type FeedbackPriority = (typeof FEEDBACK_PRIORITIES)[number];
|
|
1485
|
+
declare const FEEDBACK_PRIORITY_LABEL: Record<FeedbackPriority, string>;
|
|
1486
|
+
declare const FEEDBACK_PRIORITY_WEIGHT: Record<FeedbackPriority, number>;
|
|
1487
|
+
/** Events feedback integrations (Slack, webhooks) can get. */
|
|
1488
|
+
declare const FEEDBACK_EVENTS: readonly ["request.created", "request.status_changed", "request.voted"];
|
|
1489
|
+
type FeedbackEvent = (typeof FEEDBACK_EVENTS)[number];
|
|
1490
|
+
declare const MAX_FEEDBACK_TITLE = 140;
|
|
1491
|
+
declare const MAX_FEEDBACK_DESCRIPTION = 4000;
|
|
1492
|
+
declare const MAX_FEEDBACK_COMMENT = 2000;
|
|
1493
|
+
declare const MAX_FEEDBACK_NOTE = 500;
|
|
1494
|
+
/** "#42" for request number 42. */
|
|
1495
|
+
declare const feedbackReference: (number: number) => string;
|
|
1496
|
+
/** A request as end users see it (messenger Ideas tab, portal). */
|
|
1497
|
+
interface PublicFeedbackRequest {
|
|
1498
|
+
id: string;
|
|
1499
|
+
number: number;
|
|
1500
|
+
title: string;
|
|
1501
|
+
description: string;
|
|
1502
|
+
status: FeedbackStatus;
|
|
1503
|
+
/** Public note shown with the status, when the team wrote one. */
|
|
1504
|
+
statusNote: string;
|
|
1505
|
+
productArea: string | null;
|
|
1506
|
+
votes: number;
|
|
1507
|
+
comments: number;
|
|
1508
|
+
/** This visitor's vote, if any. */
|
|
1509
|
+
myVote: {
|
|
1510
|
+
priority: FeedbackPriority;
|
|
1511
|
+
} | null;
|
|
1512
|
+
following: boolean;
|
|
1513
|
+
/** The visitor submitted it. */
|
|
1514
|
+
mine: boolean;
|
|
1515
|
+
createdAt: string;
|
|
1516
|
+
updatedAt: string;
|
|
1517
|
+
}
|
|
1518
|
+
interface PublicFeedbackComment {
|
|
1519
|
+
id: string;
|
|
1520
|
+
authorName: string;
|
|
1521
|
+
/** "team" replies are shown with a badge. */
|
|
1522
|
+
authorType: "user" | "team";
|
|
1523
|
+
body: string;
|
|
1524
|
+
createdAt: string;
|
|
1525
|
+
}
|
|
1526
|
+
interface PublicFeedbackRequestDetail extends PublicFeedbackRequest {
|
|
1527
|
+
thread: PublicFeedbackComment[];
|
|
1528
|
+
}
|
|
1529
|
+
interface PublicFeedbackList {
|
|
1530
|
+
requests: PublicFeedbackRequest[];
|
|
1531
|
+
hasMore: boolean;
|
|
1532
|
+
}
|
|
1533
|
+
/** An update about a request the visitor follows (status changed, merged). */
|
|
1534
|
+
interface FeedbackUpdate {
|
|
1535
|
+
id: string;
|
|
1536
|
+
requestId: string | null;
|
|
1537
|
+
kind: "status" | "merged" | "comment";
|
|
1538
|
+
title: string;
|
|
1539
|
+
body: string;
|
|
1540
|
+
read: boolean;
|
|
1541
|
+
createdAt: string;
|
|
1542
|
+
}
|
|
1543
|
+
interface FeedbackUpdatesResponse {
|
|
1544
|
+
updates: FeedbackUpdate[];
|
|
1545
|
+
unread: number;
|
|
1546
|
+
}
|
|
1547
|
+
/** Ideas block of `MessengerConfig`; absent when the project hasn't turned on the Ideas tab. */
|
|
1548
|
+
interface MessengerIdeasConfig {
|
|
1549
|
+
/** Tab and heading title. */
|
|
1550
|
+
title: string;
|
|
1551
|
+
/** Visitors the app hasn't identified may vote and submit (otherwise they can only browse). */
|
|
1552
|
+
anonymous: boolean;
|
|
1553
|
+
/** Votes and new ideas need a signed identity: the messenger only browses and links to the portal. */
|
|
1554
|
+
readOnly: boolean;
|
|
1555
|
+
/** Product areas people may tag new ideas with. */
|
|
1556
|
+
productAreas: string[];
|
|
1557
|
+
/** The hosted portal is on (the messenger offers "Open the portal"). */
|
|
1558
|
+
portal: boolean;
|
|
1559
|
+
}
|
|
1560
|
+
/** Scout offered to file or upvote a feature request in a reply. */
|
|
1561
|
+
interface MessengerIdeaOffer {
|
|
1562
|
+
/** The matching request to upvote, or null to suggest a new one. */
|
|
1563
|
+
requestId: string | null;
|
|
1564
|
+
title: string;
|
|
1565
|
+
/** Prefilled description for a new idea (the person's words, summarised). */
|
|
1566
|
+
description: string;
|
|
1567
|
+
votes?: number;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/** How quickly the team usually replies, shown on the messenger home screen. */
|
|
1571
|
+
declare const REPLY_TIMES: readonly ["minutes", "hour", "hours", "day"];
|
|
1572
|
+
type ReplyTime = (typeof REPLY_TIMES)[number];
|
|
1573
|
+
/** Levels of the status card on the messenger home screen. */
|
|
1574
|
+
declare const STATUS_LEVELS: readonly ["operational", "degraded", "outage", "maintenance"];
|
|
1575
|
+
type StatusLevel = (typeof STATUS_LEVELS)[number];
|
|
1576
|
+
/** A teammate shown on the messenger home screen (first name only). */
|
|
1577
|
+
interface MessengerTeammate {
|
|
1578
|
+
name: string;
|
|
1579
|
+
avatarUrl: string | null;
|
|
1580
|
+
}
|
|
1581
|
+
interface MessengerStatus {
|
|
1582
|
+
level: StatusLevel;
|
|
1583
|
+
message: string;
|
|
1584
|
+
updatedAt: string;
|
|
1585
|
+
}
|
|
1586
|
+
/** Which personalised cards the messenger home screen shows. */
|
|
1587
|
+
interface MessengerHomeCards {
|
|
1588
|
+
/** Guides, how-tos, articles and common questions for the page the user is on. */
|
|
1589
|
+
suggestions: boolean;
|
|
1590
|
+
/** A guide the user started and didn't finish, and checklist progress. */
|
|
1591
|
+
progress: boolean;
|
|
1592
|
+
/** Live announcements (also the News tab). */
|
|
1593
|
+
news: boolean;
|
|
1594
|
+
}
|
|
1595
|
+
/** Messenger settings delivered to the SDK in `SdkConfigResponse.messenger`. */
|
|
1596
|
+
interface MessengerConfig {
|
|
1597
|
+
enabled: boolean;
|
|
1598
|
+
/** Display name of the AI agent ("Scout"). */
|
|
1599
|
+
name: string;
|
|
1600
|
+
greeting: string;
|
|
1601
|
+
/** Scout answers with AI; when false every conversation goes to the team inbox. */
|
|
1602
|
+
aiAvailable: boolean;
|
|
1603
|
+
handoffEnabled: boolean;
|
|
1604
|
+
launcher: {
|
|
1605
|
+
position: "bottom-right" | "bottom-left";
|
|
1606
|
+
};
|
|
1607
|
+
/** Absent from servers before the personalised home screen; SDKs fall back to their defaults. */
|
|
1608
|
+
replyTime?: ReplyTime | null;
|
|
1609
|
+
team?: MessengerTeammate[];
|
|
1610
|
+
status?: MessengerStatus | null;
|
|
1611
|
+
home?: MessengerHomeCards;
|
|
1612
|
+
/** Complaint categories when the project takes complaints in the messenger (absent from older servers). */
|
|
1613
|
+
complaints?: MessengerComplaintsConfig | null;
|
|
1614
|
+
/** The Ideas tab (feature requests) when the project turned it on (absent from older servers). */
|
|
1615
|
+
ideas?: MessengerIdeasConfig | null;
|
|
1616
|
+
}
|
|
1617
|
+
/** Page-matched content for the messenger, from `POST /sdk/messenger/page`. */
|
|
1618
|
+
type MessengerPageSuggestion = {
|
|
1619
|
+
type: "article";
|
|
1620
|
+
articleId: string;
|
|
1621
|
+
title: string;
|
|
1622
|
+
summary: string;
|
|
1623
|
+
}
|
|
1624
|
+
/** A how-to recorded on this page, opened as its help article. */
|
|
1625
|
+
| {
|
|
1626
|
+
type: "howto";
|
|
1627
|
+
articleId: string;
|
|
1628
|
+
title: string;
|
|
1629
|
+
steps: number;
|
|
1630
|
+
};
|
|
1631
|
+
interface MessengerPageContent {
|
|
1632
|
+
/** The page as matched: its path with ids folded (`/invoices/:id`). */
|
|
1633
|
+
path: string;
|
|
1634
|
+
label: string | null;
|
|
1635
|
+
suggestions: MessengerPageSuggestion[];
|
|
1636
|
+
/** Questions people ask on this page (FAQs and learned answers); tapping one asks Scout. */
|
|
1637
|
+
questions: string[];
|
|
1638
|
+
}
|
|
1639
|
+
declare const MessengerPageRequestSchema: z.ZodObject<{
|
|
1640
|
+
anonymousId: z.ZodString;
|
|
1641
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
1642
|
+
path: z.ZodString;
|
|
1643
|
+
}, z.core.$strip>;
|
|
1644
|
+
type MessengerPageRequest = z.infer<typeof MessengerPageRequestSchema>;
|
|
1645
|
+
declare const MESSAGE_AUTHORS: readonly ["user", "scout", "agent", "system"];
|
|
1646
|
+
type MessageAuthor = (typeof MESSAGE_AUTHORS)[number];
|
|
1647
|
+
type ConversationStatus = "bot" | "open" | "closed";
|
|
1648
|
+
interface MessengerCitation {
|
|
1649
|
+
articleId: string;
|
|
1650
|
+
title: string;
|
|
1651
|
+
}
|
|
1652
|
+
interface MessengerSuggestedGuide {
|
|
1653
|
+
key: string;
|
|
1654
|
+
name: string;
|
|
1655
|
+
}
|
|
1656
|
+
/** A how-to Scout relied on; the messenger opens it in place (`GET /sdk/how-tos/:id`). */
|
|
1657
|
+
interface MessengerHowToCitation {
|
|
1658
|
+
howToId: string;
|
|
1659
|
+
title: string;
|
|
1660
|
+
}
|
|
1661
|
+
interface MessengerMessage {
|
|
1662
|
+
id: string;
|
|
1663
|
+
author: MessageAuthor;
|
|
1664
|
+
/** Team member name for `agent` messages. */
|
|
1665
|
+
authorName?: string | null;
|
|
1666
|
+
body: string;
|
|
1667
|
+
citations: MessengerCitation[];
|
|
1668
|
+
suggestedGuides: MessengerSuggestedGuide[];
|
|
1669
|
+
/** How-tos Scout cited (absent when none; SDKs before how-to support ignore it). */
|
|
1670
|
+
howTos?: MessengerHowToCitation[];
|
|
1671
|
+
/** Scout offered the complaint form (absent otherwise). */
|
|
1672
|
+
complaintOffer?: MessengerComplaintOffer;
|
|
1673
|
+
/** Scout offered to file or upvote a feature request (absent otherwise). */
|
|
1674
|
+
ideaOffer?: MessengerIdeaOffer;
|
|
1675
|
+
status: "pending" | "complete" | "failed";
|
|
1676
|
+
createdAt: string;
|
|
1677
|
+
}
|
|
1678
|
+
interface MessengerConversation {
|
|
1679
|
+
id: string;
|
|
1680
|
+
status: ConversationStatus;
|
|
1681
|
+
subject: string;
|
|
1682
|
+
lastMessageAt: string;
|
|
1683
|
+
lastMessagePreview: string;
|
|
1684
|
+
unread: number;
|
|
1685
|
+
rating: number | null;
|
|
1686
|
+
/** The complaint filed in this conversation, latest first (absent when none). */
|
|
1687
|
+
complaint?: MessengerComplaint;
|
|
1688
|
+
}
|
|
1689
|
+
declare const MAX_MESSAGE_LENGTH = 4000;
|
|
1690
|
+
declare const StartConversationSchema: z.ZodObject<{
|
|
1691
|
+
anonymousId: z.ZodString;
|
|
1692
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
1693
|
+
message: z.ZodString;
|
|
1694
|
+
pageUrl: z.ZodOptional<z.ZodString>;
|
|
1695
|
+
}, z.core.$strip>;
|
|
1696
|
+
type StartConversationRequest = z.infer<typeof StartConversationSchema>;
|
|
1697
|
+
interface StartConversationResponse {
|
|
1698
|
+
conversation: MessengerConversation;
|
|
1699
|
+
/** Secret that authorises this browser to read and post in the conversation. Store it; it is not shown again. */
|
|
1700
|
+
token: string;
|
|
1701
|
+
messages: MessengerMessage[];
|
|
1702
|
+
}
|
|
1703
|
+
declare const ConversationLookupSchema: z.ZodObject<{
|
|
1704
|
+
tokens: z.ZodArray<z.ZodString>;
|
|
1705
|
+
}, z.core.$strip>;
|
|
1706
|
+
interface ConversationLookupResponse {
|
|
1707
|
+
conversations: Array<MessengerConversation & {
|
|
1708
|
+
token: string;
|
|
1709
|
+
}>;
|
|
1710
|
+
}
|
|
1711
|
+
declare const PostMessageSchema: z.ZodObject<{
|
|
1712
|
+
message: z.ZodString;
|
|
1713
|
+
pageUrl: z.ZodOptional<z.ZodString>;
|
|
1714
|
+
}, z.core.$strip>;
|
|
1715
|
+
declare const ConversationRatingSchema: z.ZodObject<{
|
|
1716
|
+
rating: z.ZodNumber;
|
|
1717
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
1718
|
+
}, z.core.$strip>;
|
|
1719
|
+
interface FileComplaintResponse {
|
|
1720
|
+
complaint: MessengerComplaint;
|
|
1721
|
+
conversation: MessengerConversation;
|
|
1722
|
+
/** Token of the conversation started for it (absent when it was filed in an existing one). */
|
|
1723
|
+
token?: string;
|
|
1724
|
+
}
|
|
1725
|
+
interface ConversationMessagesResponse {
|
|
1726
|
+
conversation: MessengerConversation;
|
|
1727
|
+
messages: MessengerMessage[];
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Server-sent events streamed by `POST /sdk/conversations` and `POST /sdk/conversations/:id/messages`
|
|
1731
|
+
* while Scout replies. `conversation` (start only) carries the new conversation and its token, `message`
|
|
1732
|
+
* each stored message, `delta` reply text as it is generated, and `done` the final stored message.
|
|
1733
|
+
*/
|
|
1734
|
+
type ScoutStreamEvent = {
|
|
1735
|
+
event: "conversation";
|
|
1736
|
+
data: StartConversationResponse;
|
|
1737
|
+
} | {
|
|
1738
|
+
event: "message";
|
|
1739
|
+
data: MessengerMessage;
|
|
1740
|
+
} | {
|
|
1741
|
+
event: "delta";
|
|
1742
|
+
data: {
|
|
1743
|
+
messageId: string;
|
|
1744
|
+
text: string;
|
|
1745
|
+
};
|
|
1746
|
+
} | {
|
|
1747
|
+
event: "done";
|
|
1748
|
+
data: {
|
|
1749
|
+
message: MessengerMessage;
|
|
1750
|
+
conversation: MessengerConversation;
|
|
1751
|
+
};
|
|
1752
|
+
} | {
|
|
1753
|
+
event: "error";
|
|
1754
|
+
data: {
|
|
1755
|
+
message: string;
|
|
1756
|
+
};
|
|
1757
|
+
};
|
|
1758
|
+
/** Article list entry for the messenger Help tab (bodies are fetched on demand). */
|
|
1759
|
+
interface SdkArticleSummary {
|
|
1760
|
+
id: string;
|
|
1761
|
+
slug: string;
|
|
1762
|
+
title: string;
|
|
1763
|
+
summary: string;
|
|
1764
|
+
collectionId: string | null;
|
|
1765
|
+
externalUrl: string | null;
|
|
1766
|
+
/** Listed only for members of these audiences (absent = everyone). */
|
|
1767
|
+
audienceIds?: string[];
|
|
1768
|
+
/** Guide keys of the article's "Show me" prompts (absent = none). */
|
|
1769
|
+
walkthroughs?: string[];
|
|
1770
|
+
hasVideo?: boolean;
|
|
1771
|
+
updatedAt: string;
|
|
1772
|
+
}
|
|
1773
|
+
interface SdkArticlesResponse {
|
|
1774
|
+
collections: ResourceCenterCollection[];
|
|
1775
|
+
articles: SdkArticleSummary[];
|
|
1776
|
+
}
|
|
1777
|
+
/** A how-to the team made available in the app (`GET /sdk/how-tos`). */
|
|
1778
|
+
interface SdkHowToSummary {
|
|
1779
|
+
id: string;
|
|
1780
|
+
title: string;
|
|
1781
|
+
description: string;
|
|
1782
|
+
/** Numbered (recorded) steps. */
|
|
1783
|
+
stepCount: number;
|
|
1784
|
+
/** Key of the interactive tour made from it, when that tour is live in this environment ("Show me"). */
|
|
1785
|
+
guideKey?: string;
|
|
1786
|
+
/** The how-to has a video. */
|
|
1787
|
+
hasVideo?: boolean;
|
|
1788
|
+
updatedAt: string;
|
|
1789
|
+
}
|
|
1790
|
+
interface SdkHowTosResponse {
|
|
1791
|
+
/** Every how-to available in the app, by title (at most 200). */
|
|
1792
|
+
howTos: SdkHowToSummary[];
|
|
1793
|
+
/** Ids of the ones recorded on the page in `?url=`, best match first (at most 5). */
|
|
1794
|
+
forPage: string[];
|
|
1795
|
+
}
|
|
1796
|
+
/** One step as the messenger renders it: text only, plus a screenshot with the element's highlight. */
|
|
1797
|
+
interface SdkHowToStep {
|
|
1798
|
+
id: string;
|
|
1799
|
+
kind: HowToStepKind;
|
|
1800
|
+
title: string;
|
|
1801
|
+
body: string;
|
|
1802
|
+
image?: {
|
|
1803
|
+
url: string;
|
|
1804
|
+
/** Show only this part of the screenshot (zoomed in on the element). */
|
|
1805
|
+
crop?: NormalizedRect;
|
|
1806
|
+
/** The element, in the coordinates of the (cropped) image. */
|
|
1807
|
+
highlight?: NormalizedRect;
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
/** `GET /sdk/how-tos/:id`: an available how-to with its steps. */
|
|
1811
|
+
interface SdkHowTo {
|
|
1812
|
+
id: string;
|
|
1813
|
+
title: string;
|
|
1814
|
+
description: string;
|
|
1815
|
+
updatedAt: string;
|
|
1816
|
+
steps: SdkHowToStep[];
|
|
1817
|
+
/** Key of the interactive tour made from it, when that tour is live in this environment ("Show me"). */
|
|
1818
|
+
guideKey?: string;
|
|
1819
|
+
/** Video made from the how-to (WebM), played above the steps. */
|
|
1820
|
+
video?: {
|
|
1821
|
+
url: string;
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* Product-analytics capture settings. Stored on `Project.settings` (keys `autocapture`,
|
|
1827
|
+
* `errorTracking`, `replay`, `performance`) and delivered to the SDK in `SdkConfigResponse.settings`. The project
|
|
1828
|
+
* setting turns a capability on; SDK options can only turn it off for one installation.
|
|
1829
|
+
*/
|
|
1830
|
+
interface AutocaptureSettings {
|
|
1831
|
+
/** `page_view` on load and on every SPA navigation. */
|
|
1832
|
+
pageviews: boolean;
|
|
1833
|
+
/** `page_leave` with visible time on page and scroll depth. */
|
|
1834
|
+
pageLeave: boolean;
|
|
1835
|
+
/** `click` on buttons, links and other interactive elements. */
|
|
1836
|
+
clicks: boolean;
|
|
1837
|
+
/** `rage_click` when the same spot is clicked 3+ times within a second. */
|
|
1838
|
+
rageClicks: boolean;
|
|
1839
|
+
/** Batched click positions on every element (`heatmap` events) for click heatmaps. */
|
|
1840
|
+
heatmaps: boolean;
|
|
1841
|
+
/** Mouse-movement heatmaps: pointer position sampled while it moves, aggregated in the browser into `heatmap` events. */
|
|
1842
|
+
mouseMovement: boolean;
|
|
1843
|
+
/**
|
|
1844
|
+
* Mobile SDKs: `app_install`, `app_update`, `app_open` and `app_background` events (ignored on the web).
|
|
1845
|
+
* Optional in the type for older stored settings; `resolveCaptureSettings` always fills it.
|
|
1846
|
+
*/
|
|
1847
|
+
appLifecycle?: boolean;
|
|
1848
|
+
}
|
|
1849
|
+
interface ErrorTrackingSettings {
|
|
1850
|
+
/** Uncaught errors and unhandled promise rejections become `exception` events. */
|
|
1851
|
+
enabled: boolean;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* Performance tracing in Guidely's own SDKs: pageload / navigation transactions with Web Vitals,
|
|
1855
|
+
* resource and long-task spans, and fetch/XHR spans with trace propagation. Sentry SDKs are controlled
|
|
1856
|
+
* by their own `tracesSampleRate`, so this doesn't affect them. Optional in `CaptureSettings` for older
|
|
1857
|
+
* stored settings; `resolveCaptureSettings` always fills it.
|
|
1858
|
+
*/
|
|
1859
|
+
interface PerformanceSettings {
|
|
1860
|
+
enabled: boolean;
|
|
1861
|
+
/** Percentage of page loads traced (0–100), decided once per page load. SDK `tracesSampleRate` can only lower it. */
|
|
1862
|
+
sampleRate: number;
|
|
1863
|
+
}
|
|
1864
|
+
interface ReplaySettings {
|
|
1865
|
+
enabled: boolean;
|
|
1866
|
+
/** Percentage of sessions recorded (0–100), decided once per session. */
|
|
1867
|
+
sampleRate: number;
|
|
1868
|
+
/** Record console.log/warn/error output into the recording. */
|
|
1869
|
+
recordConsole: boolean;
|
|
1870
|
+
/** Record network requests (method, URL with sensitive query values redacted, status, timing, size). */
|
|
1871
|
+
recordNetwork: boolean;
|
|
1872
|
+
/** Also record request/response headers and text/JSON bodies (redacted, ≤10KB each). Off by default. */
|
|
1873
|
+
recordNetworkPayloads: boolean;
|
|
1874
|
+
/** Mask every text node (inputs are always masked). */
|
|
1875
|
+
maskAllText: boolean;
|
|
1876
|
+
/**
|
|
1877
|
+
* Mask every image (mobile SDKs; the web SDK gets image block selectors instead). Not a project setting: the
|
|
1878
|
+
* server sets it for HIPAA-mode workspaces, which also force `maskAllText` and turn console and payloads off.
|
|
1879
|
+
*/
|
|
1880
|
+
maskAllImages?: boolean;
|
|
1881
|
+
/** Elements replaced by a placeholder box in recordings (in addition to `[data-guidely-block]`). */
|
|
1882
|
+
blockSelectors: string[];
|
|
1883
|
+
/** Days recordings are kept before the worker deletes them. */
|
|
1884
|
+
retentionDays: number;
|
|
1885
|
+
}
|
|
1886
|
+
interface CaptureSettings {
|
|
1887
|
+
autocapture: AutocaptureSettings;
|
|
1888
|
+
errorTracking: ErrorTrackingSettings;
|
|
1889
|
+
replay: ReplaySettings;
|
|
1890
|
+
performance?: PerformanceSettings;
|
|
1891
|
+
}
|
|
1892
|
+
declare const AutocaptureSettingsSchema: z.ZodObject<{
|
|
1893
|
+
pageviews: z.ZodOptional<z.ZodBoolean>;
|
|
1894
|
+
pageLeave: z.ZodOptional<z.ZodBoolean>;
|
|
1895
|
+
clicks: z.ZodOptional<z.ZodBoolean>;
|
|
1896
|
+
rageClicks: z.ZodOptional<z.ZodBoolean>;
|
|
1897
|
+
heatmaps: z.ZodOptional<z.ZodBoolean>;
|
|
1898
|
+
mouseMovement: z.ZodOptional<z.ZodBoolean>;
|
|
1899
|
+
appLifecycle: z.ZodOptional<z.ZodBoolean>;
|
|
1900
|
+
}, z.core.$strip>;
|
|
1901
|
+
declare const ErrorTrackingSettingsSchema: z.ZodObject<{
|
|
1902
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1903
|
+
}, z.core.$strip>;
|
|
1904
|
+
declare const PerformanceSettingsSchema: z.ZodObject<{
|
|
1905
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1906
|
+
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
1907
|
+
}, z.core.$strip>;
|
|
1908
|
+
declare const ReplaySettingsSchema: z.ZodObject<{
|
|
1909
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1910
|
+
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
1911
|
+
recordConsole: z.ZodOptional<z.ZodBoolean>;
|
|
1912
|
+
recordNetwork: z.ZodOptional<z.ZodBoolean>;
|
|
1913
|
+
recordNetworkPayloads: z.ZodOptional<z.ZodBoolean>;
|
|
1914
|
+
maskAllText: z.ZodOptional<z.ZodBoolean>;
|
|
1915
|
+
blockSelectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1916
|
+
retentionDays: z.ZodOptional<z.ZodNumber>;
|
|
1917
|
+
}, z.core.$strip>;
|
|
1918
|
+
declare const DEFAULT_CAPTURE_SETTINGS: CaptureSettings;
|
|
1919
|
+
/**
|
|
1920
|
+
* A project's recording level: a preset over the replay toggles, picked per project in Settings →
|
|
1921
|
+
* Workspace or Privacy & data. Sample rate, block selectors and retention are kept as they are.
|
|
1922
|
+
*/
|
|
1923
|
+
declare const RECORDING_LEVELS: readonly ["off", "privacy", "standard", "full"];
|
|
1924
|
+
type RecordingLevel = (typeof RECORDING_LEVELS)[number];
|
|
1925
|
+
/** The level a project's replay settings match, or "custom" when the toggles were set by hand. */
|
|
1926
|
+
declare function recordingLevel(replay: ReplaySettings): RecordingLevel | "custom";
|
|
1927
|
+
/** Replay settings set to a level. "off" stops recording and leaves the toggles for when it's turned back on. */
|
|
1928
|
+
declare function withRecordingLevel(replay: ReplaySettings, level: RecordingLevel): ReplaySettings;
|
|
1929
|
+
/** Fills defaults for whatever a project's stored settings leave out. */
|
|
1930
|
+
declare function resolveCaptureSettings(settings: unknown): CaptureSettings;
|
|
1931
|
+
/**
|
|
1932
|
+
* One position in a `heatmap` event (`properties.points`). `x`/`y` are page coordinates in CSS
|
|
1933
|
+
* pixels; `s` is a stable selector for the element and `rx`/`ry` the position inside it (0–1), which
|
|
1934
|
+
* lets the dashboard place the point on the element even when layouts differ.
|
|
1935
|
+
*
|
|
1936
|
+
* Mouse movement (`k: "m"`) is sampled at most every 200ms while the pointer moves and binned in the
|
|
1937
|
+
* browser (per element at 0.1 of `rx`/`ry`, else on a 16px page grid); `w` is the number of samples
|
|
1938
|
+
* in the bin, so a minute of movement costs a few dozen points rather than thousands.
|
|
1939
|
+
*/
|
|
1940
|
+
interface HeatmapPoint {
|
|
1941
|
+
/** `c` click, `r` part of a rage-click burst, `m` mouse movement. */
|
|
1942
|
+
k: "c" | "r" | "m";
|
|
1943
|
+
x: number;
|
|
1944
|
+
y: number;
|
|
1945
|
+
s?: string;
|
|
1946
|
+
rx?: number;
|
|
1947
|
+
ry?: number;
|
|
1948
|
+
/** Weight: samples aggregated into this point (movement only; clicks are 1). */
|
|
1949
|
+
w?: number;
|
|
1950
|
+
}
|
|
1951
|
+
/** Properties of a `heatmap` event: a batch of clicks on one page (flushed at ~40 points and on page leave). */
|
|
1952
|
+
interface HeatmapProperties {
|
|
1953
|
+
path?: string;
|
|
1954
|
+
viewportWidth: number;
|
|
1955
|
+
viewportHeight: number;
|
|
1956
|
+
/** Document scroll height when the batch was sent. */
|
|
1957
|
+
pageHeight: number;
|
|
1958
|
+
points: HeatmapPoint[];
|
|
1959
|
+
}
|
|
1960
|
+
/** Viewport buckets heatmaps are split by (CSS px of `viewportWidth`). */
|
|
1961
|
+
declare const HEATMAP_VIEWPORTS: {
|
|
1962
|
+
readonly mobile: readonly [0, 767];
|
|
1963
|
+
readonly tablet: readonly [768, 1279];
|
|
1964
|
+
readonly desktop: readonly [1280, 100000];
|
|
1965
|
+
};
|
|
1966
|
+
type HeatmapViewport = keyof typeof HEATMAP_VIEWPORTS;
|
|
1967
|
+
/**
|
|
1968
|
+
* One upload of rrweb events for a recording, `POST /api/v1/sdk/replay`. The SDK sends it as JSON,
|
|
1969
|
+
* or gzip-compressed JSON with `?enc=gzip`. A recording is keyed by the SDK session id; every page
|
|
1970
|
+
* load starts a new `windowId` whose uploads are numbered by `seq`.
|
|
1971
|
+
*/
|
|
1972
|
+
declare const ReplayChunkSchema: z.ZodObject<{
|
|
1973
|
+
sessionId: z.ZodString;
|
|
1974
|
+
windowId: z.ZodString;
|
|
1975
|
+
seq: z.ZodNumber;
|
|
1976
|
+
anonymousId: z.ZodString;
|
|
1977
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
1978
|
+
events: z.ZodArray<z.ZodObject<{
|
|
1979
|
+
type: z.ZodNumber;
|
|
1980
|
+
timestamp: z.ZodNumber;
|
|
1981
|
+
}, z.core.$loose>>;
|
|
1982
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1983
|
+
device: z.ZodOptional<z.ZodObject<{
|
|
1984
|
+
type: z.ZodString;
|
|
1985
|
+
browser: z.ZodOptional<z.ZodString>;
|
|
1986
|
+
os: z.ZodOptional<z.ZodString>;
|
|
1987
|
+
}, z.core.$strip>>;
|
|
1988
|
+
viewport: z.ZodOptional<z.ZodObject<{
|
|
1989
|
+
width: z.ZodNumber;
|
|
1990
|
+
height: z.ZodNumber;
|
|
1991
|
+
}, z.core.$strip>>;
|
|
1992
|
+
sdk: z.ZodOptional<z.ZodObject<{
|
|
1993
|
+
name: z.ZodString;
|
|
1994
|
+
version: z.ZodString;
|
|
1995
|
+
}, z.core.$strip>>;
|
|
1996
|
+
appVersion: z.ZodOptional<z.ZodString>;
|
|
1997
|
+
}, z.core.$strip>;
|
|
1998
|
+
type ReplayChunk = z.infer<typeof ReplayChunkSchema>;
|
|
1999
|
+
/** Max upload sizes for one replay chunk (bytes on the wire, and after decompression). */
|
|
2000
|
+
declare const REPLAY_MAX_COMPRESSED_BYTES: number;
|
|
2001
|
+
declare const REPLAY_MAX_RAW_BYTES: number;
|
|
2002
|
+
|
|
2003
|
+
/**
|
|
2004
|
+
* Tagged pages and features (named rules over the URLs and clicks the SDK captures), shared by the server (retroactive
|
|
2005
|
+
* matching, SQL generation), the dashboard (previews) and the SDK (event properties). Pure and zod-free.
|
|
2006
|
+
*
|
|
2007
|
+
* - An `ElementSnapshot` is the compact description of a clicked element the SDK attaches to `click`
|
|
2008
|
+
* events (`properties.el`): tag, id, classes, a few safe attributes, nth-of-type, ~5 ancestors and
|
|
2009
|
+
* the shadow hosts above it. CSS selector rules are evaluated against it with {@link matchCssSelector},
|
|
2010
|
+
* so a rule written today also matches clicks stored before it existed.
|
|
2011
|
+
* - Older clicks carry only a selector string; {@link snapshotFromSelector} turns that string into a
|
|
2012
|
+
* partial snapshot so CSS rules still match them where the string says enough.
|
|
2013
|
+
*/
|
|
2014
|
+
/** One element in a snapshot: tag, id, classes, safe attributes and its 1-based nth-of-type. */
|
|
2015
|
+
interface ElementNode {
|
|
2016
|
+
t: string;
|
|
2017
|
+
id?: string;
|
|
2018
|
+
c?: string[];
|
|
2019
|
+
a?: Record<string, string>;
|
|
2020
|
+
n?: number;
|
|
2021
|
+
}
|
|
2022
|
+
/** A clicked element (`click.properties.el`): the element, its ancestors (`p`, parent first) and shadow hosts (`h`, nearest first). */
|
|
2023
|
+
interface ElementSnapshot extends ElementNode {
|
|
2024
|
+
p?: ElementNode[];
|
|
2025
|
+
h?: ElementNode[];
|
|
2026
|
+
}
|
|
2027
|
+
declare const SNAPSHOT_LIMITS: {
|
|
2028
|
+
readonly classes: 8;
|
|
2029
|
+
readonly className: 60;
|
|
2030
|
+
readonly attrs: 6;
|
|
2031
|
+
readonly attrValue: 100;
|
|
2032
|
+
readonly ancestors: 5;
|
|
2033
|
+
readonly hosts: 3;
|
|
2034
|
+
readonly tag: 40;
|
|
2035
|
+
readonly id: 80;
|
|
2036
|
+
};
|
|
2037
|
+
/** Attributes a snapshot may carry besides `data-*` ones. Never `value`, never event handlers. */
|
|
2038
|
+
declare const SNAPSHOT_ATTRS: readonly ["role", "name", "type", "aria-label", "title", "alt", "for", "href"];
|
|
2039
|
+
/** Framework and state `data-*` attributes that say nothing stable about an element. */
|
|
2040
|
+
declare const NOISY_DATA_ATTR: RegExp;
|
|
2041
|
+
/** The custom attribute that names a feature by default (`<button data-guidely-feature="Export CSV">`). */
|
|
2042
|
+
declare const DEFAULT_FEATURE_ATTRIBUTE = "data-guidely-feature";
|
|
2043
|
+
declare const FEATURE_ATTRIBUTE_PATTERN: RegExp;
|
|
2044
|
+
/** Validates and trims a snapshot sent by an SDK (server side); null when it is not one. */
|
|
2045
|
+
declare function normalizeSnapshot(raw: unknown): ElementSnapshot | null;
|
|
2046
|
+
/** JSON with sorted keys, so equal snapshots hash the same whatever order the SDK wrote them in. */
|
|
2047
|
+
declare function stableStringify(v: unknown): string;
|
|
2048
|
+
type AttrOp = "exists" | "=" | "^=" | "$=" | "*=" | "~=" | "|=";
|
|
2049
|
+
interface AttrTest {
|
|
2050
|
+
name: string;
|
|
2051
|
+
op: AttrOp;
|
|
2052
|
+
value?: string;
|
|
2053
|
+
/** `[attr="x" i]` */
|
|
2054
|
+
insensitive?: boolean;
|
|
2055
|
+
}
|
|
2056
|
+
interface Compound {
|
|
2057
|
+
tag?: string;
|
|
2058
|
+
id?: string;
|
|
2059
|
+
classes: string[];
|
|
2060
|
+
attrs: AttrTest[];
|
|
2061
|
+
/** `:nth-of-type(n)`; `odd`/`even` as `{ a: 2, b: 1|0 }`; `:first-of-type` is `{ a: 0, b: 1 }`. */
|
|
2062
|
+
nth?: {
|
|
2063
|
+
a: number;
|
|
2064
|
+
b: number;
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
/** A complex selector: compounds left to right and the combinator before each (index 0 has none). */
|
|
2068
|
+
interface ComplexSelector {
|
|
2069
|
+
compounds: Compound[];
|
|
2070
|
+
combinators: Array<" " | ">" | ">>>">;
|
|
2071
|
+
}
|
|
2072
|
+
declare class SelectorSyntaxError extends Error {
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* Parses the supported subset: type and universal selectors, `#id`, `.class`, `[attr]`,
|
|
2076
|
+
* `[attr=v]`, `^=`, `$=`, `*=`, `~=`, `|=` (optionally `i`), `:nth-of-type(n|odd|even)`,
|
|
2077
|
+
* `:first-of-type`, descendant and child combinators, `>>>` (shadow host) and selector lists.
|
|
2078
|
+
* Throws {@link SelectorSyntaxError} on anything else.
|
|
2079
|
+
*/
|
|
2080
|
+
declare function parseCssSelector(input: string): ComplexSelector[];
|
|
2081
|
+
/** Is the selector inside the supported subset? Returns the error message, or null when it parses. */
|
|
2082
|
+
declare function cssSelectorError(selector: string): string | null;
|
|
2083
|
+
/** Does one compound match one node? An unknown nth-of-type fails `:nth-of-type` tests. */
|
|
2084
|
+
declare function compoundMatches(c: Compound, node: ElementNode): boolean;
|
|
2085
|
+
/** Does a CSS selector (subset, see {@link parseCssSelector}) match the snapshot? Invalid selectors match nothing. */
|
|
2086
|
+
declare function matchCssSelector(selector: string | ComplexSelector[], snap: ElementSnapshot): boolean;
|
|
2087
|
+
/**
|
|
2088
|
+
* A partial snapshot read from a stored selector string (clicks captured before snapshots existed):
|
|
2089
|
+
* `#form > div:nth-of-type(2) > button[data-testid="save"]` becomes a `button` with that attribute,
|
|
2090
|
+
* nth 1-unknown, and two ancestors. Shadow steps (`c-app >>> button`) become hosts. Null when the
|
|
2091
|
+
* string is not a selector in the supported subset.
|
|
2092
|
+
*/
|
|
2093
|
+
declare function snapshotFromSelector(selector: string, tag?: string | null): ElementSnapshot | null;
|
|
2094
|
+
type QueryParamOp = "exists" | "absent" | "equals" | "contains";
|
|
2095
|
+
interface QueryParamCondition {
|
|
2096
|
+
name: string;
|
|
2097
|
+
op: QueryParamOp;
|
|
2098
|
+
value?: string;
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* One way a URL belongs to a page. `url`: a pattern (`/accounts/:id/settings`, `/reports/*`,
|
|
2102
|
+
* `/docs/**`, `//*\/billing`, `https://app.acme.com/x`) plus optional query conditions; `regex`: a
|
|
2103
|
+
* regular expression over the path; `title`: the document title (`equals` / `contains`). With
|
|
2104
|
+
* `exclude`, matching URLs are taken out of the page instead.
|
|
2105
|
+
*/
|
|
2106
|
+
interface PageRule {
|
|
2107
|
+
id?: string;
|
|
2108
|
+
type: "url" | "regex" | "title";
|
|
2109
|
+
value: string;
|
|
2110
|
+
op?: "equals" | "contains";
|
|
2111
|
+
query?: QueryParamCondition[];
|
|
2112
|
+
exclude?: boolean;
|
|
2113
|
+
}
|
|
2114
|
+
declare const PAGE_RULE_LIMITS: {
|
|
2115
|
+
readonly rules: 20;
|
|
2116
|
+
readonly value: 500;
|
|
2117
|
+
readonly query: 5;
|
|
2118
|
+
};
|
|
2119
|
+
interface PagePattern {
|
|
2120
|
+
/** Anchored regex source, valid both as a JS RegExp (flag `i`) and a Postgres ARE (`~*`). */
|
|
2121
|
+
source: string;
|
|
2122
|
+
/** What it runs against: the path (query removed) or the full URL without query and hash. */
|
|
2123
|
+
target: "path" | "url";
|
|
2124
|
+
/** Query conditions written into the pattern (`/search?tab=people`). */
|
|
2125
|
+
query: QueryParamCondition[];
|
|
2126
|
+
}
|
|
2127
|
+
/** Turns a URL rule pattern into a regex. Query parameters in the pattern become conditions. */
|
|
2128
|
+
declare function pagePattern(raw: string): PagePattern;
|
|
2129
|
+
/** Regex (JS + Postgres) for a query condition over a raw URL. */
|
|
2130
|
+
declare function queryConditionRegex(c: QueryParamCondition): string;
|
|
2131
|
+
interface PageContext {
|
|
2132
|
+
/** Full URL (with query) when known. */
|
|
2133
|
+
url?: string | null;
|
|
2134
|
+
/** Path as stored (`/a/b`, or `/a/b?section=x` with kept page parameters). */
|
|
2135
|
+
path?: string | null;
|
|
2136
|
+
title?: string | null;
|
|
2137
|
+
}
|
|
2138
|
+
/** JS twin of the SQL a page rule compiles to (server `pageRuleSql`). */
|
|
2139
|
+
declare function pageRuleMatches(rule: PageRule, ctx: PageContext): boolean;
|
|
2140
|
+
/** Included by any include rule and excluded by no exclude rule. */
|
|
2141
|
+
declare function pageRulesMatch(rules: PageRule[], ctx: PageContext): boolean;
|
|
2142
|
+
/** Validation message for a page rule, or null. */
|
|
2143
|
+
declare function pageRuleError(rule: PageRule): string | null;
|
|
2144
|
+
type SelectorOp = "exact" | "prefix" | "contains" | "glob" | "css";
|
|
2145
|
+
/**
|
|
2146
|
+
* One way a click belongs to a feature. Every condition present must hold. `selector.op = "css"`
|
|
2147
|
+
* evaluates a CSS selector against the element snapshot (or, for old clicks, the snapshot read from
|
|
2148
|
+
* the stored selector string); the other selector operators compare the stored selector string —
|
|
2149
|
+
* mobile taps store the accessibility id / `data-guidely-id` there, so `exact` works for them too.
|
|
2150
|
+
*/
|
|
2151
|
+
interface FeatureRule {
|
|
2152
|
+
id?: string;
|
|
2153
|
+
selector?: {
|
|
2154
|
+
op: SelectorOp;
|
|
2155
|
+
value: string;
|
|
2156
|
+
};
|
|
2157
|
+
text?: {
|
|
2158
|
+
op: "equals" | "contains";
|
|
2159
|
+
value: string;
|
|
2160
|
+
};
|
|
2161
|
+
tag?: string;
|
|
2162
|
+
href?: {
|
|
2163
|
+
op: "equals" | "prefix" | "contains";
|
|
2164
|
+
value: string;
|
|
2165
|
+
};
|
|
2166
|
+
/** Only clicks on this tagged page / URL pattern. */
|
|
2167
|
+
page?: {
|
|
2168
|
+
pageId?: string;
|
|
2169
|
+
pattern?: string;
|
|
2170
|
+
};
|
|
2171
|
+
/** `web`, `ios`, `android` (mobile autocapture sets `properties.platform`). */
|
|
2172
|
+
platform?: string;
|
|
2173
|
+
exclude?: boolean;
|
|
2174
|
+
}
|
|
2175
|
+
declare const FEATURE_RULE_LIMITS: {
|
|
2176
|
+
readonly rules: 20;
|
|
2177
|
+
readonly value: 1000;
|
|
2178
|
+
};
|
|
2179
|
+
interface ClickFacts {
|
|
2180
|
+
selector?: string | null;
|
|
2181
|
+
text?: string | null;
|
|
2182
|
+
tag?: string | null;
|
|
2183
|
+
href?: string | null;
|
|
2184
|
+
platform?: string | null;
|
|
2185
|
+
}
|
|
2186
|
+
/** Does a click (facts + a CSS test) satisfy one rule's element conditions? Page scope is checked by the caller. */
|
|
2187
|
+
declare function featureRuleMatchesClick(rule: FeatureRule, click: ClickFacts, css: (selector: string) => boolean): boolean;
|
|
2188
|
+
/** Validation message for a feature rule, or null. */
|
|
2189
|
+
declare function featureRuleError(rule: FeatureRule): string | null;
|
|
2190
|
+
/** Selector to find a feature's elements on a page (dashboard overlays, SDK property capture), when the rules give one. */
|
|
2191
|
+
declare function featureCssSelectors(rules: FeatureRule[]): string[];
|
|
2192
|
+
interface TagPropertyDefinition {
|
|
2193
|
+
id: string;
|
|
2194
|
+
name: string;
|
|
2195
|
+
/** Element to read: CSS selector (may use `>>>`); empty = the clicked element itself (features only). */
|
|
2196
|
+
selector?: string;
|
|
2197
|
+
source: "text" | "attribute";
|
|
2198
|
+
/** Attribute name for `source: "attribute"`; `value` is never read. */
|
|
2199
|
+
attribute?: string;
|
|
2200
|
+
}
|
|
2201
|
+
/** One tag's capture config in the SDK payload (`SdkConfigResponse.tagging.properties`). */
|
|
2202
|
+
interface TagPropertyConfig {
|
|
2203
|
+
kind: "page" | "feature";
|
|
2204
|
+
tagId: string;
|
|
2205
|
+
/** Page rules (pages) or feature rules (features), evaluated in the browser. */
|
|
2206
|
+
pageRules?: PageRule[];
|
|
2207
|
+
featureRules?: FeatureRule[];
|
|
2208
|
+
properties: TagPropertyDefinition[];
|
|
2209
|
+
}
|
|
2210
|
+
interface TaggingSdkConfig {
|
|
2211
|
+
/** Attribute that names features automatically (null = off). */
|
|
2212
|
+
featureAttribute: string | null;
|
|
2213
|
+
properties: TagPropertyConfig[];
|
|
2214
|
+
}
|
|
2215
|
+
declare const TAG_PROPERTY_LIMITS: {
|
|
2216
|
+
readonly perTag: 10;
|
|
2217
|
+
readonly total: 50;
|
|
2218
|
+
readonly value: 100;
|
|
2219
|
+
};
|
|
2220
|
+
/** Attribute names an event property may read. */
|
|
2221
|
+
declare function propertyAttributeAllowed(name: string): boolean;
|
|
2222
|
+
|
|
2223
|
+
/** A published guide as delivered to the SDK. Draft-only data (author, notes) is never included. */
|
|
2224
|
+
interface PublishedGuide {
|
|
2225
|
+
id: string;
|
|
2226
|
+
key: string;
|
|
2227
|
+
name: string;
|
|
2228
|
+
kind: GuideKind;
|
|
2229
|
+
version: number;
|
|
2230
|
+
config: GuideConfig;
|
|
2231
|
+
publishedAt: string;
|
|
2232
|
+
/**
|
|
2233
|
+
* Set while the guide is a variant of a running guide A/B test. Its targeting already carries the
|
|
2234
|
+
* variant's `experiment.bucket` range; SDKs record an `experiment_viewed` exposure
|
|
2235
|
+
* (`{ guideExperimentId, variantId, guideId }`) when it shows.
|
|
2236
|
+
*/
|
|
2237
|
+
experiment?: {
|
|
2238
|
+
id: string;
|
|
2239
|
+
variantId: string;
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* The control group of a running guide A/B test: the base guide's targeting, trigger and frequency
|
|
2244
|
+
* restricted to the control bucket. SDKs evaluate it like a guide but never render it; when it would
|
|
2245
|
+
* show they record the `experiment_viewed` exposure (variant `control`) and its local impression.
|
|
2246
|
+
* SDKs that don't know `guideHoldouts` ignore it (control visitors then simply see nothing).
|
|
2247
|
+
*/
|
|
2248
|
+
interface GuideHoldout {
|
|
2249
|
+
experimentId: string;
|
|
2250
|
+
variantId: string;
|
|
2251
|
+
guide: PublishedGuide;
|
|
2252
|
+
}
|
|
2253
|
+
/** Project-wide limit on automatically shown guides (Project.settings.guideThrottling). */
|
|
2254
|
+
interface GuideThrottlingSettings {
|
|
2255
|
+
enabled: boolean;
|
|
2256
|
+
/** At most this many auto-launched guides per visitor within `windowHours`. */
|
|
2257
|
+
maxGuides: number;
|
|
2258
|
+
windowHours: number;
|
|
2259
|
+
/** Minimum minutes between two auto-launched guides. */
|
|
2260
|
+
minGapMinutes: number;
|
|
2261
|
+
}
|
|
2262
|
+
interface ResourceCenterArticle {
|
|
2263
|
+
id: string;
|
|
2264
|
+
slug: string;
|
|
2265
|
+
title: string;
|
|
2266
|
+
summary: string;
|
|
2267
|
+
body: string;
|
|
2268
|
+
/** True when `body` was left out of the config to keep it small; fetch it from `GET /sdk/articles/:id`. */
|
|
2269
|
+
bodyOmitted?: boolean;
|
|
2270
|
+
collectionId?: string | null;
|
|
2271
|
+
externalUrl?: string | null;
|
|
2272
|
+
/** Listed only for members of any of these audiences (absent = everyone). Not access control. */
|
|
2273
|
+
audienceIds?: string[];
|
|
2274
|
+
/** Guide keys of the article's "Show me" prompts (absent = none); the first one is offered in Help results. */
|
|
2275
|
+
walkthroughs?: string[];
|
|
2276
|
+
/** The article plays a video. */
|
|
2277
|
+
hasVideo?: boolean;
|
|
2278
|
+
updatedAt: string;
|
|
2279
|
+
/** Translations by locale; a `bodyOmitted` translation is fetched with `GET /sdk/articles/:id?locale=`. */
|
|
2280
|
+
translations?: Record<string, {
|
|
2281
|
+
title?: string;
|
|
2282
|
+
summary?: string;
|
|
2283
|
+
body?: string;
|
|
2284
|
+
bodyOmitted?: boolean;
|
|
2285
|
+
}>;
|
|
2286
|
+
}
|
|
2287
|
+
/** A "What's new" entry in the resource center. */
|
|
2288
|
+
interface ResourceCenterAnnouncement {
|
|
2289
|
+
id: string;
|
|
2290
|
+
title: string;
|
|
2291
|
+
/** Sanitized HTML. */
|
|
2292
|
+
body: string;
|
|
2293
|
+
publishedAt: string;
|
|
2294
|
+
/** Guide id or key started by its "Show me" button. */
|
|
2295
|
+
guideId?: string | null;
|
|
2296
|
+
articleId?: string | null;
|
|
2297
|
+
url?: string | null;
|
|
2298
|
+
linkLabel?: string | null;
|
|
2299
|
+
/** Listed only for members of any of these audiences (absent = everyone). */
|
|
2300
|
+
audienceIds?: string[];
|
|
2301
|
+
translations?: Record<string, {
|
|
2302
|
+
title?: string;
|
|
2303
|
+
body?: string;
|
|
2304
|
+
}>;
|
|
2305
|
+
}
|
|
2306
|
+
/** A section of the resource center, in display order; hidden when disabled or its targeting doesn't match. */
|
|
2307
|
+
interface ResourceCenterModule {
|
|
2308
|
+
id: ResourceCenterModuleId;
|
|
2309
|
+
enabled: boolean;
|
|
2310
|
+
/** Evaluated by the SDK like guide targeting (absent = everyone). */
|
|
2311
|
+
targeting?: RuleGroup | null;
|
|
2312
|
+
}
|
|
2313
|
+
interface ResourceCenterCollection {
|
|
2314
|
+
id: string;
|
|
2315
|
+
name: string;
|
|
2316
|
+
description: string;
|
|
2317
|
+
order: number;
|
|
2318
|
+
/** Parent collection for nested collections (absent/null = top level). */
|
|
2319
|
+
parentId?: string | null;
|
|
2320
|
+
/** Listed only for members of any of these audiences, with everything inside it (absent = everyone). */
|
|
2321
|
+
audienceIds?: string[];
|
|
2322
|
+
}
|
|
2323
|
+
interface ResourceCenterConfig {
|
|
2324
|
+
enabled: boolean;
|
|
2325
|
+
title: string;
|
|
2326
|
+
launcher: {
|
|
2327
|
+
position: "bottom-right" | "bottom-left";
|
|
2328
|
+
label: string;
|
|
2329
|
+
showIcon: boolean;
|
|
2330
|
+
};
|
|
2331
|
+
collections: ResourceCenterCollection[];
|
|
2332
|
+
articles: ResourceCenterArticle[];
|
|
2333
|
+
recommendedGuideIds: string[];
|
|
2334
|
+
checklistGuideIds: string[];
|
|
2335
|
+
links: Array<{
|
|
2336
|
+
id: string;
|
|
2337
|
+
label: string;
|
|
2338
|
+
url: string;
|
|
2339
|
+
}>;
|
|
2340
|
+
faqs: Array<{
|
|
2341
|
+
id: string;
|
|
2342
|
+
question: string;
|
|
2343
|
+
answer: string;
|
|
2344
|
+
}>;
|
|
2345
|
+
/** "What's new" (newest first). Absent from servers that predate it. */
|
|
2346
|
+
announcements?: ResourceCenterAnnouncement[];
|
|
2347
|
+
/** Section order and targeting; absent = every section in the default order. */
|
|
2348
|
+
modules?: ResourceCenterModule[];
|
|
2349
|
+
/** Translations of the strings above (see `resourceCenterTextEntries`), by locale. */
|
|
2350
|
+
translations?: Record<string, Record<string, string>>;
|
|
2351
|
+
}
|
|
2352
|
+
interface SdkConfigResponse {
|
|
2353
|
+
projectId: string;
|
|
2354
|
+
environment: string;
|
|
2355
|
+
configVersion: number;
|
|
2356
|
+
theme: z.infer<typeof ProjectThemeSchema>;
|
|
2357
|
+
guides: PublishedGuide[];
|
|
2358
|
+
/** Control groups of running guide A/B tests (see GuideHoldout); absent from older servers. */
|
|
2359
|
+
guideHoldouts?: GuideHoldout[];
|
|
2360
|
+
resourceCenter: ResourceCenterConfig | null;
|
|
2361
|
+
/** Scout messenger; absent from servers that predate it. */
|
|
2362
|
+
messenger?: MessengerConfig | null;
|
|
2363
|
+
settings: {
|
|
2364
|
+
analyticsEnabled: boolean;
|
|
2365
|
+
collectUrls: boolean;
|
|
2366
|
+
maskSelectors: string[];
|
|
2367
|
+
sessionTimeoutMinutes: number;
|
|
2368
|
+
/** Product analytics; absent from servers that predate it (the SDK then captures nothing extra). */
|
|
2369
|
+
autocapture?: AutocaptureSettings;
|
|
2370
|
+
errorTracking?: ErrorTrackingSettings;
|
|
2371
|
+
/** Performance tracing (Guidely SDK); absent from servers that predate it (no tracing). */
|
|
2372
|
+
performance?: PerformanceSettings;
|
|
2373
|
+
/** `retentionDays` is server-side only and not sent. */
|
|
2374
|
+
replay?: Omit<ReplaySettings, "retentionDays">;
|
|
2375
|
+
/** Project-wide guide throttling; absent or disabled = no limit. */
|
|
2376
|
+
throttling?: GuideThrottlingSettings;
|
|
2377
|
+
/** The language guides are written in, and the languages they may be translated into. */
|
|
2378
|
+
localization?: {
|
|
2379
|
+
defaultLocale: string;
|
|
2380
|
+
locales: string[];
|
|
2381
|
+
};
|
|
2382
|
+
};
|
|
2383
|
+
/** Tagged pages and features: the feature attribute and DOM event properties; absent from servers that predate them. */
|
|
2384
|
+
tagging?: TaggingSdkConfig;
|
|
2385
|
+
generatedAt: string;
|
|
2386
|
+
}
|
|
2387
|
+
declare const IdentifyRequestSchema: z.ZodObject<{
|
|
2388
|
+
anonymousId: z.ZodString;
|
|
2389
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2390
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2391
|
+
account: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
2392
|
+
id: z.ZodString;
|
|
2393
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2394
|
+
}, z.core.$strip>>>;
|
|
2395
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2396
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2397
|
+
}, z.core.$strip>;
|
|
2398
|
+
type IdentifyRequest = z.infer<typeof IdentifyRequestSchema>;
|
|
2399
|
+
/** Server-held state the SDK needs for targeting & frequency. */
|
|
2400
|
+
interface IdentifyResponse {
|
|
2401
|
+
endUserId: string;
|
|
2402
|
+
audienceIds: string[];
|
|
2403
|
+
guideState: Record<string, {
|
|
2404
|
+
impressions: number;
|
|
2405
|
+
completedAt?: string | null;
|
|
2406
|
+
dismissedAt?: string | null;
|
|
2407
|
+
lastShownAt?: string | null;
|
|
2408
|
+
}>;
|
|
2409
|
+
/** `dismissResetAt` changes when a teammate resets the user's dismissal; SDKs then drop their cached `dismissedAt`. */
|
|
2410
|
+
checklistProgress: Record<string, {
|
|
2411
|
+
completedTaskIds: string[];
|
|
2412
|
+
completedAt?: string | null;
|
|
2413
|
+
dismissedAt?: string | null;
|
|
2414
|
+
dismissResetAt?: string | null;
|
|
2415
|
+
}>;
|
|
2416
|
+
surveysSubmitted: string[];
|
|
2417
|
+
firstSeenAt: string;
|
|
2418
|
+
}
|
|
2419
|
+
declare const ChecklistProgressRequestSchema: z.ZodObject<{
|
|
2420
|
+
anonymousId: z.ZodString;
|
|
2421
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2422
|
+
guideVersion: z.ZodOptional<z.ZodNumber>;
|
|
2423
|
+
completedTaskIds: z.ZodArray<z.ZodString>;
|
|
2424
|
+
dismissed: z.ZodOptional<z.ZodBoolean>;
|
|
2425
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
2426
|
+
}, z.core.$strip>;
|
|
2427
|
+
type ChecklistProgressRequest = z.infer<typeof ChecklistProgressRequestSchema>;
|
|
2428
|
+
declare const SurveyResponseRequestSchema: z.ZodObject<{
|
|
2429
|
+
anonymousId: z.ZodString;
|
|
2430
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2431
|
+
accountId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2432
|
+
guideVersion: z.ZodNumber;
|
|
2433
|
+
answers: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
2434
|
+
responseId: z.ZodString;
|
|
2435
|
+
}, z.core.$strip>;
|
|
2436
|
+
type SurveyResponseRequest = z.infer<typeof SurveyResponseRequestSchema>;
|
|
2437
|
+
declare const GuideStateUpdateSchema: z.ZodObject<{
|
|
2438
|
+
anonymousId: z.ZodString;
|
|
2439
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2440
|
+
updates: z.ZodArray<z.ZodObject<{
|
|
2441
|
+
guideId: z.ZodString;
|
|
2442
|
+
impression: z.ZodOptional<z.ZodBoolean>;
|
|
2443
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
2444
|
+
dismissed: z.ZodOptional<z.ZodBoolean>;
|
|
2445
|
+
}, z.core.$strip>>;
|
|
2446
|
+
}, z.core.$strip>;
|
|
2447
|
+
declare const AuthoringPickSchema: z.ZodObject<{
|
|
2448
|
+
stepId: z.ZodOptional<z.ZodString>;
|
|
2449
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
2450
|
+
kind: z.ZodString;
|
|
2451
|
+
value: z.ZodString;
|
|
2452
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2453
|
+
}, z.core.$strip>>;
|
|
2454
|
+
textSnapshot: z.ZodOptional<z.ZodString>;
|
|
2455
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2456
|
+
rect: z.ZodOptional<z.ZodObject<{
|
|
2457
|
+
x: z.ZodNumber;
|
|
2458
|
+
y: z.ZodNumber;
|
|
2459
|
+
width: z.ZodNumber;
|
|
2460
|
+
height: z.ZodNumber;
|
|
2461
|
+
}, z.core.$strip>>;
|
|
2462
|
+
elementSnapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2463
|
+
}, z.core.$strip>;
|
|
2464
|
+
type AuthoringPick = z.infer<typeof AuthoringPickSchema>;
|
|
2465
|
+
/**
|
|
2466
|
+
* Static, script-free copy of the page an authoring session is connected to. The SDK posts it to
|
|
2467
|
+
* the dashboard (never to the API) so the editor canvas can show the customer's real app.
|
|
2468
|
+
*/
|
|
2469
|
+
interface AppSnapshot {
|
|
2470
|
+
/** Full HTML document (doctype included) with scripts and Guidely UI removed and a `<base>` pointing at `url`. */
|
|
2471
|
+
html: string;
|
|
2472
|
+
url: string;
|
|
2473
|
+
title: string;
|
|
2474
|
+
/** Viewport the snapshot was taken at, in CSS pixels. */
|
|
2475
|
+
width: number;
|
|
2476
|
+
height: number;
|
|
2477
|
+
capturedAt: string;
|
|
2478
|
+
}
|
|
2479
|
+
interface AuthoringSessionInfo {
|
|
2480
|
+
id: string;
|
|
2481
|
+
projectId: string;
|
|
2482
|
+
environment: string;
|
|
2483
|
+
guideId: string | null;
|
|
2484
|
+
dashboardOrigin: string;
|
|
2485
|
+
expiresAt: string;
|
|
2486
|
+
/** `tag`: the session tags pages and features (no guide); absent or `guide` for the guide editor. */
|
|
2487
|
+
purpose?: "guide" | "tag";
|
|
2488
|
+
/** Draft guide config to preview while authoring (not published). */
|
|
2489
|
+
draft: {
|
|
2490
|
+
id: string;
|
|
2491
|
+
key: string;
|
|
2492
|
+
name: string;
|
|
2493
|
+
kind: GuideKind;
|
|
2494
|
+
config: GuideConfig;
|
|
2495
|
+
} | null;
|
|
2496
|
+
}
|
|
2497
|
+
declare const PublishedGuideSchema: z.ZodObject<{
|
|
2498
|
+
id: z.ZodString;
|
|
2499
|
+
key: z.ZodString;
|
|
2500
|
+
name: z.ZodString;
|
|
2501
|
+
kind: z.ZodString;
|
|
2502
|
+
version: z.ZodNumber;
|
|
2503
|
+
config: z.ZodObject<{
|
|
2504
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2505
|
+
id: z.ZodString;
|
|
2506
|
+
type: z.ZodEnum<{
|
|
2507
|
+
custom: "custom";
|
|
2508
|
+
modal: "modal";
|
|
2509
|
+
tooltip: "tooltip";
|
|
2510
|
+
banner: "banner";
|
|
2511
|
+
checklist: "checklist";
|
|
2512
|
+
survey: "survey";
|
|
2513
|
+
popover: "popover";
|
|
2514
|
+
spotlight: "spotlight";
|
|
2515
|
+
hotspot: "hotspot";
|
|
2516
|
+
slideout: "slideout";
|
|
2517
|
+
}>;
|
|
2518
|
+
title: z.ZodDefault<z.ZodString>;
|
|
2519
|
+
body: z.ZodDefault<z.ZodString>;
|
|
2520
|
+
imageUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
2521
|
+
imageAlt: z.ZodOptional<z.ZodString>;
|
|
2522
|
+
videoUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
2523
|
+
buttons: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2524
|
+
id: z.ZodString;
|
|
2525
|
+
label: z.ZodString;
|
|
2526
|
+
action: z.ZodEnum<{
|
|
2527
|
+
skip: "skip";
|
|
2528
|
+
next: "next";
|
|
2529
|
+
back: "back";
|
|
2530
|
+
dismiss: "dismiss";
|
|
2531
|
+
complete: "complete";
|
|
2532
|
+
url: "url";
|
|
2533
|
+
start_guide: "start_guide";
|
|
2534
|
+
event: "event";
|
|
2535
|
+
open_resource_center: "open_resource_center";
|
|
2536
|
+
none: "none";
|
|
2537
|
+
}>;
|
|
2538
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
2539
|
+
link: "link";
|
|
2540
|
+
primary: "primary";
|
|
2541
|
+
secondary: "secondary";
|
|
2542
|
+
ghost: "ghost";
|
|
2543
|
+
}>>;
|
|
2544
|
+
value: z.ZodOptional<z.ZodString>;
|
|
2545
|
+
newTab: z.ZodOptional<z.ZodBoolean>;
|
|
2546
|
+
}, z.core.$strip>>>;
|
|
2547
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
2548
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
2549
|
+
kind: z.ZodEnum<{
|
|
2550
|
+
id: "id";
|
|
2551
|
+
text: "text";
|
|
2552
|
+
css: "css";
|
|
2553
|
+
"data-attr": "data-attr";
|
|
2554
|
+
aria: "aria";
|
|
2555
|
+
xpath: "xpath";
|
|
2556
|
+
"guidely-id": "guidely-id";
|
|
2557
|
+
}>;
|
|
2558
|
+
value: z.ZodString;
|
|
2559
|
+
label: z.ZodOptional<z.ZodString>;
|
|
2560
|
+
}, z.core.$strip>>;
|
|
2561
|
+
waitMs: z.ZodDefault<z.ZodNumber>;
|
|
2562
|
+
fallback: z.ZodDefault<z.ZodEnum<{
|
|
2563
|
+
skip: "skip";
|
|
2564
|
+
show_as_modal: "show_as_modal";
|
|
2565
|
+
end_guide: "end_guide";
|
|
2566
|
+
wait: "wait";
|
|
2567
|
+
}>>;
|
|
2568
|
+
scrollIntoView: z.ZodDefault<z.ZodBoolean>;
|
|
2569
|
+
textSnapshot: z.ZodOptional<z.ZodString>;
|
|
2570
|
+
}, z.core.$strip>>;
|
|
2571
|
+
placement: z.ZodDefault<z.ZodEnum<{
|
|
2572
|
+
top: "top";
|
|
2573
|
+
"top-start": "top-start";
|
|
2574
|
+
"top-end": "top-end";
|
|
2575
|
+
right: "right";
|
|
2576
|
+
"right-start": "right-start";
|
|
2577
|
+
"right-end": "right-end";
|
|
2578
|
+
bottom: "bottom";
|
|
2579
|
+
"bottom-start": "bottom-start";
|
|
2580
|
+
"bottom-end": "bottom-end";
|
|
2581
|
+
left: "left";
|
|
2582
|
+
"left-start": "left-start";
|
|
2583
|
+
"left-end": "left-end";
|
|
2584
|
+
auto: "auto";
|
|
2585
|
+
}>>;
|
|
2586
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
2587
|
+
showOverlay: z.ZodDefault<z.ZodBoolean>;
|
|
2588
|
+
showProgress: z.ZodDefault<z.ZodBoolean>;
|
|
2589
|
+
showClose: z.ZodDefault<z.ZodBoolean>;
|
|
2590
|
+
dismissOnOutsideClick: z.ZodDefault<z.ZodBoolean>;
|
|
2591
|
+
spotlightPadding: z.ZodDefault<z.ZodNumber>;
|
|
2592
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
2593
|
+
top: "top";
|
|
2594
|
+
bottom: "bottom";
|
|
2595
|
+
"top-left": "top-left";
|
|
2596
|
+
"top-right": "top-right";
|
|
2597
|
+
"bottom-left": "bottom-left";
|
|
2598
|
+
"bottom-right": "bottom-right";
|
|
2599
|
+
center: "center";
|
|
2600
|
+
}>>;
|
|
2601
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2602
|
+
advanceOn: z.ZodDefault<z.ZodEnum<{
|
|
2603
|
+
any: "any";
|
|
2604
|
+
button: "button";
|
|
2605
|
+
event: "event";
|
|
2606
|
+
element_click: "element_click";
|
|
2607
|
+
element_visible: "element_visible";
|
|
2608
|
+
delay: "delay";
|
|
2609
|
+
}>>;
|
|
2610
|
+
advanceValue: z.ZodOptional<z.ZodString>;
|
|
2611
|
+
advanceDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
2612
|
+
branches: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2613
|
+
id: z.ZodString;
|
|
2614
|
+
when: z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>;
|
|
2615
|
+
goTo: z.ZodString;
|
|
2616
|
+
}, z.core.$strip>>>;
|
|
2617
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
2618
|
+
targeting: z.ZodOptional<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
2619
|
+
hotspot: z.ZodOptional<z.ZodObject<{
|
|
2620
|
+
size: z.ZodDefault<z.ZodNumber>;
|
|
2621
|
+
pulse: z.ZodDefault<z.ZodBoolean>;
|
|
2622
|
+
openOn: z.ZodDefault<z.ZodEnum<{
|
|
2623
|
+
click: "click";
|
|
2624
|
+
hover: "hover";
|
|
2625
|
+
}>>;
|
|
2626
|
+
}, z.core.$strip>>;
|
|
2627
|
+
customHtml: z.ZodOptional<z.ZodString>;
|
|
2628
|
+
code: z.ZodOptional<z.ZodString>;
|
|
2629
|
+
}, z.core.$strip>>>;
|
|
2630
|
+
visibility: z.ZodDefault<z.ZodEnum<{
|
|
2631
|
+
everyone: "everyone";
|
|
2632
|
+
identified: "identified";
|
|
2633
|
+
anonymous: "anonymous";
|
|
2634
|
+
}>>;
|
|
2635
|
+
targeting: z.ZodDefault<z.ZodType<RuleGroup, unknown, z.core.$ZodTypeInternals<RuleGroup, unknown>>>;
|
|
2636
|
+
trigger: z.ZodPrefault<z.ZodObject<{
|
|
2637
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
2638
|
+
event: "event";
|
|
2639
|
+
element_click: "element_click";
|
|
2640
|
+
element_visible: "element_visible";
|
|
2641
|
+
delay: "delay";
|
|
2642
|
+
page_load: "page_load";
|
|
2643
|
+
url_match: "url_match";
|
|
2644
|
+
manual: "manual";
|
|
2645
|
+
after_guide: "after_guide";
|
|
2646
|
+
segment_enter: "segment_enter";
|
|
2647
|
+
}>>;
|
|
2648
|
+
value: z.ZodOptional<z.ZodString>;
|
|
2649
|
+
delayMs: z.ZodDefault<z.ZodNumber>;
|
|
2650
|
+
urlPattern: z.ZodOptional<z.ZodString>;
|
|
2651
|
+
}, z.core.$strip>>;
|
|
2652
|
+
frequency: z.ZodPrefault<z.ZodObject<{
|
|
2653
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
2654
|
+
once: "once";
|
|
2655
|
+
once_per_session: "once_per_session";
|
|
2656
|
+
every_time: "every_time";
|
|
2657
|
+
interval: "interval";
|
|
2658
|
+
}>>;
|
|
2659
|
+
intervalHours: z.ZodOptional<z.ZodNumber>;
|
|
2660
|
+
maxImpressions: z.ZodOptional<z.ZodNumber>;
|
|
2661
|
+
cooldownHours: z.ZodDefault<z.ZodNumber>;
|
|
2662
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
2663
|
+
mutuallyExclusiveWith: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2664
|
+
reshowAfterDismiss: z.ZodDefault<z.ZodBoolean>;
|
|
2665
|
+
ignoreThrottling: z.ZodOptional<z.ZodBoolean>;
|
|
2666
|
+
}, z.core.$strip>>;
|
|
2667
|
+
appearance: z.ZodPrefault<z.ZodObject<{
|
|
2668
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
2669
|
+
auto: "auto";
|
|
2670
|
+
light: "light";
|
|
2671
|
+
dark: "dark";
|
|
2672
|
+
}>>;
|
|
2673
|
+
primaryColor: z.ZodOptional<z.ZodString>;
|
|
2674
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
2675
|
+
textColor: z.ZodOptional<z.ZodString>;
|
|
2676
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
2677
|
+
fontFamily: z.ZodOptional<z.ZodString>;
|
|
2678
|
+
overlayOpacity: z.ZodOptional<z.ZodNumber>;
|
|
2679
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
2680
|
+
preset: z.ZodOptional<z.ZodString>;
|
|
2681
|
+
animation: z.ZodDefault<z.ZodEnum<{
|
|
2682
|
+
none: "none";
|
|
2683
|
+
fade: "fade";
|
|
2684
|
+
slide: "slide";
|
|
2685
|
+
}>>;
|
|
2686
|
+
customCss: z.ZodOptional<z.ZodString>;
|
|
2687
|
+
}, z.core.$strip>>;
|
|
2688
|
+
checklist: z.ZodOptional<z.ZodObject<{
|
|
2689
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
2690
|
+
id: z.ZodString;
|
|
2691
|
+
title: z.ZodString;
|
|
2692
|
+
description: z.ZodDefault<z.ZodString>;
|
|
2693
|
+
completion: z.ZodDefault<z.ZodEnum<{
|
|
2694
|
+
event: "event";
|
|
2695
|
+
click: "click";
|
|
2696
|
+
manual: "manual";
|
|
2697
|
+
guide_completed: "guide_completed";
|
|
2698
|
+
url_visited: "url_visited";
|
|
2699
|
+
}>>;
|
|
2700
|
+
completionValue: z.ZodOptional<z.ZodString>;
|
|
2701
|
+
action: z.ZodDefault<z.ZodEnum<{
|
|
2702
|
+
url: "url";
|
|
2703
|
+
start_guide: "start_guide";
|
|
2704
|
+
event: "event";
|
|
2705
|
+
none: "none";
|
|
2706
|
+
}>>;
|
|
2707
|
+
actionValue: z.ZodOptional<z.ZodString>;
|
|
2708
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
2709
|
+
}, z.core.$strip>>;
|
|
2710
|
+
ordered: z.ZodDefault<z.ZodBoolean>;
|
|
2711
|
+
launcherLabel: z.ZodDefault<z.ZodString>;
|
|
2712
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
2713
|
+
"bottom-left": "bottom-left";
|
|
2714
|
+
"bottom-right": "bottom-right";
|
|
2715
|
+
}>>;
|
|
2716
|
+
completionTitle: z.ZodDefault<z.ZodString>;
|
|
2717
|
+
completionBody: z.ZodDefault<z.ZodString>;
|
|
2718
|
+
autoOpen: z.ZodDefault<z.ZodBoolean>;
|
|
2719
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
2720
|
+
}, z.core.$strip>>;
|
|
2721
|
+
survey: z.ZodOptional<z.ZodObject<{
|
|
2722
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
2723
|
+
id: z.ZodString;
|
|
2724
|
+
type: z.ZodEnum<{
|
|
2725
|
+
text: "text";
|
|
2726
|
+
nps: "nps";
|
|
2727
|
+
csat: "csat";
|
|
2728
|
+
thumbs: "thumbs";
|
|
2729
|
+
single_choice: "single_choice";
|
|
2730
|
+
multiple_choice: "multiple_choice";
|
|
2731
|
+
rating: "rating";
|
|
2732
|
+
}>;
|
|
2733
|
+
title: z.ZodString;
|
|
2734
|
+
description: z.ZodDefault<z.ZodString>;
|
|
2735
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
2736
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2737
|
+
id: z.ZodString;
|
|
2738
|
+
label: z.ZodString;
|
|
2739
|
+
}, z.core.$strip>>>;
|
|
2740
|
+
scaleMax: z.ZodOptional<z.ZodNumber>;
|
|
2741
|
+
lowLabel: z.ZodOptional<z.ZodString>;
|
|
2742
|
+
highLabel: z.ZodOptional<z.ZodString>;
|
|
2743
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
2744
|
+
showWhen: z.ZodOptional<z.ZodObject<{
|
|
2745
|
+
questionId: z.ZodString;
|
|
2746
|
+
op: z.ZodEnum<{
|
|
2747
|
+
equals: "equals";
|
|
2748
|
+
lte: "lte";
|
|
2749
|
+
gte: "gte";
|
|
2750
|
+
in: "in";
|
|
2751
|
+
}>;
|
|
2752
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>]>;
|
|
2753
|
+
}, z.core.$strip>>;
|
|
2754
|
+
}, z.core.$strip>>;
|
|
2755
|
+
thankYouTitle: z.ZodDefault<z.ZodString>;
|
|
2756
|
+
thankYouBody: z.ZodDefault<z.ZodString>;
|
|
2757
|
+
position: z.ZodDefault<z.ZodEnum<{
|
|
2758
|
+
"bottom-left": "bottom-left";
|
|
2759
|
+
"bottom-right": "bottom-right";
|
|
2760
|
+
center: "center";
|
|
2761
|
+
}>>;
|
|
2762
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
2763
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
2764
|
+
}, z.core.$strip>>;
|
|
2765
|
+
urlPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
2766
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
2767
|
+
web: "web";
|
|
2768
|
+
ios: "ios";
|
|
2769
|
+
android: "android";
|
|
2770
|
+
}>>>;
|
|
2771
|
+
schedule: z.ZodOptional<z.ZodObject<{
|
|
2772
|
+
startAt: z.ZodOptional<z.ZodString>;
|
|
2773
|
+
endAt: z.ZodOptional<z.ZodString>;
|
|
2774
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
2775
|
+
}, z.core.$strip>>;
|
|
2776
|
+
localization: z.ZodOptional<z.ZodObject<{
|
|
2777
|
+
translations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
2778
|
+
}, z.core.$strip>>;
|
|
2779
|
+
}, z.core.$strip>;
|
|
2780
|
+
publishedAt: z.ZodString;
|
|
2781
|
+
}, z.core.$strip>;
|
|
2782
|
+
interface ApiError {
|
|
2783
|
+
error: {
|
|
2784
|
+
code: string;
|
|
2785
|
+
message: string;
|
|
2786
|
+
details?: unknown;
|
|
2787
|
+
};
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
/** Bug report (user feedback) types and limits shared by the server and the SDK (zod-free). */
|
|
2791
|
+
declare const MAX_BUG_REPORT_LENGTH = 4000;
|
|
2792
|
+
/** Largest screenshot a bug report may carry (Sentry's feedback widget allows about the same). */
|
|
2793
|
+
declare const MAX_BUG_REPORT_SCREENSHOT_BYTES: number;
|
|
2794
|
+
/** `guidely.captureFeedback(...)`. Only `message` is required. */
|
|
2795
|
+
interface BugReportInput {
|
|
2796
|
+
message: string;
|
|
2797
|
+
email?: string | null;
|
|
2798
|
+
name?: string | null;
|
|
2799
|
+
/** The error the report is about: an exception event id (defaults to the last error this page reported). */
|
|
2800
|
+
associatedEventId?: string | null;
|
|
2801
|
+
/** Free-form tags shown with the report (strings, at most 20). */
|
|
2802
|
+
tags?: Record<string, string>;
|
|
2803
|
+
/** One image (png, jpeg, webp or gif) as a File/Blob, or already base64-encoded. */
|
|
2804
|
+
screenshot?: Blob | {
|
|
2805
|
+
fileName: string;
|
|
2806
|
+
data: string;
|
|
2807
|
+
} | null;
|
|
2808
|
+
}
|
|
2809
|
+
/** What `POST /v1/sdk/bug-reports` answers. */
|
|
2810
|
+
interface BugReportResponse {
|
|
2811
|
+
id: string;
|
|
2812
|
+
/** Linked to an error issue already (the associated error arrived first). */
|
|
2813
|
+
linked: boolean;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
/**
|
|
2817
|
+
* Agent Analytics: the `agent.conversation` turn the customer's own AI agents send (zod-free, so the
|
|
2818
|
+
* browser SDK can use the types and limits without bundling the schema). The schema is in agents.ts.
|
|
2819
|
+
*/
|
|
2820
|
+
declare const AGENT_TURN_ROLES: readonly ["user", "assistant", "tool", "system"];
|
|
2821
|
+
type AgentTurnRole = (typeof AGENT_TURN_ROLES)[number];
|
|
2822
|
+
/** How a conversation ended, as the agent reports it. */
|
|
2823
|
+
declare const AGENT_OUTCOMES: readonly ["success", "failure", "escalated", "abandoned"];
|
|
2824
|
+
type AgentOutcome = (typeof AGENT_OUTCOMES)[number];
|
|
2825
|
+
declare const AGENT_TOOL_STATUSES: readonly ["ok", "error"];
|
|
2826
|
+
type AgentToolStatus = (typeof AGENT_TOOL_STATUSES)[number];
|
|
2827
|
+
/** Longest turn text accepted (characters). */
|
|
2828
|
+
declare const AGENT_TURN_MAX_TEXT = 20000;
|
|
2829
|
+
/** Most turns in one request. */
|
|
2830
|
+
declare const AGENT_TURNS_PER_BATCH = 100;
|
|
2831
|
+
/** Most tool calls on one turn. */
|
|
2832
|
+
declare const AGENT_TOOL_CALLS_PER_TURN = 50;
|
|
2833
|
+
/** Metadata: at most this many keys, string values up to 500 characters, 4 KB in all. */
|
|
2834
|
+
declare const AGENT_METADATA_MAX_KEYS = 30;
|
|
2835
|
+
declare const AGENT_METADATA_MAX_BYTES = 4096;
|
|
2836
|
+
/** The built-in Scout agent's id; customer agents can't use it. */
|
|
2837
|
+
declare const SCOUT_AGENT_ID = "scout";
|
|
2838
|
+
/** One tool the agent called in a turn. Arguments and results are never sent or stored. */
|
|
2839
|
+
interface AgentToolCallInput {
|
|
2840
|
+
name: string;
|
|
2841
|
+
status?: AgentToolStatus;
|
|
2842
|
+
latencyMs?: number;
|
|
2843
|
+
}
|
|
2844
|
+
/** One `agent.conversation` turn. */
|
|
2845
|
+
interface AgentTurnInput {
|
|
2846
|
+
type?: "agent.conversation";
|
|
2847
|
+
/** Your conversation (thread) id. */
|
|
2848
|
+
conversationId: string;
|
|
2849
|
+
/** Your agent's id, e.g. "support-bot". The agent is created on its first turn. */
|
|
2850
|
+
agentId: string;
|
|
2851
|
+
/** Display name for a new agent (defaults to agentId). */
|
|
2852
|
+
agentName?: string;
|
|
2853
|
+
/** Idempotency key: a turn sent twice with the same id is stored once. */
|
|
2854
|
+
turnId?: string;
|
|
2855
|
+
role: AgentTurnRole;
|
|
2856
|
+
text?: string;
|
|
2857
|
+
toolCalls?: AgentToolCallInput[];
|
|
2858
|
+
/** How long the agent took to produce this turn (assistant turns). */
|
|
2859
|
+
latencyMs?: number;
|
|
2860
|
+
/** How the conversation ended, when this turn ends it (the latest reported outcome wins). */
|
|
2861
|
+
outcome?: AgentOutcome;
|
|
2862
|
+
/** Whether the person got what they came for, when the agent knows. */
|
|
2863
|
+
taskSuccess?: boolean;
|
|
2864
|
+
/** ISO 8601 time of the turn (default: when Guidely receives it). */
|
|
2865
|
+
occurredAt?: string;
|
|
2866
|
+
userId?: string | null;
|
|
2867
|
+
anonymousId?: string | null;
|
|
2868
|
+
accountId?: string | null;
|
|
2869
|
+
sessionId?: string | null;
|
|
2870
|
+
/** Flat key/value pairs (strings, numbers, booleans), e.g. { model: "gpt-4.1" }. */
|
|
2871
|
+
metadata?: Record<string, string | number | boolean | null>;
|
|
2872
|
+
}
|
|
2873
|
+
/** Response of both ingestion endpoints. */
|
|
2874
|
+
interface AgentEventsResponse {
|
|
2875
|
+
accepted: number;
|
|
2876
|
+
duplicates: number;
|
|
2877
|
+
/** Turns refused (an agent past the per-project limit, or a conversation past its turn limit). */
|
|
2878
|
+
rejected?: number;
|
|
2879
|
+
/** Turns dropped because this month's product analytics allowance is used up. */
|
|
2880
|
+
overLimit?: number;
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
/** rrweb plugin name for network events in recordings (event type 6, `data.plugin`). */
|
|
2884
|
+
declare const NETWORK_PLUGIN = "guidely/network@1";
|
|
2885
|
+
/** Request kinds, from `fetch`/`XMLHttpRequest` patching or `PerformanceResourceTiming.initiatorType`. */
|
|
2886
|
+
type NetworkRequestType = "fetch" | "xhr" | "websocket" | "document" | "script" | "stylesheet" | "image" | "font" | "media" | "beacon" | "other";
|
|
2887
|
+
/**
|
|
2888
|
+
* One network request in a recording: the payload of an rrweb plugin event
|
|
2889
|
+
* `{ type: 6, data: { plugin: NETWORK_PLUGIN, payload: NetworkPluginPayload } }`, batched.
|
|
2890
|
+
* Times are epoch milliseconds (same clock as rrweb event timestamps).
|
|
2891
|
+
*
|
|
2892
|
+
* A WebSocket is a request with `type: "websocket"` and `method: "GET"`, emitted when it opens
|
|
2893
|
+
* (`startTime`) and again, with the same `id`, when it closes (`endTime`, `closeCode`, `closeReason`,
|
|
2894
|
+
* totals in `messages`). Its frames are `WebSocketMessage`s referencing that `id`.
|
|
2895
|
+
*/
|
|
2896
|
+
interface NetworkRequest {
|
|
2897
|
+
/** Stable id within the recording. */
|
|
2898
|
+
id: string;
|
|
2899
|
+
type: NetworkRequestType;
|
|
2900
|
+
method: string;
|
|
2901
|
+
/** Absolute URL; values of sensitive-looking query parameters replaced with `[redacted]`. */
|
|
2902
|
+
url: string;
|
|
2903
|
+
startTime: number;
|
|
2904
|
+
endTime?: number;
|
|
2905
|
+
durationMs?: number;
|
|
2906
|
+
/** HTTP status; 0 for network errors / blocked / aborted. Absent when the browser doesn't expose it. */
|
|
2907
|
+
status?: number;
|
|
2908
|
+
/** Set for failed requests: network error, abort or timeout message. */
|
|
2909
|
+
error?: string;
|
|
2910
|
+
/** Encoded bytes transferred / decoded response size, when known. */
|
|
2911
|
+
transferSize?: number;
|
|
2912
|
+
responseSize?: number;
|
|
2913
|
+
/** Only when `recordNetworkPayloads` is on; sensitive headers are `[redacted]`. */
|
|
2914
|
+
requestHeaders?: Record<string, string>;
|
|
2915
|
+
responseHeaders?: Record<string, string>;
|
|
2916
|
+
/** Text/JSON bodies, ≤10KB, sensitive JSON fields masked; `[binary]` / `[truncated]` markers otherwise. */
|
|
2917
|
+
requestBody?: string;
|
|
2918
|
+
responseBody?: string;
|
|
2919
|
+
/** WebSocket only: negotiated subprotocol, close details, and frame totals (all frames, including ones not recorded). */
|
|
2920
|
+
protocol?: string;
|
|
2921
|
+
closeCode?: number;
|
|
2922
|
+
closeReason?: string;
|
|
2923
|
+
messages?: {
|
|
2924
|
+
sent: number;
|
|
2925
|
+
received: number;
|
|
2926
|
+
sentBytes: number;
|
|
2927
|
+
receivedBytes: number;
|
|
2928
|
+
recorded: number;
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
/** One WebSocket frame. At most `WS_MAX_MESSAGES_PER_SOCKET` are recorded per connection per page load. */
|
|
2932
|
+
interface WebSocketMessage {
|
|
2933
|
+
/** The `NetworkRequest.id` of the connection. */
|
|
2934
|
+
socketId: string;
|
|
2935
|
+
dir: "send" | "recv";
|
|
2936
|
+
time: number;
|
|
2937
|
+
/** Bytes (UTF-8 length for text frames). */
|
|
2938
|
+
size: number;
|
|
2939
|
+
binary?: boolean;
|
|
2940
|
+
/** Only with `recordNetworkPayloads`: text ≤ 2KB (JSON with sensitive keys masked), else `[truncated]`; binary frames are `[binary <n> B]`. */
|
|
2941
|
+
data?: string;
|
|
2942
|
+
}
|
|
2943
|
+
interface NetworkPluginPayload {
|
|
2944
|
+
requests?: NetworkRequest[];
|
|
2945
|
+
messages?: WebSocketMessage[];
|
|
2946
|
+
/** Requests/frames dropped since the previous payload because a cap was reached. */
|
|
2947
|
+
dropped?: {
|
|
2948
|
+
requests?: number;
|
|
2949
|
+
messages?: number;
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
declare const WS_MAX_MESSAGES_PER_SOCKET = 200;
|
|
2953
|
+
declare const WS_MAX_MESSAGE_BYTES = 2048;
|
|
2954
|
+
/** Header names always replaced with `[redacted]` when payload capture is on. */
|
|
2955
|
+
declare const SENSITIVE_HEADER_PATTERN: RegExp;
|
|
2956
|
+
/** Query parameter and JSON field names whose values are redacted. */
|
|
2957
|
+
declare const SENSITIVE_PARAM_PATTERN: RegExp;
|
|
2958
|
+
|
|
2959
|
+
/**
|
|
2960
|
+
* Media in article bodies: uploaded images, videos and PDFs, and video embeds from a fixed set of hosts.
|
|
2961
|
+
* Sanitizers (server, browser runtime) only keep an `<iframe>` whose `src` is the canonical embed URL
|
|
2962
|
+
* that `toEmbedUrl` produces, so authors can never point a frame anywhere else.
|
|
2963
|
+
*
|
|
2964
|
+
* An uploaded PDF reads inline, as its pages: the dashboard renders each page to an image when the
|
|
2965
|
+
* PDF is uploaded, and the body holds plain HTML every renderer already understands:
|
|
2966
|
+
*
|
|
2967
|
+
* <div class="gd-pdf">
|
|
2968
|
+
* <a class="gd-file" href="…/{id}.pdf" target="_blank">{file name}</a>
|
|
2969
|
+
* <div class="gd-pdf-pages"><img src="…/{page}.webp" alt="{file name}, page 1 of 12"> …</div>
|
|
2970
|
+
* </div>
|
|
2971
|
+
*
|
|
2972
|
+
* Renderers that know the classes draw a swipeable page viewer with the PDF one tap away; older ones
|
|
2973
|
+
* show a link and the pages as images. A PDF whose pages couldn't be rendered (password-protected,
|
|
2974
|
+
* damaged) is just the `gd-file` link, drawn as a file card.
|
|
2975
|
+
*/
|
|
2976
|
+
type EmbedProvider = "youtube" | "vimeo" | "loom" | "wistia";
|
|
2977
|
+
interface VideoEmbed {
|
|
2978
|
+
provider: EmbedProvider;
|
|
2979
|
+
/** Canonical player URL, safe to use as an iframe `src`. */
|
|
2980
|
+
src: string;
|
|
2981
|
+
/** Page a viewer can open instead (native SDKs show a link rather than a player). */
|
|
2982
|
+
watchUrl: string;
|
|
2983
|
+
/** Accessible iframe title. */
|
|
2984
|
+
title: string;
|
|
2985
|
+
}
|
|
2986
|
+
declare const MEDIA_IMAGE_TYPES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
2987
|
+
declare const MEDIA_VIDEO_TYPES: readonly ["video/mp4", "video/webm"];
|
|
2988
|
+
declare const MEDIA_FILE_TYPES: readonly ["application/pdf"];
|
|
2989
|
+
type MediaContentType = (typeof MEDIA_IMAGE_TYPES)[number] | (typeof MEDIA_VIDEO_TYPES)[number] | (typeof MEDIA_FILE_TYPES)[number];
|
|
2990
|
+
type MediaKind = "image" | "video" | "file";
|
|
2991
|
+
declare const MEDIA_IMAGE_MAX_BYTES: number;
|
|
2992
|
+
declare const MEDIA_VIDEO_MAX_BYTES: number;
|
|
2993
|
+
declare const MEDIA_FILE_MAX_BYTES: number;
|
|
2994
|
+
/** The largest upload of any type. */
|
|
2995
|
+
declare const MEDIA_MAX_BYTES: number;
|
|
2996
|
+
declare function isMediaContentType(type: string): type is MediaContentType;
|
|
2997
|
+
declare function isVideoContentType(type: string): boolean;
|
|
2998
|
+
declare function mediaKind(type: string): MediaKind | null;
|
|
2999
|
+
declare function mediaMaxBytes(type: string): number;
|
|
3000
|
+
/** Class marking a link as an attached file (an uploaded PDF), drawn as a file card. */
|
|
3001
|
+
declare const FILE_LINK_CLASS = "gd-file";
|
|
3002
|
+
/** Class of the block holding a PDF's link and its rendered pages. */
|
|
3003
|
+
declare const PDF_BLOCK_CLASS = "gd-pdf";
|
|
3004
|
+
/** Class of the element wrapping a PDF's page images. */
|
|
3005
|
+
declare const PDF_PAGES_CLASS = "gd-pdf-pages";
|
|
3006
|
+
/** Pages rendered inline per PDF; readers open the PDF itself for the rest. */
|
|
3007
|
+
declare const PDF_MAX_PAGES = 40;
|
|
3008
|
+
/** True for an `<a>` with the file class and an absolute http(s) `href`: render it as a file card. */
|
|
3009
|
+
declare function isFileLink(className: string | null | undefined, href: string | null | undefined): boolean;
|
|
3010
|
+
/**
|
|
3011
|
+
* Turns a pasted video page or player URL from YouTube, Vimeo, Loom or Wistia into its canonical
|
|
3012
|
+
* embed. Returns null for anything else, including lookalike hosts.
|
|
3013
|
+
*/
|
|
3014
|
+
declare function toEmbedUrl(input: string): VideoEmbed | null;
|
|
3015
|
+
/** True only for a canonical embed URL (exactly what `toEmbedUrl` returns), so an iframe can't be pointed elsewhere. */
|
|
3016
|
+
declare function isAllowedEmbedSrc(src: string | null | undefined): boolean;
|
|
3017
|
+
/** Fixed iframe attributes for an embed; sanitizers overwrite whatever the author's HTML carried. */
|
|
3018
|
+
declare const EMBED_IFRAME_ATTRS: Readonly<Record<string, string>>;
|
|
3019
|
+
/** Fixed `<video>` attributes: player controls, no autoplay or loop. */
|
|
3020
|
+
declare const VIDEO_ATTRS: Readonly<Record<string, string>>;
|
|
3021
|
+
/** `<video src>` / `poster` must be plain http(s): no data:, blob: or relative URLs (bodies render on customer sites). */
|
|
3022
|
+
declare function isSafeMediaUrl(url: string | null | undefined): boolean;
|
|
3023
|
+
/**
|
|
3024
|
+
* Still image for a guide step's video (`videoUrl`): YouTube serves one per video; other hosts don't
|
|
3025
|
+
* without an API call, so those steps use their own image (`imageUrl`) as the poster, or a plain tile.
|
|
3026
|
+
*/
|
|
3027
|
+
declare function videoThumbnailUrl(url: string | null | undefined): string | null;
|
|
3028
|
+
/** A video file a `<video>` can load directly (shows its first frame when there's no poster). */
|
|
3029
|
+
declare function isVideoFileUrl(url: string | null | undefined): boolean;
|
|
3030
|
+
/**
|
|
3031
|
+
* The video shown on a guide step: a poster with a play button that opens `url` in a new tab.
|
|
3032
|
+
* `poster` is the step's image, else the provider's thumbnail; null means draw a plain tile.
|
|
3033
|
+
*/
|
|
3034
|
+
declare function stepVideo(step: {
|
|
3035
|
+
videoUrl?: string | null;
|
|
3036
|
+
imageUrl?: string | null;
|
|
3037
|
+
}): {
|
|
3038
|
+
url: string;
|
|
3039
|
+
poster: string | null;
|
|
3040
|
+
} | null;
|
|
3041
|
+
|
|
3042
|
+
/**
|
|
3043
|
+
* Page helpers shared by the SDK (page-aware messenger) and the server (page matching, analytics).
|
|
3044
|
+
* Pure and zod-free.
|
|
3045
|
+
*/
|
|
3046
|
+
/**
|
|
3047
|
+
* One path segment that looks like an identifier: digits, a UUID, or a long hex string (hashes,
|
|
3048
|
+
* Mongo ids). Written so the same source works as a JS RegExp and a Postgres ARE (`regexp_replace`
|
|
3049
|
+
* with flags `gi`), which keeps id folding identical in SQL and in code. A segment may be followed
|
|
3050
|
+
* by the page query parameters a project keeps in its paths (`/contacts/42?tab=notes`).
|
|
3051
|
+
*/
|
|
3052
|
+
declare const PATH_ID_PATTERN = "/([0-9]+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{12,})(?=[/?]|$)";
|
|
3053
|
+
/** `/contacts/42/notes/9f8e…` → `/contacts/:id/notes/:id`; `/contacts/42?tab=notes` → `/contacts/:id?tab=notes`. */
|
|
3054
|
+
declare function foldPathIds(path: string): string;
|
|
3055
|
+
/** Words describing a page, from its path (`/settings/billing-plans/42` → `settings billing plans`). */
|
|
3056
|
+
declare function pageTerms(path: string): string[];
|
|
3057
|
+
/** A short human name for a page (`/app/invoices/42` → `Invoices`), or null for the root and unnamed pages. */
|
|
3058
|
+
declare function pageLabel(path: string): string | null;
|
|
3059
|
+
/** The first name in a user's traits (`firstName`, `first_name`, or the first word of `name`), or null. */
|
|
3060
|
+
declare function firstNameFromTraits(traits: Record<string, unknown> | null | undefined): string | null;
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* Guide and resource-center localization (zod-free, so the browser SDK can import it).
|
|
3064
|
+
*
|
|
3065
|
+
* Every translatable text field has a stable key derived from ids, never from positions, so
|
|
3066
|
+
* reordering steps keeps translations attached: `steps.<stepId>.title`,
|
|
3067
|
+
* `steps.<stepId>.buttons.<buttonId>.label`, `checklist.tasks.<taskId>.title`,
|
|
3068
|
+
* `survey.questions.<questionId>.options.<optionId>.label`, …
|
|
3069
|
+
*
|
|
3070
|
+
* A visitor's language comes from (in order) an explicit SDK locale, the `language` / `locale`
|
|
3071
|
+
* trait, then the browser / device language. `resolveLocale` matches it against the languages a
|
|
3072
|
+
* guide is translated into (exact tag first, then the base language) and falls back to the
|
|
3073
|
+
* project's default language, in which the guide is written.
|
|
3074
|
+
*/
|
|
3075
|
+
|
|
3076
|
+
type TextKind = "text" | "html";
|
|
3077
|
+
interface TextEntry {
|
|
3078
|
+
key: string;
|
|
3079
|
+
/** Default-language text. */
|
|
3080
|
+
source: string;
|
|
3081
|
+
kind: TextKind;
|
|
3082
|
+
/** Human-readable location for translators ("Step 2 · Title"). */
|
|
3083
|
+
label: string;
|
|
3084
|
+
}
|
|
3085
|
+
/** Project-level language settings (Project.settings.localization). */
|
|
3086
|
+
interface LocalizationSettings {
|
|
3087
|
+
/** Language the content is written in. */
|
|
3088
|
+
defaultLocale: string;
|
|
3089
|
+
/** Additional languages offered for translation. */
|
|
3090
|
+
locales: string[];
|
|
3091
|
+
/** Machine-translate new and changed text into every language automatically. */
|
|
3092
|
+
autoTranslate?: boolean;
|
|
3093
|
+
/** Machine translations need a teammate's approval before visitors see them. */
|
|
3094
|
+
requireReview?: boolean;
|
|
3095
|
+
}
|
|
3096
|
+
/**
|
|
3097
|
+
* Review state of one translated text. `machine` texts were written by AI translation; `human`
|
|
3098
|
+
* ones were typed or imported by a teammate (approved by doing so). `outdated` means the source
|
|
3099
|
+
* text changed after the translation was written or approved.
|
|
3100
|
+
*/
|
|
3101
|
+
interface TranslationReviewState {
|
|
3102
|
+
origin: "machine" | "human";
|
|
3103
|
+
approved: boolean;
|
|
3104
|
+
outdated: boolean;
|
|
3105
|
+
reviewedBy?: string | null;
|
|
3106
|
+
reviewedAt?: string | null;
|
|
3107
|
+
}
|
|
3108
|
+
/** locale → key → review state. Texts without a state are human translations from before review existed. */
|
|
3109
|
+
type TranslationReviewMap = Record<string, Record<string, TranslationReviewState>>;
|
|
3110
|
+
/** Does this translation still need a teammate to look at it? */
|
|
3111
|
+
declare function needsReview(state: TranslationReviewState | undefined): boolean;
|
|
3112
|
+
declare const DEFAULT_LOCALE = "en";
|
|
3113
|
+
/** Common languages offered in the dashboard's language picker (any BCP 47 tag is accepted). */
|
|
3114
|
+
declare const COMMON_LOCALES: Array<{
|
|
3115
|
+
code: string;
|
|
3116
|
+
name: string;
|
|
3117
|
+
}>;
|
|
3118
|
+
declare function localeName(code: string): string;
|
|
3119
|
+
/** `fr_FR` / `FR-fr` → `fr-FR`; script subtags keep title case (`zh-hans` → `zh-Hans`). Invalid input → "". */
|
|
3120
|
+
declare function normalizeLocale(input: unknown): string;
|
|
3121
|
+
declare function baseLanguage(locale: string): string;
|
|
3122
|
+
/**
|
|
3123
|
+
* Picks the language to show: for each requested locale in order, an exact match among
|
|
3124
|
+
* `available`, else one sharing its base language (`fr-CA` → `fr`, `fr` → `fr-FR`). Falls back to
|
|
3125
|
+
* `defaultLocale`. Matching ignores case.
|
|
3126
|
+
*/
|
|
3127
|
+
declare function resolveLocale(requested: ReadonlyArray<string | null | undefined>, available: readonly string[], defaultLocale?: string): string;
|
|
3128
|
+
/** Locale candidates for a visitor: explicit option, traits (`language`, `locale`), then the platform's languages. */
|
|
3129
|
+
declare function visitorLocales(explicit: string | null | undefined, traits: Record<string, unknown> | null | undefined, platform?: ReadonlyArray<string | null | undefined>): string[];
|
|
3130
|
+
/** Every translatable text in a guide config, in display order. Empty texts are skipped. */
|
|
3131
|
+
declare function guideTextEntries(config: Pick<GuideConfig, "steps" | "checklist" | "survey">): TextEntry[];
|
|
3132
|
+
/** Locales a guide has any translation for. */
|
|
3133
|
+
declare function guideLocales(config: Pick<GuideConfig, "localization">): string[];
|
|
3134
|
+
/** The config with one language's translations applied (untranslated texts keep the default language). */
|
|
3135
|
+
declare function applyGuideTranslations<C extends Pick<GuideConfig, "steps" | "checklist" | "survey">>(config: C, map: Record<string, string> | undefined): C;
|
|
3136
|
+
/**
|
|
3137
|
+
* The guide as a visitor speaking `requested` should see it, with `locale` set to the language
|
|
3138
|
+
* chosen (the default language when none of the guide's translations match).
|
|
3139
|
+
*/
|
|
3140
|
+
declare function localizeGuide(guide: PublishedGuide, requested: readonly string[], defaultLocale?: string): PublishedGuide & {
|
|
3141
|
+
locale: string;
|
|
3142
|
+
};
|
|
3143
|
+
interface TranslationCoverage {
|
|
3144
|
+
locale: string;
|
|
3145
|
+
total: number;
|
|
3146
|
+
translated: number;
|
|
3147
|
+
/** Keys with no translation. */
|
|
3148
|
+
missing: string[];
|
|
3149
|
+
/** Keys whose translation exists but whose key no longer matches any text (stale). */
|
|
3150
|
+
stale: string[];
|
|
3151
|
+
}
|
|
3152
|
+
declare function translationCoverage(entries: readonly TextEntry[], map: Record<string, string> | undefined, locale: string): TranslationCoverage;
|
|
3153
|
+
/** Translations carried by the published resource center (texts other than articles and announcements). */
|
|
3154
|
+
type ResourceCenterTranslations = Record<string, Record<string, string>>;
|
|
3155
|
+
/** Translatable resource-center texts (title, launcher label, links, FAQs, collections). */
|
|
3156
|
+
declare function resourceCenterTextEntries(rc: Pick<ResourceCenterConfig, "title" | "launcher" | "links" | "faqs" | "collections">): TextEntry[];
|
|
3157
|
+
/** Article texts, keyed `title` / `summary` / `body`. */
|
|
3158
|
+
declare function articleTextEntries(a: {
|
|
3159
|
+
title: string;
|
|
3160
|
+
summary?: string | null;
|
|
3161
|
+
body?: string | null;
|
|
3162
|
+
}): TextEntry[];
|
|
3163
|
+
/** Locales the resource center offers (its own strings, articles or announcements). */
|
|
3164
|
+
declare function resourceCenterLocales(rc: ResourceCenterConfig): string[];
|
|
3165
|
+
declare function localizeArticle(a: ResourceCenterArticle, locale: string): ResourceCenterArticle;
|
|
3166
|
+
declare function localizeAnnouncement(a: ResourceCenterAnnouncement, locale: string): ResourceCenterAnnouncement;
|
|
3167
|
+
/** The resource center in the visitor's language (with `locale` = the language chosen). */
|
|
3168
|
+
declare function localizeResourceCenter(rc: ResourceCenterConfig, requested: readonly string[], defaultLocale?: string): ResourceCenterConfig & {
|
|
3169
|
+
locale: string;
|
|
3170
|
+
};
|
|
3171
|
+
|
|
3172
|
+
/** The "no guide" variant: visitors in it see nothing, and are measured against the guide variants. */
|
|
3173
|
+
declare const CONTROL_VARIANT_ID = "control";
|
|
3174
|
+
declare const GUIDE_EXPERIMENT_STATUSES: readonly ["draft", "running", "completed"];
|
|
3175
|
+
type GuideExperimentStatus = (typeof GUIDE_EXPERIMENT_STATUSES)[number];
|
|
3176
|
+
declare const GUIDE_EXPERIMENT_GOALS: readonly ["guide_completed", "event", "page_visit", "click_text"];
|
|
3177
|
+
type GuideExperimentGoalKind = (typeof GUIDE_EXPERIMENT_GOALS)[number];
|
|
3178
|
+
declare const GUIDE_EXPERIMENT_GOAL_LABELS: Record<GuideExperimentGoalKind, string>;
|
|
3179
|
+
interface GuideExperimentGoal {
|
|
3180
|
+
kind: GuideExperimentGoalKind;
|
|
3181
|
+
/** Event name, page path pattern (`/billing/*`) or click text, depending on `kind`. */
|
|
3182
|
+
value?: string;
|
|
3183
|
+
}
|
|
3184
|
+
interface GuideExperimentVariant {
|
|
3185
|
+
id: string;
|
|
3186
|
+
name: string;
|
|
3187
|
+
/** The guide shown to this variant; null for the control group (no guide). */
|
|
3188
|
+
guideId: string | null;
|
|
3189
|
+
/** Share of visitors, a whole percentage; all weights sum to 100. */
|
|
3190
|
+
weight: number;
|
|
3191
|
+
}
|
|
3192
|
+
declare function experimentSalt(experimentId: string): string;
|
|
3193
|
+
/** Bucket ranges `[from, to)` per variant, in order. */
|
|
3194
|
+
declare function variantRanges(variants: ReadonlyArray<Pick<GuideExperimentVariant, "id" | "weight">>): Array<{
|
|
3195
|
+
id: string;
|
|
3196
|
+
from: number;
|
|
3197
|
+
to: number;
|
|
3198
|
+
}>;
|
|
3199
|
+
/** The variant a visitor is in, or null when weights leave their bucket unassigned. */
|
|
3200
|
+
declare function assignGuideVariant(variants: ReadonlyArray<Pick<GuideExperimentVariant, "id" | "weight">>, experimentId: string, subject: string): string | null;
|
|
3201
|
+
/** Rules restricting targeting to bucket range `[from, to)` of `salt`. */
|
|
3202
|
+
declare function experimentBucketRules(salt: string, from: number, to: number): Rule[];
|
|
3203
|
+
/** Targeting with a variant's bucket range folded in (an SDK without `experiment.bucket` shows the guide to nobody). */
|
|
3204
|
+
declare function withExperimentBucket(targeting: RuleGroup, salt: string, from: number, to: number): RuleGroup;
|
|
3205
|
+
/** Problems with a variant list; empty when it can run. */
|
|
3206
|
+
declare function variantProblems(variants: ReadonlyArray<GuideExperimentVariant>): string[];
|
|
3207
|
+
/** Splits 100% as evenly as possible across `n` variants (first ones get the remainder). */
|
|
3208
|
+
declare function evenWeights(n: number): number[];
|
|
3209
|
+
|
|
3210
|
+
/**
|
|
3211
|
+
* Custom CSS for guides and themes (zod-free; the server sanitizes on save, the web runtime
|
|
3212
|
+
* sanitizes again and scopes before injecting).
|
|
3213
|
+
*
|
|
3214
|
+
* Guides render inside the SDK's Shadow DOM, so page styles and guide styles never mix. Within the
|
|
3215
|
+
* shadow root, every rule is additionally prefixed with the guide's own container selector, so one
|
|
3216
|
+
* guide's CSS can't restyle another guide, the resource center or the messenger. Sanitizing removes
|
|
3217
|
+
* what could reach outside the container or load anything: `@import`, `:host` / `::slotted` rules,
|
|
3218
|
+
* `url()`s other than https images and `data:image/…`, legacy script hooks (`expression()`,
|
|
3219
|
+
* `behavior`, `-moz-binding`, `javascript:`) and any markup.
|
|
3220
|
+
*/
|
|
3221
|
+
declare const MAX_CUSTOM_CSS = 20000;
|
|
3222
|
+
/** Removes everything unsafe; keeps the rule structure. */
|
|
3223
|
+
declare function sanitizeCustomCss(input: string | null | undefined): string;
|
|
3224
|
+
/**
|
|
3225
|
+
* Prefixes every selector with `scope` (e.g. `.g-scope[data-guide="abc"]`). `:root`, `html`,
|
|
3226
|
+
* `body`, `:scope` and `&` at the start of a selector refer to the container itself.
|
|
3227
|
+
*/
|
|
3228
|
+
declare function scopeCustomCss(css: string, scope: string): string;
|
|
3229
|
+
|
|
3230
|
+
/**
|
|
3231
|
+
* WCAG 2.1 colour contrast (zod-free). The editor warns when a guide's colours fall below AA:
|
|
3232
|
+
* 4.5:1 for body text, 3:1 for large text and UI components (button outlines, the close icon).
|
|
3233
|
+
*/
|
|
3234
|
+
declare const WCAG_AA_TEXT = 4.5;
|
|
3235
|
+
declare const WCAG_AA_LARGE = 3;
|
|
3236
|
+
/** `#rgb` / `#rrggbb` → [r, g, b]; null when not a hex colour. */
|
|
3237
|
+
declare function parseHexColor(hex: string | null | undefined): [number, number, number] | null;
|
|
3238
|
+
declare function relativeLuminance(hex: string): number | null;
|
|
3239
|
+
/** Contrast ratio 1–21 between two hex colours, or null when either is not a hex colour. */
|
|
3240
|
+
declare function contrastRatio(a: string, b: string): number | null;
|
|
3241
|
+
/** Text colour (black or white) with the better contrast on `background`. */
|
|
3242
|
+
declare function readableTextOn(background: string): "#ffffff" | "#111827";
|
|
3243
|
+
interface ContrastIssue {
|
|
3244
|
+
/** What is hard to read. */
|
|
3245
|
+
pair: "text" | "button" | "link";
|
|
3246
|
+
ratio: number;
|
|
3247
|
+
required: number;
|
|
3248
|
+
message: string;
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* Contrast problems of a guide's effective colours (guide appearance over the project theme).
|
|
3252
|
+
* Buttons use white or dark text, whichever reads better, so only a mid-tone primary colour fails.
|
|
3253
|
+
*/
|
|
3254
|
+
declare function contrastIssues(colors: {
|
|
3255
|
+
primaryColor?: string;
|
|
3256
|
+
backgroundColor?: string;
|
|
3257
|
+
textColor?: string;
|
|
3258
|
+
}): ContrastIssue[];
|
|
3259
|
+
|
|
3260
|
+
export { CapturedElementSchema as $, ADVANCE_ON as A, type AttrTest as B, type AuthoringPick as C, AuthoringPickSchema as D, type AuthoringSessionInfo as E, type AutocaptureSettings as F, type GuideKind as G, AutocaptureSettingsSchema as H, BUTTON_ACTIONS as I, type Breadcrumb as J, type BugReportInput as K, type BugReportResponse as L, ButtonSchema as M, CAPTURE_PARAM as N, CAPTURE_SCREENSHOT_MAX_BYTES as O, COMMON_LOCALES as P, COMPLAINT_EVENTS as Q, type RuleGroup as R, COMPLAINT_FIELD_TYPES as S, COMPLAINT_STATUSES as T, CONTROL_VARIANT_ID as U, type CaptureSessionInfo as V, type CaptureSettings as W, type CaptureStep as X, type CaptureStepInput as Y, CaptureStepSchema as Z, type CapturedElement as _, type Rule as a, type GuideExperimentGoal as a$, type ChecklistConfig as a0, ChecklistConfigSchema as a1, type ChecklistProgressRequest as a2, ChecklistProgressRequestSchema as a3, type ChecklistTask as a4, ChecklistTaskSchema as a5, type ClickFacts as a6, type ComplaintEvent as a7, type ComplaintField as a8, type ComplaintFieldType as a9, FEATURE_ATTRIBUTE_PATTERN as aA, FEATURE_RULE_LIMITS as aB, FEEDBACK_EVENTS as aC, FEEDBACK_PRIORITIES as aD, FEEDBACK_PRIORITY_LABEL as aE, FEEDBACK_PRIORITY_WEIGHT as aF, FEEDBACK_STATUSES as aG, FEEDBACK_STATUS_LABEL as aH, FILE_LINK_CLASS as aI, type FeatureRule as aJ, type FeedbackEvent as aK, type FeedbackPriority as aL, type FeedbackStatus as aM, type FeedbackUpdate as aN, type FeedbackUpdatesResponse as aO, type FileComplaintResponse as aP, type FrequencyConfig as aQ, FrequencySchema as aR, GUIDELY_ID_ATTRIBUTE as aS, GUIDE_EXPERIMENT_GOALS as aT, GUIDE_EXPERIMENT_GOAL_LABELS as aU, GUIDE_EXPERIMENT_STATUSES as aV, GUIDE_KINDS as aW, GUIDE_STATUSES as aX, GUIDE_VISIBILITIES as aY, type GuideConfig as aZ, GuideConfigSchema as a_, type ComplaintStatus as aa, type ComplexSelector as ab, type Compound as ac, type ContrastIssue as ad, type ConversationLookupResponse as ae, ConversationLookupSchema as af, type ConversationMessagesResponse as ag, ConversationRatingSchema as ah, type ConversationStatus as ai, DEFAULT_CAPTURE_SETTINGS as aj, DEFAULT_FEATURE_ATTRIBUTE as ak, DEFAULT_LOCALE as al, DEFAULT_PLATFORMS as am, type DetailException as an, type DetailFrame as ao, type DetailMechanism as ap, EMBED_IFRAME_ATTRS as aq, type ElementNode as ar, type ElementSnapshot as as, type EmbedProvider as at, type ErrorFilterPattern as au, type ErrorLevelName as av, type ErrorTrackingSettings as aw, ErrorTrackingSettingsSchema as ax, type ExceptionDetail as ay, type ExceptionProperties as az, type GuideConfigInput as b, MEDIA_MAX_BYTES as b$, type GuideExperimentGoalKind as b0, type GuideExperimentStatus as b1, type GuideExperimentVariant as b2, type GuideHoldout as b3, type GuideLocalization as b4, GuideLocalizationSchema as b5, type GuideSchedule as b6, GuideScheduleSchema as b7, GuideStateUpdateSchema as b8, type GuideStatus as b9, MAX_BUG_REPORT_LENGTH as bA, MAX_BUG_REPORT_SCREENSHOT_BYTES as bB, MAX_COLLECTION_DEPTH as bC, MAX_COMPLAINT_ANSWER_LENGTH as bD, MAX_COMPLAINT_ATTACHMENT_BYTES as bE, MAX_COMPLAINT_CHOICES as bF, MAX_COMPLAINT_FIELDS as bG, MAX_COMPLAINT_LENGTH as bH, MAX_CUSTOM_CSS as bI, MAX_DEBUG_IMAGES as bJ, MAX_DETAIL_FRAMES as bK, MAX_DETAIL_THREADS as bL, MAX_ERROR_TAGS as bM, MAX_EXCEPTION_CHAIN as bN, MAX_EXCEPTION_DETAIL_BYTES as bO, MAX_EXCEPTION_DETAIL_RAW_BYTES as bP, MAX_FEEDBACK_COMMENT as bQ, MAX_FEEDBACK_DESCRIPTION as bR, MAX_FEEDBACK_NOTE as bS, MAX_FEEDBACK_TITLE as bT, MAX_MESSAGE_LENGTH as bU, MAX_PROPERTY_BYTES as bV, MAX_STACK_FRAMES as bW, MEDIA_FILE_MAX_BYTES as bX, MEDIA_FILE_TYPES as bY, MEDIA_IMAGE_MAX_BYTES as bZ, MEDIA_IMAGE_TYPES as b_, type GuideStep as ba, type GuideStepInput as bb, GuideThrottlingSchema as bc, type GuideThrottlingSettings as bd, type GuideVisibility as be, HEATMAP_VIEWPORTS as bf, HOWTO_ACTIONS as bg, HOWTO_STEP_KINDS as bh, type HeatmapPoint as bi, type HeatmapProperties as bj, type HeatmapViewport as bk, type HowToAction as bl, type HowToAnnotation as bm, HowToAnnotationSchema as bn, type HowToStepKind as bo, type IdentifyRequest as bp, IdentifyRequestSchema as bq, type IdentifyResponse as br, LOCALE_PATTERN as bs, LOGGED_IN_AUDIENCE as bt, LocaleSchema as bu, type LocalizationSettings as bv, LocalizationSettingsSchema as bw, MAX_ANNOTATIONS as bx, MAX_APP_VERSION_LENGTH as by, MAX_BREADCRUMBS as bz, AGENT_METADATA_MAX_BYTES as c, REPLY_TIMES as c$, MEDIA_VIDEO_MAX_BYTES as c0, MEDIA_VIDEO_TYPES as c1, MESSAGE_AUTHORS as c2, type MediaContentType as c3, type MediaKind as c4, type MessageAuthor as c5, type MessengerCitation as c6, type MessengerComplaint as c7, type MessengerComplaintCategory as c8, type MessengerComplaintOffer as c9, PDF_MAX_PAGES as cA, PDF_PAGES_CLASS as cB, PLACEMENTS as cC, PLATFORMS as cD, type PageContext as cE, type PagePattern as cF, type PageRule as cG, type PerformanceSettings as cH, PerformanceSettingsSchema as cI, type Placement as cJ, type Platform as cK, PostMessageSchema as cL, type ProjectTheme as cM, ProjectThemeSchema as cN, type PublicFeedbackComment as cO, type PublicFeedbackList as cP, type PublicFeedbackRequest as cQ, type PublicFeedbackRequestDetail as cR, type PublishedGuide as cS, PublishedGuideSchema as cT, type QueryParamCondition as cU, type QueryParamOp as cV, RC_MODULE_IDS as cW, RC_MODULE_LABELS as cX, RECORDING_LEVELS as cY, REPLAY_MAX_COMPRESSED_BYTES as cZ, REPLAY_MAX_RAW_BYTES as c_, type MessengerComplaintsConfig as ca, type MessengerConfig as cb, type MessengerConversation as cc, type MessengerHomeCards as cd, type MessengerHowToCitation as ce, type MessengerIdeaOffer as cf, type MessengerIdeasConfig as cg, type MessengerMessage as ch, type MessengerPageContent as ci, type MessengerPageRequest as cj, MessengerPageRequestSchema as ck, type MessengerPageSuggestion as cl, type MessengerStatus as cm, type MessengerSuggestedGuide as cn, type MessengerTeammate as co, NETWORK_PLUGIN as cp, NOISY_DATA_ATTR as cq, type NetworkPluginPayload as cr, type NetworkRequest as cs, type NetworkRequestType as ct, NormalizedPointSchema as cu, type NormalizedRect as cv, NormalizedRectSchema as cw, PAGE_RULE_LIMITS as cx, PATH_ID_PATTERN as cy, PDF_BLOCK_CLASS as cz, AGENT_METADATA_MAX_KEYS as d, type SurveyQuestion as d$, RULE_FIELDS as d0, RULE_OPERATORS as d1, type RcArticleLike as d2, type RcCollectionLike as d3, type RcSection as d4, type RecordingLevel as d5, type ReplayChunk as d6, ReplayChunkSchema as d7, type ReplaySettings as d8, ReplaySettingsSchema as d9, type ScoutStreamEvent as dA, type SdkArticleSummary as dB, type SdkArticlesResponse as dC, type SdkConfigResponse as dD, type SdkHowTo as dE, type SdkHowToStep as dF, type SdkHowToSummary as dG, type SdkHowTosResponse as dH, type SelectorOp as dI, type SelectorStrategy as dJ, SelectorStrategySchema as dK, SelectorSyntaxError as dL, type ShowWhen as dM, type StackFrame as dN, type StartConversationRequest as dO, type StartConversationResponse as dP, StartConversationSchema as dQ, type StatusLevel as dR, StepBranchSchema as dS, type StepButton as dT, StepSchema as dU, type StepTarget as dV, type StepType as dW, type SurveyAnswer as dX, type SurveyAnswers as dY, type SurveyConfig as dZ, SurveyConfigSchema as d_, type ReplyTime as da, type ResourceCenterAnnouncement as db, type ResourceCenterArticle as dc, type ResourceCenterCollection as dd, type ResourceCenterConfig as de, type ResourceCenterModule as df, type ResourceCenterModuleId as dg, type ResourceCenterTranslations as dh, type RuleField as di, type RuleOperator as dj, SCOUT_AGENT_ID as dk, SELECTOR_KINDS as dl, SENSITIVE_HEADER_PATTERN as dm, SENSITIVE_PARAM_PATTERN as dn, SENSITIVE_PROPERTY_PATTERN as dp, SERVER_ASSISTED_FIELDS as dq, SHOW_ME_CLASS as dr, SHOW_ME_HREF_PREFIX as ds, SNAPSHOT_ATTRS as dt, SNAPSHOT_LIMITS as du, SOURCEMAP_MAX_FILES_PER_UPLOAD as dv, SOURCEMAP_MAX_FILE_BYTES as dw, STATUS_LEVELS as dx, STEP_TYPES as dy, SURVEY_QUESTION_TYPES as dz, AGENT_OUTCOMES as e, guideTextEntries as e$, SurveyQuestionSchema as e0, type SurveyResponseRequest as e1, SurveyResponseRequestSchema as e2, TAG_PROPERTY_LIMITS as e3, TRIGGER_TYPES as e4, type TagPropertyConfig as e5, type TagPropertyDefinition as e6, type TaggingSdkConfig as e7, TargetSchema as e8, type TargetingContext as e9, compoundMatches as eA, contrastIssues as eB, contrastRatio as eC, cssSelectorError as eD, customFingerprint as eE, defaultGuideConfig as eF, defaultStep as eG, describeCaptureStep as eH, describeRule as eI, emptyRuleGroup as eJ, errorFilterDrops as eK, evaluateRule as eL, evaluateRules as eM, evenWeights as eN, experimentBucketRules as eO, experimentSalt as eP, featureCssSelectors as eQ, featureRuleError as eR, featureRuleMatchesClick as eS, feedbackReference as eT, fingerprintError as eU, firstNameFromTraits as eV, fnv1a as eW, foldPathIds as eX, getPath as eY, guideLocales as eZ, guidePlatforms as e_, type TextEntry as ea, type TextKind as eb, type TranslationCoverage as ec, type TranslationReviewMap as ed, type TranslationReviewState as ee, type TriggerConfig as ef, TriggerSchema as eg, VIDEO_ATTRS as eh, type ValidationIssue as ei, type VideoEmbed as ej, WCAG_AA_LARGE as ek, WCAG_AA_TEXT as el, WS_MAX_MESSAGES_PER_SOCKET as em, WS_MAX_MESSAGE_BYTES as en, type WebSocketMessage as eo, applyGuideTranslations as ep, articleHref as eq, articleIdFromHref as er, articleTextEntries as es, assignGuideVariant as et, baseLanguage as eu, clamp as ev, cleanLabel as ew, compare as ex, compareVersions as ey, complaintReference as ez, AGENT_TOOL_CALLS_PER_TURN as f, showMeKeys as f$, guidelyIdFromSelector as f0, hasVideoMedia as f1, isAllowedEmbedSrc as f2, isArticleListed as f3, isChecklistComplete as f4, isFileLink as f5, isMediaContentType as f6, isPlainObject as f7, isQuestionVisible as f8, isRuleGroup as f9, pageRuleMatches as fA, pageRulesMatch as fB, pageTerms as fC, parseCssSelector as fD, parseHexColor as fE, parseStack as fF, propertyAttributeAllowed as fG, queryConditionRegex as fH, randomId as fI, reactNativeBundleUrl as fJ, readableTextOn as fK, recordingLevel as fL, relativeLuminance as fM, resolveCaptureSettings as fN, resolveLocale as fO, resourceCenterLocales as fP, resourceCenterSections as fQ, resourceCenterTextEntries as fR, rolloutBucket as fS, safeRegExp as fT, sanitizeCustomCss as fU, sanitizeProperties as fV, scopeCustomCss as fW, screenPath as fX, servedArticleAudiences as fY, showMeHref as fZ, showMeKeyFromHref as f_, isSafeMediaUrl as fa, isVideoContentType as fb, isVideoFileUrl as fc, localeName as fd, localizeAnnouncement as fe, localizeArticle as ff, localizeGuide as fg, localizeResourceCenter as fh, matchCssSelector as fi, matchUrlPattern as fj, matchesAudiences as fk, matchesHelpQuery as fl, mediaKind as fm, mediaMaxBytes as fn, needsReview as fo, normalizeAppVersion as fp, normalizeErrorMessage as fq, normalizeFrameFile as fr, normalizeLocale as fs, normalizeSnapshot as ft, normalizeTags as fu, orderedModules as fv, pageLabel as fw, pageName as fx, pagePattern as fy, pageRuleError as fz, AGENT_TOOL_STATUSES as g, slugify as g0, snapshotFromSelector as g1, stableStringify as g2, stepVideo as g3, stripOrigin as g4, supportsPlatform as g5, toEmbedUrl as g6, translationCoverage as g7, trimExceptionDetail as g8, unreadAnnouncements as g9, validateGuideConfig as ga, variantProblems as gb, variantRanges as gc, videoThumbnailUrl as gd, visibleAnnouncements as ge, visibleArticleIds as gf, visibleButtons as gg, visitorAudiences as gh, visitorLocales as gi, withExperimentBucket as gj, withRecordingLevel as gk, withVisibility as gl, AGENT_TURNS_PER_BATCH as h, AGENT_TURN_MAX_TEXT as i, AGENT_TURN_ROLES as j, ANNOTATION_COLORS as k, ARTICLE_HREF_PREFIX as l, ARTICLE_VISIBILITIES as m, type AgentEventsResponse as n, type AgentOutcome as o, type AgentToolCallInput as p, type AgentToolStatus as q, type AgentTurnInput as r, type AgentTurnRole as s, type AnnotationColor as t, type ApiError as u, type AppSnapshot as v, type Appearance as w, AppearanceSchema as x, type ArticleVisibility as y, type AttrOp as z };
|