@yielded/auth-persistence-drizzle 0.1.0-beta.0 → 0.1.0-beta.12
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.
- package/README.md +6 -1
- package/dist/D1.d.mts +155 -40
- package/dist/D1.mjs +10 -6
- package/dist/D1.mjs.map +1 -1
- package/dist/Libsql.d.mts +251 -129
- package/dist/Libsql.mjs +20 -21
- package/dist/Libsql.mjs.map +1 -1
- package/dist/Mysql2.d.mts +208 -56
- package/dist/Mysql2.mjs +13 -8
- package/dist/Mysql2.mjs.map +1 -1
- package/dist/Pglite.d.mts +209 -57
- package/dist/Pglite.mjs +13 -9
- package/dist/Pglite.mjs.map +1 -1
- package/dist/Postgres.d.mts +207 -55
- package/dist/Postgres.mjs +13 -9
- package/dist/Postgres.mjs.map +1 -1
- package/dist/SqliteBun.d.mts +249 -126
- package/dist/SqliteBun.mjs +20 -18
- package/dist/SqliteBun.mjs.map +1 -1
- package/dist/SqliteDo.d.mts +248 -158
- package/dist/SqliteDo.mjs +26 -44
- package/dist/SqliteDo.mjs.map +1 -1
- package/dist/SqliteNode.d.mts +247 -124
- package/dist/SqliteNode.mjs +20 -18
- package/dist/SqliteNode.mjs.map +1 -1
- package/dist/SqliteWasm.d.mts +251 -128
- package/dist/SqliteWasm.mjs +20 -18
- package/dist/SqliteWasm.mjs.map +1 -1
- package/dist/drizzle/D1BatchStatements.d.mts +1 -1
- package/dist/drizzle/D1BatchStatements.mjs.map +1 -1
- package/dist/drizzle/d1-database.d.mts +11 -0
- package/dist/drizzle/d1-database.mjs +8 -0
- package/dist/drizzle/d1-database.mjs.map +1 -0
- package/dist/drizzle/d1-emails.d.mts +8 -7
- package/dist/drizzle/d1-emails.mjs +7 -4
- package/dist/drizzle/d1-emails.mjs.map +1 -1
- package/dist/drizzle/d1-generated-statement.mjs.map +1 -1
- package/dist/drizzle/d1-identity.mjs +12 -9
- package/dist/drizzle/d1-identity.mjs.map +1 -1
- package/dist/drizzle/d1-oauth.d.mts +41 -10
- package/dist/drizzle/d1-oauth.mjs +8 -5
- package/dist/drizzle/d1-oauth.mjs.map +1 -1
- package/dist/drizzle/d1-passkey.d.mts +3 -14
- package/dist/drizzle/d1-passkey.mjs +2 -1
- package/dist/drizzle/d1-passkey.mjs.map +1 -1
- package/dist/drizzle/d1-password-prepared.d.mts +4 -3
- package/dist/drizzle/d1-password-prepared.mjs +3 -1
- package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
- package/dist/drizzle/d1-passwords.d.mts +7 -6
- package/dist/drizzle/d1-passwords.mjs +5 -2
- package/dist/drizzle/d1-passwords.mjs.map +1 -1
- package/dist/drizzle/d1-phone.d.mts +3 -4
- package/dist/drizzle/d1-phone.mjs +2 -1
- package/dist/drizzle/d1-phone.mjs.map +1 -1
- package/dist/drizzle/d1-planning.d.mts +1 -1
- package/dist/drizzle/d1-proofs.d.mts +5 -4
- package/dist/drizzle/d1-proofs.mjs +3 -1
- package/dist/drizzle/d1-proofs.mjs.map +1 -1
- package/dist/drizzle/d1-sessions.d.mts +14 -13
- package/dist/drizzle/d1-sessions.mjs +15 -9
- package/dist/drizzle/d1-sessions.mjs.map +1 -1
- package/dist/drizzle/d1-totp.d.mts +3 -4
- package/dist/drizzle/d1-totp.mjs +2 -1
- package/dist/drizzle/d1-totp.mjs.map +1 -1
- package/dist/drizzle/email-registration.d.mts +1 -1
- package/dist/drizzle/email-registration.mjs +2 -1
- package/dist/drizzle/email-registration.mjs.map +1 -1
- package/dist/drizzle/email-target.d.mts +8 -7
- package/dist/drizzle/email-target.mjs +10 -10
- package/dist/drizzle/email-target.mjs.map +1 -1
- package/dist/drizzle/model.d.mts +2 -126
- package/dist/drizzle/model.mjs +2 -21
- package/dist/drizzle/model.mjs.map +1 -1
- package/dist/drizzle/mysql-database.d.mts +8 -0
- package/dist/drizzle/mysql-database.mjs +8 -0
- package/dist/drizzle/mysql-database.mjs.map +1 -0
- package/dist/drizzle/mysql-emails.d.mts +8 -7
- package/dist/drizzle/mysql-emails.mjs +12 -8
- package/dist/drizzle/mysql-emails.mjs.map +1 -1
- package/dist/drizzle/mysql-identity.mjs +12 -9
- package/dist/drizzle/mysql-identity.mjs.map +1 -1
- package/dist/drizzle/mysql-password-prepared.d.mts +4 -3
- package/dist/drizzle/mysql-password-prepared.mjs +6 -2
- package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
- package/dist/drizzle/mysql-passwords.d.mts +7 -5
- package/dist/drizzle/mysql-passwords.mjs +11 -7
- package/dist/drizzle/mysql-passwords.mjs.map +1 -1
- package/dist/drizzle/mysql-proofs.d.mts +4 -3
- package/dist/drizzle/mysql-proofs.mjs +8 -4
- package/dist/drizzle/mysql-proofs.mjs.map +1 -1
- package/dist/drizzle/mysql-sessions.d.mts +12 -11
- package/dist/drizzle/mysql-sessions.mjs +16 -12
- package/dist/drizzle/mysql-sessions.mjs.map +1 -1
- package/dist/drizzle/native-database.mjs +10 -0
- package/dist/drizzle/native-database.mjs.map +1 -0
- package/dist/drizzle/oauth-accounts.mjs +1 -1
- package/dist/drizzle/oauth-connected-access.mjs +14 -12
- package/dist/drizzle/oauth-connected-access.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-custody.mjs +2 -2
- package/dist/drizzle/oauth-connected-drivers.mjs +11 -6
- package/dist/drizzle/oauth-connected-drivers.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-flow.mjs +2 -2
- package/dist/drizzle/oauth-connected-input.mjs +14 -1
- package/dist/drizzle/oauth-connected-input.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-maintenance.mjs +1 -1
- package/dist/drizzle/oauth-connected-management.mjs +2 -2
- package/dist/drizzle/oauth-connected-model.d.mts +17 -3
- package/dist/drizzle/oauth-connected-model.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-settlement.mjs +51 -41
- package/dist/drizzle/oauth-connected-settlement.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-sign-in.mjs +263 -0
- package/dist/drizzle/oauth-connected-sign-in.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-state.d.mts +110 -2
- package/dist/drizzle/oauth-connected-state.mjs +9 -4
- package/dist/drizzle/oauth-connected-state.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-target.d.mts +142 -15
- package/dist/drizzle/oauth-connected-target.mjs +9 -6
- package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
- package/dist/drizzle/oauth-drivers.mjs +9 -7
- package/dist/drizzle/oauth-drivers.mjs.map +1 -1
- package/dist/drizzle/oauth-flow.d.mts +1 -1
- package/dist/drizzle/oauth-flow.mjs +1 -1
- package/dist/drizzle/oauth-input.mjs +1 -1
- package/dist/drizzle/oauth-model.d.mts +1 -1
- package/dist/drizzle/oauth-owner.d.mts +1 -1
- package/dist/drizzle/oauth-registration.d.mts +2 -2
- package/dist/drizzle/oauth-registration.mjs +1 -1
- package/dist/drizzle/oauth-state.mjs +5 -4
- package/dist/drizzle/oauth-state.mjs.map +1 -1
- package/dist/drizzle/oauth-target.d.mts +14 -13
- package/dist/drizzle/oauth-target.mjs +14 -13
- package/dist/drizzle/oauth-target.mjs.map +1 -1
- package/dist/drizzle/passkey-drivers.mjs +8 -6
- package/dist/drizzle/passkey-drivers.mjs.map +1 -1
- package/dist/drizzle/passkey-write-drivers.mjs +5 -3
- package/dist/drizzle/passkey-write-drivers.mjs.map +1 -1
- package/dist/drizzle/passkey-write-target.d.mts +1 -1
- package/dist/drizzle/password-prepared-sql.mjs +2 -1
- package/dist/drizzle/password-prepared-sql.mjs.map +1 -1
- package/dist/drizzle/password-prepared-state.mjs +1 -1
- package/dist/drizzle/password-prepared-target.d.mts +4 -3
- package/dist/drizzle/password-prepared-target.mjs +4 -3
- package/dist/drizzle/password-prepared-target.mjs.map +1 -1
- package/dist/drizzle/password-registration.mjs +2 -1
- package/dist/drizzle/password-registration.mjs.map +1 -1
- package/dist/drizzle/password-target.d.mts +6 -5
- package/dist/drizzle/password-target.mjs +8 -8
- package/dist/drizzle/password-target.mjs.map +1 -1
- package/dist/drizzle/pg-database.d.mts +9 -0
- package/dist/drizzle/pg-database.mjs +8 -0
- package/dist/drizzle/pg-database.mjs.map +1 -0
- package/dist/drizzle/pg-emails.d.mts +8 -7
- package/dist/drizzle/pg-emails.mjs +12 -8
- package/dist/drizzle/pg-emails.mjs.map +1 -1
- package/dist/drizzle/pg-identity.mjs +92 -0
- package/dist/drizzle/pg-identity.mjs.map +1 -0
- package/dist/drizzle/pg-password-prepared.d.mts +4 -3
- package/dist/drizzle/pg-password-prepared.mjs +6 -2
- package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
- package/dist/drizzle/pg-passwords.d.mts +7 -5
- package/dist/drizzle/pg-passwords.mjs +11 -7
- package/dist/drizzle/pg-passwords.mjs.map +1 -1
- package/dist/drizzle/pg-proofs.d.mts +4 -3
- package/dist/drizzle/pg-proofs.mjs +8 -4
- package/dist/drizzle/pg-proofs.mjs.map +1 -1
- package/dist/drizzle/pg-sessions.d.mts +12 -11
- package/dist/drizzle/pg-sessions.mjs +16 -12
- package/dist/drizzle/pg-sessions.mjs.map +1 -1
- package/dist/drizzle/phone-model.d.mts +1 -1
- package/dist/drizzle/phone-target.d.mts +5 -4
- package/dist/drizzle/phone-target.mjs +12 -11
- package/dist/drizzle/phone-target.mjs.map +1 -1
- package/dist/drizzle/proof-target.d.mts +4 -3
- package/dist/drizzle/proof-target.mjs +5 -5
- package/dist/drizzle/proof-target.mjs.map +1 -1
- package/dist/drizzle/session-sql.d.mts +1 -0
- package/dist/drizzle/session-target.d.mts +11 -9
- package/dist/drizzle/session-target.mjs +11 -11
- package/dist/drizzle/session-target.mjs.map +1 -1
- package/dist/drizzle/sqlite-emails.mjs +9 -5
- package/dist/drizzle/sqlite-emails.mjs.map +1 -1
- package/dist/drizzle/sqlite-identity.mjs +14 -11
- package/dist/drizzle/sqlite-identity.mjs.map +1 -1
- package/dist/drizzle/sqlite-password-prepared.mjs +7 -3
- package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
- package/dist/drizzle/sqlite-passwords.mjs +10 -6
- package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
- package/dist/drizzle/sqlite-proofs.mjs +7 -3
- package/dist/drizzle/sqlite-proofs.mjs.map +1 -1
- package/dist/drizzle/sqlite-sessions.mjs +16 -12
- package/dist/drizzle/sqlite-sessions.mjs.map +1 -1
- package/dist/drizzle/standalone-guard.d.mts +2 -0
- package/dist/drizzle/standalone-guard.mjs +8 -4
- package/dist/drizzle/standalone-guard.mjs.map +1 -1
- package/dist/drizzle/totp-model.d.mts +1 -1
- package/dist/drizzle/totp-target.d.mts +5 -4
- package/dist/drizzle/totp-target.mjs +31 -28
- package/dist/drizzle/totp-target.mjs.map +1 -1
- package/dist/drizzle/transaction-mysql.mjs +1 -1
- package/dist/drizzle/transaction-mysql.mjs.map +1 -1
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +2 -4
- package/dist/internal/drizzle-postgres.mjs.map +1 -1
- package/dist/internal/drizzle-sqlite.mjs.map +1 -1
- package/package.json +1 -1
- package/src/D1.ts +37 -26
- package/src/Libsql.ts +45 -61
- package/src/Mysql2.ts +39 -35
- package/src/Pglite.ts +48 -30
- package/src/Postgres.ts +48 -30
- package/src/SqliteBun.ts +59 -68
- package/src/SqliteDo.ts +61 -274
- package/src/SqliteNode.ts +56 -66
- package/src/SqliteWasm.ts +56 -66
- package/src/drizzle/D1BatchStatements.ts +1 -1
- package/src/drizzle/d1-database.ts +10 -0
- package/src/drizzle/d1-emails.ts +86 -88
- package/src/drizzle/d1-generated-statement.ts +1 -1
- package/src/drizzle/d1-identity.ts +17 -20
- package/src/drizzle/d1-oauth.ts +19 -8
- package/src/drizzle/d1-passkey.ts +5 -1
- package/src/drizzle/d1-password-prepared.ts +40 -42
- package/src/drizzle/d1-passwords.ts +76 -80
- package/src/drizzle/d1-phone.ts +5 -1
- package/src/drizzle/d1-proofs.ts +31 -34
- package/src/drizzle/d1-sessions.ts +53 -40
- package/src/drizzle/d1-totp.ts +5 -1
- package/src/drizzle/email-registration.ts +6 -2
- package/src/drizzle/email-target.ts +18 -20
- package/src/drizzle/model.ts +1 -208
- package/src/drizzle/mysql-database.ts +8 -0
- package/src/drizzle/mysql-emails.ts +29 -17
- package/src/drizzle/mysql-identity.ts +18 -21
- package/src/drizzle/mysql-password-prepared.ts +11 -9
- package/src/drizzle/mysql-passwords.ts +22 -10
- package/src/drizzle/mysql-proofs.ts +17 -6
- package/src/drizzle/mysql-sessions.ts +41 -18
- package/src/drizzle/native-database.ts +22 -0
- package/src/drizzle/oauth-connected-access.ts +8 -1
- package/src/drizzle/oauth-connected-drivers.ts +21 -6
- package/src/drizzle/oauth-connected-input.ts +13 -0
- package/src/drizzle/oauth-connected-model.ts +17 -0
- package/src/drizzle/oauth-connected-settlement.ts +65 -42
- package/src/drizzle/oauth-connected-sign-in.ts +438 -0
- package/src/drizzle/oauth-connected-state.ts +19 -7
- package/src/drizzle/oauth-connected-target.ts +26 -18
- package/src/drizzle/oauth-drivers.ts +26 -10
- package/src/drizzle/oauth-state.ts +5 -4
- package/src/drizzle/oauth-target.ts +31 -43
- package/src/drizzle/passkey-drivers.ts +21 -13
- package/src/drizzle/passkey-write-drivers.ts +11 -6
- package/src/drizzle/password-prepared-sql.ts +2 -4
- package/src/drizzle/password-prepared-target.ts +10 -7
- package/src/drizzle/password-registration.ts +7 -8
- package/src/drizzle/password-target.ts +20 -19
- package/src/drizzle/pg-database.ts +10 -0
- package/src/drizzle/pg-emails.ts +29 -17
- package/src/drizzle/pg-identity.ts +297 -0
- package/src/drizzle/pg-password-prepared.ts +11 -9
- package/src/drizzle/pg-passwords.ts +22 -10
- package/src/drizzle/pg-proofs.ts +17 -6
- package/src/drizzle/pg-sessions.ts +41 -18
- package/src/drizzle/phone-target.ts +23 -18
- package/src/drizzle/proof-target.ts +10 -13
- package/src/drizzle/session-target.ts +33 -51
- package/src/drizzle/sqlite-emails.ts +31 -14
- package/src/drizzle/sqlite-identity.ts +22 -42
- package/src/drizzle/sqlite-password-prepared.ts +24 -10
- package/src/drizzle/sqlite-passwords.ts +30 -16
- package/src/drizzle/sqlite-proofs.ts +29 -6
- package/src/drizzle/sqlite-sessions.ts +50 -24
- package/src/drizzle/standalone-guard.ts +19 -7
- package/src/drizzle/totp-target.ts +62 -61
- package/src/drizzle/transaction-mysql.ts +1 -1
- package/src/index.ts +0 -24
- package/src/internal/drizzle-postgres.ts +1 -1
- package/src/internal/drizzle-sqlite.ts +1 -1
- package/dist/drizzle/d1-identity.d.mts +0 -30
- package/dist/drizzle/mysql-identity.d.mts +0 -21
- package/dist/drizzle/mysql.d.mts +0 -69
- package/dist/drizzle/mysql.mjs +0 -218
- package/dist/drizzle/mysql.mjs.map +0 -1
- package/dist/drizzle/pg.d.mts +0 -80
- package/dist/drizzle/pg.mjs +0 -289
- package/dist/drizzle/pg.mjs.map +0 -1
- package/dist/drizzle/sqlite.d.mts +0 -77
- package/dist/drizzle/sqlite.mjs +0 -217
- package/dist/drizzle/sqlite.mjs.map +0 -1
- package/src/drizzle/mysql.ts +0 -687
- package/src/drizzle/pg.ts +0 -984
- package/src/drizzle/sqlite.ts +0 -705
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { requireStandalone } from "@yielded/auth-persistence/Adapter";
|
|
2
2
|
import { Context, Effect, Predicate } from "effect";
|
|
3
|
-
import type * as SqlClient from "effect/
|
|
3
|
+
import type * as SqlClient from "effect/sql/SqlClient";
|
|
4
4
|
|
|
5
|
-
type TransactionService = Context.Key<
|
|
5
|
+
export type TransactionService = Context.Key<
|
|
6
6
|
SqlClient.TransactionConnection,
|
|
7
7
|
SqlClient.TransactionConnection.Service
|
|
8
8
|
>;
|
|
9
9
|
|
|
10
|
-
const transactionService = (database: unknown): TransactionService | undefined => {
|
|
10
|
+
export const transactionService = (database: unknown): TransactionService | undefined => {
|
|
11
11
|
if (
|
|
12
12
|
!Predicate.hasProperty(database, "$client") ||
|
|
13
13
|
!Predicate.hasProperty(database.$client, "transactionService") ||
|
|
@@ -19,14 +19,26 @@ const transactionService = (database: unknown): TransactionService | undefined =
|
|
|
19
19
|
return database.$client.transactionService;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/** Capture the foreign client's marker while acquiring standalone services. */
|
|
23
|
+
export const acquireTransactionService = <Id, Database>(service: Context.Key<Id, Database>) =>
|
|
24
|
+
Effect.map(Effect.service(service), (database): TransactionService | undefined => {
|
|
25
|
+
if (
|
|
26
|
+
!Predicate.hasProperty(database, "$client") ||
|
|
27
|
+
!Predicate.hasProperty(database.$client, "transactionService") ||
|
|
28
|
+
!Context.isKey(database.$client.transactionService)
|
|
29
|
+
) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return database.$client.transactionService;
|
|
34
|
+
});
|
|
35
|
+
|
|
22
36
|
/** Bind the client-specific transaction marker at foreign adapter construction. */
|
|
23
37
|
export const sqlClientStandaloneGuard = <Failure>(
|
|
24
|
-
|
|
38
|
+
service: TransactionService | undefined,
|
|
25
39
|
unavailable: () => Failure,
|
|
26
40
|
): Effect.Effect<void, Failure> => {
|
|
27
|
-
const service = transactionService(database);
|
|
28
|
-
|
|
29
41
|
if (service === undefined) return Effect.suspend(() => Effect.fail(unavailable()));
|
|
30
42
|
|
|
31
|
-
return requireStandalone(unavailable,
|
|
43
|
+
return requireStandalone(unavailable, service);
|
|
32
44
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomId } from "@yielded/auth-crypto";
|
|
2
|
+
import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
2
3
|
import { LifecycleHooks } from "@yielded/auth/Hooks";
|
|
3
4
|
import {
|
|
4
5
|
TotpConfigurationError,
|
|
@@ -10,9 +11,10 @@ import {
|
|
|
10
11
|
import type { Table } from "drizzle-orm";
|
|
11
12
|
/* oxlint-disable no-explicit-any -- shared native implementation; driver entrypoints retain exact database and table types. */
|
|
12
13
|
import { Context, Effect, Schema } from "effect";
|
|
13
|
-
import type { Statement } from "effect/
|
|
14
|
+
import type { Statement } from "effect/sql/Statement";
|
|
14
15
|
|
|
15
16
|
import type { PersistenceMappingError } from "./model";
|
|
17
|
+
import { nativeDatabase } from "./native-database";
|
|
16
18
|
import type { SuppliedService } from "./SuppliedService";
|
|
17
19
|
import {
|
|
18
20
|
type TotpMapping,
|
|
@@ -44,8 +46,8 @@ export type TotpCoordinatorError<E> =
|
|
|
44
46
|
| PersistenceMappingError;
|
|
45
47
|
|
|
46
48
|
export const sqlClientTotpStandaloneGuard = (
|
|
47
|
-
|
|
48
|
-
) => sqlClientTransactionStandaloneGuard(unavailable,
|
|
49
|
+
service: Parameters<typeof sqlClientTransactionStandaloneGuard>[1],
|
|
50
|
+
) => sqlClientTransactionStandaloneGuard(unavailable, service);
|
|
49
51
|
|
|
50
52
|
const validateMapping = <M>(original: M, configuration: TotpTargetConfiguration): M => {
|
|
51
53
|
const mapping = original as any;
|
|
@@ -66,55 +68,58 @@ const validateMapping = <M>(original: M, configuration: TotpTargetConfiguration)
|
|
|
66
68
|
});
|
|
67
69
|
};
|
|
68
70
|
|
|
69
|
-
const services = (
|
|
71
|
+
const services = Effect.fnUntraced(function* (
|
|
70
72
|
mapping: any,
|
|
71
73
|
execution: TransactionExecution<TotpUnavailable, CurrentTotpTransaction>,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
totpPersistence: TotpPersistence.of({
|
|
75
|
-
snapshot: Effect.fn("TotpNative.snapshot")(
|
|
76
|
-
function* (input) {
|
|
77
|
-
const captured = { ...input };
|
|
74
|
+
): Effect.fn.Return<TotpPersistenceServices, never, LifecycleHooks> {
|
|
75
|
+
const hooks = yield* LifecycleHooks;
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
return {
|
|
78
|
+
totpPersistence: TotpPersistence.of({
|
|
79
|
+
snapshot: Effect.fn("TotpNative.snapshot")(
|
|
80
|
+
function* (input) {
|
|
81
|
+
const captured = { ...input };
|
|
82
|
+
|
|
83
|
+
invariant(captured.moduleId === mapping.moduleId);
|
|
84
|
+
yield* execution.admit;
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
return yield* execution
|
|
87
|
+
.run(
|
|
88
|
+
Effect.map(captureTotp(mapping, captured.subjectId), (value) => value?.snapshot),
|
|
89
|
+
false,
|
|
90
|
+
)
|
|
91
|
+
.pipe(Effect.provideService(LifecycleHooks, hooks));
|
|
92
|
+
},
|
|
93
|
+
Effect.catchDefect(() => Effect.fail(unavailable())),
|
|
94
|
+
),
|
|
95
|
+
mutate: (original, prepare) =>
|
|
96
|
+
Effect.suspend(() => {
|
|
97
|
+
// Detach caller-owned payloads before any driver or hook can suspend.
|
|
98
|
+
const codec = Schema.toCodecIso(TotpMutation);
|
|
99
|
+
const input = Schema.decodeSync(codec)(Schema.encodeSync(codec)(original));
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
return execution.admit.pipe(
|
|
102
|
+
Effect.andThen(
|
|
103
|
+
execution.run(
|
|
104
|
+
Effect.gen(function* () {
|
|
105
|
+
const decision = yield* mutateTotp(mapping, input),
|
|
106
|
+
owner = yield* CurrentTotpTransaction;
|
|
103
107
|
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
owner.guards.push(owner.journal.prepare(undefined));
|
|
109
|
+
const receipt = prepare(decision, owner.journal);
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
invariant(receipt?._tag === "PreparedCommit" && Effect.isEffect(receipt.read));
|
|
112
|
+
owner.guards.push(receipt as any);
|
|
109
113
|
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
return receipt;
|
|
115
|
+
}),
|
|
116
|
+
),
|
|
112
117
|
),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
+
Effect.provideService(LifecycleHooks, hooks),
|
|
119
|
+
);
|
|
120
|
+
}).pipe(Effect.catchDefect(() => Effect.fail(unavailable()))),
|
|
121
|
+
}),
|
|
122
|
+
};
|
|
118
123
|
});
|
|
119
124
|
|
|
120
125
|
export const makeTargetTotpPersistence = <
|
|
@@ -124,12 +129,10 @@ export const makeTargetTotpPersistence = <
|
|
|
124
129
|
N,
|
|
125
130
|
RSetup = never,
|
|
126
131
|
>(
|
|
127
|
-
database: TransactionNativeDatabase,
|
|
128
132
|
source: TotpMappingSource<TotpMapping<S, F, C, N>, RSetup>,
|
|
129
133
|
configuration: TotpTargetConfiguration,
|
|
130
134
|
) =>
|
|
131
135
|
Effect.gen(function* () {
|
|
132
|
-
const hooks = yield* LifecycleHooks;
|
|
133
136
|
const original = yield* Effect.isEffect(source) ? source : Effect.succeed(source);
|
|
134
137
|
|
|
135
138
|
const mapping = yield* Effect.try({
|
|
@@ -137,15 +140,14 @@ export const makeTargetTotpPersistence = <
|
|
|
137
140
|
catch: () => TotpConfigurationError.make({}),
|
|
138
141
|
});
|
|
139
142
|
|
|
140
|
-
const execution = makeTransactionExecution(
|
|
143
|
+
const execution = yield* makeTransactionExecution(
|
|
141
144
|
CurrentTotpTransaction,
|
|
142
|
-
database,
|
|
143
145
|
configuration,
|
|
144
146
|
unavailable,
|
|
145
147
|
randomId,
|
|
146
148
|
);
|
|
147
149
|
|
|
148
|
-
return services(mapping, execution
|
|
150
|
+
return yield* services(mapping, execution);
|
|
149
151
|
});
|
|
150
152
|
|
|
151
153
|
export const coordinateTargetTotp = <M, A, E, R, RSetup = never>(
|
|
@@ -159,7 +161,6 @@ export const coordinateTargetTotp = <M, A, E, R, RSetup = never>(
|
|
|
159
161
|
) => Effect.Effect<A, E, R>,
|
|
160
162
|
): Effect.Effect<A, TotpCoordinatorError<E>, R | RSetup | LifecycleHooks> =>
|
|
161
163
|
Effect.gen(function* () {
|
|
162
|
-
const hooks = yield* LifecycleHooks;
|
|
163
164
|
const original = yield* Effect.isEffect(source) ? source : Effect.succeed(source);
|
|
164
165
|
|
|
165
166
|
const mapping = yield* Effect.try({
|
|
@@ -174,8 +175,11 @@ export const coordinateTargetTotp = <M, A, E, R, RSetup = never>(
|
|
|
174
175
|
Effect.void,
|
|
175
176
|
unavailable,
|
|
176
177
|
randomId,
|
|
177
|
-
(execution) => services(mapping, execution
|
|
178
|
-
|
|
178
|
+
(execution) => services(mapping, execution),
|
|
179
|
+
(transaction, acquireServices, append) =>
|
|
180
|
+
Effect.flatMap(acquireServices, (boundServices) =>
|
|
181
|
+
body(transaction, boundServices, append),
|
|
182
|
+
),
|
|
179
183
|
);
|
|
180
184
|
});
|
|
181
185
|
|
|
@@ -185,11 +189,13 @@ type TransactionOf<D> = D extends { readonly transaction: (...args: any[]) => an
|
|
|
185
189
|
|
|
186
190
|
/** Concrete driver wrappers select transaction mode; cryptography always precedes these owners. */
|
|
187
191
|
export const makeTotpTarget = <
|
|
192
|
+
DatabaseId,
|
|
188
193
|
D extends { readonly transaction: any },
|
|
189
194
|
T extends Table,
|
|
190
195
|
Extra = unknown,
|
|
191
196
|
Synchronous extends boolean = false,
|
|
192
197
|
>(
|
|
198
|
+
databaseService: Context.Service<DatabaseId, D>,
|
|
193
199
|
configuration: TotpTargetConfiguration,
|
|
194
200
|
) => {
|
|
195
201
|
function coordinateTotpPersistence<
|
|
@@ -292,17 +298,12 @@ export const makeTotpTarget = <
|
|
|
292
298
|
}
|
|
293
299
|
|
|
294
300
|
return {
|
|
295
|
-
makeTotpPersistenceServices: <
|
|
296
|
-
Database extends D,
|
|
297
|
-
S extends T,
|
|
298
|
-
F extends T,
|
|
299
|
-
C extends T,
|
|
300
|
-
N,
|
|
301
|
-
RSetup = never,
|
|
302
|
-
>(
|
|
303
|
-
database: Database,
|
|
301
|
+
makeTotpPersistenceServices: <S extends T, F extends T, C extends T, N, RSetup = never>(
|
|
304
302
|
mapping: TotpMappingSource<TotpMapping<S, F, C, N> & Extra, RSetup>,
|
|
305
|
-
) =>
|
|
303
|
+
) =>
|
|
304
|
+
makeTargetTotpPersistence(mapping, configuration).pipe(
|
|
305
|
+
Effect.provideServiceEffect(NativeDatabase, nativeDatabase(databaseService)),
|
|
306
|
+
),
|
|
306
307
|
coordinateTotpPersistence,
|
|
307
308
|
};
|
|
308
309
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* oxlint-disable no-explicit-any -- this private acquisition preserves the installed native transaction; public wrappers retain its exact type. */
|
|
2
2
|
import { EffectMysql2Transaction } from "drizzle-orm/effect-mysql2";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
|
-
import { makeWithTransaction, type SqlClient } from "effect/
|
|
4
|
+
import { makeWithTransaction, type SqlClient } from "effect/sql/SqlClient";
|
|
5
5
|
|
|
6
6
|
/** Locking discovery and later SQL policy predicates must see the same current
|
|
7
7
|
* authority. MySQL's default repeatable-read snapshot is unsuitable after a
|
package/src/index.ts
CHANGED
|
@@ -105,15 +105,7 @@ export {
|
|
|
105
105
|
} from "./drizzle/proof-model";
|
|
106
106
|
|
|
107
107
|
export {
|
|
108
|
-
type AuthStoreTables,
|
|
109
|
-
type AuthTables,
|
|
110
|
-
type ChallengeColumns,
|
|
111
|
-
type ChallengeConsumeDecision,
|
|
112
|
-
type ChallengeInput,
|
|
113
|
-
type ChallengeRecord,
|
|
114
|
-
type ChallengeTableMapping,
|
|
115
108
|
type CommitMode,
|
|
116
|
-
type ConsumeDecision,
|
|
117
109
|
type D1ExternalIdentityMapping,
|
|
118
110
|
type D1GeneratedIdentityMapping,
|
|
119
111
|
type D1SubjectProvisioningMapping,
|
|
@@ -121,31 +113,17 @@ export {
|
|
|
121
113
|
type ExternalIdentityTables,
|
|
122
114
|
type IdentityTables,
|
|
123
115
|
type InstantCodec,
|
|
124
|
-
type OAuthStateColumns,
|
|
125
|
-
type OAuthStateTableMapping,
|
|
126
|
-
type OAuthStateTables,
|
|
127
|
-
type RegistrationColumns,
|
|
128
|
-
type RegistrationRecord,
|
|
129
|
-
type RegistrationTableMapping,
|
|
130
|
-
type RequiredAuthConstraints,
|
|
131
|
-
type RequiredAuthStoreConstraints,
|
|
132
116
|
type RequiredExternalIdentityConstraints,
|
|
133
117
|
type RequiredIdentityConstraints,
|
|
134
|
-
type RequiredOAuthStateConstraints,
|
|
135
118
|
type RequiredSubjectProvisioningConstraints,
|
|
136
119
|
type SubjectIdCodec,
|
|
137
120
|
type SubjectProvisioningTables,
|
|
138
|
-
authServicesLayer,
|
|
139
121
|
column,
|
|
140
122
|
identityServicesLayer,
|
|
141
123
|
isMappedConstraintConflict,
|
|
142
124
|
provisioningFingerprint,
|
|
143
|
-
requireStandaloneConsume,
|
|
144
|
-
requiredAuthConstraints,
|
|
145
|
-
requiredAuthStoreConstraints,
|
|
146
125
|
requiredExternalIdentityConstraints,
|
|
147
126
|
requiredIdentityConstraints,
|
|
148
|
-
requiredOAuthStateConstraints,
|
|
149
127
|
requiredSubjectProvisioningConstraints,
|
|
150
128
|
updateValues,
|
|
151
129
|
} from "./drizzle/model";
|
|
@@ -334,7 +312,6 @@ export {
|
|
|
334
312
|
export { passwordPersistenceLayer, passwordRegistrationLayer } from "./drizzle/password-target";
|
|
335
313
|
export { passwordPreparedPersistenceLayer } from "./drizzle/password-prepared-target";
|
|
336
314
|
export { proofPersistenceLayer } from "./drizzle/proof-target";
|
|
337
|
-
export { AuthStoreDecisions } from "@yielded/auth/Persistence";
|
|
338
315
|
|
|
339
316
|
export {
|
|
340
317
|
type TotpMapping,
|
|
@@ -346,7 +323,6 @@ export {
|
|
|
346
323
|
} from "./drizzle/totp-model";
|
|
347
324
|
|
|
348
325
|
export { encodeTotpRecord, decodeTotpRecord } from "./drizzle/totp-state";
|
|
349
|
-
export { OAuthStateDecisions } from "@yielded/auth/OAuth";
|
|
350
326
|
|
|
351
327
|
export {
|
|
352
328
|
type PasskeyCredentialInsert,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
type PgTable,
|
|
16
16
|
} from "drizzle-orm/pg-core";
|
|
17
17
|
import type { Effect } from "effect";
|
|
18
|
-
import type { SqlClient } from "effect/
|
|
18
|
+
import type { SqlClient } from "effect/sql/SqlClient";
|
|
19
19
|
|
|
20
20
|
import { drizzleQueryOperations } from "../drizzle/query-operations";
|
|
21
21
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type SQLiteTable,
|
|
15
15
|
} from "drizzle-orm/sqlite-core";
|
|
16
16
|
import type { Effect } from "effect";
|
|
17
|
-
import type { SqlClient } from "effect/
|
|
17
|
+
import type { SqlClient } from "effect/sql/SqlClient";
|
|
18
18
|
|
|
19
19
|
import { drizzleQueryOperations } from "../drizzle/query-operations";
|
|
20
20
|
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { D1ExternalIdentityMapping, D1SubjectProvisioningMapping } from "./model.mjs";
|
|
2
|
-
import { ExternalIdentity, IdentityConflict, IdentityUnavailable, SubjectProvisioningInput } from "@yielded/auth/Identity";
|
|
3
|
-
import { SubjectId } from "@yielded/auth/Schema";
|
|
4
|
-
import { AnyRelations } from "drizzle-orm";
|
|
5
|
-
import { Effect } from "effect";
|
|
6
|
-
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
7
|
-
import { D1Client } from "@effect/sql-d1/D1Client";
|
|
8
|
-
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
9
|
-
//#region src/drizzle/d1-identity.d.ts
|
|
10
|
-
/**
|
|
11
|
-
* D1 provisioning is an ordered atomic batch. The receipt captures the
|
|
12
|
-
* database-generated subject id from the first insert via last_insert_rowid;
|
|
13
|
-
* the optional identifier then reads that stable id from the receipt.
|
|
14
|
-
*/
|
|
15
|
-
export declare const makeD1SubjectProvisioningServices: <Subject extends AnySQLiteTable, Identifier extends AnySQLiteTable, Request extends AnySQLiteTable, NativeId>(database: EffectSQLiteD1Database<AnyRelations> & {
|
|
16
|
-
readonly $client: D1Client;
|
|
17
|
-
}, mapping: D1SubjectProvisioningMapping<Subject, Identifier, Request, NativeId>) => {
|
|
18
|
-
readonly subjectProvisioner: {
|
|
19
|
-
readonly provision: (input: SubjectProvisioningInput) => Effect.Effect<import("@yielded/auth/Identity").ProvisioningResult, IdentityConflict | IdentityUnavailable>;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare const makeD1ExternalIdentityServices: <Subject extends AnySQLiteTable, External extends AnySQLiteTable, NativeId>(database: EffectSQLiteD1Database<AnyRelations> & {
|
|
23
|
-
readonly $client: D1Client;
|
|
24
|
-
}, mapping: D1ExternalIdentityMapping<Subject, External, NativeId>) => {
|
|
25
|
-
readonly externalIdentityMutation: {
|
|
26
|
-
readonly bind: (subjectId: SubjectId, identity: ExternalIdentity) => Effect.Effect<void, IdentityConflict | IdentityUnavailable>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
//# sourceMappingURL=d1-identity.d.mts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ExternalIdentityTables, SubjectProvisioningTables } from "./model.mjs";
|
|
2
|
-
import { ExternalIdentity, IdentityConflict, IdentityUnavailable, SubjectProvisioningInput } from "@yielded/auth/Identity";
|
|
3
|
-
import { SubjectId } from "@yielded/auth/Schema";
|
|
4
|
-
import { AnyRelations } from "drizzle-orm";
|
|
5
|
-
import { Effect } from "effect";
|
|
6
|
-
import { EffectMysql2Database } from "drizzle-orm/effect-mysql2";
|
|
7
|
-
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
|
8
|
-
//#region src/drizzle/mysql-identity.d.ts
|
|
9
|
-
type Database = EffectMysql2Database<AnyRelations>;
|
|
10
|
-
export declare const makeMysqlSubjectProvisioningServices: <Subject extends AnyMySqlTable, Identifier extends AnyMySqlTable, Request extends AnyMySqlTable, NativeId>(database: Database, mapping: SubjectProvisioningTables<Subject, Identifier, Request, NativeId>) => {
|
|
11
|
-
readonly subjectProvisioner: {
|
|
12
|
-
readonly provision: (input: SubjectProvisioningInput) => Effect.Effect<import("@yielded/auth/Identity").ProvisioningResult, IdentityConflict | IdentityUnavailable>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const makeMysqlExternalIdentityServices: <Subject extends AnyMySqlTable, External extends AnyMySqlTable, NativeId>(database: Database, mapping: ExternalIdentityTables<Subject, External, NativeId>) => {
|
|
16
|
-
readonly externalIdentityMutation: {
|
|
17
|
-
readonly bind: (subjectId: SubjectId, identity: ExternalIdentity) => Effect.Effect<void, IdentityConflict | IdentityUnavailable>;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
//# sourceMappingURL=mysql-identity.d.mts.map
|
package/dist/drizzle/mysql.d.mts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { AuthStoreTables, AuthTables, ChallengeConsumeDecision, ConsumeDecision, OAuthStateTables } from "./model.mjs";
|
|
2
|
-
import { SuppliedService } from "./SuppliedService.mjs";
|
|
3
|
-
import { EmailOtpRejected } from "@yielded/auth/AuthStore";
|
|
4
|
-
import { AuthStoreError, InvalidRegistration } from "@yielded/auth/Errors";
|
|
5
|
-
import { InvalidOAuthState, OAuthState, OAuthStateDecisions } from "@yielded/auth/OAuth";
|
|
6
|
-
import { ConsumeChallenge, ConsumeRegistration, NewChallenge, NewRegistration, TokenDigest, VerifiedEmail } from "@yielded/auth/Schema";
|
|
7
|
-
import { AnyRelations } from "drizzle-orm";
|
|
8
|
-
import { Effect } from "effect";
|
|
9
|
-
import { AuthStoreDecisions } from "@yielded/auth/Persistence";
|
|
10
|
-
import { EffectMysql2Database } from "drizzle-orm/effect-mysql2";
|
|
11
|
-
import { SqlError } from "effect/unstable/sql/SqlError";
|
|
12
|
-
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
|
13
|
-
//#region src/drizzle/mysql.d.ts
|
|
14
|
-
type Database = EffectMysql2Database<AnyRelations>;
|
|
15
|
-
type TransactionOf<D extends Database> = Parameters<Parameters<D["transaction"]>[0]>[0];
|
|
16
|
-
/** MySQL/InnoDB implementation. Multi-step decisions stay values until commit. */
|
|
17
|
-
export declare const makeMysqlAuthStoreServices: <C extends AnyMySqlTable, R extends AnyMySqlTable>(database: Database, mapping: AuthStoreTables<C, R>) => {
|
|
18
|
-
readonly authStore: {
|
|
19
|
-
readonly issueChallenge: (input: NewChallenge) => Effect.Effect<void, import("@yielded/auth/AuthStore").IssueChallengeError>;
|
|
20
|
-
readonly consumeChallenge: (input: ConsumeChallenge) => Effect.Effect<VerifiedEmail, EmailOtpRejected | AuthStoreError>;
|
|
21
|
-
readonly issueRegistration: (input: NewRegistration) => Effect.Effect<void, AuthStoreError>;
|
|
22
|
-
readonly inspectRegistration: (tokenDigest: TokenDigest) => Effect.Effect<import("@yielded/auth/Schema").PendingRegistration, InvalidRegistration | AuthStoreError>;
|
|
23
|
-
readonly consumeRegistration: (input: ConsumeRegistration) => Effect.Effect<void, InvalidRegistration | AuthStoreError>;
|
|
24
|
-
};
|
|
25
|
-
readonly decisions: {
|
|
26
|
-
readonly consumeChallenge: (input: ConsumeChallenge) => Effect.Effect<ChallengeConsumeDecision, AuthStoreError, never>;
|
|
27
|
-
readonly consumeRegistration: (input: ConsumeRegistration) => Effect.Effect<ConsumeDecision<void>, AuthStoreError, never>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare const makeMysqlOAuthStateServices: <S extends AnyMySqlTable>(database: Database, mapping: OAuthStateTables<S>) => {
|
|
31
|
-
readonly oauthStateStore: {
|
|
32
|
-
readonly issue: (state: OAuthState) => Effect.Effect<void, AuthStoreError>;
|
|
33
|
-
readonly consume: (stateDigest: TokenDigest) => Effect.Effect<OAuthState, InvalidOAuthState | AuthStoreError>;
|
|
34
|
-
};
|
|
35
|
-
readonly decisions: {
|
|
36
|
-
readonly consumeOAuthState: (digest: string & import("effect/Brand").Brand<"effect-auth/TokenDigest">) => Effect.Effect<ConsumeDecision<OAuthState>, AuthStoreError, never>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Owns the native outer commit. Keep rejection as a decision value inside the
|
|
41
|
-
* owner; interruption before commit rolls back. This adapter never retries a
|
|
42
|
-
* deadlock inside the caller's transaction.
|
|
43
|
-
*/
|
|
44
|
-
export declare function coordinateMysqlAuthStoreTransaction<D extends Database, C extends AnyMySqlTable, R extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
45
|
-
readonly mapping: AuthStoreTables<C, R>;
|
|
46
|
-
readonly transaction?: never;
|
|
47
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, AuthStoreDecisions> | DatabaseRequirements>;
|
|
48
|
-
export declare function coordinateMysqlAuthStoreTransaction<D extends Database, C extends AnyMySqlTable, R extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
49
|
-
readonly mapping: AuthStoreTables<C, R>;
|
|
50
|
-
readonly transaction: SuppliedService<TxId, NoInfer<TransactionOf<D>>, TxShape>;
|
|
51
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, AuthStoreDecisions | TxId> | DatabaseRequirements>;
|
|
52
|
-
export declare function coordinateMysqlOAuthStateTransaction<D extends Database, S extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
53
|
-
readonly mapping: OAuthStateTables<S>;
|
|
54
|
-
readonly transaction?: never;
|
|
55
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, OAuthStateDecisions> | DatabaseRequirements>;
|
|
56
|
-
export declare function coordinateMysqlOAuthStateTransaction<D extends Database, S extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
57
|
-
readonly mapping: OAuthStateTables<S>;
|
|
58
|
-
readonly transaction: SuppliedService<TxId, NoInfer<TransactionOf<D>>, TxShape>;
|
|
59
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, OAuthStateDecisions | TxId> | DatabaseRequirements>;
|
|
60
|
-
export declare function coordinateMysqlAuthTransaction<D extends Database, C extends AnyMySqlTable, R extends AnyMySqlTable, S extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
61
|
-
readonly mapping: AuthTables<C, R, S>;
|
|
62
|
-
readonly transaction?: never;
|
|
63
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, AuthStoreDecisions | OAuthStateDecisions> | DatabaseRequirements>;
|
|
64
|
-
export declare function coordinateMysqlAuthTransaction<D extends Database, C extends AnyMySqlTable, R extends AnyMySqlTable, S extends AnyMySqlTable, A, E, Requirements, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
65
|
-
readonly mapping: AuthTables<C, R, S>;
|
|
66
|
-
readonly transaction: SuppliedService<TxId, NoInfer<TransactionOf<D>>, TxShape>;
|
|
67
|
-
}, body: Effect.Effect<A, E, Requirements>): Effect.Effect<A, E | DatabaseError | SqlError, Exclude<Requirements, AuthStoreDecisions | OAuthStateDecisions | TxId> | DatabaseRequirements>;
|
|
68
|
-
//#endregion
|
|
69
|
-
//# sourceMappingURL=mysql.d.mts.map
|