@mastra/deployer 0.16.1-alpha.0 → 0.16.1-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.
@@ -8565,7 +8565,7 @@ async function getAITraceHandler(c2) {
8565
8565
  async function getAITracesPaginatedHandler(c2) {
8566
8566
  try {
8567
8567
  const mastra = c2.get("mastra");
8568
- const { page, perPage, name, spanType, start, end } = c2.req.query();
8568
+ const { page, perPage, name, spanType, dateRange, entityId, entityType } = c2.req.query();
8569
8569
  const pagination = {
8570
8570
  page: parseInt(page || "0"),
8571
8571
  perPage: parseInt(perPage || "10")
@@ -8579,23 +8579,23 @@ async function getAITracesPaginatedHandler(c2) {
8579
8579
  return c2.json({ error: "Invalid spanType" }, 400);
8580
8580
  }
8581
8581
  }
8582
- const dateRange = {};
8583
- if (start) {
8584
- try {
8585
- dateRange.start = new Date(start);
8586
- } catch {
8587
- return c2.json({ error: "Invalid start date" }, 400);
8588
- }
8582
+ if (entityId && entityType && (entityType === "agent" || entityType === "workflow")) {
8583
+ filters.entityId = entityId;
8584
+ filters.entityType = entityType;
8589
8585
  }
8590
- if (end) {
8586
+ let start;
8587
+ let end;
8588
+ if (dateRange) {
8591
8589
  try {
8592
- dateRange.end = new Date(end);
8590
+ const parsedDateRange = JSON.parse(dateRange);
8591
+ start = parsedDateRange.start ? new Date(parsedDateRange.start) : void 0;
8592
+ end = parsedDateRange.end ? new Date(parsedDateRange.end) : void 0;
8593
8593
  } catch {
8594
- return c2.json({ error: "Invalid end date" }, 400);
8594
+ return c2.json({ error: "Invalid start date" }, 400);
8595
8595
  }
8596
8596
  }
8597
- if (Object.keys(dateRange).length > 0) {
8598
- pagination.dateRange = dateRange;
8597
+ if (start || end) {
8598
+ pagination.dateRange = { start, end };
8599
8599
  }
8600
8600
  const result = await getAITracesPaginatedHandler$1({
8601
8601
  mastra,