@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.
- package/README.md +3 -0
- package/dist/D1.d.mts +11 -11
- package/dist/D1.mjs +2 -1
- package/dist/D1.mjs.map +1 -1
- package/dist/Libsql.d.mts +40 -56
- package/dist/Libsql.mjs +2 -1
- package/dist/Libsql.mjs.map +1 -1
- package/dist/Mysql2.d.mts +16 -17
- package/dist/Pglite.d.mts +18 -18
- package/dist/Pglite.mjs +2 -1
- package/dist/Pglite.mjs.map +1 -1
- package/dist/Postgres.d.mts +24 -24
- package/dist/Postgres.mjs +2 -1
- package/dist/Postgres.mjs.map +1 -1
- package/dist/SqliteBun.d.mts +39 -55
- package/dist/SqliteBun.mjs +2 -1
- package/dist/SqliteBun.mjs.map +1 -1
- package/dist/SqliteDo.d.mts +48 -64
- package/dist/SqliteDo.mjs +2 -1
- package/dist/SqliteDo.mjs.map +1 -1
- package/dist/SqliteNode.d.mts +45 -61
- package/dist/SqliteNode.mjs +2 -1
- package/dist/SqliteNode.mjs.map +1 -1
- package/dist/SqliteWasm.d.mts +48 -64
- package/dist/SqliteWasm.mjs +2 -1
- package/dist/SqliteWasm.mjs.map +1 -1
- package/dist/drizzle/crypto.mjs +1 -1
- package/dist/drizzle/d1-emails.d.mts +1 -1
- package/dist/drizzle/d1-oauth.d.mts +14 -14
- package/dist/drizzle/d1-passkey.d.mts +1 -1
- package/dist/drizzle/d1-password-prepared.d.mts +4 -4
- package/dist/drizzle/d1-password-prepared.mjs.map +1 -1
- package/dist/drizzle/d1-passwords.d.mts +18 -35
- package/dist/drizzle/d1-passwords.mjs +78 -290
- package/dist/drizzle/d1-passwords.mjs.map +1 -1
- package/dist/drizzle/d1-phone.d.mts +1 -1
- package/dist/drizzle/d1-proofs.d.mts +2 -2
- package/dist/drizzle/d1-sessions.d.mts +3 -3
- package/dist/drizzle/d1-sessions.mjs +11 -6
- package/dist/drizzle/d1-sessions.mjs.map +1 -1
- package/dist/drizzle/d1-totp.d.mts +1 -1
- package/dist/drizzle/mysql-password-prepared.d.mts +5 -5
- package/dist/drizzle/mysql-password-prepared.mjs.map +1 -1
- package/dist/drizzle/mysql-passwords.d.mts +16 -32
- package/dist/drizzle/mysql-passwords.mjs.map +1 -1
- package/dist/drizzle/mysql-sessions.d.mts +1 -1
- package/dist/drizzle/native-sql-table.mjs +135 -0
- package/dist/drizzle/native-sql-table.mjs.map +1 -0
- package/dist/drizzle/oauth-connected-model.d.mts +20 -281
- package/dist/drizzle/oauth-connected-model.mjs +3 -17
- package/dist/drizzle/oauth-connected-model.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-reference.d.mts +1 -3
- package/dist/drizzle/oauth-connected-reference.mjs +4 -53
- package/dist/drizzle/oauth-connected-reference.mjs.map +1 -1
- package/dist/drizzle/oauth-connected-target.d.mts +3 -990
- package/dist/drizzle/oauth-connected-target.mjs +8 -92
- package/dist/drizzle/oauth-connected-target.mjs.map +1 -1
- package/dist/drizzle/oauth-kernel.mjs +11 -0
- package/dist/drizzle/oauth-kernel.mjs.map +1 -0
- package/dist/drizzle/oauth-model.d.mts +35 -438
- package/dist/drizzle/oauth-model.mjs +6 -44
- package/dist/drizzle/oauth-model.mjs.map +1 -1
- package/dist/drizzle/oauth-mysql.mjs +2 -2
- package/dist/drizzle/oauth-mysql.mjs.map +1 -1
- package/dist/drizzle/oauth-proxy.d.mts +10 -0
- package/dist/drizzle/oauth-proxy.mjs +54 -0
- package/dist/drizzle/oauth-proxy.mjs.map +1 -0
- package/dist/drizzle/oauth-target.d.mts +6 -107
- package/dist/drizzle/oauth-target.mjs +15 -245
- package/dist/drizzle/oauth-target.mjs.map +1 -1
- package/dist/drizzle/password-model.d.mts +5 -8
- package/dist/drizzle/password-prepared-model.d.mts +5 -5
- package/dist/drizzle/password-prepared-model.mjs.map +1 -1
- package/dist/drizzle/password-prepared-state.mjs +1 -1
- package/dist/drizzle/password-sql.mjs +2 -1
- package/dist/drizzle/password-sql.mjs.map +1 -1
- package/dist/drizzle/password-target.mjs +13 -2
- package/dist/drizzle/password-target.mjs.map +1 -1
- package/dist/drizzle/pg-password-prepared.d.mts +5 -5
- package/dist/drizzle/pg-password-prepared.mjs.map +1 -1
- package/dist/drizzle/pg-passwords.d.mts +16 -32
- package/dist/drizzle/pg-passwords.mjs.map +1 -1
- package/dist/drizzle/pg-sessions.d.mts +1 -1
- package/dist/drizzle/phone-target.d.mts +2 -2
- package/dist/drizzle/phone-target.mjs +1 -1
- package/dist/drizzle/query-operations.mjs +3 -1
- package/dist/drizzle/query-operations.mjs.map +1 -1
- package/dist/drizzle/session-sql.mjs +2 -1
- package/dist/drizzle/session-sql.mjs.map +1 -1
- package/dist/drizzle/sqlite-password-prepared.mjs.map +1 -1
- package/dist/drizzle/sqlite-passwords.mjs.map +1 -1
- package/dist/drizzle/storage-validation.mjs +10 -198
- package/dist/drizzle/storage-validation.mjs.map +1 -1
- package/dist/drizzle/totp-target.d.mts +3 -3
- package/dist/drizzle/totp-target.mjs +2 -2
- package/dist/drizzle/transaction-execution.d.mts +2 -2
- package/dist/drizzle/transaction-owner.d.mts +1 -2
- package/dist/index.d.mts +3 -2
- package/dist/internal/drizzle-postgres-oauth-proxy.d.mts +138 -0
- package/dist/internal/drizzle-postgres-oauth-proxy.mjs +29 -0
- package/dist/internal/drizzle-postgres-oauth-proxy.mjs.map +1 -0
- package/dist/internal/drizzle-postgres.mjs +2 -0
- package/dist/internal/drizzle-postgres.mjs.map +1 -1
- package/dist/internal/drizzle-sqlite-oauth-proxy.d.mts +146 -0
- package/dist/internal/drizzle-sqlite-oauth-proxy.mjs +29 -0
- package/dist/internal/drizzle-sqlite-oauth-proxy.mjs.map +1 -0
- package/dist/internal/drizzle-sqlite.mjs +2 -0
- package/dist/internal/drizzle-sqlite.mjs.map +1 -1
- package/package.json +1 -1
- package/src/D1.ts +2 -0
- package/src/Libsql.ts +2 -0
- package/src/Pglite.ts +2 -0
- package/src/Postgres.ts +2 -0
- package/src/SqliteBun.ts +2 -0
- package/src/SqliteDo.ts +2 -0
- package/src/SqliteNode.ts +2 -0
- package/src/SqliteWasm.ts +2 -0
- package/src/drizzle/d1-password-prepared.ts +2 -23
- package/src/drizzle/d1-passwords.ts +158 -780
- package/src/drizzle/d1-sessions.ts +21 -6
- package/src/drizzle/mysql-password-prepared.ts +4 -16
- package/src/drizzle/mysql-passwords.ts +5 -20
- package/src/drizzle/native-sql-table.ts +259 -0
- package/src/drizzle/oauth-connected-model.ts +97 -315
- package/src/drizzle/oauth-connected-reference.ts +13 -93
- package/src/drizzle/oauth-connected-target.ts +14 -271
- package/src/drizzle/oauth-kernel.ts +10 -0
- package/src/drizzle/oauth-model.ts +188 -541
- package/src/drizzle/oauth-mysql.ts +2 -2
- package/src/drizzle/oauth-proxy.ts +101 -0
- package/src/drizzle/oauth-target.ts +33 -737
- package/src/drizzle/password-model.ts +0 -33
- package/src/drizzle/password-prepared-model.ts +0 -18
- package/src/drizzle/password-sql.ts +3 -0
- package/src/drizzle/password-target.ts +41 -4
- package/src/drizzle/pg-password-prepared.ts +4 -16
- package/src/drizzle/pg-passwords.ts +5 -20
- package/src/drizzle/query-operations.ts +4 -0
- package/src/drizzle/session-sql.ts +2 -1
- package/src/drizzle/sqlite-password-prepared.ts +4 -52
- package/src/drizzle/sqlite-passwords.ts +7 -28
- package/src/drizzle/storage-validation.ts +13 -222
- package/src/index.ts +2 -8
- package/src/internal/drizzle-postgres-oauth-proxy.ts +37 -0
- package/src/internal/drizzle-postgres.ts +2 -0
- package/src/internal/drizzle-sqlite-oauth-proxy.ts +44 -0
- package/src/internal/drizzle-sqlite.ts +2 -0
- package/dist/_virtual/_rolldown/runtime.mjs +0 -13
- package/dist/drizzle/oauth-accounts.mjs +0 -359
- package/dist/drizzle/oauth-accounts.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-access.mjs +0 -212
- package/dist/drizzle/oauth-connected-access.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-collection.mjs +0 -202
- package/dist/drizzle/oauth-connected-collection.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-custody.mjs +0 -147
- package/dist/drizzle/oauth-connected-custody.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-flow.mjs +0 -297
- package/dist/drizzle/oauth-connected-flow.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-input.mjs +0 -122
- package/dist/drizzle/oauth-connected-input.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-maintenance.mjs +0 -214
- package/dist/drizzle/oauth-connected-maintenance.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-management.mjs +0 -229
- package/dist/drizzle/oauth-connected-management.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-settlement.mjs +0 -128
- package/dist/drizzle/oauth-connected-settlement.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-sign-in.mjs +0 -265
- package/dist/drizzle/oauth-connected-sign-in.mjs.map +0 -1
- package/dist/drizzle/oauth-connected-state.d.mts +0 -2062
- package/dist/drizzle/oauth-connected-state.mjs +0 -430
- package/dist/drizzle/oauth-connected-state.mjs.map +0 -1
- package/dist/drizzle/oauth-flow.d.mts +0 -22
- package/dist/drizzle/oauth-flow.mjs +0 -253
- package/dist/drizzle/oauth-flow.mjs.map +0 -1
- package/dist/drizzle/oauth-input.mjs +0 -127
- package/dist/drizzle/oauth-input.mjs.map +0 -1
- package/dist/drizzle/oauth-owner.d.mts +0 -10
- package/dist/drizzle/oauth-owner.mjs +0 -10
- package/dist/drizzle/oauth-owner.mjs.map +0 -1
- package/dist/drizzle/oauth-registration.d.mts +0 -5
- package/dist/drizzle/oauth-registration.mjs +0 -374
- package/dist/drizzle/oauth-registration.mjs.map +0 -1
- package/dist/drizzle/oauth-state.mjs +0 -107
- package/dist/drizzle/oauth-state.mjs.map +0 -1
- package/src/drizzle/oauth-accounts.ts +0 -805
- package/src/drizzle/oauth-connected-access.ts +0 -361
- package/src/drizzle/oauth-connected-collection.ts +0 -324
- package/src/drizzle/oauth-connected-custody.ts +0 -279
- package/src/drizzle/oauth-connected-flow.ts +0 -529
- package/src/drizzle/oauth-connected-input.ts +0 -147
- package/src/drizzle/oauth-connected-maintenance.ts +0 -346
- package/src/drizzle/oauth-connected-management.ts +0 -365
- package/src/drizzle/oauth-connected-settlement.ts +0 -251
- package/src/drizzle/oauth-connected-sign-in.ts +0 -443
- package/src/drizzle/oauth-connected-state.ts +0 -872
- package/src/drizzle/oauth-flow.ts +0 -462
- package/src/drizzle/oauth-input.ts +0 -201
- package/src/drizzle/oauth-owner.ts +0 -29
- package/src/drizzle/oauth-registration.ts +0 -640
- package/src/drizzle/oauth-state.ts +0 -218
package/dist/SqliteDo.d.mts
CHANGED
|
@@ -7,16 +7,16 @@ import { PasswordPreparedPersistenceMapping, PasswordPreparedProofMapping } from
|
|
|
7
7
|
import { AuthenticationAuthorityMapping, PendingAuthenticationMapping, SignedSessionValidityMapping, StatefulSessionMapping } from "./drizzle/session-model.mjs";
|
|
8
8
|
import { PasskeyCredentialMapping, PasskeyEnrollmentContextMapping, PasskeyPersistenceMapping } from "./drizzle/passkey-model.mjs";
|
|
9
9
|
import { SessionStepUpMapping } from "./drizzle/step-up-model.mjs";
|
|
10
|
-
import { OAuthAccountsMapping,
|
|
10
|
+
import { OAuthAccountsMapping, OAuthRegistrationIntentMapping, OAuthRegistrationMapping, OAuthSignInMapping } from "./drizzle/oauth-model.mjs";
|
|
11
11
|
import { OAuthConnectedMapping, OAuthConnectedRevocationMapping } from "./drizzle/oauth-connected-model.mjs";
|
|
12
12
|
import { PasskeyRegistrationCeremonyMapping } from "./drizzle/passkey-registration-ceremony-model.mjs";
|
|
13
13
|
import { EmailRegistrationAuthority } from "./drizzle/email-registration.mjs";
|
|
14
|
-
import { OAuthCoordinatorError } from "./drizzle/oauth-target.mjs";
|
|
15
14
|
import { passwordPreparedPersistenceLayer } from "./drizzle/password-prepared-target.mjs";
|
|
16
15
|
import { TotpMapping, TotpMappingSource, TotpPersistenceServices } from "./drizzle/totp-model.mjs";
|
|
17
16
|
import { PasskeyManagementMapping, PasskeyRegistrationMapping } from "./drizzle/passkey-write-model.mjs";
|
|
18
17
|
import { PhoneMapping, PhoneMappingSource, PhonePersistenceServices } from "./drizzle/phone-model.mjs";
|
|
19
18
|
import "./index.mjs";
|
|
19
|
+
import { OAuthProxyPersistence } from "./internal/drizzle-sqlite-oauth-proxy.mjs";
|
|
20
20
|
import { SuppliedService } from "./drizzle/SuppliedService.mjs";
|
|
21
21
|
import { TotpCoordinatorError } from "./drizzle/totp-target.mjs";
|
|
22
22
|
import { PhoneCoordinatorError } from "./drizzle/phone-target.mjs";
|
|
@@ -85,13 +85,13 @@ export declare const coordinateEmailAddress: {
|
|
|
85
85
|
};
|
|
86
86
|
}, import("@yielded/auth/Email").EmailUnavailable, Database>;
|
|
87
87
|
export declare const coordinatePasswordPersistence: {
|
|
88
|
-
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
89
|
-
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<
|
|
88
|
+
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
89
|
+
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
|
|
90
90
|
readonly proofMapping?: PM;
|
|
91
91
|
readonly transaction?: never;
|
|
92
92
|
}, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, import("@yielded/auth/Password").PasswordPersistence>>;
|
|
93
|
-
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
94
|
-
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<
|
|
93
|
+
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, NativeId, PM extends ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any> | undefined, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
94
|
+
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
|
|
95
95
|
readonly proofMapping?: PM;
|
|
96
96
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
97
97
|
}, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/Password").PasswordPersistence>>;
|
|
@@ -106,26 +106,17 @@ export declare const coordinatePasswordPersistence: {
|
|
|
106
106
|
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>>;
|
|
107
107
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
108
108
|
}, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId | TxId>>;
|
|
109
|
-
}, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
109
|
+
}, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, NativeId>(mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>, proofMapping?: ProofPersistenceMapping<any, any, any, any, any, any, any, any, any, any, any, any>) => Effect.Effect<{
|
|
110
110
|
passwordPersistence: {
|
|
111
|
-
readonly
|
|
111
|
+
readonly findCredential: (input: {
|
|
112
112
|
readonly moduleId: string;
|
|
113
|
-
readonly action: "sign-in" | "change";
|
|
114
113
|
readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
|
|
115
114
|
readonly subjectId?: import("@yielded/auth/Schema").SubjectId;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
readonly
|
|
120
|
-
|
|
121
|
-
readonly captured?: import("@yielded/auth/Password").PasswordCredentialSnapshot;
|
|
122
|
-
readonly outcome: import("@yielded/auth/Password").PasswordAttemptDecision;
|
|
123
|
-
readonly rehash?: {
|
|
124
|
-
readonly expectedVersion: import("@yielded/auth/Sessions").SecurityRevision;
|
|
125
|
-
readonly expectedVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
126
|
-
readonly nextVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
127
|
-
};
|
|
128
|
-
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordAttemptDecision, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
115
|
+
}) => Effect.Effect<import("effect/Option").Option<import("@yielded/auth/Password").PasswordCredentialSnapshot>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
116
|
+
readonly rehashIfCurrent: (input: {
|
|
117
|
+
readonly credential: import("@yielded/auth/Password").PasswordCredentialSnapshot;
|
|
118
|
+
readonly nextVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
119
|
+
}) => Effect.Effect<void, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
129
120
|
readonly readForSubject: (input: {
|
|
130
121
|
readonly moduleId: string;
|
|
131
122
|
readonly subjectId: import("@yielded/auth/Schema").SubjectId;
|
|
@@ -134,19 +125,12 @@ export declare const coordinatePasswordPersistence: {
|
|
|
134
125
|
readonly moduleId: string;
|
|
135
126
|
readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
|
|
136
127
|
}) => Effect.Effect<import("effect/Option").Option<import("@yielded/auth/Password").PasswordCredentialSnapshot>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
137
|
-
readonly addIfAbsent: <
|
|
138
|
-
readonly replaceIfCurrent: <
|
|
128
|
+
readonly addIfAbsent: <A>(input: import("@yielded/auth/Password").PasswordMutationInput, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordMutationDecision, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
129
|
+
readonly replaceIfCurrent: <A>(input: import("@yielded/auth/Password").PasswordMutationInput, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordMutationDecision, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
139
130
|
readonly checkReset: (input: import("@yielded/auth/Proofs").ProofCompletionInput) => Effect.Effect<boolean, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
140
|
-
readonly resetWithProof: <
|
|
131
|
+
readonly resetWithProof: <A>(input: import("@yielded/auth/Password").PasswordMutationInput & {
|
|
141
132
|
readonly completion: import("@yielded/auth/Proofs").ProofCompletionPlan;
|
|
142
|
-
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordMutationDecision,
|
|
143
|
-
readonly cleanupAttempts: <A_1>(input: {
|
|
144
|
-
readonly moduleId: string;
|
|
145
|
-
readonly limit: number;
|
|
146
|
-
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<{
|
|
147
|
-
readonly removed: number;
|
|
148
|
-
readonly hasMore: boolean;
|
|
149
|
-
}, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
133
|
+
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordMutationDecision, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
150
134
|
};
|
|
151
135
|
}, import("@yielded/auth/Password").PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, makePasswordRegistrationServices: <Registration, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, Rq extends AnySQLiteTable, NativeId>(mapping: PasswordRegistrationMapping<Registration, S, I, C, AC, Rq, NativeId>) => Effect.Effect<{
|
|
152
136
|
registrationAuthority: import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>;
|
|
@@ -257,7 +241,7 @@ export declare const coordinateAuthenticationAuthority: {
|
|
|
257
241
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Sessions").SessionUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, PersistenceId | RepositoryId | TxId>>;
|
|
258
242
|
}, makeAuthenticationAuthorityServices: <Claims, S extends AnySQLiteTable, C extends AnySQLiteTable, F extends AnySQLiteTable, P extends AnySQLiteTable, NativeId>(mapping: AuthenticationAuthorityMapping<Claims, S, C, F, P, NativeId>) => Effect.Effect<{
|
|
259
243
|
authenticationAuthority: {
|
|
260
|
-
readonly capture: (subjectId: import("@yielded/auth/Schema").SubjectId, credentialIds: ReadonlyArray<string>) => Effect.Effect<import("@yielded/auth/Sessions").
|
|
244
|
+
readonly capture: (subjectId: import("@yielded/auth/Schema").SubjectId, credentialIds: ReadonlyArray<string>) => Effect.Effect<import("@yielded/auth/Sessions").AuthenticationCapture, import("@yielded/auth/Sessions").StaleAuthentication | import("@yielded/auth/Sessions").SessionUnavailable>;
|
|
261
245
|
readonly requirements: (evidence: import("@yielded/auth/Sessions").AuthenticationEvidence) => Effect.Effect<import("@yielded/auth/Sessions").AuthenticationRequirement, import("@yielded/auth/Sessions").StaleAuthentication | import("@yielded/auth/Sessions").SessionUnavailable>;
|
|
262
246
|
readonly approve: <A>(input: {
|
|
263
247
|
readonly evidence: import("@yielded/auth/Sessions").AuthenticationEvidence;
|
|
@@ -307,17 +291,17 @@ export declare const makeExternalIdentityServices: <Subject extends AnySQLiteTab
|
|
|
307
291
|
readonly bind: (subjectId: import("@yielded/auth/Schema").SubjectId, identity: import("@yielded/auth/Identity").ExternalIdentity) => Effect.Effect<void, import("@yielded/auth/Identity").IdentityConflict | import("@yielded/auth/Identity").IdentityUnavailable>;
|
|
308
292
|
};
|
|
309
293
|
}, import("@yielded/auth/Identity").IdentityUnavailable, Database>;
|
|
310
|
-
export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
294
|
+
export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable = AnySQLiteTable, PC extends AnySQLiteTable = AnySQLiteTable, PM extends AnySQLiteTable = AnySQLiteTable, PSub extends AnySQLiteTable = AnySQLiteTable, PI extends AnySQLiteTable = AnySQLiteTable, PCr extends AnySQLiteTable = AnySQLiteTable, PNativeId = unknown>(mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>, proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
|
|
311
295
|
passwordPreparedPersistence: import("@yielded/auth/Password").PasswordPreparedPersistence;
|
|
312
296
|
}, import("@yielded/auth/Password").PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinatePasswordPreparedPersistence: {
|
|
313
|
-
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
314
|
-
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC,
|
|
297
|
+
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
298
|
+
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
|
|
315
299
|
readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
|
|
316
300
|
readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
|
|
317
301
|
readonly transaction?: never;
|
|
318
302
|
}, body: Effect.Effect<Out, E, R>): Effect.Effect<Out, DatabaseError | E | import("@yielded/auth/Hooks").HookConfigurationError | import("@yielded/auth/Password").PasswordUnavailable | import("effect/sql/SqlError").SqlError, DatabaseRequirements | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TargetId>>;
|
|
319
|
-
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
320
|
-
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC,
|
|
303
|
+
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable, M extends AnySQLiteTable, T extends AnySQLiteTable, B extends AnySQLiteTable, NativeId, PS extends AnySQLiteTable, PC extends AnySQLiteTable, PM extends AnySQLiteTable, PSub extends AnySQLiteTable, PI extends AnySQLiteTable, PCr extends AnySQLiteTable, PNativeId, Out, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
304
|
+
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
|
|
321
305
|
readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
|
|
322
306
|
readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
|
|
323
307
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
@@ -483,12 +467,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
483
467
|
readonly nowMillis: number;
|
|
484
468
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
485
469
|
readonly _tag: "Rejected";
|
|
486
|
-
} | {
|
|
487
|
-
readonly _tag: "Cancelled";
|
|
488
470
|
} | {
|
|
489
471
|
readonly _tag: "Ambiguous";
|
|
490
472
|
} | {
|
|
491
|
-
readonly _tag: "
|
|
473
|
+
readonly _tag: "Cancelled";
|
|
492
474
|
} | {
|
|
493
475
|
readonly _tag: "Linked";
|
|
494
476
|
readonly credential: {
|
|
@@ -510,6 +492,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
510
492
|
};
|
|
511
493
|
};
|
|
512
494
|
readonly changed: boolean;
|
|
495
|
+
} | {
|
|
496
|
+
readonly _tag: "Conflict";
|
|
513
497
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
|
|
514
498
|
readonly inspectUnlink: (input: {
|
|
515
499
|
readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
|
|
@@ -667,7 +651,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
667
651
|
}>, R extends AnySQLiteTable<{
|
|
668
652
|
dialect: "sqlite";
|
|
669
653
|
}>, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, TA, I, R, N>) => Effect.Effect<{
|
|
670
|
-
registrationAuthority: OAuthRegistrationAuthority<Registration>;
|
|
654
|
+
registrationAuthority: import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>;
|
|
671
655
|
}, import("@yielded/auth/OAuth").OAuthUnavailable, import("effect/Crypto").Crypto | Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinateOAuthRegistration: {
|
|
672
656
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnySQLiteTable<{
|
|
673
657
|
dialect: "sqlite";
|
|
@@ -685,9 +669,9 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
685
669
|
dialect: "sqlite";
|
|
686
670
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
687
671
|
readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
|
|
688
|
-
readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
|
|
672
|
+
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
|
|
689
673
|
readonly transaction?: never;
|
|
690
|
-
}, 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>>;
|
|
674
|
+
}, 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>>;
|
|
691
675
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnySQLiteTable<{
|
|
692
676
|
dialect: "sqlite";
|
|
693
677
|
}>, O extends AnySQLiteTable<{
|
|
@@ -704,11 +688,11 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
704
688
|
dialect: "sqlite";
|
|
705
689
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
706
690
|
readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
|
|
707
|
-
readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
|
|
691
|
+
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
|
|
708
692
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
709
693
|
readonly transaction: (...args: any[]) => any;
|
|
710
694
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
711
|
-
}, 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>>;
|
|
695
|
+
}, 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>>;
|
|
712
696
|
}, coordinateOAuthSignIn: {
|
|
713
697
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
714
698
|
dialect: "sqlite";
|
|
@@ -723,7 +707,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
723
707
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
724
708
|
readonly mapping: OAuthSignInMapping<S, O, C, AC, F, N>;
|
|
725
709
|
readonly transaction?: never;
|
|
726
|
-
}, 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>>;
|
|
710
|
+
}, 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>>;
|
|
727
711
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
728
712
|
dialect: "sqlite";
|
|
729
713
|
}>, O extends AnySQLiteTable<{
|
|
@@ -739,7 +723,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
739
723
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
740
724
|
readonly transaction: (...args: any[]) => any;
|
|
741
725
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
742
|
-
}, 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>>;
|
|
726
|
+
}, 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>>;
|
|
743
727
|
}, coordinateOAuthRegistrationIntents: {
|
|
744
728
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
745
729
|
dialect: "sqlite";
|
|
@@ -758,7 +742,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
758
742
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
759
743
|
readonly mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, TA, I, N>;
|
|
760
744
|
readonly transaction?: never;
|
|
761
|
-
}, 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>>;
|
|
745
|
+
}, 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>>;
|
|
762
746
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
763
747
|
dialect: "sqlite";
|
|
764
748
|
}>, O extends AnySQLiteTable<{
|
|
@@ -778,7 +762,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
778
762
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
779
763
|
readonly transaction: (...args: any[]) => any;
|
|
780
764
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
781
|
-
}, 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>>;
|
|
765
|
+
}, 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>>;
|
|
782
766
|
}, coordinateOAuthAccounts: {
|
|
783
767
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
784
768
|
dialect: "sqlite";
|
|
@@ -797,7 +781,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
797
781
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
798
782
|
readonly mapping: OAuthAccountsMapping<S, O, C, AC, F, TA, U, N>;
|
|
799
783
|
readonly transaction?: never;
|
|
800
|
-
}, 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>>;
|
|
784
|
+
}, 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>>;
|
|
801
785
|
<Database extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
802
786
|
dialect: "sqlite";
|
|
803
787
|
}>, O extends AnySQLiteTable<{
|
|
@@ -817,7 +801,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
817
801
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
818
802
|
readonly transaction: (...args: any[]) => any;
|
|
819
803
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
820
|
-
}, 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>>;
|
|
804
|
+
}, 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>>;
|
|
821
805
|
}, makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
822
806
|
dialect: "sqlite";
|
|
823
807
|
}>, AC extends AnySQLiteTable<{
|
|
@@ -856,10 +840,12 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
856
840
|
readonly outcome: import("@yielded/auth/OAuth").OAuthSignInAccessOutcome;
|
|
857
841
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
858
842
|
readonly _tag: "Rejected";
|
|
843
|
+
} | {
|
|
844
|
+
readonly _tag: "Ambiguous";
|
|
859
845
|
} | {
|
|
860
846
|
readonly _tag: "Cancelled";
|
|
861
847
|
} | {
|
|
862
|
-
readonly _tag: "
|
|
848
|
+
readonly _tag: "Conflict";
|
|
863
849
|
} | {
|
|
864
850
|
readonly _tag: "Connected";
|
|
865
851
|
readonly grant: {
|
|
@@ -929,8 +915,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
929
915
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
930
916
|
};
|
|
931
917
|
};
|
|
932
|
-
} | {
|
|
933
|
-
readonly _tag: "Conflict";
|
|
934
918
|
} | {
|
|
935
919
|
readonly _tag: "Busy";
|
|
936
920
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
|
|
@@ -1316,10 +1300,12 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1316
1300
|
readonly nowMillis: number;
|
|
1317
1301
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
1318
1302
|
readonly _tag: "Rejected";
|
|
1303
|
+
} | {
|
|
1304
|
+
readonly _tag: "Ambiguous";
|
|
1319
1305
|
} | {
|
|
1320
1306
|
readonly _tag: "Cancelled";
|
|
1321
1307
|
} | {
|
|
1322
|
-
readonly _tag: "
|
|
1308
|
+
readonly _tag: "Conflict";
|
|
1323
1309
|
} | {
|
|
1324
1310
|
readonly _tag: "Connected";
|
|
1325
1311
|
readonly grant: {
|
|
@@ -1389,8 +1375,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1389
1375
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
1390
1376
|
};
|
|
1391
1377
|
};
|
|
1392
|
-
} | {
|
|
1393
|
-
readonly _tag: "Conflict";
|
|
1394
1378
|
} | {
|
|
1395
1379
|
readonly _tag: "Busy";
|
|
1396
1380
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
|
|
@@ -1944,7 +1928,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1944
1928
|
}>, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
1945
1929
|
readonly mapping: OAuthConnectedMapping<S, AC, T, O, F, G, C, H, UA, DC, N, J>;
|
|
1946
1930
|
readonly transaction?: never;
|
|
1947
|
-
}, 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>>;
|
|
1931
|
+
}, 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>>;
|
|
1948
1932
|
<D extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
1949
1933
|
dialect: "sqlite";
|
|
1950
1934
|
}>, AC extends AnySQLiteTable<{
|
|
@@ -1972,7 +1956,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1972
1956
|
readonly transaction: SuppliedService<TxId, NoInfer<D extends {
|
|
1973
1957
|
readonly transaction: (...args: any[]) => any;
|
|
1974
1958
|
} ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
|
|
1975
|
-
}, 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>>;
|
|
1959
|
+
}, 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>>;
|
|
1976
1960
|
}, coordinateOAuthConnectedRevocations: {
|
|
1977
1961
|
<D extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, T extends AnySQLiteTable<{
|
|
1978
1962
|
dialect: "sqlite";
|
|
@@ -1991,7 +1975,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1991
1975
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
1992
1976
|
readonly mapping: OAuthConnectedRevocationMapping<T, O, F, G, C, H, J, N>;
|
|
1993
1977
|
readonly transaction?: never;
|
|
1994
|
-
}, 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>>;
|
|
1978
|
+
}, 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>>;
|
|
1995
1979
|
<D extends DatabaseValue<import("drizzle-orm").TablesRelationalConfig>, T extends AnySQLiteTable<{
|
|
1996
1980
|
dialect: "sqlite";
|
|
1997
1981
|
}>, O extends AnySQLiteTable<{
|
|
@@ -2011,7 +1995,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
2011
1995
|
readonly transaction: SuppliedService<TxId, NoInfer<D extends {
|
|
2012
1996
|
readonly transaction: (...args: any[]) => any;
|
|
2013
1997
|
} ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
|
|
2014
|
-
}, 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>>;
|
|
1998
|
+
}, 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>>;
|
|
2015
1999
|
};
|
|
2016
2000
|
export declare const makePasskeyCredentialServices: <S extends AnySQLiteTable<{
|
|
2017
2001
|
dialect: "sqlite";
|
|
@@ -2359,5 +2343,5 @@ export declare const makePhonePersistenceServices: <S extends AnySQLiteTable<{
|
|
|
2359
2343
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, DatabaseError | PhoneCoordinatorError<E>, DatabaseRequirements | RSetup | import("effect/Crypto").Crypto | import("@yielded/auth/Hooks").LifecycleHooks | Exclude<R, TxId | import("@yielded/auth/PhoneOtp").PhoneAdmission | import("@yielded/auth/PhoneOtp").PhonePersistence | import("@yielded/auth/PhoneOtp").PhoneSignInTargets>>;
|
|
2360
2344
|
};
|
|
2361
2345
|
//#endregion
|
|
2362
|
-
export { type DatabaseValue, type Transaction, makeDatabase, passwordPreparedPersistenceLayer };
|
|
2346
|
+
export { type DatabaseValue, OAuthProxyPersistence, type Transaction, makeDatabase, passwordPreparedPersistenceLayer };
|
|
2363
2347
|
//# sourceMappingURL=SqliteDo.d.mts.map
|
package/dist/SqliteDo.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { sqlClientOAuthStandaloneGuard } from "./drizzle/oauth-target.mjs";
|
|
|
4
4
|
import { sqlClientPasswordStandaloneGuard } from "./drizzle/password-target.mjs";
|
|
5
5
|
import { passwordPreparedPersistenceLayer } from "./drizzle/password-prepared-target.mjs";
|
|
6
6
|
import { sqlClientProofStandaloneGuard } from "./drizzle/proof-target.mjs";
|
|
7
|
+
import { OAuthProxyPersistence } from "./internal/drizzle-sqlite-oauth-proxy.mjs";
|
|
7
8
|
import { nativeDatabase } from "./drizzle/native-database.mjs";
|
|
8
9
|
import { makeTotpTarget, sqlClientTotpStandaloneGuard } from "./drizzle/totp-target.mjs";
|
|
9
10
|
import { sqlClientPasskeyStandaloneGuard } from "./drizzle/passkey-target.mjs";
|
|
@@ -67,6 +68,6 @@ const { makePhonePersistenceServices, coordinatePhonePersistence } = makePhoneTa
|
|
|
67
68
|
standaloneGuard: sqlClientPhoneStandaloneGuard
|
|
68
69
|
});
|
|
69
70
|
//#endregion
|
|
70
|
-
export { Database, commitMode, coordinateAuthenticationAuthority, coordinateEmailAddress, coordinateEmailRegistration, coordinateOAuthAccounts, coordinateOAuthConnected, coordinateOAuthConnectedRevocations, coordinateOAuthRegistration, coordinateOAuthRegistrationIntents, coordinateOAuthSignIn, coordinatePasskeyManagement, coordinatePasskeyPersistence, coordinatePasskeyRegistration, coordinatePasskeyRegistrationCeremony, coordinatePasswordPersistence, coordinatePasswordPreparedPersistence, coordinatePasswordRegistration, coordinatePendingAuthentication, coordinatePhonePersistence, coordinateProofPersistence, coordinateSessionStepUp, coordinateSignedSessionValidity, coordinateStatefulSessions, coordinateTotpPersistence, databaseLayer, makeAuthenticationAuthorityServices, makeDatabase, makeEmailAddressServices, makeEmailRegistrationServices, makeEmailSignInServices, makeExternalIdentityServices, makeIdentityServices, makeOAuthAccountsServices, makeOAuthConnectedRevocationServices, makeOAuthConnectedServices, makeOAuthRegistrationIntentServices, makeOAuthRegistrationServices, makeOAuthSignInServices, makePasskeyCredentialServices, makePasskeyEnrollmentContextServices, makePasskeyManagementServices, makePasskeyPersistenceServices, makePasskeyRegistrationCeremonyServices, makePasskeyRegistrationServices, makePasswordPersistenceServices, makePasswordPreparedPersistenceServices, makePasswordRegistrationServices, makePendingAuthenticationServices, makePhonePersistenceServices, makeProofPersistenceServices, makeSessionStepUpServices, makeSignedSessionValidityServices, makeStatefulSessionServices, makeSubjectProvisioningServices, makeTotpPersistenceServices, passwordPreparedPersistenceLayer };
|
|
71
|
+
export { Database, OAuthProxyPersistence, commitMode, coordinateAuthenticationAuthority, coordinateEmailAddress, coordinateEmailRegistration, coordinateOAuthAccounts, coordinateOAuthConnected, coordinateOAuthConnectedRevocations, coordinateOAuthRegistration, coordinateOAuthRegistrationIntents, coordinateOAuthSignIn, coordinatePasskeyManagement, coordinatePasskeyPersistence, coordinatePasskeyRegistration, coordinatePasskeyRegistrationCeremony, coordinatePasswordPersistence, coordinatePasswordPreparedPersistence, coordinatePasswordRegistration, coordinatePendingAuthentication, coordinatePhonePersistence, coordinateProofPersistence, coordinateSessionStepUp, coordinateSignedSessionValidity, coordinateStatefulSessions, coordinateTotpPersistence, databaseLayer, makeAuthenticationAuthorityServices, makeDatabase, makeEmailAddressServices, makeEmailRegistrationServices, makeEmailSignInServices, makeExternalIdentityServices, makeIdentityServices, makeOAuthAccountsServices, makeOAuthConnectedRevocationServices, makeOAuthConnectedServices, makeOAuthRegistrationIntentServices, makeOAuthRegistrationServices, makeOAuthSignInServices, makePasskeyCredentialServices, makePasskeyEnrollmentContextServices, makePasskeyManagementServices, makePasskeyPersistenceServices, makePasskeyRegistrationCeremonyServices, makePasskeyRegistrationServices, makePasswordPersistenceServices, makePasswordPreparedPersistenceServices, makePasswordRegistrationServices, makePendingAuthenticationServices, makePhonePersistenceServices, makeProofPersistenceServices, makeSessionStepUpServices, makeSignedSessionValidityServices, makeStatefulSessionServices, makeSubjectProvisioningServices, makeTotpPersistenceServices, passwordPreparedPersistenceLayer };
|
|
71
72
|
|
|
72
73
|
//# sourceMappingURL=SqliteDo.mjs.map
|
package/dist/SqliteDo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteDo.mjs","names":[],"sources":["../src/SqliteDo.ts"],"sourcesContent":["import { SqliteClient } from \"@effect/sql-sqlite-do/SqliteClient\";\nimport { NativeDatabase, PersistenceConfigurationError } from \"@yielded/auth-persistence/Adapter\";\nimport type { AnyRelations } from \"drizzle-orm\";\nimport { makeWithDefaults } from \"drizzle-orm/effect-sqlite-do\";\n\nimport { type DatabaseValue, makeDatabase } from \"./drizzle/sqlite-do-database\";\nexport { type DatabaseValue, type Transaction, makeDatabase } from \"./drizzle/sqlite-do-database\";\nimport type { AnySQLiteTable } from \"drizzle-orm/sqlite-core\";\nimport { Context, Effect, Layer } from \"effect\";\n\nimport { nativeDatabase } from \"./drizzle/native-database\";\n\n/** The application-owned Drizzle queries with Effect SQL transaction ownership. */\nexport class Database extends Context.Service<Database, DatabaseValue<AnyRelations>>()(\n \"effect-auth/persistence-drizzle/SqliteDo/Database\",\n) {}\n\n/** Construct Drizzle with asynchronous transactions owned by Effect SQL. */\nexport const databaseLayer = Layer.effect(\n Database,\n Effect.gen(function* () {\n const client = yield* SqliteClient;\n const storage = client.config.storage;\n\n if (storage === undefined)\n return yield* PersistenceConfigurationError.make({\n reason: \"SqliteDo requires a SQL client configured with Durable Object storage\",\n });\n\n return yield* makeDatabase(yield* makeWithDefaults({ storage }));\n }),\n);\n\nimport { sqlClientEmailStandaloneGuard } from \"./drizzle/email-target\";\nimport type {\n ExternalIdentityTables,\n IdentityTables,\n SubjectProvisioningTables,\n} from \"./drizzle/model\";\nimport { sqlClientPasswordStandaloneGuard } from \"./drizzle/password-target\";\nimport { sqlClientProofStandaloneGuard } from \"./drizzle/proof-target\";\nimport { sqlClientSessionStandaloneGuard } from \"./drizzle/session-target\";\nimport { makeSqliteEmailTarget, sqliteEmailConfiguration } from \"./drizzle/sqlite-emails\";\nimport {\n makeSqliteExternalIdentityServices,\n makeSqliteIdentityServices,\n makeSqliteSubjectProvisioningServices,\n} from \"./drizzle/sqlite-identity\";\nimport { makeSqlitePasswordTarget, sqlitePasswordConfiguration } from \"./drizzle/sqlite-passwords\";\nimport { makeSqliteProofTarget, sqliteProofConfiguration } from \"./drizzle/sqlite-proofs\";\nimport { makeSqliteSessionTarget, sqliteSessionConfiguration } from \"./drizzle/sqlite-sessions\";\n\nconst sessionTarget = makeSqliteSessionTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) => sqliteSessionConfiguration(\"interactive\", sqlClientSessionStandaloneGuard(service)),\n);\n\nconst proofTarget = makeSqliteProofTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) => sqliteProofConfiguration(\"interactive\", sqlClientProofStandaloneGuard(service)),\n);\n\nconst passwordTarget = makeSqlitePasswordTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nconst emailTarget = makeSqliteEmailTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) =>\n sqliteEmailConfiguration(\n \"interactive\",\n sqlClientEmailStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nexport const {\n coordinateEmailAddress,\n coordinateEmailRegistration,\n makeEmailAddressServices,\n makeEmailRegistrationServices,\n makeEmailSignInServices,\n} = emailTarget;\n\nexport const {\n coordinatePasswordPersistence,\n coordinatePasswordRegistration,\n makePasswordPersistenceServices,\n makePasswordRegistrationServices,\n} = passwordTarget;\n\nexport const { coordinateProofPersistence, makeProofPersistenceServices } = proofTarget;\n\nexport const {\n coordinateAuthenticationAuthority,\n coordinatePendingAuthentication,\n coordinateSignedSessionValidity,\n coordinateStatefulSessions,\n makeAuthenticationAuthorityServices,\n makePendingAuthenticationServices,\n makeSessionStepUpServices,\n coordinateSessionStepUp,\n makeSignedSessionValidityServices,\n makeStatefulSessionServices,\n} = sessionTarget;\n\nexport const commitMode = \"interactive\" as const;\n\nexport const makeIdentityServices = <\n Subject extends AnySQLiteTable,\n Identifier extends AnySQLiteTable,\n External extends AnySQLiteTable,\n Request extends AnySQLiteTable,\n NativeId,\n>(\n mapping: IdentityTables<Subject, Identifier, External, Request, NativeId>,\n) =>\n makeSqliteIdentityServices(mapping, \"interactive\").pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nexport const makeSubjectProvisioningServices = <\n Subject extends AnySQLiteTable,\n Identifier extends AnySQLiteTable,\n Request extends AnySQLiteTable,\n NativeId,\n>(\n mapping: SubjectProvisioningTables<Subject, Identifier, Request, NativeId>,\n) =>\n makeSqliteSubjectProvisioningServices(mapping, \"interactive\").pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nexport const makeExternalIdentityServices = <\n Subject extends AnySQLiteTable,\n External extends AnySQLiteTable,\n NativeId,\n>(\n mapping: ExternalIdentityTables<Subject, External, NativeId>,\n) =>\n makeSqliteExternalIdentityServices(mapping).pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nimport { makeSqlitePasswordPreparedTarget } from \"./drizzle/sqlite-password-prepared\";\n\nconst passwordPreparedTarget = makeSqlitePasswordPreparedTarget<\n Database,\n DatabaseValue<AnyRelations>\n>(Database, (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nexport const { makePasswordPreparedPersistenceServices, coordinatePasswordPreparedPersistence } =\n passwordPreparedTarget;\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\n standaloneGuard: sqlClientPhoneStandaloneGuard,\n});\n\nexport const { makePhonePersistenceServices, coordinatePhonePersistence } = phoneTarget;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,WAAb,cAA8B,QAAQ,QAA+C,CAAC,CACpF,mDACF,CAAC,CAAC,CAAC;;AAGH,MAAa,gBAAgB,MAAM,OACjC,UACA,OAAO,IAAI,aAAa;CAEtB,MAAM,WAAU,OADM,aAAA,CACC,OAAO;CAE9B,IAAI,YAAY,KAAA,GACd,OAAO,OAAO,8BAA8B,KAAK,EAC/C,QAAQ,wEACV,CAAC;CAEH,OAAO,OAAO,aAAa,OAAO,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC,CACH;AAqBA,MAAM,gBAAgB,wBACpB,WACC,YAAY,2BAA2B,eAAe,gCAAgC,OAAO,CAAC,CACjG;AAEA,MAAM,cAAc,sBAClB,WACC,YAAY,yBAAyB,eAAe,8BAA8B,OAAO,CAAC,CAC7F;AAEA,MAAM,iBAAiB,yBACrB,WACC,YACC,4BACE,eACA,iCAAiC,OAAO,GACxC,8BAA8B,OAAO,CACvC,CACJ;AAYA,MAAa,EACX,wBACA,6BACA,0BACA,+BACA,4BAfkB,sBAClB,WACC,YACC,yBACE,eACA,8BAA8B,OAAO,GACrC,8BAA8B,OAAO,CACvC,CASA;AAEJ,MAAa,EACX,+BACA,gCACA,iCACA,qCACE;AAEJ,MAAa,EAAE,4BAA4B,iCAAiC;AAE5E,MAAa,EACX,mCACA,iCACA,iCACA,4BACA,qCACA,mCACA,2BACA,yBACA,mCACA,gCACE;AAEJ,MAAa,aAAa;AAE1B,MAAa,wBAOX,YAEA,2BAA2B,SAAS,aAAa,CAAC,CAAC,KACjD,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAEF,MAAa,mCAMX,YAEA,sCAAsC,SAAS,aAAa,CAAC,CAAC,KAC5D,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAEF,MAAa,gCAKX,YAEA,mCAAmC,OAAO,CAAC,CAAC,KAC1C,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAeF,MAAa,EAAE,yCAAyC,0CAXzB,iCAG7B,WAAW,YACX,4BACE,eACA,iCAAiC,OAAO,GACxC,8BAA8B,OAAO,CACvC,CAIA;AAkBF,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"}
|
|
1
|
+
{"version":3,"file":"SqliteDo.mjs","names":[],"sources":["../src/SqliteDo.ts"],"sourcesContent":["export { OAuthProxyPersistence } from \"./internal/drizzle-sqlite-oauth-proxy\";\n\nimport { SqliteClient } from \"@effect/sql-sqlite-do/SqliteClient\";\nimport { NativeDatabase, PersistenceConfigurationError } from \"@yielded/auth-persistence/Adapter\";\nimport type { AnyRelations } from \"drizzle-orm\";\nimport { makeWithDefaults } from \"drizzle-orm/effect-sqlite-do\";\n\nimport { type DatabaseValue, makeDatabase } from \"./drizzle/sqlite-do-database\";\nexport { type DatabaseValue, type Transaction, makeDatabase } from \"./drizzle/sqlite-do-database\";\nimport type { AnySQLiteTable } from \"drizzle-orm/sqlite-core\";\nimport { Context, Effect, Layer } from \"effect\";\n\nimport { nativeDatabase } from \"./drizzle/native-database\";\n\n/** The application-owned Drizzle queries with Effect SQL transaction ownership. */\nexport class Database extends Context.Service<Database, DatabaseValue<AnyRelations>>()(\n \"effect-auth/persistence-drizzle/SqliteDo/Database\",\n) {}\n\n/** Construct Drizzle with asynchronous transactions owned by Effect SQL. */\nexport const databaseLayer = Layer.effect(\n Database,\n Effect.gen(function* () {\n const client = yield* SqliteClient;\n const storage = client.config.storage;\n\n if (storage === undefined)\n return yield* PersistenceConfigurationError.make({\n reason: \"SqliteDo requires a SQL client configured with Durable Object storage\",\n });\n\n return yield* makeDatabase(yield* makeWithDefaults({ storage }));\n }),\n);\n\nimport { sqlClientEmailStandaloneGuard } from \"./drizzle/email-target\";\nimport type {\n ExternalIdentityTables,\n IdentityTables,\n SubjectProvisioningTables,\n} from \"./drizzle/model\";\nimport { sqlClientPasswordStandaloneGuard } from \"./drizzle/password-target\";\nimport { sqlClientProofStandaloneGuard } from \"./drizzle/proof-target\";\nimport { sqlClientSessionStandaloneGuard } from \"./drizzle/session-target\";\nimport { makeSqliteEmailTarget, sqliteEmailConfiguration } from \"./drizzle/sqlite-emails\";\nimport {\n makeSqliteExternalIdentityServices,\n makeSqliteIdentityServices,\n makeSqliteSubjectProvisioningServices,\n} from \"./drizzle/sqlite-identity\";\nimport { makeSqlitePasswordTarget, sqlitePasswordConfiguration } from \"./drizzle/sqlite-passwords\";\nimport { makeSqliteProofTarget, sqliteProofConfiguration } from \"./drizzle/sqlite-proofs\";\nimport { makeSqliteSessionTarget, sqliteSessionConfiguration } from \"./drizzle/sqlite-sessions\";\n\nconst sessionTarget = makeSqliteSessionTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) => sqliteSessionConfiguration(\"interactive\", sqlClientSessionStandaloneGuard(service)),\n);\n\nconst proofTarget = makeSqliteProofTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) => sqliteProofConfiguration(\"interactive\", sqlClientProofStandaloneGuard(service)),\n);\n\nconst passwordTarget = makeSqlitePasswordTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nconst emailTarget = makeSqliteEmailTarget<Database, DatabaseValue<AnyRelations>>(\n Database,\n (service) =>\n sqliteEmailConfiguration(\n \"interactive\",\n sqlClientEmailStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nexport const {\n coordinateEmailAddress,\n coordinateEmailRegistration,\n makeEmailAddressServices,\n makeEmailRegistrationServices,\n makeEmailSignInServices,\n} = emailTarget;\n\nexport const {\n coordinatePasswordPersistence,\n coordinatePasswordRegistration,\n makePasswordPersistenceServices,\n makePasswordRegistrationServices,\n} = passwordTarget;\n\nexport const { coordinateProofPersistence, makeProofPersistenceServices } = proofTarget;\n\nexport const {\n coordinateAuthenticationAuthority,\n coordinatePendingAuthentication,\n coordinateSignedSessionValidity,\n coordinateStatefulSessions,\n makeAuthenticationAuthorityServices,\n makePendingAuthenticationServices,\n makeSessionStepUpServices,\n coordinateSessionStepUp,\n makeSignedSessionValidityServices,\n makeStatefulSessionServices,\n} = sessionTarget;\n\nexport const commitMode = \"interactive\" as const;\n\nexport const makeIdentityServices = <\n Subject extends AnySQLiteTable,\n Identifier extends AnySQLiteTable,\n External extends AnySQLiteTable,\n Request extends AnySQLiteTable,\n NativeId,\n>(\n mapping: IdentityTables<Subject, Identifier, External, Request, NativeId>,\n) =>\n makeSqliteIdentityServices(mapping, \"interactive\").pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nexport const makeSubjectProvisioningServices = <\n Subject extends AnySQLiteTable,\n Identifier extends AnySQLiteTable,\n Request extends AnySQLiteTable,\n NativeId,\n>(\n mapping: SubjectProvisioningTables<Subject, Identifier, Request, NativeId>,\n) =>\n makeSqliteSubjectProvisioningServices(mapping, \"interactive\").pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nexport const makeExternalIdentityServices = <\n Subject extends AnySQLiteTable,\n External extends AnySQLiteTable,\n NativeId,\n>(\n mapping: ExternalIdentityTables<Subject, External, NativeId>,\n) =>\n makeSqliteExternalIdentityServices(mapping).pipe(\n Effect.provideServiceEffect(NativeDatabase, nativeDatabase(Database)),\n );\n\nimport { makeSqlitePasswordPreparedTarget } from \"./drizzle/sqlite-password-prepared\";\n\nconst passwordPreparedTarget = makeSqlitePasswordPreparedTarget<\n Database,\n DatabaseValue<AnyRelations>\n>(Database, (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nexport const { makePasswordPreparedPersistenceServices, coordinatePasswordPreparedPersistence } =\n passwordPreparedTarget;\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\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 DatabaseValue<AnyRelations>,\n AnySQLiteTable<{ dialect: \"sqlite\" }>\n>(Database, {\n mode: \"interactive\",\n dialect: \"sqlite\",\n locking: false,\n standaloneGuard: sqlClientPhoneStandaloneGuard,\n});\n\nexport const { makePhonePersistenceServices, coordinatePhonePersistence } = phoneTarget;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAa,WAAb,cAA8B,QAAQ,QAA+C,CAAC,CACpF,mDACF,CAAC,CAAC,CAAC;;AAGH,MAAa,gBAAgB,MAAM,OACjC,UACA,OAAO,IAAI,aAAa;CAEtB,MAAM,WAAU,OADM,aAAA,CACC,OAAO;CAE9B,IAAI,YAAY,KAAA,GACd,OAAO,OAAO,8BAA8B,KAAK,EAC/C,QAAQ,wEACV,CAAC;CAEH,OAAO,OAAO,aAAa,OAAO,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACjE,CAAC,CACH;AAqBA,MAAM,gBAAgB,wBACpB,WACC,YAAY,2BAA2B,eAAe,gCAAgC,OAAO,CAAC,CACjG;AAEA,MAAM,cAAc,sBAClB,WACC,YAAY,yBAAyB,eAAe,8BAA8B,OAAO,CAAC,CAC7F;AAEA,MAAM,iBAAiB,yBACrB,WACC,YACC,4BACE,eACA,iCAAiC,OAAO,GACxC,8BAA8B,OAAO,CACvC,CACJ;AAYA,MAAa,EACX,wBACA,6BACA,0BACA,+BACA,4BAfkB,sBAClB,WACC,YACC,yBACE,eACA,8BAA8B,OAAO,GACrC,8BAA8B,OAAO,CACvC,CASA;AAEJ,MAAa,EACX,+BACA,gCACA,iCACA,qCACE;AAEJ,MAAa,EAAE,4BAA4B,iCAAiC;AAE5E,MAAa,EACX,mCACA,iCACA,iCACA,4BACA,qCACA,mCACA,2BACA,yBACA,mCACA,gCACE;AAEJ,MAAa,aAAa;AAE1B,MAAa,wBAOX,YAEA,2BAA2B,SAAS,aAAa,CAAC,CAAC,KACjD,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAEF,MAAa,mCAMX,YAEA,sCAAsC,SAAS,aAAa,CAAC,CAAC,KAC5D,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAEF,MAAa,gCAKX,YAEA,mCAAmC,OAAO,CAAC,CAAC,KAC1C,OAAO,qBAAqB,gBAAgB,eAAe,QAAQ,CAAC,CACtE;AAeF,MAAa,EAAE,yCAAyC,0CAXzB,iCAG7B,WAAW,YACX,4BACE,eACA,iCAAiC,OAAO,GACxC,8BAA8B,OAAO,CACvC,CAIA;AAkBF,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"}
|