@bandeira-tech/b3nd-web 0.4.0 → 0.5.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-OY4CDOHY.js → chunk-32YBATXQ.js} +17 -1
- package/dist/{chunk-45DWSOND.js → chunk-3U3TYM34.js} +5 -5
- package/dist/{chunk-RW4GWQIG.js → chunk-7PZMJECC.js} +3 -18
- package/dist/clients/http/mod.js +1 -1
- package/dist/{core-ClnuubZw.d.ts → core-BGUpkKnP.d.ts} +0 -6
- package/dist/src/mod.web.js +11 -11
- package/dist/wallet/mod.d.ts +1 -1
- package/dist/wallet/mod.js +4 -4
- package/dist/wallet-server/adapters/browser.d.ts +2 -2
- package/dist/wallet-server/adapters/browser.js +2 -2
- package/dist/wallet-server/mod.d.ts +2 -2
- package/dist/wallet-server/mod.js +2 -2
- package/package.json +1 -1
|
@@ -48,9 +48,15 @@ var HttpClient = class {
|
|
|
48
48
|
try {
|
|
49
49
|
const { protocol, domain, path } = this.parseUri(uri);
|
|
50
50
|
const requestPath = `/api/v1/write/${protocol}/${domain}${path}`;
|
|
51
|
+
const isBinary = value instanceof Uint8Array;
|
|
52
|
+
const body = isBinary ? value : JSON.stringify({ value });
|
|
53
|
+
const contentType = isBinary ? "application/octet-stream" : "application/json";
|
|
51
54
|
const response = await this.request(requestPath, {
|
|
52
55
|
method: "POST",
|
|
53
|
-
body
|
|
56
|
+
body,
|
|
57
|
+
headers: {
|
|
58
|
+
"Content-Type": contentType
|
|
59
|
+
}
|
|
54
60
|
});
|
|
55
61
|
const result = await response.json();
|
|
56
62
|
if (!response.ok) {
|
|
@@ -90,6 +96,16 @@ var HttpClient = class {
|
|
|
90
96
|
error: `Read failed: ${response.statusText}`
|
|
91
97
|
};
|
|
92
98
|
}
|
|
99
|
+
const contentType = response.headers.get("Content-Type") || "";
|
|
100
|
+
const isBinary = contentType === "application/octet-stream" || contentType.startsWith("image/") || contentType.startsWith("audio/") || contentType.startsWith("video/") || contentType.startsWith("font/") || contentType === "application/wasm";
|
|
101
|
+
if (isBinary) {
|
|
102
|
+
const buffer = await response.arrayBuffer();
|
|
103
|
+
const data = new Uint8Array(buffer);
|
|
104
|
+
return {
|
|
105
|
+
success: true,
|
|
106
|
+
record: { data, ts: Date.now() }
|
|
107
|
+
};
|
|
108
|
+
}
|
|
93
109
|
const result = await response.json();
|
|
94
110
|
return {
|
|
95
111
|
success: true,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemoryClient,
|
|
3
|
+
createTestSchema
|
|
4
|
+
} from "./chunk-O53KW746.js";
|
|
1
5
|
import {
|
|
2
6
|
WalletServerCore
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7PZMJECC.js";
|
|
4
8
|
import {
|
|
5
9
|
createAuthenticatedMessageWithHex,
|
|
6
10
|
exportPrivateKeyPem,
|
|
7
11
|
generateEncryptionKeyPair,
|
|
8
12
|
generateSigningKeyPair
|
|
9
13
|
} from "./chunk-JN75UL5C.js";
|
|
10
|
-
import {
|
|
11
|
-
MemoryClient,
|
|
12
|
-
createTestSchema
|
|
13
|
-
} from "./chunk-O53KW746.js";
|
|
14
14
|
|
|
15
15
|
// wallet/client.ts
|
|
16
16
|
var WalletClient = class {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HttpClient
|
|
3
|
-
} from "./chunk-OY4CDOHY.js";
|
|
4
1
|
import {
|
|
5
2
|
createAuthenticatedMessage,
|
|
6
3
|
createSignedEncryptedMessage,
|
|
@@ -8,9 +5,11 @@ import {
|
|
|
8
5
|
decrypt,
|
|
9
6
|
encodeHex,
|
|
10
7
|
encrypt,
|
|
11
|
-
verify,
|
|
12
8
|
verifyPayload
|
|
13
9
|
} from "./chunk-JN75UL5C.js";
|
|
10
|
+
import {
|
|
11
|
+
HttpClient
|
|
12
|
+
} from "./chunk-32YBATXQ.js";
|
|
14
13
|
|
|
15
14
|
// wallet-server/interfaces.ts
|
|
16
15
|
var defaultLogger = {
|
|
@@ -1417,20 +1416,6 @@ var WalletServerCore = class {
|
|
|
1417
1416
|
}
|
|
1418
1417
|
return { valid: false, reason: "invalid_session_status" };
|
|
1419
1418
|
}
|
|
1420
|
-
/**
|
|
1421
|
-
* Verify that a login request signature is valid for the given session pubkey.
|
|
1422
|
-
* The signature should be over the stringified login payload (without the signature field).
|
|
1423
|
-
* Uses SDK crypto for consistent verification across the codebase.
|
|
1424
|
-
*/
|
|
1425
|
-
async verifySessionSignature(sessionPubkey, signature, payload) {
|
|
1426
|
-
try {
|
|
1427
|
-
const { sessionSignature: _, ...signedPayload } = payload;
|
|
1428
|
-
return await verify(sessionPubkey, signature, signedPayload);
|
|
1429
|
-
} catch (error) {
|
|
1430
|
-
this.logger.error("Session signature verification failed:", error);
|
|
1431
|
-
return false;
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
1419
|
createApp() {
|
|
1435
1420
|
const app = new Hono();
|
|
1436
1421
|
const serverPublicKey = this.serverKeys.identityKey.publicKeyHex;
|
package/dist/clients/http/mod.js
CHANGED
|
@@ -279,12 +279,6 @@ declare class WalletServerCore {
|
|
|
279
279
|
* @returns { valid: true } if approved, { valid: false, reason } if not
|
|
280
280
|
*/
|
|
281
281
|
private sessionExists;
|
|
282
|
-
/**
|
|
283
|
-
* Verify that a login request signature is valid for the given session pubkey.
|
|
284
|
-
* The signature should be over the stringified login payload (without the signature field).
|
|
285
|
-
* Uses SDK crypto for consistent verification across the codebase.
|
|
286
|
-
*/
|
|
287
|
-
private verifySessionSignature;
|
|
288
282
|
private createApp;
|
|
289
283
|
}
|
|
290
284
|
|
package/dist/src/mod.web.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-RW4GWQIG.js";
|
|
2
|
+
AppsClient
|
|
3
|
+
} from "../chunk-VAZUCGED.js";
|
|
5
4
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../chunk-
|
|
5
|
+
WalletClient
|
|
6
|
+
} from "../chunk-3U3TYM34.js";
|
|
7
|
+
import "../chunk-O53KW746.js";
|
|
8
|
+
import "../chunk-7PZMJECC.js";
|
|
8
9
|
import {
|
|
9
10
|
mod_exports
|
|
10
11
|
} from "../chunk-JN75UL5C.js";
|
|
11
12
|
import {
|
|
12
|
-
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import {
|
|
15
|
-
WebSocketClient
|
|
16
|
-
} from "../chunk-UUHVOWVI.js";
|
|
17
|
-
import "../chunk-O53KW746.js";
|
|
13
|
+
HttpClient
|
|
14
|
+
} from "../chunk-32YBATXQ.js";
|
|
18
15
|
import {
|
|
19
16
|
LocalStorageClient
|
|
20
17
|
} from "../chunk-PZFEKQ7F.js";
|
|
18
|
+
import {
|
|
19
|
+
WebSocketClient
|
|
20
|
+
} from "../chunk-UUHVOWVI.js";
|
|
21
21
|
import "../chunk-MLKGABMK.js";
|
|
22
22
|
export {
|
|
23
23
|
AppsClient,
|
package/dist/wallet/mod.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as AuthSession, H as HealthResponse, S as SessionKeypair, U as UserCredentials, P as PasswordResetToken, a as UserPublicKeys, b as ProxyWriteRequest, c as ProxyWriteResponse, d as ProxyReadRequest, e as ProxyReadResponse, f as ProxyReadMultiRequest, g as ProxyReadMultiResponse } from '../client-DHCiJ9I7.js';
|
|
2
2
|
export { l as ApiResponse, C as ChangePasswordResponse, G as GoogleAuthSession, 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-DHCiJ9I7.js';
|
|
3
3
|
import { N as NodeProtocolInterface, S as Schema } from '../types-uuvn4oKw.js';
|
|
4
|
-
import { S as ServerKeys, W as WalletServerCore } from '../core-
|
|
4
|
+
import { S as ServerKeys, W as WalletServerCore } from '../core-BGUpkKnP.js';
|
|
5
5
|
import { MemoryClient } from '../clients/memory/mod.js';
|
|
6
6
|
import 'hono';
|
|
7
7
|
|
package/dist/wallet/mod.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
createTestEnvironment,
|
|
5
5
|
generateSessionKeypair,
|
|
6
6
|
generateTestServerKeys
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-RW4GWQIG.js";
|
|
9
|
-
import "../chunk-OY4CDOHY.js";
|
|
10
|
-
import "../chunk-JN75UL5C.js";
|
|
7
|
+
} from "../chunk-3U3TYM34.js";
|
|
11
8
|
import "../chunk-O53KW746.js";
|
|
9
|
+
import "../chunk-7PZMJECC.js";
|
|
10
|
+
import "../chunk-JN75UL5C.js";
|
|
11
|
+
import "../chunk-32YBATXQ.js";
|
|
12
12
|
import "../chunk-MLKGABMK.js";
|
|
13
13
|
export {
|
|
14
14
|
MemoryWalletClient,
|
|
@@ -1,5 +1,5 @@
|
|
|
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-BGUpkKnP.js';
|
|
2
|
+
export { C as BrowserEnvironment, M as BrowserMemoryStorage } from '../../core-BGUpkKnP.js';
|
|
3
3
|
import 'hono';
|
|
4
4
|
import '../../types-uuvn4oKw.js';
|
|
5
5
|
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
ConfigEnvironment,
|
|
3
3
|
MemoryFileStorage,
|
|
4
4
|
WalletServerCore
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-OY4CDOHY.js";
|
|
5
|
+
} from "../../chunk-7PZMJECC.js";
|
|
7
6
|
import "../../chunk-JN75UL5C.js";
|
|
7
|
+
import "../../chunk-32YBATXQ.js";
|
|
8
8
|
import {
|
|
9
9
|
LocalStorageClient
|
|
10
10
|
} from "../../chunk-PZFEKQ7F.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
1
|
+
import { P as ProxyWriteRequest, a as ProxyWriteResponse, b as ProxyReadResponse, U as UserKeys, L as Logger, H as HttpFetch } from '../core-BGUpkKnP.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-BGUpkKnP.js';
|
|
3
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';
|
|
@@ -34,9 +34,9 @@ import {
|
|
|
34
34
|
userExists,
|
|
35
35
|
verifyGoogleIdToken,
|
|
36
36
|
verifyJwt
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-OY4CDOHY.js";
|
|
37
|
+
} from "../chunk-7PZMJECC.js";
|
|
39
38
|
import "../chunk-JN75UL5C.js";
|
|
39
|
+
import "../chunk-32YBATXQ.js";
|
|
40
40
|
import "../chunk-MLKGABMK.js";
|
|
41
41
|
export {
|
|
42
42
|
ConfigEnvironment,
|