@trigger.dev/sdk 0.0.0-prerelease-20241119135607 → 0.0.0-prerelease-20241119153006

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.
@@ -117,11 +117,7 @@ export declare class TriggerClient {
117
117
  */
118
118
  sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
119
119
  name: string;
120
- payload: ((string | number | boolean | {
121
- [key: string]: DeserializedJson;
122
- } | DeserializedJson[]) & (string | number | boolean | {
123
- [key: string]: DeserializedJson;
124
- } | DeserializedJson[] | undefined)) | null;
120
+ payload: DeserializedJson;
125
121
  id: string;
126
122
  timestamp: Date;
127
123
  context?: DeserializedJson | undefined;
@@ -136,11 +132,7 @@ export declare class TriggerClient {
136
132
  */
137
133
  sendEvents(events: SendEvent[], options?: SendEventOptions): Promise<{
138
134
  name: string;
139
- payload: ((string | number | boolean | {
140
- [key: string]: DeserializedJson;
141
- } | DeserializedJson[]) & (string | number | boolean | {
142
- [key: string]: DeserializedJson;
143
- } | DeserializedJson[] | undefined)) | null;
135
+ payload: DeserializedJson;
144
136
  id: string;
145
137
  timestamp: Date;
146
138
  context?: DeserializedJson | undefined;
@@ -150,11 +142,7 @@ export declare class TriggerClient {
150
142
  }[]>;
151
143
  cancelEvent(eventId: string): Promise<{
152
144
  name: string;
153
- payload: ((string | number | boolean | {
154
- [key: string]: DeserializedJson;
155
- } | DeserializedJson[]) & (string | number | boolean | {
156
- [key: string]: DeserializedJson;
157
- } | DeserializedJson[] | undefined)) | null;
145
+ payload: DeserializedJson;
158
146
  id: string;
159
147
  timestamp: Date;
160
148
  context?: DeserializedJson | undefined;
@@ -174,8 +162,8 @@ export declare class TriggerClient {
174
162
  state?: "loading" | "success" | "failure" | undefined;
175
163
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
176
164
  }[];
177
- data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
178
165
  state?: "loading" | "success" | "failure" | undefined;
166
+ data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
179
167
  }>;
180
168
  registerSchedule(id: string, key: string, schedule: ScheduleMetadata): Promise<{
181
169
  id: string;
@@ -184,15 +172,15 @@ export declare class TriggerClient {
184
172
  cron: string;
185
173
  };
186
174
  type: "cron";
187
- accountId?: string | undefined;
188
175
  metadata?: any;
176
+ accountId?: string | undefined;
189
177
  } | {
190
178
  options: {
191
179
  seconds: number;
192
180
  };
193
181
  type: "interval";
194
- accountId?: string | undefined;
195
182
  metadata?: any;
183
+ accountId?: string | undefined;
196
184
  };
197
185
  active: boolean;
198
186
  metadata?: any;
@@ -227,8 +215,8 @@ export declare class TriggerClient {
227
215
  state?: "loading" | "success" | "failure" | undefined;
228
216
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
229
217
  }[];
230
- data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
231
218
  state?: "loading" | "success" | "failure" | undefined;
219
+ data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
232
220
  }[];
233
221
  output?: any;
234
222
  nextCursor?: string | undefined;
@@ -248,8 +236,8 @@ export declare class TriggerClient {
248
236
  state?: "loading" | "success" | "failure" | undefined;
249
237
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
250
238
  }[];
251
- data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
252
239
  state?: "loading" | "success" | "failure" | undefined;
240
+ data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
253
241
  }[];
254
242
  output?: any;
255
243
  nextCursor?: string | undefined;
@@ -273,8 +261,8 @@ export declare class TriggerClient {
273
261
  state?: "loading" | "success" | "failure" | undefined;
274
262
  data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
275
263
  }[];
276
- data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
277
264
  state?: "loading" | "success" | "failure" | undefined;
265
+ data?: Record<string, import("@trigger.dev/core").SerializableJson> | undefined;
278
266
  }[];
279
267
  run: {
280
268
  status: "PENDING" | "CANCELED" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "SUCCESS" | "FAILURE" | "TIMED_OUT" | "ABORTED" | "UNRESOLVED_AUTH" | "INVALID_PAYLOAD" | "EXECUTING" | "WAITING_TO_CONTINUE" | "WAITING_TO_EXECUTE";
@@ -22,8 +22,8 @@ export declare class InvokeTrigger<TSchema extends ZodType = z.ZodTypeAny> imple
22
22
  examples: {
23
23
  name: string;
24
24
  id: string;
25
- icon?: string | undefined;
26
25
  payload?: any;
26
+ icon?: string | undefined;
27
27
  }[];
28
28
  icon: string;
29
29
  parsePayload: (rawPayload: unknown) => any;
@@ -119,15 +119,15 @@ export declare class DynamicSchedule implements Trigger<ScheduledEventSpecificat
119
119
  cron: string;
120
120
  };
121
121
  type: "cron";
122
- accountId?: string | undefined;
123
122
  metadata?: any;
123
+ accountId?: string | undefined;
124
124
  } | {
125
125
  options: {
126
126
  seconds: number;
127
127
  };
128
128
  type: "interval";
129
- accountId?: string | undefined;
130
129
  metadata?: any;
130
+ accountId?: string | undefined;
131
131
  };
132
132
  active: boolean;
133
133
  metadata?: any;
@@ -118,13 +118,13 @@ export declare const EventSpecificationExampleSchema: z.ZodObject<{
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  name: string;
120
120
  id: string;
121
- icon?: string | undefined;
122
121
  payload?: any;
122
+ icon?: string | undefined;
123
123
  }, {
124
124
  name: string;
125
125
  id: string;
126
- icon?: string | undefined;
127
126
  payload?: any;
127
+ icon?: string | undefined;
128
128
  }>;
129
129
  export type EventSpecificationExample = z.infer<typeof EventSpecificationExampleSchema>;
130
130
  export type TypedEventSpecificationExample<TEvent> = {
@@ -26,27 +26,30 @@ export type PollOptions = {
26
26
  declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, options?: {
27
27
  pollIntervalMs?: number;
28
28
  }, requestOptions?: ApiRequestOptions): Promise<{
29
- taskIdentifier: string;
30
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
29
+ version?: string | undefined;
30
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
31
31
  id: string;
32
- idempotencyKey?: string | undefined;
33
- createdAt: Date;
34
- updatedAt: Date;
35
- startedAt?: Date | undefined;
36
- expiredAt?: Date | undefined;
37
- isTest: boolean;
38
- costInCents: number;
39
- baseCostInCents: number;
40
- ttl?: string | undefined;
41
32
  metadata?: Record<string, any> | undefined;
33
+ startedAt?: Date | undefined;
42
34
  error?: {
43
35
  message: string;
44
36
  name?: string | undefined;
45
37
  stackTrace?: string | undefined;
46
38
  } | undefined;
47
- tags: string[];
48
- durationMs: number;
49
- version?: string | undefined;
39
+ idempotencyKey?: string | undefined;
40
+ attempts: ({
41
+ status: "PENDING" | "COMPLETED" | "CANCELED" | "EXECUTING" | "FAILED" | "PAUSED";
42
+ id: string;
43
+ updatedAt: Date;
44
+ createdAt: Date;
45
+ startedAt?: Date | undefined;
46
+ completedAt?: Date | undefined;
47
+ error?: {
48
+ message: string;
49
+ name?: string | undefined;
50
+ stackTrace?: string | undefined;
51
+ } | undefined;
52
+ } | undefined)[];
50
53
  schedule?: {
51
54
  id: string;
52
55
  generator: {
@@ -57,99 +60,107 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
57
60
  externalId?: string | undefined;
58
61
  deduplicationKey?: string | undefined;
59
62
  } | undefined;
63
+ updatedAt: Date;
64
+ isTest: boolean;
65
+ createdAt: Date;
66
+ tags: string[];
67
+ durationMs: number;
68
+ costInCents: number;
69
+ baseCostInCents: number;
70
+ taskIdentifier: string;
60
71
  payloadPresignedUrl?: string | undefined;
61
72
  outputPresignedUrl?: string | undefined;
62
73
  relatedRuns: {
63
74
  root?: {
64
- taskIdentifier: string;
65
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
75
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
66
76
  id: string;
67
- createdAt: Date;
68
77
  updatedAt: Date;
69
78
  isTest: boolean;
70
- costInCents: number;
71
- baseCostInCents: number;
79
+ createdAt: Date;
72
80
  tags: string[];
73
81
  durationMs: number;
82
+ costInCents: number;
83
+ baseCostInCents: number;
84
+ taskIdentifier: string;
74
85
  depth: number;
75
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
86
+ triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
76
87
  isQueued: boolean;
77
88
  isExecuting: boolean;
78
89
  isCompleted: boolean;
79
90
  isSuccess: boolean;
80
91
  isFailed: boolean;
81
92
  isCancelled: boolean;
82
- batchId?: string | undefined;
83
- idempotencyKey?: string | undefined;
84
93
  version?: string | undefined;
94
+ metadata?: Record<string, any> | undefined;
85
95
  startedAt?: Date | undefined;
96
+ idempotencyKey?: string | undefined;
97
+ batchId?: string | undefined;
86
98
  finishedAt?: Date | undefined;
87
99
  delayedUntil?: Date | undefined;
88
100
  ttl?: string | undefined;
89
101
  expiredAt?: Date | undefined;
90
- metadata?: Record<string, any> | undefined;
91
102
  } | undefined;
92
103
  parent?: {
93
- taskIdentifier: string;
94
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
104
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
95
105
  id: string;
96
- createdAt: Date;
97
106
  updatedAt: Date;
98
107
  isTest: boolean;
99
- costInCents: number;
100
- baseCostInCents: number;
108
+ createdAt: Date;
101
109
  tags: string[];
102
110
  durationMs: number;
111
+ costInCents: number;
112
+ baseCostInCents: number;
113
+ taskIdentifier: string;
103
114
  depth: number;
104
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
115
+ triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
105
116
  isQueued: boolean;
106
117
  isExecuting: boolean;
107
118
  isCompleted: boolean;
108
119
  isSuccess: boolean;
109
120
  isFailed: boolean;
110
121
  isCancelled: boolean;
111
- batchId?: string | undefined;
112
- idempotencyKey?: string | undefined;
113
122
  version?: string | undefined;
123
+ metadata?: Record<string, any> | undefined;
114
124
  startedAt?: Date | undefined;
125
+ idempotencyKey?: string | undefined;
126
+ batchId?: string | undefined;
115
127
  finishedAt?: Date | undefined;
116
128
  delayedUntil?: Date | undefined;
117
129
  ttl?: string | undefined;
118
130
  expiredAt?: Date | undefined;
119
- metadata?: Record<string, any> | undefined;
120
131
  } | undefined;
121
132
  children?: {
122
- taskIdentifier: string;
123
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
133
+ status: "COMPLETED" | "CANCELED" | "QUEUED" | "TIMED_OUT" | "EXECUTING" | "WAITING_FOR_DEPLOY" | "REATTEMPTING" | "FROZEN" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED";
124
134
  id: string;
125
- createdAt: Date;
126
135
  updatedAt: Date;
127
136
  isTest: boolean;
128
- costInCents: number;
129
- baseCostInCents: number;
137
+ createdAt: Date;
130
138
  tags: string[];
131
139
  durationMs: number;
140
+ costInCents: number;
141
+ baseCostInCents: number;
142
+ taskIdentifier: string;
132
143
  depth: number;
133
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
144
+ triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
134
145
  isQueued: boolean;
135
146
  isExecuting: boolean;
136
147
  isCompleted: boolean;
137
148
  isSuccess: boolean;
138
149
  isFailed: boolean;
139
150
  isCancelled: boolean;
140
- batchId?: string | undefined;
141
- idempotencyKey?: string | undefined;
142
151
  version?: string | undefined;
152
+ metadata?: Record<string, any> | undefined;
143
153
  startedAt?: Date | undefined;
154
+ idempotencyKey?: string | undefined;
155
+ batchId?: string | undefined;
144
156
  finishedAt?: Date | undefined;
145
157
  delayedUntil?: Date | undefined;
146
158
  ttl?: string | undefined;
147
159
  expiredAt?: Date | undefined;
148
- metadata?: Record<string, any> | undefined;
149
160
  }[] | undefined;
150
161
  };
151
162
  depth: number;
152
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
163
+ triggerFunction: "trigger" | "triggerAndWait" | "batchTriggerAndWait" | "batchTrigger";
153
164
  batchId?: string | undefined;
154
165
  isQueued: boolean;
155
166
  isExecuting: boolean;
@@ -159,19 +170,8 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
159
170
  isCancelled: boolean;
160
171
  finishedAt?: Date | undefined;
161
172
  delayedUntil?: Date | undefined;
162
- attempts: ({
163
- status: "EXECUTING" | "COMPLETED" | "CANCELED" | "FAILED" | "PENDING" | "PAUSED";
164
- id: string;
165
- createdAt: Date;
166
- updatedAt: Date;
167
- startedAt?: Date | undefined;
168
- completedAt?: Date | undefined;
169
- error?: {
170
- message: string;
171
- name?: string | undefined;
172
- stackTrace?: string | undefined;
173
- } | undefined;
174
- } | undefined)[];
173
+ ttl?: string | undefined;
174
+ expiredAt?: Date | undefined;
175
175
  attemptCount: number;
176
176
  output?: InferRunTypes<TRunId>["output"] | undefined;
177
177
  payload?: InferRunTypes<TRunId>["payload"] | undefined;
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.0.0-prerelease-20241119135607-v3-prerelease-20241119134900";
1
+ export const VERSION = "3.2.0";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/sdk",
3
- "version": "0.0.0-prerelease-20241119135607",
3
+ "version": "0.0.0-prerelease-20241119153006",
4
4
  "description": "trigger.dev Node.JS SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -40,7 +40,7 @@
40
40
  "@opentelemetry/api": "1.9.0",
41
41
  "@opentelemetry/api-logs": "0.52.1",
42
42
  "@opentelemetry/semantic-conventions": "1.25.1",
43
- "@trigger.dev/core": "0.0.0-prerelease-20241119135607",
43
+ "@trigger.dev/core": "0.0.0-prerelease-20241119153006",
44
44
  "chalk": "^5.2.0",
45
45
  "cronstrue": "^2.21.0",
46
46
  "debug": "^4.3.4",
@@ -65,7 +65,7 @@
65
65
  "tsx": "4.17.0",
66
66
  "typed-emitter": "^2.1.0",
67
67
  "typescript": "^5.5.4",
68
- "zod": "3.22.3"
68
+ "zod": "3.23.8"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "zod": "^3.0.0"