@fireproof/core 0.3.13 → 0.3.15
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/src/index.d.ts +321 -6
- package/dist/{bundle.js → src/index.js} +500 -1031
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.mjs +1610 -0
- package/dist/src/index.mjs.map +1 -0
- package/hooks/use-fireproof.js +135 -0
- package/package.json +19 -21
- package/src/blockstore.js +10 -5
- package/src/clock.js +31 -16
- package/src/db-index.js +2 -7
- package/src/fireproof.js +13 -8
- package/src/listener.js +26 -13
- package/src/prolly.js +25 -22
- package/src/valet.js +6 -4
- package/dist/src/blockstore.d.ts +0 -115
- package/dist/src/blockstore.d.ts.map +0 -1
- package/dist/src/clock.d.ts +0 -98
- package/dist/src/clock.d.ts.map +0 -1
- package/dist/src/crypto.d.ts +0 -18
- package/dist/src/crypto.d.ts.map +0 -1
- package/dist/src/db-index.d.ts +0 -116
- package/dist/src/db-index.d.ts.map +0 -1
- package/dist/src/fireproof.d.ts +0 -167
- package/dist/src/fireproof.d.ts.map +0 -1
- package/dist/src/hydrator.d.ts +0 -6
- package/dist/src/hydrator.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/listener.d.ts +0 -36
- package/dist/src/listener.d.ts.map +0 -1
- package/dist/src/prolly.d.ts +0 -83
- package/dist/src/prolly.d.ts.map +0 -1
- package/dist/src/sha1.d.ts +0 -9
- package/dist/src/sha1.d.ts.map +0 -1
- package/dist/src/valet.d.ts +0 -34
- package/dist/src/valet.d.ts.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/src/clock.d.ts
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @template T
|
3
|
-
* @typedef {{ parents: EventLink<T>[], data: T }} EventView
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @template T
|
7
|
-
* @typedef {import('multiformats').BlockView<EventView<T>>} EventBlockView
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @template T
|
11
|
-
* @typedef {import('multiformats').Link<EventView<T>>} EventLink
|
12
|
-
*/
|
13
|
-
/**
|
14
|
-
* Advance the clock by adding an event.
|
15
|
-
*
|
16
|
-
* @template T
|
17
|
-
* @param {import('./blockstore').BlockFetcher} blocks Block storage.
|
18
|
-
* @param {EventLink<T>[]} head The head of the clock.
|
19
|
-
* @param {EventLink<T>} event The event to add.
|
20
|
-
* @returns {Promise<EventLink<T>[]>} The new head of the clock.
|
21
|
-
*/
|
22
|
-
export function advance<T>(blocks: any, head: import("multiformats/dist/types/src").Link<EventView<T>, number, number, 1>[], event: import("multiformats/dist/types/src").Link<EventView<T>, number, number, 1>): Promise<import("multiformats/dist/types/src").Link<EventView<T>, number, number, 1>[]>;
|
23
|
-
/**
|
24
|
-
* @template T
|
25
|
-
* @param {EventView<T>} value
|
26
|
-
* @returns {Promise<EventBlockView<T>>}
|
27
|
-
*/
|
28
|
-
export function encodeEventBlock<T>(value: EventView<T>): Promise<import("multiformats/dist/types/src").BlockView<EventView<T>, number, number, 1>>;
|
29
|
-
/**
|
30
|
-
* @template T
|
31
|
-
* @param {Uint8Array} bytes
|
32
|
-
* @returns {Promise<EventBlockView<T>>}
|
33
|
-
*/
|
34
|
-
export function decodeEventBlock<T>(bytes: Uint8Array): Promise<import("multiformats/dist/types/src").BlockView<EventView<T>, number, number, 1>>;
|
35
|
-
/**
|
36
|
-
* @template T
|
37
|
-
* @param {import('./blockstore').BlockFetcher} blocks Block storage.
|
38
|
-
* @param {EventLink<T>[]} head
|
39
|
-
* @param {object} [options]
|
40
|
-
* @param {(b: EventBlockView<T>) => string} [options.renderNodeLabel]
|
41
|
-
*/
|
42
|
-
export function vis<T>(blocks: any, head: import("multiformats/dist/types/src").Link<EventView<T>, number, number, 1>[], options?: {
|
43
|
-
renderNodeLabel?: (b: import("multiformats/dist/types/src").BlockView<EventView<T>, number, number, 1>) => string;
|
44
|
-
}): AsyncGenerator<string, void, unknown>;
|
45
|
-
export function findEventsToSync(blocks: any, head: any): Promise<{
|
46
|
-
cids: any;
|
47
|
-
events: any;
|
48
|
-
}>;
|
49
|
-
export function findCommonAncestorWithSortedEvents(events: any, children: any): Promise<{
|
50
|
-
ancestor: import("multiformats/dist/types/src").Link<EventView<EventData>, number, number, 1>;
|
51
|
-
sorted: import("multiformats/dist/types/src").BlockView<EventView<EventData>, number, number, 1>[];
|
52
|
-
}>;
|
53
|
-
/**
|
54
|
-
* @template T
|
55
|
-
* @implements {EventBlockView<T>}
|
56
|
-
*/
|
57
|
-
export class EventBlock<T> extends Block<any, any, any, any> implements EventBlockView<T> {
|
58
|
-
/**
|
59
|
-
* @template T
|
60
|
-
* @param {T} data
|
61
|
-
* @param {EventLink<T>[]} [parents]
|
62
|
-
*/
|
63
|
-
static create<T_1>(data: T_1, parents?: import("multiformats/dist/types/src").Link<EventView<T_1>, number, number, 1>[]): Promise<import("multiformats/dist/types/src").BlockView<EventView<T_1>, number, number, 1>>;
|
64
|
-
/**
|
65
|
-
* @param {object} config
|
66
|
-
* @param {EventLink<T>} config.cid
|
67
|
-
* @param {Event} config.value
|
68
|
-
* @param {Uint8Array} config.bytes
|
69
|
-
*/
|
70
|
-
constructor({ cid, value, bytes }: {
|
71
|
-
cid: EventLink<T>;
|
72
|
-
value: Event;
|
73
|
-
bytes: Uint8Array;
|
74
|
-
});
|
75
|
-
}
|
76
|
-
/** @template T */
|
77
|
-
export class EventFetcher<T> {
|
78
|
-
/** @param {import('./blockstore').BlockFetcher} blocks */
|
79
|
-
constructor(blocks: any);
|
80
|
-
/** @private */
|
81
|
-
private _blocks;
|
82
|
-
_cids: any;
|
83
|
-
_cache: Map<any, any>;
|
84
|
-
/**
|
85
|
-
* @param {EventLink<T>} link
|
86
|
-
* @returns {Promise<EventBlockView<T>>}
|
87
|
-
*/
|
88
|
-
get(link: EventLink<T>): Promise<EventBlockView<T>>;
|
89
|
-
all(): Promise<any>;
|
90
|
-
}
|
91
|
-
export type EventView<T> = {
|
92
|
-
parents: EventLink<T>[];
|
93
|
-
data: T;
|
94
|
-
};
|
95
|
-
export type EventBlockView<T> = import('multiformats').BlockView<EventView<T>>;
|
96
|
-
export type EventLink<T> = import('multiformats').Link<EventView<T>>;
|
97
|
-
import { Block } from 'multiformats/block';
|
98
|
-
//# sourceMappingURL=clock.d.ts.map
|
package/dist/src/clock.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/clock.js"],"names":[],"mappings":"AAMA;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;;GAQG;AACH,ySAgCC;AA4DD;;;;GAIG;AACH,oJAKC;AAED;;;;GAIG;AACH,2CAHW,UAAU,6FAOpB;AA0BD;;;;;;GAMG;AACH;+GAFqC,MAAM;0CAgC1C;AAED;;;GAYC;AAKD;;;GAYC;AA7KD;;;GAGG;AACH,uFAF+B,CAAC;IAc9B;;;;OAIG;IACH,sNAEC;IAlBD;;;;;OAKG;IACH;QAJgC,GAAG,EAAxB,UAAU,CAAC,CAAC;QACE,KAAK,EAAnB,KAAK;QACc,KAAK,EAAxB,UAAU;OAKpB;CAUF;AAED,kBAAkB;AAClB;IACE,0DAA0D;IAC1D,yBAKC;IAJC,eAAe;IACf,gBAAqB;IACrB,WAA6B;IAC7B,sBAAuB;IAGzB;;;OAGG;IACH,UAHW,UAAU,CAAC,CAAC,GACV,QAAQ,eAAe,CAAC,CAAC,CAAC,CAYtC;IAED,oBAGC;CACF;2BAhHY;IAAE,OAAO,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE;gCAKpC,OAAO,cAAc,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;2BAK9C,OAAO,cAAc,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;sBAjBhB,oBAAoB"}
|
package/dist/src/crypto.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
export function encrypt({ get, cids, hasher, key, cache, chunker, root }: {
|
2
|
-
get: any;
|
3
|
-
cids: any;
|
4
|
-
hasher: any;
|
5
|
-
key: any;
|
6
|
-
cache: any;
|
7
|
-
chunker: any;
|
8
|
-
root: any;
|
9
|
-
}): AsyncGenerator<any, void, unknown>;
|
10
|
-
export function decrypt({ root, get, key, cache, chunker, hasher }: {
|
11
|
-
root: any;
|
12
|
-
get: any;
|
13
|
-
key: any;
|
14
|
-
cache: any;
|
15
|
-
chunker: any;
|
16
|
-
hasher: any;
|
17
|
-
}): AsyncGenerator<any, void, undefined>;
|
18
|
-
//# sourceMappingURL=crypto.d.ts.map
|
package/dist/src/crypto.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.js"],"names":[],"mappings":"AAaA;;;;;;;;uCAuBC;AAED;;;;;;;yCAsBC"}
|
package/dist/src/db-index.d.ts
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Represents an DbIndex for a Fireproof database.
|
3
|
-
*
|
4
|
-
* @class DbIndex
|
5
|
-
* @classdesc An DbIndex can be used to order and filter the documents in a Fireproof database.
|
6
|
-
*
|
7
|
-
* @param {Fireproof} database - The Fireproof database instance to DbIndex.
|
8
|
-
* @param {Function} mapFn - The map function to apply to each entry in the database.
|
9
|
-
*
|
10
|
-
*/
|
11
|
-
export class DbIndex {
|
12
|
-
static registerWithDatabase(inIndex: any, database: any): void;
|
13
|
-
static fromJSON(database: any, { code, clock, name }: {
|
14
|
-
code: any;
|
15
|
-
clock: any;
|
16
|
-
name: any;
|
17
|
-
}): DbIndex;
|
18
|
-
constructor(database: any, mapFn: any, clock: any, opts?: {});
|
19
|
-
/**
|
20
|
-
* The database instance to DbIndex.
|
21
|
-
* @type {Fireproof}
|
22
|
-
*/
|
23
|
-
database: Fireproof;
|
24
|
-
mapFnString: any;
|
25
|
-
mapFn: any;
|
26
|
-
name: any;
|
27
|
-
indexById: {
|
28
|
-
root: any;
|
29
|
-
cid: any;
|
30
|
-
};
|
31
|
-
indexByKey: {
|
32
|
-
root: any;
|
33
|
-
cid: any;
|
34
|
-
};
|
35
|
-
dbHead: any;
|
36
|
-
instanceId: string;
|
37
|
-
updateIndexPromise: Promise<void>;
|
38
|
-
makeName(): any;
|
39
|
-
toJSON(): {
|
40
|
-
name: any;
|
41
|
-
code: any;
|
42
|
-
clock: {
|
43
|
-
db: any;
|
44
|
-
byId: any;
|
45
|
-
byKey: any;
|
46
|
-
};
|
47
|
-
};
|
48
|
-
/**
|
49
|
-
* JSDoc for Query type.
|
50
|
-
* @typedef {Object} DbQuery
|
51
|
-
* @property {string[]} [range] - The range to query.
|
52
|
-
* @memberof DbIndex
|
53
|
-
*/
|
54
|
-
/**
|
55
|
-
* Query object can have {range}
|
56
|
-
* @param {DbQuery} query - the query range to use
|
57
|
-
* @returns {Promise<{proof: {}, rows: Array<{id: string, key: string, value: any}>}>}
|
58
|
-
* @memberof DbIndex
|
59
|
-
* @instance
|
60
|
-
*/
|
61
|
-
query(query: {
|
62
|
-
/**
|
63
|
-
* - The range to query.
|
64
|
-
*/
|
65
|
-
range?: string[];
|
66
|
-
}, update?: boolean): Promise<{
|
67
|
-
proof: {};
|
68
|
-
rows: Array<{
|
69
|
-
id: string;
|
70
|
-
key: string;
|
71
|
-
value: any;
|
72
|
-
}>;
|
73
|
-
}>;
|
74
|
-
/**
|
75
|
-
* Update the DbIndex with the latest changes
|
76
|
-
* @private
|
77
|
-
* @returns {Promise<void>}
|
78
|
-
*/
|
79
|
-
private updateIndex;
|
80
|
-
innerUpdateIndex(inBlocks: any): Promise<void>;
|
81
|
-
}
|
82
|
-
/**
|
83
|
-
* JDoc for the result row type.
|
84
|
-
*/
|
85
|
-
export type ChangeEvent = {
|
86
|
-
/**
|
87
|
-
* - The key of the document.
|
88
|
-
*/
|
89
|
-
key: string;
|
90
|
-
/**
|
91
|
-
* - The new value of the document.
|
92
|
-
*/
|
93
|
-
value: any;
|
94
|
-
/**
|
95
|
-
* - Is the row deleted?
|
96
|
-
*/
|
97
|
-
del?: boolean;
|
98
|
-
};
|
99
|
-
/**
|
100
|
-
* JDoc for the result row type.
|
101
|
-
*/
|
102
|
-
export type DbIndexEntry = {
|
103
|
-
/**
|
104
|
-
* - The key for the DbIndex entry.
|
105
|
-
*/
|
106
|
-
key: string[];
|
107
|
-
/**
|
108
|
-
* - The value of the document.
|
109
|
-
*/
|
110
|
-
value: any;
|
111
|
-
/**
|
112
|
-
* - Is the row deleted?
|
113
|
-
*/
|
114
|
-
del?: boolean;
|
115
|
-
};
|
116
|
-
//# sourceMappingURL=db-index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"db-index.d.ts","sourceRoot":"","sources":["../../src/db-index.js"],"names":[],"mappings":"AAoFA;;;;;;;;;GASG;AACH;IA0CE,+DAkBC;IAUD;;;;gBAGC;IAxED,8DAiCC;IA/BC;;;OAGG;IACH,oBAAwB;IAUtB,iBAAwB;IAExB,WAAkB;IAGpB,UAAwC;IACxC;;;MAA0C;IAC1C;;;MAA2C;IAC3C,YAAkB;IAMlB,mBAAqG;IACrG,kCAA8B;IAIhC,gBAIC;IAsBD;;;;;;;;MAMC;IAOD;;;;;OAKG;IAEH;;;;;;OAMG;IACH;;;;gBAXc,MAAM,EAAE;0BAOT,QAAQ;QAAC,KAAK,EAAE,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,GAAG,CAAA;SAAC,CAAC,CAAA;KAAC,CAAC,CAoBpF;IAED;;;;OAIG;IAEH,oBAOC;IAED,+CA6CC;CACF;;;;;;;;SAzNa,MAAM;;;;;;;;UAEN,OAAO;;;;;;;;;SAOP,MAAM,EAAE;;;;;;;;UAER,OAAO"}
|
package/dist/src/fireproof.d.ts
DELETED
@@ -1,167 +0,0 @@
|
|
1
|
-
export function cidsToProof(cids: any): Promise<any[]>;
|
2
|
-
/**
|
3
|
-
* @class Fireproof
|
4
|
-
* @classdesc Fireproof stores data in IndexedDB and provides a Merkle clock.
|
5
|
-
* This is the main class for saving and loading JSON and other documents with the database. You can find additional examples and
|
6
|
-
* usage guides in the repository README.
|
7
|
-
*
|
8
|
-
* @param {import('./blockstore.js').TransactionBlockstore} blocks - The block storage instance to use documents and indexes
|
9
|
-
* @param {CID[]} clock - The Merkle clock head to use for the Fireproof instance.
|
10
|
-
* @param {object} [config] - Optional configuration options for the Fireproof instance.
|
11
|
-
* @param {object} [authCtx] - Optional authorization context object to use for any authentication checks.
|
12
|
-
*
|
13
|
-
*/
|
14
|
-
export class Fireproof {
|
15
|
-
/**
|
16
|
-
* @function storage
|
17
|
-
* @memberof Fireproof
|
18
|
-
* Creates a new Fireproof instance with default storage settings
|
19
|
-
* Most apps should use this and not worry about the details.
|
20
|
-
* @static
|
21
|
-
* @returns {Fireproof} - a new Fireproof instance
|
22
|
-
*/
|
23
|
-
static storage: (name?: string) => Fireproof;
|
24
|
-
constructor(blocks: any, clock: any, config: any, authCtx?: {});
|
25
|
-
listeners: Set<any>;
|
26
|
-
name: any;
|
27
|
-
instanceId: string;
|
28
|
-
blocks: any;
|
29
|
-
clock: any;
|
30
|
-
config: any;
|
31
|
-
authCtx: {};
|
32
|
-
indexes: Map<any, any>;
|
33
|
-
/**
|
34
|
-
* Renders the Fireproof instance as a JSON object.
|
35
|
-
* @returns {Object} - The JSON representation of the Fireproof instance. Includes clock heads for the database and its indexes.
|
36
|
-
* @memberof Fireproof
|
37
|
-
* @instance
|
38
|
-
*/
|
39
|
-
toJSON(): any;
|
40
|
-
clockToJSON(): any;
|
41
|
-
hydrate({ clock, name, key }: {
|
42
|
-
clock: any;
|
43
|
-
name: any;
|
44
|
-
key: any;
|
45
|
-
}): void;
|
46
|
-
indexBlocks: any;
|
47
|
-
/**
|
48
|
-
* Triggers a notification to all listeners
|
49
|
-
* of the Fireproof instance so they can repaint UI, etc.
|
50
|
-
* @param {CID[] } clock
|
51
|
-
* Clock to use for the snapshot.
|
52
|
-
* @returns {Promise<void>}
|
53
|
-
* @memberof Fireproof
|
54
|
-
* @instance
|
55
|
-
*/
|
56
|
-
notifyReset(): Promise<void>;
|
57
|
-
notifyExternal(source?: string): Promise<void>;
|
58
|
-
/**
|
59
|
-
* Returns the changes made to the Fireproof instance since the specified event.
|
60
|
-
* @function changesSince
|
61
|
-
* @param {CID[]} [event] - The clock head to retrieve changes since. If null or undefined, retrieves all changes.
|
62
|
-
* @returns {Object<{rows : Object[], clock: CID[]}>} An object containing the rows and the head of the instance's clock.
|
63
|
-
* @memberof Fireproof
|
64
|
-
* @instance
|
65
|
-
*/
|
66
|
-
changesSince(event?: CID[]): any;
|
67
|
-
allDocuments(): Promise<{
|
68
|
-
rows: {
|
69
|
-
key: any;
|
70
|
-
value: any;
|
71
|
-
}[];
|
72
|
-
clock: any;
|
73
|
-
proof: any[];
|
74
|
-
}>;
|
75
|
-
/**
|
76
|
-
* Runs validation on the specified document using the Fireproof instance's configuration. Throws an error if the document is invalid.
|
77
|
-
*
|
78
|
-
* @param {Object} doc - The document to validate.
|
79
|
-
* @returns {Promise<void>}
|
80
|
-
* @throws {Error} - Throws an error if the document is invalid.
|
81
|
-
* @memberof Fireproof
|
82
|
-
* @instance
|
83
|
-
*/
|
84
|
-
runValidation(doc: any): Promise<void>;
|
85
|
-
/**
|
86
|
-
* Retrieves the document with the specified ID from the database
|
87
|
-
*
|
88
|
-
* @param {string} key - the ID of the document to retrieve
|
89
|
-
* @param {Object} [opts] - options
|
90
|
-
* @returns {Promise<{_id: string}>} - the document with the specified ID
|
91
|
-
* @memberof Fireproof
|
92
|
-
* @instance
|
93
|
-
*/
|
94
|
-
get(key: string, opts?: any): Promise<{
|
95
|
-
_id: string;
|
96
|
-
}>;
|
97
|
-
/**
|
98
|
-
* Adds a new document to the database, or updates an existing document. Returns the ID of the document and the new clock head.
|
99
|
-
*
|
100
|
-
* @param {Object} doc - the document to be added
|
101
|
-
* @param {string} doc._id - the document ID. If not provided, a random ID will be generated.
|
102
|
-
* @param {CID[]} doc._clock - the document ID. If not provided, a random ID will be generated.
|
103
|
-
* @param {Proof} doc._proof - CIDs referenced by the update
|
104
|
-
* @returns {Promise<{ id: string, clock: CID[] }>} - The result of adding the document to the database
|
105
|
-
* @memberof Fireproof
|
106
|
-
* @instance
|
107
|
-
*/
|
108
|
-
put({ _id, _proof, ...doc }: {
|
109
|
-
_id: string;
|
110
|
-
_clock: CID[];
|
111
|
-
_proof: Proof;
|
112
|
-
}): Promise<{
|
113
|
-
id: string;
|
114
|
-
clock: CID[];
|
115
|
-
}>;
|
116
|
-
/**
|
117
|
-
* Deletes a document from the database
|
118
|
-
* @param {string | any} docOrId - the document ID
|
119
|
-
* @returns {Promise<{ id: string, clock: CID[] }>} - The result of deleting the document from the database
|
120
|
-
* @memberof Fireproof
|
121
|
-
* @instance
|
122
|
-
*/
|
123
|
-
del(docOrId: string | any): Promise<{
|
124
|
-
id: string;
|
125
|
-
clock: CID[];
|
126
|
-
}>;
|
127
|
-
/**
|
128
|
-
* Updates the underlying storage with the specified event.
|
129
|
-
* @private
|
130
|
-
* @param {{del?: true, key : string, value?: any}} decodedEvent - the event to add
|
131
|
-
* @returns {Promise<{ proof:{}, id: string, clock: CID[] }>} - The result of adding the event to storage
|
132
|
-
*/
|
133
|
-
private putToProllyTree;
|
134
|
-
vis(): AsyncGenerator<any, {
|
135
|
-
cids: any;
|
136
|
-
result: any;
|
137
|
-
vis?: undefined;
|
138
|
-
} | {
|
139
|
-
vis: string;
|
140
|
-
cids: any;
|
141
|
-
result?: undefined;
|
142
|
-
}, unknown>;
|
143
|
-
visTree(): Promise<{
|
144
|
-
cids: any;
|
145
|
-
result: any;
|
146
|
-
vis?: undefined;
|
147
|
-
} | {
|
148
|
-
vis: string;
|
149
|
-
cids: any;
|
150
|
-
result?: undefined;
|
151
|
-
}>;
|
152
|
-
visClock(): Promise<{
|
153
|
-
vis: string;
|
154
|
-
}>;
|
155
|
-
/**
|
156
|
-
* Registers a Listener to be called when the Fireproof instance's clock is updated.
|
157
|
-
* Recieves live changes from the database after they are committed.
|
158
|
-
* @param {Function} listener - The listener to be called when the clock is updated.
|
159
|
-
* @returns {Function} - A function that can be called to unregister the listener.
|
160
|
-
* @memberof Fireproof
|
161
|
-
*/
|
162
|
-
registerListener(listener: Function): Function;
|
163
|
-
notifyListeners(changes: any): Promise<void>;
|
164
|
-
setCarUploader(carUploaderFn: any): void;
|
165
|
-
setRemoteBlockReader(remoteBlockReaderFn: any): void;
|
166
|
-
}
|
167
|
-
//# sourceMappingURL=fireproof.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fireproof.d.ts","sourceRoot":"","sources":["../../src/fireproof.js"],"names":[],"mappings":"AAkUA,uDAIC;AA3TD;;;;;;;;;;;GAWG;AACH;IAGE;;;;;;;OAOG;IACH,mCAFa,SAAS,CAOrB;IAED,gEAQC;IAzBD,oBAAqB;IAkBnB,UAAoC;IACpC,mBAAiF;IACjF,YAAoB;IACpB,WAAkB;IAClB,YAAoB;IACpB,YAAsB;IACtB,uBAAwB;IAG1B;;;;;OAKG;IACH,cAQC;IAED,mBAEC;IAED;;;;aAKC;IADC,iBAAuB;IAGzB;;;;;;;;OAQG;IACH,eAJa,QAAQ,IAAI,CAAC,CAMzB;IAGD,+CAEC;IAED;;;;;;;OAOG;IACH,qBALW,KAAK,OAiCf;IAED;;;;;;;OAQC;IAED;;;;;;;;OAQG;IACH,yBALa,QAAQ,IAAI,CAAC,CAYzB;IAED;;;;;;;;OAQG;IACH,SANW,MAAM,eAEJ,QAAQ;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAC,CAsBlC;IAED;;;;;;;;;;OAUG;IACH;QAPuB,GAAG,EAAf,MAAM;QACK,MAAM,EAAjB,KAAK;QACM,MAAM;;YACD,MAAM;eAAS,KAAK;OAQ9C;IAED;;;;;;OAMG;IACH,aALW,MAAM,GAAG,GAAG;YACI,MAAM;eAAS,KAAK;OAiB9C;IAED;;;;;OAKG;IACH,wBA6BC;IAYD;;;;;;;;gBAEC;IAED;;;;;;;;OAEC;IAED;;OAEC;IAED;;;;;;OAMG;IACH,+CAKC;IAED,6CAKC;IAED,yCAIC;IAED,qDAGC;CACF"}
|
package/dist/src/hydrator.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"hydrator.d.ts","sourceRoot":"","sources":["../../src/hydrator.js"],"names":[],"mappings":"AAMA;IACE,+CAgBC;IAED,gDAgBC;IAED,qDASC;CACF"}
|
package/dist/src/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":"0BAA0B,gBAAgB;iCACT,eAAe;yBACvB,eAAe;yBACf,eAAe"}
|
package/dist/src/listener.d.ts
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A Fireproof database Listener allows you to react to events in the database.
|
3
|
-
*
|
4
|
-
* @class Listener
|
5
|
-
* @classdesc An listener attaches to a Fireproof database and runs a routing function on each change, sending the results to subscribers.
|
6
|
-
*
|
7
|
-
* @param {Fireproof} database - The Fireproof database instance to index.
|
8
|
-
* @param {Function} routingFn - The routing function to apply to each entry in the database.
|
9
|
-
*/
|
10
|
-
export class Listener {
|
11
|
-
constructor(database: any, routingFn: any);
|
12
|
-
subcribers: Map<any, any>;
|
13
|
-
doStopListening: any;
|
14
|
-
/** routingFn
|
15
|
-
* The database instance to index.
|
16
|
-
* @type {Fireproof}
|
17
|
-
*/
|
18
|
-
database: Fireproof;
|
19
|
-
/**
|
20
|
-
* The map function to apply to each entry in the database.
|
21
|
-
* @type {Function}
|
22
|
-
*/
|
23
|
-
routingFn: Function;
|
24
|
-
dbHead: any;
|
25
|
-
/**
|
26
|
-
* Subscribe to a topic emitted by the event function.
|
27
|
-
* @param {string} topic - The topic to subscribe to.
|
28
|
-
* @param {Function} subscriber - The function to call when the topic is emitted.
|
29
|
-
* @returns {Function} A function to unsubscribe from the topic.
|
30
|
-
* @memberof Listener
|
31
|
-
* @instance
|
32
|
-
*/
|
33
|
-
on(topic: string, subscriber: Function, since: any): Function;
|
34
|
-
onChanges(changes: any): void;
|
35
|
-
}
|
36
|
-
//# sourceMappingURL=listener.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/listener.js"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAGH;IAIE,2CAiBC;IApBD,0BAAsB;IACtB,qBAAsB;IAGpB;;;OAGG;IACH,oBAAwB;IAExB;;;OAGG;IACH,oBAIG;IACH,YAAkB;IAGpB;;;;;;;OAOG;IACH,UANW,MAAM,8CAmBhB;IAED,8BAaC;CACF"}
|
package/dist/src/prolly.d.ts
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Put a value (a CID) for the given key. If the key exists it's value is overwritten.
|
3
|
-
*
|
4
|
-
* @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
|
5
|
-
* @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
|
6
|
-
* @param {string} key The key of the value to put.
|
7
|
-
* @param {CID} value The value to put.
|
8
|
-
* @param {object} [options]
|
9
|
-
* @returns {Promise<Result>}
|
10
|
-
*/
|
11
|
-
export function put(inBlocks: any, head: import('./clock').EventLink<EventData>[], event: any, options?: object): Promise<Result>;
|
12
|
-
/**
|
13
|
-
* Determine the effective prolly root given the current merkle clock head.
|
14
|
-
*
|
15
|
-
* @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
|
16
|
-
* @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
|
17
|
-
*/
|
18
|
-
export function root(inBlocks: any, head: import('./clock').EventLink<EventData>[]): Promise<{
|
19
|
-
cids: any;
|
20
|
-
node: any;
|
21
|
-
}>;
|
22
|
-
/**
|
23
|
-
* Get the list of events not known by the `since` event
|
24
|
-
* @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
|
25
|
-
* @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
|
26
|
-
* @param {import('./clock').EventLink<EventData>} since Event to compare against.
|
27
|
-
* @returns {Promise<{clockCIDs: CIDCounter, result: EventData[]}>}
|
28
|
-
*/
|
29
|
-
export function eventsSince(blocks: any, head: import('./clock').EventLink<EventData>[], since: import('./clock').EventLink<EventData>): Promise<{
|
30
|
-
clockCIDs: CIDCounter;
|
31
|
-
result: EventData[];
|
32
|
-
}>;
|
33
|
-
/**
|
34
|
-
*
|
35
|
-
* @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
|
36
|
-
* @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
|
37
|
-
*
|
38
|
-
* @returns {Promise<{clockCIDs: CIDCounter, result: EventData[]}>}
|
39
|
-
*
|
40
|
-
*/
|
41
|
-
export function getAll(blocks: any, head: import('./clock').EventLink<EventData>[]): Promise<{
|
42
|
-
clockCIDs: CIDCounter;
|
43
|
-
result: EventData[];
|
44
|
-
}>;
|
45
|
-
/**
|
46
|
-
* @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
|
47
|
-
* @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
|
48
|
-
* @param {string} key The key of the value to retrieve.
|
49
|
-
*/
|
50
|
-
export function get(blocks: any, head: import('./clock').EventLink<EventData>[], key: string): Promise<{
|
51
|
-
cids: any;
|
52
|
-
result: any;
|
53
|
-
clockCIDs?: undefined;
|
54
|
-
} | {
|
55
|
-
result: any;
|
56
|
-
cids: any;
|
57
|
-
clockCIDs: any;
|
58
|
-
}>;
|
59
|
-
export function vis(blocks: any, head: any): AsyncGenerator<any, {
|
60
|
-
cids: any;
|
61
|
-
result: any;
|
62
|
-
vis?: undefined;
|
63
|
-
} | {
|
64
|
-
vis: string;
|
65
|
-
cids: any;
|
66
|
-
result?: undefined;
|
67
|
-
}, unknown>;
|
68
|
-
export function visMerkleTree(blocks: any, head: any): Promise<{
|
69
|
-
cids: any;
|
70
|
-
result: any;
|
71
|
-
vis?: undefined;
|
72
|
-
} | {
|
73
|
-
vis: string;
|
74
|
-
cids: any;
|
75
|
-
result?: undefined;
|
76
|
-
}>;
|
77
|
-
export function visMerkleClock(blocks: any, head: any): Promise<{
|
78
|
-
vis: string;
|
79
|
-
}>;
|
80
|
-
export function makeGetBlock(blocks: any): {
|
81
|
-
getBlock: (address: any) => Promise<import("multiformats").BlockView<unknown, 113, 18, import("multiformats").Version>>;
|
82
|
-
};
|
83
|
-
//# sourceMappingURL=prolly.d.ts.map
|
package/dist/src/prolly.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"prolly.d.ts","sourceRoot":"","sources":["../../src/prolly.js"],"names":[],"mappings":"AAwLA;;;;;;;;;GASG;AACH,yCANW,OAAO,SAAS,EAAE,SAAS,WAAW,EAAE,wBAGxC,MAAM,GACJ,eAAe,CA0C3B;AAED;;;;;GAKG;AACH,0CAFW,OAAO,SAAS,EAAE,SAAS,WAAW,EAAE;;;GAelD;AAED;;;;;;GAMG;AACH,+CAJW,OAAO,SAAS,EAAE,SAAS,WAAW,EAAE,SACxC,OAAO,SAAS,EAAE,SAAS,WAAW,GACpC,QAAQ;IAAC,SAAS,aAAa;IAAC,MAAM,EAAE,WAAW,CAAA;CAAC,CAAC,CASjE;AAED;;;;;;;GAOG;AACH,0CALW,OAAO,SAAS,EAAE,SAAS,WAAW,EAAE;;YAEE,WAAW;GAe/D;AAED;;;;GAIG;AACH,uCAHW,OAAO,SAAS,EAAE,SAAS,WAAW,EAAE,OACxC,MAAM;;;;;;;;GAahB;AAED;;;;;;;;YAWC;AAED;;;;;;;;GAUC;AAED;;GAOC;AA/TM;;EAWN"}
|
package/dist/src/sha1.d.ts
DELETED
package/dist/src/sha1.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../../src/sha1.js"],"names":[],"mappings":"AAyBA;;;;;;EAME;AACF,2BAJY,UAAU,GAEV,UAAU,CAoDrB"}
|
package/dist/src/valet.d.ts
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
export class Valet {
|
2
|
-
constructor(name: string, keyMaterial: any);
|
3
|
-
idb: any;
|
4
|
-
name: any;
|
5
|
-
uploadQueue: any;
|
6
|
-
alreadyEnqueued: Set<any>;
|
7
|
-
keyMaterial: any;
|
8
|
-
keyId: string;
|
9
|
-
/**
|
10
|
-
* Function installed by the database to upload car files
|
11
|
-
* @type {null|function(string, Uint8Array):Promise<void>}
|
12
|
-
*/
|
13
|
-
uploadFunction: null | ((arg0: string, arg1: Uint8Array) => Promise<void>);
|
14
|
-
getKeyMaterial(): any;
|
15
|
-
setKeyMaterial(km: any): void;
|
16
|
-
/**
|
17
|
-
* Group the blocks into a car and write it to the valet.
|
18
|
-
* @param {InnerBlockstore} innerBlockstore
|
19
|
-
* @param {Set<string>} cids
|
20
|
-
* @returns {Promise<void>}
|
21
|
-
* @memberof Valet
|
22
|
-
*/
|
23
|
-
writeTransaction(innerBlockstore: InnerBlockstore, cids: Set<string>): Promise<void>;
|
24
|
-
withDB: (dbWorkFun: any) => Promise<any>;
|
25
|
-
/**
|
26
|
-
*
|
27
|
-
* @param {string} carCid
|
28
|
-
* @param {*} value
|
29
|
-
*/
|
30
|
-
parkCar(carCid: string, value: any, cids: any): Promise<void>;
|
31
|
-
remoteBlockFunction: any;
|
32
|
-
getBlock(dataCID: any): Promise<any>;
|
33
|
-
}
|
34
|
-
//# sourceMappingURL=valet.d.ts.map
|
package/dist/src/valet.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"valet.d.ts","sourceRoot":"","sources":["../../src/valet.js"],"names":[],"mappings":"AAqBA;IAcE,4CAmCC;IAhDD,SAAU;IACV,UAAW;IACX,iBAAkB;IAClB,0BAA2B;IAC3B,iBAAkB;IAClB,cAAc;IAEd;;;OAGG;IACH,gBAFU,IAAI,WAAU,MAAM,QAAE,UAAU,KAAE,QAAQ,IAAI,CAAC,CAAA,CAEpC;IAuCrB,sBAEC;IAED,8BAWC;IAED;;;;;;OAMG;IACH,yDAJW,IAAI,MAAM,CAAC,GACT,QAAQ,IAAI,CAAC,CAczB;IAED,yCAiBC;IAED;;;;OAIG;IACH,gBAHW,MAAM,wCAwBhB;IAED,yBAA0B;IAE1B,qCAuCC;CACF"}
|