@mx-cartographer/experiences 9.4.19-alpha.al3 → 9.4.19-alpha.al4
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/rum/RumRedaction.d.ts +0 -2
- package/dist/rum/RumRedaction.es.js +1 -3
- package/dist/rum/RumRedaction.es.js.map +1 -1
- package/dist/rum/beforeSend.d.ts +2 -11
- package/dist/rum/beforeSend.es.js +8 -9
- package/dist/rum/beforeSend.es.js.map +1 -1
- package/dist/rum/index.d.ts +1 -1
- package/dist/rum/index.es.js +7 -9
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var t = /(\/(?:md\/[^/?#]+|login)\/)[^?#]+/g, o = (r) => typeof r == "string" ? r.replace(t, "$1REDACTED") : r;
|
|
2
2
|
export {
|
|
3
|
-
f as redactAmounts,
|
|
4
|
-
T as redactGuids,
|
|
5
3
|
o as redactSsoPath
|
|
6
4
|
};
|
|
7
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RumRedaction.es.js","names":[],"sources":["../../src/rum/RumRedaction.ts"],"sourcesContent":["//
|
|
1
|
+
{"version":3,"file":"RumRedaction.es.js","names":[],"sources":["../../src/rum/RumRedaction.ts"],"sourcesContent":["// Firefly's widget SSO deep-links put a live single-use auth token — and an\n// optional base64 params blob — directly in the path:\n// /md/<widget>/:single_sign_on_token(/:encoded_params) renders the widget in\n// place, so RUM's first view.url and every later view.referrer would otherwise\n// ship the token verbatim. Everything after the widget segment is replaced.\n// /login/:single_sign_on_token redirects, but still surfaces as a referrer.\n//\n// Nothing else is redacted. GUIDs and amounts are deliberately kept: they are\n// what support uses to find and follow a member's session.\nconst SSO_PATH_PATTERN = /(\\/(?:md\\/[^/?#]+|login)\\/)[^?#]+/g\n\nexport const redactSsoPath = <T extends string | undefined>(value: T): T =>\n typeof value === 'string' ? (value.replace(SSO_PATH_PATTERN, '$1REDACTED') as T) : value\n"],"mappings":"AASA,IAAM,IAAmB,sCAEZ,IAAA,CAA+C,MAC1D,OAAO,KAAU,WAAY,EAAM,QAAQ,GAAkB,YAAY,IAAU"}
|
package/dist/rum/beforeSend.d.ts
CHANGED
|
@@ -12,28 +12,19 @@ export interface RumBeforeSendEvent {
|
|
|
12
12
|
[key: string]: unknown;
|
|
13
13
|
};
|
|
14
14
|
error?: {
|
|
15
|
-
message: string;
|
|
16
|
-
stack?: string;
|
|
17
15
|
resource?: {
|
|
18
16
|
url: string;
|
|
19
17
|
[key: string]: unknown;
|
|
20
18
|
};
|
|
21
19
|
[key: string]: unknown;
|
|
22
20
|
};
|
|
23
|
-
action?: {
|
|
24
|
-
target?: {
|
|
25
|
-
name: string;
|
|
26
|
-
[key: string]: unknown;
|
|
27
|
-
};
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
30
21
|
[key: string]: unknown;
|
|
31
22
|
}
|
|
32
23
|
export interface RumBeforeSendOptions {
|
|
33
24
|
/**
|
|
34
|
-
*
|
|
25
|
+
* Scrub firefly's /md/<widget>/:single_sign_on_token deep-link paths and
|
|
35
26
|
* /login/:token referrers. Only the firefly host has those routes; a
|
|
36
|
-
*
|
|
27
|
+
* Cortex-served build should leave this off.
|
|
37
28
|
*/
|
|
38
29
|
scrubSsoPaths?: boolean;
|
|
39
30
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
const o = (r) => i ? a(c(r)) : c(r);
|
|
1
|
+
import { redactSsoPath as u } from "./RumRedaction.es.js";
|
|
2
|
+
function c({ scrubSsoPaths: s = !1 } = {}) {
|
|
4
3
|
return (r) => {
|
|
5
|
-
if (r.view && (r.view.url =
|
|
6
|
-
const { resource:
|
|
7
|
-
if (
|
|
8
|
-
const
|
|
9
|
-
return !(
|
|
4
|
+
if (s && (r.view && (r.view.url = u(r.view.url), r.view.referrer = u(r.view.referrer)), r.resource && (r.resource.url = u(r.resource.url)), r.error?.resource && (r.error.resource.url = u(r.error.resource.url))), r.type !== "resource" || !r.resource) return !0;
|
|
5
|
+
const { resource: e } = r;
|
|
6
|
+
if (e.type === "xhr" || e.type === "fetch") return !0;
|
|
7
|
+
const o = e.status_code;
|
|
8
|
+
return !(o !== void 0 && o > 0 && o < 400);
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
c as buildRumBeforeSend
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=beforeSend.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beforeSend.es.js","names":[],"sources":["../../src/rum/beforeSend.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"beforeSend.es.js","names":[],"sources":["../../src/rum/beforeSend.ts"],"sourcesContent":["import { redactSsoPath } from './RumRedaction'\n\n// The subset of a Datadog RUM event that beforeSend reads or writes. Structural\n// on purpose: any RumEvent from @datadog/browser-rum satisfies it, and this\n// package takes no dependency on the SDK. Every field written here is on the\n// SDK's beforeSend allowlist (MODIFIABLE_FIELD_PATHS_BY_EVENT in\n// browser-rum-core/domain/assembly) — writes to anything else are silently\n// discarded by the SDK.\n//\n// The index signatures matter: SDK event members carry other fields, and\n// TypeScript's weak-type rule would otherwise reject members that share no\n// property names with these shapes.\nexport interface RumBeforeSendEvent {\n type: string\n view?: { url: string; referrer?: string; [key: string]: unknown }\n resource?: { type?: string; url: string; status_code?: number; [key: string]: unknown }\n error?: { resource?: { url: string; [key: string]: unknown }; [key: string]: unknown }\n [key: string]: unknown\n}\n\nexport interface RumBeforeSendOptions {\n /**\n * Scrub firefly's /md/<widget>/:single_sign_on_token deep-link paths and\n * /login/:token referrers. Only the firefly host has those routes; a\n * Cortex-served build should leave this off.\n */\n scrubSsoPaths?: boolean\n}\n\n// Builds the beforeSend hook every MX RUM consumer installs: scrub live SSO\n// tokens out of URLs (when asked), then drop the successful static resources\n// that make up the bulk of the volume while keeping XHR/fetch so\n// client-perceived API latency stays visible.\nexport function buildRumBeforeSend({ scrubSsoPaths = false }: RumBeforeSendOptions = {}) {\n return (event: RumBeforeSendEvent): boolean => {\n if (scrubSsoPaths) {\n if (event.view) {\n event.view.url = redactSsoPath(event.view.url)\n event.view.referrer = redactSsoPath(event.view.referrer)\n }\n if (event.resource) event.resource.url = redactSsoPath(event.resource.url)\n if (event.error?.resource) event.error.resource.url = redactSsoPath(event.error.resource.url)\n }\n\n if (event.type !== 'resource' || !event.resource) return true\n const { resource } = event\n if (resource.type === 'xhr' || resource.type === 'fetch') return true\n const status = resource.status_code\n if (status !== undefined && status > 0 && status < 400) return false\n return true\n }\n}\n"],"mappings":";AAiCA,SAAgB,EAAmB,EAAE,eAAA,IAAgB,GAAA,IAAgC,CAAC,GAAG;AACvF,SAAA,CAAQ,MAAuC;AAU7C,QATI,MACE,EAAM,SACR,EAAM,KAAK,MAAM,EAAc,EAAM,KAAK,GAAG,GAC7C,EAAM,KAAK,WAAW,EAAc,EAAM,KAAK,QAAQ,IAErD,EAAM,aAAU,EAAM,SAAS,MAAM,EAAc,EAAM,SAAS,GAAG,IACrE,EAAM,OAAO,aAAU,EAAM,MAAM,SAAS,MAAM,EAAc,EAAM,MAAM,SAAS,GAAG,KAG1F,EAAM,SAAS,cAAc,CAAC,EAAM,SAAU,QAAO;AACzD,UAAM,EAAE,UAAA,EAAA,IAAa;AACrB,QAAI,EAAS,SAAS,SAAS,EAAS,SAAS,QAAS,QAAO;AACjE,UAAM,IAAS,EAAS;AACxB,WAAI,EAAA,MAAW,UAAa,IAAS,KAAK,IAAS;AAAA,EAErD;AACF"}
|
package/dist/rum/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { redactSsoPath } from './RumRedaction';
|
|
2
2
|
export { buildRumBeforeSend, type RumBeforeSendEvent, type RumBeforeSendOptions, } from './beforeSend';
|
|
3
3
|
export { createRumErrorBuffer, DEFAULT_RUM_ERROR_BUFFER_SIZE, type RumErrorBuffer, } from './errorBuffer';
|
package/dist/rum/index.es.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { buildRumBeforeSend as
|
|
3
|
-
import { DEFAULT_RUM_ERROR_BUFFER_SIZE as
|
|
1
|
+
import { redactSsoPath as o } from "./RumRedaction.es.js";
|
|
2
|
+
import { buildRumBeforeSend as m } from "./beforeSend.es.js";
|
|
3
|
+
import { DEFAULT_RUM_ERROR_BUFFER_SIZE as R, createRumErrorBuffer as f } from "./errorBuffer.es.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
o as
|
|
9
|
-
e as redactGuids,
|
|
10
|
-
t as redactSsoPath
|
|
5
|
+
R as DEFAULT_RUM_ERROR_BUFFER_SIZE,
|
|
6
|
+
m as buildRumBeforeSend,
|
|
7
|
+
f as createRumErrorBuffer,
|
|
8
|
+
o as redactSsoPath
|
|
11
9
|
};
|