@trigger.dev/core 0.0.0-prerelease-20240718194312 → 0.0.0-prerelease-20240723165848

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.
@@ -1,8 +1,8 @@
1
- import * as zod from 'zod';
2
1
  import { CursorPageParams, ApiRequestOptions, ZodFetchOptions, ApiPromise, CursorPagePromise, OffsetLimitPagePromise } from './zodfetch.mjs';
3
2
  export { APIHeaders, ApiConnectionError, ApiError, AuthenticationError, BadRequestError, ConflictError, CursorPage, CursorPageResponse, InternalServerError, NotFoundError, OffsetLimitPage, OffsetLimitPageParams, OffsetLimitPageResponse, Page, PageResponse, PermissionDeniedError, RateLimitError, UnprocessableEntityError, isRequestOptions } from './zodfetch.mjs';
4
- import { RunStatus, TriggerTaskRequestBody, BatchTriggerTaskRequestBody, ListRunResponseItem, RescheduleRunRequestBody, CreateScheduleOptions, ListScheduleOptions, UpdateScheduleOptions, CreateEnvironmentVariableRequestBody, UpdateEnvironmentVariableRequestBody, Accessory } from './schemas/index.mjs';
5
- export { AttemptStatus, BackgroundWorkerMetadata, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, ListRunResponse, ListSchedulesResult, OtherSpanEvent, PRIMARY_VARIANT, ReplayRunResponse, RetrieveRunResponse, RunEnvironmentDetails, RunScheduleDetails, ScheduleGenerator, ScheduleObject, ScheduleType, ScheduledTaskPayload, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskResource, TimezonesResult, TriggerTaskResponse, Variant, WhoAmIResponse, WhoAmIResponseSchema, isCancellationSpanEvent, isExceptionSpanEvent, stringPatternMatchers } from './schemas/index.mjs';
3
+ import { z } from 'zod';
4
+ import { RunStatus, TriggerTaskRequestBody, BatchTriggerTaskRequestBody, ListRunResponseItem, RescheduleRunRequestBody, AddTagsRequestBody, CreateScheduleOptions, ListScheduleOptions, UpdateScheduleOptions, CreateEnvironmentVariableRequestBody, UpdateEnvironmentVariableRequestBody, Accessory } from './schemas/index.mjs';
5
+ export { AttemptStatus, BackgroundWorkerMetadata, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, ListRunResponse, ListSchedulesResult, OtherSpanEvent, PRIMARY_VARIANT, ReplayRunResponse, RetrieveRunResponse, RunEnvironmentDetails, RunScheduleDetails, RunTags, ScheduleGenerator, ScheduleObject, ScheduleType, ScheduledTaskPayload, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskResource, TimezonesResult, TriggerTaskResponse, Variant, WhoAmIResponse, WhoAmIResponseSchema, isCancellationSpanEvent, isExceptionSpanEvent, stringPatternMatchers } from './schemas/index.mjs';
6
6
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunContext } from '../common-CLW82lkt.mjs';
7
7
  export { f as MachineConfig, d as MachineCpu, e as MachineMemory, g as MachinePreset, M as MachinePresetName, m as TaskRun, h as TaskRunBuiltInError, i as TaskRunCustomErrorObject, b as TaskRunError, k as TaskRunErrorCodes, c as TaskRunExecution, o as TaskRunExecutionAttempt, t as TaskRunExecutionBatch, p as TaskRunExecutionEnvironment, q as TaskRunExecutionOrganization, r as TaskRunExecutionProject, s as TaskRunExecutionQueue, u as TaskRunExecutionRetry, n as TaskRunExecutionTask, v as TaskRunExecutionUsage, w as TaskRunFailedExecutionResult, l as TaskRunInternalError, j as TaskRunStringError, x as TaskRunSuccessfulExecutionResult } from '../common-CLW82lkt.mjs';
8
8
  import { C as Clock, a as ClockTime, b as TaskCatalog, T as TaskMetadataWithFunctions } from '../catalog-H7yFiZ60.mjs';
@@ -53,6 +53,7 @@ interface ListRunsQueryParams extends CursorPageParams {
53
53
  to?: Date | number;
54
54
  period?: string;
55
55
  bulkAction?: string;
56
+ tag?: Array<string> | string;
56
57
  schedule?: string;
57
58
  isTest?: boolean;
58
59
  }
@@ -91,8 +92,12 @@ declare class ApiClient {
91
92
  retrieveRun(runId: string, requestOptions?: ZodFetchOptions): ApiPromise<{
92
93
  status: "COMPLETED" | "CANCELED" | "QUEUED" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
93
94
  id: string;
95
+ tags: string[];
94
96
  isTest: boolean;
95
97
  createdAt: Date;
98
+ durationMs: number;
99
+ costInCents: number;
100
+ baseCostInCents: number;
96
101
  attempts: ({
97
102
  status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
98
103
  id: string;
@@ -147,8 +152,12 @@ declare class ApiClient {
147
152
  rescheduleRun(runId: string, body: RescheduleRunRequestBody, requestOptions?: ZodFetchOptions): ApiPromise<{
148
153
  status: "COMPLETED" | "CANCELED" | "QUEUED" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
149
154
  id: string;
155
+ tags: string[];
150
156
  isTest: boolean;
151
157
  createdAt: Date;
158
+ durationMs: number;
159
+ costInCents: number;
160
+ baseCostInCents: number;
152
161
  attempts: ({
153
162
  status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
154
163
  id: string;
@@ -192,6 +201,9 @@ declare class ApiClient {
192
201
  ttl?: string | undefined;
193
202
  expiredAt?: Date | undefined;
194
203
  }>;
204
+ addTags(runId: string, body: AddTagsRequestBody, requestOptions?: ZodFetchOptions): ApiPromise<{
205
+ message: string;
206
+ }>;
195
207
  createSchedule(options: CreateScheduleOptions, requestOptions?: ZodFetchOptions): ApiPromise<{
196
208
  type: "DECLARATIVE" | "IMPERATIVE";
197
209
  id: string;
@@ -212,18 +224,18 @@ declare class ApiClient {
212
224
  externalId?: string | null | undefined;
213
225
  nextRun?: Date | null | undefined;
214
226
  }>;
215
- listSchedules(options?: ListScheduleOptions, requestOptions?: ZodFetchOptions): OffsetLimitPagePromise<zod.ZodObject<{
216
- id: zod.ZodString;
217
- type: zod.ZodUnion<[zod.ZodLiteral<"DECLARATIVE">, zod.ZodLiteral<"IMPERATIVE">]>;
218
- task: zod.ZodString;
219
- active: zod.ZodBoolean;
220
- deduplicationKey: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
221
- externalId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
222
- generator: zod.ZodObject<{
223
- type: zod.ZodLiteral<"CRON">;
224
- expression: zod.ZodString;
225
- description: zod.ZodString;
226
- }, "strip", zod.ZodTypeAny, {
227
+ listSchedules(options?: ListScheduleOptions, requestOptions?: ZodFetchOptions): OffsetLimitPagePromise<z.ZodObject<{
228
+ id: z.ZodString;
229
+ type: z.ZodUnion<[z.ZodLiteral<"DECLARATIVE">, z.ZodLiteral<"IMPERATIVE">]>;
230
+ task: z.ZodString;
231
+ active: z.ZodBoolean;
232
+ deduplicationKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
+ generator: z.ZodObject<{
235
+ type: z.ZodLiteral<"CRON">;
236
+ expression: z.ZodString;
237
+ description: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
227
239
  type: "CRON";
228
240
  description: string;
229
241
  expression: string;
@@ -232,13 +244,13 @@ declare class ApiClient {
232
244
  description: string;
233
245
  expression: string;
234
246
  }>;
235
- timezone: zod.ZodString;
236
- nextRun: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
237
- environments: zod.ZodArray<zod.ZodObject<{
238
- id: zod.ZodString;
239
- type: zod.ZodString;
240
- userName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
241
- }, "strip", zod.ZodTypeAny, {
247
+ timezone: z.ZodString;
248
+ nextRun: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
249
+ environments: z.ZodArray<z.ZodObject<{
250
+ id: z.ZodString;
251
+ type: z.ZodString;
252
+ userName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ }, "strip", z.ZodTypeAny, {
242
254
  type: string;
243
255
  id: string;
244
256
  userName?: string | null | undefined;
@@ -247,7 +259,7 @@ declare class ApiClient {
247
259
  id: string;
248
260
  userName?: string | null | undefined;
249
261
  }>, "many">;
250
- }, "strip", zod.ZodTypeAny, {
262
+ }, "strip", z.ZodTypeAny, {
251
263
  type: "DECLARATIVE" | "IMPERATIVE";
252
264
  id: string;
253
265
  task: string;
@@ -505,4 +517,4 @@ declare function accessoryAttributes(accessory: Accessory): Attributes;
505
517
 
506
518
  declare function detectDependencyVersion(dependency: string): string | undefined;
507
519
 
508
- export { Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, 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, OffsetLimitPagePromise, RescheduleRunRequestBody, RunStatus, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, clock, detectDependencyVersion, imposeAttributeLimits, mergeRequestOptions, runtime, taskCatalog, taskContext };
520
+ export { Accessory, AddTagsRequestBody, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, 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, OffsetLimitPagePromise, RescheduleRunRequestBody, RunStatus, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, clock, detectDependencyVersion, imposeAttributeLimits, mergeRequestOptions, runtime, taskCatalog, taskContext };
@@ -1,8 +1,8 @@
1
- import * as zod from 'zod';
2
1
  import { CursorPageParams, ApiRequestOptions, ZodFetchOptions, ApiPromise, CursorPagePromise, OffsetLimitPagePromise } from './zodfetch.js';
3
2
  export { APIHeaders, ApiConnectionError, ApiError, AuthenticationError, BadRequestError, ConflictError, CursorPage, CursorPageResponse, InternalServerError, NotFoundError, OffsetLimitPage, OffsetLimitPageParams, OffsetLimitPageResponse, Page, PageResponse, PermissionDeniedError, RateLimitError, UnprocessableEntityError, isRequestOptions } from './zodfetch.js';
4
- import { RunStatus, TriggerTaskRequestBody, BatchTriggerTaskRequestBody, ListRunResponseItem, RescheduleRunRequestBody, CreateScheduleOptions, ListScheduleOptions, UpdateScheduleOptions, CreateEnvironmentVariableRequestBody, UpdateEnvironmentVariableRequestBody, Accessory } from './schemas/index.js';
5
- export { AttemptStatus, BackgroundWorkerMetadata, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, ListRunResponse, ListSchedulesResult, OtherSpanEvent, PRIMARY_VARIANT, ReplayRunResponse, RetrieveRunResponse, RunEnvironmentDetails, RunScheduleDetails, ScheduleGenerator, ScheduleObject, ScheduleType, ScheduledTaskPayload, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskResource, TimezonesResult, TriggerTaskResponse, Variant, WhoAmIResponse, WhoAmIResponseSchema, isCancellationSpanEvent, isExceptionSpanEvent, stringPatternMatchers } from './schemas/index.js';
3
+ import { z } from 'zod';
4
+ import { RunStatus, TriggerTaskRequestBody, BatchTriggerTaskRequestBody, ListRunResponseItem, RescheduleRunRequestBody, AddTagsRequestBody, CreateScheduleOptions, ListScheduleOptions, UpdateScheduleOptions, CreateEnvironmentVariableRequestBody, UpdateEnvironmentVariableRequestBody, Accessory } from './schemas/index.js';
5
+ export { AttemptStatus, BackgroundWorkerMetadata, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, ListRunResponse, ListSchedulesResult, OtherSpanEvent, PRIMARY_VARIANT, ReplayRunResponse, RetrieveRunResponse, RunEnvironmentDetails, RunScheduleDetails, RunTags, ScheduleGenerator, ScheduleObject, ScheduleType, ScheduledTaskPayload, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskResource, TimezonesResult, TriggerTaskResponse, Variant, WhoAmIResponse, WhoAmIResponseSchema, isCancellationSpanEvent, isExceptionSpanEvent, stringPatternMatchers } from './schemas/index.js';
6
6
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunContext } from '../common-CLW82lkt.js';
7
7
  export { f as MachineConfig, d as MachineCpu, e as MachineMemory, g as MachinePreset, M as MachinePresetName, m as TaskRun, h as TaskRunBuiltInError, i as TaskRunCustomErrorObject, b as TaskRunError, k as TaskRunErrorCodes, c as TaskRunExecution, o as TaskRunExecutionAttempt, t as TaskRunExecutionBatch, p as TaskRunExecutionEnvironment, q as TaskRunExecutionOrganization, r as TaskRunExecutionProject, s as TaskRunExecutionQueue, u as TaskRunExecutionRetry, n as TaskRunExecutionTask, v as TaskRunExecutionUsage, w as TaskRunFailedExecutionResult, l as TaskRunInternalError, j as TaskRunStringError, x as TaskRunSuccessfulExecutionResult } from '../common-CLW82lkt.js';
8
8
  import { C as Clock, a as ClockTime, b as TaskCatalog, T as TaskMetadataWithFunctions } from '../catalog-h79CG5Wy.js';
@@ -53,6 +53,7 @@ interface ListRunsQueryParams extends CursorPageParams {
53
53
  to?: Date | number;
54
54
  period?: string;
55
55
  bulkAction?: string;
56
+ tag?: Array<string> | string;
56
57
  schedule?: string;
57
58
  isTest?: boolean;
58
59
  }
@@ -91,8 +92,12 @@ declare class ApiClient {
91
92
  retrieveRun(runId: string, requestOptions?: ZodFetchOptions): ApiPromise<{
92
93
  status: "COMPLETED" | "CANCELED" | "QUEUED" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
93
94
  id: string;
95
+ tags: string[];
94
96
  isTest: boolean;
95
97
  createdAt: Date;
98
+ durationMs: number;
99
+ costInCents: number;
100
+ baseCostInCents: number;
96
101
  attempts: ({
97
102
  status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
98
103
  id: string;
@@ -147,8 +152,12 @@ declare class ApiClient {
147
152
  rescheduleRun(runId: string, body: RescheduleRunRequestBody, requestOptions?: ZodFetchOptions): ApiPromise<{
148
153
  status: "COMPLETED" | "CANCELED" | "QUEUED" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
149
154
  id: string;
155
+ tags: string[];
150
156
  isTest: boolean;
151
157
  createdAt: Date;
158
+ durationMs: number;
159
+ costInCents: number;
160
+ baseCostInCents: number;
152
161
  attempts: ({
153
162
  status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
154
163
  id: string;
@@ -192,6 +201,9 @@ declare class ApiClient {
192
201
  ttl?: string | undefined;
193
202
  expiredAt?: Date | undefined;
194
203
  }>;
204
+ addTags(runId: string, body: AddTagsRequestBody, requestOptions?: ZodFetchOptions): ApiPromise<{
205
+ message: string;
206
+ }>;
195
207
  createSchedule(options: CreateScheduleOptions, requestOptions?: ZodFetchOptions): ApiPromise<{
196
208
  type: "DECLARATIVE" | "IMPERATIVE";
197
209
  id: string;
@@ -212,18 +224,18 @@ declare class ApiClient {
212
224
  externalId?: string | null | undefined;
213
225
  nextRun?: Date | null | undefined;
214
226
  }>;
215
- listSchedules(options?: ListScheduleOptions, requestOptions?: ZodFetchOptions): OffsetLimitPagePromise<zod.ZodObject<{
216
- id: zod.ZodString;
217
- type: zod.ZodUnion<[zod.ZodLiteral<"DECLARATIVE">, zod.ZodLiteral<"IMPERATIVE">]>;
218
- task: zod.ZodString;
219
- active: zod.ZodBoolean;
220
- deduplicationKey: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
221
- externalId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
222
- generator: zod.ZodObject<{
223
- type: zod.ZodLiteral<"CRON">;
224
- expression: zod.ZodString;
225
- description: zod.ZodString;
226
- }, "strip", zod.ZodTypeAny, {
227
+ listSchedules(options?: ListScheduleOptions, requestOptions?: ZodFetchOptions): OffsetLimitPagePromise<z.ZodObject<{
228
+ id: z.ZodString;
229
+ type: z.ZodUnion<[z.ZodLiteral<"DECLARATIVE">, z.ZodLiteral<"IMPERATIVE">]>;
230
+ task: z.ZodString;
231
+ active: z.ZodBoolean;
232
+ deduplicationKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
234
+ generator: z.ZodObject<{
235
+ type: z.ZodLiteral<"CRON">;
236
+ expression: z.ZodString;
237
+ description: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
227
239
  type: "CRON";
228
240
  description: string;
229
241
  expression: string;
@@ -232,13 +244,13 @@ declare class ApiClient {
232
244
  description: string;
233
245
  expression: string;
234
246
  }>;
235
- timezone: zod.ZodString;
236
- nextRun: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
237
- environments: zod.ZodArray<zod.ZodObject<{
238
- id: zod.ZodString;
239
- type: zod.ZodString;
240
- userName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
241
- }, "strip", zod.ZodTypeAny, {
247
+ timezone: z.ZodString;
248
+ nextRun: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
249
+ environments: z.ZodArray<z.ZodObject<{
250
+ id: z.ZodString;
251
+ type: z.ZodString;
252
+ userName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ }, "strip", z.ZodTypeAny, {
242
254
  type: string;
243
255
  id: string;
244
256
  userName?: string | null | undefined;
@@ -247,7 +259,7 @@ declare class ApiClient {
247
259
  id: string;
248
260
  userName?: string | null | undefined;
249
261
  }>, "many">;
250
- }, "strip", zod.ZodTypeAny, {
262
+ }, "strip", z.ZodTypeAny, {
251
263
  type: "DECLARATIVE" | "IMPERATIVE";
252
264
  id: string;
253
265
  task: string;
@@ -505,4 +517,4 @@ declare function accessoryAttributes(accessory: Accessory): Attributes;
505
517
 
506
518
  declare function detectDependencyVersion(dependency: string): string | undefined;
507
519
 
508
- export { Accessory, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, 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, OffsetLimitPagePromise, RescheduleRunRequestBody, RunStatus, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, clock, detectDependencyVersion, imposeAttributeLimits, mergeRequestOptions, runtime, taskCatalog, taskContext };
520
+ export { Accessory, AddTagsRequestBody, ApiClient, type ApiClientConfiguration, ApiPromise, ApiRequestOptions, BackgroundWorkerProperties, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, type CreateEnvironmentVariableParams, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CursorPageParams, CursorPagePromise, type ImportEnvironmentVariablesParams, type ListProjectRunsQueryParams, ListRunResponseItem, type ListRunsQueryParams, ListScheduleOptions, 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, OffsetLimitPagePromise, RescheduleRunRequestBody, RunStatus, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskRunContext, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, type UpdateEnvironmentVariableParams, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, accessoryAttributes, apiClientManager, clock, detectDependencyVersion, imposeAttributeLimits, mergeRequestOptions, runtime, taskCatalog, taskContext };
package/dist/v3/index.js CHANGED
@@ -33,7 +33,7 @@ var __privateMethod = (obj, member, method) => {
33
33
  };
34
34
 
35
35
  // package.json
36
- var version = "0.0.0-prerelease-20240718194312";
36
+ var version = "0.0.0-prerelease-20240723165848";
37
37
  var dependencies = {
38
38
  "@google-cloud/precise-date": "^4.0.0",
39
39
  "@opentelemetry/api": "^1.8.0",
@@ -717,6 +717,22 @@ var CreateBackgroundWorkerResponse = zod.z.object({
717
717
  version: zod.z.string(),
718
718
  contentHash: zod.z.string()
719
719
  });
720
+ var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
721
+ var RunTags = zod.z.union([
722
+ RunTag,
723
+ zod.z.tuple([
724
+ RunTag
725
+ ]),
726
+ zod.z.tuple([
727
+ RunTag,
728
+ RunTag
729
+ ]),
730
+ zod.z.tuple([
731
+ RunTag,
732
+ RunTag,
733
+ RunTag
734
+ ])
735
+ ]);
720
736
  var TriggerTaskRequestBody = zod.z.object({
721
737
  payload: zod.z.any(),
722
738
  context: zod.z.any(),
@@ -731,6 +747,7 @@ var TriggerTaskRequestBody = zod.z.object({
731
747
  payloadType: zod.z.string().optional(),
732
748
  delay: zod.z.string().or(zod.z.coerce.date()).optional(),
733
749
  ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
750
+ tags: RunTags.optional(),
734
751
  maxAttempts: zod.z.number().int().optional()
735
752
  }).optional()
736
753
  });
@@ -758,6 +775,9 @@ var GetBatchResponseBody = zod.z.object({
758
775
  ])
759
776
  }))
760
777
  });
778
+ var AddTagsRequestBody = zod.z.object({
779
+ tags: RunTags
780
+ });
761
781
  var RescheduleRunRequestBody = zod.z.object({
762
782
  delay: zod.z.string().or(zod.z.coerce.date())
763
783
  });
@@ -1020,7 +1040,11 @@ var CommonRunFields = {
1020
1040
  finishedAt: zod.z.coerce.date().optional(),
1021
1041
  delayedUntil: zod.z.coerce.date().optional(),
1022
1042
  ttl: zod.z.string().optional(),
1023
- expiredAt: zod.z.coerce.date().optional()
1043
+ expiredAt: zod.z.coerce.date().optional(),
1044
+ tags: zod.z.string().array(),
1045
+ costInCents: zod.z.number(),
1046
+ baseCostInCents: zod.z.number(),
1047
+ durationMs: zod.z.number()
1024
1048
  };
1025
1049
  var RetrieveRunResponse = zod.z.object({
1026
1050
  ...CommonRunFields,
@@ -3296,6 +3320,15 @@ var _ApiClient = class _ApiClient {
3296
3320
  body: JSON.stringify(body)
3297
3321
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3298
3322
  }
3323
+ addTags(runId, body, requestOptions) {
3324
+ return zodfetch(zod.z.object({
3325
+ message: zod.z.string()
3326
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
3327
+ method: "POST",
3328
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3329
+ body: JSON.stringify(body)
3330
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3331
+ }
3299
3332
  createSchedule(options, requestOptions) {
3300
3333
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
3301
3334
  method: "POST",
@@ -3423,6 +3456,9 @@ function createSearchQueryForListRuns(query) {
3423
3456
  if (query.bulkAction) {
3424
3457
  searchParams.append("filter[bulkAction]", query.bulkAction);
3425
3458
  }
3459
+ if (query.tag) {
3460
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
3461
+ }
3426
3462
  if (query.schedule) {
3427
3463
  searchParams.append("filter[schedule]", query.schedule);
3428
3464
  }
@@ -4489,6 +4525,7 @@ function safeJsonParse2(value) {
4489
4525
  __name(safeJsonParse2, "safeJsonParse");
4490
4526
 
4491
4527
  exports.AbortTaskRunError = AbortTaskRunError;
4528
+ exports.AddTagsRequestBody = AddTagsRequestBody;
4492
4529
  exports.ApiClient = ApiClient;
4493
4530
  exports.ApiConnectionError = ApiConnectionError;
4494
4531
  exports.ApiError = ApiError;
@@ -4593,6 +4630,7 @@ exports.RetryOptions = RetryOptions;
4593
4630
  exports.RunEnvironmentDetails = RunEnvironmentDetails;
4594
4631
  exports.RunScheduleDetails = RunScheduleDetails;
4595
4632
  exports.RunStatus = RunStatus;
4633
+ exports.RunTags = RunTags;
4596
4634
  exports.ScheduleGenerator = ScheduleGenerator;
4597
4635
  exports.ScheduleMetadata = ScheduleMetadata;
4598
4636
  exports.ScheduleObject = ScheduleObject;