@guidelytech/shared 0.5.0 → 0.6.2
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-5IQVBZO6.js → chunk-OLWGMDRX.js} +71 -4
- package/dist/chunk-OLWGMDRX.js.map +1 -0
- package/dist/index.cjs +244 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +457 -7
- package/dist/index.d.ts +457 -7
- package/dist/index.js +175 -3
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +85 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +56 -3
- package/dist/runtime.d.ts +56 -3
- package/dist/runtime.js +33 -1
- package/package.json +1 -1
- package/dist/chunk-5IQVBZO6.js.map +0 -1
- package/dist/chunk-QUKMOTT4.js +0 -477
- package/dist/chunk-QUKMOTT4.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuleGroup, Rule } from './runtime.cjs';
|
|
2
|
-
export { DEFAULT_PLATFORMS, EMBED_IFRAME_ATTRS, EmbedProvider, ExceptionProperties, GUIDELY_ID_ATTRIBUTE, MAX_COLLECTION_DEPTH, MAX_PROPERTY_BYTES, MAX_STACK_FRAMES, MEDIA_IMAGE_MAX_BYTES, MEDIA_IMAGE_TYPES, MEDIA_VIDEO_MAX_BYTES, MEDIA_VIDEO_TYPES, MediaContentType, NETWORK_PLUGIN, NetworkPluginPayload, NetworkRequest, NetworkRequestType, PLATFORMS, Platform, RULE_FIELDS, RULE_OPERATORS, RcArticleLike, RcCollectionLike, RcSection, RuleField, RuleOperator, SENSITIVE_HEADER_PATTERN, SENSITIVE_PARAM_PATTERN, SENSITIVE_PROPERTY_PATTERN, SERVER_ASSISTED_FIELDS, SOURCEMAP_MAX_FILES_PER_UPLOAD, SOURCEMAP_MAX_FILE_BYTES, ShowWhen, StackFrame, SurveyAnswer, SurveyAnswers, TargetingContext, VIDEO_ATTRS, VideoEmbed, WS_MAX_MESSAGES_PER_SOCKET, WS_MAX_MESSAGE_BYTES, WebSocketMessage, clamp, compare, compareVersions, describeRule, emptyRuleGroup, evaluateRule, evaluateRules, fingerprintError, fnv1a, getPath, guidePlatforms, guidelyIdFromSelector, isAllowedEmbedSrc, isArticleListed, isChecklistComplete, isMediaContentType, isPlainObject, isQuestionVisible, isRuleGroup, isSafeMediaUrl, isVideoContentType, matchUrlPattern, matchesAudiences, mediaMaxBytes, normalizeErrorMessage, normalizeFrameFile, parseStack, randomId, resourceCenterSections, rolloutBucket, safeRegExp, sanitizeProperties, screenPath, slugify, stripOrigin, supportsPlatform, toEmbedUrl, visibleArticleIds } from './runtime.cjs';
|
|
2
|
+
export { CAPTURE_PARAM, CAPTURE_SCREENSHOT_MAX_BYTES, DEFAULT_PLATFORMS, EMBED_IFRAME_ATTRS, EmbedProvider, ExceptionProperties, FILE_LINK_CLASS, GUIDELY_ID_ATTRIBUTE, MAX_COLLECTION_DEPTH, MAX_PROPERTY_BYTES, MAX_STACK_FRAMES, MEDIA_FILE_MAX_BYTES, MEDIA_FILE_TYPES, MEDIA_IMAGE_MAX_BYTES, MEDIA_IMAGE_TYPES, MEDIA_MAX_BYTES, MEDIA_VIDEO_MAX_BYTES, MEDIA_VIDEO_TYPES, MediaContentType, MediaKind, NETWORK_PLUGIN, NetworkPluginPayload, NetworkRequest, NetworkRequestType, PATH_ID_PATTERN, PDF_BLOCK_CLASS, PDF_MAX_PAGES, PDF_PAGES_CLASS, PLATFORMS, Platform, RULE_FIELDS, RULE_OPERATORS, RcArticleLike, RcCollectionLike, RcSection, RuleField, RuleOperator, SENSITIVE_HEADER_PATTERN, SENSITIVE_PARAM_PATTERN, SENSITIVE_PROPERTY_PATTERN, SERVER_ASSISTED_FIELDS, SOURCEMAP_MAX_FILES_PER_UPLOAD, SOURCEMAP_MAX_FILE_BYTES, ShowWhen, StackFrame, SurveyAnswer, SurveyAnswers, TargetingContext, VIDEO_ATTRS, VideoEmbed, WS_MAX_MESSAGES_PER_SOCKET, WS_MAX_MESSAGE_BYTES, WebSocketMessage, clamp, compare, compareVersions, describeRule, emptyRuleGroup, evaluateRule, evaluateRules, fingerprintError, firstNameFromTraits, fnv1a, foldPathIds, getPath, guidePlatforms, guidelyIdFromSelector, isAllowedEmbedSrc, isArticleListed, isChecklistComplete, isFileLink, isMediaContentType, isPlainObject, isQuestionVisible, isRuleGroup, isSafeMediaUrl, isVideoContentType, matchUrlPattern, matchesAudiences, mediaKind, mediaMaxBytes, normalizeErrorMessage, normalizeFrameFile, pageLabel, pageTerms, parseStack, randomId, resourceCenterSections, rolloutBucket, safeRegExp, sanitizeProperties, screenPath, slugify, stripOrigin, supportsPlatform, toEmbedUrl, visibleArticleIds } from './runtime.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const RuleSchema: z.ZodType<Rule>;
|
|
@@ -1732,6 +1732,364 @@ declare const EventBatchSchema: z.ZodObject<{
|
|
|
1732
1732
|
}>;
|
|
1733
1733
|
type EventBatch = z.infer<typeof EventBatchSchema>;
|
|
1734
1734
|
|
|
1735
|
+
/**
|
|
1736
|
+
* How-tos: step-by-step guides with screenshots, recorded by clicking through the customer's app
|
|
1737
|
+
* (SDK capture mode) and edited in the dashboard. Each step is either an action captured in the app
|
|
1738
|
+
* (click, type, select, navigate) or a block the author added (text, heading, tip, alert).
|
|
1739
|
+
*/
|
|
1740
|
+
declare const HOWTO_STEP_KINDS: readonly ["action", "text", "heading", "tip", "alert"];
|
|
1741
|
+
type HowToStepKind = (typeof HOWTO_STEP_KINDS)[number];
|
|
1742
|
+
declare const HOWTO_ACTIONS: readonly ["click", "type", "select", "navigate"];
|
|
1743
|
+
type HowToAction = (typeof HOWTO_ACTIONS)[number];
|
|
1744
|
+
/** A rectangle as fractions (0–1) of its screenshot, so it survives any rendered size. */
|
|
1745
|
+
declare const NormalizedRectSchema: z.ZodObject<{
|
|
1746
|
+
x: z.ZodNumber;
|
|
1747
|
+
y: z.ZodNumber;
|
|
1748
|
+
width: z.ZodNumber;
|
|
1749
|
+
height: z.ZodNumber;
|
|
1750
|
+
}, "strip", z.ZodTypeAny, {
|
|
1751
|
+
width: number;
|
|
1752
|
+
x: number;
|
|
1753
|
+
y: number;
|
|
1754
|
+
height: number;
|
|
1755
|
+
}, {
|
|
1756
|
+
width: number;
|
|
1757
|
+
x: number;
|
|
1758
|
+
y: number;
|
|
1759
|
+
height: number;
|
|
1760
|
+
}>;
|
|
1761
|
+
type NormalizedRect = z.infer<typeof NormalizedRectSchema>;
|
|
1762
|
+
/** The element an action was performed on, described for people (not for selecting it). */
|
|
1763
|
+
declare const CapturedElementSchema: z.ZodObject<{
|
|
1764
|
+
/** Visible name: aria-label, associated label, text, placeholder, alt or title. */
|
|
1765
|
+
label: z.ZodDefault<z.ZodString>;
|
|
1766
|
+
/** button, link, tab, menuitem, checkbox, radio, field, dropdown, option, element… */
|
|
1767
|
+
role: z.ZodDefault<z.ZodString>;
|
|
1768
|
+
tag: z.ZodDefault<z.ZodString>;
|
|
1769
|
+
}, "strip", z.ZodTypeAny, {
|
|
1770
|
+
role: string;
|
|
1771
|
+
label: string;
|
|
1772
|
+
tag: string;
|
|
1773
|
+
}, {
|
|
1774
|
+
role?: string | undefined;
|
|
1775
|
+
label?: string | undefined;
|
|
1776
|
+
tag?: string | undefined;
|
|
1777
|
+
}>;
|
|
1778
|
+
type CapturedElement = z.infer<typeof CapturedElementSchema>;
|
|
1779
|
+
/**
|
|
1780
|
+
* One action the SDK recorded, sent with its screenshot as multipart form data
|
|
1781
|
+
* (`step` = this JSON, `screenshot` = the image) to `POST /api/v1/sdk/capture/steps?token=`.
|
|
1782
|
+
* Sensitive values never arrive here: the SDK drops typed text from password, payment, one-time-code
|
|
1783
|
+
* and masked fields and redacts screenshots in the browser before uploading them.
|
|
1784
|
+
*/
|
|
1785
|
+
declare const CaptureStepSchema: z.ZodObject<{
|
|
1786
|
+
/** Random id from the SDK; a retried upload with the same id is stored once. */
|
|
1787
|
+
clientId: z.ZodString;
|
|
1788
|
+
action: z.ZodEnum<["click", "type", "select", "navigate"]>;
|
|
1789
|
+
url: z.ZodString;
|
|
1790
|
+
pageTitle: z.ZodDefault<z.ZodString>;
|
|
1791
|
+
element: z.ZodOptional<z.ZodObject<{
|
|
1792
|
+
/** Visible name: aria-label, associated label, text, placeholder, alt or title. */
|
|
1793
|
+
label: z.ZodDefault<z.ZodString>;
|
|
1794
|
+
/** button, link, tab, menuitem, checkbox, radio, field, dropdown, option, element… */
|
|
1795
|
+
role: z.ZodDefault<z.ZodString>;
|
|
1796
|
+
tag: z.ZodDefault<z.ZodString>;
|
|
1797
|
+
}, "strip", z.ZodTypeAny, {
|
|
1798
|
+
role: string;
|
|
1799
|
+
label: string;
|
|
1800
|
+
tag: string;
|
|
1801
|
+
}, {
|
|
1802
|
+
role?: string | undefined;
|
|
1803
|
+
label?: string | undefined;
|
|
1804
|
+
tag?: string | undefined;
|
|
1805
|
+
}>>;
|
|
1806
|
+
/** Typed text or chosen option; absent when it was sensitive (`valueRedacted`). */
|
|
1807
|
+
value: z.ZodOptional<z.ZodString>;
|
|
1808
|
+
valueRedacted: z.ZodDefault<z.ZodBoolean>;
|
|
1809
|
+
/** Selectors for the element, so the step can later become an interactive tour step. */
|
|
1810
|
+
selectors: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1811
|
+
kind: z.ZodEnum<["css", "id", "data-attr", "aria", "text", "xpath", "guidely-id"]>;
|
|
1812
|
+
value: z.ZodString;
|
|
1813
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1814
|
+
}, "strip", z.ZodTypeAny, {
|
|
1815
|
+
value: string;
|
|
1816
|
+
kind: "id" | "css" | "data-attr" | "aria" | "text" | "xpath" | "guidely-id";
|
|
1817
|
+
label?: string | undefined;
|
|
1818
|
+
}, {
|
|
1819
|
+
value: string;
|
|
1820
|
+
kind: "id" | "css" | "data-attr" | "aria" | "text" | "xpath" | "guidely-id";
|
|
1821
|
+
label?: string | undefined;
|
|
1822
|
+
}>, "many">>;
|
|
1823
|
+
/** Where the element sits in the screenshot. */
|
|
1824
|
+
highlight: z.ZodOptional<z.ZodObject<{
|
|
1825
|
+
x: z.ZodNumber;
|
|
1826
|
+
y: z.ZodNumber;
|
|
1827
|
+
width: z.ZodNumber;
|
|
1828
|
+
height: z.ZodNumber;
|
|
1829
|
+
}, "strip", z.ZodTypeAny, {
|
|
1830
|
+
width: number;
|
|
1831
|
+
x: number;
|
|
1832
|
+
y: number;
|
|
1833
|
+
height: number;
|
|
1834
|
+
}, {
|
|
1835
|
+
width: number;
|
|
1836
|
+
x: number;
|
|
1837
|
+
y: number;
|
|
1838
|
+
height: number;
|
|
1839
|
+
}>>;
|
|
1840
|
+
/** Number of regions the SDK blurred in the screenshot before upload. */
|
|
1841
|
+
redactions: z.ZodDefault<z.ZodNumber>;
|
|
1842
|
+
occurredAt: z.ZodOptional<z.ZodString>;
|
|
1843
|
+
}, "strip", z.ZodTypeAny, {
|
|
1844
|
+
selectors: {
|
|
1845
|
+
value: string;
|
|
1846
|
+
kind: "id" | "css" | "data-attr" | "aria" | "text" | "xpath" | "guidely-id";
|
|
1847
|
+
label?: string | undefined;
|
|
1848
|
+
}[];
|
|
1849
|
+
url: string;
|
|
1850
|
+
action: "type" | "click" | "select" | "navigate";
|
|
1851
|
+
clientId: string;
|
|
1852
|
+
pageTitle: string;
|
|
1853
|
+
valueRedacted: boolean;
|
|
1854
|
+
redactions: number;
|
|
1855
|
+
value?: string | undefined;
|
|
1856
|
+
occurredAt?: string | undefined;
|
|
1857
|
+
element?: {
|
|
1858
|
+
role: string;
|
|
1859
|
+
label: string;
|
|
1860
|
+
tag: string;
|
|
1861
|
+
} | undefined;
|
|
1862
|
+
highlight?: {
|
|
1863
|
+
width: number;
|
|
1864
|
+
x: number;
|
|
1865
|
+
y: number;
|
|
1866
|
+
height: number;
|
|
1867
|
+
} | undefined;
|
|
1868
|
+
}, {
|
|
1869
|
+
url: string;
|
|
1870
|
+
action: "type" | "click" | "select" | "navigate";
|
|
1871
|
+
clientId: string;
|
|
1872
|
+
value?: string | undefined;
|
|
1873
|
+
selectors?: {
|
|
1874
|
+
value: string;
|
|
1875
|
+
kind: "id" | "css" | "data-attr" | "aria" | "text" | "xpath" | "guidely-id";
|
|
1876
|
+
label?: string | undefined;
|
|
1877
|
+
}[] | undefined;
|
|
1878
|
+
occurredAt?: string | undefined;
|
|
1879
|
+
element?: {
|
|
1880
|
+
role?: string | undefined;
|
|
1881
|
+
label?: string | undefined;
|
|
1882
|
+
tag?: string | undefined;
|
|
1883
|
+
} | undefined;
|
|
1884
|
+
pageTitle?: string | undefined;
|
|
1885
|
+
valueRedacted?: boolean | undefined;
|
|
1886
|
+
highlight?: {
|
|
1887
|
+
width: number;
|
|
1888
|
+
x: number;
|
|
1889
|
+
y: number;
|
|
1890
|
+
height: number;
|
|
1891
|
+
} | undefined;
|
|
1892
|
+
redactions?: number | undefined;
|
|
1893
|
+
}>;
|
|
1894
|
+
type CaptureStep = z.infer<typeof CaptureStepSchema>;
|
|
1895
|
+
type CaptureStepInput = z.input<typeof CaptureStepSchema>;
|
|
1896
|
+
/** `GET /api/v1/sdk/capture/session?token=`: what the SDK needs to start recording. */
|
|
1897
|
+
interface CaptureSessionInfo {
|
|
1898
|
+
id: string;
|
|
1899
|
+
projectId: string;
|
|
1900
|
+
environment: string;
|
|
1901
|
+
howToId: string;
|
|
1902
|
+
howToTitle: string;
|
|
1903
|
+
/** Origin of the dashboard window that opened the app (for `postMessage`). */
|
|
1904
|
+
dashboardOrigin: string;
|
|
1905
|
+
expiresAt: string;
|
|
1906
|
+
/** Steps already recorded (a recording continues across full page loads). */
|
|
1907
|
+
stepCount: number;
|
|
1908
|
+
/** False when the server has no media storage: record steps without screenshots. */
|
|
1909
|
+
screenshots: boolean;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
/**
|
|
1913
|
+
* A label as people would say it: icon glyphs and symbols at either end ("+ New contact", "Next →")
|
|
1914
|
+
* and required-field markers ("Email *", "Name:") removed. Falls back to the raw label when nothing
|
|
1915
|
+
* readable is left.
|
|
1916
|
+
*/
|
|
1917
|
+
declare function cleanLabel(label: string | undefined | null): string;
|
|
1918
|
+
/**
|
|
1919
|
+
* Name of the page a navigate step opens. A title like "Contacts · Northwind CRM" gives "Contacts";
|
|
1920
|
+
* a title that's just the app's name (no word of the path in it) gives the path instead, so
|
|
1921
|
+
* "/contacts/new" reads "Contacts › New". Ids in the path are skipped.
|
|
1922
|
+
*/
|
|
1923
|
+
declare function pageName(url: string, pageTitle: string | undefined | null): string;
|
|
1924
|
+
/** Plain-language instruction for a captured action, e.g. `Click “Save”` or `Type “Acme” into “Company”`. */
|
|
1925
|
+
declare function describeCaptureStep(step: Pick<CaptureStepInput, "action" | "element" | "value" | "valueRedacted" | "pageTitle" | "url">): string;
|
|
1926
|
+
/** A point as fractions (0–1) of a screenshot. */
|
|
1927
|
+
declare const NormalizedPointSchema: z.ZodObject<{
|
|
1928
|
+
x: z.ZodNumber;
|
|
1929
|
+
y: z.ZodNumber;
|
|
1930
|
+
}, "strip", z.ZodTypeAny, {
|
|
1931
|
+
x: number;
|
|
1932
|
+
y: number;
|
|
1933
|
+
}, {
|
|
1934
|
+
x: number;
|
|
1935
|
+
y: number;
|
|
1936
|
+
}>;
|
|
1937
|
+
declare const ANNOTATION_COLORS: readonly ["brand", "red", "amber", "green", "black", "white"];
|
|
1938
|
+
type AnnotationColor = (typeof ANNOTATION_COLORS)[number];
|
|
1939
|
+
/**
|
|
1940
|
+
* A mark drawn over a step's screenshot, in fractions of the full image so it survives cropping and
|
|
1941
|
+
* any rendered size: an arrow, a text label or a box. `brand` uses the project's primary colour.
|
|
1942
|
+
*/
|
|
1943
|
+
declare const HowToAnnotationSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1944
|
+
id: z.ZodString;
|
|
1945
|
+
type: z.ZodLiteral<"arrow">;
|
|
1946
|
+
from: z.ZodObject<{
|
|
1947
|
+
x: z.ZodNumber;
|
|
1948
|
+
y: z.ZodNumber;
|
|
1949
|
+
}, "strip", z.ZodTypeAny, {
|
|
1950
|
+
x: number;
|
|
1951
|
+
y: number;
|
|
1952
|
+
}, {
|
|
1953
|
+
x: number;
|
|
1954
|
+
y: number;
|
|
1955
|
+
}>;
|
|
1956
|
+
to: z.ZodObject<{
|
|
1957
|
+
x: z.ZodNumber;
|
|
1958
|
+
y: z.ZodNumber;
|
|
1959
|
+
}, "strip", z.ZodTypeAny, {
|
|
1960
|
+
x: number;
|
|
1961
|
+
y: number;
|
|
1962
|
+
}, {
|
|
1963
|
+
x: number;
|
|
1964
|
+
y: number;
|
|
1965
|
+
}>;
|
|
1966
|
+
color: z.ZodDefault<z.ZodEnum<["brand", "red", "amber", "green", "black", "white"]>>;
|
|
1967
|
+
}, "strip", z.ZodTypeAny, {
|
|
1968
|
+
type: "arrow";
|
|
1969
|
+
id: string;
|
|
1970
|
+
from: {
|
|
1971
|
+
x: number;
|
|
1972
|
+
y: number;
|
|
1973
|
+
};
|
|
1974
|
+
to: {
|
|
1975
|
+
x: number;
|
|
1976
|
+
y: number;
|
|
1977
|
+
};
|
|
1978
|
+
color: "brand" | "red" | "amber" | "green" | "black" | "white";
|
|
1979
|
+
}, {
|
|
1980
|
+
type: "arrow";
|
|
1981
|
+
id: string;
|
|
1982
|
+
from: {
|
|
1983
|
+
x: number;
|
|
1984
|
+
y: number;
|
|
1985
|
+
};
|
|
1986
|
+
to: {
|
|
1987
|
+
x: number;
|
|
1988
|
+
y: number;
|
|
1989
|
+
};
|
|
1990
|
+
color?: "brand" | "red" | "amber" | "green" | "black" | "white" | undefined;
|
|
1991
|
+
}>, z.ZodObject<{
|
|
1992
|
+
id: z.ZodString;
|
|
1993
|
+
type: z.ZodLiteral<"text">;
|
|
1994
|
+
at: z.ZodObject<{
|
|
1995
|
+
x: z.ZodNumber;
|
|
1996
|
+
y: z.ZodNumber;
|
|
1997
|
+
}, "strip", z.ZodTypeAny, {
|
|
1998
|
+
x: number;
|
|
1999
|
+
y: number;
|
|
2000
|
+
}, {
|
|
2001
|
+
x: number;
|
|
2002
|
+
y: number;
|
|
2003
|
+
}>;
|
|
2004
|
+
text: z.ZodString;
|
|
2005
|
+
color: z.ZodDefault<z.ZodEnum<["brand", "red", "amber", "green", "black", "white"]>>;
|
|
2006
|
+
}, "strip", z.ZodTypeAny, {
|
|
2007
|
+
at: {
|
|
2008
|
+
x: number;
|
|
2009
|
+
y: number;
|
|
2010
|
+
};
|
|
2011
|
+
type: "text";
|
|
2012
|
+
id: string;
|
|
2013
|
+
text: string;
|
|
2014
|
+
color: "brand" | "red" | "amber" | "green" | "black" | "white";
|
|
2015
|
+
}, {
|
|
2016
|
+
at: {
|
|
2017
|
+
x: number;
|
|
2018
|
+
y: number;
|
|
2019
|
+
};
|
|
2020
|
+
type: "text";
|
|
2021
|
+
id: string;
|
|
2022
|
+
text: string;
|
|
2023
|
+
color?: "brand" | "red" | "amber" | "green" | "black" | "white" | undefined;
|
|
2024
|
+
}>, z.ZodObject<{
|
|
2025
|
+
id: z.ZodString;
|
|
2026
|
+
type: z.ZodLiteral<"box">;
|
|
2027
|
+
rect: z.ZodObject<{
|
|
2028
|
+
x: z.ZodNumber;
|
|
2029
|
+
y: z.ZodNumber;
|
|
2030
|
+
width: z.ZodNumber;
|
|
2031
|
+
height: z.ZodNumber;
|
|
2032
|
+
}, "strip", z.ZodTypeAny, {
|
|
2033
|
+
width: number;
|
|
2034
|
+
x: number;
|
|
2035
|
+
y: number;
|
|
2036
|
+
height: number;
|
|
2037
|
+
}, {
|
|
2038
|
+
width: number;
|
|
2039
|
+
x: number;
|
|
2040
|
+
y: number;
|
|
2041
|
+
height: number;
|
|
2042
|
+
}>;
|
|
2043
|
+
color: z.ZodDefault<z.ZodEnum<["brand", "red", "amber", "green", "black", "white"]>>;
|
|
2044
|
+
}, "strip", z.ZodTypeAny, {
|
|
2045
|
+
type: "box";
|
|
2046
|
+
id: string;
|
|
2047
|
+
color: "brand" | "red" | "amber" | "green" | "black" | "white";
|
|
2048
|
+
rect: {
|
|
2049
|
+
width: number;
|
|
2050
|
+
x: number;
|
|
2051
|
+
y: number;
|
|
2052
|
+
height: number;
|
|
2053
|
+
};
|
|
2054
|
+
}, {
|
|
2055
|
+
type: "box";
|
|
2056
|
+
id: string;
|
|
2057
|
+
rect: {
|
|
2058
|
+
width: number;
|
|
2059
|
+
x: number;
|
|
2060
|
+
y: number;
|
|
2061
|
+
height: number;
|
|
2062
|
+
};
|
|
2063
|
+
color?: "brand" | "red" | "amber" | "green" | "black" | "white" | undefined;
|
|
2064
|
+
}>]>;
|
|
2065
|
+
type HowToAnnotation = z.infer<typeof HowToAnnotationSchema>;
|
|
2066
|
+
declare const MAX_ANNOTATIONS = 30;
|
|
2067
|
+
|
|
2068
|
+
/** How quickly the team usually replies, shown on the messenger home screen. */
|
|
2069
|
+
declare const REPLY_TIMES: readonly ["minutes", "hour", "hours", "day"];
|
|
2070
|
+
type ReplyTime = (typeof REPLY_TIMES)[number];
|
|
2071
|
+
/** Levels of the status card on the messenger home screen. */
|
|
2072
|
+
declare const STATUS_LEVELS: readonly ["operational", "degraded", "outage", "maintenance"];
|
|
2073
|
+
type StatusLevel = (typeof STATUS_LEVELS)[number];
|
|
2074
|
+
/** A teammate shown on the messenger home screen (first name only). */
|
|
2075
|
+
interface MessengerTeammate {
|
|
2076
|
+
name: string;
|
|
2077
|
+
avatarUrl: string | null;
|
|
2078
|
+
}
|
|
2079
|
+
interface MessengerStatus {
|
|
2080
|
+
level: StatusLevel;
|
|
2081
|
+
message: string;
|
|
2082
|
+
updatedAt: string;
|
|
2083
|
+
}
|
|
2084
|
+
/** Which personalised cards the messenger home screen shows. */
|
|
2085
|
+
interface MessengerHomeCards {
|
|
2086
|
+
/** Guides, how-tos, articles and common questions for the page the user is on. */
|
|
2087
|
+
suggestions: boolean;
|
|
2088
|
+
/** A guide the user started and didn't finish, and checklist progress. */
|
|
2089
|
+
progress: boolean;
|
|
2090
|
+
/** Live announcements (also the News tab). */
|
|
2091
|
+
news: boolean;
|
|
2092
|
+
}
|
|
1735
2093
|
/** Messenger settings delivered to the SDK in `SdkConfigResponse.messenger`. */
|
|
1736
2094
|
interface MessengerConfig {
|
|
1737
2095
|
enabled: boolean;
|
|
@@ -1744,7 +2102,49 @@ interface MessengerConfig {
|
|
|
1744
2102
|
launcher: {
|
|
1745
2103
|
position: "bottom-right" | "bottom-left";
|
|
1746
2104
|
};
|
|
2105
|
+
/** Absent from servers before the personalised home screen; SDKs fall back to their defaults. */
|
|
2106
|
+
replyTime?: ReplyTime | null;
|
|
2107
|
+
team?: MessengerTeammate[];
|
|
2108
|
+
status?: MessengerStatus | null;
|
|
2109
|
+
home?: MessengerHomeCards;
|
|
2110
|
+
}
|
|
2111
|
+
/** Page-matched content for the messenger, from `POST /sdk/messenger/page`. */
|
|
2112
|
+
type MessengerPageSuggestion = {
|
|
2113
|
+
type: "article";
|
|
2114
|
+
articleId: string;
|
|
2115
|
+
title: string;
|
|
2116
|
+
summary: string;
|
|
2117
|
+
}
|
|
2118
|
+
/** A how-to recorded on this page, opened as its help article. */
|
|
2119
|
+
| {
|
|
2120
|
+
type: "howto";
|
|
2121
|
+
articleId: string;
|
|
2122
|
+
title: string;
|
|
2123
|
+
steps: number;
|
|
2124
|
+
};
|
|
2125
|
+
interface MessengerPageContent {
|
|
2126
|
+
/** The page as matched: its path with ids folded (`/invoices/:id`). */
|
|
2127
|
+
path: string;
|
|
2128
|
+
label: string | null;
|
|
2129
|
+
suggestions: MessengerPageSuggestion[];
|
|
2130
|
+
/** Questions people ask on this page (FAQs and learned answers); tapping one asks Scout. */
|
|
2131
|
+
questions: string[];
|
|
1747
2132
|
}
|
|
2133
|
+
declare const MessengerPageRequestSchema: z.ZodObject<{
|
|
2134
|
+
anonymousId: z.ZodString;
|
|
2135
|
+
userId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
2136
|
+
/** Pathname only: query strings and fragments are never sent. */
|
|
2137
|
+
path: z.ZodString;
|
|
2138
|
+
}, "strip", z.ZodTypeAny, {
|
|
2139
|
+
path: string;
|
|
2140
|
+
anonymousId: string;
|
|
2141
|
+
userId?: string | null | undefined;
|
|
2142
|
+
}, {
|
|
2143
|
+
path: string;
|
|
2144
|
+
anonymousId: string;
|
|
2145
|
+
userId?: string | null | undefined;
|
|
2146
|
+
}>;
|
|
2147
|
+
type MessengerPageRequest = z.infer<typeof MessengerPageRequestSchema>;
|
|
1748
2148
|
declare const MESSAGE_AUTHORS: readonly ["user", "scout", "agent", "system"];
|
|
1749
2149
|
type MessageAuthor = (typeof MESSAGE_AUTHORS)[number];
|
|
1750
2150
|
type ConversationStatus = "bot" | "open" | "closed";
|
|
@@ -1756,6 +2156,11 @@ interface MessengerSuggestedGuide {
|
|
|
1756
2156
|
key: string;
|
|
1757
2157
|
name: string;
|
|
1758
2158
|
}
|
|
2159
|
+
/** A how-to Scout relied on; the messenger opens it in place (`GET /sdk/how-tos/:id`). */
|
|
2160
|
+
interface MessengerHowToCitation {
|
|
2161
|
+
howToId: string;
|
|
2162
|
+
title: string;
|
|
2163
|
+
}
|
|
1759
2164
|
interface MessengerMessage {
|
|
1760
2165
|
id: string;
|
|
1761
2166
|
author: MessageAuthor;
|
|
@@ -1764,6 +2169,8 @@ interface MessengerMessage {
|
|
|
1764
2169
|
body: string;
|
|
1765
2170
|
citations: MessengerCitation[];
|
|
1766
2171
|
suggestedGuides: MessengerSuggestedGuide[];
|
|
2172
|
+
/** How-tos Scout cited (absent when none; SDKs before how-to support ignore it). */
|
|
2173
|
+
howTos?: MessengerHowToCitation[];
|
|
1767
2174
|
status: "pending" | "complete" | "failed";
|
|
1768
2175
|
createdAt: string;
|
|
1769
2176
|
}
|
|
@@ -1814,10 +2221,14 @@ interface ConversationLookupResponse {
|
|
|
1814
2221
|
}
|
|
1815
2222
|
declare const PostMessageSchema: z.ZodObject<{
|
|
1816
2223
|
message: z.ZodString;
|
|
2224
|
+
/** The page the user is on now (omitted when URL collection is off and by older SDKs), so Scout answers for that page. */
|
|
2225
|
+
pageUrl: z.ZodOptional<z.ZodString>;
|
|
1817
2226
|
}, "strip", z.ZodTypeAny, {
|
|
1818
2227
|
message: string;
|
|
2228
|
+
pageUrl?: string | undefined;
|
|
1819
2229
|
}, {
|
|
1820
2230
|
message: string;
|
|
2231
|
+
pageUrl?: string | undefined;
|
|
1821
2232
|
}>;
|
|
1822
2233
|
declare const ConversationRatingSchema: z.ZodObject<{
|
|
1823
2234
|
rating: z.ZodNumber;
|
|
@@ -1878,6 +2289,45 @@ interface SdkArticlesResponse {
|
|
|
1878
2289
|
collections: ResourceCenterCollection[];
|
|
1879
2290
|
articles: SdkArticleSummary[];
|
|
1880
2291
|
}
|
|
2292
|
+
/** A how-to the team made available in the app (`GET /sdk/how-tos`). */
|
|
2293
|
+
interface SdkHowToSummary {
|
|
2294
|
+
id: string;
|
|
2295
|
+
title: string;
|
|
2296
|
+
description: string;
|
|
2297
|
+
/** Numbered (recorded) steps. */
|
|
2298
|
+
stepCount: number;
|
|
2299
|
+
updatedAt: string;
|
|
2300
|
+
}
|
|
2301
|
+
interface SdkHowTosResponse {
|
|
2302
|
+
/** Every how-to available in the app, by title (at most 200). */
|
|
2303
|
+
howTos: SdkHowToSummary[];
|
|
2304
|
+
/** Ids of the ones recorded on the page in `?url=`, best match first (at most 5). */
|
|
2305
|
+
forPage: string[];
|
|
2306
|
+
}
|
|
2307
|
+
/** One step as the messenger renders it: text only, plus a screenshot with the element's highlight. */
|
|
2308
|
+
interface SdkHowToStep {
|
|
2309
|
+
id: string;
|
|
2310
|
+
kind: HowToStepKind;
|
|
2311
|
+
title: string;
|
|
2312
|
+
body: string;
|
|
2313
|
+
image?: {
|
|
2314
|
+
url: string;
|
|
2315
|
+
/** Show only this part of the screenshot (zoomed in on the element). */
|
|
2316
|
+
crop?: NormalizedRect;
|
|
2317
|
+
/** The element, in the coordinates of the (cropped) image. */
|
|
2318
|
+
highlight?: NormalizedRect;
|
|
2319
|
+
};
|
|
2320
|
+
}
|
|
2321
|
+
/** `GET /sdk/how-tos/:id`: an available how-to with its steps. */
|
|
2322
|
+
interface SdkHowTo {
|
|
2323
|
+
id: string;
|
|
2324
|
+
title: string;
|
|
2325
|
+
description: string;
|
|
2326
|
+
updatedAt: string;
|
|
2327
|
+
steps: SdkHowToStep[];
|
|
2328
|
+
/** Key of the interactive tour made from it, when that tour is live in this environment ("Show me"). */
|
|
2329
|
+
guideKey?: string;
|
|
2330
|
+
}
|
|
1881
2331
|
|
|
1882
2332
|
/**
|
|
1883
2333
|
* Product-analytics capture settings. Stored on `Project.settings` (keys `autocapture`,
|
|
@@ -2373,14 +2823,14 @@ declare const AuthoringPickSchema: z.ZodObject<{
|
|
|
2373
2823
|
height: z.ZodNumber;
|
|
2374
2824
|
}, "strip", z.ZodTypeAny, {
|
|
2375
2825
|
width: number;
|
|
2376
|
-
height: number;
|
|
2377
2826
|
x: number;
|
|
2378
2827
|
y: number;
|
|
2828
|
+
height: number;
|
|
2379
2829
|
}, {
|
|
2380
2830
|
width: number;
|
|
2381
|
-
height: number;
|
|
2382
2831
|
x: number;
|
|
2383
2832
|
y: number;
|
|
2833
|
+
height: number;
|
|
2384
2834
|
}>>;
|
|
2385
2835
|
}, "strip", z.ZodTypeAny, {
|
|
2386
2836
|
selectors: {
|
|
@@ -2393,9 +2843,9 @@ declare const AuthoringPickSchema: z.ZodObject<{
|
|
|
2393
2843
|
stepId?: string | undefined;
|
|
2394
2844
|
rect?: {
|
|
2395
2845
|
width: number;
|
|
2396
|
-
height: number;
|
|
2397
2846
|
x: number;
|
|
2398
2847
|
y: number;
|
|
2848
|
+
height: number;
|
|
2399
2849
|
} | undefined;
|
|
2400
2850
|
}, {
|
|
2401
2851
|
selectors: {
|
|
@@ -2408,9 +2858,9 @@ declare const AuthoringPickSchema: z.ZodObject<{
|
|
|
2408
2858
|
stepId?: string | undefined;
|
|
2409
2859
|
rect?: {
|
|
2410
2860
|
width: number;
|
|
2411
|
-
height: number;
|
|
2412
2861
|
x: number;
|
|
2413
2862
|
y: number;
|
|
2863
|
+
height: number;
|
|
2414
2864
|
} | undefined;
|
|
2415
2865
|
}>;
|
|
2416
2866
|
type AuthoringPick = z.infer<typeof AuthoringPickSchema>;
|
|
@@ -3624,6 +4074,6 @@ declare function templateConfig(id: string): {
|
|
|
3624
4074
|
} | null;
|
|
3625
4075
|
|
|
3626
4076
|
declare const SDK_API_VERSION = "v1";
|
|
3627
|
-
declare const SHARED_VERSION = "0.
|
|
4077
|
+
declare const SHARED_VERSION = "0.6.2";
|
|
3628
4078
|
|
|
3629
|
-
export { ADVANCE_ON, AUTOCAPTURE_EVENTS, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSettings, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, type MessengerConfig, type MessengerConversation, type MessengerMessage, type MessengerSuggestedGuide, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, defaultGuideConfig, defaultStep, resolveCaptureSettings, templateConfig, validateGuideConfig, visibleButtons };
|
|
4079
|
+
export { ADVANCE_ON, ANNOTATION_COLORS, AUTOCAPTURE_EVENTS, type AnnotationColor, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSessionInfo, type CaptureSettings, type CaptureStep, type CaptureStepInput, CaptureStepSchema, type CapturedElement, CapturedElementSchema, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, HOWTO_ACTIONS, HOWTO_STEP_KINDS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type HowToAction, type HowToAnnotation, HowToAnnotationSchema, type HowToStepKind, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_ANNOTATIONS, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, type MessengerConfig, type MessengerConversation, type MessengerHomeCards, type MessengerHowToCitation, type MessengerMessage, type MessengerPageContent, type MessengerPageRequest, MessengerPageRequestSchema, type MessengerPageSuggestion, type MessengerStatus, type MessengerSuggestedGuide, type MessengerTeammate, NormalizedPointSchema, type NormalizedRect, NormalizedRectSchema, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, REPLY_TIMES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ReplyTime, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STATUS_LEVELS, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SdkHowTo, type SdkHowToStep, type SdkHowToSummary, type SdkHowTosResponse, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, type StatusLevel, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, cleanLabel, defaultGuideConfig, defaultStep, describeCaptureStep, pageName, resolveCaptureSettings, templateConfig, validateGuideConfig, visibleButtons };
|