@guidelytech/sdk-core 0.10.0 → 0.11.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/{capture-DVJyQ2JZ.d.cts → capture-CgN69Lxq.d.cts} +2 -2
- package/dist/{capture-369s4YYT.d.ts → capture-Csz721-A.d.ts} +2 -2
- package/dist/capture.cjs +2 -0
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.d.cts +3 -3
- package/dist/capture.d.ts +3 -3
- package/dist/capture.js +1 -1
- package/dist/{chunk-C4WWSF67.js → chunk-JUSM7J5N.js} +3 -1
- package/dist/{chunk-C4WWSF67.js.map → chunk-JUSM7J5N.js.map} +1 -1
- package/dist/{chunk-GDJB466J.js → chunk-ZAF2KRJA.js} +29 -6
- package/dist/chunk-ZAF2KRJA.js.map +1 -0
- package/dist/headless.cjs +32 -4
- package/dist/headless.cjs.map +1 -1
- package/dist/headless.d.cts +6 -5
- package/dist/headless.d.ts +6 -5
- package/dist/headless.js +9 -3
- package/dist/{health-DFHUstWd.d.cts → health-sbP9JwTE.d.cts} +2 -0
- package/dist/{health-DFHUstWd.d.ts → health-sbP9JwTE.d.ts} +2 -0
- package/dist/{http-D0dCcpLN.d.cts → http-Cb6KYYFv.d.cts} +1 -1
- package/dist/{http-DJd8jRhK.d.ts → http-D047Ngxk.d.ts} +1 -1
- package/dist/index.cjs +1632 -1045
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -9
- package/dist/index.d.ts +77 -9
- package/dist/index.js +760 -201
- package/dist/index.js.map +1 -1
- package/dist/recorder.cjs.map +1 -1
- package/dist/recorder.d.cts +1 -1
- package/dist/recorder.d.ts +1 -1
- package/dist/recorder.js +1 -1
- package/dist/{types-B5ecgHUV.d.cts → types-BDlebXrm.d.ts} +59 -5
- package/dist/{types-BtPovimB.d.ts → types-Mtlmlj5C.d.cts} +59 -5
- package/package.json +4 -4
- package/dist/chunk-GDJB466J.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as _guidelytech_guide_runtime from '@guidelytech/guide-runtime';
|
|
2
2
|
import { TargetingContext, PublishedGuide, ProjectTheme, SelectorStrategy, AuthoringPick, AppSnapshot } from '@guidelytech/shared';
|
|
3
|
-
export { AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
|
|
3
|
+
export { AgentEventsResponse, AgentOutcome, AgentToolCallInput, AgentTurnInput, AgentTurnRole, AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
|
|
4
4
|
import { FlagsClient, JsonValue, FlagValue, FlagDetails } from '@guidelytech/flags';
|
|
5
5
|
export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, JsonValue } from '@guidelytech/flags';
|
|
6
6
|
import { MessengerTab } from '@guidelytech/guide-runtime/messenger';
|
|
7
|
-
import {
|
|
8
|
-
export { E as EventQueue, b as EventQueueOptions, m as GuideStepInfo, d as GuidelyEnvironment, n as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, i as isExclusiveGuide, h as isFrequencyEligible, j as isWithinSchedule } from './types-B5ecgHUV.cjs';
|
|
9
|
-
export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-DFHUstWd.cjs';
|
|
10
|
-
export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-DVJyQ2JZ.cjs';
|
|
7
|
+
import { AgentTurnInput } from '@guidelytech/shared/runtime';
|
|
11
8
|
export { CAPTURE_PARAM } from '@guidelytech/shared/runtime';
|
|
12
|
-
import './
|
|
9
|
+
import { m as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, n as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-Mtlmlj5C.cjs';
|
|
10
|
+
export { A as AgentTurnRedactor, E as EventQueue, b as EventQueueOptions, o as GuideStepInfo, d as GuidelyEnvironment, q as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, g as countsTowardThrottle, i as isExclusiveGuide, j as isFrequencyEligible, k as isThrottleEligible, l as isWithinSchedule, p as pruneLaunches } from './types-Mtlmlj5C.cjs';
|
|
11
|
+
export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-sbP9JwTE.cjs';
|
|
12
|
+
export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-CgN69Lxq.cjs';
|
|
13
|
+
import './http-Cb6KYYFv.cjs';
|
|
13
14
|
|
|
14
15
|
declare const SDK_NAME = "@guidelytech/sdk-core";
|
|
15
|
-
declare const SDK_VERSION = "0.
|
|
16
|
+
declare const SDK_VERSION = "0.11.0";
|
|
16
17
|
declare const DEFAULT_API_URL = "https://api.guidely.app";
|
|
17
18
|
/**
|
|
18
19
|
* Framework-independent Guidely client. Create one per page with {@link createGuidely} or
|
|
@@ -27,6 +28,8 @@ declare class GuidelyClient {
|
|
|
27
28
|
private readonly queue;
|
|
28
29
|
/** Survey answers and guide/checklist progress, kept until the server accepts them. */
|
|
29
30
|
private readonly outbox;
|
|
31
|
+
/** Agent Analytics turns (agentConversation), in their own outbox. */
|
|
32
|
+
private readonly agentTurns;
|
|
30
33
|
private config;
|
|
31
34
|
private etag;
|
|
32
35
|
private anonymousId;
|
|
@@ -75,6 +78,10 @@ declare class GuidelyClient {
|
|
|
75
78
|
readonly flags: FlagsClient;
|
|
76
79
|
/** Experiments already reported this session (`experiment_viewed` is sent once per session). */
|
|
77
80
|
private exposures;
|
|
81
|
+
/** Language set with `setLocale()`. */
|
|
82
|
+
private locale;
|
|
83
|
+
/** Language each shown guide was rendered in; added to its events as `locale`. */
|
|
84
|
+
private guideLocales;
|
|
78
85
|
constructor(options: GuidelyOptions);
|
|
79
86
|
private createFlags;
|
|
80
87
|
/** Loads config (cache first, then network), wires listeners and evaluates triggers. Idempotent. */
|
|
@@ -109,8 +116,18 @@ declare class GuidelyClient {
|
|
|
109
116
|
private enqueue;
|
|
110
117
|
/** Tracks a custom event. Events drive `event` triggers, `advanceOn: "event"` steps and checklist tasks. */
|
|
111
118
|
track(name: string, properties?: Record<string, unknown>): void;
|
|
119
|
+
/**
|
|
120
|
+
* Agent Analytics: records one or more turns of a conversation with your own AI agent or chatbot
|
|
121
|
+
* (`{ conversationId, agentId, role, text, toolCalls?, latencyMs?, outcome?, … }`). The visitor's
|
|
122
|
+
* anonymous id, user id, account id and session id are filled in, `agents.redact` from the init
|
|
123
|
+
* options runs on each turn, and turns are retried until Guidely accepts them. Returns false when
|
|
124
|
+
* nothing was queued (analytics off or consent denied, or every turn was invalid or dropped).
|
|
125
|
+
*/
|
|
126
|
+
agentConversation(turns: AgentTurnInput | AgentTurnInput[]): boolean;
|
|
127
|
+
/** Alias of {@link agentConversation}. */
|
|
128
|
+
trackAgentTurn(turns: AgentTurnInput | AgentTurnInput[]): boolean;
|
|
112
129
|
/** Records a page view and re-evaluates triggers. Called automatically on SPA navigation. */
|
|
113
|
-
page(
|
|
130
|
+
page(href?: string): void;
|
|
114
131
|
private readonly customListeners;
|
|
115
132
|
private readonly eventBus;
|
|
116
133
|
private handleNavigation;
|
|
@@ -160,9 +177,27 @@ declare class GuidelyClient {
|
|
|
160
177
|
isRecording(): boolean;
|
|
161
178
|
/** The current analytics session id (rotates after inactivity; also the replay id). */
|
|
162
179
|
getSessionId(): string;
|
|
180
|
+
/** The page URL Guidely works with: `options.pageUrl`, else app-relative for `file:` / custom protocols (`normalizeAppUrl`). */
|
|
181
|
+
pageHref(href?: string): string;
|
|
163
182
|
/** Builds the targeting context for the current moment. */
|
|
164
183
|
getContext(): TargetingContext;
|
|
165
184
|
private isTargeted;
|
|
185
|
+
/** Guide throttling: may this guide launch automatically now? */
|
|
186
|
+
private throttleAllows;
|
|
187
|
+
private recordLaunch;
|
|
188
|
+
/** Guides and A/B test control groups, which are evaluated the same way but never render. */
|
|
189
|
+
private candidates;
|
|
190
|
+
private holdoutFor;
|
|
191
|
+
/** The visitor's language candidates, most preferred first. */
|
|
192
|
+
private locales;
|
|
193
|
+
private defaultLocale;
|
|
194
|
+
/** The guide in the visitor's language (remembered so its events carry `locale`). */
|
|
195
|
+
private localize;
|
|
196
|
+
/**
|
|
197
|
+
* Sets the language for guides and the resource center (`null` = back to the traits / browser).
|
|
198
|
+
* Guides already on screen keep their language; the resource center re-renders.
|
|
199
|
+
*/
|
|
200
|
+
setLocale(locale: string | null): void;
|
|
166
201
|
private isEligible;
|
|
167
202
|
private triggerFires;
|
|
168
203
|
private evaluate;
|
|
@@ -189,6 +224,8 @@ declare class GuidelyClient {
|
|
|
189
224
|
/** What the messenger personalises from, computed fresh on every render. */
|
|
190
225
|
private messengerVisitor;
|
|
191
226
|
private destroyMessenger;
|
|
227
|
+
/** The resource center's language for this visitor, or null for the default language. */
|
|
228
|
+
private rcLocale;
|
|
192
229
|
private loadArticle;
|
|
193
230
|
private searchResourceCenter;
|
|
194
231
|
/** Current progress for a checklist guide (by id or key). */
|
|
@@ -219,11 +256,22 @@ declare class GuidelyClient {
|
|
|
219
256
|
/** Opens the Scout messenger (when enabled for the project), optionally on a tab. */
|
|
220
257
|
openMessenger(tab?: MessengerTab): void;
|
|
221
258
|
closeMessenger(): void;
|
|
259
|
+
/**
|
|
260
|
+
* Opens a Guidely prototype test (its `/validate/<token>` URL on this SDK's API origin, or the bare
|
|
261
|
+
* token) in a full-screen overlay, attributed to the current user. Returns false, doing nothing, for
|
|
262
|
+
* any other URL. Guide buttons that open a test URL use this automatically.
|
|
263
|
+
*/
|
|
264
|
+
openPrototypeTest(urlOrToken: string): boolean;
|
|
222
265
|
/**
|
|
223
266
|
* Opens the complaint form in the messenger, optionally with a category picked (its id from
|
|
224
267
|
* Complaints → Categories). Does nothing when the project doesn't take complaints.
|
|
225
268
|
*/
|
|
226
269
|
openComplaint(categoryId?: string): void;
|
|
270
|
+
/**
|
|
271
|
+
* Opens the Ideas tab in the messenger (feature requests and voting), or one idea by its id.
|
|
272
|
+
* Does nothing when the project hasn't turned on Ideas.
|
|
273
|
+
*/
|
|
274
|
+
openIdeas(requestId?: string): void;
|
|
227
275
|
/** Opens a new messenger conversation, optionally pre-filling the message. */
|
|
228
276
|
showNewMessage(text?: string): void;
|
|
229
277
|
/** Boolean flag value for the current user; `fallback` (default `false`) until loaded or when missing. */
|
|
@@ -335,6 +383,10 @@ type Listener = (url: string) => void;
|
|
|
335
383
|
*/
|
|
336
384
|
declare function watchNavigation(listener: Listener, debounceMs?: number): () => void;
|
|
337
385
|
|
|
386
|
+
declare function normalizeAppUrl(href: string): string;
|
|
387
|
+
/** True for desktop-shell URLs (`file:`, custom protocols such as `app:`), which {@link normalizeAppUrl} makes app-relative. */
|
|
388
|
+
declare function isAppUrl(href: string): boolean;
|
|
389
|
+
|
|
338
390
|
declare const AUTHORING_PARAM = "guidely_authoring";
|
|
339
391
|
declare const HEARTBEAT_MS = 15000;
|
|
340
392
|
/** Messages the SDK posts to the dashboard window (`window.opener`). */
|
|
@@ -424,6 +476,22 @@ interface PageLeaveInfo {
|
|
|
424
476
|
scrollDepth: number;
|
|
425
477
|
}
|
|
426
478
|
|
|
479
|
+
/**
|
|
480
|
+
* In-app recruitment for Guidely prototype tests (Validate). A guide button that opens a Guidely test URL
|
|
481
|
+
* (`<apiOrigin>/validate/<token>`, same origin as the SDK's API) shows the test in a full-screen overlay
|
|
482
|
+
* iframe instead of navigating away. Attribution (public key, anonymous id, user id) goes in the URL
|
|
483
|
+
* fragment, so it never reaches servers, proxies or logs; the test page reads and clears it.
|
|
484
|
+
*
|
|
485
|
+
* The overlay is a modal dialog: focus moves into it and is trapped between the close button and the
|
|
486
|
+
* test frame, Escape closes it, and it closes when the test page posts `{ type: "guidely:prototype:close" }`.
|
|
487
|
+
*/
|
|
488
|
+
declare const PROTOTYPE_CLOSE_MESSAGE = "guidely:prototype:close";
|
|
489
|
+
/**
|
|
490
|
+
* The test URL for a full test URL or a bare token, when it points at this Guidely deployment's
|
|
491
|
+
* `/validate/<token>` page; null for anything else (other origins and paths keep their normal behaviour).
|
|
492
|
+
*/
|
|
493
|
+
declare function matchPrototypeTestUrl(urlOrToken: string, apiUrl: string): URL | null;
|
|
494
|
+
|
|
427
495
|
/**
|
|
428
496
|
* @guidelytech/sdk-core — framework-independent Guidely browser SDK.
|
|
429
497
|
*
|
|
@@ -439,4 +507,4 @@ declare const Guidely: {
|
|
|
439
507
|
version: string;
|
|
440
508
|
};
|
|
441
509
|
|
|
442
|
-
export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, watchNavigation };
|
|
510
|
+
export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, PROTOTYPE_CLOSE_MESSAGE, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, isAppUrl, matchPrototypeTestUrl, normalizeAppUrl, watchNavigation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import * as _guidelytech_guide_runtime from '@guidelytech/guide-runtime';
|
|
2
2
|
import { TargetingContext, PublishedGuide, ProjectTheme, SelectorStrategy, AuthoringPick, AppSnapshot } from '@guidelytech/shared';
|
|
3
|
-
export { AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
|
|
3
|
+
export { AgentEventsResponse, AgentOutcome, AgentToolCallInput, AgentTurnInput, AgentTurnRole, AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
|
|
4
4
|
import { FlagsClient, JsonValue, FlagValue, FlagDetails } from '@guidelytech/flags';
|
|
5
5
|
export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, JsonValue } from '@guidelytech/flags';
|
|
6
6
|
import { MessengerTab } from '@guidelytech/guide-runtime/messenger';
|
|
7
|
-
import {
|
|
8
|
-
export { E as EventQueue, b as EventQueueOptions, m as GuideStepInfo, d as GuidelyEnvironment, n as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, i as isExclusiveGuide, h as isFrequencyEligible, j as isWithinSchedule } from './types-BtPovimB.js';
|
|
9
|
-
export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-DFHUstWd.js';
|
|
10
|
-
export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-369s4YYT.js';
|
|
7
|
+
import { AgentTurnInput } from '@guidelytech/shared/runtime';
|
|
11
8
|
export { CAPTURE_PARAM } from '@guidelytech/shared/runtime';
|
|
12
|
-
import './
|
|
9
|
+
import { m as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, n as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-BDlebXrm.js';
|
|
10
|
+
export { A as AgentTurnRedactor, E as EventQueue, b as EventQueueOptions, o as GuideStepInfo, d as GuidelyEnvironment, q as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, g as countsTowardThrottle, i as isExclusiveGuide, j as isFrequencyEligible, k as isThrottleEligible, l as isWithinSchedule, p as pruneLaunches } from './types-BDlebXrm.js';
|
|
11
|
+
export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-sbP9JwTE.js';
|
|
12
|
+
export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-Csz721-A.js';
|
|
13
|
+
import './http-D047Ngxk.js';
|
|
13
14
|
|
|
14
15
|
declare const SDK_NAME = "@guidelytech/sdk-core";
|
|
15
|
-
declare const SDK_VERSION = "0.
|
|
16
|
+
declare const SDK_VERSION = "0.11.0";
|
|
16
17
|
declare const DEFAULT_API_URL = "https://api.guidely.app";
|
|
17
18
|
/**
|
|
18
19
|
* Framework-independent Guidely client. Create one per page with {@link createGuidely} or
|
|
@@ -27,6 +28,8 @@ declare class GuidelyClient {
|
|
|
27
28
|
private readonly queue;
|
|
28
29
|
/** Survey answers and guide/checklist progress, kept until the server accepts them. */
|
|
29
30
|
private readonly outbox;
|
|
31
|
+
/** Agent Analytics turns (agentConversation), in their own outbox. */
|
|
32
|
+
private readonly agentTurns;
|
|
30
33
|
private config;
|
|
31
34
|
private etag;
|
|
32
35
|
private anonymousId;
|
|
@@ -75,6 +78,10 @@ declare class GuidelyClient {
|
|
|
75
78
|
readonly flags: FlagsClient;
|
|
76
79
|
/** Experiments already reported this session (`experiment_viewed` is sent once per session). */
|
|
77
80
|
private exposures;
|
|
81
|
+
/** Language set with `setLocale()`. */
|
|
82
|
+
private locale;
|
|
83
|
+
/** Language each shown guide was rendered in; added to its events as `locale`. */
|
|
84
|
+
private guideLocales;
|
|
78
85
|
constructor(options: GuidelyOptions);
|
|
79
86
|
private createFlags;
|
|
80
87
|
/** Loads config (cache first, then network), wires listeners and evaluates triggers. Idempotent. */
|
|
@@ -109,8 +116,18 @@ declare class GuidelyClient {
|
|
|
109
116
|
private enqueue;
|
|
110
117
|
/** Tracks a custom event. Events drive `event` triggers, `advanceOn: "event"` steps and checklist tasks. */
|
|
111
118
|
track(name: string, properties?: Record<string, unknown>): void;
|
|
119
|
+
/**
|
|
120
|
+
* Agent Analytics: records one or more turns of a conversation with your own AI agent or chatbot
|
|
121
|
+
* (`{ conversationId, agentId, role, text, toolCalls?, latencyMs?, outcome?, … }`). The visitor's
|
|
122
|
+
* anonymous id, user id, account id and session id are filled in, `agents.redact` from the init
|
|
123
|
+
* options runs on each turn, and turns are retried until Guidely accepts them. Returns false when
|
|
124
|
+
* nothing was queued (analytics off or consent denied, or every turn was invalid or dropped).
|
|
125
|
+
*/
|
|
126
|
+
agentConversation(turns: AgentTurnInput | AgentTurnInput[]): boolean;
|
|
127
|
+
/** Alias of {@link agentConversation}. */
|
|
128
|
+
trackAgentTurn(turns: AgentTurnInput | AgentTurnInput[]): boolean;
|
|
112
129
|
/** Records a page view and re-evaluates triggers. Called automatically on SPA navigation. */
|
|
113
|
-
page(
|
|
130
|
+
page(href?: string): void;
|
|
114
131
|
private readonly customListeners;
|
|
115
132
|
private readonly eventBus;
|
|
116
133
|
private handleNavigation;
|
|
@@ -160,9 +177,27 @@ declare class GuidelyClient {
|
|
|
160
177
|
isRecording(): boolean;
|
|
161
178
|
/** The current analytics session id (rotates after inactivity; also the replay id). */
|
|
162
179
|
getSessionId(): string;
|
|
180
|
+
/** The page URL Guidely works with: `options.pageUrl`, else app-relative for `file:` / custom protocols (`normalizeAppUrl`). */
|
|
181
|
+
pageHref(href?: string): string;
|
|
163
182
|
/** Builds the targeting context for the current moment. */
|
|
164
183
|
getContext(): TargetingContext;
|
|
165
184
|
private isTargeted;
|
|
185
|
+
/** Guide throttling: may this guide launch automatically now? */
|
|
186
|
+
private throttleAllows;
|
|
187
|
+
private recordLaunch;
|
|
188
|
+
/** Guides and A/B test control groups, which are evaluated the same way but never render. */
|
|
189
|
+
private candidates;
|
|
190
|
+
private holdoutFor;
|
|
191
|
+
/** The visitor's language candidates, most preferred first. */
|
|
192
|
+
private locales;
|
|
193
|
+
private defaultLocale;
|
|
194
|
+
/** The guide in the visitor's language (remembered so its events carry `locale`). */
|
|
195
|
+
private localize;
|
|
196
|
+
/**
|
|
197
|
+
* Sets the language for guides and the resource center (`null` = back to the traits / browser).
|
|
198
|
+
* Guides already on screen keep their language; the resource center re-renders.
|
|
199
|
+
*/
|
|
200
|
+
setLocale(locale: string | null): void;
|
|
166
201
|
private isEligible;
|
|
167
202
|
private triggerFires;
|
|
168
203
|
private evaluate;
|
|
@@ -189,6 +224,8 @@ declare class GuidelyClient {
|
|
|
189
224
|
/** What the messenger personalises from, computed fresh on every render. */
|
|
190
225
|
private messengerVisitor;
|
|
191
226
|
private destroyMessenger;
|
|
227
|
+
/** The resource center's language for this visitor, or null for the default language. */
|
|
228
|
+
private rcLocale;
|
|
192
229
|
private loadArticle;
|
|
193
230
|
private searchResourceCenter;
|
|
194
231
|
/** Current progress for a checklist guide (by id or key). */
|
|
@@ -219,11 +256,22 @@ declare class GuidelyClient {
|
|
|
219
256
|
/** Opens the Scout messenger (when enabled for the project), optionally on a tab. */
|
|
220
257
|
openMessenger(tab?: MessengerTab): void;
|
|
221
258
|
closeMessenger(): void;
|
|
259
|
+
/**
|
|
260
|
+
* Opens a Guidely prototype test (its `/validate/<token>` URL on this SDK's API origin, or the bare
|
|
261
|
+
* token) in a full-screen overlay, attributed to the current user. Returns false, doing nothing, for
|
|
262
|
+
* any other URL. Guide buttons that open a test URL use this automatically.
|
|
263
|
+
*/
|
|
264
|
+
openPrototypeTest(urlOrToken: string): boolean;
|
|
222
265
|
/**
|
|
223
266
|
* Opens the complaint form in the messenger, optionally with a category picked (its id from
|
|
224
267
|
* Complaints → Categories). Does nothing when the project doesn't take complaints.
|
|
225
268
|
*/
|
|
226
269
|
openComplaint(categoryId?: string): void;
|
|
270
|
+
/**
|
|
271
|
+
* Opens the Ideas tab in the messenger (feature requests and voting), or one idea by its id.
|
|
272
|
+
* Does nothing when the project hasn't turned on Ideas.
|
|
273
|
+
*/
|
|
274
|
+
openIdeas(requestId?: string): void;
|
|
227
275
|
/** Opens a new messenger conversation, optionally pre-filling the message. */
|
|
228
276
|
showNewMessage(text?: string): void;
|
|
229
277
|
/** Boolean flag value for the current user; `fallback` (default `false`) until loaded or when missing. */
|
|
@@ -335,6 +383,10 @@ type Listener = (url: string) => void;
|
|
|
335
383
|
*/
|
|
336
384
|
declare function watchNavigation(listener: Listener, debounceMs?: number): () => void;
|
|
337
385
|
|
|
386
|
+
declare function normalizeAppUrl(href: string): string;
|
|
387
|
+
/** True for desktop-shell URLs (`file:`, custom protocols such as `app:`), which {@link normalizeAppUrl} makes app-relative. */
|
|
388
|
+
declare function isAppUrl(href: string): boolean;
|
|
389
|
+
|
|
338
390
|
declare const AUTHORING_PARAM = "guidely_authoring";
|
|
339
391
|
declare const HEARTBEAT_MS = 15000;
|
|
340
392
|
/** Messages the SDK posts to the dashboard window (`window.opener`). */
|
|
@@ -424,6 +476,22 @@ interface PageLeaveInfo {
|
|
|
424
476
|
scrollDepth: number;
|
|
425
477
|
}
|
|
426
478
|
|
|
479
|
+
/**
|
|
480
|
+
* In-app recruitment for Guidely prototype tests (Validate). A guide button that opens a Guidely test URL
|
|
481
|
+
* (`<apiOrigin>/validate/<token>`, same origin as the SDK's API) shows the test in a full-screen overlay
|
|
482
|
+
* iframe instead of navigating away. Attribution (public key, anonymous id, user id) goes in the URL
|
|
483
|
+
* fragment, so it never reaches servers, proxies or logs; the test page reads and clears it.
|
|
484
|
+
*
|
|
485
|
+
* The overlay is a modal dialog: focus moves into it and is trapped between the close button and the
|
|
486
|
+
* test frame, Escape closes it, and it closes when the test page posts `{ type: "guidely:prototype:close" }`.
|
|
487
|
+
*/
|
|
488
|
+
declare const PROTOTYPE_CLOSE_MESSAGE = "guidely:prototype:close";
|
|
489
|
+
/**
|
|
490
|
+
* The test URL for a full test URL or a bare token, when it points at this Guidely deployment's
|
|
491
|
+
* `/validate/<token>` page; null for anything else (other origins and paths keep their normal behaviour).
|
|
492
|
+
*/
|
|
493
|
+
declare function matchPrototypeTestUrl(urlOrToken: string, apiUrl: string): URL | null;
|
|
494
|
+
|
|
427
495
|
/**
|
|
428
496
|
* @guidelytech/sdk-core — framework-independent Guidely browser SDK.
|
|
429
497
|
*
|
|
@@ -439,4 +507,4 @@ declare const Guidely: {
|
|
|
439
507
|
version: string;
|
|
440
508
|
};
|
|
441
509
|
|
|
442
|
-
export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, watchNavigation };
|
|
510
|
+
export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, PROTOTYPE_CLOSE_MESSAGE, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, isAppUrl, matchPrototypeTestUrl, normalizeAppUrl, watchNavigation };
|