@constl/utils-tests 1.4.2 → 1.6.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 (62) hide show
  1. package/dist/@types.js.map +1 -0
  2. package/dist/{src/attente.js → attente.js} +1 -1
  3. package/dist/attente.js.map +1 -0
  4. package/dist/{src/config.js → config.js} +0 -1
  5. package/dist/config.js.map +1 -0
  6. package/dist/constellation.js.map +1 -0
  7. package/dist/{src/dossiers.js → dossiers.js} +1 -1
  8. package/dist/dossiers.js.map +1 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/libp2p.d.ts +36 -0
  11. package/dist/libp2p.js +82 -0
  12. package/dist/libp2p.js.map +1 -0
  13. package/dist/{src/orbite.d.ts → orbite.d.ts} +6 -5
  14. package/dist/{src/orbite.js → orbite.js} +37 -4
  15. package/dist/orbite.js.map +1 -0
  16. package/dist/scripts/node-globals.js.map +1 -0
  17. package/dist/{src/scripts → scripts}/relai.js +15 -10
  18. package/dist/scripts/relai.js.map +1 -0
  19. package/dist/{src/sfip.d.ts → sfip.d.ts} +2 -5
  20. package/dist/{src/sfip.js → sfip.js} +7 -3
  21. package/dist/sfip.js.map +1 -0
  22. package/dist/tsconfig.build.tsbuildinfo +1 -1
  23. package/dist/version.d.ts +1 -0
  24. package/dist/version.js +3 -0
  25. package/dist/version.js.map +1 -0
  26. package/package.json +50 -45
  27. package/src/@types/shims-orbitdb-quickstart.d.ts +1 -15
  28. package/src/attente.ts +1 -1
  29. package/src/config.ts +0 -1
  30. package/src/dossiers.ts +1 -1
  31. package/src/libp2p.ts +84 -0
  32. package/src/orbite.ts +67 -20
  33. package/src/scripts/relai.ts +16 -10
  34. package/src/sfip.ts +10 -9
  35. package/src/version.ts +1 -1
  36. package/tsconfig.build.json +1 -1
  37. package/dist/src/@types.js.map +0 -1
  38. package/dist/src/attente.js.map +0 -1
  39. package/dist/src/config.js.map +0 -1
  40. package/dist/src/constellation.js.map +0 -1
  41. package/dist/src/dossiers.js.map +0 -1
  42. package/dist/src/index.js.map +0 -1
  43. package/dist/src/orbite.js.map +0 -1
  44. package/dist/src/scripts/node-globals.js.map +0 -1
  45. package/dist/src/scripts/relai.js.map +0 -1
  46. package/dist/src/sfip.js.map +0 -1
  47. package/dist/src/version.d.ts +0 -1
  48. package/dist/src/version.js +0 -3
  49. package/dist/src/version.js.map +0 -1
  50. package/src/@types/shims-orbitdb-core.d.ts +0 -242
  51. /package/dist/{src/@types.d.ts → @types.d.ts} +0 -0
  52. /package/dist/{src/@types.js → @types.js} +0 -0
  53. /package/dist/{src/attente.d.ts → attente.d.ts} +0 -0
  54. /package/dist/{src/config.d.ts → config.d.ts} +0 -0
  55. /package/dist/{src/constellation.d.ts → constellation.d.ts} +0 -0
  56. /package/dist/{src/constellation.js → constellation.js} +0 -0
  57. /package/dist/{src/dossiers.d.ts → dossiers.d.ts} +0 -0
  58. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  59. /package/dist/{src/index.js → index.js} +0 -0
  60. /package/dist/{src/scripts → scripts}/node-globals.d.ts +0 -0
  61. /package/dist/{src/scripts → scripts}/node-globals.js +0 -0
  62. /package/dist/{src/scripts → scripts}/relai.d.ts +0 -0
@@ -1 +0,0 @@
1
- export declare const version = "1.4.2";
@@ -1,3 +0,0 @@
1
- // Generated by genversion.
2
- export const version = "1.4.2";
3
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
@@ -1,242 +0,0 @@
1
- declare module "@orbitdb/core" {
2
- import EventEmitter from "events";
3
- import type { IPFS } from "ipfs-core";
4
-
5
- export function Database(args: {
6
- ipfs: IPFS;
7
- identity?: Identity;
8
- address: string;
9
- name?: string;
10
- access?: AccessController;
11
- directory?: string;
12
- meta?: object;
13
- headsStorage?: Storage;
14
- entryStorage?: Storage;
15
- indexStorage?: Storage;
16
- referencesCount?: number;
17
- syncAutomatically?: boolean;
18
- onUpdate?: () => void;
19
- }): Promise<{
20
- type: string;
21
- addOperation: (args: {
22
- op: string;
23
- key: string | null;
24
- value: unknown;
25
- }) => Promise<string>;
26
- address: string;
27
- close(): Promise<void>;
28
- drop(): Promise<void>;
29
- events: EventEmitter;
30
- access: AccessController;
31
- log: Log;
32
- }>;
33
-
34
- export type Identity = {
35
- id: string;
36
- publicKey: string;
37
- signatures: {
38
- id: string;
39
- publicKey: string;
40
- };
41
- type: string;
42
- sign: (identity: Identity, data: string) => Promise<string>;
43
- verify: (
44
- signature: string,
45
- publicKey: string,
46
- data: string,
47
- ) => Promise<boolean>;
48
- };
49
-
50
- export type OrbitDB = {
51
- id: string;
52
- open: (
53
- address: string,
54
- OrbitDBDatabaseOptions?,
55
- ) => ReturnType<typeof Database>;
56
- stop;
57
- ipfs;
58
- directory;
59
- keystore;
60
- identity: Identity;
61
- peerId;
62
- };
63
- export function createOrbitDB(args: {
64
- ipfs: IPFS;
65
- directory: string;
66
- }): Promise<OrbitDB>;
67
-
68
- export function useAccessController(accessController: { type: string }): void;
69
- export function isValidAddress(address: unknown): boolean;
70
-
71
- export type Log = {
72
- id;
73
- clock: Clock;
74
- heads: () => Promise<Entry[]>;
75
- traverse: () => AsyncGenerator<Entry, void, unknown>;
76
- };
77
- export type Identity = {
78
- id: string;
79
- publicKey: object;
80
- sigantures: object;
81
- type: string;
82
- sign: () => string;
83
- verify: () => boolean;
84
- };
85
-
86
- export function AccessControllerGenerator({
87
- orbitdb,
88
- identities,
89
- address,
90
- }: {
91
- orbitdb: OrbitDB;
92
- identities: Identities;
93
- address?: string;
94
- }): Promise<AccessController>;
95
-
96
- export class AccessController {
97
- type: string;
98
- address: string;
99
- canAppend: (entry: Entry) => Promise<boolean>;
100
- }
101
-
102
- export function IPFSAccessController(args: {
103
- write: string[];
104
- storage: Storage;
105
- }): (args: {
106
- orbitdb: OrbitDB;
107
- identities: Identities;
108
- address: string;
109
- }) => Promise<{
110
- type: "ipfs";
111
- address: string;
112
- write: string[];
113
- canAppend: (entry: Entry) => Promise<boolean>;
114
- }>;
115
- export class Identities {
116
- getIdentity;
117
- verifyIdentity: (identity) => boolean;
118
- }
119
- export class Storage {
120
- put;
121
- get;
122
- }
123
- export function IPFSBlockStorage({
124
- ipfs: IPFS,
125
- pin: boolean,
126
- }): Promise<Storage>;
127
- export function LRUStorage({ size: number }): Promise<Storage>;
128
- export function ComposedStorage(...args: Storage[]): Promise<Storage>;
129
-
130
- export type OrbitDBDatabaseOptions = {
131
- type: string;
132
- AccessController: AccessControllerGenerator;
133
- };
134
-
135
- export type Clock = {
136
- id: string;
137
- time: number;
138
- };
139
-
140
- export type Entry<T = unknown> = {
141
- id: string;
142
- payload: { op: string; key: string | null; value?: T };
143
- next: string[];
144
- refs: string[];
145
- clock: Clock;
146
- v: integer;
147
- key: string;
148
- identity: string;
149
- sig: string;
150
- hash: string;
151
- };
152
-
153
- // Temporaires
154
- export type Store =
155
- | FeedStore
156
- | SetStore
157
- | KeyValueStore
158
- | OrderedKeyValueStore;
159
-
160
- export type FeedStore = Awaited<ReturnType<typeof Database>> & {
161
- remove: (hash: string) => Promise<string>;
162
- };
163
- export type FeedStoreTypé<T extends élémentsBd> = Omit<
164
- FeedStore,
165
- "add" | "all"
166
- > & {
167
- add: (value: T) => Promise<string>;
168
- all: () => Promise<
169
- {
170
- value: T;
171
- hash: string;
172
- }[]
173
- >;
174
- };
175
-
176
- export type SetDatabase = ReturnType<typeof Database>;
177
- export type SetStore = Awaited<SetDatabase>;
178
- export type SetStoreTypé<T extends élémentsBd> = Omit<
179
- SetStore,
180
- "put" | "set" | "del" | "all"
181
- > & {
182
- put: (value: T) => Promise<string>;
183
- set: SetStoreTypé<T>["put"];
184
- del: (value: T) => Promise<string>;
185
- all: () => Promise<
186
- {
187
- value: T;
188
- hash: string;
189
- }[]
190
- >;
191
- };
192
-
193
- export type OrderedKeyValue = ReturnType<typeof Database>;
194
- export type OrderedKeyValueStore = Awaited<OrderedKeyValue>;
195
- export type OrderedKeyValueStoreTypé<T extends { [clef: string]: unknown }> =
196
- Omit<
197
- OrderedKeyValueStore,
198
- "put" | "set" | "del" | "move" | "get" | "all"
199
- > & {
200
- put: <K extends keyof T>(
201
- key: K,
202
- value: T[K],
203
- position?: number,
204
- ) => Promise<string>;
205
- set: OrderedKeyValueStoreTypé<T>["put"];
206
- del: <K extends keyof T>(key: K) => Promise<string>;
207
- move: <K extends keyof T>(key: K, position: number) => Promise<string>;
208
- get: <K extends keyof T>(key: K) => Promise<T[K] | undefined>;
209
- all: () => Promise<
210
- {
211
- key: keyof T;
212
- value: T[keyof T];
213
- hash: string;
214
- }[]
215
- >;
216
- };
217
-
218
- export type KeyValueStore = {
219
- type: "keyvalue";
220
- address: string;
221
- put(key: string, value: unknown): Promise<string>;
222
- set: KeyValueStore["put"];
223
- del(key: string): Promise<string>;
224
- get(key: string): Promise<unknown | undefined>;
225
- all(): Promise<{ key: string; value: unknown; hash: string }[]>;
226
- close(): Promise<void>;
227
- drop(): Promise<void>;
228
- events: EventEmitter;
229
- access: AccessController;
230
- log: Log;
231
- };
232
- export type KeyValueStoreTypé<T extends { [clef: string]: unknown }> = Omit<
233
- KeyValueStore,
234
- "put" | "set" | "del" | "get" | "all"
235
- > & {
236
- put<K extends keyof T>(key: K, value: T[K]): Promise<string>;
237
- set: KeyValueStoreTypé<T>["put"];
238
- del<K extends keyof T>(key: K): Promise<string>;
239
- get<K extends keyof T>(key: K): Promise<T[K] | undefined>;
240
- all(): Promise<T>;
241
- };
242
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes