@mastra/cloudflare-d1 1.0.0-beta.0 → 1.0.0-beta.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/index.js CHANGED
@@ -1798,13 +1798,18 @@ var WorkflowsStorageD1 = class extends WorkflowsStorage {
1798
1798
  toDate,
1799
1799
  page,
1800
1800
  perPage,
1801
- resourceId
1801
+ resourceId,
1802
+ status
1802
1803
  } = {}) {
1803
1804
  const fullTableName = this.operations.getTableName(TABLE_WORKFLOW_SNAPSHOT);
1804
1805
  try {
1805
1806
  const builder = createSqlBuilder().select().from(fullTableName);
1806
1807
  const countBuilder = createSqlBuilder().count().from(fullTableName);
1807
1808
  if (workflowName) builder.whereAnd("workflow_name = ?", workflowName);
1809
+ if (status) {
1810
+ builder.whereAnd("json_extract(snapshot, '$.status') = ?", status);
1811
+ countBuilder.whereAnd("json_extract(snapshot, '$.status') = ?", status);
1812
+ }
1808
1813
  if (resourceId) {
1809
1814
  const hasResourceId = await this.operations.hasColumn(fullTableName, "resourceId");
1810
1815
  if (hasResourceId) {
@@ -2064,15 +2069,8 @@ var D1Store = class extends MastraStorage {
2064
2069
  async loadWorkflowSnapshot(params) {
2065
2070
  return this.stores.workflows.loadWorkflowSnapshot(params);
2066
2071
  }
2067
- async listWorkflowRuns({
2068
- workflowName,
2069
- fromDate,
2070
- toDate,
2071
- perPage,
2072
- page,
2073
- resourceId
2074
- } = {}) {
2075
- return this.stores.workflows.listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId });
2072
+ async listWorkflowRuns(args = {}) {
2073
+ return this.stores.workflows.listWorkflowRuns(args);
2076
2074
  }
2077
2075
  async getWorkflowRunById({
2078
2076
  runId,