New:Socket for Asana Is Now Available.Learn more
Sign In

@libp2p/interface

Package Overview
Dependencies
Maintainers
6
Versions
853
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/interface - npm Package Compare versions

Comparing version
3.2.5-5459e136d
to
3.2.5-55d7a539a
+1
-1
dist/index.min.js
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var Libp2PInterface=(()=>{var p=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var er=Object.getOwnPropertyNames;var or=Object.prototype.hasOwnProperty;var sr=(t,r)=>{for(var e in r)p(t,e,{get:r[e],enumerable:!0})},nr=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of er(r))!or.call(t,o)&&o!==e&&p(t,o,{get:()=>r[o],enumerable:!(s=tr(r,o))||s.enumerable});return t};var ar=t=>nr(p({},"__esModule",{value:!0}),t);var Sr={};sr(Sr,{AbortError:()=>l,AlreadyStartedError:()=>O,ConnectionClosedError:()=>b,ConnectionClosingError:()=>h,ConnectionFailedError:()=>y,DialError:()=>_,FaultTolerance:()=>Q,InvalidCIDError:()=>T,InvalidCryptoExchangeError:()=>m,InvalidMessageError:()=>M,InvalidMultiaddrError:()=>w,InvalidMultihashError:()=>C,InvalidParametersError:()=>x,InvalidPeerIdError:()=>g,InvalidPrivateKeyError:()=>f,InvalidPublicKeyError:()=>d,KEEP_ALIVE:()=>xr,LimitedConnectionError:()=>F,ListenError:()=>B,MuxerClosedError:()=>v,NotFoundError:()=>L,NotImplementedError:()=>V,NotStartedError:()=>K,ProtocolError:()=>U,StreamAbortEvent:()=>G,StreamAbortedError:()=>I,StreamBufferError:()=>A,StreamCloseEvent:()=>a,StreamMessageEvent:()=>z,StreamResetError:()=>S,StreamResetEvent:()=>H,StreamStateError:()=>P,TimeoutError:()=>N,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>q,TypedEventEmitter:()=>W,UnexpectedPeerError:()=>u,UnsupportedKeyTypeError:()=>j,UnsupportedOperationError:()=>E,UnsupportedProtocolError:()=>D,connectionSymbol:()=>X,contentRoutingSymbol:()=>ir,isConnection:()=>cr,isPeerId:()=>ur,isPrivateKey:()=>pr,isPublicKey:()=>Y,isStartable:()=>J,isTransport:()=>Er,peerDiscoverySymbol:()=>lr,peerIdSymbol:()=>Z,peerRoutingSymbol:()=>mr,serviceCapabilities:()=>yr,serviceDependencies:()=>vr,setMaxListeners:()=>k,start:()=>dr,stop:()=>fr,transportSymbol:()=>$});var X=Symbol.for("@libp2p/connection");function cr(t){return t!=null&&!!t[X]}var ir=Symbol.for("@libp2p/content-routing");var l=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},u=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},m=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},x=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},d=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},f=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},E=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},h=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},b=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},y=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},v=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},I=class extends Error{static name="StreamAbortedError";constructor(r="The stream has been aborted"){super(r),this.name="StreamAbortedError"}},P=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},A=class extends Error{static name="StreamBufferError";constructor(r="The stream buffer was full"){super(r),this.name="StreamBufferError"}},L=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},g=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},w=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},T=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},C=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},D=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},M=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},U=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},N=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},K=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},O=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},_=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},B=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},F=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},q=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},j=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},V=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};var z=class extends Event{data;constructor(r,e){super("message",e),this.data=r}},a=class extends Event{error;local;constructor(r,e,s){super("close",s),this.error=e,this.local=r}},G=class extends a{constructor(r,e){super(!0,r,e)}},H=class extends a{constructor(r,e){super(!1,r,e)}};function Y(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function pr(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&Y(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var lr=Symbol.for("@libp2p/peer-discovery");var Z=Symbol.for("@libp2p/peer-id");function ur(t){return!!t?.[Z]}var mr=Symbol.for("@libp2p/peer-routing");var xr="keep-alive";function J(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function dr(...t){let r=[];for(let e of t)J(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function fr(...t){let r=[];for(let e of t)J(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var $=Symbol.for("@libp2p/transport");function Er(t){return t!=null&&!!t[$]}var Q;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Q||(Q={}));function k(){}function hr(t){return typeof t?.handleEvent=="function"}function br(t){return(t!==!0&&t!==!1&&t?.once)??!1}var W=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){let o=br(s);super.addEventListener(r,c=>{if(o){let i=this.#r.get(c.type);i!=null&&(i=i.filter(({callback:rr})=>rr!==e),this.#r.set(c.type,i))}hr(e)?e.handleEvent(c):e(c)},s);let n=this.#r.get(r);n==null&&(n=[],this.#r.set(r,n)),n.push({callback:e,once:o})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:n})=>n!==e),this.#r.set(r,o))}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};var yr=Symbol.for("@libp2p/service-capabilities"),vr=Symbol.for("@libp2p/service-dependencies");return ar(Sr);})();
"use strict";var Libp2PInterface=(()=>{var p=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var nr=Object.prototype.hasOwnProperty;var ar=(t,r)=>{for(var e in r)p(t,e,{get:r[e],enumerable:!0})},ir=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of sr(r))!nr.call(t,o)&&o!==e&&p(t,o,{get:()=>r[o],enumerable:!(s=or(r,o))||s.enumerable});return t};var cr=t=>ir(p({},"__esModule",{value:!0}),t);var gr={};ar(gr,{AbortError:()=>l,AlreadyStartedError:()=>O,ConnectionClosedError:()=>b,ConnectionClosingError:()=>h,ConnectionFailedError:()=>v,DialError:()=>B,FaultTolerance:()=>Q,InvalidCIDError:()=>T,InvalidCryptoExchangeError:()=>m,InvalidMessageError:()=>M,InvalidMultiaddrError:()=>w,InvalidMultihashError:()=>C,InvalidParametersError:()=>x,InvalidPeerIdError:()=>P,InvalidPrivateKeyError:()=>d,InvalidPublicKeyError:()=>f,KEEP_ALIVE:()=>dr,LimitedConnectionError:()=>F,ListenError:()=>_,MuxerClosedError:()=>y,NotFoundError:()=>A,NotImplementedError:()=>j,NotStartedError:()=>K,ProtocolError:()=>U,StreamAbortEvent:()=>G,StreamAbortedError:()=>I,StreamBufferError:()=>g,StreamCloseEvent:()=>c,StreamMessageEvent:()=>z,StreamResetError:()=>S,StreamResetEvent:()=>H,StreamStateError:()=>L,TimeoutError:()=>N,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>q,TypedEventEmitter:()=>X,UnexpectedPeerError:()=>u,UnsupportedKeyTypeError:()=>V,UnsupportedOperationError:()=>E,UnsupportedProtocolError:()=>D,connectionSymbol:()=>Z,contentRoutingSymbol:()=>lr,isConnection:()=>pr,isPeerId:()=>xr,isPrivateKey:()=>ur,isPublicKey:()=>$,isStartable:()=>J,isTransport:()=>br,peerDiscoverySymbol:()=>mr,peerIdSymbol:()=>k,peerRoutingSymbol:()=>fr,serviceCapabilities:()=>Ir,serviceDependencies:()=>Lr,setMaxListeners:()=>tr,start:()=>Er,stop:()=>hr,transportSymbol:()=>rr});var Z=Symbol.for("@libp2p/connection");function pr(t){return t!=null&&!!t[Z]}var lr=Symbol.for("@libp2p/content-routing");var l=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},u=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},m=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},x=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},f=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},d=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},E=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},h=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},b=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},v=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},y=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},I=class extends Error{static name="StreamAbortedError";constructor(r="The stream has been aborted"){super(r),this.name="StreamAbortedError"}},L=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},g=class extends Error{static name="StreamBufferError";constructor(r="The stream buffer was full"){super(r),this.name="StreamBufferError"}},A=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},P=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},w=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},T=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},C=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},D=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},M=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},U=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},N=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},K=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},O=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},B=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},_=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},F=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},q=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},V=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},j=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};var z=class extends Event{data;constructor(r,e){super("message",e),this.data=r}},c=class extends Event{error;local;constructor(r,e,s){super("close",s),this.error=e,this.local=r}},G=class extends c{constructor(r,e){super(!0,r,e)}},H=class extends c{constructor(r,e){super(!1,r,e)}};function $(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function ur(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&$(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var mr=Symbol.for("@libp2p/peer-discovery");var k=Symbol.for("@libp2p/peer-id");function xr(t){return!!t?.[k]}var fr=Symbol.for("@libp2p/peer-routing");var dr="keep-alive";function J(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function Er(...t){let r=[];for(let e of t)J(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function hr(...t){let r=[];for(let e of t)J(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var rr=Symbol.for("@libp2p/transport");function br(t){return t!=null&&!!t[rr]}var Q;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(Q||(Q={}));function tr(){}function vr(t){return typeof t?.handleEvent=="function"}function yr(t){return t===!0||t===!1}function Sr(t){return yr(t)?t:t?.capture??!1}function W(t){let r={capture:Sr(t),once:!!t?.once};return t?.passive!=null&&(r.passive=t?.passive),t?.signal!=null&&(r.signal=t?.signal),r}function er(t,r){return W(t).capture===W(r).capture}var X=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){let o=W(s);if(o?.signal?.aborted===!0)return;let n=i=>{o.once&&this.removeEventListener(r,e,o),vr(e)?e.handleEvent(i):e(i)},a=this.#r.get(r);if(a==null&&(a=[],this.#r.set(r,a)),a.some(i=>i.callback!==e?!1:er(i.options,o)))return;super.addEventListener(r,n,o);let Y=()=>{this.removeEventListener(r,e,o)};o.signal?.addEventListener("abort",Y),a.push({callback:e,wrapper:n,options:o,onAbort:Y})}removeEventListener(r,e,s){let o=this.#r.get(r);if(o==null){super.removeEventListener(r,e??null,s);return}this.#r.set(r,o.filter(n=>n.callback===e&&er(n.options,s)?(super.removeEventListener(r,n.wrapper,s),n.options?.signal?.removeEventListener("abort",n.onAbort),!1):!0))}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};var Ir=Symbol.for("@libp2p/service-capabilities"),Lr=Symbol.for("@libp2p/service-dependencies");return cr(gr);})();
return Libp2PInterface}));
//# sourceMappingURL=index.min.js.map
{
"name": "@libp2p/interface",
"version": "3.2.5-5459e136d",
"version": "3.2.5-55d7a539a",
"description": "The interface implemented by a libp2p node",

@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT",

Sorry, the diff of this file is too big to display