@trigger.dev/core 3.0.0-beta.3 → 3.0.0-beta.30
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/catalog-KbyTBoap.d.ts +2496 -0
- package/dist/catalog-ck7x04PV.d.mts +2496 -0
- package/dist/manager-WNMVbgHf.d.mts +1158 -0
- package/dist/manager-WNMVbgHf.d.ts +1158 -0
- package/dist/messages-vq7Bk4Ap.d.mts +12838 -0
- package/dist/messages-vq7Bk4Ap.d.ts +12838 -0
- package/dist/v3/dev/index.d.mts +28 -0
- package/dist/v3/dev/index.d.ts +28 -0
- package/dist/v3/dev/index.js +93 -0
- package/dist/v3/dev/index.js.map +1 -0
- package/dist/v3/dev/index.mjs +91 -0
- package/dist/v3/dev/index.mjs.map +1 -0
- package/dist/v3/index.d.mts +850 -16919
- package/dist/v3/index.d.ts +850 -16919
- package/dist/v3/index.js +1676 -2763
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/index.mjs +1681 -2767
- package/dist/v3/index.mjs.map +1 -1
- package/dist/v3/otel/index.js +83 -45
- package/dist/v3/otel/index.js.map +1 -1
- package/dist/v3/otel/index.mjs +83 -45
- package/dist/v3/otel/index.mjs.map +1 -1
- package/dist/v3/prod/index.d.mts +45 -0
- package/dist/v3/prod/index.d.ts +45 -0
- package/dist/v3/prod/index.js +229 -0
- package/dist/v3/prod/index.js.map +1 -0
- package/dist/v3/prod/index.mjs +227 -0
- package/dist/v3/prod/index.mjs.map +1 -0
- package/dist/v3/utils/structuredLogger.d.mts +31 -0
- package/dist/v3/utils/structuredLogger.d.ts +31 -0
- package/dist/v3/utils/structuredLogger.js +88 -0
- package/dist/v3/utils/structuredLogger.js.map +1 -0
- package/dist/v3/utils/structuredLogger.mjs +86 -0
- package/dist/v3/utils/structuredLogger.mjs.map +1 -0
- package/dist/v3/workers/index.d.mts +95 -0
- package/dist/v3/workers/index.d.ts +95 -0
- package/dist/v3/workers/index.js +2631 -0
- package/dist/v3/workers/index.js.map +1 -0
- package/dist/v3/workers/index.mjs +2615 -0
- package/dist/v3/workers/index.mjs.map +1 -0
- package/dist/v3/zodIpc.d.mts +32 -0
- package/dist/v3/zodIpc.d.ts +32 -0
- package/dist/v3/zodIpc.js +268 -0
- package/dist/v3/zodIpc.js.map +1 -0
- package/dist/v3/zodIpc.mjs +266 -0
- package/dist/v3/zodIpc.mjs.map +1 -0
- package/dist/v3/zodMessageHandler.d.mts +69 -0
- package/dist/v3/zodMessageHandler.d.ts +69 -0
- package/dist/v3/zodMessageHandler.js +168 -0
- package/dist/v3/zodMessageHandler.js.map +1 -0
- package/dist/v3/zodMessageHandler.mjs +163 -0
- package/dist/v3/zodMessageHandler.mjs.map +1 -0
- package/dist/v3/zodNamespace.d.mts +3663 -0
- package/dist/v3/zodNamespace.d.ts +3663 -0
- package/dist/v3/zodNamespace.js +356 -0
- package/dist/v3/zodNamespace.js.map +1 -0
- package/dist/v3/zodNamespace.mjs +354 -0
- package/dist/v3/zodNamespace.mjs.map +1 -0
- package/dist/v3/zodSocket.d.mts +88 -0
- package/dist/v3/zodSocket.d.ts +88 -0
- package/dist/v3/zodSocket.js +309 -0
- package/dist/v3/zodSocket.js.map +1 -0
- package/dist/v3/zodSocket.mjs +305 -0
- package/dist/v3/zodSocket.mjs.map +1 -0
- package/package.json +72 -7
|
@@ -0,0 +1,2496 @@
|
|
|
1
|
+
import { Context as Context$1, Span, SpanOptions, Tracer } from '@opentelemetry/api';
|
|
2
|
+
import { Logger } from '@opentelemetry/api-logs';
|
|
3
|
+
import { InstrumentationOption } from '@opentelemetry/instrumentation';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { b as TaskRunContext } from './manager-WNMVbgHf.mjs';
|
|
6
|
+
|
|
7
|
+
type RequireKeys<T extends object, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K> extends infer O ? {
|
|
8
|
+
[P in keyof O]: O[P];
|
|
9
|
+
} : never;
|
|
10
|
+
type Prettify<T> = {
|
|
11
|
+
[K in keyof T]: T[K];
|
|
12
|
+
} & {};
|
|
13
|
+
|
|
14
|
+
type TriggerTracerConfig = {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
} | {
|
|
18
|
+
tracer: Tracer;
|
|
19
|
+
logger: Logger;
|
|
20
|
+
};
|
|
21
|
+
declare class TriggerTracer {
|
|
22
|
+
private readonly _config;
|
|
23
|
+
constructor(_config: TriggerTracerConfig);
|
|
24
|
+
private _tracer;
|
|
25
|
+
private get tracer();
|
|
26
|
+
private _logger;
|
|
27
|
+
private get logger();
|
|
28
|
+
extractContext(traceContext?: Record<string, unknown>): Context$1;
|
|
29
|
+
startActiveSpan<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions, ctx?: Context$1): Promise<T>;
|
|
30
|
+
startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
|
|
34
|
+
declare const logLevels: Array<LogLevel>;
|
|
35
|
+
type TaskLoggerConfig = {
|
|
36
|
+
logger: Logger;
|
|
37
|
+
tracer: TriggerTracer;
|
|
38
|
+
level: LogLevel;
|
|
39
|
+
};
|
|
40
|
+
interface TaskLogger {
|
|
41
|
+
debug(message: string, properties?: Record<string, unknown>): void;
|
|
42
|
+
log(message: string, properties?: Record<string, unknown>): void;
|
|
43
|
+
info(message: string, properties?: Record<string, unknown>): void;
|
|
44
|
+
warn(message: string, properties?: Record<string, unknown>): void;
|
|
45
|
+
error(message: string, properties?: Record<string, unknown>): void;
|
|
46
|
+
trace<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions): Promise<T>;
|
|
47
|
+
}
|
|
48
|
+
declare class OtelTaskLogger implements TaskLogger {
|
|
49
|
+
#private;
|
|
50
|
+
private readonly _config;
|
|
51
|
+
private readonly _level;
|
|
52
|
+
constructor(_config: TaskLoggerConfig);
|
|
53
|
+
debug(message: string, properties?: Record<string, unknown>): void;
|
|
54
|
+
log(message: string, properties?: Record<string, unknown>): void;
|
|
55
|
+
info(message: string, properties?: Record<string, unknown>): void;
|
|
56
|
+
warn(message: string, properties?: Record<string, unknown>): void;
|
|
57
|
+
error(message: string, properties?: Record<string, unknown>): void;
|
|
58
|
+
trace<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions): Promise<T>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface ProjectConfig {
|
|
62
|
+
project: string;
|
|
63
|
+
triggerDirectories?: string | string[];
|
|
64
|
+
triggerUrl?: string;
|
|
65
|
+
retries?: {
|
|
66
|
+
enabledInDev?: boolean;
|
|
67
|
+
default?: RetryOptions;
|
|
68
|
+
};
|
|
69
|
+
additionalPackages?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* List of additional files to include in your trigger.dev bundle. e.g. ["./prisma/schema.prisma"]
|
|
72
|
+
*
|
|
73
|
+
* Supports glob patterns.
|
|
74
|
+
*
|
|
75
|
+
* Note: The path separator for glob patterns is `/`, even on Windows!
|
|
76
|
+
*/
|
|
77
|
+
additionalFiles?: string[];
|
|
78
|
+
/**
|
|
79
|
+
* List of patterns that determine if a module is included in your trigger.dev bundle. This is needed when consuming ESM only packages, since the trigger.dev bundle is currently built as a CJS module.
|
|
80
|
+
*/
|
|
81
|
+
dependenciesToBundle?: Array<string | RegExp>;
|
|
82
|
+
/**
|
|
83
|
+
* The path to your project's tsconfig.json file. Will use tsconfig.json in the project directory if not provided.
|
|
84
|
+
*/
|
|
85
|
+
tsconfigPath?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The OpenTelemetry instrumentations to enable
|
|
88
|
+
*/
|
|
89
|
+
instrumentations?: InstrumentationOption[];
|
|
90
|
+
/**
|
|
91
|
+
* Set the log level for the logger. Defaults to "info", so you will see "log", "info", "warn", and "error" messages, but not "debug" messages.
|
|
92
|
+
*
|
|
93
|
+
* We automatically set the logLevel to "debug" during test runs
|
|
94
|
+
*
|
|
95
|
+
* @default "info"
|
|
96
|
+
*/
|
|
97
|
+
logLevel?: LogLevel;
|
|
98
|
+
/**
|
|
99
|
+
* Enable console logging while running the dev CLI. This will print out logs from console.log, console.warn, and console.error. By default all logs are sent to the trigger.dev backend, and not logged to the console.
|
|
100
|
+
*/
|
|
101
|
+
enableConsoleLogging?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Run before a task is executed, for all tasks. This is useful for setting up any global state that is needed for all tasks.
|
|
104
|
+
*/
|
|
105
|
+
init?: (payload: unknown, params: InitFnParams) => void | Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* onSuccess is called after the run function has successfully completed.
|
|
108
|
+
*/
|
|
109
|
+
onSuccess?: (payload: unknown, output: unknown, params: SuccessFnParams<any>) => Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* onFailure is called after a task run has failed (meaning the run function threw an error and won't be retried anymore)
|
|
112
|
+
*/
|
|
113
|
+
onFailure?: (payload: unknown, error: unknown, params: FailureFnParams<any>) => Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* onStart is called the first time a task is executed in a run (not before every retry)
|
|
116
|
+
*/
|
|
117
|
+
onStart?: (payload: unknown, params: StartFnParams) => Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* postInstall will run during the deploy build step, after all the dependencies have been installed.
|
|
120
|
+
*
|
|
121
|
+
* @example "prisma generate"
|
|
122
|
+
*/
|
|
123
|
+
postInstall?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
type InitOutput = Record<string, any> | void | undefined;
|
|
127
|
+
type RunFnParams<TInitOutput extends InitOutput> = Prettify<{
|
|
128
|
+
/** Metadata about the task, run, attempt, queue, environment, organization, project and batch. */
|
|
129
|
+
ctx: Context;
|
|
130
|
+
/** If you use the `init` function, this will be whatever you returned. */
|
|
131
|
+
init?: TInitOutput;
|
|
132
|
+
}>;
|
|
133
|
+
type MiddlewareFnParams = Prettify<{
|
|
134
|
+
ctx: Context;
|
|
135
|
+
next: () => Promise<void>;
|
|
136
|
+
}>;
|
|
137
|
+
type InitFnParams = Prettify<{
|
|
138
|
+
ctx: Context;
|
|
139
|
+
}>;
|
|
140
|
+
type StartFnParams = Prettify<{
|
|
141
|
+
ctx: Context;
|
|
142
|
+
}>;
|
|
143
|
+
type Context = TaskRunContext;
|
|
144
|
+
type SuccessFnParams<TInitOutput extends InitOutput> = RunFnParams<TInitOutput>;
|
|
145
|
+
type FailureFnParams<TInitOutput extends InitOutput> = RunFnParams<TInitOutput>;
|
|
146
|
+
type HandleErrorFnParams<TInitOutput extends InitOutput> = RunFnParams<TInitOutput> & Prettify<{
|
|
147
|
+
retry?: RetryOptions;
|
|
148
|
+
retryAt?: Date;
|
|
149
|
+
retryDelayInMs?: number;
|
|
150
|
+
}>;
|
|
151
|
+
type HandleErrorModificationOptions = {
|
|
152
|
+
skipRetrying?: boolean | undefined;
|
|
153
|
+
retryAt?: Date | undefined;
|
|
154
|
+
retryDelayInMs?: number | undefined;
|
|
155
|
+
retry?: RetryOptions | undefined;
|
|
156
|
+
error?: unknown;
|
|
157
|
+
};
|
|
158
|
+
type HandleErrorResult = undefined | void | HandleErrorModificationOptions | Promise<undefined | void | HandleErrorModificationOptions>;
|
|
159
|
+
type HandleErrorArgs = {
|
|
160
|
+
ctx: Context;
|
|
161
|
+
retry?: RetryOptions;
|
|
162
|
+
retryAt?: Date;
|
|
163
|
+
retryDelayInMs?: number;
|
|
164
|
+
};
|
|
165
|
+
type HandleErrorFunction = (payload: any, error: unknown, params: HandleErrorArgs) => HandleErrorResult;
|
|
166
|
+
type TaskMetadataWithFunctions = TaskMetadata & {
|
|
167
|
+
fns: {
|
|
168
|
+
run: (payload: any, params: RunFnParams<any>) => Promise<any>;
|
|
169
|
+
init?: (payload: any, params: InitFnParams) => Promise<InitOutput>;
|
|
170
|
+
cleanup?: (payload: any, params: RunFnParams<any>) => Promise<void>;
|
|
171
|
+
middleware?: (payload: any, params: MiddlewareFnParams) => Promise<void>;
|
|
172
|
+
handleError?: (payload: any, error: unknown, params: HandleErrorFnParams<any>) => HandleErrorResult;
|
|
173
|
+
onSuccess?: (payload: any, output: any, params: SuccessFnParams<any>) => Promise<void>;
|
|
174
|
+
onFailure?: (payload: any, error: unknown, params: FailureFnParams<any>) => Promise<void>;
|
|
175
|
+
onStart?: (payload: any, params: StartFnParams) => Promise<void>;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
declare const EnvironmentType: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
|
|
180
|
+
type EnvironmentType = z.infer<typeof EnvironmentType>;
|
|
181
|
+
declare const MachineCpu: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>]>>;
|
|
182
|
+
type MachineCpu = z.infer<typeof MachineCpu>;
|
|
183
|
+
declare const MachineMemory: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>;
|
|
184
|
+
type MachineMemory = z.infer<typeof MachineMemory>;
|
|
185
|
+
declare const Machine: z.ZodObject<{
|
|
186
|
+
version: z.ZodDefault<z.ZodLiteral<"v1">>;
|
|
187
|
+
cpu: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>]>>;
|
|
188
|
+
memory: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
version: "v1";
|
|
191
|
+
cpu: 2 | 1 | 4 | 0.25 | 0.5;
|
|
192
|
+
memory: 2 | 1 | 4 | 0.25 | 0.5 | 8;
|
|
193
|
+
}, {
|
|
194
|
+
version?: "v1" | undefined;
|
|
195
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
196
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
197
|
+
}>;
|
|
198
|
+
type Machine = z.infer<typeof Machine>;
|
|
199
|
+
declare const TaskRunExecutionPayload: z.ZodObject<{
|
|
200
|
+
execution: z.ZodObject<{
|
|
201
|
+
task: z.ZodObject<{
|
|
202
|
+
id: z.ZodString;
|
|
203
|
+
filePath: z.ZodString;
|
|
204
|
+
exportName: z.ZodString;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
id: string;
|
|
207
|
+
filePath: string;
|
|
208
|
+
exportName: string;
|
|
209
|
+
}, {
|
|
210
|
+
id: string;
|
|
211
|
+
filePath: string;
|
|
212
|
+
exportName: string;
|
|
213
|
+
}>;
|
|
214
|
+
attempt: z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
number: z.ZodNumber;
|
|
217
|
+
startedAt: z.ZodDate;
|
|
218
|
+
backgroundWorkerId: z.ZodString;
|
|
219
|
+
backgroundWorkerTaskId: z.ZodString;
|
|
220
|
+
status: z.ZodString;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
number: number;
|
|
223
|
+
status: string;
|
|
224
|
+
id: string;
|
|
225
|
+
startedAt: Date;
|
|
226
|
+
backgroundWorkerId: string;
|
|
227
|
+
backgroundWorkerTaskId: string;
|
|
228
|
+
}, {
|
|
229
|
+
number: number;
|
|
230
|
+
status: string;
|
|
231
|
+
id: string;
|
|
232
|
+
startedAt: Date;
|
|
233
|
+
backgroundWorkerId: string;
|
|
234
|
+
backgroundWorkerTaskId: string;
|
|
235
|
+
}>;
|
|
236
|
+
run: z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
payload: z.ZodString;
|
|
239
|
+
payloadType: z.ZodString;
|
|
240
|
+
context: z.ZodAny;
|
|
241
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
242
|
+
isTest: z.ZodDefault<z.ZodBoolean>;
|
|
243
|
+
createdAt: z.ZodDate;
|
|
244
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
id: string;
|
|
247
|
+
payload: string;
|
|
248
|
+
payloadType: string;
|
|
249
|
+
tags: string[];
|
|
250
|
+
isTest: boolean;
|
|
251
|
+
createdAt: Date;
|
|
252
|
+
context?: any;
|
|
253
|
+
idempotencyKey?: string | undefined;
|
|
254
|
+
}, {
|
|
255
|
+
id: string;
|
|
256
|
+
payload: string;
|
|
257
|
+
payloadType: string;
|
|
258
|
+
tags: string[];
|
|
259
|
+
createdAt: Date;
|
|
260
|
+
context?: any;
|
|
261
|
+
isTest?: boolean | undefined;
|
|
262
|
+
idempotencyKey?: string | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
queue: z.ZodObject<{
|
|
265
|
+
id: z.ZodString;
|
|
266
|
+
name: z.ZodString;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
}, {
|
|
271
|
+
id: string;
|
|
272
|
+
name: string;
|
|
273
|
+
}>;
|
|
274
|
+
environment: z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
slug: z.ZodString;
|
|
277
|
+
type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
|
|
278
|
+
}, "strip", z.ZodTypeAny, {
|
|
279
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
280
|
+
id: string;
|
|
281
|
+
slug: string;
|
|
282
|
+
}, {
|
|
283
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
284
|
+
id: string;
|
|
285
|
+
slug: string;
|
|
286
|
+
}>;
|
|
287
|
+
organization: z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
slug: z.ZodString;
|
|
290
|
+
name: z.ZodString;
|
|
291
|
+
}, "strip", z.ZodTypeAny, {
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
slug: string;
|
|
295
|
+
}, {
|
|
296
|
+
id: string;
|
|
297
|
+
name: string;
|
|
298
|
+
slug: string;
|
|
299
|
+
}>;
|
|
300
|
+
project: z.ZodObject<{
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
ref: z.ZodString;
|
|
303
|
+
slug: z.ZodString;
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
}, "strip", z.ZodTypeAny, {
|
|
306
|
+
id: string;
|
|
307
|
+
name: string;
|
|
308
|
+
slug: string;
|
|
309
|
+
ref: string;
|
|
310
|
+
}, {
|
|
311
|
+
id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
slug: string;
|
|
314
|
+
ref: string;
|
|
315
|
+
}>;
|
|
316
|
+
batch: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
id: z.ZodString;
|
|
318
|
+
}, "strip", z.ZodTypeAny, {
|
|
319
|
+
id: string;
|
|
320
|
+
}, {
|
|
321
|
+
id: string;
|
|
322
|
+
}>>;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
task: {
|
|
325
|
+
id: string;
|
|
326
|
+
filePath: string;
|
|
327
|
+
exportName: string;
|
|
328
|
+
};
|
|
329
|
+
attempt: {
|
|
330
|
+
number: number;
|
|
331
|
+
status: string;
|
|
332
|
+
id: string;
|
|
333
|
+
startedAt: Date;
|
|
334
|
+
backgroundWorkerId: string;
|
|
335
|
+
backgroundWorkerTaskId: string;
|
|
336
|
+
};
|
|
337
|
+
run: {
|
|
338
|
+
id: string;
|
|
339
|
+
payload: string;
|
|
340
|
+
payloadType: string;
|
|
341
|
+
tags: string[];
|
|
342
|
+
isTest: boolean;
|
|
343
|
+
createdAt: Date;
|
|
344
|
+
context?: any;
|
|
345
|
+
idempotencyKey?: string | undefined;
|
|
346
|
+
};
|
|
347
|
+
queue: {
|
|
348
|
+
id: string;
|
|
349
|
+
name: string;
|
|
350
|
+
};
|
|
351
|
+
environment: {
|
|
352
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
353
|
+
id: string;
|
|
354
|
+
slug: string;
|
|
355
|
+
};
|
|
356
|
+
organization: {
|
|
357
|
+
id: string;
|
|
358
|
+
name: string;
|
|
359
|
+
slug: string;
|
|
360
|
+
};
|
|
361
|
+
project: {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
slug: string;
|
|
365
|
+
ref: string;
|
|
366
|
+
};
|
|
367
|
+
batch?: {
|
|
368
|
+
id: string;
|
|
369
|
+
} | undefined;
|
|
370
|
+
}, {
|
|
371
|
+
task: {
|
|
372
|
+
id: string;
|
|
373
|
+
filePath: string;
|
|
374
|
+
exportName: string;
|
|
375
|
+
};
|
|
376
|
+
attempt: {
|
|
377
|
+
number: number;
|
|
378
|
+
status: string;
|
|
379
|
+
id: string;
|
|
380
|
+
startedAt: Date;
|
|
381
|
+
backgroundWorkerId: string;
|
|
382
|
+
backgroundWorkerTaskId: string;
|
|
383
|
+
};
|
|
384
|
+
run: {
|
|
385
|
+
id: string;
|
|
386
|
+
payload: string;
|
|
387
|
+
payloadType: string;
|
|
388
|
+
tags: string[];
|
|
389
|
+
createdAt: Date;
|
|
390
|
+
context?: any;
|
|
391
|
+
isTest?: boolean | undefined;
|
|
392
|
+
idempotencyKey?: string | undefined;
|
|
393
|
+
};
|
|
394
|
+
queue: {
|
|
395
|
+
id: string;
|
|
396
|
+
name: string;
|
|
397
|
+
};
|
|
398
|
+
environment: {
|
|
399
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
400
|
+
id: string;
|
|
401
|
+
slug: string;
|
|
402
|
+
};
|
|
403
|
+
organization: {
|
|
404
|
+
id: string;
|
|
405
|
+
name: string;
|
|
406
|
+
slug: string;
|
|
407
|
+
};
|
|
408
|
+
project: {
|
|
409
|
+
id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
slug: string;
|
|
412
|
+
ref: string;
|
|
413
|
+
};
|
|
414
|
+
batch?: {
|
|
415
|
+
id: string;
|
|
416
|
+
} | undefined;
|
|
417
|
+
}>;
|
|
418
|
+
traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
419
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
execution: {
|
|
422
|
+
task: {
|
|
423
|
+
id: string;
|
|
424
|
+
filePath: string;
|
|
425
|
+
exportName: string;
|
|
426
|
+
};
|
|
427
|
+
attempt: {
|
|
428
|
+
number: number;
|
|
429
|
+
status: string;
|
|
430
|
+
id: string;
|
|
431
|
+
startedAt: Date;
|
|
432
|
+
backgroundWorkerId: string;
|
|
433
|
+
backgroundWorkerTaskId: string;
|
|
434
|
+
};
|
|
435
|
+
run: {
|
|
436
|
+
id: string;
|
|
437
|
+
payload: string;
|
|
438
|
+
payloadType: string;
|
|
439
|
+
tags: string[];
|
|
440
|
+
isTest: boolean;
|
|
441
|
+
createdAt: Date;
|
|
442
|
+
context?: any;
|
|
443
|
+
idempotencyKey?: string | undefined;
|
|
444
|
+
};
|
|
445
|
+
queue: {
|
|
446
|
+
id: string;
|
|
447
|
+
name: string;
|
|
448
|
+
};
|
|
449
|
+
environment: {
|
|
450
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
451
|
+
id: string;
|
|
452
|
+
slug: string;
|
|
453
|
+
};
|
|
454
|
+
organization: {
|
|
455
|
+
id: string;
|
|
456
|
+
name: string;
|
|
457
|
+
slug: string;
|
|
458
|
+
};
|
|
459
|
+
project: {
|
|
460
|
+
id: string;
|
|
461
|
+
name: string;
|
|
462
|
+
slug: string;
|
|
463
|
+
ref: string;
|
|
464
|
+
};
|
|
465
|
+
batch?: {
|
|
466
|
+
id: string;
|
|
467
|
+
} | undefined;
|
|
468
|
+
};
|
|
469
|
+
traceContext: Record<string, unknown>;
|
|
470
|
+
environment?: Record<string, string> | undefined;
|
|
471
|
+
}, {
|
|
472
|
+
execution: {
|
|
473
|
+
task: {
|
|
474
|
+
id: string;
|
|
475
|
+
filePath: string;
|
|
476
|
+
exportName: string;
|
|
477
|
+
};
|
|
478
|
+
attempt: {
|
|
479
|
+
number: number;
|
|
480
|
+
status: string;
|
|
481
|
+
id: string;
|
|
482
|
+
startedAt: Date;
|
|
483
|
+
backgroundWorkerId: string;
|
|
484
|
+
backgroundWorkerTaskId: string;
|
|
485
|
+
};
|
|
486
|
+
run: {
|
|
487
|
+
id: string;
|
|
488
|
+
payload: string;
|
|
489
|
+
payloadType: string;
|
|
490
|
+
tags: string[];
|
|
491
|
+
createdAt: Date;
|
|
492
|
+
context?: any;
|
|
493
|
+
isTest?: boolean | undefined;
|
|
494
|
+
idempotencyKey?: string | undefined;
|
|
495
|
+
};
|
|
496
|
+
queue: {
|
|
497
|
+
id: string;
|
|
498
|
+
name: string;
|
|
499
|
+
};
|
|
500
|
+
environment: {
|
|
501
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
502
|
+
id: string;
|
|
503
|
+
slug: string;
|
|
504
|
+
};
|
|
505
|
+
organization: {
|
|
506
|
+
id: string;
|
|
507
|
+
name: string;
|
|
508
|
+
slug: string;
|
|
509
|
+
};
|
|
510
|
+
project: {
|
|
511
|
+
id: string;
|
|
512
|
+
name: string;
|
|
513
|
+
slug: string;
|
|
514
|
+
ref: string;
|
|
515
|
+
};
|
|
516
|
+
batch?: {
|
|
517
|
+
id: string;
|
|
518
|
+
} | undefined;
|
|
519
|
+
};
|
|
520
|
+
traceContext: Record<string, unknown>;
|
|
521
|
+
environment?: Record<string, string> | undefined;
|
|
522
|
+
}>;
|
|
523
|
+
type TaskRunExecutionPayload = z.infer<typeof TaskRunExecutionPayload>;
|
|
524
|
+
declare const ProdTaskRunExecution: z.ZodObject<{
|
|
525
|
+
task: z.ZodObject<{
|
|
526
|
+
id: z.ZodString;
|
|
527
|
+
filePath: z.ZodString;
|
|
528
|
+
exportName: z.ZodString;
|
|
529
|
+
}, "strip", z.ZodTypeAny, {
|
|
530
|
+
id: string;
|
|
531
|
+
filePath: string;
|
|
532
|
+
exportName: string;
|
|
533
|
+
}, {
|
|
534
|
+
id: string;
|
|
535
|
+
filePath: string;
|
|
536
|
+
exportName: string;
|
|
537
|
+
}>;
|
|
538
|
+
attempt: z.ZodObject<{
|
|
539
|
+
id: z.ZodString;
|
|
540
|
+
number: z.ZodNumber;
|
|
541
|
+
startedAt: z.ZodDate;
|
|
542
|
+
backgroundWorkerId: z.ZodString;
|
|
543
|
+
backgroundWorkerTaskId: z.ZodString;
|
|
544
|
+
status: z.ZodString;
|
|
545
|
+
}, "strip", z.ZodTypeAny, {
|
|
546
|
+
number: number;
|
|
547
|
+
status: string;
|
|
548
|
+
id: string;
|
|
549
|
+
startedAt: Date;
|
|
550
|
+
backgroundWorkerId: string;
|
|
551
|
+
backgroundWorkerTaskId: string;
|
|
552
|
+
}, {
|
|
553
|
+
number: number;
|
|
554
|
+
status: string;
|
|
555
|
+
id: string;
|
|
556
|
+
startedAt: Date;
|
|
557
|
+
backgroundWorkerId: string;
|
|
558
|
+
backgroundWorkerTaskId: string;
|
|
559
|
+
}>;
|
|
560
|
+
run: z.ZodObject<{
|
|
561
|
+
id: z.ZodString;
|
|
562
|
+
payload: z.ZodString;
|
|
563
|
+
payloadType: z.ZodString;
|
|
564
|
+
context: z.ZodAny;
|
|
565
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
566
|
+
isTest: z.ZodDefault<z.ZodBoolean>;
|
|
567
|
+
createdAt: z.ZodDate;
|
|
568
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
569
|
+
}, "strip", z.ZodTypeAny, {
|
|
570
|
+
id: string;
|
|
571
|
+
payload: string;
|
|
572
|
+
payloadType: string;
|
|
573
|
+
tags: string[];
|
|
574
|
+
isTest: boolean;
|
|
575
|
+
createdAt: Date;
|
|
576
|
+
context?: any;
|
|
577
|
+
idempotencyKey?: string | undefined;
|
|
578
|
+
}, {
|
|
579
|
+
id: string;
|
|
580
|
+
payload: string;
|
|
581
|
+
payloadType: string;
|
|
582
|
+
tags: string[];
|
|
583
|
+
createdAt: Date;
|
|
584
|
+
context?: any;
|
|
585
|
+
isTest?: boolean | undefined;
|
|
586
|
+
idempotencyKey?: string | undefined;
|
|
587
|
+
}>;
|
|
588
|
+
queue: z.ZodObject<{
|
|
589
|
+
id: z.ZodString;
|
|
590
|
+
name: z.ZodString;
|
|
591
|
+
}, "strip", z.ZodTypeAny, {
|
|
592
|
+
id: string;
|
|
593
|
+
name: string;
|
|
594
|
+
}, {
|
|
595
|
+
id: string;
|
|
596
|
+
name: string;
|
|
597
|
+
}>;
|
|
598
|
+
environment: z.ZodObject<{
|
|
599
|
+
id: z.ZodString;
|
|
600
|
+
slug: z.ZodString;
|
|
601
|
+
type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
|
|
602
|
+
}, "strip", z.ZodTypeAny, {
|
|
603
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
604
|
+
id: string;
|
|
605
|
+
slug: string;
|
|
606
|
+
}, {
|
|
607
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
608
|
+
id: string;
|
|
609
|
+
slug: string;
|
|
610
|
+
}>;
|
|
611
|
+
organization: z.ZodObject<{
|
|
612
|
+
id: z.ZodString;
|
|
613
|
+
slug: z.ZodString;
|
|
614
|
+
name: z.ZodString;
|
|
615
|
+
}, "strip", z.ZodTypeAny, {
|
|
616
|
+
id: string;
|
|
617
|
+
name: string;
|
|
618
|
+
slug: string;
|
|
619
|
+
}, {
|
|
620
|
+
id: string;
|
|
621
|
+
name: string;
|
|
622
|
+
slug: string;
|
|
623
|
+
}>;
|
|
624
|
+
project: z.ZodObject<{
|
|
625
|
+
id: z.ZodString;
|
|
626
|
+
ref: z.ZodString;
|
|
627
|
+
slug: z.ZodString;
|
|
628
|
+
name: z.ZodString;
|
|
629
|
+
}, "strip", z.ZodTypeAny, {
|
|
630
|
+
id: string;
|
|
631
|
+
name: string;
|
|
632
|
+
slug: string;
|
|
633
|
+
ref: string;
|
|
634
|
+
}, {
|
|
635
|
+
id: string;
|
|
636
|
+
name: string;
|
|
637
|
+
slug: string;
|
|
638
|
+
ref: string;
|
|
639
|
+
}>;
|
|
640
|
+
batch: z.ZodOptional<z.ZodObject<{
|
|
641
|
+
id: z.ZodString;
|
|
642
|
+
}, "strip", z.ZodTypeAny, {
|
|
643
|
+
id: string;
|
|
644
|
+
}, {
|
|
645
|
+
id: string;
|
|
646
|
+
}>>;
|
|
647
|
+
worker: z.ZodObject<{
|
|
648
|
+
id: z.ZodString;
|
|
649
|
+
contentHash: z.ZodString;
|
|
650
|
+
version: z.ZodString;
|
|
651
|
+
}, "strip", z.ZodTypeAny, {
|
|
652
|
+
id: string;
|
|
653
|
+
version: string;
|
|
654
|
+
contentHash: string;
|
|
655
|
+
}, {
|
|
656
|
+
id: string;
|
|
657
|
+
version: string;
|
|
658
|
+
contentHash: string;
|
|
659
|
+
}>;
|
|
660
|
+
}, "strip", z.ZodTypeAny, {
|
|
661
|
+
task: {
|
|
662
|
+
id: string;
|
|
663
|
+
filePath: string;
|
|
664
|
+
exportName: string;
|
|
665
|
+
};
|
|
666
|
+
attempt: {
|
|
667
|
+
number: number;
|
|
668
|
+
status: string;
|
|
669
|
+
id: string;
|
|
670
|
+
startedAt: Date;
|
|
671
|
+
backgroundWorkerId: string;
|
|
672
|
+
backgroundWorkerTaskId: string;
|
|
673
|
+
};
|
|
674
|
+
run: {
|
|
675
|
+
id: string;
|
|
676
|
+
payload: string;
|
|
677
|
+
payloadType: string;
|
|
678
|
+
tags: string[];
|
|
679
|
+
isTest: boolean;
|
|
680
|
+
createdAt: Date;
|
|
681
|
+
context?: any;
|
|
682
|
+
idempotencyKey?: string | undefined;
|
|
683
|
+
};
|
|
684
|
+
queue: {
|
|
685
|
+
id: string;
|
|
686
|
+
name: string;
|
|
687
|
+
};
|
|
688
|
+
environment: {
|
|
689
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
690
|
+
id: string;
|
|
691
|
+
slug: string;
|
|
692
|
+
};
|
|
693
|
+
organization: {
|
|
694
|
+
id: string;
|
|
695
|
+
name: string;
|
|
696
|
+
slug: string;
|
|
697
|
+
};
|
|
698
|
+
project: {
|
|
699
|
+
id: string;
|
|
700
|
+
name: string;
|
|
701
|
+
slug: string;
|
|
702
|
+
ref: string;
|
|
703
|
+
};
|
|
704
|
+
worker: {
|
|
705
|
+
id: string;
|
|
706
|
+
version: string;
|
|
707
|
+
contentHash: string;
|
|
708
|
+
};
|
|
709
|
+
batch?: {
|
|
710
|
+
id: string;
|
|
711
|
+
} | undefined;
|
|
712
|
+
}, {
|
|
713
|
+
task: {
|
|
714
|
+
id: string;
|
|
715
|
+
filePath: string;
|
|
716
|
+
exportName: string;
|
|
717
|
+
};
|
|
718
|
+
attempt: {
|
|
719
|
+
number: number;
|
|
720
|
+
status: string;
|
|
721
|
+
id: string;
|
|
722
|
+
startedAt: Date;
|
|
723
|
+
backgroundWorkerId: string;
|
|
724
|
+
backgroundWorkerTaskId: string;
|
|
725
|
+
};
|
|
726
|
+
run: {
|
|
727
|
+
id: string;
|
|
728
|
+
payload: string;
|
|
729
|
+
payloadType: string;
|
|
730
|
+
tags: string[];
|
|
731
|
+
createdAt: Date;
|
|
732
|
+
context?: any;
|
|
733
|
+
isTest?: boolean | undefined;
|
|
734
|
+
idempotencyKey?: string | undefined;
|
|
735
|
+
};
|
|
736
|
+
queue: {
|
|
737
|
+
id: string;
|
|
738
|
+
name: string;
|
|
739
|
+
};
|
|
740
|
+
environment: {
|
|
741
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
742
|
+
id: string;
|
|
743
|
+
slug: string;
|
|
744
|
+
};
|
|
745
|
+
organization: {
|
|
746
|
+
id: string;
|
|
747
|
+
name: string;
|
|
748
|
+
slug: string;
|
|
749
|
+
};
|
|
750
|
+
project: {
|
|
751
|
+
id: string;
|
|
752
|
+
name: string;
|
|
753
|
+
slug: string;
|
|
754
|
+
ref: string;
|
|
755
|
+
};
|
|
756
|
+
worker: {
|
|
757
|
+
id: string;
|
|
758
|
+
version: string;
|
|
759
|
+
contentHash: string;
|
|
760
|
+
};
|
|
761
|
+
batch?: {
|
|
762
|
+
id: string;
|
|
763
|
+
} | undefined;
|
|
764
|
+
}>;
|
|
765
|
+
type ProdTaskRunExecution = z.infer<typeof ProdTaskRunExecution>;
|
|
766
|
+
declare const ProdTaskRunExecutionPayload: z.ZodObject<{
|
|
767
|
+
execution: z.ZodObject<{
|
|
768
|
+
task: z.ZodObject<{
|
|
769
|
+
id: z.ZodString;
|
|
770
|
+
filePath: z.ZodString;
|
|
771
|
+
exportName: z.ZodString;
|
|
772
|
+
}, "strip", z.ZodTypeAny, {
|
|
773
|
+
id: string;
|
|
774
|
+
filePath: string;
|
|
775
|
+
exportName: string;
|
|
776
|
+
}, {
|
|
777
|
+
id: string;
|
|
778
|
+
filePath: string;
|
|
779
|
+
exportName: string;
|
|
780
|
+
}>;
|
|
781
|
+
attempt: z.ZodObject<{
|
|
782
|
+
id: z.ZodString;
|
|
783
|
+
number: z.ZodNumber;
|
|
784
|
+
startedAt: z.ZodDate;
|
|
785
|
+
backgroundWorkerId: z.ZodString;
|
|
786
|
+
backgroundWorkerTaskId: z.ZodString;
|
|
787
|
+
status: z.ZodString;
|
|
788
|
+
}, "strip", z.ZodTypeAny, {
|
|
789
|
+
number: number;
|
|
790
|
+
status: string;
|
|
791
|
+
id: string;
|
|
792
|
+
startedAt: Date;
|
|
793
|
+
backgroundWorkerId: string;
|
|
794
|
+
backgroundWorkerTaskId: string;
|
|
795
|
+
}, {
|
|
796
|
+
number: number;
|
|
797
|
+
status: string;
|
|
798
|
+
id: string;
|
|
799
|
+
startedAt: Date;
|
|
800
|
+
backgroundWorkerId: string;
|
|
801
|
+
backgroundWorkerTaskId: string;
|
|
802
|
+
}>;
|
|
803
|
+
run: z.ZodObject<{
|
|
804
|
+
id: z.ZodString;
|
|
805
|
+
payload: z.ZodString;
|
|
806
|
+
payloadType: z.ZodString;
|
|
807
|
+
context: z.ZodAny;
|
|
808
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
809
|
+
isTest: z.ZodDefault<z.ZodBoolean>;
|
|
810
|
+
createdAt: z.ZodDate;
|
|
811
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
812
|
+
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
id: string;
|
|
814
|
+
payload: string;
|
|
815
|
+
payloadType: string;
|
|
816
|
+
tags: string[];
|
|
817
|
+
isTest: boolean;
|
|
818
|
+
createdAt: Date;
|
|
819
|
+
context?: any;
|
|
820
|
+
idempotencyKey?: string | undefined;
|
|
821
|
+
}, {
|
|
822
|
+
id: string;
|
|
823
|
+
payload: string;
|
|
824
|
+
payloadType: string;
|
|
825
|
+
tags: string[];
|
|
826
|
+
createdAt: Date;
|
|
827
|
+
context?: any;
|
|
828
|
+
isTest?: boolean | undefined;
|
|
829
|
+
idempotencyKey?: string | undefined;
|
|
830
|
+
}>;
|
|
831
|
+
queue: z.ZodObject<{
|
|
832
|
+
id: z.ZodString;
|
|
833
|
+
name: z.ZodString;
|
|
834
|
+
}, "strip", z.ZodTypeAny, {
|
|
835
|
+
id: string;
|
|
836
|
+
name: string;
|
|
837
|
+
}, {
|
|
838
|
+
id: string;
|
|
839
|
+
name: string;
|
|
840
|
+
}>;
|
|
841
|
+
environment: z.ZodObject<{
|
|
842
|
+
id: z.ZodString;
|
|
843
|
+
slug: z.ZodString;
|
|
844
|
+
type: z.ZodEnum<["PRODUCTION", "STAGING", "DEVELOPMENT", "PREVIEW"]>;
|
|
845
|
+
}, "strip", z.ZodTypeAny, {
|
|
846
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
847
|
+
id: string;
|
|
848
|
+
slug: string;
|
|
849
|
+
}, {
|
|
850
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
851
|
+
id: string;
|
|
852
|
+
slug: string;
|
|
853
|
+
}>;
|
|
854
|
+
organization: z.ZodObject<{
|
|
855
|
+
id: z.ZodString;
|
|
856
|
+
slug: z.ZodString;
|
|
857
|
+
name: z.ZodString;
|
|
858
|
+
}, "strip", z.ZodTypeAny, {
|
|
859
|
+
id: string;
|
|
860
|
+
name: string;
|
|
861
|
+
slug: string;
|
|
862
|
+
}, {
|
|
863
|
+
id: string;
|
|
864
|
+
name: string;
|
|
865
|
+
slug: string;
|
|
866
|
+
}>;
|
|
867
|
+
project: z.ZodObject<{
|
|
868
|
+
id: z.ZodString;
|
|
869
|
+
ref: z.ZodString;
|
|
870
|
+
slug: z.ZodString;
|
|
871
|
+
name: z.ZodString;
|
|
872
|
+
}, "strip", z.ZodTypeAny, {
|
|
873
|
+
id: string;
|
|
874
|
+
name: string;
|
|
875
|
+
slug: string;
|
|
876
|
+
ref: string;
|
|
877
|
+
}, {
|
|
878
|
+
id: string;
|
|
879
|
+
name: string;
|
|
880
|
+
slug: string;
|
|
881
|
+
ref: string;
|
|
882
|
+
}>;
|
|
883
|
+
batch: z.ZodOptional<z.ZodObject<{
|
|
884
|
+
id: z.ZodString;
|
|
885
|
+
}, "strip", z.ZodTypeAny, {
|
|
886
|
+
id: string;
|
|
887
|
+
}, {
|
|
888
|
+
id: string;
|
|
889
|
+
}>>;
|
|
890
|
+
worker: z.ZodObject<{
|
|
891
|
+
id: z.ZodString;
|
|
892
|
+
contentHash: z.ZodString;
|
|
893
|
+
version: z.ZodString;
|
|
894
|
+
}, "strip", z.ZodTypeAny, {
|
|
895
|
+
id: string;
|
|
896
|
+
version: string;
|
|
897
|
+
contentHash: string;
|
|
898
|
+
}, {
|
|
899
|
+
id: string;
|
|
900
|
+
version: string;
|
|
901
|
+
contentHash: string;
|
|
902
|
+
}>;
|
|
903
|
+
}, "strip", z.ZodTypeAny, {
|
|
904
|
+
task: {
|
|
905
|
+
id: string;
|
|
906
|
+
filePath: string;
|
|
907
|
+
exportName: string;
|
|
908
|
+
};
|
|
909
|
+
attempt: {
|
|
910
|
+
number: number;
|
|
911
|
+
status: string;
|
|
912
|
+
id: string;
|
|
913
|
+
startedAt: Date;
|
|
914
|
+
backgroundWorkerId: string;
|
|
915
|
+
backgroundWorkerTaskId: string;
|
|
916
|
+
};
|
|
917
|
+
run: {
|
|
918
|
+
id: string;
|
|
919
|
+
payload: string;
|
|
920
|
+
payloadType: string;
|
|
921
|
+
tags: string[];
|
|
922
|
+
isTest: boolean;
|
|
923
|
+
createdAt: Date;
|
|
924
|
+
context?: any;
|
|
925
|
+
idempotencyKey?: string | undefined;
|
|
926
|
+
};
|
|
927
|
+
queue: {
|
|
928
|
+
id: string;
|
|
929
|
+
name: string;
|
|
930
|
+
};
|
|
931
|
+
environment: {
|
|
932
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
933
|
+
id: string;
|
|
934
|
+
slug: string;
|
|
935
|
+
};
|
|
936
|
+
organization: {
|
|
937
|
+
id: string;
|
|
938
|
+
name: string;
|
|
939
|
+
slug: string;
|
|
940
|
+
};
|
|
941
|
+
project: {
|
|
942
|
+
id: string;
|
|
943
|
+
name: string;
|
|
944
|
+
slug: string;
|
|
945
|
+
ref: string;
|
|
946
|
+
};
|
|
947
|
+
worker: {
|
|
948
|
+
id: string;
|
|
949
|
+
version: string;
|
|
950
|
+
contentHash: string;
|
|
951
|
+
};
|
|
952
|
+
batch?: {
|
|
953
|
+
id: string;
|
|
954
|
+
} | undefined;
|
|
955
|
+
}, {
|
|
956
|
+
task: {
|
|
957
|
+
id: string;
|
|
958
|
+
filePath: string;
|
|
959
|
+
exportName: string;
|
|
960
|
+
};
|
|
961
|
+
attempt: {
|
|
962
|
+
number: number;
|
|
963
|
+
status: string;
|
|
964
|
+
id: string;
|
|
965
|
+
startedAt: Date;
|
|
966
|
+
backgroundWorkerId: string;
|
|
967
|
+
backgroundWorkerTaskId: string;
|
|
968
|
+
};
|
|
969
|
+
run: {
|
|
970
|
+
id: string;
|
|
971
|
+
payload: string;
|
|
972
|
+
payloadType: string;
|
|
973
|
+
tags: string[];
|
|
974
|
+
createdAt: Date;
|
|
975
|
+
context?: any;
|
|
976
|
+
isTest?: boolean | undefined;
|
|
977
|
+
idempotencyKey?: string | undefined;
|
|
978
|
+
};
|
|
979
|
+
queue: {
|
|
980
|
+
id: string;
|
|
981
|
+
name: string;
|
|
982
|
+
};
|
|
983
|
+
environment: {
|
|
984
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
985
|
+
id: string;
|
|
986
|
+
slug: string;
|
|
987
|
+
};
|
|
988
|
+
organization: {
|
|
989
|
+
id: string;
|
|
990
|
+
name: string;
|
|
991
|
+
slug: string;
|
|
992
|
+
};
|
|
993
|
+
project: {
|
|
994
|
+
id: string;
|
|
995
|
+
name: string;
|
|
996
|
+
slug: string;
|
|
997
|
+
ref: string;
|
|
998
|
+
};
|
|
999
|
+
worker: {
|
|
1000
|
+
id: string;
|
|
1001
|
+
version: string;
|
|
1002
|
+
contentHash: string;
|
|
1003
|
+
};
|
|
1004
|
+
batch?: {
|
|
1005
|
+
id: string;
|
|
1006
|
+
} | undefined;
|
|
1007
|
+
}>;
|
|
1008
|
+
traceContext: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1009
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1010
|
+
}, "strip", z.ZodTypeAny, {
|
|
1011
|
+
execution: {
|
|
1012
|
+
task: {
|
|
1013
|
+
id: string;
|
|
1014
|
+
filePath: string;
|
|
1015
|
+
exportName: string;
|
|
1016
|
+
};
|
|
1017
|
+
attempt: {
|
|
1018
|
+
number: number;
|
|
1019
|
+
status: string;
|
|
1020
|
+
id: string;
|
|
1021
|
+
startedAt: Date;
|
|
1022
|
+
backgroundWorkerId: string;
|
|
1023
|
+
backgroundWorkerTaskId: string;
|
|
1024
|
+
};
|
|
1025
|
+
run: {
|
|
1026
|
+
id: string;
|
|
1027
|
+
payload: string;
|
|
1028
|
+
payloadType: string;
|
|
1029
|
+
tags: string[];
|
|
1030
|
+
isTest: boolean;
|
|
1031
|
+
createdAt: Date;
|
|
1032
|
+
context?: any;
|
|
1033
|
+
idempotencyKey?: string | undefined;
|
|
1034
|
+
};
|
|
1035
|
+
queue: {
|
|
1036
|
+
id: string;
|
|
1037
|
+
name: string;
|
|
1038
|
+
};
|
|
1039
|
+
environment: {
|
|
1040
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
1041
|
+
id: string;
|
|
1042
|
+
slug: string;
|
|
1043
|
+
};
|
|
1044
|
+
organization: {
|
|
1045
|
+
id: string;
|
|
1046
|
+
name: string;
|
|
1047
|
+
slug: string;
|
|
1048
|
+
};
|
|
1049
|
+
project: {
|
|
1050
|
+
id: string;
|
|
1051
|
+
name: string;
|
|
1052
|
+
slug: string;
|
|
1053
|
+
ref: string;
|
|
1054
|
+
};
|
|
1055
|
+
worker: {
|
|
1056
|
+
id: string;
|
|
1057
|
+
version: string;
|
|
1058
|
+
contentHash: string;
|
|
1059
|
+
};
|
|
1060
|
+
batch?: {
|
|
1061
|
+
id: string;
|
|
1062
|
+
} | undefined;
|
|
1063
|
+
};
|
|
1064
|
+
traceContext: Record<string, unknown>;
|
|
1065
|
+
environment?: Record<string, string> | undefined;
|
|
1066
|
+
}, {
|
|
1067
|
+
execution: {
|
|
1068
|
+
task: {
|
|
1069
|
+
id: string;
|
|
1070
|
+
filePath: string;
|
|
1071
|
+
exportName: string;
|
|
1072
|
+
};
|
|
1073
|
+
attempt: {
|
|
1074
|
+
number: number;
|
|
1075
|
+
status: string;
|
|
1076
|
+
id: string;
|
|
1077
|
+
startedAt: Date;
|
|
1078
|
+
backgroundWorkerId: string;
|
|
1079
|
+
backgroundWorkerTaskId: string;
|
|
1080
|
+
};
|
|
1081
|
+
run: {
|
|
1082
|
+
id: string;
|
|
1083
|
+
payload: string;
|
|
1084
|
+
payloadType: string;
|
|
1085
|
+
tags: string[];
|
|
1086
|
+
createdAt: Date;
|
|
1087
|
+
context?: any;
|
|
1088
|
+
isTest?: boolean | undefined;
|
|
1089
|
+
idempotencyKey?: string | undefined;
|
|
1090
|
+
};
|
|
1091
|
+
queue: {
|
|
1092
|
+
id: string;
|
|
1093
|
+
name: string;
|
|
1094
|
+
};
|
|
1095
|
+
environment: {
|
|
1096
|
+
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
1097
|
+
id: string;
|
|
1098
|
+
slug: string;
|
|
1099
|
+
};
|
|
1100
|
+
organization: {
|
|
1101
|
+
id: string;
|
|
1102
|
+
name: string;
|
|
1103
|
+
slug: string;
|
|
1104
|
+
};
|
|
1105
|
+
project: {
|
|
1106
|
+
id: string;
|
|
1107
|
+
name: string;
|
|
1108
|
+
slug: string;
|
|
1109
|
+
ref: string;
|
|
1110
|
+
};
|
|
1111
|
+
worker: {
|
|
1112
|
+
id: string;
|
|
1113
|
+
version: string;
|
|
1114
|
+
contentHash: string;
|
|
1115
|
+
};
|
|
1116
|
+
batch?: {
|
|
1117
|
+
id: string;
|
|
1118
|
+
} | undefined;
|
|
1119
|
+
};
|
|
1120
|
+
traceContext: Record<string, unknown>;
|
|
1121
|
+
environment?: Record<string, string> | undefined;
|
|
1122
|
+
}>;
|
|
1123
|
+
type ProdTaskRunExecutionPayload = z.infer<typeof ProdTaskRunExecutionPayload>;
|
|
1124
|
+
declare const FixedWindowRateLimit: z.ZodObject<{
|
|
1125
|
+
type: z.ZodLiteral<"fixed-window">;
|
|
1126
|
+
limit: z.ZodNumber;
|
|
1127
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1128
|
+
seconds: z.ZodNumber;
|
|
1129
|
+
}, "strip", z.ZodTypeAny, {
|
|
1130
|
+
seconds: number;
|
|
1131
|
+
}, {
|
|
1132
|
+
seconds: number;
|
|
1133
|
+
}>, z.ZodObject<{
|
|
1134
|
+
minutes: z.ZodNumber;
|
|
1135
|
+
}, "strip", z.ZodTypeAny, {
|
|
1136
|
+
minutes: number;
|
|
1137
|
+
}, {
|
|
1138
|
+
minutes: number;
|
|
1139
|
+
}>, z.ZodObject<{
|
|
1140
|
+
hours: z.ZodNumber;
|
|
1141
|
+
}, "strip", z.ZodTypeAny, {
|
|
1142
|
+
hours: number;
|
|
1143
|
+
}, {
|
|
1144
|
+
hours: number;
|
|
1145
|
+
}>]>;
|
|
1146
|
+
}, "strip", z.ZodTypeAny, {
|
|
1147
|
+
type: "fixed-window";
|
|
1148
|
+
limit: number;
|
|
1149
|
+
window: ({
|
|
1150
|
+
seconds: number;
|
|
1151
|
+
} | {
|
|
1152
|
+
minutes: number;
|
|
1153
|
+
} | {
|
|
1154
|
+
hours: number;
|
|
1155
|
+
}) & ({
|
|
1156
|
+
seconds: number;
|
|
1157
|
+
} | {
|
|
1158
|
+
minutes: number;
|
|
1159
|
+
} | {
|
|
1160
|
+
hours: number;
|
|
1161
|
+
} | undefined);
|
|
1162
|
+
}, {
|
|
1163
|
+
type: "fixed-window";
|
|
1164
|
+
limit: number;
|
|
1165
|
+
window: ({
|
|
1166
|
+
seconds: number;
|
|
1167
|
+
} | {
|
|
1168
|
+
minutes: number;
|
|
1169
|
+
} | {
|
|
1170
|
+
hours: number;
|
|
1171
|
+
}) & ({
|
|
1172
|
+
seconds: number;
|
|
1173
|
+
} | {
|
|
1174
|
+
minutes: number;
|
|
1175
|
+
} | {
|
|
1176
|
+
hours: number;
|
|
1177
|
+
} | undefined);
|
|
1178
|
+
}>;
|
|
1179
|
+
declare const SlidingWindowRateLimit: z.ZodObject<{
|
|
1180
|
+
type: z.ZodLiteral<"sliding-window">;
|
|
1181
|
+
limit: z.ZodNumber;
|
|
1182
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1183
|
+
seconds: z.ZodNumber;
|
|
1184
|
+
}, "strip", z.ZodTypeAny, {
|
|
1185
|
+
seconds: number;
|
|
1186
|
+
}, {
|
|
1187
|
+
seconds: number;
|
|
1188
|
+
}>, z.ZodObject<{
|
|
1189
|
+
minutes: z.ZodNumber;
|
|
1190
|
+
}, "strip", z.ZodTypeAny, {
|
|
1191
|
+
minutes: number;
|
|
1192
|
+
}, {
|
|
1193
|
+
minutes: number;
|
|
1194
|
+
}>, z.ZodObject<{
|
|
1195
|
+
hours: z.ZodNumber;
|
|
1196
|
+
}, "strip", z.ZodTypeAny, {
|
|
1197
|
+
hours: number;
|
|
1198
|
+
}, {
|
|
1199
|
+
hours: number;
|
|
1200
|
+
}>]>;
|
|
1201
|
+
}, "strip", z.ZodTypeAny, {
|
|
1202
|
+
type: "sliding-window";
|
|
1203
|
+
limit: number;
|
|
1204
|
+
window: ({
|
|
1205
|
+
seconds: number;
|
|
1206
|
+
} | {
|
|
1207
|
+
minutes: number;
|
|
1208
|
+
} | {
|
|
1209
|
+
hours: number;
|
|
1210
|
+
}) & ({
|
|
1211
|
+
seconds: number;
|
|
1212
|
+
} | {
|
|
1213
|
+
minutes: number;
|
|
1214
|
+
} | {
|
|
1215
|
+
hours: number;
|
|
1216
|
+
} | undefined);
|
|
1217
|
+
}, {
|
|
1218
|
+
type: "sliding-window";
|
|
1219
|
+
limit: number;
|
|
1220
|
+
window: ({
|
|
1221
|
+
seconds: number;
|
|
1222
|
+
} | {
|
|
1223
|
+
minutes: number;
|
|
1224
|
+
} | {
|
|
1225
|
+
hours: number;
|
|
1226
|
+
}) & ({
|
|
1227
|
+
seconds: number;
|
|
1228
|
+
} | {
|
|
1229
|
+
minutes: number;
|
|
1230
|
+
} | {
|
|
1231
|
+
hours: number;
|
|
1232
|
+
} | undefined);
|
|
1233
|
+
}>;
|
|
1234
|
+
declare const RateLimitOptions: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1235
|
+
type: z.ZodLiteral<"fixed-window">;
|
|
1236
|
+
limit: z.ZodNumber;
|
|
1237
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1238
|
+
seconds: z.ZodNumber;
|
|
1239
|
+
}, "strip", z.ZodTypeAny, {
|
|
1240
|
+
seconds: number;
|
|
1241
|
+
}, {
|
|
1242
|
+
seconds: number;
|
|
1243
|
+
}>, z.ZodObject<{
|
|
1244
|
+
minutes: z.ZodNumber;
|
|
1245
|
+
}, "strip", z.ZodTypeAny, {
|
|
1246
|
+
minutes: number;
|
|
1247
|
+
}, {
|
|
1248
|
+
minutes: number;
|
|
1249
|
+
}>, z.ZodObject<{
|
|
1250
|
+
hours: z.ZodNumber;
|
|
1251
|
+
}, "strip", z.ZodTypeAny, {
|
|
1252
|
+
hours: number;
|
|
1253
|
+
}, {
|
|
1254
|
+
hours: number;
|
|
1255
|
+
}>]>;
|
|
1256
|
+
}, "strip", z.ZodTypeAny, {
|
|
1257
|
+
type: "fixed-window";
|
|
1258
|
+
limit: number;
|
|
1259
|
+
window: ({
|
|
1260
|
+
seconds: number;
|
|
1261
|
+
} | {
|
|
1262
|
+
minutes: number;
|
|
1263
|
+
} | {
|
|
1264
|
+
hours: number;
|
|
1265
|
+
}) & ({
|
|
1266
|
+
seconds: number;
|
|
1267
|
+
} | {
|
|
1268
|
+
minutes: number;
|
|
1269
|
+
} | {
|
|
1270
|
+
hours: number;
|
|
1271
|
+
} | undefined);
|
|
1272
|
+
}, {
|
|
1273
|
+
type: "fixed-window";
|
|
1274
|
+
limit: number;
|
|
1275
|
+
window: ({
|
|
1276
|
+
seconds: number;
|
|
1277
|
+
} | {
|
|
1278
|
+
minutes: number;
|
|
1279
|
+
} | {
|
|
1280
|
+
hours: number;
|
|
1281
|
+
}) & ({
|
|
1282
|
+
seconds: number;
|
|
1283
|
+
} | {
|
|
1284
|
+
minutes: number;
|
|
1285
|
+
} | {
|
|
1286
|
+
hours: number;
|
|
1287
|
+
} | undefined);
|
|
1288
|
+
}>, z.ZodObject<{
|
|
1289
|
+
type: z.ZodLiteral<"sliding-window">;
|
|
1290
|
+
limit: z.ZodNumber;
|
|
1291
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1292
|
+
seconds: z.ZodNumber;
|
|
1293
|
+
}, "strip", z.ZodTypeAny, {
|
|
1294
|
+
seconds: number;
|
|
1295
|
+
}, {
|
|
1296
|
+
seconds: number;
|
|
1297
|
+
}>, z.ZodObject<{
|
|
1298
|
+
minutes: z.ZodNumber;
|
|
1299
|
+
}, "strip", z.ZodTypeAny, {
|
|
1300
|
+
minutes: number;
|
|
1301
|
+
}, {
|
|
1302
|
+
minutes: number;
|
|
1303
|
+
}>, z.ZodObject<{
|
|
1304
|
+
hours: z.ZodNumber;
|
|
1305
|
+
}, "strip", z.ZodTypeAny, {
|
|
1306
|
+
hours: number;
|
|
1307
|
+
}, {
|
|
1308
|
+
hours: number;
|
|
1309
|
+
}>]>;
|
|
1310
|
+
}, "strip", z.ZodTypeAny, {
|
|
1311
|
+
type: "sliding-window";
|
|
1312
|
+
limit: number;
|
|
1313
|
+
window: ({
|
|
1314
|
+
seconds: number;
|
|
1315
|
+
} | {
|
|
1316
|
+
minutes: number;
|
|
1317
|
+
} | {
|
|
1318
|
+
hours: number;
|
|
1319
|
+
}) & ({
|
|
1320
|
+
seconds: number;
|
|
1321
|
+
} | {
|
|
1322
|
+
minutes: number;
|
|
1323
|
+
} | {
|
|
1324
|
+
hours: number;
|
|
1325
|
+
} | undefined);
|
|
1326
|
+
}, {
|
|
1327
|
+
type: "sliding-window";
|
|
1328
|
+
limit: number;
|
|
1329
|
+
window: ({
|
|
1330
|
+
seconds: number;
|
|
1331
|
+
} | {
|
|
1332
|
+
minutes: number;
|
|
1333
|
+
} | {
|
|
1334
|
+
hours: number;
|
|
1335
|
+
}) & ({
|
|
1336
|
+
seconds: number;
|
|
1337
|
+
} | {
|
|
1338
|
+
minutes: number;
|
|
1339
|
+
} | {
|
|
1340
|
+
hours: number;
|
|
1341
|
+
} | undefined);
|
|
1342
|
+
}>]>;
|
|
1343
|
+
type RateLimitOptions = z.infer<typeof RateLimitOptions>;
|
|
1344
|
+
declare const RetryOptions: z.ZodObject<{
|
|
1345
|
+
/** The number of attempts before giving up */
|
|
1346
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
1347
|
+
/** The exponential factor to use when calculating the next retry time.
|
|
1348
|
+
*
|
|
1349
|
+
* Each subsequent retry will be calculated as `previousTimeout * factor`
|
|
1350
|
+
*/
|
|
1351
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
1352
|
+
/** The minimum time to wait before retrying */
|
|
1353
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1354
|
+
/** The maximum time to wait before retrying */
|
|
1355
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1356
|
+
/** Randomize the timeout between retries.
|
|
1357
|
+
*
|
|
1358
|
+
* This can be useful to prevent the thundering herd problem where all retries happen at the same time.
|
|
1359
|
+
*/
|
|
1360
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
1361
|
+
}, "strip", z.ZodTypeAny, {
|
|
1362
|
+
maxAttempts?: number | undefined;
|
|
1363
|
+
factor?: number | undefined;
|
|
1364
|
+
minTimeoutInMs?: number | undefined;
|
|
1365
|
+
maxTimeoutInMs?: number | undefined;
|
|
1366
|
+
randomize?: boolean | undefined;
|
|
1367
|
+
}, {
|
|
1368
|
+
maxAttempts?: number | undefined;
|
|
1369
|
+
factor?: number | undefined;
|
|
1370
|
+
minTimeoutInMs?: number | undefined;
|
|
1371
|
+
maxTimeoutInMs?: number | undefined;
|
|
1372
|
+
randomize?: boolean | undefined;
|
|
1373
|
+
}>;
|
|
1374
|
+
type RetryOptions = z.infer<typeof RetryOptions>;
|
|
1375
|
+
declare const QueueOptions: z.ZodObject<{
|
|
1376
|
+
/** You can define a shared queue and then pass the name in to your task.
|
|
1377
|
+
*
|
|
1378
|
+
* @example
|
|
1379
|
+
*
|
|
1380
|
+
* ```ts
|
|
1381
|
+
* const myQueue = queue({
|
|
1382
|
+
name: "my-queue",
|
|
1383
|
+
concurrencyLimit: 1,
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
export const task1 = task({
|
|
1387
|
+
id: "task-1",
|
|
1388
|
+
queue: {
|
|
1389
|
+
name: "my-queue",
|
|
1390
|
+
},
|
|
1391
|
+
run: async (payload: { message: string }) => {
|
|
1392
|
+
// ...
|
|
1393
|
+
},
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1396
|
+
export const task2 = task({
|
|
1397
|
+
id: "task-2",
|
|
1398
|
+
queue: {
|
|
1399
|
+
name: "my-queue",
|
|
1400
|
+
},
|
|
1401
|
+
run: async (payload: { message: string }) => {
|
|
1402
|
+
// ...
|
|
1403
|
+
},
|
|
1404
|
+
});
|
|
1405
|
+
* ```
|
|
1406
|
+
*/
|
|
1407
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1408
|
+
/** An optional property that specifies the maximum number of concurrent run executions.
|
|
1409
|
+
*
|
|
1410
|
+
* If this property is omitted, the task can potentially use up the full concurrency of an environment. */
|
|
1411
|
+
concurrencyLimit: z.ZodOptional<z.ZodNumber>;
|
|
1412
|
+
/** @deprecated This feature is coming soon */
|
|
1413
|
+
rateLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1414
|
+
type: z.ZodLiteral<"fixed-window">;
|
|
1415
|
+
limit: z.ZodNumber;
|
|
1416
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1417
|
+
seconds: z.ZodNumber;
|
|
1418
|
+
}, "strip", z.ZodTypeAny, {
|
|
1419
|
+
seconds: number;
|
|
1420
|
+
}, {
|
|
1421
|
+
seconds: number;
|
|
1422
|
+
}>, z.ZodObject<{
|
|
1423
|
+
minutes: z.ZodNumber;
|
|
1424
|
+
}, "strip", z.ZodTypeAny, {
|
|
1425
|
+
minutes: number;
|
|
1426
|
+
}, {
|
|
1427
|
+
minutes: number;
|
|
1428
|
+
}>, z.ZodObject<{
|
|
1429
|
+
hours: z.ZodNumber;
|
|
1430
|
+
}, "strip", z.ZodTypeAny, {
|
|
1431
|
+
hours: number;
|
|
1432
|
+
}, {
|
|
1433
|
+
hours: number;
|
|
1434
|
+
}>]>;
|
|
1435
|
+
}, "strip", z.ZodTypeAny, {
|
|
1436
|
+
type: "fixed-window";
|
|
1437
|
+
limit: number;
|
|
1438
|
+
window: ({
|
|
1439
|
+
seconds: number;
|
|
1440
|
+
} | {
|
|
1441
|
+
minutes: number;
|
|
1442
|
+
} | {
|
|
1443
|
+
hours: number;
|
|
1444
|
+
}) & ({
|
|
1445
|
+
seconds: number;
|
|
1446
|
+
} | {
|
|
1447
|
+
minutes: number;
|
|
1448
|
+
} | {
|
|
1449
|
+
hours: number;
|
|
1450
|
+
} | undefined);
|
|
1451
|
+
}, {
|
|
1452
|
+
type: "fixed-window";
|
|
1453
|
+
limit: number;
|
|
1454
|
+
window: ({
|
|
1455
|
+
seconds: number;
|
|
1456
|
+
} | {
|
|
1457
|
+
minutes: number;
|
|
1458
|
+
} | {
|
|
1459
|
+
hours: number;
|
|
1460
|
+
}) & ({
|
|
1461
|
+
seconds: number;
|
|
1462
|
+
} | {
|
|
1463
|
+
minutes: number;
|
|
1464
|
+
} | {
|
|
1465
|
+
hours: number;
|
|
1466
|
+
} | undefined);
|
|
1467
|
+
}>, z.ZodObject<{
|
|
1468
|
+
type: z.ZodLiteral<"sliding-window">;
|
|
1469
|
+
limit: z.ZodNumber;
|
|
1470
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1471
|
+
seconds: z.ZodNumber;
|
|
1472
|
+
}, "strip", z.ZodTypeAny, {
|
|
1473
|
+
seconds: number;
|
|
1474
|
+
}, {
|
|
1475
|
+
seconds: number;
|
|
1476
|
+
}>, z.ZodObject<{
|
|
1477
|
+
minutes: z.ZodNumber;
|
|
1478
|
+
}, "strip", z.ZodTypeAny, {
|
|
1479
|
+
minutes: number;
|
|
1480
|
+
}, {
|
|
1481
|
+
minutes: number;
|
|
1482
|
+
}>, z.ZodObject<{
|
|
1483
|
+
hours: z.ZodNumber;
|
|
1484
|
+
}, "strip", z.ZodTypeAny, {
|
|
1485
|
+
hours: number;
|
|
1486
|
+
}, {
|
|
1487
|
+
hours: number;
|
|
1488
|
+
}>]>;
|
|
1489
|
+
}, "strip", z.ZodTypeAny, {
|
|
1490
|
+
type: "sliding-window";
|
|
1491
|
+
limit: number;
|
|
1492
|
+
window: ({
|
|
1493
|
+
seconds: number;
|
|
1494
|
+
} | {
|
|
1495
|
+
minutes: number;
|
|
1496
|
+
} | {
|
|
1497
|
+
hours: number;
|
|
1498
|
+
}) & ({
|
|
1499
|
+
seconds: number;
|
|
1500
|
+
} | {
|
|
1501
|
+
minutes: number;
|
|
1502
|
+
} | {
|
|
1503
|
+
hours: number;
|
|
1504
|
+
} | undefined);
|
|
1505
|
+
}, {
|
|
1506
|
+
type: "sliding-window";
|
|
1507
|
+
limit: number;
|
|
1508
|
+
window: ({
|
|
1509
|
+
seconds: number;
|
|
1510
|
+
} | {
|
|
1511
|
+
minutes: number;
|
|
1512
|
+
} | {
|
|
1513
|
+
hours: number;
|
|
1514
|
+
}) & ({
|
|
1515
|
+
seconds: number;
|
|
1516
|
+
} | {
|
|
1517
|
+
minutes: number;
|
|
1518
|
+
} | {
|
|
1519
|
+
hours: number;
|
|
1520
|
+
} | undefined);
|
|
1521
|
+
}>]>>;
|
|
1522
|
+
}, "strip", z.ZodTypeAny, {
|
|
1523
|
+
name?: string | undefined;
|
|
1524
|
+
concurrencyLimit?: number | undefined;
|
|
1525
|
+
rateLimit?: {
|
|
1526
|
+
type: "fixed-window";
|
|
1527
|
+
limit: number;
|
|
1528
|
+
window: ({
|
|
1529
|
+
seconds: number;
|
|
1530
|
+
} | {
|
|
1531
|
+
minutes: number;
|
|
1532
|
+
} | {
|
|
1533
|
+
hours: number;
|
|
1534
|
+
}) & ({
|
|
1535
|
+
seconds: number;
|
|
1536
|
+
} | {
|
|
1537
|
+
minutes: number;
|
|
1538
|
+
} | {
|
|
1539
|
+
hours: number;
|
|
1540
|
+
} | undefined);
|
|
1541
|
+
} | {
|
|
1542
|
+
type: "sliding-window";
|
|
1543
|
+
limit: number;
|
|
1544
|
+
window: ({
|
|
1545
|
+
seconds: number;
|
|
1546
|
+
} | {
|
|
1547
|
+
minutes: number;
|
|
1548
|
+
} | {
|
|
1549
|
+
hours: number;
|
|
1550
|
+
}) & ({
|
|
1551
|
+
seconds: number;
|
|
1552
|
+
} | {
|
|
1553
|
+
minutes: number;
|
|
1554
|
+
} | {
|
|
1555
|
+
hours: number;
|
|
1556
|
+
} | undefined);
|
|
1557
|
+
} | undefined;
|
|
1558
|
+
}, {
|
|
1559
|
+
name?: string | undefined;
|
|
1560
|
+
concurrencyLimit?: number | undefined;
|
|
1561
|
+
rateLimit?: {
|
|
1562
|
+
type: "fixed-window";
|
|
1563
|
+
limit: number;
|
|
1564
|
+
window: ({
|
|
1565
|
+
seconds: number;
|
|
1566
|
+
} | {
|
|
1567
|
+
minutes: number;
|
|
1568
|
+
} | {
|
|
1569
|
+
hours: number;
|
|
1570
|
+
}) & ({
|
|
1571
|
+
seconds: number;
|
|
1572
|
+
} | {
|
|
1573
|
+
minutes: number;
|
|
1574
|
+
} | {
|
|
1575
|
+
hours: number;
|
|
1576
|
+
} | undefined);
|
|
1577
|
+
} | {
|
|
1578
|
+
type: "sliding-window";
|
|
1579
|
+
limit: number;
|
|
1580
|
+
window: ({
|
|
1581
|
+
seconds: number;
|
|
1582
|
+
} | {
|
|
1583
|
+
minutes: number;
|
|
1584
|
+
} | {
|
|
1585
|
+
hours: number;
|
|
1586
|
+
}) & ({
|
|
1587
|
+
seconds: number;
|
|
1588
|
+
} | {
|
|
1589
|
+
minutes: number;
|
|
1590
|
+
} | {
|
|
1591
|
+
hours: number;
|
|
1592
|
+
} | undefined);
|
|
1593
|
+
} | undefined;
|
|
1594
|
+
}>;
|
|
1595
|
+
type QueueOptions = z.infer<typeof QueueOptions>;
|
|
1596
|
+
declare const TaskMetadata: z.ZodObject<{
|
|
1597
|
+
id: z.ZodString;
|
|
1598
|
+
packageVersion: z.ZodString;
|
|
1599
|
+
queue: z.ZodOptional<z.ZodObject<{
|
|
1600
|
+
/** You can define a shared queue and then pass the name in to your task.
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
*
|
|
1604
|
+
* ```ts
|
|
1605
|
+
* const myQueue = queue({
|
|
1606
|
+
name: "my-queue",
|
|
1607
|
+
concurrencyLimit: 1,
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1610
|
+
export const task1 = task({
|
|
1611
|
+
id: "task-1",
|
|
1612
|
+
queue: {
|
|
1613
|
+
name: "my-queue",
|
|
1614
|
+
},
|
|
1615
|
+
run: async (payload: { message: string }) => {
|
|
1616
|
+
// ...
|
|
1617
|
+
},
|
|
1618
|
+
});
|
|
1619
|
+
|
|
1620
|
+
export const task2 = task({
|
|
1621
|
+
id: "task-2",
|
|
1622
|
+
queue: {
|
|
1623
|
+
name: "my-queue",
|
|
1624
|
+
},
|
|
1625
|
+
run: async (payload: { message: string }) => {
|
|
1626
|
+
// ...
|
|
1627
|
+
},
|
|
1628
|
+
});
|
|
1629
|
+
* ```
|
|
1630
|
+
*/
|
|
1631
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1632
|
+
/** An optional property that specifies the maximum number of concurrent run executions.
|
|
1633
|
+
*
|
|
1634
|
+
* If this property is omitted, the task can potentially use up the full concurrency of an environment. */
|
|
1635
|
+
concurrencyLimit: z.ZodOptional<z.ZodNumber>;
|
|
1636
|
+
/** @deprecated This feature is coming soon */
|
|
1637
|
+
rateLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1638
|
+
type: z.ZodLiteral<"fixed-window">;
|
|
1639
|
+
limit: z.ZodNumber;
|
|
1640
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1641
|
+
seconds: z.ZodNumber;
|
|
1642
|
+
}, "strip", z.ZodTypeAny, {
|
|
1643
|
+
seconds: number;
|
|
1644
|
+
}, {
|
|
1645
|
+
seconds: number;
|
|
1646
|
+
}>, z.ZodObject<{
|
|
1647
|
+
minutes: z.ZodNumber;
|
|
1648
|
+
}, "strip", z.ZodTypeAny, {
|
|
1649
|
+
minutes: number;
|
|
1650
|
+
}, {
|
|
1651
|
+
minutes: number;
|
|
1652
|
+
}>, z.ZodObject<{
|
|
1653
|
+
hours: z.ZodNumber;
|
|
1654
|
+
}, "strip", z.ZodTypeAny, {
|
|
1655
|
+
hours: number;
|
|
1656
|
+
}, {
|
|
1657
|
+
hours: number;
|
|
1658
|
+
}>]>;
|
|
1659
|
+
}, "strip", z.ZodTypeAny, {
|
|
1660
|
+
type: "fixed-window";
|
|
1661
|
+
limit: number;
|
|
1662
|
+
window: ({
|
|
1663
|
+
seconds: number;
|
|
1664
|
+
} | {
|
|
1665
|
+
minutes: number;
|
|
1666
|
+
} | {
|
|
1667
|
+
hours: number;
|
|
1668
|
+
}) & ({
|
|
1669
|
+
seconds: number;
|
|
1670
|
+
} | {
|
|
1671
|
+
minutes: number;
|
|
1672
|
+
} | {
|
|
1673
|
+
hours: number;
|
|
1674
|
+
} | undefined);
|
|
1675
|
+
}, {
|
|
1676
|
+
type: "fixed-window";
|
|
1677
|
+
limit: number;
|
|
1678
|
+
window: ({
|
|
1679
|
+
seconds: number;
|
|
1680
|
+
} | {
|
|
1681
|
+
minutes: number;
|
|
1682
|
+
} | {
|
|
1683
|
+
hours: number;
|
|
1684
|
+
}) & ({
|
|
1685
|
+
seconds: number;
|
|
1686
|
+
} | {
|
|
1687
|
+
minutes: number;
|
|
1688
|
+
} | {
|
|
1689
|
+
hours: number;
|
|
1690
|
+
} | undefined);
|
|
1691
|
+
}>, z.ZodObject<{
|
|
1692
|
+
type: z.ZodLiteral<"sliding-window">;
|
|
1693
|
+
limit: z.ZodNumber;
|
|
1694
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
1695
|
+
seconds: z.ZodNumber;
|
|
1696
|
+
}, "strip", z.ZodTypeAny, {
|
|
1697
|
+
seconds: number;
|
|
1698
|
+
}, {
|
|
1699
|
+
seconds: number;
|
|
1700
|
+
}>, z.ZodObject<{
|
|
1701
|
+
minutes: z.ZodNumber;
|
|
1702
|
+
}, "strip", z.ZodTypeAny, {
|
|
1703
|
+
minutes: number;
|
|
1704
|
+
}, {
|
|
1705
|
+
minutes: number;
|
|
1706
|
+
}>, z.ZodObject<{
|
|
1707
|
+
hours: z.ZodNumber;
|
|
1708
|
+
}, "strip", z.ZodTypeAny, {
|
|
1709
|
+
hours: number;
|
|
1710
|
+
}, {
|
|
1711
|
+
hours: number;
|
|
1712
|
+
}>]>;
|
|
1713
|
+
}, "strip", z.ZodTypeAny, {
|
|
1714
|
+
type: "sliding-window";
|
|
1715
|
+
limit: number;
|
|
1716
|
+
window: ({
|
|
1717
|
+
seconds: number;
|
|
1718
|
+
} | {
|
|
1719
|
+
minutes: number;
|
|
1720
|
+
} | {
|
|
1721
|
+
hours: number;
|
|
1722
|
+
}) & ({
|
|
1723
|
+
seconds: number;
|
|
1724
|
+
} | {
|
|
1725
|
+
minutes: number;
|
|
1726
|
+
} | {
|
|
1727
|
+
hours: number;
|
|
1728
|
+
} | undefined);
|
|
1729
|
+
}, {
|
|
1730
|
+
type: "sliding-window";
|
|
1731
|
+
limit: number;
|
|
1732
|
+
window: ({
|
|
1733
|
+
seconds: number;
|
|
1734
|
+
} | {
|
|
1735
|
+
minutes: number;
|
|
1736
|
+
} | {
|
|
1737
|
+
hours: number;
|
|
1738
|
+
}) & ({
|
|
1739
|
+
seconds: number;
|
|
1740
|
+
} | {
|
|
1741
|
+
minutes: number;
|
|
1742
|
+
} | {
|
|
1743
|
+
hours: number;
|
|
1744
|
+
} | undefined);
|
|
1745
|
+
}>]>>;
|
|
1746
|
+
}, "strip", z.ZodTypeAny, {
|
|
1747
|
+
name?: string | undefined;
|
|
1748
|
+
concurrencyLimit?: number | undefined;
|
|
1749
|
+
rateLimit?: {
|
|
1750
|
+
type: "fixed-window";
|
|
1751
|
+
limit: number;
|
|
1752
|
+
window: ({
|
|
1753
|
+
seconds: number;
|
|
1754
|
+
} | {
|
|
1755
|
+
minutes: number;
|
|
1756
|
+
} | {
|
|
1757
|
+
hours: number;
|
|
1758
|
+
}) & ({
|
|
1759
|
+
seconds: number;
|
|
1760
|
+
} | {
|
|
1761
|
+
minutes: number;
|
|
1762
|
+
} | {
|
|
1763
|
+
hours: number;
|
|
1764
|
+
} | undefined);
|
|
1765
|
+
} | {
|
|
1766
|
+
type: "sliding-window";
|
|
1767
|
+
limit: number;
|
|
1768
|
+
window: ({
|
|
1769
|
+
seconds: number;
|
|
1770
|
+
} | {
|
|
1771
|
+
minutes: number;
|
|
1772
|
+
} | {
|
|
1773
|
+
hours: number;
|
|
1774
|
+
}) & ({
|
|
1775
|
+
seconds: number;
|
|
1776
|
+
} | {
|
|
1777
|
+
minutes: number;
|
|
1778
|
+
} | {
|
|
1779
|
+
hours: number;
|
|
1780
|
+
} | undefined);
|
|
1781
|
+
} | undefined;
|
|
1782
|
+
}, {
|
|
1783
|
+
name?: string | undefined;
|
|
1784
|
+
concurrencyLimit?: number | undefined;
|
|
1785
|
+
rateLimit?: {
|
|
1786
|
+
type: "fixed-window";
|
|
1787
|
+
limit: number;
|
|
1788
|
+
window: ({
|
|
1789
|
+
seconds: number;
|
|
1790
|
+
} | {
|
|
1791
|
+
minutes: number;
|
|
1792
|
+
} | {
|
|
1793
|
+
hours: number;
|
|
1794
|
+
}) & ({
|
|
1795
|
+
seconds: number;
|
|
1796
|
+
} | {
|
|
1797
|
+
minutes: number;
|
|
1798
|
+
} | {
|
|
1799
|
+
hours: number;
|
|
1800
|
+
} | undefined);
|
|
1801
|
+
} | {
|
|
1802
|
+
type: "sliding-window";
|
|
1803
|
+
limit: number;
|
|
1804
|
+
window: ({
|
|
1805
|
+
seconds: number;
|
|
1806
|
+
} | {
|
|
1807
|
+
minutes: number;
|
|
1808
|
+
} | {
|
|
1809
|
+
hours: number;
|
|
1810
|
+
}) & ({
|
|
1811
|
+
seconds: number;
|
|
1812
|
+
} | {
|
|
1813
|
+
minutes: number;
|
|
1814
|
+
} | {
|
|
1815
|
+
hours: number;
|
|
1816
|
+
} | undefined);
|
|
1817
|
+
} | undefined;
|
|
1818
|
+
}>>;
|
|
1819
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
1820
|
+
/** The number of attempts before giving up */
|
|
1821
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
1822
|
+
/** The exponential factor to use when calculating the next retry time.
|
|
1823
|
+
*
|
|
1824
|
+
* Each subsequent retry will be calculated as `previousTimeout * factor`
|
|
1825
|
+
*/
|
|
1826
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
1827
|
+
/** The minimum time to wait before retrying */
|
|
1828
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1829
|
+
/** The maximum time to wait before retrying */
|
|
1830
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1831
|
+
/** Randomize the timeout between retries.
|
|
1832
|
+
*
|
|
1833
|
+
* This can be useful to prevent the thundering herd problem where all retries happen at the same time.
|
|
1834
|
+
*/
|
|
1835
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
1836
|
+
}, "strip", z.ZodTypeAny, {
|
|
1837
|
+
maxAttempts?: number | undefined;
|
|
1838
|
+
factor?: number | undefined;
|
|
1839
|
+
minTimeoutInMs?: number | undefined;
|
|
1840
|
+
maxTimeoutInMs?: number | undefined;
|
|
1841
|
+
randomize?: boolean | undefined;
|
|
1842
|
+
}, {
|
|
1843
|
+
maxAttempts?: number | undefined;
|
|
1844
|
+
factor?: number | undefined;
|
|
1845
|
+
minTimeoutInMs?: number | undefined;
|
|
1846
|
+
maxTimeoutInMs?: number | undefined;
|
|
1847
|
+
randomize?: boolean | undefined;
|
|
1848
|
+
}>>;
|
|
1849
|
+
machine: z.ZodOptional<z.ZodObject<{
|
|
1850
|
+
version: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"v1">>>;
|
|
1851
|
+
cpu: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>]>>>;
|
|
1852
|
+
memory: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>>;
|
|
1853
|
+
}, "strip", z.ZodTypeAny, {
|
|
1854
|
+
version?: "v1" | undefined;
|
|
1855
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
1856
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
1857
|
+
}, {
|
|
1858
|
+
version?: "v1" | undefined;
|
|
1859
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
1860
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
1861
|
+
}>>;
|
|
1862
|
+
triggerSource: z.ZodOptional<z.ZodString>;
|
|
1863
|
+
}, "strip", z.ZodTypeAny, {
|
|
1864
|
+
id: string;
|
|
1865
|
+
packageVersion: string;
|
|
1866
|
+
queue?: {
|
|
1867
|
+
name?: string | undefined;
|
|
1868
|
+
concurrencyLimit?: number | undefined;
|
|
1869
|
+
rateLimit?: {
|
|
1870
|
+
type: "fixed-window";
|
|
1871
|
+
limit: number;
|
|
1872
|
+
window: ({
|
|
1873
|
+
seconds: number;
|
|
1874
|
+
} | {
|
|
1875
|
+
minutes: number;
|
|
1876
|
+
} | {
|
|
1877
|
+
hours: number;
|
|
1878
|
+
}) & ({
|
|
1879
|
+
seconds: number;
|
|
1880
|
+
} | {
|
|
1881
|
+
minutes: number;
|
|
1882
|
+
} | {
|
|
1883
|
+
hours: number;
|
|
1884
|
+
} | undefined);
|
|
1885
|
+
} | {
|
|
1886
|
+
type: "sliding-window";
|
|
1887
|
+
limit: number;
|
|
1888
|
+
window: ({
|
|
1889
|
+
seconds: number;
|
|
1890
|
+
} | {
|
|
1891
|
+
minutes: number;
|
|
1892
|
+
} | {
|
|
1893
|
+
hours: number;
|
|
1894
|
+
}) & ({
|
|
1895
|
+
seconds: number;
|
|
1896
|
+
} | {
|
|
1897
|
+
minutes: number;
|
|
1898
|
+
} | {
|
|
1899
|
+
hours: number;
|
|
1900
|
+
} | undefined);
|
|
1901
|
+
} | undefined;
|
|
1902
|
+
} | undefined;
|
|
1903
|
+
retry?: {
|
|
1904
|
+
maxAttempts?: number | undefined;
|
|
1905
|
+
factor?: number | undefined;
|
|
1906
|
+
minTimeoutInMs?: number | undefined;
|
|
1907
|
+
maxTimeoutInMs?: number | undefined;
|
|
1908
|
+
randomize?: boolean | undefined;
|
|
1909
|
+
} | undefined;
|
|
1910
|
+
machine?: {
|
|
1911
|
+
version?: "v1" | undefined;
|
|
1912
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
1913
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
1914
|
+
} | undefined;
|
|
1915
|
+
triggerSource?: string | undefined;
|
|
1916
|
+
}, {
|
|
1917
|
+
id: string;
|
|
1918
|
+
packageVersion: string;
|
|
1919
|
+
queue?: {
|
|
1920
|
+
name?: string | undefined;
|
|
1921
|
+
concurrencyLimit?: number | undefined;
|
|
1922
|
+
rateLimit?: {
|
|
1923
|
+
type: "fixed-window";
|
|
1924
|
+
limit: number;
|
|
1925
|
+
window: ({
|
|
1926
|
+
seconds: number;
|
|
1927
|
+
} | {
|
|
1928
|
+
minutes: number;
|
|
1929
|
+
} | {
|
|
1930
|
+
hours: number;
|
|
1931
|
+
}) & ({
|
|
1932
|
+
seconds: number;
|
|
1933
|
+
} | {
|
|
1934
|
+
minutes: number;
|
|
1935
|
+
} | {
|
|
1936
|
+
hours: number;
|
|
1937
|
+
} | undefined);
|
|
1938
|
+
} | {
|
|
1939
|
+
type: "sliding-window";
|
|
1940
|
+
limit: number;
|
|
1941
|
+
window: ({
|
|
1942
|
+
seconds: number;
|
|
1943
|
+
} | {
|
|
1944
|
+
minutes: number;
|
|
1945
|
+
} | {
|
|
1946
|
+
hours: number;
|
|
1947
|
+
}) & ({
|
|
1948
|
+
seconds: number;
|
|
1949
|
+
} | {
|
|
1950
|
+
minutes: number;
|
|
1951
|
+
} | {
|
|
1952
|
+
hours: number;
|
|
1953
|
+
} | undefined);
|
|
1954
|
+
} | undefined;
|
|
1955
|
+
} | undefined;
|
|
1956
|
+
retry?: {
|
|
1957
|
+
maxAttempts?: number | undefined;
|
|
1958
|
+
factor?: number | undefined;
|
|
1959
|
+
minTimeoutInMs?: number | undefined;
|
|
1960
|
+
maxTimeoutInMs?: number | undefined;
|
|
1961
|
+
randomize?: boolean | undefined;
|
|
1962
|
+
} | undefined;
|
|
1963
|
+
machine?: {
|
|
1964
|
+
version?: "v1" | undefined;
|
|
1965
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
1966
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
1967
|
+
} | undefined;
|
|
1968
|
+
triggerSource?: string | undefined;
|
|
1969
|
+
}>;
|
|
1970
|
+
type TaskMetadata = z.infer<typeof TaskMetadata>;
|
|
1971
|
+
declare const TaskFileMetadata: z.ZodObject<{
|
|
1972
|
+
filePath: z.ZodString;
|
|
1973
|
+
exportName: z.ZodString;
|
|
1974
|
+
}, "strip", z.ZodTypeAny, {
|
|
1975
|
+
filePath: string;
|
|
1976
|
+
exportName: string;
|
|
1977
|
+
}, {
|
|
1978
|
+
filePath: string;
|
|
1979
|
+
exportName: string;
|
|
1980
|
+
}>;
|
|
1981
|
+
type TaskFileMetadata = z.infer<typeof TaskFileMetadata>;
|
|
1982
|
+
declare const TaskMetadataWithFilePath: z.ZodObject<{
|
|
1983
|
+
id: z.ZodString;
|
|
1984
|
+
queue: z.ZodOptional<z.ZodObject<{
|
|
1985
|
+
/** You can define a shared queue and then pass the name in to your task.
|
|
1986
|
+
*
|
|
1987
|
+
* @example
|
|
1988
|
+
*
|
|
1989
|
+
* ```ts
|
|
1990
|
+
* const myQueue = queue({
|
|
1991
|
+
name: "my-queue",
|
|
1992
|
+
concurrencyLimit: 1,
|
|
1993
|
+
});
|
|
1994
|
+
|
|
1995
|
+
export const task1 = task({
|
|
1996
|
+
id: "task-1",
|
|
1997
|
+
queue: {
|
|
1998
|
+
name: "my-queue",
|
|
1999
|
+
},
|
|
2000
|
+
run: async (payload: { message: string }) => {
|
|
2001
|
+
// ...
|
|
2002
|
+
},
|
|
2003
|
+
});
|
|
2004
|
+
|
|
2005
|
+
export const task2 = task({
|
|
2006
|
+
id: "task-2",
|
|
2007
|
+
queue: {
|
|
2008
|
+
name: "my-queue",
|
|
2009
|
+
},
|
|
2010
|
+
run: async (payload: { message: string }) => {
|
|
2011
|
+
// ...
|
|
2012
|
+
},
|
|
2013
|
+
});
|
|
2014
|
+
* ```
|
|
2015
|
+
*/
|
|
2016
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2017
|
+
/** An optional property that specifies the maximum number of concurrent run executions.
|
|
2018
|
+
*
|
|
2019
|
+
* If this property is omitted, the task can potentially use up the full concurrency of an environment. */
|
|
2020
|
+
concurrencyLimit: z.ZodOptional<z.ZodNumber>;
|
|
2021
|
+
/** @deprecated This feature is coming soon */
|
|
2022
|
+
rateLimit: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2023
|
+
type: z.ZodLiteral<"fixed-window">;
|
|
2024
|
+
limit: z.ZodNumber;
|
|
2025
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
2026
|
+
seconds: z.ZodNumber;
|
|
2027
|
+
}, "strip", z.ZodTypeAny, {
|
|
2028
|
+
seconds: number;
|
|
2029
|
+
}, {
|
|
2030
|
+
seconds: number;
|
|
2031
|
+
}>, z.ZodObject<{
|
|
2032
|
+
minutes: z.ZodNumber;
|
|
2033
|
+
}, "strip", z.ZodTypeAny, {
|
|
2034
|
+
minutes: number;
|
|
2035
|
+
}, {
|
|
2036
|
+
minutes: number;
|
|
2037
|
+
}>, z.ZodObject<{
|
|
2038
|
+
hours: z.ZodNumber;
|
|
2039
|
+
}, "strip", z.ZodTypeAny, {
|
|
2040
|
+
hours: number;
|
|
2041
|
+
}, {
|
|
2042
|
+
hours: number;
|
|
2043
|
+
}>]>;
|
|
2044
|
+
}, "strip", z.ZodTypeAny, {
|
|
2045
|
+
type: "fixed-window";
|
|
2046
|
+
limit: number;
|
|
2047
|
+
window: ({
|
|
2048
|
+
seconds: number;
|
|
2049
|
+
} | {
|
|
2050
|
+
minutes: number;
|
|
2051
|
+
} | {
|
|
2052
|
+
hours: number;
|
|
2053
|
+
}) & ({
|
|
2054
|
+
seconds: number;
|
|
2055
|
+
} | {
|
|
2056
|
+
minutes: number;
|
|
2057
|
+
} | {
|
|
2058
|
+
hours: number;
|
|
2059
|
+
} | undefined);
|
|
2060
|
+
}, {
|
|
2061
|
+
type: "fixed-window";
|
|
2062
|
+
limit: number;
|
|
2063
|
+
window: ({
|
|
2064
|
+
seconds: number;
|
|
2065
|
+
} | {
|
|
2066
|
+
minutes: number;
|
|
2067
|
+
} | {
|
|
2068
|
+
hours: number;
|
|
2069
|
+
}) & ({
|
|
2070
|
+
seconds: number;
|
|
2071
|
+
} | {
|
|
2072
|
+
minutes: number;
|
|
2073
|
+
} | {
|
|
2074
|
+
hours: number;
|
|
2075
|
+
} | undefined);
|
|
2076
|
+
}>, z.ZodObject<{
|
|
2077
|
+
type: z.ZodLiteral<"sliding-window">;
|
|
2078
|
+
limit: z.ZodNumber;
|
|
2079
|
+
window: z.ZodUnion<[z.ZodObject<{
|
|
2080
|
+
seconds: z.ZodNumber;
|
|
2081
|
+
}, "strip", z.ZodTypeAny, {
|
|
2082
|
+
seconds: number;
|
|
2083
|
+
}, {
|
|
2084
|
+
seconds: number;
|
|
2085
|
+
}>, z.ZodObject<{
|
|
2086
|
+
minutes: z.ZodNumber;
|
|
2087
|
+
}, "strip", z.ZodTypeAny, {
|
|
2088
|
+
minutes: number;
|
|
2089
|
+
}, {
|
|
2090
|
+
minutes: number;
|
|
2091
|
+
}>, z.ZodObject<{
|
|
2092
|
+
hours: z.ZodNumber;
|
|
2093
|
+
}, "strip", z.ZodTypeAny, {
|
|
2094
|
+
hours: number;
|
|
2095
|
+
}, {
|
|
2096
|
+
hours: number;
|
|
2097
|
+
}>]>;
|
|
2098
|
+
}, "strip", z.ZodTypeAny, {
|
|
2099
|
+
type: "sliding-window";
|
|
2100
|
+
limit: number;
|
|
2101
|
+
window: ({
|
|
2102
|
+
seconds: number;
|
|
2103
|
+
} | {
|
|
2104
|
+
minutes: number;
|
|
2105
|
+
} | {
|
|
2106
|
+
hours: number;
|
|
2107
|
+
}) & ({
|
|
2108
|
+
seconds: number;
|
|
2109
|
+
} | {
|
|
2110
|
+
minutes: number;
|
|
2111
|
+
} | {
|
|
2112
|
+
hours: number;
|
|
2113
|
+
} | undefined);
|
|
2114
|
+
}, {
|
|
2115
|
+
type: "sliding-window";
|
|
2116
|
+
limit: number;
|
|
2117
|
+
window: ({
|
|
2118
|
+
seconds: number;
|
|
2119
|
+
} | {
|
|
2120
|
+
minutes: number;
|
|
2121
|
+
} | {
|
|
2122
|
+
hours: number;
|
|
2123
|
+
}) & ({
|
|
2124
|
+
seconds: number;
|
|
2125
|
+
} | {
|
|
2126
|
+
minutes: number;
|
|
2127
|
+
} | {
|
|
2128
|
+
hours: number;
|
|
2129
|
+
} | undefined);
|
|
2130
|
+
}>]>>;
|
|
2131
|
+
}, "strip", z.ZodTypeAny, {
|
|
2132
|
+
name?: string | undefined;
|
|
2133
|
+
concurrencyLimit?: number | undefined;
|
|
2134
|
+
rateLimit?: {
|
|
2135
|
+
type: "fixed-window";
|
|
2136
|
+
limit: number;
|
|
2137
|
+
window: ({
|
|
2138
|
+
seconds: number;
|
|
2139
|
+
} | {
|
|
2140
|
+
minutes: number;
|
|
2141
|
+
} | {
|
|
2142
|
+
hours: number;
|
|
2143
|
+
}) & ({
|
|
2144
|
+
seconds: number;
|
|
2145
|
+
} | {
|
|
2146
|
+
minutes: number;
|
|
2147
|
+
} | {
|
|
2148
|
+
hours: number;
|
|
2149
|
+
} | undefined);
|
|
2150
|
+
} | {
|
|
2151
|
+
type: "sliding-window";
|
|
2152
|
+
limit: number;
|
|
2153
|
+
window: ({
|
|
2154
|
+
seconds: number;
|
|
2155
|
+
} | {
|
|
2156
|
+
minutes: number;
|
|
2157
|
+
} | {
|
|
2158
|
+
hours: number;
|
|
2159
|
+
}) & ({
|
|
2160
|
+
seconds: number;
|
|
2161
|
+
} | {
|
|
2162
|
+
minutes: number;
|
|
2163
|
+
} | {
|
|
2164
|
+
hours: number;
|
|
2165
|
+
} | undefined);
|
|
2166
|
+
} | undefined;
|
|
2167
|
+
}, {
|
|
2168
|
+
name?: string | undefined;
|
|
2169
|
+
concurrencyLimit?: number | undefined;
|
|
2170
|
+
rateLimit?: {
|
|
2171
|
+
type: "fixed-window";
|
|
2172
|
+
limit: number;
|
|
2173
|
+
window: ({
|
|
2174
|
+
seconds: number;
|
|
2175
|
+
} | {
|
|
2176
|
+
minutes: number;
|
|
2177
|
+
} | {
|
|
2178
|
+
hours: number;
|
|
2179
|
+
}) & ({
|
|
2180
|
+
seconds: number;
|
|
2181
|
+
} | {
|
|
2182
|
+
minutes: number;
|
|
2183
|
+
} | {
|
|
2184
|
+
hours: number;
|
|
2185
|
+
} | undefined);
|
|
2186
|
+
} | {
|
|
2187
|
+
type: "sliding-window";
|
|
2188
|
+
limit: number;
|
|
2189
|
+
window: ({
|
|
2190
|
+
seconds: number;
|
|
2191
|
+
} | {
|
|
2192
|
+
minutes: number;
|
|
2193
|
+
} | {
|
|
2194
|
+
hours: number;
|
|
2195
|
+
}) & ({
|
|
2196
|
+
seconds: number;
|
|
2197
|
+
} | {
|
|
2198
|
+
minutes: number;
|
|
2199
|
+
} | {
|
|
2200
|
+
hours: number;
|
|
2201
|
+
} | undefined);
|
|
2202
|
+
} | undefined;
|
|
2203
|
+
}>>;
|
|
2204
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
2205
|
+
/** The number of attempts before giving up */
|
|
2206
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
2207
|
+
/** The exponential factor to use when calculating the next retry time.
|
|
2208
|
+
*
|
|
2209
|
+
* Each subsequent retry will be calculated as `previousTimeout * factor`
|
|
2210
|
+
*/
|
|
2211
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
2212
|
+
/** The minimum time to wait before retrying */
|
|
2213
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2214
|
+
/** The maximum time to wait before retrying */
|
|
2215
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2216
|
+
/** Randomize the timeout between retries.
|
|
2217
|
+
*
|
|
2218
|
+
* This can be useful to prevent the thundering herd problem where all retries happen at the same time.
|
|
2219
|
+
*/
|
|
2220
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
2221
|
+
}, "strip", z.ZodTypeAny, {
|
|
2222
|
+
maxAttempts?: number | undefined;
|
|
2223
|
+
factor?: number | undefined;
|
|
2224
|
+
minTimeoutInMs?: number | undefined;
|
|
2225
|
+
maxTimeoutInMs?: number | undefined;
|
|
2226
|
+
randomize?: boolean | undefined;
|
|
2227
|
+
}, {
|
|
2228
|
+
maxAttempts?: number | undefined;
|
|
2229
|
+
factor?: number | undefined;
|
|
2230
|
+
minTimeoutInMs?: number | undefined;
|
|
2231
|
+
maxTimeoutInMs?: number | undefined;
|
|
2232
|
+
randomize?: boolean | undefined;
|
|
2233
|
+
}>>;
|
|
2234
|
+
packageVersion: z.ZodString;
|
|
2235
|
+
machine: z.ZodOptional<z.ZodObject<{
|
|
2236
|
+
version: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"v1">>>;
|
|
2237
|
+
cpu: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>]>>>;
|
|
2238
|
+
memory: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<0.25>, z.ZodLiteral<0.5>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>>;
|
|
2239
|
+
}, "strip", z.ZodTypeAny, {
|
|
2240
|
+
version?: "v1" | undefined;
|
|
2241
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
2242
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
2243
|
+
}, {
|
|
2244
|
+
version?: "v1" | undefined;
|
|
2245
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
2246
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
2247
|
+
}>>;
|
|
2248
|
+
triggerSource: z.ZodOptional<z.ZodString>;
|
|
2249
|
+
filePath: z.ZodString;
|
|
2250
|
+
exportName: z.ZodString;
|
|
2251
|
+
}, "strip", z.ZodTypeAny, {
|
|
2252
|
+
id: string;
|
|
2253
|
+
filePath: string;
|
|
2254
|
+
exportName: string;
|
|
2255
|
+
packageVersion: string;
|
|
2256
|
+
queue?: {
|
|
2257
|
+
name?: string | undefined;
|
|
2258
|
+
concurrencyLimit?: number | undefined;
|
|
2259
|
+
rateLimit?: {
|
|
2260
|
+
type: "fixed-window";
|
|
2261
|
+
limit: number;
|
|
2262
|
+
window: ({
|
|
2263
|
+
seconds: number;
|
|
2264
|
+
} | {
|
|
2265
|
+
minutes: number;
|
|
2266
|
+
} | {
|
|
2267
|
+
hours: number;
|
|
2268
|
+
}) & ({
|
|
2269
|
+
seconds: number;
|
|
2270
|
+
} | {
|
|
2271
|
+
minutes: number;
|
|
2272
|
+
} | {
|
|
2273
|
+
hours: number;
|
|
2274
|
+
} | undefined);
|
|
2275
|
+
} | {
|
|
2276
|
+
type: "sliding-window";
|
|
2277
|
+
limit: number;
|
|
2278
|
+
window: ({
|
|
2279
|
+
seconds: number;
|
|
2280
|
+
} | {
|
|
2281
|
+
minutes: number;
|
|
2282
|
+
} | {
|
|
2283
|
+
hours: number;
|
|
2284
|
+
}) & ({
|
|
2285
|
+
seconds: number;
|
|
2286
|
+
} | {
|
|
2287
|
+
minutes: number;
|
|
2288
|
+
} | {
|
|
2289
|
+
hours: number;
|
|
2290
|
+
} | undefined);
|
|
2291
|
+
} | undefined;
|
|
2292
|
+
} | undefined;
|
|
2293
|
+
retry?: {
|
|
2294
|
+
maxAttempts?: number | undefined;
|
|
2295
|
+
factor?: number | undefined;
|
|
2296
|
+
minTimeoutInMs?: number | undefined;
|
|
2297
|
+
maxTimeoutInMs?: number | undefined;
|
|
2298
|
+
randomize?: boolean | undefined;
|
|
2299
|
+
} | undefined;
|
|
2300
|
+
machine?: {
|
|
2301
|
+
version?: "v1" | undefined;
|
|
2302
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
2303
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
2304
|
+
} | undefined;
|
|
2305
|
+
triggerSource?: string | undefined;
|
|
2306
|
+
}, {
|
|
2307
|
+
id: string;
|
|
2308
|
+
filePath: string;
|
|
2309
|
+
exportName: string;
|
|
2310
|
+
packageVersion: string;
|
|
2311
|
+
queue?: {
|
|
2312
|
+
name?: string | undefined;
|
|
2313
|
+
concurrencyLimit?: number | undefined;
|
|
2314
|
+
rateLimit?: {
|
|
2315
|
+
type: "fixed-window";
|
|
2316
|
+
limit: number;
|
|
2317
|
+
window: ({
|
|
2318
|
+
seconds: number;
|
|
2319
|
+
} | {
|
|
2320
|
+
minutes: number;
|
|
2321
|
+
} | {
|
|
2322
|
+
hours: number;
|
|
2323
|
+
}) & ({
|
|
2324
|
+
seconds: number;
|
|
2325
|
+
} | {
|
|
2326
|
+
minutes: number;
|
|
2327
|
+
} | {
|
|
2328
|
+
hours: number;
|
|
2329
|
+
} | undefined);
|
|
2330
|
+
} | {
|
|
2331
|
+
type: "sliding-window";
|
|
2332
|
+
limit: number;
|
|
2333
|
+
window: ({
|
|
2334
|
+
seconds: number;
|
|
2335
|
+
} | {
|
|
2336
|
+
minutes: number;
|
|
2337
|
+
} | {
|
|
2338
|
+
hours: number;
|
|
2339
|
+
}) & ({
|
|
2340
|
+
seconds: number;
|
|
2341
|
+
} | {
|
|
2342
|
+
minutes: number;
|
|
2343
|
+
} | {
|
|
2344
|
+
hours: number;
|
|
2345
|
+
} | undefined);
|
|
2346
|
+
} | undefined;
|
|
2347
|
+
} | undefined;
|
|
2348
|
+
retry?: {
|
|
2349
|
+
maxAttempts?: number | undefined;
|
|
2350
|
+
factor?: number | undefined;
|
|
2351
|
+
minTimeoutInMs?: number | undefined;
|
|
2352
|
+
maxTimeoutInMs?: number | undefined;
|
|
2353
|
+
randomize?: boolean | undefined;
|
|
2354
|
+
} | undefined;
|
|
2355
|
+
machine?: {
|
|
2356
|
+
version?: "v1" | undefined;
|
|
2357
|
+
cpu?: 2 | 1 | 4 | 0.25 | 0.5 | undefined;
|
|
2358
|
+
memory?: 2 | 1 | 4 | 0.25 | 0.5 | 8 | undefined;
|
|
2359
|
+
} | undefined;
|
|
2360
|
+
triggerSource?: string | undefined;
|
|
2361
|
+
}>;
|
|
2362
|
+
type TaskMetadataWithFilePath = z.infer<typeof TaskMetadataWithFilePath>;
|
|
2363
|
+
declare const PostStartCauses: z.ZodEnum<["index", "create", "restore"]>;
|
|
2364
|
+
type PostStartCauses = z.infer<typeof PostStartCauses>;
|
|
2365
|
+
declare const PreStopCauses: z.ZodEnum<["terminate"]>;
|
|
2366
|
+
type PreStopCauses = z.infer<typeof PreStopCauses>;
|
|
2367
|
+
declare const Config: z.ZodObject<{
|
|
2368
|
+
project: z.ZodString;
|
|
2369
|
+
triggerDirectories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2370
|
+
triggerUrl: z.ZodOptional<z.ZodString>;
|
|
2371
|
+
projectDir: z.ZodOptional<z.ZodString>;
|
|
2372
|
+
tsconfigPath: z.ZodOptional<z.ZodString>;
|
|
2373
|
+
retries: z.ZodOptional<z.ZodObject<{
|
|
2374
|
+
enabledInDev: z.ZodDefault<z.ZodBoolean>;
|
|
2375
|
+
default: z.ZodOptional<z.ZodObject<{
|
|
2376
|
+
/** The number of attempts before giving up */
|
|
2377
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
2378
|
+
/** The exponential factor to use when calculating the next retry time.
|
|
2379
|
+
*
|
|
2380
|
+
* Each subsequent retry will be calculated as `previousTimeout * factor`
|
|
2381
|
+
*/
|
|
2382
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
2383
|
+
/** The minimum time to wait before retrying */
|
|
2384
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2385
|
+
/** The maximum time to wait before retrying */
|
|
2386
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2387
|
+
/** Randomize the timeout between retries.
|
|
2388
|
+
*
|
|
2389
|
+
* This can be useful to prevent the thundering herd problem where all retries happen at the same time.
|
|
2390
|
+
*/
|
|
2391
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
2392
|
+
}, "strip", z.ZodTypeAny, {
|
|
2393
|
+
maxAttempts?: number | undefined;
|
|
2394
|
+
factor?: number | undefined;
|
|
2395
|
+
minTimeoutInMs?: number | undefined;
|
|
2396
|
+
maxTimeoutInMs?: number | undefined;
|
|
2397
|
+
randomize?: boolean | undefined;
|
|
2398
|
+
}, {
|
|
2399
|
+
maxAttempts?: number | undefined;
|
|
2400
|
+
factor?: number | undefined;
|
|
2401
|
+
minTimeoutInMs?: number | undefined;
|
|
2402
|
+
maxTimeoutInMs?: number | undefined;
|
|
2403
|
+
randomize?: boolean | undefined;
|
|
2404
|
+
}>>;
|
|
2405
|
+
}, "strip", z.ZodTypeAny, {
|
|
2406
|
+
enabledInDev: boolean;
|
|
2407
|
+
default?: {
|
|
2408
|
+
maxAttempts?: number | undefined;
|
|
2409
|
+
factor?: number | undefined;
|
|
2410
|
+
minTimeoutInMs?: number | undefined;
|
|
2411
|
+
maxTimeoutInMs?: number | undefined;
|
|
2412
|
+
randomize?: boolean | undefined;
|
|
2413
|
+
} | undefined;
|
|
2414
|
+
}, {
|
|
2415
|
+
enabledInDev?: boolean | undefined;
|
|
2416
|
+
default?: {
|
|
2417
|
+
maxAttempts?: number | undefined;
|
|
2418
|
+
factor?: number | undefined;
|
|
2419
|
+
minTimeoutInMs?: number | undefined;
|
|
2420
|
+
maxTimeoutInMs?: number | undefined;
|
|
2421
|
+
randomize?: boolean | undefined;
|
|
2422
|
+
} | undefined;
|
|
2423
|
+
}>>;
|
|
2424
|
+
additionalPackages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2425
|
+
additionalFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2426
|
+
dependenciesToBundle: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
|
|
2427
|
+
logLevel: z.ZodOptional<z.ZodString>;
|
|
2428
|
+
enableConsoleLogging: z.ZodOptional<z.ZodBoolean>;
|
|
2429
|
+
postInstall: z.ZodOptional<z.ZodString>;
|
|
2430
|
+
}, "strip", z.ZodTypeAny, {
|
|
2431
|
+
project: string;
|
|
2432
|
+
triggerDirectories?: string[] | undefined;
|
|
2433
|
+
triggerUrl?: string | undefined;
|
|
2434
|
+
projectDir?: string | undefined;
|
|
2435
|
+
tsconfigPath?: string | undefined;
|
|
2436
|
+
retries?: {
|
|
2437
|
+
enabledInDev: boolean;
|
|
2438
|
+
default?: {
|
|
2439
|
+
maxAttempts?: number | undefined;
|
|
2440
|
+
factor?: number | undefined;
|
|
2441
|
+
minTimeoutInMs?: number | undefined;
|
|
2442
|
+
maxTimeoutInMs?: number | undefined;
|
|
2443
|
+
randomize?: boolean | undefined;
|
|
2444
|
+
} | undefined;
|
|
2445
|
+
} | undefined;
|
|
2446
|
+
additionalPackages?: string[] | undefined;
|
|
2447
|
+
additionalFiles?: string[] | undefined;
|
|
2448
|
+
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2449
|
+
logLevel?: string | undefined;
|
|
2450
|
+
enableConsoleLogging?: boolean | undefined;
|
|
2451
|
+
postInstall?: string | undefined;
|
|
2452
|
+
}, {
|
|
2453
|
+
project: string;
|
|
2454
|
+
triggerDirectories?: string[] | undefined;
|
|
2455
|
+
triggerUrl?: string | undefined;
|
|
2456
|
+
projectDir?: string | undefined;
|
|
2457
|
+
tsconfigPath?: string | undefined;
|
|
2458
|
+
retries?: {
|
|
2459
|
+
enabledInDev?: boolean | undefined;
|
|
2460
|
+
default?: {
|
|
2461
|
+
maxAttempts?: number | undefined;
|
|
2462
|
+
factor?: number | undefined;
|
|
2463
|
+
minTimeoutInMs?: number | undefined;
|
|
2464
|
+
maxTimeoutInMs?: number | undefined;
|
|
2465
|
+
randomize?: boolean | undefined;
|
|
2466
|
+
} | undefined;
|
|
2467
|
+
} | undefined;
|
|
2468
|
+
additionalPackages?: string[] | undefined;
|
|
2469
|
+
additionalFiles?: string[] | undefined;
|
|
2470
|
+
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2471
|
+
logLevel?: string | undefined;
|
|
2472
|
+
enableConsoleLogging?: boolean | undefined;
|
|
2473
|
+
postInstall?: string | undefined;
|
|
2474
|
+
}>;
|
|
2475
|
+
type Config = z.infer<typeof Config>;
|
|
2476
|
+
type ResolvedConfig = RequireKeys<Config, "triggerDirectories" | "triggerUrl" | "projectDir" | "tsconfigPath">;
|
|
2477
|
+
declare const WaitReason: z.ZodEnum<["WAIT_FOR_DURATION", "WAIT_FOR_TASK", "WAIT_FOR_BATCH"]>;
|
|
2478
|
+
type WaitReason = z.infer<typeof WaitReason>;
|
|
2479
|
+
|
|
2480
|
+
type ClockTime = [number, number];
|
|
2481
|
+
interface Clock {
|
|
2482
|
+
preciseNow(): ClockTime;
|
|
2483
|
+
reset(): void;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
interface TaskCatalog {
|
|
2487
|
+
registerTaskMetadata(task: TaskMetadataWithFunctions): void;
|
|
2488
|
+
updateTaskMetadata(id: string, task: Partial<TaskMetadataWithFunctions>): void;
|
|
2489
|
+
registerTaskFileMetadata(id: string, metadata: TaskFileMetadata): void;
|
|
2490
|
+
getAllTaskMetadata(): Array<TaskMetadataWithFilePath>;
|
|
2491
|
+
getTaskMetadata(id: string): TaskMetadataWithFilePath | undefined;
|
|
2492
|
+
getTask(id: string): TaskMetadataWithFunctions | undefined;
|
|
2493
|
+
taskExists(id: string): boolean;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
export { type HandleErrorArgs as A, type HandleErrorFunction as B, type Clock as C, type RequireKeys as D, EnvironmentType as E, FixedWindowRateLimit as F, type ProjectConfig as G, type HandleErrorFnParams as H, type InitOutput as I, logLevels as J, type LogLevel as L, MachineCpu as M, OtelTaskLogger as O, type Prettify as P, QueueOptions as Q, RetryOptions as R, SlidingWindowRateLimit as S, type TaskLogger as T, WaitReason as W, type ClockTime as a, type TaskCatalog as b, type TaskMetadataWithFunctions as c, TaskFileMetadata as d, TaskMetadataWithFilePath as e, TriggerTracer as f, MachineMemory as g, Machine as h, TaskRunExecutionPayload as i, ProdTaskRunExecution as j, ProdTaskRunExecutionPayload as k, RateLimitOptions as l, TaskMetadata as m, PostStartCauses as n, PreStopCauses as o, Config as p, type ResolvedConfig as q, type RunFnParams as r, type MiddlewareFnParams as s, type InitFnParams as t, type StartFnParams as u, type Context as v, type SuccessFnParams as w, type FailureFnParams as x, type HandleErrorModificationOptions as y, type HandleErrorResult as z };
|