@mastra/pg 1.27.2-alpha.0 → 1.27.2-alpha.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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -23031,7 +23031,7 @@ var WorkflowsPG = class WorkflowsPG extends _mastra_core_storage.WorkflowsStorag
|
|
|
23031
23031
|
}, error);
|
|
23032
23032
|
}
|
|
23033
23033
|
}
|
|
23034
|
-
async listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, threadId, status } = {}) {
|
|
23034
|
+
async listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, threadId, status, summary } = {}) {
|
|
23035
23035
|
try {
|
|
23036
23036
|
const conditions = [];
|
|
23037
23037
|
const values = [];
|
|
@@ -23079,8 +23079,13 @@ var WorkflowsPG = class WorkflowsPG extends _mastra_core_storage.WorkflowsStorag
|
|
|
23079
23079
|
}
|
|
23080
23080
|
const normalizedPerPage = usePagination ? (0, _mastra_core_storage.normalizePerPage)(perPage, Number.MAX_SAFE_INTEGER) : 0;
|
|
23081
23081
|
const offset = usePagination ? page * normalizedPerPage : void 0;
|
|
23082
|
+
let selectList = "*";
|
|
23083
|
+
if (summary) {
|
|
23084
|
+
const snapshotJson = await this.#db.getColumnType(_mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT, "snapshot") === "jsonb" ? "snapshot" : `regexp_replace(snapshot::text, '\\\\u(0000|[Dd][89A-Fa-f][0-9A-Fa-f]{2})', '', 'g')::jsonb`;
|
|
23085
|
+
selectList = `workflow_name, run_id, "resourceId", "createdAt", "createdAtZ", "updatedAt", "updatedAtZ", jsonb_build_object('status', ${snapshotJson} -> 'status', 'timestamp', ${snapshotJson} -> 'timestamp') AS snapshot`;
|
|
23086
|
+
}
|
|
23082
23087
|
const query = `
|
|
23083
|
-
SELECT
|
|
23088
|
+
SELECT ${selectList} FROM ${getTableName({
|
|
23084
23089
|
indexName: _mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT,
|
|
23085
23090
|
schemaName: getSchemaName(this.#schema)
|
|
23086
23091
|
})}
|