@mastra/convex 1.5.4 → 1.5.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 +18 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.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-DsvFmckG.js → server-BYI0FabA.js} +7 -2
- package/dist/server-BYI0FabA.js.map +1 -0
- package/dist/{server-TpqkiEiY.cjs → server-CaNL9QLG.cjs} +7 -2
- package/dist/server-CaNL9QLG.cjs.map +1 -0
- package/dist/storage/db/index.d.ts +2 -1
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +3 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/types.d.ts +1 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/server-DsvFmckG.js.map +0 -1
- package/dist/server-TpqkiEiY.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as mastraCache, i as mastraStorage, n as mastraNativeVectorMutation, r as mastraNativeVectorQuery, t as mastraNativeVectorAction } from "./server-
|
|
1
|
+
import { a as mastraCache, i as mastraStorage, n as mastraNativeVectorMutation, r as mastraNativeVectorQuery, t as mastraNativeVectorAction } from "./server-BYI0FabA.js";
|
|
2
2
|
import { TABLE_BACKGROUND_TASKS, TABLE_CHANNEL_CONFIG, TABLE_CHANNEL_INSTALLATIONS, TABLE_MESSAGES, TABLE_OBSERVATIONAL_MEMORY, TABLE_RESOURCES, TABLE_SCHEDULES, TABLE_SCHEDULE_TRIGGERS, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, defineMastraNativeVectorTable, mastraBackgroundTasksTable, mastraCacheListItemsTable, mastraCacheTable, mastraChannelConfigTable, mastraChannelInstallationsTable, mastraDocumentsTable, mastraMessagesTable, mastraObservationalMemoryTable, mastraResourcesTable, mastraScheduleTriggersTable, mastraSchedulesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from "./schema.js";
|
|
3
3
|
import { MastraServerCache } from "@mastra/core/cache";
|
|
4
4
|
import { BackgroundTasksStorage, ChannelsStorage, MastraCompositeStore, MemoryStorage, SchedulesStorage, ScoresStorage, TABLE_BACKGROUND_TASKS as TABLE_BACKGROUND_TASKS$1, TABLE_CHANNEL_CONFIG as TABLE_CHANNEL_CONFIG$1, TABLE_CHANNEL_INSTALLATIONS as TABLE_CHANNEL_INSTALLATIONS$1, TABLE_MESSAGES as TABLE_MESSAGES$1, TABLE_RESOURCES as TABLE_RESOURCES$1, TABLE_SCHEDULES as TABLE_SCHEDULES$1, TABLE_SCHEDULE_TRIGGERS as TABLE_SCHEDULE_TRIGGERS$1, TABLE_SCORERS as TABLE_SCORERS$1, TABLE_THREADS as TABLE_THREADS$1, TABLE_WORKFLOW_SNAPSHOT as TABLE_WORKFLOW_SNAPSHOT$1, WorkflowsStorage, calculatePagination, createStorageErrorId, createVectorErrorId, filterByDateRange, normalizePerPage, normalizeScheduleTarget, safelyParseJSON, storageMessageMatchesMetadataFilter, validateStorageMetadataFilter } from "@mastra/core/storage";
|
|
@@ -314,12 +314,13 @@ var ConvexDB = class extends MastraBase {
|
|
|
314
314
|
records: records.map((record) => this.normalizeRecord(tableName, record))
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
async patch({ tableName, id, record }) {
|
|
317
|
+
async patch({ tableName, id, record, expected }) {
|
|
318
318
|
return this.client.callStorage({
|
|
319
319
|
op: "patch",
|
|
320
320
|
tableName,
|
|
321
321
|
id,
|
|
322
|
-
record: this.normalizePatch(record)
|
|
322
|
+
record: this.normalizePatch(record),
|
|
323
|
+
expected
|
|
323
324
|
});
|
|
324
325
|
}
|
|
325
326
|
async updateThread({ id, title, metadata, updatedAt }) {
|
|
@@ -637,13 +638,14 @@ var BackgroundTasksConvex = class extends BackgroundTasksStorage {
|
|
|
637
638
|
record: toStored(task)
|
|
638
639
|
});
|
|
639
640
|
}
|
|
640
|
-
async updateTask(taskId, update) {
|
|
641
|
+
async updateTask(taskId, update, options) {
|
|
641
642
|
const patch = toStoredPatch(update);
|
|
642
|
-
if (Object.keys(patch).length === 0) return;
|
|
643
|
-
|
|
643
|
+
if (Object.keys(patch).length === 0) return false;
|
|
644
|
+
return this.#db.patch({
|
|
644
645
|
tableName: TABLE_BACKGROUND_TASKS$1,
|
|
645
646
|
id: taskId,
|
|
646
|
-
record: patch
|
|
647
|
+
record: patch,
|
|
648
|
+
expected: options?.expectedStatus ? { status: options.expectedStatus } : void 0
|
|
647
649
|
});
|
|
648
650
|
}
|
|
649
651
|
async getTask(taskId) {
|