@wovin/connect-web3storage 0.1.9 → 0.1.13
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.
|
@@ -6,7 +6,7 @@ import{a as p}from"./chunk-L7VH6KZJ.min.js";(!globalThis.EventTarget||!globalThi
|
|
|
6
6
|
import 'partysocket/event-target-polyfill';
|
|
7
7
|
\`\`\`
|
|
8
8
|
Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
|
|
9
|
-
`);var
|
|
9
|
+
`);var f=class extends Event{message;error;constructor(s,e){super("error",e),this.message=s.message,this.error=s}},m=class extends Event{code;reason;wasClean=!0;constructor(s=1e3,e="",t){super("close",t),this.code=s,this.reason=e}},g={Event,ErrorEvent:f,CloseEvent:m};function v(s,e){if(!s)throw new Error(e)}function b(s){return new s.constructor(s.type,s)}function R(s){return"data"in s?new MessageEvent(s.type,s):"code"in s||"reason"in s?new m(s.code||1999,s.reason||"unknown reason",s):"error"in s?new f(s.error,s):new Event(s.type,s)}var N=typeof process<"u"&&typeof process.versions?.node<"u"&&typeof document>"u",d=N?R:b,a={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},y=!1,w=class c extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType="blob";_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(e,t,n={}){super(),this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return c.CONNECTING}get OPEN(){return c.OPEN}get CLOSING(){return c.CLOSING}get CLOSED(){return c.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((t,n)=>(typeof n=="string"?t+=n.length:n instanceof Blob?t+=n.size:t+=n.byteLength,t),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?c.CLOSED:c.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(e=1e3,t){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(e,t)}reconnect(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(e,t),this._connect())}send(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{let{maxEnqueuedMessages:t=a.maxEnqueuedMessages}=this._options;this._messageQueue.length<t&&(this._debug("enqueue",e),this._messageQueue.push(e))}}_debug(...e){this._options.debug&&this._debugLogger("RWS>",...e)}_getNextDelay(){let{reconnectionDelayGrowFactor:e=a.reconnectionDelayGrowFactor,minReconnectionDelay:t=a.minReconnectionDelay,maxReconnectionDelay:n=a.maxReconnectionDelay}=this._options,o=0;return this._retryCount>0&&(o=t*Math.pow(e,this._retryCount-1),o>n&&(o=n)),this._debug("next delay",o),o}_wait(){return new Promise(e=>{setTimeout(e,this._getNextDelay())})}_getNextProtocols(e){if(!e)return Promise.resolve(null);if(typeof e=="string"||Array.isArray(e))return Promise.resolve(e);if(typeof e=="function"){let t=e();if(!t)return Promise.resolve(null);if(typeof t=="string"||Array.isArray(t))return Promise.resolve(t);if(t.then)return t}throw Error("Invalid protocols")}_getNextUrl(e){if(typeof e=="string")return Promise.resolve(e);if(typeof e=="function"){let t=e();if(typeof t=="string")return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:e=a.maxRetries,connectionTimeout:t=a.connectionTimeout}=this._options;if(this._retryCount>=e){this._debug("max retries reached",this._retryCount,">=",e);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([n,o])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!y&&(console.error(`\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket.
|
|
10
10
|
|
|
11
11
|
For example, if you're using node.js, run \`npm install ws\`, and then in your code:
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ const partysocket = new PartySocket({
|
|
|
19
19
|
WebSocket: WS
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
`),y=!0);let r=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:o}),this._ws=o?new r(n,o):new r(n),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),t)}).catch(n=>{this._connectLock=!1,this._handleError(new g.ErrorEvent(Error(n.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new g.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(e=1e3,t){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new g.CloseEvent(e,t,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=e=>{this._debug("open event");let{minUptime:t=a.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),t),
|
|
22
|
+
`),y=!0);let r=this._options.WebSocket||WebSocket;this._debug("connect",{url:n,protocols:o}),this._ws=o?new r(n,o):new r(n),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),t)}).catch(n=>{this._connectLock=!1,this._handleError(new g.ErrorEvent(Error(n.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new g.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(e=1e3,t){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new g.CloseEvent(e,t,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=e=>{this._debug("open event");let{minUptime:t=a.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),t),v(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(n=>this._ws?.send(n)),this._messageQueue=[],this.onopen&&this.onopen(e),this.dispatchEvent(d(e))};_handleMessage=e=>{this._debug("message event"),this.onmessage&&this.onmessage(e),this.dispatchEvent(d(e))};_handleError=e=>{this._debug("error event",e.message),this._disconnect(void 0,e.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(e),this._debug("exec error listeners"),this.dispatchEvent(d(e)),this._connect()};_handleClose=e=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(e),this.dispatchEvent(d(e))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};var{WARN:u,LOG:l,DEBUG:i,ERROR:I}=p.setup(p.INFO),E="wss://name.web3.storage/name",W="https://name.web3.storage/name";function D(s,e){let t=`${E}/${s}/watch`;i("[watchNameRaw] connecting to",t);let n=new WebSocket(t);return n.onopen=()=>{l("[watchNameRaw] connected to",s),e.onOpen?.()},n.onmessage=o=>{try{let r=JSON.parse(o.data);i("[watchNameRaw] received update for",s,r),e.onUpdate(r)}catch(r){u("[watchNameRaw] failed to parse message:",o.data,r),e.onError?.(r instanceof Error?r:new Error(String(r)))}},n.onerror=o=>{u("[watchNameRaw] error for",s,o),e.onError?.(o)},n.onclose=o=>{i("[watchNameRaw] closed for",s,"code:",o.code),e.onClose?.(o)},{close:()=>{i("[watchNameRaw] closing connection for",s),n.close()},ws:n}}var _=class{name;ws;lastKnownValue=null;options;isFirstConnect=!0;constructor(e,t){this.name=e,this.options=t;let n=`${E}/${e}/watch`;i("[IpnsWatcher] creating for",e),this.ws=new w(n,[],{maxReconnectionDelay:9e5,minReconnectionDelay:5e3,reconnectionDelayGrowFactor:2,maxRetries:1/0,...t.wsOptions}),this.ws.onopen=()=>{l("[IpnsWatcher] connected to",e),t.onConnected?.(),!this.isFirstConnect&&(t.catchUpOnReconnect??!0)&&this.checkForMissedUpdates(),this.isFirstConnect=!1},this.ws.onmessage=o=>{try{let r=JSON.parse(o.data);i("[IpnsWatcher] received update for",e,r),this.lastKnownValue=r.value,t.onUpdate(r)}catch(r){u("[IpnsWatcher] failed to parse message:",o.data,r),t.onError?.(r instanceof Error?r:new Error(String(r)))}},this.ws.onerror=o=>{let r=o instanceof ErrorEvent?o.message:"WebSocket error";r==="Unexpected EOF"?l("[IpnsWatcher] error for",e,":",r,"(auto-reconnect enabled)"):u("[IpnsWatcher] error for",e,":",r),r!=="Unexpected EOF"&&t.onError?.(o)},this.ws.onclose=()=>{i("[IpnsWatcher] disconnected from",e),t.onDisconnected?.()}}async checkForMissedUpdates(){try{i("[IpnsWatcher] checking for missed updates for",this.name);let e=await fetch(`${W}/${this.name}`);if(!e.ok){if(e.status===404){i("[IpnsWatcher] IPNS not yet published:",this.name);return}throw new Error(`HTTP ${e.status}: ${e.statusText}`)}let t=await e.json();t.value!==this.lastKnownValue&&(l("[IpnsWatcher] caught missed update for",this.name,{previous:this.lastKnownValue,current:t.value}),this.lastKnownValue=t.value,this.options.onUpdate(t))}catch(e){u("[IpnsWatcher] failed to check for missed updates:",this.name,e),this.options.onError?.(e instanceof Error?e:new Error(String(e)))}}start(){l("[IpnsWatcher] starting watcher for",this.name),this.ws.reconnect()}stop(){this.close()}close(){l("[IpnsWatcher] closing watcher for",this.name),this.ws.close()}get lastValue(){return this.lastKnownValue}get readyState(){return this.ws.readyState}};function U(s,e){return new _(s,e)}async function*P(s,e){let t=[],n=null,o=null,r=new _(s,{onUpdate:h=>{t.push(h),n?.()},onError:h=>{o=h instanceof Error?h:new Error("WebSocket error"),n?.()}});e?.addEventListener("abort",()=>{r.close()});try{for(;!e?.aborted;)t.length>0?yield t.shift():o?(u("[watchNameIterator] error occurred, continuing:",o),o=null):(await new Promise(h=>{n=h}),n=null)}finally{r.close()}}export{D as a,_ as b,U as c,P as d};
|
|
23
23
|
/*! Bundled license information:
|
|
24
24
|
|
|
25
25
|
partysocket/dist/chunk-4SNNYC7I.mjs:
|
|
@@ -30,4 +30,4 @@ partysocket/dist/chunk-4SNNYC7I.mjs:
|
|
|
30
30
|
* License MIT
|
|
31
31
|
*)
|
|
32
32
|
*/
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-YLZ4OBPK.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/partysocket@1.0.2/node_modules/partysocket/dist/chunk-4SNNYC7I.mjs","../src/watch.ts"],"sourcesContent":["// src/ws.ts\nif (!globalThis.EventTarget || !globalThis.Event) {\n console.error(`\n PartySocket requires a global 'EventTarget' class to be available!\n You can polyfill this global by adding this to your code before any partysocket imports: \n \n \\`\\`\\`\n import 'partysocket/event-target-polyfill';\n \\`\\`\\`\n Please file an issue at https://github.com/partykit/partykit if you're still having trouble.\n`);\n}\nvar ErrorEvent = class extends Event {\n message;\n error;\n constructor(error, target) {\n super(\"error\", target);\n this.message = error.message;\n this.error = error;\n }\n};\nvar CloseEvent = class extends Event {\n code;\n reason;\n wasClean = true;\n constructor(code = 1e3, reason = \"\", target) {\n super(\"close\", target);\n this.code = code;\n this.reason = reason;\n }\n};\nvar Events = {\n Event,\n ErrorEvent,\n CloseEvent\n};\nfunction assert(condition, msg) {\n if (!condition) {\n throw new Error(msg);\n }\n}\nfunction cloneEventBrowser(e) {\n return new e.constructor(e.type, e);\n}\nfunction cloneEventNode(e) {\n if (\"data\" in e) {\n const evt2 = new MessageEvent(e.type, e);\n return evt2;\n }\n if (\"code\" in e || \"reason\" in e) {\n const evt2 = new CloseEvent(\n // @ts-expect-error we need to fix event/listener types\n e.code || 1999,\n // @ts-expect-error we need to fix event/listener types\n e.reason || \"unknown reason\",\n e\n );\n return evt2;\n }\n if (\"error\" in e) {\n const evt2 = new ErrorEvent(e.error, e);\n return evt2;\n }\n const evt = new Event(e.type, e);\n return evt;\n}\nvar isNode = typeof process !== \"undefined\" && typeof process.versions?.node !== \"undefined\" && typeof document === \"undefined\";\nvar cloneEvent = isNode ? cloneEventNode : cloneEventBrowser;\nvar DEFAULT = {\n maxReconnectionDelay: 1e4,\n minReconnectionDelay: 1e3 + Math.random() * 4e3,\n minUptime: 5e3,\n reconnectionDelayGrowFactor: 1.3,\n connectionTimeout: 4e3,\n maxRetries: Infinity,\n maxEnqueuedMessages: Infinity,\n startClosed: false,\n debug: false\n};\nvar didWarnAboutMissingWebSocket = false;\nvar ReconnectingWebSocket = class _ReconnectingWebSocket extends EventTarget {\n _ws;\n _retryCount = -1;\n _uptimeTimeout;\n _connectTimeout;\n _shouldReconnect = true;\n _connectLock = false;\n _binaryType = \"blob\";\n _closeCalled = false;\n _messageQueue = [];\n _debugLogger = console.log.bind(console);\n _url;\n _protocols;\n _options;\n constructor(url, protocols, options = {}) {\n super();\n this._url = url;\n this._protocols = protocols;\n this._options = options;\n if (this._options.startClosed) {\n this._shouldReconnect = false;\n }\n if (this._options.debugLogger) {\n this._debugLogger = this._options.debugLogger;\n }\n this._connect();\n }\n static get CONNECTING() {\n return 0;\n }\n static get OPEN() {\n return 1;\n }\n static get CLOSING() {\n return 2;\n }\n static get CLOSED() {\n return 3;\n }\n get CONNECTING() {\n return _ReconnectingWebSocket.CONNECTING;\n }\n get OPEN() {\n return _ReconnectingWebSocket.OPEN;\n }\n get CLOSING() {\n return _ReconnectingWebSocket.CLOSING;\n }\n get CLOSED() {\n return _ReconnectingWebSocket.CLOSED;\n }\n get binaryType() {\n return this._ws ? this._ws.binaryType : this._binaryType;\n }\n set binaryType(value) {\n this._binaryType = value;\n if (this._ws) {\n this._ws.binaryType = value;\n }\n }\n /**\n * Returns the number or connection retries\n */\n get retryCount() {\n return Math.max(this._retryCount, 0);\n }\n /**\n * The number of bytes of data that have been queued using calls to send() but not yet\n * transmitted to the network. This value resets to zero once all queued data has been sent.\n * This value does not reset to zero when the connection is closed; if you keep calling send(),\n * this will continue to climb. Read only\n */\n get bufferedAmount() {\n const bytes = this._messageQueue.reduce((acc, message) => {\n if (typeof message === \"string\") {\n acc += message.length;\n } else if (message instanceof Blob) {\n acc += message.size;\n } else {\n acc += message.byteLength;\n }\n return acc;\n }, 0);\n return bytes + (this._ws ? this._ws.bufferedAmount : 0);\n }\n /**\n * The extensions selected by the server. This is currently only the empty string or a list of\n * extensions as negotiated by the connection\n */\n get extensions() {\n return this._ws ? this._ws.extensions : \"\";\n }\n /**\n * A string indicating the name of the sub-protocol the server selected;\n * this will be one of the strings specified in the protocols parameter when creating the\n * WebSocket object\n */\n get protocol() {\n return this._ws ? this._ws.protocol : \"\";\n }\n /**\n * The current state of the connection; this is one of the Ready state constants\n */\n get readyState() {\n if (this._ws) {\n return this._ws.readyState;\n }\n return this._options.startClosed ? _ReconnectingWebSocket.CLOSED : _ReconnectingWebSocket.CONNECTING;\n }\n /**\n * The URL as resolved by the constructor\n */\n get url() {\n return this._ws ? this._ws.url : \"\";\n }\n /**\n * Whether the websocket object is now in reconnectable state\n */\n get shouldReconnect() {\n return this._shouldReconnect;\n }\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to CLOSED\n */\n onclose = null;\n /**\n * An event listener to be called when an error occurs\n */\n onerror = null;\n /**\n * An event listener to be called when a message is received from the server\n */\n onmessage = null;\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to OPEN;\n * this indicates that the connection is ready to send and receive data\n */\n onopen = null;\n /**\n * Closes the WebSocket connection or connection attempt, if any. If the connection is already\n * CLOSED, this method does nothing\n */\n close(code = 1e3, reason) {\n this._closeCalled = true;\n this._shouldReconnect = false;\n this._clearTimeouts();\n if (!this._ws) {\n this._debug(\"close enqueued: no ws instance\");\n return;\n }\n if (this._ws.readyState === this.CLOSED) {\n this._debug(\"close: already closed\");\n return;\n }\n this._ws.close(code, reason);\n }\n /**\n * Closes the WebSocket connection or connection attempt and connects again.\n * Resets retry counter;\n */\n reconnect(code, reason) {\n this._shouldReconnect = true;\n this._closeCalled = false;\n this._retryCount = -1;\n if (!this._ws || this._ws.readyState === this.CLOSED) {\n this._connect();\n } else {\n this._disconnect(code, reason);\n this._connect();\n }\n }\n /**\n * Enqueue specified data to be transmitted to the server over the WebSocket connection\n */\n send(data) {\n if (this._ws && this._ws.readyState === this.OPEN) {\n this._debug(\"send\", data);\n this._ws.send(data);\n } else {\n const { maxEnqueuedMessages = DEFAULT.maxEnqueuedMessages } = this._options;\n if (this._messageQueue.length < maxEnqueuedMessages) {\n this._debug(\"enqueue\", data);\n this._messageQueue.push(data);\n }\n }\n }\n _debug(...args) {\n if (this._options.debug) {\n this._debugLogger(\"RWS>\", ...args);\n }\n }\n _getNextDelay() {\n const {\n reconnectionDelayGrowFactor = DEFAULT.reconnectionDelayGrowFactor,\n minReconnectionDelay = DEFAULT.minReconnectionDelay,\n maxReconnectionDelay = DEFAULT.maxReconnectionDelay\n } = this._options;\n let delay = 0;\n if (this._retryCount > 0) {\n delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);\n if (delay > maxReconnectionDelay) {\n delay = maxReconnectionDelay;\n }\n }\n this._debug(\"next delay\", delay);\n return delay;\n }\n _wait() {\n return new Promise((resolve) => {\n setTimeout(resolve, this._getNextDelay());\n });\n }\n _getNextProtocols(protocolsProvider) {\n if (!protocolsProvider) return Promise.resolve(null);\n if (typeof protocolsProvider === \"string\" || Array.isArray(protocolsProvider)) {\n return Promise.resolve(protocolsProvider);\n }\n if (typeof protocolsProvider === \"function\") {\n const protocols = protocolsProvider();\n if (!protocols) return Promise.resolve(null);\n if (typeof protocols === \"string\" || Array.isArray(protocols)) {\n return Promise.resolve(protocols);\n }\n if (protocols.then) {\n return protocols;\n }\n }\n throw Error(\"Invalid protocols\");\n }\n _getNextUrl(urlProvider) {\n if (typeof urlProvider === \"string\") {\n return Promise.resolve(urlProvider);\n }\n if (typeof urlProvider === \"function\") {\n const url = urlProvider();\n if (typeof url === \"string\") {\n return Promise.resolve(url);\n }\n if (url.then) {\n return url;\n }\n }\n throw Error(\"Invalid URL\");\n }\n _connect() {\n if (this._connectLock || !this._shouldReconnect) {\n return;\n }\n this._connectLock = true;\n const {\n maxRetries = DEFAULT.maxRetries,\n connectionTimeout = DEFAULT.connectionTimeout\n } = this._options;\n if (this._retryCount >= maxRetries) {\n this._debug(\"max retries reached\", this._retryCount, \">=\", maxRetries);\n return;\n }\n this._retryCount++;\n this._debug(\"connect\", this._retryCount);\n this._removeListeners();\n this._wait().then(\n () => Promise.all([\n this._getNextUrl(this._url),\n this._getNextProtocols(this._protocols || null)\n ])\n ).then(([url, protocols]) => {\n if (this._closeCalled) {\n this._connectLock = false;\n return;\n }\n if (!this._options.WebSocket && typeof WebSocket === \"undefined\" && !didWarnAboutMissingWebSocket) {\n console.error(`\\u203C\\uFE0F No WebSocket implementation available. You should define options.WebSocket. \n\nFor example, if you're using node.js, run \\`npm install ws\\`, and then in your code:\n\nimport PartySocket from 'partysocket';\nimport WS from 'ws';\n\nconst partysocket = new PartySocket({\n host: \"127.0.0.1:1999\",\n room: \"test-room\",\n WebSocket: WS\n});\n\n`);\n didWarnAboutMissingWebSocket = true;\n }\n const WS = this._options.WebSocket || WebSocket;\n this._debug(\"connect\", { url, protocols });\n this._ws = protocols ? new WS(url, protocols) : new WS(url);\n this._ws.binaryType = this._binaryType;\n this._connectLock = false;\n this._addListeners();\n this._connectTimeout = setTimeout(\n () => this._handleTimeout(),\n connectionTimeout\n );\n }).catch((err) => {\n this._connectLock = false;\n this._handleError(new Events.ErrorEvent(Error(err.message), this));\n });\n }\n _handleTimeout() {\n this._debug(\"timeout event\");\n this._handleError(new Events.ErrorEvent(Error(\"TIMEOUT\"), this));\n }\n _disconnect(code = 1e3, reason) {\n this._clearTimeouts();\n if (!this._ws) {\n return;\n }\n this._removeListeners();\n try {\n this._ws.close(code, reason);\n this._handleClose(new Events.CloseEvent(code, reason, this));\n } catch (error) {\n }\n }\n _acceptOpen() {\n this._debug(\"accept open\");\n this._retryCount = 0;\n }\n _handleOpen = (event) => {\n this._debug(\"open event\");\n const { minUptime = DEFAULT.minUptime } = this._options;\n clearTimeout(this._connectTimeout);\n this._uptimeTimeout = setTimeout(() => this._acceptOpen(), minUptime);\n assert(this._ws, \"WebSocket is not defined\");\n this._ws.binaryType = this._binaryType;\n this._messageQueue.forEach((message) => this._ws?.send(message));\n this._messageQueue = [];\n if (this.onopen) {\n this.onopen(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleMessage = (event) => {\n this._debug(\"message event\");\n if (this.onmessage) {\n this.onmessage(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleError = (event) => {\n this._debug(\"error event\", event.message);\n this._disconnect(\n void 0,\n event.message === \"TIMEOUT\" ? \"timeout\" : void 0\n );\n if (this.onerror) {\n this.onerror(event);\n }\n this._debug(\"exec error listeners\");\n this.dispatchEvent(cloneEvent(event));\n this._connect();\n };\n _handleClose = (event) => {\n this._debug(\"close event\");\n this._clearTimeouts();\n if (this._shouldReconnect) {\n this._connect();\n }\n if (this.onclose) {\n this.onclose(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _removeListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"removeListeners\");\n this._ws.removeEventListener(\"open\", this._handleOpen);\n this._ws.removeEventListener(\"close\", this._handleClose);\n this._ws.removeEventListener(\"message\", this._handleMessage);\n this._ws.removeEventListener(\"error\", this._handleError);\n }\n _addListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"addListeners\");\n this._ws.addEventListener(\"open\", this._handleOpen);\n this._ws.addEventListener(\"close\", this._handleClose);\n this._ws.addEventListener(\"message\", this._handleMessage);\n this._ws.addEventListener(\"error\", this._handleError);\n }\n _clearTimeouts() {\n clearTimeout(this._connectTimeout);\n clearTimeout(this._uptimeTimeout);\n }\n};\n\nexport {\n ErrorEvent,\n CloseEvent,\n ReconnectingWebSocket\n};\n/*!\n * Reconnecting WebSocket\n * by Pedro Ladaria <pedro.ladaria@gmail.com>\n * https://github.com/pladaria/reconnecting-websocket\n * License MIT\n */\n","import { Logger } from 'besonders-logger'\nimport ReconnectingWebSocket, { type Options as PartysocketOptions } from 'partysocket/ws'\n\nexport type { PartysocketOptions }\n\nconst { WARN, LOG, DEBUG, ERROR } = Logger.setup(Logger.INFO) // eslint-disable-line unused-imports/no-unused-vars\n\nconst NAME_WS_URL = 'wss://name.web3.storage/name'\nconst NAME_HTTP_URL = 'https://name.web3.storage/name'\n\nexport interface W3NameRecord {\n\tvalue: string // e.g. \"/ipfs/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi\"\n\tseq?: number\n\tvalidity?: string\n}\n\nexport interface WatchRawOptions {\n\t/** Called when the IPNS record is updated */\n\tonUpdate: (record: W3NameRecord) => void\n\t/** Called when an error occurs */\n\tonError?: (error: Event | Error) => void\n\t/** Called when the connection is opened */\n\tonOpen?: () => void\n\t/** Called when the connection is closed */\n\tonClose?: (event: CloseEvent) => void\n}\n\nexport interface WatchRawSubscription {\n\t/** Close the WebSocket connection */\n\tclose: () => void\n\t/** The underlying WebSocket instance */\n\tws: WebSocket\n}\n\n/**\n * Low-level WebSocket watcher for IPNS (no reconnect logic).\n * Use this when you want full control over connection lifecycle.\n * For most cases, prefer `watchName` or `IpnsWatcher` which handle reconnection.\n *\n * @param name - The IPNS name/key to watch\n * @param options - Callback options\n * @returns Subscription with close() and ws\n *\n * @example\n * ```ts\n * const sub = watchNameRaw('k51qzi5u...', {\n * onUpdate: (record) => console.log('Update:', record.value),\n * onClose: () => console.log('Disconnected - handle reconnect yourself'),\n * })\n * ```\n */\nexport function watchNameRaw(name: string, options: WatchRawOptions): WatchRawSubscription {\n\tconst url = `${NAME_WS_URL}/${name}/watch`\n\tDEBUG('[watchNameRaw] connecting to', url)\n\n\tconst ws = new WebSocket(url)\n\n\tws.onopen = () => {\n\t\tLOG('[watchNameRaw] connected to', name)\n\t\toptions.onOpen?.()\n\t}\n\n\tws.onmessage = (event) => {\n\t\ttry {\n\t\t\tconst record: W3NameRecord = JSON.parse(event.data)\n\t\t\tDEBUG('[watchNameRaw] received update for', name, record)\n\t\t\toptions.onUpdate(record)\n\t\t} catch (err) {\n\t\t\tWARN('[watchNameRaw] failed to parse message:', event.data, err)\n\t\t\toptions.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t}\n\t}\n\n\tws.onerror = (event) => {\n\t\tWARN('[watchNameRaw] error for', name, event)\n\t\toptions.onError?.(event)\n\t}\n\n\tws.onclose = (event) => {\n\t\tDEBUG('[watchNameRaw] closed for', name, 'code:', event.code)\n\t\toptions.onClose?.(event)\n\t}\n\n\treturn {\n\t\tclose: () => {\n\t\t\tDEBUG('[watchNameRaw] closing connection for', name)\n\t\t\tws.close()\n\t\t},\n\t\tws,\n\t}\n}\n\nexport interface IpnsWatcherOptions {\n\t/** Called when the IPNS record is updated */\n\tonUpdate: (record: W3NameRecord) => void | Promise<void>\n\t/** Called when an error occurs */\n\tonError?: (error: Error | Event) => void\n\t/** Called when the connection is opened/reconnected */\n\tonConnected?: () => void\n\t/** Called when the connection is closed */\n\tonDisconnected?: () => void\n\t/** Whether to check for missed updates on reconnect (default: true) */\n\tcatchUpOnReconnect?: boolean\n\t/**\n\t * Partysocket options (passed through to ReconnectingWebSocket).\n\t * Useful options: startClosed, maxReconnectionDelay, minReconnectionDelay, etc.\n\t * @see https://github.com/partykit/partykit/tree/main/packages/partysocket\n\t */\n\twsOptions?: PartysocketOptions\n}\n\n/**\n * Robust IPNS watcher with auto-reconnect and catch-up logic.\n * Uses partysocket for reliable WebSocket reconnection.\n *\n * @example\n * ```ts\n * const watcher = new IpnsWatcher('k51qzi5uqu...', {\n * onUpdate: (record) => console.log('New CID:', record.value),\n * onError: (err) => console.error('Error:', err),\n * })\n *\n * // Later, to stop watching:\n * watcher.close()\n * ```\n */\nexport class IpnsWatcher {\n\tprivate name: string\n\tprivate ws: ReconnectingWebSocket\n\tprivate lastKnownValue: string | null = null\n\tprivate options: IpnsWatcherOptions\n\tprivate isFirstConnect = true\n\n\tconstructor(name: string, options: IpnsWatcherOptions) {\n\t\tthis.name = name\n\t\tthis.options = options\n\n\t\tconst url = `${NAME_WS_URL}/${name}/watch`\n\t\tDEBUG('[IpnsWatcher] creating for', name)\n\n\t\tthis.ws = new ReconnectingWebSocket(url, [], {\n\t\t\tmaxReconnectionDelay: 900000, // 15min\n\t\t\tminReconnectionDelay: 5000,\n\t\t\treconnectionDelayGrowFactor: 2,\n\t\t\tmaxRetries: Infinity,\n\t\t\t...options.wsOptions,\n\t\t})\n\n\t\tthis.ws.onopen = () => {\n\t\t\tLOG('[IpnsWatcher] connected to', name)\n\t\t\toptions.onConnected?.()\n\n\t\t\t// Check for missed updates on reconnect (not on first connect)\n\t\t\tif (!this.isFirstConnect && (options.catchUpOnReconnect ?? true)) {\n\t\t\t\tthis.checkForMissedUpdates()\n\t\t\t}\n\t\t\tthis.isFirstConnect = false\n\t\t}\n\n\t\tthis.ws.onmessage = (event) => {\n\t\t\ttry {\n\t\t\t\tconst record: W3NameRecord = JSON.parse(event.data as string)\n\t\t\t\tDEBUG('[IpnsWatcher] received update for', name, record)\n\t\t\t\tthis.lastKnownValue = record.value\n\t\t\t\tvoid options.onUpdate(record)\n\t\t\t} catch (err) {\n\t\t\t\tWARN('[IpnsWatcher] failed to parse message:', event.data, err)\n\t\t\t\toptions.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t\t}\n\t\t}\n\n\t\tthis.ws.onerror = (event) => {\n\t\t\tWARN('[IpnsWatcher] error for', name, event)\n\t\t\toptions.onError?.(event)\n\t\t}\n\n\t\tthis.ws.onclose = () => {\n\t\t\tDEBUG('[IpnsWatcher] disconnected from', name)\n\t\t\toptions.onDisconnected?.()\n\t\t}\n\t}\n\n\t/**\n\t * Resolve current IPNS value via HTTP API to catch missed updates\n\t */\n\tprivate async checkForMissedUpdates(): Promise<void> {\n\t\ttry {\n\t\t\tDEBUG('[IpnsWatcher] checking for missed updates for', this.name)\n\t\t\tconst response = await fetch(`${NAME_HTTP_URL}/${this.name}`)\n\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status === 404) {\n\t\t\t\t\tDEBUG('[IpnsWatcher] IPNS not yet published:', this.name)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthrow new Error(`HTTP ${response.status}: ${response.statusText}`)\n\t\t\t}\n\n\t\t\tconst record: W3NameRecord = await response.json()\n\n\t\t\tif (record.value !== this.lastKnownValue) {\n\t\t\t\tLOG('[IpnsWatcher] caught missed update for', this.name, {\n\t\t\t\t\tprevious: this.lastKnownValue,\n\t\t\t\t\tcurrent: record.value,\n\t\t\t\t})\n\t\t\t\tthis.lastKnownValue = record.value\n\t\t\t\tvoid this.options.onUpdate(record)\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tWARN('[IpnsWatcher] failed to check for missed updates:', this.name, err)\n\t\t\tthis.options.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t}\n\t}\n\n\t/**\n\t * Manually start/reconnect the WebSocket.\n\t * Only needed if you used `wsOptions: { startClosed: true }`.\n\t */\n\tstart(): void {\n\t\tLOG('[IpnsWatcher] starting watcher for', this.name)\n\t\tthis.ws.reconnect()\n\t}\n\n\t/**\n\t * Alias for close() - for backward compatibility\n\t */\n\tstop(): void {\n\t\tthis.close()\n\t}\n\n\t/**\n\t * Close the WebSocket connection and stop watching\n\t */\n\tclose(): void {\n\t\tLOG('[IpnsWatcher] closing watcher for', this.name)\n\t\tthis.ws.close()\n\t}\n\n\t/**\n\t * Get the last known IPNS value\n\t */\n\tget lastValue(): string | null {\n\t\treturn this.lastKnownValue\n\t}\n\n\t/**\n\t * Get the WebSocket ready state\n\t */\n\tget readyState(): number {\n\t\treturn this.ws.readyState\n\t}\n}\n\n/**\n * Create an IPNS watcher with auto-reconnect and catch-up logic.\n * Convenience function that creates and returns an IpnsWatcher instance.\n *\n * @param name - The IPNS name/key to watch (e.g. \"k51qzi5u...\")\n * @param options - Callback options for handling events\n * @returns An IpnsWatcher instance with close() method\n */\nexport function watchName(name: string, options: IpnsWatcherOptions): IpnsWatcher {\n\treturn new IpnsWatcher(name, options)\n}\n\n/**\n * Watch an IPNS name and return updates as an async iterator.\n * Includes auto-reconnect - iterator continues through disconnections.\n *\n * @param name - The IPNS name/key to watch\n * @param signal - Optional AbortSignal to stop the watch\n *\n * @example\n * ```ts\n * const controller = new AbortController()\n * for await (const record of watchNameIterator('k51qzi5u...', controller.signal)) {\n * console.log('Update:', record.value)\n * }\n * ```\n */\nexport async function* watchNameIterator(\n\tname: string,\n\tsignal?: AbortSignal,\n): AsyncGenerator<W3NameRecord, void, unknown> {\n\tconst queue: W3NameRecord[] = []\n\tlet resolve: (() => void) | null = null\n\tlet error: Error | null = null\n\n\tconst watcher = new IpnsWatcher(name, {\n\t\tonUpdate: (record) => {\n\t\t\tqueue.push(record)\n\t\t\tresolve?.()\n\t\t},\n\t\tonError: (err) => {\n\t\t\terror = err instanceof Error ? err : new Error('WebSocket error')\n\t\t\tresolve?.()\n\t\t},\n\t})\n\n\tsignal?.addEventListener('abort', () => {\n\t\twatcher.close()\n\t})\n\n\ttry {\n\t\twhile (!signal?.aborted) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tyield queue.shift()!\n\t\t\t} else if (error) {\n\t\t\t\t// Log error but continue - partysocket will reconnect\n\t\t\t\tWARN('[watchNameIterator] error occurred, continuing:', error)\n\t\t\t\terror = null\n\t\t\t} else {\n\t\t\t\tawait new Promise<void>((r) => {\n\t\t\t\t\tresolve = r\n\t\t\t\t})\n\t\t\t\tresolve = null\n\t\t\t}\n\t\t}\n\t} finally {\n\t\twatcher.close()\n\t}\n}\n"],"mappings":"6CACI,CAAC,WAAW,aAAe,CAAC,WAAW,QACzC,QAAQ,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAQf,EAED,IAAIA,EAAa,cAAc,KAAM,CACnC,QACA,MACA,YAAYC,EAAOC,EAAQ,CACzB,MAAM,QAASA,CAAM,EACrB,KAAK,QAAUD,EAAM,QACrB,KAAK,MAAQA,CACf,CACF,EACIE,EAAa,cAAc,KAAM,CACnC,KACA,OACA,SAAW,GACX,YAAYC,EAAO,IAAKC,EAAS,GAAIH,EAAQ,CAC3C,MAAM,QAASA,CAAM,EACrB,KAAK,KAAOE,EACZ,KAAK,OAASC,CAChB,CACF,EACIC,EAAS,CACX,MACA,WAAAN,EACA,WAAAG,CACF,EACA,SAASI,EAAOC,EAAWC,EAAK,CAC9B,GAAI,CAACD,EACH,MAAM,IAAI,MAAMC,CAAG,CAEvB,CACA,SAASC,EAAkBC,EAAG,CAC5B,OAAO,IAAIA,EAAE,YAAYA,EAAE,KAAMA,CAAC,CACpC,CACA,SAASC,EAAeD,EAAG,CACzB,MAAI,SAAUA,EACC,IAAI,aAAaA,EAAE,KAAMA,CAAC,EAG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KAAK,GAAG,UAAU,CACnB,CAKA,MAAa,CACZ,KAAK,MAAM,CACZ,CAKA,OAAc,CACbA,EAAI,oCAAqC,KAAK,IAAI,EAClD,KAAK,GAAG,MAAM,CACf,CAKA,IAAI,WAA2B,CAC9B,OAAO,KAAK,cACb,CAKA,IAAI,YAAqB,CACxB,OAAO,KAAK,GAAG,UAChB,CACD,EAUO,SAASiB,EAAUV,EAAcC,EAA0C,CACjF,OAAO,IAAIM,EAAYP,EAAMC,CAAO,CACrC,CAiBA,eAAuBU,EACtBX,EACAY,EAC8C,CAC9C,IAAMC,EAAwB,CAAC,EAC3BC,EAA+B,KAC/BC,EAAsB,KAEpBC,EAAU,IAAIT,EAAYP,EAAM,CACrC,SAAWK,GAAW,CACrBQ,EAAM,KAAKR,CAAM,EACjBS,IAAU,CACX,EACA,QAAUR,GAAQ,CACjBS,EAAQT,aAAe,MAAQA,EAAM,IAAI,MAAM,iBAAiB,EAChEQ,IAAU,CACX,CACD,CAAC,EAEDF,GAAQ,iBAAiB,QAAS,IAAM,CACvCI,EAAQ,MAAM,CACf,CAAC,EAED,GAAI,CACH,KAAO,CAACJ,GAAQ,SACXC,EAAM,OAAS,EAClB,MAAMA,EAAM,MAAM,EACRE,GAEVvB,EAAK,kDAAmDuB,CAAK,EAC7DA,EAAQ,OAER,MAAM,IAAI,QAAeE,GAAM,CAC9BH,EAAUG,CACX,CAAC,EACDH,EAAU,KAGb,QAAE,CACDE,EAAQ,MAAM,CACf,CACD","names":["ErrorEvent","error","target","CloseEvent","code","reason","Events","assert","condition","msg","cloneEventBrowser","e","cloneEventNode","isNode","cloneEvent","DEFAULT","didWarnAboutMissingWebSocket","ReconnectingWebSocket","_ReconnectingWebSocket","url","protocols","options","value","acc","message","data","maxEnqueuedMessages","args","reconnectionDelayGrowFactor","minReconnectionDelay","maxReconnectionDelay","delay","resolve","protocolsProvider","urlProvider","maxRetries","connectionTimeout","WS","err","event","minUptime","WARN","LOG","DEBUG","ERROR","E","NAME_WS_URL","NAME_HTTP_URL","watchNameRaw","name","options","url","ws","event","record","err","IpnsWatcher","ReconnectingWebSocket","response","watchName","watchNameIterator","signal","queue","resolve","error","watcher","r"]}
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/partysocket@1.0.2/node_modules/partysocket/dist/chunk-4SNNYC7I.mjs","../src/watch.ts"],"sourcesContent":["// src/ws.ts\nif (!globalThis.EventTarget || !globalThis.Event) {\n console.error(`\n PartySocket requires a global 'EventTarget' class to be available!\n You can polyfill this global by adding this to your code before any partysocket imports: \n \n \\`\\`\\`\n import 'partysocket/event-target-polyfill';\n \\`\\`\\`\n Please file an issue at https://github.com/partykit/partykit if you're still having trouble.\n`);\n}\nvar ErrorEvent = class extends Event {\n message;\n error;\n constructor(error, target) {\n super(\"error\", target);\n this.message = error.message;\n this.error = error;\n }\n};\nvar CloseEvent = class extends Event {\n code;\n reason;\n wasClean = true;\n constructor(code = 1e3, reason = \"\", target) {\n super(\"close\", target);\n this.code = code;\n this.reason = reason;\n }\n};\nvar Events = {\n Event,\n ErrorEvent,\n CloseEvent\n};\nfunction assert(condition, msg) {\n if (!condition) {\n throw new Error(msg);\n }\n}\nfunction cloneEventBrowser(e) {\n return new e.constructor(e.type, e);\n}\nfunction cloneEventNode(e) {\n if (\"data\" in e) {\n const evt2 = new MessageEvent(e.type, e);\n return evt2;\n }\n if (\"code\" in e || \"reason\" in e) {\n const evt2 = new CloseEvent(\n // @ts-expect-error we need to fix event/listener types\n e.code || 1999,\n // @ts-expect-error we need to fix event/listener types\n e.reason || \"unknown reason\",\n e\n );\n return evt2;\n }\n if (\"error\" in e) {\n const evt2 = new ErrorEvent(e.error, e);\n return evt2;\n }\n const evt = new Event(e.type, e);\n return evt;\n}\nvar isNode = typeof process !== \"undefined\" && typeof process.versions?.node !== \"undefined\" && typeof document === \"undefined\";\nvar cloneEvent = isNode ? cloneEventNode : cloneEventBrowser;\nvar DEFAULT = {\n maxReconnectionDelay: 1e4,\n minReconnectionDelay: 1e3 + Math.random() * 4e3,\n minUptime: 5e3,\n reconnectionDelayGrowFactor: 1.3,\n connectionTimeout: 4e3,\n maxRetries: Infinity,\n maxEnqueuedMessages: Infinity,\n startClosed: false,\n debug: false\n};\nvar didWarnAboutMissingWebSocket = false;\nvar ReconnectingWebSocket = class _ReconnectingWebSocket extends EventTarget {\n _ws;\n _retryCount = -1;\n _uptimeTimeout;\n _connectTimeout;\n _shouldReconnect = true;\n _connectLock = false;\n _binaryType = \"blob\";\n _closeCalled = false;\n _messageQueue = [];\n _debugLogger = console.log.bind(console);\n _url;\n _protocols;\n _options;\n constructor(url, protocols, options = {}) {\n super();\n this._url = url;\n this._protocols = protocols;\n this._options = options;\n if (this._options.startClosed) {\n this._shouldReconnect = false;\n }\n if (this._options.debugLogger) {\n this._debugLogger = this._options.debugLogger;\n }\n this._connect();\n }\n static get CONNECTING() {\n return 0;\n }\n static get OPEN() {\n return 1;\n }\n static get CLOSING() {\n return 2;\n }\n static get CLOSED() {\n return 3;\n }\n get CONNECTING() {\n return _ReconnectingWebSocket.CONNECTING;\n }\n get OPEN() {\n return _ReconnectingWebSocket.OPEN;\n }\n get CLOSING() {\n return _ReconnectingWebSocket.CLOSING;\n }\n get CLOSED() {\n return _ReconnectingWebSocket.CLOSED;\n }\n get binaryType() {\n return this._ws ? this._ws.binaryType : this._binaryType;\n }\n set binaryType(value) {\n this._binaryType = value;\n if (this._ws) {\n this._ws.binaryType = value;\n }\n }\n /**\n * Returns the number or connection retries\n */\n get retryCount() {\n return Math.max(this._retryCount, 0);\n }\n /**\n * The number of bytes of data that have been queued using calls to send() but not yet\n * transmitted to the network. This value resets to zero once all queued data has been sent.\n * This value does not reset to zero when the connection is closed; if you keep calling send(),\n * this will continue to climb. Read only\n */\n get bufferedAmount() {\n const bytes = this._messageQueue.reduce((acc, message) => {\n if (typeof message === \"string\") {\n acc += message.length;\n } else if (message instanceof Blob) {\n acc += message.size;\n } else {\n acc += message.byteLength;\n }\n return acc;\n }, 0);\n return bytes + (this._ws ? this._ws.bufferedAmount : 0);\n }\n /**\n * The extensions selected by the server. This is currently only the empty string or a list of\n * extensions as negotiated by the connection\n */\n get extensions() {\n return this._ws ? this._ws.extensions : \"\";\n }\n /**\n * A string indicating the name of the sub-protocol the server selected;\n * this will be one of the strings specified in the protocols parameter when creating the\n * WebSocket object\n */\n get protocol() {\n return this._ws ? this._ws.protocol : \"\";\n }\n /**\n * The current state of the connection; this is one of the Ready state constants\n */\n get readyState() {\n if (this._ws) {\n return this._ws.readyState;\n }\n return this._options.startClosed ? _ReconnectingWebSocket.CLOSED : _ReconnectingWebSocket.CONNECTING;\n }\n /**\n * The URL as resolved by the constructor\n */\n get url() {\n return this._ws ? this._ws.url : \"\";\n }\n /**\n * Whether the websocket object is now in reconnectable state\n */\n get shouldReconnect() {\n return this._shouldReconnect;\n }\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to CLOSED\n */\n onclose = null;\n /**\n * An event listener to be called when an error occurs\n */\n onerror = null;\n /**\n * An event listener to be called when a message is received from the server\n */\n onmessage = null;\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to OPEN;\n * this indicates that the connection is ready to send and receive data\n */\n onopen = null;\n /**\n * Closes the WebSocket connection or connection attempt, if any. If the connection is already\n * CLOSED, this method does nothing\n */\n close(code = 1e3, reason) {\n this._closeCalled = true;\n this._shouldReconnect = false;\n this._clearTimeouts();\n if (!this._ws) {\n this._debug(\"close enqueued: no ws instance\");\n return;\n }\n if (this._ws.readyState === this.CLOSED) {\n this._debug(\"close: already closed\");\n return;\n }\n this._ws.close(code, reason);\n }\n /**\n * Closes the WebSocket connection or connection attempt and connects again.\n * Resets retry counter;\n */\n reconnect(code, reason) {\n this._shouldReconnect = true;\n this._closeCalled = false;\n this._retryCount = -1;\n if (!this._ws || this._ws.readyState === this.CLOSED) {\n this._connect();\n } else {\n this._disconnect(code, reason);\n this._connect();\n }\n }\n /**\n * Enqueue specified data to be transmitted to the server over the WebSocket connection\n */\n send(data) {\n if (this._ws && this._ws.readyState === this.OPEN) {\n this._debug(\"send\", data);\n this._ws.send(data);\n } else {\n const { maxEnqueuedMessages = DEFAULT.maxEnqueuedMessages } = this._options;\n if (this._messageQueue.length < maxEnqueuedMessages) {\n this._debug(\"enqueue\", data);\n this._messageQueue.push(data);\n }\n }\n }\n _debug(...args) {\n if (this._options.debug) {\n this._debugLogger(\"RWS>\", ...args);\n }\n }\n _getNextDelay() {\n const {\n reconnectionDelayGrowFactor = DEFAULT.reconnectionDelayGrowFactor,\n minReconnectionDelay = DEFAULT.minReconnectionDelay,\n maxReconnectionDelay = DEFAULT.maxReconnectionDelay\n } = this._options;\n let delay = 0;\n if (this._retryCount > 0) {\n delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);\n if (delay > maxReconnectionDelay) {\n delay = maxReconnectionDelay;\n }\n }\n this._debug(\"next delay\", delay);\n return delay;\n }\n _wait() {\n return new Promise((resolve) => {\n setTimeout(resolve, this._getNextDelay());\n });\n }\n _getNextProtocols(protocolsProvider) {\n if (!protocolsProvider) return Promise.resolve(null);\n if (typeof protocolsProvider === \"string\" || Array.isArray(protocolsProvider)) {\n return Promise.resolve(protocolsProvider);\n }\n if (typeof protocolsProvider === \"function\") {\n const protocols = protocolsProvider();\n if (!protocols) return Promise.resolve(null);\n if (typeof protocols === \"string\" || Array.isArray(protocols)) {\n return Promise.resolve(protocols);\n }\n if (protocols.then) {\n return protocols;\n }\n }\n throw Error(\"Invalid protocols\");\n }\n _getNextUrl(urlProvider) {\n if (typeof urlProvider === \"string\") {\n return Promise.resolve(urlProvider);\n }\n if (typeof urlProvider === \"function\") {\n const url = urlProvider();\n if (typeof url === \"string\") {\n return Promise.resolve(url);\n }\n if (url.then) {\n return url;\n }\n }\n throw Error(\"Invalid URL\");\n }\n _connect() {\n if (this._connectLock || !this._shouldReconnect) {\n return;\n }\n this._connectLock = true;\n const {\n maxRetries = DEFAULT.maxRetries,\n connectionTimeout = DEFAULT.connectionTimeout\n } = this._options;\n if (this._retryCount >= maxRetries) {\n this._debug(\"max retries reached\", this._retryCount, \">=\", maxRetries);\n return;\n }\n this._retryCount++;\n this._debug(\"connect\", this._retryCount);\n this._removeListeners();\n this._wait().then(\n () => Promise.all([\n this._getNextUrl(this._url),\n this._getNextProtocols(this._protocols || null)\n ])\n ).then(([url, protocols]) => {\n if (this._closeCalled) {\n this._connectLock = false;\n return;\n }\n if (!this._options.WebSocket && typeof WebSocket === \"undefined\" && !didWarnAboutMissingWebSocket) {\n console.error(`\\u203C\\uFE0F No WebSocket implementation available. You should define options.WebSocket. \n\nFor example, if you're using node.js, run \\`npm install ws\\`, and then in your code:\n\nimport PartySocket from 'partysocket';\nimport WS from 'ws';\n\nconst partysocket = new PartySocket({\n host: \"127.0.0.1:1999\",\n room: \"test-room\",\n WebSocket: WS\n});\n\n`);\n didWarnAboutMissingWebSocket = true;\n }\n const WS = this._options.WebSocket || WebSocket;\n this._debug(\"connect\", { url, protocols });\n this._ws = protocols ? new WS(url, protocols) : new WS(url);\n this._ws.binaryType = this._binaryType;\n this._connectLock = false;\n this._addListeners();\n this._connectTimeout = setTimeout(\n () => this._handleTimeout(),\n connectionTimeout\n );\n }).catch((err) => {\n this._connectLock = false;\n this._handleError(new Events.ErrorEvent(Error(err.message), this));\n });\n }\n _handleTimeout() {\n this._debug(\"timeout event\");\n this._handleError(new Events.ErrorEvent(Error(\"TIMEOUT\"), this));\n }\n _disconnect(code = 1e3, reason) {\n this._clearTimeouts();\n if (!this._ws) {\n return;\n }\n this._removeListeners();\n try {\n this._ws.close(code, reason);\n this._handleClose(new Events.CloseEvent(code, reason, this));\n } catch (error) {\n }\n }\n _acceptOpen() {\n this._debug(\"accept open\");\n this._retryCount = 0;\n }\n _handleOpen = (event) => {\n this._debug(\"open event\");\n const { minUptime = DEFAULT.minUptime } = this._options;\n clearTimeout(this._connectTimeout);\n this._uptimeTimeout = setTimeout(() => this._acceptOpen(), minUptime);\n assert(this._ws, \"WebSocket is not defined\");\n this._ws.binaryType = this._binaryType;\n this._messageQueue.forEach((message) => this._ws?.send(message));\n this._messageQueue = [];\n if (this.onopen) {\n this.onopen(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleMessage = (event) => {\n this._debug(\"message event\");\n if (this.onmessage) {\n this.onmessage(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleError = (event) => {\n this._debug(\"error event\", event.message);\n this._disconnect(\n void 0,\n event.message === \"TIMEOUT\" ? \"timeout\" : void 0\n );\n if (this.onerror) {\n this.onerror(event);\n }\n this._debug(\"exec error listeners\");\n this.dispatchEvent(cloneEvent(event));\n this._connect();\n };\n _handleClose = (event) => {\n this._debug(\"close event\");\n this._clearTimeouts();\n if (this._shouldReconnect) {\n this._connect();\n }\n if (this.onclose) {\n this.onclose(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _removeListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"removeListeners\");\n this._ws.removeEventListener(\"open\", this._handleOpen);\n this._ws.removeEventListener(\"close\", this._handleClose);\n this._ws.removeEventListener(\"message\", this._handleMessage);\n this._ws.removeEventListener(\"error\", this._handleError);\n }\n _addListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"addListeners\");\n this._ws.addEventListener(\"open\", this._handleOpen);\n this._ws.addEventListener(\"close\", this._handleClose);\n this._ws.addEventListener(\"message\", this._handleMessage);\n this._ws.addEventListener(\"error\", this._handleError);\n }\n _clearTimeouts() {\n clearTimeout(this._connectTimeout);\n clearTimeout(this._uptimeTimeout);\n }\n};\n\nexport {\n ErrorEvent,\n CloseEvent,\n ReconnectingWebSocket\n};\n/*!\n * Reconnecting WebSocket\n * by Pedro Ladaria <pedro.ladaria@gmail.com>\n * https://github.com/pladaria/reconnecting-websocket\n * License MIT\n */\n","import { Logger } from 'besonders-logger'\nimport ReconnectingWebSocket, { type Options as PartysocketOptions } from 'partysocket/ws'\n\nexport type { PartysocketOptions }\n\nconst { WARN, LOG, DEBUG, ERROR } = Logger.setup(Logger.INFO) // eslint-disable-line unused-imports/no-unused-vars\n\nconst NAME_WS_URL = 'wss://name.web3.storage/name'\nconst NAME_HTTP_URL = 'https://name.web3.storage/name'\n\nexport interface W3NameRecord {\n\tvalue: string // e.g. \"/ipfs/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi\"\n\tseq?: number\n\tvalidity?: string\n}\n\nexport interface WatchRawOptions {\n\t/** Called when the IPNS record is updated */\n\tonUpdate: (record: W3NameRecord) => void\n\t/** Called when an error occurs */\n\tonError?: (error: Event | Error) => void\n\t/** Called when the connection is opened */\n\tonOpen?: () => void\n\t/** Called when the connection is closed */\n\tonClose?: (event: CloseEvent) => void\n}\n\nexport interface WatchRawSubscription {\n\t/** Close the WebSocket connection */\n\tclose: () => void\n\t/** The underlying WebSocket instance */\n\tws: WebSocket\n}\n\n/**\n * Low-level WebSocket watcher for IPNS (no reconnect logic).\n * Use this when you want full control over connection lifecycle.\n * For most cases, prefer `watchName` or `IpnsWatcher` which handle reconnection.\n *\n * @param name - The IPNS name/key to watch\n * @param options - Callback options\n * @returns Subscription with close() and ws\n *\n * @example\n * ```ts\n * const sub = watchNameRaw('k51qzi5u...', {\n * onUpdate: (record) => console.log('Update:', record.value),\n * onClose: () => console.log('Disconnected - handle reconnect yourself'),\n * })\n * ```\n */\nexport function watchNameRaw(name: string, options: WatchRawOptions): WatchRawSubscription {\n\tconst url = `${NAME_WS_URL}/${name}/watch`\n\tDEBUG('[watchNameRaw] connecting to', url)\n\n\tconst ws = new WebSocket(url)\n\n\tws.onopen = () => {\n\t\tLOG('[watchNameRaw] connected to', name)\n\t\toptions.onOpen?.()\n\t}\n\n\tws.onmessage = (event) => {\n\t\ttry {\n\t\t\tconst record: W3NameRecord = JSON.parse(event.data)\n\t\t\tDEBUG('[watchNameRaw] received update for', name, record)\n\t\t\toptions.onUpdate(record)\n\t\t} catch (err) {\n\t\t\tWARN('[watchNameRaw] failed to parse message:', event.data, err)\n\t\t\toptions.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t}\n\t}\n\n\tws.onerror = (event) => {\n\t\tWARN('[watchNameRaw] error for', name, event)\n\t\toptions.onError?.(event)\n\t}\n\n\tws.onclose = (event) => {\n\t\tDEBUG('[watchNameRaw] closed for', name, 'code:', event.code)\n\t\toptions.onClose?.(event)\n\t}\n\n\treturn {\n\t\tclose: () => {\n\t\t\tDEBUG('[watchNameRaw] closing connection for', name)\n\t\t\tws.close()\n\t\t},\n\t\tws,\n\t}\n}\n\nexport interface IpnsWatcherOptions {\n\t/** Called when the IPNS record is updated */\n\tonUpdate: (record: W3NameRecord) => void | Promise<void>\n\t/** Called when an error occurs */\n\tonError?: (error: Error | Event) => void\n\t/** Called when the connection is opened/reconnected */\n\tonConnected?: () => void\n\t/** Called when the connection is closed */\n\tonDisconnected?: () => void\n\t/** Whether to check for missed updates on reconnect (default: true) */\n\tcatchUpOnReconnect?: boolean\n\t/**\n\t * Partysocket options (passed through to ReconnectingWebSocket).\n\t * Useful options: startClosed, maxReconnectionDelay, minReconnectionDelay, etc.\n\t * @see https://github.com/partykit/partykit/tree/main/packages/partysocket\n\t */\n\twsOptions?: PartysocketOptions\n}\n\n/**\n * Robust IPNS watcher with auto-reconnect and catch-up logic.\n * Uses partysocket for reliable WebSocket reconnection.\n *\n * @example\n * ```ts\n * const watcher = new IpnsWatcher('k51qzi5uqu...', {\n * onUpdate: (record) => console.log('New CID:', record.value),\n * onError: (err) => console.error('Error:', err),\n * })\n *\n * // Later, to stop watching:\n * watcher.close()\n * ```\n */\nexport class IpnsWatcher {\n\tprivate name: string\n\tprivate ws: ReconnectingWebSocket\n\tprivate lastKnownValue: string | null = null\n\tprivate options: IpnsWatcherOptions\n\tprivate isFirstConnect = true\n\n\tconstructor(name: string, options: IpnsWatcherOptions) {\n\t\tthis.name = name\n\t\tthis.options = options\n\n\t\tconst url = `${NAME_WS_URL}/${name}/watch`\n\t\tDEBUG('[IpnsWatcher] creating for', name)\n\n\t\tthis.ws = new ReconnectingWebSocket(url, [], {\n\t\t\tmaxReconnectionDelay: 900000, // 15min\n\t\t\tminReconnectionDelay: 5000,\n\t\t\treconnectionDelayGrowFactor: 2,\n\t\t\tmaxRetries: Infinity,\n\t\t\t...options.wsOptions,\n\t\t})\n\n\t\tthis.ws.onopen = () => {\n\t\t\tLOG('[IpnsWatcher] connected to', name)\n\t\t\toptions.onConnected?.()\n\n\t\t\t// Check for missed updates on reconnect (not on first connect)\n\t\t\tif (!this.isFirstConnect && (options.catchUpOnReconnect ?? true)) {\n\t\t\t\tthis.checkForMissedUpdates()\n\t\t\t}\n\t\t\tthis.isFirstConnect = false\n\t\t}\n\n\t\tthis.ws.onmessage = (event) => {\n\t\t\ttry {\n\t\t\t\tconst record: W3NameRecord = JSON.parse(event.data as string)\n\t\t\t\tDEBUG('[IpnsWatcher] received update for', name, record)\n\t\t\t\tthis.lastKnownValue = record.value\n\t\t\t\tvoid options.onUpdate(record)\n\t\t\t} catch (err) {\n\t\t\t\tWARN('[IpnsWatcher] failed to parse message:', event.data, err)\n\t\t\t\toptions.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t\t}\n\t\t}\n\n\t\tthis.ws.onerror = (event) => {\n\t\t\t// Extract meaningful error info instead of logging entire ErrorEvent\n\t\t\tconst errorMsg = event instanceof ErrorEvent ? event.message : 'WebSocket error'\n\n\t\t\t// \"Unexpected EOF\" is a normal disconnection - partysocket will auto-reconnect\n\t\t\t// Log at INFO level as it's expected behavior, not an error\n\t\t\tif (errorMsg === 'Unexpected EOF') {\n\t\t\t\tLOG('[IpnsWatcher] error for', name, ':', errorMsg, '(auto-reconnect enabled)')\n\t\t\t} else {\n\t\t\t\tWARN('[IpnsWatcher] error for', name, ':', errorMsg)\n\t\t\t}\n\n\t\t\t// Still call the error handler for unexpected errors\n\t\t\tif (errorMsg !== 'Unexpected EOF') {\n\t\t\t\toptions.onError?.(event)\n\t\t\t}\n\t\t}\n\n\t\tthis.ws.onclose = () => {\n\t\t\tDEBUG('[IpnsWatcher] disconnected from', name)\n\t\t\toptions.onDisconnected?.()\n\t\t}\n\t}\n\n\t/**\n\t * Resolve current IPNS value via HTTP API to catch missed updates\n\t */\n\tprivate async checkForMissedUpdates(): Promise<void> {\n\t\ttry {\n\t\t\tDEBUG('[IpnsWatcher] checking for missed updates for', this.name)\n\t\t\tconst response = await fetch(`${NAME_HTTP_URL}/${this.name}`)\n\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status === 404) {\n\t\t\t\t\tDEBUG('[IpnsWatcher] IPNS not yet published:', this.name)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthrow new Error(`HTTP ${response.status}: ${response.statusText}`)\n\t\t\t}\n\n\t\t\tconst record: W3NameRecord = await response.json()\n\n\t\t\tif (record.value !== this.lastKnownValue) {\n\t\t\t\tLOG('[IpnsWatcher] caught missed update for', this.name, {\n\t\t\t\t\tprevious: this.lastKnownValue,\n\t\t\t\t\tcurrent: record.value,\n\t\t\t\t})\n\t\t\t\tthis.lastKnownValue = record.value\n\t\t\t\tvoid this.options.onUpdate(record)\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tWARN('[IpnsWatcher] failed to check for missed updates:', this.name, err)\n\t\t\tthis.options.onError?.(err instanceof Error ? err : new Error(String(err)))\n\t\t}\n\t}\n\n\t/**\n\t * Manually start/reconnect the WebSocket.\n\t * Only needed if you used `wsOptions: { startClosed: true }`.\n\t */\n\tstart(): void {\n\t\tLOG('[IpnsWatcher] starting watcher for', this.name)\n\t\tthis.ws.reconnect()\n\t}\n\n\t/**\n\t * Alias for close() - for backward compatibility\n\t */\n\tstop(): void {\n\t\tthis.close()\n\t}\n\n\t/**\n\t * Close the WebSocket connection and stop watching\n\t */\n\tclose(): void {\n\t\tLOG('[IpnsWatcher] closing watcher for', this.name)\n\t\tthis.ws.close()\n\t}\n\n\t/**\n\t * Get the last known IPNS value\n\t */\n\tget lastValue(): string | null {\n\t\treturn this.lastKnownValue\n\t}\n\n\t/**\n\t * Get the WebSocket ready state\n\t */\n\tget readyState(): number {\n\t\treturn this.ws.readyState\n\t}\n}\n\n/**\n * Create an IPNS watcher with auto-reconnect and catch-up logic.\n * Convenience function that creates and returns an IpnsWatcher instance.\n *\n * @param name - The IPNS name/key to watch (e.g. \"k51qzi5u...\")\n * @param options - Callback options for handling events\n * @returns An IpnsWatcher instance with close() method\n */\nexport function watchName(name: string, options: IpnsWatcherOptions): IpnsWatcher {\n\treturn new IpnsWatcher(name, options)\n}\n\n/**\n * Watch an IPNS name and return updates as an async iterator.\n * Includes auto-reconnect - iterator continues through disconnections.\n *\n * @param name - The IPNS name/key to watch\n * @param signal - Optional AbortSignal to stop the watch\n *\n * @example\n * ```ts\n * const controller = new AbortController()\n * for await (const record of watchNameIterator('k51qzi5u...', controller.signal)) {\n * console.log('Update:', record.value)\n * }\n * ```\n */\nexport async function* watchNameIterator(\n\tname: string,\n\tsignal?: AbortSignal,\n): AsyncGenerator<W3NameRecord, void, unknown> {\n\tconst queue: W3NameRecord[] = []\n\tlet resolve: (() => void) | null = null\n\tlet error: Error | null = null\n\n\tconst watcher = new IpnsWatcher(name, {\n\t\tonUpdate: (record) => {\n\t\t\tqueue.push(record)\n\t\t\tresolve?.()\n\t\t},\n\t\tonError: (err) => {\n\t\t\terror = err instanceof Error ? err : new Error('WebSocket error')\n\t\t\tresolve?.()\n\t\t},\n\t})\n\n\tsignal?.addEventListener('abort', () => {\n\t\twatcher.close()\n\t})\n\n\ttry {\n\t\twhile (!signal?.aborted) {\n\t\t\tif (queue.length > 0) {\n\t\t\t\tyield queue.shift()!\n\t\t\t} else if (error) {\n\t\t\t\t// Log error but continue - partysocket will reconnect\n\t\t\t\tWARN('[watchNameIterator] error occurred, continuing:', error)\n\t\t\t\terror = null\n\t\t\t} else {\n\t\t\t\tawait new Promise<void>((r) => {\n\t\t\t\t\tresolve = r\n\t\t\t\t})\n\t\t\t\tresolve = null\n\t\t\t}\n\t\t}\n\t} finally {\n\t\twatcher.close()\n\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9C,IAAMC,EAAwB,CAAC,EAC3BC,EAA+B,KAC/BC,EAAsB,KAEpBC,EAAU,IAAIV,EAAYP,EAAM,CACrC,SAAWK,GAAW,CACrBS,EAAM,KAAKT,CAAM,EACjBU,IAAU,CACX,EACA,QAAUT,GAAQ,CACjBU,EAAQV,aAAe,MAAQA,EAAM,IAAI,MAAM,iBAAiB,EAChES,IAAU,CACX,CACD,CAAC,EAEDF,GAAQ,iBAAiB,QAAS,IAAM,CACvCI,EAAQ,MAAM,CACf,CAAC,EAED,GAAI,CACH,KAAO,CAACJ,GAAQ,SACXC,EAAM,OAAS,EAClB,MAAMA,EAAM,MAAM,EACRE,GAEVxB,EAAK,kDAAmDwB,CAAK,EAC7DA,EAAQ,OAER,MAAM,IAAI,QAAeE,GAAM,CAC9BH,EAAUG,CACX,CAAC,EACDH,EAAU,KAGb,QAAE,CACDE,EAAQ,MAAM,CACf,CACD","names":["ErrorEvent","error","target","CloseEvent","code","reason","Events","assert","condition","msg","cloneEventBrowser","e","cloneEventNode","isNode","cloneEvent","DEFAULT","didWarnAboutMissingWebSocket","ReconnectingWebSocket","_ReconnectingWebSocket","url","protocols","options","value","acc","message","data","maxEnqueuedMessages","args","reconnectionDelayGrowFactor","minReconnectionDelay","maxReconnectionDelay","delay","resolve","protocolsProvider","urlProvider","maxRetries","connectionTimeout","WS","err","event","minUptime","WARN","LOG","DEBUG","ERROR","E","NAME_WS_URL","NAME_HTTP_URL","watchNameRaw","name","options","url","ws","event","record","err","IpnsWatcher","ReconnectingWebSocket","errorMsg","response","watchName","watchNameIterator","signal","queue","resolve","error","watcher","r"]}
|
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,b as t,c as x}from"./chunk-JKYFLJ5O.min.js";import"./chunk-XCHCNDQW.min.js";import{a as o}from"./chunk-BFHWRINC.min.js";import{a as r,b as e,c as f,d as m}from"./chunk-
|
|
1
|
+
import{a as p,b as t,c as x}from"./chunk-JKYFLJ5O.min.js";import"./chunk-XCHCNDQW.min.js";import{a as o}from"./chunk-BFHWRINC.min.js";import{a as r,b as e,c as f,d as m}from"./chunk-YLZ4OBPK.min.js";import"./chunk-L7VH6KZJ.min.js";import"./chunk-D2SZILOK.min.js";export{e as IpnsWatcher,t as generateIpnsKey,x as getW3NamePublic,o as parseW3Name,p as publishIPNS,f as watchName,m as watchNameIterator,r as watchNameRaw};
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|
package/dist/watch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":"AACA,OAA8B,EAAE,KAAK,OAAO,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAE1F,YAAY,EAAE,kBAAkB,EAAE,CAAA;AAOlC,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC/B,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACxC,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,KAAK,IAAI,CAAA;IACxC,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,oBAAoB;IACpC,qCAAqC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,wCAAwC;IACxC,EAAE,EAAE,SAAS,CAAA;CACb;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,oBAAoB,CAu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IAAI;IAKb;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAE7B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;CACD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,WAAW,CAEhF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAuB,iBAAiB,CACvC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,GAClB,cAAc,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,CAsC7C"}
|
package/dist/watch.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-YLZ4OBPK.min.js";import"./chunk-L7VH6KZJ.min.js";import"./chunk-D2SZILOK.min.js";export{b as IpnsWatcher,c as watchName,d as watchNameIterator,a as watchNameRaw};
|
|
2
2
|
//# sourceMappingURL=watch.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wovin/connect-web3storage",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.min.js",
|
|
6
6
|
"browser": "./dist/index.min.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"multiformats": "^13.0.1",
|
|
45
45
|
"partysocket": "^1.0.2",
|
|
46
46
|
"w3name": "^1.0.8",
|
|
47
|
-
"@wovin/core": "^0.1.
|
|
47
|
+
"@wovin/core": "^0.1.13"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"concurrently": "^8.2.2",
|