@merittdev/horus-lens 0.0.3 → 0.1.1
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/README.md +9 -47
- package/dist/browser.cjs +84 -85
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +2 -4
- package/dist/{chunk-CTBY5XIN.js → chunk-CRV65EEY.js} +40 -2
- package/dist/chunk-CRV65EEY.js.map +1 -0
- package/dist/{chunk-XRONR4GR.js → chunk-UB7YYHI4.js} +13672 -968
- package/dist/chunk-UB7YYHI4.js.map +1 -0
- package/dist/index.cjs +46 -111
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-BA540Fae.d.ts → index.d-DeLYS02n.d.ts} +13 -0
- package/dist/{index.d-DOCLVJGS.d.cts → index.d-sNoEEgRg.d.cts} +13 -0
- package/dist/index.d.cts +14 -165
- package/dist/index.d.ts +14 -165
- package/dist/index.js +1 -29
- package/dist/lens.min.js +31 -31
- package/dist/lens.min.js.map +1 -1
- package/dist/react.cjs +84 -85
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -4
- package/dist/react.js.map +1 -1
- package/package.json +6 -19
- package/dist/chunk-CTBY5XIN.js.map +0 -1
- package/dist/chunk-DWOH2ENF.js +0 -17613
- package/dist/chunk-DWOH2ENF.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-XRONR4GR.js.map +0 -1
- package/dist/dashboard.cjs +0 -20124
- package/dist/dashboard.cjs.map +0 -1
- package/dist/dashboard.css +0 -2456
- package/dist/dashboard.d.cts +0 -791
- package/dist/dashboard.d.ts +0 -791
- package/dist/dashboard.js +0 -2584
- package/dist/dashboard.js.map +0 -1
- package/dist/rrweb-EYUUZIYR.js +0 -30
- package/dist/rrweb-EYUUZIYR.js.map +0 -1
- package/dist/server.cjs +0 -109
- package/dist/server.cjs.map +0 -1
- package/dist/server.d.cts +0 -59
- package/dist/server.d.ts +0 -59
- package/dist/server.js +0 -82
- package/dist/server.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -28,37 +28,24 @@ __export(src_exports, {
|
|
|
28
28
|
AssetKindSchema: () => AssetKindSchema,
|
|
29
29
|
AssetRefSchema: () => AssetRefSchema,
|
|
30
30
|
AttachAssetRequestSchema: () => AttachAssetRequestSchema,
|
|
31
|
-
ConnectIntegrationRequestSchema: () => ConnectIntegrationRequestSchema,
|
|
32
|
-
ConnectIntegrationResponseSchema: () => ConnectIntegrationResponseSchema,
|
|
33
31
|
ConsoleEntrySchema: () => ConsoleEntrySchema,
|
|
34
32
|
ConsoleLevelSchema: () => ConsoleLevelSchema,
|
|
35
|
-
CreateProjectRequestSchema: () => CreateProjectRequestSchema,
|
|
36
|
-
CreateProjectResponseSchema: () => CreateProjectResponseSchema,
|
|
37
33
|
EnvContextSchema: () => EnvContextSchema,
|
|
38
34
|
ErrorEntrySchema: () => ErrorEntrySchema,
|
|
39
35
|
FinalizeReportRequestSchema: () => FinalizeReportRequestSchema,
|
|
40
36
|
FinalizeReportResponseSchema: () => FinalizeReportResponseSchema,
|
|
41
37
|
InitiateReportRequestSchema: () => InitiateReportRequestSchema,
|
|
42
38
|
InitiateReportResponseSchema: () => InitiateReportResponseSchema,
|
|
43
|
-
IntegrationConfigSchema: () => IntegrationConfigSchema,
|
|
44
|
-
IntegrationProviderSchema: () => IntegrationProviderSchema,
|
|
45
|
-
IntegrationSchema: () => IntegrationSchema,
|
|
46
|
-
IntegrationStatusSchema: () => IntegrationStatusSchema,
|
|
47
39
|
LensClient: () => LensClient,
|
|
48
|
-
ListIntegrationsResponseSchema: () => ListIntegrationsResponseSchema,
|
|
49
40
|
ListReportsQuerySchema: () => ListReportsQuerySchema,
|
|
50
41
|
NetworkEntrySchema: () => NetworkEntrySchema,
|
|
51
|
-
ProjectSchema: () => ProjectSchema,
|
|
52
42
|
ReportMetadataSchema: () => ReportMetadataSchema,
|
|
53
43
|
ReportSchema: () => ReportSchema,
|
|
54
44
|
ReportStatusSchema: () => ReportStatusSchema,
|
|
55
45
|
ReportSummarySchema: () => ReportSummarySchema,
|
|
56
|
-
S3ConfigInputSchema: () => S3ConfigInputSchema,
|
|
57
|
-
S3ConfigPublicSchema: () => S3ConfigPublicSchema,
|
|
58
46
|
SDK_NAME: () => SDK_NAME,
|
|
59
47
|
SDK_VERSION: () => SDK_VERSION,
|
|
60
48
|
TargetElementSchema: () => TargetElementSchema,
|
|
61
|
-
UpdateProjectRequestSchema: () => UpdateProjectRequestSchema,
|
|
62
49
|
isAccessId: () => isAccessId,
|
|
63
50
|
isAccessSecret: () => isAccessSecret
|
|
64
51
|
});
|
|
@@ -14754,88 +14741,6 @@ var ApiErrorSchema = external_exports.object({
|
|
|
14754
14741
|
error: external_exports.string(),
|
|
14755
14742
|
message: external_exports.string()
|
|
14756
14743
|
});
|
|
14757
|
-
var IntegrationProviderSchema = external_exports.enum(["github", "jira", "linear"]);
|
|
14758
|
-
var IntegrationStatusSchema = external_exports.enum(["disconnected", "pending", "connected"]);
|
|
14759
|
-
var IntegrationConfigSchema = external_exports.object({
|
|
14760
|
-
/** github: "owner/repo" issues target. */
|
|
14761
|
-
repo: external_exports.string().optional(),
|
|
14762
|
-
/** linear: team key (e.g. "ENG"); defaults to the first team when unset. */
|
|
14763
|
-
teamKey: external_exports.string().optional(),
|
|
14764
|
-
/** jira: project key (e.g. "BUG"). Required before issues can be created. */
|
|
14765
|
-
projectKey: external_exports.string().optional(),
|
|
14766
|
-
/** jira: issue type name. Defaults to "Bug", falling back to "Task". */
|
|
14767
|
-
issueType: external_exports.string().optional()
|
|
14768
|
-
});
|
|
14769
|
-
var IntegrationSchema = external_exports.object({
|
|
14770
|
-
provider: IntegrationProviderSchema,
|
|
14771
|
-
status: IntegrationStatusSchema,
|
|
14772
|
-
account: external_exports.string().nullable().default(null),
|
|
14773
|
-
active: external_exports.boolean().default(false),
|
|
14774
|
-
config: IntegrationConfigSchema.default({})
|
|
14775
|
-
});
|
|
14776
|
-
var S3ConfigInputSchema = external_exports.object({
|
|
14777
|
-
bucket: external_exports.string().min(1),
|
|
14778
|
-
region: external_exports.string().min(1),
|
|
14779
|
-
endpoint: external_exports.string().url().optional(),
|
|
14780
|
-
accessKeyId: external_exports.string().min(1),
|
|
14781
|
-
secretAccessKey: external_exports.string().min(1),
|
|
14782
|
-
forcePathStyle: external_exports.boolean().optional()
|
|
14783
|
-
});
|
|
14784
|
-
var S3ConfigPublicSchema = external_exports.object({
|
|
14785
|
-
bucket: external_exports.string(),
|
|
14786
|
-
region: external_exports.string(),
|
|
14787
|
-
endpoint: external_exports.string().optional(),
|
|
14788
|
-
forcePathStyle: external_exports.boolean().optional(),
|
|
14789
|
-
/** e.g. "AKIA…F3D2" */
|
|
14790
|
-
accessKeyIdMasked: external_exports.string()
|
|
14791
|
-
});
|
|
14792
|
-
var ProjectSchema = external_exports.object({
|
|
14793
|
-
id: external_exports.string(),
|
|
14794
|
-
name: external_exports.string(),
|
|
14795
|
-
accessId: external_exports.string(),
|
|
14796
|
-
allowedOrigins: external_exports.array(external_exports.string()),
|
|
14797
|
-
/** Active issue destination; null until onboarding picks one. */
|
|
14798
|
-
destination: IntegrationProviderSchema.nullable(),
|
|
14799
|
-
/**
|
|
14800
|
-
* The customer dashboard page hosting the Lens components (e.g.
|
|
14801
|
-
* "https://admin.acme.com/lens"). Auto-created issues deep-link reports as
|
|
14802
|
-
* `<dashboardUrl>?report=<id>` when set.
|
|
14803
|
-
*/
|
|
14804
|
-
dashboardUrl: external_exports.string().nullable().default(null),
|
|
14805
|
-
s3: S3ConfigPublicSchema.nullable(),
|
|
14806
|
-
onboardedAt: external_exports.string().nullable(),
|
|
14807
|
-
createdAt: external_exports.string()
|
|
14808
|
-
});
|
|
14809
|
-
var CreateProjectRequestSchema = external_exports.object({
|
|
14810
|
-
name: external_exports.string().min(1).max(120),
|
|
14811
|
-
allowedOrigins: external_exports.array(external_exports.string()).default([])
|
|
14812
|
-
});
|
|
14813
|
-
var CreateProjectResponseSchema = external_exports.object({
|
|
14814
|
-
project: ProjectSchema,
|
|
14815
|
-
accessId: external_exports.string(),
|
|
14816
|
-
accessSecret: external_exports.string()
|
|
14817
|
-
});
|
|
14818
|
-
var UpdateProjectRequestSchema = external_exports.object({
|
|
14819
|
-
name: external_exports.string().min(1).max(120).optional(),
|
|
14820
|
-
allowedOrigins: external_exports.array(external_exports.string()).optional(),
|
|
14821
|
-
onboarded: external_exports.boolean().optional(),
|
|
14822
|
-
dashboardUrl: external_exports.string().url().nullable().optional()
|
|
14823
|
-
});
|
|
14824
|
-
var ListIntegrationsResponseSchema = external_exports.object({
|
|
14825
|
-
integrations: external_exports.array(IntegrationSchema)
|
|
14826
|
-
});
|
|
14827
|
-
var ConnectIntegrationRequestSchema = external_exports.object({
|
|
14828
|
-
/**
|
|
14829
|
-
* Where the provider's OAuth dance should land the user afterwards —
|
|
14830
|
-
* the calling dashboard's own URL. Packed into the signed `state` so the
|
|
14831
|
-
* fixed API callback can redirect back to any consumer dashboard.
|
|
14832
|
-
*/
|
|
14833
|
-
returnUrl: external_exports.string().url().optional()
|
|
14834
|
-
});
|
|
14835
|
-
var ConnectIntegrationResponseSchema = external_exports.object({
|
|
14836
|
-
authorizeUrl: external_exports.string(),
|
|
14837
|
-
provider: IntegrationProviderSchema
|
|
14838
|
-
});
|
|
14839
14744
|
|
|
14840
14745
|
// ../../node_modules/.pnpm/rrweb@2.1.0/node_modules/rrweb/dist/rrweb.js
|
|
14841
14746
|
var __defProp2 = Object.defineProperty;
|
|
@@ -29127,7 +29032,7 @@ async function domToBlob(node2, options) {
|
|
|
29127
29032
|
// ../core/dist/index.js
|
|
29128
29033
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
29129
29034
|
var SDK_VERSION = "0.0.1";
|
|
29130
|
-
var DEFAULT_ENDPOINT = "https://api
|
|
29035
|
+
var DEFAULT_ENDPOINT = "https://api.horus.sh";
|
|
29131
29036
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
29132
29037
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
|
29133
29038
|
var DEFAULT_MAX_NETWORK_ENTRIES = 100;
|
|
@@ -29476,6 +29381,11 @@ var ReplayRecorder = class {
|
|
|
29476
29381
|
emit: (event, isCheckout) => this.onEmit(event, isCheckout),
|
|
29477
29382
|
checkoutEveryNms: this.windowMs,
|
|
29478
29383
|
recordCanvas: false,
|
|
29384
|
+
// Inline same-origin + CORS images as data URIs at snapshot time so the
|
|
29385
|
+
// dashboard replay paints on a different origin (tainted cross-origin
|
|
29386
|
+
// images fall back to their URL, which is fine for public CDNs).
|
|
29387
|
+
inlineImages: true,
|
|
29388
|
+
collectFonts: true,
|
|
29479
29389
|
// Keep the Lens overlay itself out of every recording.
|
|
29480
29390
|
blockSelector: `#${LENS_OVERLAY_HOST_ID}`
|
|
29481
29391
|
});
|
|
@@ -29582,7 +29492,7 @@ var ReplayRecorder = class {
|
|
|
29582
29492
|
console.warn("[lens] rrweb recording unavailable; replay disabled", err);
|
|
29583
29493
|
}
|
|
29584
29494
|
};
|
|
29585
|
-
async function captureScreenshot(excludeHost) {
|
|
29495
|
+
async function captureScreenshot(excludeHost, crop) {
|
|
29586
29496
|
if (typeof document === "undefined" || typeof window === "undefined") return null;
|
|
29587
29497
|
try {
|
|
29588
29498
|
const viewportPixels = window.innerWidth * window.innerHeight || 1;
|
|
@@ -29616,12 +29526,50 @@ async function captureScreenshot(excludeHost) {
|
|
|
29616
29526
|
);
|
|
29617
29527
|
return null;
|
|
29618
29528
|
}
|
|
29529
|
+
if (crop) {
|
|
29530
|
+
const cropped = await cropBlob(blob2, crop, scale);
|
|
29531
|
+
return cropped ?? blob2;
|
|
29532
|
+
}
|
|
29619
29533
|
return blob2;
|
|
29620
29534
|
} catch (err) {
|
|
29621
29535
|
console.warn("[lens] screenshot capture failed:", err);
|
|
29622
29536
|
return null;
|
|
29623
29537
|
}
|
|
29624
29538
|
}
|
|
29539
|
+
async function cropBlob(blob2, crop, scale) {
|
|
29540
|
+
try {
|
|
29541
|
+
if (typeof createImageBitmap !== "function" || typeof document === "undefined") return null;
|
|
29542
|
+
const bitmap = await createImageBitmap(blob2);
|
|
29543
|
+
let sx = Math.round(crop.x * scale);
|
|
29544
|
+
let sy = Math.round(crop.y * scale);
|
|
29545
|
+
let sw = Math.round(crop.width * scale);
|
|
29546
|
+
let sh = Math.round(crop.height * scale);
|
|
29547
|
+
sx = Math.max(0, Math.min(sx, bitmap.width));
|
|
29548
|
+
sy = Math.max(0, Math.min(sy, bitmap.height));
|
|
29549
|
+
sw = Math.min(sw, bitmap.width - sx);
|
|
29550
|
+
sh = Math.min(sh, bitmap.height - sy);
|
|
29551
|
+
if (sw <= 0 || sh <= 0) {
|
|
29552
|
+
bitmap.close?.();
|
|
29553
|
+
return null;
|
|
29554
|
+
}
|
|
29555
|
+
const canvas = document.createElement("canvas");
|
|
29556
|
+
canvas.width = sw;
|
|
29557
|
+
canvas.height = sh;
|
|
29558
|
+
const ctx = canvas.getContext("2d");
|
|
29559
|
+
if (!ctx) {
|
|
29560
|
+
bitmap.close?.();
|
|
29561
|
+
return null;
|
|
29562
|
+
}
|
|
29563
|
+
ctx.drawImage(bitmap, sx, sy, sw, sh, 0, 0, sw, sh);
|
|
29564
|
+
bitmap.close?.();
|
|
29565
|
+
return await new Promise((resolve) => {
|
|
29566
|
+
canvas.toBlob((out) => resolve(out), "image/jpeg", 0.82);
|
|
29567
|
+
});
|
|
29568
|
+
} catch (err) {
|
|
29569
|
+
console.warn("[lens] screenshot crop failed:", err);
|
|
29570
|
+
return null;
|
|
29571
|
+
}
|
|
29572
|
+
}
|
|
29625
29573
|
function parseBrowser(ua) {
|
|
29626
29574
|
if (!ua) return void 0;
|
|
29627
29575
|
const checks = [
|
|
@@ -29886,7 +29834,7 @@ var LensClient = class {
|
|
|
29886
29834
|
const wantErrors = include.errors !== false;
|
|
29887
29835
|
const wantScreenshot = include.screenshot !== false;
|
|
29888
29836
|
const wantDom = include.dom !== false;
|
|
29889
|
-
const screenshotPromise = this.screenshotEnabled && wantScreenshot ? captureScreenshot(input2.excludeFromScreenshot) : Promise.resolve(null);
|
|
29837
|
+
const screenshotPromise = this.screenshotEnabled && wantScreenshot ? captureScreenshot(input2.excludeFromScreenshot, input2.screenshotCrop) : Promise.resolve(null);
|
|
29890
29838
|
const replayEvents = wantReplay ? this.replay?.snapshot() ?? [] : [];
|
|
29891
29839
|
const errorEntries = this.errorBuffer.drain();
|
|
29892
29840
|
const consoleTail = this.consoleBuffer.tail(CONSOLE_TAIL_SIZE);
|
|
@@ -29985,37 +29933,24 @@ var LensClient = class {
|
|
|
29985
29933
|
AssetKindSchema,
|
|
29986
29934
|
AssetRefSchema,
|
|
29987
29935
|
AttachAssetRequestSchema,
|
|
29988
|
-
ConnectIntegrationRequestSchema,
|
|
29989
|
-
ConnectIntegrationResponseSchema,
|
|
29990
29936
|
ConsoleEntrySchema,
|
|
29991
29937
|
ConsoleLevelSchema,
|
|
29992
|
-
CreateProjectRequestSchema,
|
|
29993
|
-
CreateProjectResponseSchema,
|
|
29994
29938
|
EnvContextSchema,
|
|
29995
29939
|
ErrorEntrySchema,
|
|
29996
29940
|
FinalizeReportRequestSchema,
|
|
29997
29941
|
FinalizeReportResponseSchema,
|
|
29998
29942
|
InitiateReportRequestSchema,
|
|
29999
29943
|
InitiateReportResponseSchema,
|
|
30000
|
-
IntegrationConfigSchema,
|
|
30001
|
-
IntegrationProviderSchema,
|
|
30002
|
-
IntegrationSchema,
|
|
30003
|
-
IntegrationStatusSchema,
|
|
30004
29944
|
LensClient,
|
|
30005
|
-
ListIntegrationsResponseSchema,
|
|
30006
29945
|
ListReportsQuerySchema,
|
|
30007
29946
|
NetworkEntrySchema,
|
|
30008
|
-
ProjectSchema,
|
|
30009
29947
|
ReportMetadataSchema,
|
|
30010
29948
|
ReportSchema,
|
|
30011
29949
|
ReportStatusSchema,
|
|
30012
29950
|
ReportSummarySchema,
|
|
30013
|
-
S3ConfigInputSchema,
|
|
30014
|
-
S3ConfigPublicSchema,
|
|
30015
29951
|
SDK_NAME,
|
|
30016
29952
|
SDK_VERSION,
|
|
30017
29953
|
TargetElementSchema,
|
|
30018
|
-
UpdateProjectRequestSchema,
|
|
30019
29954
|
isAccessId,
|
|
30020
29955
|
isAccessSecret
|
|
30021
29956
|
});
|