@trigger.dev/core 2.2.0 → 2.2.2

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 CHANGED
@@ -310,6 +310,7 @@ declare const ServerTaskSchema: z.ZodObject<{
310
310
  callbackUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
311
311
  idempotencyKey: z.ZodString;
312
312
  attempts: z.ZodNumber;
313
+ forceYield: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
313
314
  }, "strip", z.ZodTypeAny, {
314
315
  name: string;
315
316
  status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
@@ -342,6 +343,7 @@ declare const ServerTaskSchema: z.ZodObject<{
342
343
  parentId?: string | null | undefined;
343
344
  operation?: string | null | undefined;
344
345
  callbackUrl?: string | null | undefined;
346
+ forceYield?: boolean | null | undefined;
345
347
  }, {
346
348
  name: string;
347
349
  status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
@@ -374,6 +376,7 @@ declare const ServerTaskSchema: z.ZodObject<{
374
376
  parentId?: string | null | undefined;
375
377
  operation?: string | null | undefined;
376
378
  callbackUrl?: string | null | undefined;
379
+ forceYield?: boolean | null | undefined;
377
380
  }>;
378
381
  type ServerTask = z.infer<typeof ServerTaskSchema>;
379
382
  declare const CachedTaskSchema: z.ZodObject<{
@@ -1019,47 +1022,59 @@ type HttpSourceRequestHeaders = z.output<typeof HttpSourceRequestHeadersSchema>;
1019
1022
  declare const PongSuccessResponseSchema: z.ZodObject<{
1020
1023
  ok: z.ZodLiteral<true>;
1021
1024
  triggerVersion: z.ZodOptional<z.ZodString>;
1025
+ triggerSdkVersion: z.ZodOptional<z.ZodString>;
1022
1026
  }, "strip", z.ZodTypeAny, {
1023
1027
  ok: true;
1024
1028
  triggerVersion?: string | undefined;
1029
+ triggerSdkVersion?: string | undefined;
1025
1030
  }, {
1026
1031
  ok: true;
1027
1032
  triggerVersion?: string | undefined;
1033
+ triggerSdkVersion?: string | undefined;
1028
1034
  }>;
1029
1035
  declare const PongErrorResponseSchema: z.ZodObject<{
1030
1036
  ok: z.ZodLiteral<false>;
1031
1037
  error: z.ZodString;
1032
1038
  triggerVersion: z.ZodOptional<z.ZodString>;
1039
+ triggerSdkVersion: z.ZodOptional<z.ZodString>;
1033
1040
  }, "strip", z.ZodTypeAny, {
1034
1041
  error: string;
1035
1042
  ok: false;
1036
1043
  triggerVersion?: string | undefined;
1044
+ triggerSdkVersion?: string | undefined;
1037
1045
  }, {
1038
1046
  error: string;
1039
1047
  ok: false;
1040
1048
  triggerVersion?: string | undefined;
1049
+ triggerSdkVersion?: string | undefined;
1041
1050
  }>;
1042
1051
  declare const PongResponseSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
1043
1052
  ok: z.ZodLiteral<true>;
1044
1053
  triggerVersion: z.ZodOptional<z.ZodString>;
1054
+ triggerSdkVersion: z.ZodOptional<z.ZodString>;
1045
1055
  }, "strip", z.ZodTypeAny, {
1046
1056
  ok: true;
1047
1057
  triggerVersion?: string | undefined;
1058
+ triggerSdkVersion?: string | undefined;
1048
1059
  }, {
1049
1060
  ok: true;
1050
1061
  triggerVersion?: string | undefined;
1062
+ triggerSdkVersion?: string | undefined;
1051
1063
  }>, z.ZodObject<{
1052
1064
  ok: z.ZodLiteral<false>;
1053
1065
  error: z.ZodString;
1054
1066
  triggerVersion: z.ZodOptional<z.ZodString>;
1067
+ triggerSdkVersion: z.ZodOptional<z.ZodString>;
1055
1068
  }, "strip", z.ZodTypeAny, {
1056
1069
  error: string;
1057
1070
  ok: false;
1058
1071
  triggerVersion?: string | undefined;
1072
+ triggerSdkVersion?: string | undefined;
1059
1073
  }, {
1060
1074
  error: string;
1061
1075
  ok: false;
1062
1076
  triggerVersion?: string | undefined;
1077
+ triggerSdkVersion?: string | undefined;
1063
1078
  }>]>;
1064
1079
  type PongResponse = z.infer<typeof PongResponseSchema>;
1065
1080
  declare const ValidateSuccessResponseSchema: z.ZodObject<{
@@ -3341,10 +3356,13 @@ declare const GetEndpointIndexResponseSchema: z.ZodDiscriminatedUnion<"status",
3341
3356
  type GetEndpointIndexResponse = z.infer<typeof GetEndpointIndexResponseSchema>;
3342
3357
  declare const EndpointHeadersSchema: z.ZodObject<{
3343
3358
  "trigger-version": z.ZodOptional<z.ZodString>;
3359
+ "trigger-sdk-version": z.ZodOptional<z.ZodString>;
3344
3360
  }, "strip", z.ZodTypeAny, {
3345
3361
  "trigger-version"?: string | undefined;
3362
+ "trigger-sdk-version"?: string | undefined;
3346
3363
  }, {
3347
3364
  "trigger-version"?: string | undefined;
3365
+ "trigger-sdk-version"?: string | undefined;
3348
3366
  }>;
3349
3367
  declare const RawEventSchema: z.ZodObject<{
3350
3368
  /** The `name` property must exactly match any subscriptions you want to
@@ -3575,6 +3593,23 @@ declare const RunSourceContextSchema: z.ZodObject<{
3575
3593
  metadata?: any;
3576
3594
  }>;
3577
3595
  type RunSourceContext = z.infer<typeof RunSourceContextSchema>;
3596
+ declare const AutoYieldConfigSchema: z.ZodObject<{
3597
+ startTaskThreshold: z.ZodNumber;
3598
+ beforeExecuteTaskThreshold: z.ZodNumber;
3599
+ beforeCompleteTaskThreshold: z.ZodNumber;
3600
+ afterCompleteTaskThreshold: z.ZodNumber;
3601
+ }, "strip", z.ZodTypeAny, {
3602
+ startTaskThreshold: number;
3603
+ beforeExecuteTaskThreshold: number;
3604
+ beforeCompleteTaskThreshold: number;
3605
+ afterCompleteTaskThreshold: number;
3606
+ }, {
3607
+ startTaskThreshold: number;
3608
+ beforeExecuteTaskThreshold: number;
3609
+ beforeCompleteTaskThreshold: number;
3610
+ afterCompleteTaskThreshold: number;
3611
+ }>;
3612
+ type AutoYieldConfig = z.infer<typeof AutoYieldConfigSchema>;
3578
3613
  declare const RunJobBodySchema: z.ZodObject<{
3579
3614
  event: z.ZodObject<{
3580
3615
  /** The `id` of the event that was sent.
@@ -3739,6 +3774,23 @@ declare const RunJobBodySchema: z.ZodObject<{
3739
3774
  additionalFields?: Record<string, string> | undefined;
3740
3775
  }>>>;
3741
3776
  yieldedExecutions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3777
+ runChunkExecutionLimit: z.ZodOptional<z.ZodNumber>;
3778
+ autoYieldConfig: z.ZodOptional<z.ZodObject<{
3779
+ startTaskThreshold: z.ZodNumber;
3780
+ beforeExecuteTaskThreshold: z.ZodNumber;
3781
+ beforeCompleteTaskThreshold: z.ZodNumber;
3782
+ afterCompleteTaskThreshold: z.ZodNumber;
3783
+ }, "strip", z.ZodTypeAny, {
3784
+ startTaskThreshold: number;
3785
+ beforeExecuteTaskThreshold: number;
3786
+ beforeCompleteTaskThreshold: number;
3787
+ afterCompleteTaskThreshold: number;
3788
+ }, {
3789
+ startTaskThreshold: number;
3790
+ beforeExecuteTaskThreshold: number;
3791
+ beforeCompleteTaskThreshold: number;
3792
+ afterCompleteTaskThreshold: number;
3793
+ }>>;
3742
3794
  }, "strip", z.ZodTypeAny, {
3743
3795
  event: {
3744
3796
  name: string;
@@ -3799,6 +3851,13 @@ declare const RunJobBodySchema: z.ZodObject<{
3799
3851
  additionalFields?: Record<string, string> | undefined;
3800
3852
  }> | undefined;
3801
3853
  yieldedExecutions?: string[] | undefined;
3854
+ runChunkExecutionLimit?: number | undefined;
3855
+ autoYieldConfig?: {
3856
+ startTaskThreshold: number;
3857
+ beforeExecuteTaskThreshold: number;
3858
+ beforeCompleteTaskThreshold: number;
3859
+ afterCompleteTaskThreshold: number;
3860
+ } | undefined;
3802
3861
  }, {
3803
3862
  event: {
3804
3863
  name: string;
@@ -3859,6 +3918,13 @@ declare const RunJobBodySchema: z.ZodObject<{
3859
3918
  additionalFields?: Record<string, string> | undefined;
3860
3919
  }> | undefined;
3861
3920
  yieldedExecutions?: string[] | undefined;
3921
+ runChunkExecutionLimit?: number | undefined;
3922
+ autoYieldConfig?: {
3923
+ startTaskThreshold: number;
3924
+ beforeExecuteTaskThreshold: number;
3925
+ beforeCompleteTaskThreshold: number;
3926
+ afterCompleteTaskThreshold: number;
3927
+ } | undefined;
3862
3928
  }>;
3863
3929
  type RunJobBody = z.infer<typeof RunJobBodySchema>;
3864
3930
  declare const RunJobErrorSchema: z.ZodObject<{
@@ -4078,6 +4144,91 @@ declare const RunJobYieldExecutionErrorSchema: z.ZodObject<{
4078
4144
  status: "YIELD_EXECUTION";
4079
4145
  }>;
4080
4146
  type RunJobYieldExecutionError = z.infer<typeof RunJobYieldExecutionErrorSchema>;
4147
+ declare const RunJobAutoYieldExecutionErrorSchema: z.ZodObject<{
4148
+ status: z.ZodLiteral<"AUTO_YIELD_EXECUTION">;
4149
+ location: z.ZodString;
4150
+ timeRemaining: z.ZodNumber;
4151
+ timeElapsed: z.ZodNumber;
4152
+ limit: z.ZodOptional<z.ZodNumber>;
4153
+ }, "strip", z.ZodTypeAny, {
4154
+ status: "AUTO_YIELD_EXECUTION";
4155
+ location: string;
4156
+ timeRemaining: number;
4157
+ timeElapsed: number;
4158
+ limit?: number | undefined;
4159
+ }, {
4160
+ status: "AUTO_YIELD_EXECUTION";
4161
+ location: string;
4162
+ timeRemaining: number;
4163
+ timeElapsed: number;
4164
+ limit?: number | undefined;
4165
+ }>;
4166
+ type RunJobAutoYieldExecutionError = z.infer<typeof RunJobAutoYieldExecutionErrorSchema>;
4167
+ declare const RunJobAutoYieldWithCompletedTaskExecutionErrorSchema: z.ZodObject<{
4168
+ status: z.ZodLiteral<"AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK">;
4169
+ id: z.ZodString;
4170
+ properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
4171
+ label: z.ZodString;
4172
+ text: z.ZodString;
4173
+ url: z.ZodOptional<z.ZodString>;
4174
+ }, "strip", z.ZodTypeAny, {
4175
+ label: string;
4176
+ text: string;
4177
+ url?: string | undefined;
4178
+ }, {
4179
+ label: string;
4180
+ text: string;
4181
+ url?: string | undefined;
4182
+ }>, "many">>;
4183
+ output: z.ZodAny;
4184
+ data: z.ZodObject<{
4185
+ location: z.ZodString;
4186
+ timeRemaining: z.ZodNumber;
4187
+ timeElapsed: z.ZodNumber;
4188
+ limit: z.ZodOptional<z.ZodNumber>;
4189
+ }, "strip", z.ZodTypeAny, {
4190
+ location: string;
4191
+ timeRemaining: number;
4192
+ timeElapsed: number;
4193
+ limit?: number | undefined;
4194
+ }, {
4195
+ location: string;
4196
+ timeRemaining: number;
4197
+ timeElapsed: number;
4198
+ limit?: number | undefined;
4199
+ }>;
4200
+ }, "strip", z.ZodTypeAny, {
4201
+ status: "AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK";
4202
+ data: {
4203
+ location: string;
4204
+ timeRemaining: number;
4205
+ timeElapsed: number;
4206
+ limit?: number | undefined;
4207
+ };
4208
+ id: string;
4209
+ properties?: {
4210
+ label: string;
4211
+ text: string;
4212
+ url?: string | undefined;
4213
+ }[] | undefined;
4214
+ output?: any;
4215
+ }, {
4216
+ status: "AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK";
4217
+ data: {
4218
+ location: string;
4219
+ timeRemaining: number;
4220
+ timeElapsed: number;
4221
+ limit?: number | undefined;
4222
+ };
4223
+ id: string;
4224
+ properties?: {
4225
+ label: string;
4226
+ text: string;
4227
+ url?: string | undefined;
4228
+ }[] | undefined;
4229
+ output?: any;
4230
+ }>;
4231
+ type RunJobAutoYieldWithCompletedTaskExecutionError = z.infer<typeof RunJobAutoYieldWithCompletedTaskExecutionErrorSchema>;
4081
4232
  declare const RunJobInvalidPayloadErrorSchema: z.ZodObject<{
4082
4233
  status: z.ZodLiteral<"INVALID_PAYLOAD">;
4083
4234
  errors: z.ZodArray<z.ZodObject<{
@@ -4717,6 +4868,87 @@ declare const RunJobSuccessSchema: z.ZodObject<{
4717
4868
  }>;
4718
4869
  type RunJobSuccess = z.infer<typeof RunJobSuccessSchema>;
4719
4870
  declare const RunJobResponseSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
4871
+ status: z.ZodLiteral<"AUTO_YIELD_EXECUTION">;
4872
+ location: z.ZodString;
4873
+ timeRemaining: z.ZodNumber;
4874
+ timeElapsed: z.ZodNumber;
4875
+ limit: z.ZodOptional<z.ZodNumber>;
4876
+ }, "strip", z.ZodTypeAny, {
4877
+ status: "AUTO_YIELD_EXECUTION";
4878
+ location: string;
4879
+ timeRemaining: number;
4880
+ timeElapsed: number;
4881
+ limit?: number | undefined;
4882
+ }, {
4883
+ status: "AUTO_YIELD_EXECUTION";
4884
+ location: string;
4885
+ timeRemaining: number;
4886
+ timeElapsed: number;
4887
+ limit?: number | undefined;
4888
+ }>, z.ZodObject<{
4889
+ status: z.ZodLiteral<"AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK">;
4890
+ id: z.ZodString;
4891
+ properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
4892
+ label: z.ZodString;
4893
+ text: z.ZodString;
4894
+ url: z.ZodOptional<z.ZodString>;
4895
+ }, "strip", z.ZodTypeAny, {
4896
+ label: string;
4897
+ text: string;
4898
+ url?: string | undefined;
4899
+ }, {
4900
+ label: string;
4901
+ text: string;
4902
+ url?: string | undefined;
4903
+ }>, "many">>;
4904
+ output: z.ZodAny;
4905
+ data: z.ZodObject<{
4906
+ location: z.ZodString;
4907
+ timeRemaining: z.ZodNumber;
4908
+ timeElapsed: z.ZodNumber;
4909
+ limit: z.ZodOptional<z.ZodNumber>;
4910
+ }, "strip", z.ZodTypeAny, {
4911
+ location: string;
4912
+ timeRemaining: number;
4913
+ timeElapsed: number;
4914
+ limit?: number | undefined;
4915
+ }, {
4916
+ location: string;
4917
+ timeRemaining: number;
4918
+ timeElapsed: number;
4919
+ limit?: number | undefined;
4920
+ }>;
4921
+ }, "strip", z.ZodTypeAny, {
4922
+ status: "AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK";
4923
+ data: {
4924
+ location: string;
4925
+ timeRemaining: number;
4926
+ timeElapsed: number;
4927
+ limit?: number | undefined;
4928
+ };
4929
+ id: string;
4930
+ properties?: {
4931
+ label: string;
4932
+ text: string;
4933
+ url?: string | undefined;
4934
+ }[] | undefined;
4935
+ output?: any;
4936
+ }, {
4937
+ status: "AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK";
4938
+ data: {
4939
+ location: string;
4940
+ timeRemaining: number;
4941
+ timeElapsed: number;
4942
+ limit?: number | undefined;
4943
+ };
4944
+ id: string;
4945
+ properties?: {
4946
+ label: string;
4947
+ text: string;
4948
+ url?: string | undefined;
4949
+ }[] | undefined;
4950
+ output?: any;
4951
+ }>, z.ZodObject<{
4720
4952
  status: z.ZodLiteral<"YIELD_EXECUTION">;
4721
4953
  key: z.ZodString;
4722
4954
  }, "strip", z.ZodTypeAny, {
@@ -5895,7 +6127,7 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
5895
6127
  }>>;
5896
6128
  /** The icon for the Task, it will appear in the logs.
5897
6129
  * You can use the name of a company in lowercase, e.g. "github".
5898
- * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
6130
+ * Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
5899
6131
  icon: z.ZodOptional<z.ZodString>;
5900
6132
  /** The key for the Task that you want to appear in the logs */
5901
6133
  displayKey: z.ZodOptional<z.ZodString>;
@@ -7053,6 +7285,7 @@ declare const RunTaskResponseWithCachedTasksBodySchema: z.ZodObject<{
7053
7285
  callbackUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7054
7286
  idempotencyKey: z.ZodString;
7055
7287
  attempts: z.ZodNumber;
7288
+ forceYield: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
7056
7289
  }, "strip", z.ZodTypeAny, {
7057
7290
  name: string;
7058
7291
  status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
@@ -7085,6 +7318,7 @@ declare const RunTaskResponseWithCachedTasksBodySchema: z.ZodObject<{
7085
7318
  parentId?: string | null | undefined;
7086
7319
  operation?: string | null | undefined;
7087
7320
  callbackUrl?: string | null | undefined;
7321
+ forceYield?: boolean | null | undefined;
7088
7322
  }, {
7089
7323
  name: string;
7090
7324
  status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
@@ -7117,6 +7351,7 @@ declare const RunTaskResponseWithCachedTasksBodySchema: z.ZodObject<{
7117
7351
  parentId?: string | null | undefined;
7118
7352
  operation?: string | null | undefined;
7119
7353
  callbackUrl?: string | null | undefined;
7354
+ forceYield?: boolean | null | undefined;
7120
7355
  }>;
7121
7356
  cachedTasks: z.ZodOptional<z.ZodObject<{
7122
7357
  tasks: z.ZodArray<z.ZodObject<{
@@ -7196,6 +7431,7 @@ declare const RunTaskResponseWithCachedTasksBodySchema: z.ZodObject<{
7196
7431
  parentId?: string | null | undefined;
7197
7432
  operation?: string | null | undefined;
7198
7433
  callbackUrl?: string | null | undefined;
7434
+ forceYield?: boolean | null | undefined;
7199
7435
  };
7200
7436
  cachedTasks?: {
7201
7437
  tasks: {
@@ -7241,6 +7477,7 @@ declare const RunTaskResponseWithCachedTasksBodySchema: z.ZodObject<{
7241
7477
  parentId?: string | null | undefined;
7242
7478
  operation?: string | null | undefined;
7243
7479
  callbackUrl?: string | null | undefined;
7480
+ forceYield?: boolean | null | undefined;
7244
7481
  };
7245
7482
  cachedTasks?: {
7246
7483
  tasks: {
@@ -10138,4 +10375,4 @@ declare const PLATFORM_FEATURES: {
10138
10375
  };
10139
10376
  declare function supportsFeature<TFeatureName extends keyof typeof PLATFORM_FEATURES>(featureName: TFeatureName, version: string): boolean;
10140
10377
 
10141
- export { API_VERSIONS, ApiEventLog, ApiEventLogSchema, BloomFilter, CachedTask, CachedTaskSchema, ClientTask, CommonMissingConnectionNotificationPayloadSchema, CommonMissingConnectionNotificationResolvedPayloadSchema, CompleteTaskBodyInput, CompleteTaskBodyInputSchema, CompleteTaskBodyOutput, ConnectionAuth, ConnectionAuthSchema, CreateExternalConnectionBody, CreateExternalConnectionBodySchema, CreateRunResponseBody, CreateRunResponseBodySchema, CronMetadata, CronMetadataSchema, CronOptions, CronOptionsSchema, DeliverEventResponse, DeliverEventResponseSchema, DeserializedJson, DeserializedJsonSchema, DisplayPropertiesSchema, DisplayProperty, DisplayPropertySchema, DynamicTriggerEndpointMetadata, DynamicTriggerEndpointMetadataSchema, DynamicTriggerMetadataSchema, EndpointHeadersSchema, EndpointIndexError, EndpointIndexErrorSchema, ErrorWithStack, ErrorWithStackSchema, EventExample, EventExampleSchema, EventFilter, EventFilterSchema, EventRule, EventRuleSchema, EventSpecificationSchema, ExampleReplacement, FailTaskBodyInput, FailTaskBodyInputSchema, FetchOperation, FetchOperationSchema, FetchRequestInit, FetchRequestInitSchema, FetchRetryBackoffStrategy, FetchRetryBackoffStrategySchema, FetchRetryHeadersStrategy, FetchRetryHeadersStrategySchema, FetchRetryOptions, FetchRetryOptionsSchema, FetchRetryStrategy, FetchRetryStrategySchema, GetEndpointIndexResponse, GetEndpointIndexResponseSchema, GetEvent, GetEventSchema, GetRun, GetRunOptions, GetRunOptionsWithTaskDetails, GetRunSchema, GetRunStatuses, GetRunStatusesSchema, GetRunsOptions, GetRunsSchema, HandleTriggerSource, HandleTriggerSourceSchema, HttpSourceRequest, HttpSourceRequestHeaders, HttpSourceRequestHeadersSchema, HttpSourceRequestSchema, HttpSourceResponseMetadata, HttpSourceResponseSchema, IndexEndpointResponse, IndexEndpointResponseSchema, IndexEndpointStats, InitialStatusUpdate, InitializeCronScheduleBodySchema, InitializeTriggerBody, InitializeTriggerBodySchema, IntegrationConfig, IntegrationConfigSchema, IntegrationMetadata, IntegrationMetadataSchema, IntervalMetadata, IntervalMetadataSchema, IntervalOptions, IntervalOptionsSchema, JobMetadata, JobMetadataSchema, JobRunStatusRecordSchema, LogLevel, LogMessage, LogMessageSchema, Logger, MISSING_CONNECTION_NOTIFICATION, MISSING_CONNECTION_RESOLVED_NOTIFICATION, MissingConnectionNotificationPayload, MissingConnectionNotificationPayloadSchema, MissingConnectionResolvedNotificationPayload, MissingConnectionResolvedNotificationPayloadSchema, MissingDeveloperConnectionNotificationPayloadSchema, MissingDeveloperConnectionResolvedNotificationPayloadSchema, MissingExternalConnectionNotificationPayloadSchema, MissingExternalConnectionResolvedNotificationPayloadSchema, NormalizedRequest, NormalizedRequestSchema, NormalizedResponse, NormalizedResponseSchema, OverridableRunTaskOptions, PLATFORM_FEATURES, PongErrorResponseSchema, PongResponse, PongResponseSchema, PongSuccessResponseSchema, PreprocessRunBody, PreprocessRunBodySchema, PreprocessRunResponse, PreprocessRunResponseSchema, Prettify, QueueOptions, QueueOptionsSchema, REGISTER_SOURCE_EVENT_V1, REGISTER_SOURCE_EVENT_V2, RawEvent, RawEventSchema, RedactSchema, RedactString, RedactStringSchema, RegisterCronScheduleBody, RegisterDynamicSchedulePayload, RegisterDynamicSchedulePayloadSchema, RegisterHTTPTriggerSourceBodySchema, RegisterIntervalScheduleBody, RegisterIntervalScheduleBodySchema, RegisterSMTPTriggerSourceBodySchema, RegisterSQSTriggerSourceBodySchema, RegisterScheduleBody, RegisterScheduleBodySchema, RegisterScheduleResponseBody, RegisterScheduleResponseBodySchema, RegisterSourceChannelBodySchema, RegisterSourceEventOptions, RegisterSourceEventSchemaV1, RegisterSourceEventSchemaV2, RegisterSourceEventV1, RegisterSourceEventV2, RegisterTriggerBodySchemaV1, RegisterTriggerBodySchemaV2, RegisterTriggerBodyV1, RegisterTriggerBodyV2, RegisterTriggerSource, RegisterTriggerSourceSchema, RegisteredOptionsDiff, RetryOptions, RetryOptionsSchema, RunJobBody, RunJobBodySchema, RunJobCanceledWithTask, RunJobCanceledWithTaskSchema, RunJobError, RunJobErrorSchema, RunJobInvalidPayloadError, RunJobInvalidPayloadErrorSchema, RunJobResponse, RunJobResponseSchema, RunJobResumeWithTask, RunJobResumeWithTaskSchema, RunJobRetryWithTask, RunJobRetryWithTaskSchema, RunJobSuccess, RunJobSuccessSchema, RunJobUnresolvedAuthError, RunJobUnresolvedAuthErrorSchema, RunJobYieldExecutionError, RunJobYieldExecutionErrorSchema, RunSourceContext, RunSourceContextSchema, RunStatusSchema, RunTaskBodyInput, RunTaskBodyInputSchema, RunTaskBodyOutput, RunTaskBodyOutputSchema, RunTaskOptions, RunTaskOptionsSchema, RunTaskResponseWithCachedTasksBody, RunTaskResponseWithCachedTasksBodySchema, RunTaskSchema, RunTaskWithSubtasks, RuntimeEnvironmentType, RuntimeEnvironmentTypeSchema, SCHEDULED_EVENT, ScheduleMetadata, ScheduleMetadataSchema, ScheduledPayload, ScheduledPayloadSchema, ScheduledTriggerMetadataSchema, SchemaError, SchemaErrorSchema, SendEvent, SendEventBody, SendEventBodySchema, SendEventOptions, SendEventOptionsSchema, SerializableJson, SerializableJsonSchema, ServerTask, ServerTaskSchema, SourceEventOption, SourceMetadataV1, SourceMetadataV2, SourceMetadataV2Schema, StaticTriggerMetadataSchema, StatusHistory, StatusHistorySchema, StatusUpdate, StatusUpdateData, StatusUpdateSchema, StatusUpdateState, StatusUpdateStateSchema, Style, StyleName, StyleSchema, TaskSchema, TaskStatus, TaskStatusSchema, TriggerMetadata, TriggerMetadataSchema, TriggerSource, TriggerSourceSchema, UpdateTriggerSourceBodyV1, UpdateTriggerSourceBodyV1Schema, UpdateTriggerSourceBodyV2, UpdateTriggerSourceBodyV2Schema, ValidateErrorResponseSchema, ValidateResponse, ValidateResponseSchema, ValidateSuccessResponseSchema, addMissingVersionField, calculateRetryAt, currentDate, currentTimestampMilliseconds, currentTimestampSeconds, deepMergeFilters, eventFilterMatches, parseEndpointIndexStats, replacements, supportsFeature, urlWithSearchParams };
10378
+ export { API_VERSIONS, ApiEventLog, ApiEventLogSchema, AutoYieldConfig, AutoYieldConfigSchema, BloomFilter, CachedTask, CachedTaskSchema, ClientTask, CommonMissingConnectionNotificationPayloadSchema, CommonMissingConnectionNotificationResolvedPayloadSchema, CompleteTaskBodyInput, CompleteTaskBodyInputSchema, CompleteTaskBodyOutput, ConnectionAuth, ConnectionAuthSchema, CreateExternalConnectionBody, CreateExternalConnectionBodySchema, CreateRunResponseBody, CreateRunResponseBodySchema, CronMetadata, CronMetadataSchema, CronOptions, CronOptionsSchema, DeliverEventResponse, DeliverEventResponseSchema, DeserializedJson, DeserializedJsonSchema, DisplayPropertiesSchema, DisplayProperty, DisplayPropertySchema, DynamicTriggerEndpointMetadata, DynamicTriggerEndpointMetadataSchema, DynamicTriggerMetadataSchema, EndpointHeadersSchema, EndpointIndexError, EndpointIndexErrorSchema, ErrorWithStack, ErrorWithStackSchema, EventExample, EventExampleSchema, EventFilter, EventFilterSchema, EventRule, EventRuleSchema, EventSpecificationSchema, ExampleReplacement, FailTaskBodyInput, FailTaskBodyInputSchema, FetchOperation, FetchOperationSchema, FetchRequestInit, FetchRequestInitSchema, FetchRetryBackoffStrategy, FetchRetryBackoffStrategySchema, FetchRetryHeadersStrategy, FetchRetryHeadersStrategySchema, FetchRetryOptions, FetchRetryOptionsSchema, FetchRetryStrategy, FetchRetryStrategySchema, GetEndpointIndexResponse, GetEndpointIndexResponseSchema, GetEvent, GetEventSchema, GetRun, GetRunOptions, GetRunOptionsWithTaskDetails, GetRunSchema, GetRunStatuses, GetRunStatusesSchema, GetRunsOptions, GetRunsSchema, HandleTriggerSource, HandleTriggerSourceSchema, HttpSourceRequest, HttpSourceRequestHeaders, HttpSourceRequestHeadersSchema, HttpSourceRequestSchema, HttpSourceResponseMetadata, HttpSourceResponseSchema, IndexEndpointResponse, IndexEndpointResponseSchema, IndexEndpointStats, InitialStatusUpdate, InitializeCronScheduleBodySchema, InitializeTriggerBody, InitializeTriggerBodySchema, IntegrationConfig, IntegrationConfigSchema, IntegrationMetadata, IntegrationMetadataSchema, IntervalMetadata, IntervalMetadataSchema, IntervalOptions, IntervalOptionsSchema, JobMetadata, JobMetadataSchema, JobRunStatusRecordSchema, LogLevel, LogMessage, LogMessageSchema, Logger, MISSING_CONNECTION_NOTIFICATION, MISSING_CONNECTION_RESOLVED_NOTIFICATION, MissingConnectionNotificationPayload, MissingConnectionNotificationPayloadSchema, MissingConnectionResolvedNotificationPayload, MissingConnectionResolvedNotificationPayloadSchema, MissingDeveloperConnectionNotificationPayloadSchema, MissingDeveloperConnectionResolvedNotificationPayloadSchema, MissingExternalConnectionNotificationPayloadSchema, MissingExternalConnectionResolvedNotificationPayloadSchema, NormalizedRequest, NormalizedRequestSchema, NormalizedResponse, NormalizedResponseSchema, OverridableRunTaskOptions, PLATFORM_FEATURES, PongErrorResponseSchema, PongResponse, PongResponseSchema, PongSuccessResponseSchema, PreprocessRunBody, PreprocessRunBodySchema, PreprocessRunResponse, PreprocessRunResponseSchema, Prettify, QueueOptions, QueueOptionsSchema, REGISTER_SOURCE_EVENT_V1, REGISTER_SOURCE_EVENT_V2, RawEvent, RawEventSchema, RedactSchema, RedactString, RedactStringSchema, RegisterCronScheduleBody, RegisterDynamicSchedulePayload, RegisterDynamicSchedulePayloadSchema, RegisterHTTPTriggerSourceBodySchema, RegisterIntervalScheduleBody, RegisterIntervalScheduleBodySchema, RegisterSMTPTriggerSourceBodySchema, RegisterSQSTriggerSourceBodySchema, RegisterScheduleBody, RegisterScheduleBodySchema, RegisterScheduleResponseBody, RegisterScheduleResponseBodySchema, RegisterSourceChannelBodySchema, RegisterSourceEventOptions, RegisterSourceEventSchemaV1, RegisterSourceEventSchemaV2, RegisterSourceEventV1, RegisterSourceEventV2, RegisterTriggerBodySchemaV1, RegisterTriggerBodySchemaV2, RegisterTriggerBodyV1, RegisterTriggerBodyV2, RegisterTriggerSource, RegisterTriggerSourceSchema, RegisteredOptionsDiff, RetryOptions, RetryOptionsSchema, RunJobAutoYieldExecutionError, RunJobAutoYieldExecutionErrorSchema, RunJobAutoYieldWithCompletedTaskExecutionError, RunJobAutoYieldWithCompletedTaskExecutionErrorSchema, RunJobBody, RunJobBodySchema, RunJobCanceledWithTask, RunJobCanceledWithTaskSchema, RunJobError, RunJobErrorSchema, RunJobInvalidPayloadError, RunJobInvalidPayloadErrorSchema, RunJobResponse, RunJobResponseSchema, RunJobResumeWithTask, RunJobResumeWithTaskSchema, RunJobRetryWithTask, RunJobRetryWithTaskSchema, RunJobSuccess, RunJobSuccessSchema, RunJobUnresolvedAuthError, RunJobUnresolvedAuthErrorSchema, RunJobYieldExecutionError, RunJobYieldExecutionErrorSchema, RunSourceContext, RunSourceContextSchema, RunStatusSchema, RunTaskBodyInput, RunTaskBodyInputSchema, RunTaskBodyOutput, RunTaskBodyOutputSchema, RunTaskOptions, RunTaskOptionsSchema, RunTaskResponseWithCachedTasksBody, RunTaskResponseWithCachedTasksBodySchema, RunTaskSchema, RunTaskWithSubtasks, RuntimeEnvironmentType, RuntimeEnvironmentTypeSchema, SCHEDULED_EVENT, ScheduleMetadata, ScheduleMetadataSchema, ScheduledPayload, ScheduledPayloadSchema, ScheduledTriggerMetadataSchema, SchemaError, SchemaErrorSchema, SendEvent, SendEventBody, SendEventBodySchema, SendEventOptions, SendEventOptionsSchema, SerializableJson, SerializableJsonSchema, ServerTask, ServerTaskSchema, SourceEventOption, SourceMetadataV1, SourceMetadataV2, SourceMetadataV2Schema, StaticTriggerMetadataSchema, StatusHistory, StatusHistorySchema, StatusUpdate, StatusUpdateData, StatusUpdateSchema, StatusUpdateState, StatusUpdateStateSchema, Style, StyleName, StyleSchema, TaskSchema, TaskStatus, TaskStatusSchema, TriggerMetadata, TriggerMetadataSchema, TriggerSource, TriggerSourceSchema, UpdateTriggerSourceBodyV1, UpdateTriggerSourceBodyV1Schema, UpdateTriggerSourceBodyV2, UpdateTriggerSourceBodyV2Schema, ValidateErrorResponseSchema, ValidateResponse, ValidateResponseSchema, ValidateSuccessResponseSchema, addMissingVersionField, calculateRetryAt, currentDate, currentTimestampMilliseconds, currentTimestampSeconds, deepMergeFilters, eventFilterMatches, parseEndpointIndexStats, replacements, supportsFeature, urlWithSearchParams };
package/dist/index.js CHANGED
@@ -50,6 +50,7 @@ var src_exports = {};
50
50
  __export(src_exports, {
51
51
  API_VERSIONS: () => API_VERSIONS,
52
52
  ApiEventLogSchema: () => ApiEventLogSchema,
53
+ AutoYieldConfigSchema: () => AutoYieldConfigSchema,
53
54
  BloomFilter: () => BloomFilter,
54
55
  CachedTaskSchema: () => CachedTaskSchema,
55
56
  CommonMissingConnectionNotificationPayloadSchema: () => CommonMissingConnectionNotificationPayloadSchema,
@@ -136,6 +137,8 @@ __export(src_exports, {
136
137
  RegisterTriggerBodySchemaV2: () => RegisterTriggerBodySchemaV2,
137
138
  RegisterTriggerSourceSchema: () => RegisterTriggerSourceSchema,
138
139
  RetryOptionsSchema: () => RetryOptionsSchema,
140
+ RunJobAutoYieldExecutionErrorSchema: () => RunJobAutoYieldExecutionErrorSchema,
141
+ RunJobAutoYieldWithCompletedTaskExecutionErrorSchema: () => RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
139
142
  RunJobBodySchema: () => RunJobBodySchema,
140
143
  RunJobCanceledWithTaskSchema: () => RunJobCanceledWithTaskSchema,
141
144
  RunJobErrorSchema: () => RunJobErrorSchema,
@@ -598,7 +601,8 @@ var TaskSchema = import_zod7.z.object({
598
601
  });
599
602
  var ServerTaskSchema = TaskSchema.extend({
600
603
  idempotencyKey: import_zod7.z.string(),
601
- attempts: import_zod7.z.number()
604
+ attempts: import_zod7.z.number(),
605
+ forceYield: import_zod7.z.boolean().optional().nullable()
602
606
  });
603
607
  var CachedTaskSchema = import_zod7.z.object({
604
608
  id: import_zod7.z.string(),
@@ -868,12 +872,14 @@ var HttpSourceRequestHeadersSchema = import_zod11.z.object({
868
872
  });
869
873
  var PongSuccessResponseSchema = import_zod11.z.object({
870
874
  ok: import_zod11.z.literal(true),
871
- triggerVersion: import_zod11.z.string().optional()
875
+ triggerVersion: import_zod11.z.string().optional(),
876
+ triggerSdkVersion: import_zod11.z.string().optional()
872
877
  });
873
878
  var PongErrorResponseSchema = import_zod11.z.object({
874
879
  ok: import_zod11.z.literal(false),
875
880
  error: import_zod11.z.string(),
876
- triggerVersion: import_zod11.z.string().optional()
881
+ triggerVersion: import_zod11.z.string().optional(),
882
+ triggerSdkVersion: import_zod11.z.string().optional()
877
883
  });
878
884
  var PongResponseSchema = import_zod11.z.discriminatedUnion("ok", [
879
885
  PongSuccessResponseSchema,
@@ -1004,7 +1010,8 @@ var GetEndpointIndexResponseSchema = import_zod11.z.discriminatedUnion("status",
1004
1010
  })
1005
1011
  ]);
1006
1012
  var EndpointHeadersSchema = import_zod11.z.object({
1007
- "trigger-version": import_zod11.z.string().optional()
1013
+ "trigger-version": import_zod11.z.string().optional(),
1014
+ "trigger-sdk-version": import_zod11.z.string().optional()
1008
1015
  });
1009
1016
  var RawEventSchema = import_zod11.z.object({
1010
1017
  /** The `name` property must exactly match any subscriptions you want to
@@ -1085,6 +1092,12 @@ var RunSourceContextSchema = import_zod11.z.object({
1085
1092
  id: import_zod11.z.string(),
1086
1093
  metadata: import_zod11.z.any()
1087
1094
  });
1095
+ var AutoYieldConfigSchema = import_zod11.z.object({
1096
+ startTaskThreshold: import_zod11.z.number(),
1097
+ beforeExecuteTaskThreshold: import_zod11.z.number(),
1098
+ beforeCompleteTaskThreshold: import_zod11.z.number(),
1099
+ afterCompleteTaskThreshold: import_zod11.z.number()
1100
+ });
1088
1101
  var RunJobBodySchema = import_zod11.z.object({
1089
1102
  event: ApiEventLogSchema,
1090
1103
  job: import_zod11.z.object({
@@ -1116,7 +1129,9 @@ var RunJobBodySchema = import_zod11.z.object({
1116
1129
  cachedTaskCursor: import_zod11.z.string().optional(),
1117
1130
  noopTasksSet: import_zod11.z.string().optional(),
1118
1131
  connections: import_zod11.z.record(ConnectionAuthSchema).optional(),
1119
- yieldedExecutions: import_zod11.z.string().array().optional()
1132
+ yieldedExecutions: import_zod11.z.string().array().optional(),
1133
+ runChunkExecutionLimit: import_zod11.z.number().optional(),
1134
+ autoYieldConfig: AutoYieldConfigSchema.optional()
1120
1135
  });
1121
1136
  var RunJobErrorSchema = import_zod11.z.object({
1122
1137
  status: import_zod11.z.literal("ERROR"),
@@ -1127,6 +1142,25 @@ var RunJobYieldExecutionErrorSchema = import_zod11.z.object({
1127
1142
  status: import_zod11.z.literal("YIELD_EXECUTION"),
1128
1143
  key: import_zod11.z.string()
1129
1144
  });
1145
+ var RunJobAutoYieldExecutionErrorSchema = import_zod11.z.object({
1146
+ status: import_zod11.z.literal("AUTO_YIELD_EXECUTION"),
1147
+ location: import_zod11.z.string(),
1148
+ timeRemaining: import_zod11.z.number(),
1149
+ timeElapsed: import_zod11.z.number(),
1150
+ limit: import_zod11.z.number().optional()
1151
+ });
1152
+ var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = import_zod11.z.object({
1153
+ status: import_zod11.z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
1154
+ id: import_zod11.z.string(),
1155
+ properties: import_zod11.z.array(DisplayPropertySchema).optional(),
1156
+ output: import_zod11.z.any(),
1157
+ data: import_zod11.z.object({
1158
+ location: import_zod11.z.string(),
1159
+ timeRemaining: import_zod11.z.number(),
1160
+ timeElapsed: import_zod11.z.number(),
1161
+ limit: import_zod11.z.number().optional()
1162
+ })
1163
+ });
1130
1164
  var RunJobInvalidPayloadErrorSchema = import_zod11.z.object({
1131
1165
  status: import_zod11.z.literal("INVALID_PAYLOAD"),
1132
1166
  errors: import_zod11.z.array(SchemaErrorSchema)
@@ -1157,6 +1191,8 @@ var RunJobSuccessSchema = import_zod11.z.object({
1157
1191
  output: DeserializedJsonSchema.optional()
1158
1192
  });
1159
1193
  var RunJobResponseSchema = import_zod11.z.discriminatedUnion("status", [
1194
+ RunJobAutoYieldExecutionErrorSchema,
1195
+ RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
1160
1196
  RunJobYieldExecutionErrorSchema,
1161
1197
  RunJobErrorSchema,
1162
1198
  RunJobUnresolvedAuthErrorSchema,
@@ -1248,7 +1284,7 @@ var RunTaskOptionsSchema = import_zod11.z.object({
1248
1284
  retry: RetryOptionsSchema.optional(),
1249
1285
  /** The icon for the Task, it will appear in the logs.
1250
1286
  * You can use the name of a company in lowercase, e.g. "github".
1251
- * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
1287
+ * Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
1252
1288
  icon: import_zod11.z.string().optional(),
1253
1289
  /** The key for the Task that you want to appear in the logs */
1254
1290
  displayKey: import_zod11.z.string().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/addMissingVersionField.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/runs.ts","../src/schemas/statuses.ts","../src/schemas/notifications.ts","../src/schemas/fetch.ts","../src/schemas/events.ts","../src/utils.ts","../src/retry.ts","../src/replacements.ts","../src/searchParams.ts","../src/eventFilterMatches.ts","../src/bloom.ts"],"sourcesContent":["export * from \"./logger\";\nexport * from \"./schemas\";\nexport * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./retry\";\nexport * from \"./replacements\";\nexport * from \"./searchParams\";\nexport * from \"./eventFilterMatches\";\nexport * from \"./bloom\";\n\nexport const API_VERSIONS = {\n LAZY_LOADED_CACHED_TASKS: \"2023-09-29\",\n} as const;\n\nexport const PLATFORM_FEATURES = {\n yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,\n lazyLoadedCachedTasks: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,\n};\n\nexport function supportsFeature<TFeatureName extends keyof typeof PLATFORM_FEATURES>(\n featureName: TFeatureName,\n version: string\n): boolean {\n if (version === \"unversioned\" || version === \"unknown\") {\n return false;\n }\n\n const supportedVersion = PLATFORM_FEATURES[featureName];\n\n if (!supportedVersion) {\n return false;\n }\n\n return version >= supportedVersion;\n}\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 if (value) {\n filteredObj[key] = `[filtered ${prettyPrintBytes(value)}]`;\n } else {\n filteredObj[key] = value;\n }\n continue;\n }\n\n filteredObj[key] = filterKeys(value, keys);\n }\n\n return filteredObj;\n}\n\nfunction prettyPrintBytes(value: unknown): string {\n if (process.env.NODE_ENV === \"production\") {\n return \"skipped size\";\n }\n\n const sizeInBytes = Buffer.byteLength(JSON.stringify(value), \"utf8\");\n\n if (sizeInBytes < 1024) {\n return `${sizeInBytes} bytes`;\n }\n\n if (sizeInBytes < 1024 * 1024) {\n return `${(sizeInBytes / 1024).toFixed(2)} KB`;\n }\n\n if (sizeInBytes < 1024 * 1024 * 1024) {\n return `${(sizeInBytes / (1024 * 1024)).toFixed(2)} MB`;\n }\n\n return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n}\n","import { ulid } from \"ulid\";\nimport { z } from \"zod\";\nimport { Prettify } from \"../types\";\nimport { addMissingVersionField } from \"./addMissingVersionField\";\nimport { ErrorWithStackSchema, SchemaErrorSchema } 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 { RunStatusSchema } from \"./runs\";\nimport { JobRunStatusRecordSchema } from \"./statuses\";\n\nexport const UpdateTriggerSourceBodyV1Schema = z.object({\n registeredEvents: z.array(z.string()),\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n});\nexport type UpdateTriggerSourceBodyV1 = z.infer<typeof UpdateTriggerSourceBodyV1Schema>;\n\nexport const UpdateTriggerSourceBodyV2Schema = z.object({\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n options: z\n .object({\n event: z.array(z.string()),\n })\n .and(z.record(z.string(), z.array(z.string())).optional()),\n});\nexport type UpdateTriggerSourceBodyV2 = z.infer<typeof UpdateTriggerSourceBodyV2Schema>;\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_V1 = \"dev.trigger.source.register\";\nexport const REGISTER_SOURCE_EVENT_V2 = \"dev.trigger.source.register.v2\";\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\nconst SourceEventOptionSchema = z.object({\n name: z.string(),\n value: z.string(),\n});\n\nexport type SourceEventOption = z.infer<typeof SourceEventOptionSchema>;\n\nexport const RegisterSourceEventSchemaV1 = 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 RegisterSourceEventV1 = z.infer<typeof RegisterSourceEventSchemaV1>;\n\nconst RegisteredOptionsDiffSchema = z.object({\n desired: z.array(z.string()),\n missing: z.array(z.string()),\n orphaned: z.array(z.string()),\n});\n\nexport type RegisteredOptionsDiff = Prettify<z.infer<typeof RegisteredOptionsDiffSchema>>;\n\nconst RegisterSourceEventOptionsSchema = z\n .object({\n event: RegisteredOptionsDiffSchema,\n })\n .and(z.record(z.string(), RegisteredOptionsDiffSchema));\n\nexport type RegisterSourceEventOptions = z.infer<typeof RegisterSourceEventOptionsSchema>;\n\nexport const RegisterSourceEventSchemaV2 = z.object({\n /** The id of the source */\n id: z.string(),\n source: RegisterTriggerSourceSchema,\n options: RegisterSourceEventOptionsSchema,\n dynamicTriggerId: z.string().optional(),\n});\n\nexport type RegisterSourceEventV2 = z.infer<typeof RegisterSourceEventSchemaV2>;\n\nexport const TriggerSourceSchema = z.object({\n id: z.string(),\n key: z.string(),\n});\n\nconst HttpSourceResponseMetadataSchema = DeserializedJsonSchema;\nexport type HttpSourceResponseMetadata = z.infer<typeof HttpSourceResponseMetadataSchema>;\n\nexport const HandleTriggerSourceSchema = z.object({\n key: z.string(),\n secret: z.string(),\n data: z.any(),\n params: z.any(),\n auth: ConnectionAuthSchema.optional(),\n metadata: HttpSourceResponseMetadataSchema.optional(),\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 \"x-ts-auth\": z\n .string()\n .optional()\n .transform((s) => {\n if (s === undefined) return;\n const json = JSON.parse(s);\n return ConnectionAuthSchema.parse(json);\n }),\n \"x-ts-metadata\": z\n .string()\n .optional()\n .transform((s) => {\n if (s === undefined) return;\n const json = JSON.parse(s);\n return DeserializedJsonSchema.parse(json);\n }),\n});\n\nexport type HttpSourceRequestHeaders = z.output<typeof HttpSourceRequestHeadersSchema>;\n\nexport const PongSuccessResponseSchema = z.object({\n ok: z.literal(true),\n triggerVersion: z.string().optional(),\n});\n\nexport const PongErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n triggerVersion: z.string().optional(),\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 triggerVersion: z.string().optional(),\n});\n\nexport const ValidateErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n triggerVersion: z.string().optional(),\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 enabled: z.boolean(),\n startPosition: z.enum([\"initial\", \"latest\"]),\n preprocessRuns: z.boolean(),\n});\n\nexport type JobMetadata = z.infer<typeof JobMetadataSchema>;\n\nconst SourceMetadataV1Schema = z.object({\n version: z.literal(\"1\"),\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 SourceMetadataV1 = z.infer<typeof SourceMetadataV1Schema>;\n\nexport const SourceMetadataV2Schema = z.object({\n version: z.literal(\"2\"),\n channel: z.enum([\"HTTP\", \"SQS\", \"SMTP\"]),\n integration: IntegrationConfigSchema,\n key: z.string(),\n params: z.any(),\n options: z.record(z.array(z.string())),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type SourceMetadataV2 = z.infer<typeof SourceMetadataV2Schema>;\n\nconst SourceMetadataSchema = z.preprocess(\n addMissingVersionField,\n z.discriminatedUnion(\"version\", [SourceMetadataV1Schema, SourceMetadataV2Schema])\n);\n\ntype SourceMetadata = Prettify<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 EndpointIndexErrorSchema = z.object({\n message: z.string(),\n raw: z.any().optional(),\n});\n\nexport type EndpointIndexError = z.infer<typeof EndpointIndexErrorSchema>;\n\nconst IndexEndpointStatsSchema = z.object({\n jobs: z.number(),\n sources: z.number(),\n dynamicTriggers: z.number(),\n dynamicSchedules: z.number(),\n disabledJobs: z.number().default(0),\n});\n\nexport type IndexEndpointStats = z.infer<typeof IndexEndpointStatsSchema>;\n\nexport function parseEndpointIndexStats(stats: unknown): IndexEndpointStats | undefined {\n if (stats === null || stats === undefined) {\n return;\n }\n return IndexEndpointStatsSchema.parse(stats);\n}\n\nexport const GetEndpointIndexResponseSchema = z.discriminatedUnion(\"status\", [\n z.object({\n status: z.literal(\"PENDING\"),\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"STARTED\"),\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"SUCCESS\"),\n stats: IndexEndpointStatsSchema,\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"FAILURE\"),\n error: EndpointIndexErrorSchema,\n updatedAt: z.coerce.date(),\n }),\n]);\n\nexport type GetEndpointIndexResponse = z.infer<typeof GetEndpointIndexResponseSchema>;\n\nexport const EndpointHeadersSchema = z.object({\n \"trigger-version\": z.string().optional(),\n});\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 /** The timestamp when the event was cancelled. Is `undefined` if the event\n * wasn't cancelled. */\n cancelledAt: 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 type RunSourceContext = z.infer<typeof RunSourceContextSchema>;\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 cachedTaskCursor: z.string().optional(),\n noopTasksSet: z.string().optional(),\n connections: z.record(ConnectionAuthSchema).optional(),\n yieldedExecutions: z.string().array().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 RunJobYieldExecutionErrorSchema = z.object({\n status: z.literal(\"YIELD_EXECUTION\"),\n key: z.string(),\n});\n\nexport type RunJobYieldExecutionError = z.infer<typeof RunJobYieldExecutionErrorSchema>;\n\nexport const RunJobInvalidPayloadErrorSchema = z.object({\n status: z.literal(\"INVALID_PAYLOAD\"),\n errors: z.array(SchemaErrorSchema),\n});\n\nexport type RunJobInvalidPayloadError = z.infer<typeof RunJobInvalidPayloadErrorSchema>;\n\nexport const RunJobUnresolvedAuthErrorSchema = z.object({\n status: z.literal(\"UNRESOLVED_AUTH_ERROR\"),\n issues: z.record(z.object({ id: z.string(), error: z.string() })),\n});\n\nexport type RunJobUnresolvedAuthError = z.infer<typeof RunJobUnresolvedAuthErrorSchema>;\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 RunJobYieldExecutionErrorSchema,\n RunJobErrorSchema,\n RunJobUnresolvedAuthErrorSchema,\n RunJobInvalidPayloadErrorSchema,\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\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().optional(),\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 expose a `task.callbackUrl` to use in your tasks. Enabling this feature will cause the task to return the data sent to the callbackUrl instead of the usual async callback result. */\n callback: z\n .object({\n /** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */\n enabled: z.boolean(),\n /** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */\n timeoutInSeconds: z.number(),\n })\n .partial()\n .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 type OverridableRunTaskOptions = Pick<\n RunTaskOptions,\n \"retry\" | \"delayUntil\" | \"description\"\n>;\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 properties: z.array(DisplayPropertySchema.partial()).optional(),\n params: DeserializedJsonSchema.optional().nullable(),\n callback: z\n .object({\n enabled: z.boolean(),\n timeoutInSeconds: z.number().default(3600),\n })\n .optional(),\n});\n\nexport type RunTaskBodyOutput = z.infer<typeof RunTaskBodyOutputSchema>;\n\nexport const RunTaskResponseWithCachedTasksBodySchema = z.object({\n task: ServerTaskSchema,\n cachedTasks: z\n .object({\n tasks: z.array(CachedTaskSchema),\n cursor: z.string().optional(),\n })\n .optional(),\n});\n\nexport type RunTaskResponseWithCachedTasksBody = z.infer<\n typeof RunTaskResponseWithCachedTasksBodySchema\n>;\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 metadata: HttpSourceResponseMetadataSchema.optional(),\n});\n\nexport const RegisterTriggerBodySchemaV1 = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataV1Schema,\n});\n\nexport type RegisterTriggerBodyV1 = z.infer<typeof RegisterTriggerBodySchemaV1>;\n\nexport const RegisterTriggerBodySchemaV2 = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataV2Schema,\n accountId: z.string().optional(),\n});\n\nexport type RegisterTriggerBodyV2 = z.infer<typeof RegisterTriggerBodySchemaV2>;\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 /** An optional Account ID to associate with runs triggered by this schedule */\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\nexport const GetRunStatusesSchema = z.object({\n run: z.object({ id: z.string(), status: RunStatusSchema, output: z.any().optional() }),\n statuses: z.array(JobRunStatusRecordSchema),\n});\nexport type GetRunStatuses = z.infer<typeof GetRunStatusesSchema>;\n","export function addMissingVersionField(val: unknown) {\n if (val !== null && typeof val === \"object\" && !(\"version\" in val)) {\n return {\n ...val,\n version: \"1\",\n };\n }\n return val;\n}\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\nexport const SchemaErrorSchema = z.object({\n path: z.array(z.string()),\n message: z.string(),\n});\n\nexport type SchemaError = z.infer<typeof SchemaErrorSchema>;\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 z.array(\n z.union([\n z.object({\n $endsWith: z.string(),\n }),\n z.object({\n $startsWith: z.string(),\n }),\n z.object({\n $exists: z.boolean(),\n }),\n z.object({\n $isNull: z.boolean(),\n }),\n z.object({\n $anythingBut: z.union([z.string(), z.number(), z.boolean()]),\n }),\n z.object({\n $anythingBut: z.union([z.array(z.string()), z.array(z.number()), z.array(z.boolean())]),\n }),\n z.object({\n $gt: z.number(),\n }),\n z.object({\n $lt: z.number(),\n }),\n z.object({\n $gte: z.number(),\n }),\n z.object({\n $lte: z.number(),\n }),\n z.object({\n $between: z.tuple([z.number(), z.number()]),\n }),\n z.object({\n $includes: z.union([z.string(), z.number(), z.boolean()]),\n }),\n z.object({\n $ignoreCaseEquals: z.string(),\n }),\n ])\n ),\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\", \"apiKey\"]),\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\", \"RESOLVER\"]),\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 = 2_592_000 (30 days) */\n seconds: z.number().int().positive().min(60).max(2_592_000),\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 /** An optional Account ID to associate with runs triggered by this interval */\n accountId: z.string().optional(),\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 /** An optional Account ID to associate with runs triggered by this interval */\n accountId: z.string().optional(),\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 callbackUrl: 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\";\nimport { TaskStatusSchema } from \"./tasks\";\nimport { JobRunStatusRecordSchema } from \"./statuses\";\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 z.literal(\"UNRESOLVED_AUTH\"),\n z.literal(\"INVALID_PAYLOAD\"),\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\nexport type RunTaskWithSubtasks = z.infer<typeof RunTaskSchema> & {\n /** The subtasks of the task */\n subtasks?: RunTaskWithSubtasks[];\n};\n\nconst RunTaskWithSubtasksSchema: z.ZodType<RunTaskWithSubtasks> = RunTaskSchema.extend({\n subtasks: z.lazy(() => RunTaskWithSubtasksSchema.array()).optional(),\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(RunTaskWithSubtasksSchema),\n /** Any status updates that were published from the run */\n statuses: z.array(JobRunStatusRecordSchema).default([]),\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","import { z } from \"zod\";\nimport { SerializableJsonSchema } from \"./json\";\nimport { RunStatusSchema } from \"./runs\";\n\nexport const StatusUpdateStateSchema = z.union([\n z.literal(\"loading\"),\n z.literal(\"success\"),\n z.literal(\"failure\"),\n]);\nexport type StatusUpdateState = z.infer<typeof StatusUpdateStateSchema>;\n\nconst StatusUpdateDataSchema = z.record(SerializableJsonSchema);\nexport type StatusUpdateData = z.infer<typeof StatusUpdateDataSchema>;\n\nexport const StatusUpdateSchema = z.object({\n label: z.string().optional(),\n state: StatusUpdateStateSchema.optional(),\n data: StatusUpdateDataSchema.optional(),\n});\nexport type StatusUpdate = z.infer<typeof StatusUpdateSchema>;\n\nconst InitalStatusUpdateSchema = StatusUpdateSchema.required({ label: true });\nexport type InitialStatusUpdate = z.infer<typeof InitalStatusUpdateSchema>;\n\nexport const StatusHistorySchema = z.array(StatusUpdateSchema);\nexport type StatusHistory = z.infer<typeof StatusHistorySchema>;\n\nexport const JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({\n key: z.string(),\n history: StatusHistorySchema,\n});\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","// 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","import { EventFilter } from \"./schemas/eventFilter\";\n\n// EventFilter is a recursive type, where the keys are strings and the values are an array of strings, numbers, booleans, or objects.\n// If the values of the array are strings, numbers, or booleans, than we are matching against the value of the payload.\n// If the values of the array are objects, then we are doing content filtering\n// An example would be [{ $endsWith: \".png\" }, { $startsWith: \"images/\" } ]\nexport function eventFilterMatches(payload: any, filter: EventFilter): boolean {\n for (const [patternKey, patternValue] of Object.entries(filter)) {\n const payloadValue = payload[patternKey];\n\n if (Array.isArray(patternValue)) {\n if (patternValue.length === 0) {\n continue;\n }\n\n // Check to see if all the items in the array are a string\n if ((patternValue as unknown[]).every((item) => typeof item === \"string\")) {\n if ((patternValue as string[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Check to see if all the items in the array are a number\n if ((patternValue as unknown[]).every((item) => typeof item === \"number\")) {\n if ((patternValue as number[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Check to see if all the items in the array are a boolean\n if ((patternValue as unknown[]).every((item) => typeof item === \"boolean\")) {\n if ((patternValue as boolean[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Now we know that all the items in the array are objects\n const objectArray = patternValue as Exclude<\n typeof patternValue,\n number[] | string[] | boolean[]\n >;\n\n if (!contentFiltersMatches(payloadValue, objectArray)) {\n return false;\n }\n\n continue;\n } else if (typeof patternValue === \"object\") {\n if (Array.isArray(payloadValue)) {\n if (!payloadValue.some((item) => eventFilterMatches(item, patternValue))) {\n return false;\n }\n } else {\n if (!eventFilterMatches(payloadValue, patternValue)) {\n return false;\n }\n }\n }\n }\n return true;\n}\n\ntype ContentFilters = Exclude<EventFilter[string], EventFilter | string[] | number[] | boolean[]>;\n\nfunction contentFiltersMatches(actualValue: any, contentFilters: ContentFilters): boolean {\n for (const contentFilter of contentFilters) {\n if (typeof contentFilter === \"object\") {\n const [key, value] = Object.entries(contentFilter)[0];\n\n if (!contentFilterMatches(actualValue, contentFilter)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction contentFilterMatches(actualValue: any, contentFilter: ContentFilters[number]): boolean {\n if (\"$endsWith\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return actualValue.endsWith(contentFilter.$endsWith);\n }\n\n if (\"$startsWith\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return actualValue.startsWith(contentFilter.$startsWith);\n }\n\n if (\"$anythingBut\" in contentFilter) {\n if (Array.isArray(contentFilter.$anythingBut)) {\n if ((contentFilter.$anythingBut as any[]).includes(actualValue)) {\n return false;\n }\n }\n\n if (contentFilter.$anythingBut === actualValue) {\n return false;\n }\n\n return true;\n }\n\n if (\"$exists\" in contentFilter) {\n if (contentFilter.$exists) {\n return actualValue !== undefined;\n }\n\n return actualValue === undefined;\n }\n\n if (\"$gt\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue > contentFilter.$gt;\n }\n\n if (\"$lt\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue < contentFilter.$lt;\n }\n\n if (\"$gte\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue >= contentFilter.$gte;\n }\n\n if (\"$lte\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue <= contentFilter.$lte;\n }\n\n if (\"$between\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue >= contentFilter.$between[0] && actualValue <= contentFilter.$between[1];\n }\n\n if (\"$includes\" in contentFilter) {\n if (Array.isArray(actualValue)) {\n return actualValue.includes(contentFilter.$includes);\n }\n\n return false;\n }\n\n // Use localCompare\n if (\"$ignoreCaseEquals\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return (\n actualValue.localeCompare(contentFilter.$ignoreCaseEquals, undefined, {\n sensitivity: \"accent\",\n }) === 0\n );\n }\n\n if (\"$isNull\" in contentFilter) {\n if (contentFilter.$isNull) {\n return actualValue === null;\n }\n\n return actualValue !== null;\n }\n\n return true;\n}\n","import { Buffer } from \"node:buffer\";\n\nexport class BloomFilter {\n private size: number;\n private bitArray: Uint8Array;\n\n constructor(size: number) {\n this.size = size;\n this.bitArray = new Uint8Array(Math.ceil(size / 8));\n }\n\n add(item: string): void {\n const index = murmurHash3(item) % this.size;\n this.bitArray[Math.floor(index / 8)] |= 1 << index % 8;\n }\n\n test(item: string): boolean {\n const index = murmurHash3(item) % this.size;\n return (this.bitArray[Math.floor(index / 8)] & (1 << index % 8)) !== 0;\n }\n\n // Serialize to a Base64 string\n serialize(): string {\n return Buffer.from(this.bitArray).toString(\"base64\");\n }\n\n // Deserialize from a Base64 string\n static deserialize(str: string, size: number): BloomFilter {\n const filter = new BloomFilter(size);\n filter.bitArray = Uint8Array.from(Buffer.from(str, \"base64\"));\n return filter;\n }\n\n static NOOP_TASK_SET_SIZE = 32_768;\n}\n\nfunction murmurHash3(str: string, seed = 0): number {\n let h1 = 0xdeadbeef ^ seed,\n h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 0xcc9e2d51);\n h1 = (h1 << 15) | (h1 >>> 17);\n h1 = Math.imul(h1, 0x1b873593);\n\n h2 = Math.imul(h2 ^ ch, 0x85ebca6b);\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = Math.imul(h2, 0xc2b2ae35);\n }\n\n h1 ^= str.length;\n h2 ^= str.length;\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 0x85ebca6b);\n h1 = Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);\n h1 ^= h1 >>> 16;\n\n h2 = Math.imul(h2 ^ (h2 >>> 16), 0x85ebca6b);\n h2 = Math.imul(h2 ^ (h2 >>> 13), 0xc2b2ae35);\n h2 ^= h2 >>> 16;\n\n return 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACYA,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Q,QAAQF,KAAK;AACvCC,SAAKP,IAAIS,WAAWH,CAAAA;AACpBF,SAAKjB,KAAKuB,KAAKN,KAAKG,IAAI,UAAA;AACxBH,SAAMA,MAAM,KAAOA,OAAO;AAC1BA,SAAKjB,KAAKuB,KAAKN,IAAI,SAAA;AAEnBC,SAAKlB,KAAKuB,KAAKL,KAAKE,IAAI,UAAA;AACxBF,SAAMA,MAAM,KAAOA,OAAO;AAC1BA,SAAKlB,KAAKuB,KAAKL,IAAI,UAAA;EACrB;AAEAD,QAAMJ,IAAIQ;AACVH,QAAML,IAAIQ;AAEVJ,OAAKjB,KAAKuB,KAAKN,KAAMA,OAAO,IAAK,UAAA;AACjCA,OAAKjB,KAAKuB,KAAKN,KAAMA,OAAO,IAAK,UAAA;AACjCA,QAAMA,OAAO;AAEbC,OAAKlB,KAAKuB,KAAKL,KAAMA,OAAO,IAAK,UAAA;AACjCA,OAAKlB,KAAKuB,KAAKL,KAAMA,OAAO,IAAK,UAAA;AACjCA,QAAMA,OAAO;AAEb,SAAO,cAAc,UAAUA,OAAOD,OAAO;AAC/C;AA1BSZ;;;AtB1BF,IAAMmB,eAAe;EAC1BC,0BAA0B;AAC5B;AAEO,IAAMC,oBAAoB;EAC/BC,gBAAgBH,aAAaC;EAC7BG,uBAAuBJ,aAAaC;AACtC;AAEO,SAASI,gBACdC,aACAC,SACS;AACT,MAAIA,YAAY,iBAAiBA,YAAY,WAAW;AACtD,WAAO;EACT;AAEA,QAAMC,mBAAmBN,kBAAkBI,WAAAA;AAE3C,MAAI,CAACE,kBAAkB;AACrB,WAAO;EACT;AAEA,SAAOD,WAAWC;AACpB;AAfgBH;","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","prettyPrintBytes","process","env","NODE_ENV","sizeInBytes","Buffer","byteLength","toFixed","import_zod","addMissingVersionField","val","version","ErrorWithStackSchema","z","object","message","string","name","optional","stack","SchemaErrorSchema","path","array","import_zod","EventMatcherSchema","z","union","array","string","number","boolean","object","$endsWith","$startsWith","$exists","$isNull","$anythingBut","$gt","$lt","$gte","$lte","$between","tuple","$includes","$ignoreCaseEquals","EventFilterSchema","lazy","record","EventRuleSchema","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","accountId","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","callbackUrl","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","import_zod","import_zod","StatusUpdateStateSchema","z","union","literal","StatusUpdateDataSchema","record","SerializableJsonSchema","StatusUpdateSchema","object","label","string","optional","state","data","InitalStatusUpdateSchema","required","StatusHistorySchema","array","JobRunStatusRecordSchema","extend","key","history","RunStatusSchema","z","union","literal","RunTaskSchema","object","id","string","displayKey","nullable","status","TaskStatusSchema","name","icon","startedAt","coerce","date","completedAt","RunTaskWithSubtasksSchema","extend","subtasks","lazy","array","optional","GetRunOptionsSchema","boolean","cursor","take","number","GetRunOptionsWithTaskDetailsSchema","taskdetails","RunSchema","updatedAt","GetRunSchema","output","any","tasks","statuses","JobRunStatusRecordSchema","default","nextCursor","GetRunsOptionsSchema","GetRunsSchema","runs","UpdateTriggerSourceBodyV1Schema","z","object","registeredEvents","array","string","secret","optional","data","SerializableJsonSchema","UpdateTriggerSourceBodyV2Schema","options","event","and","record","RegisterHTTPTriggerSourceBodySchema","type","literal","url","RegisterSMTPTriggerSourceBodySchema","RegisterSQSTriggerSourceBodySchema","RegisterSourceChannelBodySchema","discriminatedUnion","REGISTER_SOURCE_EVENT_V1","REGISTER_SOURCE_EVENT_V2","RegisterTriggerSourceSchema","key","params","any","active","boolean","DeserializedJsonSchema","channel","clientId","SourceEventOptionSchema","name","value","RegisterSourceEventSchemaV1","id","source","events","missingEvents","orphanedEvents","dynamicTriggerId","RegisteredOptionsDiffSchema","desired","missing","orphaned","RegisterSourceEventOptionsSchema","RegisterSourceEventSchemaV2","TriggerSourceSchema","HttpSourceResponseMetadataSchema","HandleTriggerSourceSchema","auth","ConnectionAuthSchema","metadata","HttpSourceRequestSchema","method","headers","rawBody","instanceof","Buffer","nullable","HttpSourceRequestHeadersSchema","transform","s","JSON","parse","undefined","json","PongSuccessResponseSchema","ok","triggerVersion","PongErrorResponseSchema","error","PongResponseSchema","ValidateSuccessResponseSchema","endpointId","ValidateErrorResponseSchema","ValidateResponseSchema","QueueOptionsSchema","maxConcurrent","number","JobMetadataSchema","version","EventSpecificationSchema","trigger","TriggerMetadataSchema","integrations","IntegrationConfigSchema","internal","default","enabled","startPosition","enum","preprocessRuns","SourceMetadataV1Schema","integration","registerSourceJob","SourceMetadataV2Schema","SourceMetadataSchema","preprocess","addMissingVersionField","DynamicTriggerEndpointMetadataSchema","jobs","pick","IndexEndpointResponseSchema","sources","dynamicTriggers","dynamicSchedules","RegisterDynamicSchedulePayloadSchema","EndpointIndexErrorSchema","message","raw","IndexEndpointStatsSchema","disabledJobs","parseEndpointIndexStats","stats","GetEndpointIndexResponseSchema","status","updatedAt","coerce","date","EndpointHeadersSchema","RawEventSchema","payload","context","ulid","timestamp","ApiEventLogSchema","deliverAt","deliveredAt","cancelledAt","SendEventOptionsSchema","deliverAfter","int","accountId","SendEventBodySchema","DeliverEventResponseSchema","datetime","RuntimeEnvironmentTypeSchema","RunSourceContextSchema","RunJobBodySchema","job","run","isTest","isRetry","startedAt","environment","slug","organization","title","account","tasks","CachedTaskSchema","cachedTaskCursor","noopTasksSet","connections","yieldedExecutions","RunJobErrorSchema","ErrorWithStackSchema","task","TaskSchema","RunJobYieldExecutionErrorSchema","RunJobInvalidPayloadErrorSchema","errors","SchemaErrorSchema","RunJobUnresolvedAuthErrorSchema","issues","RunJobResumeWithTaskSchema","RunJobRetryWithTaskSchema","retryAt","RunJobCanceledWithTaskSchema","RunJobSuccessSchema","output","RunJobResponseSchema","PreprocessRunBodySchema","PreprocessRunResponseSchema","abort","properties","DisplayPropertySchema","CreateRunResponseOkSchema","CreateRunResponseErrorSchema","CreateRunResponseBodySchema","RedactStringSchema","__redactedString","strings","interpolations","LogMessageSchema","level","RedactSchema","paths","RetryOptionsSchema","limit","factor","minTimeoutInMs","maxTimeoutInMs","randomize","RunTaskOptionsSchema","delayUntil","retry","icon","displayKey","description","style","StyleSchema","callback","timeoutInSeconds","partial","connectionKey","operation","noop","redact","RunTaskBodyInputSchema","extend","idempotencyKey","parentId","RunTaskBodyOutputSchema","RunTaskResponseWithCachedTasksBodySchema","ServerTaskSchema","cachedTasks","cursor","CompleteTaskBodyInputSchema","v","stringify","FailTaskBodyInputSchema","NormalizedRequestSchema","query","body","NormalizedResponseSchema","HttpSourceResponseSchema","response","RegisterTriggerBodySchemaV1","rule","EventRuleSchema","RegisterTriggerBodySchemaV2","InitializeTriggerBodySchema","RegisterCommonScheduleBodySchema","RegisterIntervalScheduleBodySchema","merge","IntervalMetadataSchema","InitializeCronScheduleBodySchema","CronMetadataSchema","RegisterScheduleBodySchema","RegisterScheduleResponseBodySchema","schedule","ScheduleMetadataSchema","CreateExternalConnectionBodySchema","accessToken","scopes","GetRunStatusesSchema","RunStatusSchema","statuses","JobRunStatusRecordSchema","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","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","eventFilterMatches","payload","filter","patternKey","patternValue","Object","entries","payloadValue","Array","isArray","length","every","item","includes","objectArray","contentFiltersMatches","some","actualValue","contentFilters","contentFilter","key","value","contentFilterMatches","endsWith","$endsWith","startsWith","$startsWith","$anythingBut","$exists","undefined","$gt","$lt","$gte","$lte","$between","$includes","localeCompare","$ignoreCaseEquals","sensitivity","$isNull","BloomFilter","constructor","size","bitArray","Uint8Array","Math","ceil","add","item","index","murmurHash3","floor","test","serialize","Buffer","from","toString","deserialize","str","filter","NOOP_TASK_SET_SIZE","seed","h1","h2","i","ch","length","charCodeAt","imul","API_VERSIONS","LAZY_LOADED_CACHED_TASKS","PLATFORM_FEATURES","yieldExecution","lazyLoadedCachedTasks","supportsFeature","featureName","version","supportedVersion"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/logger.ts","../src/schemas/api.ts","../src/schemas/addMissingVersionField.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/runs.ts","../src/schemas/statuses.ts","../src/schemas/notifications.ts","../src/schemas/fetch.ts","../src/schemas/events.ts","../src/utils.ts","../src/retry.ts","../src/replacements.ts","../src/searchParams.ts","../src/eventFilterMatches.ts","../src/bloom.ts"],"sourcesContent":["export * from \"./logger\";\nexport * from \"./schemas\";\nexport * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./retry\";\nexport * from \"./replacements\";\nexport * from \"./searchParams\";\nexport * from \"./eventFilterMatches\";\nexport * from \"./bloom\";\n\nexport const API_VERSIONS = {\n LAZY_LOADED_CACHED_TASKS: \"2023-09-29\",\n} as const;\n\nexport const PLATFORM_FEATURES = {\n yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,\n lazyLoadedCachedTasks: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,\n};\n\nexport function supportsFeature<TFeatureName extends keyof typeof PLATFORM_FEATURES>(\n featureName: TFeatureName,\n version: string\n): boolean {\n if (version === \"unversioned\" || version === \"unknown\") {\n return false;\n }\n\n const supportedVersion = PLATFORM_FEATURES[featureName];\n\n if (!supportedVersion) {\n return false;\n }\n\n return version >= supportedVersion;\n}\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 if (value) {\n filteredObj[key] = `[filtered ${prettyPrintBytes(value)}]`;\n } else {\n filteredObj[key] = value;\n }\n continue;\n }\n\n filteredObj[key] = filterKeys(value, keys);\n }\n\n return filteredObj;\n}\n\nfunction prettyPrintBytes(value: unknown): string {\n if (process.env.NODE_ENV === \"production\") {\n return \"skipped size\";\n }\n\n const sizeInBytes = Buffer.byteLength(JSON.stringify(value), \"utf8\");\n\n if (sizeInBytes < 1024) {\n return `${sizeInBytes} bytes`;\n }\n\n if (sizeInBytes < 1024 * 1024) {\n return `${(sizeInBytes / 1024).toFixed(2)} KB`;\n }\n\n if (sizeInBytes < 1024 * 1024 * 1024) {\n return `${(sizeInBytes / (1024 * 1024)).toFixed(2)} MB`;\n }\n\n return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n}\n","import { ulid } from \"ulid\";\nimport { z } from \"zod\";\nimport { Prettify } from \"../types\";\nimport { addMissingVersionField } from \"./addMissingVersionField\";\nimport { ErrorWithStackSchema, SchemaErrorSchema } 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 { RunStatusSchema } from \"./runs\";\nimport { JobRunStatusRecordSchema } from \"./statuses\";\n\nexport const UpdateTriggerSourceBodyV1Schema = z.object({\n registeredEvents: z.array(z.string()),\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n});\nexport type UpdateTriggerSourceBodyV1 = z.infer<typeof UpdateTriggerSourceBodyV1Schema>;\n\nexport const UpdateTriggerSourceBodyV2Schema = z.object({\n secret: z.string().optional(),\n data: SerializableJsonSchema.optional(),\n options: z\n .object({\n event: z.array(z.string()),\n })\n .and(z.record(z.string(), z.array(z.string())).optional()),\n});\nexport type UpdateTriggerSourceBodyV2 = z.infer<typeof UpdateTriggerSourceBodyV2Schema>;\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_V1 = \"dev.trigger.source.register\";\nexport const REGISTER_SOURCE_EVENT_V2 = \"dev.trigger.source.register.v2\";\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\nconst SourceEventOptionSchema = z.object({\n name: z.string(),\n value: z.string(),\n});\n\nexport type SourceEventOption = z.infer<typeof SourceEventOptionSchema>;\n\nexport const RegisterSourceEventSchemaV1 = 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 RegisterSourceEventV1 = z.infer<typeof RegisterSourceEventSchemaV1>;\n\nconst RegisteredOptionsDiffSchema = z.object({\n desired: z.array(z.string()),\n missing: z.array(z.string()),\n orphaned: z.array(z.string()),\n});\n\nexport type RegisteredOptionsDiff = Prettify<z.infer<typeof RegisteredOptionsDiffSchema>>;\n\nconst RegisterSourceEventOptionsSchema = z\n .object({\n event: RegisteredOptionsDiffSchema,\n })\n .and(z.record(z.string(), RegisteredOptionsDiffSchema));\n\nexport type RegisterSourceEventOptions = z.infer<typeof RegisterSourceEventOptionsSchema>;\n\nexport const RegisterSourceEventSchemaV2 = z.object({\n /** The id of the source */\n id: z.string(),\n source: RegisterTriggerSourceSchema,\n options: RegisterSourceEventOptionsSchema,\n dynamicTriggerId: z.string().optional(),\n});\n\nexport type RegisterSourceEventV2 = z.infer<typeof RegisterSourceEventSchemaV2>;\n\nexport const TriggerSourceSchema = z.object({\n id: z.string(),\n key: z.string(),\n});\n\nconst HttpSourceResponseMetadataSchema = DeserializedJsonSchema;\nexport type HttpSourceResponseMetadata = z.infer<typeof HttpSourceResponseMetadataSchema>;\n\nexport const HandleTriggerSourceSchema = z.object({\n key: z.string(),\n secret: z.string(),\n data: z.any(),\n params: z.any(),\n auth: ConnectionAuthSchema.optional(),\n metadata: HttpSourceResponseMetadataSchema.optional(),\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 \"x-ts-auth\": z\n .string()\n .optional()\n .transform((s) => {\n if (s === undefined) return;\n const json = JSON.parse(s);\n return ConnectionAuthSchema.parse(json);\n }),\n \"x-ts-metadata\": z\n .string()\n .optional()\n .transform((s) => {\n if (s === undefined) return;\n const json = JSON.parse(s);\n return DeserializedJsonSchema.parse(json);\n }),\n});\n\nexport type HttpSourceRequestHeaders = z.output<typeof HttpSourceRequestHeadersSchema>;\n\nexport const PongSuccessResponseSchema = z.object({\n ok: z.literal(true),\n triggerVersion: z.string().optional(),\n triggerSdkVersion: z.string().optional(),\n});\n\nexport const PongErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n triggerVersion: z.string().optional(),\n triggerSdkVersion: z.string().optional(),\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 triggerVersion: z.string().optional(),\n});\n\nexport const ValidateErrorResponseSchema = z.object({\n ok: z.literal(false),\n error: z.string(),\n triggerVersion: z.string().optional(),\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 enabled: z.boolean(),\n startPosition: z.enum([\"initial\", \"latest\"]),\n preprocessRuns: z.boolean(),\n});\n\nexport type JobMetadata = z.infer<typeof JobMetadataSchema>;\n\nconst SourceMetadataV1Schema = z.object({\n version: z.literal(\"1\"),\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 SourceMetadataV1 = z.infer<typeof SourceMetadataV1Schema>;\n\nexport const SourceMetadataV2Schema = z.object({\n version: z.literal(\"2\"),\n channel: z.enum([\"HTTP\", \"SQS\", \"SMTP\"]),\n integration: IntegrationConfigSchema,\n key: z.string(),\n params: z.any(),\n options: z.record(z.array(z.string())),\n registerSourceJob: z\n .object({\n id: z.string(),\n version: z.string(),\n })\n .optional(),\n});\n\nexport type SourceMetadataV2 = z.infer<typeof SourceMetadataV2Schema>;\n\nconst SourceMetadataSchema = z.preprocess(\n addMissingVersionField,\n z.discriminatedUnion(\"version\", [SourceMetadataV1Schema, SourceMetadataV2Schema])\n);\n\ntype SourceMetadata = Prettify<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 EndpointIndexErrorSchema = z.object({\n message: z.string(),\n raw: z.any().optional(),\n});\n\nexport type EndpointIndexError = z.infer<typeof EndpointIndexErrorSchema>;\n\nconst IndexEndpointStatsSchema = z.object({\n jobs: z.number(),\n sources: z.number(),\n dynamicTriggers: z.number(),\n dynamicSchedules: z.number(),\n disabledJobs: z.number().default(0),\n});\n\nexport type IndexEndpointStats = z.infer<typeof IndexEndpointStatsSchema>;\n\nexport function parseEndpointIndexStats(stats: unknown): IndexEndpointStats | undefined {\n if (stats === null || stats === undefined) {\n return;\n }\n return IndexEndpointStatsSchema.parse(stats);\n}\n\nexport const GetEndpointIndexResponseSchema = z.discriminatedUnion(\"status\", [\n z.object({\n status: z.literal(\"PENDING\"),\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"STARTED\"),\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"SUCCESS\"),\n stats: IndexEndpointStatsSchema,\n updatedAt: z.coerce.date(),\n }),\n z.object({\n status: z.literal(\"FAILURE\"),\n error: EndpointIndexErrorSchema,\n updatedAt: z.coerce.date(),\n }),\n]);\n\nexport type GetEndpointIndexResponse = z.infer<typeof GetEndpointIndexResponseSchema>;\n\nexport const EndpointHeadersSchema = z.object({\n \"trigger-version\": z.string().optional(),\n \"trigger-sdk-version\": z.string().optional(),\n});\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 /** The timestamp when the event was cancelled. Is `undefined` if the event\n * wasn't cancelled. */\n cancelledAt: 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 type RunSourceContext = z.infer<typeof RunSourceContextSchema>;\n\nexport const AutoYieldConfigSchema = z.object({\n startTaskThreshold: z.number(),\n beforeExecuteTaskThreshold: z.number(),\n beforeCompleteTaskThreshold: z.number(),\n afterCompleteTaskThreshold: z.number(),\n});\n\nexport type AutoYieldConfig = z.infer<typeof AutoYieldConfigSchema>;\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 cachedTaskCursor: z.string().optional(),\n noopTasksSet: z.string().optional(),\n connections: z.record(ConnectionAuthSchema).optional(),\n yieldedExecutions: z.string().array().optional(),\n runChunkExecutionLimit: z.number().optional(),\n autoYieldConfig: AutoYieldConfigSchema.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 RunJobYieldExecutionErrorSchema = z.object({\n status: z.literal(\"YIELD_EXECUTION\"),\n key: z.string(),\n});\n\nexport type RunJobYieldExecutionError = z.infer<typeof RunJobYieldExecutionErrorSchema>;\n\nexport const RunJobAutoYieldExecutionErrorSchema = z.object({\n status: z.literal(\"AUTO_YIELD_EXECUTION\"),\n location: z.string(),\n timeRemaining: z.number(),\n timeElapsed: z.number(),\n limit: z.number().optional(),\n});\n\nexport type RunJobAutoYieldExecutionError = z.infer<typeof RunJobAutoYieldExecutionErrorSchema>;\n\nexport const RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = z.object({\n status: z.literal(\"AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK\"),\n id: z.string(),\n properties: z.array(DisplayPropertySchema).optional(),\n output: z.any(),\n data: z.object({\n location: z.string(),\n timeRemaining: z.number(),\n timeElapsed: z.number(),\n limit: z.number().optional(),\n }),\n});\n\nexport type RunJobAutoYieldWithCompletedTaskExecutionError = z.infer<\n typeof RunJobAutoYieldWithCompletedTaskExecutionErrorSchema\n>;\n\nexport const RunJobInvalidPayloadErrorSchema = z.object({\n status: z.literal(\"INVALID_PAYLOAD\"),\n errors: z.array(SchemaErrorSchema),\n});\n\nexport type RunJobInvalidPayloadError = z.infer<typeof RunJobInvalidPayloadErrorSchema>;\n\nexport const RunJobUnresolvedAuthErrorSchema = z.object({\n status: z.literal(\"UNRESOLVED_AUTH_ERROR\"),\n issues: z.record(z.object({ id: z.string(), error: z.string() })),\n});\n\nexport type RunJobUnresolvedAuthError = z.infer<typeof RunJobUnresolvedAuthErrorSchema>;\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 RunJobAutoYieldExecutionErrorSchema,\n RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,\n RunJobYieldExecutionErrorSchema,\n RunJobErrorSchema,\n RunJobUnresolvedAuthErrorSchema,\n RunJobInvalidPayloadErrorSchema,\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\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().optional(),\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 [Tabler Icons](https://tabler-icons.io/) 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 expose a `task.callbackUrl` to use in your tasks. Enabling this feature will cause the task to return the data sent to the callbackUrl instead of the usual async callback result. */\n callback: z\n .object({\n /** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */\n enabled: z.boolean(),\n /** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */\n timeoutInSeconds: z.number(),\n })\n .partial()\n .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 type OverridableRunTaskOptions = Pick<\n RunTaskOptions,\n \"retry\" | \"delayUntil\" | \"description\"\n>;\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 properties: z.array(DisplayPropertySchema.partial()).optional(),\n params: DeserializedJsonSchema.optional().nullable(),\n callback: z\n .object({\n enabled: z.boolean(),\n timeoutInSeconds: z.number().default(3600),\n })\n .optional(),\n});\n\nexport type RunTaskBodyOutput = z.infer<typeof RunTaskBodyOutputSchema>;\n\nexport const RunTaskResponseWithCachedTasksBodySchema = z.object({\n task: ServerTaskSchema,\n cachedTasks: z\n .object({\n tasks: z.array(CachedTaskSchema),\n cursor: z.string().optional(),\n })\n .optional(),\n});\n\nexport type RunTaskResponseWithCachedTasksBody = z.infer<\n typeof RunTaskResponseWithCachedTasksBodySchema\n>;\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 metadata: HttpSourceResponseMetadataSchema.optional(),\n});\n\nexport const RegisterTriggerBodySchemaV1 = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataV1Schema,\n});\n\nexport type RegisterTriggerBodyV1 = z.infer<typeof RegisterTriggerBodySchemaV1>;\n\nexport const RegisterTriggerBodySchemaV2 = z.object({\n rule: EventRuleSchema,\n source: SourceMetadataV2Schema,\n accountId: z.string().optional(),\n});\n\nexport type RegisterTriggerBodyV2 = z.infer<typeof RegisterTriggerBodySchemaV2>;\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 /** An optional Account ID to associate with runs triggered by this schedule */\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\nexport const GetRunStatusesSchema = z.object({\n run: z.object({ id: z.string(), status: RunStatusSchema, output: z.any().optional() }),\n statuses: z.array(JobRunStatusRecordSchema),\n});\nexport type GetRunStatuses = z.infer<typeof GetRunStatusesSchema>;\n","export function addMissingVersionField(val: unknown) {\n if (val !== null && typeof val === \"object\" && !(\"version\" in val)) {\n return {\n ...val,\n version: \"1\",\n };\n }\n return val;\n}\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\nexport const SchemaErrorSchema = z.object({\n path: z.array(z.string()),\n message: z.string(),\n});\n\nexport type SchemaError = z.infer<typeof SchemaErrorSchema>;\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 z.array(\n z.union([\n z.object({\n $endsWith: z.string(),\n }),\n z.object({\n $startsWith: z.string(),\n }),\n z.object({\n $exists: z.boolean(),\n }),\n z.object({\n $isNull: z.boolean(),\n }),\n z.object({\n $anythingBut: z.union([z.string(), z.number(), z.boolean()]),\n }),\n z.object({\n $anythingBut: z.union([z.array(z.string()), z.array(z.number()), z.array(z.boolean())]),\n }),\n z.object({\n $gt: z.number(),\n }),\n z.object({\n $lt: z.number(),\n }),\n z.object({\n $gte: z.number(),\n }),\n z.object({\n $lte: z.number(),\n }),\n z.object({\n $between: z.tuple([z.number(), z.number()]),\n }),\n z.object({\n $includes: z.union([z.string(), z.number(), z.boolean()]),\n }),\n z.object({\n $ignoreCaseEquals: z.string(),\n }),\n ])\n ),\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\", \"apiKey\"]),\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\", \"RESOLVER\"]),\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 = 2_592_000 (30 days) */\n seconds: z.number().int().positive().min(60).max(2_592_000),\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 /** An optional Account ID to associate with runs triggered by this interval */\n accountId: z.string().optional(),\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 /** An optional Account ID to associate with runs triggered by this interval */\n accountId: z.string().optional(),\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 callbackUrl: z.string().optional().nullable(),\n});\n\nexport const ServerTaskSchema = TaskSchema.extend({\n idempotencyKey: z.string(),\n attempts: z.number(),\n forceYield: z.boolean().optional().nullable(),\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\";\nimport { TaskStatusSchema } from \"./tasks\";\nimport { JobRunStatusRecordSchema } from \"./statuses\";\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 z.literal(\"UNRESOLVED_AUTH\"),\n z.literal(\"INVALID_PAYLOAD\"),\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\nexport type RunTaskWithSubtasks = z.infer<typeof RunTaskSchema> & {\n /** The subtasks of the task */\n subtasks?: RunTaskWithSubtasks[];\n};\n\nconst RunTaskWithSubtasksSchema: z.ZodType<RunTaskWithSubtasks> = RunTaskSchema.extend({\n subtasks: z.lazy(() => RunTaskWithSubtasksSchema.array()).optional(),\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(RunTaskWithSubtasksSchema),\n /** Any status updates that were published from the run */\n statuses: z.array(JobRunStatusRecordSchema).default([]),\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","import { z } from \"zod\";\nimport { SerializableJsonSchema } from \"./json\";\nimport { RunStatusSchema } from \"./runs\";\n\nexport const StatusUpdateStateSchema = z.union([\n z.literal(\"loading\"),\n z.literal(\"success\"),\n z.literal(\"failure\"),\n]);\nexport type StatusUpdateState = z.infer<typeof StatusUpdateStateSchema>;\n\nconst StatusUpdateDataSchema = z.record(SerializableJsonSchema);\nexport type StatusUpdateData = z.infer<typeof StatusUpdateDataSchema>;\n\nexport const StatusUpdateSchema = z.object({\n label: z.string().optional(),\n state: StatusUpdateStateSchema.optional(),\n data: StatusUpdateDataSchema.optional(),\n});\nexport type StatusUpdate = z.infer<typeof StatusUpdateSchema>;\n\nconst InitalStatusUpdateSchema = StatusUpdateSchema.required({ label: true });\nexport type InitialStatusUpdate = z.infer<typeof InitalStatusUpdateSchema>;\n\nexport const StatusHistorySchema = z.array(StatusUpdateSchema);\nexport type StatusHistory = z.infer<typeof StatusHistorySchema>;\n\nexport const JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({\n key: z.string(),\n history: StatusHistorySchema,\n});\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","// 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","import { EventFilter } from \"./schemas/eventFilter\";\n\n// EventFilter is a recursive type, where the keys are strings and the values are an array of strings, numbers, booleans, or objects.\n// If the values of the array are strings, numbers, or booleans, than we are matching against the value of the payload.\n// If the values of the array are objects, then we are doing content filtering\n// An example would be [{ $endsWith: \".png\" }, { $startsWith: \"images/\" } ]\nexport function eventFilterMatches(payload: any, filter: EventFilter): boolean {\n for (const [patternKey, patternValue] of Object.entries(filter)) {\n const payloadValue = payload[patternKey];\n\n if (Array.isArray(patternValue)) {\n if (patternValue.length === 0) {\n continue;\n }\n\n // Check to see if all the items in the array are a string\n if ((patternValue as unknown[]).every((item) => typeof item === \"string\")) {\n if ((patternValue as string[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Check to see if all the items in the array are a number\n if ((patternValue as unknown[]).every((item) => typeof item === \"number\")) {\n if ((patternValue as number[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Check to see if all the items in the array are a boolean\n if ((patternValue as unknown[]).every((item) => typeof item === \"boolean\")) {\n if ((patternValue as boolean[]).includes(payloadValue)) {\n continue;\n }\n\n return false;\n }\n\n // Now we know that all the items in the array are objects\n const objectArray = patternValue as Exclude<\n typeof patternValue,\n number[] | string[] | boolean[]\n >;\n\n if (!contentFiltersMatches(payloadValue, objectArray)) {\n return false;\n }\n\n continue;\n } else if (typeof patternValue === \"object\") {\n if (Array.isArray(payloadValue)) {\n if (!payloadValue.some((item) => eventFilterMatches(item, patternValue))) {\n return false;\n }\n } else {\n if (!eventFilterMatches(payloadValue, patternValue)) {\n return false;\n }\n }\n }\n }\n return true;\n}\n\ntype ContentFilters = Exclude<EventFilter[string], EventFilter | string[] | number[] | boolean[]>;\n\nfunction contentFiltersMatches(actualValue: any, contentFilters: ContentFilters): boolean {\n for (const contentFilter of contentFilters) {\n if (typeof contentFilter === \"object\") {\n const [key, value] = Object.entries(contentFilter)[0];\n\n if (!contentFilterMatches(actualValue, contentFilter)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction contentFilterMatches(actualValue: any, contentFilter: ContentFilters[number]): boolean {\n if (\"$endsWith\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return actualValue.endsWith(contentFilter.$endsWith);\n }\n\n if (\"$startsWith\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return actualValue.startsWith(contentFilter.$startsWith);\n }\n\n if (\"$anythingBut\" in contentFilter) {\n if (Array.isArray(contentFilter.$anythingBut)) {\n if ((contentFilter.$anythingBut as any[]).includes(actualValue)) {\n return false;\n }\n }\n\n if (contentFilter.$anythingBut === actualValue) {\n return false;\n }\n\n return true;\n }\n\n if (\"$exists\" in contentFilter) {\n if (contentFilter.$exists) {\n return actualValue !== undefined;\n }\n\n return actualValue === undefined;\n }\n\n if (\"$gt\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue > contentFilter.$gt;\n }\n\n if (\"$lt\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue < contentFilter.$lt;\n }\n\n if (\"$gte\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue >= contentFilter.$gte;\n }\n\n if (\"$lte\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue <= contentFilter.$lte;\n }\n\n if (\"$between\" in contentFilter) {\n if (typeof actualValue !== \"number\") {\n return false;\n }\n\n return actualValue >= contentFilter.$between[0] && actualValue <= contentFilter.$between[1];\n }\n\n if (\"$includes\" in contentFilter) {\n if (Array.isArray(actualValue)) {\n return actualValue.includes(contentFilter.$includes);\n }\n\n return false;\n }\n\n // Use localCompare\n if (\"$ignoreCaseEquals\" in contentFilter) {\n if (typeof actualValue !== \"string\") {\n return false;\n }\n\n return (\n actualValue.localeCompare(contentFilter.$ignoreCaseEquals, undefined, {\n sensitivity: \"accent\",\n }) === 0\n );\n }\n\n if (\"$isNull\" in contentFilter) {\n if (contentFilter.$isNull) {\n return actualValue === null;\n }\n\n return actualValue !== null;\n }\n\n return true;\n}\n","import { Buffer } from \"node:buffer\";\n\nexport class BloomFilter {\n private size: number;\n private bitArray: Uint8Array;\n\n constructor(size: number) {\n this.size = size;\n this.bitArray = new Uint8Array(Math.ceil(size / 8));\n }\n\n add(item: string): void {\n const index = murmurHash3(item) % this.size;\n this.bitArray[Math.floor(index / 8)] |= 1 << index % 8;\n }\n\n test(item: string): boolean {\n const index = murmurHash3(item) % this.size;\n return (this.bitArray[Math.floor(index / 8)] & (1 << index % 8)) !== 0;\n }\n\n // Serialize to a Base64 string\n serialize(): string {\n return Buffer.from(this.bitArray).toString(\"base64\");\n }\n\n // Deserialize from a Base64 string\n static deserialize(str: string, size: number): BloomFilter {\n const filter = new BloomFilter(size);\n filter.bitArray = Uint8Array.from(Buffer.from(str, \"base64\"));\n return filter;\n }\n\n static NOOP_TASK_SET_SIZE = 32_768;\n}\n\nfunction murmurHash3(str: string, seed = 0): number {\n let h1 = 0xdeadbeef ^ seed,\n h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 0xcc9e2d51);\n h1 = (h1 << 15) | (h1 >>> 17);\n h1 = Math.imul(h1, 0x1b873593);\n\n h2 = Math.imul(h2 ^ ch, 0x85ebca6b);\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = Math.imul(h2, 0xc2b2ae35);\n }\n\n h1 ^= str.length;\n h2 ^= str.length;\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 0x85ebca6b);\n h1 = Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);\n h1 ^= h1 >>> 16;\n\n h2 = Math.imul(h2 ^ (h2 >>> 16), 0x85ebca6b);\n h2 = Math.imul(h2 ^ (h2 >>> 13), 0xc2b2ae35);\n h2 ^= h2 >>> 16;\n\n return 4294967296 * (2097151 & h2) + (h1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G_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","prettyPrintBytes","process","env","NODE_ENV","sizeInBytes","Buffer","byteLength","toFixed","import_zod","addMissingVersionField","val","version","ErrorWithStackSchema","z","object","message","string","name","optional","stack","SchemaErrorSchema","path","array","import_zod","EventMatcherSchema","z","union","array","string","number","boolean","object","$endsWith","$startsWith","$exists","$isNull","$anythingBut","$gt","$lt","$gte","$lte","$between","tuple","$includes","$ignoreCaseEquals","EventFilterSchema","lazy","record","EventRuleSchema","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","accountId","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","callbackUrl","ServerTaskSchema","extend","idempotencyKey","attempts","number","forceYield","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","import_zod","import_zod","StatusUpdateStateSchema","z","union","literal","StatusUpdateDataSchema","record","SerializableJsonSchema","StatusUpdateSchema","object","label","string","optional","state","data","InitalStatusUpdateSchema","required","StatusHistorySchema","array","JobRunStatusRecordSchema","extend","key","history","RunStatusSchema","z","union","literal","RunTaskSchema","object","id","string","displayKey","nullable","status","TaskStatusSchema","name","icon","startedAt","coerce","date","completedAt","RunTaskWithSubtasksSchema","extend","subtasks","lazy","array","optional","GetRunOptionsSchema","boolean","cursor","take","number","GetRunOptionsWithTaskDetailsSchema","taskdetails","RunSchema","updatedAt","GetRunSchema","output","any","tasks","statuses","JobRunStatusRecordSchema","default","nextCursor","GetRunsOptionsSchema","GetRunsSchema","runs","UpdateTriggerSourceBodyV1Schema","z","object","registeredEvents","array","string","secret","optional","data","SerializableJsonSchema","UpdateTriggerSourceBodyV2Schema","options","event","and","record","RegisterHTTPTriggerSourceBodySchema","type","literal","url","RegisterSMTPTriggerSourceBodySchema","RegisterSQSTriggerSourceBodySchema","RegisterSourceChannelBodySchema","discriminatedUnion","REGISTER_SOURCE_EVENT_V1","REGISTER_SOURCE_EVENT_V2","RegisterTriggerSourceSchema","key","params","any","active","boolean","DeserializedJsonSchema","channel","clientId","SourceEventOptionSchema","name","value","RegisterSourceEventSchemaV1","id","source","events","missingEvents","orphanedEvents","dynamicTriggerId","RegisteredOptionsDiffSchema","desired","missing","orphaned","RegisterSourceEventOptionsSchema","RegisterSourceEventSchemaV2","TriggerSourceSchema","HttpSourceResponseMetadataSchema","HandleTriggerSourceSchema","auth","ConnectionAuthSchema","metadata","HttpSourceRequestSchema","method","headers","rawBody","instanceof","Buffer","nullable","HttpSourceRequestHeadersSchema","transform","s","JSON","parse","undefined","json","PongSuccessResponseSchema","ok","triggerVersion","triggerSdkVersion","PongErrorResponseSchema","error","PongResponseSchema","ValidateSuccessResponseSchema","endpointId","ValidateErrorResponseSchema","ValidateResponseSchema","QueueOptionsSchema","maxConcurrent","number","JobMetadataSchema","version","EventSpecificationSchema","trigger","TriggerMetadataSchema","integrations","IntegrationConfigSchema","internal","default","enabled","startPosition","enum","preprocessRuns","SourceMetadataV1Schema","integration","registerSourceJob","SourceMetadataV2Schema","SourceMetadataSchema","preprocess","addMissingVersionField","DynamicTriggerEndpointMetadataSchema","jobs","pick","IndexEndpointResponseSchema","sources","dynamicTriggers","dynamicSchedules","RegisterDynamicSchedulePayloadSchema","EndpointIndexErrorSchema","message","raw","IndexEndpointStatsSchema","disabledJobs","parseEndpointIndexStats","stats","GetEndpointIndexResponseSchema","status","updatedAt","coerce","date","EndpointHeadersSchema","RawEventSchema","payload","context","ulid","timestamp","ApiEventLogSchema","deliverAt","deliveredAt","cancelledAt","SendEventOptionsSchema","deliverAfter","int","accountId","SendEventBodySchema","DeliverEventResponseSchema","datetime","RuntimeEnvironmentTypeSchema","RunSourceContextSchema","AutoYieldConfigSchema","startTaskThreshold","beforeExecuteTaskThreshold","beforeCompleteTaskThreshold","afterCompleteTaskThreshold","RunJobBodySchema","job","run","isTest","isRetry","startedAt","environment","slug","organization","title","account","tasks","CachedTaskSchema","cachedTaskCursor","noopTasksSet","connections","yieldedExecutions","runChunkExecutionLimit","autoYieldConfig","RunJobErrorSchema","ErrorWithStackSchema","task","TaskSchema","RunJobYieldExecutionErrorSchema","RunJobAutoYieldExecutionErrorSchema","location","timeRemaining","timeElapsed","limit","RunJobAutoYieldWithCompletedTaskExecutionErrorSchema","properties","DisplayPropertySchema","output","RunJobInvalidPayloadErrorSchema","errors","SchemaErrorSchema","RunJobUnresolvedAuthErrorSchema","issues","RunJobResumeWithTaskSchema","RunJobRetryWithTaskSchema","retryAt","RunJobCanceledWithTaskSchema","RunJobSuccessSchema","RunJobResponseSchema","PreprocessRunBodySchema","PreprocessRunResponseSchema","abort","CreateRunResponseOkSchema","CreateRunResponseErrorSchema","CreateRunResponseBodySchema","RedactStringSchema","__redactedString","strings","interpolations","LogMessageSchema","level","RedactSchema","paths","RetryOptionsSchema","factor","minTimeoutInMs","maxTimeoutInMs","randomize","RunTaskOptionsSchema","delayUntil","retry","icon","displayKey","description","style","StyleSchema","callback","timeoutInSeconds","partial","connectionKey","operation","noop","redact","RunTaskBodyInputSchema","extend","idempotencyKey","parentId","RunTaskBodyOutputSchema","RunTaskResponseWithCachedTasksBodySchema","ServerTaskSchema","cachedTasks","cursor","CompleteTaskBodyInputSchema","v","stringify","FailTaskBodyInputSchema","NormalizedRequestSchema","query","body","NormalizedResponseSchema","HttpSourceResponseSchema","response","RegisterTriggerBodySchemaV1","rule","EventRuleSchema","RegisterTriggerBodySchemaV2","InitializeTriggerBodySchema","RegisterCommonScheduleBodySchema","RegisterIntervalScheduleBodySchema","merge","IntervalMetadataSchema","InitializeCronScheduleBodySchema","CronMetadataSchema","RegisterScheduleBodySchema","RegisterScheduleResponseBodySchema","schedule","ScheduleMetadataSchema","CreateExternalConnectionBodySchema","accessToken","scopes","GetRunStatusesSchema","RunStatusSchema","statuses","JobRunStatusRecordSchema","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","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","eventFilterMatches","payload","filter","patternKey","patternValue","Object","entries","payloadValue","Array","isArray","length","every","item","includes","objectArray","contentFiltersMatches","some","actualValue","contentFilters","contentFilter","key","value","contentFilterMatches","endsWith","$endsWith","startsWith","$startsWith","$anythingBut","$exists","undefined","$gt","$lt","$gte","$lte","$between","$includes","localeCompare","$ignoreCaseEquals","sensitivity","$isNull","BloomFilter","constructor","size","bitArray","Uint8Array","Math","ceil","add","item","index","murmurHash3","floor","test","serialize","Buffer","from","toString","deserialize","str","filter","NOOP_TASK_SET_SIZE","seed","h1","h2","i","ch","length","charCodeAt","imul","API_VERSIONS","LAZY_LOADED_CACHED_TASKS","PLATFORM_FEATURES","yieldExecution","lazyLoadedCachedTasks","supportsFeature","featureName","version","supportedVersion"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/core",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Core code used across the Trigger.dev SDK and platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",