@mastra/upstash 0.15.9 → 0.15.10-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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.15.10-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Add restart method to workflow run that allows restarting an active workflow run ([#10703](https://github.com/mastra-ai/mastra/pull/10703))
8
+ Add status filter to `getWorkflowRuns`
9
+ Add automatic restart to restart active workflow runs when server starts
10
+ - Updated dependencies [[`5cc85aa`](https://github.com/mastra-ai/mastra/commit/5cc85aa4329773cac8314f3aa0146227b6b158e4), [`c53f8e6`](https://github.com/mastra-ai/mastra/commit/c53f8e68df42464935f9a63eb0fc765a65aacb83), [`386ab43`](https://github.com/mastra-ai/mastra/commit/386ab4350cf2a814fb4ac0a5fc6983ca93158ffe), [`2b62302`](https://github.com/mastra-ai/mastra/commit/2b623027a9d65c1dbc963bf651e9e6a9d09da1fa), [`7d85da4`](https://github.com/mastra-ai/mastra/commit/7d85da42a5fab56009a959a9c20328558d14f4b5), [`3d7c5bd`](https://github.com/mastra-ai/mastra/commit/3d7c5bdbee1b2693cd45bf207b960dd9b7277680), [`31b381e`](https://github.com/mastra-ai/mastra/commit/31b381efb48e031c0ecc46bc6e410ae6e67b88e5), [`e77a5f9`](https://github.com/mastra-ai/mastra/commit/e77a5f9718dc418e29e3c8a389299ed6dc0a6401), [`b069af5`](https://github.com/mastra-ai/mastra/commit/b069af514c4dcfc4fdcb164303569bfff1c26e3d), [`7dc8304`](https://github.com/mastra-ai/mastra/commit/7dc830420296db516b86dcec663e54d0309b8fb8), [`6942109`](https://github.com/mastra-ai/mastra/commit/694210903c70e3c26b5ce8ca4f4637ca2d9eb369), [`62d13f4`](https://github.com/mastra-ai/mastra/commit/62d13f4d1db1c16742831f210fe4c2caf8a26d57), [`358ab98`](https://github.com/mastra-ai/mastra/commit/358ab98024c388e383aca15616e8988bf4a5b66e)]:
11
+ - @mastra/core@0.24.7-alpha.1
12
+
3
13
  ## 0.15.9
4
14
 
5
15
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1717,7 +1717,8 @@ var WorkflowsUpstash = class extends storage.WorkflowsStorage {
1717
1717
  toDate,
1718
1718
  limit,
1719
1719
  offset,
1720
- resourceId
1720
+ resourceId,
1721
+ status
1721
1722
  }) {
1722
1723
  try {
1723
1724
  let pattern = getKey(storage.TABLE_WORKFLOW_SNAPSHOT, { namespace: "workflows" }) + ":*";
@@ -1750,6 +1751,18 @@ var WorkflowsUpstash = class extends storage.WorkflowsStorage {
1750
1751
  ).filter((record) => !workflowName || record.workflow_name === workflowName).map((w) => parseWorkflowRun(w)).filter((w) => {
1751
1752
  if (fromDate && w.createdAt < fromDate) return false;
1752
1753
  if (toDate && w.createdAt > toDate) return false;
1754
+ if (status) {
1755
+ let snapshot = w.snapshot;
1756
+ if (typeof snapshot === "string") {
1757
+ try {
1758
+ snapshot = JSON.parse(snapshot);
1759
+ } catch (e) {
1760
+ console.warn(`Failed to parse snapshot for workflow ${w.workflowName}: ${e}`);
1761
+ return false;
1762
+ }
1763
+ }
1764
+ return snapshot.status === status;
1765
+ }
1753
1766
  return true;
1754
1767
  }).sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
1755
1768
  const total = runs.length;
@@ -1932,15 +1945,8 @@ var UpstashStore = class extends storage.MastraStorage {
1932
1945
  async loadWorkflowSnapshot(params) {
1933
1946
  return this.stores.workflows.loadWorkflowSnapshot(params);
1934
1947
  }
1935
- async getWorkflowRuns({
1936
- workflowName,
1937
- fromDate,
1938
- toDate,
1939
- limit,
1940
- offset,
1941
- resourceId
1942
- } = {}) {
1943
- return this.stores.workflows.getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId });
1948
+ async getWorkflowRuns(args = {}) {
1949
+ return this.stores.workflows.getWorkflowRuns(args);
1944
1950
  }
1945
1951
  async getWorkflowRunById({
1946
1952
  runId,