@libp2p/interface 1.0.0-551622a96 → 1.0.0-8e4fbe13a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,20 +5,6 @@
5
5
 
6
6
  > The interface implemented by a libp2p node
7
7
 
8
- # About
9
-
10
- Exports a `Libp2p` type for modules to use as a type argument.
11
-
12
- ## Example
13
-
14
- ```typescript
15
- import type { Libp2p } from '@libp2p/interface'
16
-
17
- function doSomethingWithLibp2p (node: Libp2p) {
18
- // ...
19
- }
20
- ```
21
-
22
8
  # Install
23
9
 
24
10
  ```console
package/dist/index.min.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},_=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of y(t))!h.call(e,s)&&s!==o&&n(e,s,{get:()=>t[s],enumerable:!(r=A(t,s))||r.enumerable});return e};var g=e=>_(n({},"__esModule",{value:!0}),e);var K={};L(K,{AbortError:()=>c,CodeError:()=>a,CustomEvent:()=>R,ERR_INVALID_MESSAGE:()=>G,ERR_INVALID_PARAMETERS:()=>B,ERR_NOT_FOUND:()=>F,ERR_TIMEOUT:()=>k,Ed25519:()=>w,FaultTolerance:()=>i,InvalidCryptoExchangeError:()=>x,KEEP_ALIVE:()=>O,RSA:()=>N,StrictNoSign:()=>U,StrictSign:()=>C,TopicValidatorResult:()=>p,TypedEventEmitter:()=>f,UnexpectedPeerError:()=>l,connectionSymbol:()=>E,contentRoutingSymbol:()=>v,isConnection:()=>I,isPeerId:()=>M,isStartable:()=>m,isTransport:()=>V,peerDiscoverySymbol:()=>P,peerIdSymbol:()=>S,peerRoutingSymbol:()=>D,secp256k1:()=>T,setMaxListeners:()=>j,start:()=>X,stop:()=>H,transportSymbol:()=>d});var E=Symbol.for("@libp2p/connection");function I(e){return e!=null&&!!e[E]}var v=Symbol.for("@libp2p/content-routing");var w="Ed25519",N="RSA",T="secp256k1";var P=Symbol.for("@libp2p/peer-discovery");var S=Symbol.for("@libp2p/peer-id");function M(e){return e!=null&&!!e[S]}var D=Symbol.for("@libp2p/peer-routing");var O="keep-alive";var C="StrictSign",U="StrictNoSign",p;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(p||(p={}));var d=Symbol.for("@libp2p/transport");function V(e){return e!=null&&!!e[d]}var i;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(i||(i={}));var c=class e extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=e.code,this.type=e.type}static code="ABORT_ERR";static type="aborted"},a=class extends Error{code;props;constructor(t,o,r){super(t),this.code=o,this.name=r?.name??"CodeError",this.props=r??{}}},l=class e extends Error{code;constructor(t="Unexpected Peer"){super(t),this.code=e.code}static code="ERR_UNEXPECTED_PEER"},x=class e extends Error{code;constructor(t="Invalid crypto exchange"){super(t),this.code=e.code}static code="ERR_INVALID_CRYPTO_EXCHANGE"},k="ERR_TIMEOUT",B="ERR_INVALID_PARAMETERS",F="ERR_NOT_FOUND",G="ERR_INVALID_MESSAGE";var f=class extends EventTarget{#t=new Map;listenerCount(t){let o=this.#t.get(t);return o==null?0:o.length}addEventListener(t,o,r){super.addEventListener(t,o,r);let s=this.#t.get(t);s==null&&(s=[],this.#t.set(t,s)),s.push({callback:o,once:(r!==!0&&r!==!1&&r?.once)??!1})}removeEventListener(t,o,r){super.removeEventListener(t.toString(),o??null,r);let s=this.#t.get(t);s!=null&&(s=s.filter(({callback:b})=>b!==o),this.#t.set(t,s))}dispatchEvent(t){let o=super.dispatchEvent(t),r=this.#t.get(t.type);return r==null||(r=r.filter(({once:s})=>!s),this.#t.set(t.type,r)),o}safeDispatchEvent(t,o){return this.dispatchEvent(new R(t,o))}},u=class extends Event{detail;constructor(t,o){super(t,o),this.detail=o?.detail}},R=globalThis.CustomEvent??u,j=(e,...t)=>{try{[...t]}catch{}};function m(e){return e!=null&&typeof e.start=="function"&&typeof e.stop=="function"}async function X(...e){let t=[];for(let o of e)m(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStart!=null&&await o.beforeStart()})),await Promise.all(t.map(async o=>{await o.start()})),await Promise.all(t.map(async o=>{o.afterStart!=null&&await o.afterStart()}))}async function H(...e){let t=[];for(let o of e)m(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStop!=null&&await o.beforeStop()})),await Promise.all(t.map(async o=>{await o.stop()})),await Promise.all(t.map(async o=>{o.afterStop!=null&&await o.afterStop()}))}return g(K);})();
2
+ "use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},I=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of y(t))!L.call(e,s)&&s!==o&&n(e,s,{get:()=>t[s],enumerable:!(r=h(t,s))||r.enumerable});return e};var g=e=>I(n({},"__esModule",{value:!0}),e);var K={};_(K,{AbortError:()=>i,CodeError:()=>a,CustomEvent:()=>b,ERR_INVALID_MESSAGE:()=>j,ERR_INVALID_PARAMETERS:()=>F,ERR_NOT_FOUND:()=>G,ERR_TIMEOUT:()=>B,Ed25519:()=>v,FaultTolerance:()=>c,InvalidCryptoExchangeError:()=>x,InvalidCryptoTransmissionError:()=>f,KEEP_ALIVE:()=>V,RSA:()=>w,StrictNoSign:()=>U,StrictSign:()=>C,TopicValidatorResult:()=>p,TypedEventEmitter:()=>u,UnexpectedPeerError:()=>l,connectionSymbol:()=>S,contentRoutingSymbol:()=>T,isConnection:()=>N,isPeerId:()=>O,isStartable:()=>E,isTransport:()=>k,peerDiscoverySymbol:()=>M,peerIdSymbol:()=>d,peerRoutingSymbol:()=>D,secp256k1:()=>P,setMaxListeners:()=>X,start:()=>Y,stop:()=>H,transportSymbol:()=>R});var S=Symbol.for("@libp2p/connection");function N(e){return e!=null&&!!e[S]}var T=Symbol.for("@libp2p/content-routing");var v="Ed25519",w="RSA",P="secp256k1";var M=Symbol.for("@libp2p/peer-discovery");var d=Symbol.for("@libp2p/peer-id");function O(e){return e!=null&&!!e[d]}var D=Symbol.for("@libp2p/peer-routing");var V="keep-alive";var C="StrictSign",U="StrictNoSign",p;(function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"})(p||(p={}));var R=Symbol.for("@libp2p/transport");function k(e){return e!=null&&!!e[R]}var c;(function(e){e[e.FATAL_ALL=0]="FATAL_ALL",e[e.NO_FATAL=1]="NO_FATAL"})(c||(c={}));var i=class e extends Error{code;type;constructor(t="The operation was aborted"){super(t),this.code=e.code,this.type=e.type}static code="ABORT_ERR";static type="aborted"},a=class extends Error{code;props;constructor(t,o,r){super(t),this.code=o,this.name=r?.name??"CodeError",this.props=r??{}}},l=class e extends Error{code;constructor(t="Unexpected Peer"){super(t),this.code=e.code}static code="ERR_UNEXPECTED_PEER"},x=class e extends Error{code;constructor(t="Invalid crypto exchange"){super(t),this.code=e.code}static code="ERR_INVALID_CRYPTO_EXCHANGE"},f=class e extends Error{code;constructor(t="Invalid crypto transmission"){super(t),this.code=e.code}static code="ERR_INVALID_CRYPTO_TRANSMISSION"},B="ERR_TIMEOUT",F="ERR_INVALID_PARAMETERS",G="ERR_NOT_FOUND",j="ERR_INVALID_MESSAGE";var u=class extends EventTarget{#t=new Map;listenerCount(t){let o=this.#t.get(t);return o==null?0:o.length}addEventListener(t,o,r){super.addEventListener(t,o,r);let s=this.#t.get(t);s==null&&(s=[],this.#t.set(t,s)),s.push({callback:o,once:(r!==!0&&r!==!1&&r?.once)??!1})}removeEventListener(t,o,r){super.removeEventListener(t.toString(),o??null,r);let s=this.#t.get(t);s!=null&&(s=s.filter(({callback:A})=>A!==o),this.#t.set(t,s))}dispatchEvent(t){let o=super.dispatchEvent(t),r=this.#t.get(t.type);return r==null||(r=r.filter(({once:s})=>!s),this.#t.set(t.type,r)),o}safeDispatchEvent(t,o){return this.dispatchEvent(new b(t,o))}},m=class extends Event{detail;constructor(t,o){super(t,o),this.detail=o?.detail}},b=globalThis.CustomEvent??m,X=(e,...t)=>{try{[...t]}catch{}};function E(e){return e!=null&&typeof e.start=="function"&&typeof e.stop=="function"}async function Y(...e){let t=[];for(let o of e)E(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStart!=null&&await o.beforeStart()})),await Promise.all(t.map(async o=>{await o.start()})),await Promise.all(t.map(async o=>{o.afterStart!=null&&await o.afterStart()}))}async function H(...e){let t=[];for(let o of e)E(o)&&t.push(o);await Promise.all(t.map(async o=>{o.beforeStop!=null&&await o.beforeStop()})),await Promise.all(t.map(async o=>{await o.stop()})),await Promise.all(t.map(async o=>{o.afterStop!=null&&await o.afterStop()}))}return g(K);})();
3
3
  return Libp2PInterface}));
@@ -9,10 +9,10 @@ import type { CID } from 'multiformats/cid';
9
9
  * @example
10
10
  *
11
11
  * ```js
12
- * import { contentRouting, ContentRouting } from '@libp2p/content-routing'
12
+ * import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing'
13
13
  *
14
14
  * class MyContentRouter implements ContentRouting {
15
- * get [contentRouting] () {
15
+ * get [contentRoutingSymbol] () {
16
16
  * return this
17
17
  * }
18
18
  *
@@ -6,10 +6,10 @@
6
6
  * @example
7
7
  *
8
8
  * ```js
9
- * import { contentRouting, ContentRouting } from '@libp2p/content-routing'
9
+ * import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing'
10
10
  *
11
11
  * class MyContentRouter implements ContentRouting {
12
- * get [contentRouting] () {
12
+ * get [contentRoutingSymbol] () {
13
13
  * return this
14
14
  * }
15
15
  *
@@ -10,10 +10,6 @@ export declare class AbortError extends Error {
10
10
  static readonly code = "ABORT_ERR";
11
11
  static readonly type = "aborted";
12
12
  }
13
- /**
14
- * An {@see Error } subclass that defines a `.code` property that calling code
15
- * can use to detect what type of error has been thrown and act accordingly.
16
- */
17
13
  export declare class CodeError<T extends Record<string, any> = Record<string, never>> extends Error {
18
14
  readonly code: string;
19
15
  readonly props: T;
@@ -29,20 +25,13 @@ export declare class InvalidCryptoExchangeError extends Error {
29
25
  constructor(message?: string);
30
26
  static readonly code = "ERR_INVALID_CRYPTO_EXCHANGE";
31
27
  }
32
- /**
33
- * A generic error code indicating that a timeout occurred
34
- */
28
+ export declare class InvalidCryptoTransmissionError extends Error {
29
+ code: string;
30
+ constructor(message?: string);
31
+ static readonly code = "ERR_INVALID_CRYPTO_TRANSMISSION";
32
+ }
35
33
  export declare const ERR_TIMEOUT = "ERR_TIMEOUT";
36
- /**
37
- * A generic error code indicating that invalid paramters were passed
38
- */
39
34
  export declare const ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS";
40
- /**
41
- * A generic error code indicating that something was not found
42
- */
43
35
  export declare const ERR_NOT_FOUND = "ERR_NOT_FOUND";
44
- /**
45
- * A generic error code indicating that the message was invalid
46
- */
47
36
  export declare const ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE";
48
37
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAA;gBAEf,OAAO,GAAE,MAAoC;IAM1D,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAc;IAElC,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAY;CACjC;AAED;;;GAGG;AACH,qBAAa,SAAS,CAAC,CAAC,S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K,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAoB;IAKxC,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAwB;CAC7C;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAA4B;IAKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD;AAID,eAAO,MAAM,WAAW,gBAAgB,CAAA;AACxC,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAC5C,eAAO,MAAM,mBAAmB,wBAAwB,CAAA"}
@@ -14,10 +14,6 @@ export class AbortError extends Error {
14
14
  static code = 'ABORT_ERR';
15
15
  static type = 'aborted';
16
16
  }
17
- /**
18
- * An {@see Error } subclass that defines a `.code` property that calling code
19
- * can use to detect what type of error has been thrown and act accordingly.
20
- */
21
17
  export class CodeError extends Error {
22
18
  code;
23
19
  props;
@@ -44,20 +40,17 @@ export class InvalidCryptoExchangeError extends Error {
44
40
  }
45
41
  static code = 'ERR_INVALID_CRYPTO_EXCHANGE';
46
42
  }
47
- /**
48
- * A generic error code indicating that a timeout occurred
49
- */
43
+ export class InvalidCryptoTransmissionError extends Error {
44
+ code;
45
+ constructor(message = 'Invalid crypto transmission') {
46
+ super(message);
47
+ this.code = InvalidCryptoTransmissionError.code;
48
+ }
49
+ static code = 'ERR_INVALID_CRYPTO_TRANSMISSION';
50
+ }
51
+ // Error codes
50
52
  export const ERR_TIMEOUT = 'ERR_TIMEOUT';
51
- /**
52
- * A generic error code indicating that invalid paramters were passed
53
- */
54
53
  export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS';
55
- /**
56
- * A generic error code indicating that something was not found
57
- */
58
54
  export const ERR_NOT_FOUND = 'ERR_NOT_FOUND';
59
- /**
60
- * A generic error code indicating that the message was invalid
61
- */
62
55
  export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE';
63
56
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnB,IAAI,CAAQ;IACZ,IAAI,CAAQ;IAE5B,YAAa,UAAkB,2BAA2B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,WAAW,CAAA;IAElC,MAAM,CAAU,IAAI,GAAG,SAAS,CAAA;;AAGlC;;;GAGG;AACH,MAAM,OAAO,SAAiE,SAAQ,KAAK;IAKvE;IAJF,KAAK,CAAG;IAExB,YACE,OAAe,EACC,IAAY,EAC5B,KAAS;QAET,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,SAAI,GAAJ,IAAI,CAAQ;QAK5B,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,WAAW,CAAA;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAO,CAAA,CAAC,oEAAoE;IACpG,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAA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AE,IAAI,IAAI,WAAW,CAAA;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAO,CAAA,CAAC,oEAAoE;IACpG,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,qBAAqB,CAAA;;AAG9C,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,yBAAyB;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAC7C,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,6BAA6B,CAAA;;AAGtD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAChD,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,6BAA6B;QAClD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC,IAAI,CAAA;IACjD,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,iCAAiC,CAAA;;AAG1D,cAAc;AAEd,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA"}
@@ -40,14 +40,6 @@ export interface Startable {
40
40
  afterStop?(): void | Promise<void>;
41
41
  }
42
42
  export declare function isStartable(obj: any): obj is Startable;
43
- /**
44
- * Start one or more {@link Startable}s, calling the `beforeStart` and
45
- * `afterStart` lifecycle methods if defined.
46
- */
47
43
  export declare function start(...objs: any[]): Promise<void>;
48
- /**
49
- * Stop one or more {@link Startable}s, calling the `beforeStop` and
50
- * `afterStop` lifecycle methods if defined.
51
- */
52
44
  export declare function stop(...objs: any[]): Promise<void>;
53
45
  //# sourceMappingURL=startable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"startable.d.ts","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,WAAW,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;;OAIG;IACH,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnC;AAED,wBAAgB,WAAW,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,CAEvD;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1D;AAED;;;GAGG;AACH,wBAAsB,IAAI,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzD"}
1
+ {"version":3,"file":"startable.d.ts","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,WAAW,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;;OAIG;IACH,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnC;AAED,wBAAgB,WAAW,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,CAEvD;AAED,wBAAsB,KAAK,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1D;AAED,wBAAsB,IAAI,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzD"}
@@ -1,10 +1,6 @@
1
1
  export function isStartable(obj) {
2
2
  return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function';
3
3
  }
4
- /**
5
- * Start one or more {@link Startable}s, calling the `beforeStart` and
6
- * `afterStart` lifecycle methods if defined.
7
- */
8
4
  export async function start(...objs) {
9
5
  const startables = [];
10
6
  for (const obj of objs) {
@@ -26,10 +22,6 @@ export async function start(...objs) {
26
22
  }
27
23
  }));
28
24
  }
29
- /**
30
- * Stop one or more {@link Startable}s, calling the `beforeStop` and
31
- * `afterStop` lifecycle methods if defined.
32
- */
33
25
  export async function stop(...objs) {
34
26
  const startables = [];
35
27
  for (const obj of objs) {
@@ -1 +1 @@
1
- {"version":3,"file":"startable.js","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,WAAW,CAAE,GAAQ;IACnC,OAAO,GA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AAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,CAAC,CAAC,SAAS,EAAE,CAAA;QACrB,CAAC;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface",
3
- "version": "1.0.0-551622a96",
3
+ "version": "1.0.0-8e4fbe13a",
4
4
  "description": "The interface implemented by a libp2p node",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
@@ -47,98 +47,6 @@
47
47
  ".": {
48
48
  "types": "./dist/src/index.d.ts",
49
49
  "import": "./dist/src/index.js"
50
- },
51
- "./connection": {
52
- "types": "./dist/src/connection/index.d.ts",
53
- "import": "./dist/src/connection/index.js"
54
- },
55
- "./connection-encrypter": {
56
- "types": "./dist/src/connection-encrypter/index.d.ts",
57
- "import": "./dist/src/connection-encrypter/index.js"
58
- },
59
- "./connection-gater": {
60
- "types": "./dist/src/connection-gater/index.d.ts",
61
- "import": "./dist/src/connection-gater/index.js"
62
- },
63
- "./content-routing": {
64
- "types": "./dist/src/content-routing/index.d.ts",
65
- "import": "./dist/src/content-routing/index.js"
66
- },
67
- "./errors": {
68
- "types": "./dist/src/errors.d.ts",
69
- "import": "./dist/src/errors.js"
70
- },
71
- "./events": {
72
- "types": "./dist/src/events.d.ts",
73
- "import": "./dist/src/events.js"
74
- },
75
- "./keychain": {
76
- "types": "./dist/src/keychain/index.d.ts",
77
- "import": "./dist/src/keychain/index.js"
78
- },
79
- "./keys": {
80
- "types": "./dist/src/keys/index.d.ts",
81
- "import": "./dist/src/keys/index.js"
82
- },
83
- "./metrics": {
84
- "types": "./dist/src/metrics/index.d.ts",
85
- "import": "./dist/src/metrics/index.js"
86
- },
87
- "./metrics/tracked-map": {
88
- "types": "./dist/src/metrics/tracked-map.d.ts",
89
- "import": "./dist/src/metrics/tracked-map.js"
90
- },
91
- "./peer-discovery": {
92
- "types": "./dist/src/peer-discovery/index.d.ts",
93
- "import": "./dist/src/peer-discovery/index.js"
94
- },
95
- "./peer-id": {
96
- "types": "./dist/src/peer-id/index.d.ts",
97
- "import": "./dist/src/peer-id/index.js"
98
- },
99
- "./peer-info": {
100
- "types": "./dist/src/peer-info/index.d.ts",
101
- "import": "./dist/src/peer-info/index.js"
102
- },
103
- "./peer-routing": {
104
- "types": "./dist/src/peer-routing/index.d.ts",
105
- "import": "./dist/src/peer-routing/index.js"
106
- },
107
- "./peer-store": {
108
- "types": "./dist/src/peer-store/index.d.ts",
109
- "import": "./dist/src/peer-store/index.js"
110
- },
111
- "./peer-store/tags": {
112
- "types": "./dist/src/peer-store/tags.d.ts",
113
- "import": "./dist/src/peer-store/tags.js"
114
- },
115
- "./pubsub": {
116
- "types": "./dist/src/pubsub/index.d.ts",
117
- "import": "./dist/src/pubsub/index.js"
118
- },
119
- "./record": {
120
- "types": "./dist/src/record/index.d.ts",
121
- "import": "./dist/src/record/index.js"
122
- },
123
- "./startable": {
124
- "types": "./dist/src/startable.d.ts",
125
- "import": "./dist/src/startable.js"
126
- },
127
- "./stream-handler": {
128
- "types": "./dist/src/stream-handler/index.d.ts",
129
- "import": "./dist/src/stream-handler/index.js"
130
- },
131
- "./stream-muxer": {
132
- "types": "./dist/src/stream-muxer/index.d.ts",
133
- "import": "./dist/src/stream-muxer/index.js"
134
- },
135
- "./stream-muxer/stream": {
136
- "types": "./dist/src/stream-muxer/stream.d.ts",
137
- "import": "./dist/src/stream-muxer/stream.js"
138
- },
139
- "./transport": {
140
- "types": "./dist/src/transport/index.d.ts",
141
- "import": "./dist/src/transport/index.js"
142
50
  }
143
51
  },
144
52
  "eslintConfig": {
@@ -10,10 +10,10 @@ import type { CID } from 'multiformats/cid'
10
10
  * @example
11
11
  *
12
12
  * ```js
13
- * import { contentRouting, ContentRouting } from '@libp2p/content-routing'
13
+ * import { contentRoutingSymbol, ContentRouting } from '@libp2p/content-routing'
14
14
  *
15
15
  * class MyContentRouter implements ContentRouting {
16
- * get [contentRouting] () {
16
+ * get [contentRoutingSymbol] () {
17
17
  * return this
18
18
  * }
19
19
  *
package/src/errors.ts CHANGED
@@ -18,10 +18,6 @@ export class AbortError extends Error {
18
18
  static readonly type = 'aborted'
19
19
  }
20
20
 
21
- /**
22
- * An {@see Error } subclass that defines a `.code` property that calling code
23
- * can use to detect what type of error has been thrown and act accordingly.
24
- */
25
21
  export class CodeError<T extends Record<string, any> = Record<string, never>> extends Error {
26
22
  public readonly props: T
27
23
 
@@ -59,22 +55,20 @@ export class InvalidCryptoExchangeError extends Error {
59
55
  static readonly code = 'ERR_INVALID_CRYPTO_EXCHANGE'
60
56
  }
61
57
 
62
- /**
63
- * A generic error code indicating that a timeout occurred
64
- */
65
- export const ERR_TIMEOUT = 'ERR_TIMEOUT'
58
+ export class InvalidCryptoTransmissionError extends Error {
59
+ public code: string
66
60
 
67
- /**
68
- * A generic error code indicating that invalid paramters were passed
69
- */
70
- export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'
61
+ constructor (message = 'Invalid crypto transmission') {
62
+ super(message)
63
+ this.code = InvalidCryptoTransmissionError.code
64
+ }
71
65
 
72
- /**
73
- * A generic error code indicating that something was not found
74
- */
75
- export const ERR_NOT_FOUND = 'ERR_NOT_FOUND'
66
+ static readonly code = 'ERR_INVALID_CRYPTO_TRANSMISSION'
67
+ }
76
68
 
77
- /**
78
- * A generic error code indicating that the message was invalid
79
- */
69
+ // Error codes
70
+
71
+ export const ERR_TIMEOUT = 'ERR_TIMEOUT'
72
+ export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'
73
+ export const ERR_NOT_FOUND = 'ERR_NOT_FOUND'
80
74
  export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE'
package/src/startable.ts CHANGED
@@ -49,10 +49,6 @@ export function isStartable (obj: any): obj is Startable {
49
49
  return obj != null && typeof obj.start === 'function' && typeof obj.stop === 'function'
50
50
  }
51
51
 
52
- /**
53
- * Start one or more {@link Startable}s, calling the `beforeStart` and
54
- * `afterStart` lifecycle methods if defined.
55
- */
56
52
  export async function start (...objs: any[]): Promise<void> {
57
53
  const startables: Startable[] = []
58
54
 
@@ -85,10 +81,6 @@ export async function start (...objs: any[]): Promise<void> {
85
81
  )
86
82
  }
87
83
 
88
- /**
89
- * Stop one or more {@link Startable}s, calling the `beforeStop` and
90
- * `afterStop` lifecycle methods if defined.
91
- */
92
84
  export async function stop (...objs: any[]): Promise<void> {
93
85
  const startables: Startable[] = []
94
86
 
@@ -1,3 +0,0 @@
1
- export type AbstractStreamInit = any;
2
- export declare const AbstractStream: any;
3
- //# sourceMappingURL=stream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAEpC,eAAO,MAAM,cAAc,KAAmB,CAAA"}
@@ -1,9 +0,0 @@
1
- // TODO: remove this file and the dep-check override in package.json for
2
- // @libp2p/utils when yamux is updated.
3
- // This is a hack to defeat TypeScript trying to inspect the types for
4
- // @libp2p/utils/abstract-stream which depends on this module - making the
5
- // import path only resolvable at runtime breaks the transpile time circular
6
- // dependency
7
- const s = await import('@libp2p/utils' + '/abstract-stream');
8
- export const AbstractStream = s.AbstractStream;
9
- //# sourceMappingURL=stream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../src/stream-muxer/stream.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,uCAAuC;AACvC,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,aAAa;AACb,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,eAAe,GAAG,kBAAkB,CAAC,CAAA;AAI5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,cAAc,CAAA"}
@@ -1,11 +0,0 @@
1
- // TODO: remove this file and the dep-check override in package.json for
2
- // @libp2p/utils when yamux is updated.
3
- // This is a hack to defeat TypeScript trying to inspect the types for
4
- // @libp2p/utils/abstract-stream which depends on this module - making the
5
- // import path only resolvable at runtime breaks the transpile time circular
6
- // dependency
7
- const s = await import('@libp2p/utils' + '/abstract-stream')
8
-
9
- export type AbstractStreamInit = any
10
-
11
- export const AbstractStream = s.AbstractStream