@qawolf/api-contracts 0.77.0 → 0.78.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/v1/index.d.ts +72 -246
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +0 -6
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/investigation/finding.d.ts +0 -9
- package/dist/v1/investigation/finding.d.ts.map +1 -1
- package/dist/v1/investigation/finding.js +2 -30
- package/dist/v1/investigation/finding.js.map +1 -1
- package/dist/v1/investigation/get.d.ts +0 -13
- package/dist/v1/investigation/get.d.ts.map +1 -1
- package/dist/v1/investigation/get.js +0 -4
- package/dist/v1/investigation/get.js.map +1 -1
- package/dist/v1/investigation/index.d.ts +0 -13
- package/dist/v1/investigation/index.d.ts.map +1 -1
- package/dist/v1/runner/catalog.d.ts +36 -4
- package/dist/v1/runner/catalog.d.ts.map +1 -1
- package/dist/v1/runner/performActions.d.ts +33 -1
- package/dist/v1/runner/performActions.d.ts.map +1 -1
- package/dist/v1/runner/performActions.js +4 -4
- package/dist/v1/runner/performActions.js.map +1 -1
- package/dist/v1/runner/performActionsSteps.d.ts +3 -1
- package/dist/v1/runner/performActionsSteps.d.ts.map +1 -1
- package/dist/v1/runner/performActionsSteps.js +2 -0
- package/dist/v1/runner/performActionsSteps.js.map +1 -1
- package/dist/v1/runner/recording.d.ts +10 -10
- package/dist/v1/sharedSchemas.d.ts +0 -1
- package/dist/v1/sharedSchemas.d.ts.map +1 -1
- package/dist/v1/sharedSchemas.js +0 -1
- package/dist/v1/sharedSchemas.js.map +1 -1
- package/package.json +1 -1
- package/dist/v1/run/acceptScreenshotBaseline.d.ts +0 -34
- package/dist/v1/run/acceptScreenshotBaseline.d.ts.map +0 -1
- package/dist/v1/run/acceptScreenshotBaseline.js +0 -61
- package/dist/v1/run/acceptScreenshotBaseline.js.map +0 -1
- package/dist/v1/run/investigationSessionId.d.ts +0 -3
- package/dist/v1/run/investigationSessionId.d.ts.map +0 -1
- package/dist/v1/run/investigationSessionId.js +0 -12
- package/dist/v1/run/investigationSessionId.js.map +0 -1
- package/dist/v1/run/listScreenshotComparisons.d.ts +0 -60
- package/dist/v1/run/listScreenshotComparisons.d.ts.map +0 -1
- package/dist/v1/run/listScreenshotComparisons.js +0 -124
- package/dist/v1/run/listScreenshotComparisons.js.map +0 -1
- package/dist/v1/run/restoreScreenshotBaseline.d.ts +0 -33
- package/dist/v1/run/restoreScreenshotBaseline.d.ts.map +0 -1
- package/dist/v1/run/restoreScreenshotBaseline.js +0 -57
- package/dist/v1/run/restoreScreenshotBaseline.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
-
export declare const makeAcceptScreenshotBaselineContract: <RunId extends PublicIdSchema>(ids: {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
run: RunId;
|
|
6
|
-
}) => {
|
|
7
|
-
readonly annotations: {
|
|
8
|
-
readonly destructiveHint: true;
|
|
9
|
-
readonly openWorldHint: false;
|
|
10
|
-
readonly readOnlyHint: false;
|
|
11
|
-
};
|
|
12
|
-
readonly description: string;
|
|
13
|
-
readonly input: z.ZodObject<{
|
|
14
|
-
chatSessionId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
comparisonId: z.ZodString;
|
|
16
|
-
runId: RunId;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
readonly kind: "write";
|
|
19
|
-
readonly name: "run.acceptScreenshotBaseline";
|
|
20
|
-
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
-
baselineChangeId: z.ZodString;
|
|
22
|
-
name: z.ZodString;
|
|
23
|
-
outcome: z.ZodLiteral<"accepted">;
|
|
24
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
-
outcome: z.ZodLiteral<"baseline-changed">;
|
|
26
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
outcome: z.ZodLiteral<"needs-approval">;
|
|
28
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
-
outcome: z.ZodLiteral<"not-investigation-session">;
|
|
30
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
outcome: z.ZodLiteral<"nothing-to-accept">;
|
|
32
|
-
}, z.core.$strip>], "outcome">;
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=acceptScreenshotBaseline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acceptScreenshotBaseline.d.ts","sourceRoot":"","sources":["../../../src/v1/run/acceptScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,oCAAoC,GAC/C,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFA,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { investigationSessionId } from "./investigationSessionId.js";
|
|
3
|
-
export const makeAcceptScreenshotBaselineContract = (ids) => {
|
|
4
|
-
const input = z.object({
|
|
5
|
-
chatSessionId: investigationSessionId.describe("The chat session of the investigation that accepts the baseline. A workspace or organization API key acts as an automation, so it must send the session that investigates the run. A person's call ignores it."),
|
|
6
|
-
comparisonId: z
|
|
7
|
-
.string()
|
|
8
|
-
.trim()
|
|
9
|
-
.min(1)
|
|
10
|
-
.max(100)
|
|
11
|
-
.describe("The failed screenshot comparison whose new screenshot becomes the baseline, as `run.listScreenshotComparisons` names it."),
|
|
12
|
-
runId: ids.run,
|
|
13
|
-
});
|
|
14
|
-
const output = z.discriminatedUnion("outcome", [
|
|
15
|
-
z.object({
|
|
16
|
-
baselineChangeId: z
|
|
17
|
-
.string()
|
|
18
|
-
.describe("The baseline change. Record it on the fixed finding, and pass it to `run.restoreScreenshotBaseline` with this runId to put the old baseline back."),
|
|
19
|
-
name: z.string().describe("The screenshot name whose baseline changed."),
|
|
20
|
-
outcome: z
|
|
21
|
-
.literal("accepted")
|
|
22
|
-
.describe("The new screenshot is now the baseline. The old baseline is kept, so the change can be restored."),
|
|
23
|
-
}),
|
|
24
|
-
z.object({
|
|
25
|
-
outcome: z
|
|
26
|
-
.literal("baseline-changed")
|
|
27
|
-
.describe("The baseline is no longer the one the run compared with: someone changed or deleted it since. Nothing changed. List the comparisons again to see the current baseline."),
|
|
28
|
-
}),
|
|
29
|
-
z.object({
|
|
30
|
-
outcome: z
|
|
31
|
-
.literal("needs-approval")
|
|
32
|
-
.describe("Only a person can approve this change. Nothing changed. Propose the new baseline on a fix-proposed finding and wait for a person to apply it."),
|
|
33
|
-
}),
|
|
34
|
-
z.object({
|
|
35
|
-
outcome: z
|
|
36
|
-
.literal("not-investigation-session")
|
|
37
|
-
.describe("An API key that is not a person's can change a baseline only as the investigation of the run, and chatSessionId is missing or is not the session that investigates the run. Nothing changed."),
|
|
38
|
-
}),
|
|
39
|
-
z.object({
|
|
40
|
-
outcome: z
|
|
41
|
-
.literal("nothing-to-accept")
|
|
42
|
-
.describe("The comparison did not fail, or has no new screenshot to accept. Nothing changed."),
|
|
43
|
-
}),
|
|
44
|
-
]);
|
|
45
|
-
return {
|
|
46
|
-
annotations: {
|
|
47
|
-
destructiveHint: true,
|
|
48
|
-
openWorldHint: false,
|
|
49
|
-
readOnlyHint: false,
|
|
50
|
-
},
|
|
51
|
-
description: "Make the new screenshot of a failed screenshot comparison the baseline, so later runs compare with it. " +
|
|
52
|
-
"Use it only when the difference is an intended change of the app, not a bug, noise, or a page that was not ready. " +
|
|
53
|
-
"Every later run of every environment of the workspace compares with the new baseline. " +
|
|
54
|
-
"Refuses without changing anything when the baseline changed since the run.",
|
|
55
|
-
input,
|
|
56
|
-
kind: "write",
|
|
57
|
-
name: "run.acceptScreenshotBaseline",
|
|
58
|
-
output,
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=acceptScreenshotBaseline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acceptScreenshotBaseline.js","sourceRoot":"","sources":["../../../src/v1/run/acceptScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAElD,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,sBAAsB,CAAC,QAAQ,CAC5C,gNAAgN,CACjN;QACD,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CACP,0HAA0H,CAC3H;QACH,KAAK,EAAE,GAAG,CAAC,GAAG;KACf,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,gBAAgB,EAAE,CAAC;iBAChB,MAAM,EAAE;iBACR,QAAQ,CACP,mJAAmJ,CACpJ;YACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YACxE,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,UAAU,CAAC;iBACnB,QAAQ,CACP,kGAAkG,CACnG;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,kBAAkB,CAAC;iBAC3B,QAAQ,CACP,wKAAwK,CACzK;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,gBAAgB,CAAC;iBACzB,QAAQ,CACP,+IAA+I,CAChJ;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,2BAA2B,CAAC;iBACpC,QAAQ,CACP,8LAA8L,CAC/L;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,mBAAmB,CAAC;iBAC5B,QAAQ,CACP,mFAAmF,CACpF;SACJ,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,yGAAyG;YACzG,oHAAoH;YACpH,wFAAwF;YACxF,4EAA4E;QAC9E,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,8BAA8B;QACpC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investigationSessionId.d.ts","sourceRoot":"","sources":["../../../src/v1/run/investigationSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,sBAAsB,4BAKtB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// A plain string, not the chat session id schema: the server authorizes an id
|
|
3
|
-
// schema before the handler runs and answers a session the caller cannot see
|
|
4
|
-
// with not found, while these contracts promise `not-investigation-session`
|
|
5
|
-
// for every session that does not investigate the run.
|
|
6
|
-
export const investigationSessionId = z
|
|
7
|
-
.string()
|
|
8
|
-
.trim()
|
|
9
|
-
.min(1)
|
|
10
|
-
.max(100)
|
|
11
|
-
.optional();
|
|
12
|
-
//# sourceMappingURL=investigationSessionId.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investigationSessionId.js","sourceRoot":"","sources":["../../../src/v1/run/investigationSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,uDAAuD;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,QAAQ,EAAE,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
-
export declare const maxListedScreenshotAttempts = 20;
|
|
4
|
-
export declare const makeListScreenshotComparisonsContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
environment: EnvironmentId;
|
|
7
|
-
flow: FlowId;
|
|
8
|
-
run: RunId;
|
|
9
|
-
}) => {
|
|
10
|
-
readonly annotations: {
|
|
11
|
-
readonly destructiveHint: false;
|
|
12
|
-
readonly openWorldHint: false;
|
|
13
|
-
readonly readOnlyHint: false;
|
|
14
|
-
};
|
|
15
|
-
readonly description: string;
|
|
16
|
-
readonly input: z.ZodObject<{
|
|
17
|
-
flowIds: z.ZodOptional<z.ZodArray<FlowId>>;
|
|
18
|
-
runId: RunId;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
readonly kind: "read";
|
|
21
|
-
readonly name: "run.listScreenshotComparisons";
|
|
22
|
-
readonly output: z.ZodObject<{
|
|
23
|
-
comparisons: z.ZodArray<z.ZodObject<{
|
|
24
|
-
actualPreviewUrl: z.ZodOptional<z.ZodURL>;
|
|
25
|
-
actualUrl: z.ZodURL;
|
|
26
|
-
attemptCompletedAt: z.ZodISODateTime;
|
|
27
|
-
baselineStatus: z.ZodEnum<{
|
|
28
|
-
unknown: "unknown";
|
|
29
|
-
accepted: "accepted";
|
|
30
|
-
deleted: "deleted";
|
|
31
|
-
unchanged: "unchanged";
|
|
32
|
-
"changed-since-run": "changed-since-run";
|
|
33
|
-
}>;
|
|
34
|
-
comparisonId: z.ZodString;
|
|
35
|
-
diffPreviewUrl: z.ZodOptional<z.ZodURL>;
|
|
36
|
-
diffUrl: z.ZodURL;
|
|
37
|
-
expectedPreviewUrl: z.ZodOptional<z.ZodURL>;
|
|
38
|
-
expectedUrl: z.ZodURL;
|
|
39
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
40
|
-
flowId: FlowId;
|
|
41
|
-
lineNumber: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
name: z.ZodString;
|
|
43
|
-
passingElsewhere: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
|
-
status: z.ZodLiteral<"not-tracked">;
|
|
45
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
-
environments: z.ZodArray<z.ZodObject<{
|
|
47
|
-
environmentId: EnvironmentId;
|
|
48
|
-
lastPassedAt: z.ZodISODateTime;
|
|
49
|
-
}, z.core.$strip>>;
|
|
50
|
-
status: z.ZodLiteral<"tracked">;
|
|
51
|
-
}, z.core.$strip>], "status">;
|
|
52
|
-
runAttemptId: z.ZodString;
|
|
53
|
-
similarity: z.ZodNumber;
|
|
54
|
-
sizeMismatch: z.ZodBoolean;
|
|
55
|
-
}, z.core.$strip>>;
|
|
56
|
-
expiresAt: z.ZodISODateTime;
|
|
57
|
-
truncated: z.ZodBoolean;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=listScreenshotComparisons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listScreenshotComparisons.d.ts","sourceRoot":"","sources":["../../../src/v1/run/listScreenshotComparisons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,eAAO,MAAM,qCAAqC,GAChD,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoKA,CAAC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Matches the cap the server applies, so a caller can tell a cut list from a
|
|
3
|
-
// complete one by `truncated` alone.
|
|
4
|
-
export const maxListedScreenshotAttempts = 20;
|
|
5
|
-
export const makeListScreenshotComparisonsContract = (ids) => {
|
|
6
|
-
const input = z.object({
|
|
7
|
-
flowIds: z
|
|
8
|
-
.array(ids.flow)
|
|
9
|
-
.min(1)
|
|
10
|
-
.max(100)
|
|
11
|
-
.refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
|
|
12
|
-
.optional()
|
|
13
|
-
.describe("Only list the comparisons of these flows. Each flow must have a result in the run. Omit to list every failed flow of the run."),
|
|
14
|
-
runId: ids.run,
|
|
15
|
-
});
|
|
16
|
-
const imageUrl = (image) => z
|
|
17
|
-
.url()
|
|
18
|
-
.describe(`Signed URL of the full-size ${image} PNG. It stops working at expiresAt.`);
|
|
19
|
-
const previewUrl = (image) => z
|
|
20
|
-
.url()
|
|
21
|
-
.optional()
|
|
22
|
-
.describe(`Signed URL of a JPEG copy of the ${image} image, scaled down so its long edge is at most 1568 pixels. ` +
|
|
23
|
-
"Fetch this one to look at the image: it is small enough to view inline, while the full-size PNG can be too large. " +
|
|
24
|
-
"It stops working at expiresAt. Absent when QA Wolf could not make the copy, for example because the full-size image is gone.");
|
|
25
|
-
const passedEnvironment = z.object({
|
|
26
|
-
environmentId: ids.environment,
|
|
27
|
-
lastPassedAt: z.iso
|
|
28
|
-
.datetime()
|
|
29
|
-
.describe("When the latest passing comparison in this environment ran."),
|
|
30
|
-
});
|
|
31
|
-
const passingElsewhere = z
|
|
32
|
-
.discriminatedUnion("status", [
|
|
33
|
-
z.object({
|
|
34
|
-
status: z
|
|
35
|
-
.literal("not-tracked")
|
|
36
|
-
.describe("QA Wolf does not record screenshot comparisons for this workspace, so it cannot tell."),
|
|
37
|
-
}),
|
|
38
|
-
z.object({
|
|
39
|
-
environments: z
|
|
40
|
-
.array(passedEnvironment)
|
|
41
|
-
.describe("Other environments where the current baseline passed this screenshot in the last 14 days, most recent first. " +
|
|
42
|
-
"Empty when it passed nowhere else, or when the baseline no longer exists."),
|
|
43
|
-
status: z.literal("tracked"),
|
|
44
|
-
}),
|
|
45
|
-
])
|
|
46
|
-
.describe("Whether the current baseline still passes in other environments. " +
|
|
47
|
-
"A baseline that passes elsewhere points to a difference in this environment rather than an outdated baseline.");
|
|
48
|
-
const comparison = z.object({
|
|
49
|
-
actualPreviewUrl: previewUrl("actual"),
|
|
50
|
-
actualUrl: imageUrl("actual (the screenshot the flow took)"),
|
|
51
|
-
attemptCompletedAt: z.iso
|
|
52
|
-
.datetime()
|
|
53
|
-
.describe("When the run attempt that made the comparison finished."),
|
|
54
|
-
baselineStatus: z
|
|
55
|
-
.enum([
|
|
56
|
-
"unchanged",
|
|
57
|
-
"accepted",
|
|
58
|
-
"changed-since-run",
|
|
59
|
-
"deleted",
|
|
60
|
-
"unknown",
|
|
61
|
-
])
|
|
62
|
-
.describe('How the current baseline relates to the expected image this comparison used. "unchanged": the baseline is still the expected image. ' +
|
|
63
|
-
'"accepted": the baseline is now this comparison\'s actual screenshot, because someone accepted it, so a reattempt should pass. ' +
|
|
64
|
-
'"changed-since-run": someone replaced the baseline with another image after this run, so rerun the flow before deciding anything. ' +
|
|
65
|
-
'"deleted": the baseline no longer exists, and the next run will save its screenshot as the new baseline. ' +
|
|
66
|
-
'"unknown": the run\'s copy of the expected image is gone, so QA Wolf cannot compare.'),
|
|
67
|
-
comparisonId: z
|
|
68
|
-
.string()
|
|
69
|
-
.describe("Identifies this comparison: the run attempt id and the position of the comparison in that attempt."),
|
|
70
|
-
diffPreviewUrl: previewUrl("diff"),
|
|
71
|
-
diffUrl: imageUrl("diff (the pixels that differ are highlighted)"),
|
|
72
|
-
expectedPreviewUrl: previewUrl("expected"),
|
|
73
|
-
expectedUrl: imageUrl("expected (the baseline as it was when the flow ran)"),
|
|
74
|
-
filePath: z
|
|
75
|
-
.string()
|
|
76
|
-
.optional()
|
|
77
|
-
.describe("The flow file that made the comparison."),
|
|
78
|
-
flowId: ids.flow,
|
|
79
|
-
lineNumber: z
|
|
80
|
-
.number()
|
|
81
|
-
.int()
|
|
82
|
-
.optional()
|
|
83
|
-
.describe("The line of filePath that made the comparison."),
|
|
84
|
-
name: z
|
|
85
|
-
.string()
|
|
86
|
-
.describe("The screenshot name the flow passed to toHaveScreenshot. The baseline is stored as _screenshots_/<name>.png in team storage."),
|
|
87
|
-
passingElsewhere,
|
|
88
|
-
runAttemptId: z.string(),
|
|
89
|
-
similarity: z
|
|
90
|
-
.number()
|
|
91
|
-
.describe("How much of the actual image matches the expected image, in percent."),
|
|
92
|
-
sizeMismatch: z
|
|
93
|
-
.boolean()
|
|
94
|
-
.describe("The actual and expected images have different dimensions. That fails the comparison whatever the pixels show, and similarity reads 0."),
|
|
95
|
-
});
|
|
96
|
-
const output = z.object({
|
|
97
|
-
comparisons: z
|
|
98
|
-
.array(comparison)
|
|
99
|
-
.describe(`Each screenshot comparison that failed its flow, from the ${maxListedScreenshotAttempts} most recent failed attempts of the selected flows, oldest attempt first.`),
|
|
100
|
-
expiresAt: z.iso
|
|
101
|
-
.datetime()
|
|
102
|
-
.describe("When the image URLs stop working. Call run.listScreenshotComparisons again for fresh ones after it."),
|
|
103
|
-
truncated: z
|
|
104
|
-
.boolean()
|
|
105
|
-
.describe(`True when the selected flows have more than ${maxListedScreenshotAttempts} failed attempts. Only the ${maxListedScreenshotAttempts} most recent are listed, and the older attempts cannot be listed.`),
|
|
106
|
-
});
|
|
107
|
-
return {
|
|
108
|
-
annotations: {
|
|
109
|
-
destructiveHint: false,
|
|
110
|
-
openWorldHint: false,
|
|
111
|
-
readOnlyHint: false,
|
|
112
|
-
},
|
|
113
|
-
description: "List the screenshot comparisons that failed a run's flows, with the expected, actual and diff images of each. " +
|
|
114
|
-
"Only comparisons that caused a failure are listed: a screenshot that differs within tolerance, or that differs on a line that did not fail, is left out. " +
|
|
115
|
-
"Each comparison tells whether its baseline changed since the run and whether the baseline still passes in other environments. " +
|
|
116
|
-
"The image URLs expire after a few minutes; fetch the preview URLs to look at the images. " +
|
|
117
|
-
"The first call for an image makes its missing JPEG preview and keeps it in team storage, so later calls reuse it.",
|
|
118
|
-
input,
|
|
119
|
-
kind: "read",
|
|
120
|
-
name: "run.listScreenshotComparisons",
|
|
121
|
-
output,
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=listScreenshotComparisons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listScreenshotComparisons.js","sourceRoot":"","sources":["../../../src/v1/run/listScreenshotComparisons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6EAA6E;AAC7E,qCAAqC;AACrC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAInD,GAKD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,G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,CACxI;KACJ,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,UAAU,CAAC;aACjB,QAAQ,CACP,6DAA6D,2BAA2B,2EAA2E,CACpK;QACH,SAAS,EAAE,CAAC,CAAC,GAAG;aACb,QAAQ,EAAE;aACV,QAAQ,CACP,qGAAqG,CACtG;QACH,SAAS,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,CACP,+CAA+C,2BAA2B,8BAA8B,2BAA2B,mEAAmE,CACvM;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,gHAAgH;YAChH,2JAA2J;YAC3J,gIAAgI;YAChI,2FAA2F;YAC3F,mHAAmH;QACrH,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,+BAA+B;QACrC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
-
export declare const makeRestoreScreenshotBaselineContract: <RunId extends PublicIdSchema>(ids: {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
run: RunId;
|
|
6
|
-
}) => {
|
|
7
|
-
readonly annotations: {
|
|
8
|
-
readonly destructiveHint: true;
|
|
9
|
-
readonly openWorldHint: false;
|
|
10
|
-
readonly readOnlyHint: false;
|
|
11
|
-
};
|
|
12
|
-
readonly description: string;
|
|
13
|
-
readonly input: z.ZodObject<{
|
|
14
|
-
baselineChangeId: z.ZodString;
|
|
15
|
-
chatSessionId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
runId: RunId;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
readonly kind: "write";
|
|
19
|
-
readonly name: "run.restoreScreenshotBaseline";
|
|
20
|
-
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
-
name: z.ZodString;
|
|
22
|
-
outcome: z.ZodLiteral<"restored">;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
-
outcome: z.ZodLiteral<"baseline-changed">;
|
|
25
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
-
outcome: z.ZodLiteral<"needs-dispute">;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
outcome: z.ZodLiteral<"not-investigation-session">;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
outcome: z.ZodLiteral<"nothing-to-restore">;
|
|
31
|
-
}, z.core.$strip>], "outcome">;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=restoreScreenshotBaseline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restoreScreenshotBaseline.d.ts","sourceRoot":"","sources":["../../../src/v1/run/restoreScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,qCAAqC,GAChD,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEA,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { investigationSessionId } from "./investigationSessionId.js";
|
|
3
|
-
export const makeRestoreScreenshotBaselineContract = (ids) => {
|
|
4
|
-
const input = z.object({
|
|
5
|
-
baselineChangeId: z
|
|
6
|
-
.string()
|
|
7
|
-
.trim()
|
|
8
|
-
.min(1)
|
|
9
|
-
.max(100)
|
|
10
|
-
.describe("The baseline change to undo, as `run.acceptScreenshotBaseline` returned it for this run."),
|
|
11
|
-
chatSessionId: investigationSessionId.describe("The chat session of the investigation that restores the baseline. A workspace or organization API key acts as an automation, so it must send the session that investigates the run. A person's call ignores it."),
|
|
12
|
-
runId: ids.run,
|
|
13
|
-
});
|
|
14
|
-
const output = z.discriminatedUnion("outcome", [
|
|
15
|
-
z.object({
|
|
16
|
-
name: z.string().describe("The screenshot name whose baseline changed."),
|
|
17
|
-
outcome: z
|
|
18
|
-
.literal("restored")
|
|
19
|
-
.describe("The baseline the change replaced is the baseline again."),
|
|
20
|
-
}),
|
|
21
|
-
z.object({
|
|
22
|
-
outcome: z
|
|
23
|
-
.literal("baseline-changed")
|
|
24
|
-
.describe("The baseline changed again after this change, so restoring it would undo someone else's change. Nothing changed."),
|
|
25
|
-
}),
|
|
26
|
-
z.object({
|
|
27
|
-
outcome: z
|
|
28
|
-
.literal("needs-dispute")
|
|
29
|
-
.describe("Only a person can restore this change, unless a person disputed the finding that made it. Nothing changed."),
|
|
30
|
-
}),
|
|
31
|
-
z.object({
|
|
32
|
-
outcome: z
|
|
33
|
-
.literal("not-investigation-session")
|
|
34
|
-
.describe("An API key that is not a person's can change a baseline only as the investigation of the run, and chatSessionId is missing or is not the session that investigates the run. Nothing changed."),
|
|
35
|
-
}),
|
|
36
|
-
z.object({
|
|
37
|
-
outcome: z
|
|
38
|
-
.literal("nothing-to-restore")
|
|
39
|
-
.describe("The change was already restored, the name had no baseline before it, or the kept copy of the old baseline is missing or is not the baseline the change replaced. Nothing changed."),
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
return {
|
|
43
|
-
annotations: {
|
|
44
|
-
destructiveHint: true,
|
|
45
|
-
openWorldHint: false,
|
|
46
|
-
readOnlyHint: false,
|
|
47
|
-
},
|
|
48
|
-
description: "Undo a screenshot baseline change that accepted a failed comparison of the run: put back the baseline it replaced, so later runs compare with the old baseline again. " +
|
|
49
|
-
"Use it when a person disputes a baseline the AI accepted. " +
|
|
50
|
-
"Refuses without changing anything when the baseline changed again since.",
|
|
51
|
-
input,
|
|
52
|
-
kind: "write",
|
|
53
|
-
name: "run.restoreScreenshotBaseline",
|
|
54
|
-
output,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=restoreScreenshotBaseline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restoreScreenshotBaseline.js","sourceRoot":"","sources":["../../../src/v1/run/restoreScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAEnD,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,gBAAgB,EAAE,CAAC;aAChB,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CACP,0FAA0F,CAC3F;QACH,aAAa,EAAE,sBAAsB,CAAC,QAAQ,CAC5C,iNAAiN,CAClN;QACD,KAAK,EAAE,GAAG,CAAC,GAAG;KACf,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YACxE,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,UAAU,CAAC;iBACnB,QAAQ,CAAC,yDAAyD,CAAC;SACvE,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,kBAAkB,CAAC;iBAC3B,QAAQ,CACP,kHAAkH,CACnH;SACJ,CAAC;QACF,CAAC,CA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