@mastra/dynamodb 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/dynamodb
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
@@ -1665,7 +1665,8 @@ var StoreOperationsDynamoDB = class extends storage.StoreOperations {
1665
1665
  [storage.TABLE_SCORERS]: "score",
1666
1666
  [storage.TABLE_TRACES]: "trace",
1667
1667
  [storage.TABLE_RESOURCES]: "resource",
1668
- [storage.TABLE_SPANS]: "ai_span"
1668
+ [storage.TABLE_SPANS]: "ai_span",
1669
+ mastra_agents: "agent"
1669
1670
  };
1670
1671
  return mapping[tableName] || null;
1671
1672
  }
@@ -2485,6 +2486,26 @@ var WorkflowStorageDynamoDB = class extends storage.WorkflowsStorage {
2485
2486
  );
2486
2487
  }
2487
2488
  }
2489
+ async deleteWorkflowRunById({ runId, workflowName }) {
2490
+ this.logger.debug("Deleting workflow run by ID", { runId, workflowName });
2491
+ try {
2492
+ await this.service.entities.workflow_snapshot.delete({
2493
+ entity: "workflow_snapshot",
2494
+ workflow_name: workflowName,
2495
+ run_id: runId
2496
+ }).go();
2497
+ } catch (error$1) {
2498
+ throw new error.MastraError(
2499
+ {
2500
+ id: storage.createStorageErrorId("DYNAMODB", "DELETE_WORKFLOW_RUN_BY_ID", "FAILED"),
2501
+ domain: error.ErrorDomain.STORAGE,
2502
+ category: error.ErrorCategory.THIRD_PARTY,
2503
+ details: { runId, workflowName }
2504
+ },
2505
+ error$1
2506
+ );
2507
+ }
2508
+ }
2488
2509
  };
2489
2510
 
2490
2511
  // src/storage/index.ts
@@ -2699,6 +2720,9 @@ var DynamoDBStore = class extends storage.MastraStorage {
2699
2720
  async getWorkflowRunById(args) {
2700
2721
  return this.stores.workflows.getWorkflowRunById(args);
2701
2722
  }
2723
+ async deleteWorkflowRunById({ runId, workflowName }) {
2724
+ return this.stores.workflows.deleteWorkflowRunById({ runId, workflowName });
2725
+ }
2702
2726
  async getResourceById({ resourceId }) {
2703
2727
  return this.stores.memory.getResourceById({ resourceId });
2704
2728
  }