@effect-auth/core 0.1.0-alpha.0 → 0.1.0-alpha.10

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 (222) hide show
  1. package/README.md +774 -36
  2. package/dist/ApiKey.d.ts +207 -0
  3. package/dist/ApiKey.d.ts.map +1 -0
  4. package/dist/ApiKey.js +275 -0
  5. package/dist/ApiKey.js.map +1 -0
  6. package/dist/AuditLog.d.ts +278 -1
  7. package/dist/AuditLog.d.ts.map +1 -1
  8. package/dist/AuditLog.js +217 -2
  9. package/dist/AuditLog.js.map +1 -1
  10. package/dist/AuthConfig.d.ts +42 -0
  11. package/dist/AuthConfig.d.ts.map +1 -0
  12. package/dist/AuthConfig.js +43 -0
  13. package/dist/AuthConfig.js.map +1 -0
  14. package/dist/AuthFlow.d.ts +465 -36
  15. package/dist/AuthFlow.d.ts.map +1 -1
  16. package/dist/AuthFlow.js +660 -5
  17. package/dist/AuthFlow.js.map +1 -1
  18. package/dist/AuthKernel.d.ts +3 -0
  19. package/dist/AuthKernel.d.ts.map +1 -0
  20. package/dist/AuthKernel.js +9 -0
  21. package/dist/AuthKernel.js.map +1 -0
  22. package/dist/Challenge.d.ts +27 -4
  23. package/dist/Challenge.d.ts.map +1 -1
  24. package/dist/Challenge.js +170 -1
  25. package/dist/Challenge.js.map +1 -1
  26. package/dist/Client.d.ts +378 -0
  27. package/dist/Client.d.ts.map +1 -0
  28. package/dist/Client.js +768 -0
  29. package/dist/Client.js.map +1 -0
  30. package/dist/Crypto.d.ts +9 -1
  31. package/dist/Crypto.d.ts.map +1 -1
  32. package/dist/Crypto.js +65 -1
  33. package/dist/Crypto.js.map +1 -1
  34. package/dist/EffectQbSqliteStorage.d.ts +600 -0
  35. package/dist/EffectQbSqliteStorage.d.ts.map +1 -0
  36. package/dist/EffectQbSqliteStorage.js +1637 -0
  37. package/dist/EffectQbSqliteStorage.js.map +1 -0
  38. package/dist/EmailOtp.d.ts +120 -0
  39. package/dist/EmailOtp.d.ts.map +1 -0
  40. package/dist/EmailOtp.js +286 -0
  41. package/dist/EmailOtp.js.map +1 -0
  42. package/dist/EmailVerification.d.ts +121 -0
  43. package/dist/EmailVerification.d.ts.map +1 -0
  44. package/dist/EmailVerification.js +200 -0
  45. package/dist/EmailVerification.js.map +1 -0
  46. package/dist/HttpApi/Api.d.ts +1956 -0
  47. package/dist/HttpApi/Api.d.ts.map +1 -0
  48. package/dist/HttpApi/Api.js +2325 -0
  49. package/dist/HttpApi/Api.js.map +1 -0
  50. package/dist/HttpApi/Endpoints.d.ts +945 -0
  51. package/dist/HttpApi/Endpoints.d.ts.map +1 -0
  52. package/dist/HttpApi/Endpoints.js +373 -0
  53. package/dist/HttpApi/Endpoints.js.map +1 -0
  54. package/dist/HttpApi/Errors.d.ts +82 -0
  55. package/dist/HttpApi/Errors.d.ts.map +1 -0
  56. package/dist/HttpApi/Errors.js +184 -0
  57. package/dist/HttpApi/Errors.js.map +1 -0
  58. package/dist/HttpApi/Schemas.d.ts +1113 -0
  59. package/dist/HttpApi/Schemas.d.ts.map +1 -0
  60. package/dist/HttpApi/Schemas.js +734 -0
  61. package/dist/HttpApi/Schemas.js.map +1 -0
  62. package/dist/HttpApi/Security.d.ts +159 -0
  63. package/dist/HttpApi/Security.d.ts.map +1 -0
  64. package/dist/HttpApi/Security.js +530 -0
  65. package/dist/HttpApi/Security.js.map +1 -0
  66. package/dist/HttpApi/Transport.d.ts +65 -0
  67. package/dist/HttpApi/Transport.d.ts.map +1 -0
  68. package/dist/HttpApi/Transport.js +311 -0
  69. package/dist/HttpApi/Transport.js.map +1 -0
  70. package/dist/HttpApi/index.d.ts +8 -0
  71. package/dist/HttpApi/index.d.ts.map +1 -0
  72. package/dist/HttpApi/index.js +7 -0
  73. package/dist/HttpApi/index.js.map +1 -0
  74. package/dist/HttpApi.d.ts +2 -0
  75. package/dist/HttpApi.d.ts.map +1 -0
  76. package/dist/HttpApi.js +2 -0
  77. package/dist/HttpApi.js.map +1 -0
  78. package/dist/Identifiers.d.ts.map +1 -1
  79. package/dist/Identifiers.js.map +1 -1
  80. package/dist/Internal.d.ts +7 -0
  81. package/dist/Internal.d.ts.map +1 -0
  82. package/dist/Internal.js +12 -0
  83. package/dist/Internal.js.map +1 -0
  84. package/dist/Jwt.d.ts +271 -0
  85. package/dist/Jwt.d.ts.map +1 -0
  86. package/dist/Jwt.js +512 -0
  87. package/dist/Jwt.js.map +1 -0
  88. package/dist/LoginApproval.d.ts +314 -0
  89. package/dist/LoginApproval.d.ts.map +1 -0
  90. package/dist/LoginApproval.js +551 -0
  91. package/dist/LoginApproval.js.map +1 -0
  92. package/dist/LoginNotification.d.ts +183 -0
  93. package/dist/LoginNotification.d.ts.map +1 -0
  94. package/dist/LoginNotification.js +329 -0
  95. package/dist/LoginNotification.js.map +1 -0
  96. package/dist/LoginRisk.d.ts +73 -0
  97. package/dist/LoginRisk.d.ts.map +1 -0
  98. package/dist/LoginRisk.js +57 -0
  99. package/dist/LoginRisk.js.map +1 -0
  100. package/dist/MagicLink.d.ts +85 -0
  101. package/dist/MagicLink.d.ts.map +1 -0
  102. package/dist/MagicLink.js +206 -0
  103. package/dist/MagicLink.js.map +1 -0
  104. package/dist/Mailer.d.ts +147 -0
  105. package/dist/Mailer.d.ts.map +1 -0
  106. package/dist/Mailer.js +208 -0
  107. package/dist/Mailer.js.map +1 -0
  108. package/dist/OAuth.d.ts +934 -0
  109. package/dist/OAuth.d.ts.map +1 -0
  110. package/dist/OAuth.js +1661 -0
  111. package/dist/OAuth.js.map +1 -0
  112. package/dist/Passkey.d.ts +334 -0
  113. package/dist/Passkey.d.ts.map +1 -0
  114. package/dist/Passkey.js +422 -0
  115. package/dist/Passkey.js.map +1 -0
  116. package/dist/PasskeySimpleWebAuthn.d.ts +11 -0
  117. package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -0
  118. package/dist/PasskeySimpleWebAuthn.js +181 -0
  119. package/dist/PasskeySimpleWebAuthn.js.map +1 -0
  120. package/dist/Password.d.ts +237 -0
  121. package/dist/Password.d.ts.map +1 -0
  122. package/dist/Password.js +641 -0
  123. package/dist/Password.js.map +1 -0
  124. package/dist/Policy.d.ts +7 -4
  125. package/dist/Policy.d.ts.map +1 -1
  126. package/dist/Policy.js +28 -5
  127. package/dist/Policy.js.map +1 -1
  128. package/dist/Privacy.d.ts +18 -0
  129. package/dist/Privacy.d.ts.map +1 -1
  130. package/dist/Privacy.js +63 -3
  131. package/dist/Privacy.js.map +1 -1
  132. package/dist/RateLimiter.d.ts +104 -0
  133. package/dist/RateLimiter.d.ts.map +1 -0
  134. package/dist/RateLimiter.js +118 -0
  135. package/dist/RateLimiter.js.map +1 -0
  136. package/dist/RecoveryCode.d.ts +169 -0
  137. package/dist/RecoveryCode.d.ts.map +1 -0
  138. package/dist/RecoveryCode.js +299 -0
  139. package/dist/RecoveryCode.js.map +1 -0
  140. package/dist/RefreshToken.d.ts +222 -0
  141. package/dist/RefreshToken.d.ts.map +1 -0
  142. package/dist/RefreshToken.js +342 -0
  143. package/dist/RefreshToken.js.map +1 -0
  144. package/dist/SecurityTimeline.d.ts +72 -0
  145. package/dist/SecurityTimeline.d.ts.map +1 -0
  146. package/dist/SecurityTimeline.js +386 -0
  147. package/dist/SecurityTimeline.js.map +1 -0
  148. package/dist/Sessions.d.ts +135 -11
  149. package/dist/Sessions.d.ts.map +1 -1
  150. package/dist/Sessions.js +546 -1
  151. package/dist/Sessions.js.map +1 -1
  152. package/dist/StepUp.d.ts +44 -0
  153. package/dist/StepUp.d.ts.map +1 -0
  154. package/dist/StepUp.js +82 -0
  155. package/dist/StepUp.js.map +1 -0
  156. package/dist/Storage.d.ts +175 -0
  157. package/dist/Storage.d.ts.map +1 -0
  158. package/dist/Storage.js +27 -0
  159. package/dist/Storage.js.map +1 -0
  160. package/dist/StorageMigrations.d.ts +19 -0
  161. package/dist/StorageMigrations.d.ts.map +1 -0
  162. package/dist/StorageMigrations.js +291 -0
  163. package/dist/StorageMigrations.js.map +1 -0
  164. package/dist/Testing.d.ts +9 -1
  165. package/dist/Testing.d.ts.map +1 -1
  166. package/dist/Testing.js +30 -2
  167. package/dist/Testing.js.map +1 -1
  168. package/dist/Totp.d.ts +220 -0
  169. package/dist/Totp.d.ts.map +1 -0
  170. package/dist/Totp.js +477 -0
  171. package/dist/Totp.js.map +1 -0
  172. package/dist/TrustedDevice.d.ts +127 -0
  173. package/dist/TrustedDevice.d.ts.map +1 -0
  174. package/dist/TrustedDevice.js +252 -0
  175. package/dist/TrustedDevice.js.map +1 -0
  176. package/dist/WaitUntil.d.ts +3 -0
  177. package/dist/WaitUntil.d.ts.map +1 -1
  178. package/dist/WaitUntil.js +6 -3
  179. package/dist/WaitUntil.js.map +1 -1
  180. package/dist/Webhook.d.ts +72 -0
  181. package/dist/Webhook.d.ts.map +1 -0
  182. package/dist/Webhook.js +82 -0
  183. package/dist/Webhook.js.map +1 -0
  184. package/dist/alchemy/cloudflare/Email.d.ts +25 -0
  185. package/dist/alchemy/cloudflare/Email.d.ts.map +1 -0
  186. package/dist/alchemy/cloudflare/Email.js +117 -0
  187. package/dist/alchemy/cloudflare/Email.js.map +1 -0
  188. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts +34 -0
  189. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
  190. package/dist/alchemy/cloudflare/RateLimitDurableObject.js +30 -0
  191. package/dist/alchemy/cloudflare/RateLimitDurableObject.js.map +1 -0
  192. package/dist/cloudflare/Email.d.ts +25 -0
  193. package/dist/cloudflare/Email.d.ts.map +1 -0
  194. package/dist/cloudflare/Email.js +153 -0
  195. package/dist/cloudflare/Email.js.map +1 -0
  196. package/dist/cloudflare/RateLimitDurableObject.d.ts +50 -0
  197. package/dist/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
  198. package/dist/cloudflare/RateLimitDurableObject.js +51 -0
  199. package/dist/cloudflare/RateLimitDurableObject.js.map +1 -0
  200. package/dist/index.d.ts +22 -0
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +22 -0
  203. package/dist/index.js.map +1 -1
  204. package/dist/internal/RateLimitDurableObject.d.ts +32 -0
  205. package/dist/internal/RateLimitDurableObject.d.ts.map +1 -0
  206. package/dist/internal/RateLimitDurableObject.js +80 -0
  207. package/dist/internal/RateLimitDurableObject.js.map +1 -0
  208. package/migrations/0001_auth_storage.sql +32 -0
  209. package/migrations/0002_auth_password.sql +25 -0
  210. package/migrations/0003_auth_login_approval_review.sql +22 -0
  211. package/migrations/0004_auth_trusted_device.sql +12 -0
  212. package/migrations/0005_auth_passkey.sql +17 -0
  213. package/migrations/0006_auth_totp_factor.sql +17 -0
  214. package/migrations/0007_auth_recovery_code.sql +13 -0
  215. package/migrations/0008_auth_api_key.sql +17 -0
  216. package/migrations/0009_auth_refresh_token.sql +21 -0
  217. package/migrations/0010_auth_jwt_revocation.sql +8 -0
  218. package/migrations/0011_auth_oauth_account.sql +16 -0
  219. package/migrations/0012_auth_oauth_provider_token_vault.sql +20 -0
  220. package/migrations/0013_auth_security_timeline.sql +16 -0
  221. package/package.json +161 -16
  222. package/LICENSE +0 -21
package/dist/StepUp.js ADDED
@@ -0,0 +1,82 @@
1
+ import { Data, Duration, Effect } from "effect";
2
+ import { currentUnixMillis } from "./Internal.js";
3
+ import { AuthzError } from "./Policy.js";
4
+ import { CurrentSession } from "./Sessions.js";
5
+ export class StepUpRequired extends Data.TaggedError("StepUpRequired") {
6
+ }
7
+ const aalRank = {
8
+ aal1: 1,
9
+ aal2: 2,
10
+ aal3: 3,
11
+ };
12
+ export const aalAtLeast = (actual, minimum) => aalRank[actual] >= aalRank[minimum];
13
+ const aalFailure = (session, requiredAal) => aalAtLeast(session.aal, requiredAal)
14
+ ? undefined
15
+ : {
16
+ reason: "aal-too-low",
17
+ requiredAal,
18
+ currentAal: session.aal,
19
+ };
20
+ const freshnessFailure = (session, now, maxAge, verifiedAt = Number(session.authTime)) => {
21
+ const maxAgeMillis = Duration.toMillis(maxAge);
22
+ const authAgeMillis = Math.max(0, now - verifiedAt);
23
+ return authAgeMillis <= maxAgeMillis
24
+ ? undefined
25
+ : {
26
+ reason: "auth-too-old",
27
+ maxAgeMillis,
28
+ authAgeMillis,
29
+ };
30
+ };
31
+ const freshnessReferenceTime = (session, requiredAal) => requiredAal !== undefined &&
32
+ aalRank[requiredAal] >= aalRank.aal2 &&
33
+ session.mfaVerifiedAt !== undefined
34
+ ? Number(session.mfaVerifiedAt)
35
+ : Number(session.authTime);
36
+ const sessionRequirementFailures = (session, noSessionRequirements) => {
37
+ if (noSessionRequirements === undefined || noSessionRequirements.length === 0) {
38
+ return [];
39
+ }
40
+ const activeRequirements = session.claims?.requirements ?? [];
41
+ return noSessionRequirements.flatMap((requirement) => activeRequirements.includes(requirement)
42
+ ? [
43
+ {
44
+ reason: "session-requirement-unsatisfied",
45
+ requirement,
46
+ },
47
+ ]
48
+ : []);
49
+ };
50
+ export const checkStepUp = (requirement) => Effect.gen(function* () {
51
+ const session = yield* CurrentSession;
52
+ const now = requirement.maxAge === undefined ? undefined : yield* currentUnixMillis;
53
+ const failures = [
54
+ ...(requirement.aal === undefined
55
+ ? []
56
+ : [aalFailure(session, requirement.aal)].filter((failure) => failure !== undefined)),
57
+ ...(requirement.maxAge === undefined || now === undefined
58
+ ? []
59
+ : [
60
+ freshnessFailure(session, Number(now), requirement.maxAge, freshnessReferenceTime(session, requirement.aal)),
61
+ ].filter((failure) => failure !== undefined)),
62
+ ...sessionRequirementFailures(session, requirement.noSessionRequirements),
63
+ ];
64
+ return failures.length === 0
65
+ ? { _tag: "Satisfied", session }
66
+ : { _tag: "Required", session, failures };
67
+ });
68
+ export const requireStepUp = (requirement) => Effect.flatMap(checkStepUp(requirement), (decision) => decision._tag === "Satisfied"
69
+ ? Effect.void
70
+ : Effect.fail(new StepUpRequired({
71
+ failures: decision.failures,
72
+ session: decision.session,
73
+ })));
74
+ export const requireAal = (aal) => requireStepUp({ aal });
75
+ export const requireFresh = (maxAge) => requireStepUp({ maxAge });
76
+ export const requireNoSessionRequirements = (...requirements) => requireStepUp({ noSessionRequirements: requirements });
77
+ export const toPolicy = (requirement, policyId) => requireStepUp(requirement).pipe(Effect.mapError((cause) => new AuthzError({
78
+ reason: "step-up-required",
79
+ policyId,
80
+ cause,
81
+ })));
82
+ //# sourceMappingURL=StepUp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepUp.js","sourceRoot":"","sources":["../src/StepUp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAmC/C,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAGnE;CAAG;AAEL,MAAM,OAAO,GAAuC;IAClD,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,MAA0B,EAC1B,OAA2B,EAClB,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;AAElD,MAAM,UAAU,GAAG,CACjB,OAA4B,EAC5B,WAA+B,EACE,EAAE,CACnC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC;IAClC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC;QACE,MAAM,EAAE,aAAa;QACrB,WAAW;QACX,UAAU,EAAE,OAAO,CAAC,GAAG;KACxB,CAAC;AAER,MAAM,gBAAgB,GAAG,CACvB,OAA4B,EAC5B,GAAW,EACX,MAAyB,EACzB,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EACJ,EAAE;IACnC,MAAM,YAAY,GA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IAAI;IACb,CAAC,CAAC,MAAM,CAAC,IAAI,CACT,IAAI,cAAc,CAAC;QACjB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC,CACH,CACN,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAAuB,EAC8B,EAAE,CACvD,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAEzB,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAAyB,EAC4B,EAAE,CACvD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,GAAG,YAA2C,EACO,EAAE,CACvD,aAAa,CAAC,EAAE,qBAAqB,EAAE,YAAY,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,WAA8B,EAC9B,QAAmB,EAC8B,EAAE,CACnD,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAC7B,MAAM,CAAC,QAAQ,CACb,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,UAAU,CAAC;IACb,MAAM,EAAE,kBAAkB;IAC1B,QAAQ;IACR,KAAK;CACN,CAAC,CACL,CACF,CAAC"}
@@ -0,0 +1,175 @@
1
+ import type { Effect } from "effect";
2
+ import { Context } from "effect";
3
+ import type * as Option from "effect/Option";
4
+ import type { ChallengeType } from "./Challenge.js";
5
+ import type { ChallengeId, CredentialId, Email, SessionId, UnixMillis, UserId } from "./Identifiers.js";
6
+ import type { AuthAssuranceLevel, AuthMethodReference, SessionClaims } from "./Sessions.js";
7
+ export type StorageEntity = "user" | "credential" | "session" | "verification" | (string & {});
8
+ export type StorageOperation = "find" | "insert" | "update" | "delete" | "consume" | (string & {});
9
+ declare const StorageError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
10
+ readonly _tag: "StorageError";
11
+ } & Readonly<A>;
12
+ export declare class StorageError extends StorageError_base<{
13
+ readonly entity: StorageEntity;
14
+ readonly operation: StorageOperation;
15
+ readonly message: string;
16
+ readonly cause?: unknown;
17
+ }> {
18
+ }
19
+ export declare namespace StorageError {
20
+ const fromUnknown: (entity: StorageEntity, operation: StorageOperation, cause: unknown, message?: string) => StorageError;
21
+ }
22
+ export interface NewUserRow {
23
+ readonly id: UserId;
24
+ readonly email: Email;
25
+ readonly emailVerified: boolean;
26
+ readonly createdAt: UnixMillis;
27
+ readonly updatedAt: UnixMillis;
28
+ readonly disabledAt?: UnixMillis;
29
+ readonly metadata?: Readonly<Record<string, unknown>>;
30
+ }
31
+ export interface UserRow extends NewUserRow {
32
+ }
33
+ export interface UserMarkEmailVerifiedInput {
34
+ readonly userId: UserId;
35
+ readonly updatedAt: UnixMillis;
36
+ }
37
+ export interface UserStoreService {
38
+ readonly findById: (id: UserId) => Effect.Effect<Option.Option<UserRow>, StorageError>;
39
+ readonly findByEmail: (email: Email) => Effect.Effect<Option.Option<UserRow>, StorageError>;
40
+ readonly insert: (row: NewUserRow) => Effect.Effect<void, StorageError>;
41
+ readonly markEmailVerified: (input: UserMarkEmailVerifiedInput) => Effect.Effect<Option.Option<UserRow>, StorageError>;
42
+ }
43
+ declare const UserStore_base: Context.ServiceClass<UserStore, "auth/UserStore", UserStoreService>;
44
+ export declare class UserStore extends UserStore_base {
45
+ }
46
+ export declare namespace UserStore {
47
+ const make: (service: UserStoreService) => UserStoreService;
48
+ }
49
+ export interface NewPasswordCredentialRow {
50
+ readonly id: CredentialId;
51
+ readonly userId: UserId;
52
+ readonly passwordHash: string;
53
+ readonly createdAt: UnixMillis;
54
+ readonly updatedAt: UnixMillis;
55
+ readonly revokedAt?: UnixMillis;
56
+ readonly metadata?: Readonly<Record<string, unknown>>;
57
+ }
58
+ export interface PasswordCredentialRow extends NewPasswordCredentialRow {
59
+ }
60
+ export interface PasswordCredentialUpdatePasswordInput {
61
+ readonly userId: UserId;
62
+ readonly passwordHash: string;
63
+ readonly updatedAt: UnixMillis;
64
+ }
65
+ export interface CredentialStoreService {
66
+ readonly findPasswordByUserId: (userId: UserId) => Effect.Effect<Option.Option<PasswordCredentialRow>, StorageError>;
67
+ readonly insertPassword: (row: NewPasswordCredentialRow) => Effect.Effect<void, StorageError>;
68
+ readonly updatePassword: (input: PasswordCredentialUpdatePasswordInput) => Effect.Effect<Option.Option<PasswordCredentialRow>, StorageError>;
69
+ }
70
+ declare const CredentialStore_base: Context.ServiceClass<CredentialStore, "auth/CredentialStore", CredentialStoreService>;
71
+ export declare class CredentialStore extends CredentialStore_base {
72
+ }
73
+ export declare namespace CredentialStore {
74
+ const make: (service: CredentialStoreService) => CredentialStoreService;
75
+ }
76
+ export interface NewSessionRow {
77
+ readonly id: SessionId;
78
+ readonly userId: UserId;
79
+ readonly secretHash: string;
80
+ readonly createdAt: UnixMillis;
81
+ readonly expiresAt: UnixMillis;
82
+ readonly authTime: UnixMillis;
83
+ readonly aal: AuthAssuranceLevel;
84
+ readonly amr: readonly AuthMethodReference[];
85
+ readonly claims?: SessionClaims;
86
+ readonly mfaVerifiedAt?: UnixMillis;
87
+ readonly metadata?: Readonly<Record<string, unknown>>;
88
+ }
89
+ export interface SessionRow extends NewSessionRow {
90
+ readonly revokedAt?: UnixMillis;
91
+ readonly lastSeenAt?: UnixMillis;
92
+ readonly rotatedAt?: UnixMillis;
93
+ }
94
+ export interface SessionRefreshStoreInput {
95
+ readonly sessionId: SessionId;
96
+ readonly expiresAt: UnixMillis;
97
+ readonly lastSeenAt?: UnixMillis;
98
+ }
99
+ export interface SessionListByUserStoreInput {
100
+ readonly userId: UserId;
101
+ }
102
+ export interface SessionRotateStoreInput {
103
+ readonly sessionId: SessionId;
104
+ readonly secretHash: string;
105
+ readonly rotatedAt: UnixMillis;
106
+ readonly expiresAt?: UnixMillis;
107
+ }
108
+ export interface SessionUpdateClaimsStoreInput {
109
+ readonly sessionId: SessionId;
110
+ readonly claims?: SessionClaims;
111
+ readonly aal?: AuthAssuranceLevel;
112
+ readonly amr?: readonly AuthMethodReference[];
113
+ readonly mfaVerifiedAt?: UnixMillis;
114
+ }
115
+ export interface SessionRevokeStoreInput {
116
+ readonly sessionId: SessionId;
117
+ readonly revokedAt: UnixMillis;
118
+ readonly reason?: string;
119
+ }
120
+ export interface SessionRevokeAllForUserStoreInput {
121
+ readonly userId: UserId;
122
+ readonly revokedAt: UnixMillis;
123
+ readonly reason?: string;
124
+ }
125
+ export interface SessionStoreService {
126
+ readonly findById: (id: SessionId) => Effect.Effect<Option.Option<SessionRow>, StorageError>;
127
+ readonly listByUser: (input: SessionListByUserStoreInput) => Effect.Effect<readonly SessionRow[], StorageError>;
128
+ readonly insert: (row: NewSessionRow) => Effect.Effect<void, StorageError>;
129
+ readonly refresh: (input: SessionRefreshStoreInput) => Effect.Effect<Option.Option<SessionRow>, StorageError>;
130
+ readonly rotate: (input: SessionRotateStoreInput) => Effect.Effect<Option.Option<SessionRow>, StorageError>;
131
+ readonly updateClaims: (input: SessionUpdateClaimsStoreInput) => Effect.Effect<Option.Option<SessionRow>, StorageError>;
132
+ readonly revoke: (input: SessionRevokeStoreInput) => Effect.Effect<void, StorageError>;
133
+ readonly revokeAllForUser: (input: SessionRevokeAllForUserStoreInput) => Effect.Effect<void, StorageError>;
134
+ }
135
+ declare const SessionStore_base: Context.ServiceClass<SessionStore, "auth/SessionStore", SessionStoreService>;
136
+ export declare class SessionStore extends SessionStore_base {
137
+ }
138
+ export declare namespace SessionStore {
139
+ const make: (service: SessionStoreService) => SessionStoreService;
140
+ }
141
+ export interface NewVerificationRow {
142
+ readonly id: ChallengeId;
143
+ readonly type: ChallengeType;
144
+ readonly subject: string;
145
+ readonly secretHash?: string;
146
+ readonly createdAt: UnixMillis;
147
+ readonly expiresAt: UnixMillis;
148
+ readonly metadata?: Readonly<Record<string, unknown>>;
149
+ }
150
+ export interface VerificationRow extends NewVerificationRow {
151
+ readonly consumedAt?: UnixMillis;
152
+ }
153
+ export interface VerificationConsumeInput {
154
+ readonly id: ChallengeId;
155
+ readonly type?: ChallengeType;
156
+ readonly consumedAt: UnixMillis;
157
+ }
158
+ export interface VerificationDeleteExpiredInput {
159
+ readonly now: UnixMillis;
160
+ readonly limit?: number;
161
+ }
162
+ export interface VerificationStoreService {
163
+ readonly findById: (id: ChallengeId) => Effect.Effect<Option.Option<VerificationRow>, StorageError>;
164
+ readonly insert: (row: NewVerificationRow) => Effect.Effect<void, StorageError>;
165
+ readonly consume: (input: VerificationConsumeInput) => Effect.Effect<Option.Option<VerificationRow>, StorageError>;
166
+ readonly deleteExpired: (input: VerificationDeleteExpiredInput) => Effect.Effect<number, StorageError>;
167
+ }
168
+ declare const VerificationStore_base: Context.ServiceClass<VerificationStore, "auth/VerificationStore", VerificationStoreService>;
169
+ export declare class VerificationStore extends VerificationStore_base {
170
+ }
171
+ export declare namespace VerificationStore {
172
+ const make: (service: VerificationStoreService) => VerificationStoreService;
173
+ }
174
+ export {};
175
+ //# sourceMappingURL=Storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../src/Storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,OAAO,EAAQ,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,MAAM,EACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,YAAY,GACZ,SA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AY,CAAC,CAAC;IACjE,QAAQ,CAAC,aAAa,EAAE,CACtB,KAAK,EAAE,8BAA8B,KAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC1C;;AAED,qBAAa,iBAAkB,SAAQ,sBAGV;CAAG;AAEhC,yBAAiB,iBAAiB,CAAC;IAC1B,MAAM,IAAI,GACf,SAAS,wBAAwB,KAChC,wBAAyD,CAAC;CAC9D"}
@@ -0,0 +1,27 @@
1
+ import { Context, Data } from "effect";
2
+ export class StorageError extends Data.TaggedError("StorageError") {
3
+ }
4
+ (function (StorageError) {
5
+ StorageError.fromUnknown = (entity, operation, cause, message = `${entity} ${operation} failed`) => new StorageError({ entity, operation, message, cause });
6
+ })(StorageError || (StorageError = {}));
7
+ export class UserStore extends Context.Service()("auth/UserStore") {
8
+ }
9
+ (function (UserStore) {
10
+ UserStore.make = (service) => UserStore.of(service);
11
+ })(UserStore || (UserStore = {}));
12
+ export class CredentialStore extends Context.Service()("auth/CredentialStore") {
13
+ }
14
+ (function (CredentialStore) {
15
+ CredentialStore.make = (service) => CredentialStore.of(service);
16
+ })(CredentialStore || (CredentialStore = {}));
17
+ export class SessionStore extends Context.Service()("auth/SessionStore") {
18
+ }
19
+ (function (SessionStore) {
20
+ SessionStore.make = (service) => SessionStore.of(service);
21
+ })(SessionStore || (SessionStore = {}));
22
+ export class VerificationStore extends Context.Service()("auth/VerificationStore") {
23
+ }
24
+ (function (VerificationStore) {
25
+ VerificationStore.make = (service) => VerificationStore.of(service);
26
+ })(VerificationStore || (VerificationStore = {}));
27
+ //# sourceMappingURL=Storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storage.js","sourceRoot":"","sources":["../src/Storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiCvC,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,WAAW,CAAC,cAAc,CAK/D;CAAG;AAEL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KAAjB,iBAAiB,QAIjC"}
@@ -0,0 +1,19 @@
1
+ export interface AuthStorageMigration {
2
+ readonly id: string;
3
+ readonly sql: string;
4
+ }
5
+ export declare const authStorageMigration001: AuthStorageMigration;
6
+ export declare const authStorageMigration002: AuthStorageMigration;
7
+ export declare const authStorageMigration003: AuthStorageMigration;
8
+ export declare const authStorageMigration004: AuthStorageMigration;
9
+ export declare const authStorageMigration005: AuthStorageMigration;
10
+ export declare const authStorageMigration006: AuthStorageMigration;
11
+ export declare const authStorageMigration007: AuthStorageMigration;
12
+ export declare const authStorageMigration008: AuthStorageMigration;
13
+ export declare const authStorageMigration009: AuthStorageMigration;
14
+ export declare const authStorageMigration010: AuthStorageMigration;
15
+ export declare const authStorageMigration011: AuthStorageMigration;
16
+ export declare const authStorageMigration012: AuthStorageMigration;
17
+ export declare const authStorageMigration013: AuthStorageMigration;
18
+ export declare const authStorageMigrations: readonly [AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration, AuthStorageMigration];
19
+ //# sourceMappingURL=StorageMigrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageMigrations.d.ts","sourceRoot":"","sources":["../src/StorageMigrations.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,uBAAuB,EAAE,oBAkCrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBA2BrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAwBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAcrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAmBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAmBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAerC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAmBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAuBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAUrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAkBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAsBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,oBAkBrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,ySAcxB,CAAC"}
@@ -0,0 +1,291 @@
1
+ export const authStorageMigration001 = {
2
+ id: "0001_auth_storage",
3
+ sql: `create table if not exists auth_session (
4
+ id text primary key,
5
+ user_id text not null,
6
+ secret_hash text not null,
7
+ created_at integer not null,
8
+ expires_at integer not null,
9
+ auth_time integer not null,
10
+ aal text not null,
11
+ amr text not null,
12
+ mfa_verified_at integer,
13
+ metadata text,
14
+ revoked_at integer,
15
+ last_seen_at integer,
16
+ rotated_at integer
17
+ );
18
+
19
+ create index if not exists auth_session_user_id_idx on auth_session (user_id);
20
+ create index if not exists auth_session_expires_at_idx on auth_session (expires_at);
21
+
22
+ create table if not exists auth_verification (
23
+ id text primary key,
24
+ type text not null,
25
+ subject text not null,
26
+ secret_hash text,
27
+ created_at integer not null,
28
+ expires_at integer not null,
29
+ metadata text,
30
+ consumed_at integer
31
+ );
32
+
33
+ create index if not exists auth_verification_type_subject_idx on auth_verification (type, subject);
34
+ create index if not exists auth_verification_expires_at_idx on auth_verification (expires_at);`,
35
+ };
36
+ export const authStorageMigration002 = {
37
+ id: "0002_auth_password",
38
+ sql: `create table if not exists auth_user (
39
+ id text primary key,
40
+ email text not null,
41
+ email_verified integer not null,
42
+ created_at integer not null,
43
+ updated_at integer not null,
44
+ disabled_at integer,
45
+ metadata text
46
+ );
47
+
48
+ create unique index if not exists auth_user_email_idx on auth_user (email);
49
+
50
+ create table if not exists auth_credential (
51
+ id text primary key,
52
+ user_id text not null,
53
+ type text not null,
54
+ password_hash text,
55
+ created_at integer not null,
56
+ updated_at integer not null,
57
+ revoked_at integer,
58
+ metadata text
59
+ );
60
+
61
+ create index if not exists auth_credential_user_id_idx on auth_credential (user_id);
62
+ create unique index if not exists auth_credential_user_type_idx on auth_credential (user_id, type);`,
63
+ };
64
+ export const authStorageMigration003 = {
65
+ id: "0003_auth_login_approval_review",
66
+ sql: `create table if not exists auth_login_approval_review (
67
+ approval_challenge_id text primary key,
68
+ flow_id text not null,
69
+ user_id text not null,
70
+ channel text not null,
71
+ reason text not null,
72
+ session_binding text not null,
73
+ same_device_required integer not null,
74
+ status text not null,
75
+ created_at integer not null,
76
+ expires_at integer not null,
77
+ reviewed_at integer,
78
+ reviewed_by text,
79
+ denied_reason text,
80
+ risk text,
81
+ metadata text,
82
+ review_metadata text
83
+ );
84
+
85
+ create index if not exists auth_login_approval_review_flow_id_idx on auth_login_approval_review (flow_id);
86
+ create index if not exists auth_login_approval_review_user_id_idx on auth_login_approval_review (user_id);
87
+ create index if not exists auth_login_approval_review_status_expires_at_idx on auth_login_approval_review (status, expires_at);`,
88
+ };
89
+ export const authStorageMigration004 = {
90
+ id: "0004_auth_trusted_device",
91
+ sql: `create table if not exists auth_trusted_device (
92
+ user_id text not null,
93
+ token_hash text not null,
94
+ created_at integer not null,
95
+ last_seen_at integer not null,
96
+ expires_at integer not null,
97
+ metadata text,
98
+ primary key (user_id, token_hash)
99
+ );
100
+
101
+ create index if not exists auth_trusted_device_user_id_idx on auth_trusted_device (user_id);
102
+ create index if not exists auth_trusted_device_expires_at_idx on auth_trusted_device (expires_at);`,
103
+ };
104
+ export const authStorageMigration005 = {
105
+ id: "0005_auth_passkey",
106
+ sql: `create table if not exists auth_passkey_credential (
107
+ id text primary key,
108
+ user_id text not null,
109
+ credential_id text not null,
110
+ public_key text not null,
111
+ sign_count integer not null,
112
+ transports text,
113
+ backed_up integer,
114
+ created_at integer not null,
115
+ last_used_at integer,
116
+ revoked_at integer,
117
+ metadata text
118
+ );
119
+
120
+ create unique index if not exists auth_passkey_credential_credential_id_idx on auth_passkey_credential (credential_id);
121
+ create index if not exists auth_passkey_credential_user_id_idx on auth_passkey_credential (user_id);
122
+ create index if not exists auth_passkey_credential_revoked_at_idx on auth_passkey_credential (revoked_at);`,
123
+ };
124
+ export const authStorageMigration006 = {
125
+ id: "0006_auth_totp_factor",
126
+ sql: `create table if not exists auth_totp_factor (
127
+ id text primary key,
128
+ user_id text not null,
129
+ secret text not null,
130
+ algorithm text not null,
131
+ digits integer not null,
132
+ period integer not null,
133
+ created_at integer not null,
134
+ confirmed_at integer,
135
+ last_used_at integer,
136
+ revoked_at integer,
137
+ metadata text
138
+ );
139
+
140
+ create index if not exists auth_totp_factor_user_id_idx on auth_totp_factor (user_id);
141
+ create index if not exists auth_totp_factor_confirmed_at_idx on auth_totp_factor (confirmed_at);
142
+ create index if not exists auth_totp_factor_revoked_at_idx on auth_totp_factor (revoked_at);`,
143
+ };
144
+ export const authStorageMigration007 = {
145
+ id: "0007_auth_recovery_code",
146
+ sql: `create table if not exists auth_recovery_code (
147
+ id text primary key,
148
+ user_id text not null,
149
+ code_hash text not null,
150
+ created_at integer not null,
151
+ used_at integer,
152
+ revoked_at integer,
153
+ metadata text
154
+ );
155
+
156
+ create index if not exists auth_recovery_code_user_id_idx on auth_recovery_code (user_id);
157
+ create index if not exists auth_recovery_code_used_at_idx on auth_recovery_code (used_at);
158
+ create index if not exists auth_recovery_code_revoked_at_idx on auth_recovery_code (revoked_at);`,
159
+ };
160
+ export const authStorageMigration008 = {
161
+ id: "0008_auth_api_key",
162
+ sql: `create table if not exists auth_api_key (
163
+ id text primary key,
164
+ user_id text not null,
165
+ prefix text not null,
166
+ secret_hash text not null,
167
+ scopes text not null,
168
+ created_at integer not null,
169
+ expires_at integer,
170
+ last_used_at integer,
171
+ revoked_at integer,
172
+ metadata text
173
+ );
174
+
175
+ create unique index if not exists auth_api_key_prefix_idx on auth_api_key (prefix);
176
+ create index if not exists auth_api_key_user_id_idx on auth_api_key (user_id);
177
+ create index if not exists auth_api_key_expires_at_idx on auth_api_key (expires_at);
178
+ create index if not exists auth_api_key_revoked_at_idx on auth_api_key (revoked_at);`,
179
+ };
180
+ export const authStorageMigration009 = {
181
+ id: "0009_auth_refresh_token",
182
+ sql: `create table if not exists auth_refresh_token (
183
+ id text primary key,
184
+ family_id text not null,
185
+ user_id text not null,
186
+ secret_hash text not null,
187
+ created_at integer not null,
188
+ expires_at integer not null,
189
+ last_used_at integer,
190
+ rotated_at integer,
191
+ replaced_by_id text,
192
+ revoked_at integer,
193
+ reuse_detected_at integer,
194
+ metadata text
195
+ );
196
+
197
+ create unique index if not exists auth_refresh_token_secret_hash_idx on auth_refresh_token (secret_hash);
198
+ create index if not exists auth_refresh_token_family_id_idx on auth_refresh_token (family_id);
199
+ create index if not exists auth_refresh_token_user_id_idx on auth_refresh_token (user_id);
200
+ create index if not exists auth_refresh_token_expires_at_idx on auth_refresh_token (expires_at);
201
+ create index if not exists auth_refresh_token_rotated_at_idx on auth_refresh_token (rotated_at);
202
+ create index if not exists auth_refresh_token_revoked_at_idx on auth_refresh_token (revoked_at);`,
203
+ };
204
+ export const authStorageMigration010 = {
205
+ id: "0010_auth_jwt_revocation",
206
+ sql: `create table if not exists auth_jwt_revocation (
207
+ jwt_id text primary key,
208
+ revoked_at integer not null,
209
+ expires_at integer,
210
+ reason text
211
+ );
212
+
213
+ create index if not exists auth_jwt_revocation_expires_at_idx on auth_jwt_revocation (expires_at);`,
214
+ };
215
+ export const authStorageMigration011 = {
216
+ id: "0011_auth_oauth_account",
217
+ sql: `create table if not exists auth_oauth_account (
218
+ id text primary key,
219
+ provider_id text not null,
220
+ provider_account_id text not null,
221
+ user_id text not null,
222
+ email text,
223
+ email_verified integer,
224
+ created_at integer not null,
225
+ updated_at integer not null,
226
+ unlinked_at integer,
227
+ metadata text
228
+ );
229
+
230
+ create unique index if not exists auth_oauth_account_provider_account_idx on auth_oauth_account (provider_id, provider_account_id);
231
+ create index if not exists auth_oauth_account_user_id_idx on auth_oauth_account (user_id);
232
+ create index if not exists auth_oauth_account_unlinked_at_idx on auth_oauth_account (unlinked_at);`,
233
+ };
234
+ export const authStorageMigration012 = {
235
+ id: "0012_auth_oauth_provider_token_vault",
236
+ sql: `create table if not exists auth_oauth_provider_token_vault (
237
+ account_id text primary key,
238
+ user_id text not null,
239
+ provider_id text not null,
240
+ provider_account_id text not null,
241
+ access_token_ciphertext text not null,
242
+ refresh_token_ciphertext text,
243
+ id_token_ciphertext text,
244
+ token_type text not null,
245
+ scopes text,
246
+ expires_at integer,
247
+ updated_at integer not null,
248
+ revoked_at integer,
249
+ revocation_reason text
250
+ );
251
+
252
+ create index if not exists auth_oauth_provider_token_vault_user_id_idx on auth_oauth_provider_token_vault (user_id);
253
+ create index if not exists auth_oauth_provider_token_vault_provider_account_idx on auth_oauth_provider_token_vault (provider_id, provider_account_id);
254
+ create index if not exists auth_oauth_provider_token_vault_expires_at_idx on auth_oauth_provider_token_vault (expires_at);
255
+ create index if not exists auth_oauth_provider_token_vault_revoked_at_idx on auth_oauth_provider_token_vault (revoked_at);`,
256
+ };
257
+ export const authStorageMigration013 = {
258
+ id: "0013_auth_security_timeline",
259
+ sql: `create table if not exists auth_security_timeline (
260
+ id text primary key,
261
+ user_id text not null,
262
+ type text not null,
263
+ category text not null,
264
+ severity text not null,
265
+ occurred_at integer not null,
266
+ summary text not null,
267
+ actor text,
268
+ request text,
269
+ metadata text
270
+ );
271
+
272
+ create index if not exists auth_security_timeline_user_occurred_at_idx on auth_security_timeline (user_id, occurred_at);
273
+ create index if not exists auth_security_timeline_type_idx on auth_security_timeline (type);
274
+ create index if not exists auth_security_timeline_category_idx on auth_security_timeline (category);`,
275
+ };
276
+ export const authStorageMigrations = [
277
+ authStorageMigration001,
278
+ authStorageMigration002,
279
+ authStorageMigration003,
280
+ authStorageMigration004,
281
+ authStorageMigration005,
282
+ authStorageMigration006,
283
+ authStorageMigration007,
284
+ authStorageMigration008,
285
+ authStorageMigration009,
286
+ authStorageMigration010,
287
+ authStorageMigration011,
288
+ authStorageMigration012,
289
+ authStorageMigration013,
290
+ ];
291
+ //# sourceMappingURL=StorageMigrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageMigrations.js","sourceRoot":"","sources":["../src/StorageMigrations.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,mBAAmB;IACvB,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FA+BwF;CAC9F,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,oBAAoB;IACxB,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;oGAwB6F;CACnG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,iCAAiC;IACrC,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;gIAqByH;CAC/H,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,0BAA0B;IAC9B,GAAG,EAAE;;;;;;;;;;;mGAW4F;CAClG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,mBAAmB;IACvB,GAAG,EAAE;;;;;;;;;;;;;;;;2GAgBoG;CAC1G,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,uBAAuB;IAC3B,GAAG,EAAE;;;;;;;;;;;;;;;;6FAgBsF;CAC5F,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,yBAAyB;IAC7B,GAAG,EAAE;;;;;;;;;;;;iGAY0F;CAChG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,mBAAmB;IACvB,GAAG,EAAE;;;;;;;;;;;;;;;;qFAgB8E;CACpF,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,yBAAyB;IAC7B,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;iGAoB0F;CAChG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,0BAA0B;IAC9B,GAAG,EAAE;;;;;;;mGAO4F;CAClG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,yBAAyB;IAC7B,GAAG,EAAE;;;;;;;;;;;;;;;mGAe4F;CAClG,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,sCAAsC;IAC1C,GAAG,EAAE;;;;;;;;;;;;;;;;;;;2HAmBoH;CAC1H,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D,EAAE,EAAE,6BAA6B;IACjC,GAAG,EAAE;;;;;;;;;;;;;;;qGAe8F;CACpG,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;CACf,CAAC"}
package/dist/Testing.d.ts CHANGED
@@ -1,3 +1,11 @@
1
1
  import { Layer } from "effect";
2
- export declare const CoreTestingLive: Layer.Layer<import("./AuditLog.js").AuditLog | import("./Privacy.js").Privacy | import("./WaitUntil.js").WaitUntil, never, never>;
2
+ import { Crypto } from "./Crypto.js";
3
+ import type { CryptoService } from "./Crypto.js";
4
+ import { PasswordHasher } from "./Password.js";
5
+ import type { PasswordHasherService } from "./Password.js";
6
+ export declare const makeTestCrypto: () => CryptoService;
7
+ export declare const CryptoTestLive: Layer.Layer<Crypto, never, never>;
8
+ export declare const makeTestPasswordHasher: () => PasswordHasherService;
9
+ export declare const PasswordHasherTestLive: Layer.Layer<PasswordHasher, never, never>;
10
+ export declare const CoreTestingLive: Layer.Layer<Crypto | import("./WaitUntil.js").WaitUntil | import("./Privacy.js").Privacy | import("./AuditLog.js").AuditLog | PasswordHasher, never, never>;
3
11
  //# sourceMappingURL=Testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAM9B,eAAO,MAAM,eAAe,mIAI3B,CAAA"}
1
+ {"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAY,MAAM,QAAQ,CAAC;AAGjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAY3D,eAAO,MAAM,cAAc,QAAO,aA+BjC,CAAC;AAEF,eAAO,MAAM,cAAc,mCAA0C,CAAC;AAEtE,eAAO,MAAM,sBAAsB,QAAO,qBAQtC,CAAC;AAEL,eAAO,MAAM,sBAAsB,2CAElC,CAAC;AAEF,eAAO,MAAM,eAAe,6JAM3B,CAAC"}