@fireproof/core 0.20.0-dev-preview-06 → 0.20.0-dev-preview-11
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 +9 -9
- package/index.cjs +3221 -3166
- package/index.cjs.map +1 -1
- package/index.d.cts +241 -189
- package/index.d.ts +241 -189
- package/index.js +3211 -3156
- package/index.js.map +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/package.json +3 -3
- package/react/index.cjs.map +1 -1
- package/react/index.js.map +1 -1
- package/tests/blockstore/loader.test.ts +6 -6
- package/tests/blockstore/transaction.test.ts +8 -8
- package/tests/fireproof/all-gateway.test.ts +7 -7
- package/tests/fireproof/crdt.test.ts +35 -45
- package/tests/fireproof/database.test.ts +34 -33
- package/tests/fireproof/fireproof.test.ts +58 -60
- package/tests/fireproof/hello.test.ts +3 -3
- package/tests/fireproof/indexer.test.ts +37 -36
- package/tests/gateway/file/loader-config.test.ts +17 -17
- package/tests/gateway/indexdb/loader-config.test.ts +5 -5
- package/tests/www/gallery.html +2 -2
- package/tests/www/todo-aws.html +1 -1
- package/tests/www/todo-ipfs.html +1 -1
- package/tests/www/todo-local.html +1 -1
- package/tests/www/todo.html +1 -1
- /package/tests/fireproof/{multiple-database.test.ts → multiple-ledger.test.ts} +0 -0
@@ -35,9 +35,9 @@ describe("config file gateway", () => {
|
|
35
35
|
it("loader", async () => {
|
36
36
|
const db = fireproof(my_app());
|
37
37
|
await db.put({ name: "my-app" });
|
38
|
-
expect(db.name).toBe(my_app());
|
38
|
+
expect(db.ledger.name).toBe(my_app());
|
39
39
|
|
40
|
-
const fileStore = await db.crdt.blockstore.loader?.fileStore();
|
40
|
+
const fileStore = await db.ledger.crdt.blockstore.loader?.fileStore();
|
41
41
|
expect(fileStore?.url().asObj()).toEqual({
|
42
42
|
pathname: "./dist/fp-dir-file",
|
43
43
|
protocol: "file:",
|
@@ -52,7 +52,7 @@ describe("config file gateway", () => {
|
|
52
52
|
style: "path",
|
53
53
|
});
|
54
54
|
|
55
|
-
const dataStore = await db.crdt.blockstore.loader?.carStore();
|
55
|
+
const dataStore = await db.ledger.crdt.blockstore.loader?.carStore();
|
56
56
|
expect(dataStore?.url().asObj()).toEqual({
|
57
57
|
pathname: "./dist/fp-dir-file",
|
58
58
|
protocol: "file:",
|
@@ -67,7 +67,7 @@ describe("config file gateway", () => {
|
|
67
67
|
},
|
68
68
|
style: "path",
|
69
69
|
});
|
70
|
-
const metaStore = await db.crdt.blockstore.loader?.metaStore();
|
70
|
+
const metaStore = await db.ledger.crdt.blockstore.loader?.metaStore();
|
71
71
|
expect(metaStore?.url().asObj()).toEqual({
|
72
72
|
pathname: "./dist/fp-dir-file",
|
73
73
|
protocol: "file:",
|
@@ -81,7 +81,7 @@ describe("config file gateway", () => {
|
|
81
81
|
},
|
82
82
|
style: "path",
|
83
83
|
});
|
84
|
-
const WALStore = await db.crdt.blockstore.loader?.WALStore();
|
84
|
+
const WALStore = await db.ledger.crdt.blockstore.loader?.WALStore();
|
85
85
|
expect(WALStore?.url().asObj()).toEqual({
|
86
86
|
pathname: "./dist/fp-dir-file",
|
87
87
|
protocol: "file:",
|
@@ -113,8 +113,8 @@ describe("config file gateway", () => {
|
|
113
113
|
const db = fireproof(my_app(), { storeUrls: { base } });
|
114
114
|
// console.log(`>>>>>>>>>>>>>>>file-path`)
|
115
115
|
await db.put({ name: "my-app" });
|
116
|
-
expect(db.name).toBe(my_app());
|
117
|
-
const carStore = await db.crdt.blockstore.loader?.carStore();
|
116
|
+
expect(db.ledger.name).toBe(my_app());
|
117
|
+
const carStore = await db.ledger.crdt.blockstore.loader?.carStore();
|
118
118
|
expect(carStore?.url().asObj()).toEqual({
|
119
119
|
pathname: "./dist/data",
|
120
120
|
protocol: "file:",
|
@@ -128,7 +128,7 @@ describe("config file gateway", () => {
|
|
128
128
|
},
|
129
129
|
style: "path",
|
130
130
|
});
|
131
|
-
const fileStore = await db.crdt.blockstore.loader?.fileStore();
|
131
|
+
const fileStore = await db.ledger.crdt.blockstore.loader?.fileStore();
|
132
132
|
expect(fileStore?.url().asObj()).toEqual({
|
133
133
|
pathname: "./dist/data",
|
134
134
|
protocol: "file:",
|
@@ -142,7 +142,7 @@ describe("config file gateway", () => {
|
|
142
142
|
style: "path",
|
143
143
|
});
|
144
144
|
expect((await sysfs.stat(sthis.pathOps.join(baseDir, "data"))).isDirectory()).toBeTruthy();
|
145
|
-
const metaStore = await db.crdt.blockstore.loader?.metaStore();
|
145
|
+
const metaStore = await db.ledger.crdt.blockstore.loader?.metaStore();
|
146
146
|
expect(metaStore?.url().asObj()).toEqual({
|
147
147
|
pathname: "./dist/data",
|
148
148
|
protocol: "file:",
|
@@ -179,8 +179,8 @@ describe("config file gateway", () => {
|
|
179
179
|
|
180
180
|
const db = fireproof(my_app());
|
181
181
|
await db.put({ name: "my-app" });
|
182
|
-
expect(db.name).toBe(my_app());
|
183
|
-
const carStore = await db.crdt.blockstore.loader?.carStore();
|
182
|
+
expect(db.ledger.name).toBe(my_app());
|
183
|
+
const carStore = await db.ledger.crdt.blockstore.loader?.carStore();
|
184
184
|
|
185
185
|
expect(carStore?.url().asObj()).toEqual({
|
186
186
|
pathname: `${sthis.env.get("HOME")}/.fireproof/v0.19`,
|
@@ -200,7 +200,7 @@ describe("config file gateway", () => {
|
|
200
200
|
|
201
201
|
expect((await sysfs.stat(sthis.pathOps.join(baseDir, "data"))).isDirectory()).toBeTruthy();
|
202
202
|
|
203
|
-
const fileStore = await db.crdt.blockstore.loader?.fileStore();
|
203
|
+
const fileStore = await db.ledger.crdt.blockstore.loader?.fileStore();
|
204
204
|
expect(fileStore?.url().asObj()).toEqual({
|
205
205
|
pathname: `${sthis.env.get("HOME")}/.fireproof/v0.19`,
|
206
206
|
protocol: "file:",
|
@@ -215,7 +215,7 @@ describe("config file gateway", () => {
|
|
215
215
|
version: rt.FILESTORE_VERSION,
|
216
216
|
},
|
217
217
|
});
|
218
|
-
const metaStore = await db.crdt.blockstore.loader?.metaStore();
|
218
|
+
const metaStore = await db.ledger.crdt.blockstore.loader?.metaStore();
|
219
219
|
expect(metaStore?.url().asObj()).toEqual({
|
220
220
|
pathname: `${sthis.env.get("HOME")}/.fireproof/v0.19`,
|
221
221
|
protocol: "file:",
|
@@ -252,8 +252,8 @@ describe("config file gateway", () => {
|
|
252
252
|
|
253
253
|
const db = fireproof(my_app());
|
254
254
|
await db.put({ name: "my-app" });
|
255
|
-
expect(db.name).toBe(my_app());
|
256
|
-
const carStore = await db.crdt.blockstore.loader.carStore();
|
255
|
+
expect(db.ledger.name).toBe(my_app());
|
256
|
+
const carStore = await db.ledger.crdt.blockstore.loader.carStore();
|
257
257
|
expect(carStore?.url().asObj()).toEqual({
|
258
258
|
pathname: "./dist/fp-dir-file",
|
259
259
|
protocol: "file:",
|
@@ -271,7 +271,7 @@ describe("config file gateway", () => {
|
|
271
271
|
});
|
272
272
|
|
273
273
|
expect((await sysfs.stat(sthis.pathOps.join(baseDir, "data"))).isDirectory()).toBeTruthy();
|
274
|
-
const fileStore = await db.crdt.blockstore.loader?.fileStore();
|
274
|
+
const fileStore = await db.ledger.crdt.blockstore.loader?.fileStore();
|
275
275
|
expect(fileStore?.url().asObj()).toEqual({
|
276
276
|
pathname: `./dist/fp-dir-file`,
|
277
277
|
protocol: "file:",
|
@@ -286,7 +286,7 @@ describe("config file gateway", () => {
|
|
286
286
|
},
|
287
287
|
});
|
288
288
|
|
289
|
-
const metaStore = await db.crdt.blockstore.loader?.metaStore();
|
289
|
+
const metaStore = await db.ledger.crdt.blockstore.loader?.metaStore();
|
290
290
|
expect(metaStore?.url().asObj()).toEqual({
|
291
291
|
pathname: `./dist/fp-dir-file`,
|
292
292
|
protocol: "file:",
|
@@ -14,9 +14,9 @@ describe("fireproof config indexdb", () => {
|
|
14
14
|
it("indexdb-loader", async () => {
|
15
15
|
const db = fireproof(my_app());
|
16
16
|
await db.put({ name: "my-app" });
|
17
|
-
expect(db.name).toBe(my_app());
|
17
|
+
expect(db.ledger.name).toBe(my_app());
|
18
18
|
|
19
|
-
const fileStore = await db.crdt.blockstore.loader.fileStore();
|
19
|
+
const fileStore = await db.ledger.crdt.blockstore.loader.fileStore();
|
20
20
|
expect(fileStore?.url().asObj()).toEqual({
|
21
21
|
pathname: "fp",
|
22
22
|
protocol: "indexdb:",
|
@@ -31,7 +31,7 @@ describe("fireproof config indexdb", () => {
|
|
31
31
|
style: "path",
|
32
32
|
});
|
33
33
|
|
34
|
-
const dataStore = await db.crdt.blockstore.loader.carStore();
|
34
|
+
const dataStore = await db.ledger.crdt.blockstore.loader.carStore();
|
35
35
|
expect(dataStore?.url().asObj()).toEqual({
|
36
36
|
pathname: "fp",
|
37
37
|
protocol: "indexdb:",
|
@@ -46,7 +46,7 @@ describe("fireproof config indexdb", () => {
|
|
46
46
|
},
|
47
47
|
style: "path",
|
48
48
|
});
|
49
|
-
const metaStore = await db.crdt.blockstore.loader.metaStore();
|
49
|
+
const metaStore = await db.ledger.crdt.blockstore.loader.metaStore();
|
50
50
|
expect(metaStore?.url().asObj()).toEqual({
|
51
51
|
pathname: "fp",
|
52
52
|
protocol: "indexdb:",
|
@@ -60,7 +60,7 @@ describe("fireproof config indexdb", () => {
|
|
60
60
|
},
|
61
61
|
style: "path",
|
62
62
|
});
|
63
|
-
const WALStore = await db.crdt.blockstore.loader.WALStore();
|
63
|
+
const WALStore = await db.ledger.crdt.blockstore.loader.WALStore();
|
64
64
|
expect(WALStore?.url().asObj()).toEqual({
|
65
65
|
pathname: "fp",
|
66
66
|
protocol: "indexdb:",
|
package/tests/www/gallery.html
CHANGED
@@ -122,8 +122,8 @@
|
|
122
122
|
<h3>Files</h3>
|
123
123
|
<p>
|
124
124
|
Data is stored locally and encrypted before upload to S3. This is a demo so the encryption key is not managed securely. Read
|
125
|
-
more about <a href="https://use-fireproof.com/docs/
|
126
|
-
|
125
|
+
more about <a href="https://use-fireproof.com/docs/ledger-api/replication">Fireproof replication options.</a> You can also see
|
126
|
+
a demo without images but <a href="https://fireproof.storage/s3up-test.html">with compaction and refresh buttons.</a>
|
127
127
|
</p>
|
128
128
|
<label for="files-up"><strong>Drop files:</strong></label>
|
129
129
|
<input accept="image/*" title="save to Fireproof" type="file" id="files-up" multiple />
|
package/tests/www/todo-aws.html
CHANGED
package/tests/www/todo-ipfs.html
CHANGED
@@ -156,7 +156,7 @@
|
|
156
156
|
e.preventDefault();
|
157
157
|
e.target.disabled = true;
|
158
158
|
const input = document.querySelector("#join");
|
159
|
-
const {
|
159
|
+
const { ledger: newDb, connection: newConn } = await cx.joinShared(input.value);
|
160
160
|
setupDb(null, newDb, newConn);
|
161
161
|
};
|
162
162
|
|
package/tests/www/todo.html
CHANGED
File without changes
|