@shipfox/api-runners-dto 12.4.0 → 13.0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/events.d.ts +0 -17
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +0 -9
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inter-module.d.ts +0 -27
- package/dist/inter-module.d.ts.map +1 -1
- package/dist/inter-module.js +0 -27
- package/dist/inter-module.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/events.ts +0 -12
- package/src/index.ts +0 -3
- package/src/inter-module.test.ts +0 -24
- package/src/inter-module.ts +0 -23
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/events.ts
CHANGED
|
@@ -4,7 +4,6 @@ const nonEmptyStringSchema = z.string().nonempty();
|
|
|
4
4
|
const isoDateTimeSchema = z.string().datetime();
|
|
5
5
|
|
|
6
6
|
export const RUNNER_JOB_LEASE_EXPIRED = 'runners.job.lease_expired' as const;
|
|
7
|
-
export const RUNNER_JOB_QUEUED = 'runners.job.queued' as const;
|
|
8
7
|
export const RUNNER_JOB_CLAIMED = 'runners.job.claimed' as const;
|
|
9
8
|
|
|
10
9
|
export const runnerJobLeaseExpiredEventSchema = z.object({
|
|
@@ -15,15 +14,6 @@ export const runnerJobLeaseExpiredEventSchema = z.object({
|
|
|
15
14
|
});
|
|
16
15
|
export type RunnerJobLeaseExpiredEvent = z.infer<typeof runnerJobLeaseExpiredEventSchema>;
|
|
17
16
|
|
|
18
|
-
export const runnerJobQueuedEventSchema = z.object({
|
|
19
|
-
workflowRunId: nonEmptyStringSchema,
|
|
20
|
-
workflowRunAttemptId: nonEmptyStringSchema,
|
|
21
|
-
jobId: nonEmptyStringSchema,
|
|
22
|
-
jobExecutionId: nonEmptyStringSchema,
|
|
23
|
-
queuedAt: isoDateTimeSchema,
|
|
24
|
-
});
|
|
25
|
-
export type RunnerJobQueuedEvent = z.infer<typeof runnerJobQueuedEventSchema>;
|
|
26
|
-
|
|
27
17
|
export const runnerJobClaimedEventSchema = z.object({
|
|
28
18
|
workflowRunId: nonEmptyStringSchema,
|
|
29
19
|
workflowRunAttemptId: nonEmptyStringSchema,
|
|
@@ -35,12 +25,10 @@ export type RunnerJobClaimedEvent = z.infer<typeof runnerJobClaimedEventSchema>;
|
|
|
35
25
|
|
|
36
26
|
export interface RunnersEventMap {
|
|
37
27
|
[RUNNER_JOB_LEASE_EXPIRED]: RunnerJobLeaseExpiredEvent;
|
|
38
|
-
[RUNNER_JOB_QUEUED]: RunnerJobQueuedEvent;
|
|
39
28
|
[RUNNER_JOB_CLAIMED]: RunnerJobClaimedEvent;
|
|
40
29
|
}
|
|
41
30
|
|
|
42
31
|
export const runnersEventSchemas = {
|
|
43
32
|
[RUNNER_JOB_LEASE_EXPIRED]: runnerJobLeaseExpiredEventSchema,
|
|
44
|
-
[RUNNER_JOB_QUEUED]: runnerJobQueuedEventSchema,
|
|
45
33
|
[RUNNER_JOB_CLAIMED]: runnerJobClaimedEventSchema,
|
|
46
34
|
} satisfies Record<keyof RunnersEventMap, z.ZodType>;
|
package/src/index.ts
CHANGED
|
@@ -138,13 +138,10 @@ export {
|
|
|
138
138
|
export {
|
|
139
139
|
RUNNER_JOB_CLAIMED,
|
|
140
140
|
RUNNER_JOB_LEASE_EXPIRED,
|
|
141
|
-
RUNNER_JOB_QUEUED,
|
|
142
141
|
type RunnerJobClaimedEvent,
|
|
143
142
|
type RunnerJobLeaseExpiredEvent,
|
|
144
|
-
type RunnerJobQueuedEvent,
|
|
145
143
|
type RunnersEventMap,
|
|
146
144
|
runnerJobClaimedEventSchema,
|
|
147
145
|
runnerJobLeaseExpiredEventSchema,
|
|
148
|
-
runnerJobQueuedEventSchema,
|
|
149
146
|
runnersEventSchemas,
|
|
150
147
|
} from './events.js';
|
package/src/inter-module.test.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import {runnersInterModuleContract} from './inter-module.js';
|
|
2
2
|
|
|
3
|
-
const id = '00000000-0000-4000-8000-000000000001';
|
|
4
|
-
|
|
5
3
|
describe('runnersInterModuleContract', () => {
|
|
6
|
-
test('accepts stable job-execution identities for idempotent commands', () => {
|
|
7
|
-
const input = runnersInterModuleContract.methods.enqueueJobExecution.input.parse({
|
|
8
|
-
workspaceId: id,
|
|
9
|
-
workflowRunId: id,
|
|
10
|
-
workflowRunAttemptId: id,
|
|
11
|
-
jobId: id,
|
|
12
|
-
jobExecutionId: id,
|
|
13
|
-
projectId: id,
|
|
14
|
-
requiredLabels: ['linux'],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
expect(input.jobExecutionId).toBe(id);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
4
|
test('exposes bounded JSON capability results', () => {
|
|
21
5
|
const result =
|
|
22
6
|
runnersInterModuleContract.methods.getEffectiveRunnerToolCapabilities.output.parse({
|
|
@@ -29,12 +13,4 @@ describe('runnersInterModuleContract', () => {
|
|
|
29
13
|
reportFresh: true,
|
|
30
14
|
});
|
|
31
15
|
});
|
|
32
|
-
|
|
33
|
-
test('defines the scheduling validation failure', () => {
|
|
34
|
-
const details = runnersInterModuleContract.methods.enqueueJobExecution.errors[
|
|
35
|
-
'empty-required-labels'
|
|
36
|
-
].parse({});
|
|
37
|
-
|
|
38
|
-
expect(details).toEqual({});
|
|
39
|
-
});
|
|
40
16
|
});
|
package/src/inter-module.ts
CHANGED
|
@@ -7,29 +7,6 @@ const idSchema = z.string().uuid();
|
|
|
7
7
|
export const runnersInterModuleContract = defineInterModuleContract({
|
|
8
8
|
module: 'runners',
|
|
9
9
|
methods: {
|
|
10
|
-
enqueueJobExecution: {
|
|
11
|
-
input: z.object({
|
|
12
|
-
workspaceId: idSchema,
|
|
13
|
-
workflowRunId: idSchema,
|
|
14
|
-
workflowRunAttemptId: idSchema,
|
|
15
|
-
jobId: idSchema,
|
|
16
|
-
jobExecutionId: idSchema,
|
|
17
|
-
projectId: idSchema,
|
|
18
|
-
requiredLabels: z.array(z.string()),
|
|
19
|
-
}),
|
|
20
|
-
output: z.object({}),
|
|
21
|
-
errors: {
|
|
22
|
-
'empty-required-labels': z.object({}),
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
releaseJobExecution: {
|
|
26
|
-
input: z.object({jobExecutionId: idSchema}),
|
|
27
|
-
output: z.object({}),
|
|
28
|
-
},
|
|
29
|
-
cancelJobs: {
|
|
30
|
-
input: z.object({jobIds: z.array(idSchema)}),
|
|
31
|
-
output: z.object({}),
|
|
32
|
-
},
|
|
33
10
|
getLeaseState: {
|
|
34
11
|
input: z.object({
|
|
35
12
|
jobId: idSchema,
|