@spfn/auth 0.3.0-beta.2 → 0.3.0-beta.20

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 (43) hide show
  1. package/README.md +1382 -23
  2. package/dist/client-proof.d.ts +45 -15
  3. package/dist/client-proof.js +198 -4
  4. package/dist/client-proof.js.map +1 -1
  5. package/dist/client.d.ts +92 -1
  6. package/dist/client.js +58 -0
  7. package/dist/client.js.map +1 -1
  8. package/dist/config.d.ts +302 -0
  9. package/dist/config.js +134 -4
  10. package/dist/config.js.map +1 -1
  11. package/dist/errors.d.ts +370 -3
  12. package/dist/errors.js +245 -2
  13. package/dist/errors.js.map +1 -1
  14. package/dist/index.d.ts +185 -2
  15. package/dist/index.js +256 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/machine-principals-BD4tnASp.d.ts +2739 -0
  18. package/dist/nextjs/api.js +350 -12
  19. package/dist/nextjs/api.js.map +1 -1
  20. package/dist/nextjs/client.d.ts +28 -1
  21. package/dist/nextjs/client.js +24 -3
  22. package/dist/nextjs/client.js.map +1 -1
  23. package/dist/nextjs/server.d.ts +173 -3
  24. package/dist/nextjs/server.js +372 -10
  25. package/dist/nextjs/server.js.map +1 -1
  26. package/dist/server.d.ts +3761 -414
  27. package/dist/server.js +5865 -1043
  28. package/dist/server.js.map +1 -1
  29. package/dist/{session-DTHahDQ9.d.ts → session-Dfwu5g2W.d.ts} +28 -1
  30. package/migrations/20260810112144_colorful_tomorrow_man/migration.sql +18 -0
  31. package/migrations/20260810112144_colorful_tomorrow_man/snapshot.json +3576 -0
  32. package/migrations/20260901091716_fine_arclight/migration.sql +21 -0
  33. package/migrations/20260901091716_fine_arclight/snapshot.json +3849 -0
  34. package/migrations/20260906155957_natural_moonstone/migration.sql +33 -0
  35. package/migrations/20260906155957_natural_moonstone/snapshot.json +4275 -0
  36. package/migrations/20260907020904_giant_eternals/migration.sql +21 -0
  37. package/migrations/20260907020904_giant_eternals/snapshot.json +4561 -0
  38. package/migrations/20260907044807_eminent_angel/migration.sql +2 -0
  39. package/migrations/20260907044807_eminent_angel/snapshot.json +4561 -0
  40. package/migrations/20260918083158_foamy_roughhouse/migration.sql +55 -0
  41. package/migrations/20260918083158_foamy_roughhouse/snapshot.json +5271 -0
  42. package/package.json +9 -6
  43. package/dist/authenticate-55LeXHqZ.d.ts +0 -1447
@@ -0,0 +1,33 @@
1
+ CREATE TABLE "spfn_auth"."passkeys" (
2
+ "id" bigserial PRIMARY KEY,
3
+ "user_id" bigint NOT NULL,
4
+ "credential_id" text NOT NULL UNIQUE,
5
+ "public_key" text NOT NULL,
6
+ "counter" integer DEFAULT 0 NOT NULL,
7
+ "transports" text[],
8
+ "device_type" text NOT NULL,
9
+ "backed_up" boolean DEFAULT false NOT NULL,
10
+ "aaguid" text,
11
+ "label" text,
12
+ "last_used_at" timestamp with time zone,
13
+ "revoked_at" timestamp with time zone,
14
+ "revoked_reason" text,
15
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
16
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
17
+ );
18
+ --> statement-breakpoint
19
+ CREATE TABLE "spfn_auth"."webauthn_challenges" (
20
+ "id" bigserial PRIMARY KEY,
21
+ "challenge_hash" text NOT NULL,
22
+ "kind" text NOT NULL,
23
+ "user_id" bigint,
24
+ "expires_at" timestamp with time zone NOT NULL,
25
+ "consumed_at" timestamp with time zone,
26
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL
27
+ );
28
+ --> statement-breakpoint
29
+ CREATE INDEX "passkeys_user_id_idx" ON "spfn_auth"."passkeys" ("user_id");--> statement-breakpoint
30
+ CREATE UNIQUE INDEX "webauthn_challenge_hash_idx" ON "spfn_auth"."webauthn_challenges" ("challenge_hash");--> statement-breakpoint
31
+ CREATE INDEX "webauthn_challenges_expires_at_idx" ON "spfn_auth"."webauthn_challenges" ("expires_at");--> statement-breakpoint
32
+ ALTER TABLE "spfn_auth"."passkeys" ADD CONSTRAINT "passkeys_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "spfn_auth"."users"("id") ON DELETE CASCADE;--> statement-breakpoint
33
+ ALTER TABLE "spfn_auth"."webauthn_challenges" ADD CONSTRAINT "webauthn_challenges_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "spfn_auth"."users"("id") ON DELETE CASCADE;