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

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 (189) 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 +48 -64
  6. package/dist/Libsql.mjs +2 -1
  7. package/dist/Libsql.mjs.map +1 -1
  8. package/dist/Mysql2.d.mts +26 -27
  9. package/dist/Pglite.d.mts +28 -28
  10. package/dist/Pglite.mjs +2 -1
  11. package/dist/Pglite.mjs.map +1 -1
  12. package/dist/Postgres.d.mts +29 -29
  13. package/dist/Postgres.mjs +2 -1
  14. package/dist/Postgres.mjs.map +1 -1
  15. package/dist/SqliteBun.d.mts +49 -65
  16. package/dist/SqliteBun.mjs +2 -1
  17. package/dist/SqliteBun.mjs.map +1 -1
  18. package/dist/SqliteDo.d.mts +47 -63
  19. package/dist/SqliteDo.mjs +2 -1
  20. package/dist/SqliteDo.mjs.map +1 -1
  21. package/dist/SqliteNode.d.mts +51 -67
  22. package/dist/SqliteNode.mjs +2 -1
  23. package/dist/SqliteNode.mjs.map +1 -1
  24. package/dist/SqliteWasm.d.mts +47 -63
  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 +15 -15
  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 +1 -1
  33. package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
  34. package/dist/drizzle/d1-passwords.d.mts +17 -33
  35. package/dist/drizzle/d1-passwords.mjs +57 -199
  36. package/dist/drizzle/d1-passwords.mjs.map +1 -1
  37. package/dist/drizzle/d1-phone.d.mts +1 -1
  38. package/dist/drizzle/d1-proofs.d.mts +1 -1
  39. package/dist/drizzle/d1-sessions.d.mts +2 -2
  40. package/dist/drizzle/d1-sessions.mjs +11 -6
  41. package/dist/drizzle/d1-sessions.mjs.map +1 -1
  42. package/dist/drizzle/d1-totp.d.mts +1 -1
  43. package/dist/drizzle/mysql-password-prepared.d.mts +5 -5
  44. package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
  45. package/dist/drizzle/mysql-passwords.d.mts +16 -32
  46. package/dist/drizzle/mysql-passwords.mjs.map +1 -1
  47. package/dist/drizzle/mysql-sessions.d.mts +1 -1
  48. package/dist/drizzle/native-sql-table.mjs +26 -1
  49. package/dist/drizzle/native-sql-table.mjs.map +1 -1
  50. package/dist/drizzle/oauth-connected-model.d.mts +20 -281
  51. package/dist/drizzle/oauth-connected-model.mjs +3 -17
  52. package/dist/drizzle/oauth-connected-model.mjs.map +1 -1
  53. package/dist/drizzle/oauth-connected-reference.d.mts +1 -3
  54. package/dist/drizzle/oauth-connected-reference.mjs +4 -53
  55. package/dist/drizzle/oauth-connected-reference.mjs.map +1 -1
  56. package/dist/drizzle/oauth-connected-target.d.mts +3 -990
  57. package/dist/drizzle/oauth-connected-target.mjs +8 -92
  58. package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
  59. package/dist/drizzle/oauth-kernel.mjs +11 -0
  60. package/dist/drizzle/oauth-kernel.mjs.map +1 -0
  61. package/dist/drizzle/oauth-model.d.mts +35 -438
  62. package/dist/drizzle/oauth-model.mjs +6 -44
  63. package/dist/drizzle/oauth-model.mjs.map +1 -1
  64. package/dist/drizzle/oauth-mysql.mjs +2 -2
  65. package/dist/drizzle/oauth-mysql.mjs.map +1 -1
  66. package/dist/drizzle/oauth-proxy.d.mts +10 -0
  67. package/dist/drizzle/oauth-proxy.mjs +54 -0
  68. package/dist/drizzle/oauth-proxy.mjs.map +1 -0
  69. package/dist/drizzle/oauth-target.d.mts +6 -107
  70. package/dist/drizzle/oauth-target.mjs +15 -245
  71. package/dist/drizzle/oauth-target.mjs.map +1 -1
  72. package/dist/drizzle/password-model.d.mts +5 -6
  73. package/dist/drizzle/password-prepared-model.d.mts +5 -5
  74. package/dist/drizzle/password-prepared-model.mjs.map +1 -1
  75. package/dist/drizzle/password-prepared-sql.mjs +1 -1
  76. package/dist/drizzle/password-prepared-sql.mjs.map +1 -1
  77. package/dist/drizzle/password-prepared-state.mjs +1 -1
  78. package/dist/drizzle/pg-password-prepared.d.mts +5 -5
  79. package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
  80. package/dist/drizzle/pg-passwords.d.mts +16 -32
  81. package/dist/drizzle/pg-passwords.mjs.map +1 -1
  82. package/dist/drizzle/pg-sessions.d.mts +1 -1
  83. package/dist/drizzle/phone-target.d.mts +1 -1
  84. package/dist/drizzle/phone-target.mjs +1 -1
  85. package/dist/drizzle/query-operations.mjs +3 -1
  86. package/dist/drizzle/query-operations.mjs.map +1 -1
  87. package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
  88. package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
  89. package/dist/drizzle/storage-validation.mjs +10 -185
  90. package/dist/drizzle/storage-validation.mjs.map +1 -1
  91. package/dist/drizzle/totp-target.d.mts +2 -2
  92. package/dist/drizzle/totp-target.mjs +2 -2
  93. package/dist/drizzle/transaction-execution.d.mts +2 -2
  94. package/dist/drizzle/transaction-owner.d.mts +1 -2
  95. package/dist/index.d.mts +3 -2
  96. package/dist/internal/drizzle-postgres-oauth-proxy.d.mts +138 -0
  97. package/dist/internal/drizzle-postgres-oauth-proxy.mjs +29 -0
  98. package/dist/internal/drizzle-postgres-oauth-proxy.mjs.map +1 -0
  99. package/dist/internal/drizzle-sqlite-oauth-proxy.d.mts +146 -0
  100. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs +29 -0
  101. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs.map +1 -0
  102. package/package.json +1 -1
  103. package/src/D1.ts +2 -0
  104. package/src/Libsql.ts +2 -0
  105. package/src/Pglite.ts +2 -0
  106. package/src/Postgres.ts +2 -0
  107. package/src/SqliteBun.ts +2 -0
  108. package/src/SqliteDo.ts +2 -0
  109. package/src/SqliteNode.ts +2 -0
  110. package/src/SqliteWasm.ts +2 -0
  111. package/src/drizzle/d1-password-prepared.ts +4 -6
  112. package/src/drizzle/d1-passwords.ts +125 -459
  113. package/src/drizzle/d1-sessions.ts +21 -6
  114. package/src/drizzle/mysql-password-prepared.ts +4 -8
  115. package/src/drizzle/mysql-passwords.ts +5 -10
  116. package/src/drizzle/native-sql-table.ts +30 -0
  117. package/src/drizzle/oauth-connected-model.ts +97 -315
  118. package/src/drizzle/oauth-connected-reference.ts +13 -93
  119. package/src/drizzle/oauth-connected-target.ts +14 -271
  120. package/src/drizzle/oauth-kernel.ts +10 -0
  121. package/src/drizzle/oauth-model.ts +188 -541
  122. package/src/drizzle/oauth-mysql.ts +2 -2
  123. package/src/drizzle/oauth-proxy.ts +101 -0
  124. package/src/drizzle/oauth-target.ts +33 -737
  125. package/src/drizzle/password-model.ts +0 -13
  126. package/src/drizzle/password-prepared-model.ts +0 -6
  127. package/src/drizzle/password-prepared-sql.ts +2 -1
  128. package/src/drizzle/pg-password-prepared.ts +4 -8
  129. package/src/drizzle/pg-passwords.ts +5 -10
  130. package/src/drizzle/query-operations.ts +4 -0
  131. package/src/drizzle/sqlite-password-prepared.ts +4 -8
  132. package/src/drizzle/sqlite-passwords.ts +7 -14
  133. package/src/drizzle/storage-validation.ts +13 -214
  134. package/src/index.ts +2 -4
  135. package/src/internal/drizzle-postgres-oauth-proxy.ts +37 -0
  136. package/src/internal/drizzle-sqlite-oauth-proxy.ts +44 -0
  137. package/dist/_virtual/_rolldown/runtime.mjs +0 -13
  138. package/dist/drizzle/oauth-accounts.mjs +0 -359
  139. package/dist/drizzle/oauth-accounts.mjs.map +0 -1
  140. package/dist/drizzle/oauth-connected-access.mjs +0 -212
  141. package/dist/drizzle/oauth-connected-access.mjs.map +0 -1
  142. package/dist/drizzle/oauth-connected-collection.mjs +0 -202
  143. package/dist/drizzle/oauth-connected-collection.mjs.map +0 -1
  144. package/dist/drizzle/oauth-connected-custody.mjs +0 -147
  145. package/dist/drizzle/oauth-connected-custody.mjs.map +0 -1
  146. package/dist/drizzle/oauth-connected-flow.mjs +0 -297
  147. package/dist/drizzle/oauth-connected-flow.mjs.map +0 -1
  148. package/dist/drizzle/oauth-connected-input.mjs +0 -122
  149. package/dist/drizzle/oauth-connected-input.mjs.map +0 -1
  150. package/dist/drizzle/oauth-connected-maintenance.mjs +0 -214
  151. package/dist/drizzle/oauth-connected-maintenance.mjs.map +0 -1
  152. package/dist/drizzle/oauth-connected-management.mjs +0 -229
  153. package/dist/drizzle/oauth-connected-management.mjs.map +0 -1
  154. package/dist/drizzle/oauth-connected-settlement.mjs +0 -128
  155. package/dist/drizzle/oauth-connected-settlement.mjs.map +0 -1
  156. package/dist/drizzle/oauth-connected-sign-in.mjs +0 -265
  157. package/dist/drizzle/oauth-connected-sign-in.mjs.map +0 -1
  158. package/dist/drizzle/oauth-connected-state.d.mts +0 -2062
  159. package/dist/drizzle/oauth-connected-state.mjs +0 -430
  160. package/dist/drizzle/oauth-connected-state.mjs.map +0 -1
  161. package/dist/drizzle/oauth-flow.d.mts +0 -22
  162. package/dist/drizzle/oauth-flow.mjs +0 -253
  163. package/dist/drizzle/oauth-flow.mjs.map +0 -1
  164. package/dist/drizzle/oauth-input.mjs +0 -127
  165. package/dist/drizzle/oauth-input.mjs.map +0 -1
  166. package/dist/drizzle/oauth-owner.d.mts +0 -10
  167. package/dist/drizzle/oauth-owner.mjs +0 -10
  168. package/dist/drizzle/oauth-owner.mjs.map +0 -1
  169. package/dist/drizzle/oauth-registration.d.mts +0 -5
  170. package/dist/drizzle/oauth-registration.mjs +0 -374
  171. package/dist/drizzle/oauth-registration.mjs.map +0 -1
  172. package/dist/drizzle/oauth-state.mjs +0 -107
  173. package/dist/drizzle/oauth-state.mjs.map +0 -1
  174. package/src/drizzle/oauth-accounts.ts +0 -805
  175. package/src/drizzle/oauth-connected-access.ts +0 -361
  176. package/src/drizzle/oauth-connected-collection.ts +0 -324
  177. package/src/drizzle/oauth-connected-custody.ts +0 -279
  178. package/src/drizzle/oauth-connected-flow.ts +0 -529
  179. package/src/drizzle/oauth-connected-input.ts +0 -147
  180. package/src/drizzle/oauth-connected-maintenance.ts +0 -346
  181. package/src/drizzle/oauth-connected-management.ts +0 -365
  182. package/src/drizzle/oauth-connected-settlement.ts +0 -251
  183. package/src/drizzle/oauth-connected-sign-in.ts +0 -443
  184. package/src/drizzle/oauth-connected-state.ts +0 -872
  185. package/src/drizzle/oauth-flow.ts +0 -462
  186. package/src/drizzle/oauth-input.ts +0 -201
  187. package/src/drizzle/oauth-owner.ts +0 -29
  188. package/src/drizzle/oauth-registration.ts +0 -640
  189. package/src/drizzle/oauth-state.ts +0 -218
@@ -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";
@@ -201,12 +201,10 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
201
201
  readonly nowMillis: number;
202
202
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
203
203
  readonly _tag: "Rejected";
204
- } | {
205
- readonly _tag: "Ambiguous";
206
204
  } | {
207
205
  readonly _tag: "Cancelled";
208
206
  } | {
209
- readonly _tag: "Conflict";
207
+ readonly _tag: "Ambiguous";
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">;
@@ -265,7 +265,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
265
265
  readonly credentialId: string;
266
266
  readonly invalidation: {
267
267
  readonly trigger: "all-session-revocation" | "credential-change" | "factor-reset" | "identifier-change" | "password-reset" | "subject-delete" | "subject-disable";
268
- readonly existingSessions: "immediate" | "original-absolute-expiry";
268
+ readonly existingSessions: "cache-expiry" | "immediate" | "original-absolute-expiry";
269
269
  readonly maximumExposureMillis: number;
270
270
  readonly oldAuthenticationEvidence: "rejected";
271
271
  };
@@ -290,7 +290,7 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
290
290
  readonly credentialId: string;
291
291
  readonly invalidation: {
292
292
  readonly trigger: "all-session-revocation" | "credential-change" | "factor-reset" | "identifier-change" | "password-reset" | "subject-delete" | "subject-disable";
293
- readonly existingSessions: "immediate" | "original-absolute-expiry";
293
+ readonly existingSessions: "cache-expiry" | "immediate" | "original-absolute-expiry";
294
294
  readonly maximumExposureMillis: number;
295
295
  readonly oldAuthenticationEvidence: "rejected";
296
296
  };
@@ -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<{
@@ -574,10 +574,12 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
574
574
  readonly outcome: import("@yielded/auth/OAuth").OAuthSignInAccessOutcome;
575
575
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
576
576
  readonly _tag: "Rejected";
577
+ } | {
578
+ readonly _tag: "Cancelled";
577
579
  } | {
578
580
  readonly _tag: "Ambiguous";
579
581
  } | {
580
- readonly _tag: "Cancelled";
582
+ readonly _tag: "Conflict";
581
583
  } | {
582
584
  readonly _tag: "Connected";
583
585
  readonly grant: {
@@ -647,8 +649,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
647
649
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
648
650
  };
649
651
  };
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>;
@@ -1034,10 +1034,12 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1034
1034
  readonly nowMillis: number;
1035
1035
  }, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
1036
1036
  readonly _tag: "Rejected";
1037
+ } | {
1038
+ readonly _tag: "Cancelled";
1037
1039
  } | {
1038
1040
  readonly _tag: "Ambiguous";
1039
1041
  } | {
1040
- readonly _tag: "Cancelled";
1042
+ readonly _tag: "Conflict";
1041
1043
  } | {
1042
1044
  readonly _tag: "Connected";
1043
1045
  readonly grant: {
@@ -1107,8 +1109,6 @@ export declare const makeOAuthAccountsServices: <S extends AnyPgTable<{
1107
1109
  readonly ciphertext: import("effect/Redacted").Redacted<string>;
1108
1110
  };
1109
1111
  };
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>;
@@ -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-pg/PgClient").PgClient>;
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=Postgres.d.mts.map
package/dist/Postgres.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=Postgres.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Postgres.mjs","names":[],"sources":["../src/Postgres.ts"],"sourcesContent":["import type { AnyRelations } from \"drizzle-orm\";\nimport { type EffectPgDatabase, makeWithDefaults } from \"drizzle-orm/effect-postgres\";\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-postgres/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,uCAAuC,CAAC,CAAC,KACnE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF;AACF;;AAGA,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Postgres.mjs","names":[],"sources":["../src/Postgres.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-postgres\";\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-postgres/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,uCAAuC,CAAC,CAAC,KACnE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF;AACF;;AAGA,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC"}