@fkn/lib 0.9.48 → 0.9.50

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.
Files changed (60) hide show
  1. package/LICENSE +12 -0
  2. package/{storage-C6F9SnDM.js → account-storage-C31d68BN.js} +2 -2
  3. package/{storage-DmRIhg1P.cjs → account-storage-C6hcXjG0.cjs} +1 -1
  4. package/{storage-B_mXNAdB.d.ts → account-storage-DHl6bXdb.d.ts} +2 -2
  5. package/{api-Cpi-qz1j.d.ts → api-wnOQJEK6.d.ts} +34 -42
  6. package/api.d.ts +2 -2
  7. package/cloud/dns.d.ts +1 -1
  8. package/cloud/fetch.d.ts +1 -1
  9. package/cloud/fs/promises.d.ts +1 -1
  10. package/cloud/fs.cjs +1 -1
  11. package/cloud/fs.d.ts +3 -3
  12. package/cloud/fs.js +12 -12
  13. package/cloud/net.d.ts +1 -1
  14. package/{cloud-BmwojOb5.cjs → cloud-CAN_iu2o.cjs} +1 -1
  15. package/{cloud-DK3DtdsU.d.ts → cloud-CWHjH89l.d.ts} +3 -3
  16. package/{cloud-B4_qsdaE.js → cloud-JXQKSDrW.js} +1 -1
  17. package/cloud.cjs +1 -1
  18. package/cloud.d.ts +4 -4
  19. package/cloud.js +1 -1
  20. package/{contract-XlEPwc7b.d.ts → contract-DGuGXxKd.d.ts} +119 -82
  21. package/contract.cjs +1 -1
  22. package/contract.d.ts +2 -2
  23. package/contract.js +69 -3
  24. package/dgram.d.ts +2 -2
  25. package/dns.d.ts +1 -1
  26. package/{extension-hOZN6A1U.js → extension-1Je_RJ6_.js} +1 -1
  27. package/{extension-uAlpUogG.cjs → extension-4koB6bS6.cjs} +1 -1
  28. package/extension.cjs +1 -1
  29. package/extension.js +2 -2
  30. package/fs/promises.cjs +1 -1
  31. package/fs/promises.d.ts +1 -1
  32. package/fs/promises.js +1 -1
  33. package/{fs-lKZe5xIo.d.ts → fs-BZv2djbS.d.ts} +2 -2
  34. package/{fs-BY0Csn2V.js → fs-ClnOPmRF.js} +39 -39
  35. package/fs-zERmcLRS.cjs +1 -0
  36. package/fs.cjs +1 -1
  37. package/fs.d.ts +3 -3
  38. package/fs.js +2 -2
  39. package/http.d.ts +1 -1
  40. package/{index-D9x6A-Gx.d.ts → index-DawD_N1P.d.ts} +2 -2
  41. package/index.cjs +1 -1
  42. package/index.d.ts +5 -6
  43. package/index.js +41 -42
  44. package/{lib-5z-jA7ND.cjs → lib-35d-3W0p.cjs} +1 -1
  45. package/{lib-Dhq4W2V8.js → lib-B2cML3Tq.js} +12 -10
  46. package/{messages-d7pvCXPn.d.ts → messages-AdPfdoLV.d.ts} +1 -1
  47. package/messages.d.ts +1 -1
  48. package/{net-C2Yz0job.d.ts → net-C2sulnNU.d.ts} +2 -2
  49. package/net.d.ts +1 -1
  50. package/package.json +6 -5
  51. package/packages.d.ts +1 -1
  52. package/{proxy-BZ-YFeXe.d.ts → proxy-MVuD49E2.d.ts} +2 -2
  53. package/rooms.d.ts +1 -1
  54. package/storage.cjs +1 -0
  55. package/storage.d.ts +69 -0
  56. package/storage.js +137 -0
  57. package/fs-DnF1cQuE.cjs +0 -1
  58. package/links.cjs +0 -1
  59. package/links.d.ts +0 -65
  60. package/links.js +0 -187
package/links.cjs DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs"),n=require("./contract.cjs"),r=require("./account-generation-9VhfEDoW.cjs"),i=require("./storage-DmRIhg1P.cjs");var a=e.t({LINK_EXPIRES_MS:()=>n.LINK_EXPIRES_MS,available:()=>_,create:()=>v,list:()=>x,open:()=>b,revoke:()=>S}),o={notALink:`links: the link is not one fkn.app made`,badExpiry:`links: the expiry is not one a link can carry`,notAFile:`links: the file is not a Blob or a ReadableStream`,badSize:`links: a stream needs the size it will deliver, a whole number of bytes`,badName:`links: the name or type is not one a link can carry`,tooLarge:`links: the file is too large for a link`,shortStream:`links: the stream did not deliver the size it declared`,badKey:`links: the key is not 32 bytes base64url`,keyTaken:`links: the key already names a link`,gone:`links: the link is no longer available`,integrity:`links: the file does not match its link`,needsAccount:`links: making a link needs an account`,notCreator:`links: only the app that made the link can revoke it`,quota:`links: storage quota exceeded`,tooMany:`links: too many links`,tooManyThisHour:`links: too many links made this hour, try again later`,rateLimited:`links: this link is opened too often, try again later`,accountChanged:`links: the signed-in account changed`,unavailable:`links: links are unavailable`},s=new Map([[o.notALink,`invalid`],[o.badExpiry,`invalid`],[o.notAFile,`invalid`],[o.badSize,`invalid`],[o.badName,`invalid`],[o.tooLarge,`invalid`],[o.shortStream,`invalid`],[o.badKey,`invalid`],[o.keyTaken,`invalid`],[o.gone,`not-found`],[o.integrity,`integrity`],[o.needsAccount,`denied`],[o.notCreator,`denied`],[o.quota,`quota`],[o.tooMany,`too-many`],[o.tooManyThisHour,`too-many`],[o.rateLimited,`rate-limited`],[o.accountChanged,`account-changed`],[o.unavailable,`unavailable`]]),c=new Set(s.values()),l=(e,t)=>Object.assign(Error(t),{code:e}),u=e=>e instanceof Error&&c.has(e.code),d=e=>{if(u(e))return e;let t=e instanceof Error?e.message:``,n=s.get(t);return n?l(n,t):l(`unavailable`,o.unavailable)},f=async()=>{if(!t.l)return;let e=(await t.s(`a link`).catch(()=>void 0))?.links;return typeof e?.create==`function`?e:void 0},p=()=>{throw l(`unavailable`,o.unavailable)},m=e=>typeof e==`object`&&!!e&&typeof e.error==`string`&&typeof e.message==`string`,h=(e,t,n)=>{throw e.error===`aborted`?t?.reason??new DOMException(`The operation was aborted.`,`AbortError`):(e.error===`account-changed`&&n&&r.r(n.generation),c.has(e.error)?l(e.error,e.message):l(`unavailable`,o.unavailable))},g=async e=>{try{return await i.p(e)}catch(e){throw i.c(e)?l(`account-changed`,o.accountChanged):e instanceof Error&&/not connected|not signed in/i.test(e.message)?l(`denied`,o.needsAccount):l(`unavailable`,o.unavailable)}},_=async()=>{let e=await f();return e?Promise.resolve(e.available()).catch(()=>!1):!1},v=async(e,t={})=>{let r=i.o(),a=Date.now(),{signal:s,onProgress:c,key:u}=t;s?.throwIfAborted();let d=typeof Blob<`u`&&e instanceof Blob,_=typeof ReadableStream<`u`&&e instanceof ReadableStream;if(!d&&!_)throw l(`invalid`,o.notAFile);let v=d?e.size:t.size;if(typeof v!=`number`||!Number.isSafeInteger(v)||v<0||d&&t.size!==void 0&&t.size!==v)throw l(`invalid`,o.badSize);let y=t.name??(typeof File<`u`&&e instanceof File?e.name:``),b=t.type??(d?e.type:``);if(typeof y!=`string`||typeof b!=`string`)throw l(`invalid`,o.badName);let x=typeof File<`u`&&e instanceof File?e.lastModified:a,S=t.expires,C;if(S!=null&&(typeof S!=`number`||!Number.isFinite(S)||(C=Math.round(S-a),C<n.LINK_EXPIRES_MS.min||C>n.LINK_EXPIRES_MS.max)))throw l(`invalid`,o.badExpiry);if(c!==void 0&&typeof c!=`function`)throw l(`invalid`,o.notAFile);let w=await f();if(!w)throw l(`unavailable`,o.unavailable);let T=await g(r);s?.throwIfAborted();let E=Promise.resolve(w.create(e,{name:y,type:b,lastModified:x,size:v,...C===void 0?{}:{expiresIn:C},...u===void 0?{}:{key:u},accountPin:T,...s?{signal:s}:{},...c?{onProgress:e=>{try{c(e)}catch{}}}:{}})).catch(p);E.catch(()=>{});let D=s?await Promise.race([E,new Promise((e,t)=>s.addEventListener(`abort`,()=>t(s.reason),{once:!0}))]):await E;return m(D)?h(D,s,r):D},y=(e,t,n)=>{let r=(t,n)=>{if(t===void 0)return n;let r=Math.trunc(Number.isFinite(t)?t:t>0?e:-e);return r<0?Math.max(e+r,0):Math.min(r,e)},i=r(t,0);return{from:i,to:Math.max(i,r(n,e))}},b=async(e,n={})=>{if(typeof e!=`string`)throw l(`invalid`,o.notALink);let{signal:r}=n;r?.throwIfAborted();let i=async()=>{let n=await f();if(!n)throw l(`unavailable`,o.unavailable);let i=t.c()?.epoch,a=await Promise.resolve(n.open(e,r?{signal:r}:void 0)).catch(p);return m(a)?h(a,r):{handle:a,epoch:i}},a=await i(),s=async()=>{let e=t.c()?.epoch;return a.epoch!==void 0&&e!==void 0&&e!==a.epoch&&(a=await i()),a.handle},{name:c,type:u,size:g,lastModified:_}=a.handle,v=(e,t)=>{let n;return new ReadableStream({pull:async r=>{try{if(!n){let r=await s(),i=await Promise.resolve(r.read(e,t)).catch(p);if(m(i))return h(i);n=i.getReader()}let{value:i,done:a}=await n.read();a?r.close():r.enqueue(i)}catch(e){throw d(e)}},cancel:e=>n?.cancel(e)},{highWaterMark:0})},b=(e,t)=>({name:c,type:u,size:t-e,lastModified:_,stream:()=>v(e,t),arrayBuffer:async()=>{let n=new Uint8Array(t-e),r=v(e,t).getReader(),i=0;for(;;){let{value:e,done:t}=await r.read();if(t)break;n.set(e,i),i+=e.length}return n.buffer},slice:(n,r)=>{let i=y(t-e,n,r);return b(e+i.from,e+i.to)}});return b(0,g)},x=async()=>{let e=i.o(),t=await f();if(!t)throw l(`unavailable`,o.unavailable);let n=await g(e),r=await Promise.resolve(t.list({accountPin:n})).catch(p);return m(r)?h(r,void 0,e):r.links},S=async e=>{let t=i.o();if(typeof e!=`string`||!e)throw l(`invalid`,o.notALink);let n=await f();if(!n)throw l(`unavailable`,o.unavailable);let r=await g(t),a=await Promise.resolve(n.revoke(e,{accountPin:r})).catch(p);m(a)&&h(a,void 0,t)};exports.LINK_EXPIRES_MS=n.LINK_EXPIRES_MS,exports.available=_,exports.create=v,exports.list=x,exports.open=b,exports.revoke=S,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
package/links.d.ts DELETED
@@ -1,65 +0,0 @@
1
- import { A as Link, F as LinksErrorCode, L as ListedLink, P as LinkProgress, j as LinkCreateOptions, k as LINK_EXPIRES_MS } from "./contract-XlEPwc7b.js";
2
- declare namespace links_d_exports {
3
- export { LINK_EXPIRES_MS, Link, LinkCreateOptions, LinkProgress, LinkedFile, LinksError, LinksErrorCode, ListedLink, available, create, list, open, revoke };
4
- }
5
- /** Thrown by every member of this namespace except on an aborted signal. Match on `code`, never on the message. */
6
- export type LinksError = Error & {
7
- code: LinksErrorCode;
8
- };
9
- /**
10
- * The file an opened link names, shaped like a `File`: the same four fields, `stream`, `arrayBuffer`
11
- * and `slice`. Every read is by range and each 1 MiB record is checked before it is handed over, so a
12
- * `slice` near the end of a large file fetches only that end.
13
- */
14
- export type LinkedFile = {
15
- name: string;
16
- type: string;
17
- size: number;
18
- lastModified: number;
19
- /** errors with `integrity` on the first record that is not what the link sealed */
20
- stream: () => ReadableStream<Uint8Array>;
21
- arrayBuffer: () => Promise<ArrayBuffer>;
22
- /** `Blob.slice`'s arguments, negative ones counted from the end, and the same shape back */
23
- slice: (start?: number, end?: number) => LinkedFile;
24
- };
25
- /** Whether a link can be made here now. Opening needs no account and does not depend on this. Answers rather than rejecting. */
26
- export declare const available: () => Promise<boolean>;
27
- /**
28
- * Seals a file in the broker and uploads it, then answers its link. Needs a signed-in account, and
29
- * counts the sealed size (28 bytes more per 1 MiB) against the account's storage from the moment it
30
- * starts until the link is revoked, expires or the upload is aborted. The account the call belongs to
31
- * is the one this page is on when it is made, as for every storage call.
32
- *
33
- * `data` is a `Blob` (a `File` included) or a `ReadableStream<Uint8Array>` with its `size`. An upload
34
- * survives the network dropping a part, not a reload: a reload starts the file again, and the upload
35
- * left behind stops counting within the hour, or at once from `revoke` or the account's settings.
36
- *
37
- * Refused `invalid` for an expiry outside `LINK_EXPIRES_MS`, a stream without its size or one that
38
- * delivers another, a file past the service's part ceiling, a `key` that is not 32 bytes base64url or
39
- * one that already names a link; `denied` with no account; `quota`; `too-many` past the account's live
40
- * links or this hour's creations; `account-changed`.
41
- */
42
- export declare const create: (data: Blob | ReadableStream<Uint8Array>, options?: LinkCreateOptions) => Promise<Link>;
43
- /**
44
- * Opens a link made by any app, with no account: the broker reads the key from the link and fetches
45
- * the sealed file by range. Refused `invalid` for a link fkn.app did not make, `not-found` for one
46
- * that is missing, revoked, expired, still uploading or turned off (one answer for all of them),
47
- * `integrity` when the file does not match its link, `rate-limited` past the link's daily opens.
48
- *
49
- * Opening counts once per viewer per link per day; reading the same opened file again, by `slice` or
50
- * a second `stream()`, counts nothing more. A broker replaced while the file is held is asked to open
51
- * it again on the next read.
52
- */
53
- export declare const open: (url: string, options?: {
54
- signal?: AbortSignal;
55
- }) => Promise<LinkedFile>;
56
- /** This app's links, newest first, uploads in progress included, as the service holds them: no name and no url. */
57
- export declare const list: () => Promise<ListedLink[]>;
58
- /**
59
- * Revokes a link by its url or its id: every copy of the link stops opening, and an upload in
60
- * progress is aborted and stops counting. Only the app that made the link (the same app once it is
61
- * verified) revokes it, `denied` otherwise. A link already gone resolves.
62
- */
63
- export declare const revoke: (target: string) => Promise<void>;
64
- //#endregion
65
- export { LINK_EXPIRES_MS, type Link, type LinkCreateOptions, type LinkProgress, type LinksErrorCode, type ListedLink, links_d_exports as t };
package/links.js DELETED
@@ -1,187 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { c as t, l as n, s as r } from "./api-ySazPAwN.js";
3
- import { LINK_EXPIRES_MS as i } from "./contract.js";
4
- import { r as a } from "./account-generation-hUekEHGW.js";
5
- import { c as o, o as s, p as c } from "./storage-C6F9SnDM.js";
6
- //#region src/links.ts
7
- var l = /* @__PURE__ */ e({
8
- LINK_EXPIRES_MS: () => i,
9
- available: () => x,
10
- create: () => S,
11
- list: () => T,
12
- open: () => w,
13
- revoke: () => E
14
- }), u = {
15
- notALink: "links: the link is not one fkn.app made",
16
- badExpiry: "links: the expiry is not one a link can carry",
17
- notAFile: "links: the file is not a Blob or a ReadableStream",
18
- badSize: "links: a stream needs the size it will deliver, a whole number of bytes",
19
- badName: "links: the name or type is not one a link can carry",
20
- tooLarge: "links: the file is too large for a link",
21
- shortStream: "links: the stream did not deliver the size it declared",
22
- badKey: "links: the key is not 32 bytes base64url",
23
- keyTaken: "links: the key already names a link",
24
- gone: "links: the link is no longer available",
25
- integrity: "links: the file does not match its link",
26
- needsAccount: "links: making a link needs an account",
27
- notCreator: "links: only the app that made the link can revoke it",
28
- quota: "links: storage quota exceeded",
29
- tooMany: "links: too many links",
30
- tooManyThisHour: "links: too many links made this hour, try again later",
31
- rateLimited: "links: this link is opened too often, try again later",
32
- accountChanged: "links: the signed-in account changed",
33
- unavailable: "links: links are unavailable"
34
- }, d = /* @__PURE__ */ new Map([
35
- [u.notALink, "invalid"],
36
- [u.badExpiry, "invalid"],
37
- [u.notAFile, "invalid"],
38
- [u.badSize, "invalid"],
39
- [u.badName, "invalid"],
40
- [u.tooLarge, "invalid"],
41
- [u.shortStream, "invalid"],
42
- [u.badKey, "invalid"],
43
- [u.keyTaken, "invalid"],
44
- [u.gone, "not-found"],
45
- [u.integrity, "integrity"],
46
- [u.needsAccount, "denied"],
47
- [u.notCreator, "denied"],
48
- [u.quota, "quota"],
49
- [u.tooMany, "too-many"],
50
- [u.tooManyThisHour, "too-many"],
51
- [u.rateLimited, "rate-limited"],
52
- [u.accountChanged, "account-changed"],
53
- [u.unavailable, "unavailable"]
54
- ]), f = new Set(d.values()), p = (e, t) => Object.assign(Error(t), { code: e }), m = (e) => e instanceof Error && f.has(e.code), h = (e) => {
55
- if (m(e)) return e;
56
- let t = e instanceof Error ? e.message : "", n = d.get(t);
57
- return n ? p(n, t) : p("unavailable", u.unavailable);
58
- }, g = async () => {
59
- if (!n) return;
60
- let e = (await r("a link").catch(() => void 0))?.links;
61
- return typeof e?.create == "function" ? e : void 0;
62
- }, _ = () => {
63
- throw p("unavailable", u.unavailable);
64
- }, v = (e) => typeof e == "object" && !!e && typeof e.error == "string" && typeof e.message == "string", y = (e, t, n) => {
65
- throw e.error === "aborted" ? t?.reason ?? new DOMException("The operation was aborted.", "AbortError") : (e.error === "account-changed" && n && a(n.generation), f.has(e.error) ? p(e.error, e.message) : p("unavailable", u.unavailable));
66
- }, b = async (e) => {
67
- try {
68
- return await c(e);
69
- } catch (e) {
70
- throw o(e) ? p("account-changed", u.accountChanged) : e instanceof Error && /not connected|not signed in/i.test(e.message) ? p("denied", u.needsAccount) : p("unavailable", u.unavailable);
71
- }
72
- }, x = async () => {
73
- let e = await g();
74
- return e ? Promise.resolve(e.available()).catch(() => !1) : !1;
75
- }, S = async (e, t = {}) => {
76
- let n = s(), r = Date.now(), { signal: a, onProgress: o, key: c } = t;
77
- a?.throwIfAborted();
78
- let l = typeof Blob < "u" && e instanceof Blob, d = typeof ReadableStream < "u" && e instanceof ReadableStream;
79
- if (!l && !d) throw p("invalid", u.notAFile);
80
- let f = l ? e.size : t.size;
81
- if (typeof f != "number" || !Number.isSafeInteger(f) || f < 0 || l && t.size !== void 0 && t.size !== f) throw p("invalid", u.badSize);
82
- let m = t.name ?? (typeof File < "u" && e instanceof File ? e.name : ""), h = t.type ?? (l ? e.type : "");
83
- if (typeof m != "string" || typeof h != "string") throw p("invalid", u.badName);
84
- let x = typeof File < "u" && e instanceof File ? e.lastModified : r, S = t.expires, C;
85
- if (S != null && (typeof S != "number" || !Number.isFinite(S) || (C = Math.round(S - r), C < i.min || C > i.max))) throw p("invalid", u.badExpiry);
86
- if (o !== void 0 && typeof o != "function") throw p("invalid", u.notAFile);
87
- let w = await g();
88
- if (!w) throw p("unavailable", u.unavailable);
89
- let T = await b(n);
90
- a?.throwIfAborted();
91
- let E = Promise.resolve(w.create(e, {
92
- name: m,
93
- type: h,
94
- lastModified: x,
95
- size: f,
96
- ...C === void 0 ? {} : { expiresIn: C },
97
- ...c === void 0 ? {} : { key: c },
98
- accountPin: T,
99
- ...a ? { signal: a } : {},
100
- ...o ? { onProgress: (e) => {
101
- try {
102
- o(e);
103
- } catch {}
104
- } } : {}
105
- })).catch(_);
106
- E.catch(() => {});
107
- let D = a ? await Promise.race([E, new Promise((e, t) => a.addEventListener("abort", () => t(a.reason), { once: !0 }))]) : await E;
108
- return v(D) ? y(D, a, n) : D;
109
- }, C = (e, t, n) => {
110
- let r = (t, n) => {
111
- if (t === void 0) return n;
112
- let r = Math.trunc(Number.isFinite(t) ? t : t > 0 ? e : -e);
113
- return r < 0 ? Math.max(e + r, 0) : Math.min(r, e);
114
- }, i = r(t, 0);
115
- return {
116
- from: i,
117
- to: Math.max(i, r(n, e))
118
- };
119
- }, w = async (e, n = {}) => {
120
- if (typeof e != "string") throw p("invalid", u.notALink);
121
- let { signal: r } = n;
122
- r?.throwIfAborted();
123
- let i = async () => {
124
- let n = await g();
125
- if (!n) throw p("unavailable", u.unavailable);
126
- let i = t()?.epoch, a = await Promise.resolve(n.open(e, r ? { signal: r } : void 0)).catch(_);
127
- return v(a) ? y(a, r) : {
128
- handle: a,
129
- epoch: i
130
- };
131
- }, a = await i(), o = async () => {
132
- let e = t()?.epoch;
133
- return a.epoch !== void 0 && e !== void 0 && e !== a.epoch && (a = await i()), a.handle;
134
- }, { name: s, type: c, size: l, lastModified: d } = a.handle, f = (e, t) => {
135
- let n;
136
- return new ReadableStream({
137
- pull: async (r) => {
138
- try {
139
- if (!n) {
140
- let r = await o(), i = await Promise.resolve(r.read(e, t)).catch(_);
141
- if (v(i)) return y(i);
142
- n = i.getReader();
143
- }
144
- let { value: i, done: a } = await n.read();
145
- a ? r.close() : r.enqueue(i);
146
- } catch (e) {
147
- throw h(e);
148
- }
149
- },
150
- cancel: (e) => n?.cancel(e)
151
- }, { highWaterMark: 0 });
152
- }, m = (e, t) => ({
153
- name: s,
154
- type: c,
155
- size: t - e,
156
- lastModified: d,
157
- stream: () => f(e, t),
158
- arrayBuffer: async () => {
159
- let n = new Uint8Array(t - e), r = f(e, t).getReader(), i = 0;
160
- for (;;) {
161
- let { value: e, done: t } = await r.read();
162
- if (t) break;
163
- n.set(e, i), i += e.length;
164
- }
165
- return n.buffer;
166
- },
167
- slice: (n, r) => {
168
- let i = C(t - e, n, r);
169
- return m(e + i.from, e + i.to);
170
- }
171
- });
172
- return m(0, l);
173
- }, T = async () => {
174
- let e = s(), t = await g();
175
- if (!t) throw p("unavailable", u.unavailable);
176
- let n = await b(e), r = await Promise.resolve(t.list({ accountPin: n })).catch(_);
177
- return v(r) ? y(r, void 0, e) : r.links;
178
- }, E = async (e) => {
179
- let t = s();
180
- if (typeof e != "string" || !e) throw p("invalid", u.notALink);
181
- let n = await g();
182
- if (!n) throw p("unavailable", u.unavailable);
183
- let r = await b(t), i = await Promise.resolve(n.revoke(e, { accountPin: r })).catch(_);
184
- v(i) && y(i, void 0, t);
185
- };
186
- //#endregion
187
- export { i as LINK_EXPIRES_MS, x as available, S as create, T as list, w as open, E as revoke, l as t };