@trigger.dev/core 2.0.3 → 2.0.4
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/index.d.ts +41 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -680,6 +680,46 @@ declare const PongResponseSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
|
680
680
|
ok: false;
|
|
681
681
|
}>]>;
|
|
682
682
|
type PongResponse = z.infer<typeof PongResponseSchema>;
|
|
683
|
+
declare const ValidateSuccessResponseSchema: z.ZodObject<{
|
|
684
|
+
ok: z.ZodLiteral<true>;
|
|
685
|
+
endpointId: z.ZodString;
|
|
686
|
+
}, "strip", z.ZodTypeAny, {
|
|
687
|
+
ok: true;
|
|
688
|
+
endpointId: string;
|
|
689
|
+
}, {
|
|
690
|
+
ok: true;
|
|
691
|
+
endpointId: string;
|
|
692
|
+
}>;
|
|
693
|
+
declare const ValidateErrorResponseSchema: z.ZodObject<{
|
|
694
|
+
ok: z.ZodLiteral<false>;
|
|
695
|
+
error: z.ZodString;
|
|
696
|
+
}, "strip", z.ZodTypeAny, {
|
|
697
|
+
error: string;
|
|
698
|
+
ok: false;
|
|
699
|
+
}, {
|
|
700
|
+
error: string;
|
|
701
|
+
ok: false;
|
|
702
|
+
}>;
|
|
703
|
+
declare const ValidateResponseSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
|
|
704
|
+
ok: z.ZodLiteral<true>;
|
|
705
|
+
endpointId: z.ZodString;
|
|
706
|
+
}, "strip", z.ZodTypeAny, {
|
|
707
|
+
ok: true;
|
|
708
|
+
endpointId: string;
|
|
709
|
+
}, {
|
|
710
|
+
ok: true;
|
|
711
|
+
endpointId: string;
|
|
712
|
+
}>, z.ZodObject<{
|
|
713
|
+
ok: z.ZodLiteral<false>;
|
|
714
|
+
error: z.ZodString;
|
|
715
|
+
}, "strip", z.ZodTypeAny, {
|
|
716
|
+
error: string;
|
|
717
|
+
ok: false;
|
|
718
|
+
}, {
|
|
719
|
+
error: string;
|
|
720
|
+
ok: false;
|
|
721
|
+
}>]>;
|
|
722
|
+
type ValidateResponse = z.infer<typeof ValidateResponseSchema>;
|
|
683
723
|
declare const QueueOptionsSchema: z.ZodObject<{
|
|
684
724
|
name: z.ZodString;
|
|
685
725
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
@@ -9046,4 +9086,4 @@ declare const replacements: ExampleReplacement[];
|
|
|
9046
9086
|
|
|
9047
9087
|
declare function urlWithSearchParams(url: string, params: Record<string, string | number | boolean> | undefined): string;
|
|
9048
9088
|
|
|
9049
|
-
export { ApiEventLog, ApiEventLogSchema, CachedTask, CachedTaskSchema, ClientTask, CommonMissingConnectionNotificationPayloadSchema, CommonMissingConnectionNotificationResolvedPayloadSchema, CompleteTaskBodyInput, CompleteTaskBodyInputSchema, CompleteTaskBodyOutput, ConnectionAuth, ConnectionAuthSchema, CreateExternalConnectionBody, CreateExternalConnectionBodySchema, CreateRunBody, CreateRunBodySchema, CreateRunResponseBody, CreateRunResponseBodySchema, CronMetadata, CronMetadataSchema, CronOptions, CronOptionsSchema, DeliverEventResponse, DeliverEventResponseSchema, DeserializedJson, DeserializedJsonSchema, DisplayPropertiesSchema, DisplayProperty, DisplayPropertySchema, DynamicTriggerEndpointMetadata, DynamicTriggerEndpointMetadataSchema, DynamicTriggerMetadataSchema, ErrorWithStack, ErrorWithStackSchema, EventExample, EventExampleSchema, EventFilter, EventFilterSchema, EventRule, EventRuleSchema, EventSpecificationSchema, ExampleReplacement, FailTaskBodyInput, FailTaskBodyInputSchema, FetchOperation, FetchOperationSchema, FetchRequestInit, FetchRequestInitSchema, FetchRetryBackoffStrategy, FetchRetryBackoffStrategySchema, FetchRetryHeadersStrategy, FetchRetryHeadersStrategySchema, FetchRetryOptions, FetchRetryOptionsSchema, FetchRetryStrategy, FetchRetryStrategySchema, GetEvent, GetEventSchema, GetRun, GetRunOptions, GetRunOptionsWithTaskDetails, GetRunSchema, GetRunsOptions, GetRunsSchema, HandleTriggerSource, HandleTriggerSourceSchema, HttpEventSourceSchema, HttpSourceRequest, HttpSourceRequestHeaders, HttpSourceRequestHeadersSchema, HttpSourceRequestSchema, HttpSourceResponseSchema, IndexEndpointResponse, IndexEndpointResponseSchema, InitializeCronScheduleBodySchema, InitializeTriggerBody, InitializeTriggerBodySchema, IntegrationConfig, IntegrationConfigSchema, IntegrationMetadata, IntegrationMetadataSchema, IntervalMetadata, IntervalMetadataSchema, IntervalOptions, IntervalOptionsSchema, JobMetadata, JobMetadataSchema, LogLevel, LogMessage, LogMessageSchema, Logger, MISSING_CONNECTION_NOTIFICATION, MISSING_CONNECTION_RESOLVED_NOTIFICATION, MissingConnectionNotificationPayload, MissingConnectionNotificationPayloadSchema, MissingConnectionResolvedNotificationPayload, MissingConnectionResolvedNotificationPayloadSchema, MissingDeveloperConnectionNotificationPayloadSchema, MissingDeveloperConnectionResolvedNotificationPayloadSchema, MissingExternalConnectionNotificationPayloadSchema, MissingExternalConnectionResolvedNotificationPayloadSchema, NormalizedRequest, NormalizedRequestSchema, NormalizedResponse, NormalizedResponseSchema, PongErrorResponseSchema, PongResponse, PongResponseSchema, PongSuccessResponseSchema, PreprocessRunBody, PreprocessRunBodySchema, PreprocessRunResponse, PreprocessRunResponseSchema, Prettify, QueueOptions, QueueOptionsSchema, REGISTER_SOURCE_EVENT, RawEvent, RawEventSchema, RedactSchema, RedactString, RedactStringSchema, RegisterCronScheduleBody, RegisterDynamicSchedulePayload, RegisterDynamicSchedulePayloadSchema, RegisterHTTPTriggerSourceBodySchema, RegisterIntervalScheduleBody, RegisterIntervalScheduleBodySchema, RegisterSMTPTriggerSourceBodySchema, RegisterSQSTriggerSourceBodySchema, RegisterScheduleBody, RegisterScheduleBodySchema, RegisterScheduleResponseBody, RegisterScheduleResponseBodySchema, RegisterSourceChannelBodySchema, RegisterSourceEvent, RegisterSourceEventSchema, RegisterTriggerBody, RegisterTriggerBodySchema, RegisterTriggerSource, RegisterTriggerSourceSchema, RetryOptions, RetryOptionsSchema, RunJobBody, RunJobBodySchema, RunJobCanceledWithTask, RunJobCanceledWithTaskSchema, RunJobError, RunJobErrorSchema, RunJobResponse, RunJobResponseSchema, RunJobResumeWithTask, RunJobResumeWithTaskSchema, RunJobRetryWithTask, RunJobRetryWithTaskSchema, RunJobSuccess, RunJobSuccessSchema, RunSourceContextSchema, RunStatusSchema, RunTaskBodyInput, RunTaskBodyInputSchema, RunTaskBodyOutput, RunTaskBodyOutputSchema, RunTaskOptions, RunTaskOptionsSchema, RunTaskSchema, RuntimeEnvironmentType, RuntimeEnvironmentTypeSchema, SCHEDULED_EVENT, ScheduleMetadata, ScheduleMetadataSchema, ScheduledPayload, ScheduledPayloadSchema, ScheduledTriggerMetadataSchema, SendEvent, SendEventBody, SendEventBodySchema, SendEventOptions, SendEventOptionsSchema, SerializableJson, SerializableJsonSchema, ServerTask, ServerTaskSchema, SourceMetadata, SourceMetadataSchema, StaticTriggerMetadataSchema, Style, StyleName, StyleSchema, TaskSchema, TaskStatus, TaskStatusSchema, TriggerMetadata, TriggerMetadataSchema, TriggerSource, TriggerSourceSchema, UpdateTriggerSourceBody, UpdateTriggerSourceBodySchema, calculateRetryAt, currentDate, currentTimestampMilliseconds, currentTimestampSeconds, deepMergeFilters, replacements, urlWithSearchParams };
|
|
9089
|
+
export { ApiEventLog, ApiEventLogSchema, CachedTask, CachedTaskSchema, ClientTask, CommonMissingConnectionNotificationPayloadSchema, CommonMissingConnectionNotificationResolvedPayloadSchema, CompleteTaskBodyInput, CompleteTaskBodyInputSchema, CompleteTaskBodyOutput, ConnectionAuth, ConnectionAuthSchema, CreateExternalConnectionBody, CreateExternalConnectionBodySchema, CreateRunBody, CreateRunBodySchema, CreateRunResponseBody, CreateRunResponseBodySchema, CronMetadata, CronMetadataSchema, CronOptions, CronOptionsSchema, DeliverEventResponse, DeliverEventResponseSchema, DeserializedJson, DeserializedJsonSchema, DisplayPropertiesSchema, DisplayProperty, DisplayPropertySchema, DynamicTriggerEndpointMetadata, DynamicTriggerEndpointMetadataSchema, DynamicTriggerMetadataSchema, ErrorWithStack, ErrorWithStackSchema, EventExample, EventExampleSchema, EventFilter, EventFilterSchema, EventRule, EventRuleSchema, EventSpecificationSchema, ExampleReplacement, FailTaskBodyInput, FailTaskBodyInputSchema, FetchOperation, FetchOperationSchema, FetchRequestInit, FetchRequestInitSchema, FetchRetryBackoffStrategy, FetchRetryBackoffStrategySchema, FetchRetryHeadersStrategy, FetchRetryHeadersStrategySchema, FetchRetryOptions, FetchRetryOptionsSchema, FetchRetryStrategy, FetchRetryStrategySchema, GetEvent, GetEventSchema, GetRun, GetRunOptions, GetRunOptionsWithTaskDetails, GetRunSchema, GetRunsOptions, GetRunsSchema, HandleTriggerSource, HandleTriggerSourceSchema, HttpEventSourceSchema, HttpSourceRequest, HttpSourceRequestHeaders, HttpSourceRequestHeadersSchema, HttpSourceRequestSchema, HttpSourceResponseSchema, IndexEndpointResponse, IndexEndpointResponseSchema, InitializeCronScheduleBodySchema, InitializeTriggerBody, InitializeTriggerBodySchema, IntegrationConfig, IntegrationConfigSchema, IntegrationMetadata, IntegrationMetadataSchema, IntervalMetadata, IntervalMetadataSchema, IntervalOptions, IntervalOptionsSchema, JobMetadata, JobMetadataSchema, LogLevel, LogMessage, LogMessageSchema, Logger, MISSING_CONNECTION_NOTIFICATION, MISSING_CONNECTION_RESOLVED_NOTIFICATION, MissingConnectionNotificationPayload, MissingConnectionNotificationPayloadSchema, MissingConnectionResolvedNotificationPayload, MissingConnectionResolvedNotificationPayloadSchema, MissingDeveloperConnectionNotificationPayloadSchema, MissingDeveloperConnectionResolvedNotificationPayloadSchema, MissingExternalConnectionNotificationPayloadSchema, MissingExternalConnectionResolvedNotificationPayloadSchema, NormalizedRequest, NormalizedRequestSchema, NormalizedResponse, NormalizedResponseSchema, PongErrorResponseSchema, PongResponse, PongResponseSchema, PongSuccessResponseSchema, PreprocessRunBody, PreprocessRunBodySchema, PreprocessRunResponse, PreprocessRunResponseSchema, Prettify, QueueOptions, QueueOptionsSchema, REGISTER_SOURCE_EVENT, RawEvent, RawEventSchema, RedactSchema, RedactString, RedactStringSchema, RegisterCronScheduleBody, RegisterDynamicSchedulePayload, RegisterDynamicSchedulePayloadSchema, RegisterHTTPTriggerSourceBodySchema, RegisterIntervalScheduleBody, RegisterIntervalScheduleBodySchema, RegisterSMTPTriggerSourceBodySchema, RegisterSQSTriggerSourceBodySchema, RegisterScheduleBody, RegisterScheduleBodySchema, RegisterScheduleResponseBody, RegisterScheduleResponseBodySchema, RegisterSourceChannelBodySchema, RegisterSourceEvent, RegisterSourceEventSchema, RegisterTriggerBody, RegisterTriggerBodySchema, RegisterTriggerSource, RegisterTriggerSourceSchema, RetryOptions, RetryOptionsSchema, RunJobBody, RunJobBodySchema, RunJobCanceledWithTask, RunJobCanceledWithTaskSchema, RunJobError, RunJobErrorSchema, RunJobResponse, RunJobResponseSchema, RunJobResumeWithTask, RunJobResumeWithTaskSchema, RunJobRetryWithTask, RunJobRetryWithTaskSchema, RunJobSuccess, RunJobSuccessSchema, RunSourceContextSchema, RunStatusSchema, RunTaskBodyInput, RunTaskBodyInputSchema, RunTaskBodyOutput, RunTaskBodyOutputSchema, RunTaskOptions, RunTaskOptionsSchema, RunTaskSchema, RuntimeEnvironmentType, RuntimeEnvironmentTypeSchema, SCHEDULED_EVENT, ScheduleMetadata, ScheduleMetadataSchema, ScheduledPayload, ScheduledPayloadSchema, ScheduledTriggerMetadataSchema, SendEvent, SendEventBody, SendEventBodySchema, SendEventOptions, SendEventOptionsSchema, SerializableJson, SerializableJsonSchema, ServerTask, ServerTaskSchema, SourceMetadata, SourceMetadataSchema, StaticTriggerMetadataSchema, Style, StyleName, StyleSchema, TaskSchema, TaskStatus, TaskStatusSchema, TriggerMetadata, TriggerMetadataSchema, TriggerSource, TriggerSourceSchema, UpdateTriggerSourceBody, UpdateTriggerSourceBodySchema, ValidateErrorResponseSchema, ValidateResponse, ValidateResponseSchema, ValidateSuccessResponseSchema, calculateRetryAt, currentDate, currentTimestampMilliseconds, currentTimestampSeconds, deepMergeFilters, replacements, urlWithSearchParams };
|
package/dist/index.js
CHANGED
|
@@ -152,6 +152,9 @@ __export(src_exports, {
|
|
|
152
152
|
TriggerMetadataSchema: () => TriggerMetadataSchema,
|
|
153
153
|
TriggerSourceSchema: () => TriggerSourceSchema,
|
|
154
154
|
UpdateTriggerSourceBodySchema: () => UpdateTriggerSourceBodySchema,
|
|
155
|
+
ValidateErrorResponseSchema: () => ValidateErrorResponseSchema,
|
|
156
|
+
ValidateResponseSchema: () => ValidateResponseSchema,
|
|
157
|
+
ValidateSuccessResponseSchema: () => ValidateSuccessResponseSchema,
|
|
155
158
|
calculateRetryAt: () => calculateRetryAt,
|
|
156
159
|
currentDate: () => currentDate,
|
|
157
160
|
currentTimestampMilliseconds: () => currentTimestampMilliseconds,
|
|
@@ -601,6 +604,18 @@ var PongResponseSchema = import_zod9.z.discriminatedUnion("ok", [
|
|
|
601
604
|
PongSuccessResponseSchema,
|
|
602
605
|
PongErrorResponseSchema
|
|
603
606
|
]);
|
|
607
|
+
var ValidateSuccessResponseSchema = import_zod9.z.object({
|
|
608
|
+
ok: import_zod9.z.literal(true),
|
|
609
|
+
endpointId: import_zod9.z.string()
|
|
610
|
+
});
|
|
611
|
+
var ValidateErrorResponseSchema = import_zod9.z.object({
|
|
612
|
+
ok: import_zod9.z.literal(false),
|
|
613
|
+
error: import_zod9.z.string()
|
|
614
|
+
});
|
|
615
|
+
var ValidateResponseSchema = import_zod9.z.discriminatedUnion("ok", [
|
|
616
|
+
ValidateSuccessResponseSchema,
|
|
617
|
+
ValidateErrorResponseSchema
|
|
618
|
+
]);
|
|
604
619
|
var QueueOptionsSchema = import_zod9.z.object({
|
|
605
620
|
name: import_zod9.z.string(),
|
|
606
621
|
maxConcurrent: import_zod9.z.number().optional()
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/logger.ts","../src/schemas/api.ts","../src/schemas/errors.ts","../src/schemas/eventFilter.ts","../src/schemas/integrations.ts","../src/schemas/json.ts","../src/schemas/properties.ts","../src/schemas/schedules.ts","../src/schemas/tasks.ts","../src/schemas/triggers.ts","../src/schemas/notifications.ts","../src/schemas/fetch.ts","../src/schemas/events.ts","../src/schemas/runs.ts","../src/utils.ts","../src/retry.ts","../src/replacements.ts","../src/searchParams.ts"],"sourcesContent":["export * from \"./logger\";\nexport * from \"./schemas\";\nexport * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./retry\";\nexport * from \"./replacements\";\nexport * from \"./searchParams\";\n","// Create a logger class that uses the debug package internally\n\n/**\n * Represents different log levels.\n * - `\"log\"`: Only essential messages.\n * - `\"error\"`: Errors and essential messages.\n * - `\"warn\"`: Warnings, Errors and essential messages.\n * - `\"info\"`: Info, Warnings, Errors and essential messages.\n * - `\"debug\"`: Everything.\n */\nexport type LogLevel = \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\";\n\nconst logLevels: Array<LogLevel> = [\"log\", \"error\", \"warn\", \"info\", \"debug\"];\n\nexport class Logger {\n #name: string;\n readonly #level: number;\n #filteredKeys: string[] = [];\n #jsonReplacer?: (key: string, value: unknown) => unknown;\n\n constructor(\n name: string,\n level: LogLevel = \"info\",\n filteredKeys: string[] = [],\n jsonReplacer?: (key: string, value: unknown) => unknown\n ) {\n this.#name = name;\n this.#level = logLevels.indexOf((process.env.TRIGGER_LOG_LEVEL ?? level) as LogLevel);\n this.#filteredKeys = filteredKeys;\n this.#jsonReplacer = jsonReplacer;\n }\n\n // Return a new Logger instance with the same name and a new log level\n // but filter out the keys from the log messages (at any level)\n filter(...keys: string[]) {\n return new Logger(this.#name, logLevels[this.#level], keys, this.#jsonReplacer);\n }\n\n static satisfiesLogLevel(logLevel: LogLevel, setLevel: LogLevel) {\n return logLevels.indexOf(logLevel) <= logLevels.indexOf(setLevel);\n }\n\n log(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 0) return;\n\n this.#structuredLog(console.log, message, ...args);\n }\n\n error(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 1) return;\n\n this.#structuredLog(console.error, message, ...args);\n }\n\n warn(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 2) return;\n\n this.#structuredLog(console.warn, message, ...args);\n }\n\n info(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 3) return;\n\n this.#structuredLog(console.info, message, ...args);\n }\n\n debug(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 4) return;\n\n this.#structuredLog(console.debug, message, ...args);\n }\n\n #structuredLog(\n loggerFunction: (message: string, ...args: any[]) => void,\n message: string,\n ...args: Array<Record<string, unknown> | undefined>\n ) {\n const structuredLog = {\n ...structureArgs(safeJsonClone(args) as Record<string, unknown>[], this.#filteredKeys),\n timestamp: new Date(),\n name: this.#name,\n message,\n };\n\n loggerFunction(JSON.stringify(structuredLog, createReplacer(this.#jsonReplacer)));\n }\n}\n\nfunction createReplacer(replacer?: (key: string, value: unknown) => unknown) {\n return (key: string, value: unknown) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n if (replacer) {\n return replacer(key, value);\n }\n\n return value;\n };\n}\n\n// Replacer function for JSON.stringify that converts BigInts to strings\nfunction bigIntReplacer(_key: string, value: unknown) {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n return value;\n}\n\nfunction safeJsonClone(obj: unknown) {\n try {\n return JSON.parse(JSON.stringify(obj, bigIntReplacer));\n } catch (e) {\n return obj;\n }\n}\n\nfunction formattedDateTime() {\n const date = new Date();\n\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const milliseconds = date.getMilliseconds();\n\n // Make sure the time is always 2 digits\n const formattedHours = hours < 10 ? `0${hours}` : hours;\n const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;\n const formattedSeconds = seconds < 10 ? `0${seconds}` : seconds;\n const formattedMilliseconds =\n milliseconds < 10\n ? `00${milliseconds}`\n : milliseconds < 100\n ? `0${milliseconds}`\n : milliseconds;\n\n return `${formattedHours}:${formattedMinutes}:${formattedSeconds}.${formattedMilliseconds}`;\n}\n\n// If args is has a single item that is an object, return that object\nfunction structureArgs(args: Array<Record<string, unknown>>, filteredKeys: string[] = []) {\n if (args.length === 0) {\n return;\n }\n\n if (args.length === 1 && typeof args[0] === \"object\") {\n return filterKeys(JSON.parse(JSON.stringify(args[0], bigIntReplacer)), filteredKeys);\n }\n\n return args;\n}\n\n// Recursively filter out keys from an object, including nested objects, and arrays\nfunction filterKeys(obj: unknown, keys: string[]): any {\n if (typeof obj !== \"object\" || obj === null) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map((item) => filterKeys(item, keys));\n }\n\n const filteredObj: any = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (keys.includes(key)) {\n continue;\n }\n\n filteredObj[key] = filterKeys(value, keys);\n }\n\n return filteredObj;\n}\n","import { ulid } from \"ulid\";\nimport { z } from \"zod\";\nimport { ErrorWithStackSchema } from \"./errors\";\nimport { EventRuleSchema } from \"./eventFilter\";\nimport { ConnectionAuthSchema, IntegrationConfigSchema } from \"./integrations\";\nimport { DeserializedJsonSchema, SerializableJsonSchema } from \"./json\";\nimport { DisplayPropertySchema, StyleSchema } from \"./properties\";\nimport {\n CronMetadataSchema,\n IntervalMetadataSchema,\n RegisterDynamicSchedulePayloadSchema,\n ScheduleMetadataSchema,\n} from \"./schedules\";\nimport { CachedTaskSchema, ServerTaskSchema, TaskSchema } from \"./tasks\";\nimport { EventSpecificationSchema, TriggerMetadataSchema } from \"./triggers\";\nimport { Prettify } from \"../types\";\n\nexport const UpdateTriggerSourceBodySchema = z.object({\n registeredEvents: z.array(z.string()),\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n});\n\nexport type UpdateTriggerSourceBody = z.infer<typeof UpdateTriggerSourceBodySchema>;\n\nexport const HttpEventSourceSchema = UpdateTriggerSourceBodySchema.extend({\n id: z.string(),\n active: z.boolean(),\n url: z.string().url(),\n});\n\nexport const RegisterHTTPTriggerSourceBodySchema = z.object({\n type: z.literal(\"HTTP\"),\n url: z.string().url(),\n});\n\nexport const RegisterSMTPTriggerSourceBodySchema = z.object({\n type: z.literal(\"SMTP\"),\n});\n\nexport const RegisterSQSTriggerSourceBodySchema = z.object({\n type: z.literal(\"SQS\"),\n});\n\nexport const RegisterSourceChannelBodySchema = z.discriminatedUnion(\"type\", [\n RegisterHTTPTriggerSourceBodySchema,\n RegisterSMTPTriggerSourceBodySchema,\n RegisterSQSTriggerSourceBodySchema,\n]);\n\nexport const REGISTER_SOURCE_EVENT = \"dev.trigger.source.register\";\n\nexport const RegisterTriggerSourceSchema = z.object({\n key: z.string(),\n params: z.any(),\n active: z.boolean(),\n secret: z.string(),\n data: DeserializedJsonSchema.optional(),\n channel: RegisterSourceChannelBodySchema,\n clientId: z.string().optional(),\n});\n\nexport type RegisterTriggerSource = z.infer<typeof RegisterTriggerSourceSchema>;\n\nexport const RegisterSourceEventSchema = z.object({\n /** The id of the source */\n id: z.string(),\n source: RegisterTriggerSourceSchema,\n events: z.array(z.string()),\n missingEvents: z.array(z.string()),\n orphanedEvents: z.array(z.string()),\n dynamicTriggerId: z.string().optional(),\n});\n\nexport type RegisterSourceEvent = z.infer<typeof RegisterSourceEventSchema>;\n\nexport const TriggerSourceSchema = z.object({\n id: z.string(),\n key: z.string(),\n});\n\nexport const HandleTriggerSourceSchema = z.object({\n key: z.string(),\n secret: z.string(),\n data: z.any(),\n params: z.any(),\n});\n\nexport type HandleTriggerSource = z.infer<typeof HandleTriggerSourceSchema>;\n\nexport type TriggerSource = z.infer<typeof TriggerSourceSchema>;\n\nexport const HttpSourceRequestSchema = z.object({\n url: z.string().url(),\n method: z.string(),\n headers: z.record(z.string()),\n rawBody: z.instanceof(Buffer).optional().nullable(),\n});\n\nexport type HttpSourceRequest = z.infer<typeof HttpSourceRequestSchema>;\n\nexport const HttpSourceRequestHeadersSchema = z.object({\n \"x-ts-key\": z.string(),\n \"x-ts-dynamic-id\": z.string().optional(),\n \"x-ts-secret\": z.string(),\n \"x-ts-data\": z.string().transform((s) => JSON.parse(s)),\n \"x-ts-params\": z.string().transform((s) => JSON.parse(s)),\n \"x-ts-http-url\": z.string(),\n \"x-ts-http-method\": z.string(),\n \"x-ts-http-headers\": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s))),\n});\n\nexport type HttpSourceRequestHeaders = z.output<typeof HttpSourceRequestHeadersSchema>;\n\nexport const PongSuccessResponseSchema = z.object({\n ok: z.literal(true),\n});\n\nexport const PongErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n});\n\nexport const PongResponseSchema = z.discriminatedUnion(\"ok\", [\n PongSuccessResponseSchema,\n PongErrorResponseSchema,\n]);\n\nexport type PongResponse = z.infer<typeof PongResponseSchema>;\n\nexport const QueueOptionsSchema = z.object({\n name: z.string(),\n maxConcurrent: z.number().optional(),\n});\n\nexport type QueueOptions = z.infer<typeof QueueOptionsSchema>;\n\nexport const JobMetadataSchema = z.object({\n id: z.string(),\n name: z.string(),\n version: z.string(),\n event: EventSpecificationSchema,\n trigger: TriggerMetadataSchema,\n integrations: z.record(IntegrationConfigSchema),\n internal: z.boolean().default(false),\n queue: z.union([QueueOptionsSchema, z.string()]).optional(),\n startPosition: z.enum([\"initial\", \"latest\"]),\n enabled: z.boolean(),\n preprocessRuns: z.boolean(),\n});\n\nexport type JobMetadata = z.infer<typeof JobMetadataSchema>;\n\nexport const SourceMetadataSchema = z.object({\n channel: z.enum([\"HTTP\", \"SQS\", \"SMTP\"]),\n integration: IntegrationConfigSchema,\n key: z.string(),\n params: z.any(),\n events: z.array(z.string()),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type SourceMetadata = z.infer<typeof SourceMetadataSchema>;\n\nexport const DynamicTriggerEndpointMetadataSchema = z.object({\n id: z.string(),\n jobs: z.array(JobMetadataSchema.pick({ id: true, version: true })),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type DynamicTriggerEndpointMetadata = z.infer<typeof DynamicTriggerEndpointMetadataSchema>;\n\nexport const IndexEndpointResponseSchema = z.object({\n jobs: z.array(JobMetadataSchema),\n sources: z.array(SourceMetadataSchema),\n dynamicTriggers: z.array(DynamicTriggerEndpointMetadataSchema),\n dynamicSchedules: z.array(RegisterDynamicSchedulePayloadSchema),\n});\n\nexport type IndexEndpointResponse = z.infer<typeof IndexEndpointResponseSchema>;\n\nexport const RawEventSchema = z.object({\n /** The `name` property must exactly match any subscriptions you want to\n trigger. */\n name: z.string(),\n /** The `payload` property will be sent to any matching Jobs and will appear\n as the `payload` param of the `run()` function. You can leave this\n parameter out if you just want to trigger a Job without any input data. */\n payload: z.any(),\n /** The optional `context` property will be sent to any matching Jobs and will\n be passed through as the `context.event.context` param of the `run()`\n function. This is optional but can be useful if you want to pass through\n some additional context to the Job. */\n context: z.any().optional(),\n /** The `id` property uniquely identify this particular event. If unset it\n will be set automatically using `ulid`. */\n id: z.string().default(() => ulid()),\n /** This is optional, it defaults to the current timestamp. Usually you would\n only set this if you have a timestamp that you wish to pass through, e.g.\n you receive a timestamp from a service and you want the same timestamp to\n be used in your Job. */\n timestamp: z.coerce.date().optional(),\n /** This is optional, it defaults to \"trigger.dev\". It can be useful to set\n this as you can filter events using this in the `eventTrigger()`. */\n source: z.string().optional(),\n});\n\nexport type RawEvent = z.infer<typeof RawEventSchema>;\n\n/** The event you wish to send to Trigger a Job */\nexport type SendEvent = z.input<typeof RawEventSchema>;\n\n/** The event that was sent */\nexport const ApiEventLogSchema = z.object({\n /** The `id` of the event that was sent.\n */\n id: z.string(),\n /** The `name` of the event that was sent. */\n name: z.string(),\n /** The `payload` of the event that was sent */\n payload: DeserializedJsonSchema,\n /** The `context` of the event that was sent. Is `undefined` if no context was\n set when sending the event. */\n context: DeserializedJsonSchema.optional().nullable(),\n /** The `timestamp` of the event that was sent */\n timestamp: z.coerce.date(),\n /** The timestamp when the event will be delivered to any matching Jobs. Is\n `undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the\n event. */\n deliverAt: z.coerce.date().optional().nullable(),\n /** The timestamp when the event was delivered. Is `undefined` if `deliverAt`\n or `deliverAfter` were set when sending the event. */\n deliveredAt: z.coerce.date().optional().nullable(),\n});\n\nexport type ApiEventLog = z.infer<typeof ApiEventLogSchema>;\n\n/** Options to control the delivery of the event */\nexport const SendEventOptionsSchema = z.object({\n /** An optional Date when you want the event to trigger Jobs. The event will\n be sent to the platform immediately but won't be acted upon until the\n specified time. */\n deliverAt: z.coerce.date().optional(),\n /** An optional number of seconds you want to wait for the event to trigger\n any relevant Jobs. The event will be sent to the platform immediately but\n won't be delivered until after the elapsed number of seconds. */\n deliverAfter: z.number().int().optional(),\n /** This optional param will be used by Trigger.dev Connect, which\n is coming soon. */\n accountId: z.string().optional(),\n});\n\nexport const SendEventBodySchema = z.object({\n event: RawEventSchema,\n options: SendEventOptionsSchema.optional(),\n});\n\nexport type SendEventBody = z.infer<typeof SendEventBodySchema>;\nexport type SendEventOptions = z.infer<typeof SendEventOptionsSchema>;\n\nexport const DeliverEventResponseSchema = z.object({\n deliveredAt: z.string().datetime(),\n});\n\nexport type DeliverEventResponse = z.infer<typeof DeliverEventResponseSchema>;\n\nexport const RuntimeEnvironmentTypeSchema = z.enum([\n \"PRODUCTION\",\n \"STAGING\",\n \"DEVELOPMENT\",\n \"PREVIEW\",\n]);\n\nexport type RuntimeEnvironmentType = z.infer<typeof RuntimeEnvironmentTypeSchema>;\n\nexport const RunSourceContextSchema = z.object({\n id: z.string(),\n metadata: z.any(),\n});\n\nexport const RunJobBodySchema = z.object({\n event: ApiEventLogSchema,\n job: z.object({\n id: z.string(),\n version: z.string(),\n }),\n run: z.object({\n id: z.string(),\n isTest: z.boolean(),\n isRetry: z.boolean().default(false),\n startedAt: z.coerce.date(),\n }),\n environment: z.object({\n id: z.string(),\n slug: z.string(),\n type: RuntimeEnvironmentTypeSchema,\n }),\n organization: z.object({\n id: z.string(),\n title: z.string(),\n slug: z.string(),\n }),\n account: z\n .object({\n id: z.string(),\n metadata: z.any(),\n })\n .optional(),\n source: RunSourceContextSchema.optional(),\n tasks: z.array(CachedTaskSchema).optional(),\n connections: z.record(ConnectionAuthSchema).optional(),\n});\n\nexport type RunJobBody = z.infer<typeof RunJobBodySchema>;\n\nexport const RunJobErrorSchema = z.object({\n status: z.literal(\"ERROR\"),\n error: ErrorWithStackSchema,\n task: TaskSchema.optional(),\n});\n\nexport type RunJobError = z.infer<typeof RunJobErrorSchema>;\n\nexport const RunJobResumeWithTaskSchema = z.object({\n status: z.literal(\"RESUME_WITH_TASK\"),\n task: TaskSchema,\n});\n\nexport type RunJobResumeWithTask = z.infer<typeof RunJobResumeWithTaskSchema>;\n\nexport const RunJobRetryWithTaskSchema = z.object({\n status: z.literal(\"RETRY_WITH_TASK\"),\n task: TaskSchema,\n error: ErrorWithStackSchema,\n retryAt: z.coerce.date(),\n});\n\nexport type RunJobRetryWithTask = z.infer<typeof RunJobRetryWithTaskSchema>;\n\nexport const RunJobCanceledWithTaskSchema = z.object({\n status: z.literal(\"CANCELED\"),\n task: TaskSchema,\n});\n\nexport type RunJobCanceledWithTask = z.infer<typeof RunJobCanceledWithTaskSchema>;\n\nexport const RunJobSuccessSchema = z.object({\n status: z.literal(\"SUCCESS\"),\n output: DeserializedJsonSchema.optional(),\n});\n\nexport type RunJobSuccess = z.infer<typeof RunJobSuccessSchema>;\n\nexport const RunJobResponseSchema = z.discriminatedUnion(\"status\", [\n RunJobErrorSchema,\n RunJobResumeWithTaskSchema,\n RunJobRetryWithTaskSchema,\n RunJobCanceledWithTaskSchema,\n RunJobSuccessSchema,\n]);\n\nexport type RunJobResponse = z.infer<typeof RunJobResponseSchema>;\n\nexport const PreprocessRunBodySchema = z.object({\n event: ApiEventLogSchema,\n job: z.object({\n id: z.string(),\n version: z.string(),\n }),\n run: z.object({\n id: z.string(),\n isTest: z.boolean(),\n }),\n environment: z.object({\n id: z.string(),\n slug: z.string(),\n type: RuntimeEnvironmentTypeSchema,\n }),\n organization: z.object({\n id: z.string(),\n title: z.string(),\n slug: z.string(),\n }),\n account: z\n .object({\n id: z.string(),\n metadata: z.any(),\n })\n .optional(),\n});\n\nexport type PreprocessRunBody = z.infer<typeof PreprocessRunBodySchema>;\n\nexport const PreprocessRunResponseSchema = z.object({\n abort: z.boolean(),\n properties: z.array(DisplayPropertySchema).optional(),\n});\n\nexport type PreprocessRunResponse = z.infer<typeof PreprocessRunResponseSchema>;\n\nexport const CreateRunBodySchema = z.object({\n client: z.string(),\n job: JobMetadataSchema,\n event: ApiEventLogSchema,\n properties: z.array(DisplayPropertySchema).optional(),\n});\n\nexport type CreateRunBody = z.infer<typeof CreateRunBodySchema>;\n\nconst CreateRunResponseOkSchema = z.object({\n ok: z.literal(true),\n data: z.object({\n id: z.string(),\n }),\n});\n\nconst CreateRunResponseErrorSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n});\n\nexport const CreateRunResponseBodySchema = z.discriminatedUnion(\"ok\", [\n CreateRunResponseOkSchema,\n CreateRunResponseErrorSchema,\n]);\n\nexport type CreateRunResponseBody = z.infer<typeof CreateRunResponseBodySchema>;\n\nexport const RedactStringSchema = z.object({\n __redactedString: z.literal(true),\n strings: z.array(z.string()),\n interpolations: z.array(z.string()),\n});\n\nexport type RedactString = z.infer<typeof RedactStringSchema>;\n\nexport const LogMessageSchema = z.object({\n level: z.enum([\"DEBUG\", \"INFO\", \"WARN\", \"ERROR\"]),\n message: z.string(),\n data: SerializableJsonSchema.optional(),\n});\n\nexport type LogMessage = z.infer<typeof LogMessageSchema>;\n\nexport type ClientTask = z.infer<typeof TaskSchema>;\nexport type CachedTask = z.infer<typeof CachedTaskSchema>;\n\nexport const RedactSchema = z.object({\n paths: z.array(z.string()),\n});\n\nexport const RetryOptionsSchema = z.object({\n /** The maximum number of times to retry the request. */\n limit: z.number().optional(),\n /** The exponential factor to use when calculating the next retry time. */\n factor: z.number().optional(),\n /** The minimum amount of time to wait before retrying the request. */\n minTimeoutInMs: z.number().optional(),\n /** The maximum amount of time to wait before retrying the request. */\n maxTimeoutInMs: z.number().optional(),\n /** Whether to randomize the retry time. */\n randomize: z.boolean().optional(),\n});\n\nexport type RetryOptions = z.infer<typeof RetryOptionsSchema>;\n\nexport const RunTaskOptionsSchema = z.object({\n /** The name of the Task is required. This is displayed on the Task in the logs. */\n name: z.string(),\n /** The Task will wait and only start at the specified Date */\n delayUntil: z.coerce.date().optional(),\n /** Retry options */\n retry: RetryOptionsSchema.optional(),\n /** The icon for the Task, it will appear in the logs.\n * You can use the name of a company in lowercase, e.g. \"github\".\n * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */\n icon: z.string().optional(),\n /** The key for the Task that you want to appear in the logs */\n displayKey: z.string().optional(),\n /** A description of the Task */\n description: z.string().optional(),\n /** Properties that are displayed in the logs */\n properties: z.array(DisplayPropertySchema).optional(),\n /** The input params to the Task, will be displayed in the logs */\n params: z.any(),\n /** The style of the log entry. */\n style: StyleSchema.optional(),\n /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */\n connectionKey: z.string().optional(),\n /** An operation you want to perform on the Trigger.dev platform, current only \"fetch\" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */\n operation: z.enum([\"fetch\"]).optional(),\n /** A No Operation means that the code won't be executed. This is used internally to implement features like [io.wait()](https://trigger.dev/docs/sdk/io/wait). */\n noop: z.boolean().default(false),\n redact: RedactSchema.optional(),\n trigger: TriggerMetadataSchema.optional(),\n});\n\nexport type RunTaskOptions = z.input<typeof RunTaskOptionsSchema>;\n\nexport const RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({\n idempotencyKey: z.string(),\n parentId: z.string().optional(),\n});\n\nexport type RunTaskBodyInput = z.infer<typeof RunTaskBodyInputSchema>;\n\nexport const RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({\n params: DeserializedJsonSchema.optional().nullable(),\n});\n\nexport type RunTaskBodyOutput = z.infer<typeof RunTaskBodyOutputSchema>;\n\nexport const CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({\n properties: true,\n description: true,\n params: true,\n}).extend({\n output: SerializableJsonSchema.optional().transform((v) =>\n v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {}\n ),\n});\n\nexport type CompleteTaskBodyInput = Prettify<z.input<typeof CompleteTaskBodyInputSchema>>;\nexport type CompleteTaskBodyOutput = z.infer<typeof CompleteTaskBodyInputSchema>;\n\nexport const FailTaskBodyInputSchema = z.object({\n error: ErrorWithStackSchema,\n});\n\nexport type FailTaskBodyInput = z.infer<typeof FailTaskBodyInputSchema>;\n\nexport const NormalizedRequestSchema = z.object({\n headers: z.record(z.string()),\n method: z.string(),\n query: z.record(z.string()),\n url: z.string(),\n body: z.any(),\n});\n\nexport type NormalizedRequest = z.infer<typeof NormalizedRequestSchema>;\n\nexport const NormalizedResponseSchema = z.object({\n status: z.number(),\n body: z.any(),\n headers: z.record(z.string()).optional(),\n});\n\nexport type NormalizedResponse = z.infer<typeof NormalizedResponseSchema>;\n\nexport const HttpSourceResponseSchema = z.object({\n response: NormalizedResponseSchema,\n events: z.array(RawEventSchema),\n});\n\nexport const RegisterTriggerBodySchema = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataSchema,\n});\n\nexport type RegisterTriggerBody = z.infer<typeof RegisterTriggerBodySchema>;\n\nexport const InitializeTriggerBodySchema = z.object({\n id: z.string(),\n params: z.any(),\n accountId: z.string().optional(),\n metadata: z.any().optional(),\n});\n\nexport type InitializeTriggerBody = z.infer<typeof InitializeTriggerBodySchema>;\n\nconst RegisterCommonScheduleBodySchema = z.object({\n /** A unique id for the schedule. This is used to identify and unregister the schedule later. */\n id: z.string(),\n /** Any additional metadata about the schedule. */\n metadata: z.any(),\n /** This will be used by the Trigger.dev Connect feature, which is coming soon. */\n accountId: z.string().optional(),\n});\n\nexport const RegisterIntervalScheduleBodySchema =\n RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);\n\nexport type RegisterIntervalScheduleBody = z.infer<typeof RegisterIntervalScheduleBodySchema>;\n\nexport const InitializeCronScheduleBodySchema =\n RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);\n\nexport type RegisterCronScheduleBody = z.infer<typeof InitializeCronScheduleBodySchema>;\n\nexport const RegisterScheduleBodySchema = z.discriminatedUnion(\"type\", [\n RegisterIntervalScheduleBodySchema,\n InitializeCronScheduleBodySchema,\n]);\n\nexport type RegisterScheduleBody = z.infer<typeof RegisterScheduleBodySchema>;\n\nexport const RegisterScheduleResponseBodySchema = z.object({\n id: z.string(),\n schedule: ScheduleMetadataSchema,\n metadata: z.any(),\n active: z.boolean(),\n});\n\nexport type RegisterScheduleResponseBody = z.infer<typeof RegisterScheduleResponseBodySchema>;\n\nexport const CreateExternalConnectionBodySchema = z.object({\n accessToken: z.string(),\n type: z.enum([\"oauth2\"]),\n scopes: z.array(z.string()).optional(),\n metadata: z.any(),\n});\n\nexport type CreateExternalConnectionBody = z.infer<typeof CreateExternalConnectionBodySchema>;\n","import { z } from \"zod\";\n\nexport const ErrorWithStackSchema = z.object({\n message: z.string(),\n name: z.string().optional(),\n stack: z.string().optional(),\n});\n\nexport type ErrorWithStack = z.infer<typeof ErrorWithStackSchema>;\n","import { z } from \"zod\";\n\nconst EventMatcherSchema = z.union([\n /** Match against a string */\n z.array(z.string()),\n /** Match against a number */\n z.array(z.number()),\n /** Match against a boolean */\n z.array(z.boolean()),\n]);\n\ntype EventMatcher = z.infer<typeof EventMatcherSchema>;\n\n/** A filter for matching against data */\nexport type EventFilter = { [key: string]: EventMatcher | EventFilter };\n\nexport const EventFilterSchema: z.ZodType<EventFilter> = z.lazy(() =>\n z.record(z.union([EventMatcherSchema, EventFilterSchema]))\n);\n\nexport const EventRuleSchema = z.object({\n event: z.string().or(z.array(z.string())),\n source: z.string(),\n payload: EventFilterSchema.optional(),\n context: EventFilterSchema.optional(),\n});\n\nexport type EventRule = z.infer<typeof EventRuleSchema>;\n","import { z } from \"zod\";\n\nexport const ConnectionAuthSchema = z.object({\n type: z.enum([\"oauth2\"]),\n accessToken: z.string(),\n scopes: z.array(z.string()).optional(),\n additionalFields: z.record(z.string()).optional(),\n});\n\nexport type ConnectionAuth = z.infer<typeof ConnectionAuthSchema>;\n\nexport const IntegrationMetadataSchema = z.object({\n id: z.string(),\n name: z.string(),\n instructions: z.string().optional(),\n});\n\nexport type IntegrationMetadata = z.infer<typeof IntegrationMetadataSchema>;\n\nexport const IntegrationConfigSchema = z.object({\n id: z.string(),\n metadata: IntegrationMetadataSchema,\n authSource: z.enum([\"HOSTED\", \"LOCAL\"]),\n});\n\nexport type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;\n","import { z } from \"zod\";\n\nconst LiteralSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);\ntype Literal = z.infer<typeof LiteralSchema>;\n\nexport type DeserializedJson = Literal | { [key: string]: DeserializedJson } | DeserializedJson[];\n\nexport const DeserializedJsonSchema: z.ZodType<DeserializedJson> = z.lazy(() =>\n z.union([LiteralSchema, z.array(DeserializedJsonSchema), z.record(DeserializedJsonSchema)])\n);\n\nconst SerializableSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.date(),\n z.undefined(),\n z.symbol(),\n]);\ntype Serializable = z.infer<typeof SerializableSchema>;\n\nexport type SerializableJson =\n | Serializable\n | { [key: string]: SerializableJson }\n | SerializableJson[];\n\nexport const SerializableJsonSchema: z.ZodType<SerializableJson> = z.lazy(() =>\n z.union([SerializableSchema, z.array(SerializableJsonSchema), z.record(SerializableJsonSchema)])\n);\n","import { z } from \"zod\";\n\n/** A property that is displayed in the logs */\nexport const DisplayPropertySchema = z.object({\n /** The label for the property */\n label: z.string(),\n /** The value of the property */\n text: z.string(),\n /** The URL to link to when the property is clicked */\n url: z.string().optional(),\n});\n\nexport const DisplayPropertiesSchema = z.array(DisplayPropertySchema);\n\nexport type DisplayProperty = z.infer<typeof DisplayPropertySchema>;\n\nexport const StyleSchema = z.object({\n /** The style, `normal` or `minimal` */\n style: z.enum([\"normal\", \"minimal\"]),\n /** A variant of the style. */\n variant: z.string().optional(),\n});\n\nexport type Style = z.infer<typeof StyleSchema>;\nexport type StyleName = Style[\"style\"];\n","import { z } from \"zod\";\n\nexport const SCHEDULED_EVENT = \"dev.trigger.scheduled\";\n\nexport const ScheduledPayloadSchema = z.object({\n ts: z.coerce.date(),\n lastTimestamp: z.coerce.date().optional(),\n});\n\nexport type ScheduledPayload = z.infer<typeof ScheduledPayloadSchema>;\n\nexport const IntervalOptionsSchema = z.object({\n /** The number of seconds for the interval. Min = 60, Max = 86400 (1 day) */\n seconds: z.number().int().positive().min(60).max(86400),\n});\n\n/** Interval options */\nexport type IntervalOptions = z.infer<typeof IntervalOptionsSchema>;\n\nexport const CronOptionsSchema = z.object({\n /** A CRON expression that defines the schedule. A useful tool when writing CRON\n expressions is [crontab guru](https://crontab.guru). Note that the timezone\n used is UTC. */\n cron: z.string(),\n});\n\n/** The options for a `cronTrigger()` */\nexport type CronOptions = z.infer<typeof CronOptionsSchema>;\n\nexport const CronMetadataSchema = z.object({\n type: z.literal(\"cron\"),\n options: CronOptionsSchema,\n metadata: z.any(),\n});\n\nexport type CronMetadata = z.infer<typeof CronMetadataSchema>;\n\nexport const IntervalMetadataSchema = z.object({\n /** An interval reoccurs at the specified number of seconds */\n type: z.literal(\"interval\"),\n /** An object containing options about the interval. */\n options: IntervalOptionsSchema,\n /** Any additional metadata about the schedule. */\n metadata: z.any(),\n});\n\nexport type IntervalMetadata = z.infer<typeof IntervalMetadataSchema>;\n\nexport const ScheduleMetadataSchema = z.discriminatedUnion(\"type\", [\n IntervalMetadataSchema,\n CronMetadataSchema,\n]);\n\nexport type ScheduleMetadata = z.infer<typeof ScheduleMetadataSchema>;\n\nexport const RegisterDynamicSchedulePayloadSchema = z.object({\n id: z.string(),\n jobs: z.array(\n z.object({\n id: z.string(),\n version: z.string(),\n })\n ),\n});\n\nexport type RegisterDynamicSchedulePayload = z.infer<typeof RegisterDynamicSchedulePayloadSchema>;\n","import { z } from \"zod\";\nimport { DisplayPropertySchema, StyleSchema } from \"./properties\";\nimport { DeserializedJsonSchema } from \"./json\";\n\nexport const TaskStatusSchema = z.enum([\n \"PENDING\",\n \"WAITING\",\n \"RUNNING\",\n \"COMPLETED\",\n \"ERRORED\",\n \"CANCELED\",\n]);\n\nexport type TaskStatus = z.infer<typeof TaskStatusSchema>;\n\nexport const TaskSchema = z.object({\n id: z.string(),\n name: z.string(),\n icon: z.string().optional().nullable(),\n noop: z.boolean(),\n startedAt: z.coerce.date().optional().nullable(),\n completedAt: z.coerce.date().optional().nullable(),\n delayUntil: z.coerce.date().optional().nullable(),\n status: TaskStatusSchema,\n description: z.string().optional().nullable(),\n properties: z.array(DisplayPropertySchema).optional().nullable(),\n outputProperties: z.array(DisplayPropertySchema).optional().nullable(),\n params: DeserializedJsonSchema.optional().nullable(),\n output: DeserializedJsonSchema.optional().nullable(),\n error: z.string().optional().nullable(),\n parentId: z.string().optional().nullable(),\n style: StyleSchema.optional().nullable(),\n operation: z.string().optional().nullable(),\n});\n\nexport const ServerTaskSchema = TaskSchema.extend({\n idempotencyKey: z.string(),\n attempts: z.number(),\n});\n\nexport type ServerTask = z.infer<typeof ServerTaskSchema>;\n\nexport const CachedTaskSchema = z.object({\n id: z.string(),\n idempotencyKey: z.string(),\n status: TaskStatusSchema,\n noop: z.boolean().default(false),\n output: DeserializedJsonSchema.optional().nullable(),\n parentId: z.string().optional().nullable(),\n});\n","import { z } from \"zod\";\nimport { EventFilterSchema, EventRuleSchema } from \"./eventFilter\";\nimport { DisplayPropertySchema } from \"./properties\";\nimport { ScheduleMetadataSchema } from \"./schedules\";\n\nexport const EventExampleSchema = z.object({\n id: z.string(),\n icon: z.string().optional(),\n name: z.string(),\n payload: z.any(),\n});\n\nexport type EventExample = z.infer<typeof EventExampleSchema>;\n\nexport const EventSpecificationSchema = z.object({\n name: z.string().or(z.array(z.string())),\n title: z.string(),\n source: z.string(),\n icon: z.string(),\n filter: EventFilterSchema.optional(),\n properties: z.array(DisplayPropertySchema).optional(),\n schema: z.any().optional(),\n examples: z.array(EventExampleSchema).optional(),\n});\n\nexport const DynamicTriggerMetadataSchema = z.object({\n type: z.literal(\"dynamic\"),\n id: z.string(),\n});\n\nexport const StaticTriggerMetadataSchema = z.object({\n type: z.literal(\"static\"),\n title: z.union([z.string(), z.array(z.string())]),\n properties: z.array(DisplayPropertySchema).optional(),\n rule: EventRuleSchema,\n});\n\nexport const ScheduledTriggerMetadataSchema = z.object({\n type: z.literal(\"scheduled\"),\n schedule: ScheduleMetadataSchema,\n});\n\nexport const TriggerMetadataSchema = z.discriminatedUnion(\"type\", [\n DynamicTriggerMetadataSchema,\n StaticTriggerMetadataSchema,\n ScheduledTriggerMetadataSchema,\n]);\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n","import { z } from \"zod\";\n\nexport const MISSING_CONNECTION_NOTIFICATION = \"dev.trigger.notifications.missingConnection\";\n\nexport const MISSING_CONNECTION_RESOLVED_NOTIFICATION =\n \"dev.trigger.notifications.missingConnectionResolved\";\n\nexport const CommonMissingConnectionNotificationPayloadSchema = z.object({\n id: z.string(),\n client: z.object({\n id: z.string(),\n title: z.string(),\n scopes: z.array(z.string()),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n }),\n authorizationUrl: z.string(),\n});\n\nexport const MissingDeveloperConnectionNotificationPayloadSchema =\n CommonMissingConnectionNotificationPayloadSchema.extend({\n type: z.literal(\"DEVELOPER\"),\n });\n\nexport const MissingExternalConnectionNotificationPayloadSchema =\n CommonMissingConnectionNotificationPayloadSchema.extend({\n type: z.literal(\"EXTERNAL\"),\n account: z.object({\n id: z.string(),\n metadata: z.any(),\n }),\n });\n\nexport const MissingConnectionNotificationPayloadSchema = z.discriminatedUnion(\"type\", [\n MissingDeveloperConnectionNotificationPayloadSchema,\n MissingExternalConnectionNotificationPayloadSchema,\n]);\n\nexport type MissingConnectionNotificationPayload = z.infer<\n typeof MissingConnectionNotificationPayloadSchema\n>;\n\nexport const CommonMissingConnectionNotificationResolvedPayloadSchema = z.object({\n id: z.string(),\n client: z.object({\n id: z.string(),\n title: z.string(),\n scopes: z.array(z.string()),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n integrationIdentifier: z.string(),\n integrationAuthMethod: z.string(),\n }),\n expiresAt: z.coerce.date(),\n});\n\nexport const MissingDeveloperConnectionResolvedNotificationPayloadSchema =\n CommonMissingConnectionNotificationResolvedPayloadSchema.extend({\n type: z.literal(\"DEVELOPER\"),\n });\n\nexport const MissingExternalConnectionResolvedNotificationPayloadSchema =\n CommonMissingConnectionNotificationResolvedPayloadSchema.extend({\n type: z.literal(\"EXTERNAL\"),\n account: z.object({\n id: z.string(),\n metadata: z.any(),\n }),\n });\n\nexport const MissingConnectionResolvedNotificationPayloadSchema = z.discriminatedUnion(\"type\", [\n MissingDeveloperConnectionResolvedNotificationPayloadSchema,\n MissingExternalConnectionResolvedNotificationPayloadSchema,\n]);\n\nexport type MissingConnectionResolvedNotificationPayload = z.infer<\n typeof MissingConnectionResolvedNotificationPayloadSchema\n>;\n","import { z } from \"zod\";\nimport { RedactStringSchema, RetryOptionsSchema } from \"./api\";\n\nexport const FetchRetryHeadersStrategySchema = z.object({\n /** The `headers` strategy retries the request using info from the response headers. */\n strategy: z.literal(\"headers\"),\n /** The header to use to determine the maximum number of times to retry the request. */\n limitHeader: z.string(),\n /** The header to use to determine the number of remaining retries. */\n remainingHeader: z.string(),\n /** The header to use to determine the time when the number of remaining retries will be reset. */\n resetHeader: z.string(),\n});\n\nexport type FetchRetryHeadersStrategy = z.infer<typeof FetchRetryHeadersStrategySchema>;\n\n/** The `backoff` strategy retries the request with an exponential backoff. */\nexport const FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({\n /** The `backoff` strategy retries the request with an exponential backoff. */\n strategy: z.literal(\"backoff\"),\n});\n\n/** The `backoff` strategy retries the request with an exponential backoff. */\nexport type FetchRetryBackoffStrategy = z.infer<typeof FetchRetryBackoffStrategySchema>;\n\nexport const FetchRetryStrategySchema = z.discriminatedUnion(\"strategy\", [\n FetchRetryHeadersStrategySchema,\n FetchRetryBackoffStrategySchema,\n]);\n\nexport type FetchRetryStrategy = z.infer<typeof FetchRetryStrategySchema>;\n\n/** The options for a fetch request */\nexport const FetchRequestInitSchema = z.object({\n /** The HTTP method to use for the request. */\n method: z.string().optional(),\n /** Any headers to send with the request. Note that you can use [redactString](https://trigger.dev/docs/sdk/redactString) to prevent sensitive information from being stored (e.g. in the logs), like API keys and tokens. */\n headers: z.record(z.union([z.string(), RedactStringSchema])).optional(),\n /** The body of the request. */\n body: z.union([z.string(), z.instanceof(ArrayBuffer)]).optional(),\n});\n\n/** The options for a fetch request */\nexport type FetchRequestInit = z.infer<typeof FetchRequestInitSchema>;\n\nexport const FetchRetryOptionsSchema = z.record(FetchRetryStrategySchema);\n\n/** An object where the key is a status code pattern and the value is a retrying strategy. Supported patterns are:\n - Specific status codes: 429\n - Ranges: 500-599\n - Wildcards: 2xx, 3xx, 4xx, 5xx \n */\nexport type FetchRetryOptions = z.infer<typeof FetchRetryOptionsSchema>;\n\nexport const FetchOperationSchema = z.object({\n url: z.string(),\n requestInit: FetchRequestInitSchema.optional(),\n retry: z.record(FetchRetryStrategySchema).optional(),\n});\n\nexport type FetchOperation = z.infer<typeof FetchOperationSchema>;\n","import { z } from \"zod\";\nimport { RunStatusSchema } from \"./runs\";\n\nexport const GetEventSchema = z.object({\n /** The event id */\n id: z.string(),\n /** The event name */\n name: z.string(),\n /** When the event was created */\n createdAt: z.coerce.date(),\n /** When the event was last updated */\n updatedAt: z.coerce.date(),\n /** The runs that were triggered by the event */\n runs: z.array(\n z.object({\n /** The Run id */\n id: z.string(),\n /** The Run status */\n status: RunStatusSchema,\n /** When the run started */\n startedAt: z.coerce.date().optional().nullable(),\n /** When the run completed */\n completedAt: z.coerce.date().optional().nullable(),\n })\n ),\n});\n\nexport type GetEvent = z.infer<typeof GetEventSchema>;\n","import { ZodObject, z } from \"zod\";\nimport { TaskStatusSchema } from \"./tasks\";\n\nexport const RunStatusSchema = z.union([\n z.literal(\"PENDING\"),\n z.literal(\"QUEUED\"),\n z.literal(\"WAITING_ON_CONNECTIONS\"),\n z.literal(\"PREPROCESSING\"),\n z.literal(\"STARTED\"),\n z.literal(\"SUCCESS\"),\n z.literal(\"FAILURE\"),\n z.literal(\"TIMED_OUT\"),\n z.literal(\"ABORTED\"),\n z.literal(\"CANCELED\"),\n]);\n\nexport const RunTaskSchema = z.object({\n /** The Task id */\n id: z.string(),\n /** The key that you defined when creating the Task, the first param in any task. */\n displayKey: z.string().nullable(),\n /** The Task status */\n status: TaskStatusSchema,\n /** The name of the Task */\n name: z.string(),\n /** The icon of the Task, a string.\n * For integrations, this will be a lowercase name of the company.\n * Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */\n icon: z.string().nullable(),\n /** When the task started */\n startedAt: z.coerce.date().nullable(),\n /** When the task completed */\n completedAt: z.coerce.date().nullable(),\n});\n\nconst GetRunOptionsSchema = z.object({\n /** Return subtasks, which appear in a `subtasks` array on a task. @default false */\n subtasks: z.boolean().optional(),\n /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */\n cursor: z.string().optional(),\n /** How many tasks you want to return in one go, max 50. @default 20 */\n take: z.number().optional(),\n});\n\nexport type GetRunOptions = z.infer<typeof GetRunOptionsSchema>;\n\nconst GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({\n /** If `true`, it returns the `params` and `output` of all tasks. @default false */\n taskdetails: z.boolean().optional(),\n});\n\nexport type GetRunOptionsWithTaskDetails = z.infer<typeof GetRunOptionsWithTaskDetailsSchema>;\n\nconst RunSchema = z.object({\n /** The Run id */\n id: z.string(),\n /** The Run status */\n status: RunStatusSchema,\n /** When the run started */\n startedAt: z.coerce.date().nullable(),\n /** When the run was last updated */\n updatedAt: z.coerce.date().nullable(),\n /** When the run was completed */\n completedAt: z.coerce.date().nullable(),\n});\n\nexport const GetRunSchema = RunSchema.extend({\n /** The output of the run */\n output: z.any().optional(),\n /** The tasks from the run */\n tasks: z.array(RunTaskSchema),\n /** If there are more tasks, you can use this to get them */\n nextCursor: z.string().optional(),\n});\n\nexport type GetRun = z.infer<typeof GetRunSchema>;\n\nconst GetRunsOptionsSchema = z.object({\n /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */\n cursor: z.string().optional(),\n /** How many runs you want to return in one go, max 50. @default 20 */\n take: z.number().optional(),\n});\n\nexport type GetRunsOptions = z.infer<typeof GetRunsOptionsSchema>;\n\nexport const GetRunsSchema = z.object({\n /** The runs from the query */\n runs: RunSchema.array(),\n /** If there are more runs, you can use this to get them */\n nextCursor: z.string().optional(),\n});\n","// EventFilter is typed as type EventFilter = { [key: string]: EventFilter | string[] | number[] | boolean[] }\n\nimport { EventFilter } from \"./schemas\";\n\n// This function should take any number of EventFilters and return a new EventFilter that is the result of merging of them.\nexport function deepMergeFilters(...filters: EventFilter[]): EventFilter {\n const result: EventFilter = {};\n\n for (const filter of filters) {\n for (const key in filter) {\n if (filter.hasOwnProperty(key)) {\n const filterValue = filter[key];\n const existingValue = result[key];\n\n if (\n existingValue &&\n typeof existingValue === \"object\" &&\n typeof filterValue === \"object\" &&\n !Array.isArray(existingValue) &&\n !Array.isArray(filterValue) &&\n existingValue !== null &&\n filterValue !== null\n ) {\n result[key] = deepMergeFilters(existingValue, filterValue);\n } else {\n result[key] = filterValue;\n }\n }\n }\n }\n\n return result;\n}\n","import { RetryOptions } from \"./schemas\";\n\nconst DEFAULT_RETRY_OPTIONS = {\n limit: 5,\n factor: 1.8,\n minTimeoutInMs: 1000,\n maxTimeoutInMs: 60000,\n randomize: true,\n} satisfies RetryOptions;\n\nexport function calculateRetryAt(retryOptions: RetryOptions, attempts: number): Date | undefined {\n const options = {\n ...DEFAULT_RETRY_OPTIONS,\n ...retryOptions,\n };\n\n const retryCount = attempts + 1;\n\n if (retryCount >= options.limit) {\n return;\n }\n\n const random = options.randomize ? Math.random() + 1 : 1;\n\n let timeoutInMs = Math.round(\n random *\n Math.max(options.minTimeoutInMs, 1) *\n Math.pow(options.factor, Math.max(attempts - 1, 0))\n );\n\n timeoutInMs = Math.min(timeoutInMs, options.maxTimeoutInMs);\n\n return new Date(Date.now() + timeoutInMs);\n}\n","import { DeserializedJson } from \"./schemas\";\n\nexport interface ExampleReplacement {\n marker: string;\n replace(input: ExampleInputData): DeserializedJson;\n}\n\ntype ExampleInputData = {\n match: {\n key: string;\n value: string;\n };\n data: {\n now: Date;\n };\n};\n\nexport const currentDate: ExampleReplacement = {\n marker: \"__CURRENT_DATE__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.toISOString();\n },\n};\n\nexport const currentTimestampMilliseconds: ExampleReplacement = {\n marker: \"__CURRENT_TIMESTAMP_MS__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.getTime();\n },\n};\n\nexport const currentTimestampSeconds: ExampleReplacement = {\n marker: \"__CURRENT_TIMESTAMP_S__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.getTime() / 1000;\n },\n};\n\nexport const replacements: ExampleReplacement[] = [\n currentDate,\n currentTimestampMilliseconds,\n currentTimestampSeconds,\n];\n","export function urlWithSearchParams(\n url: string,\n params: Record<string, string | number | boolean> | undefined\n) {\n if (!params) {\n return url;\n }\n\n const urlObj = new URL(url);\n for (const [key, value] of Object.entries(params)) {\n urlObj.searchParams.append(key, String(value));\n }\n return urlObj.toString();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACxB;AACF;AAEO,IAAMC,+BAAmD;EAC9DL,QAAQ;EACRC,QAAQ,EAAEC,MAAM,EAAEC,IAAG,EAAE,GAAsB;AAC3C,WAAOA,IAAIG,QAAO;EACpB;AACF;AAEO,IAAMC,0BAA8C;EACzDP,QAAQ;EACRC,QAAQ,EAAEC,MAAM,EAAEC,IAAG,EAAE,GAAsB;AAC3C,WAAOA,IAAIG,QAAO,IAAK;EACzB;AACF;AAEO,IAAME,eAAqC;EAChDT;EACAM;EACAE;;;;ACzCK,SAASE,oBACdC,KACAC,QACA;AACA,MAAI,CAACA,QAAQ;AACX,WAAOD;EACT;AAEA,QAAME,SAAS,IAAIC,IAAIH,GAAAA;AACvB,aAAW,CAACI,KAAKC,KAAAA,KAAUC,OAAOC,QAAQN,MAAAA,GAAS;AACjDC,WAAOM,aAAaC,OAAOL,KAAKM,OAAOL,KAAAA,CAAAA;EACzC;AACA,SAAOH,OAAOS,SAAQ;AACxB;AAbgBZ;","names":["logLevels","Logger","constructor","name","level","filteredKeys","jsonReplacer","indexOf","process","env","TRIGGER_LOG_LEVEL","filter","keys","satisfiesLogLevel","logLevel","setLevel","log","message","args","console","error","warn","info","debug","loggerFunction","structuredLog","structureArgs","safeJsonClone","timestamp","Date","JSON","stringify","createReplacer","replacer","key","value","toString","bigIntReplacer","_key","obj","parse","e","structureArgs","args","filteredKeys","length","filterKeys","JSON","parse","stringify","bigIntReplacer","obj","keys","Array","isArray","map","item","filteredObj","key","value","Object","entries","includes","import_zod","ErrorWithStackSchema","z","object","message","string","name","optional","stack","import_zod","EventMatcherSchema","z","union","array","string","number","boolean","EventFilterSchema","lazy","record","EventRuleSchema","object","event","or","source","payload","optional","context","import_zod","ConnectionAuthSchema","z","object","type","enum","accessToken","string","scopes","array","optional","additionalFields","record","IntegrationMetadataSchema","id","name","instructions","IntegrationConfigSchema","metadata","authSource","import_zod","LiteralSchema","z","union","string","number","boolean","null","DeserializedJsonSchema","lazy","array","record","SerializableSchema","date","undefined","symbol","SerializableJsonSchema","import_zod","DisplayPropertySchema","z","object","label","string","text","url","optional","DisplayPropertiesSchema","array","StyleSchema","style","enum","variant","import_zod","SCHEDULED_EVENT","ScheduledPayloadSchema","z","object","ts","coerce","date","lastTimestamp","optional","IntervalOptionsSchema","seconds","number","int","positive","min","max","CronOptionsSchema","cron","string","CronMetadataSchema","type","literal","options","metadata","any","IntervalMetadataSchema","ScheduleMetadataSchema","discriminatedUnion","RegisterDynamicSchedulePayloadSchema","id","jobs","array","version","import_zod","TaskStatusSchema","z","enum","TaskSchema","object","id","string","name","icon","optional","nullable","noop","boolean","startedAt","coerce","date","completedAt","delayUntil","status","description","properties","array","DisplayPropertySchema","outputProperties","params","DeserializedJsonSchema","output","error","parentId","style","StyleSchema","operation","ServerTaskSchema","extend","idempotencyKey","attempts","number","CachedTaskSchema","default","import_zod","EventExampleSchema","z","object","id","string","icon","optional","name","payload","any","EventSpecificationSchema","or","array","title","source","filter","EventFilterSchema","properties","DisplayPropertySchema","schema","examples","DynamicTriggerMetadataSchema","type","literal","StaticTriggerMetadataSchema","union","rule","EventRuleSchema","ScheduledTriggerMetadataSchema","schedule","ScheduleMetadataSchema","TriggerMetadataSchema","discriminatedUnion","UpdateTriggerSourceBodySchema","z","object","registeredEvents","array","string","secret","optional","data","SerializableJsonSchema","HttpEventSourceSchema","extend","id","active","boolean","url","RegisterHTTPTriggerSourceBodySchema","type","literal","RegisterSMTPTriggerSourceBodySchema","RegisterSQSTriggerSourceBodySchema","RegisterSourceChannelBodySchema","discriminatedUnion","REGISTER_SOURCE_EVENT","RegisterTriggerSourceSchema","key","params","any","DeserializedJsonSchema","channel","clientId","RegisterSourceEventSchema","source","events","missingEvents","orphanedEvents","dynamicTriggerId","TriggerSourceSchema","HandleTriggerSourceSchema","HttpSourceRequestSchema","method","headers","record","rawBody","instanceof","Buffer","nullable","HttpSourceRequestHeadersSchema","transform","s","JSON","parse","PongSuccessResponseSchema","ok","PongErrorResponseSchema","error","PongResponseSchema","QueueOptionsSchema","name","maxConcurrent","number","JobMetadataSchema","version","event","EventSpecificationSchema","trigger","TriggerMetadataSchema","integrations","IntegrationConfigSchema","internal","default","queue","union","startPosition","enum","enabled","preprocessRuns","SourceMetadataSchema","integration","registerSourceJob","DynamicTriggerEndpointMetadataSchema","jobs","pick","IndexEndpointResponseSchema","sources","dynamicTriggers","dynamicSchedules","RegisterDynamicSchedulePayloadSchema","RawEventSchema","payload","context","ulid","timestamp","coerce","date","ApiEventLogSchema","deliverAt","deliveredAt","SendEventOptionsSchema","deliverAfter","int","accountId","SendEventBodySchema","options","DeliverEventResponseSchema","datetime","RuntimeEnvironmentTypeSchema","RunSourceContextSchema","metadata","RunJobBodySchema","job","run","isTest","isRetry","startedAt","environment","slug","organization","title","account","tasks","CachedTaskSchema","connections","ConnectionAuthSchema","RunJobErrorSchema","status","ErrorWithStackSchema","task","TaskSchema","RunJobResumeWithTaskSchema","RunJobRetryWithTaskSchema","retryAt","RunJobCanceledWithTaskSchema","RunJobSuccessSchema","output","RunJobResponseSchema","PreprocessRunBodySchema","PreprocessRunResponseSchema","abort","properties","DisplayPropertySchema","CreateRunBodySchema","client","CreateRunResponseOkSchema","CreateRunResponseErrorSchema","CreateRunResponseBodySchema","RedactStringSchema","__redactedString","strings","interpolations","LogMessageSchema","level","message","RedactSchema","paths","RetryOptionsSchema","limit","factor","minTimeoutInMs","maxTimeoutInMs","randomize","RunTaskOptionsSchema","delayUntil","retry","icon","displayKey","description","style","StyleSchema","connectionKey","operation","noop","redact","RunTaskBodyInputSchema","idempotencyKey","parentId","RunTaskBodyOutputSchema","CompleteTaskBodyInputSchema","v","stringify","FailTaskBodyInputSchema","NormalizedRequestSchema","query","body","NormalizedResponseSchema","HttpSourceResponseSchema","response","RegisterTriggerBodySchema","rule","EventRuleSchema","InitializeTriggerBodySchema","RegisterCommonScheduleBodySchema","RegisterIntervalScheduleBodySchema","merge","IntervalMetadataSchema","InitializeCronScheduleBodySchema","CronMetadataSchema","RegisterScheduleBodySchema","RegisterScheduleResponseBodySchema","schedule","ScheduleMetadataSchema","CreateExternalConnectionBodySchema","accessToken","scopes","import_zod","MISSING_CONNECTION_NOTIFICATION","MISSING_CONNECTION_RESOLVED_NOTIFICATION","CommonMissingConnectionNotificationPayloadSchema","z","object","id","string","client","title","scopes","array","createdAt","coerce","date","updatedAt","authorizationUrl","MissingDeveloperConnectionNotificationPayloadSchema","extend","type","literal","MissingExternalConnectionNotificationPayloadSchema","account","metadata","any","MissingConnectionNotificationPayloadSchema","discriminatedUnion","CommonMissingConnectionNotificationResolvedPayloadSchema","integrationIdentifier","integrationAuthMethod","expiresAt","MissingDeveloperConnectionResolvedNotificationPayloadSchema","MissingExternalConnectionResolvedNotificationPayloadSchema","MissingConnectionResolvedNotificationPayloadSchema","import_zod","FetchRetryHeadersStrategySchema","z","object","strategy","literal","limitHeader","string","remainingHeader","resetHeader","FetchRetryBackoffStrategySchema","RetryOptionsSchema","extend","FetchRetryStrategySchema","discriminatedUnion","FetchRequestInitSchema","method","optional","headers","record","union","RedactStringSchema","body","instanceof","ArrayBuffer","FetchRetryOptionsSchema","FetchOperationSchema","url","requestInit","retry","import_zod","import_zod","RunStatusSchema","z","union","literal","RunTaskSchema","object","id","string","displayKey","nullable","status","TaskStatusSchema","name","icon","startedAt","coerce","date","completedAt","GetRunOptionsSchema","subtasks","boolean","optional","cursor","take","number","GetRunOptionsWithTaskDetailsSchema","extend","taskdetails","RunSchema","updatedAt","GetRunSchema","output","any","tasks","array","nextCursor","GetRunsOptionsSchema","GetRunsSchema","runs","GetEventSchema","z","object","id","string","name","createdAt","coerce","date","updatedAt","runs","array","status","RunStatusSchema","startedAt","optional","nullable","completedAt","deepMergeFilters","filters","result","filter","key","hasOwnProperty","filterValue","existingValue","Array","isArray","DEFAULT_RETRY_OPTIONS","limit","factor","minTimeoutInMs","maxTimeoutInMs","randomize","calculateRetryAt","retryOptions","attempts","options","retryCount","random","Math","timeoutInMs","round","max","pow","min","Date","now","currentDate","marker","replace","data","now","toISOString","currentTimestampMilliseconds","getTime","currentTimestampSeconds","replacements","urlWithSearchParams","url","params","urlObj","URL","key","value","Object","entries","searchParams","append","String","toString"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/logger.ts","../src/schemas/api.ts","../src/schemas/errors.ts","../src/schemas/eventFilter.ts","../src/schemas/integrations.ts","../src/schemas/json.ts","../src/schemas/properties.ts","../src/schemas/schedules.ts","../src/schemas/tasks.ts","../src/schemas/triggers.ts","../src/schemas/notifications.ts","../src/schemas/fetch.ts","../src/schemas/events.ts","../src/schemas/runs.ts","../src/utils.ts","../src/retry.ts","../src/replacements.ts","../src/searchParams.ts"],"sourcesContent":["export * from \"./logger\";\nexport * from \"./schemas\";\nexport * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./retry\";\nexport * from \"./replacements\";\nexport * from \"./searchParams\";\n","// Create a logger class that uses the debug package internally\n\n/**\n * Represents different log levels.\n * - `\"log\"`: Only essential messages.\n * - `\"error\"`: Errors and essential messages.\n * - `\"warn\"`: Warnings, Errors and essential messages.\n * - `\"info\"`: Info, Warnings, Errors and essential messages.\n * - `\"debug\"`: Everything.\n */\nexport type LogLevel = \"log\" | \"error\" | \"warn\" | \"info\" | \"debug\";\n\nconst logLevels: Array<LogLevel> = [\"log\", \"error\", \"warn\", \"info\", \"debug\"];\n\nexport class Logger {\n #name: string;\n readonly #level: number;\n #filteredKeys: string[] = [];\n #jsonReplacer?: (key: string, value: unknown) => unknown;\n\n constructor(\n name: string,\n level: LogLevel = \"info\",\n filteredKeys: string[] = [],\n jsonReplacer?: (key: string, value: unknown) => unknown\n ) {\n this.#name = name;\n this.#level = logLevels.indexOf((process.env.TRIGGER_LOG_LEVEL ?? level) as LogLevel);\n this.#filteredKeys = filteredKeys;\n this.#jsonReplacer = jsonReplacer;\n }\n\n // Return a new Logger instance with the same name and a new log level\n // but filter out the keys from the log messages (at any level)\n filter(...keys: string[]) {\n return new Logger(this.#name, logLevels[this.#level], keys, this.#jsonReplacer);\n }\n\n static satisfiesLogLevel(logLevel: LogLevel, setLevel: LogLevel) {\n return logLevels.indexOf(logLevel) <= logLevels.indexOf(setLevel);\n }\n\n log(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 0) return;\n\n this.#structuredLog(console.log, message, ...args);\n }\n\n error(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 1) return;\n\n this.#structuredLog(console.error, message, ...args);\n }\n\n warn(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 2) return;\n\n this.#structuredLog(console.warn, message, ...args);\n }\n\n info(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 3) return;\n\n this.#structuredLog(console.info, message, ...args);\n }\n\n debug(message: string, ...args: Array<Record<string, unknown> | undefined>) {\n if (this.#level < 4) return;\n\n this.#structuredLog(console.debug, message, ...args);\n }\n\n #structuredLog(\n loggerFunction: (message: string, ...args: any[]) => void,\n message: string,\n ...args: Array<Record<string, unknown> | undefined>\n ) {\n const structuredLog = {\n ...structureArgs(safeJsonClone(args) as Record<string, unknown>[], this.#filteredKeys),\n timestamp: new Date(),\n name: this.#name,\n message,\n };\n\n loggerFunction(JSON.stringify(structuredLog, createReplacer(this.#jsonReplacer)));\n }\n}\n\nfunction createReplacer(replacer?: (key: string, value: unknown) => unknown) {\n return (key: string, value: unknown) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n if (replacer) {\n return replacer(key, value);\n }\n\n return value;\n };\n}\n\n// Replacer function for JSON.stringify that converts BigInts to strings\nfunction bigIntReplacer(_key: string, value: unknown) {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n\n return value;\n}\n\nfunction safeJsonClone(obj: unknown) {\n try {\n return JSON.parse(JSON.stringify(obj, bigIntReplacer));\n } catch (e) {\n return obj;\n }\n}\n\nfunction formattedDateTime() {\n const date = new Date();\n\n const hours = date.getHours();\n const minutes = date.getMinutes();\n const seconds = date.getSeconds();\n const milliseconds = date.getMilliseconds();\n\n // Make sure the time is always 2 digits\n const formattedHours = hours < 10 ? `0${hours}` : hours;\n const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;\n const formattedSeconds = seconds < 10 ? `0${seconds}` : seconds;\n const formattedMilliseconds =\n milliseconds < 10\n ? `00${milliseconds}`\n : milliseconds < 100\n ? `0${milliseconds}`\n : milliseconds;\n\n return `${formattedHours}:${formattedMinutes}:${formattedSeconds}.${formattedMilliseconds}`;\n}\n\n// If args is has a single item that is an object, return that object\nfunction structureArgs(args: Array<Record<string, unknown>>, filteredKeys: string[] = []) {\n if (args.length === 0) {\n return;\n }\n\n if (args.length === 1 && typeof args[0] === \"object\") {\n return filterKeys(JSON.parse(JSON.stringify(args[0], bigIntReplacer)), filteredKeys);\n }\n\n return args;\n}\n\n// Recursively filter out keys from an object, including nested objects, and arrays\nfunction filterKeys(obj: unknown, keys: string[]): any {\n if (typeof obj !== \"object\" || obj === null) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.map((item) => filterKeys(item, keys));\n }\n\n const filteredObj: any = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (keys.includes(key)) {\n continue;\n }\n\n filteredObj[key] = filterKeys(value, keys);\n }\n\n return filteredObj;\n}\n","import { ulid } from \"ulid\";\nimport { z } from \"zod\";\nimport { ErrorWithStackSchema } from \"./errors\";\nimport { EventRuleSchema } from \"./eventFilter\";\nimport { ConnectionAuthSchema, IntegrationConfigSchema } from \"./integrations\";\nimport { DeserializedJsonSchema, SerializableJsonSchema } from \"./json\";\nimport { DisplayPropertySchema, StyleSchema } from \"./properties\";\nimport {\n CronMetadataSchema,\n IntervalMetadataSchema,\n RegisterDynamicSchedulePayloadSchema,\n ScheduleMetadataSchema,\n} from \"./schedules\";\nimport { CachedTaskSchema, ServerTaskSchema, TaskSchema } from \"./tasks\";\nimport { EventSpecificationSchema, TriggerMetadataSchema } from \"./triggers\";\nimport { Prettify } from \"../types\";\n\nexport const UpdateTriggerSourceBodySchema = z.object({\n registeredEvents: z.array(z.string()),\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n});\n\nexport type UpdateTriggerSourceBody = z.infer<typeof UpdateTriggerSourceBodySchema>;\n\nexport const HttpEventSourceSchema = UpdateTriggerSourceBodySchema.extend({\n id: z.string(),\n active: z.boolean(),\n url: z.string().url(),\n});\n\nexport const RegisterHTTPTriggerSourceBodySchema = z.object({\n type: z.literal(\"HTTP\"),\n url: z.string().url(),\n});\n\nexport const RegisterSMTPTriggerSourceBodySchema = z.object({\n type: z.literal(\"SMTP\"),\n});\n\nexport const RegisterSQSTriggerSourceBodySchema = z.object({\n type: z.literal(\"SQS\"),\n});\n\nexport const RegisterSourceChannelBodySchema = z.discriminatedUnion(\"type\", [\n RegisterHTTPTriggerSourceBodySchema,\n RegisterSMTPTriggerSourceBodySchema,\n RegisterSQSTriggerSourceBodySchema,\n]);\n\nexport const REGISTER_SOURCE_EVENT = \"dev.trigger.source.register\";\n\nexport const RegisterTriggerSourceSchema = z.object({\n key: z.string(),\n params: z.any(),\n active: z.boolean(),\n secret: z.string(),\n data: DeserializedJsonSchema.optional(),\n channel: RegisterSourceChannelBodySchema,\n clientId: z.string().optional(),\n});\n\nexport type RegisterTriggerSource = z.infer<typeof RegisterTriggerSourceSchema>;\n\nexport const RegisterSourceEventSchema = z.object({\n /** The id of the source */\n id: z.string(),\n source: RegisterTriggerSourceSchema,\n events: z.array(z.string()),\n missingEvents: z.array(z.string()),\n orphanedEvents: z.array(z.string()),\n dynamicTriggerId: z.string().optional(),\n});\n\nexport type RegisterSourceEvent = z.infer<typeof RegisterSourceEventSchema>;\n\nexport const TriggerSourceSchema = z.object({\n id: z.string(),\n key: z.string(),\n});\n\nexport const HandleTriggerSourceSchema = z.object({\n key: z.string(),\n secret: z.string(),\n data: z.any(),\n params: z.any(),\n});\n\nexport type HandleTriggerSource = z.infer<typeof HandleTriggerSourceSchema>;\n\nexport type TriggerSource = z.infer<typeof TriggerSourceSchema>;\n\nexport const HttpSourceRequestSchema = z.object({\n url: z.string().url(),\n method: z.string(),\n headers: z.record(z.string()),\n rawBody: z.instanceof(Buffer).optional().nullable(),\n});\n\nexport type HttpSourceRequest = z.infer<typeof HttpSourceRequestSchema>;\n\nexport const HttpSourceRequestHeadersSchema = z.object({\n \"x-ts-key\": z.string(),\n \"x-ts-dynamic-id\": z.string().optional(),\n \"x-ts-secret\": z.string(),\n \"x-ts-data\": z.string().transform((s) => JSON.parse(s)),\n \"x-ts-params\": z.string().transform((s) => JSON.parse(s)),\n \"x-ts-http-url\": z.string(),\n \"x-ts-http-method\": z.string(),\n \"x-ts-http-headers\": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s))),\n});\n\nexport type HttpSourceRequestHeaders = z.output<typeof HttpSourceRequestHeadersSchema>;\n\nexport const PongSuccessResponseSchema = z.object({\n ok: z.literal(true),\n});\n\nexport const PongErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n});\n\nexport const PongResponseSchema = z.discriminatedUnion(\"ok\", [\n PongSuccessResponseSchema,\n PongErrorResponseSchema,\n]);\n\nexport type PongResponse = z.infer<typeof PongResponseSchema>;\n\nexport const ValidateSuccessResponseSchema = z.object({\n ok: z.literal(true),\n endpointId: z.string(),\n});\n\nexport const ValidateErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n});\n\nexport const ValidateResponseSchema = z.discriminatedUnion(\"ok\", [\n ValidateSuccessResponseSchema,\n ValidateErrorResponseSchema,\n]);\n\nexport type ValidateResponse = z.infer<typeof ValidateResponseSchema>;\n\nexport const QueueOptionsSchema = z.object({\n name: z.string(),\n maxConcurrent: z.number().optional(),\n});\n\nexport type QueueOptions = z.infer<typeof QueueOptionsSchema>;\n\nexport const JobMetadataSchema = z.object({\n id: z.string(),\n name: z.string(),\n version: z.string(),\n event: EventSpecificationSchema,\n trigger: TriggerMetadataSchema,\n integrations: z.record(IntegrationConfigSchema),\n internal: z.boolean().default(false),\n queue: z.union([QueueOptionsSchema, z.string()]).optional(),\n startPosition: z.enum([\"initial\", \"latest\"]),\n enabled: z.boolean(),\n preprocessRuns: z.boolean(),\n});\n\nexport type JobMetadata = z.infer<typeof JobMetadataSchema>;\n\nexport const SourceMetadataSchema = z.object({\n channel: z.enum([\"HTTP\", \"SQS\", \"SMTP\"]),\n integration: IntegrationConfigSchema,\n key: z.string(),\n params: z.any(),\n events: z.array(z.string()),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type SourceMetadata = z.infer<typeof SourceMetadataSchema>;\n\nexport const DynamicTriggerEndpointMetadataSchema = z.object({\n id: z.string(),\n jobs: z.array(JobMetadataSchema.pick({ id: true, version: true })),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type DynamicTriggerEndpointMetadata = z.infer<typeof DynamicTriggerEndpointMetadataSchema>;\n\nexport const IndexEndpointResponseSchema = z.object({\n jobs: z.array(JobMetadataSchema),\n sources: z.array(SourceMetadataSchema),\n dynamicTriggers: z.array(DynamicTriggerEndpointMetadataSchema),\n dynamicSchedules: z.array(RegisterDynamicSchedulePayloadSchema),\n});\n\nexport type IndexEndpointResponse = z.infer<typeof IndexEndpointResponseSchema>;\n\nexport const RawEventSchema = z.object({\n /** The `name` property must exactly match any subscriptions you want to\n trigger. */\n name: z.string(),\n /** The `payload` property will be sent to any matching Jobs and will appear\n as the `payload` param of the `run()` function. You can leave this\n parameter out if you just want to trigger a Job without any input data. */\n payload: z.any(),\n /** The optional `context` property will be sent to any matching Jobs and will\n be passed through as the `context.event.context` param of the `run()`\n function. This is optional but can be useful if you want to pass through\n some additional context to the Job. */\n context: z.any().optional(),\n /** The `id` property uniquely identify this particular event. If unset it\n will be set automatically using `ulid`. */\n id: z.string().default(() => ulid()),\n /** This is optional, it defaults to the current timestamp. Usually you would\n only set this if you have a timestamp that you wish to pass through, e.g.\n you receive a timestamp from a service and you want the same timestamp to\n be used in your Job. */\n timestamp: z.coerce.date().optional(),\n /** This is optional, it defaults to \"trigger.dev\". It can be useful to set\n this as you can filter events using this in the `eventTrigger()`. */\n source: z.string().optional(),\n});\n\nexport type RawEvent = z.infer<typeof RawEventSchema>;\n\n/** The event you wish to send to Trigger a Job */\nexport type SendEvent = z.input<typeof RawEventSchema>;\n\n/** The event that was sent */\nexport const ApiEventLogSchema = z.object({\n /** The `id` of the event that was sent.\n */\n id: z.string(),\n /** The `name` of the event that was sent. */\n name: z.string(),\n /** The `payload` of the event that was sent */\n payload: DeserializedJsonSchema,\n /** The `context` of the event that was sent. Is `undefined` if no context was\n set when sending the event. */\n context: DeserializedJsonSchema.optional().nullable(),\n /** The `timestamp` of the event that was sent */\n timestamp: z.coerce.date(),\n /** The timestamp when the event will be delivered to any matching Jobs. Is\n `undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the\n event. */\n deliverAt: z.coerce.date().optional().nullable(),\n /** The timestamp when the event was delivered. Is `undefined` if `deliverAt`\n or `deliverAfter` were set when sending the event. */\n deliveredAt: z.coerce.date().optional().nullable(),\n});\n\nexport type ApiEventLog = z.infer<typeof ApiEventLogSchema>;\n\n/** Options to control the delivery of the event */\nexport const SendEventOptionsSchema = z.object({\n /** An optional Date when you want the event to trigger Jobs. The event will\n be sent to the platform immediately but won't be acted upon until the\n specified time. */\n deliverAt: z.coerce.date().optional(),\n /** An optional number of seconds you want to wait for the event to trigger\n any relevant Jobs. The event will be sent to the platform immediately but\n won't be delivered until after the elapsed number of seconds. */\n deliverAfter: z.number().int().optional(),\n /** This optional param will be used by Trigger.dev Connect, which\n is coming soon. */\n accountId: z.string().optional(),\n});\n\nexport const SendEventBodySchema = z.object({\n event: RawEventSchema,\n options: SendEventOptionsSchema.optional(),\n});\n\nexport type SendEventBody = z.infer<typeof SendEventBodySchema>;\nexport type SendEventOptions = z.infer<typeof SendEventOptionsSchema>;\n\nexport const DeliverEventResponseSchema = z.object({\n deliveredAt: z.string().datetime(),\n});\n\nexport type DeliverEventResponse = z.infer<typeof DeliverEventResponseSchema>;\n\nexport const RuntimeEnvironmentTypeSchema = z.enum([\n \"PRODUCTION\",\n \"STAGING\",\n \"DEVELOPMENT\",\n \"PREVIEW\",\n]);\n\nexport type RuntimeEnvironmentType = z.infer<typeof RuntimeEnvironmentTypeSchema>;\n\nexport const RunSourceContextSchema = z.object({\n id: z.string(),\n metadata: z.any(),\n});\n\nexport const RunJobBodySchema = z.object({\n event: ApiEventLogSchema,\n job: z.object({\n id: z.string(),\n version: z.string(),\n }),\n run: z.object({\n id: z.string(),\n isTest: z.boolean(),\n isRetry: z.boolean().default(false),\n startedAt: z.coerce.date(),\n }),\n environment: z.object({\n id: z.string(),\n slug: z.string(),\n type: RuntimeEnvironmentTypeSchema,\n }),\n organization: z.object({\n id: z.string(),\n title: z.string(),\n slug: z.string(),\n }),\n account: z\n .object({\n id: z.string(),\n metadata: z.any(),\n })\n .optional(),\n source: RunSourceContextSchema.optional(),\n tasks: z.array(CachedTaskSchema).optional(),\n connections: z.record(ConnectionAuthSchema).optional(),\n});\n\nexport type RunJobBody = z.infer<typeof RunJobBodySchema>;\n\nexport const RunJobErrorSchema = z.object({\n status: z.literal(\"ERROR\"),\n error: ErrorWithStackSchema,\n task: TaskSchema.optional(),\n});\n\nexport type RunJobError = z.infer<typeof RunJobErrorSchema>;\n\nexport const RunJobResumeWithTaskSchema = z.object({\n status: z.literal(\"RESUME_WITH_TASK\"),\n task: TaskSchema,\n});\n\nexport type RunJobResumeWithTask = z.infer<typeof RunJobResumeWithTaskSchema>;\n\nexport const RunJobRetryWithTaskSchema = z.object({\n status: z.literal(\"RETRY_WITH_TASK\"),\n task: TaskSchema,\n error: ErrorWithStackSchema,\n retryAt: z.coerce.date(),\n});\n\nexport type RunJobRetryWithTask = z.infer<typeof RunJobRetryWithTaskSchema>;\n\nexport const RunJobCanceledWithTaskSchema = z.object({\n status: z.literal(\"CANCELED\"),\n task: TaskSchema,\n});\n\nexport type RunJobCanceledWithTask = z.infer<typeof RunJobCanceledWithTaskSchema>;\n\nexport const RunJobSuccessSchema = z.object({\n status: z.literal(\"SUCCESS\"),\n output: DeserializedJsonSchema.optional(),\n});\n\nexport type RunJobSuccess = z.infer<typeof RunJobSuccessSchema>;\n\nexport const RunJobResponseSchema = z.discriminatedUnion(\"status\", [\n RunJobErrorSchema,\n RunJobResumeWithTaskSchema,\n RunJobRetryWithTaskSchema,\n RunJobCanceledWithTaskSchema,\n RunJobSuccessSchema,\n]);\n\nexport type RunJobResponse = z.infer<typeof RunJobResponseSchema>;\n\nexport const PreprocessRunBodySchema = z.object({\n event: ApiEventLogSchema,\n job: z.object({\n id: z.string(),\n version: z.string(),\n }),\n run: z.object({\n id: z.string(),\n isTest: z.boolean(),\n }),\n environment: z.object({\n id: z.string(),\n slug: z.string(),\n type: RuntimeEnvironmentTypeSchema,\n }),\n organization: z.object({\n id: z.string(),\n title: z.string(),\n slug: z.string(),\n }),\n account: z\n .object({\n id: z.string(),\n metadata: z.any(),\n })\n .optional(),\n});\n\nexport type PreprocessRunBody = z.infer<typeof PreprocessRunBodySchema>;\n\nexport const PreprocessRunResponseSchema = z.object({\n abort: z.boolean(),\n properties: z.array(DisplayPropertySchema).optional(),\n});\n\nexport type PreprocessRunResponse = z.infer<typeof PreprocessRunResponseSchema>;\n\nexport const CreateRunBodySchema = z.object({\n client: z.string(),\n job: JobMetadataSchema,\n event: ApiEventLogSchema,\n properties: z.array(DisplayPropertySchema).optional(),\n});\n\nexport type CreateRunBody = z.infer<typeof CreateRunBodySchema>;\n\nconst CreateRunResponseOkSchema = z.object({\n ok: z.literal(true),\n data: z.object({\n id: z.string(),\n }),\n});\n\nconst CreateRunResponseErrorSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n});\n\nexport const CreateRunResponseBodySchema = z.discriminatedUnion(\"ok\", [\n CreateRunResponseOkSchema,\n CreateRunResponseErrorSchema,\n]);\n\nexport type CreateRunResponseBody = z.infer<typeof CreateRunResponseBodySchema>;\n\nexport const RedactStringSchema = z.object({\n __redactedString: z.literal(true),\n strings: z.array(z.string()),\n interpolations: z.array(z.string()),\n});\n\nexport type RedactString = z.infer<typeof RedactStringSchema>;\n\nexport const LogMessageSchema = z.object({\n level: z.enum([\"DEBUG\", \"INFO\", \"WARN\", \"ERROR\"]),\n message: z.string(),\n data: SerializableJsonSchema.optional(),\n});\n\nexport type LogMessage = z.infer<typeof LogMessageSchema>;\n\nexport type ClientTask = z.infer<typeof TaskSchema>;\nexport type CachedTask = z.infer<typeof CachedTaskSchema>;\n\nexport const RedactSchema = z.object({\n paths: z.array(z.string()),\n});\n\nexport const RetryOptionsSchema = z.object({\n /** The maximum number of times to retry the request. */\n limit: z.number().optional(),\n /** The exponential factor to use when calculating the next retry time. */\n factor: z.number().optional(),\n /** The minimum amount of time to wait before retrying the request. */\n minTimeoutInMs: z.number().optional(),\n /** The maximum amount of time to wait before retrying the request. */\n maxTimeoutInMs: z.number().optional(),\n /** Whether to randomize the retry time. */\n randomize: z.boolean().optional(),\n});\n\nexport type RetryOptions = z.infer<typeof RetryOptionsSchema>;\n\nexport const RunTaskOptionsSchema = z.object({\n /** The name of the Task is required. This is displayed on the Task in the logs. */\n name: z.string(),\n /** The Task will wait and only start at the specified Date */\n delayUntil: z.coerce.date().optional(),\n /** Retry options */\n retry: RetryOptionsSchema.optional(),\n /** The icon for the Task, it will appear in the logs.\n * You can use the name of a company in lowercase, e.g. \"github\".\n * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */\n icon: z.string().optional(),\n /** The key for the Task that you want to appear in the logs */\n displayKey: z.string().optional(),\n /** A description of the Task */\n description: z.string().optional(),\n /** Properties that are displayed in the logs */\n properties: z.array(DisplayPropertySchema).optional(),\n /** The input params to the Task, will be displayed in the logs */\n params: z.any(),\n /** The style of the log entry. */\n style: StyleSchema.optional(),\n /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */\n connectionKey: z.string().optional(),\n /** An operation you want to perform on the Trigger.dev platform, current only \"fetch\" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */\n operation: z.enum([\"fetch\"]).optional(),\n /** A No Operation means that the code won't be executed. This is used internally to implement features like [io.wait()](https://trigger.dev/docs/sdk/io/wait). */\n noop: z.boolean().default(false),\n redact: RedactSchema.optional(),\n trigger: TriggerMetadataSchema.optional(),\n});\n\nexport type RunTaskOptions = z.input<typeof RunTaskOptionsSchema>;\n\nexport const RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({\n idempotencyKey: z.string(),\n parentId: z.string().optional(),\n});\n\nexport type RunTaskBodyInput = z.infer<typeof RunTaskBodyInputSchema>;\n\nexport const RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({\n params: DeserializedJsonSchema.optional().nullable(),\n});\n\nexport type RunTaskBodyOutput = z.infer<typeof RunTaskBodyOutputSchema>;\n\nexport const CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({\n properties: true,\n description: true,\n params: true,\n}).extend({\n output: SerializableJsonSchema.optional().transform((v) =>\n v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {}\n ),\n});\n\nexport type CompleteTaskBodyInput = Prettify<z.input<typeof CompleteTaskBodyInputSchema>>;\nexport type CompleteTaskBodyOutput = z.infer<typeof CompleteTaskBodyInputSchema>;\n\nexport const FailTaskBodyInputSchema = z.object({\n error: ErrorWithStackSchema,\n});\n\nexport type FailTaskBodyInput = z.infer<typeof FailTaskBodyInputSchema>;\n\nexport const NormalizedRequestSchema = z.object({\n headers: z.record(z.string()),\n method: z.string(),\n query: z.record(z.string()),\n url: z.string(),\n body: z.any(),\n});\n\nexport type NormalizedRequest = z.infer<typeof NormalizedRequestSchema>;\n\nexport const NormalizedResponseSchema = z.object({\n status: z.number(),\n body: z.any(),\n headers: z.record(z.string()).optional(),\n});\n\nexport type NormalizedResponse = z.infer<typeof NormalizedResponseSchema>;\n\nexport const HttpSourceResponseSchema = z.object({\n response: NormalizedResponseSchema,\n events: z.array(RawEventSchema),\n});\n\nexport const RegisterTriggerBodySchema = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataSchema,\n});\n\nexport type RegisterTriggerBody = z.infer<typeof RegisterTriggerBodySchema>;\n\nexport const InitializeTriggerBodySchema = z.object({\n id: z.string(),\n params: z.any(),\n accountId: z.string().optional(),\n metadata: z.any().optional(),\n});\n\nexport type InitializeTriggerBody = z.infer<typeof InitializeTriggerBodySchema>;\n\nconst RegisterCommonScheduleBodySchema = z.object({\n /** A unique id for the schedule. This is used to identify and unregister the schedule later. */\n id: z.string(),\n /** Any additional metadata about the schedule. */\n metadata: z.any(),\n /** This will be used by the Trigger.dev Connect feature, which is coming soon. */\n accountId: z.string().optional(),\n});\n\nexport const RegisterIntervalScheduleBodySchema =\n RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);\n\nexport type RegisterIntervalScheduleBody = z.infer<typeof RegisterIntervalScheduleBodySchema>;\n\nexport const InitializeCronScheduleBodySchema =\n RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);\n\nexport type RegisterCronScheduleBody = z.infer<typeof InitializeCronScheduleBodySchema>;\n\nexport const RegisterScheduleBodySchema = z.discriminatedUnion(\"type\", [\n RegisterIntervalScheduleBodySchema,\n InitializeCronScheduleBodySchema,\n]);\n\nexport type RegisterScheduleBody = z.infer<typeof RegisterScheduleBodySchema>;\n\nexport const RegisterScheduleResponseBodySchema = z.object({\n id: z.string(),\n schedule: ScheduleMetadataSchema,\n metadata: z.any(),\n active: z.boolean(),\n});\n\nexport type RegisterScheduleResponseBody = z.infer<typeof RegisterScheduleResponseBodySchema>;\n\nexport const CreateExternalConnectionBodySchema = z.object({\n accessToken: z.string(),\n type: z.enum([\"oauth2\"]),\n scopes: z.array(z.string()).optional(),\n metadata: z.any(),\n});\n\nexport type CreateExternalConnectionBody = z.infer<typeof CreateExternalConnectionBodySchema>;\n","import { z } from \"zod\";\n\nexport const ErrorWithStackSchema = z.object({\n message: z.string(),\n name: z.string().optional(),\n stack: z.string().optional(),\n});\n\nexport type ErrorWithStack = z.infer<typeof ErrorWithStackSchema>;\n","import { z } from \"zod\";\n\nconst EventMatcherSchema = z.union([\n /** Match against a string */\n z.array(z.string()),\n /** Match against a number */\n z.array(z.number()),\n /** Match against a boolean */\n z.array(z.boolean()),\n]);\n\ntype EventMatcher = z.infer<typeof EventMatcherSchema>;\n\n/** A filter for matching against data */\nexport type EventFilter = { [key: string]: EventMatcher | EventFilter };\n\nexport const EventFilterSchema: z.ZodType<EventFilter> = z.lazy(() =>\n z.record(z.union([EventMatcherSchema, EventFilterSchema]))\n);\n\nexport const EventRuleSchema = z.object({\n event: z.string().or(z.array(z.string())),\n source: z.string(),\n payload: EventFilterSchema.optional(),\n context: EventFilterSchema.optional(),\n});\n\nexport type EventRule = z.infer<typeof EventRuleSchema>;\n","import { z } from \"zod\";\n\nexport const ConnectionAuthSchema = z.object({\n type: z.enum([\"oauth2\"]),\n accessToken: z.string(),\n scopes: z.array(z.string()).optional(),\n additionalFields: z.record(z.string()).optional(),\n});\n\nexport type ConnectionAuth = z.infer<typeof ConnectionAuthSchema>;\n\nexport const IntegrationMetadataSchema = z.object({\n id: z.string(),\n name: z.string(),\n instructions: z.string().optional(),\n});\n\nexport type IntegrationMetadata = z.infer<typeof IntegrationMetadataSchema>;\n\nexport const IntegrationConfigSchema = z.object({\n id: z.string(),\n metadata: IntegrationMetadataSchema,\n authSource: z.enum([\"HOSTED\", \"LOCAL\"]),\n});\n\nexport type IntegrationConfig = z.infer<typeof IntegrationConfigSchema>;\n","import { z } from \"zod\";\n\nconst LiteralSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);\ntype Literal = z.infer<typeof LiteralSchema>;\n\nexport type DeserializedJson = Literal | { [key: string]: DeserializedJson } | DeserializedJson[];\n\nexport const DeserializedJsonSchema: z.ZodType<DeserializedJson> = z.lazy(() =>\n z.union([LiteralSchema, z.array(DeserializedJsonSchema), z.record(DeserializedJsonSchema)])\n);\n\nconst SerializableSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.date(),\n z.undefined(),\n z.symbol(),\n]);\ntype Serializable = z.infer<typeof SerializableSchema>;\n\nexport type SerializableJson =\n | Serializable\n | { [key: string]: SerializableJson }\n | SerializableJson[];\n\nexport const SerializableJsonSchema: z.ZodType<SerializableJson> = z.lazy(() =>\n z.union([SerializableSchema, z.array(SerializableJsonSchema), z.record(SerializableJsonSchema)])\n);\n","import { z } from \"zod\";\n\n/** A property that is displayed in the logs */\nexport const DisplayPropertySchema = z.object({\n /** The label for the property */\n label: z.string(),\n /** The value of the property */\n text: z.string(),\n /** The URL to link to when the property is clicked */\n url: z.string().optional(),\n});\n\nexport const DisplayPropertiesSchema = z.array(DisplayPropertySchema);\n\nexport type DisplayProperty = z.infer<typeof DisplayPropertySchema>;\n\nexport const StyleSchema = z.object({\n /** The style, `normal` or `minimal` */\n style: z.enum([\"normal\", \"minimal\"]),\n /** A variant of the style. */\n variant: z.string().optional(),\n});\n\nexport type Style = z.infer<typeof StyleSchema>;\nexport type StyleName = Style[\"style\"];\n","import { z } from \"zod\";\n\nexport const SCHEDULED_EVENT = \"dev.trigger.scheduled\";\n\nexport const ScheduledPayloadSchema = z.object({\n ts: z.coerce.date(),\n lastTimestamp: z.coerce.date().optional(),\n});\n\nexport type ScheduledPayload = z.infer<typeof ScheduledPayloadSchema>;\n\nexport const IntervalOptionsSchema = z.object({\n /** The number of seconds for the interval. Min = 60, Max = 86400 (1 day) */\n seconds: z.number().int().positive().min(60).max(86400),\n});\n\n/** Interval options */\nexport type IntervalOptions = z.infer<typeof IntervalOptionsSchema>;\n\nexport const CronOptionsSchema = z.object({\n /** A CRON expression that defines the schedule. A useful tool when writing CRON\n expressions is [crontab guru](https://crontab.guru). Note that the timezone\n used is UTC. */\n cron: z.string(),\n});\n\n/** The options for a `cronTrigger()` */\nexport type CronOptions = z.infer<typeof CronOptionsSchema>;\n\nexport const CronMetadataSchema = z.object({\n type: z.literal(\"cron\"),\n options: CronOptionsSchema,\n metadata: z.any(),\n});\n\nexport type CronMetadata = z.infer<typeof CronMetadataSchema>;\n\nexport const IntervalMetadataSchema = z.object({\n /** An interval reoccurs at the specified number of seconds */\n type: z.literal(\"interval\"),\n /** An object containing options about the interval. */\n options: IntervalOptionsSchema,\n /** Any additional metadata about the schedule. */\n metadata: z.any(),\n});\n\nexport type IntervalMetadata = z.infer<typeof IntervalMetadataSchema>;\n\nexport const ScheduleMetadataSchema = z.discriminatedUnion(\"type\", [\n IntervalMetadataSchema,\n CronMetadataSchema,\n]);\n\nexport type ScheduleMetadata = z.infer<typeof ScheduleMetadataSchema>;\n\nexport const RegisterDynamicSchedulePayloadSchema = z.object({\n id: z.string(),\n jobs: z.array(\n z.object({\n id: z.string(),\n version: z.string(),\n })\n ),\n});\n\nexport type RegisterDynamicSchedulePayload = z.infer<typeof RegisterDynamicSchedulePayloadSchema>;\n","import { z } from \"zod\";\nimport { DisplayPropertySchema, StyleSchema } from \"./properties\";\nimport { DeserializedJsonSchema } from \"./json\";\n\nexport const TaskStatusSchema = z.enum([\n \"PENDING\",\n \"WAITING\",\n \"RUNNING\",\n \"COMPLETED\",\n \"ERRORED\",\n \"CANCELED\",\n]);\n\nexport type TaskStatus = z.infer<typeof TaskStatusSchema>;\n\nexport const TaskSchema = z.object({\n id: z.string(),\n name: z.string(),\n icon: z.string().optional().nullable(),\n noop: z.boolean(),\n startedAt: z.coerce.date().optional().nullable(),\n completedAt: z.coerce.date().optional().nullable(),\n delayUntil: z.coerce.date().optional().nullable(),\n status: TaskStatusSchema,\n description: z.string().optional().nullable(),\n properties: z.array(DisplayPropertySchema).optional().nullable(),\n outputProperties: z.array(DisplayPropertySchema).optional().nullable(),\n params: DeserializedJsonSchema.optional().nullable(),\n output: DeserializedJsonSchema.optional().nullable(),\n error: z.string().optional().nullable(),\n parentId: z.string().optional().nullable(),\n style: StyleSchema.optional().nullable(),\n operation: z.string().optional().nullable(),\n});\n\nexport const ServerTaskSchema = TaskSchema.extend({\n idempotencyKey: z.string(),\n attempts: z.number(),\n});\n\nexport type ServerTask = z.infer<typeof ServerTaskSchema>;\n\nexport const CachedTaskSchema = z.object({\n id: z.string(),\n idempotencyKey: z.string(),\n status: TaskStatusSchema,\n noop: z.boolean().default(false),\n output: DeserializedJsonSchema.optional().nullable(),\n parentId: z.string().optional().nullable(),\n});\n","import { z } from \"zod\";\nimport { EventFilterSchema, EventRuleSchema } from \"./eventFilter\";\nimport { DisplayPropertySchema } from \"./properties\";\nimport { ScheduleMetadataSchema } from \"./schedules\";\n\nexport const EventExampleSchema = z.object({\n id: z.string(),\n icon: z.string().optional(),\n name: z.string(),\n payload: z.any(),\n});\n\nexport type EventExample = z.infer<typeof EventExampleSchema>;\n\nexport const EventSpecificationSchema = z.object({\n name: z.string().or(z.array(z.string())),\n title: z.string(),\n source: z.string(),\n icon: z.string(),\n filter: EventFilterSchema.optional(),\n properties: z.array(DisplayPropertySchema).optional(),\n schema: z.any().optional(),\n examples: z.array(EventExampleSchema).optional(),\n});\n\nexport const DynamicTriggerMetadataSchema = z.object({\n type: z.literal(\"dynamic\"),\n id: z.string(),\n});\n\nexport const StaticTriggerMetadataSchema = z.object({\n type: z.literal(\"static\"),\n title: z.union([z.string(), z.array(z.string())]),\n properties: z.array(DisplayPropertySchema).optional(),\n rule: EventRuleSchema,\n});\n\nexport const ScheduledTriggerMetadataSchema = z.object({\n type: z.literal(\"scheduled\"),\n schedule: ScheduleMetadataSchema,\n});\n\nexport const TriggerMetadataSchema = z.discriminatedUnion(\"type\", [\n DynamicTriggerMetadataSchema,\n StaticTriggerMetadataSchema,\n ScheduledTriggerMetadataSchema,\n]);\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n","import { z } from \"zod\";\n\nexport const MISSING_CONNECTION_NOTIFICATION = \"dev.trigger.notifications.missingConnection\";\n\nexport const MISSING_CONNECTION_RESOLVED_NOTIFICATION =\n \"dev.trigger.notifications.missingConnectionResolved\";\n\nexport const CommonMissingConnectionNotificationPayloadSchema = z.object({\n id: z.string(),\n client: z.object({\n id: z.string(),\n title: z.string(),\n scopes: z.array(z.string()),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n }),\n authorizationUrl: z.string(),\n});\n\nexport const MissingDeveloperConnectionNotificationPayloadSchema =\n CommonMissingConnectionNotificationPayloadSchema.extend({\n type: z.literal(\"DEVELOPER\"),\n });\n\nexport const MissingExternalConnectionNotificationPayloadSchema =\n CommonMissingConnectionNotificationPayloadSchema.extend({\n type: z.literal(\"EXTERNAL\"),\n account: z.object({\n id: z.string(),\n metadata: z.any(),\n }),\n });\n\nexport const MissingConnectionNotificationPayloadSchema = z.discriminatedUnion(\"type\", [\n MissingDeveloperConnectionNotificationPayloadSchema,\n MissingExternalConnectionNotificationPayloadSchema,\n]);\n\nexport type MissingConnectionNotificationPayload = z.infer<\n typeof MissingConnectionNotificationPayloadSchema\n>;\n\nexport const CommonMissingConnectionNotificationResolvedPayloadSchema = z.object({\n id: z.string(),\n client: z.object({\n id: z.string(),\n title: z.string(),\n scopes: z.array(z.string()),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n integrationIdentifier: z.string(),\n integrationAuthMethod: z.string(),\n }),\n expiresAt: z.coerce.date(),\n});\n\nexport const MissingDeveloperConnectionResolvedNotificationPayloadSchema =\n CommonMissingConnectionNotificationResolvedPayloadSchema.extend({\n type: z.literal(\"DEVELOPER\"),\n });\n\nexport const MissingExternalConnectionResolvedNotificationPayloadSchema =\n CommonMissingConnectionNotificationResolvedPayloadSchema.extend({\n type: z.literal(\"EXTERNAL\"),\n account: z.object({\n id: z.string(),\n metadata: z.any(),\n }),\n });\n\nexport const MissingConnectionResolvedNotificationPayloadSchema = z.discriminatedUnion(\"type\", [\n MissingDeveloperConnectionResolvedNotificationPayloadSchema,\n MissingExternalConnectionResolvedNotificationPayloadSchema,\n]);\n\nexport type MissingConnectionResolvedNotificationPayload = z.infer<\n typeof MissingConnectionResolvedNotificationPayloadSchema\n>;\n","import { z } from \"zod\";\nimport { RedactStringSchema, RetryOptionsSchema } from \"./api\";\n\nexport const FetchRetryHeadersStrategySchema = z.object({\n /** The `headers` strategy retries the request using info from the response headers. */\n strategy: z.literal(\"headers\"),\n /** The header to use to determine the maximum number of times to retry the request. */\n limitHeader: z.string(),\n /** The header to use to determine the number of remaining retries. */\n remainingHeader: z.string(),\n /** The header to use to determine the time when the number of remaining retries will be reset. */\n resetHeader: z.string(),\n});\n\nexport type FetchRetryHeadersStrategy = z.infer<typeof FetchRetryHeadersStrategySchema>;\n\n/** The `backoff` strategy retries the request with an exponential backoff. */\nexport const FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({\n /** The `backoff` strategy retries the request with an exponential backoff. */\n strategy: z.literal(\"backoff\"),\n});\n\n/** The `backoff` strategy retries the request with an exponential backoff. */\nexport type FetchRetryBackoffStrategy = z.infer<typeof FetchRetryBackoffStrategySchema>;\n\nexport const FetchRetryStrategySchema = z.discriminatedUnion(\"strategy\", [\n FetchRetryHeadersStrategySchema,\n FetchRetryBackoffStrategySchema,\n]);\n\nexport type FetchRetryStrategy = z.infer<typeof FetchRetryStrategySchema>;\n\n/** The options for a fetch request */\nexport const FetchRequestInitSchema = z.object({\n /** The HTTP method to use for the request. */\n method: z.string().optional(),\n /** Any headers to send with the request. Note that you can use [redactString](https://trigger.dev/docs/sdk/redactString) to prevent sensitive information from being stored (e.g. in the logs), like API keys and tokens. */\n headers: z.record(z.union([z.string(), RedactStringSchema])).optional(),\n /** The body of the request. */\n body: z.union([z.string(), z.instanceof(ArrayBuffer)]).optional(),\n});\n\n/** The options for a fetch request */\nexport type FetchRequestInit = z.infer<typeof FetchRequestInitSchema>;\n\nexport const FetchRetryOptionsSchema = z.record(FetchRetryStrategySchema);\n\n/** An object where the key is a status code pattern and the value is a retrying strategy. Supported patterns are:\n - Specific status codes: 429\n - Ranges: 500-599\n - Wildcards: 2xx, 3xx, 4xx, 5xx \n */\nexport type FetchRetryOptions = z.infer<typeof FetchRetryOptionsSchema>;\n\nexport const FetchOperationSchema = z.object({\n url: z.string(),\n requestInit: FetchRequestInitSchema.optional(),\n retry: z.record(FetchRetryStrategySchema).optional(),\n});\n\nexport type FetchOperation = z.infer<typeof FetchOperationSchema>;\n","import { z } from \"zod\";\nimport { RunStatusSchema } from \"./runs\";\n\nexport const GetEventSchema = z.object({\n /** The event id */\n id: z.string(),\n /** The event name */\n name: z.string(),\n /** When the event was created */\n createdAt: z.coerce.date(),\n /** When the event was last updated */\n updatedAt: z.coerce.date(),\n /** The runs that were triggered by the event */\n runs: z.array(\n z.object({\n /** The Run id */\n id: z.string(),\n /** The Run status */\n status: RunStatusSchema,\n /** When the run started */\n startedAt: z.coerce.date().optional().nullable(),\n /** When the run completed */\n completedAt: z.coerce.date().optional().nullable(),\n })\n ),\n});\n\nexport type GetEvent = z.infer<typeof GetEventSchema>;\n","import { ZodObject, z } from \"zod\";\nimport { TaskStatusSchema } from \"./tasks\";\n\nexport const RunStatusSchema = z.union([\n z.literal(\"PENDING\"),\n z.literal(\"QUEUED\"),\n z.literal(\"WAITING_ON_CONNECTIONS\"),\n z.literal(\"PREPROCESSING\"),\n z.literal(\"STARTED\"),\n z.literal(\"SUCCESS\"),\n z.literal(\"FAILURE\"),\n z.literal(\"TIMED_OUT\"),\n z.literal(\"ABORTED\"),\n z.literal(\"CANCELED\"),\n]);\n\nexport const RunTaskSchema = z.object({\n /** The Task id */\n id: z.string(),\n /** The key that you defined when creating the Task, the first param in any task. */\n displayKey: z.string().nullable(),\n /** The Task status */\n status: TaskStatusSchema,\n /** The name of the Task */\n name: z.string(),\n /** The icon of the Task, a string.\n * For integrations, this will be a lowercase name of the company.\n * Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */\n icon: z.string().nullable(),\n /** When the task started */\n startedAt: z.coerce.date().nullable(),\n /** When the task completed */\n completedAt: z.coerce.date().nullable(),\n});\n\nconst GetRunOptionsSchema = z.object({\n /** Return subtasks, which appear in a `subtasks` array on a task. @default false */\n subtasks: z.boolean().optional(),\n /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */\n cursor: z.string().optional(),\n /** How many tasks you want to return in one go, max 50. @default 20 */\n take: z.number().optional(),\n});\n\nexport type GetRunOptions = z.infer<typeof GetRunOptionsSchema>;\n\nconst GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({\n /** If `true`, it returns the `params` and `output` of all tasks. @default false */\n taskdetails: z.boolean().optional(),\n});\n\nexport type GetRunOptionsWithTaskDetails = z.infer<typeof GetRunOptionsWithTaskDetailsSchema>;\n\nconst RunSchema = z.object({\n /** The Run id */\n id: z.string(),\n /** The Run status */\n status: RunStatusSchema,\n /** When the run started */\n startedAt: z.coerce.date().nullable(),\n /** When the run was last updated */\n updatedAt: z.coerce.date().nullable(),\n /** When the run was completed */\n completedAt: z.coerce.date().nullable(),\n});\n\nexport const GetRunSchema = RunSchema.extend({\n /** The output of the run */\n output: z.any().optional(),\n /** The tasks from the run */\n tasks: z.array(RunTaskSchema),\n /** If there are more tasks, you can use this to get them */\n nextCursor: z.string().optional(),\n});\n\nexport type GetRun = z.infer<typeof GetRunSchema>;\n\nconst GetRunsOptionsSchema = z.object({\n /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */\n cursor: z.string().optional(),\n /** How many runs you want to return in one go, max 50. @default 20 */\n take: z.number().optional(),\n});\n\nexport type GetRunsOptions = z.infer<typeof GetRunsOptionsSchema>;\n\nexport const GetRunsSchema = z.object({\n /** The runs from the query */\n runs: RunSchema.array(),\n /** If there are more runs, you can use this to get them */\n nextCursor: z.string().optional(),\n});\n","// EventFilter is typed as type EventFilter = { [key: string]: EventFilter | string[] | number[] | boolean[] }\n\nimport { EventFilter } from \"./schemas\";\n\n// This function should take any number of EventFilters and return a new EventFilter that is the result of merging of them.\nexport function deepMergeFilters(...filters: EventFilter[]): EventFilter {\n const result: EventFilter = {};\n\n for (const filter of filters) {\n for (const key in filter) {\n if (filter.hasOwnProperty(key)) {\n const filterValue = filter[key];\n const existingValue = result[key];\n\n if (\n existingValue &&\n typeof existingValue === \"object\" &&\n typeof filterValue === \"object\" &&\n !Array.isArray(existingValue) &&\n !Array.isArray(filterValue) &&\n existingValue !== null &&\n filterValue !== null\n ) {\n result[key] = deepMergeFilters(existingValue, filterValue);\n } else {\n result[key] = filterValue;\n }\n }\n }\n }\n\n return result;\n}\n","import { RetryOptions } from \"./schemas\";\n\nconst DEFAULT_RETRY_OPTIONS = {\n limit: 5,\n factor: 1.8,\n minTimeoutInMs: 1000,\n maxTimeoutInMs: 60000,\n randomize: true,\n} satisfies RetryOptions;\n\nexport function calculateRetryAt(retryOptions: RetryOptions, attempts: number): Date | undefined {\n const options = {\n ...DEFAULT_RETRY_OPTIONS,\n ...retryOptions,\n };\n\n const retryCount = attempts + 1;\n\n if (retryCount >= options.limit) {\n return;\n }\n\n const random = options.randomize ? Math.random() + 1 : 1;\n\n let timeoutInMs = Math.round(\n random *\n Math.max(options.minTimeoutInMs, 1) *\n Math.pow(options.factor, Math.max(attempts - 1, 0))\n );\n\n timeoutInMs = Math.min(timeoutInMs, options.maxTimeoutInMs);\n\n return new Date(Date.now() + timeoutInMs);\n}\n","import { DeserializedJson } from \"./schemas\";\n\nexport interface ExampleReplacement {\n marker: string;\n replace(input: ExampleInputData): DeserializedJson;\n}\n\ntype ExampleInputData = {\n match: {\n key: string;\n value: string;\n };\n data: {\n now: Date;\n };\n};\n\nexport const currentDate: ExampleReplacement = {\n marker: \"__CURRENT_DATE__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.toISOString();\n },\n};\n\nexport const currentTimestampMilliseconds: ExampleReplacement = {\n marker: \"__CURRENT_TIMESTAMP_MS__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.getTime();\n },\n};\n\nexport const currentTimestampSeconds: ExampleReplacement = {\n marker: \"__CURRENT_TIMESTAMP_S__\",\n replace({ data: { now } }: ExampleInputData) {\n return now.getTime() / 1000;\n },\n};\n\nexport const replacements: ExampleReplacement[] = [\n currentDate,\n currentTimestampMilliseconds,\n currentTimestampSeconds,\n];\n","export function urlWithSearchParams(\n url: string,\n params: Record<string, string | number | boolean> | undefined\n) {\n if (!params) {\n return url;\n }\n\n const urlObj = new URL(url);\n for (const [key, value] of Object.entries(params)) {\n urlObj.searchParams.append(key, String(value));\n }\n return urlObj.toString();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACYA,IAAMA,YAA6B;EAAC;EAAO;EAAS;EAAQ;EAAQ;;AAZpE;AAcO,IAAMC,UAAN,MAAMA,QAAAA;EAMXC,YACEC,MACAC,QAAkB,QAClBC,eAAyB,CAAA,GACzBC,cACA;AA+CF;AAzDA;AACS;AACT,sCAA0B,CAAA;AAC1B;AAQE,uBAAK,OAAQH;AACb,uBAAK,QAASH,UAAUO,QAASC,QAAQC,IAAIC,qBAAqBN,KAAAA;AAClE,uBAAK,eAAgBC;AACrB,uBAAK,eAAgBC;EACvB;;;EAIAK,UAAUC,MAAgB;AACxB,WAAO,IAAIX,QAAO,mBAAK,QAAOD,UAAU,mBAAK,OAAM,GAAGY,MAAM,mBAAK,cAAa;EAChF;EAEA,OAAOC,kBAAkBC,UAAoBC,UAAoB;AAC/D,WAAOf,UAAUO,QAAQO,QAAAA,KAAad,UAAUO,QAAQQ,QAAAA;EAC1D;EAEAC,IAAIC,YAAoBC,MAAkD;AACxE,QAAI,mBAAK,UAAS;AAAG;AAErB,0BAAK,kCAAL,WAAoBC,QAAQH,KAAKC,SAAAA,GAAYC;EAC/C;EAEAE,MAAMH,YAAoBC,MAAkD;AAC1E,QAAI,mBAAK,UAAS;AAAG;AAErB,0BAAK,kCAAL,WAAoBC,QAAQC,OAAOH,SAAAA,GAAYC;EACjD;EAEAG,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;","names":["logLevels","Logger","constructor","name","level","filteredKeys","jsonReplacer","indexOf","process","env","TRIGGER_LOG_LEVEL","filter","keys","satisfiesLogLevel","logLevel","setLevel","log","message","args","console","error","warn","info","debug","loggerFunction","structuredLog","structureArgs","safeJsonClone","timestamp","Date","JSON","stringify","createReplacer","replacer","key","value","toString","bigIntReplacer","_key","obj","parse","e","structureArgs","args","filteredKeys","length","filterKeys","JSON","parse","stringify","bigIntReplacer","obj","keys","Array","isArray","map","item","filteredObj","key","value","Object","entries","includes","import_zod","ErrorWithStackSchema","z","object","message","string","name","optional","stack","import_zod","EventMatcherSchema","z","union","array","string","number","boolean","EventFilterSchema","lazy","record","EventRuleSchema","object","event","or","source","payload","optional","context","import_zod","ConnectionAuthSchema","z","object","type","enum","accessToken","string","scopes","array","optional","additionalFields","record","IntegrationMetadataSchema","id","name","instructions","IntegrationConfigSchema","metadata","authSource","import_zod","LiteralSchema","z","union","string","number","boolean","null","DeserializedJsonSchema","lazy","array","record","SerializableSchema","date","undefined","symbol","SerializableJsonSchema","import_zod","DisplayPropertySchema","z","object","label","string","text","url","optional","DisplayPropertiesSchema","array","StyleSchema","style","enum","variant","import_zod","SCHEDULED_EVENT","ScheduledPayloadSchema","z","object","ts","coerce","date","lastTimestamp","optional","IntervalOptionsSchema","seconds","number","int","positive","min","max","CronOptionsSchema","cron","string","CronMetadataSchema","type","literal","options","metadata","any","IntervalMetadataSchema","ScheduleMetadataSchema","discriminatedUnion","RegisterDynamicSchedulePayloadSchema","id","jobs","array","version","import_zod","TaskStatusSchema","z","enum","TaskSchema","object","id","string","name","icon","optional","nullable","noop","boolean","startedAt","coerce","date","completedAt","delayUntil","status","description","properties","array","DisplayPropertySchema","outputProperties","params","DeserializedJsonSchema","output","error","parentId","style","StyleSchema","operation","ServerTaskSchema","extend","idempotencyKey","attempts","number","CachedTaskSchema","default","import_zod","EventExampleSchema","z","object","id","string","icon","optional","name","payload","any","EventSpecificationSchema","or","array","title","source","filter","EventFilterSchema","properties","DisplayPropertySchema","schema","examples","DynamicTriggerMetadataSchema","type","literal","StaticTriggerMetadataSchema","union","rule","EventRuleSchema","ScheduledTriggerMetadataSchema","schedule","ScheduleMetadataSchema","TriggerMetadataSchema","discriminatedUnion","UpdateTriggerSourceBodySchema","z","object","registeredEvents","array","string","secret","optional","data","SerializableJsonSchema","HttpEventSourceSchema","extend","id","active","boolean","url","RegisterHTTPTriggerSourceBodySchema","type","literal","RegisterSMTPTriggerSourceBodySchema","RegisterSQSTriggerSourceBodySchema","RegisterSourceChannelBodySchema","discriminatedUnion","REGISTER_SOURCE_EVENT","RegisterTriggerSourceSchema","key","params","any","DeserializedJsonSchema","channel","clientId","RegisterSourceEventSchema","source","events","missingEvents","orphanedEvents","dynamicTriggerId","TriggerSourceSchema","HandleTriggerSourceSchema","HttpSourceRequestSchema","method","headers","record","rawBody","instanceof","Buffer","nullable","HttpSourceRequestHeadersSchema","transform","s","JSON","parse","PongSuccessResponseSchema","ok","PongErrorResponseSchema","error","PongResponseSchema","ValidateSuccessResponseSchema","endpointId","ValidateErrorResponseSchema","ValidateResponseSchema","QueueOptionsSchema","name","maxConcurrent","number","JobMetadataSchema","version","event","EventSpecificationSchema","trigger","TriggerMetadataSchema","integrations","IntegrationConfigSchema","internal","default","queue","union","startPosition","enum","enabled","preprocessRuns","SourceMetadataSchema","integration","registerSourceJob","DynamicTriggerEndpointMetadataSchema","jobs","pick","IndexEndpointResponseSchema","sources","dynamicTriggers","dynamicSchedules","RegisterDynamicSchedulePayloadSchema","RawEventSchema","payload","context","ulid","timestamp","coerce","date","ApiEventLogSchema","deliverAt","deliveredAt","SendEventOptionsSchema","deliverAfter","int","accountId","SendEventBodySchema","options","DeliverEventResponseSchema","datetime","RuntimeEnvironmentTypeSchema","RunSourceContextSchema","metadata","RunJobBodySchema","job","run","isTest","isRetry","startedAt","environment","slug","organization","title","account","tasks","CachedTaskSchema","connections","ConnectionAuthSchema","RunJobErrorSchema","status","ErrorWithStackSchema","task","TaskSchema","RunJobResumeWithTaskSchema","RunJobRetryWithTaskSchema","retryAt","RunJobCanceledWithTaskSchema","RunJobSuccessSchema","output","RunJobResponseSchema","PreprocessRunBodySchema","PreprocessRunResponseSchema","abort","properties","DisplayPropertySchema","CreateRunBodySchema","client","CreateRunResponseOkSchema","CreateRunResponseErrorSchema","CreateRunResponseBodySchema","RedactStringSchema","__redactedString","strings","interpolations","LogMessageSchema","level","message","RedactSchema","paths","RetryOptionsSchema","limit","factor","minTimeoutInMs","maxTimeoutInMs","randomize","RunTaskOptionsSchema","delayUntil","retry","icon","displayKey","description","style","StyleSchema","connectionKey","operation","noop","redact","RunTaskBodyInputSchema","idempotencyKey","parentId","RunTaskBodyOutputSchema","CompleteTaskBodyInputSchema","v","stringify","FailTaskBodyInputSchema","NormalizedRequestSchema","query","body","NormalizedResponseSchema","HttpSourceResponseSchema","response","RegisterTriggerBodySchema","rule","EventRuleSchema","InitializeTriggerBodySchema","RegisterCommonScheduleBodySchema","RegisterIntervalScheduleBodySchema","merge","IntervalMetadataSchema","InitializeCronScheduleBodySchema","CronMetadataSchema","RegisterScheduleBodySchema","RegisterScheduleResponseBodySchema","schedule","ScheduleMetadataSchema","CreateExternalConnectionBodySchema","accessToken","scopes","import_zod","MISSING_CONNECTION_NOTIFICATION","MISSING_CONNECTION_RESOLVED_NOTIFICATION","CommonMissingConnectionNotificationPayloadSchema","z","object","id","string","client","title","scopes","array","createdAt","coerce","date","updatedAt","authorizationUrl","MissingDeveloperConnectionNotificationPayloadSchema","extend","type","literal","MissingExternalConnectionNotificationPayloadSchema","account","metadata","any","MissingConnectionNotificationPayloadSchema","discriminatedUnion","CommonMissingConnectionNotificationResolvedPayloadSchema","integrationIdentifier","integrationAuthMethod","expiresAt","MissingDeveloperConnectionResolvedNotificationPayloadSchema","MissingExternalConnectionResolvedNotificationPayloadSchema","MissingConnectionResolvedNotificationPayloadSchema","import_zod","FetchRetryHeadersStrategySchema","z","object","strategy","literal","limitHeader","string","remainingHeader","resetHeader","FetchRetryBackoffStrategySchema","RetryOptionsSchema","extend","FetchRetryStrategySchema","discriminatedUnion","FetchRequestInitSchema","method","optional","headers","record","union","RedactStringSchema","body","instanceof","ArrayBuffer","FetchRetryOptionsSchema","FetchOperationSchema","url","requestInit","retry","import_zod","import_zod","RunStatusSchema","z","union","literal","RunTaskSchema","object","id","string","displayKey","nullable","status","TaskStatusSchema","name","icon","startedAt","coerce","date","completedAt","GetRunOptionsSchema","subtasks","boolean","optional","cursor","take","number","GetRunOptionsWithTaskDetailsSchema","extend","taskdetails","RunSchema","updatedAt","GetRunSchema","output","any","tasks","array","nextCursor","GetRunsOptionsSchema","GetRunsSchema","runs","GetEventSchema","z","object","id","string","name","createdAt","coerce","date","updatedAt","runs","array","status","RunStatusSchema","startedAt","optional","nullable","completedAt","deepMergeFilters","filters","result","filter","key","hasOwnProperty","filterValue","existingValue","Array","isArray","DEFAULT_RETRY_OPTIONS","limit","factor","minTimeoutInMs","maxTimeoutInMs","randomize","calculateRetryAt","retryOptions","attempts","options","retryCount","random","Math","timeoutInMs","round","max","pow","min","Date","now","currentDate","marker","replace","data","now","toISOString","currentTimestampMilliseconds","getTime","currentTimestampSeconds","replacements","urlWithSearchParams","url","params","urlObj","URL","key","value","Object","entries","searchParams","append","String","toString"]}
|