@mastra/cloudflare 0.13.3 → 0.13.4-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/dist/index.js CHANGED
@@ -2029,7 +2029,7 @@ var WorkflowsStorageCloudflare = class extends WorkflowsStorage {
2029
2029
  workflow_name: workflowName,
2030
2030
  run_id: runId,
2031
2031
  resourceId,
2032
- snapshot: typeof snapshot === "string" ? snapshot : JSON.stringify(snapshot),
2032
+ snapshot: JSON.stringify(snapshot),
2033
2033
  createdAt: /* @__PURE__ */ new Date(),
2034
2034
  updatedAt: /* @__PURE__ */ new Date()
2035
2035
  }
@@ -2114,7 +2114,8 @@ var WorkflowsStorageCloudflare = class extends WorkflowsStorage {
2114
2114
  offset = 0,
2115
2115
  resourceId,
2116
2116
  fromDate,
2117
- toDate
2117
+ toDate,
2118
+ status
2118
2119
  } = {}) {
2119
2120
  try {
2120
2121
  const prefix = this.buildWorkflowSnapshotPrefix({ workflowName });
@@ -2132,10 +2133,11 @@ var WorkflowsStorageCloudflare = class extends WorkflowsStorage {
2132
2133
  if (!data) continue;
2133
2134
  try {
2134
2135
  if (resourceId && !keyResourceId) continue;
2136
+ const snapshotData = typeof data.snapshot === "string" ? JSON.parse(data.snapshot) : data.snapshot;
2137
+ if (status && snapshotData.status !== status) continue;
2135
2138
  const createdAt = ensureDate(data.createdAt);
2136
2139
  if (fromDate && createdAt && createdAt < fromDate) continue;
2137
2140
  if (toDate && createdAt && createdAt > toDate) continue;
2138
- const snapshotData = typeof data.snapshot === "string" ? JSON.parse(data.snapshot) : data.snapshot;
2139
2141
  const resourceIdToUse = keyResourceId || data.resourceId;
2140
2142
  const run = this.parseWorkflowRun({
2141
2143
  ...data,
@@ -2432,22 +2434,8 @@ var CloudflareStore = class extends MastraStorage {
2432
2434
  async getEvals(options) {
2433
2435
  return this.stores.legacyEvals.getEvals(options);
2434
2436
  }
2435
- async getWorkflowRuns({
2436
- workflowName,
2437
- limit = 20,
2438
- offset = 0,
2439
- resourceId,
2440
- fromDate,
2441
- toDate
2442
- } = {}) {
2443
- return this.stores.workflows.getWorkflowRuns({
2444
- workflowName,
2445
- limit,
2446
- offset,
2447
- resourceId,
2448
- fromDate,
2449
- toDate
2450
- });
2437
+ async getWorkflowRuns(args = {}) {
2438
+ return this.stores.workflows.getWorkflowRuns(args);
2451
2439
  }
2452
2440
  async getWorkflowRunById({
2453
2441
  runId,