@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/SqliteWasm.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";
|
|
@@ -84,13 +84,13 @@ export declare const coordinateEmailAddress: {
|
|
|
84
84
|
};
|
|
85
85
|
}, import("@yielded/auth/Email").EmailUnavailable, Database>;
|
|
86
86
|
export declare const coordinatePasswordPersistence: {
|
|
87
|
-
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
88
|
-
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<
|
|
87
|
+
<Database extends EffectSQLiteWasmDatabase<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: {
|
|
88
|
+
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
|
|
89
89
|
readonly proofMapping?: PM;
|
|
90
90
|
readonly transaction?: never;
|
|
91
91
|
}, 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>>;
|
|
92
|
-
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
93
|
-
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<
|
|
92
|
+
<Database extends EffectSQLiteWasmDatabase<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: {
|
|
93
|
+
readonly mapping: import("@yielded/auth-persistence/Adapter").PasswordPersistenceMapping<DrizzleTableModel<S>, DrizzleTableModel<I>, DrizzleTableModel<C>, DrizzleTableModel<AC>, DrizzleTableModel<M>, NativeId, import("drizzle-orm").SQL<unknown>>;
|
|
94
94
|
readonly proofMapping?: PM;
|
|
95
95
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
96
96
|
}, 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>>;
|
|
@@ -105,26 +105,17 @@ export declare const coordinatePasswordPersistence: {
|
|
|
105
105
|
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>>;
|
|
106
106
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
107
107
|
}, 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>>;
|
|
108
|
-
}, makePasswordPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
108
|
+
}, 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<{
|
|
109
109
|
passwordPersistence: {
|
|
110
|
-
readonly
|
|
110
|
+
readonly findCredential: (input: {
|
|
111
111
|
readonly moduleId: string;
|
|
112
|
-
readonly action: "sign-in" | "change";
|
|
113
112
|
readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
|
|
114
113
|
readonly subjectId?: import("@yielded/auth/Schema").SubjectId;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
readonly
|
|
119
|
-
|
|
120
|
-
readonly captured?: import("@yielded/auth/Password").PasswordCredentialSnapshot;
|
|
121
|
-
readonly outcome: import("@yielded/auth/Password").PasswordAttemptDecision;
|
|
122
|
-
readonly rehash?: {
|
|
123
|
-
readonly expectedVersion: import("@yielded/auth/Sessions").SecurityRevision;
|
|
124
|
-
readonly expectedVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
125
|
-
readonly nextVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
126
|
-
};
|
|
127
|
-
}, 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>;
|
|
114
|
+
}) => Effect.Effect<import("effect/Option").Option<import("@yielded/auth/Password").PasswordCredentialSnapshot>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
115
|
+
readonly rehashIfCurrent: (input: {
|
|
116
|
+
readonly credential: import("@yielded/auth/Password").PasswordCredentialSnapshot;
|
|
117
|
+
readonly nextVerifier: import("effect/Redacted").Redacted<import("@yielded/auth/Password").EncodedPasswordHash>;
|
|
118
|
+
}) => Effect.Effect<void, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
128
119
|
readonly readForSubject: (input: {
|
|
129
120
|
readonly moduleId: string;
|
|
130
121
|
readonly subjectId: import("@yielded/auth/Schema").SubjectId;
|
|
@@ -133,19 +124,12 @@ export declare const coordinatePasswordPersistence: {
|
|
|
133
124
|
readonly moduleId: string;
|
|
134
125
|
readonly identifier: import("@yielded/auth/Identity").LoginIdentifier;
|
|
135
126
|
}) => Effect.Effect<import("effect/Option").Option<import("@yielded/auth/Password").PasswordCredentialSnapshot>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
136
|
-
readonly addIfAbsent: <
|
|
137
|
-
readonly replaceIfCurrent: <
|
|
127
|
+
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>;
|
|
128
|
+
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>;
|
|
138
129
|
readonly checkReset: (input: import("@yielded/auth/Proofs").ProofCompletionInput) => Effect.Effect<boolean, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
139
|
-
readonly resetWithProof: <
|
|
130
|
+
readonly resetWithProof: <A>(input: import("@yielded/auth/Password").PasswordMutationInput & {
|
|
140
131
|
readonly completion: import("@yielded/auth/Proofs").ProofCompletionPlan;
|
|
141
|
-
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<import("@yielded/auth/Password").PasswordMutationDecision,
|
|
142
|
-
readonly cleanupAttempts: <A_1>(input: {
|
|
143
|
-
readonly moduleId: string;
|
|
144
|
-
readonly limit: number;
|
|
145
|
-
}, prepare: import("@yielded/auth/Password").PreparePasswordCommit<{
|
|
146
|
-
readonly removed: number;
|
|
147
|
-
readonly hasMore: boolean;
|
|
148
|
-
}, A_1>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A_1>, import("@yielded/auth/Password").PasswordUnavailable>;
|
|
132
|
+
}, 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>;
|
|
149
133
|
};
|
|
150
134
|
}, 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<{
|
|
151
135
|
registrationAuthority: import("@yielded/auth-persistence/Adapter").PasswordRegistrationAuthority<Registration>;
|
|
@@ -256,7 +240,7 @@ export declare const coordinateAuthenticationAuthority: {
|
|
|
256
240
|
}, 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>>;
|
|
257
241
|
}, 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<{
|
|
258
242
|
authenticationAuthority: {
|
|
259
|
-
readonly capture: (subjectId: import("@yielded/auth/Schema").SubjectId, credentialIds: ReadonlyArray<string>) => Effect.Effect<import("@yielded/auth/Sessions").
|
|
243
|
+
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>;
|
|
260
244
|
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>;
|
|
261
245
|
readonly approve: <A>(input: {
|
|
262
246
|
readonly evidence: import("@yielded/auth/Sessions").AuthenticationEvidence;
|
|
@@ -306,17 +290,17 @@ export declare const makeExternalIdentityServices: <Subject extends AnySQLiteTab
|
|
|
306
290
|
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>;
|
|
307
291
|
};
|
|
308
292
|
}, import("@yielded/auth/Identity").IdentityUnavailable, Database>;
|
|
309
|
-
export declare const makePasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
293
|
+
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<{
|
|
310
294
|
passwordPreparedPersistence: import("@yielded/auth/Password").PasswordPreparedPersistence;
|
|
311
295
|
}, import("@yielded/auth/Password").PasswordUnavailable, Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinatePasswordPreparedPersistence: {
|
|
312
|
-
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
313
|
-
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC,
|
|
296
|
+
<Database extends EffectSQLiteWasmDatabase<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: {
|
|
297
|
+
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
|
|
314
298
|
readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
|
|
315
299
|
readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
|
|
316
300
|
readonly transaction?: never;
|
|
317
301
|
}, 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>>;
|
|
318
|
-
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
319
|
-
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC,
|
|
302
|
+
<Database extends EffectSQLiteWasmDatabase<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: {
|
|
303
|
+
readonly mapping: PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
|
|
320
304
|
readonly proofMapping?: PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
|
|
321
305
|
readonly target: SuppliedService<TargetId, import("@yielded/auth/Password").PasswordPreparedPersistence>;
|
|
322
306
|
readonly transaction: SuppliedService<TxId, NoInfer<Parameters<Parameters<Database["transaction"]>[0]>[0]>, TxShape>;
|
|
@@ -482,12 +466,10 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
482
466
|
readonly nowMillis: number;
|
|
483
467
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
484
468
|
readonly _tag: "Rejected";
|
|
485
|
-
} | {
|
|
486
|
-
readonly _tag: "Cancelled";
|
|
487
469
|
} | {
|
|
488
470
|
readonly _tag: "Ambiguous";
|
|
489
471
|
} | {
|
|
490
|
-
readonly _tag: "
|
|
472
|
+
readonly _tag: "Cancelled";
|
|
491
473
|
} | {
|
|
492
474
|
readonly _tag: "Linked";
|
|
493
475
|
readonly credential: {
|
|
@@ -509,6 +491,8 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
509
491
|
};
|
|
510
492
|
};
|
|
511
493
|
readonly changed: boolean;
|
|
494
|
+
} | {
|
|
495
|
+
readonly _tag: "Conflict";
|
|
512
496
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable>;
|
|
513
497
|
readonly inspectUnlink: (input: {
|
|
514
498
|
readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
|
|
@@ -666,7 +650,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
666
650
|
}>, R extends AnySQLiteTable<{
|
|
667
651
|
dialect: "sqlite";
|
|
668
652
|
}>, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, TA, I, R, N>) => Effect.Effect<{
|
|
669
|
-
registrationAuthority: OAuthRegistrationAuthority<Registration>;
|
|
653
|
+
registrationAuthority: import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>;
|
|
670
654
|
}, import("@yielded/auth/OAuth").OAuthUnavailable, import("effect/Crypto").Crypto | Database | import("@yielded/auth/Hooks").LifecycleHooks>, coordinateOAuthRegistration: {
|
|
671
655
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnySQLiteTable<{
|
|
672
656
|
dialect: "sqlite";
|
|
@@ -684,9 +668,9 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
684
668
|
dialect: "sqlite";
|
|
685
669
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
686
670
|
readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
|
|
687
|
-
readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
|
|
671
|
+
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
|
|
688
672
|
readonly transaction?: never;
|
|
689
|
-
}, 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>>;
|
|
673
|
+
}, 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>>;
|
|
690
674
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, TargetId, Registration, S extends AnySQLiteTable<{
|
|
691
675
|
dialect: "sqlite";
|
|
692
676
|
}>, O extends AnySQLiteTable<{
|
|
@@ -703,11 +687,11 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
703
687
|
dialect: "sqlite";
|
|
704
688
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements, TxId, TxShape>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
705
689
|
readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, TA, I, Rq, N>;
|
|
706
|
-
readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
|
|
690
|
+
readonly target: SuppliedService<TargetId, import("@yielded/auth-persistence/Adapter").OAuthRegistrationAuthority<Registration>>;
|
|
707
691
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
708
692
|
readonly transaction: (...args: any[]) => any;
|
|
709
693
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
710
|
-
}, 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>>;
|
|
694
|
+
}, 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>>;
|
|
711
695
|
}, coordinateOAuthSignIn: {
|
|
712
696
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
713
697
|
dialect: "sqlite";
|
|
@@ -722,7 +706,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
722
706
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
723
707
|
readonly mapping: OAuthSignInMapping<S, O, C, AC, F, N>;
|
|
724
708
|
readonly transaction?: never;
|
|
725
|
-
}, 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>>;
|
|
709
|
+
}, 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>>;
|
|
726
710
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
727
711
|
dialect: "sqlite";
|
|
728
712
|
}>, O extends AnySQLiteTable<{
|
|
@@ -738,7 +722,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
738
722
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
739
723
|
readonly transaction: (...args: any[]) => any;
|
|
740
724
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
741
|
-
}, 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>>;
|
|
725
|
+
}, 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>>;
|
|
742
726
|
}, coordinateOAuthRegistrationIntents: {
|
|
743
727
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
744
728
|
dialect: "sqlite";
|
|
@@ -757,7 +741,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
757
741
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
758
742
|
readonly mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, TA, I, N>;
|
|
759
743
|
readonly transaction?: never;
|
|
760
|
-
}, 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>>;
|
|
744
|
+
}, 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>>;
|
|
761
745
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
762
746
|
dialect: "sqlite";
|
|
763
747
|
}>, O extends AnySQLiteTable<{
|
|
@@ -777,7 +761,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
777
761
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
778
762
|
readonly transaction: (...args: any[]) => any;
|
|
779
763
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
780
|
-
}, 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>>;
|
|
764
|
+
}, 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>>;
|
|
781
765
|
}, coordinateOAuthAccounts: {
|
|
782
766
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
783
767
|
dialect: "sqlite";
|
|
@@ -796,7 +780,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
796
780
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
797
781
|
readonly mapping: OAuthAccountsMapping<S, O, C, AC, F, TA, U, N>;
|
|
798
782
|
readonly transaction?: never;
|
|
799
|
-
}, 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>>;
|
|
783
|
+
}, 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>>;
|
|
800
784
|
<Database extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
801
785
|
dialect: "sqlite";
|
|
802
786
|
}>, O extends AnySQLiteTable<{
|
|
@@ -816,7 +800,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
816
800
|
readonly transaction: SuppliedService<TxId, NoInfer<Database extends {
|
|
817
801
|
readonly transaction: (...args: any[]) => any;
|
|
818
802
|
} ? Parameters<Parameters<Database["transaction"]>[0]>[0] : never>, TxShape>;
|
|
819
|
-
}, 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>>;
|
|
803
|
+
}, 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>>;
|
|
820
804
|
}, makeOAuthConnectedServices: <S extends AnySQLiteTable<{
|
|
821
805
|
dialect: "sqlite";
|
|
822
806
|
}>, AC extends AnySQLiteTable<{
|
|
@@ -855,10 +839,12 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
855
839
|
readonly outcome: import("@yielded/auth/OAuth").OAuthSignInAccessOutcome;
|
|
856
840
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
857
841
|
readonly _tag: "Rejected";
|
|
842
|
+
} | {
|
|
843
|
+
readonly _tag: "Ambiguous";
|
|
858
844
|
} | {
|
|
859
845
|
readonly _tag: "Cancelled";
|
|
860
846
|
} | {
|
|
861
|
-
readonly _tag: "
|
|
847
|
+
readonly _tag: "Conflict";
|
|
862
848
|
} | {
|
|
863
849
|
readonly _tag: "Connected";
|
|
864
850
|
readonly grant: {
|
|
@@ -928,8 +914,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
928
914
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
929
915
|
};
|
|
930
916
|
};
|
|
931
|
-
} | {
|
|
932
|
-
readonly _tag: "Conflict";
|
|
933
917
|
} | {
|
|
934
918
|
readonly _tag: "Busy";
|
|
935
919
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
|
|
@@ -1315,10 +1299,12 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1315
1299
|
readonly nowMillis: number;
|
|
1316
1300
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
1317
1301
|
readonly _tag: "Rejected";
|
|
1302
|
+
} | {
|
|
1303
|
+
readonly _tag: "Ambiguous";
|
|
1318
1304
|
} | {
|
|
1319
1305
|
readonly _tag: "Cancelled";
|
|
1320
1306
|
} | {
|
|
1321
|
-
readonly _tag: "
|
|
1307
|
+
readonly _tag: "Conflict";
|
|
1322
1308
|
} | {
|
|
1323
1309
|
readonly _tag: "Connected";
|
|
1324
1310
|
readonly grant: {
|
|
@@ -1388,8 +1374,6 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1388
1374
|
readonly ciphertext: import("effect/Redacted").Redacted<string>;
|
|
1389
1375
|
};
|
|
1390
1376
|
};
|
|
1391
|
-
} | {
|
|
1392
|
-
readonly _tag: "Conflict";
|
|
1393
1377
|
} | {
|
|
1394
1378
|
readonly _tag: "Busy";
|
|
1395
1379
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, import("@yielded/auth/OAuth").OAuthUnavailable, never>;
|
|
@@ -1943,7 +1927,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1943
1927
|
}>, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
1944
1928
|
readonly mapping: OAuthConnectedMapping<S, AC, T, O, F, G, C, H, UA, DC, N, J>;
|
|
1945
1929
|
readonly transaction?: never;
|
|
1946
|
-
}, 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>>;
|
|
1930
|
+
}, 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>>;
|
|
1947
1931
|
<D extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, S extends AnySQLiteTable<{
|
|
1948
1932
|
dialect: "sqlite";
|
|
1949
1933
|
}>, AC extends AnySQLiteTable<{
|
|
@@ -1971,7 +1955,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1971
1955
|
readonly transaction: SuppliedService<TxId, NoInfer<D extends {
|
|
1972
1956
|
readonly transaction: (...args: any[]) => any;
|
|
1973
1957
|
} ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
|
|
1974
|
-
}, 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>>;
|
|
1958
|
+
}, 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>>;
|
|
1975
1959
|
}, coordinateOAuthConnectedRevocations: {
|
|
1976
1960
|
<D extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, T extends AnySQLiteTable<{
|
|
1977
1961
|
dialect: "sqlite";
|
|
@@ -1990,7 +1974,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
1990
1974
|
}>, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<D, DatabaseError, DatabaseRequirements>, options: {
|
|
1991
1975
|
readonly mapping: OAuthConnectedRevocationMapping<T, O, F, G, C, H, J, N>;
|
|
1992
1976
|
readonly transaction?: never;
|
|
1993
|
-
}, 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>>;
|
|
1977
|
+
}, 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>>;
|
|
1994
1978
|
<D extends EffectSQLiteWasmDatabase<import("drizzle-orm").TablesRelationalConfig>, T extends AnySQLiteTable<{
|
|
1995
1979
|
dialect: "sqlite";
|
|
1996
1980
|
}>, O extends AnySQLiteTable<{
|
|
@@ -2010,7 +1994,7 @@ export declare const makeOAuthAccountsServices: <S extends AnySQLiteTable<{
|
|
|
2010
1994
|
readonly transaction: SuppliedService<TxId, NoInfer<D extends {
|
|
2011
1995
|
readonly transaction: (...args: any[]) => any;
|
|
2012
1996
|
} ? Parameters<Parameters<D["transaction"]>[0]>[0] : never>, TxShape>;
|
|
2013
|
-
}, 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>>;
|
|
1997
|
+
}, 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>>;
|
|
2014
1998
|
};
|
|
2015
1999
|
export declare const makePasskeyCredentialServices: <S extends AnySQLiteTable<{
|
|
2016
2000
|
dialect: "sqlite";
|
|
@@ -2365,5 +2349,5 @@ export declare const AuthPersistence: {
|
|
|
2365
2349
|
}) => Layer.Layer<never, import("drizzle-orm/effect-core").EffectDrizzleQueryError | import("drizzle-orm/effect-core").MigratorInitError | import("@yielded/auth-persistence/Adapter").PersistenceConfigurationError | import("effect/sql/SqlError").SqlError, import("@effect/sql-sqlite-wasm/SqliteClient").SqliteClient>;
|
|
2366
2350
|
};
|
|
2367
2351
|
//#endregion
|
|
2368
|
-
export { passwordPreparedPersistenceLayer };
|
|
2352
|
+
export { OAuthProxyPersistence, passwordPreparedPersistenceLayer };
|
|
2369
2353
|
//# sourceMappingURL=SqliteWasm.d.mts.map
|
package/dist/SqliteWasm.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 AuthPersistence = {
|
|
|
67
68
|
migrationsLayer: (options) => drizzleMigrationsLayer(makeWithDefaults({}), Effect.promise(() => import("drizzle-orm/effect-sqlite-wasm/migrator")).pipe(Effect.map((module) => module.migrate)))(options)
|
|
68
69
|
};
|
|
69
70
|
//#endregion
|
|
70
|
-
export { AuthPersistence, 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, 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 { AuthPersistence, 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, 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=SqliteWasm.mjs.map
|
package/dist/SqliteWasm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqliteWasm.mjs","names":[],"sources":["../src/SqliteWasm.ts"],"sourcesContent":["import { NativeDatabase } from \"@yielded/auth-persistence/Adapter\";\nimport type { AnyRelations } from \"drizzle-orm\";\nimport { type EffectSQLiteWasmDatabase, makeWithDefaults } from \"drizzle-orm/effect-sqlite-wasm\";\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 database used to construct persistence services. */\nexport class Database extends Context.Service<Database, EffectSQLiteWasmDatabase<AnyRelations>>()(\n \"effect-auth/persistence-drizzle/SqliteWasm/Database\",\n) {}\n\n/** Construct Drizzle from the driver's SQL-client Layer. */\nexport const databaseLayer = Layer.effect(Database, makeWithDefaults({}));\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, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) => sqliteSessionConfiguration(\"interactive\", sqlClientSessionStandaloneGuard(service)),\n);\n\nconst proofTarget = makeSqliteProofTarget<Database, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) => sqliteProofConfiguration(\"interactive\", sqlClientProofStandaloneGuard(service)),\n);\n\nconst passwordTarget = makeSqlitePasswordTarget<Database, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nconst emailTarget = makeSqliteEmailTarget<Database, EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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\nimport { drizzleMigrationsLayer } from \"./internal/drizzle-migrations\";\nimport { sqlitePersistence } from \"./internal/drizzle-sqlite\";\n\nexport const AuthPersistence = {\n ...sqlitePersistence(makeWithDefaults({})),\n migrationsLayer: (options: {\n readonly migrations: Record<string, string>;\n readonly migrationsTable?: string;\n }) =>\n drizzleMigrationsLayer(\n makeWithDefaults({}),\n Effect.promise(() => import(\"drizzle-orm/effect-sqlite-wasm/migrator\")).pipe(\n Effect.map((module) => module.migrate),\n ),\n )(options),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAa,WAAb,cAA8B,QAAQ,QAA0D,CAAC,CAC/F,qDACF,CAAC,CAAC,CAAC;;AAGH,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC;AAqBxE,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;AAK5E,MAAa,kBAAkB;CAC7B,GAAG,kBAAkB,iBAAiB,CAAC,CAAC,CAAC;CACzC,kBAAkB,YAIhB,uBACE,iBAAiB,CAAC,CAAC,GACnB,OAAO,cAAc,OAAO,0CAA0C,CAAC,CAAC,KACtE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF,CAAC,CAAC,OAAO;AACb"}
|
|
1
|
+
{"version":3,"file":"SqliteWasm.mjs","names":[],"sources":["../src/SqliteWasm.ts"],"sourcesContent":["import { NativeDatabase } from \"@yielded/auth-persistence/Adapter\";\nexport { OAuthProxyPersistence } from \"./internal/drizzle-sqlite-oauth-proxy\";\n\nimport type { AnyRelations } from \"drizzle-orm\";\nimport { type EffectSQLiteWasmDatabase, makeWithDefaults } from \"drizzle-orm/effect-sqlite-wasm\";\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 database used to construct persistence services. */\nexport class Database extends Context.Service<Database, EffectSQLiteWasmDatabase<AnyRelations>>()(\n \"effect-auth/persistence-drizzle/SqliteWasm/Database\",\n) {}\n\n/** Construct Drizzle from the driver's SQL-client Layer. */\nexport const databaseLayer = Layer.effect(Database, makeWithDefaults({}));\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, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) => sqliteSessionConfiguration(\"interactive\", sqlClientSessionStandaloneGuard(service)),\n);\n\nconst proofTarget = makeSqliteProofTarget<Database, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) => sqliteProofConfiguration(\"interactive\", sqlClientProofStandaloneGuard(service)),\n);\n\nconst passwordTarget = makeSqlitePasswordTarget<Database, EffectSQLiteWasmDatabase<AnyRelations>>(\n Database,\n (service) =>\n sqlitePasswordConfiguration(\n \"interactive\",\n sqlClientPasswordStandaloneGuard(service),\n sqlClientProofStandaloneGuard(service),\n ),\n);\n\nconst emailTarget = makeSqliteEmailTarget<Database, EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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 EffectSQLiteWasmDatabase<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\nimport { drizzleMigrationsLayer } from \"./internal/drizzle-migrations\";\nimport { sqlitePersistence } from \"./internal/drizzle-sqlite\";\n\nexport const AuthPersistence = {\n ...sqlitePersistence(makeWithDefaults({})),\n migrationsLayer: (options: {\n readonly migrations: Record<string, string>;\n readonly migrationsTable?: string;\n }) =>\n drizzleMigrationsLayer(\n makeWithDefaults({}),\n Effect.promise(() => import(\"drizzle-orm/effect-sqlite-wasm/migrator\")).pipe(\n Effect.map((module) => module.migrate),\n ),\n )(options),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,WAAb,cAA8B,QAAQ,QAA0D,CAAC,CAC/F,qDACF,CAAC,CAAC,CAAC;;AAGH,MAAa,gBAAgB,MAAM,OAAO,UAAU,iBAAiB,CAAC,CAAC,CAAC;AAqBxE,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;AAK5E,MAAa,kBAAkB;CAC7B,GAAG,kBAAkB,iBAAiB,CAAC,CAAC,CAAC;CACzC,kBAAkB,YAIhB,uBACE,iBAAiB,CAAC,CAAC,GACnB,OAAO,cAAc,OAAO,0CAA0C,CAAC,CAAC,KACtE,OAAO,KAAK,WAAW,OAAO,OAAO,CACvC,CACF,CAAC,CAAC,OAAO;AACb"}
|
package/dist/drizzle/crypto.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Crypto, Effect } from "effect";
|
|
2
|
-
import { Base64Url } from "effect/encoding";
|
|
3
2
|
import { TokenDigest } from "@yielded/auth/Schema";
|
|
3
|
+
import { Base64Url } from "effect/encoding";
|
|
4
4
|
//#region src/drizzle/crypto.ts
|
|
5
5
|
const encoder = new TextEncoder();
|
|
6
6
|
const randomId = Effect.flatMap(Crypto.Crypto, (crypto) => crypto.randomBytes(32).pipe(Effect.map(Base64Url.encode)));
|
|
@@ -10,8 +10,8 @@ import { Effect, Option } from "effect";
|
|
|
10
10
|
import { HookConfigurationError, LifecycleHooks, PreparedCommit } from "@yielded/auth/Hooks";
|
|
11
11
|
import { EmailAddressDecision, EmailAddressPersistence, EmailUnavailable } from "@yielded/auth/Email";
|
|
12
12
|
import { ProofCompletionInput } from "@yielded/auth/Proofs";
|
|
13
|
-
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
14
13
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
14
|
+
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
15
15
|
import { D1Client } from "@effect/sql-d1/D1Client";
|
|
16
16
|
//#region src/drizzle/d1-emails.d.ts
|
|
17
17
|
type Database = EffectSQLiteD1Database<AnyRelations> & {
|
|
@@ -6,18 +6,18 @@ import { SuppliedService } from "./SuppliedService.mjs";
|
|
|
6
6
|
import { AnyRelations } from "drizzle-orm";
|
|
7
7
|
import { Crypto, Effect } from "effect";
|
|
8
8
|
import { LifecycleHooks } from "@yielded/auth/Hooks";
|
|
9
|
-
import { OAuthAccountsPersistence, OAuthRegistrationIntents, OAuthSignInPersistence, OAuthUnavailable } from "@yielded/auth/OAuth";
|
|
10
|
-
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
11
9
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
10
|
+
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
11
|
+
import { OAuthAccountsPersistence, OAuthRegistrationIntents, OAuthSignInPersistence, OAuthUnavailable } from "@yielded/auth/OAuth";
|
|
12
12
|
import { D1Client } from "@effect/sql-d1/D1Client";
|
|
13
13
|
//#region src/drizzle/d1-oauth.d.ts
|
|
14
|
-
type SQLiteTable = AnySQLiteTable<{
|
|
14
|
+
type SQLiteTable$1 = AnySQLiteTable<{
|
|
15
15
|
dialect: "sqlite";
|
|
16
16
|
}>;
|
|
17
17
|
type Database = EffectSQLiteD1Database<AnyRelations> & {
|
|
18
18
|
readonly $client: D1Client;
|
|
19
19
|
};
|
|
20
|
-
export declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, T extends SQLiteTable, U extends SQLiteTable, N>(mapping: OAuthAccountsMapping<S, O, C, AC, F, T, U, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
20
|
+
export declare const makeD1OAuthAccountsServices: <S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, T extends SQLiteTable$1, U extends SQLiteTable$1, N>(mapping: OAuthAccountsMapping<S, O, C, AC, F, T, U, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
21
21
|
oauthAccountsPersistence: {
|
|
22
22
|
readonly capture: (input: {
|
|
23
23
|
readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
|
|
@@ -163,12 +163,10 @@ export declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O exte
|
|
|
163
163
|
readonly nowMillis: number;
|
|
164
164
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<{
|
|
165
165
|
readonly _tag: "Rejected";
|
|
166
|
-
} | {
|
|
167
|
-
readonly _tag: "Cancelled";
|
|
168
166
|
} | {
|
|
169
167
|
readonly _tag: "Ambiguous";
|
|
170
168
|
} | {
|
|
171
|
-
readonly _tag: "
|
|
169
|
+
readonly _tag: "Cancelled";
|
|
172
170
|
} | {
|
|
173
171
|
readonly _tag: "Linked";
|
|
174
172
|
readonly credential: {
|
|
@@ -190,6 +188,8 @@ export declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O exte
|
|
|
190
188
|
};
|
|
191
189
|
};
|
|
192
190
|
readonly changed: boolean;
|
|
191
|
+
} | {
|
|
192
|
+
readonly _tag: "Conflict";
|
|
193
193
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, OAuthUnavailable>;
|
|
194
194
|
readonly inspectUnlink: (input: {
|
|
195
195
|
readonly moduleId: string & import("effect/Brand").Brand<"effect-auth/OAuthModuleId">;
|
|
@@ -268,7 +268,7 @@ export declare const makeD1OAuthAccountsServices: <S extends SQLiteTable, O exte
|
|
|
268
268
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, OAuthUnavailable>;
|
|
269
269
|
};
|
|
270
270
|
}, OAuthUnavailable, Crypto.Crypto | Database$1 | LifecycleHooks>;
|
|
271
|
-
export declare const makeD1OAuthSignInServices: <S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, N>(mapping: OAuthSignInMapping<S, O, C, AC, F, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
271
|
+
export declare const makeD1OAuthSignInServices: <S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, N>(mapping: OAuthSignInMapping<S, O, C, AC, F, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
272
272
|
oauthSignInPersistence: {
|
|
273
273
|
readonly issue: <A>(input: import("@yielded/auth/OAuth").OAuthPendingFlow, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<import("@yielded/auth/OAuth").OAuthIssueDecision, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, OAuthUnavailable>;
|
|
274
274
|
readonly claim: <A>(input: {
|
|
@@ -301,7 +301,7 @@ export declare const makeD1OAuthSignInServices: <S extends SQLiteTable, O extend
|
|
|
301
301
|
}, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, OAuthUnavailable>;
|
|
302
302
|
};
|
|
303
303
|
}, OAuthUnavailable, Crypto.Crypto | Database$1 | LifecycleHooks>;
|
|
304
|
-
export declare const makeD1OAuthRegistrationIntentServices: <S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, T extends SQLiteTable, I extends SQLiteTable, N>(mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, T, I, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
304
|
+
export declare const makeD1OAuthRegistrationIntentServices: <S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, T extends SQLiteTable$1, I extends SQLiteTable$1, N>(mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, T, I, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
305
305
|
oauthRegistrationIntents: {
|
|
306
306
|
readonly settle: <A>(input: {
|
|
307
307
|
readonly claim: import("@yielded/auth/OAuth").OAuthClaim;
|
|
@@ -311,19 +311,19 @@ export declare const makeD1OAuthRegistrationIntentServices: <S extends SQLiteTab
|
|
|
311
311
|
}, prepare: import("@yielded/auth/OAuth").PrepareOAuthCommit<import("@yielded/auth/OAuth").OAuthRegistrationSettlement, A>) => Effect.Effect<import("@yielded/auth/Hooks").PreparedCommit<A>, OAuthUnavailable>;
|
|
312
312
|
};
|
|
313
313
|
}, OAuthUnavailable, Crypto.Crypto | Database$1 | LifecycleHooks>;
|
|
314
|
-
export declare const makeD1OAuthRegistrationServices: <Registration, S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, T extends SQLiteTable, I extends SQLiteTable, R extends SQLiteTable, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, T, I, R, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
314
|
+
export declare const makeD1OAuthRegistrationServices: <Registration, S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, T extends SQLiteTable$1, I extends SQLiteTable$1, R extends SQLiteTable$1, N>(mapping: OAuthRegistrationMapping<Registration, S, O, C, AC, T, I, R, N> & OAuthD1Mapping) => Effect.Effect<{
|
|
315
315
|
registrationAuthority: OAuthRegistrationAuthority<Registration>;
|
|
316
316
|
}, OAuthUnavailable, Crypto.Crypto | Database$1 | LifecycleHooks>;
|
|
317
|
-
export declare function coordinateD1OAuthSignIn<S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
317
|
+
export declare function coordinateD1OAuthSignIn<S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
318
318
|
readonly mapping: OAuthSignInMapping<S, O, C, AC, F, N> & OAuthD1Mapping;
|
|
319
319
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, OAuthCoordinatorError<E> | DatabaseError, Exclude<R, OAuthSignInPersistence | D1BatchStatements> | Crypto.Crypto | LifecycleHooks | DatabaseRequirements>;
|
|
320
|
-
export declare function coordinateD1OAuthRegistrationIntents<S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, T extends SQLiteTable, I extends SQLiteTable, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
320
|
+
export declare function coordinateD1OAuthRegistrationIntents<S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, T extends SQLiteTable$1, I extends SQLiteTable$1, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
321
321
|
readonly mapping: OAuthRegistrationIntentMapping<S, O, C, AC, F, T, I, N> & OAuthD1Mapping;
|
|
322
322
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, OAuthCoordinatorError<E> | DatabaseError, Exclude<R, OAuthRegistrationIntents | D1BatchStatements> | Crypto.Crypto | LifecycleHooks | DatabaseRequirements>;
|
|
323
|
-
export declare function coordinateD1OAuthAccounts<S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, F extends SQLiteTable, T extends SQLiteTable, U extends SQLiteTable, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
323
|
+
export declare function coordinateD1OAuthAccounts<S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, F extends SQLiteTable$1, T extends SQLiteTable$1, U extends SQLiteTable$1, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
324
324
|
readonly mapping: OAuthAccountsMapping<S, O, C, AC, F, T, U, N> & OAuthD1Mapping;
|
|
325
325
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, OAuthCoordinatorError<E> | DatabaseError, Exclude<R, OAuthAccountsPersistence | D1BatchStatements> | Crypto.Crypto | LifecycleHooks | DatabaseRequirements>;
|
|
326
|
-
export declare function coordinateD1OAuthRegistration<TargetId, Registration, S extends SQLiteTable, O extends SQLiteTable, C extends SQLiteTable, AC extends SQLiteTable, T extends SQLiteTable, I extends SQLiteTable, Rq extends SQLiteTable, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
326
|
+
export declare function coordinateD1OAuthRegistration<TargetId, Registration, S extends SQLiteTable$1, O extends SQLiteTable$1, C extends SQLiteTable$1, AC extends SQLiteTable$1, T extends SQLiteTable$1, I extends SQLiteTable$1, Rq extends SQLiteTable$1, N, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
327
327
|
readonly mapping: OAuthRegistrationMapping<NoInfer<Registration>, S, O, C, AC, T, I, Rq, N> & OAuthD1Mapping;
|
|
328
328
|
readonly target: SuppliedService<TargetId, OAuthRegistrationAuthority<Registration>>;
|
|
329
329
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, OAuthCoordinatorError<E> | DatabaseError, Exclude<R, TargetId | D1BatchStatements> | Crypto.Crypto | LifecycleHooks | DatabaseRequirements>;
|
|
@@ -8,9 +8,9 @@ import { NativeDatabase } from "@yielded/auth-persistence/Adapter";
|
|
|
8
8
|
import { AnyRelations } from "drizzle-orm";
|
|
9
9
|
import { Context, Crypto, Effect } from "effect";
|
|
10
10
|
import { LifecycleHooks } from "@yielded/auth/Hooks";
|
|
11
|
+
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
11
12
|
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
12
13
|
import { PasskeyManagementPersistence, PasskeyPersistence } from "@yielded/auth/Passkey";
|
|
13
|
-
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
14
14
|
import { D1Client } from "@effect/sql-d1/D1Client";
|
|
15
15
|
//#region src/drizzle/d1-passkey.d.ts
|
|
16
16
|
type Table$1 = AnySQLiteTable<{
|
|
@@ -6,18 +6,18 @@ import { AnyRelations } from "drizzle-orm";
|
|
|
6
6
|
import { Effect } from "effect";
|
|
7
7
|
import { HookConfigurationError, LifecycleHooks } from "@yielded/auth/Hooks";
|
|
8
8
|
import { PasswordPreparedPersistence, PasswordUnavailable } from "@yielded/auth/Password";
|
|
9
|
-
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
10
9
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
10
|
+
import { EffectSQLiteD1Database } from "drizzle-orm/effect-d1";
|
|
11
11
|
import { D1Client } from "@effect/sql-d1/D1Client";
|
|
12
12
|
//#region src/drizzle/d1-password-prepared.d.ts
|
|
13
13
|
type Database = EffectSQLiteD1Database<AnyRelations> & {
|
|
14
14
|
readonly $client: D1Client;
|
|
15
15
|
};
|
|
16
|
-
export declare const makeD1PasswordPreparedPersistenceServices: <S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
16
|
+
export declare const makeD1PasswordPreparedPersistenceServices: <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: D1PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>, proofMapping?: D1PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined) => Effect.Effect<{
|
|
17
17
|
passwordPreparedPersistence: PasswordPreparedPersistence;
|
|
18
18
|
}, PasswordUnavailable, Database$1 | LifecycleHooks>;
|
|
19
|
-
export declare function coordinateD1PasswordPreparedPersistence<TargetId, S extends AnySQLiteTable, I extends AnySQLiteTable, C extends AnySQLiteTable, AC extends AnySQLiteTable,
|
|
20
|
-
readonly mapping: D1PasswordPreparedPersistenceMapping<S, I, C, AC,
|
|
19
|
+
export declare function coordinateD1PasswordPreparedPersistence<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, A, E, R, DatabaseError, DatabaseRequirements>(acquire: Effect.Effect<Database, DatabaseError, DatabaseRequirements>, options: {
|
|
20
|
+
readonly mapping: D1PasswordPreparedPersistenceMapping<S, I, C, AC, M, T, B, NativeId>;
|
|
21
21
|
readonly proofMapping?: D1PasswordPreparedProofMapping<PS, PC, PM, PSub, PI, PCr, PNativeId> | undefined;
|
|
22
22
|
readonly target: SuppliedService<TargetId, PasswordPreparedPersistence>;
|
|
23
23
|
}, body: Effect.Effect<A, E, R>): Effect.Effect<A, E | PasswordUnavailable | HookConfigurationError | DatabaseError, Exclude<R, TargetId | D1BatchStatements> | LifecycleHooks | DatabaseRequirements>;
|