@mastra/upstash 1.0.0-beta.0 → 1.0.0-beta.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 1.0.0-beta.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#10081](https://github.com/mastra-ai/mastra/pull/10081))
8
+ - Updated dependency [`@upstash/redis@^1.35.6` ↗︎](https://www.npmjs.com/package/@upstash/redis/v/1.35.6) (from `^1.35.5`, in `dependencies`)
9
+
10
+ - Add restart method to workflow run that allows restarting an active workflow run ([#9750](https://github.com/mastra-ai/mastra/pull/9750))
11
+ Add status filter to `listWorkflowRuns`
12
+ Add automatic restart to restart active workflow runs when server starts
13
+ - Updated dependencies [[`2319326`](https://github.com/mastra-ai/mastra/commit/2319326f8c64e503a09bbcf14be2dd65405445e0), [`d629361`](https://github.com/mastra-ai/mastra/commit/d629361a60f6565b5bfb11976fdaf7308af858e2), [`08c31c1`](https://github.com/mastra-ai/mastra/commit/08c31c188ebccd598acaf55e888b6397d01f7eae), [`fd3d338`](https://github.com/mastra-ai/mastra/commit/fd3d338a2c362174ed5b383f1f011ad9fb0302aa), [`c30400a`](https://github.com/mastra-ai/mastra/commit/c30400a49b994b1b97256fe785eb6c906fc2b232), [`69e0a87`](https://github.com/mastra-ai/mastra/commit/69e0a878896a2da9494945d86e056a5f8f05b851), [`01f8878`](https://github.com/mastra-ai/mastra/commit/01f88783de25e4de048c1c8aace43e26373c6ea5), [`4c77209`](https://github.com/mastra-ai/mastra/commit/4c77209e6c11678808b365d545845918c40045c8), [`d827d08`](https://github.com/mastra-ai/mastra/commit/d827d0808ffe1f3553a84e975806cc989b9735dd), [`23c10a1`](https://github.com/mastra-ai/mastra/commit/23c10a1efdd9a693c405511ab2dc8a1236603162), [`676ccc7`](https://github.com/mastra-ai/mastra/commit/676ccc7fe92468d2d45d39c31a87825c89fd1ea0), [`c10398d`](https://github.com/mastra-ai/mastra/commit/c10398d5b88f1d4af556f4267ff06f1d11e89179), [`00c2387`](https://github.com/mastra-ai/mastra/commit/00c2387f5f04a365316f851e58666ac43f8c4edf), [`ad6250d`](https://github.com/mastra-ai/mastra/commit/ad6250dbdaad927e29f74a27b83f6c468b50a705), [`3a73998`](https://github.com/mastra-ai/mastra/commit/3a73998fa4ebeb7f3dc9301afe78095fc63e7999), [`e16d553`](https://github.com/mastra-ai/mastra/commit/e16d55338403c7553531cc568125c63d53653dff), [`4d59f58`](https://github.com/mastra-ai/mastra/commit/4d59f58de2d90d6e2810a19d4518e38ddddb9038), [`e1bb9c9`](https://github.com/mastra-ai/mastra/commit/e1bb9c94b4eb68b019ae275981be3feb769b5365), [`351a11f`](https://github.com/mastra-ai/mastra/commit/351a11fcaf2ed1008977fa9b9a489fc422e51cd4)]:
14
+ - @mastra/core@1.0.0-beta.3
15
+
3
16
  ## 1.0.0-beta.0
4
17
 
5
18
  ### Major Changes
package/dist/index.cjs CHANGED
@@ -1380,7 +1380,8 @@ var WorkflowsUpstash = class extends storage.WorkflowsStorage {
1380
1380
  toDate,
1381
1381
  perPage,
1382
1382
  page,
1383
- resourceId
1383
+ resourceId,
1384
+ status
1384
1385
  }) {
1385
1386
  try {
1386
1387
  if (page !== void 0 && page < 0) {
@@ -1424,6 +1425,18 @@ var WorkflowsUpstash = class extends storage.WorkflowsStorage {
1424
1425
  ).filter((record) => !workflowName || record.workflow_name === workflowName).map((w) => parseWorkflowRun(w)).filter((w) => {
1425
1426
  if (fromDate && w.createdAt < fromDate) return false;
1426
1427
  if (toDate && w.createdAt > toDate) return false;
1428
+ if (status) {
1429
+ let snapshot = w.snapshot;
1430
+ if (typeof snapshot === "string") {
1431
+ try {
1432
+ snapshot = JSON.parse(snapshot);
1433
+ } catch (e) {
1434
+ console.warn(`Failed to parse snapshot for workflow ${w.workflowName}: ${e}`);
1435
+ return false;
1436
+ }
1437
+ }
1438
+ return snapshot.status === status;
1439
+ }
1427
1440
  return true;
1428
1441
  }).sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
1429
1442
  const total = runs.length;
@@ -1556,15 +1569,8 @@ var UpstashStore = class extends storage.MastraStorage {
1556
1569
  async loadWorkflowSnapshot(params) {
1557
1570
  return this.stores.workflows.loadWorkflowSnapshot(params);
1558
1571
  }
1559
- async listWorkflowRuns({
1560
- workflowName,
1561
- fromDate,
1562
- toDate,
1563
- perPage,
1564
- page,
1565
- resourceId
1566
- } = {}) {
1567
- return this.stores.workflows.listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId });
1572
+ async listWorkflowRuns(args = {}) {
1573
+ return this.stores.workflows.listWorkflowRuns(args);
1568
1574
  }
1569
1575
  async getWorkflowRunById({
1570
1576
  runId,