@terminal3/t3n-sdk 5.0.0 → 5.1.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/index.js +1 -1
- package/dist/index.d.ts +30 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1483,6 +1483,12 @@ interface OrgDataActionWire {
|
|
|
1483
1483
|
* calling agent to be the `grantee` of at least one grant (subject binding), so
|
|
1484
1484
|
* an unregistered agent discovers nothing regardless of this list.
|
|
1485
1485
|
*
|
|
1486
|
+
* Every entry must be a canonical `did:t3n:<40-hex>` identifier. The contract
|
|
1487
|
+
* decodes each one to its 20 bytes, so a value of any other shape refuses the
|
|
1488
|
+
* whole document (the error names the failing index), and two hex casings of one
|
|
1489
|
+
* DID are a duplicate rather than two entries — also a refusal. Use
|
|
1490
|
+
* {@link mergeDiscoverDids} to build the list rather than concatenating.
|
|
1491
|
+
*
|
|
1486
1492
|
* The document IS the new state on a write: an empty `grants` list revokes all
|
|
1487
1493
|
* delegated access, and an empty `discover_dids` persists an empty
|
|
1488
1494
|
* discovery-grant list (there is no per-field merge). Use {@link mergeGrants} /
|
|
@@ -1519,8 +1525,20 @@ declare function mergeGrants(existing: BoundGrant[], additions: BoundGrant[]): G
|
|
|
1519
1525
|
/**
|
|
1520
1526
|
* Order-preserving deduplicating union of discovery-grant DID lists — the
|
|
1521
1527
|
* read-merge-write counterpart of {@link mergeGrants} for the document-level
|
|
1522
|
-
* `discover_dids
|
|
1523
|
-
*
|
|
1528
|
+
* `discover_dids`.
|
|
1529
|
+
*
|
|
1530
|
+
* A DID's identity is the 20 bytes it decodes to, not its spelling. The contract
|
|
1531
|
+
* dedupes on those bytes and treats a repeat as a hard error over the WHOLE
|
|
1532
|
+
* document, so unioning `did:t3n:AABB…` with `did:t3n:aabb…` has to yield one
|
|
1533
|
+
* entry — matching on the raw string would emit both and lose the write. Each
|
|
1534
|
+
* recognised entry is emitted in canonical lowercase, the form the contract
|
|
1535
|
+
* stores and a later `member-delegation-get` returns, so repeated
|
|
1536
|
+
* read-merge-write cycles converge instead of oscillating.
|
|
1537
|
+
*
|
|
1538
|
+
* An entry that is not a `did:t3n:<40-hex>` identifier at all passes through
|
|
1539
|
+
* verbatim and dedupes by exact string: the contract refuses it and names its
|
|
1540
|
+
* index, which is more use to the caller than this helper dropping it or folding
|
|
1541
|
+
* it into an unrelated entry.
|
|
1524
1542
|
*/
|
|
1525
1543
|
declare function mergeDiscoverDids(existing: string[], additions: string[]): string[];
|
|
1526
1544
|
/**
|
|
@@ -1617,10 +1635,16 @@ interface AgentAuthEntry {
|
|
|
1617
1635
|
* in `agents` (subject binding), so an unregistered agent discovers nothing
|
|
1618
1636
|
* regardless of this list.
|
|
1619
1637
|
*
|
|
1638
|
+
* Every entry must be a canonical `did:t3n:<40-hex>` identifier. The legacy
|
|
1639
|
+
* document is converted onto the current one before it is stored, and that
|
|
1640
|
+
* conversion decodes each entry, so anything else refuses the write with the
|
|
1641
|
+
* failing index named.
|
|
1642
|
+
*
|
|
1620
1643
|
* @deprecated Use {@link MemberDelegationDoc}.
|
|
1621
1644
|
*/
|
|
1622
1645
|
interface AgentAuthPolicy {
|
|
1623
1646
|
agents: AgentAuthEntry[];
|
|
1647
|
+
/** Document-level discovery grants (`did:t3n:<40-hex>` entries). */
|
|
1624
1648
|
discoverDids: string[];
|
|
1625
1649
|
}
|
|
1626
1650
|
/**
|
|
@@ -1668,6 +1692,10 @@ interface AgentAuthUpdateInput {
|
|
|
1668
1692
|
* deny-all egress. The document-level `discover_dids` is emitted only when
|
|
1669
1693
|
* non-empty; the contract defaults an absent list to empty.
|
|
1670
1694
|
*
|
|
1695
|
+
* Discovery DIDs are copied through verbatim — no canonicalisation, no dedupe —
|
|
1696
|
+
* so a non-canonical or repeated entry is refused by the contract rather than
|
|
1697
|
+
* quietly repaired here. Build the list with `mergeDiscoverDids`.
|
|
1698
|
+
*
|
|
1671
1699
|
* @deprecated The new write path passes `MemberDelegationDoc` straight through
|
|
1672
1700
|
* with no casing transform.
|
|
1673
1701
|
*/
|