@trigger.dev/sdk 2.2.11 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,24 @@
1
1
  import * as _trigger_dev_core from '@trigger.dev/core';
2
- import { AsyncMap, KeyValueStoreResponseBody, RunTaskBodyInput, CompleteTaskBodyV2Input, FailTaskBodyInput, SendEvent, SendEventOptions, StatusUpdate, UpdateTriggerSourceBodyV2, TriggerSource, UpdateWebhookBody, RegisterTriggerBodyV2, RegisterSourceEventV2, ScheduleMetadata, GetRunOptionsWithTaskDetails, GetRunsOptions, InvokeOptions, EphemeralEventDispatcherRequestBody, LogLevel, RuntimeEnvironmentType, DisplayProperty, TriggerMetadata, EventFilter, SuccessfulRunNotification, FailedRunNotification, HttpEndpointMetadata, RequestFilter, Prettify, HandleTriggerSource, Logger, RegisterTriggerSource, SerializableJson, ConnectionAuth, NormalizedResponse, HttpSourceResponseMetadata, IntervalOptions, CronOptions, ScheduledPayload, RegisterWebhookSource, DeserializedJson, ServerTask, CachedTask, InitialStatusUpdate, FetchRequestInit, FetchRetryOptions, FetchTimeoutOptions, FetchPollOperation, RunTaskOptions, IntegrationMetadata, IntegrationConfig, JobMetadata, RunNotification, MissingConnectionNotificationPayload, MissingConnectionResolvedNotificationPayload, ErrorWithStack, ApiEventLog, RedactString } from '@trigger.dev/core';
3
- export { ConnectionAuth, DisplayProperty, EventFilter, Logger, NormalizedRequest, OverridableRunTaskOptions, Prettify, RedactString, RegisteredOptionsDiff, RunTaskOptions, SourceEventOption } from '@trigger.dev/core';
2
+ import { AsyncMap, KeyValueStoreResponseBody, RunTaskBodyInput, CompleteTaskBodyV2Input, FailTaskBodyInput, SendEvent, SendEventOptions, StatusUpdate, UpdateTriggerSourceBodyV2, TriggerSource, UpdateWebhookBody, RegisterTriggerBodyV2, RegisterSourceEventV2, ScheduleMetadata, GetRunOptionsWithTaskDetails, GetRunsOptions, InvokeOptions, EphemeralEventDispatcherRequestBody, RuntimeEnvironmentType, DisplayProperty, TriggerMetadata, EventFilter, SuccessfulRunNotification, FailedRunNotification, HttpEndpointMetadata, RequestFilter, Prettify, HandleTriggerSource, RegisterTriggerSource, SerializableJson, ConnectionAuth, NormalizedResponse, HttpSourceResponseMetadata, IntervalOptions, CronOptions, ScheduledPayload, RegisterWebhookSource, DeserializedJson, ServerTask, CachedTask, InitialStatusUpdate, FetchRequestInit, FetchRetryOptions, FetchTimeoutOptions, FetchPollOperation, RunTaskOptions, IntegrationMetadata, IntegrationConfig, JobMetadata, RunNotification, MissingConnectionNotificationPayload, MissingConnectionResolvedNotificationPayload, ErrorWithStack, ApiEventLog, RedactString } from '@trigger.dev/core';
3
+ export { ConnectionAuth, DisplayProperty, EventFilter, NormalizedRequest, OverridableRunTaskOptions, Prettify, RedactString, RegisteredOptionsDiff, RunTaskOptions, SourceEventOption } from '@trigger.dev/core';
4
+ import { LogLevel, Logger } from '@trigger.dev/core-backend';
5
+ export { Logger } from '@trigger.dev/core-backend';
4
6
  import * as zod from 'zod';
5
7
  import { z, ZodType, TypeOf } from 'zod';
8
+ import { Buffer } from 'buffer';
6
9
  import { BinaryToTextEncoding, BinaryLike, KeyObject } from 'crypto';
7
10
 
11
+ type ConcurrencyLimitOptions = {
12
+ id: string;
13
+ limit: number;
14
+ };
15
+ declare class ConcurrencyLimit {
16
+ private options;
17
+ constructor(options: ConcurrencyLimitOptions);
18
+ get id(): string;
19
+ get limit(): number;
20
+ }
21
+
8
22
  type QueryKeyValueStoreFunction = (action: "DELETE" | "GET" | "HAS" | "SET", data: {
9
23
  key: string;
10
24
  value?: string;
@@ -1071,6 +1085,22 @@ type EndpointOptions = {
1071
1085
  verify: VerifyCallback;
1072
1086
  };
1073
1087
 
1088
+ declare class KeyValueStore {
1089
+ #private;
1090
+ private apiClient;
1091
+ private type;
1092
+ private namespace;
1093
+ constructor(apiClient: ApiClient, type?: string | null, namespace?: string);
1094
+ delete(cacheKey: string | any[], key: string): Promise<boolean>;
1095
+ delete(key: string): Promise<boolean>;
1096
+ get<T extends Json<T> = any>(cacheKey: string | any[], key: string): Promise<T | undefined>;
1097
+ get<T extends Json<T> = any>(key: string): Promise<T | undefined>;
1098
+ has(cacheKey: string | any[], key: string): Promise<boolean>;
1099
+ has(key: string): Promise<boolean>;
1100
+ set<T extends Json<T>>(cacheKey: string | any[], key: string, value: T): Promise<T>;
1101
+ set<T extends Json<T>>(key: string, value: T): Promise<T>;
1102
+ }
1103
+
1074
1104
  type HttpSourceEvent = {
1075
1105
  url: string;
1076
1106
  method: string;
@@ -1415,17 +1445,6 @@ declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
1415
1445
  toJSON(): TriggerMetadata;
1416
1446
  }
1417
1447
 
1418
- type ConcurrencyLimitOptions = {
1419
- id: string;
1420
- limit: number;
1421
- };
1422
- declare class ConcurrencyLimit {
1423
- private options;
1424
- constructor(options: ConcurrencyLimitOptions);
1425
- get id(): string;
1426
- get limit(): number;
1427
- }
1428
-
1429
1448
  type WebhookCRUDContext<TParams extends any, TConfig extends Record<string, string[]>> = {
1430
1449
  active: boolean;
1431
1450
  params: TParams;
@@ -1561,22 +1580,6 @@ declare class WebhookTrigger<TEventSpecification extends EventSpecification<any>
1561
1580
  }>;
1562
1581
  }
1563
1582
 
1564
- declare class KeyValueStore {
1565
- #private;
1566
- private apiClient;
1567
- private type;
1568
- private namespace;
1569
- constructor(apiClient: ApiClient, type?: string | null, namespace?: string);
1570
- delete(cacheKey: string | any[], key: string): Promise<boolean>;
1571
- delete(key: string): Promise<boolean>;
1572
- get<T extends Json<T> = any>(cacheKey: string | any[], key: string): Promise<T | undefined>;
1573
- get<T extends Json<T> = any>(key: string): Promise<T | undefined>;
1574
- has(cacheKey: string | any[], key: string): Promise<boolean>;
1575
- has(key: string): Promise<boolean>;
1576
- set<T extends Json<T>>(cacheKey: string | any[], key: string, value: T): Promise<T>;
1577
- set<T extends Json<T>>(key: string, value: T): Promise<T>;
1578
- }
1579
-
1580
1583
  type TriggerClientOptions = {
1581
1584
  /** The `id` property is used to uniquely identify the client.
1582
1585
  */
@@ -2374,11 +2377,12 @@ type JobIO<TJob> = TJob extends Job<any, infer TIntegrations> ? IOWithIntegratio
2374
2377
  declare class Job<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration> = {}, TOutput extends any = any> {
2375
2378
  #private;
2376
2379
  readonly options: JobOptions<TTrigger, TIntegrations, TOutput>;
2377
- client: TriggerClient;
2378
- constructor(
2379
- /** An instance of [TriggerClient](/sdk/triggerclient) that is used to send events
2380
- to the Trigger API. */
2381
- client: TriggerClient, options: JobOptions<TTrigger, TIntegrations, TOutput>);
2380
+ client?: TriggerClient;
2381
+ constructor(options: JobOptions<TTrigger, TIntegrations, TOutput>);
2382
+ /**
2383
+ * Attaches the job to a client. This is called automatically when you define a job using `client.defineJob()`.
2384
+ */
2385
+ attachToClient(client: TriggerClient): void;
2382
2386
  get id(): string;
2383
2387
  get enabled(): boolean;
2384
2388
  get name(): string;
@@ -2689,4 +2693,4 @@ type Task = ServerTask;
2689
2693
  type SentEvent = ApiEventLog;
2690
2694
  declare function redactString(strings: TemplateStringsArray, ...interpolations: string[]): RedactString;
2691
2695
 
2692
- export { AuthResolverResult, BackgroundFetchResponse, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventSpecification, EventSpecificationExample, EventSpecificationExampleSchema, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, GetWebhookConfig, GetWebhookParams, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOStats, IOTask, IOWithIntegrations, IntegrationTaskKey, IntervalTrigger, InvokeTrigger, JSONOutputSerializer, Job, JobIO, JobOptions, JobPayload, Json, MissingConnectionNotification, MissingConnectionResolvedNotification, NotificationEvents, NotificationsEventEmitter, OutputSerializer, PreprocessResults, RunTaskErrorCallback, SchemaParser, SchemaParserIssue, SchemaParserResult, SentEvent, Task, TaskLogger, Trigger, TriggerAuthResolver, TriggerClient, TriggerClientOptions, TriggerContext, TriggerEventType, TriggerIntegration, TriggerInvokeType, TriggerOptionRecord, TriggerPayload, TriggerPreprocessContext, TypedEventSpecificationExample, VerifyResult, WaitForEventResult, WebhookConfig, WebhookDeliveryContext, WebhookHandlerEvent, WebhookSource, WebhookTrigger, WebhookTriggerOptions, cronTrigger, eventTrigger, intervalTrigger, invokeTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString, retry, slugifyId, verifyHmacSha256, verifyRequestSignature, waitForEventSchema };
2696
+ export { type AuthResolverResult, type BackgroundFetchResponse, CronTrigger, type DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, type DynamicTriggerOptions, type EventSpecification, type EventSpecificationExample, EventSpecificationExampleSchema, EventTrigger, type EventTypeFromSpecification, ExternalSource, type ExternalSourceParams, ExternalSourceTrigger, type ExternalSourceTriggerOptions, type GetWebhookConfig, type GetWebhookParams, type HandlerEvent, type HttpSourceEvent, IO, IOLogger, type IOOptions, type IOStats, type IOTask, type IOWithIntegrations, type IntegrationTaskKey, IntervalTrigger, InvokeTrigger, JSONOutputSerializer, Job, type JobIO, type JobOptions, type JobPayload, type Json, MissingConnectionNotification, MissingConnectionResolvedNotification, type NotificationEvents, type NotificationsEventEmitter, type OutputSerializer, type PreprocessResults, type RunTaskErrorCallback, type SchemaParser, type SchemaParserIssue, type SchemaParserResult, type SentEvent, type Task, type TaskLogger, type Trigger, type TriggerAuthResolver, TriggerClient, type TriggerClientOptions, type TriggerContext, type TriggerEventType, type TriggerIntegration, type TriggerInvokeType, type TriggerOptionRecord, type TriggerPayload, type TriggerPreprocessContext, type TypedEventSpecificationExample, type VerifyResult, type WaitForEventResult, type WebhookConfig, type WebhookDeliveryContext, type WebhookHandlerEvent, WebhookSource, WebhookTrigger, type WebhookTriggerOptions, cronTrigger, eventTrigger, intervalTrigger, invokeTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString, retry, slugifyId, verifyHmacSha256, verifyRequestSignature, waitForEventSchema };