@palbase/web 4.0.0 → 4.0.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/_mls-wasm.cjs +32 -0
- package/dist/_mls-wasm.cjs.map +1 -0
- package/dist/_mls-wasm.js +11 -0
- package/dist/_mls-wasm.js.map +1 -0
- package/dist/{chunk-S7NAY3MW.js → chunk-NXEPAEF5.js} +1 -8
- package/dist/{chunk-S7NAY3MW.js.map → chunk-NXEPAEF5.js.map} +1 -1
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-NP4NIY7A.js → chunk-TGDS6VMT.js} +29 -24
- package/dist/{chunk-NP4NIY7A.js.map → chunk-TGDS6VMT.js.map} +1 -1
- package/dist/gen/cli.js +2 -1
- package/dist/gen/cli.js.map +1 -1
- package/dist/index.cjs +37 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/internal.cjs +34 -22
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +3 -2
- package/dist/next/client.cjs +34 -22
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +3 -2
- package/dist/next/client.js.map +1 -1
- package/dist/next/index.cjs +24 -22
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +3 -2
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +3 -2
- package/dist/react/index.js.map +1 -1
- package/package.json +10 -3
- package/dist/pkg/palbe_mls_bg.wasm +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/messaging/wasm/asset.ts"],"sourcesContent":["import encodedWasm from './pkg/palbe_mls_bg.wasm';\n\n// Built as a private package-import target. Keeping the bytes in their own\n// lazily imported JavaScript module lets browser bundlers carry/split the MLS\n// engine without a public-path convention, while Node ESM and CJS resolve the\n// exact same package-owned bytes.\nexport default encodedWasm;\n"],"mappings":";;;;;;AAMA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
1
|
// src/api-key.ts
|
|
8
2
|
var API_KEY_RE = /^pb_([a-z0-9]+)_[cs][A-Za-z0-9]{20}$/;
|
|
9
3
|
var PUBLISHABLE_API_KEY_RE = /^pb_([a-z0-9]+)_c[A-Za-z0-9]{20}$/;
|
|
@@ -17,8 +11,7 @@ function environmentRefFromPublishableApiKey(apiKey) {
|
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
export {
|
|
20
|
-
__export,
|
|
21
14
|
environmentRefFromApiKey,
|
|
22
15
|
environmentRefFromPublishableApiKey
|
|
23
16
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-NXEPAEF5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api-key.ts"],"sourcesContent":["/**\n * `pb_<environmentRef>_<scope><random>` → environmentRef ('' if malformed).\n * Utility for callers that only have a raw key. App-bound runtime storage and\n * palbe/next cookie naming use the explicit `PalbeConfig.environmentRef` emitted\n * by `palbe-gen`.\n *\n * The key is shape-validated (prefix `pb`, non-empty environmentRef, and a\n * `<scope><20-base62-random>` secret segment where scope ∈ {c,s}) before a ref\n * is returned. A structurally-invalid key returns '' so session storage stays\n * UNSCOPED rather than getting bound to a partially-parsed ref — a loose parse\n * (e.g. `pb_victim_cXX`) must not scope persisted sessions to `victim` and\n * hydrate a session belonging to a different, real key. The backend remains the\n * authority that rejects a bad key on the first request; this keeps the client's\n * local session-storage scoping honest. (Audit finding apikey-ref-mismatch.)\n */\nconst API_KEY_RE = /^pb_([a-z0-9]+)_[cs][A-Za-z0-9]{20}$/;\nconst PUBLISHABLE_API_KEY_RE = /^pb_([a-z0-9]+)_c[A-Za-z0-9]{20}$/;\n\nexport function environmentRefFromApiKey(apiKey: string): string {\n const m = API_KEY_RE.exec(apiKey);\n return m ? (m[1] ?? '') : '';\n}\n\n/** Internal app-runtime parser: browser config accepts publishable keys only. */\nexport function environmentRefFromPublishableApiKey(apiKey: string): string {\n const match = PUBLISHABLE_API_KEY_RE.exec(apiKey);\n return match ? (match[1] ?? '') : '';\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/api-key.ts"],"sourcesContent":["/**\n * `pb_<environmentRef>_<scope><random>` → environmentRef ('' if malformed).\n * Utility for callers that only have a raw key. App-bound runtime storage and\n * palbe/next cookie naming use the explicit `PalbeConfig.environmentRef` emitted\n * by `palbe-gen`.\n *\n * The key is shape-validated (prefix `pb`, non-empty environmentRef, and a\n * `<scope><20-base62-random>` secret segment where scope ∈ {c,s}) before a ref\n * is returned. A structurally-invalid key returns '' so session storage stays\n * UNSCOPED rather than getting bound to a partially-parsed ref — a loose parse\n * (e.g. `pb_victim_cXX`) must not scope persisted sessions to `victim` and\n * hydrate a session belonging to a different, real key. The backend remains the\n * authority that rejects a bad key on the first request; this keeps the client's\n * local session-storage scoping honest. (Audit finding apikey-ref-mismatch.)\n */\nconst API_KEY_RE = /^pb_([a-z0-9]+)_[cs][A-Za-z0-9]{20}$/;\nconst PUBLISHABLE_API_KEY_RE = /^pb_([a-z0-9]+)_c[A-Za-z0-9]{20}$/;\n\nexport function environmentRefFromApiKey(apiKey: string): string {\n const m = API_KEY_RE.exec(apiKey);\n return m ? (m[1] ?? '') : '';\n}\n\n/** Internal app-runtime parser: browser config accepts publishable keys only. */\nexport function environmentRefFromPublishableApiKey(apiKey: string): string {\n const match = PUBLISHABLE_API_KEY_RE.exec(apiKey);\n return match ? (match[1] ?? '') : '';\n}\n"],"mappings":";AAeA,IAAM,aAAa;AACnB,IAAM,yBAAyB;AAExB,SAAS,yBAAyB,QAAwB;AAC/D,QAAM,IAAI,WAAW,KAAK,MAAM;AAChC,SAAO,IAAK,EAAE,CAAC,KAAK,KAAM;AAC5B;AAGO,SAAS,oCAAoC,QAAwB;AAC1E,QAAM,QAAQ,uBAAuB,KAAK,MAAM;AAChD,SAAO,QAAS,MAAM,CAAC,KAAK,KAAM;AACpC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__export,
|
|
3
2
|
environmentRefFromPublishableApiKey
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NXEPAEF5.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-PZ5AY32C.js";
|
|
5
7
|
|
|
6
8
|
// ../core/dist/index.js
|
|
7
9
|
var CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
@@ -6432,26 +6434,25 @@ var GLUE_MODULE = "./palbe_mls_bg.js";
|
|
|
6432
6434
|
var SNIPPET_MODULE = "./snippets/mls-rs-core-f99cdecbb456b09c/inline0.js";
|
|
6433
6435
|
var inflight = null;
|
|
6434
6436
|
var ready = null;
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
const fsSpecifier = ["node", "fs/promises"].join(":");
|
|
6439
|
-
const { readFile } = await import(
|
|
6440
|
-
/* webpackIgnore: true */
|
|
6441
|
-
fsSpecifier
|
|
6442
|
-
);
|
|
6443
|
-
const bytes = await readFile(wasmUrl);
|
|
6444
|
-
return WebAssembly.compile(bytes);
|
|
6437
|
+
function decodeBase64(encoded) {
|
|
6438
|
+
if (typeof encoded !== "string" || encoded.length === 0 || typeof globalThis.atob !== "function") {
|
|
6439
|
+
throw new Error("palbe-mls WASM asset is invalid");
|
|
6445
6440
|
}
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6441
|
+
let binary;
|
|
6442
|
+
try {
|
|
6443
|
+
binary = globalThis.atob(encoded);
|
|
6444
|
+
} catch {
|
|
6445
|
+
throw new Error("palbe-mls WASM asset is invalid");
|
|
6446
|
+
}
|
|
6447
|
+
const bytes = new Uint8Array(binary.length);
|
|
6448
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
6449
|
+
bytes[index] = binary.charCodeAt(index);
|
|
6452
6450
|
}
|
|
6453
|
-
|
|
6454
|
-
|
|
6451
|
+
return bytes.buffer;
|
|
6452
|
+
}
|
|
6453
|
+
async function loadWasmModule() {
|
|
6454
|
+
const asset = await import("#palbase-mls-wasm");
|
|
6455
|
+
return WebAssembly.compile(decodeBase64(asset.default));
|
|
6455
6456
|
}
|
|
6456
6457
|
function buildImports() {
|
|
6457
6458
|
return {
|
|
@@ -6462,7 +6463,7 @@ function buildImports() {
|
|
|
6462
6463
|
function initMls() {
|
|
6463
6464
|
if (ready) return Promise.resolve(ready);
|
|
6464
6465
|
if (inflight) return inflight;
|
|
6465
|
-
|
|
6466
|
+
const attempt = (async () => {
|
|
6466
6467
|
const module2 = await loadWasmModule();
|
|
6467
6468
|
const instance = await WebAssembly.instantiate(module2, buildImports());
|
|
6468
6469
|
const setWasm = __wbg_set_wasm;
|
|
@@ -6481,7 +6482,11 @@ function initMls() {
|
|
|
6481
6482
|
ready = g;
|
|
6482
6483
|
return g;
|
|
6483
6484
|
})();
|
|
6484
|
-
|
|
6485
|
+
inflight = attempt;
|
|
6486
|
+
void attempt.catch(() => {
|
|
6487
|
+
if (inflight === attempt) inflight = null;
|
|
6488
|
+
});
|
|
6489
|
+
return attempt;
|
|
6485
6490
|
}
|
|
6486
6491
|
function requireMls() {
|
|
6487
6492
|
if (!ready) {
|
|
@@ -8934,7 +8939,7 @@ function defaultSessionStorage(key) {
|
|
|
8934
8939
|
}
|
|
8935
8940
|
|
|
8936
8941
|
// src/version.ts
|
|
8937
|
-
var VERSION = "4.0.
|
|
8942
|
+
var VERSION = "4.0.1";
|
|
8938
8943
|
|
|
8939
8944
|
// src/runtime.ts
|
|
8940
8945
|
function buildRuntime(config) {
|
|
@@ -9361,4 +9366,4 @@ export {
|
|
|
9361
9366
|
pb,
|
|
9362
9367
|
createBoundClient
|
|
9363
9368
|
};
|
|
9364
|
-
//# sourceMappingURL=chunk-
|
|
9369
|
+
//# sourceMappingURL=chunk-TGDS6VMT.js.map
|