@mastra/lance 1.3.0 → 1.3.1
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/docs/references/reference-rag-vector-databases.md +4 -4
- package/dist/index.cjs +17 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -15
- package/dist/index.js.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/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -530,21 +530,23 @@ var StoreBackgroundTasksLance = class extends BackgroundTasksStorage {
|
|
|
530
530
|
async createTask(task) {
|
|
531
531
|
await (await this.client.openTable(TABLE_BACKGROUND_TASKS)).add([toRecord(task)], { mode: "append" });
|
|
532
532
|
}
|
|
533
|
-
async updateTask(taskId, update) {
|
|
534
|
-
const
|
|
535
|
-
if (
|
|
536
|
-
|
|
537
|
-
if ("
|
|
538
|
-
if ("
|
|
539
|
-
if ("
|
|
540
|
-
if ("
|
|
541
|
-
if ("
|
|
542
|
-
if ("
|
|
543
|
-
if (
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
await
|
|
547
|
-
|
|
533
|
+
async updateTask(taskId, update, options) {
|
|
534
|
+
const values = {};
|
|
535
|
+
if ("status" in update) values.status = update.status;
|
|
536
|
+
if ("result" in update) values.result = serializeJson(update.result) ?? null;
|
|
537
|
+
if ("error" in update) values.error = serializeJson(update.error) ?? null;
|
|
538
|
+
if ("suspendPayload" in update) values.suspend_payload = serializeJson(update.suspendPayload) ?? null;
|
|
539
|
+
if ("retryCount" in update) values.retry_count = update.retryCount;
|
|
540
|
+
if ("startedAt" in update) values.startedAt = update.startedAt?.getTime() ?? 0;
|
|
541
|
+
if ("suspendedAt" in update) values.suspendedAt = update.suspendedAt?.getTime() ?? 0;
|
|
542
|
+
if ("completedAt" in update) values.completedAt = update.completedAt?.getTime() ?? 0;
|
|
543
|
+
if (Object.keys(values).length === 0) return false;
|
|
544
|
+
const conditions = [`id = '${escapeStr(taskId)}'`];
|
|
545
|
+
if (options?.expectedStatus) conditions.push(`status = '${escapeStr(options.expectedStatus)}'`);
|
|
546
|
+
return (await (await this.client.openTable(TABLE_BACKGROUND_TASKS)).update({
|
|
547
|
+
where: conditions.join(" AND "),
|
|
548
|
+
values
|
|
549
|
+
})).rowsUpdated > 0;
|
|
548
550
|
}
|
|
549
551
|
async getTask(taskId) {
|
|
550
552
|
try {
|