@qawolf/api-contracts 0.58.0 → 0.59.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/agent/get.d.ts +8 -1
- package/dist/v1/agent/get.d.ts.map +1 -1
- package/dist/v1/agent/get.js +16 -1
- package/dist/v1/agent/get.js.map +1 -1
- package/dist/v1/agent/wait.d.ts +9 -0
- package/dist/v1/agent/wait.d.ts.map +1 -0
- package/dist/v1/agent/wait.js +6 -0
- package/dist/v1/agent/wait.js.map +1 -0
- package/dist/v1/deployment/find.d.ts +48 -0
- package/dist/v1/deployment/find.d.ts.map +1 -0
- package/dist/v1/deployment/find.js +30 -0
- package/dist/v1/deployment/find.js.map +1 -0
- package/dist/v1/deployment/index.d.ts +189 -0
- package/dist/v1/deployment/index.d.ts.map +1 -0
- package/dist/v1/deployment/index.js +9 -0
- package/dist/v1/deployment/index.js.map +1 -0
- package/dist/v1/deployment/listTriggerEvaluations.d.ts +96 -0
- package/dist/v1/deployment/listTriggerEvaluations.d.ts.map +1 -0
- package/dist/v1/deployment/listTriggerEvaluations.js +101 -0
- package/dist/v1/deployment/listTriggerEvaluations.js.map +1 -0
- package/dist/v1/deployment/resource.d.ts +29 -0
- package/dist/v1/deployment/resource.d.ts.map +1 -0
- package/dist/v1/deployment/resource.js +44 -0
- package/dist/v1/deployment/resource.js.map +1 -0
- package/dist/v1/ids.d.ts +2 -6
- package/dist/v1/ids.d.ts.map +1 -1
- package/dist/v1/ids.js.map +1 -1
- package/dist/v1/index.d.ts +278 -4
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +2 -4
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/sharedSchemas.d.ts +1 -0
- package/dist/v1/sharedSchemas.d.ts.map +1 -1
- package/dist/v1/sharedSchemas.js +1 -0
- package/dist/v1/sharedSchemas.js.map +1 -1
- package/package.json +1 -1
package/dist/v1/agent/get.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export declare const makeAgentGetContract: <ChatSessionId extends PublicIdSchema
|
|
|
9
9
|
readonly openWorldHint: false;
|
|
10
10
|
readonly readOnlyHint: true;
|
|
11
11
|
};
|
|
12
|
-
readonly description: "Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring.
|
|
12
|
+
readonly description: "Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring. Pass waitSeconds 45 so the server holds the check open and answers the moment something happens. Check again as soon as it returns; never sleep between checks or loop without waitSeconds. Pass the nextCursor from one response as the cursor on the next check; it then reads only what is new, and only for the session that minted it. Continue monitoring silently when the status is unchanged and no replies come back; do not narrate waiting, announce the next check, or ask whether to keep monitoring. Report only substantive new progress, questions, blockers, or the final outcome. A status of \"waiting-for-you\" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Surface an explicit request for user input even if the status still says \"working\". Include the session URL when reporting a blocker or final outcome. On \"completed\", stop status checks and verify the requested result before claiming success. For new flows, validation, publication in the target environment, and readiness are separate checks; a Git push or final reply does not prove the flow is active. If every requested result is verified but status remains \"working\", report the mismatch and stop monitoring. Stop on \"failed\" or \"cancelled\" and report any confirmed partial result.";
|
|
13
13
|
readonly input: z.ZodObject<{
|
|
14
14
|
cursor: z.ZodOptional<z.ZodString>;
|
|
15
15
|
sessionId: ChatSessionId;
|
|
16
|
+
waitSeconds: z.ZodOptional<z.ZodNumber>;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
18
|
readonly kind: "read";
|
|
18
19
|
readonly name: "agent.get";
|
|
@@ -31,6 +32,12 @@ export declare const makeAgentGetContract: <ChatSessionId extends PublicIdSchema
|
|
|
31
32
|
failed: "failed";
|
|
32
33
|
cancelled: "cancelled";
|
|
33
34
|
}>;
|
|
35
|
+
waitSeconds: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
wokeOn: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
reply: "reply";
|
|
38
|
+
status: "status";
|
|
39
|
+
timeout: "timeout";
|
|
40
|
+
}>>;
|
|
34
41
|
url: z.ZodURL;
|
|
35
42
|
}, z.core.$strip>;
|
|
36
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,oBAAoB,GAC/B,aAAa,SAAS,cAAc,EACpC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEA,CAAC"}
|
package/dist/v1/agent/get.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { resource } from "../resource.js";
|
|
3
3
|
import { agentReplySchema, agentSessionStatusSchema } from "./status.js";
|
|
4
|
+
import { agentWakeReasonSchema, maxAgentWaitSeconds } from "./wait.js";
|
|
4
5
|
export const makeAgentGetContract = (ids) => {
|
|
5
6
|
const input = z.object({
|
|
6
7
|
cursor: z
|
|
@@ -9,6 +10,12 @@ export const makeAgentGetContract = (ids) => {
|
|
|
9
10
|
.optional()
|
|
10
11
|
.describe("Opaque cursor copied from this same session's previous nextCursor. Omit to read from its first reply."),
|
|
11
12
|
sessionId: ids.chatSession.describe("The id agent.send answered with."),
|
|
13
|
+
waitSeconds: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.min(0)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(`How long the server may hold this check open, in seconds. Omit or pass 0 to answer at once. A larger value clamps to ${maxAgentWaitSeconds}. Check again as soon as a held check returns.`),
|
|
12
19
|
});
|
|
13
20
|
const output = resource({
|
|
14
21
|
nextCursor: z
|
|
@@ -20,6 +27,14 @@ export const makeAgentGetContract = (ids) => {
|
|
|
20
27
|
.describe("What the AI has said since the cursor, oldest first. A reply still being written returns again, longer. A reply carrying choices is a question the work is blocked on."),
|
|
21
28
|
sessionId: ids.chatSession,
|
|
22
29
|
status: agentSessionStatusSchema,
|
|
30
|
+
waitSeconds: z
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("The hold this check was allowed, in seconds, after clamping. Absent when the check did not wait."),
|
|
35
|
+
wokeOn: agentWakeReasonSchema
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Why this check answered when it did. Absent when the check did not wait. "timeout" means nothing new: replies is empty and nextCursor unchanged, so check again with the same cursor.'),
|
|
23
38
|
}, {
|
|
24
39
|
urlFieldDescription: "Absolute URL of the live session in the QA Wolf app.",
|
|
25
40
|
});
|
|
@@ -29,7 +44,7 @@ export const makeAgentGetContract = (ids) => {
|
|
|
29
44
|
openWorldHint: false,
|
|
30
45
|
readOnlyHint: true,
|
|
31
46
|
},
|
|
32
|
-
description: 'Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring.
|
|
47
|
+
description: 'Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring. Pass waitSeconds 45 so the server holds the check open and answers the moment something happens. Check again as soon as it returns; never sleep between checks or loop without waitSeconds. Pass the nextCursor from one response as the cursor on the next check; it then reads only what is new, and only for the session that minted it. Continue monitoring silently when the status is unchanged and no replies come back; do not narrate waiting, announce the next check, or ask whether to keep monitoring. Report only substantive new progress, questions, blockers, or the final outcome. A status of "waiting-for-you" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Surface an explicit request for user input even if the status still says "working". Include the session URL when reporting a blocker or final outcome. On "completed", stop status checks and verify the requested result before claiming success. For new flows, validation, publication in the target environment, and readiness are separate checks; a Git push or final reply does not prove the flow is active. If every requested result is verified but status remains "working", report the mismatch and stop monitoring. Stop on "failed" or "cancelled" and report any confirmed partial result.',
|
|
33
48
|
input,
|
|
34
49
|
kind: "read",
|
|
35
50
|
name: "agent.get",
|
package/dist/v1/agent/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/agent/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAGlC,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,uGAAuG,CACxG;QACH,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QACvE,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,wHAAwH,mBAAmB,gDAAgD,CAC5L;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,QAAQ,CACrB;QACE,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,uIAAuI,CACxI;QACH,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,gBAAgB,CAAC;aACvB,QAAQ,CACP,wKAAwK,CACzK;QACH,SAAS,EAAE,GAAG,CAAC,WAAW;QAC1B,MAAM,EAAE,wBAAwB;QAChC,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CACP,kGAAkG,CACnG;QACH,MAAM,EAAE,qBAAqB;aAC1B,QAAQ,EAAE;aACV,QAAQ,CACP,uLAAuL,CACxL;KACJ,EACD;QACE,mBAAmB,EACjB,sDAAsD;KACzD,CACF,CAAC;IAEF,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB;QACD,WAAW,EACT,o6CAAo6C;QACt6C,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const maxAgentWaitSeconds = 45;
|
|
3
|
+
export declare const agentWakeReasonSchema: z.ZodEnum<{
|
|
4
|
+
reply: "reply";
|
|
5
|
+
status: "status";
|
|
6
|
+
timeout: "timeout";
|
|
7
|
+
}>;
|
|
8
|
+
export type AgentWakeReason = z.infer<typeof agentWakeReasonSchema>;
|
|
9
|
+
//# sourceMappingURL=wait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../../src/v1/agent/wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,eAAO,MAAM,qBAAqB;;;;EAI/B,CAAC;AAEJ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const maxAgentWaitSeconds = 45;
|
|
3
|
+
export const agentWakeReasonSchema = z
|
|
4
|
+
.enum(["reply", "status", "timeout"])
|
|
5
|
+
.describe('Why a held check answered. "reply" means the AI said something new, "status" means the session settled or needs you, "timeout" means the hold ran out with nothing new.');
|
|
6
|
+
//# sourceMappingURL=wait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../../src/v1/agent/wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;KACpC,QAAQ,CACP,yKAAyK,CAC1K,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeFindDeploymentsContract: <DeploymentId extends PublicIdSchema, EnvironmentId extends PublicIdSchema, WorkspaceId extends PublicIdSchema>(ids: {
|
|
4
|
+
deployment: DeploymentId;
|
|
5
|
+
environment: EnvironmentId;
|
|
6
|
+
workspace: WorkspaceId;
|
|
7
|
+
}) => {
|
|
8
|
+
readonly annotations: {
|
|
9
|
+
readonly destructiveHint: false;
|
|
10
|
+
readonly openWorldHint: false;
|
|
11
|
+
readonly readOnlyHint: true;
|
|
12
|
+
};
|
|
13
|
+
readonly description: "List the deployments QA Wolf has received for the workspace, newest first. A deployment arrives through a code host integration's webhook or through deployment.reportStatus, and is what a deployment trigger evaluates against. deployment.listTriggerEvaluations reports each trigger's verdict for one deployment.";
|
|
14
|
+
readonly input: z.ZodObject<{
|
|
15
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
16
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
workspaceId: z.ZodOptional<WorkspaceId>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
readonly kind: "read";
|
|
20
|
+
readonly name: "deployment.find";
|
|
21
|
+
readonly output: z.ZodObject<{
|
|
22
|
+
deployments: z.ZodArray<z.ZodObject<{
|
|
23
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
24
|
+
commitAuthorName: z.ZodOptional<z.ZodString>;
|
|
25
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
26
|
+
commitSha: z.ZodOptional<z.ZodString>;
|
|
27
|
+
deployedAt: z.ZodISODateTime;
|
|
28
|
+
deployTarget: z.ZodOptional<z.ZodString>;
|
|
29
|
+
environmentId: EnvironmentId;
|
|
30
|
+
environmentName: z.ZodOptional<z.ZodString>;
|
|
31
|
+
id: DeploymentId;
|
|
32
|
+
provider: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
github: "github";
|
|
34
|
+
gitlab: "gitlab";
|
|
35
|
+
api: "api";
|
|
36
|
+
}>>;
|
|
37
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
success: "success";
|
|
39
|
+
pending: "pending";
|
|
40
|
+
failure: "failure";
|
|
41
|
+
inactive: "inactive";
|
|
42
|
+
}>>;
|
|
43
|
+
url: z.ZodURL;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/v1/deployment/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAKhD,eAAO,MAAM,2BAA2B,GACtC,YAAY,SAAS,cAAc,EACnC,aAAa,SAAS,cAAc,EACpC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,UAAU,EAAE,YAAY,CAAC;IACzB,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCA,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makePaginationInputFields, nextCursorSchema } from "../pagination.js";
|
|
3
|
+
import { makeDeploymentResourceSchema } from "./resource.js";
|
|
4
|
+
export const makeFindDeploymentsContract = (ids) => {
|
|
5
|
+
const input = z.object({
|
|
6
|
+
workspaceId: ids.workspace
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("The workspace to list deployments from. Required when authenticating with an organization or user API key."),
|
|
9
|
+
...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
|
|
10
|
+
});
|
|
11
|
+
const output = z.object({
|
|
12
|
+
deployments: z
|
|
13
|
+
.array(makeDeploymentResourceSchema(ids))
|
|
14
|
+
.describe("The workspace's deployments, newest first."),
|
|
15
|
+
nextCursor: nextCursorSchema,
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
annotations: {
|
|
19
|
+
destructiveHint: false,
|
|
20
|
+
openWorldHint: false,
|
|
21
|
+
readOnlyHint: true,
|
|
22
|
+
},
|
|
23
|
+
description: "List the deployments QA Wolf has received for the workspace, newest first. A deployment arrives through a code host integration's webhook or through deployment.reportStatus, and is what a deployment trigger evaluates against. deployment.listTriggerEvaluations reports each trigger's verdict for one deployment.",
|
|
24
|
+
input,
|
|
25
|
+
kind: "read",
|
|
26
|
+
name: "deployment.find",
|
|
27
|
+
output,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/v1/deployment/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAIzC,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,GAAG,CAAC,SAAS;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,4GAA4G,CAC7G;QACH,GAAG,yBAAyB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;KAClE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC;aACxC,QAAQ,CAAC,4CAA4C,CAAC;QACzD,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB;QACD,WAAW,EACT,wTAAwT;QAC1T,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,iBAAiB;QACvB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
2
|
+
export declare const makeDeploymentContracts: <DeploymentId extends PublicIdSchema, EnvironmentId extends PublicIdSchema, RunId extends PublicIdSchema, TriggerId extends PublicIdSchema, WorkspaceId extends PublicIdSchema>(ids: {
|
|
3
|
+
deployment: DeploymentId;
|
|
4
|
+
environment: EnvironmentId;
|
|
5
|
+
run: RunId;
|
|
6
|
+
trigger: TriggerId;
|
|
7
|
+
workspace: WorkspaceId;
|
|
8
|
+
}) => {
|
|
9
|
+
find: {
|
|
10
|
+
readonly annotations: {
|
|
11
|
+
readonly destructiveHint: false;
|
|
12
|
+
readonly openWorldHint: false;
|
|
13
|
+
readonly readOnlyHint: true;
|
|
14
|
+
};
|
|
15
|
+
readonly description: "List the deployments QA Wolf has received for the workspace, newest first. A deployment arrives through a code host integration's webhook or through deployment.reportStatus, and is what a deployment trigger evaluates against. deployment.listTriggerEvaluations reports each trigger's verdict for one deployment.";
|
|
16
|
+
readonly input: import("zod").ZodObject<{
|
|
17
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
19
|
+
workspaceId: import("zod").ZodOptional<WorkspaceId>;
|
|
20
|
+
}, import("zod/v4/core").$strip>;
|
|
21
|
+
readonly kind: "read";
|
|
22
|
+
readonly name: "deployment.find";
|
|
23
|
+
readonly output: import("zod").ZodObject<{
|
|
24
|
+
deployments: import("zod").ZodArray<import("zod").ZodObject<{
|
|
25
|
+
branch: import("zod").ZodOptional<import("zod").ZodString>;
|
|
26
|
+
commitAuthorName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
27
|
+
commitMessage: import("zod").ZodOptional<import("zod").ZodString>;
|
|
28
|
+
commitSha: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
deployedAt: import("zod").ZodISODateTime;
|
|
30
|
+
deployTarget: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
environmentId: EnvironmentId;
|
|
32
|
+
environmentName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
id: DeploymentId;
|
|
34
|
+
provider: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
35
|
+
github: "github";
|
|
36
|
+
gitlab: "gitlab";
|
|
37
|
+
api: "api";
|
|
38
|
+
}>>;
|
|
39
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
40
|
+
success: "success";
|
|
41
|
+
pending: "pending";
|
|
42
|
+
failure: "failure";
|
|
43
|
+
inactive: "inactive";
|
|
44
|
+
}>>;
|
|
45
|
+
url: import("zod").ZodURL;
|
|
46
|
+
}, import("zod/v4/core").$strip>>;
|
|
47
|
+
nextCursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
48
|
+
}, import("zod/v4/core").$strip>;
|
|
49
|
+
};
|
|
50
|
+
listTriggerEvaluations: {
|
|
51
|
+
readonly annotations: {
|
|
52
|
+
readonly destructiveHint: false;
|
|
53
|
+
readonly openWorldHint: false;
|
|
54
|
+
readonly readOnlyHint: true;
|
|
55
|
+
};
|
|
56
|
+
readonly description: "List the per-trigger verdicts recorded when a deployment was evaluated against the workspace's triggers. Each verdict says whether the trigger matched, did not match with the reason per condition, or was never considered and why. Verdicts are a snapshot from evaluation time: editing or deleting a trigger later does not change them.";
|
|
57
|
+
readonly input: import("zod").ZodObject<{
|
|
58
|
+
deploymentId: DeploymentId;
|
|
59
|
+
}, import("zod/v4/core").$strip>;
|
|
60
|
+
readonly kind: "read";
|
|
61
|
+
readonly name: "deployment.listTriggerEvaluations";
|
|
62
|
+
readonly output: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
63
|
+
evaluations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
64
|
+
triggerId: import("zod").ZodOptional<TriggerId>;
|
|
65
|
+
triggerName: import("zod").ZodString;
|
|
66
|
+
verdict: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
67
|
+
conditionSets: import("zod").ZodArray<import("zod").ZodObject<{
|
|
68
|
+
conditions: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
69
|
+
kind: import("zod").ZodEnum<{
|
|
70
|
+
branch: "branch";
|
|
71
|
+
deployTarget: "deployTarget";
|
|
72
|
+
environment: "environment";
|
|
73
|
+
}>;
|
|
74
|
+
outcome: import("zod").ZodLiteral<"matched">;
|
|
75
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
76
|
+
kind: import("zod").ZodEnum<{
|
|
77
|
+
branch: "branch";
|
|
78
|
+
deployTarget: "deployTarget";
|
|
79
|
+
environment: "environment";
|
|
80
|
+
}>;
|
|
81
|
+
outcome: import("zod").ZodLiteral<"did-not-match">;
|
|
82
|
+
reason: import("zod").ZodString;
|
|
83
|
+
}, import("zod/v4/core").$strip>], "outcome">>;
|
|
84
|
+
outcome: import("zod").ZodEnum<{
|
|
85
|
+
matched: "matched";
|
|
86
|
+
"did-not-match": "did-not-match";
|
|
87
|
+
}>;
|
|
88
|
+
}, import("zod/v4/core").$strip>>;
|
|
89
|
+
outcome: import("zod").ZodLiteral<"matched">;
|
|
90
|
+
run: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
91
|
+
runId: RunId;
|
|
92
|
+
status: import("zod").ZodLiteral<"ran">;
|
|
93
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
94
|
+
status: import("zod").ZodLiteral<"starting">;
|
|
95
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
96
|
+
reason: import("zod").ZodString;
|
|
97
|
+
status: import("zod").ZodLiteral<"did-not-run">;
|
|
98
|
+
supersededByRunId: import("zod").ZodOptional<RunId>;
|
|
99
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
100
|
+
status: import("zod").ZodLiteral<"unknown">;
|
|
101
|
+
}, import("zod/v4/core").$strip>], "status">;
|
|
102
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
103
|
+
conditionSets: import("zod").ZodArray<import("zod").ZodObject<{
|
|
104
|
+
conditions: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
105
|
+
kind: import("zod").ZodEnum<{
|
|
106
|
+
branch: "branch";
|
|
107
|
+
deployTarget: "deployTarget";
|
|
108
|
+
environment: "environment";
|
|
109
|
+
}>;
|
|
110
|
+
outcome: import("zod").ZodLiteral<"matched">;
|
|
111
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
112
|
+
kind: import("zod").ZodEnum<{
|
|
113
|
+
branch: "branch";
|
|
114
|
+
deployTarget: "deployTarget";
|
|
115
|
+
environment: "environment";
|
|
116
|
+
}>;
|
|
117
|
+
outcome: import("zod").ZodLiteral<"did-not-match">;
|
|
118
|
+
reason: import("zod").ZodString;
|
|
119
|
+
}, import("zod/v4/core").$strip>], "outcome">>;
|
|
120
|
+
outcome: import("zod").ZodEnum<{
|
|
121
|
+
matched: "matched";
|
|
122
|
+
"did-not-match": "did-not-match";
|
|
123
|
+
}>;
|
|
124
|
+
}, import("zod/v4/core").$strip>>;
|
|
125
|
+
outcome: import("zod").ZodLiteral<"did-not-match">;
|
|
126
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
127
|
+
outcome: import("zod").ZodLiteral<"not-considered">;
|
|
128
|
+
reason: import("zod").ZodEnum<{
|
|
129
|
+
"trigger-paused": "trigger-paused";
|
|
130
|
+
"not-a-deployment-trigger": "not-a-deployment-trigger";
|
|
131
|
+
}>;
|
|
132
|
+
}, import("zod/v4/core").$strip>], "outcome">;
|
|
133
|
+
}, import("zod/v4/core").$strip>>;
|
|
134
|
+
state: import("zod").ZodLiteral<"evaluated">;
|
|
135
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
136
|
+
state: import("zod").ZodLiteral<"not-evaluated">;
|
|
137
|
+
}, import("zod/v4/core").$strip>], "state">;
|
|
138
|
+
};
|
|
139
|
+
reportStatus: {
|
|
140
|
+
readonly annotations: {
|
|
141
|
+
readonly destructiveHint: true;
|
|
142
|
+
readonly openWorldHint: true;
|
|
143
|
+
readonly readOnlyHint: false;
|
|
144
|
+
};
|
|
145
|
+
readonly description: "Report a deployment lifecycle status. A deployment's first success report evaluates global triggers asynchronously, and it is the only report that does: a trigger added or unpaused later does not make an already reported deployment evaluate again. Report that deployment under a new providerDeploymentId to evaluate it against the current triggers. The response contains the deployment only, not the resulting runs. This route requires an organization or user API key.";
|
|
146
|
+
readonly input: import("zod").ZodObject<{
|
|
147
|
+
deployTarget: import("zod").ZodOptional<import("zod").ZodURL>;
|
|
148
|
+
environment: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
149
|
+
id: EnvironmentId;
|
|
150
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
151
|
+
baseEphemeralEnvironment: import("zod").ZodOptional<import("zod").ZodString>;
|
|
152
|
+
ephemeral: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
153
|
+
name: import("zod").ZodString;
|
|
154
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
155
|
+
environmentVariables: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
156
|
+
metadata: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
157
|
+
commitAuthorName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
158
|
+
commitMessage: import("zod").ZodOptional<import("zod").ZodString>;
|
|
159
|
+
commitSha: import("zod").ZodOptional<import("zod").ZodString>;
|
|
160
|
+
pullRequestNumber: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
161
|
+
ref: import("zod").ZodOptional<import("zod").ZodString>;
|
|
162
|
+
repository: import("zod").ZodOptional<import("zod").ZodString>;
|
|
163
|
+
}, import("zod/v4/core").$strict>>;
|
|
164
|
+
providerDeploymentId: import("zod").ZodString;
|
|
165
|
+
status: import("zod").ZodEnum<{
|
|
166
|
+
success: "success";
|
|
167
|
+
pending: "pending";
|
|
168
|
+
failure: "failure";
|
|
169
|
+
inactive: "inactive";
|
|
170
|
+
}>;
|
|
171
|
+
workspaceId: WorkspaceId;
|
|
172
|
+
}, import("zod/v4/core").$strict>;
|
|
173
|
+
readonly kind: "write";
|
|
174
|
+
readonly name: "deployment.reportStatus";
|
|
175
|
+
readonly output: import("zod").ZodObject<{
|
|
176
|
+
deployment: import("zod").ZodObject<{
|
|
177
|
+
id: DeploymentId;
|
|
178
|
+
status: import("zod").ZodEnum<{
|
|
179
|
+
success: "success";
|
|
180
|
+
pending: "pending";
|
|
181
|
+
failure: "failure";
|
|
182
|
+
inactive: "inactive";
|
|
183
|
+
}>;
|
|
184
|
+
url: import("zod").ZodURL;
|
|
185
|
+
}, import("zod/v4/core").$strip>;
|
|
186
|
+
}, import("zod/v4/core").$strip>;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/deployment/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,uBAAuB,GAClC,YAAY,SAAS,cAAc,EACnC,aAAa,SAAS,cAAc,EACpC,KAAK,SAAS,cAAc,EAC5B,SAAS,SAAS,cAAc,EAChC,WAAW,SAAS,cAAc,EAClC,KAAK;IACL,UAAU,EAAE,YAAY,CAAC;IACzB,WAAW,EAAE,aAAa,CAAC;IAC3B,GAAG,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { makeFindDeploymentsContract } from "./find.js";
|
|
2
|
+
import { makeListDeploymentTriggerEvaluationsContract } from "./listTriggerEvaluations.js";
|
|
3
|
+
import { makeReportDeploymentStatusContract } from "./reportStatus.js";
|
|
4
|
+
export const makeDeploymentContracts = (ids) => ({
|
|
5
|
+
find: makeFindDeploymentsContract(ids),
|
|
6
|
+
listTriggerEvaluations: makeListDeploymentTriggerEvaluationsContract(ids),
|
|
7
|
+
reportStatus: makeReportDeploymentStatusContract(ids),
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v1/deployment/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,4CAA4C,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAMrC,GAMD,EAAE,EAAE,CAAC,CAAC;IACL,IAAI,EAAE,2BAA2B,CAAC,GAAG,CAAC;IACtC,sBAAsB,EAAE,4CAA4C,CAAC,GAAG,CAAC;IACzE,YAAY,EAAE,kCAAkC,CAAC,GAAG,CAAC;CACtD,CAAC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { PublicIdSchema } from "../ids.js";
|
|
3
|
+
export declare const makeListDeploymentTriggerEvaluationsContract: <DeploymentId extends PublicIdSchema, RunId extends PublicIdSchema, TriggerId extends PublicIdSchema>(ids: {
|
|
4
|
+
deployment: DeploymentId;
|
|
5
|
+
run: RunId;
|
|
6
|
+
trigger: TriggerId;
|
|
7
|
+
}) => {
|
|
8
|
+
readonly annotations: {
|
|
9
|
+
readonly destructiveHint: false;
|
|
10
|
+
readonly openWorldHint: false;
|
|
11
|
+
readonly readOnlyHint: true;
|
|
12
|
+
};
|
|
13
|
+
readonly description: "List the per-trigger verdicts recorded when a deployment was evaluated against the workspace's triggers. Each verdict says whether the trigger matched, did not match with the reason per condition, or was never considered and why. Verdicts are a snapshot from evaluation time: editing or deleting a trigger later does not change them.";
|
|
14
|
+
readonly input: z.ZodObject<{
|
|
15
|
+
deploymentId: DeploymentId;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
readonly kind: "read";
|
|
18
|
+
readonly name: "deployment.listTriggerEvaluations";
|
|
19
|
+
readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
|
+
evaluations: z.ZodArray<z.ZodObject<{
|
|
21
|
+
triggerId: z.ZodOptional<TriggerId>;
|
|
22
|
+
triggerName: z.ZodString;
|
|
23
|
+
verdict: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
24
|
+
conditionSets: z.ZodArray<z.ZodObject<{
|
|
25
|
+
conditions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
+
kind: z.ZodEnum<{
|
|
27
|
+
branch: "branch";
|
|
28
|
+
deployTarget: "deployTarget";
|
|
29
|
+
environment: "environment";
|
|
30
|
+
}>;
|
|
31
|
+
outcome: z.ZodLiteral<"matched">;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
kind: z.ZodEnum<{
|
|
34
|
+
branch: "branch";
|
|
35
|
+
deployTarget: "deployTarget";
|
|
36
|
+
environment: "environment";
|
|
37
|
+
}>;
|
|
38
|
+
outcome: z.ZodLiteral<"did-not-match">;
|
|
39
|
+
reason: z.ZodString;
|
|
40
|
+
}, z.core.$strip>], "outcome">>;
|
|
41
|
+
outcome: z.ZodEnum<{
|
|
42
|
+
matched: "matched";
|
|
43
|
+
"did-not-match": "did-not-match";
|
|
44
|
+
}>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
outcome: z.ZodLiteral<"matched">;
|
|
47
|
+
run: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
runId: RunId;
|
|
49
|
+
status: z.ZodLiteral<"ran">;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
status: z.ZodLiteral<"starting">;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
reason: z.ZodString;
|
|
54
|
+
status: z.ZodLiteral<"did-not-run">;
|
|
55
|
+
supersededByRunId: z.ZodOptional<RunId>;
|
|
56
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
57
|
+
status: z.ZodLiteral<"unknown">;
|
|
58
|
+
}, z.core.$strip>], "status">;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
conditionSets: z.ZodArray<z.ZodObject<{
|
|
61
|
+
conditions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
kind: z.ZodEnum<{
|
|
63
|
+
branch: "branch";
|
|
64
|
+
deployTarget: "deployTarget";
|
|
65
|
+
environment: "environment";
|
|
66
|
+
}>;
|
|
67
|
+
outcome: z.ZodLiteral<"matched">;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
kind: z.ZodEnum<{
|
|
70
|
+
branch: "branch";
|
|
71
|
+
deployTarget: "deployTarget";
|
|
72
|
+
environment: "environment";
|
|
73
|
+
}>;
|
|
74
|
+
outcome: z.ZodLiteral<"did-not-match">;
|
|
75
|
+
reason: z.ZodString;
|
|
76
|
+
}, z.core.$strip>], "outcome">>;
|
|
77
|
+
outcome: z.ZodEnum<{
|
|
78
|
+
matched: "matched";
|
|
79
|
+
"did-not-match": "did-not-match";
|
|
80
|
+
}>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
outcome: z.ZodLiteral<"did-not-match">;
|
|
83
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
84
|
+
outcome: z.ZodLiteral<"not-considered">;
|
|
85
|
+
reason: z.ZodEnum<{
|
|
86
|
+
"trigger-paused": "trigger-paused";
|
|
87
|
+
"not-a-deployment-trigger": "not-a-deployment-trigger";
|
|
88
|
+
}>;
|
|
89
|
+
}, z.core.$strip>], "outcome">;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
state: z.ZodLiteral<"evaluated">;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
state: z.ZodLiteral<"not-evaluated">;
|
|
94
|
+
}, z.core.$strip>], "state">;
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=listTriggerEvaluations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTriggerEvaluations.d.ts","sourceRoot":"","sources":["../../../src/v1/deployment/listTriggerEvaluations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgHhD,eAAO,MAAM,4CAA4C,GACvD,YAAY,SAAS,cAAc,EACnC,KAAK,SAAS,cAAc,EAC5B,SAAS,SAAS,cAAc,EAChC,KAAK;IACL,UAAU,EAAE,YAAY,CAAC;IACzB,GAAG,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,SAAS,CAAC;CACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCA,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const conditionKindSchema = z
|
|
3
|
+
.enum(["environment", "deployTarget", "branch"])
|
|
4
|
+
.describe("What the condition checks on the deployment: the environment it reported into, the deploy target identifying the deployed app, or the git branch of the deployed commit.");
|
|
5
|
+
const conditionVerdictSchema = z.discriminatedUnion("outcome", [
|
|
6
|
+
z.object({
|
|
7
|
+
kind: conditionKindSchema,
|
|
8
|
+
outcome: z.literal("matched"),
|
|
9
|
+
}),
|
|
10
|
+
z.object({
|
|
11
|
+
kind: conditionKindSchema,
|
|
12
|
+
outcome: z.literal("did-not-match"),
|
|
13
|
+
reason: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe("Why the condition did not match this deployment, in plain language."),
|
|
16
|
+
}),
|
|
17
|
+
]);
|
|
18
|
+
const conditionSetsField = z
|
|
19
|
+
.array(z.object({
|
|
20
|
+
conditions: z
|
|
21
|
+
.array(conditionVerdictSchema)
|
|
22
|
+
.describe("One verdict per condition. Conditions in a set are ANDed; a set with no conditions matches every deployment."),
|
|
23
|
+
outcome: z
|
|
24
|
+
.enum(["matched", "did-not-match"])
|
|
25
|
+
.describe("Whether every condition in the set matched."),
|
|
26
|
+
}))
|
|
27
|
+
.describe("The trigger's condition sets as they were when the deployment was evaluated, each with per-condition verdicts. Sets are ORed: the trigger matches when any one set matches. Most triggers have exactly one set.");
|
|
28
|
+
const makeRunOutcomeSchema = (ids) => z
|
|
29
|
+
.discriminatedUnion("status", [
|
|
30
|
+
z.object({
|
|
31
|
+
runId: ids.run.describe("The run the trigger created."),
|
|
32
|
+
status: z.literal("ran"),
|
|
33
|
+
}),
|
|
34
|
+
z.object({ status: z.literal("starting") }),
|
|
35
|
+
z.object({
|
|
36
|
+
reason: z
|
|
37
|
+
.string()
|
|
38
|
+
.describe("Why the matched trigger created no run, in plain language."),
|
|
39
|
+
status: z.literal("did-not-run"),
|
|
40
|
+
supersededByRunId: ids.run
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("The run that covered this deployment instead, when an earlier delivery of the same deployment had already created one."),
|
|
43
|
+
}),
|
|
44
|
+
z.object({ status: z.literal("unknown") }),
|
|
45
|
+
])
|
|
46
|
+
.describe("What became of the match. Matching is not running: a matched trigger can still be stopped from creating a run, and did-not-run carries the reason. starting means run creation is still in progress; unknown means QA Wolf has no record of what followed the match.");
|
|
47
|
+
const makeVerdictSchema = (ids) => z
|
|
48
|
+
.discriminatedUnion("outcome", [
|
|
49
|
+
z.object({
|
|
50
|
+
conditionSets: conditionSetsField,
|
|
51
|
+
outcome: z.literal("matched"),
|
|
52
|
+
run: makeRunOutcomeSchema(ids),
|
|
53
|
+
}),
|
|
54
|
+
z.object({
|
|
55
|
+
conditionSets: conditionSetsField,
|
|
56
|
+
outcome: z.literal("did-not-match"),
|
|
57
|
+
}),
|
|
58
|
+
z.object({
|
|
59
|
+
outcome: z.literal("not-considered"),
|
|
60
|
+
reason: z
|
|
61
|
+
.enum(["trigger-paused", "not-a-deployment-trigger"])
|
|
62
|
+
.describe("Why the conditions were never checked. trigger-paused: the trigger was paused when the deployment was evaluated. not-a-deployment-trigger: the trigger has no deployment conditions (a schedule trigger, for example), so no deployment can fire it."),
|
|
63
|
+
}),
|
|
64
|
+
])
|
|
65
|
+
.describe("The trigger's verdict for this deployment: matched, did-not-match with per-condition verdicts, or not-considered when the conditions were never checked at all.");
|
|
66
|
+
const makeEvaluationSchema = (ids) => z.object({
|
|
67
|
+
triggerId: ids.trigger
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Absent when the trigger has been deleted since."),
|
|
70
|
+
triggerName: z
|
|
71
|
+
.string()
|
|
72
|
+
.describe("The trigger's name when the deployment was evaluated."),
|
|
73
|
+
verdict: makeVerdictSchema(ids),
|
|
74
|
+
});
|
|
75
|
+
export const makeListDeploymentTriggerEvaluationsContract = (ids) => {
|
|
76
|
+
const input = z.object({ deploymentId: ids.deployment });
|
|
77
|
+
const output = z.discriminatedUnion("state", [
|
|
78
|
+
z.object({
|
|
79
|
+
evaluations: z
|
|
80
|
+
.array(makeEvaluationSchema(ids))
|
|
81
|
+
.describe("One verdict per trigger that existed when the deployment was evaluated."),
|
|
82
|
+
state: z.literal("evaluated"),
|
|
83
|
+
}),
|
|
84
|
+
z
|
|
85
|
+
.object({ state: z.literal("not-evaluated") })
|
|
86
|
+
.describe("Triggers were never evaluated for this deployment. Only a deployment's first success report evaluates triggers, so a deployment that never reported success carries no verdicts."),
|
|
87
|
+
]);
|
|
88
|
+
return {
|
|
89
|
+
annotations: {
|
|
90
|
+
destructiveHint: false,
|
|
91
|
+
openWorldHint: false,
|
|
92
|
+
readOnlyHint: true,
|
|
93
|
+
},
|
|
94
|
+
description: "List the per-trigger verdicts recorded when a deployment was evaluated against the workspace's triggers. Each verdict says whether the trigger matched, did not match with the reason per condition, or was never considered and why. Verdicts are a snapshot from evaluation time: editing or deleting a trigger later does not change them.",
|
|
95
|
+
input,
|
|
96
|
+
kind: "read",
|
|
97
|
+
name: "deployment.listTriggerEvaluations",
|
|
98
|
+
output,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=listTriggerEvaluations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTriggerEvaluations.js","sourceRoot":"","sources":["../../../src/v1/deployment/listTriggerEvaluations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,mBAAmB,GAAG,CAAC;KAC1B,IAAI,CAAC,CAAC,aAAa,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;KAC/C,QAAQ,CACP,0KAA0K,CAC3K,CAAC;AAEJ,MAAM,sBAAsB,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;IAC7D,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;KAC9B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QACnC,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CACP,qEAAqE,CACtE;KACJ,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC;KACzB,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;IACP,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,sBAAsB,CAAC;SAC7B,QAAQ,CACP,8GAA8G,CAC/G;IACH,OAAO,EAAE,CAAC;SACP,IAAI,CAAC,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;SAClC,QAAQ,CAAC,6CAA6C,CAAC;CAC3D,CAAC,CACH;KACA,QAAQ,CACP,iNAAiN,CAClN,CAAC;AAEJ,MAAM,oBAAoB,GAAG,CAA+B,GAE3D,EAAE,EAAE,CACH,CAAC;KACE,kBAAkB,CAAC,QAAQ,EAAE;IAC5B,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACvD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;KACzB,CAAC;IACF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3C,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CACP,4DAA4D,CAC7D;QACH,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QAChC,iBAAiB,EAAE,GAAG,CAAC,GAAG;aACvB,QAAQ,EAAE;aACV,QAAQ,CACP,wHAAwH,CACzH;KACJ,CAAC;IACF,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;CAC3C,CAAC;KACD,QAAQ,CACP,sQAAsQ,CACvQ,CAAC;AAEN,MAAM,iBAAiB,GAAG,CAA+B,GAAmB,EAAE,EAAE,CAC9E,CAAC;KACE,kBAAkB,CAAC,SAAS,EAAE;IAC7B,CAAC,CAAC,MAAM,CAAC;QACP,aAAa,EAAE,kBAAkB;QACjC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7B,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC;KAC/B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,aAAa,EAAE,kBAAkB;QACjC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;KACpC,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACpC,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAAC;aACpD,QAAQ,CACP,sPAAsP,CACvP;KACJ,CAAC;CACH,CAAC;KACD,QAAQ,CACP,iKAAiK,CAClK,CAAC;AAEN,MAAM,oBAAoB,GAAG,CAG3B,GAGD,EAAE,EAAE,CACH,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,GAAG,CAAC,OAAO;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;IAC9D,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,CAAC,uDAAuD,CAAC;IACpE,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC;CAChC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAI1D,GAID,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;QAC3C,CAAC,CAAC,MAAM,CAAC;YACP,WAAW,EAAE,CAAC;iBACX,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;iBAChC,QAAQ,CACP,yEAAyE,CAC1E;YACH,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;SAC9B,CAAC;QACF,CAAC;aACE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;aAC7C,QAAQ,CACP,kLAAkL,CACnL;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB;QACD,WAAW,EACT,+UAA+U;QACjV,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mCAAmC;QACzC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
|