@trigger.dev/sdk 0.0.0-prerelease-20241202120601 → 0.0.0-prerelease-20241202151711

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.
@@ -27,124 +27,127 @@ export type PollOptions = {
27
27
  declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, options?: {
28
28
  pollIntervalMs?: number;
29
29
  }, requestOptions?: ApiRequestOptions): Promise<{
30
- taskIdentifier: string;
31
- idempotencyKey?: string | undefined;
32
- ttl?: string | undefined;
33
30
  tags: string[];
34
- metadata?: Record<string, any> | undefined;
35
- error?: {
36
- message: string;
37
- name?: string | undefined;
38
- stackTrace?: string | undefined;
31
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
32
+ taskIdentifier: string;
33
+ version?: string | undefined;
34
+ schedule?: {
35
+ id: string;
36
+ generator: {
37
+ type: "CRON";
38
+ description: string;
39
+ expression: string;
40
+ };
41
+ externalId?: string | undefined;
42
+ deduplicationKey?: string | undefined;
39
43
  } | undefined;
44
+ isTest: boolean;
40
45
  id: string;
41
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
46
+ createdAt: Date;
47
+ updatedAt: Date;
48
+ costInCents: number;
49
+ baseCostInCents: number;
50
+ durationMs: number;
42
51
  relatedRuns: {
43
52
  root?: {
44
- id: string;
53
+ taskIdentifier: string;
45
54
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
46
55
  tags: string[];
47
- taskIdentifier: string;
56
+ id: string;
57
+ createdAt: Date;
58
+ updatedAt: Date;
59
+ isTest: boolean;
60
+ costInCents: number;
61
+ baseCostInCents: number;
62
+ durationMs: number;
48
63
  depth: number;
49
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
64
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
50
65
  isQueued: boolean;
51
66
  isExecuting: boolean;
52
67
  isCompleted: boolean;
53
68
  isSuccess: boolean;
54
69
  isFailed: boolean;
55
70
  isCancelled: boolean;
56
- isTest: boolean;
57
- createdAt: Date;
58
- updatedAt: Date;
59
- costInCents: number;
60
- baseCostInCents: number;
61
- durationMs: number;
62
71
  idempotencyKey?: string | undefined;
63
72
  ttl?: string | undefined;
64
73
  metadata?: Record<string, any> | undefined;
65
- batchId?: string | undefined;
66
- version?: string | undefined;
67
74
  startedAt?: Date | undefined;
75
+ expiredAt?: Date | undefined;
76
+ version?: string | undefined;
77
+ batchId?: string | undefined;
68
78
  finishedAt?: Date | undefined;
69
79
  delayedUntil?: Date | undefined;
70
- expiredAt?: Date | undefined;
71
80
  } | undefined;
72
81
  parent?: {
73
- id: string;
82
+ taskIdentifier: string;
74
83
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
75
84
  tags: string[];
76
- taskIdentifier: string;
85
+ id: string;
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ isTest: boolean;
89
+ costInCents: number;
90
+ baseCostInCents: number;
91
+ durationMs: number;
77
92
  depth: number;
78
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
93
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
79
94
  isQueued: boolean;
80
95
  isExecuting: boolean;
81
96
  isCompleted: boolean;
82
97
  isSuccess: boolean;
83
98
  isFailed: boolean;
84
99
  isCancelled: boolean;
85
- isTest: boolean;
86
- createdAt: Date;
87
- updatedAt: Date;
88
- costInCents: number;
89
- baseCostInCents: number;
90
- durationMs: number;
91
100
  idempotencyKey?: string | undefined;
92
101
  ttl?: string | undefined;
93
102
  metadata?: Record<string, any> | undefined;
94
- batchId?: string | undefined;
95
- version?: string | undefined;
96
103
  startedAt?: Date | undefined;
104
+ expiredAt?: Date | undefined;
105
+ version?: string | undefined;
106
+ batchId?: string | undefined;
97
107
  finishedAt?: Date | undefined;
98
108
  delayedUntil?: Date | undefined;
99
- expiredAt?: Date | undefined;
100
109
  } | undefined;
101
110
  children?: {
102
- id: string;
111
+ taskIdentifier: string;
103
112
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
104
113
  tags: string[];
105
- taskIdentifier: string;
114
+ id: string;
115
+ createdAt: Date;
116
+ updatedAt: Date;
117
+ isTest: boolean;
118
+ costInCents: number;
119
+ baseCostInCents: number;
120
+ durationMs: number;
106
121
  depth: number;
107
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
122
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
108
123
  isQueued: boolean;
109
124
  isExecuting: boolean;
110
125
  isCompleted: boolean;
111
126
  isSuccess: boolean;
112
127
  isFailed: boolean;
113
128
  isCancelled: boolean;
114
- isTest: boolean;
115
- createdAt: Date;
116
- updatedAt: Date;
117
- costInCents: number;
118
- baseCostInCents: number;
119
- durationMs: number;
120
129
  idempotencyKey?: string | undefined;
121
130
  ttl?: string | undefined;
122
131
  metadata?: Record<string, any> | undefined;
123
- batchId?: string | undefined;
124
- version?: string | undefined;
125
132
  startedAt?: Date | undefined;
133
+ expiredAt?: Date | undefined;
134
+ version?: string | undefined;
135
+ batchId?: string | undefined;
126
136
  finishedAt?: Date | undefined;
127
137
  delayedUntil?: Date | undefined;
128
- expiredAt?: Date | undefined;
129
138
  }[] | undefined;
130
139
  };
131
140
  depth: number;
132
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
141
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
133
142
  isQueued: boolean;
134
143
  isExecuting: boolean;
135
144
  isCompleted: boolean;
136
145
  isSuccess: boolean;
137
146
  isFailed: boolean;
138
147
  isCancelled: boolean;
139
- isTest: boolean;
140
- createdAt: Date;
141
- updatedAt: Date;
142
- costInCents: number;
143
- baseCostInCents: number;
144
- durationMs: number;
145
148
  attempts: ({
146
- id: string;
147
149
  status: "EXECUTING" | "COMPLETED" | "CANCELED" | "FAILED" | "PENDING" | "PAUSED";
150
+ id: string;
148
151
  createdAt: Date;
149
152
  updatedAt: Date;
150
153
  error?: {
@@ -156,24 +159,21 @@ declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: Run
156
159
  completedAt?: Date | undefined;
157
160
  } | undefined)[];
158
161
  attemptCount: number;
162
+ idempotencyKey?: string | undefined;
163
+ ttl?: string | undefined;
164
+ metadata?: Record<string, any> | undefined;
165
+ error?: {
166
+ message: string;
167
+ name?: string | undefined;
168
+ stackTrace?: string | undefined;
169
+ } | undefined;
170
+ startedAt?: Date | undefined;
171
+ expiredAt?: Date | undefined;
159
172
  payloadPresignedUrl?: string | undefined;
160
173
  outputPresignedUrl?: string | undefined;
161
- schedule?: {
162
- id: string;
163
- generator: {
164
- type: "CRON";
165
- expression: string;
166
- description: string;
167
- };
168
- externalId?: string | undefined;
169
- deduplicationKey?: string | undefined;
170
- } | undefined;
171
174
  batchId?: string | undefined;
172
- version?: string | undefined;
173
- startedAt?: Date | undefined;
174
175
  finishedAt?: Date | undefined;
175
176
  delayedUntil?: Date | undefined;
176
- expiredAt?: Date | undefined;
177
177
  output?: InferRunTypes<TRunId>["output"] | undefined;
178
178
  payload?: InferRunTypes<TRunId>["payload"] | undefined;
179
179
  }>;
@@ -27,139 +27,139 @@ export type PollOptions = {
27
27
  declare function poll<TRunId extends AnyRunHandle | AnyTask | string>(runId: RunId<TRunId>, options?: {
28
28
  pollIntervalMs?: number;
29
29
  }, requestOptions?: ApiRequestOptions): Promise<{
30
- status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
31
- id: string;
32
- durationMs: number;
33
30
  taskIdentifier: string;
31
+ status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
32
+ idempotencyKey?: string | undefined;
33
+ ttl?: string | undefined;
34
+ tags: string[];
35
+ metadata?: Record<string, any> | undefined;
34
36
  error?: {
35
37
  message: string;
36
38
  name?: string | undefined;
37
39
  stackTrace?: string | undefined;
38
40
  } | undefined;
39
- idempotencyKey?: string | undefined;
40
- ttl?: string | undefined;
41
- tags: string[];
42
- metadata?: Record<string, any> | undefined;
43
- payloadPresignedUrl?: string | undefined;
44
- outputPresignedUrl?: string | undefined;
41
+ id: string;
42
+ createdAt: Date;
43
+ updatedAt: Date;
44
+ startedAt?: Date | undefined;
45
+ expiredAt?: Date | undefined;
46
+ isTest: boolean;
47
+ costInCents: number;
48
+ baseCostInCents: number;
49
+ durationMs: number;
50
+ version?: string | undefined;
45
51
  schedule?: {
46
52
  id: string;
47
53
  generator: {
48
54
  type: "CRON";
49
- expression: string;
50
55
  description: string;
56
+ expression: string;
51
57
  };
52
58
  externalId?: string | undefined;
53
59
  deduplicationKey?: string | undefined;
54
60
  } | undefined;
61
+ payloadPresignedUrl?: string | undefined;
62
+ outputPresignedUrl?: string | undefined;
55
63
  relatedRuns: {
56
64
  root?: {
65
+ taskIdentifier: string;
57
66
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
67
+ tags: string[];
58
68
  id: string;
69
+ createdAt: Date;
70
+ updatedAt: Date;
71
+ isTest: boolean;
72
+ costInCents: number;
73
+ baseCostInCents: number;
59
74
  durationMs: number;
60
- taskIdentifier: string;
61
- tags: string[];
62
75
  depth: number;
63
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
76
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
64
77
  isQueued: boolean;
65
78
  isExecuting: boolean;
66
79
  isCompleted: boolean;
67
80
  isSuccess: boolean;
68
81
  isFailed: boolean;
69
82
  isCancelled: boolean;
70
- isTest: boolean;
71
- createdAt: Date;
72
- updatedAt: Date;
73
- costInCents: number;
74
- baseCostInCents: number;
75
83
  idempotencyKey?: string | undefined;
76
84
  ttl?: string | undefined;
77
85
  metadata?: Record<string, any> | undefined;
78
- batchId?: string | undefined;
79
- version?: string | undefined;
80
86
  startedAt?: Date | undefined;
87
+ expiredAt?: Date | undefined;
88
+ version?: string | undefined;
89
+ batchId?: string | undefined;
81
90
  finishedAt?: Date | undefined;
82
91
  delayedUntil?: Date | undefined;
83
- expiredAt?: Date | undefined;
84
92
  } | undefined;
85
93
  parent?: {
94
+ taskIdentifier: string;
86
95
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
96
+ tags: string[];
87
97
  id: string;
98
+ createdAt: Date;
99
+ updatedAt: Date;
100
+ isTest: boolean;
101
+ costInCents: number;
102
+ baseCostInCents: number;
88
103
  durationMs: number;
89
- taskIdentifier: string;
90
- tags: string[];
91
104
  depth: number;
92
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
105
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
93
106
  isQueued: boolean;
94
107
  isExecuting: boolean;
95
108
  isCompleted: boolean;
96
109
  isSuccess: boolean;
97
110
  isFailed: boolean;
98
111
  isCancelled: boolean;
99
- isTest: boolean;
100
- createdAt: Date;
101
- updatedAt: Date;
102
- costInCents: number;
103
- baseCostInCents: number;
104
112
  idempotencyKey?: string | undefined;
105
113
  ttl?: string | undefined;
106
114
  metadata?: Record<string, any> | undefined;
107
- batchId?: string | undefined;
108
- version?: string | undefined;
109
115
  startedAt?: Date | undefined;
116
+ expiredAt?: Date | undefined;
117
+ version?: string | undefined;
118
+ batchId?: string | undefined;
110
119
  finishedAt?: Date | undefined;
111
120
  delayedUntil?: Date | undefined;
112
- expiredAt?: Date | undefined;
113
121
  } | undefined;
114
122
  children?: {
123
+ taskIdentifier: string;
115
124
  status: "WAITING_FOR_DEPLOY" | "QUEUED" | "EXECUTING" | "REATTEMPTING" | "FROZEN" | "COMPLETED" | "CANCELED" | "FAILED" | "CRASHED" | "INTERRUPTED" | "SYSTEM_FAILURE" | "DELAYED" | "EXPIRED" | "TIMED_OUT";
125
+ tags: string[];
116
126
  id: string;
127
+ createdAt: Date;
128
+ updatedAt: Date;
129
+ isTest: boolean;
130
+ costInCents: number;
131
+ baseCostInCents: number;
117
132
  durationMs: number;
118
- taskIdentifier: string;
119
- tags: string[];
120
133
  depth: number;
121
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
134
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
122
135
  isQueued: boolean;
123
136
  isExecuting: boolean;
124
137
  isCompleted: boolean;
125
138
  isSuccess: boolean;
126
139
  isFailed: boolean;
127
140
  isCancelled: boolean;
128
- isTest: boolean;
129
- createdAt: Date;
130
- updatedAt: Date;
131
- costInCents: number;
132
- baseCostInCents: number;
133
141
  idempotencyKey?: string | undefined;
134
142
  ttl?: string | undefined;
135
143
  metadata?: Record<string, any> | undefined;
136
- batchId?: string | undefined;
137
- version?: string | undefined;
138
144
  startedAt?: Date | undefined;
145
+ expiredAt?: Date | undefined;
146
+ version?: string | undefined;
147
+ batchId?: string | undefined;
139
148
  finishedAt?: Date | undefined;
140
149
  delayedUntil?: Date | undefined;
141
- expiredAt?: Date | undefined;
142
150
  }[] | undefined;
143
151
  };
144
152
  depth: number;
145
- triggerFunction: "triggerAndWait" | "trigger" | "batchTriggerAndWait" | "batchTrigger";
153
+ triggerFunction: "trigger" | "batchTrigger" | "triggerAndWait" | "batchTriggerAndWait";
146
154
  batchId?: string | undefined;
147
- version?: string | undefined;
148
155
  isQueued: boolean;
149
156
  isExecuting: boolean;
150
157
  isCompleted: boolean;
151
158
  isSuccess: boolean;
152
159
  isFailed: boolean;
153
160
  isCancelled: boolean;
154
- isTest: boolean;
155
- createdAt: Date;
156
- updatedAt: Date;
157
- startedAt?: Date | undefined;
158
161
  finishedAt?: Date | undefined;
159
162
  delayedUntil?: Date | undefined;
160
- expiredAt?: Date | undefined;
161
- costInCents: number;
162
- baseCostInCents: number;
163
163
  attempts: ({
164
164
  status: "EXECUTING" | "COMPLETED" | "CANCELED" | "FAILED" | "PENDING" | "PAUSED";
165
165
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/sdk",
3
- "version": "0.0.0-prerelease-20241202120601",
3
+ "version": "0.0.0-prerelease-20241202151711",
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-20241202120601",
43
+ "@trigger.dev/core": "0.0.0-prerelease-20241202151711",
44
44
  "chalk": "^5.2.0",
45
45
  "cronstrue": "^2.21.0",
46
46
  "debug": "^4.3.4",