@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.
- package/dist/@types.d.ts +6 -0
- package/dist/@types.js +2 -0
- package/dist/@types.js.map +1 -0
- package/dist/attente.d.ts +10 -0
- package/dist/attente.js +113 -0
- package/dist/attente.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +84 -0
- package/dist/config.js.map +1 -0
- package/dist/constellation.d.ts +17 -0
- package/dist/constellation.js +32 -0
- package/dist/constellation.js.map +1 -0
- package/dist/dossiers.d.ts +4 -0
- package/dist/dossiers.js +37 -0
- package/dist/dossiers.js.map +1 -0
- package/dist/h/303/251lia.d.ts +9 -0
- package/dist/h/303/251lia.js +40 -0
- package/dist/h/303/251lia.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/libp2p/config.d.ts +27 -0
- package/dist/libp2p/config.js +89 -0
- package/dist/libp2p/config.js.map +1 -0
- package/dist/libp2p/index.d.ts +3 -0
- package/dist/libp2p/index.js +4 -0
- package/dist/libp2p/index.js.map +1 -0
- package/dist/libp2p/libp2p.d.ts +9 -0
- package/dist/libp2p/libp2p.js +21 -0
- package/dist/libp2p/libp2p.js.map +1 -0
- package/dist/libp2p/utils.d.ts +10 -0
- package/dist/libp2p/utils.js +55 -0
- package/dist/libp2p/utils.js.map +1 -0
- package/dist/orbite.d.ts +9 -0
- package/dist/orbite.js +35 -0
- package/dist/orbite.js.map +1 -0
- package/dist/relai/bin.d.ts +1 -0
- package/dist/relai/bin.js +82 -0
- package/dist/relai/bin.js.map +1 -0
- package/dist/relai/consts.d.ts +3 -0
- package/dist/relai/consts.js +4 -0
- package/dist/relai/consts.js.map +1 -0
- package/dist/relai/index.d.ts +3 -0
- package/dist/relai/index.js +4 -0
- package/dist/relai/index.js.map +1 -0
- package/dist/relai/relai.d.ts +5 -0
- package/dist/relai/relai.js +29 -0
- package/dist/relai/relai.js.map +1 -0
- package/dist/relai/utils.d.ts +4 -0
- package/dist/relai/utils.js +6 -0
- package/dist/relai/utils.js.map +1 -0
- package/dist/scripts/node-globals.d.ts +2 -0
- package/dist/scripts/node-globals.js +4 -0
- package/dist/scripts/node-globals.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +5 -0
- package/dist/utils.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +40 -36
- package/pnpm-workspace.yaml +4 -0
- package/src/@types.ts +1 -1
- package/src/attente.ts +2 -2
- package/src/constellation.ts +1 -1
- package/src/h/303/251lia.ts +30 -38
- package/src/index.ts +2 -2
- package/src/libp2p/config.ts +9 -5
- package/src/libp2p/index.ts +2 -2
- package/src/libp2p/libp2p.ts +2 -2
- package/src/libp2p/utils.ts +5 -5
- package/src/orbite.ts +2 -8
- package/src/relai/relai.ts +1 -1
- package/src/relai/utils.ts +1 -1
- package/src/version.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +1 -0
package/src/libp2p/config.ts
CHANGED
|
@@ -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 {
|
|
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;
|
package/src/libp2p/index.ts
CHANGED
package/src/libp2p/libp2p.ts
CHANGED
|
@@ -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";
|
package/src/libp2p/utils.ts
CHANGED
|
@@ -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;
|
package/src/relai/relai.ts
CHANGED
package/src/relai/utils.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version =
|
|
2
|
+
export const version = '2.2.0';
|