@yielded/auth-persistence-drizzle 0.1.0-beta.22 → 0.1.0-beta.23

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 (68) hide show
  1. package/dist/D1.d.mts +4 -4
  2. package/dist/Libsql.d.mts +19 -19
  3. package/dist/Mysql2.d.mts +8 -8
  4. package/dist/Pglite.d.mts +8 -8
  5. package/dist/Postgres.d.mts +6 -6
  6. package/dist/SqliteBun.d.mts +21 -21
  7. package/dist/SqliteDo.d.mts +19 -19
  8. package/dist/SqliteNode.d.mts +17 -17
  9. package/dist/SqliteWasm.d.mts +19 -19
  10. package/dist/drizzle/d1-oauth.d.mts +2 -2
  11. package/dist/drizzle/d1-password-prepared.d.mts +3 -3
  12. package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
  13. package/dist/drizzle/d1-passwords.d.mts +8 -9
  14. package/dist/drizzle/d1-passwords.mjs +103 -173
  15. package/dist/drizzle/d1-passwords.mjs.map +1 -1
  16. package/dist/drizzle/d1-proofs.d.mts +1 -1
  17. package/dist/drizzle/d1-sessions.d.mts +1 -1
  18. package/dist/drizzle/mysql-password-prepared.d.mts +5 -5
  19. package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
  20. package/dist/drizzle/mysql-passwords.d.mts +9 -9
  21. package/dist/drizzle/mysql-passwords.mjs.map +1 -1
  22. package/dist/drizzle/native-sql-table.mjs +110 -0
  23. package/dist/drizzle/native-sql-table.mjs.map +1 -0
  24. package/dist/drizzle/oauth-connected-target.d.mts +5 -5
  25. package/dist/drizzle/oauth-target.d.mts +1 -1
  26. package/dist/drizzle/password-model.d.mts +5 -7
  27. package/dist/drizzle/password-prepared-model.d.mts +5 -5
  28. package/dist/drizzle/password-prepared-model.mjs.map +1 -1
  29. package/dist/drizzle/password-sql.mjs +2 -1
  30. package/dist/drizzle/password-sql.mjs.map +1 -1
  31. package/dist/drizzle/password-target.mjs +13 -2
  32. package/dist/drizzle/password-target.mjs.map +1 -1
  33. package/dist/drizzle/pg-password-prepared.d.mts +5 -5
  34. package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
  35. package/dist/drizzle/pg-passwords.d.mts +9 -9
  36. package/dist/drizzle/pg-passwords.mjs.map +1 -1
  37. package/dist/drizzle/phone-target.d.mts +1 -1
  38. package/dist/drizzle/session-sql.mjs +2 -1
  39. package/dist/drizzle/session-sql.mjs.map +1 -1
  40. package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
  41. package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
  42. package/dist/drizzle/storage-validation.mjs +0 -13
  43. package/dist/drizzle/storage-validation.mjs.map +1 -1
  44. package/dist/drizzle/totp-target.d.mts +1 -1
  45. package/dist/index.d.mts +2 -2
  46. package/dist/internal/drizzle-postgres.mjs +2 -0
  47. package/dist/internal/drizzle-postgres.mjs.map +1 -1
  48. package/dist/internal/drizzle-sqlite.mjs +2 -0
  49. package/dist/internal/drizzle-sqlite.mjs.map +1 -1
  50. package/package.json +1 -1
  51. package/src/drizzle/d1-password-prepared.ts +2 -20
  52. package/src/drizzle/d1-passwords.ts +232 -519
  53. package/src/drizzle/mysql-password-prepared.ts +4 -12
  54. package/src/drizzle/mysql-passwords.ts +5 -15
  55. package/src/drizzle/native-sql-table.ts +229 -0
  56. package/src/drizzle/password-model.ts +0 -20
  57. package/src/drizzle/password-prepared-model.ts +0 -12
  58. package/src/drizzle/password-sql.ts +3 -0
  59. package/src/drizzle/password-target.ts +41 -4
  60. package/src/drizzle/pg-password-prepared.ts +4 -12
  61. package/src/drizzle/pg-passwords.ts +5 -15
  62. package/src/drizzle/session-sql.ts +2 -1
  63. package/src/drizzle/sqlite-password-prepared.ts +4 -48
  64. package/src/drizzle/sqlite-passwords.ts +7 -21
  65. package/src/drizzle/storage-validation.ts +0 -8
  66. package/src/index.ts +0 -4
  67. package/src/internal/drizzle-postgres.ts +2 -0
  68. package/src/internal/drizzle-sqlite.ts +2 -0
package/dist/D1.d.mts CHANGED
@@ -78,10 +78,10 @@ export declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
78
78
  readonly outcome: import("@yielded/auth/OAuth").OAuthSignInAccessOutcome;
79
79
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
80
80
  readonly _tag: "Rejected";
81
- } | {
82
- readonly _tag: "Cancelled";
83
81
  } | {
84
82
  readonly _tag: "Ambiguous";
83
+ } | {
84
+ readonly _tag: "Cancelled";
85
85
  } | {
86
86
  readonly _tag: "Connected";
87
87
  readonly grant: {
@@ -538,10 +538,10 @@ export declare const makeOAuthConnectedServices: <S extends AnySQLiteTable<{
538
538
  readonly nowMillis: number;
539
539
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
540
540
  readonly _tag: "Rejected";
541
- } | {
542
- readonly _tag: "Cancelled";
543
541
  } | {
544
542
  readonly _tag: "Ambiguous";
543
+ } | {
544
+ readonly _tag: "Cancelled";
545
545
  } | {
546
546
  readonly _tag: "Connected";
547
547
  readonly grant: {
package/dist/Libsql.d.mts CHANGED
@@ -88,13 +88,13 @@ export declare const coordinateEmailAddress: {
88
88
  };
89
89
  }, EmailUnavailable, Database>;
90
90
  export declare const coordinatePasswordPersistence: {
91
- <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
92
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
91
+ <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
92
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
93
93
  readonly proofMapping?: PM;
94
94
  readonly transaction?: never;
95
95
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/Password").PasswordPersistence>>;
96
- <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
97
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
96
+ <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
97
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
98
98
  readonly proofMapping?: PM;
99
99
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
100
100
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/Password").PasswordPersistence>>;
@@ -109,15 +109,15 @@ export declare const coordinatePasswordPersistence: {
109
109
  readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>>;
110
110
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
111
111
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
112
- }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
112
+ }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
113
113
  passwordPersistence: {
114
- readonly admitAttempt: <A_1>(input: {
114
+ readonly prepareAttempt: (input: {
115
115
  readonly moduleId: string;
116
116
  readonly action: "sign-in" | "change";
117
117
  readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
118
118
  readonly subjectId?: import("@yielded/auth/Schema").SubjectId;
119
- readonly policy: import("@yielded/auth/Password").PasswordAttemptPolicy;
120
- }, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordAttemptAdmission, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, PasswordUnavailable>;
119
+ readonly attemptLifetimeMillis: number;
120
+ }) => Effect.Effect<import("@yielded/auth/Password").PasswordAttemptPreparation, PasswordUnavailable>;
121
121
  readonly settleAttempt: <A_1>(input: {
122
122
  readonly moduleId: string;
123
123
  readonly attemptId: import("@yielded/auth/Password").PasswordAttemptId;
@@ -310,17 +310,17 @@ export declare const makeExternalIdentityServices: <Subject extends AnySQLiteTab
310
310
  readonly bind: (subjectId: import("@yielded/auth/Schema").SubjectId, identity: import("@yielded/auth/Identity").ExternalIdentity) => Effect.Effect<void, import("@yielded/auth/Identity").IdentityConflict | import("@yielded/auth/Identity").IdentityUnavailable>;
311
311
  };
312
312
  }, import("@yielded/auth/Identity").IdentityUnavailable, Database>;
313
- export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
313
+ export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
314
314
  passwordPreparedPersistence: import("@yielded/auth/Password").PasswordPreparedPersistence;
315
315
  }, PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinatePasswordPreparedPersistence: {
316
- <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
317
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
316
+ <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
317
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
318
318
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
319
319
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
320
320
  readonly transaction?: never;
321
321
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
322
- <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
323
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
322
+ <Database extends EffectLibsqlDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
323
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
324
324
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
325
325
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
326
326
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
@@ -490,6 +490,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
490
490
  readonly _tag: "Ambiguous";
491
491
  } | {
492
492
  readonly _tag: "Cancelled";
493
+ } | {
494
+ readonly _tag: "Conflict";
493
495
  } | {
494
496
  readonly _tag: "Linked";
495
497
  readonly credential: {
@@ -511,8 +513,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
511
513
  };
512
514
  };
513
515
  readonly changed: boolean;
514
- } | {
515
- readonly _tag: "Conflict";
516
516
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
517
517
  readonly inspectUnlink: (input: {
518
518
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -863,8 +863,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
863
863
  readonly _tag: "Ambiguous";
864
864
  } | {
865
865
  readonly _tag: "Cancelled";
866
- } | {
867
- readonly _tag: "Conflict";
868
866
  } | {
869
867
  readonly _tag: "Connected";
870
868
  readonly grant: {
@@ -934,6 +932,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
934
932
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
935
933
  };
936
934
  };
935
+ } | {
936
+ readonly _tag: "Conflict";
937
937
  } | {
938
938
  readonly _tag: "Busy";
939
939
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
@@ -1323,8 +1323,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1323
1323
  readonly _tag: "Ambiguous";
1324
1324
  } | {
1325
1325
  readonly _tag: "Cancelled";
1326
- } | {
1327
- readonly _tag: "Conflict";
1328
1326
  } | {
1329
1327
  readonly _tag: "Connected";
1330
1328
  readonly grant: {
@@ -1394,6 +1392,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1394
1392
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1395
1393
  };
1396
1394
  };
1395
+ } | {
1396
+ readonly _tag: "Conflict";
1397
1397
  } | {
1398
1398
  readonly _tag: "Busy";
1399
1399
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
package/dist/Mysql2.d.mts CHANGED
@@ -205,6 +205,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
205
205
  readonly _tag: "Ambiguous";
206
206
  } | {
207
207
  readonly _tag: "Cancelled";
208
+ } | {
209
+ readonly _tag: "Conflict";
208
210
  } | {
209
211
  readonly _tag: "Linked";
210
212
  readonly credential: {
@@ -226,8 +228,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
226
228
  };
227
229
  };
228
230
  readonly changed: boolean;
229
- } | {
230
- readonly _tag: "Conflict";
231
231
  }, A>) => import("effect/Effect").Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
232
232
  readonly inspectUnlink: (input: {
233
233
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -1262,6 +1262,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1262
1262
  readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
1263
1263
  }) => import("effect/Effect").Effect<{
1264
1264
  readonly _tag: "Rejected";
1265
+ } | {
1266
+ readonly _tag: "ReauthorizationRequired";
1265
1267
  } | {
1266
1268
  readonly _tag: "Busy";
1267
1269
  } | {
@@ -1333,8 +1335,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1333
1335
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1334
1336
  };
1335
1337
  };
1336
- } | {
1337
- readonly _tag: "ReauthorizationRequired";
1338
1338
  }, import("@yielded/auth/OAuth").OAuthUnavailable>;
1339
1339
  readonly claimRefresh: <A>(input: {
1340
1340
  readonly grant: import("@yielded/auth/OAuth").OAuthConnectedStoredGrant;
@@ -1344,10 +1344,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1344
1344
  readonly lifetimeMillis: number;
1345
1345
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1346
1346
  readonly _tag: "Rejected";
1347
- } | {
1348
- readonly _tag: "Busy";
1349
1347
  } | {
1350
1348
  readonly _tag: "ReauthorizationRequired";
1349
+ } | {
1350
+ readonly _tag: "Busy";
1351
1351
  } | {
1352
1352
  readonly _tag: "Claimed";
1353
1353
  readonly claim: {
@@ -1510,10 +1510,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1510
1510
  readonly lifetimeMillis: number;
1511
1511
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1512
1512
  readonly _tag: "Rejected";
1513
- } | {
1514
- readonly _tag: "Busy";
1515
1513
  } | {
1516
1514
  readonly _tag: "ReauthorizationRequired";
1515
+ } | {
1516
+ readonly _tag: "Busy";
1517
1517
  } | {
1518
1518
  readonly _tag: "Admitted";
1519
1519
  readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
package/dist/Pglite.d.mts CHANGED
@@ -205,6 +205,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
205
205
  readonly _tag: "Ambiguous";
206
206
  } | {
207
207
  readonly _tag: "Cancelled";
208
+ } | {
209
+ readonly _tag: "Conflict";
208
210
  } | {
209
211
  readonly _tag: "Linked";
210
212
  readonly credential: {
@@ -226,8 +228,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
226
228
  };
227
229
  };
228
230
  readonly changed: boolean;
229
- } | {
230
- readonly _tag: "Conflict";
231
231
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
232
232
  readonly inspectUnlink: (input: {
233
233
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -1262,6 +1262,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1262
1262
  readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
1263
1263
  }) => Effect.Effect<{
1264
1264
  readonly _tag: "Rejected";
1265
+ } | {
1266
+ readonly _tag: "ReauthorizationRequired";
1265
1267
  } | {
1266
1268
  readonly _tag: "Busy";
1267
1269
  } | {
@@ -1333,8 +1335,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1333
1335
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1334
1336
  };
1335
1337
  };
1336
- } | {
1337
- readonly _tag: "ReauthorizationRequired";
1338
1338
  }, import("@yielded/auth/OAuth").OAuthUnavailable>;
1339
1339
  readonly claimRefresh: <A>(input: {
1340
1340
  readonly grant: import("@yielded/auth/OAuth").OAuthConnectedStoredGrant;
@@ -1344,10 +1344,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1344
1344
  readonly lifetimeMillis: number;
1345
1345
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1346
1346
  readonly _tag: "Rejected";
1347
- } | {
1348
- readonly _tag: "Busy";
1349
1347
  } | {
1350
1348
  readonly _tag: "ReauthorizationRequired";
1349
+ } | {
1350
+ readonly _tag: "Busy";
1351
1351
  } | {
1352
1352
  readonly _tag: "Claimed";
1353
1353
  readonly claim: {
@@ -1510,10 +1510,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1510
1510
  readonly lifetimeMillis: number;
1511
1511
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1512
1512
  readonly _tag: "Rejected";
1513
- } | {
1514
- readonly _tag: "Busy";
1515
1513
  } | {
1516
1514
  readonly _tag: "ReauthorizationRequired";
1515
+ } | {
1516
+ readonly _tag: "Busy";
1517
1517
  } | {
1518
1518
  readonly _tag: "Admitted";
1519
1519
  readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
@@ -205,6 +205,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
205
205
  readonly _tag: "Ambiguous";
206
206
  } | {
207
207
  readonly _tag: "Cancelled";
208
+ } | {
209
+ readonly _tag: "Conflict";
208
210
  } | {
209
211
  readonly _tag: "Linked";
210
212
  readonly credential: {
@@ -226,8 +228,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
226
228
  };
227
229
  };
228
230
  readonly changed: boolean;
229
- } | {
230
- readonly _tag: "Conflict";
231
231
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
232
232
  readonly inspectUnlink: (input: {
233
233
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -578,8 +578,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
578
578
  readonly _tag: "Ambiguous";
579
579
  } | {
580
580
  readonly _tag: "Cancelled";
581
- } | {
582
- readonly _tag: "Conflict";
583
581
  } | {
584
582
  readonly _tag: "Connected";
585
583
  readonly grant: {
@@ -649,6 +647,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
649
647
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
650
648
  };
651
649
  };
650
+ } | {
651
+ readonly _tag: "Conflict";
652
652
  } | {
653
653
  readonly _tag: "Busy";
654
654
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
@@ -1038,8 +1038,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1038
1038
  readonly _tag: "Ambiguous";
1039
1039
  } | {
1040
1040
  readonly _tag: "Cancelled";
1041
- } | {
1042
- readonly _tag: "Conflict";
1043
1041
  } | {
1044
1042
  readonly _tag: "Connected";
1045
1043
  readonly grant: {
@@ -1109,6 +1107,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1109
1107
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1110
1108
  };
1111
1109
  };
1110
+ } | {
1111
+ readonly _tag: "Conflict";
1112
1112
  } | {
1113
1113
  readonly _tag: "Busy";
1114
1114
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
@@ -84,13 +84,13 @@ export declare const coordinateEmailAddress: {
84
84
  };
85
85
  }, import("@yielded/auth/Email").EmailUnavailable, Database>;
86
86
  export declare const coordinatePasswordPersistence: {
87
- <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
88
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
87
+ <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
88
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
89
89
  readonly proofMapping?: PM;
90
90
  readonly transaction?: never;
91
91
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/Password").PasswordPersistence>>;
92
- <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
93
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
92
+ <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
93
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
94
94
  readonly proofMapping?: PM;
95
95
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
96
96
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/Password").PasswordPersistence>>;
@@ -105,15 +105,15 @@ export declare const coordinatePasswordPersistence: {
105
105
  readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>>;
106
106
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
107
107
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
108
- }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
108
+ }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
109
109
  passwordPersistence: {
110
- readonly admitAttempt: <A_1>(input: {
110
+ readonly prepareAttempt: (input: {
111
111
  readonly moduleId: string;
112
112
  readonly action: "sign-in" | "change";
113
113
  readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
114
114
  readonly subjectId?: import("@yielded/auth/Schema").SubjectId;
115
- readonly policy: import("@yielded/auth/Password").PasswordAttemptPolicy;
116
- }, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordAttemptAdmission, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, import("@yielded/auth/Password").PasswordUnavailable>;
115
+ readonly attemptLifetimeMillis: number;
116
+ }) => Effect.Effect<import("@yielded/auth/Password").PasswordAttemptPreparation, import("@yielded/auth/Password").PasswordUnavailable>;
117
117
  readonly settleAttempt: <A_1>(input: {
118
118
  readonly moduleId: string;
119
119
  readonly attemptId: import("@yielded/auth/Password").PasswordAttemptId;
@@ -306,17 +306,17 @@ export declare const makeExternalIdentityServices: <Subject extends AnySQLiteTab
306
306
  readonly bind: (subjectId: import("@yielded/auth/Schema").SubjectId, identity: import("@yielded/auth/Identity").ExternalIdentity) => Effect.Effect<void, import("@yielded/auth/Identity").IdentityConflict | import("@yielded/auth/Identity").IdentityUnavailable>;
307
307
  };
308
308
  }, import("@yielded/auth/Identity").IdentityUnavailable, Database>;
309
- export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
309
+ export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
310
310
  passwordPreparedPersistence: import("@yielded/auth/Password").PasswordPreparedPersistence;
311
311
  }, import("@yielded/auth/Password").PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinatePasswordPreparedPersistence: {
312
- <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
313
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
312
+ <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
313
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
314
314
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
315
315
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
316
316
  readonly transaction?: never;
317
317
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
318
- <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
319
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
318
+ <Database extends EffectSQLiteBunDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
319
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
320
320
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
321
321
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
322
322
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
@@ -486,6 +486,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
486
486
  readonly _tag: "Ambiguous";
487
487
  } | {
488
488
  readonly _tag: "Cancelled";
489
+ } | {
490
+ readonly _tag: "Conflict";
489
491
  } | {
490
492
  readonly _tag: "Linked";
491
493
  readonly credential: {
@@ -507,8 +509,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
507
509
  };
508
510
  };
509
511
  readonly changed: boolean;
510
- } | {
511
- readonly _tag: "Conflict";
512
512
  }, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
513
513
  readonly inspectUnlink: (input: {
514
514
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -1543,6 +1543,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1543
1543
  readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
1544
1544
  }) => Effect.Effect<{
1545
1545
  readonly _tag: "Rejected";
1546
+ } | {
1547
+ readonly _tag: "ReauthorizationRequired";
1546
1548
  } | {
1547
1549
  readonly _tag: "Busy";
1548
1550
  } | {
@@ -1614,8 +1616,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1614
1616
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1615
1617
  };
1616
1618
  };
1617
- } | {
1618
- readonly _tag: "ReauthorizationRequired";
1619
1619
  }, import("@yielded/auth/OAuth").OAuthUnavailable>;
1620
1620
  readonly claimRefresh: <A>(input: {
1621
1621
  readonly grant: import("@yielded/auth/OAuth").OAuthConnectedStoredGrant;
@@ -1625,10 +1625,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1625
1625
  readonly lifetimeMillis: number;
1626
1626
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1627
1627
  readonly _tag: "Rejected";
1628
- } | {
1629
- readonly _tag: "Busy";
1630
1628
  } | {
1631
1629
  readonly _tag: "ReauthorizationRequired";
1630
+ } | {
1631
+ readonly _tag: "Busy";
1632
1632
  } | {
1633
1633
  readonly _tag: "Claimed";
1634
1634
  readonly claim: {
@@ -1791,10 +1791,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1791
1791
  readonly lifetimeMillis: number;
1792
1792
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1793
1793
  readonly _tag: "Rejected";
1794
- } | {
1795
- readonly _tag: "Busy";
1796
1794
  } | {
1797
1795
  readonly _tag: "ReauthorizationRequired";
1796
+ } | {
1797
+ readonly _tag: "Busy";
1798
1798
  } | {
1799
1799
  readonly _tag: "Admitted";
1800
1800
  readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
@@ -85,13 +85,13 @@ export declare const coordinateEmailAddress: {
85
85
  };
86
86
  }, import("@yielded/auth/Email").EmailUnavailable, Database>;
87
87
  export declare const coordinatePasswordPersistence: {
88
- <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
89
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
88
+ <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
89
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
90
90
  readonly proofMapping?: PM;
91
91
  readonly transaction?: never;
92
92
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/Password").PasswordPersistence>>;
93
- <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
94
- readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
93
+ <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
94
+ readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
95
95
  readonly proofMapping?: PM;
96
96
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
97
97
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/Password").PasswordPersistence>>;
@@ -106,15 +106,15 @@ export declare const coordinatePasswordPersistence: {
106
106
  readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>>;
107
107
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
108
108
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
109
- }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<RS>, DrizzleTableModel<CE>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
109
+ }, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<A>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
110
110
  passwordPersistence: {
111
- readonly admitAttempt: <A_1>(input: {
111
+ readonly prepareAttempt: (input: {
112
112
  readonly moduleId: string;
113
113
  readonly action: "sign-in" | "change";
114
114
  readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
115
115
  readonly subjectId?: import("@yielded/auth/Schema").SubjectId;
116
- readonly policy: import("@yielded/auth/Password").PasswordAttemptPolicy;
117
- }, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordAttemptAdmission, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, import("@yielded/auth/Password").PasswordUnavailable>;
116
+ readonly attemptLifetimeMillis: number;
117
+ }) => Effect.Effect<import("@yielded/auth/Password").PasswordAttemptPreparation, import("@yielded/auth/Password").PasswordUnavailable>;
118
118
  readonly settleAttempt: <A_1>(input: {
119
119
  readonly moduleId: string;
120
120
  readonly attemptId: import("@yielded/auth/Password").PasswordAttemptId;
@@ -307,17 +307,17 @@ export declare const makeExternalIdentityServices: <Subject extends AnySQLiteTab
307
307
  readonly bind: (subjectId: import("@yielded/auth/Schema").SubjectId, identity: import("@yielded/auth/Identity").ExternalIdentity) => Effect.Effect<void, import("@yielded/auth/Identity").IdentityConflict | import("@yielded/auth/Identity").IdentityUnavailable>;
308
308
  };
309
309
  }, import("@yielded/auth/Identity").IdentityUnavailable, Database>;
310
- export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
310
+ export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
311
311
  passwordPreparedPersistence: import("@yielded/auth/Password").PasswordPreparedPersistence;
312
312
  }, import("@yielded/auth/Password").PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinatePasswordPreparedPersistence: {
313
- <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
314
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
313
+ <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
314
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
315
315
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
316
316
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
317
317
  readonly transaction?: never;
318
318
  }, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
319
- <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, RS extends AnySQLiteTable, CE extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
320
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
319
+ <Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, A extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
320
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, M, T, B, NativeId>;
321
321
  readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
322
322
  readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
323
323
  readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
@@ -483,10 +483,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
483
483
  readonly nowMillis: number;
484
484
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
485
485
  readonly _tag: "Rejected";
486
- } | {
487
- readonly _tag: "Cancelled";
488
486
  } | {
489
487
  readonly _tag: "Ambiguous";
488
+ } | {
489
+ readonly _tag: "Cancelled";
490
490
  } | {
491
491
  readonly _tag: "Conflict";
492
492
  } | {
@@ -856,10 +856,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
856
856
  readonly outcome: import("@yielded/auth/OAuth").OAuthSignInAccessOutcome;
857
857
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
858
858
  readonly _tag: "Rejected";
859
- } | {
860
- readonly _tag: "Cancelled";
861
859
  } | {
862
860
  readonly _tag: "Ambiguous";
861
+ } | {
862
+ readonly _tag: "Cancelled";
863
863
  } | {
864
864
  readonly _tag: "Connected";
865
865
  readonly grant: {
@@ -1316,10 +1316,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
1316
1316
  readonly nowMillis: number;
1317
1317
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1318
1318
  readonly _tag: "Rejected";
1319
- } | {
1320
- readonly _tag: "Cancelled";
1321
1319
  } | {
1322
1320
  readonly _tag: "Ambiguous";
1321
+ } | {
1322
+ readonly _tag: "Cancelled";
1323
1323
  } | {
1324
1324
  readonly _tag: "Connected";
1325
1325
  readonly grant: {