@strapi-community/plugin-better-auth-dashboard 1.1.0 → 1.1.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.
@@ -420,6 +420,14 @@ const dashUserOutput = utils.z.object({
420
420
  createdAt: utils.z.union([utils.z.string(), utils.z.number()]).nullable().optional(),
421
421
  updatedAt: utils.z.union([utils.z.string(), utils.z.number()]).nullable().optional()
422
422
  });
423
+ function normalizeDashDate(value) {
424
+ if (value == null) return null;
425
+ if (value instanceof Date) return value.toISOString();
426
+ if (typeof value === "string" || typeof value === "number") return value;
427
+ const maybe = value;
428
+ if (typeof maybe.toISOString === "function") return maybe.toISOString();
429
+ return String(value);
430
+ }
423
431
  function mapDashUser(u) {
424
432
  return {
425
433
  id: u.id,
@@ -430,9 +438,9 @@ function mapDashUser(u) {
430
438
  role: u.role ?? null,
431
439
  banned: u.banned ?? null,
432
440
  banReason: u.banReason ?? null,
433
- banExpires: u.banExpires ?? null,
434
- createdAt: u.createdAt ?? null,
435
- updatedAt: u.updatedAt ?? null
441
+ banExpires: normalizeDashDate(u.banExpires),
442
+ createdAt: normalizeDashDate(u.createdAt),
443
+ updatedAt: normalizeDashDate(u.updatedAt)
436
444
  };
437
445
  }
438
446
  function registerBanTools(mcp) {
@@ -614,7 +622,9 @@ function registerSignupsGraph(mcp) {
614
622
  return toolResult({
615
623
  period: graph.period ?? args.period,
616
624
  points: (graph.data ?? []).map((p) => ({
617
- date: String(p.date ?? ""),
625
+ // dash() returns `date` as a JS Date; emit ISO (machine-readable)
626
+ // rather than the locale `String(Date)` form ("Tue Jun 16 2026 …").
627
+ date: String(normalizeDashDate(p.date) ?? ""),
618
628
  label: String(p.label ?? ""),
619
629
  totalUsers: Number(p.totalUsers ?? 0),
620
630
  newUsers: Number(p.newUsers ?? 0),
@@ -418,6 +418,14 @@ const dashUserOutput = z.object({
418
418
  createdAt: z.union([z.string(), z.number()]).nullable().optional(),
419
419
  updatedAt: z.union([z.string(), z.number()]).nullable().optional()
420
420
  });
421
+ function normalizeDashDate(value) {
422
+ if (value == null) return null;
423
+ if (value instanceof Date) return value.toISOString();
424
+ if (typeof value === "string" || typeof value === "number") return value;
425
+ const maybe = value;
426
+ if (typeof maybe.toISOString === "function") return maybe.toISOString();
427
+ return String(value);
428
+ }
421
429
  function mapDashUser(u) {
422
430
  return {
423
431
  id: u.id,
@@ -428,9 +436,9 @@ function mapDashUser(u) {
428
436
  role: u.role ?? null,
429
437
  banned: u.banned ?? null,
430
438
  banReason: u.banReason ?? null,
431
- banExpires: u.banExpires ?? null,
432
- createdAt: u.createdAt ?? null,
433
- updatedAt: u.updatedAt ?? null
439
+ banExpires: normalizeDashDate(u.banExpires),
440
+ createdAt: normalizeDashDate(u.createdAt),
441
+ updatedAt: normalizeDashDate(u.updatedAt)
434
442
  };
435
443
  }
436
444
  function registerBanTools(mcp) {
@@ -612,7 +620,9 @@ function registerSignupsGraph(mcp) {
612
620
  return toolResult({
613
621
  period: graph.period ?? args.period,
614
622
  points: (graph.data ?? []).map((p) => ({
615
- date: String(p.date ?? ""),
623
+ // dash() returns `date` as a JS Date; emit ISO (machine-readable)
624
+ // rather than the locale `String(Date)` form ("Tue Jun 16 2026 …").
625
+ date: String(normalizeDashDate(p.date) ?? ""),
616
626
  label: String(p.label ?? ""),
617
627
  totalUsers: Number(p.totalUsers ?? 0),
618
628
  newUsers: Number(p.newUsers ?? 0),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi-community/plugin-better-auth-dashboard",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Better Auth dashboard for the Strapi admin panel",
5
5
  "keywords": [
6
6
  "strapi",