@skyramp/testbot-core 0.13.0-v3.176 → 0.13.0-v3.178
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/VERSION.json +1 -1
- package/dist/runner-client.cjs +25 -25
- package/dist/runner-client.d.cts +4160 -0
- package/package.json +4 -3
|
@@ -0,0 +1,4160 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
4
|
+
export type Scalars = Primitive | Primitive[];
|
|
5
|
+
declare namespace util {
|
|
6
|
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
7
|
+
export type isAny<T> = 0 extends 1 & T ? true : false;
|
|
8
|
+
export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
|
|
9
|
+
export function assertIs<T>(_arg: T): void;
|
|
10
|
+
export function assertNever(_x: never): never;
|
|
11
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
12
|
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
13
|
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
14
|
+
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
|
15
|
+
export type InexactPartial<T> = {
|
|
16
|
+
[k in keyof T]?: T[k] | undefined;
|
|
17
|
+
};
|
|
18
|
+
export const arrayToEnum: <T extends string, U extends [
|
|
19
|
+
T,
|
|
20
|
+
...T[]
|
|
21
|
+
]>(items: U) => {
|
|
22
|
+
[k in U[number]]: k;
|
|
23
|
+
};
|
|
24
|
+
export const getValidEnumValues: (obj: any) => any[];
|
|
25
|
+
export const objectValues: (obj: any) => any[];
|
|
26
|
+
export const objectKeys: ObjectConstructor["keys"];
|
|
27
|
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
28
|
+
export type identity<T> = objectUtil.identity<T>;
|
|
29
|
+
export type flatten<T> = objectUtil.flatten<T>;
|
|
30
|
+
export type noUndefined<T> = T extends undefined ? never : T;
|
|
31
|
+
export const isInteger: NumberConstructor["isInteger"];
|
|
32
|
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
33
|
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
34
|
+
export {};
|
|
35
|
+
}
|
|
36
|
+
declare namespace objectUtil {
|
|
37
|
+
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
|
|
38
|
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
39
|
+
} & V;
|
|
40
|
+
type optionalKeys<T extends object> = {
|
|
41
|
+
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
42
|
+
}[keyof T];
|
|
43
|
+
type requiredKeys<T extends object> = {
|
|
44
|
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
45
|
+
}[keyof T];
|
|
46
|
+
export type addQuestionMarks<T extends object, _O = any> = {
|
|
47
|
+
[K in requiredKeys<T>]: T[K];
|
|
48
|
+
} & {
|
|
49
|
+
[K in optionalKeys<T>]?: T[K];
|
|
50
|
+
} & {
|
|
51
|
+
[k in keyof T]?: unknown;
|
|
52
|
+
};
|
|
53
|
+
export type identity<T> = T;
|
|
54
|
+
export type flatten<T> = identity<{
|
|
55
|
+
[k in keyof T]: T[k];
|
|
56
|
+
}>;
|
|
57
|
+
export type noNeverKeys<T> = {
|
|
58
|
+
[k in keyof T]: [
|
|
59
|
+
T[k]
|
|
60
|
+
] extends [
|
|
61
|
+
never
|
|
62
|
+
] ? never : k;
|
|
63
|
+
}[keyof T];
|
|
64
|
+
export type noNever<T> = identity<{
|
|
65
|
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
66
|
+
}>;
|
|
67
|
+
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
|
68
|
+
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
|
|
69
|
+
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
70
|
+
} & {
|
|
71
|
+
[K in keyof B]: B[K];
|
|
72
|
+
};
|
|
73
|
+
export {};
|
|
74
|
+
}
|
|
75
|
+
declare const ZodParsedType: {
|
|
76
|
+
string: "string";
|
|
77
|
+
nan: "nan";
|
|
78
|
+
number: "number";
|
|
79
|
+
integer: "integer";
|
|
80
|
+
float: "float";
|
|
81
|
+
boolean: "boolean";
|
|
82
|
+
date: "date";
|
|
83
|
+
bigint: "bigint";
|
|
84
|
+
symbol: "symbol";
|
|
85
|
+
function: "function";
|
|
86
|
+
undefined: "undefined";
|
|
87
|
+
null: "null";
|
|
88
|
+
array: "array";
|
|
89
|
+
object: "object";
|
|
90
|
+
unknown: "unknown";
|
|
91
|
+
promise: "promise";
|
|
92
|
+
void: "void";
|
|
93
|
+
never: "never";
|
|
94
|
+
map: "map";
|
|
95
|
+
set: "set";
|
|
96
|
+
};
|
|
97
|
+
export type ZodParsedType = keyof typeof ZodParsedType;
|
|
98
|
+
declare const getParsedType: (data: any) => ZodParsedType;
|
|
99
|
+
export type allKeys<T> = T extends any ? keyof T : never;
|
|
100
|
+
export type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
|
|
101
|
+
export type typeToFlattenedError<T, U = string> = {
|
|
102
|
+
formErrors: U[];
|
|
103
|
+
fieldErrors: {
|
|
104
|
+
[P in allKeys<T>]?: U[];
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
declare const ZodIssueCode: {
|
|
108
|
+
invalid_type: "invalid_type";
|
|
109
|
+
invalid_literal: "invalid_literal";
|
|
110
|
+
custom: "custom";
|
|
111
|
+
invalid_union: "invalid_union";
|
|
112
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
113
|
+
invalid_enum_value: "invalid_enum_value";
|
|
114
|
+
unrecognized_keys: "unrecognized_keys";
|
|
115
|
+
invalid_arguments: "invalid_arguments";
|
|
116
|
+
invalid_return_type: "invalid_return_type";
|
|
117
|
+
invalid_date: "invalid_date";
|
|
118
|
+
invalid_string: "invalid_string";
|
|
119
|
+
too_small: "too_small";
|
|
120
|
+
too_big: "too_big";
|
|
121
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
122
|
+
not_multiple_of: "not_multiple_of";
|
|
123
|
+
not_finite: "not_finite";
|
|
124
|
+
};
|
|
125
|
+
export type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
126
|
+
export type ZodIssueBase = {
|
|
127
|
+
path: (string | number)[];
|
|
128
|
+
message?: string | undefined;
|
|
129
|
+
};
|
|
130
|
+
export interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
131
|
+
code: typeof ZodIssueCode.invalid_type;
|
|
132
|
+
expected: ZodParsedType;
|
|
133
|
+
received: ZodParsedType;
|
|
134
|
+
}
|
|
135
|
+
export interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
136
|
+
code: typeof ZodIssueCode.invalid_literal;
|
|
137
|
+
expected: unknown;
|
|
138
|
+
received: unknown;
|
|
139
|
+
}
|
|
140
|
+
export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
141
|
+
code: typeof ZodIssueCode.unrecognized_keys;
|
|
142
|
+
keys: string[];
|
|
143
|
+
}
|
|
144
|
+
export interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
145
|
+
code: typeof ZodIssueCode.invalid_union;
|
|
146
|
+
unionErrors: ZodError[];
|
|
147
|
+
}
|
|
148
|
+
export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
149
|
+
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
150
|
+
options: Primitive[];
|
|
151
|
+
}
|
|
152
|
+
export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
153
|
+
received: string | number;
|
|
154
|
+
code: typeof ZodIssueCode.invalid_enum_value;
|
|
155
|
+
options: (string | number)[];
|
|
156
|
+
}
|
|
157
|
+
export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
158
|
+
code: typeof ZodIssueCode.invalid_arguments;
|
|
159
|
+
argumentsError: ZodError;
|
|
160
|
+
}
|
|
161
|
+
export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
162
|
+
code: typeof ZodIssueCode.invalid_return_type;
|
|
163
|
+
returnTypeError: ZodError;
|
|
164
|
+
}
|
|
165
|
+
export interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
166
|
+
code: typeof ZodIssueCode.invalid_date;
|
|
167
|
+
}
|
|
168
|
+
export type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
|
|
169
|
+
includes: string;
|
|
170
|
+
position?: number | undefined;
|
|
171
|
+
} | {
|
|
172
|
+
startsWith: string;
|
|
173
|
+
} | {
|
|
174
|
+
endsWith: string;
|
|
175
|
+
};
|
|
176
|
+
export interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
177
|
+
code: typeof ZodIssueCode.invalid_string;
|
|
178
|
+
validation: StringValidation;
|
|
179
|
+
}
|
|
180
|
+
export interface ZodTooSmallIssue extends ZodIssueBase {
|
|
181
|
+
code: typeof ZodIssueCode.too_small;
|
|
182
|
+
minimum: number | bigint;
|
|
183
|
+
inclusive: boolean;
|
|
184
|
+
exact?: boolean;
|
|
185
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
186
|
+
}
|
|
187
|
+
export interface ZodTooBigIssue extends ZodIssueBase {
|
|
188
|
+
code: typeof ZodIssueCode.too_big;
|
|
189
|
+
maximum: number | bigint;
|
|
190
|
+
inclusive: boolean;
|
|
191
|
+
exact?: boolean;
|
|
192
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
193
|
+
}
|
|
194
|
+
export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
195
|
+
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
196
|
+
}
|
|
197
|
+
export interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
198
|
+
code: typeof ZodIssueCode.not_multiple_of;
|
|
199
|
+
multipleOf: number | bigint;
|
|
200
|
+
}
|
|
201
|
+
export interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
202
|
+
code: typeof ZodIssueCode.not_finite;
|
|
203
|
+
}
|
|
204
|
+
export interface ZodCustomIssue extends ZodIssueBase {
|
|
205
|
+
code: typeof ZodIssueCode.custom;
|
|
206
|
+
params?: {
|
|
207
|
+
[k: string]: any;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
export type DenormalizedError = {
|
|
211
|
+
[k: string]: DenormalizedError | string[];
|
|
212
|
+
};
|
|
213
|
+
export type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
214
|
+
export type ZodIssue = ZodIssueOptionalMessage & {
|
|
215
|
+
fatal?: boolean | undefined;
|
|
216
|
+
message: string;
|
|
217
|
+
};
|
|
218
|
+
declare const quotelessJson: (obj: any) => string;
|
|
219
|
+
export type recursiveZodFormattedError<T> = T extends [
|
|
220
|
+
any,
|
|
221
|
+
...any[]
|
|
222
|
+
] ? {
|
|
223
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
224
|
+
} : T extends any[] ? {
|
|
225
|
+
[k: number]: ZodFormattedError<T[number]>;
|
|
226
|
+
} : T extends object ? {
|
|
227
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
228
|
+
} : unknown;
|
|
229
|
+
export type ZodFormattedError<T, U = string> = {
|
|
230
|
+
_errors: U[];
|
|
231
|
+
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
232
|
+
export type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
|
|
233
|
+
declare class ZodError<T = any> extends Error {
|
|
234
|
+
issues: ZodIssue[];
|
|
235
|
+
get errors(): ZodIssue[];
|
|
236
|
+
constructor(issues: ZodIssue[]);
|
|
237
|
+
format(): ZodFormattedError<T>;
|
|
238
|
+
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
239
|
+
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
240
|
+
static assert(value: unknown): asserts value is ZodError;
|
|
241
|
+
toString(): string;
|
|
242
|
+
get message(): string;
|
|
243
|
+
get isEmpty(): boolean;
|
|
244
|
+
addIssue: (sub: ZodIssue) => void;
|
|
245
|
+
addIssues: (subs?: ZodIssue[]) => void;
|
|
246
|
+
flatten(): typeToFlattenedError<T>;
|
|
247
|
+
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
248
|
+
get formErrors(): typeToFlattenedError<T, string>;
|
|
249
|
+
}
|
|
250
|
+
export type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
251
|
+
export type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
252
|
+
path?: (string | number)[];
|
|
253
|
+
fatal?: boolean | undefined;
|
|
254
|
+
};
|
|
255
|
+
export type ErrorMapCtx = {
|
|
256
|
+
defaultError: string;
|
|
257
|
+
data: any;
|
|
258
|
+
};
|
|
259
|
+
export type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
260
|
+
message: string;
|
|
261
|
+
};
|
|
262
|
+
declare const errorMap: ZodErrorMap;
|
|
263
|
+
declare function setErrorMap(map: ZodErrorMap): void;
|
|
264
|
+
declare function getErrorMap(): ZodErrorMap;
|
|
265
|
+
declare const makeIssue: (params: {
|
|
266
|
+
data: any;
|
|
267
|
+
path: (string | number)[];
|
|
268
|
+
errorMaps: ZodErrorMap[];
|
|
269
|
+
issueData: IssueData;
|
|
270
|
+
}) => ZodIssue;
|
|
271
|
+
export type ParseParams = {
|
|
272
|
+
path: (string | number)[];
|
|
273
|
+
errorMap: ZodErrorMap;
|
|
274
|
+
async: boolean;
|
|
275
|
+
};
|
|
276
|
+
export type ParsePathComponent = string | number;
|
|
277
|
+
export type ParsePath = ParsePathComponent[];
|
|
278
|
+
declare const EMPTY_PATH: ParsePath;
|
|
279
|
+
export interface ParseContext {
|
|
280
|
+
readonly common: {
|
|
281
|
+
readonly issues: ZodIssue[];
|
|
282
|
+
readonly contextualErrorMap?: ZodErrorMap | undefined;
|
|
283
|
+
readonly async: boolean;
|
|
284
|
+
};
|
|
285
|
+
readonly path: ParsePath;
|
|
286
|
+
readonly schemaErrorMap?: ZodErrorMap | undefined;
|
|
287
|
+
readonly parent: ParseContext | null;
|
|
288
|
+
readonly data: any;
|
|
289
|
+
readonly parsedType: ZodParsedType;
|
|
290
|
+
}
|
|
291
|
+
export type ParseInput = {
|
|
292
|
+
data: any;
|
|
293
|
+
path: (string | number)[];
|
|
294
|
+
parent: ParseContext;
|
|
295
|
+
};
|
|
296
|
+
declare function addIssueToContext(ctx: ParseContext, issueData: IssueData): void;
|
|
297
|
+
export type ObjectPair = {
|
|
298
|
+
key: SyncParseReturnType<any>;
|
|
299
|
+
value: SyncParseReturnType<any>;
|
|
300
|
+
};
|
|
301
|
+
declare class ParseStatus {
|
|
302
|
+
value: "aborted" | "dirty" | "valid";
|
|
303
|
+
dirty(): void;
|
|
304
|
+
abort(): void;
|
|
305
|
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
306
|
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
307
|
+
key: ParseReturnType<any>;
|
|
308
|
+
value: ParseReturnType<any>;
|
|
309
|
+
}[]): Promise<SyncParseReturnType<any>>;
|
|
310
|
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
311
|
+
key: SyncParseReturnType<any>;
|
|
312
|
+
value: SyncParseReturnType<any>;
|
|
313
|
+
alwaysSet?: boolean;
|
|
314
|
+
}[]): SyncParseReturnType;
|
|
315
|
+
}
|
|
316
|
+
export interface ParseResult {
|
|
317
|
+
status: "aborted" | "dirty" | "valid";
|
|
318
|
+
data: any;
|
|
319
|
+
}
|
|
320
|
+
export type INVALID = {
|
|
321
|
+
status: "aborted";
|
|
322
|
+
};
|
|
323
|
+
declare const INVALID: INVALID;
|
|
324
|
+
export type DIRTY<T> = {
|
|
325
|
+
status: "dirty";
|
|
326
|
+
value: T;
|
|
327
|
+
};
|
|
328
|
+
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
329
|
+
export type OK<T> = {
|
|
330
|
+
status: "valid";
|
|
331
|
+
value: T;
|
|
332
|
+
};
|
|
333
|
+
declare const OK: <T>(value: T) => OK<T>;
|
|
334
|
+
export type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
335
|
+
export type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
336
|
+
export type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
337
|
+
declare const isAborted: (x: ParseReturnType<any>) => x is INVALID;
|
|
338
|
+
declare const isDirty: <T>(x: ParseReturnType<T>) => x is OK<T> | DIRTY<T>;
|
|
339
|
+
declare const isValid: <T>(x: ParseReturnType<T>) => x is OK<T>;
|
|
340
|
+
declare const isAsync: <T>(x: ParseReturnType<T>) => x is AsyncParseReturnType<T>;
|
|
341
|
+
declare namespace enumUtil {
|
|
342
|
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
343
|
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
|
344
|
+
type UnionToTuple<T, Tuple extends unknown[] = [
|
|
345
|
+
]> = [
|
|
346
|
+
T
|
|
347
|
+
] extends [
|
|
348
|
+
never
|
|
349
|
+
] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [
|
|
350
|
+
GetUnionLast<T>,
|
|
351
|
+
...Tuple
|
|
352
|
+
]>;
|
|
353
|
+
type CastToStringTuple<T> = T extends [
|
|
354
|
+
string,
|
|
355
|
+
...string[]
|
|
356
|
+
] ? T : never;
|
|
357
|
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
|
358
|
+
export {};
|
|
359
|
+
}
|
|
360
|
+
declare namespace errorUtil {
|
|
361
|
+
type ErrMessage = string | {
|
|
362
|
+
message?: string | undefined;
|
|
363
|
+
};
|
|
364
|
+
const errToObj: (message?: ErrMessage) => {
|
|
365
|
+
message?: string | undefined;
|
|
366
|
+
};
|
|
367
|
+
const toString: (message?: ErrMessage) => string | undefined;
|
|
368
|
+
}
|
|
369
|
+
declare namespace partialUtil {
|
|
370
|
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
|
371
|
+
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
|
372
|
+
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
|
373
|
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
|
374
|
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* The Standard Schema interface.
|
|
378
|
+
*/
|
|
379
|
+
export type StandardSchemaV1<Input = unknown, Output = Input> = {
|
|
380
|
+
/**
|
|
381
|
+
* The Standard Schema properties.
|
|
382
|
+
*/
|
|
383
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
384
|
+
};
|
|
385
|
+
declare namespace StandardSchemaV1 {
|
|
386
|
+
/**
|
|
387
|
+
* The Standard Schema properties interface.
|
|
388
|
+
*/
|
|
389
|
+
export interface Props<Input = unknown, Output = Input> {
|
|
390
|
+
/**
|
|
391
|
+
* The version number of the standard.
|
|
392
|
+
*/
|
|
393
|
+
readonly version: 1;
|
|
394
|
+
/**
|
|
395
|
+
* The vendor name of the schema library.
|
|
396
|
+
*/
|
|
397
|
+
readonly vendor: string;
|
|
398
|
+
/**
|
|
399
|
+
* Validates unknown input values.
|
|
400
|
+
*/
|
|
401
|
+
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
402
|
+
/**
|
|
403
|
+
* Inferred types associated with the schema.
|
|
404
|
+
*/
|
|
405
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* The result interface of the validate function.
|
|
409
|
+
*/
|
|
410
|
+
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
411
|
+
/**
|
|
412
|
+
* The result interface if validation succeeds.
|
|
413
|
+
*/
|
|
414
|
+
export interface SuccessResult<Output> {
|
|
415
|
+
/**
|
|
416
|
+
* The typed output value.
|
|
417
|
+
*/
|
|
418
|
+
readonly value: Output;
|
|
419
|
+
/**
|
|
420
|
+
* The non-existent issues.
|
|
421
|
+
*/
|
|
422
|
+
readonly issues?: undefined;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The result interface if validation fails.
|
|
426
|
+
*/
|
|
427
|
+
export interface FailureResult {
|
|
428
|
+
/**
|
|
429
|
+
* The issues of failed validation.
|
|
430
|
+
*/
|
|
431
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* The issue interface of the failure output.
|
|
435
|
+
*/
|
|
436
|
+
export interface Issue {
|
|
437
|
+
/**
|
|
438
|
+
* The error message of the issue.
|
|
439
|
+
*/
|
|
440
|
+
readonly message: string;
|
|
441
|
+
/**
|
|
442
|
+
* The path of the issue, if any.
|
|
443
|
+
*/
|
|
444
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* The path segment interface of the issue.
|
|
448
|
+
*/
|
|
449
|
+
export interface PathSegment {
|
|
450
|
+
/**
|
|
451
|
+
* The key representing a path segment.
|
|
452
|
+
*/
|
|
453
|
+
readonly key: PropertyKey;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* The Standard Schema types interface.
|
|
457
|
+
*/
|
|
458
|
+
export interface Types<Input = unknown, Output = Input> {
|
|
459
|
+
/**
|
|
460
|
+
* The input type of the schema.
|
|
461
|
+
*/
|
|
462
|
+
readonly input: Input;
|
|
463
|
+
/**
|
|
464
|
+
* The output type of the schema.
|
|
465
|
+
*/
|
|
466
|
+
readonly output: Output;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Infers the input type of a Standard Schema.
|
|
470
|
+
*/
|
|
471
|
+
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
472
|
+
/**
|
|
473
|
+
* Infers the output type of a Standard Schema.
|
|
474
|
+
*/
|
|
475
|
+
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
476
|
+
export {};
|
|
477
|
+
}
|
|
478
|
+
export interface RefinementCtx {
|
|
479
|
+
addIssue: (arg: IssueData) => void;
|
|
480
|
+
path: (string | number)[];
|
|
481
|
+
}
|
|
482
|
+
export type ZodRawShape = {
|
|
483
|
+
[k: string]: ZodTypeAny;
|
|
484
|
+
};
|
|
485
|
+
export type ZodTypeAny = ZodType<any, any, any>;
|
|
486
|
+
export type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
487
|
+
export type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
488
|
+
export type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
489
|
+
export type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
490
|
+
export interface ZodTypeDef {
|
|
491
|
+
errorMap?: ZodErrorMap | undefined;
|
|
492
|
+
description?: string | undefined;
|
|
493
|
+
}
|
|
494
|
+
export type RawCreateParams = {
|
|
495
|
+
errorMap?: ZodErrorMap | undefined;
|
|
496
|
+
invalid_type_error?: string | undefined;
|
|
497
|
+
required_error?: string | undefined;
|
|
498
|
+
message?: string | undefined;
|
|
499
|
+
description?: string | undefined;
|
|
500
|
+
} | undefined;
|
|
501
|
+
export type ProcessedCreateParams = {
|
|
502
|
+
errorMap?: ZodErrorMap | undefined;
|
|
503
|
+
description?: string | undefined;
|
|
504
|
+
};
|
|
505
|
+
export type SafeParseSuccess<Output> = {
|
|
506
|
+
success: true;
|
|
507
|
+
data: Output;
|
|
508
|
+
error?: never;
|
|
509
|
+
};
|
|
510
|
+
export type SafeParseError<Input> = {
|
|
511
|
+
success: false;
|
|
512
|
+
error: ZodError<Input>;
|
|
513
|
+
data?: never;
|
|
514
|
+
};
|
|
515
|
+
export type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
516
|
+
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
517
|
+
readonly _type: Output;
|
|
518
|
+
readonly _output: Output;
|
|
519
|
+
readonly _input: Input;
|
|
520
|
+
readonly _def: Def;
|
|
521
|
+
get description(): string | undefined;
|
|
522
|
+
"~standard": StandardSchemaV1.Props<Input, Output>;
|
|
523
|
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
524
|
+
_getType(input: ParseInput): string;
|
|
525
|
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
526
|
+
_processInputParams(input: ParseInput): {
|
|
527
|
+
status: ParseStatus;
|
|
528
|
+
ctx: ParseContext;
|
|
529
|
+
};
|
|
530
|
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
531
|
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
532
|
+
parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
|
|
533
|
+
safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
534
|
+
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
|
535
|
+
parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
|
|
536
|
+
safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
537
|
+
/** Alias of safeParseAsync */
|
|
538
|
+
spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
|
539
|
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
540
|
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
541
|
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
542
|
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
543
|
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
544
|
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
545
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
546
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
|
547
|
+
constructor(def: Def);
|
|
548
|
+
optional(): ZodOptional<this>;
|
|
549
|
+
nullable(): ZodNullable<this>;
|
|
550
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
551
|
+
array(): ZodArray<this>;
|
|
552
|
+
promise(): ZodPromise<this>;
|
|
553
|
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[
|
|
554
|
+
this,
|
|
555
|
+
T
|
|
556
|
+
]>;
|
|
557
|
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
558
|
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
559
|
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
560
|
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
561
|
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
562
|
+
catch(def: Output): ZodCatch<this>;
|
|
563
|
+
catch(def: (ctx: {
|
|
564
|
+
error: ZodError;
|
|
565
|
+
input: Input;
|
|
566
|
+
}) => Output): ZodCatch<this>;
|
|
567
|
+
describe(description: string): this;
|
|
568
|
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
569
|
+
readonly(): ZodReadonly<this>;
|
|
570
|
+
isOptional(): boolean;
|
|
571
|
+
isNullable(): boolean;
|
|
572
|
+
}
|
|
573
|
+
export type IpVersion = "v4" | "v6";
|
|
574
|
+
export type ZodStringCheck = {
|
|
575
|
+
kind: "min";
|
|
576
|
+
value: number;
|
|
577
|
+
message?: string | undefined;
|
|
578
|
+
} | {
|
|
579
|
+
kind: "max";
|
|
580
|
+
value: number;
|
|
581
|
+
message?: string | undefined;
|
|
582
|
+
} | {
|
|
583
|
+
kind: "length";
|
|
584
|
+
value: number;
|
|
585
|
+
message?: string | undefined;
|
|
586
|
+
} | {
|
|
587
|
+
kind: "email";
|
|
588
|
+
message?: string | undefined;
|
|
589
|
+
} | {
|
|
590
|
+
kind: "url";
|
|
591
|
+
message?: string | undefined;
|
|
592
|
+
} | {
|
|
593
|
+
kind: "emoji";
|
|
594
|
+
message?: string | undefined;
|
|
595
|
+
} | {
|
|
596
|
+
kind: "uuid";
|
|
597
|
+
message?: string | undefined;
|
|
598
|
+
} | {
|
|
599
|
+
kind: "nanoid";
|
|
600
|
+
message?: string | undefined;
|
|
601
|
+
} | {
|
|
602
|
+
kind: "cuid";
|
|
603
|
+
message?: string | undefined;
|
|
604
|
+
} | {
|
|
605
|
+
kind: "includes";
|
|
606
|
+
value: string;
|
|
607
|
+
position?: number | undefined;
|
|
608
|
+
message?: string | undefined;
|
|
609
|
+
} | {
|
|
610
|
+
kind: "cuid2";
|
|
611
|
+
message?: string | undefined;
|
|
612
|
+
} | {
|
|
613
|
+
kind: "ulid";
|
|
614
|
+
message?: string | undefined;
|
|
615
|
+
} | {
|
|
616
|
+
kind: "startsWith";
|
|
617
|
+
value: string;
|
|
618
|
+
message?: string | undefined;
|
|
619
|
+
} | {
|
|
620
|
+
kind: "endsWith";
|
|
621
|
+
value: string;
|
|
622
|
+
message?: string | undefined;
|
|
623
|
+
} | {
|
|
624
|
+
kind: "regex";
|
|
625
|
+
regex: RegExp;
|
|
626
|
+
message?: string | undefined;
|
|
627
|
+
} | {
|
|
628
|
+
kind: "trim";
|
|
629
|
+
message?: string | undefined;
|
|
630
|
+
} | {
|
|
631
|
+
kind: "toLowerCase";
|
|
632
|
+
message?: string | undefined;
|
|
633
|
+
} | {
|
|
634
|
+
kind: "toUpperCase";
|
|
635
|
+
message?: string | undefined;
|
|
636
|
+
} | {
|
|
637
|
+
kind: "jwt";
|
|
638
|
+
alg?: string;
|
|
639
|
+
message?: string | undefined;
|
|
640
|
+
} | {
|
|
641
|
+
kind: "datetime";
|
|
642
|
+
offset: boolean;
|
|
643
|
+
local: boolean;
|
|
644
|
+
precision: number | null;
|
|
645
|
+
message?: string | undefined;
|
|
646
|
+
} | {
|
|
647
|
+
kind: "date";
|
|
648
|
+
message?: string | undefined;
|
|
649
|
+
} | {
|
|
650
|
+
kind: "time";
|
|
651
|
+
precision: number | null;
|
|
652
|
+
message?: string | undefined;
|
|
653
|
+
} | {
|
|
654
|
+
kind: "duration";
|
|
655
|
+
message?: string | undefined;
|
|
656
|
+
} | {
|
|
657
|
+
kind: "ip";
|
|
658
|
+
version?: IpVersion | undefined;
|
|
659
|
+
message?: string | undefined;
|
|
660
|
+
} | {
|
|
661
|
+
kind: "cidr";
|
|
662
|
+
version?: IpVersion | undefined;
|
|
663
|
+
message?: string | undefined;
|
|
664
|
+
} | {
|
|
665
|
+
kind: "base64";
|
|
666
|
+
message?: string | undefined;
|
|
667
|
+
} | {
|
|
668
|
+
kind: "base64url";
|
|
669
|
+
message?: string | undefined;
|
|
670
|
+
};
|
|
671
|
+
export interface ZodStringDef extends ZodTypeDef {
|
|
672
|
+
checks: ZodStringCheck[];
|
|
673
|
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
|
674
|
+
coerce: boolean;
|
|
675
|
+
}
|
|
676
|
+
declare function datetimeRegex(args: {
|
|
677
|
+
precision?: number | null;
|
|
678
|
+
offset?: boolean;
|
|
679
|
+
local?: boolean;
|
|
680
|
+
}): RegExp;
|
|
681
|
+
declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
|
682
|
+
_parse(input: ParseInput): ParseReturnType<string>;
|
|
683
|
+
protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
|
|
684
|
+
_addCheck(check: ZodStringCheck): ZodString;
|
|
685
|
+
email(message?: errorUtil.ErrMessage): ZodString;
|
|
686
|
+
url(message?: errorUtil.ErrMessage): ZodString;
|
|
687
|
+
emoji(message?: errorUtil.ErrMessage): ZodString;
|
|
688
|
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
|
689
|
+
nanoid(message?: errorUtil.ErrMessage): ZodString;
|
|
690
|
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
|
691
|
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
692
|
+
ulid(message?: errorUtil.ErrMessage): ZodString;
|
|
693
|
+
base64(message?: errorUtil.ErrMessage): ZodString;
|
|
694
|
+
base64url(message?: errorUtil.ErrMessage): ZodString;
|
|
695
|
+
jwt(options?: {
|
|
696
|
+
alg?: string;
|
|
697
|
+
message?: string | undefined;
|
|
698
|
+
}): ZodString;
|
|
699
|
+
ip(options?: string | {
|
|
700
|
+
version?: IpVersion;
|
|
701
|
+
message?: string | undefined;
|
|
702
|
+
}): ZodString;
|
|
703
|
+
cidr(options?: string | {
|
|
704
|
+
version?: IpVersion;
|
|
705
|
+
message?: string | undefined;
|
|
706
|
+
}): ZodString;
|
|
707
|
+
datetime(options?: string | {
|
|
708
|
+
message?: string | undefined;
|
|
709
|
+
precision?: number | null;
|
|
710
|
+
offset?: boolean;
|
|
711
|
+
local?: boolean;
|
|
712
|
+
}): ZodString;
|
|
713
|
+
date(message?: string): ZodString;
|
|
714
|
+
time(options?: string | {
|
|
715
|
+
message?: string | undefined;
|
|
716
|
+
precision?: number | null;
|
|
717
|
+
}): ZodString;
|
|
718
|
+
duration(message?: errorUtil.ErrMessage): ZodString;
|
|
719
|
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
|
720
|
+
includes(value: string, options?: {
|
|
721
|
+
message?: string;
|
|
722
|
+
position?: number;
|
|
723
|
+
}): ZodString;
|
|
724
|
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
725
|
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
726
|
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
727
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
728
|
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
|
729
|
+
/**
|
|
730
|
+
* Equivalent to `.min(1)`
|
|
731
|
+
*/
|
|
732
|
+
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
|
733
|
+
trim(): ZodString;
|
|
734
|
+
toLowerCase(): ZodString;
|
|
735
|
+
toUpperCase(): ZodString;
|
|
736
|
+
get isDatetime(): boolean;
|
|
737
|
+
get isDate(): boolean;
|
|
738
|
+
get isTime(): boolean;
|
|
739
|
+
get isDuration(): boolean;
|
|
740
|
+
get isEmail(): boolean;
|
|
741
|
+
get isURL(): boolean;
|
|
742
|
+
get isEmoji(): boolean;
|
|
743
|
+
get isUUID(): boolean;
|
|
744
|
+
get isNANOID(): boolean;
|
|
745
|
+
get isCUID(): boolean;
|
|
746
|
+
get isCUID2(): boolean;
|
|
747
|
+
get isULID(): boolean;
|
|
748
|
+
get isIP(): boolean;
|
|
749
|
+
get isCIDR(): boolean;
|
|
750
|
+
get isBase64(): boolean;
|
|
751
|
+
get isBase64url(): boolean;
|
|
752
|
+
get minLength(): number | null;
|
|
753
|
+
get maxLength(): number | null;
|
|
754
|
+
static create: (params?: RawCreateParams & {
|
|
755
|
+
coerce?: true;
|
|
756
|
+
}) => ZodString;
|
|
757
|
+
}
|
|
758
|
+
export type ZodNumberCheck = {
|
|
759
|
+
kind: "min";
|
|
760
|
+
value: number;
|
|
761
|
+
inclusive: boolean;
|
|
762
|
+
message?: string | undefined;
|
|
763
|
+
} | {
|
|
764
|
+
kind: "max";
|
|
765
|
+
value: number;
|
|
766
|
+
inclusive: boolean;
|
|
767
|
+
message?: string | undefined;
|
|
768
|
+
} | {
|
|
769
|
+
kind: "int";
|
|
770
|
+
message?: string | undefined;
|
|
771
|
+
} | {
|
|
772
|
+
kind: "multipleOf";
|
|
773
|
+
value: number;
|
|
774
|
+
message?: string | undefined;
|
|
775
|
+
} | {
|
|
776
|
+
kind: "finite";
|
|
777
|
+
message?: string | undefined;
|
|
778
|
+
};
|
|
779
|
+
export interface ZodNumberDef extends ZodTypeDef {
|
|
780
|
+
checks: ZodNumberCheck[];
|
|
781
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
|
782
|
+
coerce: boolean;
|
|
783
|
+
}
|
|
784
|
+
declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
|
785
|
+
_parse(input: ParseInput): ParseReturnType<number>;
|
|
786
|
+
static create: (params?: RawCreateParams & {
|
|
787
|
+
coerce?: boolean;
|
|
788
|
+
}) => ZodNumber;
|
|
789
|
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
790
|
+
min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
791
|
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
792
|
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
793
|
+
max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
794
|
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
795
|
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
796
|
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
797
|
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
|
798
|
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
799
|
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
800
|
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
801
|
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
802
|
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
803
|
+
step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber;
|
|
804
|
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
805
|
+
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
|
806
|
+
get minValue(): number | null;
|
|
807
|
+
get maxValue(): number | null;
|
|
808
|
+
get isInt(): boolean;
|
|
809
|
+
get isFinite(): boolean;
|
|
810
|
+
}
|
|
811
|
+
export type ZodBigIntCheck = {
|
|
812
|
+
kind: "min";
|
|
813
|
+
value: bigint;
|
|
814
|
+
inclusive: boolean;
|
|
815
|
+
message?: string | undefined;
|
|
816
|
+
} | {
|
|
817
|
+
kind: "max";
|
|
818
|
+
value: bigint;
|
|
819
|
+
inclusive: boolean;
|
|
820
|
+
message?: string | undefined;
|
|
821
|
+
} | {
|
|
822
|
+
kind: "multipleOf";
|
|
823
|
+
value: bigint;
|
|
824
|
+
message?: string | undefined;
|
|
825
|
+
};
|
|
826
|
+
export interface ZodBigIntDef extends ZodTypeDef {
|
|
827
|
+
checks: ZodBigIntCheck[];
|
|
828
|
+
typeName: ZodFirstPartyTypeKind.ZodBigInt;
|
|
829
|
+
coerce: boolean;
|
|
830
|
+
}
|
|
831
|
+
declare class ZodBigInt extends ZodType<bigint, ZodBigIntDef, bigint> {
|
|
832
|
+
_parse(input: ParseInput): ParseReturnType<bigint>;
|
|
833
|
+
_getInvalidInput(input: ParseInput): INVALID;
|
|
834
|
+
static create: (params?: RawCreateParams & {
|
|
835
|
+
coerce?: boolean;
|
|
836
|
+
}) => ZodBigInt;
|
|
837
|
+
gte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
838
|
+
min: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
|
839
|
+
gt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
840
|
+
lte(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
841
|
+
max: (value: bigint, message?: errorUtil.ErrMessage) => ZodBigInt;
|
|
842
|
+
lt(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
843
|
+
protected setLimit(kind: "min" | "max", value: bigint, inclusive: boolean, message?: string): ZodBigInt;
|
|
844
|
+
_addCheck(check: ZodBigIntCheck): ZodBigInt;
|
|
845
|
+
positive(message?: errorUtil.ErrMessage): ZodBigInt;
|
|
846
|
+
negative(message?: errorUtil.ErrMessage): ZodBigInt;
|
|
847
|
+
nonpositive(message?: errorUtil.ErrMessage): ZodBigInt;
|
|
848
|
+
nonnegative(message?: errorUtil.ErrMessage): ZodBigInt;
|
|
849
|
+
multipleOf(value: bigint, message?: errorUtil.ErrMessage): ZodBigInt;
|
|
850
|
+
get minValue(): bigint | null;
|
|
851
|
+
get maxValue(): bigint | null;
|
|
852
|
+
}
|
|
853
|
+
export interface ZodBooleanDef extends ZodTypeDef {
|
|
854
|
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
|
855
|
+
coerce: boolean;
|
|
856
|
+
}
|
|
857
|
+
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
|
858
|
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
859
|
+
static create: (params?: RawCreateParams & {
|
|
860
|
+
coerce?: boolean;
|
|
861
|
+
}) => ZodBoolean;
|
|
862
|
+
}
|
|
863
|
+
export type ZodDateCheck = {
|
|
864
|
+
kind: "min";
|
|
865
|
+
value: number;
|
|
866
|
+
message?: string | undefined;
|
|
867
|
+
} | {
|
|
868
|
+
kind: "max";
|
|
869
|
+
value: number;
|
|
870
|
+
message?: string | undefined;
|
|
871
|
+
};
|
|
872
|
+
export interface ZodDateDef extends ZodTypeDef {
|
|
873
|
+
checks: ZodDateCheck[];
|
|
874
|
+
coerce: boolean;
|
|
875
|
+
typeName: ZodFirstPartyTypeKind.ZodDate;
|
|
876
|
+
}
|
|
877
|
+
declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
|
878
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
879
|
+
_addCheck(check: ZodDateCheck): ZodDate;
|
|
880
|
+
min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
|
881
|
+
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
|
882
|
+
get minDate(): Date | null;
|
|
883
|
+
get maxDate(): Date | null;
|
|
884
|
+
static create: (params?: RawCreateParams & {
|
|
885
|
+
coerce?: boolean;
|
|
886
|
+
}) => ZodDate;
|
|
887
|
+
}
|
|
888
|
+
export interface ZodSymbolDef extends ZodTypeDef {
|
|
889
|
+
typeName: ZodFirstPartyTypeKind.ZodSymbol;
|
|
890
|
+
}
|
|
891
|
+
declare class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> {
|
|
892
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
893
|
+
static create: (params?: RawCreateParams) => ZodSymbol;
|
|
894
|
+
}
|
|
895
|
+
export interface ZodUndefinedDef extends ZodTypeDef {
|
|
896
|
+
typeName: ZodFirstPartyTypeKind.ZodUndefined;
|
|
897
|
+
}
|
|
898
|
+
declare class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> {
|
|
899
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
900
|
+
params?: RawCreateParams;
|
|
901
|
+
static create: (params?: RawCreateParams) => ZodUndefined;
|
|
902
|
+
}
|
|
903
|
+
export interface ZodNullDef extends ZodTypeDef {
|
|
904
|
+
typeName: ZodFirstPartyTypeKind.ZodNull;
|
|
905
|
+
}
|
|
906
|
+
declare class ZodNull extends ZodType<null, ZodNullDef, null> {
|
|
907
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
908
|
+
static create: (params?: RawCreateParams) => ZodNull;
|
|
909
|
+
}
|
|
910
|
+
export interface ZodAnyDef extends ZodTypeDef {
|
|
911
|
+
typeName: ZodFirstPartyTypeKind.ZodAny;
|
|
912
|
+
}
|
|
913
|
+
declare class ZodAny extends ZodType<any, ZodAnyDef, any> {
|
|
914
|
+
_any: true;
|
|
915
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
916
|
+
static create: (params?: RawCreateParams) => ZodAny;
|
|
917
|
+
}
|
|
918
|
+
export interface ZodUnknownDef extends ZodTypeDef {
|
|
919
|
+
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
|
920
|
+
}
|
|
921
|
+
declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef, unknown> {
|
|
922
|
+
_unknown: true;
|
|
923
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
924
|
+
static create: (params?: RawCreateParams) => ZodUnknown;
|
|
925
|
+
}
|
|
926
|
+
export interface ZodNeverDef extends ZodTypeDef {
|
|
927
|
+
typeName: ZodFirstPartyTypeKind.ZodNever;
|
|
928
|
+
}
|
|
929
|
+
declare class ZodNever extends ZodType<never, ZodNeverDef, never> {
|
|
930
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
931
|
+
static create: (params?: RawCreateParams) => ZodNever;
|
|
932
|
+
}
|
|
933
|
+
export interface ZodVoidDef extends ZodTypeDef {
|
|
934
|
+
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
|
935
|
+
}
|
|
936
|
+
declare class ZodVoid extends ZodType<void, ZodVoidDef, void> {
|
|
937
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
938
|
+
static create: (params?: RawCreateParams) => ZodVoid;
|
|
939
|
+
}
|
|
940
|
+
export interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
941
|
+
type: T;
|
|
942
|
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
|
943
|
+
exactLength: {
|
|
944
|
+
value: number;
|
|
945
|
+
message?: string | undefined;
|
|
946
|
+
} | null;
|
|
947
|
+
minLength: {
|
|
948
|
+
value: number;
|
|
949
|
+
message?: string | undefined;
|
|
950
|
+
} | null;
|
|
951
|
+
maxLength: {
|
|
952
|
+
value: number;
|
|
953
|
+
message?: string | undefined;
|
|
954
|
+
} | null;
|
|
955
|
+
}
|
|
956
|
+
export type ArrayCardinality = "many" | "atleastone";
|
|
957
|
+
export type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [
|
|
958
|
+
T["_output"],
|
|
959
|
+
...T["_output"][]
|
|
960
|
+
] : T["_output"][];
|
|
961
|
+
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [
|
|
962
|
+
T["_input"],
|
|
963
|
+
...T["_input"][]
|
|
964
|
+
] : T["_input"][]> {
|
|
965
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
966
|
+
get element(): T;
|
|
967
|
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
968
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
969
|
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
970
|
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
971
|
+
static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
|
972
|
+
}
|
|
973
|
+
export type ZodNonEmptyArray<T extends ZodTypeAny> = ZodArray<T, "atleastone">;
|
|
974
|
+
export type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
975
|
+
export interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
976
|
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
977
|
+
shape: () => T;
|
|
978
|
+
catchall: Catchall;
|
|
979
|
+
unknownKeys: UnknownKeys;
|
|
980
|
+
}
|
|
981
|
+
export type mergeTypes<A, B> = {
|
|
982
|
+
[k in keyof A | keyof B]: k extends keyof B ? B[k] : k extends keyof A ? A[k] : never;
|
|
983
|
+
};
|
|
984
|
+
export type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
|
985
|
+
export type baseObjectOutputType<Shape extends ZodRawShape> = {
|
|
986
|
+
[k in keyof Shape]: Shape[k]["_output"];
|
|
987
|
+
};
|
|
988
|
+
export type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
|
989
|
+
export type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
990
|
+
[k in keyof Shape]: Shape[k]["_input"];
|
|
991
|
+
}>;
|
|
992
|
+
export type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
993
|
+
[k: string]: T["_output"];
|
|
994
|
+
};
|
|
995
|
+
export type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
996
|
+
[k: string]: T["_input"];
|
|
997
|
+
};
|
|
998
|
+
export type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
|
999
|
+
[k: string]: unknown;
|
|
1000
|
+
} : unknown;
|
|
1001
|
+
export type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
1002
|
+
export type SomeZodObject = ZodObject<ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
1003
|
+
export type noUnrecognized<Obj extends object, Shape extends object> = {
|
|
1004
|
+
[k in keyof Obj]: k extends keyof Shape ? Obj[k] : never;
|
|
1005
|
+
};
|
|
1006
|
+
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
1007
|
+
private _cached;
|
|
1008
|
+
_getCached(): {
|
|
1009
|
+
shape: T;
|
|
1010
|
+
keys: string[];
|
|
1011
|
+
};
|
|
1012
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1013
|
+
get shape(): T;
|
|
1014
|
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
|
1015
|
+
strip(): ZodObject<T, "strip", Catchall>;
|
|
1016
|
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
|
1017
|
+
/**
|
|
1018
|
+
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
|
1019
|
+
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
|
1020
|
+
*/
|
|
1021
|
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
1022
|
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
1023
|
+
/**
|
|
1024
|
+
* @deprecated Use `.extend` instead
|
|
1025
|
+
* */
|
|
1026
|
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
1029
|
+
* inferred type of merged objects. Please
|
|
1030
|
+
* upgrade if you are experiencing issues.
|
|
1031
|
+
*/
|
|
1032
|
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
1033
|
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
1034
|
+
[k in Key]: Schema;
|
|
1035
|
+
}, UnknownKeys, Catchall>;
|
|
1036
|
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
1037
|
+
pick<Mask extends util.Exactly<{
|
|
1038
|
+
[k in keyof T]?: true;
|
|
1039
|
+
}, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
1040
|
+
omit<Mask extends util.Exactly<{
|
|
1041
|
+
[k in keyof T]?: true;
|
|
1042
|
+
}, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
1043
|
+
/**
|
|
1044
|
+
* @deprecated
|
|
1045
|
+
*/
|
|
1046
|
+
deepPartial(): partialUtil.DeepPartial<this>;
|
|
1047
|
+
partial(): ZodObject<{
|
|
1048
|
+
[k in keyof T]: ZodOptional<T[k]>;
|
|
1049
|
+
}, UnknownKeys, Catchall>;
|
|
1050
|
+
partial<Mask extends util.Exactly<{
|
|
1051
|
+
[k in keyof T]?: true;
|
|
1052
|
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
1053
|
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
1054
|
+
}>, UnknownKeys, Catchall>;
|
|
1055
|
+
required(): ZodObject<{
|
|
1056
|
+
[k in keyof T]: deoptional<T[k]>;
|
|
1057
|
+
}, UnknownKeys, Catchall>;
|
|
1058
|
+
required<Mask extends util.Exactly<{
|
|
1059
|
+
[k in keyof T]?: true;
|
|
1060
|
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
1061
|
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
1062
|
+
}>, UnknownKeys, Catchall>;
|
|
1063
|
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
1064
|
+
static create: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
|
1065
|
+
static strictCreate: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
|
1066
|
+
static lazycreate: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
|
1067
|
+
}
|
|
1068
|
+
export type AnyZodObject = ZodObject<any, any, any>;
|
|
1069
|
+
export type ZodUnionOptions = Readonly<[
|
|
1070
|
+
ZodTypeAny,
|
|
1071
|
+
...ZodTypeAny[]
|
|
1072
|
+
]>;
|
|
1073
|
+
export interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
1074
|
+
ZodTypeAny,
|
|
1075
|
+
ZodTypeAny,
|
|
1076
|
+
...ZodTypeAny[]
|
|
1077
|
+
]>> extends ZodTypeDef {
|
|
1078
|
+
options: T;
|
|
1079
|
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
1080
|
+
}
|
|
1081
|
+
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
|
1082
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1083
|
+
get options(): T;
|
|
1084
|
+
static create: <Options extends Readonly<[
|
|
1085
|
+
ZodTypeAny,
|
|
1086
|
+
ZodTypeAny,
|
|
1087
|
+
...ZodTypeAny[]
|
|
1088
|
+
]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
|
1089
|
+
}
|
|
1090
|
+
export type ZodDiscriminatedUnionOption<Discriminator extends string> = ZodObject<{
|
|
1091
|
+
[key in Discriminator]: ZodTypeAny;
|
|
1092
|
+
} & ZodRawShape, UnknownKeysParam, ZodTypeAny>;
|
|
1093
|
+
export interface ZodDiscriminatedUnionDef<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<string>[] = ZodDiscriminatedUnionOption<string>[]> extends ZodTypeDef {
|
|
1094
|
+
discriminator: Discriminator;
|
|
1095
|
+
options: Options;
|
|
1096
|
+
optionsMap: Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
|
1097
|
+
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion;
|
|
1098
|
+
}
|
|
1099
|
+
declare class ZodDiscriminatedUnion<Discriminator extends string, Options extends readonly ZodDiscriminatedUnionOption<Discriminator>[]> extends ZodType<output<Options[number]>, ZodDiscriminatedUnionDef<Discriminator, Options>, input<Options[number]>> {
|
|
1100
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1101
|
+
get discriminator(): Discriminator;
|
|
1102
|
+
get options(): Options;
|
|
1103
|
+
get optionsMap(): Map<Primitive, ZodDiscriminatedUnionOption<any>>;
|
|
1104
|
+
/**
|
|
1105
|
+
* The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
|
|
1106
|
+
* However, it only allows a union of objects, all of which need to share a discriminator property. This property must
|
|
1107
|
+
* have a different value for each object in the union.
|
|
1108
|
+
* @param discriminator the name of the discriminator property
|
|
1109
|
+
* @param types an array of object schemas
|
|
1110
|
+
* @param params
|
|
1111
|
+
*/
|
|
1112
|
+
static create<Discriminator extends string, Types extends readonly [
|
|
1113
|
+
ZodDiscriminatedUnionOption<Discriminator>,
|
|
1114
|
+
...ZodDiscriminatedUnionOption<Discriminator>[]
|
|
1115
|
+
]>(discriminator: Discriminator, options: Types, params?: RawCreateParams): ZodDiscriminatedUnion<Discriminator, Types>;
|
|
1116
|
+
}
|
|
1117
|
+
export interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1118
|
+
left: T;
|
|
1119
|
+
right: U;
|
|
1120
|
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
|
1121
|
+
}
|
|
1122
|
+
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
|
1123
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1124
|
+
static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
|
1125
|
+
}
|
|
1126
|
+
export type ZodTupleItems = [
|
|
1127
|
+
ZodTypeAny,
|
|
1128
|
+
...ZodTypeAny[]
|
|
1129
|
+
];
|
|
1130
|
+
export type AssertArray<T> = T extends any[] ? T : never;
|
|
1131
|
+
export type OutputTypeOfTuple<T extends ZodTupleItems | [
|
|
1132
|
+
]> = AssertArray<{
|
|
1133
|
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
|
1134
|
+
}>;
|
|
1135
|
+
export type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [
|
|
1136
|
+
], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [
|
|
1137
|
+
...OutputTypeOfTuple<T>,
|
|
1138
|
+
...Rest["_output"][]
|
|
1139
|
+
] : OutputTypeOfTuple<T>;
|
|
1140
|
+
export type InputTypeOfTuple<T extends ZodTupleItems | [
|
|
1141
|
+
]> = AssertArray<{
|
|
1142
|
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
|
1143
|
+
}>;
|
|
1144
|
+
export type InputTypeOfTupleWithRest<T extends ZodTupleItems | [
|
|
1145
|
+
], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [
|
|
1146
|
+
...InputTypeOfTuple<T>,
|
|
1147
|
+
...Rest["_input"][]
|
|
1148
|
+
] : InputTypeOfTuple<T>;
|
|
1149
|
+
export interface ZodTupleDef<T extends ZodTupleItems | [
|
|
1150
|
+
] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
1151
|
+
items: T;
|
|
1152
|
+
rest: Rest;
|
|
1153
|
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
1154
|
+
}
|
|
1155
|
+
export type AnyZodTuple = ZodTuple<[
|
|
1156
|
+
ZodTypeAny,
|
|
1157
|
+
...ZodTypeAny[]
|
|
1158
|
+
] | [
|
|
1159
|
+
], ZodTypeAny | null>;
|
|
1160
|
+
declare class ZodTuple<T extends ZodTupleItems | [
|
|
1161
|
+
] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
|
1162
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1163
|
+
get items(): T;
|
|
1164
|
+
rest<RestSchema extends ZodTypeAny>(rest: RestSchema): ZodTuple<T, RestSchema>;
|
|
1165
|
+
static create: <Items extends [
|
|
1166
|
+
ZodTypeAny,
|
|
1167
|
+
...ZodTypeAny[]
|
|
1168
|
+
] | [
|
|
1169
|
+
]>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
|
1170
|
+
}
|
|
1171
|
+
export interface ZodRecordDef<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1172
|
+
valueType: Value;
|
|
1173
|
+
keyType: Key;
|
|
1174
|
+
typeName: ZodFirstPartyTypeKind.ZodRecord;
|
|
1175
|
+
}
|
|
1176
|
+
export type KeySchema = ZodType<string | number | symbol, any, any>;
|
|
1177
|
+
export type RecordType<K extends string | number | symbol, V> = [
|
|
1178
|
+
string
|
|
1179
|
+
] extends [
|
|
1180
|
+
K
|
|
1181
|
+
] ? Record<K, V> : [
|
|
1182
|
+
number
|
|
1183
|
+
] extends [
|
|
1184
|
+
K
|
|
1185
|
+
] ? Record<K, V> : [
|
|
1186
|
+
symbol
|
|
1187
|
+
] extends [
|
|
1188
|
+
K
|
|
1189
|
+
] ? Record<K, V> : [
|
|
1190
|
+
BRAND<string | number | symbol>
|
|
1191
|
+
] extends [
|
|
1192
|
+
K
|
|
1193
|
+
] ? Record<K, V> : Partial<Record<K, V>>;
|
|
1194
|
+
declare class ZodRecord<Key extends KeySchema = ZodString, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<RecordType<Key["_output"], Value["_output"]>, ZodRecordDef<Key, Value>, RecordType<Key["_input"], Value["_input"]>> {
|
|
1195
|
+
get keySchema(): Key;
|
|
1196
|
+
get valueSchema(): Value;
|
|
1197
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1198
|
+
get element(): Value;
|
|
1199
|
+
static create<Value extends ZodTypeAny>(valueType: Value, params?: RawCreateParams): ZodRecord<ZodString, Value>;
|
|
1200
|
+
static create<Keys extends KeySchema, Value extends ZodTypeAny>(keySchema: Keys, valueType: Value, params?: RawCreateParams): ZodRecord<Keys, Value>;
|
|
1201
|
+
}
|
|
1202
|
+
export interface ZodMapDef<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1203
|
+
valueType: Value;
|
|
1204
|
+
keyType: Key;
|
|
1205
|
+
typeName: ZodFirstPartyTypeKind.ZodMap;
|
|
1206
|
+
}
|
|
1207
|
+
declare class ZodMap<Key extends ZodTypeAny = ZodTypeAny, Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Map<Key["_output"], Value["_output"]>, ZodMapDef<Key, Value>, Map<Key["_input"], Value["_input"]>> {
|
|
1208
|
+
get keySchema(): Key;
|
|
1209
|
+
get valueSchema(): Value;
|
|
1210
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1211
|
+
static create: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
|
1212
|
+
}
|
|
1213
|
+
export interface ZodSetDef<Value extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1214
|
+
valueType: Value;
|
|
1215
|
+
typeName: ZodFirstPartyTypeKind.ZodSet;
|
|
1216
|
+
minSize: {
|
|
1217
|
+
value: number;
|
|
1218
|
+
message?: string | undefined;
|
|
1219
|
+
} | null;
|
|
1220
|
+
maxSize: {
|
|
1221
|
+
value: number;
|
|
1222
|
+
message?: string | undefined;
|
|
1223
|
+
} | null;
|
|
1224
|
+
}
|
|
1225
|
+
declare class ZodSet<Value extends ZodTypeAny = ZodTypeAny> extends ZodType<Set<Value["_output"]>, ZodSetDef<Value>, Set<Value["_input"]>> {
|
|
1226
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1227
|
+
min(minSize: number, message?: errorUtil.ErrMessage): this;
|
|
1228
|
+
max(maxSize: number, message?: errorUtil.ErrMessage): this;
|
|
1229
|
+
size(size: number, message?: errorUtil.ErrMessage): this;
|
|
1230
|
+
nonempty(message?: errorUtil.ErrMessage): ZodSet<Value>;
|
|
1231
|
+
static create: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
|
1232
|
+
}
|
|
1233
|
+
export interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1234
|
+
args: Args;
|
|
1235
|
+
returns: Returns;
|
|
1236
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
|
1237
|
+
}
|
|
1238
|
+
export type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
|
1239
|
+
export type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
|
1240
|
+
declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
|
1241
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1242
|
+
parameters(): Args;
|
|
1243
|
+
returnType(): Returns;
|
|
1244
|
+
args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
|
1245
|
+
returns<NewReturnType extends ZodType<any, any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
|
1246
|
+
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1247
|
+
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
|
1248
|
+
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1249
|
+
static create(): ZodFunction<ZodTuple<[
|
|
1250
|
+
], ZodUnknown>, ZodUnknown>;
|
|
1251
|
+
static create<T extends AnyZodTuple = ZodTuple<[
|
|
1252
|
+
], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
|
1253
|
+
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
|
1254
|
+
static create<T extends AnyZodTuple = ZodTuple<[
|
|
1255
|
+
], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
|
1256
|
+
}
|
|
1257
|
+
export interface ZodLazyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1258
|
+
getter: () => T;
|
|
1259
|
+
typeName: ZodFirstPartyTypeKind.ZodLazy;
|
|
1260
|
+
}
|
|
1261
|
+
declare class ZodLazy<T extends ZodTypeAny> extends ZodType<output<T>, ZodLazyDef<T>, input<T>> {
|
|
1262
|
+
get schema(): T;
|
|
1263
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1264
|
+
static create: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
|
1265
|
+
}
|
|
1266
|
+
export interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
|
1267
|
+
value: T;
|
|
1268
|
+
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
|
1269
|
+
}
|
|
1270
|
+
declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
|
1271
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1272
|
+
get value(): T;
|
|
1273
|
+
static create: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
|
1274
|
+
}
|
|
1275
|
+
export type ArrayKeys = keyof any[];
|
|
1276
|
+
export type Indices<T> = Exclude<keyof T, ArrayKeys>;
|
|
1277
|
+
export type EnumValues<T extends string = string> = readonly [
|
|
1278
|
+
T,
|
|
1279
|
+
...T[]
|
|
1280
|
+
];
|
|
1281
|
+
export type Values<T extends EnumValues> = {
|
|
1282
|
+
[k in T[number]]: k;
|
|
1283
|
+
};
|
|
1284
|
+
export interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
|
1285
|
+
values: T;
|
|
1286
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
|
1287
|
+
}
|
|
1288
|
+
export type Writeable<T> = {
|
|
1289
|
+
-readonly [P in keyof T]: T[P];
|
|
1290
|
+
};
|
|
1291
|
+
export type FilterEnum<Values, ToExclude> = Values extends [
|
|
1292
|
+
] ? [
|
|
1293
|
+
] : Values extends [
|
|
1294
|
+
infer Head,
|
|
1295
|
+
...infer Rest
|
|
1296
|
+
] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [
|
|
1297
|
+
Head,
|
|
1298
|
+
...FilterEnum<Rest, ToExclude>
|
|
1299
|
+
] : never;
|
|
1300
|
+
export type typecast<A, T> = A extends T ? A : never;
|
|
1301
|
+
declare function createZodEnum<U extends string, T extends Readonly<[
|
|
1302
|
+
U,
|
|
1303
|
+
...U[]
|
|
1304
|
+
]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
1305
|
+
declare function createZodEnum<U extends string, T extends [
|
|
1306
|
+
U,
|
|
1307
|
+
...U[]
|
|
1308
|
+
]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
1309
|
+
declare class ZodEnum<T extends [
|
|
1310
|
+
string,
|
|
1311
|
+
...string[]
|
|
1312
|
+
]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
|
1313
|
+
_cache: Set<T[number]> | undefined;
|
|
1314
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1315
|
+
get options(): T;
|
|
1316
|
+
get enum(): Values<T>;
|
|
1317
|
+
get Values(): Values<T>;
|
|
1318
|
+
get Enum(): Values<T>;
|
|
1319
|
+
extract<ToExtract extends readonly [
|
|
1320
|
+
T[number],
|
|
1321
|
+
...T[number][]
|
|
1322
|
+
]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
|
|
1323
|
+
exclude<ToExclude extends readonly [
|
|
1324
|
+
T[number],
|
|
1325
|
+
...T[number][]
|
|
1326
|
+
]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [
|
|
1327
|
+
string,
|
|
1328
|
+
...string[]
|
|
1329
|
+
]>>;
|
|
1330
|
+
static create: typeof createZodEnum;
|
|
1331
|
+
}
|
|
1332
|
+
export interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
|
1333
|
+
values: T;
|
|
1334
|
+
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
|
1335
|
+
}
|
|
1336
|
+
export type EnumLike = {
|
|
1337
|
+
[k: string]: string | number;
|
|
1338
|
+
[nu: number]: string;
|
|
1339
|
+
};
|
|
1340
|
+
declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>, T[keyof T]> {
|
|
1341
|
+
_cache: Set<T[keyof T]> | undefined;
|
|
1342
|
+
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
|
1343
|
+
get enum(): T;
|
|
1344
|
+
static create: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
|
1345
|
+
}
|
|
1346
|
+
export interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1347
|
+
type: T;
|
|
1348
|
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
1349
|
+
}
|
|
1350
|
+
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
1351
|
+
unwrap(): T;
|
|
1352
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1353
|
+
static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
|
1354
|
+
}
|
|
1355
|
+
export type Refinement<T> = (arg: T, ctx: RefinementCtx) => any;
|
|
1356
|
+
export type SuperRefinement<T> = (arg: T, ctx: RefinementCtx) => void | Promise<void>;
|
|
1357
|
+
export type RefinementEffect<T> = {
|
|
1358
|
+
type: "refinement";
|
|
1359
|
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
1360
|
+
};
|
|
1361
|
+
export type TransformEffect<T> = {
|
|
1362
|
+
type: "transform";
|
|
1363
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1364
|
+
};
|
|
1365
|
+
export type PreprocessEffect<T> = {
|
|
1366
|
+
type: "preprocess";
|
|
1367
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1368
|
+
};
|
|
1369
|
+
export type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
1370
|
+
export interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1371
|
+
schema: T;
|
|
1372
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
1373
|
+
effect: Effect<any>;
|
|
1374
|
+
}
|
|
1375
|
+
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
|
1376
|
+
innerType(): T;
|
|
1377
|
+
sourceType(): T;
|
|
1378
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1379
|
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
1380
|
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
1381
|
+
}
|
|
1382
|
+
export interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1383
|
+
innerType: T;
|
|
1384
|
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
1385
|
+
}
|
|
1386
|
+
export type ZodOptionalType<T extends ZodTypeAny> = ZodOptional<T>;
|
|
1387
|
+
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
1388
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1389
|
+
unwrap(): T;
|
|
1390
|
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
|
1391
|
+
}
|
|
1392
|
+
export interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1393
|
+
innerType: T;
|
|
1394
|
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
1395
|
+
}
|
|
1396
|
+
export type ZodNullableType<T extends ZodTypeAny> = ZodNullable<T>;
|
|
1397
|
+
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
1398
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1399
|
+
unwrap(): T;
|
|
1400
|
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
|
1401
|
+
}
|
|
1402
|
+
export interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1403
|
+
innerType: T;
|
|
1404
|
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
|
1405
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
1406
|
+
}
|
|
1407
|
+
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
|
1408
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1409
|
+
removeDefault(): T;
|
|
1410
|
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
|
1411
|
+
default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
|
|
1412
|
+
}) => ZodDefault<Inner>;
|
|
1413
|
+
}
|
|
1414
|
+
export interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1415
|
+
innerType: T;
|
|
1416
|
+
catchValue: (ctx: {
|
|
1417
|
+
error: ZodError;
|
|
1418
|
+
input: unknown;
|
|
1419
|
+
}) => T["_input"];
|
|
1420
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
1421
|
+
}
|
|
1422
|
+
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
1423
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1424
|
+
removeCatch(): T;
|
|
1425
|
+
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
|
1426
|
+
catch: Inner["_output"] | (() => Inner["_output"]);
|
|
1427
|
+
}) => ZodCatch<Inner>;
|
|
1428
|
+
}
|
|
1429
|
+
export interface ZodNaNDef extends ZodTypeDef {
|
|
1430
|
+
typeName: ZodFirstPartyTypeKind.ZodNaN;
|
|
1431
|
+
}
|
|
1432
|
+
declare class ZodNaN extends ZodType<number, ZodNaNDef, number> {
|
|
1433
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1434
|
+
static create: (params?: RawCreateParams) => ZodNaN;
|
|
1435
|
+
}
|
|
1436
|
+
export interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
1437
|
+
type: T;
|
|
1438
|
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
1439
|
+
}
|
|
1440
|
+
declare const BRAND: unique symbol;
|
|
1441
|
+
export type BRAND<T extends string | number | symbol> = {
|
|
1442
|
+
[BRAND]: {
|
|
1443
|
+
[k in T]: true;
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
1447
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1448
|
+
unwrap(): T;
|
|
1449
|
+
}
|
|
1450
|
+
export interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
|
1451
|
+
in: A;
|
|
1452
|
+
out: B;
|
|
1453
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
1454
|
+
}
|
|
1455
|
+
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
|
1456
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1457
|
+
static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
|
|
1458
|
+
}
|
|
1459
|
+
export type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
1460
|
+
readonly [Symbol.toStringTag]: string;
|
|
1461
|
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
1462
|
+
export type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [
|
|
1463
|
+
infer Head,
|
|
1464
|
+
...infer Tail
|
|
1465
|
+
] ? readonly [
|
|
1466
|
+
Head,
|
|
1467
|
+
...Tail
|
|
1468
|
+
] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
1469
|
+
export interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1470
|
+
innerType: T;
|
|
1471
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
|
1472
|
+
}
|
|
1473
|
+
declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
|
1474
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1475
|
+
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
|
|
1476
|
+
unwrap(): T;
|
|
1477
|
+
}
|
|
1478
|
+
export type CustomParams = CustomErrorParams & {
|
|
1479
|
+
fatal?: boolean;
|
|
1480
|
+
};
|
|
1481
|
+
declare function custom<T>(check?: (data: any) => any, _params?: string | CustomParams | ((input: any) => CustomParams),
|
|
1482
|
+
/**
|
|
1483
|
+
* @deprecated
|
|
1484
|
+
*
|
|
1485
|
+
* Pass `fatal` into the params object instead:
|
|
1486
|
+
*
|
|
1487
|
+
* ```ts
|
|
1488
|
+
* z.string().custom((val) => val.length > 5, { fatal: false })
|
|
1489
|
+
* ```
|
|
1490
|
+
*
|
|
1491
|
+
*/
|
|
1492
|
+
fatal?: boolean): ZodType<T, ZodTypeDef, T>;
|
|
1493
|
+
declare const late: {
|
|
1494
|
+
object: <Shape extends ZodRawShape>(shape: () => Shape, params?: RawCreateParams) => ZodObject<Shape, "strip">;
|
|
1495
|
+
};
|
|
1496
|
+
declare enum ZodFirstPartyTypeKind {
|
|
1497
|
+
ZodString = "ZodString",
|
|
1498
|
+
ZodNumber = "ZodNumber",
|
|
1499
|
+
ZodNaN = "ZodNaN",
|
|
1500
|
+
ZodBigInt = "ZodBigInt",
|
|
1501
|
+
ZodBoolean = "ZodBoolean",
|
|
1502
|
+
ZodDate = "ZodDate",
|
|
1503
|
+
ZodSymbol = "ZodSymbol",
|
|
1504
|
+
ZodUndefined = "ZodUndefined",
|
|
1505
|
+
ZodNull = "ZodNull",
|
|
1506
|
+
ZodAny = "ZodAny",
|
|
1507
|
+
ZodUnknown = "ZodUnknown",
|
|
1508
|
+
ZodNever = "ZodNever",
|
|
1509
|
+
ZodVoid = "ZodVoid",
|
|
1510
|
+
ZodArray = "ZodArray",
|
|
1511
|
+
ZodObject = "ZodObject",
|
|
1512
|
+
ZodUnion = "ZodUnion",
|
|
1513
|
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
1514
|
+
ZodIntersection = "ZodIntersection",
|
|
1515
|
+
ZodTuple = "ZodTuple",
|
|
1516
|
+
ZodRecord = "ZodRecord",
|
|
1517
|
+
ZodMap = "ZodMap",
|
|
1518
|
+
ZodSet = "ZodSet",
|
|
1519
|
+
ZodFunction = "ZodFunction",
|
|
1520
|
+
ZodLazy = "ZodLazy",
|
|
1521
|
+
ZodLiteral = "ZodLiteral",
|
|
1522
|
+
ZodEnum = "ZodEnum",
|
|
1523
|
+
ZodEffects = "ZodEffects",
|
|
1524
|
+
ZodNativeEnum = "ZodNativeEnum",
|
|
1525
|
+
ZodOptional = "ZodOptional",
|
|
1526
|
+
ZodNullable = "ZodNullable",
|
|
1527
|
+
ZodDefault = "ZodDefault",
|
|
1528
|
+
ZodCatch = "ZodCatch",
|
|
1529
|
+
ZodPromise = "ZodPromise",
|
|
1530
|
+
ZodBranded = "ZodBranded",
|
|
1531
|
+
ZodPipeline = "ZodPipeline",
|
|
1532
|
+
ZodReadonly = "ZodReadonly"
|
|
1533
|
+
}
|
|
1534
|
+
export type ZodFirstPartySchemaTypes = ZodString | ZodNumber | ZodNaN | ZodBigInt | ZodBoolean | ZodDate | ZodUndefined | ZodNull | ZodAny | ZodUnknown | ZodNever | ZodVoid | ZodArray<any, any> | ZodObject<any, any, any> | ZodUnion<any> | ZodDiscriminatedUnion<any, any> | ZodIntersection<any, any> | ZodTuple<any, any> | ZodRecord<any, any> | ZodMap<any> | ZodSet<any> | ZodFunction<any, any> | ZodLazy<any> | ZodLiteral<any> | ZodEnum<any> | ZodEffects<any, any, any> | ZodNativeEnum<any> | ZodOptional<any> | ZodNullable<any> | ZodDefault<any> | ZodCatch<any> | ZodPromise<any> | ZodBranded<any, any> | ZodPipeline<any, any> | ZodReadonly<any> | ZodSymbol;
|
|
1535
|
+
declare abstract class Class {
|
|
1536
|
+
constructor(..._: any[]);
|
|
1537
|
+
}
|
|
1538
|
+
declare const instanceOfType: <T extends typeof Class>(cls: T, params?: CustomParams) => ZodType<InstanceType<T>, ZodTypeDef, InstanceType<T>>;
|
|
1539
|
+
declare const stringType: (params?: RawCreateParams & {
|
|
1540
|
+
coerce?: true;
|
|
1541
|
+
}) => ZodString;
|
|
1542
|
+
declare const numberType: (params?: RawCreateParams & {
|
|
1543
|
+
coerce?: boolean;
|
|
1544
|
+
}) => ZodNumber;
|
|
1545
|
+
declare const nanType: (params?: RawCreateParams) => ZodNaN;
|
|
1546
|
+
declare const bigIntType: (params?: RawCreateParams & {
|
|
1547
|
+
coerce?: boolean;
|
|
1548
|
+
}) => ZodBigInt;
|
|
1549
|
+
declare const booleanType: (params?: RawCreateParams & {
|
|
1550
|
+
coerce?: boolean;
|
|
1551
|
+
}) => ZodBoolean;
|
|
1552
|
+
declare const dateType: (params?: RawCreateParams & {
|
|
1553
|
+
coerce?: boolean;
|
|
1554
|
+
}) => ZodDate;
|
|
1555
|
+
declare const symbolType: (params?: RawCreateParams) => ZodSymbol;
|
|
1556
|
+
declare const undefinedType: (params?: RawCreateParams) => ZodUndefined;
|
|
1557
|
+
declare const nullType: (params?: RawCreateParams) => ZodNull;
|
|
1558
|
+
declare const anyType: (params?: RawCreateParams) => ZodAny;
|
|
1559
|
+
declare const unknownType: (params?: RawCreateParams) => ZodUnknown;
|
|
1560
|
+
declare const neverType: (params?: RawCreateParams) => ZodNever;
|
|
1561
|
+
declare const voidType: (params?: RawCreateParams) => ZodVoid;
|
|
1562
|
+
declare const arrayType: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
|
1563
|
+
declare const objectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strip", ZodTypeAny, objectOutputType<Shape, ZodTypeAny, "strip">, objectInputType<Shape, ZodTypeAny, "strip">>;
|
|
1564
|
+
declare const strictObjectType: <Shape extends ZodRawShape>(shape: Shape, params?: RawCreateParams) => ZodObject<Shape, "strict">;
|
|
1565
|
+
declare const unionType: <Options extends Readonly<[
|
|
1566
|
+
ZodTypeAny,
|
|
1567
|
+
ZodTypeAny,
|
|
1568
|
+
...ZodTypeAny[]
|
|
1569
|
+
]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
|
1570
|
+
declare const discriminatedUnionType: typeof ZodDiscriminatedUnion.create;
|
|
1571
|
+
declare const intersectionType: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
|
1572
|
+
declare const tupleType: <Items extends [
|
|
1573
|
+
ZodTypeAny,
|
|
1574
|
+
...ZodTypeAny[]
|
|
1575
|
+
] | [
|
|
1576
|
+
]>(schemas: Items, params?: RawCreateParams) => ZodTuple<Items, null>;
|
|
1577
|
+
declare const recordType: typeof ZodRecord.create;
|
|
1578
|
+
declare const mapType: <KeySchema extends ZodTypeAny = ZodTypeAny, ValueSchema extends ZodTypeAny = ZodTypeAny>(keyType: KeySchema, valueType: ValueSchema, params?: RawCreateParams) => ZodMap<KeySchema, ValueSchema>;
|
|
1579
|
+
declare const setType: <ValueSchema extends ZodTypeAny = ZodTypeAny>(valueType: ValueSchema, params?: RawCreateParams) => ZodSet<ValueSchema>;
|
|
1580
|
+
declare const functionType: typeof ZodFunction.create;
|
|
1581
|
+
declare const lazyType: <Inner extends ZodTypeAny>(getter: () => Inner, params?: RawCreateParams) => ZodLazy<Inner>;
|
|
1582
|
+
declare const literalType: <Value extends Primitive>(value: Value, params?: RawCreateParams) => ZodLiteral<Value>;
|
|
1583
|
+
declare const enumType: typeof createZodEnum;
|
|
1584
|
+
declare const nativeEnumType: <Elements extends EnumLike>(values: Elements, params?: RawCreateParams) => ZodNativeEnum<Elements>;
|
|
1585
|
+
declare const promiseType: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
|
1586
|
+
declare const effectsType: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
1587
|
+
declare const optionalType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
|
1588
|
+
declare const nullableType: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
|
1589
|
+
declare const preprocessType: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
1590
|
+
declare const pipelineType: typeof ZodPipeline.create;
|
|
1591
|
+
declare const ostring: () => ZodOptional<ZodString>;
|
|
1592
|
+
declare const onumber: () => ZodOptional<ZodNumber>;
|
|
1593
|
+
declare const oboolean: () => ZodOptional<ZodBoolean>;
|
|
1594
|
+
declare const coerce: {
|
|
1595
|
+
string: (typeof ZodString)["create"];
|
|
1596
|
+
number: (typeof ZodNumber)["create"];
|
|
1597
|
+
boolean: (typeof ZodBoolean)["create"];
|
|
1598
|
+
bigint: (typeof ZodBigInt)["create"];
|
|
1599
|
+
date: (typeof ZodDate)["create"];
|
|
1600
|
+
};
|
|
1601
|
+
declare const NEVER: never;
|
|
1602
|
+
/**
|
|
1603
|
+
* The report's shape, split by who produces each part. A leaf module: the rows
|
|
1604
|
+
* builder and the contract both need these types, and neither may import the
|
|
1605
|
+
* other (report-contract calls buildReportRows, so the dependency runs one way).
|
|
1606
|
+
*/
|
|
1607
|
+
/**
|
|
1608
|
+
* One behaviour the change introduces, and the tests that stand behind it.
|
|
1609
|
+
*
|
|
1610
|
+
* DERIVED, never authored — the whole chain already exists in the artifacts:
|
|
1611
|
+
* analyze names each behaviour with an id and the diff line that introduces it,
|
|
1612
|
+
* recommend's cases carry `from_behavior` and its maintenance entries carry
|
|
1613
|
+
* `covers_behaviors`, and the rows know which of those were actually delivered.
|
|
1614
|
+
* Aggregating it here is what lets a reader go from "what changed" to "the test
|
|
1615
|
+
* that proves it" without reading prose.
|
|
1616
|
+
*/
|
|
1617
|
+
export interface ChangeRow {
|
|
1618
|
+
/** analyze behaviour id. */
|
|
1619
|
+
id: string;
|
|
1620
|
+
/** What the change makes true (analyze's `statement`). */
|
|
1621
|
+
text: string;
|
|
1622
|
+
/** Where it comes from — analyze's `evidence`, a file:line in the diff. */
|
|
1623
|
+
source: string;
|
|
1624
|
+
/** Planned-case ids of tests that ran AND whose own result was Pass/Fail —
|
|
1625
|
+
* not merely a sibling in the same file that itself came back Skipped —
|
|
1626
|
+
* and cite this behaviour. */
|
|
1627
|
+
testedBy: string[];
|
|
1628
|
+
/**
|
|
1629
|
+
* Planned-case ids delivered as a real file (a newTestsCreated row exists)
|
|
1630
|
+
* and citing this behaviour, whether or not `testedBy` could prove them —
|
|
1631
|
+
* distinguishes "a test exists but did not run this time" from "nothing
|
|
1632
|
+
* was ever written for this".
|
|
1633
|
+
*/
|
|
1634
|
+
writtenBy: string[];
|
|
1635
|
+
/**
|
|
1636
|
+
* Final paths of existing tests adapt actually acted on (its own item,
|
|
1637
|
+
* action other than `none`) that cite this behaviour — not merely files
|
|
1638
|
+
* recommend planned to touch, which a run may never have gotten to.
|
|
1639
|
+
*/
|
|
1640
|
+
maintainedBy: string[];
|
|
1641
|
+
}
|
|
1642
|
+
/** Counters over the rows: what the run produced and how much of it ran. */
|
|
1643
|
+
export interface ExecutionCoverage {
|
|
1644
|
+
generated: number;
|
|
1645
|
+
modified: number;
|
|
1646
|
+
verified: number;
|
|
1647
|
+
executed: number;
|
|
1648
|
+
}
|
|
1649
|
+
declare enum ClauseStatus {
|
|
1650
|
+
/** Every test behind it that ran passed. */
|
|
1651
|
+
Pass = "Pass",
|
|
1652
|
+
/** A test behind it failed: the change does not do what the clause says (or a defect's test showed it). */
|
|
1653
|
+
Fail = "Fail",
|
|
1654
|
+
/** Tests were written for it, and none of them ran. */
|
|
1655
|
+
NotRun = "Not run",
|
|
1656
|
+
/** No test checks it. */
|
|
1657
|
+
NotTested = "Not tested",
|
|
1658
|
+
/**
|
|
1659
|
+
* A check of what the change could break that ran and passed, its test then removed (contracts/could-break-contract.ts):
|
|
1660
|
+
* it was checked and holds, though no test is kept for it.
|
|
1661
|
+
*/
|
|
1662
|
+
PassedNotKept = "Passed, test not kept"
|
|
1663
|
+
}
|
|
1664
|
+
export interface RequirementTestRef {
|
|
1665
|
+
/** The planned case the result proves. */
|
|
1666
|
+
testId: string;
|
|
1667
|
+
fileName?: string;
|
|
1668
|
+
/** owner/repo of `fileName` when a result row named it; absent for a file named as write wrote it. */
|
|
1669
|
+
repository?: string;
|
|
1670
|
+
/** The test functions behind the case, as the runner names them; empty when the run did not name them. */
|
|
1671
|
+
functions: string[];
|
|
1672
|
+
status: "Pass" | "Fail" | "Skipped";
|
|
1673
|
+
}
|
|
1674
|
+
export interface RequirementClauseRow {
|
|
1675
|
+
id: string;
|
|
1676
|
+
/** What the clause asks; absent for a Requirement reference. */
|
|
1677
|
+
text?: string;
|
|
1678
|
+
status: ClauseStatus;
|
|
1679
|
+
tests: RequirementTestRef[];
|
|
1680
|
+
/** The plan's findings against this clause or its requirement. */
|
|
1681
|
+
findings: string[];
|
|
1682
|
+
/** Why no test checks it (Not tested, when the plan or write said), or what the removed check showed (Passed, test not kept). */
|
|
1683
|
+
notTested?: string;
|
|
1684
|
+
}
|
|
1685
|
+
export interface RequirementReportRow {
|
|
1686
|
+
id: string;
|
|
1687
|
+
/** How the reader knows it: the item and criterion for a Requirement reference ("PAY-184 AC2"), else its id. */
|
|
1688
|
+
label: string;
|
|
1689
|
+
source: string;
|
|
1690
|
+
/** The requirement as the plan states it; absent for a Requirement reference. */
|
|
1691
|
+
statement?: string;
|
|
1692
|
+
clauses: RequirementClauseRow[];
|
|
1693
|
+
}
|
|
1694
|
+
/** The shipped report — the TestbotReport shape deliver renders into the PR. */
|
|
1695
|
+
export interface StagedTestbotReport {
|
|
1696
|
+
schemaVersion?: 1;
|
|
1697
|
+
businessCaseAnalysis: string;
|
|
1698
|
+
newTestsCreated: {
|
|
1699
|
+
testId: string;
|
|
1700
|
+
testType: string;
|
|
1701
|
+
endpoint: string;
|
|
1702
|
+
fileName: string;
|
|
1703
|
+
description: string;
|
|
1704
|
+
reasoning: string;
|
|
1705
|
+
/** owner/repo where the test lives. Absent from pre-V3 reports. */
|
|
1706
|
+
repository?: string;
|
|
1707
|
+
}[];
|
|
1708
|
+
testMaintenance?: {
|
|
1709
|
+
testType: string;
|
|
1710
|
+
endpoint: string;
|
|
1711
|
+
fileName: string;
|
|
1712
|
+
description: string;
|
|
1713
|
+
action: string;
|
|
1714
|
+
beforeStatus: string;
|
|
1715
|
+
beforeDetails: string;
|
|
1716
|
+
afterStatus: string;
|
|
1717
|
+
afterDetails: string;
|
|
1718
|
+
/** owner/repo where the maintained test lives. Absent from pre-V3 reports. */
|
|
1719
|
+
repository?: string;
|
|
1720
|
+
}[];
|
|
1721
|
+
testResults: {
|
|
1722
|
+
/** The recommend case this row proves, when the file covers one. Absent
|
|
1723
|
+
* for a row about an existing test's overall re-run (no planned case). */
|
|
1724
|
+
testId?: string;
|
|
1725
|
+
testType: string;
|
|
1726
|
+
endpoint: string;
|
|
1727
|
+
status: "Pass" | "Fail" | "Skipped";
|
|
1728
|
+
details: string;
|
|
1729
|
+
/** The test file this row is about. */
|
|
1730
|
+
fileName?: string;
|
|
1731
|
+
/** Testbot V3: `owner/repo` where the test lives. Absent from pre-V3 reports. */
|
|
1732
|
+
repository?: string;
|
|
1733
|
+
/** Testbot V3: `testResultId(repository, testType, path, name)`, unique within
|
|
1734
|
+
* the report. Absent from pre-V3 reports. */
|
|
1735
|
+
resultId?: string;
|
|
1736
|
+
/** Testbot V3: why a Fail or Skipped row came out so, when the run's own
|
|
1737
|
+
* records say. Absent when they do not, and never on a Pass row. */
|
|
1738
|
+
failureCause?: FailureCause;
|
|
1739
|
+
}[];
|
|
1740
|
+
issuesFound: {
|
|
1741
|
+
description: string;
|
|
1742
|
+
severity?: string;
|
|
1743
|
+
/** `bug`, `lint`, `type`, `config`, or for a Requirement reference `requirement_conflict` or `spec_overruled` (IssueCategory). */
|
|
1744
|
+
category?: string;
|
|
1745
|
+
sourceFile?: string;
|
|
1746
|
+
sourceLine?: number;
|
|
1747
|
+
/** The reference criteria a `requirement_conflict` or `spec_overruled` issue is about (SKYR-4920). */
|
|
1748
|
+
requirements?: IssueCriterion[];
|
|
1749
|
+
/** The plan's finding this issue is, when it is one. */
|
|
1750
|
+
findingId?: string;
|
|
1751
|
+
/** The plan's requirement or clause ids it violates. */
|
|
1752
|
+
requirementIds?: string[];
|
|
1753
|
+
}[];
|
|
1754
|
+
nextSteps: string[];
|
|
1755
|
+
/**
|
|
1756
|
+
* What the reader must know that the rows alone do not say: nothing ran, a
|
|
1757
|
+
* dependency was mocked, the app needed a corrected recipe.
|
|
1758
|
+
*
|
|
1759
|
+
* DERIVED, never authored. Every one of these is a fact the artifacts
|
|
1760
|
+
* already record, and the gate used to require the agent to restate it in
|
|
1761
|
+
* prose and then hunt for that prose with a regex — so a report could
|
|
1762
|
+
* disclose a caveat perfectly and fail on vocabulary, while one that merely
|
|
1763
|
+
* contained the word "lint" passed. Constructing the line instead makes the
|
|
1764
|
+
* disclosure a property of the report rather than of its wording.
|
|
1765
|
+
*/
|
|
1766
|
+
caveats?: ReportCaveat[];
|
|
1767
|
+
/** Behaviour → proving test. Absent when analyze named no behaviours. */
|
|
1768
|
+
changes?: ChangeRow[];
|
|
1769
|
+
/** Absent when there are no rows to count. */
|
|
1770
|
+
executionCoverage?: ExecutionCoverage;
|
|
1771
|
+
commitMessage: string;
|
|
1772
|
+
/** Testbot V3: the run's triage and sufficiency. Absent from pre-V3 reports. */
|
|
1773
|
+
validation?: ReportValidation;
|
|
1774
|
+
/** Testbot V3: the shared environment the run needed, as it was checked. Absent when it needed none. */
|
|
1775
|
+
system?: ReportSystem;
|
|
1776
|
+
/** Testbot V3: the context each runtime test ran in (SKYR-4579). Absent when the run planned no runtime test. */
|
|
1777
|
+
testExecutionContexts?: TestExecutionContext[];
|
|
1778
|
+
/** Testbot V3: whether the run read each Requirement reference (SKYR-4919). Only when its manifest named some. */
|
|
1779
|
+
requirementReferences?: ReportedRequirementReference[];
|
|
1780
|
+
/** Each requirement by its id, its clauses, and the tests and defects behind each (two-step pipeline). Derived. */
|
|
1781
|
+
requirements?: RequirementReportRow[];
|
|
1782
|
+
/** The recorded video of each browser test file the run wrote (context/ui-video.ts): the file by its repository and
|
|
1783
|
+
* path there (as testResults names it) and as the write step named it (as userJourneys does), with its download link
|
|
1784
|
+
* once uploaded. `artifactsUrl` is the run's artifacts page, set only when some file's upload succeeded. Absent when
|
|
1785
|
+
* none was recorded. */
|
|
1786
|
+
testVideos?: {
|
|
1787
|
+
fileName: string;
|
|
1788
|
+
repository?: string;
|
|
1789
|
+
writtenAs?: string;
|
|
1790
|
+
url?: string;
|
|
1791
|
+
artifactsUrl?: string;
|
|
1792
|
+
}[];
|
|
1793
|
+
/** The user journeys the change sits on and the browser test that walks each (two-step pipeline). Absent when none were planned. */
|
|
1794
|
+
userJourneys?: JourneyReportRow[];
|
|
1795
|
+
/** The Testbot test packages this run's tests are in, each with the one command that runs it. Derived. */
|
|
1796
|
+
testPackages?: ReportTestPackage[];
|
|
1797
|
+
/** Packages this run added to an application manifest: an exception, each with its reason. Derived. */
|
|
1798
|
+
dependencyChanges?: ReportDependencyChange[];
|
|
1799
|
+
}
|
|
1800
|
+
declare enum JourneyStatus {
|
|
1801
|
+
Pass = "Pass",
|
|
1802
|
+
Fail = "Fail",
|
|
1803
|
+
NotRun = "Not run",
|
|
1804
|
+
NotWritten = "Not written"
|
|
1805
|
+
}
|
|
1806
|
+
/** One planned user journey, and the browser test that walks it (contracts/journeys.ts). */
|
|
1807
|
+
export interface JourneyReportRow {
|
|
1808
|
+
id: string;
|
|
1809
|
+
name: string;
|
|
1810
|
+
entry: string;
|
|
1811
|
+
steps: number;
|
|
1812
|
+
/** spec or pr-description when one describes the flow, else inferred. */
|
|
1813
|
+
source: string;
|
|
1814
|
+
fileName?: string;
|
|
1815
|
+
test?: string;
|
|
1816
|
+
status: JourneyStatus;
|
|
1817
|
+
/** Why the test does not count as walking the journey end to end, when it does not. */
|
|
1818
|
+
problems: string[];
|
|
1819
|
+
/** Not covered: what the journey's test needs that could not be set up here. */
|
|
1820
|
+
uncovered?: string;
|
|
1821
|
+
}
|
|
1822
|
+
/** A Testbot test package (context/test-package.ts): a self-contained folder whose entrypoint CI calls. */
|
|
1823
|
+
export interface ReportTestPackage {
|
|
1824
|
+
directory: string;
|
|
1825
|
+
runner: string;
|
|
1826
|
+
entrypoint: string;
|
|
1827
|
+
/** Set up by this run, else maintained from an earlier one. */
|
|
1828
|
+
created: boolean;
|
|
1829
|
+
/** owner/repo the package is in. */
|
|
1830
|
+
repository?: string;
|
|
1831
|
+
}
|
|
1832
|
+
/** A package added to an application manifest (finalize.json dependencies.added). */
|
|
1833
|
+
export interface ReportDependencyChange {
|
|
1834
|
+
package: string;
|
|
1835
|
+
manifest: string;
|
|
1836
|
+
reason?: string;
|
|
1837
|
+
repository?: string;
|
|
1838
|
+
}
|
|
1839
|
+
declare enum RequirementItemSource {
|
|
1840
|
+
Jira = "jira",
|
|
1841
|
+
/** A Confluence page. Its key is its page id. */
|
|
1842
|
+
Confluence = "confluence",
|
|
1843
|
+
/**
|
|
1844
|
+
* Pasted requirement text, or an Uploaded document (SKYR-4927). It has no site. Its key is "pasted-" or "file-" and
|
|
1845
|
+
* the start of its content hash.
|
|
1846
|
+
*/
|
|
1847
|
+
Other = "other"
|
|
1848
|
+
}
|
|
1849
|
+
declare enum RequirementItemState {
|
|
1850
|
+
Read = "read",
|
|
1851
|
+
NotRead = "not_read"
|
|
1852
|
+
}
|
|
1853
|
+
declare enum RequirementNotReadReason {
|
|
1854
|
+
NotFound = "not_found",
|
|
1855
|
+
NoAccess = "no_access",
|
|
1856
|
+
Unavailable = "unavailable",
|
|
1857
|
+
AccessLost = "access_lost",
|
|
1858
|
+
/** The runner could not get an Uploaded document, its bytes do not match its hash, or the agent could not open it (SKYR-4927). */
|
|
1859
|
+
CannotOpen = "cannot_open"
|
|
1860
|
+
}
|
|
1861
|
+
/** An item by its source, site and key. A Jira issue and a Confluence page are on a site; pasted text has none. */
|
|
1862
|
+
export type RequirementItemName = {
|
|
1863
|
+
source: RequirementItemSource.Jira | RequirementItemSource.Confluence;
|
|
1864
|
+
site: string;
|
|
1865
|
+
key: string;
|
|
1866
|
+
} | {
|
|
1867
|
+
source: RequirementItemSource.Other;
|
|
1868
|
+
site?: undefined;
|
|
1869
|
+
key: string;
|
|
1870
|
+
};
|
|
1871
|
+
/** A Requirement reference as the report names it: the item and whether the run read it, never its text. */
|
|
1872
|
+
export type ReportedRequirementReference = RequirementItemName & ({
|
|
1873
|
+
state: RequirementItemState.Read;
|
|
1874
|
+
/**
|
|
1875
|
+
* Whether the item still matches what the app read on Run. False when it changed since: the run used its current
|
|
1876
|
+
* content, and Run details says it changed (SKYR-4923).
|
|
1877
|
+
*/
|
|
1878
|
+
contentMatches: boolean;
|
|
1879
|
+
/** How the run judged each criterion of the item (SKYR-4920). Absent when the run made no plan. */
|
|
1880
|
+
criteria?: ReportedCriterion[];
|
|
1881
|
+
} | {
|
|
1882
|
+
state: RequirementItemState.NotRead;
|
|
1883
|
+
reason: RequirementNotReadReason;
|
|
1884
|
+
});
|
|
1885
|
+
declare enum CriterionResult {
|
|
1886
|
+
/** A covering test passed, and none failed. */
|
|
1887
|
+
Met = "met",
|
|
1888
|
+
/** A covering test ran and failed, for a cause other than the application. */
|
|
1889
|
+
NotMet = "not_met",
|
|
1890
|
+
/** The change does not touch it. It is never a test and never a failure. */
|
|
1891
|
+
NotInChange = "not_in_change",
|
|
1892
|
+
/** A covering test failed because the code contradicts it: a requirement_conflict. */
|
|
1893
|
+
Conflict = "conflict",
|
|
1894
|
+
/**
|
|
1895
|
+
* The change touches it, but no covering test ran: the plan gave it no test (for example, an Instruction narrowed
|
|
1896
|
+
* the validation), or its tests were skipped.
|
|
1897
|
+
*/
|
|
1898
|
+
NotTested = "not_tested"
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* One criterion of an item, numbered from 1 in the item's order. `quote` is the item's own words, for the web app
|
|
1902
|
+
* only (ADR-0008 in testbot-installer-app docs/specs/testbot-v3/docs/adr/). It is left out when it holds a shape the
|
|
1903
|
+
* app refuses. `coveredBy` names planned cases, as `changes[].testedBy` does.
|
|
1904
|
+
*/
|
|
1905
|
+
export interface ReportedCriterion {
|
|
1906
|
+
criterion: number;
|
|
1907
|
+
quote?: string;
|
|
1908
|
+
coveredBy: string[];
|
|
1909
|
+
result: CriterionResult;
|
|
1910
|
+
/** Why the change does not touch it; only for not_in_change. */
|
|
1911
|
+
note?: string;
|
|
1912
|
+
}
|
|
1913
|
+
/** The criterion an issue is about, and the version of its item the run read. */
|
|
1914
|
+
export type IssueCriterion = RequirementItemName & {
|
|
1915
|
+
criterion: number;
|
|
1916
|
+
version: string;
|
|
1917
|
+
};
|
|
1918
|
+
declare enum UploadedMediaType {
|
|
1919
|
+
Pdf = "application/pdf",
|
|
1920
|
+
Csv = "text/csv",
|
|
1921
|
+
Docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1922
|
+
Xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1923
|
+
}
|
|
1924
|
+
declare enum ValidationSufficiency {
|
|
1925
|
+
Sufficient = "sufficient",
|
|
1926
|
+
Insufficient = "insufficient"
|
|
1927
|
+
}
|
|
1928
|
+
declare enum ActionRequiredReason {
|
|
1929
|
+
RelatedChangeConflict = "related_change_conflict",
|
|
1930
|
+
ReferenceOutsideTarget = "reference_outside_target",
|
|
1931
|
+
SourceAccessLost = "source_access_lost",
|
|
1932
|
+
ConfigurationIncomplete = "configuration_incomplete",
|
|
1933
|
+
CredentialUnavailable = "credential_unavailable",
|
|
1934
|
+
WorkflowBindingUnverified = "workflow_binding_unverified",
|
|
1935
|
+
/** No Admin trusts the workflow host's writers, and Skyramp could not confirm that a ruleset requires a reviewed pull request on its bound branch (SKYR-4681). */
|
|
1936
|
+
WorkflowRefUnprotected = "workflow_ref_unprotected",
|
|
1937
|
+
/** The organization runs Testbot on AWS Bedrock, and the bound workflow does not turn Bedrock on (SKYR-5055). */
|
|
1938
|
+
BedrockWorkflowRequired = "bedrock_workflow_required",
|
|
1939
|
+
DeploymentReview = "deployment_review",
|
|
1940
|
+
SutRevisionMismatch = "sut_revision_mismatch",
|
|
1941
|
+
IsolationUnavailable = "isolation_unavailable",
|
|
1942
|
+
EvidenceInsufficient = "evidence_insufficient"
|
|
1943
|
+
}
|
|
1944
|
+
declare enum EvidenceKind {
|
|
1945
|
+
CiCheck = "ci_check",
|
|
1946
|
+
TestReport = "test_report",
|
|
1947
|
+
StaticAnalysis = "static_analysis",
|
|
1948
|
+
CodeReview = "code_review",
|
|
1949
|
+
Other = "other"
|
|
1950
|
+
}
|
|
1951
|
+
declare enum FailureCauseKind {
|
|
1952
|
+
Application = "application",
|
|
1953
|
+
Environment = "environment",
|
|
1954
|
+
TestDefect = "test_defect"
|
|
1955
|
+
}
|
|
1956
|
+
declare enum EnvironmentFamily {
|
|
1957
|
+
AuthToken = "auth_token",
|
|
1958
|
+
Secret = "secret",
|
|
1959
|
+
DataConnection = "data_connection",
|
|
1960
|
+
AppNotStarted = "app_not_started",
|
|
1961
|
+
Login = "login",
|
|
1962
|
+
ExternalDependency = "external_dependency",
|
|
1963
|
+
RecordingReplay = "recording_replay"
|
|
1964
|
+
}
|
|
1965
|
+
/** A Fail or Skipped result's cause, derived from what the run recorded. `family` goes with Environment only. */
|
|
1966
|
+
export interface FailureCause {
|
|
1967
|
+
kind: FailureCauseKind;
|
|
1968
|
+
family?: EnvironmentFamily;
|
|
1969
|
+
}
|
|
1970
|
+
/** Existing evidence the run accepted. The app refuses evidence from a repository or revision the run did not freeze. */
|
|
1971
|
+
export interface AcceptedEvidence {
|
|
1972
|
+
kind: EvidenceKind;
|
|
1973
|
+
/** `owner/repo`. */
|
|
1974
|
+
repository: string;
|
|
1975
|
+
/** The full commit the evidence was produced for: 40 or 64 lowercase hex characters. */
|
|
1976
|
+
revision: string;
|
|
1977
|
+
/** A URL or provider identifier for the evidence. */
|
|
1978
|
+
reference: string;
|
|
1979
|
+
summary: string;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* The run's Validation Triage and sufficiency judgment. A run that is insufficient, or names any
|
|
1983
|
+
* `actionRequired` reason, is never a validated success. The app refuses a report that breaks the rules below.
|
|
1984
|
+
*/
|
|
1985
|
+
export interface ReportValidation {
|
|
1986
|
+
sufficiency: ValidationSufficiency;
|
|
1987
|
+
/** Why the evidence is, or is not, enough. Never empty. */
|
|
1988
|
+
rationale: string;
|
|
1989
|
+
/** Required evidence that is still missing: empty exactly when `sufficient`. */
|
|
1990
|
+
gaps: string[];
|
|
1991
|
+
acceptedEvidence: AcceptedEvidence[];
|
|
1992
|
+
/** No reason appears twice. */
|
|
1993
|
+
actionRequired: ActionRequiredReason[];
|
|
1994
|
+
}
|
|
1995
|
+
declare enum RevisionStatus {
|
|
1996
|
+
Verified = "verified",
|
|
1997
|
+
Mismatch = "mismatch",
|
|
1998
|
+
Unverifiable = "unverifiable"
|
|
1999
|
+
}
|
|
2000
|
+
declare enum RevisionSource {
|
|
2001
|
+
Probe = "probe",
|
|
2002
|
+
Agent = "agent"
|
|
2003
|
+
}
|
|
2004
|
+
/** The shared environment a run that needed runtime evidence checked: its existing components and shared dependencies. */
|
|
2005
|
+
export interface ReportSystem {
|
|
2006
|
+
components: {
|
|
2007
|
+
name: string;
|
|
2008
|
+
/** `owner/repo` of the frozen source the component runs. */
|
|
2009
|
+
repository: string;
|
|
2010
|
+
url: string;
|
|
2011
|
+
/** The manifest's frozen revision of `repository`. */
|
|
2012
|
+
expectedRevision: string;
|
|
2013
|
+
/** 7 to 64 lowercase hex characters, as the check returned them. */
|
|
2014
|
+
observedRevision: string | null;
|
|
2015
|
+
status: RevisionStatus;
|
|
2016
|
+
source: RevisionSource;
|
|
2017
|
+
/** The line of the check's answer that shows the revision (at most 300 characters), or why the check failed. */
|
|
2018
|
+
evidence: string;
|
|
2019
|
+
}[];
|
|
2020
|
+
dependencies: {
|
|
2021
|
+
name: string;
|
|
2022
|
+
url: string | null;
|
|
2023
|
+
version: string | null;
|
|
2024
|
+
evidence: string;
|
|
2025
|
+
}[];
|
|
2026
|
+
}
|
|
2027
|
+
declare enum ContextSetupKind {
|
|
2028
|
+
Seed = "seed",
|
|
2029
|
+
RuntimeMock = "runtime_mock",
|
|
2030
|
+
EnvOverride = "env_override"
|
|
2031
|
+
}
|
|
2032
|
+
declare enum ContextMechanism {
|
|
2033
|
+
TestCode = "test_code",
|
|
2034
|
+
SkyrampMocker = "skyramp_mocker",
|
|
2035
|
+
RecipeOverride = "recipe_override"
|
|
2036
|
+
}
|
|
2037
|
+
declare enum ContextStatus {
|
|
2038
|
+
Ran = "ran",
|
|
2039
|
+
SetupFailed = "setup_failed",
|
|
2040
|
+
Cancelled = "cancelled",
|
|
2041
|
+
Interrupted = "interrupted",
|
|
2042
|
+
NotRun = "not_run"
|
|
2043
|
+
}
|
|
2044
|
+
declare enum ContextScope {
|
|
2045
|
+
Disposable = "disposable",
|
|
2046
|
+
Shared = "shared"
|
|
2047
|
+
}
|
|
2048
|
+
declare enum ContextExecution {
|
|
2049
|
+
Serial = "serial",
|
|
2050
|
+
Parallel = "parallel"
|
|
2051
|
+
}
|
|
2052
|
+
declare enum ContextCleanupStatus {
|
|
2053
|
+
Done = "done",
|
|
2054
|
+
Failed = "failed",
|
|
2055
|
+
NotNeeded = "not_needed",
|
|
2056
|
+
Skipped = "skipped"
|
|
2057
|
+
}
|
|
2058
|
+
/** The temporary setup or runtime manipulation one runtime test needed, and how it was undone. */
|
|
2059
|
+
export interface TestExecutionContext {
|
|
2060
|
+
/** The test's resultId when it produced a result, else its repository-relative path (or the withheld case's id). */
|
|
2061
|
+
test: string;
|
|
2062
|
+
resultId: string | null;
|
|
2063
|
+
scope: ContextScope;
|
|
2064
|
+
execution: ContextExecution;
|
|
2065
|
+
setup: {
|
|
2066
|
+
kind: ContextSetupKind;
|
|
2067
|
+
target: string;
|
|
2068
|
+
mechanism: ContextMechanism;
|
|
2069
|
+
detail: string;
|
|
2070
|
+
}[];
|
|
2071
|
+
status: ContextStatus;
|
|
2072
|
+
notRunReason: ActionRequiredReason.IsolationUnavailable | null;
|
|
2073
|
+
cleanup: {
|
|
2074
|
+
status: ContextCleanupStatus;
|
|
2075
|
+
detail: string;
|
|
2076
|
+
};
|
|
2077
|
+
/** The checkout `test` is in, until v3Report links it to its results and drops this. */
|
|
2078
|
+
repository?: string;
|
|
2079
|
+
}
|
|
2080
|
+
declare enum CaveatKind {
|
|
2081
|
+
TestsNotExecuted = "tests-not-executed",
|
|
2082
|
+
DeployFailed = "deploy-failed",
|
|
2083
|
+
RecipeDrift = "recipe-drift",
|
|
2084
|
+
MockedDependency = "mocked-dependency",
|
|
2085
|
+
FinalizeNotReady = "finalize-not-ready",
|
|
2086
|
+
CiNotCovered = "ci-not-covered",
|
|
2087
|
+
/** Validation Triage found no deployed behavior to validate, so no app was started. */
|
|
2088
|
+
SutNotRequired = "sut-not-required",
|
|
2089
|
+
/** The repo's own linter config doesn't reach this file — derived independently of CiNotCovered (whether the test RUNS at all), so the two can coexist: a file can be run but not linted, linted but not run, both, or neither. */
|
|
2090
|
+
LintNotCovered = "lint-not-covered",
|
|
2091
|
+
/** Analyze was salvaged: some of its claims went unconfirmed, and the plan was made from them as such. */
|
|
2092
|
+
AnalysisUnverified = "analysis-unverified",
|
|
2093
|
+
/** native-run selected unit tests and none of them ran: no unit result in the report is its re-run. */
|
|
2094
|
+
UnitTestsNotRun = "unit-tests-not-run",
|
|
2095
|
+
/** Tests the run wrote exist, but this environment could not run some of them (a missing tool, package or display). */
|
|
2096
|
+
TestsCouldNotRunHere = "tests-could-not-run-here",
|
|
2097
|
+
/** Checks only of what the change could break elsewhere that this run did not make: reported, not missing evidence. */
|
|
2098
|
+
DownstreamNotChecked = "downstream-not-checked"
|
|
2099
|
+
}
|
|
2100
|
+
export interface ReportCaveat {
|
|
2101
|
+
kind: CaveatKind;
|
|
2102
|
+
/** What it is about, when the kind alone does not say — a dependency name. */
|
|
2103
|
+
subject?: string;
|
|
2104
|
+
/** One sentence for the PR author, in their terms. */
|
|
2105
|
+
text: string;
|
|
2106
|
+
/** True when it means the run is not evidence the change works. */
|
|
2107
|
+
blocking: boolean;
|
|
2108
|
+
}
|
|
2109
|
+
declare enum SourceProvider {
|
|
2110
|
+
GitHub = "github",
|
|
2111
|
+
AzureDevOps = "azure-devops"
|
|
2112
|
+
}
|
|
2113
|
+
declare enum SelectionReason {
|
|
2114
|
+
Trigger = "TRIGGER",
|
|
2115
|
+
Baseline = "BASELINE",
|
|
2116
|
+
AuthoritativeRelatedChange = "AUTHORITATIVE_RELATED_CHANGE",
|
|
2117
|
+
ConfiguredSharedDependency = "CONFIGURED_SHARED_DEPENDENCY",
|
|
2118
|
+
ManualOverride = "MANUAL_OVERRIDE"
|
|
2119
|
+
}
|
|
2120
|
+
declare enum TriggerKind {
|
|
2121
|
+
PullRequest = "pull_request",
|
|
2122
|
+
ReadyForReview = "ready_for_review",
|
|
2123
|
+
Schedule = "schedule",
|
|
2124
|
+
Manual = "manual",
|
|
2125
|
+
SutSetup = "sut_setup",
|
|
2126
|
+
RevisionRead = "revision_read"
|
|
2127
|
+
}
|
|
2128
|
+
declare enum ChangeKind {
|
|
2129
|
+
PullRequest = "pull_request"
|
|
2130
|
+
}
|
|
2131
|
+
declare enum CredentialPurpose {
|
|
2132
|
+
ModelProvider = "model_provider",
|
|
2133
|
+
SutAccess = "sut_access",
|
|
2134
|
+
Skyramp = "skyramp",
|
|
2135
|
+
Other = "other"
|
|
2136
|
+
}
|
|
2137
|
+
declare enum DeliveryStatus {
|
|
2138
|
+
None = "none",
|
|
2139
|
+
Delivered = "delivered",
|
|
2140
|
+
Partial = "partial",
|
|
2141
|
+
Failed = "failed"
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* `RecipeUploaded`: a `sut_setup` attempt's SUT recipe reached the app; it is that run's `ReportUploaded`.
|
|
2145
|
+
* `RevisionsUploaded`: a `revision_read` attempt read every component and its upload reached the app (SKYR-5225).
|
|
2146
|
+
*/
|
|
2147
|
+
export declare enum AttemptEndReason {
|
|
2148
|
+
ReportUploaded = "report_uploaded",
|
|
2149
|
+
NoReport = "no_report",
|
|
2150
|
+
Cancelled = "cancelled",
|
|
2151
|
+
RecipeUploaded = "recipe_uploaded",
|
|
2152
|
+
RevisionsUploaded = "revisions_uploaded"
|
|
2153
|
+
}
|
|
2154
|
+
declare enum AttemptState {
|
|
2155
|
+
Running = "running",
|
|
2156
|
+
Ended = "ended"
|
|
2157
|
+
}
|
|
2158
|
+
/**
|
|
2159
|
+
* Why no report reached the app. `RunnerLost` is recorded by the app itself, when an attempt passes its deadline.
|
|
2160
|
+
* `CheckoutFailed`: the frozen sources could not be checked out, which the app counts as getting the Target's code,
|
|
2161
|
+
* not bringing up the app (SKYR-4769). `EnvironmentUnverified`: the run could not verify what the customer's environment
|
|
2162
|
+
* runs, so it is Validation Blocked, not a failed setup (SKYR-5225).
|
|
2163
|
+
*/
|
|
2164
|
+
export declare enum NoReportCause {
|
|
2165
|
+
TimedOut = "timed_out",
|
|
2166
|
+
AgentFailed = "agent_failed",
|
|
2167
|
+
SetupFailed = "setup_failed",
|
|
2168
|
+
CredentialMissing = "credential_missing",
|
|
2169
|
+
RunnerLost = "runner_lost",
|
|
2170
|
+
CheckoutFailed = "checkout_failed",
|
|
2171
|
+
EnvironmentUnverified = "environment_unverified"
|
|
2172
|
+
}
|
|
2173
|
+
declare const SourceRefSchema: z.ZodDiscriminatedUnion<"provider", [
|
|
2174
|
+
z.ZodObject<{
|
|
2175
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2176
|
+
providerAccountId: z.ZodString;
|
|
2177
|
+
providerRepositoryId: z.ZodString;
|
|
2178
|
+
}, "strict", z.ZodTypeAny, {
|
|
2179
|
+
provider: SourceProvider.GitHub;
|
|
2180
|
+
providerAccountId: string;
|
|
2181
|
+
providerRepositoryId: string;
|
|
2182
|
+
}, {
|
|
2183
|
+
provider: SourceProvider.GitHub;
|
|
2184
|
+
providerAccountId: string;
|
|
2185
|
+
providerRepositoryId: string;
|
|
2186
|
+
}>,
|
|
2187
|
+
z.ZodObject<{
|
|
2188
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2189
|
+
providerAccountId: z.ZodString;
|
|
2190
|
+
providerRepositoryId: z.ZodString;
|
|
2191
|
+
}, "strict", z.ZodTypeAny, {
|
|
2192
|
+
provider: SourceProvider.AzureDevOps;
|
|
2193
|
+
providerAccountId: string;
|
|
2194
|
+
providerRepositoryId: string;
|
|
2195
|
+
}, {
|
|
2196
|
+
provider: SourceProvider.AzureDevOps;
|
|
2197
|
+
providerAccountId: string;
|
|
2198
|
+
providerRepositoryId: string;
|
|
2199
|
+
}>
|
|
2200
|
+
]>;
|
|
2201
|
+
export type SourceRef = z.infer<typeof SourceRefSchema>;
|
|
2202
|
+
declare const SourceIdentitySchema: z.ZodDiscriminatedUnion<"provider", [
|
|
2203
|
+
z.ZodObject<{
|
|
2204
|
+
namespace: z.ZodString;
|
|
2205
|
+
name: z.ZodString;
|
|
2206
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2207
|
+
providerAccountId: z.ZodString;
|
|
2208
|
+
providerRepositoryId: z.ZodString;
|
|
2209
|
+
}, "strict", z.ZodTypeAny, {
|
|
2210
|
+
name: string;
|
|
2211
|
+
provider: SourceProvider.GitHub;
|
|
2212
|
+
providerAccountId: string;
|
|
2213
|
+
providerRepositoryId: string;
|
|
2214
|
+
namespace: string;
|
|
2215
|
+
}, {
|
|
2216
|
+
name: string;
|
|
2217
|
+
provider: SourceProvider.GitHub;
|
|
2218
|
+
providerAccountId: string;
|
|
2219
|
+
providerRepositoryId: string;
|
|
2220
|
+
namespace: string;
|
|
2221
|
+
}>,
|
|
2222
|
+
z.ZodObject<{
|
|
2223
|
+
namespace: z.ZodString;
|
|
2224
|
+
name: z.ZodString;
|
|
2225
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2226
|
+
providerAccountId: z.ZodString;
|
|
2227
|
+
providerRepositoryId: z.ZodString;
|
|
2228
|
+
}, "strict", z.ZodTypeAny, {
|
|
2229
|
+
name: string;
|
|
2230
|
+
provider: SourceProvider.AzureDevOps;
|
|
2231
|
+
providerAccountId: string;
|
|
2232
|
+
providerRepositoryId: string;
|
|
2233
|
+
namespace: string;
|
|
2234
|
+
}, {
|
|
2235
|
+
name: string;
|
|
2236
|
+
provider: SourceProvider.AzureDevOps;
|
|
2237
|
+
providerAccountId: string;
|
|
2238
|
+
providerRepositoryId: string;
|
|
2239
|
+
namespace: string;
|
|
2240
|
+
}>
|
|
2241
|
+
]>;
|
|
2242
|
+
export type SourceIdentity = z.infer<typeof SourceIdentitySchema>;
|
|
2243
|
+
declare const RunManifestV1Schema: z.ZodEffects<z.ZodObject<{
|
|
2244
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
2245
|
+
runId: z.ZodString;
|
|
2246
|
+
skyrampOrgId: z.ZodString;
|
|
2247
|
+
target: z.ZodObject<{
|
|
2248
|
+
id: z.ZodString;
|
|
2249
|
+
revision: z.ZodString;
|
|
2250
|
+
}, "strict", z.ZodTypeAny, {
|
|
2251
|
+
id: string;
|
|
2252
|
+
revision: string;
|
|
2253
|
+
}, {
|
|
2254
|
+
id: string;
|
|
2255
|
+
revision: string;
|
|
2256
|
+
}>;
|
|
2257
|
+
/** Null exactly for a trigger in POLICYLESS_TRIGGERS, such as `sut_setup`. */
|
|
2258
|
+
policy: z.ZodNullable<z.ZodObject<{
|
|
2259
|
+
id: z.ZodString;
|
|
2260
|
+
revision: z.ZodString;
|
|
2261
|
+
}, "strict", z.ZodTypeAny, {
|
|
2262
|
+
id: string;
|
|
2263
|
+
revision: string;
|
|
2264
|
+
}, {
|
|
2265
|
+
id: string;
|
|
2266
|
+
revision: string;
|
|
2267
|
+
}>>;
|
|
2268
|
+
trigger: z.ZodObject<{
|
|
2269
|
+
kind: z.ZodNativeEnum<typeof TriggerKind>;
|
|
2270
|
+
requestedAt: z.ZodString;
|
|
2271
|
+
}, "strict", z.ZodTypeAny, {
|
|
2272
|
+
kind: TriggerKind;
|
|
2273
|
+
requestedAt: string;
|
|
2274
|
+
}, {
|
|
2275
|
+
kind: TriggerKind;
|
|
2276
|
+
requestedAt: string;
|
|
2277
|
+
}>;
|
|
2278
|
+
configuration: z.ZodObject<{
|
|
2279
|
+
captureId: z.ZodString;
|
|
2280
|
+
revision: z.ZodNullable<z.ZodString>;
|
|
2281
|
+
hash: z.ZodString;
|
|
2282
|
+
}, "strict", z.ZodTypeAny, {
|
|
2283
|
+
revision: string | null;
|
|
2284
|
+
captureId: string;
|
|
2285
|
+
hash: string;
|
|
2286
|
+
}, {
|
|
2287
|
+
revision: string | null;
|
|
2288
|
+
captureId: string;
|
|
2289
|
+
hash: string;
|
|
2290
|
+
}>;
|
|
2291
|
+
/**
|
|
2292
|
+
* The Confirmed Baseline the run compares with. A scheduled run that has one also names each source's revision
|
|
2293
|
+
* in it (SKYR-4582), and a Rerun of that run keeps them: the runner validates the delta since then. Absent on
|
|
2294
|
+
* every other manifest. `initialBaselineId` names an Initial Baseline in its place (SKYR-5225): the heads the app
|
|
2295
|
+
* saved, without a run, when the schedule was turned on or its setup changed. It is never validated. Absent
|
|
2296
|
+
* exactly on a `revision_read` manifest, which reads what that baseline is.
|
|
2297
|
+
*/
|
|
2298
|
+
baseline: z.ZodOptional<z.ZodObject<{
|
|
2299
|
+
confirmedRunId: z.ZodNullable<z.ZodString>;
|
|
2300
|
+
initialBaselineId: z.ZodOptional<z.ZodString>;
|
|
2301
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2302
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
2303
|
+
z.ZodObject<{
|
|
2304
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2305
|
+
providerAccountId: z.ZodString;
|
|
2306
|
+
providerRepositoryId: z.ZodString;
|
|
2307
|
+
}, "strict", z.ZodTypeAny, {
|
|
2308
|
+
provider: SourceProvider.GitHub;
|
|
2309
|
+
providerAccountId: string;
|
|
2310
|
+
providerRepositoryId: string;
|
|
2311
|
+
}, {
|
|
2312
|
+
provider: SourceProvider.GitHub;
|
|
2313
|
+
providerAccountId: string;
|
|
2314
|
+
providerRepositoryId: string;
|
|
2315
|
+
}>,
|
|
2316
|
+
z.ZodObject<{
|
|
2317
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2318
|
+
providerAccountId: z.ZodString;
|
|
2319
|
+
providerRepositoryId: z.ZodString;
|
|
2320
|
+
}, "strict", z.ZodTypeAny, {
|
|
2321
|
+
provider: SourceProvider.AzureDevOps;
|
|
2322
|
+
providerAccountId: string;
|
|
2323
|
+
providerRepositoryId: string;
|
|
2324
|
+
}, {
|
|
2325
|
+
provider: SourceProvider.AzureDevOps;
|
|
2326
|
+
providerAccountId: string;
|
|
2327
|
+
providerRepositoryId: string;
|
|
2328
|
+
}>
|
|
2329
|
+
]>;
|
|
2330
|
+
revision: z.ZodString;
|
|
2331
|
+
}, "strict", z.ZodTypeAny, {
|
|
2332
|
+
repository: {
|
|
2333
|
+
provider: SourceProvider.GitHub;
|
|
2334
|
+
providerAccountId: string;
|
|
2335
|
+
providerRepositoryId: string;
|
|
2336
|
+
} | {
|
|
2337
|
+
provider: SourceProvider.AzureDevOps;
|
|
2338
|
+
providerAccountId: string;
|
|
2339
|
+
providerRepositoryId: string;
|
|
2340
|
+
};
|
|
2341
|
+
revision: string;
|
|
2342
|
+
}, {
|
|
2343
|
+
repository: {
|
|
2344
|
+
provider: SourceProvider.GitHub;
|
|
2345
|
+
providerAccountId: string;
|
|
2346
|
+
providerRepositoryId: string;
|
|
2347
|
+
} | {
|
|
2348
|
+
provider: SourceProvider.AzureDevOps;
|
|
2349
|
+
providerAccountId: string;
|
|
2350
|
+
providerRepositoryId: string;
|
|
2351
|
+
};
|
|
2352
|
+
revision: string;
|
|
2353
|
+
}>, "many">>;
|
|
2354
|
+
}, "strict", z.ZodTypeAny, {
|
|
2355
|
+
confirmedRunId: string | null;
|
|
2356
|
+
initialBaselineId?: string | undefined;
|
|
2357
|
+
sources?: {
|
|
2358
|
+
repository: {
|
|
2359
|
+
provider: SourceProvider.GitHub;
|
|
2360
|
+
providerAccountId: string;
|
|
2361
|
+
providerRepositoryId: string;
|
|
2362
|
+
} | {
|
|
2363
|
+
provider: SourceProvider.AzureDevOps;
|
|
2364
|
+
providerAccountId: string;
|
|
2365
|
+
providerRepositoryId: string;
|
|
2366
|
+
};
|
|
2367
|
+
revision: string;
|
|
2368
|
+
}[] | undefined;
|
|
2369
|
+
}, {
|
|
2370
|
+
confirmedRunId: string | null;
|
|
2371
|
+
initialBaselineId?: string | undefined;
|
|
2372
|
+
sources?: {
|
|
2373
|
+
repository: {
|
|
2374
|
+
provider: SourceProvider.GitHub;
|
|
2375
|
+
providerAccountId: string;
|
|
2376
|
+
providerRepositoryId: string;
|
|
2377
|
+
} | {
|
|
2378
|
+
provider: SourceProvider.AzureDevOps;
|
|
2379
|
+
providerAccountId: string;
|
|
2380
|
+
providerRepositoryId: string;
|
|
2381
|
+
};
|
|
2382
|
+
revision: string;
|
|
2383
|
+
}[] | undefined;
|
|
2384
|
+
}>>;
|
|
2385
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
2386
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
2387
|
+
z.ZodObject<{
|
|
2388
|
+
namespace: z.ZodString;
|
|
2389
|
+
name: z.ZodString;
|
|
2390
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2391
|
+
providerAccountId: z.ZodString;
|
|
2392
|
+
providerRepositoryId: z.ZodString;
|
|
2393
|
+
}, "strict", z.ZodTypeAny, {
|
|
2394
|
+
name: string;
|
|
2395
|
+
provider: SourceProvider.GitHub;
|
|
2396
|
+
providerAccountId: string;
|
|
2397
|
+
providerRepositoryId: string;
|
|
2398
|
+
namespace: string;
|
|
2399
|
+
}, {
|
|
2400
|
+
name: string;
|
|
2401
|
+
provider: SourceProvider.GitHub;
|
|
2402
|
+
providerAccountId: string;
|
|
2403
|
+
providerRepositoryId: string;
|
|
2404
|
+
namespace: string;
|
|
2405
|
+
}>,
|
|
2406
|
+
z.ZodObject<{
|
|
2407
|
+
namespace: z.ZodString;
|
|
2408
|
+
name: z.ZodString;
|
|
2409
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2410
|
+
providerAccountId: z.ZodString;
|
|
2411
|
+
providerRepositoryId: z.ZodString;
|
|
2412
|
+
}, "strict", z.ZodTypeAny, {
|
|
2413
|
+
name: string;
|
|
2414
|
+
provider: SourceProvider.AzureDevOps;
|
|
2415
|
+
providerAccountId: string;
|
|
2416
|
+
providerRepositoryId: string;
|
|
2417
|
+
namespace: string;
|
|
2418
|
+
}, {
|
|
2419
|
+
name: string;
|
|
2420
|
+
provider: SourceProvider.AzureDevOps;
|
|
2421
|
+
providerAccountId: string;
|
|
2422
|
+
providerRepositoryId: string;
|
|
2423
|
+
namespace: string;
|
|
2424
|
+
}>
|
|
2425
|
+
]>;
|
|
2426
|
+
revision: z.ZodString;
|
|
2427
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
2428
|
+
reason: z.ZodNativeEnum<typeof SelectionReason>;
|
|
2429
|
+
change: z.ZodNullable<z.ZodObject<{
|
|
2430
|
+
kind: z.ZodNativeEnum<typeof ChangeKind>;
|
|
2431
|
+
number: z.ZodString;
|
|
2432
|
+
base: z.ZodOptional<z.ZodObject<{
|
|
2433
|
+
ref: z.ZodString;
|
|
2434
|
+
revision: z.ZodString;
|
|
2435
|
+
}, "strict", z.ZodTypeAny, {
|
|
2436
|
+
revision: string;
|
|
2437
|
+
ref: string;
|
|
2438
|
+
}, {
|
|
2439
|
+
revision: string;
|
|
2440
|
+
ref: string;
|
|
2441
|
+
}>>;
|
|
2442
|
+
}, "strict", z.ZodTypeAny, {
|
|
2443
|
+
number: string;
|
|
2444
|
+
kind: ChangeKind;
|
|
2445
|
+
base?: {
|
|
2446
|
+
revision: string;
|
|
2447
|
+
ref: string;
|
|
2448
|
+
} | undefined;
|
|
2449
|
+
}, {
|
|
2450
|
+
number: string;
|
|
2451
|
+
kind: ChangeKind;
|
|
2452
|
+
base?: {
|
|
2453
|
+
revision: string;
|
|
2454
|
+
ref: string;
|
|
2455
|
+
} | undefined;
|
|
2456
|
+
}>>;
|
|
2457
|
+
compareWith: z.ZodOptional<z.ZodObject<{
|
|
2458
|
+
ref: z.ZodString;
|
|
2459
|
+
revision: z.ZodString;
|
|
2460
|
+
}, "strict", z.ZodTypeAny, {
|
|
2461
|
+
revision: string;
|
|
2462
|
+
ref: string;
|
|
2463
|
+
}, {
|
|
2464
|
+
revision: string;
|
|
2465
|
+
ref: string;
|
|
2466
|
+
}>>;
|
|
2467
|
+
}, "strict", z.ZodTypeAny, {
|
|
2468
|
+
repository: {
|
|
2469
|
+
name: string;
|
|
2470
|
+
provider: SourceProvider.GitHub;
|
|
2471
|
+
providerAccountId: string;
|
|
2472
|
+
providerRepositoryId: string;
|
|
2473
|
+
namespace: string;
|
|
2474
|
+
} | {
|
|
2475
|
+
name: string;
|
|
2476
|
+
provider: SourceProvider.AzureDevOps;
|
|
2477
|
+
providerAccountId: string;
|
|
2478
|
+
providerRepositoryId: string;
|
|
2479
|
+
namespace: string;
|
|
2480
|
+
};
|
|
2481
|
+
reason: SelectionReason;
|
|
2482
|
+
revision: string;
|
|
2483
|
+
ref: string | null;
|
|
2484
|
+
change: {
|
|
2485
|
+
number: string;
|
|
2486
|
+
kind: ChangeKind;
|
|
2487
|
+
base?: {
|
|
2488
|
+
revision: string;
|
|
2489
|
+
ref: string;
|
|
2490
|
+
} | undefined;
|
|
2491
|
+
} | null;
|
|
2492
|
+
compareWith?: {
|
|
2493
|
+
revision: string;
|
|
2494
|
+
ref: string;
|
|
2495
|
+
} | undefined;
|
|
2496
|
+
}, {
|
|
2497
|
+
repository: {
|
|
2498
|
+
name: string;
|
|
2499
|
+
provider: SourceProvider.GitHub;
|
|
2500
|
+
providerAccountId: string;
|
|
2501
|
+
providerRepositoryId: string;
|
|
2502
|
+
namespace: string;
|
|
2503
|
+
} | {
|
|
2504
|
+
name: string;
|
|
2505
|
+
provider: SourceProvider.AzureDevOps;
|
|
2506
|
+
providerAccountId: string;
|
|
2507
|
+
providerRepositoryId: string;
|
|
2508
|
+
namespace: string;
|
|
2509
|
+
};
|
|
2510
|
+
reason: SelectionReason;
|
|
2511
|
+
revision: string;
|
|
2512
|
+
ref: string | null;
|
|
2513
|
+
change: {
|
|
2514
|
+
number: string;
|
|
2515
|
+
kind: ChangeKind;
|
|
2516
|
+
base?: {
|
|
2517
|
+
revision: string;
|
|
2518
|
+
ref: string;
|
|
2519
|
+
} | undefined;
|
|
2520
|
+
} | null;
|
|
2521
|
+
compareWith?: {
|
|
2522
|
+
revision: string;
|
|
2523
|
+
ref: string;
|
|
2524
|
+
} | undefined;
|
|
2525
|
+
}>, "many">;
|
|
2526
|
+
execution: z.ZodObject<{
|
|
2527
|
+
provider: z.ZodNativeEnum<typeof SourceProvider>;
|
|
2528
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
2529
|
+
z.ZodObject<{
|
|
2530
|
+
namespace: z.ZodString;
|
|
2531
|
+
name: z.ZodString;
|
|
2532
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2533
|
+
providerAccountId: z.ZodString;
|
|
2534
|
+
providerRepositoryId: z.ZodString;
|
|
2535
|
+
}, "strict", z.ZodTypeAny, {
|
|
2536
|
+
name: string;
|
|
2537
|
+
provider: SourceProvider.GitHub;
|
|
2538
|
+
providerAccountId: string;
|
|
2539
|
+
providerRepositoryId: string;
|
|
2540
|
+
namespace: string;
|
|
2541
|
+
}, {
|
|
2542
|
+
name: string;
|
|
2543
|
+
provider: SourceProvider.GitHub;
|
|
2544
|
+
providerAccountId: string;
|
|
2545
|
+
providerRepositoryId: string;
|
|
2546
|
+
namespace: string;
|
|
2547
|
+
}>,
|
|
2548
|
+
z.ZodObject<{
|
|
2549
|
+
namespace: z.ZodString;
|
|
2550
|
+
name: z.ZodString;
|
|
2551
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2552
|
+
providerAccountId: z.ZodString;
|
|
2553
|
+
providerRepositoryId: z.ZodString;
|
|
2554
|
+
}, "strict", z.ZodTypeAny, {
|
|
2555
|
+
name: string;
|
|
2556
|
+
provider: SourceProvider.AzureDevOps;
|
|
2557
|
+
providerAccountId: string;
|
|
2558
|
+
providerRepositoryId: string;
|
|
2559
|
+
namespace: string;
|
|
2560
|
+
}, {
|
|
2561
|
+
name: string;
|
|
2562
|
+
provider: SourceProvider.AzureDevOps;
|
|
2563
|
+
providerAccountId: string;
|
|
2564
|
+
providerRepositoryId: string;
|
|
2565
|
+
namespace: string;
|
|
2566
|
+
}>
|
|
2567
|
+
]>;
|
|
2568
|
+
workflowPath: z.ZodString;
|
|
2569
|
+
ref: z.ZodString;
|
|
2570
|
+
}, "strict", z.ZodTypeAny, {
|
|
2571
|
+
repository: {
|
|
2572
|
+
name: string;
|
|
2573
|
+
provider: SourceProvider.GitHub;
|
|
2574
|
+
providerAccountId: string;
|
|
2575
|
+
providerRepositoryId: string;
|
|
2576
|
+
namespace: string;
|
|
2577
|
+
} | {
|
|
2578
|
+
name: string;
|
|
2579
|
+
provider: SourceProvider.AzureDevOps;
|
|
2580
|
+
providerAccountId: string;
|
|
2581
|
+
providerRepositoryId: string;
|
|
2582
|
+
namespace: string;
|
|
2583
|
+
};
|
|
2584
|
+
provider: SourceProvider;
|
|
2585
|
+
ref: string;
|
|
2586
|
+
workflowPath: string;
|
|
2587
|
+
}, {
|
|
2588
|
+
repository: {
|
|
2589
|
+
name: string;
|
|
2590
|
+
provider: SourceProvider.GitHub;
|
|
2591
|
+
providerAccountId: string;
|
|
2592
|
+
providerRepositoryId: string;
|
|
2593
|
+
namespace: string;
|
|
2594
|
+
} | {
|
|
2595
|
+
name: string;
|
|
2596
|
+
provider: SourceProvider.AzureDevOps;
|
|
2597
|
+
providerAccountId: string;
|
|
2598
|
+
providerRepositoryId: string;
|
|
2599
|
+
namespace: string;
|
|
2600
|
+
};
|
|
2601
|
+
provider: SourceProvider;
|
|
2602
|
+
ref: string;
|
|
2603
|
+
workflowPath: string;
|
|
2604
|
+
}>;
|
|
2605
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
2606
|
+
name: z.ZodString;
|
|
2607
|
+
purpose: z.ZodNativeEnum<typeof CredentialPurpose>;
|
|
2608
|
+
required: z.ZodBoolean;
|
|
2609
|
+
}, "strict", z.ZodTypeAny, {
|
|
2610
|
+
name: string;
|
|
2611
|
+
purpose: CredentialPurpose;
|
|
2612
|
+
required: boolean;
|
|
2613
|
+
}, {
|
|
2614
|
+
name: string;
|
|
2615
|
+
purpose: CredentialPurpose;
|
|
2616
|
+
required: boolean;
|
|
2617
|
+
}>, "many">;
|
|
2618
|
+
/** The Requirement references the run validates against (SKYR-4919). Absent on a run without them. */
|
|
2619
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodUnion<[
|
|
2620
|
+
z.ZodObject<{
|
|
2621
|
+
source: z.ZodLiteral<RequirementItemSource.Jira>;
|
|
2622
|
+
site: z.ZodString;
|
|
2623
|
+
key: z.ZodString;
|
|
2624
|
+
updated: z.ZodString;
|
|
2625
|
+
contentHash: z.ZodString;
|
|
2626
|
+
}, "strict", z.ZodTypeAny, {
|
|
2627
|
+
site: string;
|
|
2628
|
+
source: RequirementItemSource.Jira;
|
|
2629
|
+
key: string;
|
|
2630
|
+
updated: string;
|
|
2631
|
+
contentHash: string;
|
|
2632
|
+
}, {
|
|
2633
|
+
site: string;
|
|
2634
|
+
source: RequirementItemSource.Jira;
|
|
2635
|
+
key: string;
|
|
2636
|
+
updated: string;
|
|
2637
|
+
contentHash: string;
|
|
2638
|
+
}>,
|
|
2639
|
+
z.ZodObject<{
|
|
2640
|
+
source: z.ZodLiteral<RequirementItemSource.Confluence>;
|
|
2641
|
+
site: z.ZodString;
|
|
2642
|
+
key: z.ZodString;
|
|
2643
|
+
version: z.ZodNumber;
|
|
2644
|
+
contentHash: z.ZodString;
|
|
2645
|
+
}, "strict", z.ZodTypeAny, {
|
|
2646
|
+
site: string;
|
|
2647
|
+
source: RequirementItemSource.Confluence;
|
|
2648
|
+
key: string;
|
|
2649
|
+
contentHash: string;
|
|
2650
|
+
version: number;
|
|
2651
|
+
}, {
|
|
2652
|
+
site: string;
|
|
2653
|
+
source: RequirementItemSource.Confluence;
|
|
2654
|
+
key: string;
|
|
2655
|
+
contentHash: string;
|
|
2656
|
+
version: number;
|
|
2657
|
+
}>,
|
|
2658
|
+
z.ZodObject<{
|
|
2659
|
+
source: z.ZodLiteral<RequirementItemSource.Other>;
|
|
2660
|
+
key: z.ZodString;
|
|
2661
|
+
contentHash: z.ZodString;
|
|
2662
|
+
}, "strict", z.ZodTypeAny, {
|
|
2663
|
+
source: RequirementItemSource.Other;
|
|
2664
|
+
key: string;
|
|
2665
|
+
contentHash: string;
|
|
2666
|
+
}, {
|
|
2667
|
+
source: RequirementItemSource.Other;
|
|
2668
|
+
key: string;
|
|
2669
|
+
contentHash: string;
|
|
2670
|
+
}>,
|
|
2671
|
+
z.ZodObject<{
|
|
2672
|
+
source: z.ZodLiteral<RequirementItemSource.Other>;
|
|
2673
|
+
key: z.ZodString;
|
|
2674
|
+
contentHash: z.ZodString;
|
|
2675
|
+
fileName: z.ZodString;
|
|
2676
|
+
mediaType: z.ZodNativeEnum<typeof UploadedMediaType>;
|
|
2677
|
+
}, "strict", z.ZodTypeAny, {
|
|
2678
|
+
source: RequirementItemSource.Other;
|
|
2679
|
+
key: string;
|
|
2680
|
+
contentHash: string;
|
|
2681
|
+
fileName: string;
|
|
2682
|
+
mediaType: UploadedMediaType;
|
|
2683
|
+
}, {
|
|
2684
|
+
source: RequirementItemSource.Other;
|
|
2685
|
+
key: string;
|
|
2686
|
+
contentHash: string;
|
|
2687
|
+
fileName: string;
|
|
2688
|
+
mediaType: UploadedMediaType;
|
|
2689
|
+
}>
|
|
2690
|
+
]>, "many">>;
|
|
2691
|
+
/**
|
|
2692
|
+
* The run has Instructions (SKYR-4925): the hash of their words only. The runner reads the words from the app
|
|
2693
|
+
* (RUNNER_PATHS.requirements). Absent on a run without them.
|
|
2694
|
+
*/
|
|
2695
|
+
instructions: z.ZodOptional<z.ZodObject<{
|
|
2696
|
+
contentHash: z.ZodString;
|
|
2697
|
+
}, "strict", z.ZodTypeAny, {
|
|
2698
|
+
contentHash: string;
|
|
2699
|
+
}, {
|
|
2700
|
+
contentHash: string;
|
|
2701
|
+
}>>;
|
|
2702
|
+
/**
|
|
2703
|
+
* What the scheduled run that a Rerun repeats validated of each source an existing component runs (SKYR-5225,
|
|
2704
|
+
* §6.2): the runner checks each out at exactly that revision, or ends the run blocked when the environment no
|
|
2705
|
+
* longer runs it. Only on a manual run, at most one per source. Absent when nothing is pinned.
|
|
2706
|
+
*/
|
|
2707
|
+
deployedRevisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2708
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
2709
|
+
z.ZodObject<{
|
|
2710
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
2711
|
+
providerAccountId: z.ZodString;
|
|
2712
|
+
providerRepositoryId: z.ZodString;
|
|
2713
|
+
}, "strict", z.ZodTypeAny, {
|
|
2714
|
+
provider: SourceProvider.GitHub;
|
|
2715
|
+
providerAccountId: string;
|
|
2716
|
+
providerRepositoryId: string;
|
|
2717
|
+
}, {
|
|
2718
|
+
provider: SourceProvider.GitHub;
|
|
2719
|
+
providerAccountId: string;
|
|
2720
|
+
providerRepositoryId: string;
|
|
2721
|
+
}>,
|
|
2722
|
+
z.ZodObject<{
|
|
2723
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
2724
|
+
providerAccountId: z.ZodString;
|
|
2725
|
+
providerRepositoryId: z.ZodString;
|
|
2726
|
+
}, "strict", z.ZodTypeAny, {
|
|
2727
|
+
provider: SourceProvider.AzureDevOps;
|
|
2728
|
+
providerAccountId: string;
|
|
2729
|
+
providerRepositoryId: string;
|
|
2730
|
+
}, {
|
|
2731
|
+
provider: SourceProvider.AzureDevOps;
|
|
2732
|
+
providerAccountId: string;
|
|
2733
|
+
providerRepositoryId: string;
|
|
2734
|
+
}>
|
|
2735
|
+
]>;
|
|
2736
|
+
revision: z.ZodString;
|
|
2737
|
+
}, "strict", z.ZodTypeAny, {
|
|
2738
|
+
repository: {
|
|
2739
|
+
provider: SourceProvider.GitHub;
|
|
2740
|
+
providerAccountId: string;
|
|
2741
|
+
providerRepositoryId: string;
|
|
2742
|
+
} | {
|
|
2743
|
+
provider: SourceProvider.AzureDevOps;
|
|
2744
|
+
providerAccountId: string;
|
|
2745
|
+
providerRepositoryId: string;
|
|
2746
|
+
};
|
|
2747
|
+
revision: string;
|
|
2748
|
+
}, {
|
|
2749
|
+
repository: {
|
|
2750
|
+
provider: SourceProvider.GitHub;
|
|
2751
|
+
providerAccountId: string;
|
|
2752
|
+
providerRepositoryId: string;
|
|
2753
|
+
} | {
|
|
2754
|
+
provider: SourceProvider.AzureDevOps;
|
|
2755
|
+
providerAccountId: string;
|
|
2756
|
+
providerRepositoryId: string;
|
|
2757
|
+
};
|
|
2758
|
+
revision: string;
|
|
2759
|
+
}>, "many">>;
|
|
2760
|
+
}, "strict", z.ZodTypeAny, {
|
|
2761
|
+
credentials: {
|
|
2762
|
+
name: string;
|
|
2763
|
+
purpose: CredentialPurpose;
|
|
2764
|
+
required: boolean;
|
|
2765
|
+
}[];
|
|
2766
|
+
schemaVersion: 1;
|
|
2767
|
+
sources: {
|
|
2768
|
+
repository: {
|
|
2769
|
+
name: string;
|
|
2770
|
+
provider: SourceProvider.GitHub;
|
|
2771
|
+
providerAccountId: string;
|
|
2772
|
+
providerRepositoryId: string;
|
|
2773
|
+
namespace: string;
|
|
2774
|
+
} | {
|
|
2775
|
+
name: string;
|
|
2776
|
+
provider: SourceProvider.AzureDevOps;
|
|
2777
|
+
providerAccountId: string;
|
|
2778
|
+
providerRepositoryId: string;
|
|
2779
|
+
namespace: string;
|
|
2780
|
+
};
|
|
2781
|
+
reason: SelectionReason;
|
|
2782
|
+
revision: string;
|
|
2783
|
+
ref: string | null;
|
|
2784
|
+
change: {
|
|
2785
|
+
number: string;
|
|
2786
|
+
kind: ChangeKind;
|
|
2787
|
+
base?: {
|
|
2788
|
+
revision: string;
|
|
2789
|
+
ref: string;
|
|
2790
|
+
} | undefined;
|
|
2791
|
+
} | null;
|
|
2792
|
+
compareWith?: {
|
|
2793
|
+
revision: string;
|
|
2794
|
+
ref: string;
|
|
2795
|
+
} | undefined;
|
|
2796
|
+
}[];
|
|
2797
|
+
runId: string;
|
|
2798
|
+
skyrampOrgId: string;
|
|
2799
|
+
target: {
|
|
2800
|
+
id: string;
|
|
2801
|
+
revision: string;
|
|
2802
|
+
};
|
|
2803
|
+
policy: {
|
|
2804
|
+
id: string;
|
|
2805
|
+
revision: string;
|
|
2806
|
+
} | null;
|
|
2807
|
+
trigger: {
|
|
2808
|
+
kind: TriggerKind;
|
|
2809
|
+
requestedAt: string;
|
|
2810
|
+
};
|
|
2811
|
+
configuration: {
|
|
2812
|
+
revision: string | null;
|
|
2813
|
+
captureId: string;
|
|
2814
|
+
hash: string;
|
|
2815
|
+
};
|
|
2816
|
+
execution: {
|
|
2817
|
+
repository: {
|
|
2818
|
+
name: string;
|
|
2819
|
+
provider: SourceProvider.GitHub;
|
|
2820
|
+
providerAccountId: string;
|
|
2821
|
+
providerRepositoryId: string;
|
|
2822
|
+
namespace: string;
|
|
2823
|
+
} | {
|
|
2824
|
+
name: string;
|
|
2825
|
+
provider: SourceProvider.AzureDevOps;
|
|
2826
|
+
providerAccountId: string;
|
|
2827
|
+
providerRepositoryId: string;
|
|
2828
|
+
namespace: string;
|
|
2829
|
+
};
|
|
2830
|
+
provider: SourceProvider;
|
|
2831
|
+
ref: string;
|
|
2832
|
+
workflowPath: string;
|
|
2833
|
+
};
|
|
2834
|
+
instructions?: {
|
|
2835
|
+
contentHash: string;
|
|
2836
|
+
} | undefined;
|
|
2837
|
+
baseline?: {
|
|
2838
|
+
confirmedRunId: string | null;
|
|
2839
|
+
initialBaselineId?: string | undefined;
|
|
2840
|
+
sources?: {
|
|
2841
|
+
repository: {
|
|
2842
|
+
provider: SourceProvider.GitHub;
|
|
2843
|
+
providerAccountId: string;
|
|
2844
|
+
providerRepositoryId: string;
|
|
2845
|
+
} | {
|
|
2846
|
+
provider: SourceProvider.AzureDevOps;
|
|
2847
|
+
providerAccountId: string;
|
|
2848
|
+
providerRepositoryId: string;
|
|
2849
|
+
};
|
|
2850
|
+
revision: string;
|
|
2851
|
+
}[] | undefined;
|
|
2852
|
+
} | undefined;
|
|
2853
|
+
requirements?: ({
|
|
2854
|
+
site: string;
|
|
2855
|
+
source: RequirementItemSource.Jira;
|
|
2856
|
+
key: string;
|
|
2857
|
+
updated: string;
|
|
2858
|
+
contentHash: string;
|
|
2859
|
+
} | {
|
|
2860
|
+
site: string;
|
|
2861
|
+
source: RequirementItemSource.Confluence;
|
|
2862
|
+
key: string;
|
|
2863
|
+
contentHash: string;
|
|
2864
|
+
version: number;
|
|
2865
|
+
} | {
|
|
2866
|
+
source: RequirementItemSource.Other;
|
|
2867
|
+
key: string;
|
|
2868
|
+
contentHash: string;
|
|
2869
|
+
} | {
|
|
2870
|
+
source: RequirementItemSource.Other;
|
|
2871
|
+
key: string;
|
|
2872
|
+
contentHash: string;
|
|
2873
|
+
fileName: string;
|
|
2874
|
+
mediaType: UploadedMediaType;
|
|
2875
|
+
})[] | undefined;
|
|
2876
|
+
deployedRevisions?: {
|
|
2877
|
+
repository: {
|
|
2878
|
+
provider: SourceProvider.GitHub;
|
|
2879
|
+
providerAccountId: string;
|
|
2880
|
+
providerRepositoryId: string;
|
|
2881
|
+
} | {
|
|
2882
|
+
provider: SourceProvider.AzureDevOps;
|
|
2883
|
+
providerAccountId: string;
|
|
2884
|
+
providerRepositoryId: string;
|
|
2885
|
+
};
|
|
2886
|
+
revision: string;
|
|
2887
|
+
}[] | undefined;
|
|
2888
|
+
}, {
|
|
2889
|
+
credentials: {
|
|
2890
|
+
name: string;
|
|
2891
|
+
purpose: CredentialPurpose;
|
|
2892
|
+
required: boolean;
|
|
2893
|
+
}[];
|
|
2894
|
+
schemaVersion: 1;
|
|
2895
|
+
sources: {
|
|
2896
|
+
repository: {
|
|
2897
|
+
name: string;
|
|
2898
|
+
provider: SourceProvider.GitHub;
|
|
2899
|
+
providerAccountId: string;
|
|
2900
|
+
providerRepositoryId: string;
|
|
2901
|
+
namespace: string;
|
|
2902
|
+
} | {
|
|
2903
|
+
name: string;
|
|
2904
|
+
provider: SourceProvider.AzureDevOps;
|
|
2905
|
+
providerAccountId: string;
|
|
2906
|
+
providerRepositoryId: string;
|
|
2907
|
+
namespace: string;
|
|
2908
|
+
};
|
|
2909
|
+
reason: SelectionReason;
|
|
2910
|
+
revision: string;
|
|
2911
|
+
ref: string | null;
|
|
2912
|
+
change: {
|
|
2913
|
+
number: string;
|
|
2914
|
+
kind: ChangeKind;
|
|
2915
|
+
base?: {
|
|
2916
|
+
revision: string;
|
|
2917
|
+
ref: string;
|
|
2918
|
+
} | undefined;
|
|
2919
|
+
} | null;
|
|
2920
|
+
compareWith?: {
|
|
2921
|
+
revision: string;
|
|
2922
|
+
ref: string;
|
|
2923
|
+
} | undefined;
|
|
2924
|
+
}[];
|
|
2925
|
+
runId: string;
|
|
2926
|
+
skyrampOrgId: string;
|
|
2927
|
+
target: {
|
|
2928
|
+
id: string;
|
|
2929
|
+
revision: string;
|
|
2930
|
+
};
|
|
2931
|
+
policy: {
|
|
2932
|
+
id: string;
|
|
2933
|
+
revision: string;
|
|
2934
|
+
} | null;
|
|
2935
|
+
trigger: {
|
|
2936
|
+
kind: TriggerKind;
|
|
2937
|
+
requestedAt: string;
|
|
2938
|
+
};
|
|
2939
|
+
configuration: {
|
|
2940
|
+
revision: string | null;
|
|
2941
|
+
captureId: string;
|
|
2942
|
+
hash: string;
|
|
2943
|
+
};
|
|
2944
|
+
execution: {
|
|
2945
|
+
repository: {
|
|
2946
|
+
name: string;
|
|
2947
|
+
provider: SourceProvider.GitHub;
|
|
2948
|
+
providerAccountId: string;
|
|
2949
|
+
providerRepositoryId: string;
|
|
2950
|
+
namespace: string;
|
|
2951
|
+
} | {
|
|
2952
|
+
name: string;
|
|
2953
|
+
provider: SourceProvider.AzureDevOps;
|
|
2954
|
+
providerAccountId: string;
|
|
2955
|
+
providerRepositoryId: string;
|
|
2956
|
+
namespace: string;
|
|
2957
|
+
};
|
|
2958
|
+
provider: SourceProvider;
|
|
2959
|
+
ref: string;
|
|
2960
|
+
workflowPath: string;
|
|
2961
|
+
};
|
|
2962
|
+
instructions?: {
|
|
2963
|
+
contentHash: string;
|
|
2964
|
+
} | undefined;
|
|
2965
|
+
baseline?: {
|
|
2966
|
+
confirmedRunId: string | null;
|
|
2967
|
+
initialBaselineId?: string | undefined;
|
|
2968
|
+
sources?: {
|
|
2969
|
+
repository: {
|
|
2970
|
+
provider: SourceProvider.GitHub;
|
|
2971
|
+
providerAccountId: string;
|
|
2972
|
+
providerRepositoryId: string;
|
|
2973
|
+
} | {
|
|
2974
|
+
provider: SourceProvider.AzureDevOps;
|
|
2975
|
+
providerAccountId: string;
|
|
2976
|
+
providerRepositoryId: string;
|
|
2977
|
+
};
|
|
2978
|
+
revision: string;
|
|
2979
|
+
}[] | undefined;
|
|
2980
|
+
} | undefined;
|
|
2981
|
+
requirements?: ({
|
|
2982
|
+
site: string;
|
|
2983
|
+
source: RequirementItemSource.Jira;
|
|
2984
|
+
key: string;
|
|
2985
|
+
updated: string;
|
|
2986
|
+
contentHash: string;
|
|
2987
|
+
} | {
|
|
2988
|
+
site: string;
|
|
2989
|
+
source: RequirementItemSource.Confluence;
|
|
2990
|
+
key: string;
|
|
2991
|
+
contentHash: string;
|
|
2992
|
+
version: number;
|
|
2993
|
+
} | {
|
|
2994
|
+
source: RequirementItemSource.Other;
|
|
2995
|
+
key: string;
|
|
2996
|
+
contentHash: string;
|
|
2997
|
+
} | {
|
|
2998
|
+
source: RequirementItemSource.Other;
|
|
2999
|
+
key: string;
|
|
3000
|
+
contentHash: string;
|
|
3001
|
+
fileName: string;
|
|
3002
|
+
mediaType: UploadedMediaType;
|
|
3003
|
+
})[] | undefined;
|
|
3004
|
+
deployedRevisions?: {
|
|
3005
|
+
repository: {
|
|
3006
|
+
provider: SourceProvider.GitHub;
|
|
3007
|
+
providerAccountId: string;
|
|
3008
|
+
providerRepositoryId: string;
|
|
3009
|
+
} | {
|
|
3010
|
+
provider: SourceProvider.AzureDevOps;
|
|
3011
|
+
providerAccountId: string;
|
|
3012
|
+
providerRepositoryId: string;
|
|
3013
|
+
};
|
|
3014
|
+
revision: string;
|
|
3015
|
+
}[] | undefined;
|
|
3016
|
+
}>, {
|
|
3017
|
+
credentials: {
|
|
3018
|
+
name: string;
|
|
3019
|
+
purpose: CredentialPurpose;
|
|
3020
|
+
required: boolean;
|
|
3021
|
+
}[];
|
|
3022
|
+
schemaVersion: 1;
|
|
3023
|
+
sources: {
|
|
3024
|
+
repository: {
|
|
3025
|
+
name: string;
|
|
3026
|
+
provider: SourceProvider.GitHub;
|
|
3027
|
+
providerAccountId: string;
|
|
3028
|
+
providerRepositoryId: string;
|
|
3029
|
+
namespace: string;
|
|
3030
|
+
} | {
|
|
3031
|
+
name: string;
|
|
3032
|
+
provider: SourceProvider.AzureDevOps;
|
|
3033
|
+
providerAccountId: string;
|
|
3034
|
+
providerRepositoryId: string;
|
|
3035
|
+
namespace: string;
|
|
3036
|
+
};
|
|
3037
|
+
reason: SelectionReason;
|
|
3038
|
+
revision: string;
|
|
3039
|
+
ref: string | null;
|
|
3040
|
+
change: {
|
|
3041
|
+
number: string;
|
|
3042
|
+
kind: ChangeKind;
|
|
3043
|
+
base?: {
|
|
3044
|
+
revision: string;
|
|
3045
|
+
ref: string;
|
|
3046
|
+
} | undefined;
|
|
3047
|
+
} | null;
|
|
3048
|
+
compareWith?: {
|
|
3049
|
+
revision: string;
|
|
3050
|
+
ref: string;
|
|
3051
|
+
} | undefined;
|
|
3052
|
+
}[];
|
|
3053
|
+
runId: string;
|
|
3054
|
+
skyrampOrgId: string;
|
|
3055
|
+
target: {
|
|
3056
|
+
id: string;
|
|
3057
|
+
revision: string;
|
|
3058
|
+
};
|
|
3059
|
+
policy: {
|
|
3060
|
+
id: string;
|
|
3061
|
+
revision: string;
|
|
3062
|
+
} | null;
|
|
3063
|
+
trigger: {
|
|
3064
|
+
kind: TriggerKind;
|
|
3065
|
+
requestedAt: string;
|
|
3066
|
+
};
|
|
3067
|
+
configuration: {
|
|
3068
|
+
revision: string | null;
|
|
3069
|
+
captureId: string;
|
|
3070
|
+
hash: string;
|
|
3071
|
+
};
|
|
3072
|
+
execution: {
|
|
3073
|
+
repository: {
|
|
3074
|
+
name: string;
|
|
3075
|
+
provider: SourceProvider.GitHub;
|
|
3076
|
+
providerAccountId: string;
|
|
3077
|
+
providerRepositoryId: string;
|
|
3078
|
+
namespace: string;
|
|
3079
|
+
} | {
|
|
3080
|
+
name: string;
|
|
3081
|
+
provider: SourceProvider.AzureDevOps;
|
|
3082
|
+
providerAccountId: string;
|
|
3083
|
+
providerRepositoryId: string;
|
|
3084
|
+
namespace: string;
|
|
3085
|
+
};
|
|
3086
|
+
provider: SourceProvider;
|
|
3087
|
+
ref: string;
|
|
3088
|
+
workflowPath: string;
|
|
3089
|
+
};
|
|
3090
|
+
instructions?: {
|
|
3091
|
+
contentHash: string;
|
|
3092
|
+
} | undefined;
|
|
3093
|
+
baseline?: {
|
|
3094
|
+
confirmedRunId: string | null;
|
|
3095
|
+
initialBaselineId?: string | undefined;
|
|
3096
|
+
sources?: {
|
|
3097
|
+
repository: {
|
|
3098
|
+
provider: SourceProvider.GitHub;
|
|
3099
|
+
providerAccountId: string;
|
|
3100
|
+
providerRepositoryId: string;
|
|
3101
|
+
} | {
|
|
3102
|
+
provider: SourceProvider.AzureDevOps;
|
|
3103
|
+
providerAccountId: string;
|
|
3104
|
+
providerRepositoryId: string;
|
|
3105
|
+
};
|
|
3106
|
+
revision: string;
|
|
3107
|
+
}[] | undefined;
|
|
3108
|
+
} | undefined;
|
|
3109
|
+
requirements?: ({
|
|
3110
|
+
site: string;
|
|
3111
|
+
source: RequirementItemSource.Jira;
|
|
3112
|
+
key: string;
|
|
3113
|
+
updated: string;
|
|
3114
|
+
contentHash: string;
|
|
3115
|
+
} | {
|
|
3116
|
+
site: string;
|
|
3117
|
+
source: RequirementItemSource.Confluence;
|
|
3118
|
+
key: string;
|
|
3119
|
+
contentHash: string;
|
|
3120
|
+
version: number;
|
|
3121
|
+
} | {
|
|
3122
|
+
source: RequirementItemSource.Other;
|
|
3123
|
+
key: string;
|
|
3124
|
+
contentHash: string;
|
|
3125
|
+
} | {
|
|
3126
|
+
source: RequirementItemSource.Other;
|
|
3127
|
+
key: string;
|
|
3128
|
+
contentHash: string;
|
|
3129
|
+
fileName: string;
|
|
3130
|
+
mediaType: UploadedMediaType;
|
|
3131
|
+
})[] | undefined;
|
|
3132
|
+
deployedRevisions?: {
|
|
3133
|
+
repository: {
|
|
3134
|
+
provider: SourceProvider.GitHub;
|
|
3135
|
+
providerAccountId: string;
|
|
3136
|
+
providerRepositoryId: string;
|
|
3137
|
+
} | {
|
|
3138
|
+
provider: SourceProvider.AzureDevOps;
|
|
3139
|
+
providerAccountId: string;
|
|
3140
|
+
providerRepositoryId: string;
|
|
3141
|
+
};
|
|
3142
|
+
revision: string;
|
|
3143
|
+
}[] | undefined;
|
|
3144
|
+
}, {
|
|
3145
|
+
credentials: {
|
|
3146
|
+
name: string;
|
|
3147
|
+
purpose: CredentialPurpose;
|
|
3148
|
+
required: boolean;
|
|
3149
|
+
}[];
|
|
3150
|
+
schemaVersion: 1;
|
|
3151
|
+
sources: {
|
|
3152
|
+
repository: {
|
|
3153
|
+
name: string;
|
|
3154
|
+
provider: SourceProvider.GitHub;
|
|
3155
|
+
providerAccountId: string;
|
|
3156
|
+
providerRepositoryId: string;
|
|
3157
|
+
namespace: string;
|
|
3158
|
+
} | {
|
|
3159
|
+
name: string;
|
|
3160
|
+
provider: SourceProvider.AzureDevOps;
|
|
3161
|
+
providerAccountId: string;
|
|
3162
|
+
providerRepositoryId: string;
|
|
3163
|
+
namespace: string;
|
|
3164
|
+
};
|
|
3165
|
+
reason: SelectionReason;
|
|
3166
|
+
revision: string;
|
|
3167
|
+
ref: string | null;
|
|
3168
|
+
change: {
|
|
3169
|
+
number: string;
|
|
3170
|
+
kind: ChangeKind;
|
|
3171
|
+
base?: {
|
|
3172
|
+
revision: string;
|
|
3173
|
+
ref: string;
|
|
3174
|
+
} | undefined;
|
|
3175
|
+
} | null;
|
|
3176
|
+
compareWith?: {
|
|
3177
|
+
revision: string;
|
|
3178
|
+
ref: string;
|
|
3179
|
+
} | undefined;
|
|
3180
|
+
}[];
|
|
3181
|
+
runId: string;
|
|
3182
|
+
skyrampOrgId: string;
|
|
3183
|
+
target: {
|
|
3184
|
+
id: string;
|
|
3185
|
+
revision: string;
|
|
3186
|
+
};
|
|
3187
|
+
policy: {
|
|
3188
|
+
id: string;
|
|
3189
|
+
revision: string;
|
|
3190
|
+
} | null;
|
|
3191
|
+
trigger: {
|
|
3192
|
+
kind: TriggerKind;
|
|
3193
|
+
requestedAt: string;
|
|
3194
|
+
};
|
|
3195
|
+
configuration: {
|
|
3196
|
+
revision: string | null;
|
|
3197
|
+
captureId: string;
|
|
3198
|
+
hash: string;
|
|
3199
|
+
};
|
|
3200
|
+
execution: {
|
|
3201
|
+
repository: {
|
|
3202
|
+
name: string;
|
|
3203
|
+
provider: SourceProvider.GitHub;
|
|
3204
|
+
providerAccountId: string;
|
|
3205
|
+
providerRepositoryId: string;
|
|
3206
|
+
namespace: string;
|
|
3207
|
+
} | {
|
|
3208
|
+
name: string;
|
|
3209
|
+
provider: SourceProvider.AzureDevOps;
|
|
3210
|
+
providerAccountId: string;
|
|
3211
|
+
providerRepositoryId: string;
|
|
3212
|
+
namespace: string;
|
|
3213
|
+
};
|
|
3214
|
+
provider: SourceProvider;
|
|
3215
|
+
ref: string;
|
|
3216
|
+
workflowPath: string;
|
|
3217
|
+
};
|
|
3218
|
+
instructions?: {
|
|
3219
|
+
contentHash: string;
|
|
3220
|
+
} | undefined;
|
|
3221
|
+
baseline?: {
|
|
3222
|
+
confirmedRunId: string | null;
|
|
3223
|
+
initialBaselineId?: string | undefined;
|
|
3224
|
+
sources?: {
|
|
3225
|
+
repository: {
|
|
3226
|
+
provider: SourceProvider.GitHub;
|
|
3227
|
+
providerAccountId: string;
|
|
3228
|
+
providerRepositoryId: string;
|
|
3229
|
+
} | {
|
|
3230
|
+
provider: SourceProvider.AzureDevOps;
|
|
3231
|
+
providerAccountId: string;
|
|
3232
|
+
providerRepositoryId: string;
|
|
3233
|
+
};
|
|
3234
|
+
revision: string;
|
|
3235
|
+
}[] | undefined;
|
|
3236
|
+
} | undefined;
|
|
3237
|
+
requirements?: ({
|
|
3238
|
+
site: string;
|
|
3239
|
+
source: RequirementItemSource.Jira;
|
|
3240
|
+
key: string;
|
|
3241
|
+
updated: string;
|
|
3242
|
+
contentHash: string;
|
|
3243
|
+
} | {
|
|
3244
|
+
site: string;
|
|
3245
|
+
source: RequirementItemSource.Confluence;
|
|
3246
|
+
key: string;
|
|
3247
|
+
contentHash: string;
|
|
3248
|
+
version: number;
|
|
3249
|
+
} | {
|
|
3250
|
+
source: RequirementItemSource.Other;
|
|
3251
|
+
key: string;
|
|
3252
|
+
contentHash: string;
|
|
3253
|
+
} | {
|
|
3254
|
+
source: RequirementItemSource.Other;
|
|
3255
|
+
key: string;
|
|
3256
|
+
contentHash: string;
|
|
3257
|
+
fileName: string;
|
|
3258
|
+
mediaType: UploadedMediaType;
|
|
3259
|
+
})[] | undefined;
|
|
3260
|
+
deployedRevisions?: {
|
|
3261
|
+
repository: {
|
|
3262
|
+
provider: SourceProvider.GitHub;
|
|
3263
|
+
providerAccountId: string;
|
|
3264
|
+
providerRepositoryId: string;
|
|
3265
|
+
} | {
|
|
3266
|
+
provider: SourceProvider.AzureDevOps;
|
|
3267
|
+
providerAccountId: string;
|
|
3268
|
+
providerRepositoryId: string;
|
|
3269
|
+
};
|
|
3270
|
+
revision: string;
|
|
3271
|
+
}[] | undefined;
|
|
3272
|
+
}>;
|
|
3273
|
+
export type RunManifestV1 = z.infer<typeof RunManifestV1Schema>;
|
|
3274
|
+
/** What a V3 run uses in place of a license file while the app has licensing on. */
|
|
3275
|
+
export interface RunLicense {
|
|
3276
|
+
/** The organization's entitlement codes. */
|
|
3277
|
+
entitlements: string[];
|
|
3278
|
+
/** What Skyramp core shows the app to get the codes. */
|
|
3279
|
+
runToken: string;
|
|
3280
|
+
}
|
|
3281
|
+
declare enum RequesterKind {
|
|
3282
|
+
Person = "person",
|
|
3283
|
+
Policy = "policy"
|
|
3284
|
+
}
|
|
3285
|
+
declare const RequestedBySchema: z.ZodObject<{
|
|
3286
|
+
kind: z.ZodNativeEnum<typeof RequesterKind>;
|
|
3287
|
+
name: z.ZodString;
|
|
3288
|
+
}, "strict", z.ZodTypeAny, {
|
|
3289
|
+
name: string;
|
|
3290
|
+
kind: RequesterKind;
|
|
3291
|
+
}, {
|
|
3292
|
+
name: string;
|
|
3293
|
+
kind: RequesterKind;
|
|
3294
|
+
}>;
|
|
3295
|
+
export type RequestedBy = z.infer<typeof RequestedBySchema>;
|
|
3296
|
+
declare const RunnerHandshakeRequestV1Schema: z.ZodObject<{
|
|
3297
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
3298
|
+
runId: z.ZodString;
|
|
3299
|
+
execution: z.ZodDiscriminatedUnion<"provider", [
|
|
3300
|
+
z.ZodObject<{
|
|
3301
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3302
|
+
repository: z.ZodObject<{
|
|
3303
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3304
|
+
providerAccountId: z.ZodString;
|
|
3305
|
+
providerRepositoryId: z.ZodString;
|
|
3306
|
+
}, "strict", z.ZodTypeAny, {
|
|
3307
|
+
provider: SourceProvider.GitHub;
|
|
3308
|
+
providerAccountId: string;
|
|
3309
|
+
providerRepositoryId: string;
|
|
3310
|
+
}, {
|
|
3311
|
+
provider: SourceProvider.GitHub;
|
|
3312
|
+
providerAccountId: string;
|
|
3313
|
+
providerRepositoryId: string;
|
|
3314
|
+
}>;
|
|
3315
|
+
providerRunId: z.ZodString;
|
|
3316
|
+
providerRunAttempt: z.ZodNumber;
|
|
3317
|
+
workflowRef: z.ZodString;
|
|
3318
|
+
}, "strict", z.ZodTypeAny, {
|
|
3319
|
+
repository: {
|
|
3320
|
+
provider: SourceProvider.GitHub;
|
|
3321
|
+
providerAccountId: string;
|
|
3322
|
+
providerRepositoryId: string;
|
|
3323
|
+
};
|
|
3324
|
+
provider: SourceProvider.GitHub;
|
|
3325
|
+
providerRunId: string;
|
|
3326
|
+
providerRunAttempt: number;
|
|
3327
|
+
workflowRef: string;
|
|
3328
|
+
}, {
|
|
3329
|
+
repository: {
|
|
3330
|
+
provider: SourceProvider.GitHub;
|
|
3331
|
+
providerAccountId: string;
|
|
3332
|
+
providerRepositoryId: string;
|
|
3333
|
+
};
|
|
3334
|
+
provider: SourceProvider.GitHub;
|
|
3335
|
+
providerRunId: string;
|
|
3336
|
+
providerRunAttempt: number;
|
|
3337
|
+
workflowRef: string;
|
|
3338
|
+
}>,
|
|
3339
|
+
z.ZodObject<{
|
|
3340
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3341
|
+
repository: z.ZodObject<{
|
|
3342
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3343
|
+
providerAccountId: z.ZodString;
|
|
3344
|
+
providerRepositoryId: z.ZodString;
|
|
3345
|
+
}, "strict", z.ZodTypeAny, {
|
|
3346
|
+
provider: SourceProvider.AzureDevOps;
|
|
3347
|
+
providerAccountId: string;
|
|
3348
|
+
providerRepositoryId: string;
|
|
3349
|
+
}, {
|
|
3350
|
+
provider: SourceProvider.AzureDevOps;
|
|
3351
|
+
providerAccountId: string;
|
|
3352
|
+
providerRepositoryId: string;
|
|
3353
|
+
}>;
|
|
3354
|
+
providerRunId: z.ZodString;
|
|
3355
|
+
providerRunAttempt: z.ZodNumber;
|
|
3356
|
+
workflowRef: z.ZodString;
|
|
3357
|
+
}, "strict", z.ZodTypeAny, {
|
|
3358
|
+
repository: {
|
|
3359
|
+
provider: SourceProvider.AzureDevOps;
|
|
3360
|
+
providerAccountId: string;
|
|
3361
|
+
providerRepositoryId: string;
|
|
3362
|
+
};
|
|
3363
|
+
provider: SourceProvider.AzureDevOps;
|
|
3364
|
+
providerRunId: string;
|
|
3365
|
+
providerRunAttempt: number;
|
|
3366
|
+
workflowRef: string;
|
|
3367
|
+
}, {
|
|
3368
|
+
repository: {
|
|
3369
|
+
provider: SourceProvider.AzureDevOps;
|
|
3370
|
+
providerAccountId: string;
|
|
3371
|
+
providerRepositoryId: string;
|
|
3372
|
+
};
|
|
3373
|
+
provider: SourceProvider.AzureDevOps;
|
|
3374
|
+
providerRunId: string;
|
|
3375
|
+
providerRunAttempt: number;
|
|
3376
|
+
workflowRef: string;
|
|
3377
|
+
}>
|
|
3378
|
+
]>;
|
|
3379
|
+
requester: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3380
|
+
writeCheck: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3381
|
+
claudeCodePin: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3382
|
+
deployedPins: z.ZodOptional<z.ZodLiteral<true>>;
|
|
3383
|
+
}, "strict", z.ZodTypeAny, {
|
|
3384
|
+
schemaVersion: 1;
|
|
3385
|
+
runId: string;
|
|
3386
|
+
execution: {
|
|
3387
|
+
repository: {
|
|
3388
|
+
provider: SourceProvider.GitHub;
|
|
3389
|
+
providerAccountId: string;
|
|
3390
|
+
providerRepositoryId: string;
|
|
3391
|
+
};
|
|
3392
|
+
provider: SourceProvider.GitHub;
|
|
3393
|
+
providerRunId: string;
|
|
3394
|
+
providerRunAttempt: number;
|
|
3395
|
+
workflowRef: string;
|
|
3396
|
+
} | {
|
|
3397
|
+
repository: {
|
|
3398
|
+
provider: SourceProvider.AzureDevOps;
|
|
3399
|
+
providerAccountId: string;
|
|
3400
|
+
providerRepositoryId: string;
|
|
3401
|
+
};
|
|
3402
|
+
provider: SourceProvider.AzureDevOps;
|
|
3403
|
+
providerRunId: string;
|
|
3404
|
+
providerRunAttempt: number;
|
|
3405
|
+
workflowRef: string;
|
|
3406
|
+
};
|
|
3407
|
+
requester?: true | undefined;
|
|
3408
|
+
writeCheck?: true | undefined;
|
|
3409
|
+
claudeCodePin?: true | undefined;
|
|
3410
|
+
deployedPins?: true | undefined;
|
|
3411
|
+
}, {
|
|
3412
|
+
schemaVersion: 1;
|
|
3413
|
+
runId: string;
|
|
3414
|
+
execution: {
|
|
3415
|
+
repository: {
|
|
3416
|
+
provider: SourceProvider.GitHub;
|
|
3417
|
+
providerAccountId: string;
|
|
3418
|
+
providerRepositoryId: string;
|
|
3419
|
+
};
|
|
3420
|
+
provider: SourceProvider.GitHub;
|
|
3421
|
+
providerRunId: string;
|
|
3422
|
+
providerRunAttempt: number;
|
|
3423
|
+
workflowRef: string;
|
|
3424
|
+
} | {
|
|
3425
|
+
repository: {
|
|
3426
|
+
provider: SourceProvider.AzureDevOps;
|
|
3427
|
+
providerAccountId: string;
|
|
3428
|
+
providerRepositoryId: string;
|
|
3429
|
+
};
|
|
3430
|
+
provider: SourceProvider.AzureDevOps;
|
|
3431
|
+
providerRunId: string;
|
|
3432
|
+
providerRunAttempt: number;
|
|
3433
|
+
workflowRef: string;
|
|
3434
|
+
};
|
|
3435
|
+
requester?: true | undefined;
|
|
3436
|
+
writeCheck?: true | undefined;
|
|
3437
|
+
claudeCodePin?: true | undefined;
|
|
3438
|
+
deployedPins?: true | undefined;
|
|
3439
|
+
}>;
|
|
3440
|
+
export type RunnerHandshakeRequestV1 = z.infer<typeof RunnerHandshakeRequestV1Schema>;
|
|
3441
|
+
declare const GeneratedTestDeliverySchema: z.ZodDiscriminatedUnion<"status", [
|
|
3442
|
+
z.ZodObject<{
|
|
3443
|
+
status: z.ZodLiteral<DeliveryStatus.None>;
|
|
3444
|
+
}, "strict", z.ZodTypeAny, {
|
|
3445
|
+
status: DeliveryStatus.None;
|
|
3446
|
+
}, {
|
|
3447
|
+
status: DeliveryStatus.None;
|
|
3448
|
+
}>,
|
|
3449
|
+
z.ZodObject<{
|
|
3450
|
+
status: z.ZodLiteral<DeliveryStatus.Delivered>;
|
|
3451
|
+
pullRequests: z.ZodArray<z.ZodObject<{
|
|
3452
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
3453
|
+
z.ZodObject<{
|
|
3454
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3455
|
+
providerAccountId: z.ZodString;
|
|
3456
|
+
providerRepositoryId: z.ZodString;
|
|
3457
|
+
}, "strict", z.ZodTypeAny, {
|
|
3458
|
+
provider: SourceProvider.GitHub;
|
|
3459
|
+
providerAccountId: string;
|
|
3460
|
+
providerRepositoryId: string;
|
|
3461
|
+
}, {
|
|
3462
|
+
provider: SourceProvider.GitHub;
|
|
3463
|
+
providerAccountId: string;
|
|
3464
|
+
providerRepositoryId: string;
|
|
3465
|
+
}>,
|
|
3466
|
+
z.ZodObject<{
|
|
3467
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3468
|
+
providerAccountId: z.ZodString;
|
|
3469
|
+
providerRepositoryId: z.ZodString;
|
|
3470
|
+
}, "strict", z.ZodTypeAny, {
|
|
3471
|
+
provider: SourceProvider.AzureDevOps;
|
|
3472
|
+
providerAccountId: string;
|
|
3473
|
+
providerRepositoryId: string;
|
|
3474
|
+
}, {
|
|
3475
|
+
provider: SourceProvider.AzureDevOps;
|
|
3476
|
+
providerAccountId: string;
|
|
3477
|
+
providerRepositoryId: string;
|
|
3478
|
+
}>
|
|
3479
|
+
]>;
|
|
3480
|
+
number: z.ZodString;
|
|
3481
|
+
}, "strict", z.ZodTypeAny, {
|
|
3482
|
+
number: string;
|
|
3483
|
+
repository: {
|
|
3484
|
+
provider: SourceProvider.GitHub;
|
|
3485
|
+
providerAccountId: string;
|
|
3486
|
+
providerRepositoryId: string;
|
|
3487
|
+
} | {
|
|
3488
|
+
provider: SourceProvider.AzureDevOps;
|
|
3489
|
+
providerAccountId: string;
|
|
3490
|
+
providerRepositoryId: string;
|
|
3491
|
+
};
|
|
3492
|
+
}, {
|
|
3493
|
+
number: string;
|
|
3494
|
+
repository: {
|
|
3495
|
+
provider: SourceProvider.GitHub;
|
|
3496
|
+
providerAccountId: string;
|
|
3497
|
+
providerRepositoryId: string;
|
|
3498
|
+
} | {
|
|
3499
|
+
provider: SourceProvider.AzureDevOps;
|
|
3500
|
+
providerAccountId: string;
|
|
3501
|
+
providerRepositoryId: string;
|
|
3502
|
+
};
|
|
3503
|
+
}>, "many">;
|
|
3504
|
+
}, "strict", z.ZodTypeAny, {
|
|
3505
|
+
status: DeliveryStatus.Delivered;
|
|
3506
|
+
pullRequests: {
|
|
3507
|
+
number: string;
|
|
3508
|
+
repository: {
|
|
3509
|
+
provider: SourceProvider.GitHub;
|
|
3510
|
+
providerAccountId: string;
|
|
3511
|
+
providerRepositoryId: string;
|
|
3512
|
+
} | {
|
|
3513
|
+
provider: SourceProvider.AzureDevOps;
|
|
3514
|
+
providerAccountId: string;
|
|
3515
|
+
providerRepositoryId: string;
|
|
3516
|
+
};
|
|
3517
|
+
}[];
|
|
3518
|
+
}, {
|
|
3519
|
+
status: DeliveryStatus.Delivered;
|
|
3520
|
+
pullRequests: {
|
|
3521
|
+
number: string;
|
|
3522
|
+
repository: {
|
|
3523
|
+
provider: SourceProvider.GitHub;
|
|
3524
|
+
providerAccountId: string;
|
|
3525
|
+
providerRepositoryId: string;
|
|
3526
|
+
} | {
|
|
3527
|
+
provider: SourceProvider.AzureDevOps;
|
|
3528
|
+
providerAccountId: string;
|
|
3529
|
+
providerRepositoryId: string;
|
|
3530
|
+
};
|
|
3531
|
+
}[];
|
|
3532
|
+
}>,
|
|
3533
|
+
z.ZodObject<{
|
|
3534
|
+
status: z.ZodLiteral<DeliveryStatus.Partial>;
|
|
3535
|
+
pullRequests: z.ZodArray<z.ZodObject<{
|
|
3536
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
3537
|
+
z.ZodObject<{
|
|
3538
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3539
|
+
providerAccountId: z.ZodString;
|
|
3540
|
+
providerRepositoryId: z.ZodString;
|
|
3541
|
+
}, "strict", z.ZodTypeAny, {
|
|
3542
|
+
provider: SourceProvider.GitHub;
|
|
3543
|
+
providerAccountId: string;
|
|
3544
|
+
providerRepositoryId: string;
|
|
3545
|
+
}, {
|
|
3546
|
+
provider: SourceProvider.GitHub;
|
|
3547
|
+
providerAccountId: string;
|
|
3548
|
+
providerRepositoryId: string;
|
|
3549
|
+
}>,
|
|
3550
|
+
z.ZodObject<{
|
|
3551
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3552
|
+
providerAccountId: z.ZodString;
|
|
3553
|
+
providerRepositoryId: z.ZodString;
|
|
3554
|
+
}, "strict", z.ZodTypeAny, {
|
|
3555
|
+
provider: SourceProvider.AzureDevOps;
|
|
3556
|
+
providerAccountId: string;
|
|
3557
|
+
providerRepositoryId: string;
|
|
3558
|
+
}, {
|
|
3559
|
+
provider: SourceProvider.AzureDevOps;
|
|
3560
|
+
providerAccountId: string;
|
|
3561
|
+
providerRepositoryId: string;
|
|
3562
|
+
}>
|
|
3563
|
+
]>;
|
|
3564
|
+
number: z.ZodString;
|
|
3565
|
+
}, "strict", z.ZodTypeAny, {
|
|
3566
|
+
number: string;
|
|
3567
|
+
repository: {
|
|
3568
|
+
provider: SourceProvider.GitHub;
|
|
3569
|
+
providerAccountId: string;
|
|
3570
|
+
providerRepositoryId: string;
|
|
3571
|
+
} | {
|
|
3572
|
+
provider: SourceProvider.AzureDevOps;
|
|
3573
|
+
providerAccountId: string;
|
|
3574
|
+
providerRepositoryId: string;
|
|
3575
|
+
};
|
|
3576
|
+
}, {
|
|
3577
|
+
number: string;
|
|
3578
|
+
repository: {
|
|
3579
|
+
provider: SourceProvider.GitHub;
|
|
3580
|
+
providerAccountId: string;
|
|
3581
|
+
providerRepositoryId: string;
|
|
3582
|
+
} | {
|
|
3583
|
+
provider: SourceProvider.AzureDevOps;
|
|
3584
|
+
providerAccountId: string;
|
|
3585
|
+
providerRepositoryId: string;
|
|
3586
|
+
};
|
|
3587
|
+
}>, "many">;
|
|
3588
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
3589
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
3590
|
+
z.ZodObject<{
|
|
3591
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3592
|
+
providerAccountId: z.ZodString;
|
|
3593
|
+
providerRepositoryId: z.ZodString;
|
|
3594
|
+
}, "strict", z.ZodTypeAny, {
|
|
3595
|
+
provider: SourceProvider.GitHub;
|
|
3596
|
+
providerAccountId: string;
|
|
3597
|
+
providerRepositoryId: string;
|
|
3598
|
+
}, {
|
|
3599
|
+
provider: SourceProvider.GitHub;
|
|
3600
|
+
providerAccountId: string;
|
|
3601
|
+
providerRepositoryId: string;
|
|
3602
|
+
}>,
|
|
3603
|
+
z.ZodObject<{
|
|
3604
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3605
|
+
providerAccountId: z.ZodString;
|
|
3606
|
+
providerRepositoryId: z.ZodString;
|
|
3607
|
+
}, "strict", z.ZodTypeAny, {
|
|
3608
|
+
provider: SourceProvider.AzureDevOps;
|
|
3609
|
+
providerAccountId: string;
|
|
3610
|
+
providerRepositoryId: string;
|
|
3611
|
+
}, {
|
|
3612
|
+
provider: SourceProvider.AzureDevOps;
|
|
3613
|
+
providerAccountId: string;
|
|
3614
|
+
providerRepositoryId: string;
|
|
3615
|
+
}>
|
|
3616
|
+
]>;
|
|
3617
|
+
message: z.ZodString;
|
|
3618
|
+
}, "strict", z.ZodTypeAny, {
|
|
3619
|
+
message: string;
|
|
3620
|
+
repository: {
|
|
3621
|
+
provider: SourceProvider.GitHub;
|
|
3622
|
+
providerAccountId: string;
|
|
3623
|
+
providerRepositoryId: string;
|
|
3624
|
+
} | {
|
|
3625
|
+
provider: SourceProvider.AzureDevOps;
|
|
3626
|
+
providerAccountId: string;
|
|
3627
|
+
providerRepositoryId: string;
|
|
3628
|
+
};
|
|
3629
|
+
}, {
|
|
3630
|
+
message: string;
|
|
3631
|
+
repository: {
|
|
3632
|
+
provider: SourceProvider.GitHub;
|
|
3633
|
+
providerAccountId: string;
|
|
3634
|
+
providerRepositoryId: string;
|
|
3635
|
+
} | {
|
|
3636
|
+
provider: SourceProvider.AzureDevOps;
|
|
3637
|
+
providerAccountId: string;
|
|
3638
|
+
providerRepositoryId: string;
|
|
3639
|
+
};
|
|
3640
|
+
}>, "many">;
|
|
3641
|
+
}, "strict", z.ZodTypeAny, {
|
|
3642
|
+
status: DeliveryStatus.Partial;
|
|
3643
|
+
pullRequests: {
|
|
3644
|
+
number: string;
|
|
3645
|
+
repository: {
|
|
3646
|
+
provider: SourceProvider.GitHub;
|
|
3647
|
+
providerAccountId: string;
|
|
3648
|
+
providerRepositoryId: string;
|
|
3649
|
+
} | {
|
|
3650
|
+
provider: SourceProvider.AzureDevOps;
|
|
3651
|
+
providerAccountId: string;
|
|
3652
|
+
providerRepositoryId: string;
|
|
3653
|
+
};
|
|
3654
|
+
}[];
|
|
3655
|
+
failures: {
|
|
3656
|
+
message: string;
|
|
3657
|
+
repository: {
|
|
3658
|
+
provider: SourceProvider.GitHub;
|
|
3659
|
+
providerAccountId: string;
|
|
3660
|
+
providerRepositoryId: string;
|
|
3661
|
+
} | {
|
|
3662
|
+
provider: SourceProvider.AzureDevOps;
|
|
3663
|
+
providerAccountId: string;
|
|
3664
|
+
providerRepositoryId: string;
|
|
3665
|
+
};
|
|
3666
|
+
}[];
|
|
3667
|
+
}, {
|
|
3668
|
+
status: DeliveryStatus.Partial;
|
|
3669
|
+
pullRequests: {
|
|
3670
|
+
number: string;
|
|
3671
|
+
repository: {
|
|
3672
|
+
provider: SourceProvider.GitHub;
|
|
3673
|
+
providerAccountId: string;
|
|
3674
|
+
providerRepositoryId: string;
|
|
3675
|
+
} | {
|
|
3676
|
+
provider: SourceProvider.AzureDevOps;
|
|
3677
|
+
providerAccountId: string;
|
|
3678
|
+
providerRepositoryId: string;
|
|
3679
|
+
};
|
|
3680
|
+
}[];
|
|
3681
|
+
failures: {
|
|
3682
|
+
message: string;
|
|
3683
|
+
repository: {
|
|
3684
|
+
provider: SourceProvider.GitHub;
|
|
3685
|
+
providerAccountId: string;
|
|
3686
|
+
providerRepositoryId: string;
|
|
3687
|
+
} | {
|
|
3688
|
+
provider: SourceProvider.AzureDevOps;
|
|
3689
|
+
providerAccountId: string;
|
|
3690
|
+
providerRepositoryId: string;
|
|
3691
|
+
};
|
|
3692
|
+
}[];
|
|
3693
|
+
}>,
|
|
3694
|
+
z.ZodObject<{
|
|
3695
|
+
status: z.ZodLiteral<DeliveryStatus.Failed>;
|
|
3696
|
+
message: z.ZodString;
|
|
3697
|
+
}, "strict", z.ZodTypeAny, {
|
|
3698
|
+
status: DeliveryStatus.Failed;
|
|
3699
|
+
message: string;
|
|
3700
|
+
}, {
|
|
3701
|
+
status: DeliveryStatus.Failed;
|
|
3702
|
+
message: string;
|
|
3703
|
+
}>
|
|
3704
|
+
]>;
|
|
3705
|
+
export type GeneratedTestDelivery = z.infer<typeof GeneratedTestDeliverySchema>;
|
|
3706
|
+
declare enum GitHubWriteKind {
|
|
3707
|
+
BranchPushed = "branch_pushed",
|
|
3708
|
+
PullRequestOpened = "pull_request_opened",
|
|
3709
|
+
PullRequestEdited = "pull_request_edited"
|
|
3710
|
+
}
|
|
3711
|
+
declare const GitHubWriteSchema: z.ZodDiscriminatedUnion<"kind", [
|
|
3712
|
+
z.ZodObject<{
|
|
3713
|
+
kind: z.ZodLiteral<GitHubWriteKind.BranchPushed>;
|
|
3714
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
3715
|
+
z.ZodObject<{
|
|
3716
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3717
|
+
providerAccountId: z.ZodString;
|
|
3718
|
+
providerRepositoryId: z.ZodString;
|
|
3719
|
+
}, "strict", z.ZodTypeAny, {
|
|
3720
|
+
provider: SourceProvider.GitHub;
|
|
3721
|
+
providerAccountId: string;
|
|
3722
|
+
providerRepositoryId: string;
|
|
3723
|
+
}, {
|
|
3724
|
+
provider: SourceProvider.GitHub;
|
|
3725
|
+
providerAccountId: string;
|
|
3726
|
+
providerRepositoryId: string;
|
|
3727
|
+
}>,
|
|
3728
|
+
z.ZodObject<{
|
|
3729
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3730
|
+
providerAccountId: z.ZodString;
|
|
3731
|
+
providerRepositoryId: z.ZodString;
|
|
3732
|
+
}, "strict", z.ZodTypeAny, {
|
|
3733
|
+
provider: SourceProvider.AzureDevOps;
|
|
3734
|
+
providerAccountId: string;
|
|
3735
|
+
providerRepositoryId: string;
|
|
3736
|
+
}, {
|
|
3737
|
+
provider: SourceProvider.AzureDevOps;
|
|
3738
|
+
providerAccountId: string;
|
|
3739
|
+
providerRepositoryId: string;
|
|
3740
|
+
}>
|
|
3741
|
+
]>;
|
|
3742
|
+
branch: z.ZodString;
|
|
3743
|
+
commit: z.ZodString;
|
|
3744
|
+
}, "strict", z.ZodTypeAny, {
|
|
3745
|
+
repository: {
|
|
3746
|
+
provider: SourceProvider.GitHub;
|
|
3747
|
+
providerAccountId: string;
|
|
3748
|
+
providerRepositoryId: string;
|
|
3749
|
+
} | {
|
|
3750
|
+
provider: SourceProvider.AzureDevOps;
|
|
3751
|
+
providerAccountId: string;
|
|
3752
|
+
providerRepositoryId: string;
|
|
3753
|
+
};
|
|
3754
|
+
kind: GitHubWriteKind.BranchPushed;
|
|
3755
|
+
branch: string;
|
|
3756
|
+
commit: string;
|
|
3757
|
+
}, {
|
|
3758
|
+
repository: {
|
|
3759
|
+
provider: SourceProvider.GitHub;
|
|
3760
|
+
providerAccountId: string;
|
|
3761
|
+
providerRepositoryId: string;
|
|
3762
|
+
} | {
|
|
3763
|
+
provider: SourceProvider.AzureDevOps;
|
|
3764
|
+
providerAccountId: string;
|
|
3765
|
+
providerRepositoryId: string;
|
|
3766
|
+
};
|
|
3767
|
+
kind: GitHubWriteKind.BranchPushed;
|
|
3768
|
+
branch: string;
|
|
3769
|
+
commit: string;
|
|
3770
|
+
}>,
|
|
3771
|
+
z.ZodObject<{
|
|
3772
|
+
kind: z.ZodEnum<[
|
|
3773
|
+
GitHubWriteKind.PullRequestOpened,
|
|
3774
|
+
GitHubWriteKind.PullRequestEdited
|
|
3775
|
+
]>;
|
|
3776
|
+
repository: z.ZodDiscriminatedUnion<"provider", [
|
|
3777
|
+
z.ZodObject<{
|
|
3778
|
+
provider: z.ZodLiteral<SourceProvider.GitHub>;
|
|
3779
|
+
providerAccountId: z.ZodString;
|
|
3780
|
+
providerRepositoryId: z.ZodString;
|
|
3781
|
+
}, "strict", z.ZodTypeAny, {
|
|
3782
|
+
provider: SourceProvider.GitHub;
|
|
3783
|
+
providerAccountId: string;
|
|
3784
|
+
providerRepositoryId: string;
|
|
3785
|
+
}, {
|
|
3786
|
+
provider: SourceProvider.GitHub;
|
|
3787
|
+
providerAccountId: string;
|
|
3788
|
+
providerRepositoryId: string;
|
|
3789
|
+
}>,
|
|
3790
|
+
z.ZodObject<{
|
|
3791
|
+
provider: z.ZodLiteral<SourceProvider.AzureDevOps>;
|
|
3792
|
+
providerAccountId: z.ZodString;
|
|
3793
|
+
providerRepositoryId: z.ZodString;
|
|
3794
|
+
}, "strict", z.ZodTypeAny, {
|
|
3795
|
+
provider: SourceProvider.AzureDevOps;
|
|
3796
|
+
providerAccountId: string;
|
|
3797
|
+
providerRepositoryId: string;
|
|
3798
|
+
}, {
|
|
3799
|
+
provider: SourceProvider.AzureDevOps;
|
|
3800
|
+
providerAccountId: string;
|
|
3801
|
+
providerRepositoryId: string;
|
|
3802
|
+
}>
|
|
3803
|
+
]>;
|
|
3804
|
+
number: z.ZodString;
|
|
3805
|
+
branch: z.ZodString;
|
|
3806
|
+
}, "strict", z.ZodTypeAny, {
|
|
3807
|
+
number: string;
|
|
3808
|
+
repository: {
|
|
3809
|
+
provider: SourceProvider.GitHub;
|
|
3810
|
+
providerAccountId: string;
|
|
3811
|
+
providerRepositoryId: string;
|
|
3812
|
+
} | {
|
|
3813
|
+
provider: SourceProvider.AzureDevOps;
|
|
3814
|
+
providerAccountId: string;
|
|
3815
|
+
providerRepositoryId: string;
|
|
3816
|
+
};
|
|
3817
|
+
kind: GitHubWriteKind.PullRequestOpened | GitHubWriteKind.PullRequestEdited;
|
|
3818
|
+
branch: string;
|
|
3819
|
+
}, {
|
|
3820
|
+
number: string;
|
|
3821
|
+
repository: {
|
|
3822
|
+
provider: SourceProvider.GitHub;
|
|
3823
|
+
providerAccountId: string;
|
|
3824
|
+
providerRepositoryId: string;
|
|
3825
|
+
} | {
|
|
3826
|
+
provider: SourceProvider.AzureDevOps;
|
|
3827
|
+
providerAccountId: string;
|
|
3828
|
+
providerRepositoryId: string;
|
|
3829
|
+
};
|
|
3830
|
+
kind: GitHubWriteKind.PullRequestOpened | GitHubWriteKind.PullRequestEdited;
|
|
3831
|
+
branch: string;
|
|
3832
|
+
}>
|
|
3833
|
+
]>;
|
|
3834
|
+
export type GitHubWrite = z.infer<typeof GitHubWriteSchema>;
|
|
3835
|
+
declare const AttemptHeartbeatV1Schema: z.ZodObject<{
|
|
3836
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
3837
|
+
state: z.ZodNativeEnum<typeof AttemptState>;
|
|
3838
|
+
ending: z.ZodNullable<z.ZodNativeEnum<typeof AttemptEndReason>>;
|
|
3839
|
+
cause: z.ZodNullable<z.ZodNativeEnum<typeof NoReportCause>>;
|
|
3840
|
+
deadlineAt: z.ZodString;
|
|
3841
|
+
}, "strict", z.ZodTypeAny, {
|
|
3842
|
+
schemaVersion: 1;
|
|
3843
|
+
state: AttemptState;
|
|
3844
|
+
deadlineAt: string;
|
|
3845
|
+
ending: AttemptEndReason | null;
|
|
3846
|
+
cause: NoReportCause | null;
|
|
3847
|
+
}, {
|
|
3848
|
+
schemaVersion: 1;
|
|
3849
|
+
state: AttemptState;
|
|
3850
|
+
deadlineAt: string;
|
|
3851
|
+
ending: AttemptEndReason | null;
|
|
3852
|
+
cause: NoReportCause | null;
|
|
3853
|
+
}>;
|
|
3854
|
+
export type AttemptHeartbeatV1 = z.infer<typeof AttemptHeartbeatV1Schema>;
|
|
3855
|
+
declare enum AttemptClosure {
|
|
3856
|
+
Cancelled = "cancelled",
|
|
3857
|
+
Expired = "expired",
|
|
3858
|
+
Ended = "ended"
|
|
3859
|
+
}
|
|
3860
|
+
declare enum CommitLookup {
|
|
3861
|
+
Found = "found",
|
|
3862
|
+
Missing = "missing",
|
|
3863
|
+
/** GitHub gave no answer. */
|
|
3864
|
+
Unknown = "unknown"
|
|
3865
|
+
}
|
|
3866
|
+
/** One pull request of the Change Set, as the session reads it. */
|
|
3867
|
+
export interface ChangeSetPullRequest {
|
|
3868
|
+
/** owner/repo. */
|
|
3869
|
+
repository: string;
|
|
3870
|
+
number: string;
|
|
3871
|
+
title?: string;
|
|
3872
|
+
body?: string;
|
|
3873
|
+
/** Why the title and description are missing. */
|
|
3874
|
+
note?: string;
|
|
3875
|
+
/** Whether GitHub says the PR is merged. Absent when the PR could not be read. */
|
|
3876
|
+
merged?: boolean;
|
|
3877
|
+
/**
|
|
3878
|
+
* The commit the merge made, only for a merged PR. On an open PR GitHub fills `merge_commit_sha` with its test merge
|
|
3879
|
+
* commit, which no deployment runs.
|
|
3880
|
+
*/
|
|
3881
|
+
mergeCommit?: string;
|
|
3882
|
+
/** The head commit the PR merged, only for a merged PR. */
|
|
3883
|
+
mergedHead?: string;
|
|
3884
|
+
}
|
|
3885
|
+
/** A repository as a V3 source names it. */
|
|
3886
|
+
export interface SourceName {
|
|
3887
|
+
namespace: string;
|
|
3888
|
+
name: string;
|
|
3889
|
+
}
|
|
3890
|
+
/** A direct REST call to the job's source host: the token, minted only when the call is made, and the fetch to use. */
|
|
3891
|
+
export interface SourceCall {
|
|
3892
|
+
token: () => Promise<string>;
|
|
3893
|
+
fetch: typeof fetch;
|
|
3894
|
+
}
|
|
3895
|
+
declare enum CiPlatform {
|
|
3896
|
+
GitHub = "github",
|
|
3897
|
+
Azure = "azure"
|
|
3898
|
+
}
|
|
3899
|
+
/** A token a cloud role (Bedrock's) trusts, minted by the job. */
|
|
3900
|
+
export interface WebIdentity {
|
|
3901
|
+
token(audience: string): Promise<string>;
|
|
3902
|
+
/** The CI run's id, which names the role session. */
|
|
3903
|
+
runId?: string;
|
|
3904
|
+
}
|
|
3905
|
+
export interface RunnerHost {
|
|
3906
|
+
/** The --runner-platform this job selects when none is named; undefined outside a CI job. */
|
|
3907
|
+
readonly runnerPlatform?: CiPlatform;
|
|
3908
|
+
/** The job's workspace, where its checkouts are; undefined when the job names none. */
|
|
3909
|
+
readonly workspace?: string;
|
|
3910
|
+
/** The web base of the source host the job runs on: clone URLs and the scope of a persisted auth header. */
|
|
3911
|
+
readonly serverUrl: string;
|
|
3912
|
+
/** The REST API base of that host. */
|
|
3913
|
+
readonly apiUrl: string;
|
|
3914
|
+
/** The repository the job runs in, when the job names it. */
|
|
3915
|
+
readonly repository?: {
|
|
3916
|
+
id: string;
|
|
3917
|
+
slug: string;
|
|
3918
|
+
};
|
|
3919
|
+
/** The CI run, its attempt and the job, when known: artifact names. */
|
|
3920
|
+
readonly runId?: string;
|
|
3921
|
+
readonly runAttempt?: string;
|
|
3922
|
+
readonly job?: string;
|
|
3923
|
+
/** Where the V3 handshake says this job runs. The app compares every field with the job's identity token. Throws when the job does not say. */
|
|
3924
|
+
execution(): RunnerHandshakeRequestV1["execution"];
|
|
3925
|
+
/**
|
|
3926
|
+
* Takes the job's identity-token credentials out of the environment and returns the only way left to mint a token
|
|
3927
|
+
* for an audience. Every process the run starts inherits process.env; with those credentials, code in any of them
|
|
3928
|
+
* could repeat the handshake.
|
|
3929
|
+
*/
|
|
3930
|
+
takeIdToken(): (audience: string) => Promise<string>;
|
|
3931
|
+
/**
|
|
3932
|
+
* Takes the job's own token for its source host out of the environment and returns it: Azure DevOps's
|
|
3933
|
+
* System.AccessToken, which reaches the repositories the pipeline checked out. Absent where the app mints scoped tokens
|
|
3934
|
+
* instead (GitHub).
|
|
3935
|
+
*/
|
|
3936
|
+
takeSourceToken?(): string | undefined;
|
|
3937
|
+
/** The job's web identity for a cloud role, or undefined when the job can mint none. Read when called. */
|
|
3938
|
+
webIdentity(): WebIdentity | undefined;
|
|
3939
|
+
/** Whether the job runs only the V3 runs the app starts: their main step uploads its files and ends its reporting. */
|
|
3940
|
+
readonly v3RunsOnly: boolean;
|
|
3941
|
+
/** Whether the engine assumes the Bedrock role with the job's OIDC token, because the job has no AWS step of its own. */
|
|
3942
|
+
readonly assumesBedrockRole: boolean;
|
|
3943
|
+
/** Whether the Skyramp MCP server needs the run's repository and provider: the job's env names neither. */
|
|
3944
|
+
readonly namesSourceToMcp: boolean;
|
|
3945
|
+
/** Throws when `repository` cannot be a repository on this host: its names go into paths and URLs. */
|
|
3946
|
+
checkSourceName(repository: SourceName): void;
|
|
3947
|
+
/** The clone URL of `repository`, which is also where gitAuthEnv sends the token. */
|
|
3948
|
+
cloneUrl(repository: SourceName): string;
|
|
3949
|
+
/** git's environment for one fetch from this host with `token`, which never reaches argv or git config. */
|
|
3950
|
+
gitAuthEnv(token: string): Record<string, string>;
|
|
3951
|
+
/** A pull request's title, description and, once merged, its merge commit and the head it merged. Throws when it cannot be read. */
|
|
3952
|
+
pullRequest(repository: SourceName, number: string, call: SourceCall): Promise<Omit<ChangeSetPullRequest, "repository" | "number">>;
|
|
3953
|
+
/** The full commit that `ref` names in `repository`, by its slug, or why the host answers none. */
|
|
3954
|
+
commit(repository: string, ref: string, call: SourceCall): Promise<{
|
|
3955
|
+
sha: string;
|
|
3956
|
+
} | {
|
|
3957
|
+
lookup: CommitLookup.Missing | CommitLookup.Unknown;
|
|
3958
|
+
}>;
|
|
3959
|
+
/** Revokes a token the app minted for this job. Absent where the job's token is its own and ends with the job. */
|
|
3960
|
+
revokeToken?(token: string, fetchImpl: typeof fetch): Promise<void>;
|
|
3961
|
+
}
|
|
3962
|
+
export interface V3RunnerDeps {
|
|
3963
|
+
/** The application origin, which is also the OIDC audience. */
|
|
3964
|
+
origin: string;
|
|
3965
|
+
/** A GitHub Actions OIDC token for the audience. */
|
|
3966
|
+
idToken: (audience: string) => Promise<string>;
|
|
3967
|
+
fetch?: typeof fetch;
|
|
3968
|
+
now?: () => Date;
|
|
3969
|
+
/** Masks a credential in the job log (core.setSecret), and receives each new token. */
|
|
3970
|
+
mask?: (value: string) => void;
|
|
3971
|
+
/** Writes one line to the job log (core.info). */
|
|
3972
|
+
log?: (line: string) => void;
|
|
3973
|
+
/** Pause between retries of a call the app did not answer (default 2 s, then 4 s). */
|
|
3974
|
+
retryDelayMs?: number;
|
|
3975
|
+
/**
|
|
3976
|
+
* The job's own token for its source host (RunnerHost.takeSourceToken): on Azure DevOps, System.AccessToken. The app
|
|
3977
|
+
* gives such a job no token, so the attempt uses this one for its sources.
|
|
3978
|
+
*/
|
|
3979
|
+
sourceToken?: string;
|
|
3980
|
+
}
|
|
3981
|
+
declare enum RunnerMethod {
|
|
3982
|
+
Get = "GET",
|
|
3983
|
+
Post = "POST",
|
|
3984
|
+
Put = "PUT"
|
|
3985
|
+
}
|
|
3986
|
+
/** How a direct REST call to the source host is made: the fetch to use, and the job's host, which makes the call. */
|
|
3987
|
+
export interface SourceRestOptions {
|
|
3988
|
+
fetch?: typeof fetch;
|
|
3989
|
+
host?: Pick<RunnerHost, "pullRequest" | "commit" | "revokeToken" | "cloneUrl" | "gitAuthEnv">;
|
|
3990
|
+
}
|
|
3991
|
+
/** A refusal the app answered, which a retry would only repeat. */
|
|
3992
|
+
export declare class AppRefusal extends Error {
|
|
3993
|
+
readonly status: number;
|
|
3994
|
+
readonly code?: string | undefined;
|
|
3995
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
3996
|
+
}
|
|
3997
|
+
/** The app did not answer on any try: a network error, a timeout, a 5xx or a 429. Trying again later may work. */
|
|
3998
|
+
export declare class AppUnreachable extends Error {
|
|
3999
|
+
}
|
|
4000
|
+
/** One Execution attempt of a Validation Run, bound by the handshake. */
|
|
4001
|
+
export declare class V3Attempt {
|
|
4002
|
+
readonly attemptId: string;
|
|
4003
|
+
readonly attemptNumber: number;
|
|
4004
|
+
readonly deadlineAt: Date;
|
|
4005
|
+
readonly manifest: RunManifestV1;
|
|
4006
|
+
private readonly deps;
|
|
4007
|
+
/** Absent while the app has licensing off: the run then uses the license file. */
|
|
4008
|
+
readonly license?: RunLicense | undefined;
|
|
4009
|
+
/** Who the run was started for. Absent when the app does not know. */
|
|
4010
|
+
readonly requestedBy?: RequestedBy | undefined;
|
|
4011
|
+
/** Whether the run's person may push to every source (SKYR-4882). Absent when the app did not say. */
|
|
4012
|
+
readonly writeAllowed?: boolean | undefined;
|
|
4013
|
+
/** The exact Claude Code version the organization pins (SKYR-5143). Absent: the latest. */
|
|
4014
|
+
readonly claudeCodeVersion?: string | undefined;
|
|
4015
|
+
/**
|
|
4016
|
+
* What an earlier attempt of this scheduled run read of each deployed source, which pins this attempt as a Rerun's
|
|
4017
|
+
* `deployedRevisions` pins it (ADR-0011). Empty when none did, or when the app did not say.
|
|
4018
|
+
*/
|
|
4019
|
+
readonly deployedPins: readonly {
|
|
4020
|
+
repository: SourceRef;
|
|
4021
|
+
revision: string;
|
|
4022
|
+
}[];
|
|
4023
|
+
constructor(attemptId: string, attemptNumber: number, deadlineAt: Date, manifest: RunManifestV1, deps: V3RunnerDeps,
|
|
4024
|
+
/** Absent while the app has licensing off: the run then uses the license file. */
|
|
4025
|
+
license?: RunLicense | undefined,
|
|
4026
|
+
/** Who the run was started for. Absent when the app does not know. */
|
|
4027
|
+
requestedBy?: RequestedBy | undefined,
|
|
4028
|
+
/** Whether the run's person may push to every source (SKYR-4882). Absent when the app did not say. */
|
|
4029
|
+
writeAllowed?: boolean | undefined,
|
|
4030
|
+
/** The exact Claude Code version the organization pins (SKYR-5143). Absent: the latest. */
|
|
4031
|
+
claudeCodeVersion?: string | undefined,
|
|
4032
|
+
/**
|
|
4033
|
+
* What an earlier attempt of this scheduled run read of each deployed source, which pins this attempt as a Rerun's
|
|
4034
|
+
* `deployedRevisions` pins it (ADR-0011). Empty when none did, or when the app did not say.
|
|
4035
|
+
*/
|
|
4036
|
+
deployedPins?: readonly {
|
|
4037
|
+
repository: SourceRef;
|
|
4038
|
+
revision: string;
|
|
4039
|
+
}[]);
|
|
4040
|
+
/**
|
|
4041
|
+
* The run's budget, from now: the time to the attempt deadline, less the post step's reserve. The app fixed the
|
|
4042
|
+
* deadline from the execution timeout it froze, so the `testbotTimeout` input has no say in a V3 run.
|
|
4043
|
+
*/
|
|
4044
|
+
budgetMs(now: Date): number;
|
|
4045
|
+
/** The run's page in the app (skyrampRunPageUrl). */
|
|
4046
|
+
get skyrampRunUrl(): string;
|
|
4047
|
+
/** One call to an attempt route of the app. */
|
|
4048
|
+
send<T>(method: RunnerMethod, route: string, body: unknown): Promise<T>;
|
|
4049
|
+
/** One read of an attempt route that answers bytes (callAppBytes). */
|
|
4050
|
+
readBytes(route: string, maxBytes: number): Promise<Buffer>;
|
|
4051
|
+
/** Every scoped token this attempt received, for scrubbing what it uploads. */
|
|
4052
|
+
readonly issuedTokens: string[];
|
|
4053
|
+
/** Why the app no longer holds this attempt open, once a heartbeat said so. */
|
|
4054
|
+
closure?: AttemptClosure;
|
|
4055
|
+
/** The model provider key the first credentials answer carried, if any. A renewal never changes it. */
|
|
4056
|
+
modelKey?: string;
|
|
4057
|
+
/** The current credentials of each kind, kept and renewed apart. */
|
|
4058
|
+
private readonly credentials;
|
|
4059
|
+
/** The one revocation, which a later caller waits for. Once it started, the attempt mints no more tokens. */
|
|
4060
|
+
private revocation?;
|
|
4061
|
+
/**
|
|
4062
|
+
* A GitHub token scoped to the run's frozen sources. Concurrent callers share one request. It is renewed once less
|
|
4063
|
+
* than ten minutes of it are left: an installation token lives one hour, and a run can last longer. The first answer
|
|
4064
|
+
* also gives the attempt its modelKey.
|
|
4065
|
+
*/
|
|
4066
|
+
token(): Promise<string>;
|
|
4067
|
+
/**
|
|
4068
|
+
* A GitHub token that only reads the run's frozen sources (`contents: read`), whoever started the run, kept and
|
|
4069
|
+
* renewed apart from `token()`. A Test Environment's deployed-revisions.sh runs with it, the scope its setup checked
|
|
4070
|
+
* it with (SKYR-5183). Fails when the app's answer grants anything more: the caller then has no token, never a wider one.
|
|
4071
|
+
* On Azure DevOps the app mints no token, so it is the job's own, as for `token()` and as in the setup's check.
|
|
4072
|
+
*/
|
|
4073
|
+
readOnlyToken(): Promise<string>;
|
|
4074
|
+
private cachedToken;
|
|
4075
|
+
/** The job's own source token, used where the app's answer carries none. */
|
|
4076
|
+
private jobToken;
|
|
4077
|
+
/**
|
|
4078
|
+
* The fetch of a direct REST call to the source host (GitHub, or Azure DevOps): the caller's, else the attempt's
|
|
4079
|
+
* (V3RunnerDeps), else the global one. The attempt's is the hook an eval of the runner fakes the app with, so the eval
|
|
4080
|
+
* records these calls, and a fake token never reaches the host. The action gives neither, and calls the host.
|
|
4081
|
+
*/
|
|
4082
|
+
sourceFetch(options: SourceRestOptions): typeof fetch;
|
|
4083
|
+
/**
|
|
4084
|
+
* Revokes every token this attempt minted, each with its own credentials (DELETE /installation/token), and mints
|
|
4085
|
+
* no more. Otherwise a token that leaked during the run stays usable for up to an hour after the job ends. The
|
|
4086
|
+
* tokens it holds go at once, in parallel, and a token still being minted goes when it lands: a workflow cancel
|
|
4087
|
+
* leaves about 7.5 s before the runner's next signal ends the process. A token GitHub no longer accepts (401) has
|
|
4088
|
+
* expired, and counts as revoked. Never throws: it returns what failed, without the token. A later call waits for
|
|
4089
|
+
* the first, and gets the same answer.
|
|
4090
|
+
*
|
|
4091
|
+
* A direct REST call, like changeSetPullRequests: the main step makes it after the driver is done, with each token's
|
|
4092
|
+
* own credentials, which no RunnerPlatform method takes. It goes through sourceFetch.
|
|
4093
|
+
*/
|
|
4094
|
+
revokeTokens(options?: SourceRestOptions): Promise<string[]>;
|
|
4095
|
+
private revokeIssued;
|
|
4096
|
+
/** Revokes one token; returns why it failed, naming the token by its place, or nothing. */
|
|
4097
|
+
private revokeOne;
|
|
4098
|
+
}
|
|
4099
|
+
/** The handshake. Refuses a manifest whose hash does not match, that names another run, or a source on another provider. */
|
|
4100
|
+
export declare function startV3Attempt(runId: string, host: Pick<RunnerHost, "execution">, deps: V3RunnerDeps): Promise<V3Attempt>;
|
|
4101
|
+
/** The attempt as the app holds it. */
|
|
4102
|
+
export declare function heartbeatV3Attempt(attempt: V3Attempt): Promise<AttemptHeartbeatV1>;
|
|
4103
|
+
/**
|
|
4104
|
+
* Why the app closed the attempt, or null while it holds it open: what a heartbeat said, else one heartbeat now. A
|
|
4105
|
+
* heartbeat the app did not answer says nothing, so the caller goes on; the app still refuses what a closed attempt sends.
|
|
4106
|
+
*/
|
|
4107
|
+
export declare function closedV3Attempt(attempt: V3Attempt, now?: () => Date): Promise<AttemptClosure | null>;
|
|
4108
|
+
/** One frozen source, checked out for this attempt. */
|
|
4109
|
+
export interface CheckedOutSource {
|
|
4110
|
+
repository: SourceIdentity;
|
|
4111
|
+
/** What `git rev-parse HEAD` says after the checkout: the provenance the report sends. */
|
|
4112
|
+
revision: string;
|
|
4113
|
+
path: string;
|
|
4114
|
+
/** `namespace/name`, as the staged report names repositories. */
|
|
4115
|
+
slug: string;
|
|
4116
|
+
}
|
|
4117
|
+
/** Sends the report once. Throws with the refused field named, before the app would refuse it. */
|
|
4118
|
+
export declare function uploadV3Report(attempt: V3Attempt, input: {
|
|
4119
|
+
report: StagedTestbotReport;
|
|
4120
|
+
sources: CheckedOutSource[];
|
|
4121
|
+
/** The run compared with no Confirmed Baseline, though its manifest names one (checkoutSources). */
|
|
4122
|
+
firstQualification?: boolean;
|
|
4123
|
+
/** The working checkout's slug: where a result that names no repository lives. */
|
|
4124
|
+
workingSlug: string;
|
|
4125
|
+
delivery: GeneratedTestDelivery;
|
|
4126
|
+
producer: {
|
|
4127
|
+
testbot: string;
|
|
4128
|
+
mcp: string;
|
|
4129
|
+
};
|
|
4130
|
+
/** Other secret values the run held, such as the credential references' values. */
|
|
4131
|
+
secrets?: readonly string[];
|
|
4132
|
+
/** What the run wrote to GitHub (githubWritesFromOutputs). */
|
|
4133
|
+
githubWrites?: GitHubWrite[];
|
|
4134
|
+
}): Promise<void>;
|
|
4135
|
+
/** Why the attempt ended without a report: a cancellation, or one of the contract's causes. */
|
|
4136
|
+
export type V3EndCause = AttemptEndReason.Cancelled | NoReportCause;
|
|
4137
|
+
/** What the main step learned about the attempt, which the post step turns into the attempt end. */
|
|
4138
|
+
export interface V3AttemptState {
|
|
4139
|
+
attemptId: string;
|
|
4140
|
+
reportUploaded: boolean;
|
|
4141
|
+
/** A `sut_setup` run's SUT recipe reached the app. */
|
|
4142
|
+
recipeUploaded?: boolean;
|
|
4143
|
+
/** A `revision_read` run read every component, and its upload reached the app (SKYR-5225). */
|
|
4144
|
+
revisionsUploaded?: boolean;
|
|
4145
|
+
/** None recorded: the agent stopped without a report for a reason the main step did not see. */
|
|
4146
|
+
cause?: V3EndCause;
|
|
4147
|
+
}
|
|
4148
|
+
/**
|
|
4149
|
+
* The attempt end, sent by the post step. The app derives the outcome from it and from the accepted report; the
|
|
4150
|
+
* `outcome` it answers is the app's value, only logged here, so it stays the app's string rather than a runner enum.
|
|
4151
|
+
*/
|
|
4152
|
+
export declare function endV3Attempt(state: V3AttemptState, deps: V3RunnerDeps): Promise<{
|
|
4153
|
+
outcome: string | null;
|
|
4154
|
+
}>;
|
|
4155
|
+
|
|
4156
|
+
declare namespace z {
|
|
4157
|
+
export { AnyZodObject, AnyZodTuple, ArrayCardinality, ArrayKeys, AssertArray, AsyncParseReturnType, BRAND, CatchallInput, CatchallOutput, CustomErrorParams, DIRTY, DenormalizedError, EMPTY_PATH, Effect, EnumLike, EnumValues, ErrorMapCtx, FilterEnum, INVALID, Indices, InnerTypeOfFunction, InputTypeOfTuple, InputTypeOfTupleWithRest, IpVersion, IssueData, KeySchema, NEVER, OK, ObjectPair, OuterTypeOfFunction, OutputTypeOfTuple, OutputTypeOfTupleWithRest, ParseContext, ParseInput, ParseParams, ParsePath, ParsePathComponent, ParseResult, ParseReturnType, ParseStatus, PassthroughType, PreprocessEffect, Primitive, ProcessedCreateParams, RawCreateParams, RecordType, Refinement, RefinementCtx, RefinementEffect, SafeParseError, SafeParseReturnType, SafeParseSuccess, Scalars, SomeZodObject, StringValidation, SuperRefinement, SyncParseReturnType, TransformEffect, TypeOf, TypeOf as infer, UnknownKeysParam, Values, Writeable, ZodAny, ZodAnyDef, ZodArray, ZodArrayDef, ZodBigInt, ZodBigIntCheck, ZodBigIntDef, ZodBoolean, ZodBooleanDef, ZodBranded, ZodBrandedDef, ZodCatch, ZodCatchDef, ZodCustomIssue, ZodDate, ZodDateCheck, ZodDateDef, ZodDefault, ZodDefaultDef, ZodDiscriminatedUnion, ZodDiscriminatedUnionDef, ZodDiscriminatedUnionOption, ZodEffects, ZodEffects as ZodTransformer, ZodEffectsDef, ZodEnum, ZodEnumDef, ZodError, ZodErrorMap, ZodFirstPartySchemaTypes, ZodFirstPartyTypeKind, ZodFormattedError, ZodFunction, ZodFunctionDef, ZodIntersection, ZodIntersectionDef, ZodInvalidArgumentsIssue, ZodInvalidDateIssue, ZodInvalidEnumValueIssue, ZodInvalidIntersectionTypesIssue, ZodInvalidLiteralIssue, ZodInvalidReturnTypeIssue, ZodInvalidStringIssue, ZodInvalidTypeIssue, ZodInvalidUnionDiscriminatorIssue, ZodInvalidUnionIssue, ZodIssue, ZodIssueBase, ZodIssueCode, ZodIssueOptionalMessage, ZodLazy, ZodLazyDef, ZodLiteral, ZodLiteralDef, ZodMap, ZodMapDef, ZodNaN, ZodNaNDef, ZodNativeEnum, ZodNativeEnumDef, ZodNever, ZodNeverDef, ZodNonEmptyArray, ZodNotFiniteIssue, ZodNotMultipleOfIssue, ZodNull, ZodNullDef, ZodNullable, ZodNullableDef, ZodNullableType, ZodNumber, ZodNumberCheck, ZodNumberDef, ZodObject, ZodObjectDef, ZodOptional, ZodOptionalDef, ZodOptionalType, ZodParsedType, ZodPipeline, ZodPipelineDef, ZodPromise, ZodPromiseDef, ZodRawShape, ZodReadonly, ZodReadonlyDef, ZodRecord, ZodRecordDef, ZodSet, ZodSetDef, ZodString, ZodStringCheck, ZodStringDef, ZodSymbol, ZodSymbolDef, ZodTooBigIssue, ZodTooSmallIssue, ZodTuple, ZodTupleDef, ZodTupleItems, ZodType, ZodType as Schema, ZodType as ZodSchema, ZodTypeAny, ZodTypeDef, ZodUndefined, ZodUndefinedDef, ZodUnion, ZodUnionDef, ZodUnionOptions, ZodUnknown, ZodUnknownDef, ZodUnrecognizedKeysIssue, ZodVoid, ZodVoidDef, addIssueToContext, anyType as any, arrayOutputType, arrayType as array, baseObjectInputType, baseObjectOutputType, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, deoptional, discriminatedUnionType as discriminatedUnion, effectsType as effect, effectsType as transformer, enumType as enum, errorMap as defaultErrorMap, functionType as function, getErrorMap, getParsedType, inferFlattenedErrors, inferFormattedError, input, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, mergeTypes, nanType as nan, nativeEnumType as nativeEnum, neverType as never, noUnrecognized, nullType as null, nullableType as nullable, numberType as number, objectInputType, objectOutputType, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, output, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setErrorMap, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, tupleType as tuple, typeToFlattenedError, typecast, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void };
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
export {};
|