@fireproof/core 0.3.6 → 0.3.8

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.
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
5
+ * @license MIT
6
+ */
7
+
8
+ /*!
9
+ * The buffer module from node.js, for the browser.
10
+ *
11
+ * @author Feross Aboukhadijeh <https://feross.org>
12
+ * @license MIT
13
+ */
14
+
15
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
16
+
17
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -1,7 +1,7 @@
1
1
  /* global localStorage */
2
2
  // @ts-ignore
3
3
  import { useEffect, useState, createContext } from 'react'
4
- import { Fireproof, Listener, Hydrator } from '../src/index'
4
+ import { Fireproof, Listener, Hydrator } from '../index'
5
5
 
6
6
  // export interface FireproofCtxValue {
7
7
  // addSubscriber: (label: String, fn: Function) => void
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import Fireproof from './src/fireproof.js'
2
+ import Index from './src/db-index.js'
3
+ import Listener from './src/listener.js'
4
+ import Hydrator from './src/hydrator.js'
5
+
6
+ export { Fireproof, Index, Listener, Hydrator }
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Realtime database for IPFS",
5
- "main": "src/index.js",
5
+ "main": "index.js",
6
6
  "type": "module",
7
- "types": "./dist/src/index.d.ts",
8
7
  "scripts": {
9
8
  "keygen": "node scripts/keygen.js",
10
9
  "test": "standard && npm run test:unencrypted && npm run test:mocha",
@@ -15,8 +14,7 @@
15
14
  "prepublishOnly": "cp ../../README.md .",
16
15
  "postpublish": "rm README.md",
17
16
  "lint": "standard",
18
- "lint:fix": "standard --fix",
19
- "build": "tsc --build"
17
+ "lint:fix": "standard --fix"
20
18
  },
21
19
  "keywords": [
22
20
  "database",
@@ -34,6 +32,7 @@
34
32
  ],
35
33
  "license": "Apache-2.0 OR MIT",
36
34
  "dependencies": {
35
+ "prolly-trees": "1.0.4",
37
36
  "@ipld/car": "^5.1.0",
38
37
  "@ipld/dag-cbor": "^9.0.0",
39
38
  "archy": "^1.0.0",
@@ -41,12 +40,9 @@
41
40
  "car-transaction": "^1.0.1",
42
41
  "charwise": "^3.0.1",
43
42
  "cli-color": "^2.0.3",
44
- "crypto-browserify": "^3.12.0",
45
43
  "encrypted-block": "^0.0.3",
46
44
  "idb": "^7.1.1",
47
45
  "multiformats": "^11.0.1",
48
- "node-polyfill-webpack-plugin": "^2.0.1",
49
- "prolly-trees": "1.0.4",
50
46
  "sade": "^1.8.1"
51
47
  },
52
48
  "devDependencies": {
@@ -55,10 +51,7 @@
55
51
  "flexsearch": "^0.7.31",
56
52
  "mocha": "^10.2.0",
57
53
  "nanoid": "^4.0.0",
58
- "standard": "^17.0.0",
59
- "typescript": "^5.0.2",
60
- "webpack": "^5.78.0",
61
- "webpack-cli": "^5.0.1"
54
+ "standard": "^17.0.0"
62
55
  },
63
56
  "mocha": {
64
57
  "require": [
@@ -69,7 +62,7 @@
69
62
  "ignore": [
70
63
  "examples/**/*.tsx",
71
64
  "examples/**/dist",
72
- "out/**"
65
+ "out/**", "dist/**"
73
66
  ]
74
67
  },
75
68
  "repository": {
package/src/blockstore.js CHANGED
@@ -1,7 +1,6 @@
1
- // @ts-nocheck
2
1
  import { parse } from 'multiformats/link'
3
2
  import { CID } from 'multiformats'
4
- import { Valet } from './valet.js'
3
+ import Valet from './valet.js'
5
4
 
6
5
  // const sleep = ms => new Promise(r => setTimeout(r, ms))
7
6
 
@@ -28,7 +27,7 @@ const husher = (id, workFn) => {
28
27
  * A blockstore that caches writes to a transaction and only persists them when committed.
29
28
  * @implements {Blockstore}
30
29
  */
31
- export class TransactionBlockstore {
30
+ export default class TransactionBlockstore {
32
31
  /** @type {Map<string, Uint8Array>} */
33
32
  committedBlocks = new Map()
34
33
 
package/src/clock.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { Block, encode, decode } from 'multiformats/block'
3
2
  import { sha256 } from 'multiformats/hashes/sha2'
4
3
  import * as cbor from '@ipld/dag-cbor'
@@ -23,7 +22,7 @@ import { CIDCounter } from 'prolly-trees/utils'
23
22
  * Advance the clock by adding an event.
24
23
  *
25
24
  * @template T
26
- * @param {import('./blockstore').BlockFetcher} blocks Block storage.
25
+ * @param {import('../test/block').BlockFetcher} blocks Block storage.
27
26
  * @param {EventLink<T>[]} head The head of the clock.
28
27
  * @param {EventLink<T>} event The event to add.
29
28
  * @returns {Promise<EventLink<T>[]>} The new head of the clock.
@@ -90,7 +89,7 @@ export class EventBlock extends Block {
90
89
 
91
90
  /** @template T */
92
91
  export class EventFetcher {
93
- /** @param {import('./blockstore').BlockFetcher} blocks */
92
+ /** @param {import('../test/block').BlockFetcher} blocks */
94
93
  constructor (blocks) {
95
94
  /** @private */
96
95
  this._blocks = blocks
@@ -169,7 +168,7 @@ async function contains (events, a, b) {
169
168
 
170
169
  /**
171
170
  * @template T
172
- * @param {import('./blockstore').BlockFetcher} blocks Block storage.
171
+ * @param {import('../test/block').BlockFetcher} blocks Block storage.
173
172
  * @param {EventLink<T>[]} head
174
173
  * @param {object} [options]
175
174
  * @param {(b: EventBlockView<T>) => string} [options.renderNodeLabel]
package/src/crypto.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import * as codec from 'encrypted-block'
3
2
  import {
4
3
  create,
package/src/db-index.js CHANGED
@@ -1,20 +1,15 @@
1
- // @ts-nocheck
2
- // @ts-ignore
3
1
  import { create, load } from 'prolly-trees/db-index'
4
2
  // import { create, load } from '../../../../prolly-trees/src/db-index.js'
5
3
 
6
4
  import { sha256 as hasher } from 'multiformats/hashes/sha2'
7
- // @ts-ignore
8
5
  import { nocache as cache } from 'prolly-trees/cache'
9
- // @ts-ignore
10
6
  import { bf, simpleCompare } from 'prolly-trees/utils'
11
7
  import { makeGetBlock } from './prolly.js'
12
8
  import { cidsToProof } from './fireproof.js'
13
9
 
14
10
  import * as codec from '@ipld/dag-cbor'
15
11
  // import { create as createBlock } from 'multiformats/block'
16
- import { TransactionBlockstore, doTransaction } from './blockstore.js'
17
- // @ts-ignore
12
+ import TransactionBlockstore, { doTransaction } from './blockstore.js'
18
13
  import charwise from 'charwise'
19
14
 
20
15
  const ALWAYS_REBUILD = false // todo: make false
@@ -92,7 +87,7 @@ const indexEntriesForChanges = (changes, mapFn) => {
92
87
  * @param {Function} mapFn - The map function to apply to each entry in the database.
93
88
  *
94
89
  */
95
- export class DbIndex {
90
+ export default class DbIndex {
96
91
  constructor (database, mapFn, clock, opts = {}) {
97
92
  // console.log('DbIndex constructor', database.constructor.name, typeof mapFn, clock)
98
93
  /**
@@ -177,7 +172,7 @@ export class DbIndex {
177
172
  /**
178
173
  * Query object can have {range}
179
174
  * @param {DbQuery} query - the query range to use
180
- * @returns {Promise<{proof: {}, rows: Array<{id: string, key: string, value: any}>}>}
175
+ * @returns {Promise<{rows: Array<{id: string, key: string, value: any}>}>}
181
176
  * @memberof DbIndex
182
177
  * @instance
183
178
  */
@@ -264,8 +259,8 @@ export class DbIndex {
264
259
 
265
260
  /**
266
261
  * Update the DbIndex with the given entries
267
- * @param {import('./blockstore.js').Blockstore} blocks
268
- * @param {{root, cid}} inIndex
262
+ * @param {Blockstore} blocks
263
+ * @param {Block} inRoot
269
264
  * @param {DbIndexEntry[]} indexEntries
270
265
  * @private
271
266
  */
package/src/fireproof.js CHANGED
@@ -1,27 +1,23 @@
1
- // @ts-nocheck
2
1
  import { randomBytes } from 'crypto'
3
2
  import { visMerkleClock, visMerkleTree, vis, put, get, getAll, eventsSince } from './prolly.js'
4
- import { TransactionBlockstore, doTransaction } from './blockstore.js'
3
+ import TransactionBlockstore, { doTransaction } from './blockstore.js'
5
4
  import charwise from 'charwise'
6
- // import { CID } from 'multiformats/dist/types/src/cid.js'
7
5
 
8
6
  // const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
9
7
 
10
- // class Proof {}
11
-
12
8
  /**
13
9
  * @class Fireproof
14
10
  * @classdesc Fireproof stores data in IndexedDB and provides a Merkle clock.
15
11
  * This is the main class for saving and loading JSON and other documents with the database. You can find additional examples and
16
12
  * usage guides in the repository README.
17
13
  *
18
- * @param {import('./blockstore.js').TransactionBlockstore} blocks - The block storage instance to use documents and indexes
14
+ * @param {Blockstore} blocks - The block storage instance to use documents and indexes
19
15
  * @param {CID[]} clock - The Merkle clock head to use for the Fireproof instance.
20
16
  * @param {object} [config] - Optional configuration options for the Fireproof instance.
21
17
  * @param {object} [authCtx] - Optional authorization context object to use for any authentication checks.
22
18
  *
23
19
  */
24
- export class Fireproof {
20
+ export default class Fireproof {
25
21
  listeners = new Set()
26
22
 
27
23
  /**
@@ -165,7 +161,7 @@ export class Fireproof {
165
161
  *
166
162
  * @param {string} key - the ID of the document to retrieve
167
163
  * @param {Object} [opts] - options
168
- * @returns {Promise<{_id: string}>} - the document with the specified ID
164
+ * @returns {Object<{_id: string, ...doc: Object}>} - the document with the specified ID
169
165
  * @memberof Fireproof
170
166
  * @instance
171
167
  */
@@ -194,9 +190,8 @@ export class Fireproof {
194
190
  *
195
191
  * @param {Object} doc - the document to be added
196
192
  * @param {string} doc._id - the document ID. If not provided, a random ID will be generated.
197
- * @param {CID[]} doc._clock - the document ID. If not provided, a random ID will be generated.
198
- * @param {Proof} doc._proof - CIDs referenced by the update
199
- * @returns {Promise<{ id: string, clock: CID[] }>} - The result of adding the document to the database
193
+ * @param {Object} doc.* - the document data to be added
194
+ * @returns {Object<{ id: string, clock: CID[] }>} - The result of adding the document to the database
200
195
  * @memberof Fireproof
201
196
  * @instance
202
197
  */
@@ -208,8 +203,8 @@ export class Fireproof {
208
203
 
209
204
  /**
210
205
  * Deletes a document from the database
211
- * @param {string | any} docOrId - the document ID
212
- * @returns {Promise<{ id: string, clock: CID[] }>} - The result of deleting the document from the database
206
+ * @param {string} id - the document ID
207
+ * @returns {Object<{ id: string, clock: CID[] }>} - The result of deleting the document from the database
213
208
  * @memberof Fireproof
214
209
  * @instance
215
210
  */
@@ -231,8 +226,8 @@ export class Fireproof {
231
226
  /**
232
227
  * Updates the underlying storage with the specified event.
233
228
  * @private
234
- * @param {{del?: true, key : string, value?: any}} decodedEvent - the event to add
235
- * @returns {Promise<{ proof:{}, id: string, clock: CID[] }>} - The result of adding the event to storage
229
+ * @param {Object<{key : string, value: any}>} event - the event to add
230
+ * @returns {Object<{ id: string, clock: CID[] }>} - The result of adding the event to storage
236
231
  */
237
232
  async putToProllyTree (decodedEvent, clock = null) {
238
233
  const event = encodeEvent(decodedEvent)
package/src/hydrator.js CHANGED
@@ -1,10 +1,10 @@
1
- import { DbIndex } from './db-index.js'
2
- import { Fireproof } from './fireproof.js'
1
+ import DbIndex from './db-index.js'
2
+ import Fireproof from './fireproof.js'
3
3
  import { CID } from 'multiformats'
4
4
 
5
5
  const parseCID = cid => typeof cid === 'string' ? CID.parse(cid) : cid
6
6
 
7
- export class Hydrator {
7
+ export default class Hydrator {
8
8
  static fromJSON (json, database) {
9
9
  database.hydrate({ clock: json.clock.map(c => parseCID(c)), name: json.name, key: json.key })
10
10
  if (json.indexes) {
package/src/listener.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * A Fireproof database Listener allows you to react to events in the database.
4
3
  *
@@ -10,7 +9,7 @@
10
9
  */
11
10
  // import { ChangeEvent } from './db-index'
12
11
 
13
- export class Listener {
12
+ export default class Listener {
14
13
  subcribers = new Map()
15
14
  doStopListening = null
16
15
 
package/src/prolly.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import {
3
2
  advance,
4
3
  EventFetcher,
@@ -38,9 +37,23 @@ export const makeGetBlock = (blocks) => {
38
37
  }
39
38
 
40
39
  /**
41
- *
42
- * @param {*} param0
43
- * @returns
40
+ * Creates and saves a new event.
41
+ * @param {import('./blockstore.js').Blockstore} inBlocks - A persistent blockstore.
42
+ * @param {MemoryBlockstore} mblocks - A temporary blockstore.
43
+ * @param {Function} getBlock - A function that gets a block.
44
+ * @param {Function} bigPut - A function that puts a block.
45
+ * @param {import('prolly-trees/map').Root} root - The root node.
46
+ * @param {Object<{ key: string, value: any, del: boolean }>} event - The update event.
47
+ * @param {CID[]} head - The head of the event chain.
48
+ * @param {Array<import('multiformats/block').Block>} additions - A array of additions.
49
+ * @param {Array<mport('multiformats/block').Block>>} removals - An array of removals.
50
+ * @returns {Promise<{
51
+ * root: import('prolly-trees/map').Root,
52
+ * additions: Map<string, import('multiformats/block').Block>,
53
+ * removals: Array<string>,
54
+ * head: CID[],
55
+ * event: CID[]
56
+ * }>}
44
57
  */
45
58
  async function createAndSaveNewEvent ({
46
59
  inBlocks,
@@ -185,7 +198,7 @@ const doProllyBulk = async (inBlocks, head, event) => {
185
198
  /**
186
199
  * Put a value (a CID) for the given key. If the key exists it's value is overwritten.
187
200
  *
188
- * @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
201
+ * @param {import('../test/block.js').BlockFetcher} blocks Bucket block storage.
189
202
  * @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
190
203
  * @param {string} key The key of the value to put.
191
204
  * @param {CID} value The value to put.
@@ -237,7 +250,7 @@ export async function put (inBlocks, head, event, options) {
237
250
  /**
238
251
  * Determine the effective prolly root given the current merkle clock head.
239
252
  *
240
- * @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
253
+ * @param {import('../test/block.js').BlockFetcher} blocks Bucket block storage.
241
254
  * @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
242
255
  */
243
256
  export async function root (inBlocks, head) {
@@ -257,10 +270,10 @@ export async function root (inBlocks, head) {
257
270
 
258
271
  /**
259
272
  * Get the list of events not known by the `since` event
260
- * @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
273
+ * @param {import('../test/block.js').BlockFetcher} blocks Bucket block storage.
261
274
  * @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
262
275
  * @param {import('./clock').EventLink<EventData>} since Event to compare against.
263
- * @returns {Promise<{clockCIDs: CIDCounter, result: EventData[]}>}
276
+ * @returns {Promise<import('./clock').EventLink<EventData>[]>}
264
277
  */
265
278
  export async function eventsSince (blocks, head, since) {
266
279
  if (!head.length) {
@@ -273,10 +286,10 @@ export async function eventsSince (blocks, head, since) {
273
286
 
274
287
  /**
275
288
  *
276
- * @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
289
+ * @param {import('../test/block.js').BlockFetcher} blocks Bucket block storage.
277
290
  * @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
278
291
  *
279
- * @returns {Promise<{clockCIDs: CIDCounter, result: EventData[]}>}
292
+ * @returns {Promise<import('./prolly').Entry[]>}
280
293
  *
281
294
  */
282
295
  export async function getAll (blocks, head) {
@@ -294,7 +307,7 @@ export async function getAll (blocks, head) {
294
307
  }
295
308
 
296
309
  /**
297
- * @param {import('./blockstore.js').BlockFetcher} blocks Bucket block storage.
310
+ * @param {import('../test/block.js').BlockFetcher} blocks Bucket block storage.
298
311
  * @param {import('./clock').EventLink<EventData>[]} head Merkle clock head.
299
312
  * @param {string} key The key of the value to retrieve.
300
313
  */
package/src/sha1.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  // from https://github.com/duzun/sync-sha1/blob/master/rawSha1.js
3
2
  // MIT License Copyright (c) 2020 Dumitru Uzun
4
3
  // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,7 +29,7 @@
30
29
  *
31
30
  * @return {Uint8Array} sha1 hash
32
31
  */
33
- export function rawSha1 (b) {
32
+ export default function rawSha1 (b) {
34
33
  let i = b.byteLength
35
34
  let bs = 0
36
35
  let A; let B; let C; let D; let G
package/src/valet.js CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { CarReader } from '@ipld/car'
3
2
  import { CID } from 'multiformats/cid'
4
3
  import { sha256 } from 'multiformats/hashes/sha2'
@@ -13,13 +12,13 @@ import { nocache as cache } from 'prolly-trees/cache'
13
12
  import { encrypt, decrypt } from './crypto.js'
14
13
  import { Buffer } from 'buffer'
15
14
  import * as codec from 'encrypted-block'
16
- import { rawSha1 as sha1sync } from './sha1.js'
15
+ import sha1sync from './sha1.js'
17
16
  const chunker = bf(3)
18
17
 
19
18
  const NO_ENCRYPT =
20
19
  typeof process !== 'undefined' ? process.env.NO_ENCRYPT : import.meta && import.meta.env.VITE_NO_ENCRYPT
21
20
 
22
- export class Valet {
21
+ export default class Valet {
23
22
  idb = null
24
23
  name = null
25
24
  uploadQueue = null
@@ -235,8 +234,7 @@ const blocksToEncryptedCarBlock = async (innerBlockStoreClockRootCid, blocks, ke
235
234
  key: encryptionKey,
236
235
  hasher: sha256,
237
236
  chunker,
238
- cache,
239
- // codec: dagcbor, // should be crypto?
237
+ codec: dagcbor, // should be crypto?
240
238
  root: innerBlockStoreClockRootCid
241
239
  })) {
242
240
  encryptedBlocks.push(block)
@@ -264,8 +262,8 @@ const blocksFromEncryptedCarBlock = async (cid, get, keyMaterial) => {
264
262
  key: decryptionKey,
265
263
  chunker,
266
264
  hasher: sha256,
267
- cache
268
- // codec: dagcbor
265
+ cache,
266
+ codec: dagcbor
269
267
  })) {
270
268
  decryptedBlocks.push(block)
271
269
  cids.add(block.cid.toString())
@@ -1,9 +1,9 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { TransactionBlockstore as Blockstore } from '../src/blockstore.js'
4
- import { Fireproof } from '../src/fireproof.js'
5
- import { DbIndex } from '../src/db-index.js'
6
- import { Hydrator } from '../src/hydrator.js'
3
+ import Blockstore from '../src/blockstore.js'
4
+ import Fireproof from '../src/fireproof.js'
5
+ import DbIndex from '../src/db-index.js'
6
+ import Hydrator from '../src/hydrator.js'
7
7
  console.x = function () {}
8
8
 
9
9
  describe('DbIndex query', () => {
@@ -1,8 +1,8 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { TransactionBlockstore as Blockstore } from '../src/blockstore.js'
4
- import { Fireproof } from '../src/fireproof.js'
5
- import { Hydrator } from '../src/hydrator.js'
3
+ import Blockstore from '../src/blockstore.js'
4
+ import Fireproof from '../src/fireproof.js'
5
+ import Hydrator from '../src/hydrator.js'
6
6
  // import * as codec from '@ipld/dag-cbor'
7
7
 
8
8
  let database, resp0
@@ -113,11 +113,12 @@ describe('Fireproof', () => {
113
113
  })
114
114
  it('has a factory for making new instances with default settings', async () => {
115
115
  // TODO if you pass it an email it asks the local keyring, and if no key, does the email validation thing
116
- const db = await Fireproof.storage('test')
117
- assert.equal(db.name, 'test')
116
+ const db = await Fireproof.storage({ email: 'jchris@gmail.com' })
117
+ assert(db instanceof Fireproof)
118
118
  })
119
119
  it('an empty database has no documents', async () => {
120
120
  const db = Fireproof.storage()
121
+ assert(db instanceof Fireproof)
121
122
  const e = await db.get('8c5c0c5c0c5c').catch((err) => err)
122
123
  assert.equal(e.message, 'Not found')
123
124
  const changes = await db.changesSince()
@@ -125,6 +126,7 @@ describe('Fireproof', () => {
125
126
  })
126
127
  it('delete on an empty database', async () => {
127
128
  const db = Fireproof.storage()
129
+ assert(db instanceof Fireproof)
128
130
  const e = await db.del('8c5c0c5c0c5c').catch((err) => err)
129
131
  assert.equal(e.id, '8c5c0c5c0c5c')
130
132
  const changes = await db.changesSince()
@@ -1,6 +1,6 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { Fireproof } from '../src/fireproof.js'
3
+ import Fireproof from '../src/fireproof.js'
4
4
  import flexsearch from 'flexsearch'
5
5
  const { Index } = flexsearch
6
6
  // this is an illustration of how to use the flexsearch library
@@ -1,8 +1,8 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { Fireproof } from '../src/fireproof.js'
4
- import { DbIndex } from '../src/db-index.js'
5
- import { Hydrator } from '../src/hydrator.js'
3
+ import Fireproof from '../src/fireproof.js'
4
+ import DbIndex from '../src/db-index.js'
5
+ import Hydrator from '../src/hydrator.js'
6
6
 
7
7
  describe('DbIndex query', () => {
8
8
  let database, index
@@ -1,9 +1,9 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { TransactionBlockstore as Blockstore } from '../src/blockstore.js'
4
- import { Fireproof } from '../src/fireproof.js'
5
- import { Listener } from '../src/listener.js'
6
- import { Hydrator } from '../src/hydrator.js'
3
+ import Blockstore from '../src/blockstore.js'
4
+ import Fireproof from '../src/fireproof.js'
5
+ import Listener from '../src/listener.js'
6
+ import Hydrator from '../src/hydrator.js'
7
7
 
8
8
  let database, listener, star
9
9
 
@@ -1,6 +1,6 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { Fireproof } from '../src/fireproof.js'
3
+ import Fireproof from '../src/fireproof.js'
4
4
 
5
5
  let database, ok, doc
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { describe, it, beforeEach } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { Fireproof } from '../src/fireproof.js'
4
- import { DbIndex } from '../src/db-index.js'
3
+ import Fireproof from '../src/fireproof.js'
4
+ import DbIndex from '../src/db-index.js'
5
5
 
6
6
  let database
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { before, describe, it } from 'mocha'
2
2
  import assert from 'node:assert'
3
- import { Valet } from '../src/valet.js'
3
+ import Valet from '../src/valet.js'
4
4
 
5
5
  describe('new Valet', () => {
6
6
  let val
package/src/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { Fireproof } from './fireproof.js'
2
- import { DbIndex as Index } from './db-index.js'
3
- import { Listener } from './listener.js'
4
- import { Hydrator } from './hydrator.js'
5
-
6
- export { Fireproof, Index, Listener, Hydrator }