@eloxiv/client 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Account.d.ts +131 -0
- package/dist/Account.d.ts.map +1 -0
- package/dist/Account.js +169 -0
- package/dist/Account.js.map +1 -0
- package/dist/Agent.d.ts +496 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +228 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSync.d.ts +990 -0
- package/dist/AgentSync.d.ts.map +1 -0
- package/dist/AgentSync.js +46 -0
- package/dist/AgentSync.js.map +1 -0
- package/dist/AppState.d.ts +127 -0
- package/dist/AppState.d.ts.map +1 -0
- package/dist/AppState.js +145 -0
- package/dist/AppState.js.map +1 -0
- package/dist/AppStateSync.d.ts +193 -0
- package/dist/AppStateSync.d.ts.map +1 -0
- package/dist/AppStateSync.js +23 -0
- package/dist/AppStateSync.js.map +1 -0
- package/dist/Auth.d.ts +95 -0
- package/dist/Auth.d.ts.map +1 -0
- package/dist/Auth.js +139 -0
- package/dist/Auth.js.map +1 -0
- package/dist/Avatars.d.ts +53 -0
- package/dist/Avatars.d.ts.map +1 -0
- package/dist/Avatars.js +121 -0
- package/dist/Avatars.js.map +1 -0
- package/dist/BrowserAnalytics.d.ts +56 -0
- package/dist/BrowserAnalytics.d.ts.map +1 -0
- package/dist/BrowserAnalytics.js +94 -0
- package/dist/BrowserAnalytics.js.map +1 -0
- package/dist/Chat.d.ts +712 -0
- package/dist/Chat.d.ts.map +1 -0
- package/dist/Chat.js +883 -0
- package/dist/Chat.js.map +1 -0
- package/dist/ChatIntegrity.d.ts +63 -0
- package/dist/ChatIntegrity.d.ts.map +1 -0
- package/dist/ChatIntegrity.js +89 -0
- package/dist/ChatIntegrity.js.map +1 -0
- package/dist/ChatSends.d.ts +103 -0
- package/dist/ChatSends.d.ts.map +1 -0
- package/dist/ChatSends.js +157 -0
- package/dist/ChatSends.js.map +1 -0
- package/dist/Client.d.ts +113 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +189 -0
- package/dist/Client.js.map +1 -0
- package/dist/Collab.d.ts +138 -0
- package/dist/Collab.d.ts.map +1 -0
- package/dist/Collab.js +454 -0
- package/dist/Collab.js.map +1 -0
- package/dist/CollabTools.d.ts +129 -0
- package/dist/CollabTools.d.ts.map +1 -0
- package/dist/CollabTools.js +277 -0
- package/dist/CollabTools.js.map +1 -0
- package/dist/Connections.d.ts +288 -0
- package/dist/Connections.d.ts.map +1 -0
- package/dist/Connections.js +316 -0
- package/dist/Connections.js.map +1 -0
- package/dist/Consent.d.ts +338 -0
- package/dist/Consent.d.ts.map +1 -0
- package/dist/Consent.js +142 -0
- package/dist/Consent.js.map +1 -0
- package/dist/Desktop.d.ts +61 -0
- package/dist/Desktop.d.ts.map +1 -0
- package/dist/Desktop.js +101 -0
- package/dist/Desktop.js.map +1 -0
- package/dist/Directory.d.ts +36 -0
- package/dist/Directory.d.ts.map +1 -0
- package/dist/Directory.js +42 -0
- package/dist/Directory.js.map +1 -0
- package/dist/ErrorReporter.d.ts +48 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +70 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/ExpoSqlite.d.ts +7 -0
- package/dist/ExpoSqlite.d.ts.map +1 -0
- package/dist/ExpoSqlite.js +7 -0
- package/dist/ExpoSqlite.js.map +1 -0
- package/dist/FileSync.d.ts +265 -0
- package/dist/FileSync.d.ts.map +1 -0
- package/dist/FileSync.js +29 -0
- package/dist/FileSync.js.map +1 -0
- package/dist/FileTables.gen.d.ts +109 -0
- package/dist/FileTables.gen.d.ts.map +1 -0
- package/dist/FileTables.gen.js +23 -0
- package/dist/FileTables.gen.js.map +1 -0
- package/dist/Foldkit.d.ts +487 -0
- package/dist/Foldkit.d.ts.map +1 -0
- package/dist/Foldkit.js +617 -0
- package/dist/Foldkit.js.map +1 -0
- package/dist/History.d.ts +133 -0
- package/dist/History.d.ts.map +1 -0
- package/dist/History.js +210 -0
- package/dist/History.js.map +1 -0
- package/dist/InboxSync.d.ts +428 -0
- package/dist/InboxSync.d.ts.map +1 -0
- package/dist/InboxSync.js +37 -0
- package/dist/InboxSync.js.map +1 -0
- package/dist/KernelTables.gen.d.ts +1522 -0
- package/dist/KernelTables.gen.d.ts.map +1 -0
- package/dist/KernelTables.gen.js +307 -0
- package/dist/KernelTables.gen.js.map +1 -0
- package/dist/Make.d.ts +75 -0
- package/dist/Make.d.ts.map +1 -0
- package/dist/Make.js +70 -0
- package/dist/Make.js.map +1 -0
- package/dist/Models.d.ts +88 -0
- package/dist/Models.d.ts.map +1 -0
- package/dist/Models.js +80 -0
- package/dist/Models.js.map +1 -0
- package/dist/Optimistic.d.ts +120 -0
- package/dist/Optimistic.d.ts.map +1 -0
- package/dist/Optimistic.js +231 -0
- package/dist/Optimistic.js.map +1 -0
- package/dist/PlatformSync.d.ts +273 -0
- package/dist/PlatformSync.d.ts.map +1 -0
- package/dist/PlatformSync.js +92 -0
- package/dist/PlatformSync.js.map +1 -0
- package/dist/Poll.d.ts +113 -0
- package/dist/Poll.d.ts.map +1 -0
- package/dist/Poll.js +179 -0
- package/dist/Poll.js.map +1 -0
- package/dist/Preferences.d.ts +18 -0
- package/dist/Preferences.d.ts.map +1 -0
- package/dist/Preferences.js +22 -0
- package/dist/Preferences.js.map +1 -0
- package/dist/Proposals.d.ts +29 -0
- package/dist/Proposals.d.ts.map +1 -0
- package/dist/Proposals.js +41 -0
- package/dist/Proposals.js.map +1 -0
- package/dist/React.d.ts +17 -0
- package/dist/React.d.ts.map +1 -0
- package/dist/React.js +17 -0
- package/dist/React.js.map +1 -0
- package/dist/Reader.d.ts +35 -0
- package/dist/Reader.d.ts.map +1 -0
- package/dist/Reader.js +136 -0
- package/dist/Reader.js.map +1 -0
- package/dist/Resources.d.ts +98 -0
- package/dist/Resources.d.ts.map +1 -0
- package/dist/Resources.js +161 -0
- package/dist/Resources.js.map +1 -0
- package/dist/Rows.d.ts +4 -0
- package/dist/Rows.d.ts.map +1 -0
- package/dist/Rows.js +16 -0
- package/dist/Rows.js.map +1 -0
- package/dist/Runtime.d.ts +254 -0
- package/dist/Runtime.d.ts.map +1 -0
- package/dist/Runtime.js +1283 -0
- package/dist/Runtime.js.map +1 -0
- package/dist/RuntimeRuns.d.ts +74 -0
- package/dist/RuntimeRuns.d.ts.map +1 -0
- package/dist/RuntimeRuns.js +118 -0
- package/dist/RuntimeRuns.js.map +1 -0
- package/dist/ServicesSync.d.ts +286 -0
- package/dist/ServicesSync.d.ts.map +1 -0
- package/dist/ServicesSync.js +40 -0
- package/dist/ServicesSync.js.map +1 -0
- package/dist/Session.d.ts +228 -0
- package/dist/Session.d.ts.map +1 -0
- package/dist/Session.js +792 -0
- package/dist/Session.js.map +1 -0
- package/dist/ShareGrant.d.ts +47 -0
- package/dist/ShareGrant.d.ts.map +1 -0
- package/dist/ShareGrant.js +20 -0
- package/dist/ShareGrant.js.map +1 -0
- package/dist/Sharing.d.ts +203 -0
- package/dist/Sharing.d.ts.map +1 -0
- package/dist/Sharing.js +520 -0
- package/dist/Sharing.js.map +1 -0
- package/dist/Skew.d.ts +52 -0
- package/dist/Skew.d.ts.map +1 -0
- package/dist/Skew.js +77 -0
- package/dist/Skew.js.map +1 -0
- package/dist/SpacesSync.d.ts +247 -0
- package/dist/SpacesSync.d.ts.map +1 -0
- package/dist/SpacesSync.js +30 -0
- package/dist/SpacesSync.js.map +1 -0
- package/dist/Storage.d.ts +51 -0
- package/dist/Storage.d.ts.map +1 -0
- package/dist/Storage.js +107 -0
- package/dist/Storage.js.map +1 -0
- package/dist/Sync.d.ts +48 -0
- package/dist/Sync.d.ts.map +1 -0
- package/dist/Sync.js +48 -0
- package/dist/Sync.js.map +1 -0
- package/dist/SyncTables.d.ts +13 -0
- package/dist/SyncTables.d.ts.map +1 -0
- package/dist/SyncTables.js +13 -0
- package/dist/SyncTables.js.map +1 -0
- package/dist/Tab.d.ts +36 -0
- package/dist/Tab.d.ts.map +1 -0
- package/dist/Tab.js +44 -0
- package/dist/Tab.js.map +1 -0
- package/dist/Transport.d.ts +139 -0
- package/dist/Transport.d.ts.map +1 -0
- package/dist/Transport.js +232 -0
- package/dist/Transport.js.map +1 -0
- package/dist/Upload.d.ts +41 -0
- package/dist/Upload.d.ts.map +1 -0
- package/dist/Upload.js +93 -0
- package/dist/Upload.js.map +1 -0
- package/dist/WebMcp.d.ts +78 -0
- package/dist/WebMcp.d.ts.map +1 -0
- package/dist/WebMcp.js +204 -0
- package/dist/WebMcp.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +97 -3
- package/src/Account.ts +249 -0
- package/src/Agent.ts +387 -0
- package/src/AgentSync.ts +59 -0
- package/src/AppState.ts +222 -0
- package/src/AppStateSync.ts +26 -0
- package/src/Auth.ts +225 -0
- package/src/Avatars.ts +144 -0
- package/src/BrowserAnalytics.ts +133 -0
- package/src/Chat.ts +1150 -0
- package/src/ChatIntegrity.ts +130 -0
- package/src/ChatSends.ts +209 -0
- package/src/Client.ts +319 -0
- package/src/Collab.ts +524 -0
- package/src/CollabTools.ts +381 -0
- package/src/Connections.ts +517 -0
- package/src/Consent.ts +176 -0
- package/src/Desktop.ts +139 -0
- package/src/Directory.ts +71 -0
- package/src/ErrorReporter.ts +112 -0
- package/src/ExpoSqlite.ts +6 -0
- package/src/FileSync.ts +34 -0
- package/src/FileTables.gen.ts +23 -0
- package/src/Foldkit.ts +960 -0
- package/src/History.ts +337 -0
- package/src/InboxSync.ts +47 -0
- package/src/KernelTables.gen.ts +329 -0
- package/src/Make.ts +120 -0
- package/src/Models.ts +134 -0
- package/src/Optimistic.ts +364 -0
- package/src/PlatformSync.ts +156 -0
- package/src/Poll.ts +227 -0
- package/src/Preferences.ts +42 -0
- package/src/Proposals.ts +57 -0
- package/src/React.ts +26 -0
- package/src/Reader.ts +180 -0
- package/src/Resources.ts +257 -0
- package/src/Rows.ts +16 -0
- package/src/Runtime.ts +1442 -0
- package/src/RuntimeRuns.ts +180 -0
- package/src/ServicesSync.ts +58 -0
- package/src/Session.ts +844 -0
- package/src/ShareGrant.ts +20 -0
- package/src/Sharing.ts +696 -0
- package/src/Skew.ts +97 -0
- package/src/SpacesSync.ts +61 -0
- package/src/Storage.ts +167 -0
- package/src/Sync.ts +125 -0
- package/src/SyncTables.ts +12 -0
- package/src/Tab.ts +59 -0
- package/src/Transport.ts +321 -0
- package/src/Upload.ts +125 -0
- package/src/WebMcp.ts +279 -0
- package/src/index.ts +26 -0
- package/src/web-globals.d.ts +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eloxiv contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @eloxiv/client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The headless Eloxiv client SDK: sign-in and sessions, a local synced replica with live queries, optimistic writes, actions, chat, sharing, and history. It has no DOM or Node-only dependencies, so it runs in browsers, desktop webviews, and React Native. Adapters: `@eloxiv/client/foldkit`, `@eloxiv/client/react`, `@eloxiv/client/expo-sqlite`, and the portable client runtime, `@eloxiv/client/runtime`.
|
|
4
|
+
|
|
5
|
+
Eloxiv is a framework for agent-native applications: a headless kernel, a registry of app-owned modules, and the tools to assemble apps from them. Start with [Getting started](https://github.com/eloxiv/eloxiv/blob/main/docs/getting-started.md).
|
|
6
|
+
|
|
7
|
+
MIT licensed.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account security and profile, headless: password recovery, address verification and change, two-factor
|
|
3
|
+
* authentication (TOTP and backup codes), OAuth sign-in and the signed-in person's own profile. Each is one request to
|
|
4
|
+
* the kernel's Better Auth routes (`/auth/*`), which the kernel fronts (Identity): every mail goes through the
|
|
5
|
+
* deployment's system email, and a flow that needs mail is refused where the deployment has none.
|
|
6
|
+
*
|
|
7
|
+
* Routes that change the account may rotate the session (Better Auth issues a new one and ends the old): they resolve
|
|
8
|
+
* with the token to use from then on (`token`), the same one when it did not change.
|
|
9
|
+
*/
|
|
10
|
+
import { type Session } from "./Auth.ts";
|
|
11
|
+
export { TwoFactorRequired } from "./Auth.ts";
|
|
12
|
+
/** The header a client without cookies returns a two-factor challenge in (the kernel's `TWO_FACTOR_CHALLENGE_HEADER`). */
|
|
13
|
+
export declare const TWO_FACTOR_CHALLENGE_HEADER = "x-eloxiv-two-factor";
|
|
14
|
+
/** The signed-in person's own account, as the kernel holds it. */
|
|
15
|
+
export interface Account {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly email: string;
|
|
18
|
+
readonly emailVerified: boolean;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly image: string | null;
|
|
21
|
+
readonly twoFactorEnabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Ask for a password reset: the kernel mails a link to the address when it has an account (and answers the same
|
|
25
|
+
* either way, so it tells nobody whether it does). The link opens `redirectTo` (an origin the kernel trusts) with
|
|
26
|
+
* `?token=`, which `resetPassword` takes.
|
|
27
|
+
*/
|
|
28
|
+
export declare const requestPasswordReset: (baseUrl: string, input: {
|
|
29
|
+
readonly email: string;
|
|
30
|
+
readonly redirectTo: string;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
/** Set a new password with a reset link's token. Every session of the account ends; sign in again. */
|
|
33
|
+
export declare const resetPassword: (baseUrl: string, input: {
|
|
34
|
+
readonly token: string;
|
|
35
|
+
readonly newPassword: string;
|
|
36
|
+
}) => Promise<void>;
|
|
37
|
+
/** Mail (again) the link that verifies the account's address; `callbackURL` is where it lands afterwards. */
|
|
38
|
+
export declare const sendVerificationEmail: (baseUrl: string, input: {
|
|
39
|
+
readonly email: string;
|
|
40
|
+
readonly callbackURL?: string;
|
|
41
|
+
}) => Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Verify an address with the token of its verification link (the link itself does the same in a browser). A change
|
|
44
|
+
* of address's links act only with `session`, the session that asked for the change, while it lasts, each once.
|
|
45
|
+
*/
|
|
46
|
+
export declare const verifyEmail: (baseUrl: string, token: string, session?: string) => Promise<void>;
|
|
47
|
+
/** The signed-in person's account. */
|
|
48
|
+
export declare const getAccount: (baseUrl: string, token: string) => Promise<Account>;
|
|
49
|
+
/** Change the person's display name. */
|
|
50
|
+
export declare const updateProfile: (baseUrl: string, token: string, input: {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
}) => Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Ask to change the account's address. A verified address must confirm it first (a link mailed to it), then the new
|
|
55
|
+
* address is verified (a link mailed there) and only then does it change; an unverified one is verified at the new
|
|
56
|
+
* address. The address never changes on the request alone.
|
|
57
|
+
*/
|
|
58
|
+
export declare const changeEmail: (baseUrl: string, token: string, input: {
|
|
59
|
+
readonly newEmail: string;
|
|
60
|
+
readonly callbackURL?: string;
|
|
61
|
+
}) => Promise<void>;
|
|
62
|
+
/** Change the password; with `revokeOtherSessions`, every other session ends. Resolves with the token to use. */
|
|
63
|
+
export declare const changePassword: (baseUrl: string, token: string, input: {
|
|
64
|
+
readonly currentPassword: string;
|
|
65
|
+
readonly newPassword: string;
|
|
66
|
+
readonly revokeOtherSessions?: boolean;
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
readonly token: string;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Start two-factor enrollment (the password again): the authenticator app's `otpauth://` URI and ten backup codes.
|
|
72
|
+
* Nothing is required at sign-in until `confirmTwoFactor` proves a first code.
|
|
73
|
+
*/
|
|
74
|
+
export declare const enableTwoFactor: (baseUrl: string, token: string, input: {
|
|
75
|
+
readonly password: string;
|
|
76
|
+
}) => Promise<{
|
|
77
|
+
readonly totpURI: string;
|
|
78
|
+
readonly backupCodes: ReadonlyArray<string>;
|
|
79
|
+
}>;
|
|
80
|
+
/** Finish enrollment with a first code from the app; from then on sign-in asks for a second factor. */
|
|
81
|
+
export declare const confirmTwoFactor: (baseUrl: string, token: string, input: {
|
|
82
|
+
readonly code: string;
|
|
83
|
+
}) => Promise<{
|
|
84
|
+
readonly token: string;
|
|
85
|
+
}>;
|
|
86
|
+
/** Turn two-factor authentication off (the password again). */
|
|
87
|
+
export declare const disableTwoFactor: (baseUrl: string, token: string, input: {
|
|
88
|
+
readonly password: string;
|
|
89
|
+
}) => Promise<{
|
|
90
|
+
readonly token: string;
|
|
91
|
+
}>;
|
|
92
|
+
/** New backup codes (the password again); the old ones stop working. */
|
|
93
|
+
export declare const regenerateBackupCodes: (baseUrl: string, token: string, input: {
|
|
94
|
+
readonly password: string;
|
|
95
|
+
}) => Promise<{
|
|
96
|
+
readonly backupCodes: ReadonlyArray<string>;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Finish a sign-in `TwoFactorRequired` interrupted: the challenge and a code from the authenticator app (`totp`) or
|
|
100
|
+
* one of the backup codes (`backup-code`, each good once). Resolves with the session.
|
|
101
|
+
*/
|
|
102
|
+
export declare const verifyTwoFactor: (baseUrl: string, input: {
|
|
103
|
+
readonly challenge: string;
|
|
104
|
+
readonly code: string;
|
|
105
|
+
readonly method?: "totp" | "backup-code";
|
|
106
|
+
}) => Promise<Session>;
|
|
107
|
+
/**
|
|
108
|
+
* Where to send the browser to sign in with an OAuth provider the deployment configured: the provider's page, which
|
|
109
|
+
* returns to the kernel and then to `callbackURL` (an origin the kernel trusts) signed in with the session cookie.
|
|
110
|
+
* An existing account is joined only when the provider verified the same address and the account's own address is
|
|
111
|
+
* verified; otherwise the sign-in is refused (`errorCallbackURL?error=account_not_linked`).
|
|
112
|
+
*/
|
|
113
|
+
export declare const oauthSignInUrl: (baseUrl: string, input: {
|
|
114
|
+
readonly provider: string;
|
|
115
|
+
readonly callbackURL: string;
|
|
116
|
+
readonly errorCallbackURL?: string;
|
|
117
|
+
}) => Promise<string>;
|
|
118
|
+
/**
|
|
119
|
+
* Ask for a passwordless sign-in link (where the deployment offers magic links): mailed to the address, single use,
|
|
120
|
+
* five minutes. Answers alike whether or not the address has an account. A link to an account with two-factor
|
|
121
|
+
* authentication signs nobody in (it would skip the second factor), and one that proves an unverified account's
|
|
122
|
+
* address removes the account's earlier password and sessions first.
|
|
123
|
+
*/
|
|
124
|
+
export declare const requestMagicLink: (baseUrl: string, input: {
|
|
125
|
+
readonly email: string;
|
|
126
|
+
readonly callbackURL?: string;
|
|
127
|
+
readonly errorCallbackURL?: string;
|
|
128
|
+
}) => Promise<void>;
|
|
129
|
+
/** Sign in with a magic link's token (the link itself does the same in a browser, with the session cookie). */
|
|
130
|
+
export declare const verifyMagicLink: (baseUrl: string, token: string) => Promise<Session>;
|
|
131
|
+
//# sourceMappingURL=Account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,WAAW,CAAA;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,0HAA0H;AAC1H,eAAO,MAAM,2BAA2B,wBAAwB,CAAA;AAEhE,kEAAkE;AAClE,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CACnC;AA6CD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,YACtB,MAAM,SACR;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,KAC7D,OAAO,CAAC,IAAI,CAEd,CAAA;AAED,sGAAsG;AACtG,eAAO,MAAM,aAAa,YACf,MAAM,SACR;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,KAC9D,OAAO,CAAC,IAAI,CAEd,CAAA;AAED,6GAA6G;AAC7G,eAAO,MAAM,qBAAqB,YACvB,MAAM,SACR;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,W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MAAM,CAAA;CAAE,KACnG,OAAO,CAAC,IAAI,CAEd,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,eAAe,YAAmB,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAKrF,CAAA"}
|
package/dist/Account.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account security and profile, headless: password recovery, address verification and change, two-factor
|
|
3
|
+
* authentication (TOTP and backup codes), OAuth sign-in and the signed-in person's own profile. Each is one request to
|
|
4
|
+
* the kernel's Better Auth routes (`/auth/*`), which the kernel fronts (Identity): every mail goes through the
|
|
5
|
+
* deployment's system email, and a flow that needs mail is refused where the deployment has none.
|
|
6
|
+
*
|
|
7
|
+
* Routes that change the account may rotate the session (Better Auth issues a new one and ends the old): they resolve
|
|
8
|
+
* with the token to use from then on (`token`), the same one when it did not change.
|
|
9
|
+
*/
|
|
10
|
+
import { AuthError, originOf } from "./Auth.js";
|
|
11
|
+
export { TwoFactorRequired } from "./Auth.js";
|
|
12
|
+
/** The header a client without cookies returns a two-factor challenge in (the kernel's `TWO_FACTOR_CHALLENGE_HEADER`). */
|
|
13
|
+
export const TWO_FACTOR_CHALLENGE_HEADER = "x-eloxiv-two-factor";
|
|
14
|
+
/** One call of the kernel's auth routes: its JSON answer and response, or `AuthError` with Better Auth's message. */
|
|
15
|
+
const call = async (baseUrl, path, request = {}) => {
|
|
16
|
+
const method = request.method ?? "POST";
|
|
17
|
+
const response = await fetch(`${baseUrl}/auth${path}`, {
|
|
18
|
+
method,
|
|
19
|
+
headers: {
|
|
20
|
+
...(method === "POST" ? { "content-type": "application/json", origin: originOf(baseUrl) } : {}),
|
|
21
|
+
...(request.token === undefined ? {} : { authorization: `Bearer ${request.token}` }),
|
|
22
|
+
...request.headers,
|
|
23
|
+
},
|
|
24
|
+
...(method === "POST" ? { body: JSON.stringify(request.body ?? {}) } : {}),
|
|
25
|
+
});
|
|
26
|
+
const text = await response.text();
|
|
27
|
+
let json;
|
|
28
|
+
try {
|
|
29
|
+
json = text.length === 0 ? undefined : JSON.parse(text);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
json = undefined;
|
|
33
|
+
}
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
const message = json?.message;
|
|
36
|
+
throw new AuthError(`${path} failed: ${typeof message === "string" ? message : text}`, response.status);
|
|
37
|
+
}
|
|
38
|
+
return { json, response };
|
|
39
|
+
};
|
|
40
|
+
/** The session token a route answered with (`set-auth-token`), or the one it was called with. */
|
|
41
|
+
const tokenAfter = (response, token) => response.headers.get("set-auth-token") ?? token;
|
|
42
|
+
const sessionOf = (response, json) => {
|
|
43
|
+
const token = response.headers.get("set-auth-token");
|
|
44
|
+
if (token === null)
|
|
45
|
+
throw new AuthError("The server did not return a bearer token", response.status);
|
|
46
|
+
return { token, user: json.user };
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Ask for a password reset: the kernel mails a link to the address when it has an account (and answers the same
|
|
50
|
+
* either way, so it tells nobody whether it does). The link opens `redirectTo` (an origin the kernel trusts) with
|
|
51
|
+
* `?token=`, which `resetPassword` takes.
|
|
52
|
+
*/
|
|
53
|
+
export const requestPasswordReset = async (baseUrl, input) => {
|
|
54
|
+
await call(baseUrl, "/request-password-reset", { body: input });
|
|
55
|
+
};
|
|
56
|
+
/** Set a new password with a reset link's token. Every session of the account ends; sign in again. */
|
|
57
|
+
export const resetPassword = async (baseUrl, input) => {
|
|
58
|
+
await call(baseUrl, "/reset-password", { body: input });
|
|
59
|
+
};
|
|
60
|
+
/** Mail (again) the link that verifies the account's address; `callbackURL` is where it lands afterwards. */
|
|
61
|
+
export const sendVerificationEmail = async (baseUrl, input) => {
|
|
62
|
+
await call(baseUrl, "/send-verification-email", { body: input });
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Verify an address with the token of its verification link (the link itself does the same in a browser). A change
|
|
66
|
+
* of address's links act only with `session`, the session that asked for the change, while it lasts, each once.
|
|
67
|
+
*/
|
|
68
|
+
export const verifyEmail = async (baseUrl, token, session) => {
|
|
69
|
+
await call(baseUrl, `/verify-email?token=${encodeURIComponent(token)}`, { method: "GET", token: session });
|
|
70
|
+
};
|
|
71
|
+
/** The signed-in person's account. */
|
|
72
|
+
export const getAccount = async (baseUrl, token) => {
|
|
73
|
+
const { json } = await call(baseUrl, "/get-session", { method: "GET", token });
|
|
74
|
+
const user = json?.user;
|
|
75
|
+
if (user === undefined)
|
|
76
|
+
throw new AuthError("Not signed in", 401);
|
|
77
|
+
const text = (key) => (typeof user[key] === "string" ? user[key] : "");
|
|
78
|
+
return {
|
|
79
|
+
id: text("id"),
|
|
80
|
+
email: text("email"),
|
|
81
|
+
emailVerified: user["emailVerified"] === true,
|
|
82
|
+
name: text("name"),
|
|
83
|
+
image: typeof user["image"] === "string" ? user["image"] : null,
|
|
84
|
+
twoFactorEnabled: user["twoFactorEnabled"] === true,
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** Change the person's display name. */
|
|
88
|
+
export const updateProfile = async (baseUrl, token, input) => {
|
|
89
|
+
await call(baseUrl, "/update-user", { token, body: { name: input.name } });
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Ask to change the account's address. A verified address must confirm it first (a link mailed to it), then the new
|
|
93
|
+
* address is verified (a link mailed there) and only then does it change; an unverified one is verified at the new
|
|
94
|
+
* address. The address never changes on the request alone.
|
|
95
|
+
*/
|
|
96
|
+
export const changeEmail = async (baseUrl, token, input) => {
|
|
97
|
+
await call(baseUrl, "/change-email", { token, body: input });
|
|
98
|
+
};
|
|
99
|
+
/** Change the password; with `revokeOtherSessions`, every other session ends. Resolves with the token to use. */
|
|
100
|
+
export const changePassword = async (baseUrl, token, input) => {
|
|
101
|
+
const { response } = await call(baseUrl, "/change-password", { token, body: input });
|
|
102
|
+
return { token: tokenAfter(response, token) };
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Start two-factor enrollment (the password again): the authenticator app's `otpauth://` URI and ten backup codes.
|
|
106
|
+
* Nothing is required at sign-in until `confirmTwoFactor` proves a first code.
|
|
107
|
+
*/
|
|
108
|
+
export const enableTwoFactor = async (baseUrl, token, input) => {
|
|
109
|
+
const { json } = await call(baseUrl, "/two-factor/enable", { token, body: input });
|
|
110
|
+
const body = json;
|
|
111
|
+
return { totpURI: body.totpURI, backupCodes: body.backupCodes };
|
|
112
|
+
};
|
|
113
|
+
/** Finish enrollment with a first code from the app; from then on sign-in asks for a second factor. */
|
|
114
|
+
export const confirmTwoFactor = async (baseUrl, token, input) => {
|
|
115
|
+
const { response } = await call(baseUrl, "/two-factor/verify-totp", { token, body: input });
|
|
116
|
+
return { token: tokenAfter(response, token) };
|
|
117
|
+
};
|
|
118
|
+
/** Turn two-factor authentication off (the password again). */
|
|
119
|
+
export const disableTwoFactor = async (baseUrl, token, input) => {
|
|
120
|
+
const { response } = await call(baseUrl, "/two-factor/disable", { token, body: input });
|
|
121
|
+
return { token: tokenAfter(response, token) };
|
|
122
|
+
};
|
|
123
|
+
/** New backup codes (the password again); the old ones stop working. */
|
|
124
|
+
export const regenerateBackupCodes = async (baseUrl, token, input) => {
|
|
125
|
+
const { json } = await call(baseUrl, "/two-factor/generate-backup-codes", { token, body: input });
|
|
126
|
+
return { backupCodes: json.backupCodes };
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Finish a sign-in `TwoFactorRequired` interrupted: the challenge and a code from the authenticator app (`totp`) or
|
|
130
|
+
* one of the backup codes (`backup-code`, each good once). Resolves with the session.
|
|
131
|
+
*/
|
|
132
|
+
export const verifyTwoFactor = async (baseUrl, input) => {
|
|
133
|
+
const path = input.method === "backup-code" ? "/two-factor/verify-backup-code" : "/two-factor/verify-totp";
|
|
134
|
+
const { json, response } = await call(baseUrl, path, {
|
|
135
|
+
body: { code: input.code },
|
|
136
|
+
headers: { [TWO_FACTOR_CHALLENGE_HEADER]: input.challenge },
|
|
137
|
+
});
|
|
138
|
+
return sessionOf(response, json);
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Where to send the browser to sign in with an OAuth provider the deployment configured: the provider's page, which
|
|
142
|
+
* returns to the kernel and then to `callbackURL` (an origin the kernel trusts) signed in with the session cookie.
|
|
143
|
+
* An existing account is joined only when the provider verified the same address and the account's own address is
|
|
144
|
+
* verified; otherwise the sign-in is refused (`errorCallbackURL?error=account_not_linked`).
|
|
145
|
+
*/
|
|
146
|
+
export const oauthSignInUrl = async (baseUrl, input) => {
|
|
147
|
+
const { json } = await call(baseUrl, "/sign-in/social", { body: { ...input, disableRedirect: true } });
|
|
148
|
+
const url = json?.url;
|
|
149
|
+
if (typeof url !== "string")
|
|
150
|
+
throw new AuthError("The server did not return the provider's URL", 500);
|
|
151
|
+
return url;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Ask for a passwordless sign-in link (where the deployment offers magic links): mailed to the address, single use,
|
|
155
|
+
* five minutes. Answers alike whether or not the address has an account. A link to an account with two-factor
|
|
156
|
+
* authentication signs nobody in (it would skip the second factor), and one that proves an unverified account's
|
|
157
|
+
* address removes the account's earlier password and sessions first.
|
|
158
|
+
*/
|
|
159
|
+
export const requestMagicLink = async (baseUrl, input) => {
|
|
160
|
+
await call(baseUrl, "/sign-in/magic-link", { body: input });
|
|
161
|
+
};
|
|
162
|
+
/** Sign in with a magic link's token (the link itself does the same in a browser, with the session cookie). */
|
|
163
|
+
export const verifyMagicLink = async (baseUrl, token) => {
|
|
164
|
+
const { json, response } = await call(baseUrl, `/magic-link/verify?token=${encodeURIComponent(token)}`, {
|
|
165
|
+
method: "GET",
|
|
166
|
+
});
|
|
167
|
+
return sessionOf(response, json);
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=Account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,E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