@trigger.dev/core 3.0.0-beta.27 → 3.0.0-beta.28

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.
@@ -30,7 +30,7 @@ declare class TriggerTracer {
30
30
  startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
31
31
  }
32
32
 
33
- type LogLevel = "none" | "error" | "warn" | "info" | "debug";
33
+ type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
34
34
  declare const logLevels: Array<LogLevel>;
35
35
  type TaskLoggerConfig = {
36
36
  logger: Logger;
@@ -30,7 +30,7 @@ declare class TriggerTracer {
30
30
  startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
31
31
  }
32
32
 
33
- type LogLevel = "none" | "error" | "warn" | "info" | "debug";
33
+ type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
34
34
  declare const logLevels: Array<LogLevel>;
35
35
  type TaskLoggerConfig = {
36
36
  logger: Logger;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunError, b as TaskRunContext, R as RuntimeManager } from '../manager-WNMVbgHf.mjs';
3
3
  export { h as TaskRun, c as TaskRunBuiltInError, d as TaskRunCustomErrorObject, f as TaskRunErrorCodes, p as TaskRunExecution, j as TaskRunExecutionAttempt, o as TaskRunExecutionBatch, k as TaskRunExecutionEnvironment, l as TaskRunExecutionOrganization, m as TaskRunExecutionProject, n as TaskRunExecutionQueue, q as TaskRunExecutionRetry, i as TaskRunExecutionTask, r as TaskRunFailedExecutionResult, g as TaskRunInternalError, e as TaskRunStringError, s as TaskRunSuccessfulExecutionResult } from '../manager-WNMVbgHf.mjs';
4
- import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-Bh7P1hZc.mjs';
5
- export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-Bh7P1hZc.mjs';
4
+ import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-ck7x04PV.mjs';
5
+ export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-ck7x04PV.mjs';
6
6
  import { Attributes, Span } from '@opentelemetry/api';
7
7
  import { B as BackgroundWorkerProperties } from '../messages-vq7Bk4Ap.mjs';
8
8
  export { b as BackgroundWorkerClientMessages, a as BackgroundWorkerServerMessages, i as ClientToSharedQueueMessages, C as CoordinatorToPlatformMessages, k as CoordinatorToProdWorkerMessages, h as PlatformToCoordinatorMessages, g as PlatformToProviderMessages, P as ProdChildToWorkerMessages, l as ProdWorkerSocketData, e as ProdWorkerToChildMessages, j as ProdWorkerToCoordinatorMessages, f as ProviderToPlatformMessages, S as SharedQueueToClientMessages, T as TaskMetadataFailedToParseData, U as UncaughtExceptionMessage, d as childToWorkerMessages, c as clientWebsocketMessages, s as serverWebsocketMessages, w as workerToChildMessages } from '../messages-vq7Bk4Ap.mjs';
@@ -4186,19 +4186,6 @@ declare class ApiClient {
4186
4186
  id: string;
4187
4187
  }>;
4188
4188
  }
4189
- type ApiClientContext = {
4190
- baseURL: string;
4191
- accessToken: string;
4192
- };
4193
- declare class ApiClientManager {
4194
- #private;
4195
- private _storage;
4196
- get baseURL(): string | undefined;
4197
- get accessToken(): string | undefined;
4198
- get client(): ApiClient | undefined;
4199
- runWith<R extends (...args: any[]) => Promise<any>>(context: ApiClientContext, fn: R): Promise<ReturnType<R>>;
4200
- }
4201
- declare const apiClientManager: ApiClientManager;
4202
4189
 
4203
4190
  type APIHeaders = Record<string, string | null | undefined>;
4204
4191
  declare class APIError extends Error {
@@ -4346,6 +4333,26 @@ declare class TaskContextAPI {
4346
4333
  /** Entrypoint for logger API */
4347
4334
  declare const taskContext: TaskContextAPI;
4348
4335
 
4336
+ type ApiClientConfiguration = {
4337
+ baseURL?: string;
4338
+ secretKey?: string;
4339
+ };
4340
+
4341
+ declare class APIClientManagerAPI {
4342
+ #private;
4343
+ private static _instance?;
4344
+ private constructor();
4345
+ static getInstance(): APIClientManagerAPI;
4346
+ disable(): void;
4347
+ setGlobalAPIClientConfiguration(config: ApiClientConfiguration): boolean;
4348
+ get baseURL(): string | undefined;
4349
+ get accessToken(): string | undefined;
4350
+ get client(): ApiClient | undefined;
4351
+ }
4352
+
4353
+ /** Entrypoint for logger API */
4354
+ declare const apiClientManager: APIClientManagerAPI;
4355
+
4349
4356
  declare const SemanticInternalAttributes: {
4350
4357
  ENVIRONMENT_ID: string;
4351
4358
  ENVIRONMENT_TYPE: string;
@@ -4492,4 +4499,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4492
4499
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4493
4500
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4494
4501
 
4495
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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 };
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 };
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunError, b as TaskRunContext, R as RuntimeManager } from '../manager-WNMVbgHf.js';
3
3
  export { h as TaskRun, c as TaskRunBuiltInError, d as TaskRunCustomErrorObject, f as TaskRunErrorCodes, p as TaskRunExecution, j as TaskRunExecutionAttempt, o as TaskRunExecutionBatch, k as TaskRunExecutionEnvironment, l as TaskRunExecutionOrganization, m as TaskRunExecutionProject, n as TaskRunExecutionQueue, q as TaskRunExecutionRetry, i as TaskRunExecutionTask, r as TaskRunFailedExecutionResult, g as TaskRunInternalError, e as TaskRunStringError, s as TaskRunSuccessfulExecutionResult } from '../manager-WNMVbgHf.js';
4
- import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-akmn1vqt.js';
5
- export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-akmn1vqt.js';
4
+ import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-KbyTBoap.js';
5
+ export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-KbyTBoap.js';
6
6
  import { Attributes, Span } from '@opentelemetry/api';
7
7
  import { B as BackgroundWorkerProperties } from '../messages-vq7Bk4Ap.js';
8
8
  export { b as BackgroundWorkerClientMessages, a as BackgroundWorkerServerMessages, i as ClientToSharedQueueMessages, C as CoordinatorToPlatformMessages, k as CoordinatorToProdWorkerMessages, h as PlatformToCoordinatorMessages, g as PlatformToProviderMessages, P as ProdChildToWorkerMessages, l as ProdWorkerSocketData, e as ProdWorkerToChildMessages, j as ProdWorkerToCoordinatorMessages, f as ProviderToPlatformMessages, S as SharedQueueToClientMessages, T as TaskMetadataFailedToParseData, U as UncaughtExceptionMessage, d as childToWorkerMessages, c as clientWebsocketMessages, s as serverWebsocketMessages, w as workerToChildMessages } from '../messages-vq7Bk4Ap.js';
@@ -4186,19 +4186,6 @@ declare class ApiClient {
4186
4186
  id: string;
4187
4187
  }>;
4188
4188
  }
4189
- type ApiClientContext = {
4190
- baseURL: string;
4191
- accessToken: string;
4192
- };
4193
- declare class ApiClientManager {
4194
- #private;
4195
- private _storage;
4196
- get baseURL(): string | undefined;
4197
- get accessToken(): string | undefined;
4198
- get client(): ApiClient | undefined;
4199
- runWith<R extends (...args: any[]) => Promise<any>>(context: ApiClientContext, fn: R): Promise<ReturnType<R>>;
4200
- }
4201
- declare const apiClientManager: ApiClientManager;
4202
4189
 
4203
4190
  type APIHeaders = Record<string, string | null | undefined>;
4204
4191
  declare class APIError extends Error {
@@ -4346,6 +4333,26 @@ declare class TaskContextAPI {
4346
4333
  /** Entrypoint for logger API */
4347
4334
  declare const taskContext: TaskContextAPI;
4348
4335
 
4336
+ type ApiClientConfiguration = {
4337
+ baseURL?: string;
4338
+ secretKey?: string;
4339
+ };
4340
+
4341
+ declare class APIClientManagerAPI {
4342
+ #private;
4343
+ private static _instance?;
4344
+ private constructor();
4345
+ static getInstance(): APIClientManagerAPI;
4346
+ disable(): void;
4347
+ setGlobalAPIClientConfiguration(config: ApiClientConfiguration): boolean;
4348
+ get baseURL(): string | undefined;
4349
+ get accessToken(): string | undefined;
4350
+ get client(): ApiClient | undefined;
4351
+ }
4352
+
4353
+ /** Entrypoint for logger API */
4354
+ declare const apiClientManager: APIClientManagerAPI;
4355
+
4349
4356
  declare const SemanticInternalAttributes: {
4350
4357
  ENVIRONMENT_ID: string;
4351
4358
  ENVIRONMENT_TYPE: string;
@@ -4492,4 +4499,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4492
4499
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4493
4500
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4494
4501
 
4495
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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 };
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 };
package/dist/v3/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var api = require('@opentelemetry/api');
4
4
  var zodValidationError = require('zod-validation-error');
5
5
  var zod = require('zod');
6
- var async_hooks = require('async_hooks');
7
6
  var preciseDate = require('@google-cloud/precise-date');
8
7
  var apiLogs = require('@opentelemetry/api-logs');
9
8
  var humanizeDuration = require('humanize-duration');
@@ -2106,27 +2105,6 @@ var TaskContextAPI = _TaskContextAPI;
2106
2105
  // src/v3/task-context-api.ts
2107
2106
  var taskContext = TaskContextAPI.getInstance();
2108
2107
 
2109
- // src/v3/utils/getEnv.ts
2110
- function getEnvVar(name) {
2111
- if (typeof process !== "undefined" && typeof process.env === "object" && process.env !== null) {
2112
- return process.env[name];
2113
- }
2114
- }
2115
- __name(getEnvVar, "getEnvVar");
2116
- var _SafeAsyncLocalStorage = class _SafeAsyncLocalStorage {
2117
- constructor() {
2118
- this.storage = new async_hooks.AsyncLocalStorage();
2119
- }
2120
- runWith(context3, fn) {
2121
- return this.storage.run(context3, fn);
2122
- }
2123
- getStore() {
2124
- return this.storage.getStore();
2125
- }
2126
- };
2127
- __name(_SafeAsyncLocalStorage, "SafeAsyncLocalStorage");
2128
- var SafeAsyncLocalStorage = _SafeAsyncLocalStorage;
2129
-
2130
2108
  // src/v3/apiClient/index.ts
2131
2109
  var zodFetchOptions = {
2132
2110
  retry: {
@@ -2277,37 +2255,6 @@ getHeaders_fn = /* @__PURE__ */ __name(function(spanParentAsLink) {
2277
2255
  }, "#getHeaders");
2278
2256
  __name(_ApiClient, "ApiClient");
2279
2257
  var ApiClient = _ApiClient;
2280
- var _getStore, getStore_fn;
2281
- var _ApiClientManager = class _ApiClientManager {
2282
- constructor() {
2283
- __privateAdd(this, _getStore);
2284
- __publicField(this, "_storage", new SafeAsyncLocalStorage());
2285
- }
2286
- get baseURL() {
2287
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
2288
- return store?.baseURL ?? getEnvVar("TRIGGER_API_URL") ?? "https://api.trigger.dev";
2289
- }
2290
- get accessToken() {
2291
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
2292
- return store?.accessToken ?? getEnvVar("TRIGGER_SECRET_KEY");
2293
- }
2294
- get client() {
2295
- if (!this.baseURL || !this.accessToken) {
2296
- return void 0;
2297
- }
2298
- return new ApiClient(this.baseURL, this.accessToken);
2299
- }
2300
- runWith(context3, fn) {
2301
- return this._storage.runWith(context3, fn);
2302
- }
2303
- };
2304
- _getStore = new WeakSet();
2305
- getStore_fn = /* @__PURE__ */ __name(function() {
2306
- return this._storage.getStore();
2307
- }, "#getStore");
2308
- __name(_ApiClientManager, "ApiClientManager");
2309
- var ApiClientManager = _ApiClientManager;
2310
- var apiClientManager = new ApiClientManager();
2311
2258
  var _SimpleClock = class _SimpleClock {
2312
2259
  preciseNow() {
2313
2260
  const now = new preciseDate.PreciseDate();
@@ -2775,6 +2722,58 @@ var RuntimeAPI = _RuntimeAPI;
2775
2722
  // src/v3/runtime-api.ts
2776
2723
  var runtime = RuntimeAPI.getInstance();
2777
2724
 
2725
+ // src/v3/utils/getEnv.ts
2726
+ function getEnvVar(name) {
2727
+ if (typeof process !== "undefined" && typeof process.env === "object" && process.env !== null) {
2728
+ return process.env[name];
2729
+ }
2730
+ }
2731
+ __name(getEnvVar, "getEnvVar");
2732
+
2733
+ // src/v3/apiClientManager/index.ts
2734
+ var API_NAME5 = "api-client";
2735
+ var _getConfig, getConfig_fn;
2736
+ var _APIClientManagerAPI = class _APIClientManagerAPI {
2737
+ constructor() {
2738
+ __privateAdd(this, _getConfig);
2739
+ }
2740
+ static getInstance() {
2741
+ if (!this._instance) {
2742
+ this._instance = new _APIClientManagerAPI();
2743
+ }
2744
+ return this._instance;
2745
+ }
2746
+ disable() {
2747
+ unregisterGlobal(API_NAME5);
2748
+ }
2749
+ setGlobalAPIClientConfiguration(config) {
2750
+ return registerGlobal(API_NAME5, config);
2751
+ }
2752
+ get baseURL() {
2753
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
2754
+ return store?.baseURL ?? getEnvVar("TRIGGER_API_URL") ?? "https://api.trigger.dev";
2755
+ }
2756
+ get accessToken() {
2757
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
2758
+ return store?.secretKey ?? getEnvVar("TRIGGER_SECRET_KEY");
2759
+ }
2760
+ get client() {
2761
+ if (!this.baseURL || !this.accessToken) {
2762
+ return void 0;
2763
+ }
2764
+ return new ApiClient(this.baseURL, this.accessToken);
2765
+ }
2766
+ };
2767
+ _getConfig = new WeakSet();
2768
+ getConfig_fn = /* @__PURE__ */ __name(function() {
2769
+ return getGlobal(API_NAME5);
2770
+ }, "#getConfig");
2771
+ __name(_APIClientManagerAPI, "APIClientManagerAPI");
2772
+ var APIClientManagerAPI = _APIClientManagerAPI;
2773
+
2774
+ // src/v3/apiClientManager-api.ts
2775
+ var apiClientManager = APIClientManagerAPI.getInstance();
2776
+
2778
2777
  // src/v3/task-catalog/noopTaskCatalog.ts
2779
2778
  var _NoopTaskCatalog = class _NoopTaskCatalog {
2780
2779
  registerTaskMetadata(task) {
@@ -2802,7 +2801,7 @@ __name(_NoopTaskCatalog, "NoopTaskCatalog");
2802
2801
  var NoopTaskCatalog = _NoopTaskCatalog;
2803
2802
 
2804
2803
  // src/v3/task-catalog/index.ts
2805
- var API_NAME5 = "task-catalog";
2804
+ var API_NAME6 = "task-catalog";
2806
2805
  var NOOP_TASK_CATALOG = new NoopTaskCatalog();
2807
2806
  var _getCatalog, getCatalog_fn;
2808
2807
  var _TaskCatalogAPI = class _TaskCatalogAPI {
@@ -2816,10 +2815,10 @@ var _TaskCatalogAPI = class _TaskCatalogAPI {
2816
2815
  return this._instance;
2817
2816
  }
2818
2817
  setGlobalTaskCatalog(taskCatalog2) {
2819
- return registerGlobal(API_NAME5, taskCatalog2);
2818
+ return registerGlobal(API_NAME6, taskCatalog2);
2820
2819
  }
2821
2820
  disable() {
2822
- unregisterGlobal(API_NAME5);
2821
+ unregisterGlobal(API_NAME6);
2823
2822
  }
2824
2823
  registerTaskMetadata(task) {
2825
2824
  __privateMethod(this, _getCatalog, getCatalog_fn).call(this).registerTaskMetadata(task);
@@ -2845,7 +2844,7 @@ var _TaskCatalogAPI = class _TaskCatalogAPI {
2845
2844
  };
2846
2845
  _getCatalog = new WeakSet();
2847
2846
  getCatalog_fn = /* @__PURE__ */ __name(function() {
2848
- return getGlobal(API_NAME5) ?? NOOP_TASK_CATALOG;
2847
+ return getGlobal(API_NAME6) ?? NOOP_TASK_CATALOG;
2849
2848
  }, "#getCatalog");
2850
2849
  __name(_TaskCatalogAPI, "TaskCatalogAPI");
2851
2850
  var TaskCatalogAPI = _TaskCatalogAPI;
@@ -3474,7 +3473,6 @@ __name(safeJsonParse2, "safeJsonParse");
3474
3473
  exports.APIConnectionError = APIConnectionError;
3475
3474
  exports.APIError = APIError;
3476
3475
  exports.ApiClient = ApiClient;
3477
- exports.ApiClientManager = ApiClientManager;
3478
3476
  exports.AttemptStatus = AttemptStatus;
3479
3477
  exports.AuthenticationError = AuthenticationError;
3480
3478
  exports.BackgroundWorkerClientMessages = BackgroundWorkerClientMessages;