@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.
@@ -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:",
@@ -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/database-api/replication">Fireproof replication options.</a> You can also
126
- see a demo without images but <a href="https://fireproof.storage/s3up-test.html">with compaction and refresh buttons.</a>
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 />
@@ -211,7 +211,7 @@
211
211
 
212
212
  <body>
213
213
  <h1><a href="https://use-fireproof.com/">Fireproof</a> Test App</h1>
214
- Database:
214
+ Ledger:
215
215
  <input title="Change list" type="text" name="list" id="list" />
216
216
  <button onclick="changeList(event)">Switch</button>
217
217
 
@@ -156,7 +156,7 @@
156
156
  e.preventDefault();
157
157
  e.target.disabled = true;
158
158
  const input = document.querySelector("#join");
159
- const { database: newDb, connection: newConn } = await cx.joinShared(input.value);
159
+ const { ledger: newDb, connection: newConn } = await cx.joinShared(input.value);
160
160
  setupDb(null, newDb, newConn);
161
161
  };
162
162
 
@@ -196,7 +196,7 @@
196
196
 
197
197
  <body>
198
198
  <h1><a href="https://use-fireproof.com/">Fireproof</a> Test App</h1>
199
- Database:
199
+ Ledger:
200
200
  <input title="Change list" type="text" name="list" id="list" />
201
201
  <button onclick="changeList(event)">Switch</button>
202
202
 
@@ -235,7 +235,7 @@
235
235
 
236
236
  <body>
237
237
  <h1><a href="https://use-fireproof.com/">Fireproof</a> Test App</h1>
238
- Database:
238
+ Ledger:
239
239
  <input title="Change list" type="text" name="list" id="list" />
240
240
  <button onclick="changeList(event)">Switch</button>
241
241