@mastra/lance 0.3.11 → 0.3.12-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/CHANGELOG.md +10 -0
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +2 -9
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +2 -9
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1883,11 +1883,13 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1883
1883
|
} else {
|
|
1884
1884
|
createdAt = now;
|
|
1885
1885
|
}
|
|
1886
|
+
const { status, value, ...rest } = snapshot;
|
|
1886
1887
|
const record = {
|
|
1887
1888
|
workflow_name: workflowName,
|
|
1888
1889
|
run_id: runId,
|
|
1889
1890
|
resourceId,
|
|
1890
|
-
snapshot: JSON.stringify(
|
|
1891
|
+
snapshot: JSON.stringify({ status, value, ...rest }),
|
|
1892
|
+
// this is to ensure status is always just before value, for when querying the db by status
|
|
1891
1893
|
createdAt,
|
|
1892
1894
|
updatedAt: now
|
|
1893
1895
|
};
|
|
@@ -1957,6 +1959,10 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1957
1959
|
if (args?.workflowName) {
|
|
1958
1960
|
conditions.push(`workflow_name = '${args.workflowName.replace(/'/g, "''")}'`);
|
|
1959
1961
|
}
|
|
1962
|
+
if (args?.status) {
|
|
1963
|
+
const escapedStatus = args.status.replace(/\\/g, "\\\\").replace(/'/g, "''").replace(/%/g, "\\%").replace(/_/g, "\\_");
|
|
1964
|
+
conditions.push(`\`snapshot\` LIKE '%"status":"${escapedStatus}","value"%'`);
|
|
1965
|
+
}
|
|
1960
1966
|
if (args?.resourceId) {
|
|
1961
1967
|
conditions.push(`\`resourceId\` = '${args.resourceId}'`);
|
|
1962
1968
|
}
|
|
@@ -1990,7 +1996,7 @@ var StoreWorkflowsLance = class extends WorkflowsStorage {
|
|
|
1990
1996
|
id: "LANCE_STORE_GET_WORKFLOW_RUNS_FAILED",
|
|
1991
1997
|
domain: ErrorDomain.STORAGE,
|
|
1992
1998
|
category: ErrorCategory.THIRD_PARTY,
|
|
1993
|
-
details: {
|
|
1999
|
+
details: { resourceId: args?.resourceId ?? "", workflowName: args?.workflowName ?? "" }
|
|
1994
2000
|
},
|
|
1995
2001
|
error
|
|
1996
2002
|
);
|