@mastra/mongodb 1.19.1-alpha.0 → 1.20.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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-storage-retention.md +1 -1
- package/dist/index.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +2 -4
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/docs/SKILL.md
CHANGED
|
@@ -202,7 +202,7 @@ async function retentionTick() {
|
|
|
202
202
|
}
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
You can also cancel a long-running prune with an `AbortSignal`: the loop stops between batches and returns partial results with `done: false
|
|
205
|
+
You can also cancel a long-running prune with an `AbortSignal`: the loop stops between batches and returns partial results with `done: false`. The next run resumes cleanly.
|
|
206
206
|
|
|
207
207
|
## ClickHouse native TTL
|
|
208
208
|
|
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ let _mastra_core_agent = require("@mastra/core/agent");
|
|
|
10
10
|
let _mastra_core_evals = require("@mastra/core/evals");
|
|
11
11
|
let _mastra_core_storage_domains_skills = require("@mastra/core/storage/domains/skills");
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "1.
|
|
13
|
+
var version = "1.20.0";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/vector/filter.ts
|
|
16
16
|
/**
|
|
@@ -2378,7 +2378,9 @@ function toDoc(task) {
|
|
|
2378
2378
|
createdAt: task.createdAt.toISOString(),
|
|
2379
2379
|
startedAt: task.startedAt?.toISOString() ?? null,
|
|
2380
2380
|
suspendedAt: task.suspendedAt?.toISOString() ?? null,
|
|
2381
|
-
completedAt: task.completedAt?.toISOString() ?? null
|
|
2381
|
+
completedAt: task.completedAt?.toISOString() ?? null,
|
|
2382
|
+
ownerId: task.ownerId ?? null,
|
|
2383
|
+
leaseExpiresAt: task.leaseExpiresAt?.toISOString() ?? null
|
|
2382
2384
|
};
|
|
2383
2385
|
}
|
|
2384
2386
|
function fromDoc(doc) {
|
|
@@ -2401,7 +2403,9 @@ function fromDoc(doc) {
|
|
|
2401
2403
|
createdAt: new Date(doc.createdAt),
|
|
2402
2404
|
startedAt: doc.startedAt ? new Date(doc.startedAt) : void 0,
|
|
2403
2405
|
suspendedAt: doc.suspendedAt ? new Date(doc.suspendedAt) : void 0,
|
|
2404
|
-
completedAt: doc.completedAt ? new Date(doc.completedAt) : void 0
|
|
2406
|
+
completedAt: doc.completedAt ? new Date(doc.completedAt) : void 0,
|
|
2407
|
+
ownerId: doc.ownerId ?? void 0,
|
|
2408
|
+
leaseExpiresAt: doc.leaseExpiresAt ? new Date(doc.leaseExpiresAt) : void 0
|
|
2405
2409
|
};
|
|
2406
2410
|
}
|
|
2407
2411
|
var BackgroundTasksStorageMongoDB = class BackgroundTasksStorageMongoDB extends _mastra_core_storage.BackgroundTasksStorage {
|
|
@@ -2518,11 +2522,14 @@ var BackgroundTasksStorageMongoDB = class BackgroundTasksStorageMongoDB extends
|
|
|
2518
2522
|
if ("startedAt" in update) $set.startedAt = update.startedAt?.toISOString() ?? null;
|
|
2519
2523
|
if ("suspendedAt" in update) $set.suspendedAt = update.suspendedAt?.toISOString() ?? null;
|
|
2520
2524
|
if ("completedAt" in update) $set.completedAt = update.completedAt?.toISOString() ?? null;
|
|
2525
|
+
if ("ownerId" in update) $set.ownerId = update.ownerId ?? null;
|
|
2526
|
+
if ("leaseExpiresAt" in update) $set.leaseExpiresAt = update.leaseExpiresAt?.toISOString() ?? null;
|
|
2521
2527
|
if (Object.keys($set).length === 0) return false;
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2528
|
+
const filter = { id: taskId };
|
|
2529
|
+
if (options?.expectedStatus) filter.status = options.expectedStatus;
|
|
2530
|
+
if (options?.expectedOwnerId !== void 0) filter.ownerId = options.expectedOwnerId;
|
|
2531
|
+
if (options?.expectedLeaseExpiresAt !== void 0) filter.leaseExpiresAt = options.expectedLeaseExpiresAt?.toISOString() ?? null;
|
|
2532
|
+
return (await (await this.getCollection()).updateOne(filter, { $set })).matchedCount > 0;
|
|
2526
2533
|
}
|
|
2527
2534
|
async getTask(taskId) {
|
|
2528
2535
|
const doc = await (await this.getCollection()).findOne({ id: taskId });
|