@alwaysmeticulous/cli 2.264.6 → 2.265.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.
@@ -1,9 +1,10 @@
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]="271cbea8-fb12-5484-b637-f53ec043a57c")}catch(e){}}();
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]="8bd4e484-ad21-53f2-97d9-b51c7dc7986a")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.agentCommand = void 0;
6
6
  const screenshot_dom_diff_command_1 = require("./screenshot-dom-diff.command");
7
+ const screenshot_image_files_command_1 = require("./screenshot-image-files.command");
7
8
  const screenshot_image_command_1 = require("./screenshot-image.command");
8
9
  const test_run_diffs_command_1 = require("./test-run-diffs.command");
9
10
  const timeline_command_1 = require("./timeline.command");
@@ -13,6 +14,7 @@ exports.agentCommand = {
13
14
  builder: (yargs) => yargs
14
15
  .command(test_run_diffs_command_1.testRunDiffsCommand)
15
16
  .command(screenshot_dom_diff_command_1.domDiffCommand)
17
+ .command(screenshot_image_files_command_1.imageFilesCommand)
16
18
  .command(screenshot_image_command_1.imageUrlsCommand)
17
19
  .command(timeline_command_1.timelineDiffCommand)
18
20
  .demandCommand()
@@ -22,4 +24,4 @@ exports.agentCommand = {
22
24
  },
23
25
  };
24
26
  //# sourceMappingURL=index.js.map
25
- //# debugId=271cbea8-fb12-5484-b637-f53ec043a57c
27
+ //# debugId=8bd4e484-ad21-53f2-97d9-b51c7dc7986a
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/commands/agent/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,+EAA+D;AAC/D,yEAA8D;AAC9D,qEAA+D;AAC/D,yDAAyD;AAE5C,QAAA,YAAY,GAAkB;IACzC,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,4CAA4C;IACtD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,OAAO,CAAC,4CAAmB,CAAC;SAC5B,OAAO,CAAC,4CAAc,CAAC;SACvB,OAAO,CAAC,2CAAgB,CAAC;SACzB,OAAO,CAAC,sCAAmB,CAAC;SAC5B,aAAa,EAAE;SACf,IAAI,EAAE;IACX,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"271cbea8-fb12-5484-b637-f53ec043a57c"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/commands/agent/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,+EAA+D;AAC/D,qFAAqE;AACrE,yEAA8D;AAC9D,qEAA+D;AAC/D,yDAAyD;AAE5C,QAAA,YAAY,GAAkB;IACzC,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,4CAA4C;IACtD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,OAAO,CAAC,4CAAmB,CAAC;SAC5B,OAAO,CAAC,4CAAc,CAAC;SACvB,OAAO,CAAC,kDAAiB,CAAC;SAC1B,OAAO,CAAC,2CAAgB,CAAC;SACzB,OAAO,CAAC,sCAAmB,CAAC;SAC5B,aAAa,EAAE;SACf,IAAI,EAAE;IACX,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"8bd4e484-ad21-53f2-97d9-b51c7dc7986a"}
@@ -0,0 +1,8 @@
1
+ import { CommandModule } from "yargs";
2
+ interface Options {
3
+ apiToken?: string | null | undefined;
4
+ replayDiffId: string;
5
+ screenshotName: string;
6
+ }
7
+ export declare const imageFilesCommand: CommandModule<unknown, Options>;
8
+ export {};
@@ -0,0 +1,62 @@
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]="eddc9a2a-df30-52e9-9a53-256bfdbd3541")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.imageFilesCommand = void 0;
6
+ const promises_1 = require("fs/promises");
7
+ const os_1 = require("os");
8
+ const path_1 = require("path");
9
+ const client_1 = require("@alwaysmeticulous/client");
10
+ const common_1 = require("@alwaysmeticulous/common");
11
+ const downloading_helpers_1 = require("@alwaysmeticulous/downloading-helpers");
12
+ const sentry_utils_1 = require("../../command-utils/sentry.utils");
13
+ const downloadImageToTmpDir = async (tmpDir, label, url) => {
14
+ const filePath = (0, path_1.join)(tmpDir, `${label}.png`);
15
+ await (0, downloading_helpers_1.downloadFile)(url, filePath);
16
+ return filePath;
17
+ };
18
+ const handler = async ({ apiToken, replayDiffId, screenshotName, }) => {
19
+ (0, common_1.initLogger)();
20
+ const client = (0, client_1.createClient)({ apiToken });
21
+ const urls = await (0, client_1.getScreenshotUrls)(client, replayDiffId, screenshotName);
22
+ const tmpDir = (0, path_1.join)((0, os_1.tmpdir)(), "meticulous-screenshots", `${replayDiffId}_${screenshotName}`);
23
+ await (0, promises_1.mkdir)(tmpDir, { recursive: true });
24
+ console.log(`outcome: ${urls.outcome}`);
25
+ const downloads = [];
26
+ if (urls.screenshot) {
27
+ downloads.push({ label: "screenshot", url: urls.screenshot });
28
+ }
29
+ if (urls.before) {
30
+ downloads.push({ label: "before", url: urls.before });
31
+ }
32
+ if (urls.after) {
33
+ downloads.push({ label: "after", url: urls.after });
34
+ }
35
+ if (urls.diffImage) {
36
+ downloads.push({ label: "diffImage", url: urls.diffImage });
37
+ }
38
+ const results = await Promise.all(downloads.map(({ label, url }) => downloadImageToTmpDir(tmpDir, label, url)));
39
+ for (let i = 0; i < downloads.length; i++) {
40
+ console.log(`${downloads[i].label}: ${results[i]}`);
41
+ }
42
+ };
43
+ exports.imageFilesCommand = {
44
+ command: "image-files",
45
+ describe: "Download screenshot images for a replay diff screenshot to local tmp files",
46
+ builder: {
47
+ apiToken: { string: true, description: "Meticulous API token" },
48
+ replayDiffId: {
49
+ string: true,
50
+ description: "The replay diff ID",
51
+ demandOption: true,
52
+ },
53
+ screenshotName: {
54
+ string: true,
55
+ description: 'Screenshot name (e.g. "after-event-5" or "end-state")',
56
+ demandOption: true,
57
+ },
58
+ },
59
+ handler: (0, sentry_utils_1.wrapHandler)(handler),
60
+ };
61
+ //# sourceMappingURL=screenshot-image-files.command.js.map
62
+ //# debugId=eddc9a2a-df30-52e9-9a53-256bfdbd3541
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot-image-files.command.js","sources":["../../../src/commands/agent/screenshot-image-files.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,0CAAoC;AACpC,2BAA4B;AAC5B,+BAA4B;AAC5B,qDAA2E;AAC3E,qDAAsD;AACtD,+EAAqE;AAErE,mEAA+D;AAQ/D,MAAM,qBAAqB,GAAG,KAAK,EACjC,MAAc,EACd,KAAa,EACb,GAAW,EACM,EAAE;IACnB,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC;IAC9C,MAAM,IAAA,kCAAY,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,GACN,EAAiB,EAAE;IAC3B,IAAA,mBAAU,GAAE,CAAC;IACb,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,EAAE,QA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AAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAC1C,CACF,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC;AAEW,QAAA,iBAAiB,GAAoC;IAChE,OAAO,EAAE,aAAa;IACtB,QAAQ,EACN,4EAA4E;IAC9E,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE;QAC/D,YAAY,EAAE;YACZ,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,oBAAoB;YACjC,YAAY,EAAE,IAAI;SACnB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,uDAAuD;YACpE,YAAY,EAAE,IAAI;SACnB;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"eddc9a2a-df30-52e9-9a53-256bfdbd3541"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.264.6",
3
+ "version": "2.265.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -75,5 +75,5 @@
75
75
  "bugs": {
76
76
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
77
77
  },
78
- "gitHead": "63d28d08f113c920b3a1cac6b8b7019a9d6e69c2"
78
+ "gitHead": "82bc03633f0c63e196ce5cf4bd5575fcf65a5bdb"
79
79
  }