@mastra/convex 1.5.7 → 1.6.0-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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +14 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs +3 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.ts +5 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +3 -1
- package/dist/schema.js.map +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/storage.d.ts.map +1 -1
- package/dist/{server-D6F5bOWl.cjs → server-D5fx5hYY.cjs} +2 -2
- package/dist/server-D5fx5hYY.cjs.map +1 -0
- package/dist/{server-D8oEAyrJ.js → server-DEhttoZL.js} +2 -2
- package/dist/server-DEhttoZL.js.map +1 -0
- 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 +8 -8
- package/dist/server-D6F5bOWl.cjs.map +0 -1
- package/dist/server-D8oEAyrJ.js.map +0 -1
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_server = require("./server-
|
|
2
|
+
const require_server = require("./server-D5fx5hYY.cjs");
|
|
3
3
|
const require_schema = require("./schema.cjs");
|
|
4
4
|
let _mastra_core_cache = require("@mastra/core/cache");
|
|
5
5
|
let _mastra_core_storage = require("@mastra/core/storage");
|
|
@@ -569,7 +569,9 @@ function toStored(task) {
|
|
|
569
569
|
createdAt: task.createdAt.toISOString(),
|
|
570
570
|
startedAt: task.startedAt?.toISOString() ?? null,
|
|
571
571
|
suspendedAt: task.suspendedAt?.toISOString() ?? null,
|
|
572
|
-
completedAt: task.completedAt?.toISOString() ?? null
|
|
572
|
+
completedAt: task.completedAt?.toISOString() ?? null,
|
|
573
|
+
ownerId: task.ownerId ?? null,
|
|
574
|
+
leaseExpiresAt: task.leaseExpiresAt?.toISOString() ?? null
|
|
573
575
|
};
|
|
574
576
|
}
|
|
575
577
|
function toStoredPatch(update) {
|
|
@@ -584,6 +586,8 @@ function toStoredPatch(update) {
|
|
|
584
586
|
if ("startedAt" in update) patch.startedAt = update.startedAt?.toISOString() ?? null;
|
|
585
587
|
if ("suspendedAt" in update) patch.suspendedAt = update.suspendedAt?.toISOString() ?? null;
|
|
586
588
|
if ("completedAt" in update) patch.completedAt = update.completedAt?.toISOString() ?? null;
|
|
589
|
+
if ("ownerId" in update) patch.ownerId = update.ownerId ?? null;
|
|
590
|
+
if ("leaseExpiresAt" in update) patch.leaseExpiresAt = update.leaseExpiresAt?.toISOString() ?? null;
|
|
587
591
|
return patch;
|
|
588
592
|
}
|
|
589
593
|
function legacyOrCurrent(stored, currentKey, legacyKey) {
|
|
@@ -618,7 +622,9 @@ function fromStored(stored) {
|
|
|
618
622
|
createdAt: new Date(record.createdAt),
|
|
619
623
|
startedAt: record.startedAt ? new Date(record.startedAt) : void 0,
|
|
620
624
|
suspendedAt: record.suspendedAt ? new Date(record.suspendedAt) : void 0,
|
|
621
|
-
completedAt: record.completedAt ? new Date(record.completedAt) : void 0
|
|
625
|
+
completedAt: record.completedAt ? new Date(record.completedAt) : void 0,
|
|
626
|
+
ownerId: record.ownerId ?? void 0,
|
|
627
|
+
leaseExpiresAt: record.leaseExpiresAt ? new Date(record.leaseExpiresAt) : void 0
|
|
622
628
|
};
|
|
623
629
|
}
|
|
624
630
|
function hasDeleteFilter(filter) {
|
|
@@ -643,11 +649,15 @@ var BackgroundTasksConvex = class extends _mastra_core_storage.BackgroundTasksSt
|
|
|
643
649
|
async updateTask(taskId, update, options) {
|
|
644
650
|
const patch = toStoredPatch(update);
|
|
645
651
|
if (Object.keys(patch).length === 0) return false;
|
|
652
|
+
const expected = {};
|
|
653
|
+
if (options?.expectedStatus) expected.status = options.expectedStatus;
|
|
654
|
+
if (options?.expectedOwnerId !== void 0) expected.ownerId = options.expectedOwnerId;
|
|
655
|
+
if (options?.expectedLeaseExpiresAt !== void 0) expected.leaseExpiresAt = options.expectedLeaseExpiresAt?.toISOString() ?? null;
|
|
646
656
|
return this.#db.patch({
|
|
647
657
|
tableName: _mastra_core_storage.TABLE_BACKGROUND_TASKS,
|
|
648
658
|
id: taskId,
|
|
649
659
|
record: patch,
|
|
650
|
-
expected:
|
|
660
|
+
expected: Object.keys(expected).length > 0 ? expected : void 0
|
|
651
661
|
});
|
|
652
662
|
}
|
|
653
663
|
async getTask(taskId) {
|