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

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 (185) hide show
  1. package/README.md +3 -0
  2. package/dist/D1.d.mts +9 -9
  3. package/dist/D1.mjs +2 -1
  4. package/dist/D1.mjs.map +1 -1
  5. package/dist/Libsql.d.mts +46 -62
  6. package/dist/Libsql.mjs +2 -1
  7. package/dist/Libsql.mjs.map +1 -1
  8. package/dist/Mysql2.d.mts +24 -25
  9. package/dist/Pglite.d.mts +26 -26
  10. package/dist/Pglite.mjs +2 -1
  11. package/dist/Pglite.mjs.map +1 -1
  12. package/dist/Postgres.d.mts +27 -27
  13. package/dist/Postgres.mjs +2 -1
  14. package/dist/Postgres.mjs.map +1 -1
  15. package/dist/SqliteBun.d.mts +47 -63
  16. package/dist/SqliteBun.mjs +2 -1
  17. package/dist/SqliteBun.mjs.map +1 -1
  18. package/dist/SqliteDo.d.mts +45 -61
  19. package/dist/SqliteDo.mjs +2 -1
  20. package/dist/SqliteDo.mjs.map +1 -1
  21. package/dist/SqliteNode.d.mts +49 -65
  22. package/dist/SqliteNode.mjs +2 -1
  23. package/dist/SqliteNode.mjs.map +1 -1
  24. package/dist/SqliteWasm.d.mts +45 -61
  25. package/dist/SqliteWasm.mjs +2 -1
  26. package/dist/SqliteWasm.mjs.map +1 -1
  27. package/dist/drizzle/crypto.mjs +1 -1
  28. package/dist/drizzle/d1-emails.d.mts +1 -1
  29. package/dist/drizzle/d1-oauth.d.mts +13 -13
  30. package/dist/drizzle/d1-passkey.d.mts +1 -1
  31. package/dist/drizzle/d1-password-prepared.d.mts +4 -4
  32. package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
  33. package/dist/drizzle/d1-passwords.d.mts +17 -33
  34. package/dist/drizzle/d1-passwords.mjs +56 -198
  35. package/dist/drizzle/d1-passwords.mjs.map +1 -1
  36. package/dist/drizzle/d1-phone.d.mts +1 -1
  37. package/dist/drizzle/d1-proofs.d.mts +1 -1
  38. package/dist/drizzle/d1-sessions.d.mts +2 -2
  39. package/dist/drizzle/d1-sessions.mjs +11 -6
  40. package/dist/drizzle/d1-sessions.mjs.map +1 -1
  41. package/dist/drizzle/d1-totp.d.mts +1 -1
  42. package/dist/drizzle/mysql-password-prepared.d.mts +5 -5
  43. package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
  44. package/dist/drizzle/mysql-passwords.d.mts +16 -32
  45. package/dist/drizzle/mysql-passwords.mjs.map +1 -1
  46. package/dist/drizzle/mysql-sessions.d.mts +1 -1
  47. package/dist/drizzle/native-sql-table.mjs +26 -1
  48. package/dist/drizzle/native-sql-table.mjs.map +1 -1
  49. package/dist/drizzle/oauth-connected-model.d.mts +20 -281
  50. package/dist/drizzle/oauth-connected-model.mjs +3 -17
  51. package/dist/drizzle/oauth-connected-model.mjs.map +1 -1
  52. package/dist/drizzle/oauth-connected-reference.d.mts +1 -3
  53. package/dist/drizzle/oauth-connected-reference.mjs +4 -53
  54. package/dist/drizzle/oauth-connected-reference.mjs.map +1 -1
  55. package/dist/drizzle/oauth-connected-target.d.mts +3 -990
  56. package/dist/drizzle/oauth-connected-target.mjs +8 -92
  57. package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
  58. package/dist/drizzle/oauth-kernel.mjs +11 -0
  59. package/dist/drizzle/oauth-kernel.mjs.map +1 -0
  60. package/dist/drizzle/oauth-model.d.mts +35 -438
  61. package/dist/drizzle/oauth-model.mjs +6 -44
  62. package/dist/drizzle/oauth-model.mjs.map +1 -1
  63. package/dist/drizzle/oauth-mysql.mjs +2 -2
  64. package/dist/drizzle/oauth-mysql.mjs.map +1 -1
  65. package/dist/drizzle/oauth-proxy.d.mts +10 -0
  66. package/dist/drizzle/oauth-proxy.mjs +54 -0
  67. package/dist/drizzle/oauth-proxy.mjs.map +1 -0
  68. package/dist/drizzle/oauth-target.d.mts +6 -107
  69. package/dist/drizzle/oauth-target.mjs +15 -245
  70. package/dist/drizzle/oauth-target.mjs.map +1 -1
  71. package/dist/drizzle/password-model.d.mts +5 -6
  72. package/dist/drizzle/password-prepared-model.d.mts +5 -5
  73. package/dist/drizzle/password-prepared-model.mjs.map +1 -1
  74. package/dist/drizzle/password-prepared-state.mjs +1 -1
  75. package/dist/drizzle/pg-password-prepared.d.mts +5 -5
  76. package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
  77. package/dist/drizzle/pg-passwords.d.mts +16 -32
  78. package/dist/drizzle/pg-passwords.mjs.map +1 -1
  79. package/dist/drizzle/pg-sessions.d.mts +1 -1
  80. package/dist/drizzle/phone-target.d.mts +1 -1
  81. package/dist/drizzle/phone-target.mjs +1 -1
  82. package/dist/drizzle/query-operations.mjs +3 -1
  83. package/dist/drizzle/query-operations.mjs.map +1 -1
  84. package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
  85. package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
  86. package/dist/drizzle/storage-validation.mjs +10 -185
  87. package/dist/drizzle/storage-validation.mjs.map +1 -1
  88. package/dist/drizzle/totp-target.d.mts +2 -2
  89. package/dist/drizzle/totp-target.mjs +2 -2
  90. package/dist/drizzle/transaction-execution.d.mts +2 -2
  91. package/dist/drizzle/transaction-owner.d.mts +1 -2
  92. package/dist/index.d.mts +3 -2
  93. package/dist/internal/drizzle-postgres-oauth-proxy.d.mts +138 -0
  94. package/dist/internal/drizzle-postgres-oauth-proxy.mjs +29 -0
  95. package/dist/internal/drizzle-postgres-oauth-proxy.mjs.map +1 -0
  96. package/dist/internal/drizzle-sqlite-oauth-proxy.d.mts +146 -0
  97. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs +29 -0
  98. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs.map +1 -0
  99. package/package.json +1 -1
  100. package/src/D1.ts +2 -0
  101. package/src/Libsql.ts +2 -0
  102. package/src/Pglite.ts +2 -0
  103. package/src/Postgres.ts +2 -0
  104. package/src/SqliteBun.ts +2 -0
  105. package/src/SqliteDo.ts +2 -0
  106. package/src/SqliteNode.ts +2 -0
  107. package/src/SqliteWasm.ts +2 -0
  108. package/src/drizzle/d1-password-prepared.ts +2 -5
  109. package/src/drizzle/d1-passwords.ts +123 -458
  110. package/src/drizzle/d1-sessions.ts +21 -6
  111. package/src/drizzle/mysql-password-prepared.ts +4 -8
  112. package/src/drizzle/mysql-passwords.ts +5 -10
  113. package/src/drizzle/native-sql-table.ts +30 -0
  114. package/src/drizzle/oauth-connected-model.ts +97 -315
  115. package/src/drizzle/oauth-connected-reference.ts +13 -93
  116. package/src/drizzle/oauth-connected-target.ts +14 -271
  117. package/src/drizzle/oauth-kernel.ts +10 -0
  118. package/src/drizzle/oauth-model.ts +188 -541
  119. package/src/drizzle/oauth-mysql.ts +2 -2
  120. package/src/drizzle/oauth-proxy.ts +101 -0
  121. package/src/drizzle/oauth-target.ts +33 -737
  122. package/src/drizzle/password-model.ts +0 -13
  123. package/src/drizzle/password-prepared-model.ts +0 -6
  124. package/src/drizzle/pg-password-prepared.ts +4 -8
  125. package/src/drizzle/pg-passwords.ts +5 -10
  126. package/src/drizzle/query-operations.ts +4 -0
  127. package/src/drizzle/sqlite-password-prepared.ts +4 -8
  128. package/src/drizzle/sqlite-passwords.ts +7 -14
  129. package/src/drizzle/storage-validation.ts +13 -214
  130. package/src/index.ts +2 -4
  131. package/src/internal/drizzle-postgres-oauth-proxy.ts +37 -0
  132. package/src/internal/drizzle-sqlite-oauth-proxy.ts +44 -0
  133. package/dist/_virtual/_rolldown/runtime.mjs +0 -13
  134. package/dist/drizzle/oauth-accounts.mjs +0 -359
  135. package/dist/drizzle/oauth-accounts.mjs.map +0 -1
  136. package/dist/drizzle/oauth-connected-access.mjs +0 -212
  137. package/dist/drizzle/oauth-connected-access.mjs.map +0 -1
  138. package/dist/drizzle/oauth-connected-collection.mjs +0 -202
  139. package/dist/drizzle/oauth-connected-collection.mjs.map +0 -1
  140. package/dist/drizzle/oauth-connected-custody.mjs +0 -147
  141. package/dist/drizzle/oauth-connected-custody.mjs.map +0 -1
  142. package/dist/drizzle/oauth-connected-flow.mjs +0 -297
  143. package/dist/drizzle/oauth-connected-flow.mjs.map +0 -1
  144. package/dist/drizzle/oauth-connected-input.mjs +0 -122
  145. package/dist/drizzle/oauth-connected-input.mjs.map +0 -1
  146. package/dist/drizzle/oauth-connected-maintenance.mjs +0 -214
  147. package/dist/drizzle/oauth-connected-maintenance.mjs.map +0 -1
  148. package/dist/drizzle/oauth-connected-management.mjs +0 -229
  149. package/dist/drizzle/oauth-connected-management.mjs.map +0 -1
  150. package/dist/drizzle/oauth-connected-settlement.mjs +0 -128
  151. package/dist/drizzle/oauth-connected-settlement.mjs.map +0 -1
  152. package/dist/drizzle/oauth-connected-sign-in.mjs +0 -265
  153. package/dist/drizzle/oauth-connected-sign-in.mjs.map +0 -1
  154. package/dist/drizzle/oauth-connected-state.d.mts +0 -2062
  155. package/dist/drizzle/oauth-connected-state.mjs +0 -430
  156. package/dist/drizzle/oauth-connected-state.mjs.map +0 -1
  157. package/dist/drizzle/oauth-flow.d.mts +0 -22
  158. package/dist/drizzle/oauth-flow.mjs +0 -253
  159. package/dist/drizzle/oauth-flow.mjs.map +0 -1
  160. package/dist/drizzle/oauth-input.mjs +0 -127
  161. package/dist/drizzle/oauth-input.mjs.map +0 -1
  162. package/dist/drizzle/oauth-owner.d.mts +0 -10
  163. package/dist/drizzle/oauth-owner.mjs +0 -10
  164. package/dist/drizzle/oauth-owner.mjs.map +0 -1
  165. package/dist/drizzle/oauth-registration.d.mts +0 -5
  166. package/dist/drizzle/oauth-registration.mjs +0 -374
  167. package/dist/drizzle/oauth-registration.mjs.map +0 -1
  168. package/dist/drizzle/oauth-state.mjs +0 -107
  169. package/dist/drizzle/oauth-state.mjs.map +0 -1
  170. package/src/drizzle/oauth-accounts.ts +0 -805
  171. package/src/drizzle/oauth-connected-access.ts +0 -361
  172. package/src/drizzle/oauth-connected-collection.ts +0 -324
  173. package/src/drizzle/oauth-connected-custody.ts +0 -279
  174. package/src/drizzle/oauth-connected-flow.ts +0 -529
  175. package/src/drizzle/oauth-connected-input.ts +0 -147
  176. package/src/drizzle/oauth-connected-maintenance.ts +0 -346
  177. package/src/drizzle/oauth-connected-management.ts +0 -365
  178. package/src/drizzle/oauth-connected-settlement.ts +0 -251
  179. package/src/drizzle/oauth-connected-sign-in.ts +0 -443
  180. package/src/drizzle/oauth-connected-state.ts +0 -872
  181. package/src/drizzle/oauth-flow.ts +0 -462
  182. package/src/drizzle/oauth-input.ts +0 -201
  183. package/src/drizzle/oauth-owner.ts +0 -29
  184. package/src/drizzle/oauth-registration.ts +0 -640
  185. package/src/drizzle/oauth-state.ts +0 -218
package/dist/Mysql2.d.mts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { ExternalIdentityTables, IdentityTables, SubjectProvisioningTables } from "./drizzle/model.mjs";
2
2
  import { PasskeyCredentialMapping, PasskeyEnrollmentContextMapping, PasskeyPersistenceMapping } from "./drizzle/passkey-model.mjs";
3
- import { OAuthAccountsMapping, OAuthRegistrationAuthority, OAuthRegistrationIntentMapping, OAuthRegistrationMapping, OAuthSignInMapping } from "./drizzle/oauth-model.mjs";
3
+ import { OAuthAccountsMapping, OAuthRegistrationIntentMapping, OAuthRegistrationMapping, OAuthSignInMapping } from "./drizzle/oauth-model.mjs";
4
4
  import { OAuthConnectedMapping, OAuthConnectedRevocationMapping } from "./drizzle/oauth-connected-model.mjs";
5
5
  import { PasskeyRegistrationCeremonyMapping } from "./drizzle/passkey-registration-ceremony-model.mjs";
6
- import { OAuthCoordinatorError } from "./drizzle/oauth-target.mjs";
7
6
  import { passwordPreparedPersistenceLayer } from "./drizzle/password-prepared-target.mjs";
8
7
  import { TotpMapping, TotpMappingSource, TotpPersistenceServices } from "./drizzle/totp-model.mjs";
9
8
  import { PasskeyManagementMapping, PasskeyRegistrationMapping } from "./drizzle/passkey-write-model.mjs";
@@ -205,8 +204,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
205
204
  readonly _tag: "Ambiguous";
206
205
  } | {
207
206
  readonly _tag: "Cancelled";
208
- } | {
209
- readonly _tag: "Conflict";
210
207
  } | {
211
208
  readonly _tag: "Linked";
212
209
  readonly credential: {
@@ -228,6 +225,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
228
225
  };
229
226
  };
230
227
  readonly changed: boolean;
228
+ } | {
229
+ readonly _tag: "Conflict";
231
230
  }, A>) => import("effect/Effect").Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
232
231
  readonly inspectUnlink: (input: {
233
232
  readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
@@ -385,7 +384,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
385
384
  }>, R extends AnyMySqlTable<{
386
385
  dialect: "mysql";
387
386
  }>, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, TA, I, R, N>) => import("effect/Effect").Effect<{
388
- registrationAuthority: OAuthRegistrationAuthority<Registration>;
387
+ registrationAuthority: import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>;
389
388
  }, import("@yielded/auth/OAuth").OAuthUnavailable, import("effect/Crypto").Crypto | Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinateOAuthRegistration: {
390
389
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnyMySqlTable<{
391
390
  dialect: "mysql";
@@ -403,9 +402,9 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
403
402
  dialect: "mysql";
404
403
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<Database, DatabaseError, DatabaseRequirements>, options: {
405
404
  readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
406
- readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
405
+ readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
407
406
  readonly transaction?: never;
408
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
407
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
409
408
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnyMySqlTable<{
410
409
  dialect: "mysql";
411
410
  }>, O extends AnyMySqlTable<{
@@ -422,11 +421,11 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
422
421
  dialect: "mysql";
423
422
  }>, N, A, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: import("effect/Effect").Effect<Database, DatabaseError, DatabaseRequirements>, options: {
424
423
  readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
425
- readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
424
+ readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
426
425
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
427
426
  readonly transaction: (...args: any[]) => any;
428
427
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
429
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
428
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
430
429
  }, coordinateOAuthSignIn: {
431
430
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
432
431
  dialect: "mysql";
@@ -441,7 +440,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
441
440
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<Database, DatabaseError, DatabaseRequirements>, options: {
442
441
  readonly mapping: OAuthSignInMapping<S, O, C, AC, F, N>;
443
442
  readonly transaction?: never;
444
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
443
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
445
444
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
446
445
  dialect: "mysql";
447
446
  }>, O extends AnyMySqlTable<{
@@ -457,7 +456,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
457
456
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
458
457
  readonly transaction: (...args: any[]) => any;
459
458
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
460
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
459
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
461
460
  }, coordinateOAuthRegistrationIntents: {
462
461
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
463
462
  dialect: "mysql";
@@ -476,7 +475,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
476
475
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<Database, DatabaseError, DatabaseRequirements>, options: {
477
476
  readonly mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, TA, I, N>;
478
477
  readonly transaction?: never;
479
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
478
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
480
479
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
481
480
  dialect: "mysql";
482
481
  }>, O extends AnyMySqlTable<{
@@ -496,7 +495,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
496
495
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
497
496
  readonly transaction: (...args: any[]) => any;
498
497
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
499
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
498
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
500
499
  }, coordinateOAuthAccounts: {
501
500
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
502
501
  dialect: "mysql";
@@ -515,7 +514,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
515
514
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<Database, DatabaseError, DatabaseRequirements>, options: {
516
515
  readonly mapping: OAuthAccountsMapping<S, O, C, AC, F, TA, U, N>;
517
516
  readonly transaction?: never;
518
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
517
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
519
518
  <Database extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
520
519
  dialect: "mysql";
521
520
  }>, O extends AnyMySqlTable<{
@@ -535,7 +534,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
535
534
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
536
535
  readonly transaction: (...args: any[]) => any;
537
536
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
538
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
537
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
539
538
  }, makeOAuthConnectedServices: <S extends AnyMySqlTable<{
540
539
  dialect: "mysql";
541
540
  }>, AC extends AnyMySqlTable<{
@@ -1262,8 +1261,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1262
1261
  readonly profileKey: string & import("effect/Brand").Brand<"effect-auth/OAuthPermissionProfileKey">;
1263
1262
  }) => import("effect/Effect").Effect<{
1264
1263
  readonly _tag: "Rejected";
1265
- } | {
1266
- readonly _tag: "ReauthorizationRequired";
1267
1264
  } | {
1268
1265
  readonly _tag: "Busy";
1269
1266
  } | {
@@ -1335,6 +1332,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1335
1332
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1336
1333
  };
1337
1334
  };
1335
+ } | {
1336
+ readonly _tag: "ReauthorizationRequired";
1338
1337
  }, import("@yielded/auth/OAuth").OAuthUnavailable>;
1339
1338
  readonly claimRefresh: <A>(input: {
1340
1339
  readonly grant: import("@yielded/auth/OAuth").OAuthConnectedStoredGrant;
@@ -1344,10 +1343,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1344
1343
  readonly lifetimeMillis: number;
1345
1344
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1346
1345
  readonly _tag: "Rejected";
1347
- } | {
1348
- readonly _tag: "ReauthorizationRequired";
1349
1346
  } | {
1350
1347
  readonly _tag: "Busy";
1348
+ } | {
1349
+ readonly _tag: "ReauthorizationRequired";
1351
1350
  } | {
1352
1351
  readonly _tag: "Claimed";
1353
1352
  readonly claim: {
@@ -1510,10 +1509,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1510
1509
  readonly lifetimeMillis: number;
1511
1510
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1512
1511
  readonly _tag: "Rejected";
1513
- } | {
1514
- readonly _tag: "ReauthorizationRequired";
1515
1512
  } | {
1516
1513
  readonly _tag: "Busy";
1514
+ } | {
1515
+ readonly _tag: "ReauthorizationRequired";
1517
1516
  } | {
1518
1517
  readonly _tag: "Admitted";
1519
1518
  readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
@@ -1662,7 +1661,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1662
1661
  }>, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<D, DatabaseError, DatabaseRequirements>, options: {
1663
1662
  readonly mapping: OAuthConnectedMapping<S, AC, T, O, F, G, C, H, UA, DC, N, J>;
1664
1663
  readonly transaction?: never;
1665
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1664
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1666
1665
  <D extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, S extends AnyMySqlTable<{
1667
1666
  dialect: "mysql";
1668
1667
  }>, AC extends AnyMySqlTable<{
@@ -1690,7 +1689,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1690
1689
  readonly transaction: SuppliedService<TxId, NoInfer<D extends {
1691
1690
  readonly transaction: (...args: any[]) => any;
1692
1691
  } ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
1693
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1692
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1694
1693
  }, coordinateOAuthConnectedRevocations: {
1695
1694
  <D extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, T extends AnyMySqlTable<{
1696
1695
  dialect: "mysql";
@@ -1709,7 +1708,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1709
1708
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: import("effect/Effect").Effect<D, DatabaseError, DatabaseRequirements>, options: {
1710
1709
  readonly mapping: OAuthConnectedRevocationMapping<T, O, F, G, C, H, J, N>;
1711
1710
  readonly transaction?: never;
1712
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1711
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1713
1712
  <D extends EffectMysql2Database<import("drizzle-orm").TablesRelationalConfig>, T extends AnyMySqlTable<{
1714
1713
  dialect: "mysql";
1715
1714
  }>, O extends AnyMySqlTable<{
@@ -1729,7 +1728,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyMySqlTable<{
1729
1728
  readonly transaction: SuppliedService<TxId, NoInfer<D extends {
1730
1729
  readonly transaction: (...args: any[]) => any;
1731
1730
  } ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
1732
- }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1731
+ }, body: import("effect/Effect").Effect<A, E, R>): import("effect/Effect").Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1733
1732
  };
1734
1733
  export declare const makePasskeyCredentialServices: <S extends AnyMySqlTable<{
1735
1734
  dialect: "mysql";
package/dist/Pglite.d.mts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { ExternalIdentityTables, IdentityTables, SubjectProvisioningTables } from "./drizzle/model.mjs";
2
2
  import { PasskeyCredentialMapping, PasskeyEnrollmentContextMapping, PasskeyPersistenceMapping } from "./drizzle/passkey-model.mjs";
3
- import { OAuthAccountsMapping, OAuthRegistrationAuthority, OAuthRegistrationIntentMapping, OAuthRegistrationMapping, OAuthSignInMapping } from "./drizzle/oauth-model.mjs";
3
+ import { OAuthAccountsMapping, OAuthRegistrationIntentMapping, OAuthRegistrationMapping, OAuthSignInMapping } from "./drizzle/oauth-model.mjs";
4
4
  import { OAuthConnectedMapping, OAuthConnectedRevocationMapping } from "./drizzle/oauth-connected-model.mjs";
5
5
  import { PasskeyRegistrationCeremonyMapping } from "./drizzle/passkey-registration-ceremony-model.mjs";
6
- import { OAuthCoordinatorError } from "./drizzle/oauth-target.mjs";
7
6
  import { passwordPreparedPersistenceLayer } from "./drizzle/password-prepared-target.mjs";
8
7
  import { TotpMapping, TotpMappingSource, TotpPersistenceServices } from "./drizzle/totp-model.mjs";
9
8
  import { PasskeyManagementMapping, PasskeyRegistrationMapping } from "./drizzle/passkey-write-model.mjs";
@@ -12,6 +11,7 @@ import "./index.mjs";
12
11
  import { SuppliedService } from "./drizzle/SuppliedService.mjs";
13
12
  import { TotpCoordinatorError } from "./drizzle/totp-target.mjs";
14
13
  import { PhoneCoordinatorError } from "./drizzle/phone-target.mjs";
14
+ import { OAuthProxyPersistence } from "./internal/drizzle-postgres-oauth-proxy.mjs";
15
15
  import { Database } from "./drizzle/pg-database.mjs";
16
16
  import { coordinatePgAuthenticationAuthority, coordinatePgPendingAuthentication, coordinatePgSessionStepUp, coordinatePgSignedSessionValidity, coordinatePgStatefulSessions, makePgAuthenticationAuthorityServices, makePgPendingAuthenticationServices, makePgSessionStepUpServices, makePgSignedSessionValidityServices, makePgStatefulSessionServices } from "./drizzle/pg-sessions.mjs";
17
17
  import { coordinatePgProofPersistence, makePgProofPersistenceServices } from "./drizzle/pg-proofs.mjs";
@@ -205,8 +205,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
205
205
  readonly _tag: "Ambiguous";
206
206
  } | {
207
207
  readonly _tag: "Cancelled";
208
- } | {
209
- readonly _tag: "Conflict";
210
208
  } | {
211
209
  readonly _tag: "Linked";
212
210
  readonly credential: {
@@ -228,6 +226,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
228
226
  };
229
227
  };
230
228
  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">;
@@ -385,7 +385,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
385
385
  }>, R extends AnyPgTable<{
386
386
  dialect: "pg";
387
387
  }>, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, TA, I, R, N>) => Effect.Effect<{
388
- registrationAuthority: OAuthRegistrationAuthority<Registration>;
388
+ registrationAuthority: import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>;
389
389
  }, import("@yielded/auth/OAuth").OAuthUnavailable, import("effect/Crypto").Crypto | Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinateOAuthRegistration: {
390
390
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnyPgTable<{
391
391
  dialect: "pg";
@@ -403,9 +403,9 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
403
403
  dialect: "pg";
404
404
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
405
405
  readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
406
- readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
406
+ readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
407
407
  readonly transaction?: never;
408
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
408
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
409
409
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnyPgTable<{
410
410
  dialect: "pg";
411
411
  }>, O extends AnyPgTable<{
@@ -422,11 +422,11 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
422
422
  dialect: "pg";
423
423
  }>, N, A, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
424
424
  readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
425
- readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
425
+ readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
426
426
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
427
427
  readonly transaction: (...args: any[]) => any;
428
428
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
429
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
429
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
430
430
  }, coordinateOAuthSignIn: {
431
431
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
432
432
  dialect: "pg";
@@ -441,7 +441,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
441
441
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
442
442
  readonly mapping: OAuthSignInMapping<S, O, C, AC, F, N>;
443
443
  readonly transaction?: never;
444
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
444
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
445
445
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
446
446
  dialect: "pg";
447
447
  }>, O extends AnyPgTable<{
@@ -457,7 +457,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
457
457
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
458
458
  readonly transaction: (...args: any[]) => any;
459
459
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
460
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
460
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthSignInPersistence>>;
461
461
  }, coordinateOAuthRegistrationIntents: {
462
462
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
463
463
  dialect: "pg";
@@ -476,7 +476,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
476
476
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
477
477
  readonly mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, TA, I, N>;
478
478
  readonly transaction?: never;
479
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
479
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
480
480
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
481
481
  dialect: "pg";
482
482
  }>, O extends AnyPgTable<{
@@ -496,7 +496,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
496
496
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
497
497
  readonly transaction: (...args: any[]) => any;
498
498
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
499
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
499
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthRegistrationIntents>>;
500
500
  }, coordinateOAuthAccounts: {
501
501
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
502
502
  dialect: "pg";
@@ -515,7 +515,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
515
515
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
516
516
  readonly mapping: OAuthAccountsMapping<S, O, C, AC, F, TA, U, N>;
517
517
  readonly transaction?: never;
518
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
518
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
519
519
  <Database extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
520
520
  dialect: "pg";
521
521
  }>, O extends AnyPgTable<{
@@ -535,7 +535,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
535
535
  readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
536
536
  readonly transaction: (...args: any[]) => any;
537
537
  } ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
538
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
538
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthAccountsPersistence>>;
539
539
  }, makeOAuthConnectedServices: <S extends AnyPgTable<{
540
540
  dialect: "pg";
541
541
  }>, AC extends AnyPgTable<{
@@ -1262,8 +1262,6 @@ 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";
1267
1265
  } | {
1268
1266
  readonly _tag: "Busy";
1269
1267
  } | {
@@ -1335,6 +1333,8 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1335
1333
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1336
1334
  };
1337
1335
  };
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: "ReauthorizationRequired";
1349
1347
  } | {
1350
1348
  readonly _tag: "Busy";
1349
+ } | {
1350
+ readonly _tag: "ReauthorizationRequired";
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: "ReauthorizationRequired";
1515
1513
  } | {
1516
1514
  readonly _tag: "Busy";
1515
+ } | {
1516
+ readonly _tag: "ReauthorizationRequired";
1517
1517
  } | {
1518
1518
  readonly _tag: "Admitted";
1519
1519
  readonly admissionId: string & import("effect/Brand").Brand<"effect-auth/OAuthClaimId">;
@@ -1662,7 +1662,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1662
1662
  }>, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
1663
1663
  readonly mapping: OAuthConnectedMapping<S, AC, T, O, F, G, C, H, UA, DC, N, J>;
1664
1664
  readonly transaction?: never;
1665
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1665
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1666
1666
  <D extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnyPgTable<{
1667
1667
  dialect: "pg";
1668
1668
  }>, AC extends AnyPgTable<{
@@ -1690,7 +1690,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1690
1690
  readonly transaction: SuppliedService<TxId, NoInfer<D extends {
1691
1691
  readonly transaction: (...args: any[]) => any;
1692
1692
  } ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
1693
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1693
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedPersistence>>;
1694
1694
  }, coordinateOAuthConnectedRevocations: {
1695
1695
  <D extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, T extends AnyPgTable<{
1696
1696
  dialect: "pg";
@@ -1709,7 +1709,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1709
1709
  }>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
1710
1710
  readonly mapping: OAuthConnectedRevocationMapping<T, O, F, G, C, H, J, N>;
1711
1711
  readonly transaction?: never;
1712
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1712
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1713
1713
  <D extends EffectPgDatabase<import("drizzle-orm").TablesRelationalConfig>, T extends AnyPgTable<{
1714
1714
  dialect: "pg";
1715
1715
  }>, O extends AnyPgTable<{
@@ -1729,7 +1729,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1729
1729
  readonly transaction: SuppliedService<TxId, NoInfer<D extends {
1730
1730
  readonly transaction: (...args: any[]) => any;
1731
1731
  } ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
1732
- }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1732
+ }, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | import("@yielded/auth-persistence/Adapter").OAuthCoordinatorError<E>, DatabaseRequirements | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/OAuth").OAuthConnectedRevocations>>;
1733
1733
  };
1734
1734
  export declare const makePasskeyCredentialServices: <S extends AnyPgTable<{
1735
1735
  dialect: "pg";
@@ -2083,5 +2083,5 @@ export declare const AuthPersistence: {
2083
2083
  /** Construct Drizzle from the driver's SQL-client Layer. */
2084
2084
  export declare const databaseLayer: Layer.Layer<Database, never, import("@effect/sql-pglite/PgliteClient").PgliteClient>;
2085
2085
  //#endregion
2086
- export { Database, coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority, coordinatePgEmailAddress as coordinateEmailAddress, coordinatePgEmailRegistration as coordinateEmailRegistration, coordinatePgPasswordPersistence as coordinatePasswordPersistence, coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence, coordinatePgPasswordRegistration as coordinatePasswordRegistration, coordinatePgPendingAuthentication as coordinatePendingAuthentication, coordinatePgProofPersistence as coordinateProofPersistence, coordinatePgSessionStepUp as coordinateSessionStepUp, coordinatePgSignedSessionValidity as coordinateSignedSessionValidity, coordinatePgStatefulSessions as coordinateStatefulSessions, makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices, makePgEmailAddressServices as makeEmailAddressServices, makePgEmailRegistrationServices as makeEmailRegistrationServices, makePgEmailSignInServices as makeEmailSignInServices, makePgPasswordPersistenceServices as makePasswordPersistenceServices, makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices, makePgPasswordRegistrationServices as makePasswordRegistrationServices, makePgPendingAuthenticationServices as makePendingAuthenticationServices, makePgProofPersistenceServices as makeProofPersistenceServices, makePgSessionStepUpServices as makeSessionStepUpServices, makePgSignedSessionValidityServices as makeSignedSessionValidityServices, makePgStatefulSessionServices as makeStatefulSessionServices, passwordPreparedPersistenceLayer };
2086
+ export { Database, OAuthProxyPersistence, coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority, coordinatePgEmailAddress as coordinateEmailAddress, coordinatePgEmailRegistration as coordinateEmailRegistration, coordinatePgPasswordPersistence as coordinatePasswordPersistence, coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence, coordinatePgPasswordRegistration as coordinatePasswordRegistration, coordinatePgPendingAuthentication as coordinatePendingAuthentication, coordinatePgProofPersistence as coordinateProofPersistence, coordinatePgSessionStepUp as coordinateSessionStepUp, coordinatePgSignedSessionValidity as coordinateSignedSessionValidity, coordinatePgStatefulSessions as coordinateStatefulSessions, makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices, makePgEmailAddressServices as makeEmailAddressServices, makePgEmailRegistrationServices as makeEmailRegistrationServices, makePgEmailSignInServices as makeEmailSignInServices, makePgPasswordPersistenceServices as makePasswordPersistenceServices, makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices, makePgPasswordRegistrationServices as makePasswordRegistrationServices, makePgPendingAuthenticationServices as makePendingAuthenticationServices, makePgProofPersistenceServices as makeProofPersistenceServices, makePgSessionStepUpServices as makeSessionStepUpServices, makePgSignedSessionValidityServices as makeSignedSessionValidityServices, makePgStatefulSessionServices as makeStatefulSessionServices, passwordPreparedPersistenceLayer };
2087
2087
  //# sourceMappingURL=Pglite.d.mts.map
package/dist/Pglite.mjs CHANGED
@@ -6,6 +6,7 @@ import { makePasskeyTarget } from "./drizzle/passkey-drivers.mjs";
6
6
  import { makePhoneTarget, sqlClientPhoneStandaloneGuard } from "./drizzle/phone-target.mjs";
7
7
  import { makeOAuthTarget } from "./drizzle/oauth-drivers.mjs";
8
8
  import { drizzleMigrationsLayer } from "./internal/drizzle-migrations.mjs";
9
+ import { OAuthProxyPersistence } from "./internal/drizzle-postgres-oauth-proxy.mjs";
9
10
  import { Database } from "./drizzle/pg-database.mjs";
10
11
  import { makePgExternalIdentityServices, makePgIdentityServices, makePgSubjectProvisioningServices } from "./drizzle/pg-identity.mjs";
11
12
  import { coordinatePgAuthenticationAuthority, coordinatePgPendingAuthentication, coordinatePgSessionStepUp, coordinatePgSignedSessionValidity, coordinatePgStatefulSessions, makePgAuthenticationAuthorityServices, makePgPendingAuthenticationServices, makePgSessionStepUpServices, makePgSignedSessionValidityServices, makePgStatefulSessionServices } from "./drizzle/pg-sessions.mjs";
@@ -52,6 +53,6 @@ const AuthPersistence = {
52
53
  /** Construct Drizzle from the driver's SQL-client Layer. */
53
54
  const databaseLayer = Layer.effect(Database, makeWithDefaults({}));
54
55
  //#endregion
55
- export { AuthPersistence, Database, commitMode, coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority, coordinatePgEmailAddress as coordinateEmailAddress, coordinatePgEmailRegistration as coordinateEmailRegistration, coordinateOAuthAccounts, coordinateOAuthConnected, coordinateOAuthConnectedRevocations, coordinateOAuthRegistration, coordinateOAuthRegistrationIntents, coordinateOAuthSignIn, coordinatePasskeyManagement, coordinatePasskeyPersistence, coordinatePasskeyRegistration, coordinatePasskeyRegistrationCeremony, coordinatePgPasswordPersistence as coordinatePasswordPersistence, coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence, coordinatePgPasswordRegistration as coordinatePasswordRegistration, coordinatePgPendingAuthentication as coordinatePendingAuthentication, coordinatePhonePersistence, coordinatePgProofPersistence as coordinateProofPersistence, coordinatePgSessionStepUp as coordinateSessionStepUp, coordinatePgSignedSessionValidity as coordinateSignedSessionValidity, coordinatePgStatefulSessions as coordinateStatefulSessions, coordinateTotpPersistence, databaseLayer, makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices, makePgEmailAddressServices as makeEmailAddressServices, makePgEmailRegistrationServices as makeEmailRegistrationServices, makePgEmailSignInServices as makeEmailSignInServices, makeExternalIdentityServices, makeIdentityServices, makeOAuthAccountsServices, makeOAuthConnectedRevocationServices, makeOAuthConnectedServices, makeOAuthRegistrationIntentServices, makeOAuthRegistrationServices, makeOAuthSignInServices, makePasskeyCredentialServices, makePasskeyEnrollmentContextServices, makePasskeyManagementServices, makePasskeyPersistenceServices, makePasskeyRegistrationCeremonyServices, makePasskeyRegistrationServices, makePgPasswordPersistenceServices as makePasswordPersistenceServices, makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices, makePgPasswordRegistrationServices as makePasswordRegistrationServices, makePgPendingAuthenticationServices as makePendingAuthenticationServices, makePhonePersistenceServices, makePgProofPersistenceServices as makeProofPersistenceServices, makePgSessionStepUpServices as makeSessionStepUpServices, makePgSignedSessionValidityServices as makeSignedSessionValidityServices, makePgStatefulSessionServices as makeStatefulSessionServices, makeSubjectProvisioningServices, makeTotpPersistenceServices, passwordPreparedPersistenceLayer };
56
+ export { AuthPersistence, Database, OAuthProxyPersistence, commitMode, coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority, coordinatePgEmailAddress as coordinateEmailAddress, coordinatePgEmailRegistration as coordinateEmailRegistration, coordinateOAuthAccounts, coordinateOAuthConnected, coordinateOAuthConnectedRevocations, coordinateOAuthRegistration, coordinateOAuthRegistrationIntents, coordinateOAuthSignIn, coordinatePasskeyManagement, coordinatePasskeyPersistence, coordinatePasskeyRegistration, coordinatePasskeyRegistrationCeremony, coordinatePgPasswordPersistence as coordinatePasswordPersistence, coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence, coordinatePgPasswordRegistration as coordinatePasswordRegistration, coordinatePgPendingAuthentication as coordinatePendingAuthentication, coordinatePhonePersistence, coordinatePgProofPersistence as coordinateProofPersistence, coordinatePgSessionStepUp as coordinateSessionStepUp, coordinatePgSignedSessionValidity as coordinateSignedSessionValidity, coordinatePgStatefulSessions as coordinateStatefulSessions, coordinateTotpPersistence, databaseLayer, makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices, makePgEmailAddressServices as makeEmailAddressServices, makePgEmailRegistrationServices as makeEmailRegistrationServices, makePgEmailSignInServices as makeEmailSignInServices, makeExternalIdentityServices, makeIdentityServices, makeOAuthAccountsServices, makeOAuthConnectedRevocationServices, makeOAuthConnectedServices, makeOAuthRegistrationIntentServices, makeOAuthRegistrationServices, makeOAuthSignInServices, makePasskeyCredentialServices, makePasskeyEnrollmentContextServices, makePasskeyManagementServices, makePasskeyPersistenceServices, makePasskeyRegistrationCeremonyServices, makePasskeyRegistrationServices, makePgPasswordPersistenceServices as makePasswordPersistenceServices, makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices, makePgPasswordRegistrationServices as makePasswordRegistrationServices, makePgPendingAuthenticationServices as makePendingAuthenticationServices, makePhonePersistenceServices, makePgProofPersistenceServices as makeProofPersistenceServices, makePgSessionStepUpServices as makeSessionStepUpServices, makePgSignedSessionValidityServices as makeSignedSessionValidityServices, makePgStatefulSessionServices as makeStatefulSessionServices, makeSubjectProvisioningServices, makeTotpPersistenceServices, passwordPreparedPersistenceLayer };
56
57
 
57
58
  //# sourceMappingURL=Pglite.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pglite.mjs","names":[],"sources":["../src/Pglite.ts"],"sourcesContent":["import type { AnyRelations } from \"drizzle-orm\";\nimport { type EffectPgDatabase, makeWithDefaults } from \"drizzle-orm/effect-pglite\";\nimport type { AnyPgTable } from \"drizzle-orm/pg-core\";\nimport { Effect, Layer } from \"effect\";\n\nimport type {\n IdentityTables,\n SubjectProvisioningTables,\n ExternalIdentityTables,\n} from \"./drizzle/model\";\nimport { Database } from \"./drizzle/pg-database\";\nimport {\n makePgExternalIdentityServices,\n makePgIdentityServices,\n makePgSubjectProvisioningServices,\n} from \"./drizzle/pg-identity\";\n\nexport { Database } from \"./drizzle/pg-database\";\n\nexport {\n coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority,\n coordinatePgPendingAuthentication as coordinatePendingAuthentication,\n coordinatePgSignedSessionValidity as coordinateSignedSessionValidity,\n coordinatePgStatefulSessions as coordinateStatefulSessions,\n makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices,\n makePgPendingAuthenticationServices as makePendingAuthenticationServices,\n makePgSignedSessionValidityServices as makeSignedSessionValidityServices,\n makePgStatefulSessionServices as makeStatefulSessionServices,\n} from \"./drizzle/pg-sessions\";\n\nexport {\n coordinatePgProofPersistence as coordinateProofPersistence,\n makePgProofPersistenceServices as makeProofPersistenceServices,\n} from \"./drizzle/pg-proofs\";\n\nexport {\n coordinatePgPasswordPersistence as coordinatePasswordPersistence,\n coordinatePgPasswordRegistration as coordinatePasswordRegistration,\n makePgPasswordPersistenceServices as makePasswordPersistenceServices,\n makePgPasswordRegistrationServices as makePasswordRegistrationServices,\n} from \"./drizzle/pg-passwords\";\n\nexport {\n coordinatePgEmailAddress as coordinateEmailAddress,\n coordinatePgEmailRegistration as coordinateEmailRegistration,\n makePgEmailAddressServices as makeEmailAddressServices,\n makePgEmailRegistrationServices as makeEmailRegistrationServices,\n makePgEmailSignInServices as makeEmailSignInServices,\n} from \"./drizzle/pg-emails\";\n\nexport const makeSubjectProvisioningServices = <\n Subject extends AnyPgTable,\n Identifier extends AnyPgTable,\n Request extends AnyPgTable,\n NativeId,\n>(\n mapping: SubjectProvisioningTables<Subject, Identifier, Request, NativeId>,\n) => makePgSubjectProvisioningServices(mapping);\n\nexport const makeExternalIdentityServices = <\n Subject extends AnyPgTable,\n External extends AnyPgTable,\n NativeId,\n>(\n mapping: ExternalIdentityTables<Subject, External, NativeId>,\n) => makePgExternalIdentityServices(mapping);\n\nexport const commitMode = \"interactive\" as const;\n\nexport const makeIdentityServices = <\n Subject extends AnyPgTable,\n Identifier extends AnyPgTable,\n External extends AnyPgTable,\n Request extends AnyPgTable,\n NativeId,\n>(\n mapping: IdentityTables<Subject, Identifier, External, Request, NativeId>,\n) => makePgIdentityServices(mapping);\n\nexport {\n makePgSessionStepUpServices as makeSessionStepUpServices,\n coordinatePgSessionStepUp as coordinateSessionStepUp,\n} from \"./drizzle/pg-sessions\";\n\nexport {\n makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices,\n coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence,\n} from \"./drizzle/pg-password-prepared\";\n\nexport { passwordPreparedPersistenceLayer } from \"./drizzle/password-prepared-target\";\n\nimport { makeOAuthTarget } from \"./drizzle/oauth-drivers\";\nimport { sqlClientOAuthStandaloneGuard } from \"./drizzle/oauth-target\";\n\nconst oauthTarget = makeOAuthTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientOAuthStandaloneGuard,\n});\n\nexport const {\n makeOAuthAccountsServices,\n makeOAuthSignInServices,\n makeOAuthRegistrationIntentServices,\n makeOAuthRegistrationServices,\n coordinateOAuthRegistration,\n coordinateOAuthSignIn,\n coordinateOAuthRegistrationIntents,\n coordinateOAuthAccounts,\n makeOAuthConnectedServices,\n makeOAuthConnectedRevocationServices,\n coordinateOAuthConnected,\n coordinateOAuthConnectedRevocations,\n} = oauthTarget;\n\nimport { makePasskeyTarget } from \"./drizzle/passkey-drivers\";\nimport { sqlClientPasskeyStandaloneGuard } from \"./drizzle/passkey-target\";\n\nconst passkeyTarget = makePasskeyTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientPasskeyStandaloneGuard,\n});\n\nexport const {\n makePasskeyCredentialServices,\n makePasskeyPersistenceServices,\n makePasskeyEnrollmentContextServices,\n makePasskeyRegistrationCeremonyServices,\n coordinatePasskeyPersistence,\n coordinatePasskeyRegistrationCeremony,\n makePasskeyManagementServices,\n makePasskeyRegistrationServices,\n coordinatePasskeyManagement,\n coordinatePasskeyRegistration,\n} = passkeyTarget;\n\nimport { makeTotpTarget, sqlClientTotpStandaloneGuard } from \"./drizzle/totp-target\";\n\nconst totpTarget = makeTotpTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientTotpStandaloneGuard,\n});\n\nexport const { makeTotpPersistenceServices, coordinateTotpPersistence } = totpTarget;\n\nimport { makePhoneTarget, sqlClientPhoneStandaloneGuard } from \"./drizzle/phone-target\";\n\nconst phoneTarget = makePhoneTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientPhoneStandaloneGuard,\n});\n\nexport const { makePhonePersistenceServices, coordinatePhonePersistence } = phoneTarget;\n\nimport { drizzleMigrationsLayer } from \"./internal/drizzle-migrations\";\nimport { postgresPersistence } from \"./internal/drizzle-postgres\";\n\nexport const AuthPersistence = {\n ...postgresPersistence(makeWithDefaults({})),\n migrationsLayer: drizzleMigrationsLayer(\n makeWithDefaults({}),\n Effect.promise(() => import(\"drizzle-orm/effect-pglite/migrator\")).pipe(\n Effect.map((module) => module.migrate),\n ),\n ),\n};\n\n/** Construct Drizzle from the driver's SQL-client Layer. */\nexport const databaseLayer = Layer.effect(Database, makeWithDefaults({}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkDA,MAAa,mCAMX,YACG,kCAAkC,OAAO;AAE9C,MAAa,gCAKX,YACG,+BAA+B,OAAO;AAE3C,MAAa,aAAa;AAE1B,MAAa,wBAOX,YACG,uBAAuB,OAAO;AA4BnC,MAAa,EACX,2BACA,yBACA,qCACA,+BACA,6BACA,uBACA,oCACA,yBACA,4BACA,sCACA,0BACA,wCAvBkB,gBAIlB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAeI;AAgBJ,MAAa,EACX,+BACA,gCACA,sCACA,yCACA,8BACA,uCACA,+BACA,iCACA,6BACA,kCArBoB,kBAIpB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAaI;AAeJ,MAAa,EAAE,6BAA6B,8BAXzB,eAIjB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAE0E;AAe1E,MAAa,EAAE,8BAA8B,+BAXzB,gBAIlB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAE4E;AAK5E,MAAa,kBAAkB;CAC7B,GAAG,oBAAoB,iBAAiB,CAAC,CAAC,CAAC;CAC3C,iBAAiB,uBACf,iBAAiB,CAAC,CAAC,GACnB,OAAO,cAAc,OAAO,qCAAqC,CAAC,CAAC,KACjE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF;AACF;;AAGA,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Pglite.mjs","names":[],"sources":["../src/Pglite.ts"],"sourcesContent":["export { OAuthProxyPersistence } from \"./internal/drizzle-postgres-oauth-proxy\";\n\nimport type { AnyRelations } from \"drizzle-orm\";\nimport { type EffectPgDatabase, makeWithDefaults } from \"drizzle-orm/effect-pglite\";\nimport type { AnyPgTable } from \"drizzle-orm/pg-core\";\nimport { Effect, Layer } from \"effect\";\n\nimport type {\n IdentityTables,\n SubjectProvisioningTables,\n ExternalIdentityTables,\n} from \"./drizzle/model\";\nimport { Database } from \"./drizzle/pg-database\";\nimport {\n makePgExternalIdentityServices,\n makePgIdentityServices,\n makePgSubjectProvisioningServices,\n} from \"./drizzle/pg-identity\";\n\nexport { Database } from \"./drizzle/pg-database\";\n\nexport {\n coordinatePgAuthenticationAuthority as coordinateAuthenticationAuthority,\n coordinatePgPendingAuthentication as coordinatePendingAuthentication,\n coordinatePgSignedSessionValidity as coordinateSignedSessionValidity,\n coordinatePgStatefulSessions as coordinateStatefulSessions,\n makePgAuthenticationAuthorityServices as makeAuthenticationAuthorityServices,\n makePgPendingAuthenticationServices as makePendingAuthenticationServices,\n makePgSignedSessionValidityServices as makeSignedSessionValidityServices,\n makePgStatefulSessionServices as makeStatefulSessionServices,\n} from \"./drizzle/pg-sessions\";\n\nexport {\n coordinatePgProofPersistence as coordinateProofPersistence,\n makePgProofPersistenceServices as makeProofPersistenceServices,\n} from \"./drizzle/pg-proofs\";\n\nexport {\n coordinatePgPasswordPersistence as coordinatePasswordPersistence,\n coordinatePgPasswordRegistration as coordinatePasswordRegistration,\n makePgPasswordPersistenceServices as makePasswordPersistenceServices,\n makePgPasswordRegistrationServices as makePasswordRegistrationServices,\n} from \"./drizzle/pg-passwords\";\n\nexport {\n coordinatePgEmailAddress as coordinateEmailAddress,\n coordinatePgEmailRegistration as coordinateEmailRegistration,\n makePgEmailAddressServices as makeEmailAddressServices,\n makePgEmailRegistrationServices as makeEmailRegistrationServices,\n makePgEmailSignInServices as makeEmailSignInServices,\n} from \"./drizzle/pg-emails\";\n\nexport const makeSubjectProvisioningServices = <\n Subject extends AnyPgTable,\n Identifier extends AnyPgTable,\n Request extends AnyPgTable,\n NativeId,\n>(\n mapping: SubjectProvisioningTables<Subject, Identifier, Request, NativeId>,\n) => makePgSubjectProvisioningServices(mapping);\n\nexport const makeExternalIdentityServices = <\n Subject extends AnyPgTable,\n External extends AnyPgTable,\n NativeId,\n>(\n mapping: ExternalIdentityTables<Subject, External, NativeId>,\n) => makePgExternalIdentityServices(mapping);\n\nexport const commitMode = \"interactive\" as const;\n\nexport const makeIdentityServices = <\n Subject extends AnyPgTable,\n Identifier extends AnyPgTable,\n External extends AnyPgTable,\n Request extends AnyPgTable,\n NativeId,\n>(\n mapping: IdentityTables<Subject, Identifier, External, Request, NativeId>,\n) => makePgIdentityServices(mapping);\n\nexport {\n makePgSessionStepUpServices as makeSessionStepUpServices,\n coordinatePgSessionStepUp as coordinateSessionStepUp,\n} from \"./drizzle/pg-sessions\";\n\nexport {\n makePgPasswordPreparedPersistenceServices as makePasswordPreparedPersistenceServices,\n coordinatePgPasswordPreparedPersistence as coordinatePasswordPreparedPersistence,\n} from \"./drizzle/pg-password-prepared\";\n\nexport { passwordPreparedPersistenceLayer } from \"./drizzle/password-prepared-target\";\n\nimport { makeOAuthTarget } from \"./drizzle/oauth-drivers\";\nimport { sqlClientOAuthStandaloneGuard } from \"./drizzle/oauth-target\";\n\nconst oauthTarget = makeOAuthTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientOAuthStandaloneGuard,\n});\n\nexport const {\n makeOAuthAccountsServices,\n makeOAuthSignInServices,\n makeOAuthRegistrationIntentServices,\n makeOAuthRegistrationServices,\n coordinateOAuthRegistration,\n coordinateOAuthSignIn,\n coordinateOAuthRegistrationIntents,\n coordinateOAuthAccounts,\n makeOAuthConnectedServices,\n makeOAuthConnectedRevocationServices,\n coordinateOAuthConnected,\n coordinateOAuthConnectedRevocations,\n} = oauthTarget;\n\nimport { makePasskeyTarget } from \"./drizzle/passkey-drivers\";\nimport { sqlClientPasskeyStandaloneGuard } from \"./drizzle/passkey-target\";\n\nconst passkeyTarget = makePasskeyTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientPasskeyStandaloneGuard,\n});\n\nexport const {\n makePasskeyCredentialServices,\n makePasskeyPersistenceServices,\n makePasskeyEnrollmentContextServices,\n makePasskeyRegistrationCeremonyServices,\n coordinatePasskeyPersistence,\n coordinatePasskeyRegistrationCeremony,\n makePasskeyManagementServices,\n makePasskeyRegistrationServices,\n coordinatePasskeyManagement,\n coordinatePasskeyRegistration,\n} = passkeyTarget;\n\nimport { makeTotpTarget, sqlClientTotpStandaloneGuard } from \"./drizzle/totp-target\";\n\nconst totpTarget = makeTotpTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientTotpStandaloneGuard,\n});\n\nexport const { makeTotpPersistenceServices, coordinateTotpPersistence } = totpTarget;\n\nimport { makePhoneTarget, sqlClientPhoneStandaloneGuard } from \"./drizzle/phone-target\";\n\nconst phoneTarget = makePhoneTarget<\n Database,\n EffectPgDatabase<AnyRelations>,\n AnyPgTable<{ dialect: \"pg\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"pg\",\n locking: true,\n standaloneGuard: sqlClientPhoneStandaloneGuard,\n});\n\nexport const { makePhonePersistenceServices, coordinatePhonePersistence } = phoneTarget;\n\nimport { drizzleMigrationsLayer } from \"./internal/drizzle-migrations\";\nimport { postgresPersistence } from \"./internal/drizzle-postgres\";\n\nexport const AuthPersistence = {\n ...postgresPersistence(makeWithDefaults({})),\n migrationsLayer: drizzleMigrationsLayer(\n makeWithDefaults({}),\n Effect.promise(() => import(\"drizzle-orm/effect-pglite/migrator\")).pipe(\n Effect.map((module) => module.migrate),\n ),\n ),\n};\n\n/** Construct Drizzle from the driver's SQL-client Layer. */\nexport const databaseLayer = Layer.effect(Database, makeWithDefaults({}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoDA,MAAa,mCAMX,YACG,kCAAkC,OAAO;AAE9C,MAAa,gCAKX,YACG,+BAA+B,OAAO;AAE3C,MAAa,aAAa;AAE1B,MAAa,wBAOX,YACG,uBAAuB,OAAO;AA4BnC,MAAa,EACX,2BACA,yBACA,qCACA,+BACA,6BACA,uBACA,oCACA,yBACA,4BACA,sCACA,0BACA,wCAvBkB,gBAIlB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAeI;AAgBJ,MAAa,EACX,+BACA,gCACA,sCACA,yCACA,8BACA,uCACA,+BACA,iCACA,6BACA,kCArBoB,kBAIpB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAaI;AAeJ,MAAa,EAAE,6BAA6B,8BAXzB,eAIjB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAE0E;AAe1E,MAAa,EAAE,8BAA8B,+BAXzB,gBAIlB,UAAU;CACV,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB;AACnB,CAE4E;AAK5E,MAAa,kBAAkB;CAC7B,GAAG,oBAAoB,iBAAiB,CAAC,CAAC,CAAC;CAC3C,iBAAiB,uBACf,iBAAiB,CAAC,CAAC,GACnB,OAAO,cAAc,OAAO,qCAAqC,CAAC,CAAC,KACjE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF;AACF;;AAGA,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC"}