@fairfox/polly 0.78.0 → 0.79.0
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/cli/polly.js +46 -3
- package/dist/cli/polly.js.map +3 -3
- package/dist/src/background/index.js.map +3 -3
- package/dist/src/background/message-router.js.map +3 -3
- package/dist/src/client/index.js +137 -32
- package/dist/src/client/index.js.map +6 -5
- package/dist/src/client/wrapper.d.ts +39 -2
- package/dist/src/elysia/index.js +22 -3
- package/dist/src/elysia/index.js.map +5 -5
- package/dist/src/elysia/route-match.d.ts +13 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +12 -2
- package/dist/src/index.js.map +7 -7
- package/dist/src/mesh.js +28 -9
- package/dist/src/mesh.js.map +10 -9
- package/dist/src/peer.js +6 -2
- package/dist/src/peer.js.map +5 -5
- package/dist/src/polly-ui/Badge.d.ts +5 -0
- package/dist/src/polly-ui/Button.d.ts +31 -6
- package/dist/src/polly-ui/Dropdown.d.ts +6 -0
- package/dist/src/polly-ui/Select.d.ts +11 -1
- package/dist/src/polly-ui/TextInput.d.ts +30 -0
- package/dist/src/polly-ui/index.css +10 -0
- package/dist/src/polly-ui/index.js +81 -32
- package/dist/src/polly-ui/index.js.map +10 -10
- package/dist/src/polly-ui/styles.css +10 -0
- package/dist/src/shared/adapters/index.js.map +3 -3
- package/dist/src/shared/lib/context-helpers.js.map +3 -3
- package/dist/src/shared/lib/message-bus.js.map +3 -3
- package/dist/src/shared/lib/resource.js +11 -2
- package/dist/src/shared/lib/resource.js.map +6 -6
- package/dist/src/shared/lib/state.d.ts +20 -0
- package/dist/src/shared/lib/state.js +11 -1
- package/dist/src/shared/lib/state.js.map +5 -5
- package/dist/src/shared/state/app-state.js +10 -1
- package/dist/src/shared/state/app-state.js.map +5 -5
- package/dist/tools/init/src/cli.js +23 -2
- package/dist/tools/init/src/cli.js.map +4 -4
- package/dist/tools/init/templates/pwa/package.json.template +1 -1
- package/dist/tools/init/templates/pwa/src/service-worker.ts.template +26 -15
- package/dist/tools/init/templates/pwa/src/shared-worker.ts.template +13 -3
- package/dist/tools/init/templates/pwa/tsconfig.json.template +2 -2
- package/dist/tools/init/templates/pwa/tsconfig.worker.json.template +17 -0
- package/dist/tools/test/src/browser/index.js +5 -2
- package/dist/tools/test/src/browser/index.js.map +3 -3
- package/dist/tools/test/src/contrast/index.js +20 -15
- package/dist/tools/test/src/contrast/index.js.map +3 -3
- package/dist/tools/test/src/e2e-cli/index.d.ts +10 -0
- package/dist/tools/test/src/e2e-cli/run-cli.d.ts +25 -0
- package/dist/tools/test/src/e2e-cli/with-temp-dir.d.ts +15 -0
- package/dist/tools/test/src/e2e-mesh/index.js +12 -7
- package/dist/tools/test/src/e2e-mesh/index.js.map +4 -4
- package/dist/tools/test/src/e2e-mesh/launch-peer.d.ts +7 -1
- package/dist/tools/test/src/e2e-relay/index.d.ts +12 -0
- package/dist/tools/test/src/e2e-relay/wait-for-relay-convergence.d.ts +27 -0
- package/dist/tools/test/src/e2e-relay/with-repo-server.d.ts +24 -0
- package/dist/tools/test/src/e2e-shared/assert.d.ts +18 -0
- package/dist/tools/test/src/e2e-shared/contract.d.ts +40 -0
- package/dist/tools/test/src/e2e-shared/index.d.ts +2 -0
- package/dist/tools/test/src/tiers/args.d.ts +23 -0
- package/dist/tools/test/src/tiers/cli.d.ts +2 -0
- package/dist/tools/test/src/tiers/cli.js +490 -0
- package/dist/tools/test/src/tiers/cli.js.map +16 -0
- package/dist/tools/test/src/tiers/detect.d.ts +12 -0
- package/dist/tools/test/src/tiers/discover.d.ts +2 -0
- package/dist/tools/test/src/tiers/engine.d.ts +3 -0
- package/dist/tools/test/src/tiers/index.d.ts +14 -0
- package/dist/tools/test/src/tiers/protocol.d.ts +10 -0
- package/dist/tools/test/src/tiers/reporter.d.ts +12 -0
- package/dist/tools/test/src/tiers/types.d.ts +94 -0
- package/dist/tools/test/src/tiers/worker.d.ts +2 -0
- package/dist/tools/test/src/tiers/worker.js +60 -0
- package/dist/tools/test/src/tiers/worker.js.map +12 -0
- package/dist/tools/verify/src/cli.js +165 -30
- package/dist/tools/verify/src/cli.js.map +7 -6
- package/dist/tools/verify/src/stryker/index.js +20 -11
- package/dist/tools/verify/src/stryker/index.js.map +3 -3
- package/dist/tools/visualize/src/cli.js +8 -5
- package/dist/tools/visualize/src/cli.js.map +4 -4
- package/package.json +16 -6
package/dist/src/mesh.js
CHANGED
|
@@ -257,6 +257,17 @@ var init_encryption = __esm(() => {
|
|
|
257
257
|
};
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
+
// src/shared/lib/guards.ts
|
|
261
|
+
function hasKeyInObject(input, key) {
|
|
262
|
+
return typeof input === "object" && input !== null && Object.hasOwn(input, key);
|
|
263
|
+
}
|
|
264
|
+
function isRecord(input) {
|
|
265
|
+
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
266
|
+
}
|
|
267
|
+
function assertNever(value) {
|
|
268
|
+
throw new Error(`assertNever: unexpected value ${JSON.stringify(value)}`);
|
|
269
|
+
}
|
|
270
|
+
|
|
260
271
|
// src/shared/lib/wasm-init.ts
|
|
261
272
|
import wasmPath from "@automerge/automerge/automerge.wasm";
|
|
262
273
|
import { initializeWasm } from "@automerge/automerge-repo/slim";
|
|
@@ -437,7 +448,7 @@ class IndexedDBBlobCache {
|
|
|
437
448
|
totalSize += value.size;
|
|
438
449
|
if (!value.pinned) {
|
|
439
450
|
candidates.push({
|
|
440
|
-
hash: key,
|
|
451
|
+
hash: String(key),
|
|
441
452
|
accessedAt: value.accessedAt,
|
|
442
453
|
size: value.size
|
|
443
454
|
});
|
|
@@ -1251,6 +1262,10 @@ class MeshNetworkAdapter extends NetworkAdapter {
|
|
|
1251
1262
|
return;
|
|
1252
1263
|
}
|
|
1253
1264
|
const tag = payload[0];
|
|
1265
|
+
if (tag === undefined) {
|
|
1266
|
+
emitMeshDiagnostic({ kind: "drop:empty-control-payload", senderId });
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1254
1269
|
const body = payload.subarray(1);
|
|
1255
1270
|
switch (tag) {
|
|
1256
1271
|
case MESH_CONTROL_TYPE.Sync:
|
|
@@ -2476,15 +2491,17 @@ function partitionStats(report) {
|
|
|
2476
2491
|
retransmittedPacketsSent: undefined,
|
|
2477
2492
|
retransmittedBytesSent: undefined
|
|
2478
2493
|
};
|
|
2479
|
-
const iter = report.values
|
|
2494
|
+
const iter = hasStatsIterator(report) ? report.values() : [];
|
|
2480
2495
|
for (const raw of iter) {
|
|
2481
|
-
if (!raw
|
|
2496
|
+
if (!isRecord(raw))
|
|
2482
2497
|
continue;
|
|
2483
|
-
|
|
2484
|
-
ingestStat(stat, out);
|
|
2498
|
+
ingestStat(raw, out);
|
|
2485
2499
|
}
|
|
2486
2500
|
return out;
|
|
2487
2501
|
}
|
|
2502
|
+
function hasStatsIterator(report) {
|
|
2503
|
+
return report !== null && typeof report === "object" && "values" in report && typeof report.values === "function";
|
|
2504
|
+
}
|
|
2488
2505
|
function ingestStat(stat, out) {
|
|
2489
2506
|
const id = String(stat["id"]);
|
|
2490
2507
|
switch (stat["type"]) {
|
|
@@ -3630,11 +3647,13 @@ function decodeRevocationSummary(bytes) {
|
|
|
3630
3647
|
if (!item || typeof item !== "object") {
|
|
3631
3648
|
throw new Error(`decodeRevocationSummary: entry ${index} is not an object`);
|
|
3632
3649
|
}
|
|
3633
|
-
const
|
|
3634
|
-
|
|
3650
|
+
const r = "r" in item ? item.r : undefined;
|
|
3651
|
+
const i = "i" in item ? item.i : undefined;
|
|
3652
|
+
const t = "t" in item ? item.t : undefined;
|
|
3653
|
+
if (typeof r !== "string" || typeof i !== "string" || typeof t !== "number") {
|
|
3635
3654
|
throw new Error(`decodeRevocationSummary: entry ${index} has missing or wrong-typed fields`);
|
|
3636
3655
|
}
|
|
3637
|
-
return { revokedPeerId:
|
|
3656
|
+
return { revokedPeerId: r, issuerPeerId: i, issuedAt: t };
|
|
3638
3657
|
});
|
|
3639
3658
|
}
|
|
3640
3659
|
function compareSummaryEntries(a, b) {
|
|
@@ -4332,4 +4351,4 @@ export {
|
|
|
4332
4351
|
$meshCounter
|
|
4333
4352
|
};
|
|
4334
4353
|
|
|
4335
|
-
//# debugId=
|
|
4354
|
+
//# debugId=7FA8CE30CEE539D264756E2164756E21
|