@pithy-sh/auth 0.1.3 → 0.1.4

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.
Files changed (82) hide show
  1. package/dist/admin/users.d.ts +2 -0
  2. package/dist/admin/users.js +2 -0
  3. package/dist/audit/actions.d.ts +2 -0
  4. package/dist/audit/actions.js +2 -0
  5. package/dist/audit/emit.d.ts +2 -0
  6. package/dist/audit/emit.js +2 -0
  7. package/dist/capability.d.ts +2 -0
  8. package/dist/capability.js +2 -0
  9. package/dist/client/api.d.ts +2 -0
  10. package/dist/client/api.js +2 -0
  11. package/dist/client/projection.d.ts +2 -0
  12. package/dist/client/projection.js +2 -0
  13. package/dist/data/betterAuth.d.ts +2 -0
  14. package/dist/data/betterAuth.js +2 -0
  15. package/dist/data/device.d.ts +2 -0
  16. package/dist/data/device.js +2 -0
  17. package/dist/data/kitFields.d.ts +2 -0
  18. package/dist/data/kitFields.js +2 -0
  19. package/dist/data/rotatedToken.d.ts +2 -0
  20. package/dist/data/rotatedToken.js +2 -0
  21. package/dist/data/tables.d.ts +2 -0
  22. package/dist/data/tables.js +2 -0
  23. package/dist/device/registry.d.ts +2 -0
  24. package/dist/device/registry.js +2 -0
  25. package/dist/email/send.d.ts +2 -0
  26. package/dist/email/send.js +2 -0
  27. package/dist/http/adminRoutes.d.ts +2 -0
  28. package/dist/http/adminRoutes.js +2 -0
  29. package/dist/http/baseUrl.d.ts +2 -0
  30. package/dist/http/baseUrl.js +2 -0
  31. package/dist/http/csrf.d.ts +2 -0
  32. package/dist/http/csrf.js +2 -0
  33. package/dist/http/devLoginRoute.d.ts +2 -0
  34. package/dist/http/devLoginRoute.js +2 -0
  35. package/dist/http/errors.d.ts +2 -0
  36. package/dist/http/errors.js +2 -0
  37. package/dist/http/guards.d.ts +2 -0
  38. package/dist/http/guards.js +2 -0
  39. package/dist/http/middleware.d.ts +2 -0
  40. package/dist/http/middleware.js +2 -0
  41. package/dist/http/rateLimit.d.ts +2 -0
  42. package/dist/http/rateLimit.js +2 -0
  43. package/dist/http/resolve.d.ts +2 -0
  44. package/dist/http/resolve.js +2 -0
  45. package/dist/http/responses.d.ts +2 -0
  46. package/dist/http/responses.js +2 -0
  47. package/dist/http/routes.d.ts +2 -0
  48. package/dist/http/routes.js +2 -0
  49. package/dist/http/schemas.d.ts +2 -0
  50. package/dist/http/schemas.js +2 -0
  51. package/dist/http/views.d.ts +2 -0
  52. package/dist/http/views.js +2 -0
  53. package/dist/i18n/errorCopy.d.ts +2 -0
  54. package/dist/i18n/errorCopy.es.d.ts +2 -0
  55. package/dist/i18n/errorCopy.es.js +2 -0
  56. package/dist/i18n/errorCopy.js +2 -0
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.js +2 -0
  59. package/dist/instance/auth.d.ts +2 -0
  60. package/dist/instance/auth.js +2 -0
  61. package/dist/instance/plugins.d.ts +2 -0
  62. package/dist/instance/plugins.js +2 -0
  63. package/dist/instance/providers.d.ts +2 -0
  64. package/dist/instance/providers.js +2 -0
  65. package/dist/instance/secrets.d.ts +2 -0
  66. package/dist/instance/secrets.js +2 -0
  67. package/dist/migrations/0001_init.d.ts +2 -0
  68. package/dist/migrations/0001_init.js +2 -0
  69. package/dist/migrations/pluginTables.d.ts +2 -0
  70. package/dist/migrations/pluginTables.js +2 -0
  71. package/dist/seeds/devSession.d.ts +2 -0
  72. package/dist/seeds/devSession.js +2 -0
  73. package/dist/seeds/example.d.ts +2 -0
  74. package/dist/seeds/example.js +2 -0
  75. package/dist/test-utils/liveApp.d.ts +2 -0
  76. package/dist/test-utils/liveApp.js +2 -0
  77. package/dist/token/rotation.d.ts +2 -0
  78. package/dist/token/rotation.js +2 -0
  79. package/dist/version.generated.d.ts +3 -1
  80. package/dist/version.generated.js +3 -1
  81. package/package.json +6 -6
  82. package/src/version.generated.ts +1 -1
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Session, User } from "../data/betterAuth";
2
4
  import { Device, type DevicePlatform } from "../data/device";
3
5
  import type { AuthDatabase } from "../data/tables";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Session, User } from "../data/betterAuth.js";
2
4
  import { Device } from "../data/device.js";
3
5
  import { ValidationError } from "@pithy-sh/core/src/error/pithyError";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The audit action codes `@pithy-sh/auth` emits, as `domain/reason` strings under the `auth` domain.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/audit/actions.ts
2
4
  /**
3
5
  * The audit action codes `@pithy-sh/auth` emits, as `domain/reason` strings under the `auth` domain.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuditEmit } from "@pithy-sh/core/src/audit/recorder";
2
4
  /**
3
5
  * Audit emission helpers, kept out of the instance so the hook wiring stays legible. Every helper goes
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { AuthAuditActions } from "./actions.js";
2
4
  //#region src/audit/emit.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Capability } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { EmailCapability } from "@pithy-sh/email/src/capability";
3
5
  import { type TurnstileMode } from "@pithy-sh/turnstile/src/config/config";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authTables } from "./data/tables.js";
2
4
  import { publishSameOrigin } from "./http/csrf.js";
3
5
  import { authSecretsRegistry } from "./instance/secrets.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The browser half of `@pithy-sh/auth`: the one place that knows how a browser program makes a
3
5
  * same-origin, cookie-bearing request to this Worker, and the calls made through it — the six a
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/api.ts
2
4
  /**
3
5
  * The browser half of `@pithy-sh/auth`: the one place that knows how a browser program makes a
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * What a browser may know about this project's auth — the shape of `virtual:pithy/auth`.
3
5
  *
@@ -0,0 +1,2 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /** `pithy_auth_users` — one end user. Text/UUID id (anti-enumeration); email is unique. */
3
5
  export declare const User: z.ZodObject<{
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { JsonDate, SQLiteBoolean } from "@pithy-sh/core/src/data/codecs";
3
5
  import { Locale } from "@pithy-sh/core/src/i18n/locale";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * `pithy_auth_devices` — the device registry, a Pithy-specific table with no Better-Auth equivalent.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
3
5
  //#region src/data/device.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The columns Pithy adds to Better Auth's own tables, declared **once**.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Locale } from "@pithy-sh/core/src/i18n/locale";
2
4
  //#region src/data/kitFields.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * `pithy_auth_rotated_tokens` — the reuse-detection ledger, a Pithy-specific table with no
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
3
5
  //#region src/data/rotatedToken.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { type DatabaseSchema } from "@pithy-sh/core/src/data/db";
3
5
  import type { Kysely } from "kysely";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Account, Jwks, RateLimit, Session, User, Verification } from "./betterAuth.js";
2
4
  import { Device } from "./device.js";
3
5
  import { RotatedToken } from "./rotatedToken.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Device, DevicePlatform } from "../data/device";
2
4
  import type { AuthDatabase } from "../data/tables";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Device, DevicePlatform } from "../data/device.js";
2
4
  //#region src/device/registry.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { EmailCapability } from "@pithy-sh/email/src/capability";
2
4
  import type { SendAuthEmail } from "../instance/auth";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/email/send.ts
2
4
  /**
3
5
  * Build the `sendEmail` the auth instance calls from its magic-link / OTP hooks.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { Hono } from "hono";
3
5
  import type { AuthWiring } from "../capability";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authDatabase } from "../data/tables.js";
2
4
  import { AuthAuditActions } from "../audit/actions.js";
3
5
  import { correlation, emitControlPlaneAction } from "../audit/emit.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type AmbientEnv } from "@pithy-sh/core/src/env/ambient";
2
4
  /**
3
5
  * The scheme every `dev` composition serves on.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ambientEnv, compositionEnvironment } from "@pithy-sh/core/src/env/ambient";
2
4
  //#region src/http/baseUrl.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyMiddleware } from "@pithy-sh/core/src/capability/capability";
2
4
  import { type AmbientEnv } from "@pithy-sh/core/src/env/ambient";
3
5
  import type { AuthWiring } from "../capability";
package/dist/http/csrf.js CHANGED
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { baseURLResolver } from "./baseUrl.js";
2
4
  import { ForbiddenError } from "@pithy-sh/core/src/error/pithyError";
3
5
  import { ambientEnv } from "@pithy-sh/core/src/env/ambient";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import { type AmbientEnv } from "@pithy-sh/core/src/env/ambient";
3
5
  import type { Hono } from "hono";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authDatabase } from "../data/tables.js";
2
4
  import { resolveSessionSecret } from "../instance/secrets.js";
3
5
  import { DEV_SESSION_COOKIE_NAME, DEV_SESSION_TOKEN_PREFIX, secretFingerprint, signCookieValue } from "../seeds/devSession.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
2
4
  /**
3
5
  * Translate a thrown Better-Auth `APIError` into the matching `PithyError` subclass, by HTTP status.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ConflictError, ForbiddenError, InternalError, NotFoundError, PithyError, RateLimitError, UnauthorizedError, ValidationError } from "@pithy-sh/core/src/error/pithyError";
2
4
  import { isAPIError } from "better-auth/api";
3
5
  //#region src/http/errors.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AdminRoute } from "@pithy-sh/core/src/controlPlane/discovery/adminRoute";
2
4
  import type { ControlPlaneScope } from "@pithy-sh/core/src/controlPlane/scope/scope";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/http/guards.ts
2
4
  /**
3
5
  * Auth's control-plane scopes, and the admin surface a manifest advertises.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv, PithyMiddleware } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { MiddlewareHandler } from "hono";
3
5
  import type { AuthWiring } from "../capability";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { getAuthInstance } from "./resolve.js";
2
4
  import { UnauthorizedError } from "@pithy-sh/core/src/error/pithyError";
3
5
  import { isLocale } from "@pithy-sh/core/src/i18n/locale";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { MiddlewareHandler } from "hono";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { RateLimitError } from "@pithy-sh/core/src/error/pithyError";
2
4
  //#region src/http/rateLimit.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
3
5
  import type { Context } from "hono";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authDatabase } from "../data/tables.js";
2
4
  import { baseURLResolver } from "./baseUrl.js";
3
5
  import { resolveAppleCredentials, resolveFacebookCredentials, resolveGithubCredentials, resolveGoogleCredentials, resolveSessionSecret } from "../instance/secrets.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /** A user as a management client may see them. */
3
5
  export declare const AdminUserView: z.ZodObject<{
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { DevicePlatform } from "../data/device.js";
2
4
  import { z } from "zod";
3
5
  import { Locale } from "@pithy-sh/core/src/i18n/locale";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { Hono } from "hono";
3
5
  import type { AuthWiring } from "../capability";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authDatabase } from "../data/tables.js";
2
4
  import { correlation, emitDenied, emitDeviceRevoked, emitTokenRefresh, emitTokenReuseDetected } from "../audit/emit.js";
3
5
  import { deleteDevice, deviceSessionTokens, listDevices } from "../device/registry.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The request schemas for the auth routes Pithy owns. Validation happens at the HTTP boundary
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { DevicePlatform } from "../data/device.js";
2
4
  import { z } from "zod";
3
5
  import { MAX_PAGE_SIZE } from "@pithy-sh/core/src/data/cursor";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Session, User } from "../data/betterAuth";
2
4
  import type { Device } from "../data/device";
3
5
  import type { AdminDeviceView, AdminSessionView, AdminUserView } from "./responses";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/http/views.ts
2
4
  /**
3
5
  * The admin projections — what a management client is shown of a user, a session, and a device.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { BetterAuthPlugin } from "better-auth";
2
4
  /**
3
5
  * Codes that stay English on purpose, and why.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * What this kit says in Spanish that `@better-auth/i18n` does not (#452).
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/i18n/errorCopy.es.ts
2
4
  /**
3
5
  * What this kit says in Spanish that `@better-auth/i18n` does not (#452).
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { AUTH_ERRORS_ES } from "./errorCopy.es.js";
2
4
  import { BASE_ERROR_CODES } from "better-auth";
3
5
  import { locales } from "@better-auth/i18n";
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The package entrypoint — the surface `pithy add auth` wires into `pithy.config.ts`. Deliberately
3
5
  * narrow: the capability factory, the `requireAuth()` gate other capabilities stack, and the data /
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { DevicePlatform } from "./data/device.js";
2
4
  import { authDatabase } from "./data/tables.js";
3
5
  import { AUTH_APPLE_CREDENTIALS, AUTH_GOOGLE_CREDENTIALS, AUTH_SESSION_SECRET, AppleOAuthCredentials, GoogleOAuthCredentials, authSecretsRegistry } from "./instance/secrets.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuditEmit } from "@pithy-sh/core/src/audit/recorder";
2
4
  import { type BetterAuthPlugin } from "better-auth";
3
5
  import type { AuthDatabase } from "../data/tables";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { emitAfterRequest, emitProviderUnavailable } from "../audit/emit.js";
2
4
  import { KIT_SESSION_FIELDS, KIT_USER_FIELDS } from "../data/kitFields.js";
3
5
  import { parseDeviceMeta, registerDevice } from "../device/registry.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { BetterAuthPlugin } from "better-auth";
2
4
  import { bearer } from "better-auth/plugins/bearer";
3
5
  import { emailOTP } from "better-auth/plugins/email-otp";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authErrorTranslations } from "../i18n/errorCopy.js";
2
4
  import { ValidationError } from "@pithy-sh/core/src/error/pithyError";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
2
4
  import type { AppleOAuthCredentials, FacebookOAuthCredentials, GithubOAuthCredentials, GoogleOAuthCredentials } from "./secrets";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
2
4
  import { z } from "zod";
3
5
  //#region src/instance/providers.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { SecretsStoreEnv } from "@pithy-sh/secrets/src/env/bindings";
2
4
  import { z } from "zod";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { defineSecretRegistry } from "@pithy-sh/secrets/src/registry";
3
5
  import { sharedSecretsStore } from "@pithy-sh/secrets/src/sharedSecretsStore";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Migration } from "kysely/migration";
2
4
  /**
3
5
  * Create the auth tables in the app database, all prefixed `pithy_auth_` so they never clash with an
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/migrations/0001_init.ts
2
4
  /**
3
5
  * Create the auth tables in the app database, all prefixed `pithy_auth_` so they never clash with an
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { BetterAuthOptions, BetterAuthPlugin } from "better-auth";
2
4
  import type { Migration } from "kysely/migration";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { authTables } from "../data/tables.js";
2
4
  import { KIT_SESSION_FIELDS, KIT_USER_FIELDS } from "../data/kitFields.js";
3
5
  import { kitPlugins } from "../instance/plugins.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { DevLogin } from "@pithy-sh/core/src/seed/devLogin";
2
4
  import { type SeedSet } from "@pithy-sh/core/src/seed/seed";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Session } from "../data/betterAuth.js";
2
4
  import { DEV_PROTOCOL, sessionCookieName } from "../http/baseUrl.js";
3
5
  import { AUTH_SESSION_SECRET } from "../instance/secrets.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type SeedSet } from "@pithy-sh/core/src/seed/seed";
2
4
  /**
3
5
  * The canonical demo cast ({@link EXAMPLE_IDENTITIES}) as `pithy_auth_users` rows — the shared,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { User } from "../data/betterAuth.js";
2
4
  import { d1SeedGroup, defineSeed } from "@pithy-sh/core/src/seed/seed";
3
5
  import { EXAMPLE_IDENTITIES } from "@pithy-sh/core/src/seed/exampleIdentities";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuditEventInput } from "@pithy-sh/core/src/audit/auditEvent";
2
4
  /**
3
5
  * A real auth Worker on a real port, for the live suites (#84).
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { publishSameOrigin } from "../http/csrf.js";
2
4
  import { authSecretsRegistry } from "../instance/secrets.js";
3
5
  import { createSessionMiddleware } from "../http/middleware.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuthDatabase } from "../data/tables";
2
4
  /**
3
5
  * Refresh-token rotation primitives: the atomic consume that makes rotation race-safe, and the
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { RotatedToken } from "../data/rotatedToken.js";
2
4
  import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
3
5
  //#region src/token/rotation.ts
@@ -1,5 +1,7 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /** This package's npm name — the join key against a release feed. */
2
4
  export declare const PACKAGE_NAME = "@pithy-sh/auth";
3
5
  /** This package's version, stamped from its own package.json at generation time. */
4
- export declare const PACKAGE_VERSION = "0.1.3";
6
+ export declare const PACKAGE_VERSION = "0.1.4";
5
7
  //# sourceMappingURL=version.generated.d.ts.map
@@ -1,7 +1,9 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/version.generated.ts
2
4
  /** This package's npm name — the join key against a release feed. */
3
5
  const PACKAGE_NAME = "@pithy-sh/auth";
4
6
  /** This package's version, stamped from its own package.json at generation time. */
5
- const PACKAGE_VERSION = "0.1.3";
7
+ const PACKAGE_VERSION = "0.1.4";
6
8
  //#endregion
7
9
  export { PACKAGE_NAME, PACKAGE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pithy-sh/auth",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "scripts": {
29
- "build": "tsdown && tsc -p tsconfig.build.json",
29
+ "build": "tsdown && tsc -p tsconfig.build.json && bun ../../tooling/build/src/stampDeclarations.ts",
30
30
  "typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.client.json",
31
31
  "test": "vitest run",
32
32
  "test:node": "vitest run --project=node",
@@ -39,10 +39,10 @@
39
39
  "@better-auth/i18n": "^1.7.1",
40
40
  "@cloudflare/workers-types": "^5.20260729.1",
41
41
  "@hono/zod-validator": "^0.9.0",
42
- "@pithy-sh/core": "^0.1.3",
43
- "@pithy-sh/email": "^0.1.3",
44
- "@pithy-sh/secrets": "^0.1.3",
45
- "@pithy-sh/turnstile": "^0.1.3",
42
+ "@pithy-sh/core": "^0.1.5",
43
+ "@pithy-sh/email": "^0.1.4",
44
+ "@pithy-sh/secrets": "^0.1.4",
45
+ "@pithy-sh/turnstile": "^0.1.4",
46
46
  "better-auth": "^1.7.1"
47
47
  },
48
48
  "devDependencies": {
@@ -13,4 +13,4 @@
13
13
  export const PACKAGE_NAME = "@pithy-sh/auth";
14
14
 
15
15
  /** This package's version, stamped from its own package.json at generation time. */
16
- export const PACKAGE_VERSION = "0.1.3";
16
+ export const PACKAGE_VERSION = "0.1.4";