@yielded/auth-persistence-drizzle 0.1.0-beta.22 → 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 (200) hide show
  1. package/README.md +3 -0
  2. package/dist/D1.d.mts +11 -11
  3. package/dist/D1.mjs +2 -1
  4. package/dist/D1.mjs.map +1 -1
  5. package/dist/Libsql.d.mts +40 -56
  6. package/dist/Libsql.mjs +2 -1
  7. package/dist/Libsql.mjs.map +1 -1
  8. package/dist/Mysql2.d.mts +16 -17
  9. package/dist/Pglite.d.mts +18 -18
  10. package/dist/Pglite.mjs +2 -1
  11. package/dist/Pglite.mjs.map +1 -1
  12. package/dist/Postgres.d.mts +24 -24
  13. package/dist/Postgres.mjs +2 -1
  14. package/dist/Postgres.mjs.map +1 -1
  15. package/dist/SqliteBun.d.mts +39 -55
  16. package/dist/SqliteBun.mjs +2 -1
  17. package/dist/SqliteBun.mjs.map +1 -1
  18. package/dist/SqliteDo.d.mts +48 -64
  19. package/dist/SqliteDo.mjs +2 -1
  20. package/dist/SqliteDo.mjs.map +1 -1
  21. package/dist/SqliteNode.d.mts +45 -61
  22. package/dist/SqliteNode.mjs +2 -1
  23. package/dist/SqliteNode.mjs.map +1 -1
  24. package/dist/SqliteWasm.d.mts +48 -64
  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 +14 -14
  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 +18 -35
  34. package/dist/drizzle/d1-passwords.mjs +78 -290
  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 +2 -2
  38. package/dist/drizzle/d1-sessions.d.mts +3 -3
  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 +135 -0
  48. package/dist/drizzle/native-sql-table.mjs.map +1 -0
  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 -8
  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/password-sql.mjs +2 -1
  76. package/dist/drizzle/password-sql.mjs.map +1 -1
  77. package/dist/drizzle/password-target.mjs +13 -2
  78. package/dist/drizzle/password-target.mjs.map +1 -1
  79. package/dist/drizzle/pg-password-prepared.d.mts +5 -5
  80. package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
  81. package/dist/drizzle/pg-passwords.d.mts +16 -32
  82. package/dist/drizzle/pg-passwords.mjs.map +1 -1
  83. package/dist/drizzle/pg-sessions.d.mts +1 -1
  84. package/dist/drizzle/phone-target.d.mts +2 -2
  85. package/dist/drizzle/phone-target.mjs +1 -1
  86. package/dist/drizzle/query-operations.mjs +3 -1
  87. package/dist/drizzle/query-operations.mjs.map +1 -1
  88. package/dist/drizzle/session-sql.mjs +2 -1
  89. package/dist/drizzle/session-sql.mjs.map +1 -1
  90. package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
  91. package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
  92. package/dist/drizzle/storage-validation.mjs +10 -198
  93. package/dist/drizzle/storage-validation.mjs.map +1 -1
  94. package/dist/drizzle/totp-target.d.mts +3 -3
  95. package/dist/drizzle/totp-target.mjs +2 -2
  96. package/dist/drizzle/transaction-execution.d.mts +2 -2
  97. package/dist/drizzle/transaction-owner.d.mts +1 -2
  98. package/dist/index.d.mts +3 -2
  99. package/dist/internal/drizzle-postgres-oauth-proxy.d.mts +138 -0
  100. package/dist/internal/drizzle-postgres-oauth-proxy.mjs +29 -0
  101. package/dist/internal/drizzle-postgres-oauth-proxy.mjs.map +1 -0
  102. package/dist/internal/drizzle-postgres.mjs +2 -0
  103. package/dist/internal/drizzle-postgres.mjs.map +1 -1
  104. package/dist/internal/drizzle-sqlite-oauth-proxy.d.mts +146 -0
  105. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs +29 -0
  106. package/dist/internal/drizzle-sqlite-oauth-proxy.mjs.map +1 -0
  107. package/dist/internal/drizzle-sqlite.mjs +2 -0
  108. package/dist/internal/drizzle-sqlite.mjs.map +1 -1
  109. package/package.json +1 -1
  110. package/src/D1.ts +2 -0
  111. package/src/Libsql.ts +2 -0
  112. package/src/Pglite.ts +2 -0
  113. package/src/Postgres.ts +2 -0
  114. package/src/SqliteBun.ts +2 -0
  115. package/src/SqliteDo.ts +2 -0
  116. package/src/SqliteNode.ts +2 -0
  117. package/src/SqliteWasm.ts +2 -0
  118. package/src/drizzle/d1-password-prepared.ts +2 -23
  119. package/src/drizzle/d1-passwords.ts +158 -780
  120. package/src/drizzle/d1-sessions.ts +21 -6
  121. package/src/drizzle/mysql-password-prepared.ts +4 -16
  122. package/src/drizzle/mysql-passwords.ts +5 -20
  123. package/src/drizzle/native-sql-table.ts +259 -0
  124. package/src/drizzle/oauth-connected-model.ts +97 -315
  125. package/src/drizzle/oauth-connected-reference.ts +13 -93
  126. package/src/drizzle/oauth-connected-target.ts +14 -271
  127. package/src/drizzle/oauth-kernel.ts +10 -0
  128. package/src/drizzle/oauth-model.ts +188 -541
  129. package/src/drizzle/oauth-mysql.ts +2 -2
  130. package/src/drizzle/oauth-proxy.ts +101 -0
  131. package/src/drizzle/oauth-target.ts +33 -737
  132. package/src/drizzle/password-model.ts +0 -33
  133. package/src/drizzle/password-prepared-model.ts +0 -18
  134. package/src/drizzle/password-sql.ts +3 -0
  135. package/src/drizzle/password-target.ts +41 -4
  136. package/src/drizzle/pg-password-prepared.ts +4 -16
  137. package/src/drizzle/pg-passwords.ts +5 -20
  138. package/src/drizzle/query-operations.ts +4 -0
  139. package/src/drizzle/session-sql.ts +2 -1
  140. package/src/drizzle/sqlite-password-prepared.ts +4 -52
  141. package/src/drizzle/sqlite-passwords.ts +7 -28
  142. package/src/drizzle/storage-validation.ts +13 -222
  143. package/src/index.ts +2 -8
  144. package/src/internal/drizzle-postgres-oauth-proxy.ts +37 -0
  145. package/src/internal/drizzle-postgres.ts +2 -0
  146. package/src/internal/drizzle-sqlite-oauth-proxy.ts +44 -0
  147. package/src/internal/drizzle-sqlite.ts +2 -0
  148. package/dist/_virtual/_rolldown/runtime.mjs +0 -13
  149. package/dist/drizzle/oauth-accounts.mjs +0 -359
  150. package/dist/drizzle/oauth-accounts.mjs.map +0 -1
  151. package/dist/drizzle/oauth-connected-access.mjs +0 -212
  152. package/dist/drizzle/oauth-connected-access.mjs.map +0 -1
  153. package/dist/drizzle/oauth-connected-collection.mjs +0 -202
  154. package/dist/drizzle/oauth-connected-collection.mjs.map +0 -1
  155. package/dist/drizzle/oauth-connected-custody.mjs +0 -147
  156. package/dist/drizzle/oauth-connected-custody.mjs.map +0 -1
  157. package/dist/drizzle/oauth-connected-flow.mjs +0 -297
  158. package/dist/drizzle/oauth-connected-flow.mjs.map +0 -1
  159. package/dist/drizzle/oauth-connected-input.mjs +0 -122
  160. package/dist/drizzle/oauth-connected-input.mjs.map +0 -1
  161. package/dist/drizzle/oauth-connected-maintenance.mjs +0 -214
  162. package/dist/drizzle/oauth-connected-maintenance.mjs.map +0 -1
  163. package/dist/drizzle/oauth-connected-management.mjs +0 -229
  164. package/dist/drizzle/oauth-connected-management.mjs.map +0 -1
  165. package/dist/drizzle/oauth-connected-settlement.mjs +0 -128
  166. package/dist/drizzle/oauth-connected-settlement.mjs.map +0 -1
  167. package/dist/drizzle/oauth-connected-sign-in.mjs +0 -265
  168. package/dist/drizzle/oauth-connected-sign-in.mjs.map +0 -1
  169. package/dist/drizzle/oauth-connected-state.d.mts +0 -2062
  170. package/dist/drizzle/oauth-connected-state.mjs +0 -430
  171. package/dist/drizzle/oauth-connected-state.mjs.map +0 -1
  172. package/dist/drizzle/oauth-flow.d.mts +0 -22
  173. package/dist/drizzle/oauth-flow.mjs +0 -253
  174. package/dist/drizzle/oauth-flow.mjs.map +0 -1
  175. package/dist/drizzle/oauth-input.mjs +0 -127
  176. package/dist/drizzle/oauth-input.mjs.map +0 -1
  177. package/dist/drizzle/oauth-owner.d.mts +0 -10
  178. package/dist/drizzle/oauth-owner.mjs +0 -10
  179. package/dist/drizzle/oauth-owner.mjs.map +0 -1
  180. package/dist/drizzle/oauth-registration.d.mts +0 -5
  181. package/dist/drizzle/oauth-registration.mjs +0 -374
  182. package/dist/drizzle/oauth-registration.mjs.map +0 -1
  183. package/dist/drizzle/oauth-state.mjs +0 -107
  184. package/dist/drizzle/oauth-state.mjs.map +0 -1
  185. package/src/drizzle/oauth-accounts.ts +0 -805
  186. package/src/drizzle/oauth-connected-access.ts +0 -361
  187. package/src/drizzle/oauth-connected-collection.ts +0 -324
  188. package/src/drizzle/oauth-connected-custody.ts +0 -279
  189. package/src/drizzle/oauth-connected-flow.ts +0 -529
  190. package/src/drizzle/oauth-connected-input.ts +0 -147
  191. package/src/drizzle/oauth-connected-maintenance.ts +0 -346
  192. package/src/drizzle/oauth-connected-management.ts +0 -365
  193. package/src/drizzle/oauth-connected-settlement.ts +0 -251
  194. package/src/drizzle/oauth-connected-sign-in.ts +0 -443
  195. package/src/drizzle/oauth-connected-state.ts +0 -872
  196. package/src/drizzle/oauth-flow.ts +0 -462
  197. package/src/drizzle/oauth-input.ts +0 -201
  198. package/src/drizzle/oauth-owner.ts +0 -29
  199. package/src/drizzle/oauth-registration.ts +0 -640
  200. package/src/drizzle/oauth-state.ts +0 -218
@@ -4,11 +4,6 @@ import type { SQL, Table } from "drizzle-orm";
4
4
  import type { DrizzleTableModel } from "./table-model";
5
5
 
6
6
  export {
7
- type PasswordAttemptAction,
8
- type PasswordAttemptState,
9
- type PasswordRateScopeKind,
10
- type PasswordScopeKeys,
11
- type PasswordAttemptRecord,
12
7
  type RequiredPasswordConstraints,
13
8
  requiredPasswordConstraints,
14
9
  type PasswordConstraintClassifier,
@@ -46,19 +41,6 @@ export type PasswordCredentialTable<
46
41
  NativeSubjectId
47
42
  >;
48
43
 
49
- export type PasswordAttemptTable<
50
- Attempt extends Table,
51
- NativeSubjectId,
52
- > = Shared.PasswordAttemptTable<DrizzleTableModel<Attempt>, NativeSubjectId>;
53
-
54
- export type PasswordRateScopeTable<RateScope extends Table> = Shared.PasswordRateScopeTable<
55
- DrizzleTableModel<RateScope>
56
- >;
57
-
58
- export type PasswordChargeTable<Charge extends Table> = Shared.PasswordChargeTable<
59
- DrizzleTableModel<Charge>
60
- >;
61
-
62
44
  export type PasswordCommandTable<Command extends Table> = Shared.PasswordCommandTable<
63
45
  DrizzleTableModel<Command>
64
46
  >;
@@ -70,9 +52,6 @@ export type PasswordPersistenceMapping<
70
52
  Identifier extends Table,
71
53
  Credential extends Table,
72
54
  AuthorityCredential extends Table,
73
- Attempt extends Table,
74
- RateScope extends Table,
75
- Charge extends Table,
76
55
  Command extends Table,
77
56
  NativeSubjectId,
78
57
  > = Shared.PasswordPersistenceMapping<
@@ -80,9 +59,6 @@ export type PasswordPersistenceMapping<
80
59
  DrizzleTableModel<Identifier>,
81
60
  DrizzleTableModel<Credential>,
82
61
  DrizzleTableModel<AuthorityCredential>,
83
- DrizzleTableModel<Attempt>,
84
- DrizzleTableModel<RateScope>,
85
- DrizzleTableModel<Charge>,
86
62
  DrizzleTableModel<Command>,
87
63
  NativeSubjectId,
88
64
  SQL
@@ -93,9 +69,6 @@ export type D1PasswordPersistenceMapping<
93
69
  Identifier extends Table,
94
70
  Credential extends Table,
95
71
  AuthorityCredential extends Table,
96
- Attempt extends Table,
97
- RateScope extends Table,
98
- Charge extends Table,
99
72
  Command extends Table,
100
73
  NativeSubjectId,
101
74
  > = Shared.D1PasswordPersistenceMapping<
@@ -103,9 +76,6 @@ export type D1PasswordPersistenceMapping<
103
76
  DrizzleTableModel<Identifier>,
104
77
  DrizzleTableModel<Credential>,
105
78
  DrizzleTableModel<AuthorityCredential>,
106
- DrizzleTableModel<Attempt>,
107
- DrizzleTableModel<RateScope>,
108
- DrizzleTableModel<Charge>,
109
79
  DrizzleTableModel<Command>,
110
80
  NativeSubjectId,
111
81
  SQL
@@ -152,9 +122,6 @@ export type AnyPasswordPersistenceMapping = PasswordPersistenceMapping<
152
122
  Table,
153
123
  Table,
154
124
  Table,
155
- Table,
156
- Table,
157
- Table,
158
125
  unknown
159
126
  >;
160
127
 
@@ -86,9 +86,6 @@ export interface PasswordPreparedPersistenceMapping<
86
86
  Identifier extends Table,
87
87
  Credential extends Table,
88
88
  AuthorityCredential extends Table,
89
- Attempt extends Table,
90
- RateScope extends Table,
91
- Charge extends Table,
92
89
  Command extends Table,
93
90
  Intent extends Table,
94
91
  Admission extends Table,
@@ -99,9 +96,6 @@ export interface PasswordPreparedPersistenceMapping<
99
96
  Identifier,
100
97
  Credential,
101
98
  AuthorityCredential,
102
- Attempt,
103
- RateScope,
104
- Charge,
105
99
  Command,
106
100
  NativeSubjectId
107
101
  >;
@@ -118,9 +112,6 @@ export type D1PasswordPreparedPersistenceMapping<
118
112
  Identifier extends Table,
119
113
  Credential extends Table,
120
114
  AuthorityCredential extends Table,
121
- Attempt extends Table,
122
- RateScope extends Table,
123
- Charge extends Table,
124
115
  Command extends Table,
125
116
  Intent extends Table,
126
117
  Admission extends Table,
@@ -130,9 +121,6 @@ export type D1PasswordPreparedPersistenceMapping<
130
121
  Identifier,
131
122
  Credential,
132
123
  AuthorityCredential,
133
- Attempt,
134
- RateScope,
135
- Charge,
136
124
  Command,
137
125
  Intent,
138
126
  Admission,
@@ -145,9 +133,6 @@ export type D1PasswordPreparedPersistenceMapping<
145
133
  Identifier,
146
134
  Credential,
147
135
  AuthorityCredential,
148
- Attempt,
149
- RateScope,
150
- Charge,
151
136
  Command,
152
137
  NativeSubjectId
153
138
  >;
@@ -252,8 +237,5 @@ export type AnyPasswordPreparedPersistenceMapping = PasswordPreparedPersistenceM
252
237
  Table,
253
238
  Table,
254
239
  Table,
255
- Table,
256
- Table,
257
- Table,
258
240
  unknown
259
241
  >;
@@ -1,13 +1,16 @@
1
1
  import { makePasswordKernel } from "@yielded/auth-persistence/Adapter";
2
2
 
3
+ import { makeDrizzleSqlTables } from "./native-sql-table";
3
4
  import { completeProofPlanIn } from "./proof-sql";
4
5
  import { drizzleQueryOperations } from "./query-operations";
5
6
  export type { PasswordSqlQuery } from "@yielded/auth-persistence/Adapter";
6
7
  export type { PasswordSqlDatabase } from "@yielded/auth-persistence/Adapter";
7
8
  export { CurrentPasswordSql } from "@yielded/auth-persistence/Adapter";
9
+
8
10
  export type { PasswordSqlConfiguration } from "@yielded/auth-persistence/Adapter";
9
11
 
10
12
  export const { makeSqlPasswordPersistence, passwordSqlKernel } = makePasswordKernel(
11
13
  drizzleQueryOperations,
12
14
  { completeProofPlanIn },
15
+ makeDrizzleSqlTables,
13
16
  );
@@ -1,4 +1,9 @@
1
- import type { NativeDatabase } from "@yielded/auth-persistence/Adapter";
1
+ import {
2
+ CurrentPasswordPreparedTransaction,
3
+ type NativeDatabase,
4
+ type PasswordPreparedPostcondition,
5
+ PasswordPreparedPostconditions,
6
+ } from "@yielded/auth-persistence/Adapter";
2
7
  import {
3
8
  coordinateCommit,
4
9
  hasCommitScope,
@@ -7,7 +12,7 @@ import {
7
12
  } from "@yielded/auth/Hooks";
8
13
  import { PasswordUnavailable, PasswordPersistence } from "@yielded/auth/Password";
9
14
  /* oxlint-disable no-explicit-any -- public driver wrappers restore concrete Drizzle generics. */
10
- import { type Context, Effect, Layer } from "effect";
15
+ import { Cause, type Context, Effect, Layer } from "effect";
11
16
  import type * as SqlError from "effect/sql/SqlError";
12
17
 
13
18
  import {
@@ -154,7 +159,10 @@ export const coordinateTargetPasswordPersistence = <Transaction, A, E, R>(
154
159
  () =>
155
160
  database.transaction((transaction) =>
156
161
  Effect.gen(function* () {
157
- return yield* owner(transaction, {
162
+ const postconditions: Array<PasswordPreparedPostcondition> = [];
163
+ let acceptingPostconditions = true;
164
+
165
+ const value = yield* owner(transaction, {
158
166
  passwordPersistence: yield* makeSqlPasswordPersistence(
159
167
  mapping,
160
168
  passwordOptions(configuration, proofMapping, true),
@@ -164,7 +172,36 @@ export const coordinateTargetPasswordPersistence = <Transaction, A, E, R>(
164
172
  transaction as unknown as PasswordSqlDatabase,
165
173
  ),
166
174
  ),
167
- });
175
+ }).pipe(
176
+ Effect.provideService(PasswordPreparedPostconditions, {
177
+ register: (check) => {
178
+ if (!acceptingPostconditions) return false;
179
+ postconditions.push(check);
180
+
181
+ return true;
182
+ },
183
+ }),
184
+ Effect.ensuring(
185
+ Effect.sync(() => {
186
+ acceptingPostconditions = false;
187
+ }),
188
+ ),
189
+ );
190
+
191
+ // Application work in this transaction must not change what the
192
+ // password mutations committed to; a failure here rolls back both.
193
+ for (const check of postconditions)
194
+ yield* check.pipe(
195
+ Effect.provideService(
196
+ CurrentPasswordPreparedTransaction,
197
+ transaction as unknown as PasswordSqlDatabase,
198
+ ),
199
+ Effect.catchCause((cause) =>
200
+ Effect.failCause(Cause.map(cause, () => PasswordUnavailable.make({}))),
201
+ ),
202
+ );
203
+
204
+ return value;
168
205
  }),
169
206
  ),
170
207
  { mode: configuration.mode },
@@ -30,9 +30,6 @@ export const makePgPasswordPreparedPersistenceServices = <
30
30
  I extends AnyPgTable,
31
31
  C extends AnyPgTable,
32
32
  AC extends AnyPgTable,
33
- A extends AnyPgTable,
34
- RS extends AnyPgTable,
35
- CE extends AnyPgTable,
36
33
  M extends AnyPgTable,
37
34
  T extends AnyPgTable,
38
35
  B extends AnyPgTable,
@@ -45,7 +42,7 @@ export const makePgPasswordPreparedPersistenceServices = <
45
42
  PCr extends AnyPgTable = AnyPgTable,
46
43
  PNativeId = unknown,
47
44
  >(
48
- mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>,
45
+ mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>,
49
46
  proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>,
50
47
  ) =>
51
48
  Effect.flatMap(
@@ -64,9 +61,6 @@ export function coordinatePgPasswordPreparedPersistence<
64
61
  I extends AnyPgTable,
65
62
  C extends AnyPgTable,
66
63
  AC extends AnyPgTable,
67
- A extends AnyPgTable,
68
- RS extends AnyPgTable,
69
- CE extends AnyPgTable,
70
64
  M extends AnyPgTable,
71
65
  T extends AnyPgTable,
72
66
  B extends AnyPgTable,
@@ -86,7 +80,7 @@ export function coordinatePgPasswordPreparedPersistence<
86
80
  >(
87
81
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
88
82
  options: {
89
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
83
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
90
84
  readonly proofMapping?:
91
85
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
92
86
  | undefined;
@@ -107,9 +101,6 @@ export function coordinatePgPasswordPreparedPersistence<
107
101
  I extends AnyPgTable,
108
102
  C extends AnyPgTable,
109
103
  AC extends AnyPgTable,
110
- A extends AnyPgTable,
111
- RS extends AnyPgTable,
112
- CE extends AnyPgTable,
113
104
  M extends AnyPgTable,
114
105
  T extends AnyPgTable,
115
106
  B extends AnyPgTable,
@@ -131,7 +122,7 @@ export function coordinatePgPasswordPreparedPersistence<
131
122
  >(
132
123
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
133
124
  options: {
134
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
125
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
135
126
  readonly proofMapping?:
136
127
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
137
128
  | undefined;
@@ -152,9 +143,6 @@ export function coordinatePgPasswordPreparedPersistence<
152
143
  I extends AnyPgTable,
153
144
  C extends AnyPgTable,
154
145
  AC extends AnyPgTable,
155
- A extends AnyPgTable,
156
- RS extends AnyPgTable,
157
- CE extends AnyPgTable,
158
146
  M extends AnyPgTable,
159
147
  T extends AnyPgTable,
160
148
  B extends AnyPgTable,
@@ -176,7 +164,7 @@ export function coordinatePgPasswordPreparedPersistence<
176
164
  >(
177
165
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
178
166
  options: {
179
- readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>;
167
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
180
168
  readonly proofMapping?:
181
169
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
182
170
  | undefined;
@@ -54,25 +54,19 @@ type PasswordMapping<
54
54
  I extends AnyPgTable,
55
55
  C extends AnyPgTable,
56
56
  AC extends AnyPgTable,
57
- A extends AnyPgTable,
58
- RS extends AnyPgTable,
59
- CE extends AnyPgTable,
60
57
  M extends AnyPgTable,
61
58
  NativeId,
62
- > = PasswordPersistenceMapping<S, I, C, AC, A, RS, CE, M, NativeId>;
59
+ > = PasswordPersistenceMapping<S, I, C, AC, M, NativeId>;
63
60
 
64
61
  export const makePgPasswordPersistenceServices = <
65
62
  S extends AnyPgTable,
66
63
  I extends AnyPgTable,
67
64
  C extends AnyPgTable,
68
65
  AC extends AnyPgTable,
69
- A extends AnyPgTable,
70
- RS extends AnyPgTable,
71
- CE extends AnyPgTable,
72
66
  M extends AnyPgTable,
73
67
  NativeId,
74
68
  >(
75
- mapping: PasswordMapping<S, I, C, AC, A, RS, CE, M, NativeId>,
69
+ mapping: PasswordMapping<S, I, C, AC, M, NativeId>,
76
70
  proofMapping?: ProofPersistenceMapping<
77
71
  any,
78
72
  any,
@@ -102,9 +96,6 @@ export function coordinatePgPasswordPersistence<
102
96
  I extends AnyPgTable,
103
97
  C extends AnyPgTable,
104
98
  AC extends AnyPgTable,
105
- A extends AnyPgTable,
106
- RS extends AnyPgTable,
107
- CE extends AnyPgTable,
108
99
  M extends AnyPgTable,
109
100
  NativeId,
110
101
  PM extends
@@ -118,7 +109,7 @@ export function coordinatePgPasswordPersistence<
118
109
  >(
119
110
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
120
111
  options: {
121
- readonly mapping: PasswordMapping<S, I, C, AC, A, RS, CE, M, NativeId>;
112
+ readonly mapping: PasswordMapping<S, I, C, AC, M, NativeId>;
122
113
  readonly proofMapping?: PM;
123
114
  readonly transaction?: never;
124
115
  },
@@ -135,9 +126,6 @@ export function coordinatePgPasswordPersistence<
135
126
  I extends AnyPgTable,
136
127
  C extends AnyPgTable,
137
128
  AC extends AnyPgTable,
138
- A extends AnyPgTable,
139
- RS extends AnyPgTable,
140
- CE extends AnyPgTable,
141
129
  M extends AnyPgTable,
142
130
  NativeId,
143
131
  PM extends
@@ -153,7 +141,7 @@ export function coordinatePgPasswordPersistence<
153
141
  >(
154
142
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
155
143
  options: {
156
- readonly mapping: PasswordMapping<S, I, C, AC, A, RS, CE, M, NativeId>;
144
+ readonly mapping: PasswordMapping<S, I, C, AC, M, NativeId>;
157
145
  readonly proofMapping?: PM;
158
146
  readonly transaction: SuppliedService<TxId, NoInfer<TransactionOf<D>>, TxShape>;
159
147
  },
@@ -170,9 +158,6 @@ export function coordinatePgPasswordPersistence<
170
158
  I extends AnyPgTable,
171
159
  C extends AnyPgTable,
172
160
  AC extends AnyPgTable,
173
- A extends AnyPgTable,
174
- RS extends AnyPgTable,
175
- CE extends AnyPgTable,
176
161
  M extends AnyPgTable,
177
162
  NativeId,
178
163
  PM extends
@@ -188,7 +173,7 @@ export function coordinatePgPasswordPersistence<
188
173
  >(
189
174
  acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>,
190
175
  options: {
191
- readonly mapping: PasswordMapping<S, I, C, AC, A, RS, CE, M, NativeId>;
176
+ readonly mapping: PasswordMapping<S, I, C, AC, M, NativeId>;
192
177
  readonly proofMapping?: PM;
193
178
  readonly transaction?: SuppliedService<TxId, NoInfer<TransactionOf<D>>, TxShape>;
194
179
  },
@@ -6,11 +6,13 @@ import {
6
6
  asc,
7
7
  or,
8
8
  eq,
9
+ ne,
9
10
  gt,
10
11
  gte,
11
12
  lte,
12
13
  inArray,
13
14
  isNull,
15
+ isNotNull,
14
16
  notExists,
15
17
  sql,
16
18
  getTableColumns,
@@ -26,11 +28,13 @@ const operations = {
26
28
  asc,
27
29
  or,
28
30
  eq,
31
+ ne,
29
32
  gt,
30
33
  gte,
31
34
  lte,
32
35
  inArray,
33
36
  isNull,
37
+ isNotNull,
34
38
  notExists,
35
39
  sql,
36
40
  getTableColumns,
@@ -1,5 +1,6 @@
1
1
  import { makeSessionKernel } from "@yielded/auth-persistence/Adapter";
2
2
 
3
+ import { makeDrizzleSqlTables } from "./native-sql-table";
3
4
  import { drizzleQueryOperations } from "./query-operations";
4
5
  export type { SessionSqlDatabase } from "@yielded/auth-persistence/Adapter";
5
6
  export { CurrentSessionSql } from "@yielded/auth-persistence/Adapter";
@@ -11,4 +12,4 @@ export const {
11
12
  makeSqlStatefulSessions,
12
13
  makeSqlSignedValidity,
13
14
  makeSqlSessionStepUp,
14
- } = makeSessionKernel(drizzleQueryOperations);
15
+ } = makeSessionKernel(drizzleQueryOperations, makeDrizzleSqlTables);
@@ -54,9 +54,6 @@ export const makeSqlitePasswordPreparedTarget = <
54
54
  I extends AnySQLiteTable,
55
55
  C extends AnySQLiteTable,
56
56
  AC extends AnySQLiteTable,
57
- A extends AnySQLiteTable,
58
- RS extends AnySQLiteTable,
59
- CE extends AnySQLiteTable,
60
57
  M extends AnySQLiteTable,
61
58
  T extends AnySQLiteTable,
62
59
  B extends AnySQLiteTable,
@@ -76,19 +73,7 @@ export const makeSqlitePasswordPreparedTarget = <
76
73
  >(
77
74
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
78
75
  options: {
79
- readonly mapping: PasswordPreparedPersistenceMapping<
80
- S,
81
- I,
82
- C,
83
- AC,
84
- A,
85
- RS,
86
- CE,
87
- M,
88
- T,
89
- B,
90
- NativeId
91
- >;
76
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
92
77
  readonly proofMapping?:
93
78
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
94
79
  | undefined;
@@ -110,9 +95,6 @@ export const makeSqlitePasswordPreparedTarget = <
110
95
  I extends AnySQLiteTable,
111
96
  C extends AnySQLiteTable,
112
97
  AC extends AnySQLiteTable,
113
- A extends AnySQLiteTable,
114
- RS extends AnySQLiteTable,
115
- CE extends AnySQLiteTable,
116
98
  M extends AnySQLiteTable,
117
99
  T extends AnySQLiteTable,
118
100
  B extends AnySQLiteTable,
@@ -134,19 +116,7 @@ export const makeSqlitePasswordPreparedTarget = <
134
116
  >(
135
117
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
136
118
  options: {
137
- readonly mapping: PasswordPreparedPersistenceMapping<
138
- S,
139
- I,
140
- C,
141
- AC,
142
- A,
143
- RS,
144
- CE,
145
- M,
146
- T,
147
- B,
148
- NativeId
149
- >;
119
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
150
120
  readonly proofMapping?:
151
121
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
152
122
  | undefined;
@@ -168,9 +138,6 @@ export const makeSqlitePasswordPreparedTarget = <
168
138
  I extends AnySQLiteTable,
169
139
  C extends AnySQLiteTable,
170
140
  AC extends AnySQLiteTable,
171
- A extends AnySQLiteTable,
172
- RS extends AnySQLiteTable,
173
- CE extends AnySQLiteTable,
174
141
  M extends AnySQLiteTable,
175
142
  T extends AnySQLiteTable,
176
143
  B extends AnySQLiteTable,
@@ -192,19 +159,7 @@ export const makeSqlitePasswordPreparedTarget = <
192
159
  >(
193
160
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
194
161
  options: {
195
- readonly mapping: PasswordPreparedPersistenceMapping<
196
- S,
197
- I,
198
- C,
199
- AC,
200
- A,
201
- RS,
202
- CE,
203
- M,
204
- T,
205
- B,
206
- NativeId
207
- >;
162
+ readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
208
163
  readonly proofMapping?:
209
164
  | PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>
210
165
  | undefined;
@@ -249,9 +204,6 @@ export const makeSqlitePasswordPreparedTarget = <
249
204
  I extends AnySQLiteTable,
250
205
  C extends AnySQLiteTable,
251
206
  AC extends AnySQLiteTable,
252
- A extends AnySQLiteTable,
253
- RS extends AnySQLiteTable,
254
- CE extends AnySQLiteTable,
255
207
  M extends AnySQLiteTable,
256
208
  T extends AnySQLiteTable,
257
209
  B extends AnySQLiteTable,
@@ -264,7 +216,7 @@ export const makeSqlitePasswordPreparedTarget = <
264
216
  PCr extends AnySQLiteTable = AnySQLiteTable,
265
217
  PNativeId = unknown,
266
218
  >(
267
- mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, A, RS, CE, M, T, B, NativeId>,
219
+ mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>,
268
220
  proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId>,
269
221
  ) =>
270
222
  Effect.flatMap(standaloneConfiguration, (configuration) =>
@@ -69,25 +69,19 @@ type Mapping<
69
69
  I extends AnySQLiteTable,
70
70
  C extends AnySQLiteTable,
71
71
  AC extends AnySQLiteTable,
72
- A extends AnySQLiteTable,
73
- RS extends AnySQLiteTable,
74
- CE extends AnySQLiteTable,
75
72
  M extends AnySQLiteTable,
76
73
  NativeId,
77
- > = PasswordPersistenceMapping<S, I, C, AC, A, RS, CE, M, NativeId>;
74
+ > = PasswordPersistenceMapping<S, I, C, AC, M, NativeId>;
78
75
 
79
76
  export const makeSqlitePasswordPersistenceServices = <
80
77
  S extends AnySQLiteTable,
81
78
  I extends AnySQLiteTable,
82
79
  C extends AnySQLiteTable,
83
80
  AC extends AnySQLiteTable,
84
- A extends AnySQLiteTable,
85
- RS extends AnySQLiteTable,
86
- CE extends AnySQLiteTable,
87
81
  M extends AnySQLiteTable,
88
82
  NativeId,
89
83
  >(
90
- mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>,
84
+ mapping: Mapping<S, I, C, AC, M, NativeId>,
91
85
  configuration: PasswordTargetConfiguration,
92
86
  proofMapping?: ProofPersistenceMapping<
93
87
  any,
@@ -111,9 +105,6 @@ export const coordinateSqlitePasswordPersistence = <
111
105
  I extends AnySQLiteTable,
112
106
  C extends AnySQLiteTable,
113
107
  AC extends AnySQLiteTable,
114
- A extends AnySQLiteTable,
115
- RS extends AnySQLiteTable,
116
- CE extends AnySQLiteTable,
117
108
  M extends AnySQLiteTable,
118
109
  NativeId,
119
110
  PM extends
@@ -124,7 +115,7 @@ export const coordinateSqlitePasswordPersistence = <
124
115
  R,
125
116
  >(
126
117
  database: D,
127
- mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>,
118
+ mapping: Mapping<S, I, C, AC, M, NativeId>,
128
119
  configuration: PasswordTargetConfiguration,
129
120
  proofMapping: PM,
130
121
  owner: (
@@ -207,9 +198,6 @@ export const makeSqlitePasswordTarget = <
207
198
  I extends AnySQLiteTable,
208
199
  C extends AnySQLiteTable,
209
200
  AC extends AnySQLiteTable,
210
- A extends AnySQLiteTable,
211
- RS extends AnySQLiteTable,
212
- CE extends AnySQLiteTable,
213
201
  M extends AnySQLiteTable,
214
202
  NativeId,
215
203
  PM extends
@@ -223,7 +211,7 @@ export const makeSqlitePasswordTarget = <
223
211
  >(
224
212
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
225
213
  options: {
226
- readonly mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>;
214
+ readonly mapping: Mapping<S, I, C, AC, M, NativeId>;
227
215
  readonly proofMapping?: PM;
228
216
  readonly transaction?: never;
229
217
  },
@@ -241,9 +229,6 @@ export const makeSqlitePasswordTarget = <
241
229
  I extends AnySQLiteTable,
242
230
  C extends AnySQLiteTable,
243
231
  AC extends AnySQLiteTable,
244
- A extends AnySQLiteTable,
245
- RS extends AnySQLiteTable,
246
- CE extends AnySQLiteTable,
247
232
  M extends AnySQLiteTable,
248
233
  NativeId,
249
234
  PM extends
@@ -259,7 +244,7 @@ export const makeSqlitePasswordTarget = <
259
244
  >(
260
245
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
261
246
  options: {
262
- readonly mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>;
247
+ readonly mapping: Mapping<S, I, C, AC, M, NativeId>;
263
248
  readonly proofMapping?: PM;
264
249
  readonly transaction: SuppliedService<TxId, NoInfer<TransactionOf<Database>>, TxShape>;
265
250
  },
@@ -277,9 +262,6 @@ export const makeSqlitePasswordTarget = <
277
262
  I extends AnySQLiteTable,
278
263
  C extends AnySQLiteTable,
279
264
  AC extends AnySQLiteTable,
280
- A extends AnySQLiteTable,
281
- RS extends AnySQLiteTable,
282
- CE extends AnySQLiteTable,
283
265
  M extends AnySQLiteTable,
284
266
  NativeId,
285
267
  PM extends
@@ -295,7 +277,7 @@ export const makeSqlitePasswordTarget = <
295
277
  >(
296
278
  acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>,
297
279
  options: {
298
- readonly mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>;
280
+ readonly mapping: Mapping<S, I, C, AC, M, NativeId>;
299
281
  readonly proofMapping?: PM;
300
282
  readonly transaction?: SuppliedService<TxId, NoInfer<TransactionOf<Database>>, TxShape>;
301
283
  },
@@ -467,13 +449,10 @@ export const makeSqlitePasswordTarget = <
467
449
  I extends AnySQLiteTable,
468
450
  C extends AnySQLiteTable,
469
451
  AC extends AnySQLiteTable,
470
- A extends AnySQLiteTable,
471
- RS extends AnySQLiteTable,
472
- CE extends AnySQLiteTable,
473
452
  M extends AnySQLiteTable,
474
453
  NativeId,
475
454
  >(
476
- mapping: Mapping<S, I, C, AC, A, RS, CE, M, NativeId>,
455
+ mapping: Mapping<S, I, C, AC, M, NativeId>,
477
456
  proofMapping?: ProofPersistenceMapping<
478
457
  any,
479
458
  any,