@bandeira-tech/b3nd-web 0.3.0 → 0.3.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/dist/{chunk-4C4YY2X7.js → chunk-B4VAPGAO.js} +191 -14
- package/dist/{chunk-IILPY4TK.js → chunk-GWPCZVXV.js} +198 -48
- package/dist/{chunk-OXHGNAQJ.js → chunk-O53KW746.js} +25 -1
- package/dist/{chunk-LFUC4ETD.js → chunk-OY4CDOHY.js} +45 -0
- package/dist/{chunk-7U5JDFQW.js → chunk-PZFEKQ7F.js} +24 -0
- package/dist/{chunk-T43IWAQK.js → chunk-UUHVOWVI.js} +29 -0
- package/dist/{client-fsiY-9VW.d.ts → client-C4oQxiDu.d.ts} +102 -11
- package/dist/clients/http/mod.d.ts +3 -1
- package/dist/clients/http/mod.js +1 -1
- package/dist/clients/local-storage/mod.d.ts +2 -1
- package/dist/clients/local-storage/mod.js +1 -1
- package/dist/clients/memory/mod.d.ts +2 -1
- package/dist/clients/memory/mod.js +1 -1
- package/dist/clients/websocket/mod.d.ts +2 -1
- package/dist/clients/websocket/mod.js +1 -1
- package/dist/{core-BLTm0eu6.d.ts → core-ClnuubZw.d.ts} +16 -1
- package/dist/src/mod.web.d.ts +2 -2
- package/dist/src/mod.web.js +8 -8
- package/dist/{types-oQCx3U-_.d.ts → types-uuvn4oKw.d.ts} +36 -2
- package/dist/wallet/mod.d.ts +52 -12
- package/dist/wallet/mod.js +6 -4
- package/dist/wallet-server/adapters/browser.d.ts +3 -3
- package/dist/wallet-server/adapters/browser.js +3 -3
- package/dist/wallet-server/mod.d.ts +8 -5
- package/dist/wallet-server/mod.js +2 -2
- package/package.json +1 -1
package/dist/wallet/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AuthSession, H as HealthResponse, U as UserCredentials, P as PasswordResetToken, a as UserPublicKeys, b as ProxyWriteRequest, c as ProxyWriteResponse, d as ProxyReadRequest, e as ProxyReadResponse, G as GoogleAuthSession } from '../client-
|
|
2
|
-
export {
|
|
3
|
-
import { N as NodeProtocolInterface, S as Schema } from '../types-
|
|
4
|
-
import { S as ServerKeys, W as WalletServerCore } from '../core-
|
|
1
|
+
import { A as AuthSession, H as HealthResponse, U as UserCredentials, S as SessionKeypair, P as PasswordResetToken, a as UserPublicKeys, b as ProxyWriteRequest, c as ProxyWriteResponse, d as ProxyReadRequest, e as ProxyReadResponse, f as ProxyReadMultiRequest, g as ProxyReadMultiResponse, G as GoogleAuthSession } from '../client-C4oQxiDu.js';
|
|
2
|
+
export { l as ApiResponse, C as ChangePasswordResponse, q as GoogleLoginResponse, p as GoogleSignupResponse, L as LoginResponse, k as ProxyReadMultiResultItem, n as PublicKeysResponse, R as RequestPasswordResetResponse, o as ResetPasswordResponse, m as SignupResponse, W as WalletClient, j as WalletClientConfig, i as WalletClientInterface, h as generateSessionKeypair } from '../client-C4oQxiDu.js';
|
|
3
|
+
import { N as NodeProtocolInterface, S as Schema } from '../types-uuvn4oKw.js';
|
|
4
|
+
import { S as ServerKeys, W as WalletServerCore } from '../core-ClnuubZw.js';
|
|
5
5
|
import { MemoryClient } from '../clients/memory/mod.js';
|
|
6
6
|
import 'hono';
|
|
7
7
|
|
|
@@ -107,8 +107,32 @@ declare class MemoryWalletClient {
|
|
|
107
107
|
}>;
|
|
108
108
|
signup(_credentials: UserCredentials): Promise<AuthSession>;
|
|
109
109
|
login(_credentials: UserCredentials): Promise<AuthSession>;
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Sign up with session keypair (scoped to an app)
|
|
112
|
+
*
|
|
113
|
+
* The session must be approved by the app beforehand:
|
|
114
|
+
* 1. Client writes request to: immutable://inbox/{appKey}/sessions/{sessionPubkey} = 1
|
|
115
|
+
* 2. App approves by writing: mutable://accounts/{appKey}/sessions/{sessionPubkey} = 1
|
|
116
|
+
* 3. Client calls this method with the session keypair
|
|
117
|
+
*
|
|
118
|
+
* @param appKey - The app's public key
|
|
119
|
+
* @param session - Session keypair (generated via generateSessionKeypair)
|
|
120
|
+
* @param credentials - User credentials (username/password)
|
|
121
|
+
*/
|
|
122
|
+
signupWithToken(appKey: string, session: SessionKeypair, credentials: UserCredentials): Promise<AuthSession>;
|
|
123
|
+
/**
|
|
124
|
+
* Login with session keypair (scoped to an app)
|
|
125
|
+
*
|
|
126
|
+
* The session must be approved by the app beforehand:
|
|
127
|
+
* 1. Client writes request to: immutable://inbox/{appKey}/sessions/{sessionPubkey} = 1
|
|
128
|
+
* 2. App approves by writing: mutable://accounts/{appKey}/sessions/{sessionPubkey} = 1
|
|
129
|
+
* 3. Client calls this method with the session keypair
|
|
130
|
+
*
|
|
131
|
+
* @param appKey - The app's public key
|
|
132
|
+
* @param session - Session keypair (generated via generateSessionKeypair)
|
|
133
|
+
* @param credentials - User credentials (username/password)
|
|
134
|
+
*/
|
|
135
|
+
loginWithTokenSession(appKey: string, session: SessionKeypair, credentials: UserCredentials): Promise<AuthSession>;
|
|
112
136
|
changePassword(appKey: string, oldPassword: string, newPassword: string): Promise<void>;
|
|
113
137
|
requestPasswordReset(_username: string): Promise<PasswordResetToken>;
|
|
114
138
|
resetPassword(_username: string, _resetToken: string, _newPassword: string): Promise<AuthSession>;
|
|
@@ -118,8 +142,21 @@ declare class MemoryWalletClient {
|
|
|
118
142
|
getMyPublicKeys(appKey: string): Promise<UserPublicKeys>;
|
|
119
143
|
proxyWrite(request: ProxyWriteRequest): Promise<ProxyWriteResponse>;
|
|
120
144
|
proxyRead(request: ProxyReadRequest): Promise<ProxyReadResponse>;
|
|
145
|
+
proxyReadMulti(request: ProxyReadMultiRequest): Promise<ProxyReadMultiResponse>;
|
|
121
146
|
signupWithGoogle(appKey: string, token: string, googleIdToken: string): Promise<GoogleAuthSession>;
|
|
122
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Login with Google OAuth (scoped to app token and session keypair)
|
|
149
|
+
* Returns session data with Google profile info - call setSession() to activate it
|
|
150
|
+
*
|
|
151
|
+
* The session must be approved by the app beforehand.
|
|
152
|
+
*
|
|
153
|
+
* @param appKey - The app's public key
|
|
154
|
+
* @param token - App token from app server
|
|
155
|
+
* @param session - Session keypair (generated via generateSessionKeypair)
|
|
156
|
+
* @param googleIdToken - Google ID token from Google Sign-In
|
|
157
|
+
* @returns GoogleAuthSession with username, JWT token, and Google profile info
|
|
158
|
+
*/
|
|
159
|
+
loginWithGoogle(appKey: string, token: string, session: SessionKeypair, googleIdToken: string): Promise<GoogleAuthSession>;
|
|
123
160
|
/**
|
|
124
161
|
* Get the underlying WalletServerCore (for testing/inspection)
|
|
125
162
|
*/
|
|
@@ -197,28 +234,31 @@ interface TestEnvironment {
|
|
|
197
234
|
serverKeys: ServerKeys;
|
|
198
235
|
/**
|
|
199
236
|
* Sign up a test user and set the session.
|
|
237
|
+
* Automatically generates and approves a session keypair for testing.
|
|
200
238
|
*
|
|
201
239
|
* @param appKey - App key for the signup
|
|
202
240
|
* @param username - Username
|
|
203
241
|
* @param password - Password
|
|
204
|
-
* @returns Session
|
|
242
|
+
* @returns Session, user public keys, and the session keypair used
|
|
205
243
|
*/
|
|
206
244
|
signupTestUser(appKey: string, username: string, password: string): Promise<{
|
|
207
245
|
session: AuthSession;
|
|
208
246
|
keys: UserPublicKeys;
|
|
247
|
+
sessionKeypair: SessionKeypair;
|
|
209
248
|
}>;
|
|
210
249
|
/**
|
|
211
250
|
* Login a test user and set the session.
|
|
251
|
+
* Automatically generates and approves a session keypair for testing.
|
|
212
252
|
*
|
|
213
253
|
* @param appKey - App key for the login
|
|
214
|
-
* @param sessionKey - Session key (can be any string for tests)
|
|
215
254
|
* @param username - Username
|
|
216
255
|
* @param password - Password
|
|
217
|
-
* @returns Session
|
|
256
|
+
* @returns Session, user public keys, and the session keypair used
|
|
218
257
|
*/
|
|
219
|
-
loginTestUser(appKey: string,
|
|
258
|
+
loginTestUser(appKey: string, username: string, password: string): Promise<{
|
|
220
259
|
session: AuthSession;
|
|
221
260
|
keys: UserPublicKeys;
|
|
261
|
+
sessionKeypair: SessionKeypair;
|
|
222
262
|
}>;
|
|
223
263
|
/**
|
|
224
264
|
* Clean up the test environment.
|
|
@@ -267,4 +307,4 @@ interface TestEnvironment {
|
|
|
267
307
|
*/
|
|
268
308
|
declare function createTestEnvironment(config?: TestEnvironmentConfig): Promise<TestEnvironment>;
|
|
269
309
|
|
|
270
|
-
export { AuthSession, GoogleAuthSession, HealthResponse, MemoryWalletClient, type MemoryWalletClientConfig, PasswordResetToken, ProxyReadRequest, ProxyReadResponse, ProxyWriteRequest, ProxyWriteResponse, type TestEnvironment, type TestEnvironmentConfig, UserCredentials, UserPublicKeys, createTestEnvironment, generateTestServerKeys };
|
|
310
|
+
export { AuthSession, GoogleAuthSession, HealthResponse, MemoryWalletClient, type MemoryWalletClientConfig, PasswordResetToken, ProxyReadMultiRequest, ProxyReadMultiResponse, ProxyReadRequest, ProxyReadResponse, ProxyWriteRequest, ProxyWriteResponse, SessionKeypair, type TestEnvironment, type TestEnvironmentConfig, UserCredentials, UserPublicKeys, createTestEnvironment, generateTestServerKeys };
|
package/dist/wallet/mod.js
CHANGED
|
@@ -2,16 +2,18 @@ import {
|
|
|
2
2
|
MemoryWalletClient,
|
|
3
3
|
WalletClient,
|
|
4
4
|
createTestEnvironment,
|
|
5
|
+
generateSessionKeypair,
|
|
5
6
|
generateTestServerKeys
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-4C4YY2X7.js";
|
|
7
|
+
} from "../chunk-GWPCZVXV.js";
|
|
8
|
+
import "../chunk-B4VAPGAO.js";
|
|
9
9
|
import "../chunk-JN75UL5C.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-OY4CDOHY.js";
|
|
11
|
+
import "../chunk-O53KW746.js";
|
|
11
12
|
import "../chunk-MLKGABMK.js";
|
|
12
13
|
export {
|
|
13
14
|
MemoryWalletClient,
|
|
14
15
|
WalletClient,
|
|
15
16
|
createTestEnvironment,
|
|
17
|
+
generateSessionKeypair,
|
|
16
18
|
generateTestServerKeys
|
|
17
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as FileStorage, S as ServerKeys, W as WalletServerCore } from '../../core-
|
|
2
|
-
export { C as BrowserEnvironment, M as BrowserMemoryStorage } from '../../core-
|
|
1
|
+
import { F as FileStorage, S as ServerKeys, W as WalletServerCore } from '../../core-ClnuubZw.js';
|
|
2
|
+
export { C as BrowserEnvironment, M as BrowserMemoryStorage } from '../../core-ClnuubZw.js';
|
|
3
3
|
import 'hono';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-uuvn4oKw.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Browser Adapter for Wallet Server
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
ConfigEnvironment,
|
|
3
3
|
MemoryFileStorage,
|
|
4
4
|
WalletServerCore
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-B4VAPGAO.js";
|
|
6
6
|
import "../../chunk-JN75UL5C.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-OY4CDOHY.js";
|
|
8
8
|
import {
|
|
9
9
|
LocalStorageClient
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-PZFEKQ7F.js";
|
|
11
11
|
import "../../chunk-MLKGABMK.js";
|
|
12
12
|
|
|
13
13
|
// wallet-server/adapters/browser.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProxyWriteRequest, a as ProxyWriteResponse, b as ProxyReadResponse, U as UserKeys, L as Logger, H as HttpFetch } from '../core-
|
|
2
|
-
export { A as AppBackendConfig, f as AuthSessionResponse, C as ConfigEnvironment, E as Environment, F as FileStorage, h as HealthResponse, M as MemoryFileStorage, g as PublicKeysResponse, R as ResolvedWalletServerConfig, e as ServerKeyPair, S as ServerKeys, i as ServerKeysResponse, c as WalletServerConfig, W as WalletServerCore, d as WalletServerDeps, j as defaultLogger } from '../core-
|
|
3
|
-
import { N as NodeProtocolInterface } from '../types-
|
|
1
|
+
import { P as ProxyWriteRequest, a as ProxyWriteResponse, b as ProxyReadResponse, U as UserKeys, L as Logger, H as HttpFetch } from '../core-ClnuubZw.js';
|
|
2
|
+
export { A as AppBackendConfig, f as AuthSessionResponse, C as ConfigEnvironment, E as Environment, F as FileStorage, h as HealthResponse, M as MemoryFileStorage, g as PublicKeysResponse, R as ResolvedWalletServerConfig, e as ServerKeyPair, S as ServerKeys, i as ServerKeysResponse, c as WalletServerConfig, W as WalletServerCore, d as WalletServerDeps, j as defaultLogger } from '../core-ClnuubZw.js';
|
|
3
|
+
import { N as NodeProtocolInterface } from '../types-uuvn4oKw.js';
|
|
4
4
|
import { S as SignedEncryptedMessage, E as EncryptedPayload } from '../mod-CII9wqu2.js';
|
|
5
5
|
import 'hono';
|
|
6
6
|
|
|
@@ -143,7 +143,7 @@ declare function createUser(client: NodeProtocolInterface, serverPublicKey: stri
|
|
|
143
143
|
/**
|
|
144
144
|
* Authenticate user with password
|
|
145
145
|
*/
|
|
146
|
-
declare function authenticateUser(client: NodeProtocolInterface, serverPublicKey: string, username: string, password: string,
|
|
146
|
+
declare function authenticateUser(client: NodeProtocolInterface, serverPublicKey: string, username: string, password: string, serverEncryptionPrivateKeyPem: string, appScope?: string, logger?: Logger): Promise<boolean>;
|
|
147
147
|
/**
|
|
148
148
|
* Change user password
|
|
149
149
|
*/
|
|
@@ -193,7 +193,10 @@ interface CredentialResult {
|
|
|
193
193
|
*/
|
|
194
194
|
interface BaseCredentialPayload {
|
|
195
195
|
type: string;
|
|
196
|
-
session
|
|
196
|
+
/** Session public key (hex). Required for login - identifies the session. */
|
|
197
|
+
sessionPubkey?: string;
|
|
198
|
+
/** Signature of the login payload by session private key (hex). Required for login. */
|
|
199
|
+
sessionSignature?: string;
|
|
197
200
|
}
|
|
198
201
|
/**
|
|
199
202
|
* Password credential payload
|
|
@@ -34,9 +34,9 @@ import {
|
|
|
34
34
|
userExists,
|
|
35
35
|
verifyGoogleIdToken,
|
|
36
36
|
verifyJwt
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-B4VAPGAO.js";
|
|
38
38
|
import "../chunk-JN75UL5C.js";
|
|
39
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-OY4CDOHY.js";
|
|
40
40
|
import "../chunk-MLKGABMK.js";
|
|
41
41
|
export {
|
|
42
42
|
ConfigEnvironment,
|