@tinycloud/web-sdk 3.8.0-beta.4 → 3.8.0-beta.6
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/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/panel-data.cjs +1 -1
- package/dist/panel-data.mjs +1 -1
- package/dist/ui/data/authority.d.ts +18 -0
- package/dist/ui/data.d.ts +10 -1
- package/package.json +3 -3
package/dist/panel-data.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return new Promise(e=>{"requestIdleCallback"in globalThis?globalThis.requestIdleCallback(()=>e(),{timeout:3e3}):setTimeout(e,2e3)})}function o(e){return{state:"ready",data:e}}function n(e){return{state:"needs-permission",ability:e}}function a(e){return{state:"error",code:e}}e.r(t),e.d(t,{arm:()=>
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(){return new Promise(e=>{"requestIdleCallback"in globalThis?globalThis.requestIdleCallback(()=>e(),{timeout:3e3}):setTimeout(e,2e3)})}function o(e){return{state:"ready",data:e}}function n(e){return{state:"needs-permission",ability:e}}function a(e){return{state:"error",code:e}}e.r(t),e.d(t,{arm:()=>T,livePanelData:()=>O,onLivePanelDataChange:()=>E});const i={service:"tinycloud.sql",space:"account",path:"account",actions:["tinycloud.sql/read"]};function s(e,t){return void 0===e.hasPermissions||e.hasPermissions([t])}const c=864e5;function d(e){const t=e.indexOf("#");return-1!==t&&-1===e.indexOf("#",t+1)?e.slice(0,t):e}function u(e,t){return"received"===e.direction?"received":(r=t,d(e.delegateDid)===d(r)?"this-app":"to-others");var r}function l(e,t){if(!e)return!1;const r=e.getTime()-t;return r>0&&r<=c}const f=5e3,g="not-granted",v=new Set([g,"AUTH_UNAUTHORIZED","PERMISSION_DENIED"]),p="SQL_ERROR",y={spaces:/^(?:SQL query failed: 400 - )?SQLite error: no such table:\s*spaces(?![\w$.\-])/i,applications:/^(?:SQL query failed: 400 - )?SQLite error: no such table:\s*applications(?![\w$.\-])/i};function h(e,t){return!0===e.ok?e.data.length:e.error.code===p&&y[t].test(e.error.message??"")?void 0:e.error.code}const k=6e4,m=6e4,w=1e4,b=50,D={account:["overview"],delegations:["delegations"],storage:["storage"]};const S=new WeakMap,A=new WeakMap;function I(e){for(const t of[...A.get(e)??[]])t()}function T(e,t={}){const c=S.get(e);if(c)return void(t.now&&c.prefetch.intent());const{host:d,gate:p}=t;if(!d||!p||!e.signedIn())return;const y=e.data??function(e,t,r){const c=new Set,d=new Map;let p=0;const y=new Set;t.onReset(()=>{for(const e of d.values())clearTimeout(e.retryTimer);p+=1,d.clear(),y.clear()});const S=e=>{let t=d.get(e);return t||(t={at:0,checkedAt:0,refreshing:!1},d.set(e,t)),t},A=e=>{for(const t of D[e])for(const e of c)e(t)};function I(e,t){const r=S(e);if(r.inflight)return r.inflight;const o=p,n=t().catch(()=>a("unavailable")).then(e=>{o===p&&("error"!==e.state||"ready"!==r.value?.state?(r.value=e,r.at=Date.now(),r.lastError=void 0,"ready"===e.state&&(r.retried=!1,clearTimeout(r.retryTimer),r.retryTimer=void 0)):r.lastError=e.code)}).finally(()=>{o===p&&(r.inflight=void 0,r.checkedAt=Date.now(),r.refreshing=!1,A(e),"account"!==e||"error"!==r.value?.state||v.has(r.value.code)||r.retried||(r.retried=!0,r.retryTimer=setTimeout(()=>{r.retryTimer=void 0,o===p&&I(e,t)},f)))});return r.inflight=n,r.refreshing=!0,A(e),n}function T(e,t){return"ready"!==t.state?t:{...t,freshness:{updatedAt:e.at,refreshing:e.refreshing,lastError:e.lastError}}}async function O(e,t,r,o=!1){const n=S(e);if(void 0===n.value||o){const t=p;return await I(e,r),t!==p||void 0===n.value?{state:"loading"}:T(n,n.value)}return Date.now()-n.checkedAt>t&&I(e,r),T(n,n.value)}async function E(t){const r=p,i=function(e){if(void 0===e.hasPermissions)return;const t=[];for(const r of[e.accountSpaceId,e.spaceId])void 0===r||t.includes(r)||s(e,{service:"tinycloud.delegation",space:r,path:"",actions:["tinycloud.delegation/list"]})&&t.push(r);return t}(e);if(0===i?.length)return n("delegation/list");const c={direction:"all",limit:b,...t?{cursor:t}:{}},d=await(void 0===i?e.delegations.query(c):e.delegations.query(c,{spaces:i}));if(r!==p)return a("stale");if(!1===d.ok)return"PERMISSION_DENIED"===d.error.code?n("delegation/list"):a(d.error.code);const f=Date.now();return d.data.nextCursor&&y.add(d.data.nextCursor),o({rows:d.data.items.map(t=>function(e,t,r){return{source:"real",cid:e.cid,direction:e.direction,status:e.status,group:u(e,t),label:{text:(o=e.delegateDid,o.length<=22?o:`${o.slice(0,14)}…${o.slice(-6)}`),source:"derived"},delegatorDid:e.delegatorDid,delegateDid:e.delegateDid,resources:e.resources.map(e=>({resource:e.resource,actions:e.actions})),parents:e.parents,issuedAt:e.issuedAt,notBefore:e.notBefore,expiresAt:e.expiresAt,expiringSoon:l(e.expiresAt,r),...void 0!==e.revokedAt?{revokedAt:e.revokedAt}:{},...void 0!==e.revokedBy?{revokedBy:e.revokedBy}:{},...void 0!==e.revokedAncestorCid?{revokedAncestorCid:e.revokedAncestorCid}:{}};var o}(t,e.sessionDid,f)),...d.data.nextCursor?{nextCursor:d.data.nextCursor}:{}})}async function N(){if(!s(e,i))return a(g);const[t,n,c]=await Promise.all([e.account.index.spaces.list(),e.account.index.applications.list(),O("delegations",w,()=>E())]),d=h(t,"spaces");if("string"==typeof d)return a(d);const u=h(n,"applications");if("string"==typeof u)return a(u);const l="ready"===c.state?c.data.rows:void 0,f=l?.filter(e=>"granted"===e.direction).length??0,v=l?.filter(e=>"received"===e.direction).length??0;return o({source:"real",fieldSources:{grantedDelegations:"derived",receivedDelegations:"derived"},did:e.did,host:e.hosts[0]??"",...void 0!==u?{applications:u}:{},...void 0!==d?{spaces:d}:{},grantedDelegations:f,receivedDelegations:v,appName:r})}async function P(){if(void 0!==e.spaceId&&!s(e,(t=e.spaceId,{service:"tinycloud.space",space:t,path:"",actions:["tinycloud.space/info"]})))return n("space/info");var t;const r=await e.storage.status();return!1===r.ok?"PERMISSION_DENIED"===r.error.code||"AUTH_UNAUTHORIZED"===r.error.code?n("space/info"):a(r.error.code):o({source:"real",...r.data})}return{subscribe:e=>(c.add(e),()=>{c.delete(e)}),account:()=>O("account",k,N),knownDid:()=>0===p?e.did:void 0,async localNode(){const t=p,r=await e.activeNodeIdentity().catch(()=>{});return t!==p?{state:"loading"}:o({source:"real",fieldSources:{connection:"stub",version:"stub"},connection:"unavailable",...r?{identity:r}:{}})},setLocalNodeEnabled:async()=>({ok:!1,code:"unavailable"}),async localCopy(){const e=t.sync;if(!e)return a("unavailable");const{requested:r,effective:n,reason:i}=e.state;return o({source:"real",fieldSources:{lastSyncedAt:"stub",folders:"stub",pending:"stub",bytesOnDevice:"stub"},requested:r,effective:n,...void 0!==i?{reason:i}:{},folders:[],pending:0})},delegations:e=>e?y.has(e)?E(e):Promise.resolve(a("stale")):O("delegations",w,()=>E()),async revoke(t){const r=p,o=await e.delegations.status(t);if(r!==p)return{ok:!1,code:"stale"};if(o.ok&&"revoked"===o.data.status)return{ok:!1,code:"not-revocable"};const n=await e.delegations.revoke(t);if(r!==p)return{ok:!1,code:"stale"};if(!1===n.ok){if("NOT_FOUND"!==n.error.code)return{ok:!1,code:n.error.code};let e;if(S("account").at=0,await I("delegations",async()=>e=await E()),r!==p)return{ok:!1,code:"stale"};const o="ready"===e?.state?e.data:void 0,a=o?.rows.find(e=>e.cid===t);return{ok:!1,code:void 0!==o&&(void 0===a?void 0===o.nextCursor:"revoked"===a.status)?"NOT_FOUND":"REVOCATION_FAILED"}}return S("account").at=0,await I("delegations",()=>E()),r!==p?{ok:!1,code:"stale"}:{ok:!0,cid:t}},async nodes(){const t=p,r=await e.activeNodeIdentity().catch(()=>{});return t!==p?{state:"loading"}:o(e.hosts.map(e=>{const t=void 0!==r&&r.origin===e;return{source:"real",fieldSources:{kind:"stub",status:"stub",spaces:"stub"},origin:e,kind:"hosted",active:t,...t&&r?{nodeDid:r.nodeDid}:{},status:"ok",spaces:[]}}))},storage:e=>O("storage",m,P,!0===e?.fresh)}}(d,e,t.appName?.()??""),A=function(e){let t="waiting";const r=()=>{"waiting"===t&&(t="pulling",Promise.allSettled([e.data.account(),e.data.delegations(),e.data.storage()]).then(()=>{"pulling"===t&&(t="done")}))};Promise.all([e.idle(),e.registrySettled()]).then(r,r);const o=e.onReset(()=>{t="reset",o()});return{intent:r}}({data:y,registrySettled:()=>p.waitForAccountRegistrySync?.()??Promise.resolve(),idle:r,onReset:t=>e.onReset(t)});S.set(e,{source:y,prefetch:A}),e.onReset(()=>{S.delete(e),I(e)}),I(e)}function O(e){return S.get(e)?.source}function E(e,t){let r=A.get(e);return void 0===r&&(r=new Set,A.set(e,r)),r.add(t),()=>{r.delete(t)}}module.exports=t})();
|
package/dist/panel-data.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={};function t(){return new Promise(e=>{"requestIdleCallback"in globalThis?globalThis.requestIdleCallback(()=>e(),{timeout:3e3}):setTimeout(e,2e3)})}function r(e){return{state:"ready",data:e}}function o(e){return{state:"needs-permission",ability:e}}function n(e){return{state:"error",code:e}}function a(e){const t=e.indexOf("#");return-1!==t&&-1===e.indexOf("#",t+1)?e.slice(0,t):e}function
|
|
1
|
+
var e={};function t(){return new Promise(e=>{"requestIdleCallback"in globalThis?globalThis.requestIdleCallback(()=>e(),{timeout:3e3}):setTimeout(e,2e3)})}function r(e){return{state:"ready",data:e}}function o(e){return{state:"needs-permission",ability:e}}function n(e){return{state:"error",code:e}}e.d=(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const s={service:"tinycloud.sql",space:"account",path:"account",actions:["tinycloud.sql/read"]};function i(e,t){return void 0===e.hasPermissions||e.hasPermissions([t])}function a(e){const t=e.indexOf("#");return-1!==t&&-1===e.indexOf("#",t+1)?e.slice(0,t):e}function c(e,t){return"received"===e.direction?"received":(r=t,a(e.delegateDid)===a(r)?"this-app":"to-others");var r}function d(e,t){if(!e)return!1;const r=e.getTime()-t;return r>0&&r<=864e5}const u="not-granted",l=new Set([u,"AUTH_UNAUTHORIZED","PERMISSION_DENIED"]),f={spaces:/^(?:SQL query failed: 400 - )?SQLite error: no such table:\s*spaces(?![\w$.\-])/i,applications:/^(?:SQL query failed: 400 - )?SQLite error: no such table:\s*applications(?![\w$.\-])/i};function v(e,t){return!0===e.ok?e.data.length:"SQL_ERROR"===e.error.code&&f[t].test(e.error.message??"")?void 0:e.error.code}const g={account:["overview"],delegations:["delegations"],storage:["storage"]};const p=new WeakMap,y=new WeakMap;function h(e){for(const t of[...y.get(e)??[]])t()}function k(e,a={}){const f=p.get(e);if(f)return void(a.now&&f.prefetch.intent());const{host:y,gate:k}=a;if(!y||!k||!e.signedIn())return;const w=e.data??function(e,t,a){const f=new Set,p=new Map;let y=0;const h=new Set;t.onReset(()=>{for(const e of p.values())clearTimeout(e.retryTimer);y+=1,p.clear(),h.clear()});const k=e=>{let t=p.get(e);return t||(t={at:0,checkedAt:0,refreshing:!1},p.set(e,t)),t},w=e=>{for(const t of g[e])for(const e of f)e(t)};function m(e,t){const r=k(e);if(r.inflight)return r.inflight;const o=y,s=t().catch(()=>n("unavailable")).then(e=>{o===y&&("error"!==e.state||"ready"!==r.value?.state?(r.value=e,r.at=Date.now(),r.lastError=void 0,"ready"===e.state&&(r.retried=!1,clearTimeout(r.retryTimer),r.retryTimer=void 0)):r.lastError=e.code)}).finally(()=>{o===y&&(r.inflight=void 0,r.checkedAt=Date.now(),r.refreshing=!1,w(e),"account"!==e||"error"!==r.value?.state||l.has(r.value.code)||r.retried||(r.retried=!0,r.retryTimer=setTimeout(()=>{r.retryTimer=void 0,o===y&&m(e,t)},5e3)))});return r.inflight=s,r.refreshing=!0,w(e),s}function D(e,t){return"ready"!==t.state?t:{...t,freshness:{updatedAt:e.at,refreshing:e.refreshing,lastError:e.lastError}}}async function b(e,t,r,o=!1){const n=k(e);if(void 0===n.value||o){const t=y;return await m(e,r),t!==y||void 0===n.value?{state:"loading"}:D(n,n.value)}return Date.now()-n.checkedAt>t&&m(e,r),D(n,n.value)}async function S(t){const s=y,a=function(e){if(void 0===e.hasPermissions)return;const t=[];for(const r of[e.accountSpaceId,e.spaceId])void 0===r||t.includes(r)||i(e,{service:"tinycloud.delegation",space:r,path:"",actions:["tinycloud.delegation/list"]})&&t.push(r);return t}(e);if(0===a?.length)return o("delegation/list");const u={direction:"all",limit:50,...t?{cursor:t}:{}},l=await(void 0===a?e.delegations.query(u):e.delegations.query(u,{spaces:a}));if(s!==y)return n("stale");if(!1===l.ok)return"PERMISSION_DENIED"===l.error.code?o("delegation/list"):n(l.error.code);const f=Date.now();return l.data.nextCursor&&h.add(l.data.nextCursor),r({rows:l.data.items.map(t=>function(e,t,r){return{source:"real",cid:e.cid,direction:e.direction,status:e.status,group:c(e,t),label:{text:(o=e.delegateDid,o.length<=22?o:`${o.slice(0,14)}…${o.slice(-6)}`),source:"derived"},delegatorDid:e.delegatorDid,delegateDid:e.delegateDid,resources:e.resources.map(e=>({resource:e.resource,actions:e.actions})),parents:e.parents,issuedAt:e.issuedAt,notBefore:e.notBefore,expiresAt:e.expiresAt,expiringSoon:d(e.expiresAt,r),...void 0!==e.revokedAt?{revokedAt:e.revokedAt}:{},...void 0!==e.revokedBy?{revokedBy:e.revokedBy}:{},...void 0!==e.revokedAncestorCid?{revokedAncestorCid:e.revokedAncestorCid}:{}};var o}(t,e.sessionDid,f)),...l.data.nextCursor?{nextCursor:l.data.nextCursor}:{}})}async function A(){if(!i(e,s))return n(u);const[t,o,c]=await Promise.all([e.account.index.spaces.list(),e.account.index.applications.list(),b("delegations",1e4,()=>S())]),d=v(t,"spaces");if("string"==typeof d)return n(d);const l=v(o,"applications");if("string"==typeof l)return n(l);const f="ready"===c.state?c.data.rows:void 0,g=f?.filter(e=>"granted"===e.direction).length??0,p=f?.filter(e=>"received"===e.direction).length??0;return r({source:"real",fieldSources:{grantedDelegations:"derived",receivedDelegations:"derived"},did:e.did,host:e.hosts[0]??"",...void 0!==l?{applications:l}:{},...void 0!==d?{spaces:d}:{},grantedDelegations:g,receivedDelegations:p,appName:a})}async function I(){if(void 0!==e.spaceId&&!i(e,(t=e.spaceId,{service:"tinycloud.space",space:t,path:"",actions:["tinycloud.space/info"]})))return o("space/info");var t;const s=await e.storage.status();return!1===s.ok?"PERMISSION_DENIED"===s.error.code||"AUTH_UNAUTHORIZED"===s.error.code?o("space/info"):n(s.error.code):r({source:"real",...s.data})}return{subscribe:e=>(f.add(e),()=>{f.delete(e)}),account:()=>b("account",6e4,A),knownDid:()=>0===y?e.did:void 0,async localNode(){const t=y,o=await e.activeNodeIdentity().catch(()=>{});return t!==y?{state:"loading"}:r({source:"real",fieldSources:{connection:"stub",version:"stub"},connection:"unavailable",...o?{identity:o}:{}})},setLocalNodeEnabled:async()=>({ok:!1,code:"unavailable"}),async localCopy(){const e=t.sync;if(!e)return n("unavailable");const{requested:o,effective:s,reason:i}=e.state;return r({source:"real",fieldSources:{lastSyncedAt:"stub",folders:"stub",pending:"stub",bytesOnDevice:"stub"},requested:o,effective:s,...void 0!==i?{reason:i}:{},folders:[],pending:0})},delegations:e=>e?h.has(e)?S(e):Promise.resolve(n("stale")):b("delegations",1e4,()=>S()),async revoke(t){const r=y,o=await e.delegations.status(t);if(r!==y)return{ok:!1,code:"stale"};if(o.ok&&"revoked"===o.data.status)return{ok:!1,code:"not-revocable"};const n=await e.delegations.revoke(t);if(r!==y)return{ok:!1,code:"stale"};if(!1===n.ok){if("NOT_FOUND"!==n.error.code)return{ok:!1,code:n.error.code};let e;if(k("account").at=0,await m("delegations",async()=>e=await S()),r!==y)return{ok:!1,code:"stale"};const o="ready"===e?.state?e.data:void 0,s=o?.rows.find(e=>e.cid===t);return{ok:!1,code:void 0!==o&&(void 0===s?void 0===o.nextCursor:"revoked"===s.status)?"NOT_FOUND":"REVOCATION_FAILED"}}return k("account").at=0,await m("delegations",()=>S()),r!==y?{ok:!1,code:"stale"}:{ok:!0,cid:t}},async nodes(){const t=y,o=await e.activeNodeIdentity().catch(()=>{});return t!==y?{state:"loading"}:r(e.hosts.map(e=>{const t=void 0!==o&&o.origin===e;return{source:"real",fieldSources:{kind:"stub",status:"stub",spaces:"stub"},origin:e,kind:"hosted",active:t,...t&&o?{nodeDid:o.nodeDid}:{},status:"ok",spaces:[]}}))},storage:e=>b("storage",6e4,I,!0===e?.fresh)}}(y,e,a.appName?.()??""),m=function(e){let t="waiting";const r=()=>{"waiting"===t&&(t="pulling",Promise.allSettled([e.data.account(),e.data.delegations(),e.data.storage()]).then(()=>{"pulling"===t&&(t="done")}))};Promise.all([e.idle(),e.registrySettled()]).then(r,r);const o=e.onReset(()=>{t="reset",o()});return{intent:r}}({data:w,registrySettled:()=>k.waitForAccountRegistrySync?.()??Promise.resolve(),idle:t,onReset:t=>e.onReset(t)});p.set(e,{source:w,prefetch:m}),e.onReset(()=>{p.delete(e),h(e)}),h(e)}function w(e){return p.get(e)?.source}function m(e,t){let r=y.get(e);return void 0===r&&(r=new Set,y.set(e,r)),r.add(t),()=>{r.delete(t)}}export{k as arm,w as livePanelData,m as onLivePanelDataChange};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PermissionEntry } from "@tinycloud/sdk-core";
|
|
2
|
+
import type { PanelDataHost } from "../data";
|
|
3
|
+
/** The account index read: `tinycloud.sql/read` on the `account` database of the account space. */
|
|
4
|
+
export declare const ACCOUNT_INDEX_READ: PermissionEntry;
|
|
5
|
+
/** `tinycloud.space/info` on one space, given by its full space id: the storage status read. */
|
|
6
|
+
export declare function spaceInfoOn(spaceId: string): PermissionEntry;
|
|
7
|
+
/**
|
|
8
|
+
* True when the session holds `entry`. A host that cannot tell (`hasPermissions` absent) answers true,
|
|
9
|
+
* so its reads are sent as before.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sessionHolds(host: Pick<PanelDataHost, "hasPermissions">, entry: PermissionEntry): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The spaces to sign the delegation query for, in the order the SDK tries them (account space, then the
|
|
14
|
+
* session's own space), limited to those the session holds `delegation/list` on. Empty: nothing to send.
|
|
15
|
+
* `undefined`: the host cannot tell, so the SDK picks its own spaces.
|
|
16
|
+
*/
|
|
17
|
+
export declare function delegationQuerySpaces(host: Pick<PanelDataHost, "hasPermissions" | "accountSpaceId" | "spaceId">): readonly string[] | undefined;
|
|
18
|
+
//# sourceMappingURL=authority.d.ts.map
|
package/dist/ui/data.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Panel code reads these shapes through a `PanelDataSource`. It never reads
|
|
14
14
|
* TinyCloudWeb directly.
|
|
15
15
|
*/
|
|
16
|
-
import type { AccountDelegationRecord, AccountService, AccountStatus, DelegationManager, IStorageService, StorageStatus, StorageUsage } from "@tinycloud/sdk-core";
|
|
16
|
+
import type { AccountDelegationRecord, AccountService, AccountStatus, DelegationManager, IStorageService, PermissionEntry, StorageStatus, StorageUsage } from "@tinycloud/sdk-core";
|
|
17
17
|
import type { PanelClient, SyncState } from "./slots";
|
|
18
18
|
export type DataSource = "real" | "stub" | "derived";
|
|
19
19
|
/** Per-field source for records that mix real and stub fields. */
|
|
@@ -213,6 +213,15 @@ export interface PanelDataHost {
|
|
|
213
213
|
readonly origin: string;
|
|
214
214
|
readonly nodeDid: string;
|
|
215
215
|
}>;
|
|
216
|
+
/**
|
|
217
|
+
* Whether the session or an unexpired runtime grant covers every entry (`tc.hasPermissions`). Never prompts.
|
|
218
|
+
* Absent on a host that cannot tell: panel reads then go out as they always did.
|
|
219
|
+
*/
|
|
220
|
+
hasPermissions?(entries: PermissionEntry[]): boolean;
|
|
221
|
+
/** Account space id (`tc.accountSpaceId`). The delegation query signs for it first. */
|
|
222
|
+
readonly accountSpaceId?: string;
|
|
223
|
+
/** The session's own space id (`tc.spaceId`). The delegation query falls back to it. */
|
|
224
|
+
readonly spaceId?: string;
|
|
216
225
|
}
|
|
217
226
|
export interface PanelDataSource {
|
|
218
227
|
/** Fires when any view's data changes (toggle, revoke, stub change). Returns unsubscribe. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinycloud/web-sdk",
|
|
3
|
-
"version": "3.8.0-beta.
|
|
3
|
+
"version": "3.8.0-beta.6",
|
|
4
4
|
"description": "A set of tools and utilities to help you build your app with TinyCloud.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"@multiformats/multiaddr": "^13.0.1",
|
|
67
67
|
"@multiformats/multiaddr-to-uri": "^12.0.0",
|
|
68
68
|
"@noble/curves": "^1.9.7",
|
|
69
|
-
"@tinycloud/node-sdk": "3.8.0-beta.
|
|
69
|
+
"@tinycloud/node-sdk": "3.8.0-beta.6",
|
|
70
70
|
"@tinycloud/replica": "0.4.0-beta.1",
|
|
71
|
-
"@tinycloud/sdk-core": "3.8.0-beta.
|
|
71
|
+
"@tinycloud/sdk-core": "3.8.0-beta.5",
|
|
72
72
|
"@tinycloud/share-envelope": "1.3.1-beta.0",
|
|
73
73
|
"@tinycloud/share-sdk": "1.4.1-beta.0",
|
|
74
74
|
"@tinycloud/web-sdk-wasm": "1.7.7",
|