@guidelytech/shared 0.16.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-7PWYIAJI.js → chunk-YL65O3FS.js} +123 -13
- package/dist/chunk-YL65O3FS.js.map +1 -0
- package/dist/index.cjs +309 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -12
- package/dist/index.d.ts +39 -12
- package/dist/index.js +198 -103
- package/dist/index.js.map +1 -1
- package/dist/{runtime-CAtOOY7X.d.cts → runtime-x-0GT7HM.d.cts} +216 -3
- package/dist/{runtime-CAtOOY7X.d.ts → runtime-x-0GT7HM.d.ts} +216 -3
- package/dist/runtime.cjs +139 -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 +35 -1
- package/package.json +1 -1
- package/dist/chunk-7PWYIAJI.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -29,6 +29,10 @@ import {
|
|
|
29
29
|
GUIDE_EXPERIMENT_STATUSES,
|
|
30
30
|
GUIDE_VISIBILITIES,
|
|
31
31
|
LOGGED_IN_AUDIENCE,
|
|
32
|
+
MAX_APP_VERSION_LENGTH,
|
|
33
|
+
MAX_BREADCRUMBS,
|
|
34
|
+
MAX_BUG_REPORT_LENGTH,
|
|
35
|
+
MAX_BUG_REPORT_SCREENSHOT_BYTES,
|
|
32
36
|
MAX_COLLECTION_DEPTH,
|
|
33
37
|
MAX_COMPLAINT_ANSWER_LENGTH,
|
|
34
38
|
MAX_COMPLAINT_ATTACHMENT_BYTES,
|
|
@@ -36,6 +40,13 @@ import {
|
|
|
36
40
|
MAX_COMPLAINT_FIELDS,
|
|
37
41
|
MAX_COMPLAINT_LENGTH,
|
|
38
42
|
MAX_CUSTOM_CSS,
|
|
43
|
+
MAX_DEBUG_IMAGES,
|
|
44
|
+
MAX_DETAIL_FRAMES,
|
|
45
|
+
MAX_DETAIL_THREADS,
|
|
46
|
+
MAX_ERROR_TAGS,
|
|
47
|
+
MAX_EXCEPTION_CHAIN,
|
|
48
|
+
MAX_EXCEPTION_DETAIL_BYTES,
|
|
49
|
+
MAX_EXCEPTION_DETAIL_RAW_BYTES,
|
|
39
50
|
MAX_PROPERTY_BYTES,
|
|
40
51
|
MAX_STACK_FRAMES,
|
|
41
52
|
MEDIA_FILE_MAX_BYTES,
|
|
@@ -89,8 +100,10 @@ import {
|
|
|
89
100
|
contrastIssues,
|
|
90
101
|
contrastRatio,
|
|
91
102
|
cssSelectorError,
|
|
103
|
+
customFingerprint,
|
|
92
104
|
describeRule,
|
|
93
105
|
emptyRuleGroup,
|
|
106
|
+
errorFilterDrops,
|
|
94
107
|
evaluateRule,
|
|
95
108
|
evaluateRules,
|
|
96
109
|
evenWeights,
|
|
@@ -132,10 +145,12 @@ import {
|
|
|
132
145
|
mediaKind,
|
|
133
146
|
mediaMaxBytes,
|
|
134
147
|
needsReview,
|
|
148
|
+
normalizeAppVersion,
|
|
135
149
|
normalizeErrorMessage,
|
|
136
150
|
normalizeFrameFile,
|
|
137
151
|
normalizeLocale,
|
|
138
152
|
normalizeSnapshot,
|
|
153
|
+
normalizeTags,
|
|
139
154
|
orderedModules,
|
|
140
155
|
pageLabel,
|
|
141
156
|
pagePattern,
|
|
@@ -149,6 +164,7 @@ import {
|
|
|
149
164
|
propertyAttributeAllowed,
|
|
150
165
|
queryConditionRegex,
|
|
151
166
|
randomId,
|
|
167
|
+
reactNativeBundleUrl,
|
|
152
168
|
readableTextOn,
|
|
153
169
|
relativeLuminance,
|
|
154
170
|
resolveLocale,
|
|
@@ -173,6 +189,7 @@ import {
|
|
|
173
189
|
supportsPlatform,
|
|
174
190
|
toEmbedUrl,
|
|
175
191
|
translationCoverage,
|
|
192
|
+
trimExceptionDetail,
|
|
176
193
|
unreadAnnouncements,
|
|
177
194
|
variantProblems,
|
|
178
195
|
variantRanges,
|
|
@@ -183,7 +200,7 @@ import {
|
|
|
183
200
|
visitorLocales,
|
|
184
201
|
withExperimentBucket,
|
|
185
202
|
withVisibility
|
|
186
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-YL65O3FS.js";
|
|
187
204
|
|
|
188
205
|
// src/targeting.ts
|
|
189
206
|
import { z } from "zod";
|
|
@@ -557,6 +574,14 @@ var EVENT_NAMES = [
|
|
|
557
574
|
var AUTOCAPTURE_EVENTS = ["page_view", "page_leave", "click", "rage_click", "exception", "heatmap", "app_install", "app_update", "app_open", "app_background"];
|
|
558
575
|
var APP_LIFECYCLE_EVENTS = ["app_install", "app_update", "app_open", "app_background"];
|
|
559
576
|
var GUIDE_LIFECYCLE_EVENTS = ["guide_viewed", "guide_started", "step_viewed", "step_completed", "guide_completed", "guide_skipped", "guide_dismissed", "guide_abandoned"];
|
|
577
|
+
var ExceptionDetailField = z3.preprocess((v) => {
|
|
578
|
+
if (!v || typeof v !== "object" || Array.isArray(v)) return void 0;
|
|
579
|
+
try {
|
|
580
|
+
return JSON.stringify(v).length > MAX_EXCEPTION_DETAIL_RAW_BYTES ? void 0 : v;
|
|
581
|
+
} catch {
|
|
582
|
+
return void 0;
|
|
583
|
+
}
|
|
584
|
+
}, z3.record(z3.string(), z3.unknown()).optional());
|
|
560
585
|
var SdkEventSchema = z3.object({
|
|
561
586
|
eventId: z3.string().min(8).max(64),
|
|
562
587
|
name: z3.enum(EVENT_NAMES),
|
|
@@ -572,7 +597,19 @@ var SdkEventSchema = z3.object({
|
|
|
572
597
|
stepId: z3.string().max(64).optional(),
|
|
573
598
|
stepIndex: z3.number().int().min(0).optional(),
|
|
574
599
|
url: z3.string().max(2e3).optional(),
|
|
575
|
-
|
|
600
|
+
/**
|
|
601
|
+
* Version of the customer's app when the event happened (`appVersion` SDK option, auto-detected on
|
|
602
|
+
* mobile). Stored per event so reports can filter and break down by version; see `normalizeAppVersion`.
|
|
603
|
+
*/
|
|
604
|
+
appVersion: z3.string().max(200).optional().nullable(),
|
|
605
|
+
properties: z3.record(z3.string(), z3.unknown()).optional(),
|
|
606
|
+
/**
|
|
607
|
+
* `exception` events only: breadcrumbs, contexts, tags, extra, the exception chain, threads and
|
|
608
|
+
* debug images in the Sentry event shape (`ExceptionDetail`, docs/error-monitoring/sdks.md), outside
|
|
609
|
+
* the 8 KB property budget. The server trims it to 64 KB and stores it in ErrorEventDetail; one over
|
|
610
|
+
* 1 MB (or that isn't an object) is dropped without failing the batch.
|
|
611
|
+
*/
|
|
612
|
+
detail: ExceptionDetailField
|
|
576
613
|
});
|
|
577
614
|
var EventBatchSchema = z3.object({
|
|
578
615
|
events: z3.array(SdkEventSchema).min(1).max(50),
|
|
@@ -690,15 +727,38 @@ var FileComplaintSchema = z6.object({
|
|
|
690
727
|
}).optional().nullable()
|
|
691
728
|
});
|
|
692
729
|
|
|
693
|
-
// src/
|
|
730
|
+
// src/bug-reports.ts
|
|
694
731
|
import { z as z7 } from "zod";
|
|
695
|
-
var
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
732
|
+
var BugReportSchema = z7.object({
|
|
733
|
+
anonymousId: z7.string().min(1).max(128),
|
|
734
|
+
userId: z7.string().max(256).optional().nullable(),
|
|
735
|
+
sessionId: z7.string().max(128).optional().nullable(),
|
|
736
|
+
message: z7.string().trim().min(1).max(MAX_BUG_REPORT_LENGTH),
|
|
737
|
+
email: z7.string().trim().toLowerCase().email().max(254).optional().nullable(),
|
|
738
|
+
name: z7.string().trim().max(200).optional().nullable(),
|
|
739
|
+
/** The exception event the report is about (the SDK sends the page's last error unless told otherwise). */
|
|
740
|
+
associatedEventId: z7.string().trim().max(64).optional().nullable(),
|
|
741
|
+
url: z7.string().max(2e3).optional().nullable(),
|
|
742
|
+
appVersion: z7.string().max(200).optional().nullable(),
|
|
743
|
+
/** widget (the built-in dialog) or api (captureFeedback). */
|
|
744
|
+
source: z7.enum(["widget", "api"]).default("api"),
|
|
745
|
+
tags: z7.record(z7.string().max(64), z7.string().max(200)).optional(),
|
|
746
|
+
sdk: z7.object({ name: z7.string().max(60), version: z7.string().max(30) }).optional(),
|
|
747
|
+
screenshot: z7.object({
|
|
748
|
+
fileName: z7.string().trim().min(1).max(200),
|
|
749
|
+
data: z7.string().max(Math.ceil(MAX_BUG_REPORT_SCREENSHOT_BYTES * 4 / 3) + 64)
|
|
750
|
+
}).optional().nullable()
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
// src/agents.ts
|
|
754
|
+
import { z as z8 } from "zod";
|
|
755
|
+
var EnvironmentKey = z8.string().trim().regex(/^[a-z][a-z0-9-]{0,29}$/, "environment: use an environment key such as production");
|
|
756
|
+
var AgentToolCallSchema = z8.object({
|
|
757
|
+
name: z8.string().trim().min(1).max(100),
|
|
758
|
+
status: z8.enum(AGENT_TOOL_STATUSES).optional(),
|
|
759
|
+
latencyMs: z8.number().int().min(0).max(36e5).optional()
|
|
700
760
|
}).strip();
|
|
701
|
-
var AgentMetadataSchema =
|
|
761
|
+
var AgentMetadataSchema = z8.record(z8.string().max(100), z8.unknown()).transform((m) => {
|
|
702
762
|
const out = {};
|
|
703
763
|
let size = 0;
|
|
704
764
|
for (const [k, v] of Object.entries(m)) {
|
|
@@ -712,31 +772,31 @@ var AgentMetadataSchema = z7.record(z7.string().max(100), z7.unknown()).transfor
|
|
|
712
772
|
}
|
|
713
773
|
return out;
|
|
714
774
|
});
|
|
715
|
-
var id = (max) =>
|
|
716
|
-
var optionalId = (max) =>
|
|
717
|
-
var AgentTurnInputSchema =
|
|
718
|
-
type:
|
|
775
|
+
var id = (max) => z8.string().trim().min(1).max(max);
|
|
776
|
+
var optionalId = (max) => z8.string().trim().max(max).optional().nullable().transform((v) => v || null);
|
|
777
|
+
var AgentTurnInputSchema = z8.object({
|
|
778
|
+
type: z8.literal("agent.conversation").optional(),
|
|
719
779
|
conversationId: id(128),
|
|
720
780
|
agentId: id(64).refine((v) => v.toLowerCase() !== SCOUT_AGENT_ID, { message: `"${SCOUT_AGENT_ID}" is reserved for Guidely's built-in Scout agent` }),
|
|
721
|
-
agentName:
|
|
722
|
-
turnId:
|
|
723
|
-
role:
|
|
724
|
-
text:
|
|
725
|
-
toolCalls:
|
|
726
|
-
latencyMs:
|
|
727
|
-
outcome:
|
|
728
|
-
taskSuccess:
|
|
729
|
-
occurredAt:
|
|
781
|
+
agentName: z8.string().trim().max(100).optional(),
|
|
782
|
+
turnId: z8.string().trim().min(1).max(128).optional(),
|
|
783
|
+
role: z8.enum(AGENT_TURN_ROLES),
|
|
784
|
+
text: z8.string().max(AGENT_TURN_MAX_TEXT).default(""),
|
|
785
|
+
toolCalls: z8.array(AgentToolCallSchema).max(AGENT_TOOL_CALLS_PER_TURN).default([]),
|
|
786
|
+
latencyMs: z8.number().int().min(0).max(36e5).optional(),
|
|
787
|
+
outcome: z8.enum(AGENT_OUTCOMES).optional(),
|
|
788
|
+
taskSuccess: z8.boolean().optional(),
|
|
789
|
+
occurredAt: z8.string().datetime({ offset: true }).optional(),
|
|
730
790
|
userId: optionalId(256),
|
|
731
791
|
anonymousId: optionalId(128),
|
|
732
792
|
accountId: optionalId(256),
|
|
733
793
|
sessionId: optionalId(128),
|
|
734
794
|
metadata: AgentMetadataSchema.default({})
|
|
735
795
|
});
|
|
736
|
-
var turns =
|
|
737
|
-
var sdkInfo =
|
|
738
|
-
var SdkAgentEventsSchema =
|
|
739
|
-
var AgentEventsRequestSchema =
|
|
796
|
+
var turns = z8.array(AgentTurnInputSchema).min(1).max(AGENT_TURNS_PER_BATCH);
|
|
797
|
+
var sdkInfo = z8.object({ name: z8.string().max(60), version: z8.string().max(30) }).optional();
|
|
798
|
+
var SdkAgentEventsSchema = z8.object({ turns, sdk: sdkInfo });
|
|
799
|
+
var AgentEventsRequestSchema = z8.preprocess(
|
|
740
800
|
(v) => {
|
|
741
801
|
if (Array.isArray(v)) return { turns: v };
|
|
742
802
|
if (v && typeof v === "object" && !("turns" in v)) {
|
|
@@ -745,11 +805,11 @@ var AgentEventsRequestSchema = z7.preprocess(
|
|
|
745
805
|
}
|
|
746
806
|
return v;
|
|
747
807
|
},
|
|
748
|
-
|
|
808
|
+
z8.object({ turns, environment: EnvironmentKey.default("production"), sdk: sdkInfo })
|
|
749
809
|
);
|
|
750
810
|
|
|
751
811
|
// src/feedback.ts
|
|
752
|
-
import { z as
|
|
812
|
+
import { z as z9 } from "zod";
|
|
753
813
|
|
|
754
814
|
// src/feedback-limits.ts
|
|
755
815
|
var FEEDBACK_STATUSES = ["new", "under_review", "planned", "in_progress", "released", "declined"];
|
|
@@ -773,58 +833,60 @@ var feedbackReference = (number) => `#${number}`;
|
|
|
773
833
|
|
|
774
834
|
// src/feedback.ts
|
|
775
835
|
var visitor = {
|
|
776
|
-
anonymousId:
|
|
777
|
-
userId:
|
|
836
|
+
anonymousId: z9.string().min(1).max(128),
|
|
837
|
+
userId: z9.string().max(256).optional().nullable()
|
|
778
838
|
};
|
|
779
|
-
var FeedbackListRequestSchema =
|
|
839
|
+
var FeedbackListRequestSchema = z9.object({
|
|
780
840
|
...visitor,
|
|
781
|
-
q:
|
|
782
|
-
sort:
|
|
783
|
-
status:
|
|
841
|
+
q: z9.string().trim().max(200).optional(),
|
|
842
|
+
sort: z9.enum(["top", "new", "trending"]).default("top"),
|
|
843
|
+
status: z9.enum(FEEDBACK_STATUSES).optional(),
|
|
784
844
|
/** "open" = not released or declined. */
|
|
785
|
-
filter:
|
|
786
|
-
productArea:
|
|
787
|
-
page:
|
|
845
|
+
filter: z9.enum(["open", "all", "mine", "following"]).default("open"),
|
|
846
|
+
productArea: z9.string().trim().max(60).optional(),
|
|
847
|
+
page: z9.number().int().min(1).max(100).default(1)
|
|
788
848
|
});
|
|
789
|
-
var FeedbackVisitorSchema =
|
|
790
|
-
var SubmitFeedbackSchema =
|
|
849
|
+
var FeedbackVisitorSchema = z9.object(visitor);
|
|
850
|
+
var SubmitFeedbackSchema = z9.object({
|
|
791
851
|
...visitor,
|
|
792
|
-
title:
|
|
793
|
-
description:
|
|
794
|
-
productArea:
|
|
795
|
-
priority:
|
|
852
|
+
title: z9.string().trim().min(3, "Give your idea a short title").max(MAX_FEEDBACK_TITLE),
|
|
853
|
+
description: z9.string().trim().max(MAX_FEEDBACK_DESCRIPTION).default(""),
|
|
854
|
+
productArea: z9.string().trim().max(60).optional().nullable(),
|
|
855
|
+
priority: z9.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
|
|
796
856
|
/** Filed from this Scout conversation (Scout offered it). */
|
|
797
|
-
conversationId:
|
|
798
|
-
pageUrl:
|
|
857
|
+
conversationId: z9.string().min(1).max(64).optional().nullable(),
|
|
858
|
+
pageUrl: z9.string().max(2e3).optional()
|
|
799
859
|
});
|
|
800
|
-
var FeedbackVoteSchema =
|
|
860
|
+
var FeedbackVoteSchema = z9.object({
|
|
801
861
|
...visitor,
|
|
802
|
-
priority:
|
|
803
|
-
note:
|
|
804
|
-
conversationId:
|
|
862
|
+
priority: z9.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
|
|
863
|
+
note: z9.string().trim().max(MAX_FEEDBACK_NOTE).optional(),
|
|
864
|
+
conversationId: z9.string().min(1).max(64).optional().nullable()
|
|
805
865
|
});
|
|
806
|
-
var FeedbackFollowSchema =
|
|
807
|
-
var FeedbackCommentSchema =
|
|
808
|
-
var FeedbackSimilarSchema =
|
|
809
|
-
var FeedbackUpdatesReadSchema =
|
|
866
|
+
var FeedbackFollowSchema = z9.object({ ...visitor, follow: z9.boolean() });
|
|
867
|
+
var FeedbackCommentSchema = z9.object({ ...visitor, body: z9.string().trim().min(1).max(MAX_FEEDBACK_COMMENT) });
|
|
868
|
+
var FeedbackSimilarSchema = z9.object({ ...visitor, title: z9.string().trim().min(3).max(MAX_FEEDBACK_TITLE) });
|
|
869
|
+
var FeedbackUpdatesReadSchema = z9.object({ ...visitor, ids: z9.array(z9.string().min(1).max(64)).max(100).optional() });
|
|
810
870
|
|
|
811
871
|
// src/capture.ts
|
|
812
|
-
import { z as
|
|
813
|
-
var AutocaptureSettingsSchema =
|
|
814
|
-
var ErrorTrackingSettingsSchema =
|
|
815
|
-
var
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
872
|
+
import { z as z10 } from "zod";
|
|
873
|
+
var AutocaptureSettingsSchema = z10.object({ pageviews: z10.boolean(), pageLeave: z10.boolean(), clicks: z10.boolean(), rageClicks: z10.boolean(), heatmaps: z10.boolean(), mouseMovement: z10.boolean(), appLifecycle: z10.boolean() }).partial();
|
|
874
|
+
var ErrorTrackingSettingsSchema = z10.object({ enabled: z10.boolean() }).partial();
|
|
875
|
+
var PerformanceSettingsSchema = z10.object({ enabled: z10.boolean(), sampleRate: z10.number().min(0).max(100) }).partial();
|
|
876
|
+
var ReplaySettingsSchema = z10.object({
|
|
877
|
+
enabled: z10.boolean(),
|
|
878
|
+
sampleRate: z10.number().int().min(0).max(100),
|
|
879
|
+
recordConsole: z10.boolean(),
|
|
880
|
+
recordNetwork: z10.boolean(),
|
|
881
|
+
recordNetworkPayloads: z10.boolean(),
|
|
882
|
+
maskAllText: z10.boolean(),
|
|
883
|
+
blockSelectors: z10.array(z10.string().min(1).max(200)).max(50),
|
|
884
|
+
retentionDays: z10.number().int().min(1).max(365)
|
|
824
885
|
}).partial();
|
|
825
886
|
var DEFAULT_CAPTURE_SETTINGS = {
|
|
826
887
|
autocapture: { pageviews: true, pageLeave: true, clicks: true, rageClicks: true, heatmaps: true, mouseMovement: true, appLifecycle: true },
|
|
827
888
|
errorTracking: { enabled: true },
|
|
889
|
+
performance: { enabled: false, sampleRate: 100 },
|
|
828
890
|
replay: { enabled: false, sampleRate: 100, recordConsole: true, recordNetwork: true, recordNetworkPayloads: false, maskAllText: false, blockSelectors: [], retentionDays: 30 }
|
|
829
891
|
};
|
|
830
892
|
var RECORDING_LEVELS = ["off", "privacy", "standard", "full"];
|
|
@@ -851,25 +913,29 @@ function resolveCaptureSettings(settings) {
|
|
|
851
913
|
const a = AutocaptureSettingsSchema.safeParse(obj(s.autocapture));
|
|
852
914
|
const e = ErrorTrackingSettingsSchema.safeParse(obj(s.errorTracking));
|
|
853
915
|
const r = ReplaySettingsSchema.safeParse(obj(s.replay));
|
|
916
|
+
const p = PerformanceSettingsSchema.safeParse(obj(s.performance));
|
|
854
917
|
return {
|
|
855
918
|
autocapture: { ...d.autocapture, ...a.success ? a.data : {} },
|
|
856
919
|
errorTracking: { ...d.errorTracking, ...e.success ? e.data : {} },
|
|
857
|
-
replay: { ...d.replay, ...r.success ? r.data : {} }
|
|
920
|
+
replay: { ...d.replay, ...r.success ? r.data : {} },
|
|
921
|
+
performance: { ...d.performance, ...p.success ? p.data : {} }
|
|
858
922
|
};
|
|
859
923
|
}
|
|
860
924
|
var HEATMAP_VIEWPORTS = { mobile: [0, 767], tablet: [768, 1279], desktop: [1280, 1e5] };
|
|
861
|
-
var ReplayChunkSchema =
|
|
862
|
-
sessionId:
|
|
863
|
-
windowId:
|
|
864
|
-
seq:
|
|
865
|
-
anonymousId:
|
|
866
|
-
userId:
|
|
925
|
+
var ReplayChunkSchema = z10.object({
|
|
926
|
+
sessionId: z10.string().min(1).max(128),
|
|
927
|
+
windowId: z10.string().min(1).max(64),
|
|
928
|
+
seq: z10.number().int().min(0).max(1e6),
|
|
929
|
+
anonymousId: z10.string().min(1).max(128),
|
|
930
|
+
userId: z10.string().max(256).optional().nullable(),
|
|
867
931
|
/** rrweb `eventWithTime` objects, in order. */
|
|
868
|
-
events:
|
|
869
|
-
url:
|
|
870
|
-
device:
|
|
871
|
-
viewport:
|
|
872
|
-
sdk:
|
|
932
|
+
events: z10.array(z10.object({ type: z10.number().int(), timestamp: z10.number() }).passthrough()).min(1).max(5e4),
|
|
933
|
+
url: z10.string().max(2e3).optional(),
|
|
934
|
+
device: z10.object({ type: z10.string().max(20), browser: z10.string().max(40).optional(), os: z10.string().max(40).optional() }).optional(),
|
|
935
|
+
viewport: z10.object({ width: z10.number().int().min(0).max(1e5), height: z10.number().int().min(0).max(1e5) }).optional(),
|
|
936
|
+
sdk: z10.object({ name: z10.string().max(60), version: z10.string().max(30) }).optional(),
|
|
937
|
+
/** The app's version (`appVersion` SDK option); recordings can be filtered by it. */
|
|
938
|
+
appVersion: z10.string().max(200).optional()
|
|
873
939
|
});
|
|
874
940
|
var REPLAY_MAX_COMPRESSED_BYTES = 2 * 1024 * 1024;
|
|
875
941
|
var REPLAY_MAX_RAW_BYTES = 16 * 1024 * 1024;
|
|
@@ -1053,39 +1119,39 @@ function templateConfig(id2) {
|
|
|
1053
1119
|
}
|
|
1054
1120
|
|
|
1055
1121
|
// src/howto.ts
|
|
1056
|
-
import { z as
|
|
1122
|
+
import { z as z11 } from "zod";
|
|
1057
1123
|
var HOWTO_STEP_KINDS = ["action", "text", "heading", "tip", "alert"];
|
|
1058
1124
|
var HOWTO_ACTIONS = ["click", "type", "select", "navigate"];
|
|
1059
|
-
var NormalizedRectSchema =
|
|
1060
|
-
x:
|
|
1061
|
-
y:
|
|
1062
|
-
width:
|
|
1063
|
-
height:
|
|
1125
|
+
var NormalizedRectSchema = z11.object({
|
|
1126
|
+
x: z11.number().min(0).max(1),
|
|
1127
|
+
y: z11.number().min(0).max(1),
|
|
1128
|
+
width: z11.number().min(0).max(1),
|
|
1129
|
+
height: z11.number().min(0).max(1)
|
|
1064
1130
|
});
|
|
1065
|
-
var CapturedElementSchema =
|
|
1131
|
+
var CapturedElementSchema = z11.object({
|
|
1066
1132
|
/** Visible name: aria-label, associated label, text, placeholder, alt or title. */
|
|
1067
|
-
label:
|
|
1133
|
+
label: z11.string().max(200).default(""),
|
|
1068
1134
|
/** button, link, tab, menuitem, checkbox, radio, field, dropdown, option, element… */
|
|
1069
|
-
role:
|
|
1070
|
-
tag:
|
|
1135
|
+
role: z11.string().max(40).default("element"),
|
|
1136
|
+
tag: z11.string().max(40).default("")
|
|
1071
1137
|
});
|
|
1072
|
-
var CaptureStepSchema =
|
|
1138
|
+
var CaptureStepSchema = z11.object({
|
|
1073
1139
|
/** Random id from the SDK; a retried upload with the same id is stored once. */
|
|
1074
|
-
clientId:
|
|
1075
|
-
action:
|
|
1076
|
-
url:
|
|
1077
|
-
pageTitle:
|
|
1140
|
+
clientId: z11.string().min(1).max(64),
|
|
1141
|
+
action: z11.enum(HOWTO_ACTIONS),
|
|
1142
|
+
url: z11.string().max(2e3),
|
|
1143
|
+
pageTitle: z11.string().max(300).default(""),
|
|
1078
1144
|
element: CapturedElementSchema.optional(),
|
|
1079
1145
|
/** Typed text or chosen option; absent when it was sensitive (`valueRedacted`). */
|
|
1080
|
-
value:
|
|
1081
|
-
valueRedacted:
|
|
1146
|
+
value: z11.string().max(200).optional(),
|
|
1147
|
+
valueRedacted: z11.boolean().default(false),
|
|
1082
1148
|
/** Selectors for the element, so the step can later become an interactive tour step. */
|
|
1083
|
-
selectors:
|
|
1149
|
+
selectors: z11.array(SelectorStrategySchema).max(10).default([]),
|
|
1084
1150
|
/** Where the element sits in the screenshot. */
|
|
1085
1151
|
highlight: NormalizedRectSchema.optional(),
|
|
1086
1152
|
/** Number of regions the SDK blurred in the screenshot before upload. */
|
|
1087
|
-
redactions:
|
|
1088
|
-
occurredAt:
|
|
1153
|
+
redactions: z11.number().int().min(0).max(1e3).default(0),
|
|
1154
|
+
occurredAt: z11.string().datetime().optional()
|
|
1089
1155
|
});
|
|
1090
1156
|
function quoted(s) {
|
|
1091
1157
|
const t = (s ?? "").replace(/\s+/g, " ").trim();
|
|
@@ -1156,12 +1222,12 @@ function hostAndPath(url) {
|
|
|
1156
1222
|
return url.slice(0, 80);
|
|
1157
1223
|
}
|
|
1158
1224
|
}
|
|
1159
|
-
var NormalizedPointSchema =
|
|
1225
|
+
var NormalizedPointSchema = z11.object({ x: z11.number().min(0).max(1), y: z11.number().min(0).max(1) });
|
|
1160
1226
|
var ANNOTATION_COLORS = ["brand", "red", "amber", "green", "black", "white"];
|
|
1161
|
-
var HowToAnnotationSchema =
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1227
|
+
var HowToAnnotationSchema = z11.discriminatedUnion("type", [
|
|
1228
|
+
z11.object({ id: z11.string().min(1).max(32), type: z11.literal("arrow"), from: NormalizedPointSchema, to: NormalizedPointSchema, color: z11.enum(ANNOTATION_COLORS).default("brand") }),
|
|
1229
|
+
z11.object({ id: z11.string().min(1).max(32), type: z11.literal("text"), at: NormalizedPointSchema, text: z11.string().trim().min(1).max(120), color: z11.enum(ANNOTATION_COLORS).default("brand") }),
|
|
1230
|
+
z11.object({ id: z11.string().min(1).max(32), type: z11.literal("box"), rect: NormalizedRectSchema, color: z11.enum(ANNOTATION_COLORS).default("brand") })
|
|
1165
1231
|
]);
|
|
1166
1232
|
var MAX_ANNOTATIONS = 30;
|
|
1167
1233
|
|
|
@@ -1189,6 +1255,16 @@ var SCRIPT_STUB_METHODS = [
|
|
|
1189
1255
|
"openComplaint",
|
|
1190
1256
|
"openIdeas",
|
|
1191
1257
|
"captureException",
|
|
1258
|
+
"captureFeedback",
|
|
1259
|
+
"showBugReport",
|
|
1260
|
+
"captureMessage",
|
|
1261
|
+
"addBreadcrumb",
|
|
1262
|
+
"setTag",
|
|
1263
|
+
"setTags",
|
|
1264
|
+
"setExtra",
|
|
1265
|
+
"setExtras",
|
|
1266
|
+
"setContext",
|
|
1267
|
+
"setUser",
|
|
1192
1268
|
"agentConversation",
|
|
1193
1269
|
"trackAgentTurn",
|
|
1194
1270
|
"on"
|
|
@@ -1306,7 +1382,7 @@ function parseTranslationCsv(text) {
|
|
|
1306
1382
|
|
|
1307
1383
|
// src/index.ts
|
|
1308
1384
|
var SDK_API_VERSION = "v1";
|
|
1309
|
-
var SHARED_VERSION = "0.
|
|
1385
|
+
var SHARED_VERSION = "0.17.0";
|
|
1310
1386
|
export {
|
|
1311
1387
|
ADVANCE_ON,
|
|
1312
1388
|
AGENT_METADATA_MAX_BYTES,
|
|
@@ -1330,6 +1406,7 @@ export {
|
|
|
1330
1406
|
AuthoringPickSchema,
|
|
1331
1407
|
AutocaptureSettingsSchema,
|
|
1332
1408
|
BUTTON_ACTIONS,
|
|
1409
|
+
BugReportSchema,
|
|
1333
1410
|
ButtonSchema,
|
|
1334
1411
|
CAPTURE_PARAM,
|
|
1335
1412
|
CAPTURE_SCREENSHOT_MAX_BYTES,
|
|
@@ -1395,6 +1472,10 @@ export {
|
|
|
1395
1472
|
LocaleSchema,
|
|
1396
1473
|
LocalizationSettingsSchema,
|
|
1397
1474
|
MAX_ANNOTATIONS,
|
|
1475
|
+
MAX_APP_VERSION_LENGTH,
|
|
1476
|
+
MAX_BREADCRUMBS,
|
|
1477
|
+
MAX_BUG_REPORT_LENGTH,
|
|
1478
|
+
MAX_BUG_REPORT_SCREENSHOT_BYTES,
|
|
1398
1479
|
MAX_COLLECTION_DEPTH,
|
|
1399
1480
|
MAX_COMPLAINT_ANSWER_LENGTH,
|
|
1400
1481
|
MAX_COMPLAINT_ATTACHMENT_BYTES,
|
|
@@ -1402,6 +1483,13 @@ export {
|
|
|
1402
1483
|
MAX_COMPLAINT_FIELDS,
|
|
1403
1484
|
MAX_COMPLAINT_LENGTH,
|
|
1404
1485
|
MAX_CUSTOM_CSS,
|
|
1486
|
+
MAX_DEBUG_IMAGES,
|
|
1487
|
+
MAX_DETAIL_FRAMES,
|
|
1488
|
+
MAX_DETAIL_THREADS,
|
|
1489
|
+
MAX_ERROR_TAGS,
|
|
1490
|
+
MAX_EXCEPTION_CHAIN,
|
|
1491
|
+
MAX_EXCEPTION_DETAIL_BYTES,
|
|
1492
|
+
MAX_EXCEPTION_DETAIL_RAW_BYTES,
|
|
1405
1493
|
MAX_FEEDBACK_COMMENT,
|
|
1406
1494
|
MAX_FEEDBACK_DESCRIPTION,
|
|
1407
1495
|
MAX_FEEDBACK_NOTE,
|
|
@@ -1429,6 +1517,7 @@ export {
|
|
|
1429
1517
|
PDF_PAGES_CLASS,
|
|
1430
1518
|
PLACEMENTS,
|
|
1431
1519
|
PLATFORMS,
|
|
1520
|
+
PerformanceSettingsSchema,
|
|
1432
1521
|
PostMessageSchema,
|
|
1433
1522
|
ProjectThemeSchema,
|
|
1434
1523
|
PublishedGuideSchema,
|
|
@@ -1498,11 +1587,13 @@ export {
|
|
|
1498
1587
|
contrastIssues,
|
|
1499
1588
|
contrastRatio,
|
|
1500
1589
|
cssSelectorError,
|
|
1590
|
+
customFingerprint,
|
|
1501
1591
|
defaultGuideConfig,
|
|
1502
1592
|
defaultStep,
|
|
1503
1593
|
describeCaptureStep,
|
|
1504
1594
|
describeRule,
|
|
1505
1595
|
emptyRuleGroup,
|
|
1596
|
+
errorFilterDrops,
|
|
1506
1597
|
evaluateRule,
|
|
1507
1598
|
evaluateRules,
|
|
1508
1599
|
evenWeights,
|
|
@@ -1545,10 +1636,12 @@ export {
|
|
|
1545
1636
|
mediaKind,
|
|
1546
1637
|
mediaMaxBytes,
|
|
1547
1638
|
needsReview,
|
|
1639
|
+
normalizeAppVersion,
|
|
1548
1640
|
normalizeErrorMessage,
|
|
1549
1641
|
normalizeFrameFile,
|
|
1550
1642
|
normalizeLocale,
|
|
1551
1643
|
normalizeSnapshot,
|
|
1644
|
+
normalizeTags,
|
|
1552
1645
|
orderedModules,
|
|
1553
1646
|
pageLabel,
|
|
1554
1647
|
pageName,
|
|
@@ -1566,6 +1659,7 @@ export {
|
|
|
1566
1659
|
propertyAttributeAllowed,
|
|
1567
1660
|
queryConditionRegex,
|
|
1568
1661
|
randomId,
|
|
1662
|
+
reactNativeBundleUrl,
|
|
1569
1663
|
readableTextOn,
|
|
1570
1664
|
recordingLevel,
|
|
1571
1665
|
relativeLuminance,
|
|
@@ -1596,6 +1690,7 @@ export {
|
|
|
1596
1690
|
toTranslationCsv,
|
|
1597
1691
|
toXliff,
|
|
1598
1692
|
translationCoverage,
|
|
1693
|
+
trimExceptionDetail,
|
|
1599
1694
|
unreadAnnouncements,
|
|
1600
1695
|
validateGuideConfig,
|
|
1601
1696
|
variantProblems,
|