@constl/utils-tests 2.1.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/@types.d.ts +6 -0
  2. package/dist/@types.js +2 -0
  3. package/dist/@types.js.map +1 -0
  4. package/dist/attente.d.ts +10 -0
  5. package/dist/attente.js +113 -0
  6. package/dist/attente.js.map +1 -0
  7. package/dist/config.d.ts +7 -0
  8. package/dist/config.js +84 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/constellation.d.ts +17 -0
  11. package/dist/constellation.js +32 -0
  12. package/dist/constellation.js.map +1 -0
  13. package/dist/dossiers.d.ts +4 -0
  14. package/dist/dossiers.js +37 -0
  15. package/dist/dossiers.js.map +1 -0
  16. package/dist/h/303/251lia.d.ts +9 -0
  17. package/dist/h/303/251lia.js +40 -0
  18. package/dist/h/303/251lia.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.js +9 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/libp2p/config.d.ts +27 -0
  23. package/dist/libp2p/config.js +89 -0
  24. package/dist/libp2p/config.js.map +1 -0
  25. package/dist/libp2p/index.d.ts +3 -0
  26. package/dist/libp2p/index.js +4 -0
  27. package/dist/libp2p/index.js.map +1 -0
  28. package/dist/libp2p/libp2p.d.ts +9 -0
  29. package/dist/libp2p/libp2p.js +21 -0
  30. package/dist/libp2p/libp2p.js.map +1 -0
  31. package/dist/libp2p/utils.d.ts +10 -0
  32. package/dist/libp2p/utils.js +55 -0
  33. package/dist/libp2p/utils.js.map +1 -0
  34. package/dist/orbite.d.ts +9 -0
  35. package/dist/orbite.js +35 -0
  36. package/dist/orbite.js.map +1 -0
  37. package/dist/relai/bin.d.ts +1 -0
  38. package/dist/relai/bin.js +82 -0
  39. package/dist/relai/bin.js.map +1 -0
  40. package/dist/relai/consts.d.ts +3 -0
  41. package/dist/relai/consts.js +4 -0
  42. package/dist/relai/consts.js.map +1 -0
  43. package/dist/relai/index.d.ts +3 -0
  44. package/dist/relai/index.js +4 -0
  45. package/dist/relai/index.js.map +1 -0
  46. package/dist/relai/relai.d.ts +5 -0
  47. package/dist/relai/relai.js +29 -0
  48. package/dist/relai/relai.js.map +1 -0
  49. package/dist/relai/utils.d.ts +4 -0
  50. package/dist/relai/utils.js +6 -0
  51. package/dist/relai/utils.js.map +1 -0
  52. package/dist/scripts/node-globals.d.ts +2 -0
  53. package/dist/scripts/node-globals.js +4 -0
  54. package/dist/scripts/node-globals.js.map +1 -0
  55. package/dist/utils.d.ts +4 -0
  56. package/dist/utils.js +5 -0
  57. package/dist/utils.js.map +1 -0
  58. package/dist/version.d.ts +1 -0
  59. package/dist/version.js +3 -0
  60. package/dist/version.js.map +1 -0
  61. package/package.json +40 -36
  62. package/pnpm-workspace.yaml +4 -0
  63. package/src/@types.ts +1 -1
  64. package/src/attente.ts +2 -2
  65. package/src/constellation.ts +1 -1
  66. package/src/h/303/251lia.ts +30 -38
  67. package/src/index.ts +2 -2
  68. package/src/libp2p/config.ts +9 -5
  69. package/src/libp2p/index.ts +2 -2
  70. package/src/libp2p/libp2p.ts +2 -2
  71. package/src/libp2p/utils.ts +5 -5
  72. package/src/orbite.ts +2 -8
  73. package/src/relai/relai.ts +1 -1
  74. package/src/relai/utils.ts +1 -1
  75. package/src/version.ts +1 -1
  76. package/tsconfig.build.tsbuildinfo +1 -1
  77. package/tsconfig.json +1 -0
@@ -24,18 +24,22 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
24
  SOFTWARE.
25
25
  */
26
26
 
27
- import { gossipsub, GossipSubComponents, GossipSub } from "@libp2p/gossipsub";
27
+ import {
28
+ gossipsub,
29
+ type GossipSubComponents,
30
+ type GossipSub,
31
+ } from "@libp2p/gossipsub";
28
32
  import { noise } from "@chainsafe/libp2p-noise";
29
33
  import { yamux } from "@chainsafe/libp2p-yamux";
30
34
  import { circuitRelayTransport } from "@libp2p/circuit-relay-v2";
31
- import { Identify, identify } from "@libp2p/identify";
35
+ import { type Identify, identify } from "@libp2p/identify";
32
36
  import { webRTC } from "@libp2p/webrtc";
33
37
  import { webSockets } from "@libp2p/websockets";
34
38
 
35
- import { Libp2pOptions } from "libp2p";
39
+ import { type Libp2pOptions } from "libp2p";
36
40
 
37
- import { PrivateKey } from "@libp2p/interface";
38
- import { ping, Ping } from "@libp2p/ping";
41
+ import { type PrivateKey } from "@libp2p/interface";
42
+ import { ping, type Ping } from "@libp2p/ping";
39
43
 
40
44
  export type ServicesLibp2pTest = {
41
45
  ping: Ping;
@@ -1,6 +1,6 @@
1
1
  export {
2
- ServicesLibp2pTest,
3
- ComposantesServiceClefPrivée,
2
+ type ServicesLibp2pTest,
3
+ type ComposantesServiceClefPrivée,
4
4
  ServiceClefPrivée,
5
5
  OptionsDéfautLibp2pNode,
6
6
  OptionsDéfautLibp2pNavigateur,
@@ -1,9 +1,9 @@
1
- import { Libp2p } from "@libp2p/interface";
1
+ import type { Libp2p } from "@libp2p/interface";
2
2
  import { createLibp2p } from "libp2p";
3
3
  import {
4
4
  OptionsDéfautLibp2pNavigateur,
5
5
  OptionsDéfautLibp2pNode,
6
- ServicesLibp2pTest,
6
+ type ServicesLibp2pTest,
7
7
  } from "./config.js";
8
8
  import { isBrowser } from "wherearewe";
9
9
  import { connecterPairs } from "./utils.js";
@@ -1,8 +1,8 @@
1
- import { Libp2p } from "@libp2p/interface";
1
+ import type { Libp2p } from "@libp2p/interface";
2
2
  import { WebRTC } from "@multiformats/multiaddr-matcher";
3
- import { multiaddr, Multiaddr } from "@multiformats/multiaddr";
3
+ import { multiaddr, type Multiaddr } from "@multiformats/multiaddr";
4
4
  import { isBrowser, isElectronRenderer } from "wherearewe";
5
- import { ServicesLibp2pTest } from "./config.js";
5
+ import type { ServicesLibp2pTest } from "./config.js";
6
6
 
7
7
  const filtreParDéfaut = () => true;
8
8
 
@@ -16,7 +16,7 @@ export const connecterPairs = async <
16
16
  libp2p1: T,
17
17
  libp2p2: T,
18
18
  options: OptionsConnectionPairs,
19
- ) => {
19
+ ): Promise<void> => {
20
20
  const filtre = options.filtre ?? filtreParDéfaut;
21
21
 
22
22
  if (isBrowser || isElectronRenderer) {
@@ -62,7 +62,7 @@ export const connecterPairs = async <
62
62
  export const toutesConnectées = async (
63
63
  libp2ps: Libp2p<ServicesLibp2pTest>[],
64
64
  options: OptionsConnectionPairs,
65
- ) => {
65
+ ): Promise<void> => {
66
66
  const connectées: Libp2p<ServicesLibp2pTest>[] = [];
67
67
  for (const lib of libp2ps) {
68
68
  for (const autre of connectées) {
package/src/orbite.ts CHANGED
@@ -1,25 +1,20 @@
1
- import { OrbitDB, createOrbitDB } from "@orbitdb/core";
1
+ import { type OrbitDB, createOrbitDB } from "@orbitdb/core";
2
2
  import { dossierTempo } from "./dossiers.js";
3
- import { ServicesLibp2pTest } from "./libp2p/index.js";
3
+ import { type ServicesLibp2pTest } from "./libp2p/index.js";
4
4
  import { créerHéliasTest } from "./hélia.js";
5
5
  import { join } from "path";
6
6
  import { sousDossier } from "./utils.js";
7
- import { obtenirAdresseRelai } from "./relai/utils.js";
8
7
 
9
8
  export const créerOrbitesTest = async ({
10
9
  n,
11
10
  dossier,
12
- adresseRelai,
13
11
  }: {
14
12
  n: number;
15
13
  dossier?: string;
16
- adresseRelai?: string;
17
14
  }): Promise<{
18
15
  orbites: OrbitDB<ServicesLibp2pTest>[];
19
16
  fermer: () => Promise<void>;
20
17
  }> => {
21
- adresseRelai = adresseRelai ?? obtenirAdresseRelai();
22
-
23
18
  let effacerDossier: () => void = () => {};
24
19
  if (!dossier) {
25
20
  ({ dossier, effacer: effacerDossier } = await dossierTempo());
@@ -29,7 +24,6 @@ export const créerOrbitesTest = async ({
29
24
  const { hélias, fermer: fermerHélias } = await créerHéliasTest({
30
25
  n,
31
26
  dossier,
32
- adresseRelai,
33
27
  });
34
28
 
35
29
  let i = 0;
@@ -13,7 +13,7 @@ export const lancerRelai = async ({
13
13
  }: {
14
14
  portDéfautRelai?: string;
15
15
  clefPrivéeRelai?: string;
16
- } = {}) => {
16
+ } = {}): Promise<() => void> => {
17
17
  const { execa } = await import("execa");
18
18
 
19
19
  const fichierRelai = await obtenirFichierRelai();
@@ -11,4 +11,4 @@ export const obtenirAdresseRelai = (
11
11
  portRelai: PORT_DÉFAUT_RELAI,
12
12
  idRelai: ID_DÉFAUT_RELAI,
13
13
  },
14
- ) => `/ip4/127.0.0.1/tcp/${portRelai}/ws/p2p/${idRelai}`;
14
+ ): string => `/ip4/127.0.0.1/tcp/${portRelai}/ws/p2p/${idRelai}`;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = "2.1.4";
2
+ export const version = '2.2.0';