@alwaysmeticulous/record 2.287.1 → 2.288.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/record/__tests__/get-recording-snippet-url.spec.d.ts +1 -0
- package/dist/record/__tests__/get-recording-snippet-url.spec.js +27 -0
- package/dist/record/__tests__/get-recording-snippet-url.spec.js.map +1 -0
- package/dist/record/constants.d.ts +1 -0
- package/dist/record/constants.js +4 -3
- package/dist/record/constants.js.map +1 -1
- package/dist/record/get-recording-snippet-url.d.ts +1 -0
- package/dist/record/get-recording-snippet-url.js +14 -0
- package/dist/record/get-recording-snippet-url.js.map +1 -0
- package/dist/record/record.utils.js +9 -4
- package/dist/record/record.utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9b359b61-0a9f-58d3-8821-e3bfc2999422")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const get_recording_snippet_url_1 = require("../get-recording-snippet-url");
|
|
7
|
+
(0, vitest_1.describe)("getRecordingSnippetUrl", () => {
|
|
8
|
+
const originalSnippetsBaseUrl = process.env["METICULOUS_SNIPPETS_BASE_URL"];
|
|
9
|
+
(0, vitest_1.afterEach)(() => {
|
|
10
|
+
if (originalSnippetsBaseUrl === undefined) {
|
|
11
|
+
delete process.env["METICULOUS_SNIPPETS_BASE_URL"];
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
process.env["METICULOUS_SNIPPETS_BASE_URL"] = originalSnippetsBaseUrl;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.it)("returns the default CDN recording snippet URL", () => {
|
|
18
|
+
delete process.env["METICULOUS_SNIPPETS_BASE_URL"];
|
|
19
|
+
(0, vitest_1.expect)((0, get_recording_snippet_url_1.getRecordingSnippetUrl)()).toBe("https://snippet.meticulous.ai/v1/meticulous.js");
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.it)("respects METICULOUS_SNIPPETS_BASE_URL", () => {
|
|
22
|
+
process.env["METICULOUS_SNIPPETS_BASE_URL"] = "http://localhost:8888/";
|
|
23
|
+
(0, vitest_1.expect)((0, get_recording_snippet_url_1.getRecordingSnippetUrl)()).toBe("http://localhost:8888/v1/meticulous.js");
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=get-recording-snippet-url.spec.js.map
|
|
27
|
+
//# debugId=9b359b61-0a9f-58d3-8821-e3bfc2999422
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-recording-snippet-url.spec.js","sources":["../../../src/record/__tests__/get-recording-snippet-url.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;AAAA,mCAAyD;AACzD,4EAAsE;AAEtE,IAAA,iBAAQ,EAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,MAAM,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAE5E,IAAA,kBAAS,EAAC,GAAG,EAAE;QACb,IAAI,uBAAuB,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,GAAG,uBAAuB,CAAC;QACxE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,OAAO,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QACnD,IAAA,eAAM,EAAC,IAAA,kDAAsB,GAAE,CAAC,CAAC,IAAI,CACnC,gDAAgD,CACjD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,GAAG,wBAAwB,CAAC;QACvE,IAAA,eAAM,EAAC,IAAA,kDAAsB,GAAE,CAAC,CAAC,IAAI,CACnC,wCAAwC,CACzC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debugId":"9b359b61-0a9f-58d3-8821-e3bfc2999422"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const RECORDING_SNIPPET_ASSET_PATH = "v1/meticulous.js";
|
|
1
2
|
export declare const DEFAULT_UPLOAD_INTERVAL_MS = 1000;
|
|
2
3
|
export declare const DEFAULT_NAVIGATION_TIMEOUT_MS = 120000;
|
|
3
4
|
export declare const INITIAL_METICULOUS_RECORD_DOCS_URL = "https://app.meticulous.ai/docs/recording-a-test";
|
package/dist/record/constants.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b9f28a11-d24a-57b4-a70b-e90b8db0327e")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.REQUIRED_CSP_ORIGINS = exports.COMMON_RECORD_CHROME_LAUNCH_ARGS = exports.METICULOUS_BYPASS_CSP_DOCS_URL = exports.METICULOUS_RECORD_LOGIN_FLOW_SAVING_DOCS_URL = exports.INITIAL_METICULOUS_RECORD_LOGIN_FLOW_DOCS_URL = exports.INITIAL_METICULOUS_RECORD_DOCS_URL = exports.DEFAULT_NAVIGATION_TIMEOUT_MS = exports.DEFAULT_UPLOAD_INTERVAL_MS = void 0;
|
|
5
|
+
exports.REQUIRED_CSP_ORIGINS = exports.COMMON_RECORD_CHROME_LAUNCH_ARGS = exports.METICULOUS_BYPASS_CSP_DOCS_URL = exports.METICULOUS_RECORD_LOGIN_FLOW_SAVING_DOCS_URL = exports.INITIAL_METICULOUS_RECORD_LOGIN_FLOW_DOCS_URL = exports.INITIAL_METICULOUS_RECORD_DOCS_URL = exports.DEFAULT_NAVIGATION_TIMEOUT_MS = exports.DEFAULT_UPLOAD_INTERVAL_MS = exports.RECORDING_SNIPPET_ASSET_PATH = void 0;
|
|
6
|
+
exports.RECORDING_SNIPPET_ASSET_PATH = "v1/meticulous.js";
|
|
6
7
|
exports.DEFAULT_UPLOAD_INTERVAL_MS = 1_000; // 1 second
|
|
7
8
|
exports.DEFAULT_NAVIGATION_TIMEOUT_MS = 120_000; // 2 minutes
|
|
8
9
|
exports.INITIAL_METICULOUS_RECORD_DOCS_URL = "https://app.meticulous.ai/docs/recording-a-test";
|
|
@@ -23,4 +24,4 @@ exports.REQUIRED_CSP_ORIGINS = [
|
|
|
23
24
|
"https://user-events-v3.s3-accelerate.amazonaws.com",
|
|
24
25
|
];
|
|
25
26
|
//# sourceMappingURL=constants.js.map
|
|
26
|
-
//# debugId=
|
|
27
|
+
//# debugId=b9f28a11-d24a-57b4-a70b-e90b8db0327e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/record/constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,0BAA0B,GAAG,KAAK,CAAC,CAAC,WAAW;AAE/C,QAAA,6BAA6B,GAAG,OAAO,CAAC,CAAC,YAAY;AAErD,QAAA,kCAAkC,GAC7C,iDAAiD,CAAC;AAEpD,0DAA0D;AAC7C,QAAA,6CAA6C,GACxD,uDAAuD,CAAC;AAE1D,0DAA0D;AAC7C,QAAA,4CAA4C,GACvD,8DAA8D,CAAC;AAEpD,QAAA,8BAA8B,GACzC,uEAAuE,CAAC;AAE7D,QAAA,gCAAgC,GAAG;IAC9C,kFAAkF;IAClF,sCAAsC;IACtC,+CAA+C;CAChD,CAAC;AAEF,mFAAmF;AACnF,wBAAwB;AACX,QAAA,oBAAoB,GAAG;IAClC,kDAAkD;IAClD,oDAAoD;CACrD,CAAC","debugId":"
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/record/constants.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAa,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAElD,QAAA,0BAA0B,GAAG,KAAK,CAAC,CAAC,WAAW;AAE/C,QAAA,6BAA6B,GAAG,OAAO,CAAC,CAAC,YAAY;AAErD,QAAA,kCAAkC,GAC7C,iDAAiD,CAAC;AAEpD,0DAA0D;AAC7C,QAAA,6CAA6C,GACxD,uDAAuD,CAAC;AAE1D,0DAA0D;AAC7C,QAAA,4CAA4C,GACvD,8DAA8D,CAAC;AAEpD,QAAA,8BAA8B,GACzC,uEAAuE,CAAC;AAE7D,QAAA,gCAAgC,GAAG;IAC9C,kFAAkF;IAClF,sCAAsC;IACtC,+CAA+C;CAChD,CAAC;AAEF,mFAAmF;AACnF,wBAAwB;AACX,QAAA,oBAAoB,GAAG;IAClC,kDAAkD;IAClD,oDAAoD;CACrD,CAAC","debugId":"b9f28a11-d24a-57b4-a70b-e90b8db0327e"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRecordingSnippetUrl: () => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="426e9f79-8b7f-56a5-bc72-31115382ea78")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getRecordingSnippetUrl = void 0;
|
|
6
|
+
const common_1 = require("@alwaysmeticulous/common");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const getRecordingSnippetUrl = () => {
|
|
9
|
+
const baseUrl = process.env["METICULOUS_SNIPPETS_BASE_URL"] || common_1.BASE_SNIPPETS_URL;
|
|
10
|
+
return new URL(constants_1.RECORDING_SNIPPET_ASSET_PATH, baseUrl).href;
|
|
11
|
+
};
|
|
12
|
+
exports.getRecordingSnippetUrl = getRecordingSnippetUrl;
|
|
13
|
+
//# sourceMappingURL=get-recording-snippet-url.js.map
|
|
14
|
+
//# debugId=426e9f79-8b7f-56a5-bc72-31115382ea78
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-recording-snippet-url.js","sources":["../../src/record/get-recording-snippet-url.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAA6D;AAC7D,2CAA2D;AAEpD,MAAM,sBAAsB,GAAG,GAAW,EAAE;IACjD,MAAM,OAAO,GACX,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,IAAI,0BAAiB,CAAC;IACnE,OAAO,IAAI,GAAG,CAAC,wCAA4B,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC,CAAC;AAJW,QAAA,sBAAsB,0BAIjC","debugId":"426e9f79-8b7f-56a5-bc72-31115382ea78"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4bd97891-7c15-54bd-9133-189ea7939b70")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.bootstrapPage = bootstrapPage;
|
|
6
6
|
const promises_1 = require("fs/promises");
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
|
+
const get_recording_snippet_url_1 = require("./get-recording-snippet-url");
|
|
8
9
|
const provide_cookie_access_1 = require("./utils/provide-cookie-access");
|
|
9
10
|
const wrap_in_should_record_condition_1 = require("./utils/wrap-in-should-record-condition");
|
|
10
11
|
// Setup Meticulous recording
|
|
11
12
|
async function bootstrapPage({ page, recordingToken, appCommitHash, recordingSnippet, uploadIntervalMs, captureHttpOnlyCookies, recordingSource = "cli", disablePasswordRedaction, }) {
|
|
12
13
|
const recordingSnippetFile = await (0, promises_1.readFile)(recordingSnippet, "utf8");
|
|
13
|
-
|
|
14
|
+
const snippetScriptUrl = (0, get_recording_snippet_url_1.getRecordingSnippetUrl)();
|
|
15
|
+
await page.evaluateOnNewDocument(({ recordingToken, appCommitHash, recordingSource, uploadIntervalMs, disablePasswordRedaction, snippetScriptUrl, }) => {
|
|
14
16
|
const recorderWindow = window;
|
|
17
|
+
recorderWindow.__meticulous = recorderWindow.__meticulous || {};
|
|
18
|
+
recorderWindow.__meticulous.snippetScriptSrc ??= snippetScriptUrl;
|
|
15
19
|
recorderWindow["METICULOUS_RECORDING_TOKEN"] = recordingToken;
|
|
16
20
|
recorderWindow["METICULOUS_APP_COMMIT_HASH"] = appCommitHash;
|
|
17
21
|
recorderWindow["METICULOUS_FORCE_RECORDING"] = true;
|
|
@@ -29,6 +33,7 @@ async function bootstrapPage({ page, recordingToken, appCommitHash, recordingSni
|
|
|
29
33
|
recordingSource,
|
|
30
34
|
uploadIntervalMs,
|
|
31
35
|
disablePasswordRedaction,
|
|
36
|
+
snippetScriptUrl,
|
|
32
37
|
});
|
|
33
38
|
if (captureHttpOnlyCookies) {
|
|
34
39
|
await (0, provide_cookie_access_1.provideCookieAccess)(page);
|
|
@@ -36,7 +41,7 @@ async function bootstrapPage({ page, recordingToken, appCommitHash, recordingSni
|
|
|
36
41
|
await page.evaluateOnNewDocument((0, wrap_in_should_record_condition_1.wrapInShouldRecordCondition)(recordingSnippetFile));
|
|
37
42
|
await page.evaluateOnNewDocument((requiredOrigins, docsPage) => {
|
|
38
43
|
if (window.parent !== window) {
|
|
39
|
-
return; //
|
|
44
|
+
return; // Only the top frame should trigger the bypass-CSP redirect; child frames must not navigate the whole tab.
|
|
40
45
|
}
|
|
41
46
|
addEventListener("securitypolicyviolation", (event) => {
|
|
42
47
|
if (requiredOrigins.some((origin) => event.blockedURI.startsWith(origin))) {
|
|
@@ -46,4 +51,4 @@ async function bootstrapPage({ page, recordingToken, appCommitHash, recordingSni
|
|
|
46
51
|
}, constants_1.REQUIRED_CSP_ORIGINS, constants_1.METICULOUS_BYPASS_CSP_DOCS_URL);
|
|
47
52
|
}
|
|
48
53
|
//# sourceMappingURL=record.utils.js.map
|
|
49
|
-
//# debugId=
|
|
54
|
+
//# debugId=4bd97891-7c15-54bd-9133-189ea7939b70
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.utils.js","sources":["../../src/record/record.utils.ts"],"sourceRoot":"","names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"record.utils.js","sources":["../../src/record/record.utils.ts"],"sourceRoot":"","names":[],"mappings":";;;;AA0BA,sCAiFC;AA3GD,0CAAuC;AAEvC,2CAGqB;AACrB,2EAAqE;AACrE,yEAAoE;AACpE,6FAAsF;AAiBtF,6BAA6B;AACtB,KAAK,UAAU,aAAa,CA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,MAAM,IAAI,CAAC,qBAAqB,CAC9B,IAAA,6DAA2B,EAAC,oBAAoB,CAAC,CAClD,CAAC;IAEF,MAAM,IAAI,CAAC,qBAAqB,CAC9B,CAAC,eAAe,EAAE,QAAQ,EAAE,EAAE;QAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,CAAC,2GAA2G;QACrH,CAAC;QACD,gBAAgB,CAAC,yBAAyB,EAAE,CAAC,KAAK,EAAE,EAAE;YACpD,IACE,eAAe,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EACrE,CAAC;gBACD,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EACD,gCAAoB,EACpB,0CAA8B,CAC/B,CAAC;AACJ,CAAC","debugId":"4bd97891-7c15-54bd-9133-189ea7939b70"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/record",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.288.0",
|
|
4
4
|
"description": "The Meticulous toolkit to record user sessions",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"chalk": "^4.1.2",
|
|
13
13
|
"loglevel": "^1.8.0",
|
|
14
14
|
"puppeteer-core": "24.14.0",
|
|
15
|
-
"@alwaysmeticulous/api": "2.
|
|
15
|
+
"@alwaysmeticulous/api": "2.288.0",
|
|
16
16
|
"@alwaysmeticulous/common": "2.287.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|