@trigger.dev/core 3.0.0-beta.29 → 3.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1715,10 +1715,13 @@ declare const GetEnvironmentVariablesResponseBody: z.ZodObject<{
1715
1715
  type GetEnvironmentVariablesResponseBody = z.infer<typeof GetEnvironmentVariablesResponseBody>;
1716
1716
  declare const StartDeploymentIndexingRequestBody: z.ZodObject<{
1717
1717
  imageReference: z.ZodString;
1718
+ selfHosted: z.ZodOptional<z.ZodBoolean>;
1718
1719
  }, "strip", z.ZodTypeAny, {
1719
1720
  imageReference: string;
1721
+ selfHosted?: boolean | undefined;
1720
1722
  }, {
1721
1723
  imageReference: string;
1724
+ selfHosted?: boolean | undefined;
1722
1725
  }>;
1723
1726
  type StartDeploymentIndexingRequestBody = z.infer<typeof StartDeploymentIndexingRequestBody>;
1724
1727
  declare const StartDeploymentIndexingResponseBody: z.ZodObject<{
@@ -4245,6 +4248,15 @@ declare const clock: ClockAPI;
4245
4248
 
4246
4249
  declare function parseError(error: unknown): TaskRunError;
4247
4250
  declare function createErrorTaskError(error: TaskRunError): any;
4251
+ declare function createJsonErrorObject(error: TaskRunError): {
4252
+ name: string;
4253
+ message: string;
4254
+ stackTrace: string;
4255
+ } | {
4256
+ message: string;
4257
+ name?: undefined;
4258
+ stackTrace?: undefined;
4259
+ };
4248
4260
  declare function correctErrorStackTrace(stackTrace: string, projectDir?: string, options?: {
4249
4261
  removeFirstLine?: boolean;
4250
4262
  }): string;
@@ -4499,4 +4511,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4499
4511
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4500
4512
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4501
4513
 
4502
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
4514
+ export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
@@ -1715,10 +1715,13 @@ declare const GetEnvironmentVariablesResponseBody: z.ZodObject<{
1715
1715
  type GetEnvironmentVariablesResponseBody = z.infer<typeof GetEnvironmentVariablesResponseBody>;
1716
1716
  declare const StartDeploymentIndexingRequestBody: z.ZodObject<{
1717
1717
  imageReference: z.ZodString;
1718
+ selfHosted: z.ZodOptional<z.ZodBoolean>;
1718
1719
  }, "strip", z.ZodTypeAny, {
1719
1720
  imageReference: string;
1721
+ selfHosted?: boolean | undefined;
1720
1722
  }, {
1721
1723
  imageReference: string;
1724
+ selfHosted?: boolean | undefined;
1722
1725
  }>;
1723
1726
  type StartDeploymentIndexingRequestBody = z.infer<typeof StartDeploymentIndexingRequestBody>;
1724
1727
  declare const StartDeploymentIndexingResponseBody: z.ZodObject<{
@@ -4245,6 +4248,15 @@ declare const clock: ClockAPI;
4245
4248
 
4246
4249
  declare function parseError(error: unknown): TaskRunError;
4247
4250
  declare function createErrorTaskError(error: TaskRunError): any;
4251
+ declare function createJsonErrorObject(error: TaskRunError): {
4252
+ name: string;
4253
+ message: string;
4254
+ stackTrace: string;
4255
+ } | {
4256
+ message: string;
4257
+ name?: undefined;
4258
+ stackTrace?: undefined;
4259
+ };
4248
4260
  declare function correctErrorStackTrace(stackTrace: string, projectDir?: string, options?: {
4249
4261
  removeFirstLine?: boolean;
4250
4262
  }): string;
@@ -4499,4 +4511,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4499
4511
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4500
4512
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4501
4513
 
4502
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
4514
+ export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
package/dist/v3/index.js CHANGED
@@ -864,7 +864,8 @@ var GetEnvironmentVariablesResponseBody = zod.z.object({
864
864
  variables: zod.z.record(zod.z.string())
865
865
  });
866
866
  var StartDeploymentIndexingRequestBody = zod.z.object({
867
- imageReference: zod.z.string()
867
+ imageReference: zod.z.string(),
868
+ selfHosted: zod.z.boolean().optional()
868
869
  });
869
870
  var StartDeploymentIndexingResponseBody = zod.z.object({
870
871
  id: zod.z.string(),
@@ -2353,6 +2354,33 @@ function createErrorTaskError(error) {
2353
2354
  }
2354
2355
  }
2355
2356
  __name(createErrorTaskError, "createErrorTaskError");
2357
+ function createJsonErrorObject(error) {
2358
+ switch (error.type) {
2359
+ case "BUILT_IN_ERROR": {
2360
+ return {
2361
+ name: error.name,
2362
+ message: error.message,
2363
+ stackTrace: error.stackTrace
2364
+ };
2365
+ }
2366
+ case "STRING_ERROR": {
2367
+ return {
2368
+ message: error.raw
2369
+ };
2370
+ }
2371
+ case "CUSTOM_ERROR": {
2372
+ return {
2373
+ message: error.raw
2374
+ };
2375
+ }
2376
+ case "INTERNAL_ERROR": {
2377
+ return {
2378
+ message: `trigger.dev internal error (${error.code})`
2379
+ };
2380
+ }
2381
+ }
2382
+ }
2383
+ __name(createJsonErrorObject, "createJsonErrorObject");
2356
2384
  function correctErrorStackTrace(stackTrace, projectDir, options) {
2357
2385
  const [errorLine, ...traceLines] = stackTrace.split("\n");
2358
2386
  return [
@@ -3614,6 +3642,7 @@ exports.conditionallyExportPacket = conditionallyExportPacket;
3614
3642
  exports.conditionallyImportPacket = conditionallyImportPacket;
3615
3643
  exports.correctErrorStackTrace = correctErrorStackTrace;
3616
3644
  exports.createErrorTaskError = createErrorTaskError;
3645
+ exports.createJsonErrorObject = createJsonErrorObject;
3617
3646
  exports.createPacketAttributes = createPacketAttributes;
3618
3647
  exports.createPacketAttributesAsJson = createPacketAttributesAsJson;
3619
3648
  exports.defaultFetchRetryOptions = defaultFetchRetryOptions;