@tinycloud/sdk-services 3.8.0-beta.1 → 3.8.0-beta.16

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.
@@ -591,7 +591,9 @@ type ReplicaGateReason =
591
591
  /** Browser only: the `localStorage` logout marker is set. */
592
592
  | "logout_pending"
593
593
  /** The gate store itself could not be read; fail closed. */
594
- | "gate_unavailable";
594
+ | "gate_unavailable"
595
+ /** Browser: replication is configured but no wallet provider can prove the connected account. */
596
+ | "wallet_provider_required";
595
597
  /** Shape of every gate refusal error: `Error & { code: "REPLICA_GATED"; gate }`. */
596
598
  interface ReplicaGatedError extends Error {
597
599
  code: "REPLICA_GATED";
@@ -877,6 +879,63 @@ interface ReplicaLifecycleGate {
877
879
  }): Promise<ReplicaEraseReport>;
878
880
  /** Outstanding intents; non-empty means status `purgePending: true`. */
879
881
  pendingPurge(): Promise<ReplicaPurgeIntent[]>;
882
+ /**
883
+ * Browser only. Under the gate lock, erases pending intents and deletes the whole origin
884
+ * database. Deletes only when nothing live is at stake: the gate is denied (null principal),
885
+ * the gate is behind the persisted deny tombstone, or the logout marker is set with a tombstone.
886
+ * A live or other-account gate is `refused` and left untouched. On a failed delete it sets the
887
+ * logout marker (when a tombstone exists) so `recover` finishes the erase on the next load.
888
+ * Never clears the deny tombstone.
889
+ */
890
+ eraseLocalCopy?(o: {
891
+ signal: AbortSignal;
892
+ }): Promise<ReplicaLocalEraseOutcome>;
893
+ }
894
+ /** Result of {@link ReplicaLifecycleGate.eraseLocalCopy}. */
895
+ type ReplicaLocalEraseOutcome =
896
+ /** The database is gone and the logout marker (if any) is cleared. */
897
+ {
898
+ status: "erased";
899
+ }
900
+ /** Delete blocked or storage error; a retry can succeed. `marker` is true when the next-load marker is set. */
901
+ | {
902
+ status: "failed";
903
+ code: string;
904
+ marker: boolean;
905
+ }
906
+ /** The gate does not authorize destruction; nothing was deleted. A retry cannot succeed until the gate is denied. */
907
+ | {
908
+ status: "refused";
909
+ code: string;
910
+ };
911
+ /** What triggered a local-copy erase. */
912
+ type ReplicaPurgeTrigger = "sign_out" | "account_switch" | "purge_local_copy";
913
+ /** Result of `replication.purgeLocalCopy()`. `retryNow` means a short bounded retry is meaningful. */
914
+ type ReplicaPurgeLocalCopyResult = {
915
+ ok: true;
916
+ } | {
917
+ ok: false;
918
+ retryNow: boolean;
919
+ };
920
+ /**
921
+ * Emitted (`on("replica.purge.failed", …)`) when the local copy could not be erased after the
922
+ * bounded retries. The SDK finishes the erase on the next load through the logout marker.
923
+ */
924
+ interface ReplicaPurgeFailedEvent {
925
+ type: "replica.purge.failed";
926
+ trigger: ReplicaPurgeTrigger;
927
+ /** Typed reason: `logout_pending` (marker set, erase retried on next load) or `gate_unavailable`. */
928
+ reason: ReplicaGateReason;
929
+ /** Storage error code of the last attempt. */
930
+ code: string;
931
+ /** True when a short bounded retry is meaningful (delete blocked or storage error). */
932
+ retryNow: boolean;
933
+ }
934
+ /** Rejection of `signOut()` when the deny itself was `unguarded` and the erase did not complete. */
935
+ interface ReplicaPurgeError extends Error {
936
+ code: "REPLICA_PURGE_FAILED";
937
+ reason: ReplicaGateReason;
938
+ retryNow: boolean;
880
939
  }
881
940
  /** Node/CLI profile-local fencing token, not a secret capability; the profile lock remains authoritative. */
882
941
  interface ProfileReplicaDeferredToken {
@@ -1401,6 +1460,8 @@ interface KVReplicaSpec {
1401
1460
  grantPolicy?: ReplicaGrantPolicy;
1402
1461
  /** Quota settings; absent means unbounded. */
1403
1462
  quota?: ReplicaQuotaSpec;
1463
+ /** Value download policy for syncs of this handle; absent means `"eager"`. See `ReplicationOptions.contentFetch`. */
1464
+ contentFetch?: "eager" | "lazy";
1404
1465
  /**
1405
1466
  * Called when another tab/process commits a sync for this partition (browser: the worker's
1406
1467
  * `committed` BroadcastChannel message). The controller emits `replication.sync` with
@@ -1764,6 +1825,15 @@ interface ReplicationControl {
1764
1825
  * and committed records remain. Exposed callers MUST show CLEAR_PENDING_WARNING first.
1765
1826
  */
1766
1827
  clearPending(): Promise<number>;
1828
+ /**
1829
+ * Browser: erases the whole local copy (the IndexedDB database) once the account has been
1830
+ * denied by sign-out or account switch; `signOut()` and account switch already do this. Retries
1831
+ * a few times when the delete is blocked. `{ ok: false, retryNow: true }`: the copy is still
1832
+ * there and a short bounded retry is meaningful (the deny outcome kept the keys, or the delete
1833
+ * is blocked); the SDK also finishes the erase on the next load. `retryNow: false`: nothing is
1834
+ * erasable now (a session is live, or the storage has no browser database). Never rejects.
1835
+ */
1836
+ purgeLocalCopy(): Promise<ReplicaPurgeLocalCopyResult>;
1767
1837
  close(): Promise<void>;
1768
1838
  }
1769
1839
  interface ReplicationOptions {
@@ -1774,6 +1844,11 @@ interface ReplicationOptions {
1774
1844
  allowSecrets?: boolean;
1775
1845
  /** Sign-in asks for kv/sync on each declared prefix only and never widens to a root entry that covers them. */
1776
1846
  syncScope?: "prefixes";
1847
+ /**
1848
+ * `"eager"` (default) downloads each changed value while syncing. `"lazy"` syncs entry names
1849
+ * without downloading values; a read of a value the replica does not hold goes to the network.
1850
+ */
1851
+ contentFetch?: "eager" | "lazy";
1777
1852
  /** Background interval; default 60 seconds. */
1778
1853
  syncIntervalMs?: number;
1779
1854
  maxStalenessMs?: number;
@@ -1972,4 +2047,4 @@ declare function replicationIdentityKey(id: ReplicationIdentity): string;
1972
2047
  /** Whether replicating this space/prefix can copy encrypted secret material to disk. */
1973
2048
  declare function requiresSecretsOptIn(space: string, prefix: string): boolean;
1974
2049
 
1975
- export { type ReplicaGuardedStore as $, type AuthorityRefusal as A, type ReplicaBrowserGateAccess as B, CLEAR_PENDING_WARNING as C, type ReplicaBrowserGateSnapshot as D, type ReplicaBrowserGateTx as E, type ReplicaBrowserPageAdmission as F, type ReplicaClock as G, type ReplicaCoverage as H, type ReplicaDeliveryDecision as I, type ReplicaDenyInput as J, type KVReplicationDeps as K, type LocalGetResult as L, type ReplicaDenyOutcome as M, type ReplicaDevice as N, type ReplicaEraseReport as O, type PendingWriteStore as P, type ReplicaGateAccess as Q, type ReplicationIdentity as R, type ReplicaGateReason as S, type ReplicaGateScope as T, type ReplicaGateSnapshot as U, type ReplicaGateTx as V, type ReplicaGatedError as W, type ReplicaGatedHandle as X, type ReplicaGatedSpec as Y, type ReplicaGatedStorage as Z, type ReplicaGrantInfo as _, type KVReplicationController as a, type ReplicaInspectedStatus as a0, type ReplicaLifecycleGate as a1, type ReplicaPageAdmission as a2, type ReplicaPartitionEraser as a3, type ReplicaPartitionIndexEntry as a4, type ReplicaPeerCommit as a5, type ReplicaPrivateGateHash as a6, type ReplicaPurgeIntent as a7, type ReplicaQuotaLedger as a8, type ReplicaQuotaSpec as a9, type KVChangesResponse as aA, type KVCreateSignedReadUrlOptions as aB, type KVDeleteOptions as aC, type KVGetOptions as aD, type KVHeadOptions as aE, type KVListOptions as aF, type KVListResponse as aG, type KVPutOptions as aH, type KVResponse as aI, type KVResponseHeaders as aJ, type KVServiceConfig as aK, type KVSignedReadUrlResponse as aL, type ReplicaSessionStamp as aa, type ReplicaStampedReply as ab, type ReplicaState as ac, type ReplicaStatusEntry as ad, type ReplicationAuthority as ae, type ReplicationControl as af, type ReplicationEvent as ag, type ReplicationOptions as ah, type ReplicationPurgeReport as ai, type ReplicationReason as aj, type ReplicationScheduler as ak, type ResolvedReplicationOptions as al, type SaltedHash as am, canonicalReplicationIdentity as an, replicationIdentityKey as ao, requiresSecretsOptIn as ap, DEFAULT_SIGNED_READ_URL_EXPIRY_MS as aq, KVAction as ar, type KVActionType as as, type KVBatchPutItem as at, type KVBatchPutOptions as au, type KVBatchPutResponse as av, type KVBatchReadResponse as aw, type KVChange as ax, type KVChangesAuthority as ay, type KVChangesOptions as az, type KVListPage as b, type KVReadThrough as c, type KVReplicaHandle as d, type KVReplicaSpec as e, type KVReplicaStorage as f, type LocalListResult as g, type LocalReadMeta as h, type LocalReplicaStatus as i, type LocalSyncResult as j, type PendingWriteRecord as k, type PendingWriteState as l, type PinnedKey as m, type ProfileReplicaApprovalEntry as n, type ProfileReplicaDeferredDenyOutcome as o, type ProfileReplicaDeferredToken as p, type ProfileReplicaLogoutPending as q, type ProfileReplicaPreflight as r, type ProfileReplicaPurge as s, type ProfileReplicaRemoteLogoutState as t, type ProfileReplicaRootIdentity as u, type ProfileReplicaUnknownEntry as v, type PurgeTarget as w, type ReplicaAccountGate as x, type ReplicaAdmitHook as y, type ReplicaAuthorityState as z };
2050
+ export { type ReplicaGuardedStore as $, type AuthorityRefusal as A, type ReplicaBrowserGateAccess as B, CLEAR_PENDING_WARNING as C, type ReplicaBrowserGateSnapshot as D, type ReplicaBrowserGateTx as E, type ReplicaBrowserPageAdmission as F, type ReplicaClock as G, type ReplicaCoverage as H, type ReplicaDeliveryDecision as I, type ReplicaDenyInput as J, type KVReplicationDeps as K, type LocalGetResult as L, type ReplicaDenyOutcome as M, type ReplicaDevice as N, type ReplicaEraseReport as O, type PendingWriteStore as P, type ReplicaGateAccess as Q, type ReplicationIdentity as R, type ReplicaGateReason as S, type ReplicaGateScope as T, type ReplicaGateSnapshot as U, type ReplicaGateTx as V, type ReplicaGatedError as W, type ReplicaGatedHandle as X, type ReplicaGatedSpec as Y, type ReplicaGatedStorage as Z, type ReplicaGrantInfo as _, type KVReplicationController as a, type ReplicaInspectedStatus as a0, type ReplicaLifecycleGate as a1, type ReplicaLocalEraseOutcome as a2, type ReplicaPageAdmission as a3, type ReplicaPartitionEraser as a4, type ReplicaPartitionIndexEntry as a5, type ReplicaPeerCommit as a6, type ReplicaPrivateGateHash as a7, type ReplicaPurgeError as a8, type ReplicaPurgeFailedEvent as a9, type KVBatchPutResponse as aA, type KVBatchReadResponse as aB, type KVChange as aC, type KVChangesAuthority as aD, type KVChangesOptions as aE, type KVChangesResponse as aF, type KVCreateSignedReadUrlOptions as aG, type KVDeleteOptions as aH, type KVGetOptions as aI, type KVHeadOptions as aJ, type KVListOptions as aK, type KVListResponse as aL, type KVPutOptions as aM, type KVResponse as aN, type KVResponseHeaders as aO, type KVServiceConfig as aP, type KVSignedReadUrlResponse as aQ, type ReplicaPurgeIntent as aa, type ReplicaPurgeLocalCopyResult as ab, type ReplicaPurgeTrigger as ac, type ReplicaQuotaLedger as ad, type ReplicaQuotaSpec as ae, type ReplicaSessionStamp as af, type ReplicaStampedReply as ag, type ReplicaState as ah, type ReplicaStatusEntry as ai, type ReplicationAuthority as aj, type ReplicationControl as ak, type ReplicationEvent as al, type ReplicationOptions as am, type ReplicationPurgeReport as an, type ReplicationReason as ao, type ReplicationScheduler as ap, type ResolvedReplicationOptions as aq, type SaltedHash as ar, canonicalReplicationIdentity as as, replicationIdentityKey as at, requiresSecretsOptIn as au, DEFAULT_SIGNED_READ_URL_EXPIRY_MS as av, KVAction as aw, type KVActionType as ax, type KVBatchPutItem as ay, type KVBatchPutOptions as az, type KVListPage as b, type KVReadThrough as c, type KVReplicaHandle as d, type KVReplicaSpec as e, type KVReplicaStorage as f, type LocalListResult as g, type LocalReadMeta as h, type LocalReplicaStatus as i, type LocalSyncResult as j, type PendingWriteRecord as k, type PendingWriteState as l, type PinnedKey as m, type ProfileReplicaApprovalEntry as n, type ProfileReplicaDeferredDenyOutcome as o, type ProfileReplicaDeferredToken as p, type ProfileReplicaLogoutPending as q, type ProfileReplicaPreflight as r, type ProfileReplicaPurge as s, type ProfileReplicaRemoteLogoutState as t, type ProfileReplicaRootIdentity as u, type ProfileReplicaUnknownEntry as v, type PurgeTarget as w, type ReplicaAccountGate as x, type ReplicaAdmitHook as y, type ReplicaAuthorityState as z };
@@ -591,7 +591,9 @@ type ReplicaGateReason =
591
591
  /** Browser only: the `localStorage` logout marker is set. */
592
592
  | "logout_pending"
593
593
  /** The gate store itself could not be read; fail closed. */
594
- | "gate_unavailable";
594
+ | "gate_unavailable"
595
+ /** Browser: replication is configured but no wallet provider can prove the connected account. */
596
+ | "wallet_provider_required";
595
597
  /** Shape of every gate refusal error: `Error & { code: "REPLICA_GATED"; gate }`. */
596
598
  interface ReplicaGatedError extends Error {
597
599
  code: "REPLICA_GATED";
@@ -877,6 +879,63 @@ interface ReplicaLifecycleGate {
877
879
  }): Promise<ReplicaEraseReport>;
878
880
  /** Outstanding intents; non-empty means status `purgePending: true`. */
879
881
  pendingPurge(): Promise<ReplicaPurgeIntent[]>;
882
+ /**
883
+ * Browser only. Under the gate lock, erases pending intents and deletes the whole origin
884
+ * database. Deletes only when nothing live is at stake: the gate is denied (null principal),
885
+ * the gate is behind the persisted deny tombstone, or the logout marker is set with a tombstone.
886
+ * A live or other-account gate is `refused` and left untouched. On a failed delete it sets the
887
+ * logout marker (when a tombstone exists) so `recover` finishes the erase on the next load.
888
+ * Never clears the deny tombstone.
889
+ */
890
+ eraseLocalCopy?(o: {
891
+ signal: AbortSignal;
892
+ }): Promise<ReplicaLocalEraseOutcome>;
893
+ }
894
+ /** Result of {@link ReplicaLifecycleGate.eraseLocalCopy}. */
895
+ type ReplicaLocalEraseOutcome =
896
+ /** The database is gone and the logout marker (if any) is cleared. */
897
+ {
898
+ status: "erased";
899
+ }
900
+ /** Delete blocked or storage error; a retry can succeed. `marker` is true when the next-load marker is set. */
901
+ | {
902
+ status: "failed";
903
+ code: string;
904
+ marker: boolean;
905
+ }
906
+ /** The gate does not authorize destruction; nothing was deleted. A retry cannot succeed until the gate is denied. */
907
+ | {
908
+ status: "refused";
909
+ code: string;
910
+ };
911
+ /** What triggered a local-copy erase. */
912
+ type ReplicaPurgeTrigger = "sign_out" | "account_switch" | "purge_local_copy";
913
+ /** Result of `replication.purgeLocalCopy()`. `retryNow` means a short bounded retry is meaningful. */
914
+ type ReplicaPurgeLocalCopyResult = {
915
+ ok: true;
916
+ } | {
917
+ ok: false;
918
+ retryNow: boolean;
919
+ };
920
+ /**
921
+ * Emitted (`on("replica.purge.failed", …)`) when the local copy could not be erased after the
922
+ * bounded retries. The SDK finishes the erase on the next load through the logout marker.
923
+ */
924
+ interface ReplicaPurgeFailedEvent {
925
+ type: "replica.purge.failed";
926
+ trigger: ReplicaPurgeTrigger;
927
+ /** Typed reason: `logout_pending` (marker set, erase retried on next load) or `gate_unavailable`. */
928
+ reason: ReplicaGateReason;
929
+ /** Storage error code of the last attempt. */
930
+ code: string;
931
+ /** True when a short bounded retry is meaningful (delete blocked or storage error). */
932
+ retryNow: boolean;
933
+ }
934
+ /** Rejection of `signOut()` when the deny itself was `unguarded` and the erase did not complete. */
935
+ interface ReplicaPurgeError extends Error {
936
+ code: "REPLICA_PURGE_FAILED";
937
+ reason: ReplicaGateReason;
938
+ retryNow: boolean;
880
939
  }
881
940
  /** Node/CLI profile-local fencing token, not a secret capability; the profile lock remains authoritative. */
882
941
  interface ProfileReplicaDeferredToken {
@@ -1401,6 +1460,8 @@ interface KVReplicaSpec {
1401
1460
  grantPolicy?: ReplicaGrantPolicy;
1402
1461
  /** Quota settings; absent means unbounded. */
1403
1462
  quota?: ReplicaQuotaSpec;
1463
+ /** Value download policy for syncs of this handle; absent means `"eager"`. See `ReplicationOptions.contentFetch`. */
1464
+ contentFetch?: "eager" | "lazy";
1404
1465
  /**
1405
1466
  * Called when another tab/process commits a sync for this partition (browser: the worker's
1406
1467
  * `committed` BroadcastChannel message). The controller emits `replication.sync` with
@@ -1764,6 +1825,15 @@ interface ReplicationControl {
1764
1825
  * and committed records remain. Exposed callers MUST show CLEAR_PENDING_WARNING first.
1765
1826
  */
1766
1827
  clearPending(): Promise<number>;
1828
+ /**
1829
+ * Browser: erases the whole local copy (the IndexedDB database) once the account has been
1830
+ * denied by sign-out or account switch; `signOut()` and account switch already do this. Retries
1831
+ * a few times when the delete is blocked. `{ ok: false, retryNow: true }`: the copy is still
1832
+ * there and a short bounded retry is meaningful (the deny outcome kept the keys, or the delete
1833
+ * is blocked); the SDK also finishes the erase on the next load. `retryNow: false`: nothing is
1834
+ * erasable now (a session is live, or the storage has no browser database). Never rejects.
1835
+ */
1836
+ purgeLocalCopy(): Promise<ReplicaPurgeLocalCopyResult>;
1767
1837
  close(): Promise<void>;
1768
1838
  }
1769
1839
  interface ReplicationOptions {
@@ -1774,6 +1844,11 @@ interface ReplicationOptions {
1774
1844
  allowSecrets?: boolean;
1775
1845
  /** Sign-in asks for kv/sync on each declared prefix only and never widens to a root entry that covers them. */
1776
1846
  syncScope?: "prefixes";
1847
+ /**
1848
+ * `"eager"` (default) downloads each changed value while syncing. `"lazy"` syncs entry names
1849
+ * without downloading values; a read of a value the replica does not hold goes to the network.
1850
+ */
1851
+ contentFetch?: "eager" | "lazy";
1777
1852
  /** Background interval; default 60 seconds. */
1778
1853
  syncIntervalMs?: number;
1779
1854
  maxStalenessMs?: number;
@@ -1972,4 +2047,4 @@ declare function replicationIdentityKey(id: ReplicationIdentity): string;
1972
2047
  /** Whether replicating this space/prefix can copy encrypted secret material to disk. */
1973
2048
  declare function requiresSecretsOptIn(space: string, prefix: string): boolean;
1974
2049
 
1975
- export { type ReplicaGuardedStore as $, type AuthorityRefusal as A, type ReplicaBrowserGateAccess as B, CLEAR_PENDING_WARNING as C, type ReplicaBrowserGateSnapshot as D, type ReplicaBrowserGateTx as E, type ReplicaBrowserPageAdmission as F, type ReplicaClock as G, type ReplicaCoverage as H, type ReplicaDeliveryDecision as I, type ReplicaDenyInput as J, type KVReplicationDeps as K, type LocalGetResult as L, type ReplicaDenyOutcome as M, type ReplicaDevice as N, type ReplicaEraseReport as O, type PendingWriteStore as P, type ReplicaGateAccess as Q, type ReplicationIdentity as R, type ReplicaGateReason as S, type ReplicaGateScope as T, type ReplicaGateSnapshot as U, type ReplicaGateTx as V, type ReplicaGatedError as W, type ReplicaGatedHandle as X, type ReplicaGatedSpec as Y, type ReplicaGatedStorage as Z, type ReplicaGrantInfo as _, type KVReplicationController as a, type ReplicaInspectedStatus as a0, type ReplicaLifecycleGate as a1, type ReplicaPageAdmission as a2, type ReplicaPartitionEraser as a3, type ReplicaPartitionIndexEntry as a4, type ReplicaPeerCommit as a5, type ReplicaPrivateGateHash as a6, type ReplicaPurgeIntent as a7, type ReplicaQuotaLedger as a8, type ReplicaQuotaSpec as a9, type KVChangesResponse as aA, type KVCreateSignedReadUrlOptions as aB, type KVDeleteOptions as aC, type KVGetOptions as aD, type KVHeadOptions as aE, type KVListOptions as aF, type KVListResponse as aG, type KVPutOptions as aH, type KVResponse as aI, type KVResponseHeaders as aJ, type KVServiceConfig as aK, type KVSignedReadUrlResponse as aL, type ReplicaSessionStamp as aa, type ReplicaStampedReply as ab, type ReplicaState as ac, type ReplicaStatusEntry as ad, type ReplicationAuthority as ae, type ReplicationControl as af, type ReplicationEvent as ag, type ReplicationOptions as ah, type ReplicationPurgeReport as ai, type ReplicationReason as aj, type ReplicationScheduler as ak, type ResolvedReplicationOptions as al, type SaltedHash as am, canonicalReplicationIdentity as an, replicationIdentityKey as ao, requiresSecretsOptIn as ap, DEFAULT_SIGNED_READ_URL_EXPIRY_MS as aq, KVAction as ar, type KVActionType as as, type KVBatchPutItem as at, type KVBatchPutOptions as au, type KVBatchPutResponse as av, type KVBatchReadResponse as aw, type KVChange as ax, type KVChangesAuthority as ay, type KVChangesOptions as az, type KVListPage as b, type KVReadThrough as c, type KVReplicaHandle as d, type KVReplicaSpec as e, type KVReplicaStorage as f, type LocalListResult as g, type LocalReadMeta as h, type LocalReplicaStatus as i, type LocalSyncResult as j, type PendingWriteRecord as k, type PendingWriteState as l, type PinnedKey as m, type ProfileReplicaApprovalEntry as n, type ProfileReplicaDeferredDenyOutcome as o, type ProfileReplicaDeferredToken as p, type ProfileReplicaLogoutPending as q, type ProfileReplicaPreflight as r, type ProfileReplicaPurge as s, type ProfileReplicaRemoteLogoutState as t, type ProfileReplicaRootIdentity as u, type ProfileReplicaUnknownEntry as v, type PurgeTarget as w, type ReplicaAccountGate as x, type ReplicaAdmitHook as y, type ReplicaAuthorityState as z };
2050
+ export { type ReplicaGuardedStore as $, type AuthorityRefusal as A, type ReplicaBrowserGateAccess as B, CLEAR_PENDING_WARNING as C, type ReplicaBrowserGateSnapshot as D, type ReplicaBrowserGateTx as E, type ReplicaBrowserPageAdmission as F, type ReplicaClock as G, type ReplicaCoverage as H, type ReplicaDeliveryDecision as I, type ReplicaDenyInput as J, type KVReplicationDeps as K, type LocalGetResult as L, type ReplicaDenyOutcome as M, type ReplicaDevice as N, type ReplicaEraseReport as O, type PendingWriteStore as P, type ReplicaGateAccess as Q, type ReplicationIdentity as R, type ReplicaGateReason as S, type ReplicaGateScope as T, type ReplicaGateSnapshot as U, type ReplicaGateTx as V, type ReplicaGatedError as W, type ReplicaGatedHandle as X, type ReplicaGatedSpec as Y, type ReplicaGatedStorage as Z, type ReplicaGrantInfo as _, type KVReplicationController as a, type ReplicaInspectedStatus as a0, type ReplicaLifecycleGate as a1, type ReplicaLocalEraseOutcome as a2, type ReplicaPageAdmission as a3, type ReplicaPartitionEraser as a4, type ReplicaPartitionIndexEntry as a5, type ReplicaPeerCommit as a6, type ReplicaPrivateGateHash as a7, type ReplicaPurgeError as a8, type ReplicaPurgeFailedEvent as a9, type KVBatchPutResponse as aA, type KVBatchReadResponse as aB, type KVChange as aC, type KVChangesAuthority as aD, type KVChangesOptions as aE, type KVChangesResponse as aF, type KVCreateSignedReadUrlOptions as aG, type KVDeleteOptions as aH, type KVGetOptions as aI, type KVHeadOptions as aJ, type KVListOptions as aK, type KVListResponse as aL, type KVPutOptions as aM, type KVResponse as aN, type KVResponseHeaders as aO, type KVServiceConfig as aP, type KVSignedReadUrlResponse as aQ, type ReplicaPurgeIntent as aa, type ReplicaPurgeLocalCopyResult as ab, type ReplicaPurgeTrigger as ac, type ReplicaQuotaLedger as ad, type ReplicaQuotaSpec as ae, type ReplicaSessionStamp as af, type ReplicaStampedReply as ag, type ReplicaState as ah, type ReplicaStatusEntry as ai, type ReplicationAuthority as aj, type ReplicationControl as ak, type ReplicationEvent as al, type ReplicationOptions as am, type ReplicationPurgeReport as an, type ReplicationReason as ao, type ReplicationScheduler as ap, type ResolvedReplicationOptions as aq, type SaltedHash as ar, canonicalReplicationIdentity as as, replicationIdentityKey as at, requiresSecretsOptIn as au, DEFAULT_SIGNED_READ_URL_EXPIRY_MS as av, KVAction as aw, type KVActionType as ax, type KVBatchPutItem as ay, type KVBatchPutOptions as az, type KVListPage as b, type KVReadThrough as c, type KVReplicaHandle as d, type KVReplicaSpec as e, type KVReplicaStorage as f, type LocalListResult as g, type LocalReadMeta as h, type LocalReplicaStatus as i, type LocalSyncResult as j, type PendingWriteRecord as k, type PendingWriteState as l, type PinnedKey as m, type ProfileReplicaApprovalEntry as n, type ProfileReplicaDeferredDenyOutcome as o, type ProfileReplicaDeferredToken as p, type ProfileReplicaLogoutPending as q, type ProfileReplicaPreflight as r, type ProfileReplicaPurge as s, type ProfileReplicaRemoteLogoutState as t, type ProfileReplicaRootIdentity as u, type ProfileReplicaUnknownEntry as v, type PurgeTarget as w, type ReplicaAccountGate as x, type ReplicaAdmitHook as y, type ReplicaAuthorityState as z };
@@ -78,10 +78,11 @@ declare const DECRYPT_ACTION: "tinycloud.encryption/decrypt";
78
78
  * them.
79
79
  */
80
80
  interface InlineEncryptedEnvelope {
81
- /** Schema version. */
82
81
  v: typeof ENVELOPE_VERSION;
83
82
  /** Network id URN. */
84
83
  networkId: string;
84
+ /** Exact named-key path; absent on network-root v1 envelopes. */
85
+ keyPath?: string;
85
86
  /** Ciphersuite identifier. */
86
87
  alg: string;
87
88
  /** Network key version that was used to wrap the symmetric key. */
@@ -132,6 +133,8 @@ interface DecryptRequestBody {
132
133
  type: typeof DECRYPT_FACT_TYPE;
133
134
  targetNode: string;
134
135
  networkId: string;
136
+ /** Exact named-key path for path-scoped decrypt, absent for root keys. */
137
+ keyPath?: string;
135
138
  alg: string;
136
139
  keyVersion: number;
137
140
  /** Base64-encoded wrapped symmetric key from the envelope. */
@@ -173,6 +176,8 @@ interface DecryptInvocationFact {
173
176
  type: typeof DECRYPT_FACT_TYPE;
174
177
  targetNode: string;
175
178
  networkId: string;
179
+ /** Exact named-key path for path-scoped decrypt, absent for root keys. */
180
+ keyPath?: string;
176
181
  bodyHash: string;
177
182
  encryptedSymmetricKeyHash: string;
178
183
  receiverPublicKeyHash: string;
@@ -78,10 +78,11 @@ declare const DECRYPT_ACTION: "tinycloud.encryption/decrypt";
78
78
  * them.
79
79
  */
80
80
  interface InlineEncryptedEnvelope {
81
- /** Schema version. */
82
81
  v: typeof ENVELOPE_VERSION;
83
82
  /** Network id URN. */
84
83
  networkId: string;
84
+ /** Exact named-key path; absent on network-root v1 envelopes. */
85
+ keyPath?: string;
85
86
  /** Ciphersuite identifier. */
86
87
  alg: string;
87
88
  /** Network key version that was used to wrap the symmetric key. */
@@ -132,6 +133,8 @@ interface DecryptRequestBody {
132
133
  type: typeof DECRYPT_FACT_TYPE;
133
134
  targetNode: string;
134
135
  networkId: string;
136
+ /** Exact named-key path for path-scoped decrypt, absent for root keys. */
137
+ keyPath?: string;
135
138
  alg: string;
136
139
  keyVersion: number;
137
140
  /** Base64-encoded wrapped symmetric key from the envelope. */
@@ -173,6 +176,8 @@ interface DecryptInvocationFact {
173
176
  type: typeof DECRYPT_FACT_TYPE;
174
177
  targetNode: string;
175
178
  networkId: string;
179
+ /** Exact named-key path for path-scoped decrypt, absent for root keys. */
180
+ keyPath?: string;
176
181
  bodyHash: string;
177
182
  encryptedSymmetricKeyHash: string;
178
183
  receiverPublicKeyHash: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinycloud/sdk-services",
3
- "version": "3.8.0-beta.1",
3
+ "version": "3.8.0-beta.16",
4
4
  "description": "TinyCloud SDK Services - Platform-agnostic service implementations",
5
5
  "author": "TinyCloud, Inc.",
6
6
  "license": "EGPL",