@mastra/upstash 1.1.0 → 1.1.1-alpha.0

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.js CHANGED
@@ -170,11 +170,13 @@ function toStorageRecord(task) {
170
170
  args: task.args,
171
171
  result: task.result ?? null,
172
172
  error: task.error ?? null,
173
+ suspend_payload: task.suspendPayload ?? null,
173
174
  retry_count: task.retryCount,
174
175
  max_retries: task.maxRetries,
175
176
  timeout_ms: task.timeoutMs,
176
177
  createdAt: task.createdAt.toISOString(),
177
178
  startedAt: task.startedAt?.toISOString() ?? null,
179
+ suspendedAt: task.suspendedAt?.toISOString() ?? null,
178
180
  completedAt: task.completedAt?.toISOString() ?? null
179
181
  };
180
182
  }
@@ -191,11 +193,13 @@ function fromStorageRecord(record) {
191
193
  runId: record.run_id ?? "",
192
194
  result: record.result ?? void 0,
193
195
  error: record.error ?? void 0,
196
+ suspendPayload: record.suspend_payload ?? void 0,
194
197
  retryCount: Number(record.retry_count ?? 0),
195
198
  maxRetries: Number(record.max_retries ?? 0),
196
199
  timeoutMs: Number(record.timeout_ms ?? 3e5),
197
200
  createdAt: new Date(record.createdAt),
198
201
  startedAt: record.startedAt ? new Date(record.startedAt) : void 0,
202
+ suspendedAt: record.suspendedAt ? new Date(record.suspendedAt) : void 0,
199
203
  completedAt: record.completedAt ? new Date(record.completedAt) : void 0
200
204
  };
201
205
  }
@@ -223,8 +227,10 @@ var BackgroundTasksUpstash = class extends BackgroundTasksStorage {
223
227
  if ("status" in update) merged.status = update.status;
224
228
  if ("result" in update) merged.result = update.result;
225
229
  if ("error" in update) merged.error = update.error;
230
+ if ("suspendPayload" in update) merged.suspendPayload = update.suspendPayload;
226
231
  if ("retryCount" in update) merged.retryCount = update.retryCount;
227
232
  if ("startedAt" in update) merged.startedAt = update.startedAt;
233
+ if ("suspendedAt" in update) merged.suspendedAt = update.suspendedAt;
228
234
  if ("completedAt" in update) merged.completedAt = update.completedAt;
229
235
  const record = toStorageRecord(merged);
230
236
  const { key, processedRecord } = processRecord(TABLE_BACKGROUND_TASKS, record);
@@ -264,6 +270,9 @@ var BackgroundTasksUpstash = class extends BackgroundTasksStorage {
264
270
  if (filter.toolName) {
265
271
  tasks = tasks.filter((t) => t.toolName === filter.toolName);
266
272
  }
273
+ if (filter.toolCallId) {
274
+ tasks = tasks.filter((t) => t.toolCallId === filter.toolCallId);
275
+ }
267
276
  const dateCol = filter.dateFilterBy ?? "createdAt";
268
277
  if (filter.fromDate) {
269
278
  tasks = tasks.filter((t) => {