@mastra/mongodb 1.0.0-beta.5 → 1.0.0-beta.6

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
@@ -11,7 +11,7 @@ import { saveScorePayloadSchema } from '@mastra/core/evals';
11
11
 
12
12
  // package.json
13
13
  var package_default = {
14
- version: "1.0.0-beta.5"};
14
+ version: "1.0.0-beta.6"};
15
15
  var MongoDBFilterTranslator = class extends BaseFilterTranslator {
16
16
  getSupportedOperators() {
17
17
  return {
@@ -2378,6 +2378,22 @@ var WorkflowsStorageMongoDB = class extends WorkflowsStorage {
2378
2378
  );
2379
2379
  }
2380
2380
  }
2381
+ async deleteWorkflowRunById({ runId, workflowName }) {
2382
+ try {
2383
+ const collection = await this.operations.getCollection(TABLE_WORKFLOW_SNAPSHOT);
2384
+ await collection.deleteOne({ workflow_name: workflowName, run_id: runId });
2385
+ } catch (error) {
2386
+ throw new MastraError(
2387
+ {
2388
+ id: createStorageErrorId("MONGODB", "DELETE_WORKFLOW_RUN_BY_ID", "FAILED"),
2389
+ domain: ErrorDomain.STORAGE,
2390
+ category: ErrorCategory.THIRD_PARTY,
2391
+ details: { runId, workflowName }
2392
+ },
2393
+ error
2394
+ );
2395
+ }
2396
+ }
2381
2397
  parseWorkflowRun(row) {
2382
2398
  let parsedSnapshot = row.snapshot;
2383
2399
  if (typeof parsedSnapshot === "string") {
@@ -2562,6 +2578,9 @@ var MongoDBStore = class extends MastraStorage {
2562
2578
  }) {
2563
2579
  return this.stores.workflows.getWorkflowRunById({ runId, workflowName });
2564
2580
  }
2581
+ async deleteWorkflowRunById({ runId, workflowName }) {
2582
+ return this.stores.workflows.deleteWorkflowRunById({ runId, workflowName });
2583
+ }
2565
2584
  async close() {
2566
2585
  try {
2567
2586
  await this.#connector.close();