@fkn/lib 0.9.43 → 0.9.44

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/rooms.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api--LOXTOpv.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./contract.cjs");var i=e.t({available:()=>m,create:()=>g,join:()=>_,open:()=>h}),a={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,needsPremium:`rooms: claiming needs premium`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,badDescription:`rooms: the description is not one a claim can carry`,notClaimer:`rooms: only the app that claimed the room can describe it`,notReleaser:`rooms: only the app that claimed the room can release it`,badTemporary:`rooms: the temporary duration is not one a claim can carry`,notTemporaryClaimer:`rooms: only the app that claimed the room can set when it expires`,temporaryUnavailable:`rooms: temporary claims are not available`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},o=(e,t)=>Object.assign(Error(t),{code:e}),s=e=>e instanceof Error&&typeof e.code==`string`,c={send:!0,receive:!0,maxMessageBytes:262144},l=async()=>{if(!t.l)return;let e=(await t.s(`a room`).catch(()=>void 0))?.rooms;return typeof e?.open==`function`?e:void 0},u=()=>{throw o(`unavailable`,a.unavailable)},d=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,f=e=>{if(e!==void 0&&e!==!1)return e===!0?r.ROOM_TEMPORARY_MS.default:typeof e!=`number`||!Number.isInteger(e)?null:e>=r.ROOM_TEMPORARY_MS.min&&e<=r.ROOM_TEMPORARY_MS.max?e:null},p=async e=>{let r=e.invite,i=e,l=0,u=e.self,p=e.owner,m=e.claimed,h=e.mailbox,g=await e.defaults().catch(()=>c),_=!1,v=new Set,y=new Set,b=n.t(`room`),x=()=>{},S=()=>{},C=new Promise(e=>{S=e}),w=e=>{let t=[...y];y.clear();for(let n of t)try{n(e)}catch{}},T=e=>{_||(_=!0,x(),v.clear(),b(),w(o(`closed`,a.ended)),S({reason:e}))},E=e=>{if(!_){e.type===`defaults`&&(g=e.defaults),e.type===`permissions`&&e.id===u.id&&(u={id:u.id,permissions:e.permissions,maxMessageBytes:e.maxMessageBytes}),e.type===`claim`&&(m=e.claimed,p=e.owner,m||(h=null));for(let t of[...v])try{t(e)}catch{}}},D=(e,t)=>{Promise.resolve(e.on(E)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===l&&T(e.reason)},()=>{})},O=async(e,t)=>{if(typeof e?.join!=`function`)return T(`unavailable`);let n=await e.join(r).catch(()=>void 0);if(_||t!==l)return;if(!n)return T(`unavailable`);if(`error`in n)return T(d(n.error));if(n.self.id!==u.id)return Promise.resolve(n.leave()).catch(()=>{}),T(`unavailable`);i=n,u=n.self,p=n.owner,m=n.claimed,h=n.mailbox,D(n,t);let a=await n.defaults().catch(()=>void 0);a&&!_&&t===l&&(g=a)};x=t.u((e,t)=>{let n=l;l=t,!(_||n===0||n===t)&&(w(o(`unavailable`,a.unavailable)),O(e.rooms,t))}),D(e,l);let k=async e=>{if(_)throw o(`closed`,a.ended);let t=()=>{},n=new Promise((e,n)=>{t=n});y.add(t);try{return await Promise.race([Promise.resolve(e(i)),n])}catch(e){throw s(e)?e:o(`unavailable`,a.unavailable)}finally{y.delete(t)}},A=async e=>{let t=await k(e);if(`error`in t)throw o(t.error,t.message)},j=async e=>{let t=await k(e);if(typeof t==`object`&&t&&`error`in t)throw o(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:r,get self(){return u},get owner(){return p},get claimed(){return m},get mailbox(){return h},defaults:()=>g,members:()=>k(e=>e.members()),send:e=>A(t=>t.send(e)),edit:(e,t)=>A(n=>n.edit(e,t)),delete:(e,t)=>A(n=>n.delete(e,t)),backlog:(e,t)=>j(n=>n.backlog(e,t)),setDefault:(e,t)=>A(n=>n.setDefault(e,t)),limit:(e,t)=>A(n=>n.limit(e,t)),grant:(e,t)=>A(n=>n.grant(e,t)),revoke:(e,t)=>A(n=>n.revoke(e,t)),remove:e=>A(t=>t.remove(e)),block:e=>A(t=>t.block(e)),unblock:e=>A(t=>t.unblock(e)),claim:async e=>{let t=e?.description;if(t!==void 0&&typeof t!=`string`)throw o(`invalid`,a.badDescription);let n=f(e?.temporary);if(n===null)throw o(`invalid`,a.badTemporary);let r={...t===void 0?{}:{description:t},...n===void 0?{}:{temporary:n}};return Object.keys(r).length===0?A(e=>e.claim()):A(e=>{if(n!==void 0&&e.temporaryClaims!==!0)throw o(`unavailable`,a.temporaryUnavailable);return e.claim(r)})},release:()=>A(e=>e.release()),usage:async()=>{let e=await j(e=>e.usage());return h=e,e},on:async e=>_?()=>{}:(v.add(e),()=>{v.delete(e)}),leave:async()=>{await Promise.resolve(i.leave()).catch(()=>{}),T(`left`)},closed:C}},m=async()=>{let e=await l();return e?e.available().catch(()=>!1):!1},h=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw o(`invalid`,a.badName);let n=await l();if(!n)throw o(`unavailable`,a.unavailable);let r=await n.open(e,t).catch(u);if(`error`in r)throw o(r.error,r.message);return p(r)},g=async e=>{let t=await l();if(!t)throw o(`unavailable`,a.unavailable);let n=await t.create(e).catch(u);if(`error`in n)throw o(n.error,n.message);return p(n)},_=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw o(`invalid`,a.inviteNoKey);let r=await l();if(!r)throw o(`unavailable`,a.unavailable);let i=await r.join(e,t).catch(u);if(`error`in i)throw o(i.error,i.message);return p(i)};exports.available=m,exports.create=g,exports.join=_,exports.open=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api--LOXTOpv.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./contract.cjs");var i=e.t({available:()=>h,create:()=>_,join:()=>v,open:()=>g}),a={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,needsPremium:`rooms: claiming needs premium`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,badDescription:`rooms: the description is not one a claim can carry`,notClaimer:`rooms: only the app that claimed the room can describe it`,notReleaser:`rooms: only the app that claimed the room can release it`,notClaimingApp:`rooms: only the app that claimed the room can change it`,badTemporary:`rooms: the temporary duration is not one a claim can carry`,notTemporaryClaimer:`rooms: only the app that claimed the room can set when it expires`,temporaryUnavailable:`rooms: temporary claims are not available`,mailboxUnavailable:`rooms: the mailbox switch is not available`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},o=(e,t)=>Object.assign(Error(t),{code:e}),s=e=>e instanceof Error&&typeof e.code==`string`,c={send:!0,receive:!0,maxMessageBytes:262144},l=()=>({messages:0,bytes:0,cap:5e8,archived:!1}),u=async()=>{if(!t.l)return;let e=(await t.s(`a room`).catch(()=>void 0))?.rooms;return typeof e?.open==`function`?e:void 0},d=()=>{throw o(`unavailable`,a.unavailable)},f=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,p=e=>{if(e!==void 0&&e!==!1)return e===!0?r.ROOM_TEMPORARY_MS.default:typeof e!=`number`||!Number.isInteger(e)?null:e>=r.ROOM_TEMPORARY_MS.min&&e<=r.ROOM_TEMPORARY_MS.max?e:null},m=async e=>{let r=e.invite,i=e,u=0,d=e.self,m=e.owner,h=e.claimed,g=e.mailbox,_=0,v=await e.defaults().catch(()=>c),y=!1,b=new Set,x=new Set,S=n.t(`room`),C=()=>{},w=()=>{},T=new Promise(e=>{w=e}),E=e=>{let t=[...x];x.clear();for(let n of t)try{n(e)}catch{}},D=e=>{y||(y=!0,C(),b.clear(),S(),E(o(`closed`,a.ended)),w({reason:e}))},O=e=>{if(y)return;let t=e;if(t.type===`defaults`&&(v=t.defaults),t.type===`permissions`&&t.id===d.id&&(d={id:d.id,permissions:t.permissions,maxMessageBytes:t.maxMessageBytes}),t.type===`claim`){_+=1;let e=t.claimed&&t.mailbox!==!1;t={type:`claim`,claimed:t.claimed,owner:t.owner,mailbox:e},h=t.claimed,m=t.owner,g=e?l():null}for(let e of[...b])try{e(t)}catch{}},k=(e,t)=>{Promise.resolve(e.on(O)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===u&&D(e.reason)},()=>{})},A=async(e,t)=>{if(typeof e?.join!=`function`)return D(`unavailable`);let n=await e.join(r).catch(()=>void 0);if(y||t!==u)return;if(!n)return D(`unavailable`);if(`error`in n)return D(f(n.error));if(n.self.id!==d.id)return Promise.resolve(n.leave()).catch(()=>{}),D(`unavailable`);i=n,d=n.self,m=n.owner,h=n.claimed,g=n.mailbox,k(n,t);let a=await n.defaults().catch(()=>void 0);a&&!y&&t===u&&(v=a)};C=t.u((e,t)=>{let n=u;u=t,!(y||n===0||n===t)&&(E(o(`unavailable`,a.unavailable)),A(e.rooms,t))}),k(e,u);let j=async e=>{if(y)throw o(`closed`,a.ended);let t=()=>{},n=new Promise((e,n)=>{t=n});x.add(t);try{return await Promise.race([Promise.resolve(e(i)),n])}catch(e){throw s(e)?e:o(`unavailable`,a.unavailable)}finally{x.delete(t)}},M=async e=>{let t=await j(e);if(`error`in t)throw o(t.error,t.message)},N=async e=>{let t=await j(e);if(typeof t==`object`&&t&&`error`in t)throw o(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:r,get self(){return d},get owner(){return m},get claimed(){return h},get mailbox(){return g},defaults:()=>v,members:()=>j(e=>e.members()),send:e=>M(t=>t.send(e)),edit:(e,t)=>M(n=>n.edit(e,t)),delete:(e,t)=>M(n=>n.delete(e,t)),backlog:(e,t)=>N(n=>n.backlog(e,t)),setDefault:(e,t)=>M(n=>n.setDefault(e,t)),limit:(e,t)=>M(n=>n.limit(e,t)),grant:(e,t)=>M(n=>n.grant(e,t)),revoke:(e,t)=>M(n=>n.revoke(e,t)),remove:e=>M(t=>t.remove(e)),block:e=>M(t=>t.block(e)),unblock:e=>M(t=>t.unblock(e)),claim:async e=>{let t=e?.description;if(t!==void 0&&typeof t!=`string`)throw o(`invalid`,a.badDescription);let n=p(e?.temporary);if(n===null)throw o(`invalid`,a.badTemporary);let r=e?.mailbox;if(r!==void 0&&typeof r!=`boolean`)throw o(`invalid`,a.malformed);let i={...t===void 0?{}:{description:t},...n===void 0?{}:{temporary:n},...r===void 0?{}:{mailbox:r}};return Object.keys(i).length===0?M(e=>e.claim()):M(e=>{if(n!==void 0&&e.temporaryClaims!==!0)throw o(`unavailable`,a.temporaryUnavailable);if(r===!1&&e.mailboxSwitch!==!0)throw o(`unavailable`,a.mailboxUnavailable);return e.claim(i)})},setMailbox:async e=>{if(typeof e!=`boolean`)throw o(`invalid`,a.malformed);let t=_;await M(t=>{if(t.mailboxSwitch!==!0)throw o(`unavailable`,a.mailboxUnavailable);return t.setMailbox(e)}),_===t&&(e?g===null&&(g=l()):g=null)},release:()=>M(e=>e.release()),usage:async()=>{let e=await N(e=>e.usage());return g=e,e},on:async e=>y?()=>{}:(b.add(e),()=>{b.delete(e)}),leave:async()=>{await Promise.resolve(i.leave()).catch(()=>{}),D(`left`)},closed:T}},h=async()=>{let e=await u();return e?e.available().catch(()=>!1):!1},g=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw o(`invalid`,a.badName);let n=await u();if(!n)throw o(`unavailable`,a.unavailable);let r=await n.open(e,t).catch(d);if(`error`in r)throw o(r.error,r.message);return m(r)},_=async e=>{let t=await u();if(!t)throw o(`unavailable`,a.unavailable);let n=await t.create(e).catch(d);if(`error`in n)throw o(n.error,n.message);return m(n)},v=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw o(`invalid`,a.inviteNoKey);let r=await u();if(!r)throw o(`unavailable`,a.unavailable);let i=await r.join(e,t).catch(d);if(`error`in i)throw o(i.error,i.message);return m(i)};exports.available=h,exports.create=_,exports.join=v,exports.open=g,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
package/rooms.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { J as RoomClaimOptions, Q as RoomEvent, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, at as RoomPermission, et as RoomJoinOptions, it as RoomOpenOptions, nt as RoomMember, ot as RoomPermissions, q as RoomBacklog, rt as RoomMessage, st as RoomsErrorCode, tt as RoomMailbox } from "./contract-DJxGa8lb.js";
1
+ import { J as RoomClaimOptions, Q as RoomEvent, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, at as RoomPermission, et as RoomJoinOptions, it as RoomOpenOptions, nt as RoomMember, ot as RoomPermissions, q as RoomBacklog, rt as RoomMessage, st as RoomsErrorCode, tt as RoomMailbox } from "./contract-6Xfd_qel.js";
2
2
  declare namespace rooms_d_exports {
3
3
  export { RoomClaimOptions as ClaimOptions, RoomCreateOptions as CreateOptions, RoomJoinOptions as JoinOptions, RoomOpenOptions as OpenOptions, Room, RoomBacklog, RoomDefaults, RoomEnd, RoomEvent, RoomMailbox, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsError, RoomsErrorCode, available, create, join, open };
4
4
  }
@@ -22,44 +22,87 @@ export type Room = {
22
22
  readonly self: RoomMember;
23
23
  /** the owner's member id, or '' while a claimed room's owner has never joined */
24
24
  readonly owner: string;
25
- /** whether a premium account keeps this name and its messages */
25
+ /** whether a premium account keeps this name. Whether it keeps the messages too is `mailbox`. */
26
26
  readonly claimed: boolean;
27
27
  /**
28
- * what the mailbox holds, as the room last said. Null for a room nobody has claimed. The account can
29
- * clear the room, unclaim it or set a lower `cap` from its fkn.app settings, which the app hears as a
30
- * `deleted` or a `claim` event; `usage()` reads the figures again.
28
+ * what the mailbox holds, as the room last said. Null while the room keeps no messages: nobody has
29
+ * claimed it, or its claim keeps none. The account can clear the room, unclaim it, turn its messages
30
+ * off or on, or set a lower `cap` from its fkn.app settings, which the app hears as a `deleted` or a
31
+ * `claim` event; `usage()` reads the figures again.
31
32
  */
32
33
  readonly mailbox: RoomMailbox | null;
33
34
  defaults: () => RoomDefaults;
34
35
  members: () => Promise<RoomMember[]>;
35
36
  /** sealed before it leaves the browser. Rejects `too-large` past `self.maxMessageBytes` on the wire, never truncates. */
36
37
  send: (text: string) => Promise<void>;
37
- /** replaces a stored message's text: one of your own, or any as the owner */
38
+ /**
39
+ * replaces a stored message's text: one of your own, or any as the owner. On a room claimed under an
40
+ * app's scope, from another app of the claim's account, it is refused `denied` (`rooms: only the app
41
+ * that claimed the room can change it`), the account's own messages included, as `claim` says.
42
+ */
38
43
  edit: (seq: number, text: string) => Promise<void>;
39
- /** drops stored messages: one of your own, or any range as the owner */
44
+ /**
45
+ * drops stored messages: one of your own, or any range as the owner. On a room claimed under an app's
46
+ * scope, from another app of the claim's account, it is refused `denied` (`rooms: only the app that
47
+ * claimed the room can change it`), the account's own messages included, as `claim` says.
48
+ */
40
49
  delete: (from: number, to?: number) => Promise<void>;
41
50
  /** replays stored messages above `after` as `message` events marked `replayed`, one page at a time */
42
51
  backlog: (after: number, limit?: number) => Promise<RoomBacklog>;
52
+ /**
53
+ * whether a member with no override may send or receive, from the owner only (`denied`, `rooms: not
54
+ * the room owner`). On a room claimed under an app's scope, from another app of the claim's account,
55
+ * it is refused `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
56
+ */
43
57
  setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<void>;
44
58
  /**
45
59
  * the message size cap, from 1 to 33,554,432. With no id it sets the room default, which is always
46
- * a number. With an id it sets that member's override, and null clears the override.
60
+ * a number. With an id it sets that member's override, and null clears the override. From the owner
61
+ * only (`denied`, `rooms: not the room owner`); on a room claimed under an app's scope, from another
62
+ * app of the claim's account, it is refused `denied` (`rooms: only the app that claimed the room can
63
+ * change it`), as `claim` says.
47
64
  */
48
65
  limit: {
49
66
  (maxMessageBytes: number, id?: string): Promise<void>;
50
67
  (maxMessageBytes: number | null, id: string): Promise<void>;
51
68
  };
69
+ /**
70
+ * gives a member a permission over the room default, from the owner only (`denied`, `rooms: not the
71
+ * room owner`). On a room claimed under an app's scope, from another app of the claim's account, it is
72
+ * refused `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
73
+ */
52
74
  grant: (id: string, permission: RoomPermission) => Promise<void>;
75
+ /**
76
+ * takes a permission from a member over the room default, from the owner only (`denied`, `rooms: not
77
+ * the room owner`). On a room claimed under an app's scope, from another app of the claim's account, it
78
+ * is refused `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
79
+ */
53
80
  revoke: (id: string, permission: RoomPermission) => Promise<void>;
81
+ /**
82
+ * sends a member out of the room, which they may join again, with the `remove` permission (`denied`,
83
+ * `rooms: permission denied`). On a room claimed under an app's scope, from another app of the claim's
84
+ * account, it is refused `denied` (`rooms: only the app that claimed the room can change it`), as
85
+ * `claim` says.
86
+ */
54
87
  remove: (id: string) => Promise<void>;
88
+ /**
89
+ * sends a member out of the room and keeps them out, with the `block` permission (`denied`, `rooms:
90
+ * permission denied`). On a room claimed under an app's scope, from another app of the claim's account,
91
+ * it is refused `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
92
+ */
55
93
  block: (id: string) => Promise<void>;
94
+ /**
95
+ * lets a blocked member join again, with the `block` permission (`denied`, `rooms: permission denied`).
96
+ * On a room claimed under an app's scope, from another app of the claim's account, it is refused
97
+ * `denied` (`rooms: only the app that claimed the room can change it`), as `claim` says.
98
+ */
56
99
  unblock: (id: string) => Promise<void>;
57
100
  /**
58
- * keeps the name and a mailbox for the signed-in premium account. The only thing in rooms that premium
59
- * buys. `description` says what the room is for, shown to the account in its fkn.app settings; a
60
- * permanent claim with an unchanged one on every open is free. Claiming on every open also claims the
61
- * room again after the account unclaims it from fkn.app, so claim when the person wants the room kept,
62
- * or make it `temporary`.
101
+ * keeps the name for the signed-in premium account, and a mailbox unless asked not to. The only thing
102
+ * in rooms that premium buys. `description` says what the room is for, shown to the account in its
103
+ * fkn.app settings; a permanent claim with an unchanged one on every open is free. Claiming on every
104
+ * open also claims the room again after the account unclaims it from fkn.app, so claim when the person
105
+ * wants the room kept, or make it `temporary`.
63
106
  *
64
107
  * `temporary` makes the claim end by itself, in milliseconds (`true` is 7 days), that long after its
65
108
  * last claim: a temporary claim goes to the account's ledger every time, which is what restarts its
@@ -67,6 +110,22 @@ export type Room = {
67
110
  * from fkn.app, and the stored messages are gone. A broker too old to carry it refuses the call
68
111
  * `unavailable` (`rooms: temporary claims are not available`) rather than make the claim permanent.
69
112
  *
113
+ * `mailbox: false` keeps the name and stores nothing: the room relays as an unclaimed one does. It is
114
+ * read only when the call starts the claim and ignored on a room the account already holds, so claiming
115
+ * on every open never undoes the owner's choice.
116
+ *
117
+ * Who changes a claimed room depends on its scope. A room under an app's scope, which is every room
118
+ * but a `global` one, is changed by the claim's account only through the app that claimed it (the
119
+ * same app once it is verified): from another app of the account `setDefault`, `limit`, `grant`,
120
+ * `revoke`, `remove`, `block`, `unblock`, `setMailbox`, `edit` and `delete` are refused `denied`
121
+ * (`rooms: only the app that claimed the room can change it`), the account's own messages included,
122
+ * and nothing changes. That other app, which reaches the room through its invite, still joins, reads
123
+ * and sends. A claimed `global` room is changed by any app of the account, which also describes it,
124
+ * sets its `temporary` and releases it. The account changes every room it claimed
125
+ * from its fkn.app settings, whichever app claimed it, and members of other accounts are answered as
126
+ * in any room. While the room cannot tell whether two apps are one, such a change is refused
127
+ * `unavailable` (`rooms: rooms are unavailable`) and can be sent again.
128
+ *
70
129
  * Past the account's room limit the call waits while fkn.app shows the person their claimed rooms over
71
130
  * your app, with Unclaim on each: it resolves once one is unclaimed and this claim is made, and rejects
72
131
  * `full` (`rooms: too many claims`) when they close the card or when fkn.app cannot show it. Nothing
@@ -74,8 +133,28 @@ export type Room = {
74
133
  */
75
134
  claim: (options?: RoomClaimOptions) => Promise<void>;
76
135
  /**
77
- * gives the claim back: the mailbox is deleted and whoever is present stays in an ordinary room. The app
78
- * that claimed the room only; the account can also unclaim it from its fkn.app settings.
136
+ * turns a claimed room's mailbox off or on, from the room's owner only, which in a claimed room is the
137
+ * claim's account. Off deletes every stored message at once, the archive included, and the room then
138
+ * relays as an unclaimed one does while keeping its claim; whoever is present hears a `claim` event
139
+ * with `mailbox: false` and no `deleted`, so what an app shows stays. On starts an empty mailbox that
140
+ * keeps messages from the next `seq`, and nothing deleted comes back. Turning it on needs premium, as a
141
+ * claim does (`denied`, `rooms: claiming needs premium`); turning it off never does. Setting what it
142
+ * already is changes nothing. Resolves once the room answered, with `mailbox` reading the new state,
143
+ * or a newer one when a release or the account's own switch landed before the answer.
144
+ *
145
+ * Refused `invalid` (`rooms: the room is not claimed`) on an unclaimed room, `denied` (`rooms: not the
146
+ * room owner`) from anyone else, `denied` (`rooms: only the app that claimed the room can change it`)
147
+ * from another app of the claim's account on a room claimed under an app's scope, as `claim` says, and
148
+ * `invalid` (`rooms: malformed frame`) for anything but a boolean. A broker too old to carry it refuses
149
+ * `unavailable` (`rooms: the mailbox switch is not available`). The account can do the same from its
150
+ * fkn.app settings, whichever app claimed the room.
151
+ */
152
+ setMailbox: (on: boolean) => Promise<void>;
153
+ /**
154
+ * gives the claim back: the mailbox is deleted and whoever is present stays in an ordinary room. On a
155
+ * room under an app's scope, the app that claimed it only (the same app once it is verified), and from
156
+ * another app it is refused `denied` (`rooms: only the app that claimed the room can release it`); on a
157
+ * `global` room, any app of the account. The account can also unclaim it from its fkn.app settings.
79
158
  */
80
159
  release: () => Promise<void>;
81
160
  usage: () => Promise<RoomMailbox | null>;
package/rooms.js CHANGED
@@ -4,10 +4,10 @@ import { t as i } from "./busy-B189uX--.js";
4
4
  import { ROOM_TEMPORARY_MS as a } from "./contract.js";
5
5
  //#region src/rooms.ts
6
6
  var o = /* @__PURE__ */ e({
7
- available: () => g,
8
- create: () => v,
9
- join: () => y,
10
- open: () => _
7
+ available: () => _,
8
+ create: () => y,
9
+ join: () => b,
10
+ open: () => v
11
11
  }), s = {
12
12
  wrongKey: "rooms: wrong room key",
13
13
  inviteNoKey: "rooms: the invite carries no key",
@@ -38,9 +38,11 @@ var o = /* @__PURE__ */ e({
38
38
  badDescription: "rooms: the description is not one a claim can carry",
39
39
  notClaimer: "rooms: only the app that claimed the room can describe it",
40
40
  notReleaser: "rooms: only the app that claimed the room can release it",
41
+ notClaimingApp: "rooms: only the app that claimed the room can change it",
41
42
  badTemporary: "rooms: the temporary duration is not one a claim can carry",
42
43
  notTemporaryClaimer: "rooms: only the app that claimed the room can set when it expires",
43
44
  temporaryUnavailable: "rooms: temporary claims are not available",
45
+ mailboxUnavailable: "rooms: the mailbox switch is not available",
44
46
  tooFast: "rooms: sending too fast",
45
47
  tooLarge: "rooms: the message is too large",
46
48
  unavailable: "rooms: rooms are unavailable",
@@ -53,73 +55,87 @@ var o = /* @__PURE__ */ e({
53
55
  send: !0,
54
56
  receive: !0,
55
57
  maxMessageBytes: 262144
56
- }, d = async () => {
58
+ }, d = () => ({
59
+ messages: 0,
60
+ bytes: 0,
61
+ cap: 5e8,
62
+ archived: !1
63
+ }), f = async () => {
57
64
  if (!t) return;
58
65
  let e = (await n("a room").catch(() => void 0))?.rooms;
59
66
  return typeof e?.open == "function" ? e : void 0;
60
- }, f = () => {
67
+ }, p = () => {
61
68
  throw c("unavailable", s.unavailable);
62
- }, p = (e) => e === "blocked" ? "blocked" : e === "not-found" ? "ended" : "unavailable", m = (e) => {
69
+ }, m = (e) => e === "blocked" ? "blocked" : e === "not-found" ? "ended" : "unavailable", h = (e) => {
63
70
  if (e !== void 0 && e !== !1) return e === !0 ? a.default : typeof e != "number" || !Number.isInteger(e) ? null : e >= a.min && e <= a.max ? e : null;
64
- }, h = async (e) => {
65
- let t = e.invite, n = e, a = 0, o = e.self, d = e.owner, f = e.claimed, h = e.mailbox, g = await e.defaults().catch(() => u), _ = !1, v = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set(), b = i("room"), x = () => {}, S = () => {}, C = new Promise((e) => {
66
- S = e;
67
- }), w = (e) => {
68
- let t = [...y];
69
- y.clear();
71
+ }, g = async (e) => {
72
+ let t = e.invite, n = e, a = 0, o = e.self, f = e.owner, p = e.claimed, g = e.mailbox, _ = 0, v = await e.defaults().catch(() => u), y = !1, b = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set(), S = i("room"), C = () => {}, w = () => {}, T = new Promise((e) => {
73
+ w = e;
74
+ }), E = (e) => {
75
+ let t = [...x];
76
+ x.clear();
70
77
  for (let n of t) try {
71
78
  n(e);
72
79
  } catch {}
73
- }, T = (e) => {
74
- _ || (_ = !0, x(), v.clear(), b(), w(c("closed", s.ended)), S({ reason: e }));
75
- }, E = (e) => {
76
- if (!_) {
77
- e.type === "defaults" && (g = e.defaults), e.type === "permissions" && e.id === o.id && (o = {
78
- id: o.id,
79
- permissions: e.permissions,
80
- maxMessageBytes: e.maxMessageBytes
81
- }), e.type === "claim" && (f = e.claimed, d = e.owner, f || (h = null));
82
- for (let t of [...v]) try {
83
- t(e);
84
- } catch {}
80
+ }, D = (e) => {
81
+ y || (y = !0, C(), b.clear(), S(), E(c("closed", s.ended)), w({ reason: e }));
82
+ }, O = (e) => {
83
+ if (y) return;
84
+ let t = e;
85
+ if (t.type === "defaults" && (v = t.defaults), t.type === "permissions" && t.id === o.id && (o = {
86
+ id: o.id,
87
+ permissions: t.permissions,
88
+ maxMessageBytes: t.maxMessageBytes
89
+ }), t.type === "claim") {
90
+ _ += 1;
91
+ let e = t.claimed && t.mailbox !== !1;
92
+ t = {
93
+ type: "claim",
94
+ claimed: t.claimed,
95
+ owner: t.owner,
96
+ mailbox: e
97
+ }, p = t.claimed, f = t.owner, g = e ? d() : null;
85
98
  }
86
- }, D = (e, t) => {
87
- Promise.resolve(e.on(E)).catch(() => {}), Promise.resolve(e.closed).then((e) => {
88
- t === a && T(e.reason);
99
+ for (let e of [...b]) try {
100
+ e(t);
101
+ } catch {}
102
+ }, k = (e, t) => {
103
+ Promise.resolve(e.on(O)).catch(() => {}), Promise.resolve(e.closed).then((e) => {
104
+ t === a && D(e.reason);
89
105
  }, () => {});
90
- }, O = async (e, r) => {
91
- if (typeof e?.join != "function") return T("unavailable");
106
+ }, A = async (e, r) => {
107
+ if (typeof e?.join != "function") return D("unavailable");
92
108
  let i = await e.join(t).catch(() => void 0);
93
- if (_ || r !== a) return;
94
- if (!i) return T("unavailable");
95
- if ("error" in i) return T(p(i.error));
96
- if (i.self.id !== o.id) return Promise.resolve(i.leave()).catch(() => {}), T("unavailable");
97
- n = i, o = i.self, d = i.owner, f = i.claimed, h = i.mailbox, D(i, r);
109
+ if (y || r !== a) return;
110
+ if (!i) return D("unavailable");
111
+ if ("error" in i) return D(m(i.error));
112
+ if (i.self.id !== o.id) return Promise.resolve(i.leave()).catch(() => {}), D("unavailable");
113
+ n = i, o = i.self, f = i.owner, p = i.claimed, g = i.mailbox, k(i, r);
98
114
  let s = await i.defaults().catch(() => void 0);
99
- s && !_ && r === a && (g = s);
115
+ s && !y && r === a && (v = s);
100
116
  };
101
- x = r((e, t) => {
117
+ C = r((e, t) => {
102
118
  let n = a;
103
- a = t, !(_ || n === 0 || n === t) && (w(c("unavailable", s.unavailable)), O(e.rooms, t));
104
- }), D(e, a);
105
- let k = async (e) => {
106
- if (_) throw c("closed", s.ended);
119
+ a = t, !(y || n === 0 || n === t) && (E(c("unavailable", s.unavailable)), A(e.rooms, t));
120
+ }), k(e, a);
121
+ let j = async (e) => {
122
+ if (y) throw c("closed", s.ended);
107
123
  let t = () => {}, r = new Promise((e, n) => {
108
124
  t = n;
109
125
  });
110
- y.add(t);
126
+ x.add(t);
111
127
  try {
112
128
  return await Promise.race([Promise.resolve(e(n)), r]);
113
129
  } catch (e) {
114
130
  throw l(e) ? e : c("unavailable", s.unavailable);
115
131
  } finally {
116
- y.delete(t);
132
+ x.delete(t);
117
133
  }
118
- }, A = async (e) => {
119
- let t = await k(e);
134
+ }, M = async (e) => {
135
+ let t = await j(e);
120
136
  if ("error" in t) throw c(t.error, t.message);
121
- }, j = async (e) => {
122
- let t = await k(e);
137
+ }, N = async (e) => {
138
+ let t = await j(e);
123
139
  if (typeof t == "object" && t && "error" in t) throw c(t.error, t.message);
124
140
  return t;
125
141
  };
@@ -132,78 +148,90 @@ var o = /* @__PURE__ */ e({
132
148
  return o;
133
149
  },
134
150
  get owner() {
135
- return d;
151
+ return f;
136
152
  },
137
153
  get claimed() {
138
- return f;
154
+ return p;
139
155
  },
140
156
  get mailbox() {
141
- return h;
157
+ return g;
142
158
  },
143
- defaults: () => g,
144
- members: () => k((e) => e.members()),
145
- send: (e) => A((t) => t.send(e)),
146
- edit: (e, t) => A((n) => n.edit(e, t)),
147
- delete: (e, t) => A((n) => n.delete(e, t)),
148
- backlog: (e, t) => j((n) => n.backlog(e, t)),
149
- setDefault: (e, t) => A((n) => n.setDefault(e, t)),
150
- limit: (e, t) => A((n) => n.limit(e, t)),
151
- grant: (e, t) => A((n) => n.grant(e, t)),
152
- revoke: (e, t) => A((n) => n.revoke(e, t)),
153
- remove: (e) => A((t) => t.remove(e)),
154
- block: (e) => A((t) => t.block(e)),
155
- unblock: (e) => A((t) => t.unblock(e)),
159
+ defaults: () => v,
160
+ members: () => j((e) => e.members()),
161
+ send: (e) => M((t) => t.send(e)),
162
+ edit: (e, t) => M((n) => n.edit(e, t)),
163
+ delete: (e, t) => M((n) => n.delete(e, t)),
164
+ backlog: (e, t) => N((n) => n.backlog(e, t)),
165
+ setDefault: (e, t) => M((n) => n.setDefault(e, t)),
166
+ limit: (e, t) => M((n) => n.limit(e, t)),
167
+ grant: (e, t) => M((n) => n.grant(e, t)),
168
+ revoke: (e, t) => M((n) => n.revoke(e, t)),
169
+ remove: (e) => M((t) => t.remove(e)),
170
+ block: (e) => M((t) => t.block(e)),
171
+ unblock: (e) => M((t) => t.unblock(e)),
156
172
  claim: async (e) => {
157
173
  let t = e?.description;
158
174
  if (t !== void 0 && typeof t != "string") throw c("invalid", s.badDescription);
159
- let n = m(e?.temporary);
175
+ let n = h(e?.temporary);
160
176
  if (n === null) throw c("invalid", s.badTemporary);
161
- let r = {
177
+ let r = e?.mailbox;
178
+ if (r !== void 0 && typeof r != "boolean") throw c("invalid", s.malformed);
179
+ let i = {
162
180
  ...t === void 0 ? {} : { description: t },
163
- ...n === void 0 ? {} : { temporary: n }
181
+ ...n === void 0 ? {} : { temporary: n },
182
+ ...r === void 0 ? {} : { mailbox: r }
164
183
  };
165
- return Object.keys(r).length === 0 ? A((e) => e.claim()) : A((e) => {
184
+ return Object.keys(i).length === 0 ? M((e) => e.claim()) : M((e) => {
166
185
  if (n !== void 0 && e.temporaryClaims !== !0) throw c("unavailable", s.temporaryUnavailable);
167
- return e.claim(r);
186
+ if (r === !1 && e.mailboxSwitch !== !0) throw c("unavailable", s.mailboxUnavailable);
187
+ return e.claim(i);
168
188
  });
169
189
  },
170
- release: () => A((e) => e.release()),
190
+ setMailbox: async (e) => {
191
+ if (typeof e != "boolean") throw c("invalid", s.malformed);
192
+ let t = _;
193
+ await M((t) => {
194
+ if (t.mailboxSwitch !== !0) throw c("unavailable", s.mailboxUnavailable);
195
+ return t.setMailbox(e);
196
+ }), _ === t && (e ? g === null && (g = d()) : g = null);
197
+ },
198
+ release: () => M((e) => e.release()),
171
199
  usage: async () => {
172
- let e = await j((e) => e.usage());
173
- return h = e, e;
200
+ let e = await N((e) => e.usage());
201
+ return g = e, e;
174
202
  },
175
- on: async (e) => _ ? () => {} : (v.add(e), () => {
176
- v.delete(e);
203
+ on: async (e) => y ? () => {} : (b.add(e), () => {
204
+ b.delete(e);
177
205
  }),
178
206
  leave: async () => {
179
- await Promise.resolve(n.leave()).catch(() => {}), T("left");
207
+ await Promise.resolve(n.leave()).catch(() => {}), D("left");
180
208
  },
181
- closed: C
209
+ closed: T
182
210
  };
183
- }, g = async () => {
184
- let e = await d();
211
+ }, _ = async () => {
212
+ let e = await f();
185
213
  return e ? e.available().catch(() => !1) : !1;
186
- }, _ = async (e, t) => {
214
+ }, v = async (e, t) => {
187
215
  if (typeof e != "string" || e.length === 0 || e.length > 72) throw c("invalid", s.badName);
188
- let n = await d();
216
+ let n = await f();
189
217
  if (!n) throw c("unavailable", s.unavailable);
190
- let r = await n.open(e, t).catch(f);
218
+ let r = await n.open(e, t).catch(p);
191
219
  if ("error" in r) throw c(r.error, r.message);
192
- return h(r);
193
- }, v = async (e) => {
194
- let t = await d();
220
+ return g(r);
221
+ }, y = async (e) => {
222
+ let t = await f();
195
223
  if (!t) throw c("unavailable", s.unavailable);
196
- let n = await t.create(e).catch(f);
224
+ let n = await t.create(e).catch(p);
197
225
  if ("error" in n) throw c(n.error, n.message);
198
- return h(n);
199
- }, y = async (e, t) => {
226
+ return g(n);
227
+ }, b = async (e, t) => {
200
228
  let n = typeof e == "string" ? e.indexOf(".") : -1;
201
229
  if (n <= 0 || n === e.length - 1) throw c("invalid", s.inviteNoKey);
202
- let r = await d();
230
+ let r = await f();
203
231
  if (!r) throw c("unavailable", s.unavailable);
204
- let i = await r.join(e, t).catch(f);
232
+ let i = await r.join(e, t).catch(p);
205
233
  if ("error" in i) throw c(i.error, i.message);
206
- return h(i);
234
+ return g(i);
207
235
  };
208
236
  //#endregion
209
- export { g as available, v as create, y as join, _ as open, o as t };
237
+ export { _ as available, y as create, b as join, v as open, o as t };
@@ -7,12 +7,10 @@ type FileEntry$1 = {
7
7
  };
8
8
  type WriteData$1 = Blob | ArrayBuffer | Uint8Array | string;
9
9
  /**
10
- * Which account a cloud call belongs to. Library plumbing that app code never passes: an operation of
11
- * several calls (a rename, a mount, a queue drain) captures one when it starts, so none of its calls
12
- * can land in an account the realm switched to meanwhile.
13
- *
14
- * `{ generation }` is a ticket from `captureAccount()`: its calls carry that generation's pin. `{ pin }`
15
- * is a pin a queued entry was stamped with, sent as is.
10
+ * Which account a cloud call belongs to; library plumbing app code never passes. A multi-call
11
+ * operation (a rename, a mount, a queue drain) captures one at its start so no call lands in an
12
+ * account the realm switched to meanwhile. `{ generation }` is a ticket from `captureAccount()`;
13
+ * `{ pin }` is the pin a queued entry was stamped with, sent as is.
16
14
  */
17
15
  type PinFrom = {
18
16
  readonly generation: number;
@@ -61,18 +59,12 @@ declare class StorageLockedError extends Error {
61
59
  constructor();
62
60
  }
63
61
  /**
64
- * There is no object at this path. Test `err.code === STORAGE_NOT_FOUND`, never the message.
65
- *
66
- * Absence arrives from two places that word it completely differently: the api refusing to presign
67
- * a path with no committed row says "Not found", and a presign that succeeded followed by an object
68
- * fetch that 404s says "storage: read failed (404)". Neither is a fault, both mean the same thing,
69
- * and matching either by hand means matching both. Ripple matched only the first, so a missing
70
- * backup read as a transient failure, retried forever, and a library went un-backed-up for a day
71
- * without a single error anywhere.
62
+ * There is no object at this path. Test `err.code === STORAGE_NOT_FOUND`, never the message: absence
63
+ * is worded differently by the presign ("Not found") and by the object fetch ("storage: read failed
64
+ * (404)").
72
65
  *
73
- * The distinction matters more than it sounds. "There is nothing here" is safe to overwrite;
74
- * "I could not tell you" is not, and a caller that confuses them either never writes a first
75
- * backup or destroys a real one.
66
+ * "There is nothing here" is safe to overwrite; "I could not tell you" is not, and a caller that
67
+ * confuses them either never writes a first backup or destroys a real one.
76
68
  */
77
69
  declare class StorageNotFoundError extends Error {
78
70
  code: string;
@@ -114,7 +106,6 @@ declare class StorageAccountPinUnsupportedError extends Error {
114
106
  declare const isAccountChanged: (error: unknown) => boolean;
115
107
  /** Whether the api could not read a pin at all (a queued entry's record damaged on the device). */
116
108
  declare const isInvalidPin: (error: unknown) => boolean;
117
- /** One account generation of this realm, captured when an operation started. */
118
109
  type AccountTicket = {
119
110
  readonly generation: number;
120
111
  };
@@ -145,16 +136,11 @@ type SealedRead = {
145
136
  /**
146
137
  * A cloud read that also reports when the copy was sealed.
147
138
  *
148
- * `sealedAt` is an ISO string, or null when the envelope carries no such field (one written before
149
- * the seal time existed) or when the data plane is older than this call. The value is
150
- * AUTHENTICATED, so the server can neither forge nor alter it, and it is the WRITER's own claim
151
- * about when it sealed, so on its own it does not prove this copy is the newest one: an older but
152
- * perfectly authentic copy of the same path is still authentic. An app that needs that answer keeps
153
- * a high-water mark per path and compares. Do not confuse it with the `updatedAt` on a listing,
154
- * which is the server's hint and is fine for display and nothing else.
155
- *
156
- * The bytes and the stamp come from ONE read of ONE envelope, which is what makes the stamp
157
- * describe the bytes returned beside it. `readFile` is unchanged and unaffected.
139
+ * `sealedAt` is an ISO string, or null for an envelope written before the seal time existed or a
140
+ * data plane older than this call. It is authenticated, so the server can neither forge nor alter
141
+ * it, but it is the WRITER's claim: it does not prove this copy is the newest, so an app that needs
142
+ * that keeps a high-water mark per path. The listing's `updatedAt` is a server hint, for display only.
143
+ * The bytes and the stamp come from one read of one envelope.
158
144
  */
159
145
  declare const readFileSealed: (path: string, opts?: PinOptions) => Promise<SealedRead>;
160
146
  declare const writeFile: (path: string, data: WriteData, opts?: {
@@ -2,19 +2,13 @@
2
2
  /**
3
3
  * Socket option codes as they appear on the WebVPN wire, and the option shapes built from them.
4
4
  *
5
- * These live in the library rather than beside the packet codecs because BOTH sides need them and
6
- * only one side may own them. `@fkn/lib` already imported these constants at value level (see
7
- * `webvpn/net.ts` and `webvpn/dgram.ts`), so the previous arrangement had the published package
8
- * reaching into `src/api/webvpn/packets/*` for its own vocabulary, which dragged those modules and
9
- * their imports into the library's type program.
5
+ * Owned by the library so both sides share one source: the packet codecs in
6
+ * `src/api/webvpn/packets/` import from this file, and the library needs nothing from the app.
10
7
  *
11
- * Owning them here inverts that: the codecs in `src/api/webvpn/packets/` import from this file, and
12
- * the library needs nothing from the app to describe a socket option.
13
- *
14
- * The VALUES are protocol. They are the u8 discriminant of a tagged union nested inside a
15
- * TcpSetOption or UdpSetOption client packet (metadata-stream tag 8), and a relay built against
16
- * these numbers is deployed independently of any browser holding this file. Renumbering one is a
17
- * wire break, not a refactor. Booleans go on the wire as u8, 0 for false and anything else true.
8
+ * The VALUES are protocol: the u8 discriminant of a tagged union inside a TcpSetOption or
9
+ * UdpSetOption client packet (metadata-stream tag 8). A relay built against these numbers deploys
10
+ * independently of any browser holding this file, so renumbering one is a wire break. Booleans go
11
+ * on the wire as u8, 0 for false and anything else true.
18
12
  */
19
13
  declare const TCP_OPTION_NODELAY: 0;
20
14
  declare const TCP_OPTION_TTL: 1;
package/wire.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as UDP_OPTION_TTL, a as TCP_OPTION_TTL, c as UDP_OPTION_ADD_MEMBERSHIP_V6, d as UDP_OPTION_DROP_MEMBERSHIP_V6, f as UDP_OPTION_MULTICAST_LOOP_V4, g as UDP_OPTION_SEND_BUFFER_SIZE, h as UDP_OPTION_RECV_BUFFER_SIZE, i as TCP_OPTION_SEND_BUFFER_SIZE, l as UDP_OPTION_BROADCAST, m as UDP_OPTION_MULTICAST_TTL_V4, n as TCP_OPTION_NODELAY, o as TcpSocketOption, p as UDP_OPTION_MULTICAST_LOOP_V6, r as TCP_OPTION_RECV_BUFFER_SIZE, s as UDP_OPTION_ADD_MEMBERSHIP_V4, t as TCP_OPTION_KEEPALIVE, u as UDP_OPTION_DROP_MEMBERSHIP_V4, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
1
+ import { _ as UDP_OPTION_TTL, a as TCP_OPTION_TTL, c as UDP_OPTION_ADD_MEMBERSHIP_V6, d as UDP_OPTION_DROP_MEMBERSHIP_V6, f as UDP_OPTION_MULTICAST_LOOP_V4, g as UDP_OPTION_SEND_BUFFER_SIZE, h as UDP_OPTION_RECV_BUFFER_SIZE, i as TCP_OPTION_SEND_BUFFER_SIZE, l as UDP_OPTION_BROADCAST, m as UDP_OPTION_MULTICAST_TTL_V4, n as TCP_OPTION_NODELAY, o as TcpSocketOption, p as UDP_OPTION_MULTICAST_LOOP_V6, r as TCP_OPTION_RECV_BUFFER_SIZE, s as UDP_OPTION_ADD_MEMBERSHIP_V4, t as TCP_OPTION_KEEPALIVE, u as UDP_OPTION_DROP_MEMBERSHIP_V4, v as UdpSocketOption } from "./wire-BwA4JjZH.js";
2
2
  export { TCP_OPTION_KEEPALIVE, TCP_OPTION_NODELAY, TCP_OPTION_RECV_BUFFER_SIZE, TCP_OPTION_SEND_BUFFER_SIZE, TCP_OPTION_TTL, TcpSocketOption, UDP_OPTION_ADD_MEMBERSHIP_V4, UDP_OPTION_ADD_MEMBERSHIP_V6, UDP_OPTION_BROADCAST, UDP_OPTION_DROP_MEMBERSHIP_V4, UDP_OPTION_DROP_MEMBERSHIP_V6, UDP_OPTION_MULTICAST_LOOP_V4, UDP_OPTION_MULTICAST_LOOP_V6, UDP_OPTION_MULTICAST_TTL_V4, UDP_OPTION_RECV_BUFFER_SIZE, UDP_OPTION_SEND_BUFFER_SIZE, UDP_OPTION_TTL, UdpSocketOption };