@trigger.dev/core 3.0.0-beta.24 → 3.0.0-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{catalog-Eta7Xel2.d.ts → catalog-XNyNDUOF.d.ts} +9 -0
- package/dist/{catalog-28mBcCbl.d.mts → catalog-g2Qc0Ukb.d.mts} +9 -0
- package/dist/v3/index.d.mts +5 -4
- package/dist/v3/index.d.ts +5 -4
- package/dist/v3/index.js +53 -25
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/index.mjs +53 -26
- package/dist/v3/index.mjs.map +1 -1
- package/dist/v3/otel/index.js +14 -3
- package/dist/v3/otel/index.js.map +1 -1
- package/dist/v3/otel/index.mjs +14 -3
- package/dist/v3/otel/index.mjs.map +1 -1
- package/dist/v3/workers/index.d.mts +2 -2
- package/dist/v3/workers/index.d.ts +2 -2
- package/dist/v3/workers/index.js +19 -6
- package/dist/v3/workers/index.js.map +1 -1
- package/dist/v3/workers/index.mjs +19 -6
- package/dist/v3/workers/index.mjs.map +1 -1
- package/dist/v3/zodMessageHandler.d.mts +1 -1
- package/dist/v3/zodMessageHandler.d.ts +1 -1
- package/package.json +1 -1
|
@@ -115,6 +115,12 @@ interface ProjectConfig {
|
|
|
115
115
|
* onStart is called the first time a task is executed in a run (not before every retry)
|
|
116
116
|
*/
|
|
117
117
|
onStart?: (payload: unknown, params: StartFnParams) => Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* postInstall will run during the deploy build step, after all the dependencies have been installed.
|
|
120
|
+
*
|
|
121
|
+
* @example "prisma generate"
|
|
122
|
+
*/
|
|
123
|
+
postInstall?: string;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
type InitOutput = Record<string, any> | void | undefined;
|
|
@@ -2420,6 +2426,7 @@ declare const Config: z.ZodObject<{
|
|
|
2420
2426
|
dependenciesToBundle: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
|
|
2421
2427
|
logLevel: z.ZodOptional<z.ZodString>;
|
|
2422
2428
|
enableConsoleLogging: z.ZodOptional<z.ZodBoolean>;
|
|
2429
|
+
postInstall: z.ZodOptional<z.ZodString>;
|
|
2423
2430
|
}, "strip", z.ZodTypeAny, {
|
|
2424
2431
|
project: string;
|
|
2425
2432
|
triggerDirectories?: string[] | undefined;
|
|
@@ -2441,6 +2448,7 @@ declare const Config: z.ZodObject<{
|
|
|
2441
2448
|
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2442
2449
|
logLevel?: string | undefined;
|
|
2443
2450
|
enableConsoleLogging?: boolean | undefined;
|
|
2451
|
+
postInstall?: string | undefined;
|
|
2444
2452
|
}, {
|
|
2445
2453
|
project: string;
|
|
2446
2454
|
triggerDirectories?: string[] | undefined;
|
|
@@ -2462,6 +2470,7 @@ declare const Config: z.ZodObject<{
|
|
|
2462
2470
|
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2463
2471
|
logLevel?: string | undefined;
|
|
2464
2472
|
enableConsoleLogging?: boolean | undefined;
|
|
2473
|
+
postInstall?: string | undefined;
|
|
2465
2474
|
}>;
|
|
2466
2475
|
type Config = z.infer<typeof Config>;
|
|
2467
2476
|
type ResolvedConfig = RequireKeys<Config, "triggerDirectories" | "triggerUrl" | "projectDir" | "tsconfigPath">;
|
|
@@ -115,6 +115,12 @@ interface ProjectConfig {
|
|
|
115
115
|
* onStart is called the first time a task is executed in a run (not before every retry)
|
|
116
116
|
*/
|
|
117
117
|
onStart?: (payload: unknown, params: StartFnParams) => Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* postInstall will run during the deploy build step, after all the dependencies have been installed.
|
|
120
|
+
*
|
|
121
|
+
* @example "prisma generate"
|
|
122
|
+
*/
|
|
123
|
+
postInstall?: string;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
type InitOutput = Record<string, any> | void | undefined;
|
|
@@ -2420,6 +2426,7 @@ declare const Config: z.ZodObject<{
|
|
|
2420
2426
|
dependenciesToBundle: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">>;
|
|
2421
2427
|
logLevel: z.ZodOptional<z.ZodString>;
|
|
2422
2428
|
enableConsoleLogging: z.ZodOptional<z.ZodBoolean>;
|
|
2429
|
+
postInstall: z.ZodOptional<z.ZodString>;
|
|
2423
2430
|
}, "strip", z.ZodTypeAny, {
|
|
2424
2431
|
project: string;
|
|
2425
2432
|
triggerDirectories?: string[] | undefined;
|
|
@@ -2441,6 +2448,7 @@ declare const Config: z.ZodObject<{
|
|
|
2441
2448
|
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2442
2449
|
logLevel?: string | undefined;
|
|
2443
2450
|
enableConsoleLogging?: boolean | undefined;
|
|
2451
|
+
postInstall?: string | undefined;
|
|
2444
2452
|
}, {
|
|
2445
2453
|
project: string;
|
|
2446
2454
|
triggerDirectories?: string[] | undefined;
|
|
@@ -2462,6 +2470,7 @@ declare const Config: z.ZodObject<{
|
|
|
2462
2470
|
dependenciesToBundle?: (string | RegExp)[] | undefined;
|
|
2463
2471
|
logLevel?: string | undefined;
|
|
2464
2472
|
enableConsoleLogging?: boolean | undefined;
|
|
2473
|
+
postInstall?: string | undefined;
|
|
2465
2474
|
}>;
|
|
2466
2475
|
type Config = z.infer<typeof Config>;
|
|
2467
2476
|
type ResolvedConfig = RequireKeys<Config, "triggerDirectories" | "triggerUrl" | "projectDir" | "tsconfigPath">;
|
package/dist/v3/index.d.mts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-g2Qc0Ukb.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-g2Qc0Ukb.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';
|
|
@@ -4338,8 +4338,9 @@ declare function formatDurationNanoseconds(nanoseconds: number, options?: Durati
|
|
|
4338
4338
|
declare function formatDurationMilliseconds(milliseconds: number, options?: DurationOptions): string;
|
|
4339
4339
|
declare function formatDurationInDays(milliseconds: number): string;
|
|
4340
4340
|
|
|
4341
|
+
declare const NULL_SENTINEL = "$@null((";
|
|
4341
4342
|
declare function flattenAttributes(obj: Record<string, unknown> | Array<unknown> | string | boolean | number | null | undefined, prefix?: string): Attributes;
|
|
4342
|
-
declare function unflattenAttributes(obj: Attributes): Record<string, unknown
|
|
4343
|
+
declare function unflattenAttributes(obj: Attributes): Record<string, unknown> | string | number | boolean | null | undefined;
|
|
4343
4344
|
declare function primitiveValueOrflattenedAttributes(obj: Record<string, unknown> | Array<unknown> | string | boolean | number | undefined, prefix: string | undefined): Attributes | string | number | boolean | undefined;
|
|
4344
4345
|
|
|
4345
4346
|
declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
|
|
@@ -4406,4 +4407,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
|
|
|
4406
4407
|
declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
|
|
4407
4408
|
declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
|
|
4408
4409
|
|
|
4409
|
-
export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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, 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, RetryOptions, 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 };
|
|
4410
|
+
export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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, RetryOptions, 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.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-XNyNDUOF.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-XNyNDUOF.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';
|
|
@@ -4338,8 +4338,9 @@ declare function formatDurationNanoseconds(nanoseconds: number, options?: Durati
|
|
|
4338
4338
|
declare function formatDurationMilliseconds(milliseconds: number, options?: DurationOptions): string;
|
|
4339
4339
|
declare function formatDurationInDays(milliseconds: number): string;
|
|
4340
4340
|
|
|
4341
|
+
declare const NULL_SENTINEL = "$@null((";
|
|
4341
4342
|
declare function flattenAttributes(obj: Record<string, unknown> | Array<unknown> | string | boolean | number | null | undefined, prefix?: string): Attributes;
|
|
4342
|
-
declare function unflattenAttributes(obj: Attributes): Record<string, unknown
|
|
4343
|
+
declare function unflattenAttributes(obj: Attributes): Record<string, unknown> | string | number | boolean | null | undefined;
|
|
4343
4344
|
declare function primitiveValueOrflattenedAttributes(obj: Record<string, unknown> | Array<unknown> | string | boolean | number | undefined, prefix: string | undefined): Attributes | string | number | boolean | undefined;
|
|
4344
4345
|
|
|
4345
4346
|
declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
|
|
@@ -4406,4 +4407,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
|
|
|
4406
4407
|
declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
|
|
4407
4408
|
declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
|
|
4408
4409
|
|
|
4409
|
-
export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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, 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, RetryOptions, 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 };
|
|
4410
|
+
export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, 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, RetryOptions, 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
|
@@ -759,7 +759,8 @@ var Config = zod.z.object({
|
|
|
759
759
|
RegexSchema
|
|
760
760
|
])).optional(),
|
|
761
761
|
logLevel: zod.z.string().optional(),
|
|
762
|
-
enableConsoleLogging: zod.z.boolean().optional()
|
|
762
|
+
enableConsoleLogging: zod.z.boolean().optional(),
|
|
763
|
+
postInstall: zod.z.string().optional()
|
|
763
764
|
});
|
|
764
765
|
var WaitReason = zod.z.enum([
|
|
765
766
|
"WAIT_FOR_DURATION",
|
|
@@ -2474,9 +2475,14 @@ function calculateAttributeValueLength(value) {
|
|
|
2474
2475
|
__name(calculateAttributeValueLength, "calculateAttributeValueLength");
|
|
2475
2476
|
|
|
2476
2477
|
// src/v3/utils/flattenAttributes.ts
|
|
2478
|
+
var NULL_SENTINEL = "$@null((";
|
|
2477
2479
|
function flattenAttributes(obj, prefix) {
|
|
2478
2480
|
const result = {};
|
|
2479
|
-
if (
|
|
2481
|
+
if (obj === void 0) {
|
|
2482
|
+
return result;
|
|
2483
|
+
}
|
|
2484
|
+
if (obj === null) {
|
|
2485
|
+
result[prefix || ""] = NULL_SENTINEL;
|
|
2480
2486
|
return result;
|
|
2481
2487
|
}
|
|
2482
2488
|
if (typeof obj === "string") {
|
|
@@ -2492,13 +2498,17 @@ function flattenAttributes(obj, prefix) {
|
|
|
2492
2498
|
return result;
|
|
2493
2499
|
}
|
|
2494
2500
|
for (const [key, value] of Object.entries(obj)) {
|
|
2495
|
-
const newPrefix = `${prefix ? `${prefix}.` : ""}${key}`;
|
|
2501
|
+
const newPrefix = `${prefix ? `${prefix}.` : ""}${Array.isArray(obj) ? `[${key}]` : key}`;
|
|
2496
2502
|
if (Array.isArray(value)) {
|
|
2497
2503
|
for (let i = 0; i < value.length; i++) {
|
|
2498
2504
|
if (typeof value[i] === "object" && value[i] !== null) {
|
|
2499
2505
|
Object.assign(result, flattenAttributes(value[i], `${newPrefix}.[${i}]`));
|
|
2500
2506
|
} else {
|
|
2501
|
-
|
|
2507
|
+
if (value[i] === null) {
|
|
2508
|
+
result[`${newPrefix}.[${i}]`] = NULL_SENTINEL;
|
|
2509
|
+
} else {
|
|
2510
|
+
result[`${newPrefix}.[${i}]`] = value[i];
|
|
2511
|
+
}
|
|
2502
2512
|
}
|
|
2503
2513
|
}
|
|
2504
2514
|
} else if (isRecord(value)) {
|
|
@@ -2506,6 +2516,8 @@ function flattenAttributes(obj, prefix) {
|
|
|
2506
2516
|
} else {
|
|
2507
2517
|
if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
|
|
2508
2518
|
result[newPrefix] = value;
|
|
2519
|
+
} else if (value === null) {
|
|
2520
|
+
result[newPrefix] = NULL_SENTINEL;
|
|
2509
2521
|
}
|
|
2510
2522
|
}
|
|
2511
2523
|
}
|
|
@@ -2520,42 +2532,49 @@ function unflattenAttributes(obj) {
|
|
|
2520
2532
|
if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
|
|
2521
2533
|
return obj;
|
|
2522
2534
|
}
|
|
2535
|
+
if (typeof obj === "object" && obj !== null && Object.keys(obj).length === 1 && Object.keys(obj)[0] === "") {
|
|
2536
|
+
return rehydrateNull(obj[""]);
|
|
2537
|
+
}
|
|
2538
|
+
if (Object.keys(obj).length === 0) {
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2523
2541
|
const result = {};
|
|
2524
2542
|
for (const [key, value] of Object.entries(obj)) {
|
|
2525
2543
|
const parts = key.split(".").reduce((acc, part) => {
|
|
2526
|
-
if (
|
|
2527
|
-
|
|
2544
|
+
if (part.includes("[")) {
|
|
2545
|
+
const subparts = part.split(/\[|\]/).filter((p) => p !== "");
|
|
2546
|
+
acc.push(...subparts);
|
|
2528
2547
|
} else {
|
|
2529
|
-
acc.push(
|
|
2548
|
+
acc.push(part);
|
|
2530
2549
|
}
|
|
2531
2550
|
return acc;
|
|
2532
2551
|
}, []);
|
|
2533
2552
|
let current = result;
|
|
2534
2553
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
2535
2554
|
const part = parts[i];
|
|
2536
|
-
const
|
|
2537
|
-
const
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2555
|
+
const nextPart = parts[i + 1];
|
|
2556
|
+
const isArray = /^\d+$/.test(nextPart);
|
|
2557
|
+
if (isArray && !Array.isArray(current[part])) {
|
|
2558
|
+
current[part] = [];
|
|
2559
|
+
} else if (!isArray && current[part] === void 0) {
|
|
2560
|
+
current[part] = {};
|
|
2541
2561
|
}
|
|
2542
|
-
current = current[
|
|
2562
|
+
current = current[part];
|
|
2543
2563
|
}
|
|
2544
2564
|
const lastPart = parts[parts.length - 1];
|
|
2545
|
-
|
|
2546
|
-
|
|
2565
|
+
current[lastPart] = rehydrateNull(value);
|
|
2566
|
+
}
|
|
2567
|
+
if (Object.keys(result).every((k) => /^\d+$/.test(k))) {
|
|
2568
|
+
const maxIndex = Math.max(...Object.keys(result).map((k) => parseInt(k)));
|
|
2569
|
+
const arrayResult = Array(maxIndex + 1);
|
|
2570
|
+
for (const key in result) {
|
|
2571
|
+
arrayResult[parseInt(key)] = result[key];
|
|
2572
|
+
}
|
|
2573
|
+
return arrayResult;
|
|
2547
2574
|
}
|
|
2548
2575
|
return result;
|
|
2549
2576
|
}
|
|
2550
2577
|
__name(unflattenAttributes, "unflattenAttributes");
|
|
2551
|
-
function detectIsArrayIndex(key) {
|
|
2552
|
-
const match = key.match(/^\[(\d+)\]$/);
|
|
2553
|
-
if (match) {
|
|
2554
|
-
return true;
|
|
2555
|
-
}
|
|
2556
|
-
return false;
|
|
2557
|
-
}
|
|
2558
|
-
__name(detectIsArrayIndex, "detectIsArrayIndex");
|
|
2559
2578
|
function primitiveValueOrflattenedAttributes(obj, prefix) {
|
|
2560
2579
|
if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean" || obj === null || obj === void 0) {
|
|
2561
2580
|
return obj;
|
|
@@ -2567,6 +2586,13 @@ function primitiveValueOrflattenedAttributes(obj, prefix) {
|
|
|
2567
2586
|
return attributes;
|
|
2568
2587
|
}
|
|
2569
2588
|
__name(primitiveValueOrflattenedAttributes, "primitiveValueOrflattenedAttributes");
|
|
2589
|
+
function rehydrateNull(value) {
|
|
2590
|
+
if (value === NULL_SENTINEL) {
|
|
2591
|
+
return null;
|
|
2592
|
+
}
|
|
2593
|
+
return value;
|
|
2594
|
+
}
|
|
2595
|
+
__name(rehydrateNull, "rehydrateNull");
|
|
2570
2596
|
|
|
2571
2597
|
// src/v3/logger/taskLogger.ts
|
|
2572
2598
|
var _NoopTaskLogger = class _NoopTaskLogger {
|
|
@@ -3295,11 +3321,12 @@ async function createPacketAttributes(packet, dataKey, dataTypeKey) {
|
|
|
3295
3321
|
try {
|
|
3296
3322
|
const parsed = parse(packet.data);
|
|
3297
3323
|
const jsonified = JSON.parse(JSON.stringify(parsed, safeReplacer));
|
|
3298
|
-
|
|
3324
|
+
const result = {
|
|
3299
3325
|
...flattenAttributes(jsonified, dataKey),
|
|
3300
3326
|
[dataTypeKey]: "application/json"
|
|
3301
3327
|
};
|
|
3302
|
-
|
|
3328
|
+
return result;
|
|
3329
|
+
} catch (e) {
|
|
3303
3330
|
return;
|
|
3304
3331
|
}
|
|
3305
3332
|
case "application/store":
|
|
@@ -3461,6 +3488,7 @@ exports.ListSchedulesResult = ListSchedulesResult;
|
|
|
3461
3488
|
exports.Machine = Machine;
|
|
3462
3489
|
exports.MachineCpu = MachineCpu;
|
|
3463
3490
|
exports.MachineMemory = MachineMemory;
|
|
3491
|
+
exports.NULL_SENTINEL = NULL_SENTINEL;
|
|
3464
3492
|
exports.NotFoundError = NotFoundError;
|
|
3465
3493
|
exports.OFFLOAD_IO_PACKET_LENGTH_LIMIT = OFFLOAD_IO_PACKET_LENGTH_LIMIT;
|
|
3466
3494
|
exports.OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT;
|