@mastra/cloudflare-d1 1.0.0-beta.4 → 1.0.0-beta.5

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/cloudflare-d1
2
2
 
3
+ ## 1.0.0-beta.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Add delete workflow run API ([#10991](https://github.com/mastra-ai/mastra/pull/10991))
8
+
9
+ ```typescript
10
+ await workflow.deleteWorkflowRunById(runId);
11
+ ```
12
+
13
+ - Updated dependencies [[`edb07e4`](https://github.com/mastra-ai/mastra/commit/edb07e49283e0c28bd094a60e03439bf6ecf0221), [`b7e17d3`](https://github.com/mastra-ai/mastra/commit/b7e17d3f5390bb5a71efc112204413656fcdc18d), [`261473a`](https://github.com/mastra-ai/mastra/commit/261473ac637e633064a22076671e2e02b002214d), [`5d7000f`](https://github.com/mastra-ai/mastra/commit/5d7000f757cd65ea9dc5b05e662fd83dfd44e932), [`4f0331a`](https://github.com/mastra-ai/mastra/commit/4f0331a79bf6eb5ee598a5086e55de4b5a0ada03), [`8a000da`](https://github.com/mastra-ai/mastra/commit/8a000da0c09c679a2312f6b3aa05b2ca78ca7393)]:
14
+ - @mastra/core@1.0.0-beta.10
15
+
3
16
  ## 1.0.0-beta.4
4
17
 
5
18
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1906,6 +1906,25 @@ var WorkflowsStorageD1 = class extends storage.WorkflowsStorage {
1906
1906
  );
1907
1907
  }
1908
1908
  }
1909
+ async deleteWorkflowRunById({ runId, workflowName }) {
1910
+ const fullTableName = this.operations.getTableName(storage.TABLE_WORKFLOW_SNAPSHOT);
1911
+ try {
1912
+ const sql = `DELETE FROM ${fullTableName} WHERE workflow_name = ? AND run_id = ?`;
1913
+ const params = [workflowName, runId];
1914
+ await this.operations.executeQuery({ sql, params });
1915
+ } catch (error$1) {
1916
+ throw new error.MastraError(
1917
+ {
1918
+ id: storage.createStorageErrorId("CLOUDFLARE_D1", "DELETE_WORKFLOW_RUN_BY_ID", "FAILED"),
1919
+ domain: error.ErrorDomain.STORAGE,
1920
+ category: error.ErrorCategory.THIRD_PARTY,
1921
+ text: `Failed to delete workflow run by ID: ${error$1 instanceof Error ? error$1.message : String(error$1)}`,
1922
+ details: { runId, workflowName }
1923
+ },
1924
+ error$1
1925
+ );
1926
+ }
1927
+ }
1909
1928
  };
1910
1929
 
1911
1930
  // src/storage/index.ts
@@ -2087,6 +2106,9 @@ var D1Store = class extends storage.MastraStorage {
2087
2106
  }) {
2088
2107
  return this.stores.workflows.getWorkflowRunById({ runId, workflowName });
2089
2108
  }
2109
+ async deleteWorkflowRunById({ runId, workflowName }) {
2110
+ return this.stores.workflows.deleteWorkflowRunById({ runId, workflowName });
2111
+ }
2090
2112
  /**
2091
2113
  * Insert multiple records in a batch operation
2092
2114
  * @param tableName The table to insert into