@camstack/addon-matter-broker 0.2.139 → 0.2.140
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/addon.js +17 -17
- package/dist/addon.mjs +17 -17
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -5561,7 +5561,7 @@ var ZodIssueCode = {
|
|
|
5561
5561
|
var ZodFirstPartyTypeKind;
|
|
5562
5562
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5563
5563
|
//#endregion
|
|
5564
|
-
//#region ../types/dist/sleep-
|
|
5564
|
+
//#region ../types/dist/sleep-_sV1BE2f.mjs
|
|
5565
5565
|
/**
|
|
5566
5566
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5567
5567
|
* window to float samples (D455).
|
|
@@ -5678,7 +5678,7 @@ function isKeychainStoredField(field) {
|
|
|
5678
5678
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5679
5679
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5680
5680
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5681
|
-
function isRecord$
|
|
5681
|
+
function isRecord$6(value) {
|
|
5682
5682
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5683
5683
|
}
|
|
5684
5684
|
function makeSecretMarker(ref) {
|
|
@@ -5689,12 +5689,12 @@ function makeSecretMarker(ref) {
|
|
|
5689
5689
|
}
|
|
5690
5690
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5691
5691
|
function isSecretMarker(value) {
|
|
5692
|
-
if (!isRecord$
|
|
5692
|
+
if (!isRecord$6(value)) return false;
|
|
5693
5693
|
const ref = value["$secret"];
|
|
5694
5694
|
return typeof ref === "string" && ref.length > 0;
|
|
5695
5695
|
}
|
|
5696
5696
|
function isSecretClear(value) {
|
|
5697
|
-
return isRecord$
|
|
5697
|
+
return isRecord$6(value) && value["$secretClear"] === true;
|
|
5698
5698
|
}
|
|
5699
5699
|
/**
|
|
5700
5700
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6304,7 +6304,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6304
6304
|
}
|
|
6305
6305
|
};
|
|
6306
6306
|
var KEEP = { kind: "keep" };
|
|
6307
|
-
function isRecord$
|
|
6307
|
+
function isRecord$5(value) {
|
|
6308
6308
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6309
6309
|
}
|
|
6310
6310
|
function defaultMintId() {
|
|
@@ -6317,7 +6317,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6317
6317
|
return out;
|
|
6318
6318
|
}
|
|
6319
6319
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6320
|
-
else if (isRecord$
|
|
6320
|
+
else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6321
6321
|
return out;
|
|
6322
6322
|
}
|
|
6323
6323
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6372,7 +6372,7 @@ function rowId(row, idKey) {
|
|
|
6372
6372
|
return null;
|
|
6373
6373
|
}
|
|
6374
6374
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6375
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6375
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
|
|
6376
6376
|
if (!Array.isArray(incoming)) {
|
|
6377
6377
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6378
6378
|
return {
|
|
@@ -6388,7 +6388,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6388
6388
|
const kept = /* @__PURE__ */ new Set();
|
|
6389
6389
|
const rows = [];
|
|
6390
6390
|
for (const row of incoming) {
|
|
6391
|
-
if (!isRecord$
|
|
6391
|
+
if (!isRecord$5(row)) {
|
|
6392
6392
|
rows.push(row);
|
|
6393
6393
|
continue;
|
|
6394
6394
|
}
|
|
@@ -6413,7 +6413,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6413
6413
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6414
6414
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6415
6415
|
case "object": {
|
|
6416
|
-
if (!isRecord$
|
|
6416
|
+
if (!isRecord$5(incoming)) {
|
|
6417
6417
|
if (incoming === void 0) return KEEP;
|
|
6418
6418
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6419
6419
|
return {
|
|
@@ -6421,7 +6421,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6421
6421
|
value: incoming
|
|
6422
6422
|
};
|
|
6423
6423
|
}
|
|
6424
|
-
const storedObj = isRecord$
|
|
6424
|
+
const storedObj = isRecord$5(stored) ? stored : {};
|
|
6425
6425
|
return {
|
|
6426
6426
|
kind: "value",
|
|
6427
6427
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6544,7 +6544,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
6544
6544
|
value: items
|
|
6545
6545
|
};
|
|
6546
6546
|
}
|
|
6547
|
-
if (isRecord$
|
|
6547
|
+
if (isRecord$5(v)) {
|
|
6548
6548
|
const out = {};
|
|
6549
6549
|
for (const [k, child] of Object.entries(v)) {
|
|
6550
6550
|
const s = substitute(child);
|
|
@@ -6576,7 +6576,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
6576
6576
|
this.name = "SecretOverwriteRefusedError";
|
|
6577
6577
|
}
|
|
6578
6578
|
};
|
|
6579
|
-
function isRecord$
|
|
6579
|
+
function isRecord$4(value) {
|
|
6580
6580
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6581
6581
|
}
|
|
6582
6582
|
function resolvedValue(pass, marker) {
|
|
@@ -6605,7 +6605,7 @@ function inArray(pass, incoming, stored) {
|
|
|
6605
6605
|
return incoming.map((item, index) => {
|
|
6606
6606
|
const twin = stored[index];
|
|
6607
6607
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6608
|
-
if (isRecord$
|
|
6608
|
+
if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
|
|
6609
6609
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6610
6610
|
return item;
|
|
6611
6611
|
});
|
|
@@ -6616,7 +6616,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6616
6616
|
const twin = stored[key];
|
|
6617
6617
|
if (isSecretMarker(twin)) {
|
|
6618
6618
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6619
|
-
} else if (isRecord$
|
|
6619
|
+
} else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6620
6620
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6621
6621
|
}
|
|
6622
6622
|
return out;
|
|
@@ -6624,7 +6624,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6624
6624
|
async function walk(pass, incoming, stored) {
|
|
6625
6625
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6626
6626
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6627
|
-
if (!isRecord$
|
|
6627
|
+
if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
|
|
6628
6628
|
const out = { ...incoming };
|
|
6629
6629
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6630
6630
|
return out;
|
|
@@ -6655,7 +6655,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
6655
6655
|
function isJsonEqual(a, b) {
|
|
6656
6656
|
if (Object.is(a, b)) return true;
|
|
6657
6657
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6658
|
-
if (isRecord$
|
|
6658
|
+
if (isRecord$4(a) && isRecord$4(b)) {
|
|
6659
6659
|
const keys = Object.keys(a);
|
|
6660
6660
|
if (keys.length !== Object.keys(b).length) return false;
|
|
6661
6661
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -6679,7 +6679,7 @@ function markerKeysOf(blob, owner) {
|
|
|
6679
6679
|
}
|
|
6680
6680
|
function nodeFromStored(value, owner) {
|
|
6681
6681
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6682
|
-
if (!isRecord$
|
|
6682
|
+
if (!isRecord$4(value)) return null;
|
|
6683
6683
|
const children = /* @__PURE__ */ new Map();
|
|
6684
6684
|
for (const [key, child] of Object.entries(value)) {
|
|
6685
6685
|
const node = nodeFromStored(child, owner);
|
package/dist/addon.mjs
CHANGED
|
@@ -5559,7 +5559,7 @@ var ZodIssueCode = {
|
|
|
5559
5559
|
var ZodFirstPartyTypeKind;
|
|
5560
5560
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5561
5561
|
//#endregion
|
|
5562
|
-
//#region ../types/dist/sleep-
|
|
5562
|
+
//#region ../types/dist/sleep-_sV1BE2f.mjs
|
|
5563
5563
|
/**
|
|
5564
5564
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5565
5565
|
* window to float samples (D455).
|
|
@@ -5676,7 +5676,7 @@ function isKeychainStoredField(field) {
|
|
|
5676
5676
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5677
5677
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5678
5678
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5679
|
-
function isRecord$
|
|
5679
|
+
function isRecord$6(value) {
|
|
5680
5680
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5681
5681
|
}
|
|
5682
5682
|
function makeSecretMarker(ref) {
|
|
@@ -5687,12 +5687,12 @@ function makeSecretMarker(ref) {
|
|
|
5687
5687
|
}
|
|
5688
5688
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5689
5689
|
function isSecretMarker(value) {
|
|
5690
|
-
if (!isRecord$
|
|
5690
|
+
if (!isRecord$6(value)) return false;
|
|
5691
5691
|
const ref = value["$secret"];
|
|
5692
5692
|
return typeof ref === "string" && ref.length > 0;
|
|
5693
5693
|
}
|
|
5694
5694
|
function isSecretClear(value) {
|
|
5695
|
-
return isRecord$
|
|
5695
|
+
return isRecord$6(value) && value["$secretClear"] === true;
|
|
5696
5696
|
}
|
|
5697
5697
|
/**
|
|
5698
5698
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6302,7 +6302,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6302
6302
|
}
|
|
6303
6303
|
};
|
|
6304
6304
|
var KEEP = { kind: "keep" };
|
|
6305
|
-
function isRecord$
|
|
6305
|
+
function isRecord$5(value) {
|
|
6306
6306
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6307
6307
|
}
|
|
6308
6308
|
function defaultMintId() {
|
|
@@ -6315,7 +6315,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6315
6315
|
return out;
|
|
6316
6316
|
}
|
|
6317
6317
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6318
|
-
else if (isRecord$
|
|
6318
|
+
else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6319
6319
|
return out;
|
|
6320
6320
|
}
|
|
6321
6321
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6370,7 +6370,7 @@ function rowId(row, idKey) {
|
|
|
6370
6370
|
return null;
|
|
6371
6371
|
}
|
|
6372
6372
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6373
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6373
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
|
|
6374
6374
|
if (!Array.isArray(incoming)) {
|
|
6375
6375
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6376
6376
|
return {
|
|
@@ -6386,7 +6386,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6386
6386
|
const kept = /* @__PURE__ */ new Set();
|
|
6387
6387
|
const rows = [];
|
|
6388
6388
|
for (const row of incoming) {
|
|
6389
|
-
if (!isRecord$
|
|
6389
|
+
if (!isRecord$5(row)) {
|
|
6390
6390
|
rows.push(row);
|
|
6391
6391
|
continue;
|
|
6392
6392
|
}
|
|
@@ -6411,7 +6411,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6411
6411
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6412
6412
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6413
6413
|
case "object": {
|
|
6414
|
-
if (!isRecord$
|
|
6414
|
+
if (!isRecord$5(incoming)) {
|
|
6415
6415
|
if (incoming === void 0) return KEEP;
|
|
6416
6416
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6417
6417
|
return {
|
|
@@ -6419,7 +6419,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6419
6419
|
value: incoming
|
|
6420
6420
|
};
|
|
6421
6421
|
}
|
|
6422
|
-
const storedObj = isRecord$
|
|
6422
|
+
const storedObj = isRecord$5(stored) ? stored : {};
|
|
6423
6423
|
return {
|
|
6424
6424
|
kind: "value",
|
|
6425
6425
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6542,7 +6542,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
6542
6542
|
value: items
|
|
6543
6543
|
};
|
|
6544
6544
|
}
|
|
6545
|
-
if (isRecord$
|
|
6545
|
+
if (isRecord$5(v)) {
|
|
6546
6546
|
const out = {};
|
|
6547
6547
|
for (const [k, child] of Object.entries(v)) {
|
|
6548
6548
|
const s = substitute(child);
|
|
@@ -6574,7 +6574,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
6574
6574
|
this.name = "SecretOverwriteRefusedError";
|
|
6575
6575
|
}
|
|
6576
6576
|
};
|
|
6577
|
-
function isRecord$
|
|
6577
|
+
function isRecord$4(value) {
|
|
6578
6578
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6579
6579
|
}
|
|
6580
6580
|
function resolvedValue(pass, marker) {
|
|
@@ -6603,7 +6603,7 @@ function inArray(pass, incoming, stored) {
|
|
|
6603
6603
|
return incoming.map((item, index) => {
|
|
6604
6604
|
const twin = stored[index];
|
|
6605
6605
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6606
|
-
if (isRecord$
|
|
6606
|
+
if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
|
|
6607
6607
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6608
6608
|
return item;
|
|
6609
6609
|
});
|
|
@@ -6614,7 +6614,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6614
6614
|
const twin = stored[key];
|
|
6615
6615
|
if (isSecretMarker(twin)) {
|
|
6616
6616
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6617
|
-
} else if (isRecord$
|
|
6617
|
+
} else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6618
6618
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6619
6619
|
}
|
|
6620
6620
|
return out;
|
|
@@ -6622,7 +6622,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6622
6622
|
async function walk(pass, incoming, stored) {
|
|
6623
6623
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6624
6624
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6625
|
-
if (!isRecord$
|
|
6625
|
+
if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
|
|
6626
6626
|
const out = { ...incoming };
|
|
6627
6627
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6628
6628
|
return out;
|
|
@@ -6653,7 +6653,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
6653
6653
|
function isJsonEqual(a, b) {
|
|
6654
6654
|
if (Object.is(a, b)) return true;
|
|
6655
6655
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6656
|
-
if (isRecord$
|
|
6656
|
+
if (isRecord$4(a) && isRecord$4(b)) {
|
|
6657
6657
|
const keys = Object.keys(a);
|
|
6658
6658
|
if (keys.length !== Object.keys(b).length) return false;
|
|
6659
6659
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -6677,7 +6677,7 @@ function markerKeysOf(blob, owner) {
|
|
|
6677
6677
|
}
|
|
6678
6678
|
function nodeFromStored(value, owner) {
|
|
6679
6679
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6680
|
-
if (!isRecord$
|
|
6680
|
+
if (!isRecord$4(value)) return null;
|
|
6681
6681
|
const children = /* @__PURE__ */ new Map();
|
|
6682
6682
|
for (const [key, child] of Object.entries(value)) {
|
|
6683
6683
|
const node = nodeFromStored(child, owner);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-matter-broker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.140",
|
|
4
4
|
"description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|