@fireproof/core 0.20.0-dev-preview-54 → 0.20.0-dev-preview-57

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/metafile-esm.json CHANGED
@@ -1 +1 @@
1
- {"inputs":{"src/types.ts":{"bytes":18474,"imports":[],"format":"esm"},"src/utils.ts":{"bytes":13432,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"multiformats/bases/base58","kind":"import-statement","external":true}],"format":"esm"},"src/write-queue.ts":{"bytes":3276,"imports":[{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"./types.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/files.ts":{"bytes":1746,"imports":[{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"../types.js","kind":"import-statement","external":true},{"path":"../blockstore/index.js","kind":"import-statement","external":true},{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/file/sys-file-system-factory.ts":{"bytes":502,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/core/node","kind":"dynamic-import","external":true},{"path":"@fireproof/core/deno","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/gateways/file/key-bag-file.ts":{"bytes":1715,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../../../types.js","kind":"import-statement","external":true},{"path":"../../key-bag.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"./sys-file-system-factory.js"}],"format":"esm"},"src/runtime/key-bag-memory.ts":{"bytes":1333,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./key-bag.js","kind":"import-statement","external":true},{"path":"../types.js","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/key-bag.ts":{"bytes":16696,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../blockstore/types.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/gateways/file/key-bag-file.ts","kind":"import-statement","original":"./gateways/file/key-bag-file.js"},{"path":"src/runtime/key-bag-memory.ts","kind":"import-statement","original":"./key-bag-memory.js"},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/gateways/file/version.ts":{"bytes":47,"imports":[],"format":"esm"},"src/runtime/gateways/indexeddb-version.ts":{"bytes":52,"imports":[],"format":"esm"},"src/runtime/gateways/file/utils.ts":{"bytes":1393,"imports":[{"path":"../../../types.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"}],"format":"esm"},"src/runtime/gateways/file/gateway-impl.ts":{"bytes":5435,"imports":[{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"./version.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/gateways/file/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../../types.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"}],"format":"esm"},"src/runtime/gateways/memory/version.ts":{"bytes":46,"imports":[],"format":"esm"},"src/runtime/gateways/memory/gateway.ts":{"bytes":2777,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../../../blockstore/gateway.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../../../types.js"},{"path":"src/runtime/gateways/memory/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"},{"path":"../../../blockstore/serde-gateway.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/fp-envelope.ts":{"bytes":4858,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/fp-envelope-serialize.ts":{"bytes":9473,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"../../blockstore/fp-envelope.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../types.js"},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"multiformats/bases/base64","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock/api","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../utils.js"}],"format":"esm"},"src/runtime/gateways/def-serde-gateway.ts":{"bytes":3469,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"../../blockstore/fp-envelope.js"},{"path":"src/runtime/gateways/fp-envelope-serialize.ts","kind":"import-statement","original":"./fp-envelope-serialize.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../types.js"}],"format":"esm"},"src/blockstore/register-store-protocol.ts":{"bytes":5265,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"../runtime/gateways/file/version.js"},{"path":"src/runtime/gateways/indexeddb-version.ts","kind":"import-statement","original":"../runtime/gateways/indexeddb-version.js"},{"path":"src/runtime/gateways/file/gateway-impl.ts","kind":"import-statement","original":"../runtime/gateways/file/gateway-impl.js"},{"path":"src/runtime/gateways/memory/gateway.ts","kind":"import-statement","original":"../runtime/gateways/memory/gateway.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"../runtime/gateways/file/sys-file-system-factory.js"},{"path":"src/runtime/gateways/def-serde-gateway.ts","kind":"import-statement","original":"../runtime/gateways/def-serde-gateway.js"},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/wait-pr-multiformats/block.ts":{"bytes":5839,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/block","kind":"import-statement","external":true},{"path":"./codec-interface.js","kind":"import-statement","external":true}],"format":"esm"},"src/indexer-helpers.ts":{"bytes":7618,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"charwise","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"prolly-trees/utils","kind":"import-statement","external":true},{"path":"prolly-trees/cache","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/indexer.ts":{"bytes":11843,"imports":[{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/indexer-helpers.ts","kind":"import-statement","original":"./indexer-helpers.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/database.ts":{"bytes":5245,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/blockstore/types.ts":{"bytes":20302,"imports":[{"path":"../types.js","kind":"import-statement","external":true},{"path":"./transaction.js","kind":"import-statement","external":true},{"path":"./commit-queue.js","kind":"import-statement","external":true},{"path":"../runtime/key-bag.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"./task-manager.js","kind":"import-statement","external":true},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"../context.js","kind":"import-statement","external":true},{"path":"../runtime/wait-pr-multiformats/codec-interface.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/loader-helpers.ts":{"bytes":2139,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/transaction.ts":{"bytes":10991,"imports":[{"path":"@fireproof/vendor/@web3-storage/pail/block","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/api","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/blockstore/commit-queue.ts":{"bytes":1375,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/commitor.ts":{"bytes":6874,"imports":[{"path":"../types.js","kind":"import-statement","external":true},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"@ipld/car/buffer-writer","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"../runtime/wait-pr-multiformats/codec-interface.js","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/task-manager.ts":{"bytes":2428,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"../types.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/attachable-store.ts":{"bytes":10835,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/blockstore/loader.ts":{"bytes":22119,"imports":[{"path":"p-limit","kind":"import-statement","external":true},{"path":"@ipld/car/reader","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/blockstore/loader-helpers.ts","kind":"import-statement","original":"./loader-helpers.js"},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"src/blockstore/commit-queue.ts","kind":"import-statement","original":"./commit-queue.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"../runtime/key-bag.js"},{"path":"src/blockstore/commitor.ts","kind":"import-statement","original":"./commitor.js"},{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"src/blockstore/task-manager.ts","kind":"import-statement","original":"./task-manager.js"},{"path":"src/blockstore/attachable-store.ts","kind":"import-statement","original":"./attachable-store.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/runtime/keyed-crypto.ts":{"bytes":8783,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../blockstore/index.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"./key-bag.js","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"cborg","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"}],"format":"esm"},"src/blockstore/interceptor-gateway.ts":{"bytes":5562,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./fp-envelope.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/store.ts":{"bytes":21936,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/blockstore/commit-queue.ts","kind":"import-statement","original":"./commit-queue.js"},{"path":"src/runtime/keyed-crypto.ts","kind":"import-statement","original":"../runtime/keyed-crypto.js"},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"./fp-envelope.js"},{"path":"@fireproof/vendor/@web3-storage/pail/clock/api","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"p-retry","kind":"import-statement","external":true},{"path":"p-map","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"src/blockstore/interceptor-gateway.ts","kind":"import-statement","original":"./interceptor-gateway.js"}],"format":"esm"},"src/blockstore/store-factory.ts":{"bytes":6937,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/files.ts","kind":"import-statement","original":"../runtime/files.js"},{"path":"src/blockstore/store.ts","kind":"import-statement","original":"./store.js"},{"path":"./types.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./register-store-protocol.js"},{"path":"./serde-gateway.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/serde-gateway.ts":{"bytes":4290,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../utils.js","kind":"import-statement","external":true},{"path":"./fp-envelope.js","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"../runtime/gateways/fp-envelope-serialize.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/gateway.ts":{"bytes":1431,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/index.ts":{"bytes":850,"imports":[{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/serde-gateway.ts","kind":"import-statement","original":"./serde-gateway.js"},{"path":"src/blockstore/gateway.ts","kind":"import-statement","original":"./gateway.js"},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"./fp-envelope.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/interceptor-gateway.ts","kind":"import-statement","original":"./interceptor-gateway.js"},{"path":"src/blockstore/store.ts","kind":"import-statement","original":"./store.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./register-store-protocol.js"},{"path":"src/blockstore/attachable-store.ts","kind":"import-statement","original":"./attachable-store.js"},{"path":"src/blockstore/task-manager.ts","kind":"import-statement","original":"./task-manager.js"},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/blockstore/loader-helpers.ts","kind":"import-statement","original":"./loader-helpers.js"}],"format":"esm"},"src/crdt-helpers.ts":{"bytes":14381,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/api","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/batch","kind":"import-statement","external":true},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/api","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./blockstore/transaction.js"}],"format":"esm"},"src/apply-head-queue.ts":{"bytes":2240,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/crdt-clock.ts":{"bytes":5950,"imports":[{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/crdt-helpers.ts","kind":"import-statement","original":"./crdt-helpers.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/apply-head-queue.ts","kind":"import-statement","original":"./apply-head-queue.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/crdt.ts":{"bytes":7122,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/crdt-helpers.ts","kind":"import-statement","original":"./crdt-helpers.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/crdt-clock.ts","kind":"import-statement","original":"./crdt-clock.js"}],"format":"esm"},"src/context.ts":{"bytes":407,"imports":[],"format":"esm"},"src/ledger.ts":{"bytes":9310,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/write-queue.ts","kind":"import-statement","original":"./write-queue.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/runtime/files.ts","kind":"import-statement","original":"./runtime/files.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./runtime/key-bag.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./blockstore/register-store-protocol.js"},{"path":"src/database.ts","kind":"import-statement","original":"./database.js"},{"path":"src/crdt.ts","kind":"import-statement","original":"./crdt.js"},{"path":"src/context.ts","kind":"import-statement","original":"./context.js"}],"format":"esm"},"src/runtime/wait-pr-multiformats/codec-interface.ts":{"bytes":1656,"imports":[],"format":"esm"},"src/runtime/wait-pr-multiformats/index.ts":{"bytes":84,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./block.js"},{"path":"src/runtime/wait-pr-multiformats/codec-interface.ts","kind":"import-statement","original":"./codec-interface.js"}],"format":"esm"},"src/runtime/gateways/file/index.ts":{"bytes":81,"imports":[{"path":"src/runtime/gateways/file/key-bag-file.ts","kind":"import-statement","original":"./key-bag-file.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"./sys-file-system-factory.js"}],"format":"esm"},"src/runtime/gateways/index.ts":{"bytes":172,"imports":[{"path":"src/runtime/gateways/fp-envelope-serialize.ts","kind":"import-statement","original":"./fp-envelope-serialize.js"},{"path":"src/runtime/gateways/file/index.ts","kind":"import-statement","original":"./file/index.js"},{"path":"src/runtime/gateways/memory/gateway.ts","kind":"import-statement","original":"./memory/gateway.js"},{"path":"src/runtime/gateways/def-serde-gateway.ts","kind":"import-statement","original":"./def-serde-gateway.js"}],"format":"esm"},"src/runtime/index.ts":{"bytes":624,"imports":[{"path":"src/runtime/gateways/file/utils.ts","kind":"import-statement","original":"./gateways/file/utils.js"},{"path":"src/runtime/files.ts","kind":"import-statement","original":"./files.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./key-bag.js"},{"path":"src/runtime/keyed-crypto.ts","kind":"import-statement","original":"./keyed-crypto.js"},{"path":"src/runtime/wait-pr-multiformats/index.ts","kind":"import-statement","original":"./wait-pr-multiformats/index.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/gateways/index.ts","kind":"import-statement","original":"./gateways/index.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./key-bag.js"},{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"./gateways/file/version.js"},{"path":"src/runtime/gateways/indexeddb-version.ts","kind":"import-statement","original":"./gateways/indexeddb-version.js"}],"format":"esm"},"src/version.ts":{"bytes":97,"imports":[],"format":"esm"},"src/index.ts":{"bytes":455,"imports":[{"path":"src/ledger.ts","kind":"import-statement","original":"./ledger.js"},{"path":"src/database.ts","kind":"import-statement","original":"./database.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/crdt.ts","kind":"import-statement","original":"./crdt.js"},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/write-queue.ts","kind":"import-statement","original":"./write-queue.js"},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/runtime/index.ts","kind":"import-statement","original":"./runtime/index.js"},{"path":"src/runtime/index.ts","kind":"import-statement","original":"./runtime/index.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"}],"format":"esm"}},"outputs":{"dist/fireproof-core/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":426469},"dist/fireproof-core/index.js":{"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/core/node","kind":"dynamic-import","external":true},{"path":"@fireproof/core/deno","kind":"dynamic-import","external":true},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"multiformats/bases/base64","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/block","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"charwise","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"prolly-trees/utils","kind":"import-statement","external":true},{"path":"prolly-trees/cache","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"p-limit","kind":"import-statement","external":true},{"path":"@ipld/car/reader","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/block","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@ipld/car/buffer-writer","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"cborg","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"p-retry","kind":"import-statement","external":true},{"path":"p-map","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/batch","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"exports":["CRDTImpl","DataAndMetaAndWalAndBaseStore","DatabaseImpl","Index","LedgerFactory","LedgerShell","NotFoundError","PACKAGE_VERSION","PARAM","UInt8ArrayEqual","blockstore","bs","coerceIntoUint8","coercePromiseIntoUint8","defaultWriteQueueOpts","ensureLogger","ensureSuperLog","ensureSuperThis","ensureURIDefaults","exceptionWrapper","falsyToUndef","fireproof","getKey","getName","getStore","index","inplaceFilter","isDatabase","isFalsy","isLedger","isNotFoundError","keyConfigOpts","makeName","onSuperThis","rt","runtime","storeType2DataMetaWal","throwFalsy","toSortedArray","toStoreURIRuntime"],"entryPoint":"src/index.ts","inputs":{"src/ledger.ts":{"bytesInOutput":6669},"src/utils.ts":{"bytesInOutput":9894},"src/types.ts":{"bytesInOutput":1365},"src/write-queue.ts":{"bytesInOutput":2074},"src/runtime/files.ts":{"bytesInOutput":1065},"src/runtime/key-bag.ts":{"bytesInOutput":13136},"src/runtime/gateways/file/sys-file-system-factory.ts":{"bytesInOutput":404},"src/runtime/gateways/file/key-bag-file.ts":{"bytesInOutput":1047},"src/runtime/key-bag-memory.ts":{"bytesInOutput":965},"src/blockstore/register-store-protocol.ts":{"bytesInOutput":2876},"src/runtime/gateways/file/version.ts":{"bytesInOutput":38},"src/runtime/gateways/indexeddb-version.ts":{"bytesInOutput":43},"src/runtime/gateways/file/gateway-impl.ts":{"bytesInOutput":4233},"src/runtime/gateways/file/utils.ts":{"bytesInOutput":772},"src/runtime/gateways/memory/gateway.ts":{"bytesInOutput":1661},"src/runtime/gateways/memory/version.ts":{"bytesInOutput":37},"src/runtime/gateways/def-serde-gateway.ts":{"bytesInOutput":2281},"src/blockstore/fp-envelope.ts":{"bytesInOutput":339},"src/runtime/gateways/fp-envelope-serialize.ts":{"bytesInOutput":5120},"src/runtime/wait-pr-multiformats/block.ts":{"bytesInOutput":2500},"src/indexer-helpers.ts":{"bytesInOutput":4064},"src/indexer.ts":{"bytesInOutput":8141},"src/database.ts":{"bytesInOutput":3475},"src/crdt.ts":{"bytesInOutput":4455},"src/blockstore/index.ts":{"bytesInOutput":1393},"src/blockstore/types.ts":{"bytesInOutput":1246},"src/blockstore/store-factory.ts":{"bytesInOutput":4579},"src/blockstore/store.ts":{"bytesInOutput":16806},"src/blockstore/loader.ts":{"bytesInOutput":13704},"src/blockstore/loader-helpers.ts":{"bytesInOutput":561},"src/blockstore/transaction.ts":{"bytesInOutput":7275},"src/blockstore/commit-queue.ts":{"bytesInOutput":1239},"src/blockstore/commitor.ts":{"bytesInOutput":3556},"src/blockstore/task-manager.ts":{"bytesInOutput":1665},"src/blockstore/attachable-store.ts":{"bytesInOutput":7630},"src/runtime/keyed-crypto.ts":{"bytesInOutput":6157},"src/blockstore/interceptor-gateway.ts":{"bytesInOutput":3773},"src/crdt-helpers.ts":{"bytesInOutput":10068},"src/crdt-clock.ts":{"bytesInOutput":4538},"src/apply-head-queue.ts":{"bytesInOutput":1260},"src/context.ts":{"bytesInOutput":236},"src/index.ts":{"bytesInOutput":0},"src/runtime/index.ts":{"bytesInOutput":776},"src/runtime/wait-pr-multiformats/index.ts":{"bytesInOutput":153},"src/runtime/wait-pr-multiformats/codec-interface.ts":{"bytesInOutput":34},"src/runtime/gateways/index.ts":{"bytesInOutput":340},"src/runtime/gateways/file/index.ts":{"bytesInOutput":151},"src/version.ts":{"bytesInOutput":77}},"bytes":166791}}}
1
+ {"inputs":{"src/types.ts":{"bytes":18551,"imports":[],"format":"esm"},"src/utils.ts":{"bytes":13432,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"multiformats/bases/base58","kind":"import-statement","external":true}],"format":"esm"},"src/write-queue.ts":{"bytes":3276,"imports":[{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"./types.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/files.ts":{"bytes":1746,"imports":[{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"../types.js","kind":"import-statement","external":true},{"path":"../blockstore/index.js","kind":"import-statement","external":true},{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/file/sys-file-system-factory.ts":{"bytes":502,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/core/node","kind":"dynamic-import","external":true},{"path":"@fireproof/core/deno","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/gateways/file/key-bag-file.ts":{"bytes":1715,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../../../types.js","kind":"import-statement","external":true},{"path":"../../key-bag.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"./sys-file-system-factory.js"}],"format":"esm"},"src/runtime/key-bag-memory.ts":{"bytes":1333,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./key-bag.js","kind":"import-statement","external":true},{"path":"../types.js","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/key-bag.ts":{"bytes":16696,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../blockstore/types.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/gateways/file/key-bag-file.ts","kind":"import-statement","original":"./gateways/file/key-bag-file.js"},{"path":"src/runtime/key-bag-memory.ts","kind":"import-statement","original":"./key-bag-memory.js"},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/gateways/file/version.ts":{"bytes":47,"imports":[],"format":"esm"},"src/runtime/gateways/indexeddb-version.ts":{"bytes":52,"imports":[],"format":"esm"},"src/runtime/gateways/file/utils.ts":{"bytes":1393,"imports":[{"path":"../../../types.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"}],"format":"esm"},"src/runtime/gateways/file/gateway-impl.ts":{"bytes":5435,"imports":[{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"./version.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/gateways/file/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../../types.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"}],"format":"esm"},"src/runtime/gateways/memory/version.ts":{"bytes":46,"imports":[],"format":"esm"},"src/runtime/gateways/memory/gateway.ts":{"bytes":2777,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../../../blockstore/gateway.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../../../types.js"},{"path":"src/runtime/gateways/memory/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"},{"path":"../../../blockstore/serde-gateway.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/fp-envelope.ts":{"bytes":4858,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/fp-envelope-serialize.ts":{"bytes":9473,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"../../blockstore/fp-envelope.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../types.js"},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"multiformats/bases/base64","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock/api","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../utils.js"}],"format":"esm"},"src/runtime/gateways/def-serde-gateway.ts":{"bytes":3469,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"../../blockstore/fp-envelope.js"},{"path":"src/runtime/gateways/fp-envelope-serialize.ts","kind":"import-statement","original":"./fp-envelope-serialize.js"},{"path":"src/types.ts","kind":"import-statement","original":"../../types.js"}],"format":"esm"},"src/blockstore/register-store-protocol.ts":{"bytes":5265,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"../runtime/gateways/file/version.js"},{"path":"src/runtime/gateways/indexeddb-version.ts","kind":"import-statement","original":"../runtime/gateways/indexeddb-version.js"},{"path":"src/runtime/gateways/file/gateway-impl.ts","kind":"import-statement","original":"../runtime/gateways/file/gateway-impl.js"},{"path":"src/runtime/gateways/memory/gateway.ts","kind":"import-statement","original":"../runtime/gateways/memory/gateway.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"../runtime/gateways/file/sys-file-system-factory.js"},{"path":"src/runtime/gateways/def-serde-gateway.ts","kind":"import-statement","original":"../runtime/gateways/def-serde-gateway.js"},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true}],"format":"esm"},"src/runtime/wait-pr-multiformats/block.ts":{"bytes":5839,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/block","kind":"import-statement","external":true},{"path":"./codec-interface.js","kind":"import-statement","external":true}],"format":"esm"},"src/indexer-helpers.ts":{"bytes":7618,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"charwise","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"prolly-trees/utils","kind":"import-statement","external":true},{"path":"prolly-trees/cache","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/indexer.ts":{"bytes":11843,"imports":[{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/indexer-helpers.ts","kind":"import-statement","original":"./indexer-helpers.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/database.ts":{"bytes":5326,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/blockstore/types.ts":{"bytes":20302,"imports":[{"path":"../types.js","kind":"import-statement","external":true},{"path":"./transaction.js","kind":"import-statement","external":true},{"path":"./commit-queue.js","kind":"import-statement","external":true},{"path":"../runtime/key-bag.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"./task-manager.js","kind":"import-statement","external":true},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"../context.js","kind":"import-statement","external":true},{"path":"../runtime/wait-pr-multiformats/codec-interface.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/loader-helpers.ts":{"bytes":2139,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/transaction.ts":{"bytes":10991,"imports":[{"path":"@fireproof/vendor/@web3-storage/pail/block","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/api","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/blockstore/commit-queue.ts":{"bytes":1375,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/commitor.ts":{"bytes":6874,"imports":[{"path":"../types.js","kind":"import-statement","external":true},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"@ipld/car/buffer-writer","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"../runtime/wait-pr-multiformats/codec-interface.js","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/task-manager.ts":{"bytes":2428,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"../types.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/attachable-store.ts":{"bytes":10835,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/blockstore/loader.ts":{"bytes":22119,"imports":[{"path":"p-limit","kind":"import-statement","external":true},{"path":"@ipld/car/reader","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/blockstore/loader-helpers.ts","kind":"import-statement","original":"./loader-helpers.js"},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"src/blockstore/commit-queue.ts","kind":"import-statement","original":"./commit-queue.js"},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"../runtime/key-bag.js"},{"path":"src/blockstore/commitor.ts","kind":"import-statement","original":"./commitor.js"},{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"../runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"src/blockstore/task-manager.ts","kind":"import-statement","original":"./task-manager.js"},{"path":"src/blockstore/attachable-store.ts","kind":"import-statement","original":"./attachable-store.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"}],"format":"esm"},"src/runtime/keyed-crypto.ts":{"bytes":8783,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../blockstore/index.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"./key-bag.js","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"cborg","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"}],"format":"esm"},"src/blockstore/store.ts":{"bytes":22119,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../utils.js"},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/blockstore/commit-queue.ts","kind":"import-statement","original":"./commit-queue.js"},{"path":"src/runtime/keyed-crypto.ts","kind":"import-statement","original":"../runtime/keyed-crypto.js"},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"./fp-envelope.js"},{"path":"@fireproof/vendor/@web3-storage/pail/clock/api","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"p-retry","kind":"import-statement","external":true},{"path":"p-map","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"./interceptor-gateway.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/interceptor-gateway.ts":{"bytes":5562,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./fp-envelope.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/store-factory.ts":{"bytes":6360,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/files.ts","kind":"import-statement","original":"../runtime/files.js"},{"path":"src/blockstore/store.ts","kind":"import-statement","original":"./store.js"},{"path":"./types.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./register-store-protocol.js"},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"src/blockstore/interceptor-gateway.ts","kind":"import-statement","original":"./interceptor-gateway.js"}],"format":"esm"},"src/blockstore/serde-gateway.ts":{"bytes":4290,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"../utils.js","kind":"import-statement","external":true},{"path":"./fp-envelope.js","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true},{"path":"../runtime/gateways/fp-envelope-serialize.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/gateway.ts":{"bytes":1431,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/uri-interceptor.ts":{"bytes":2539,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/interceptor-gateway.ts","kind":"import-statement","original":"./interceptor-gateway.js"},{"path":"./serde-gateway.js","kind":"import-statement","external":true},{"path":"./fp-envelope.js","kind":"import-statement","external":true}],"format":"esm"},"src/blockstore/index.ts":{"bytes":889,"imports":[{"path":"src/blockstore/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/serde-gateway.ts","kind":"import-statement","original":"./serde-gateway.js"},{"path":"src/blockstore/gateway.ts","kind":"import-statement","original":"./gateway.js"},{"path":"src/blockstore/fp-envelope.ts","kind":"import-statement","original":"./fp-envelope.js"},{"path":"src/blockstore/store-factory.ts","kind":"import-statement","original":"./store-factory.js"},{"path":"src/blockstore/interceptor-gateway.ts","kind":"import-statement","original":"./interceptor-gateway.js"},{"path":"src/blockstore/store.ts","kind":"import-statement","original":"./store.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./register-store-protocol.js"},{"path":"src/blockstore/attachable-store.ts","kind":"import-statement","original":"./attachable-store.js"},{"path":"src/blockstore/task-manager.ts","kind":"import-statement","original":"./task-manager.js"},{"path":"src/blockstore/uri-interceptor.ts","kind":"import-statement","original":"./uri-interceptor.js"},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./transaction.js"},{"path":"src/blockstore/loader.ts","kind":"import-statement","original":"./loader.js"},{"path":"src/blockstore/loader-helpers.ts","kind":"import-statement","original":"./loader-helpers.js"}],"format":"esm"},"src/crdt-helpers.ts":{"bytes":14381,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./runtime/wait-pr-multiformats/block.js"},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/api","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/batch","kind":"import-statement","external":true},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/api","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/transaction.ts","kind":"import-statement","original":"./blockstore/transaction.js"}],"format":"esm"},"src/apply-head-queue.ts":{"bytes":2240,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./types.js","kind":"import-statement","external":true}],"format":"esm"},"src/crdt-clock.ts":{"bytes":5950,"imports":[{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/crdt-helpers.ts","kind":"import-statement","original":"./crdt-helpers.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/apply-head-queue.ts","kind":"import-statement","original":"./apply-head-queue.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"}],"format":"esm"},"src/crdt.ts":{"bytes":7122,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/crdt-helpers.ts","kind":"import-statement","original":"./crdt-helpers.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/crdt-clock.ts","kind":"import-statement","original":"./crdt-clock.js"}],"format":"esm"},"src/context.ts":{"bytes":407,"imports":[],"format":"esm"},"src/ledger.ts":{"bytes":9310,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/write-queue.ts","kind":"import-statement","original":"./write-queue.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"./blockstore/index.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/runtime/files.ts","kind":"import-statement","original":"./runtime/files.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./runtime/key-bag.js"},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"./blockstore/register-store-protocol.js"},{"path":"src/database.ts","kind":"import-statement","original":"./database.js"},{"path":"src/crdt.ts","kind":"import-statement","original":"./crdt.js"},{"path":"src/context.ts","kind":"import-statement","original":"./context.js"}],"format":"esm"},"src/runtime/wait-pr-multiformats/codec-interface.ts":{"bytes":1656,"imports":[],"format":"esm"},"src/runtime/wait-pr-multiformats/index.ts":{"bytes":84,"imports":[{"path":"src/runtime/wait-pr-multiformats/block.ts","kind":"import-statement","original":"./block.js"},{"path":"src/runtime/wait-pr-multiformats/codec-interface.ts","kind":"import-statement","original":"./codec-interface.js"}],"format":"esm"},"src/runtime/sts-service/index.ts":{"bytes":4359,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"jose","kind":"import-statement","external":true},{"path":"jose/key/generate/keypair","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../utils.js"},{"path":"../../types.js","kind":"import-statement","external":true},{"path":"../../protocols/cloud/msg-types.js","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/file/index.ts":{"bytes":81,"imports":[{"path":"src/runtime/gateways/file/key-bag-file.ts","kind":"import-statement","original":"./key-bag-file.js"},{"path":"src/runtime/gateways/file/sys-file-system-factory.ts","kind":"import-statement","original":"./sys-file-system-factory.js"}],"format":"esm"},"src/protocols/cloud/msg-types.ts":{"bytes":17773,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/core","kind":"import-statement","external":true},{"path":"./msg-types-data.js","kind":"import-statement","external":true}],"format":"esm"},"src/protocols/cloud/msg-raw-connection-base.ts":{"bytes":1180,"imports":[{"path":"../../types.js","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"./msger.js","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"format":"esm"},"src/protocols/cloud/http-connection.ts":{"bytes":6385,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../utils.js"},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"src/protocols/cloud/msger.ts","kind":"import-statement","original":"./msger.js"},{"path":"src/protocols/cloud/msg-raw-connection-base.ts","kind":"import-statement","original":"./msg-raw-connection-base.js"},{"path":"../../types.js","kind":"import-statement","external":true}],"format":"esm"},"src/protocols/cloud/ws-connection.ts":{"bytes":6869,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"./msger.js","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-raw-connection-base.ts","kind":"import-statement","original":"./msg-raw-connection-base.js"},{"path":"../../types.js","kind":"import-statement","external":true},{"path":"src/utils.ts","kind":"import-statement","original":"../../utils.js"}],"format":"esm"},"src/protocols/cloud/msger.ts":{"bytes":11475,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"src/protocols/cloud/http-connection.ts","kind":"import-statement","original":"./http-connection.js"},{"path":"src/protocols/cloud/ws-connection.ts","kind":"import-statement","original":"./ws-connection.js"},{"path":"../../types.js","kind":"import-statement","external":true},{"path":"ws","kind":"dynamic-import","external":true}],"format":"esm"},"src/protocols/cloud/msg-types-data.ts":{"bytes":3221,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"}],"format":"esm"},"src/protocols/cloud/msg-types-meta.ts":{"bytes":4354,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./msg-types.js","kind":"import-statement","external":true},{"path":"../../runtime/meta-key-hack.js","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/meta-key-hack.ts":{"bytes":9161,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"./gateways/fp-envelope-serialize.js","kind":"import-statement","external":true},{"path":"../blockstore/serde-gateway.js","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types.js"},{"path":"../blockstore/fp-envelope.js","kind":"import-statement","external":true},{"path":"../utils.js","kind":"import-statement","external":true},{"path":"src/runtime/gateways/def-serde-gateway.ts","kind":"import-statement","original":"./gateways/def-serde-gateway.js"},{"path":"../blockstore/gateway.js","kind":"import-statement","external":true},{"path":"../blockstore/types.js","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/gateways/cloud/gateway.ts":{"bytes":26490,"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"../../../protocols/cloud/msg-types.js"},{"path":"src/protocols/cloud/msger.ts","kind":"import-statement","original":"../../../protocols/cloud/msger.js"},{"path":"src/protocols/cloud/msg-types-data.ts","kind":"import-statement","original":"../../../protocols/cloud/msg-types-data.js"},{"path":"src/utils.ts","kind":"import-statement","original":"../../../utils.js"},{"path":"../../../blockstore/serde-gateway.js","kind":"import-statement","external":true},{"path":"src/blockstore/register-store-protocol.ts","kind":"import-statement","original":"../../../blockstore/register-store-protocol.js"},{"path":"../../../blockstore/fp-envelope.js","kind":"import-statement","external":true},{"path":"src/runtime/gateways/fp-envelope-serialize.ts","kind":"import-statement","original":"../fp-envelope-serialize.js"},{"path":"src/protocols/cloud/msg-types-meta.ts","kind":"import-statement","original":"../../../protocols/cloud/msg-types-meta.js"},{"path":"src/runtime/meta-key-hack.ts","kind":"import-statement","original":"../../meta-key-hack.js"}],"format":"esm"},"src/runtime/gateways/index.ts":{"bytes":217,"imports":[{"path":"src/runtime/gateways/fp-envelope-serialize.ts","kind":"import-statement","original":"./fp-envelope-serialize.js"},{"path":"src/runtime/gateways/file/index.ts","kind":"import-statement","original":"./file/index.js"},{"path":"src/runtime/gateways/memory/gateway.ts","kind":"import-statement","original":"./memory/gateway.js"},{"path":"src/runtime/gateways/cloud/gateway.ts","kind":"import-statement","original":"./cloud/gateway.js"},{"path":"src/runtime/gateways/def-serde-gateway.ts","kind":"import-statement","original":"./def-serde-gateway.js"}],"format":"esm"},"src/runtime/index.ts":{"bytes":709,"imports":[{"path":"src/runtime/gateways/file/utils.ts","kind":"import-statement","original":"./gateways/file/utils.js"},{"path":"src/runtime/files.ts","kind":"import-statement","original":"./files.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./key-bag.js"},{"path":"src/runtime/keyed-crypto.ts","kind":"import-statement","original":"./keyed-crypto.js"},{"path":"src/runtime/wait-pr-multiformats/index.ts","kind":"import-statement","original":"./wait-pr-multiformats/index.js"},{"path":"src/runtime/sts-service/index.ts","kind":"import-statement","original":"./sts-service/index.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"src/runtime/gateways/index.ts","kind":"import-statement","original":"./gateways/index.js"},{"path":"src/runtime/key-bag.ts","kind":"import-statement","original":"./key-bag.js"},{"path":"src/runtime/meta-key-hack.ts","kind":"import-statement","original":"./meta-key-hack.js"},{"path":"src/runtime/gateways/file/version.ts","kind":"import-statement","original":"./gateways/file/version.js"},{"path":"src/runtime/gateways/indexeddb-version.ts","kind":"import-statement","original":"./gateways/indexeddb-version.js"}],"format":"esm"},"src/protocols/cloud/msg-types-wal.ts":{"bytes":3187,"imports":[{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"./msg-types-data.js","kind":"import-statement","external":true}],"format":"esm"},"src/protocols/cloud/index.ts":{"bytes":327,"imports":[{"path":"src/protocols/cloud/http-connection.ts","kind":"import-statement","original":"./http-connection.js"},{"path":"src/protocols/cloud/msg-raw-connection-base.ts","kind":"import-statement","original":"./msg-raw-connection-base.js"},{"path":"src/protocols/cloud/msg-types-data.ts","kind":"import-statement","original":"./msg-types-data.js"},{"path":"src/protocols/cloud/msg-types-meta.ts","kind":"import-statement","original":"./msg-types-meta.js"},{"path":"src/protocols/cloud/msg-types-meta.ts","kind":"import-statement","original":"./msg-types-meta.js"},{"path":"src/protocols/cloud/msg-types-wal.ts","kind":"import-statement","original":"./msg-types-wal.js"},{"path":"src/protocols/cloud/msg-types.ts","kind":"import-statement","original":"./msg-types.js"},{"path":"src/protocols/cloud/msger.ts","kind":"import-statement","original":"./msger.js"},{"path":"src/protocols/cloud/ws-connection.ts","kind":"import-statement","original":"./ws-connection.js"}],"format":"esm"},"src/protocols/index.ts":{"bytes":43,"imports":[{"path":"src/protocols/cloud/index.ts","kind":"import-statement","original":"./cloud/index.js"}],"format":"esm"},"src/version.ts":{"bytes":97,"imports":[],"format":"esm"},"src/index.ts":{"bytes":551,"imports":[{"path":"src/ledger.ts","kind":"import-statement","original":"./ledger.js"},{"path":"src/database.ts","kind":"import-statement","original":"./database.js"},{"path":"src/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/crdt.ts","kind":"import-statement","original":"./crdt.js"},{"path":"src/indexer.ts","kind":"import-statement","original":"./indexer.js"},{"path":"src/write-queue.ts","kind":"import-statement","original":"./write-queue.js"},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/blockstore/index.ts","kind":"import-statement","original":"./blockstore/index.js"},{"path":"src/runtime/index.ts","kind":"import-statement","original":"./runtime/index.js"},{"path":"src/runtime/index.ts","kind":"import-statement","original":"./runtime/index.js"},{"path":"src/protocols/index.ts","kind":"import-statement","original":"./protocols/index.js"},{"path":"src/protocols/index.ts","kind":"import-statement","original":"./protocols/index.js"},{"path":"src/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"}],"format":"esm"}},"outputs":{"dist/fireproof-core/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":574345},"dist/fireproof-core/index.js":{"imports":[{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/core/node","kind":"dynamic-import","external":true},{"path":"@fireproof/core/deno","kind":"dynamic-import","external":true},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"multiformats/bases/base64","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"@fireproof/core/indexeddb","kind":"dynamic-import","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/block","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"charwise","kind":"import-statement","external":true},{"path":"prolly-trees/db-index","kind":"import-statement","external":true},{"path":"prolly-trees/utils","kind":"import-statement","external":true},{"path":"prolly-trees/cache","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"p-limit","kind":"import-statement","external":true},{"path":"@ipld/car/reader","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/block","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@ipld/car/buffer-writer","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"cborg","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@ipld/dag-json","kind":"import-statement","external":true},{"path":"p-retry","kind":"import-statement","external":true},{"path":"p-map","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"multiformats/link","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@ipld/dag-cbor","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt/batch","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/clock","kind":"import-statement","external":true},{"path":"@fireproof/vendor/@web3-storage/pail/crdt","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"jose","kind":"import-statement","external":true},{"path":"jose/key/generate/keypair","kind":"import-statement","external":true},{"path":"multiformats/bases/base58","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"ws","kind":"dynamic-import","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"@adviser/cement","kind":"import-statement","external":true}],"exports":["CRDTImpl","DataAndMetaAndWalAndBaseStore","DatabaseImpl","Index","LedgerFactory","LedgerShell","NotFoundError","PACKAGE_VERSION","PARAM","UInt8ArrayEqual","blockstore","bs","coerceIntoUint8","coercePromiseIntoUint8","defaultWriteQueueOpts","ensureLogger","ensureSuperLog","ensureSuperThis","ensureURIDefaults","exceptionWrapper","falsyToUndef","fireproof","getKey","getName","getStore","index","inplaceFilter","isDatabase","isFalsy","isLedger","isNotFoundError","keyConfigOpts","makeName","onSuperThis","protocols","ps","rt","runtime","storeType2DataMetaWal","throwFalsy","toSortedArray","toStoreURIRuntime"],"entryPoint":"src/index.ts","inputs":{"src/ledger.ts":{"bytesInOutput":6669},"src/utils.ts":{"bytesInOutput":9894},"src/types.ts":{"bytesInOutput":1365},"src/write-queue.ts":{"bytesInOutput":2074},"src/runtime/files.ts":{"bytesInOutput":1065},"src/runtime/key-bag.ts":{"bytesInOutput":13136},"src/runtime/gateways/file/sys-file-system-factory.ts":{"bytesInOutput":404},"src/runtime/gateways/file/key-bag-file.ts":{"bytesInOutput":1047},"src/runtime/key-bag-memory.ts":{"bytesInOutput":965},"src/blockstore/register-store-protocol.ts":{"bytesInOutput":2876},"src/runtime/gateways/file/version.ts":{"bytesInOutput":38},"src/runtime/gateways/indexeddb-version.ts":{"bytesInOutput":43},"src/runtime/gateways/file/gateway-impl.ts":{"bytesInOutput":4233},"src/runtime/gateways/file/utils.ts":{"bytesInOutput":772},"src/runtime/gateways/memory/gateway.ts":{"bytesInOutput":1661},"src/runtime/gateways/memory/version.ts":{"bytesInOutput":37},"src/runtime/gateways/def-serde-gateway.ts":{"bytesInOutput":2281},"src/blockstore/fp-envelope.ts":{"bytesInOutput":339},"src/runtime/gateways/fp-envelope-serialize.ts":{"bytesInOutput":5120},"src/runtime/wait-pr-multiformats/block.ts":{"bytesInOutput":2500},"src/indexer-helpers.ts":{"bytesInOutput":4064},"src/indexer.ts":{"bytesInOutput":8141},"src/database.ts":{"bytesInOutput":3525},"src/crdt.ts":{"bytesInOutput":4455},"src/blockstore/index.ts":{"bytesInOutput":1445},"src/blockstore/types.ts":{"bytesInOutput":1246},"src/blockstore/store-factory.ts":{"bytesInOutput":3848},"src/blockstore/store.ts":{"bytesInOutput":16806},"src/blockstore/loader.ts":{"bytesInOutput":13704},"src/blockstore/loader-helpers.ts":{"bytesInOutput":561},"src/blockstore/transaction.ts":{"bytesInOutput":7275},"src/blockstore/commit-queue.ts":{"bytesInOutput":1239},"src/blockstore/commitor.ts":{"bytesInOutput":3556},"src/blockstore/task-manager.ts":{"bytesInOutput":1665},"src/blockstore/attachable-store.ts":{"bytesInOutput":7630},"src/runtime/keyed-crypto.ts":{"bytesInOutput":6157},"src/blockstore/interceptor-gateway.ts":{"bytesInOutput":3791},"src/blockstore/uri-interceptor.ts":{"bytesInOutput":1337},"src/crdt-helpers.ts":{"bytesInOutput":10068},"src/crdt-clock.ts":{"bytesInOutput":4538},"src/apply-head-queue.ts":{"bytesInOutput":1260},"src/context.ts":{"bytesInOutput":236},"src/index.ts":{"bytesInOutput":0},"src/runtime/index.ts":{"bytesInOutput":1234},"src/runtime/wait-pr-multiformats/index.ts":{"bytesInOutput":153},"src/runtime/wait-pr-multiformats/codec-interface.ts":{"bytesInOutput":34},"src/runtime/sts-service/index.ts":{"bytesInOutput":3266},"src/runtime/gateways/index.ts":{"bytesInOutput":373},"src/runtime/gateways/file/index.ts":{"bytesInOutput":151},"src/runtime/gateways/cloud/gateway.ts":{"bytesInOutput":17483},"src/protocols/cloud/msg-types.ts":{"bytesInOutput":6175},"src/protocols/cloud/msger.ts":{"bytesInOutput":6146},"src/protocols/cloud/http-connection.ts":{"bytesInOutput":4678},"src/protocols/cloud/msg-raw-connection-base.ts":{"bytesInOutput":632},"src/protocols/cloud/ws-connection.ts":{"bytesInOutput":5053},"src/protocols/cloud/msg-types-data.ts":{"bytesInOutput":1280},"src/protocols/cloud/msg-types-meta.ts":{"bytesInOutput":2128},"src/runtime/meta-key-hack.ts":{"bytesInOutput":6159},"src/protocols/index.ts":{"bytesInOutput":91},"src/protocols/cloud/index.ts":{"bytesInOutput":3369},"src/protocols/cloud/msg-types-wal.ts":{"bytesInOutput":1205},"src/version.ts":{"bytesInOutput":77}},"bytes":226364}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireproof/core",
3
- "version": "0.20.0-dev-preview-54",
3
+ "version": "0.20.0-dev-preview-57",
4
4
  "description": "Live ledger for the web.",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -72,24 +72,26 @@
72
72
  },
73
73
  "devDependencies": {},
74
74
  "peerDependencies": {
75
- "@adviser/cement": "~0.4.1",
75
+ "@adviser/cement": "~0.4.2",
76
76
  "@fireproof/vendor": "~2.0.0",
77
77
  "react": ">=18.0.0"
78
78
  },
79
79
  "dependencies": {
80
- "@adviser/cement": "~0.4.1",
81
- "@fireproof/vendor": "~2.0.1",
80
+ "@adviser/cement": "~0.4.3",
81
+ "@fireproof/vendor": "~2.0.2",
82
82
  "@ipld/car": "^5.4.0",
83
83
  "@ipld/dag-cbor": "^9.2.2",
84
84
  "@ipld/dag-json": "^10.2.3",
85
85
  "cborg": "^4.2.8",
86
+ "jose": "^6.0.10",
86
87
  "multiformats": "^13.3.2",
87
88
  "charwise": "^3.0.1",
88
89
  "prolly-trees": "^1.0.4",
89
90
  "idb": "^8.0.2",
90
91
  "p-limit": "^6.2.0",
91
92
  "p-map": "^7.0.3",
92
- "p-retry": "^6.2.1"
93
+ "p-retry": "^6.2.1",
94
+ "ws": "^8.18.1"
93
95
  },
94
96
  "scripts": {}
95
97
  }
package/react/index.cjs CHANGED
@@ -255,7 +255,7 @@ var useChanges = topLevelUseChanges;
255
255
 
256
256
  // src/react/img-file.ts
257
257
  var import_react2 = __toESM(require("react"), 1);
258
- var { URL } = window;
258
+ var { URL } = globalThis;
259
259
  function isFile(obj) {
260
260
  return "type" in obj && "size" in obj && "stream" in obj && typeof obj.stream === "function";
261
261
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/react/index.ts","../../../src/react/useFireproof.ts","../../../src/react/useDocument.ts","../../../src/react/useLiveQuery.ts","../../../src/react/useAllDocs.ts","../../../src/react/useChanges.ts","../../../src/react/img-file.ts"],"sourcesContent":["export {\n type TLUseDocument,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useDocument,\n} from \"./useDocument.js\";\nexport { FireproofCtx, type UseFireproof, useFireproof, type LiveQueryResult, type UseDocumentResult } from \"./useFireproof.js\";\nexport {\n type TLUseLiveQuery,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useLiveQuery,\n} from \"./useLiveQuery.js\";\nexport {\n type TLUseAllDocs,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useAllDocs,\n} from \"./useAllDocs.js\";\nexport {\n type TLUseChanges,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useChanges,\n} from \"./useChanges.js\";\n\nexport { ImgFile } from \"./img-file.js\";\n","import type {\n ConfigOpts,\n DocFragment,\n DocResponse,\n DocSet,\n DocTypes,\n DocWithId,\n IndexKeyType,\n IndexRow,\n MapFn,\n QueryOpts,\n Database,\n} from \"@fireproof/core\";\nimport { fireproof } from \"@fireproof/core\";\nimport { useCallback, useEffect, useMemo, useState, useRef } from \"react\";\nimport type { AllDocsQueryOpts, ChangesOptions, ClockHead } from \"@fireproof/core\";\n\nexport interface LiveQueryResult<T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T> {\n readonly docs: DocWithId<T>[];\n readonly rows: IndexRow<K, T, R>[];\n /** @internal */\n readonly length: number;\n /** @internal */\n map<U>(callbackfn: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => U): U[];\n /** @internal */\n filter(predicate: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => boolean): DocWithId<T>[];\n /** @internal */\n forEach(callbackfn: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => void): void;\n /** @internal */\n [Symbol.iterator](): Iterator<DocWithId<T>>;\n}\n\nexport type UseLiveQuery = <T extends DocTypes, K extends IndexKeyType = string, R extends DocFragment = T>(\n mapFn: string | MapFn<T>,\n query?: QueryOpts<K>,\n initialRows?: IndexRow<K, T, R>[],\n) => LiveQueryResult<T, K, R>;\n\nexport interface AllDocsResult<T extends DocTypes> {\n readonly docs: DocWithId<T>[];\n}\n\nexport interface ChangesResult<T extends DocTypes> {\n readonly docs: DocWithId<T>[];\n}\n\nexport type UseAllDocs = <T extends DocTypes>(query?: AllDocsQueryOpts) => AllDocsResult<T>;\n\nexport type UseChanges = <T extends DocTypes>(since: ClockHead, opts: ChangesOptions) => ChangesResult<T>;\n\ninterface UpdateDocFnOptions {\n readonly replace?: boolean;\n readonly reset?: boolean;\n}\n\ntype UpdateDocFn<T extends DocTypes> = (newDoc?: DocSet<T>, options?: UpdateDocFnOptions) => void;\n\ntype StoreDocFn<T extends DocTypes> = (existingDoc?: DocWithId<T>) => Promise<DocResponse>;\n\ntype DeleteDocFn<T extends DocTypes> = (existingDoc?: DocWithId<T>) => Promise<DocResponse>;\n\ntype UseDocumentResultTuple<T extends DocTypes> = [DocWithId<T>, UpdateDocFn<T>, StoreDocFn<T>, DeleteDocFn<T>];\n\ninterface UseDocumentResultObject<T extends DocTypes> {\n doc: DocWithId<T>;\n merge: (newDoc: Partial<T>) => void;\n replace: (newDoc: T) => void;\n reset: () => void;\n refresh: () => Promise<void>;\n save: StoreDocFn<T>;\n remove: DeleteDocFn<T>;\n submit: (e?: Event) => Promise<void>;\n}\n\nexport type UseDocumentResult<T extends DocTypes> = UseDocumentResultObject<T> & UseDocumentResultTuple<T>;\n\nexport type UseDocumentInitialDocOrFn<T extends DocTypes> = DocSet<T> | (() => DocSet<T>);\nexport type UseDocument = <T extends DocTypes>(initialDocOrFn: UseDocumentInitialDocOrFn<T>) => UseDocumentResult<T>;\n\nexport interface UseFireproof {\n readonly database: Database;\n /**\n * ## Summary\n *\n * React hook that provides the ability to create/update/save new Fireproof documents into your custom Fireproof database.\n * The creation occurs when you do not pass in an `_id` as part of your initial document -- the database will assign a new\n * one when you call the provided `save` handler. The hook also provides generics support so you can inline your custom type into\n * the invocation to receive type-safety and auto-complete support in your IDE.\n *\n * ## Usage\n *\n * ```tsx\n * const todo = useDocument<Todo>({\n * text: '',\n * date: Date.now(),\n * completed: false\n * })\n * // Access via object properties\n * todo.doc // The current document\n * todo.merge({ completed: true }) // Update specific fields\n * todo.replace({ text: 'new', date: Date.now(), completed: false }) // Replace entire doc\n * todo.save() // Save changes\n * todo.remove() // Delete document\n * todo.reset() // Reset to initial state\n * todo.refresh() // Refresh from database\n *\n * // Or use tuple destructuring for legacy compatibility\n * const [doc, updateDoc, saveDoc, removeDoc] = todo\n * ```\n *\n * ## Overview\n *\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useDocument: UseDocument;\n /**\n * ## Summary\n * React hook that provides access to live query results, enabling real-time updates in your app.\n *\n * ## Usage\n * ```tsx\n * const result = useLiveQuery(\"date\"); // using string key\n * const result = useLiveQuery('date', { limit: 10, descending: true }) // key + options\n * const result = useLiveQuery<CustomType>(\"date\"); // using generics\n * const result = useLiveQuery((doc) => doc.date)); // using map function\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useLiveQuery: UseLiveQuery;\n /**\n * ## Summary\n * React hook that provides access to all documents in the database, sorted by `_id`.\n *\n * ## Usage\n * ```tsx\n * const result = useAllDocs({ limit: 10, descending: true }); // with options\n * const result = useAllDocs(); // without options\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useAllDocs: UseAllDocs;\n /**\n * ## Summary\n * React hook that provides access to all new documents in the database added since the last time the changes was called\n *\n * ## Usage\n * ```tsx\n * const result = useChanges(prevresult.clock,{limit:10}); // with options\n * const result = useChanges(); // without options\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs`, `useChanges` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useChanges: UseChanges;\n}\n\n/**\n * @deprecated Use the `useFireproof` hook instead\n */\nexport const FireproofCtx = {} as UseFireproof;\n\nfunction deepClone<T>(value: T): T {\n if (typeof structuredClone !== \"undefined\") {\n return structuredClone(value);\n } else {\n // Fallback if structuredClone is not available (older browsers, older Node versions, etc.)\n return JSON.parse(JSON.stringify(value));\n }\n}\n\n/**\n *\n * ## Summary\n *\n * React hook to create a custom-named Fireproof database and provides the utility hooks to query against it.\n *\n * ## Usage\n * ```tsx\n * const { database, useLiveQuery, useDocument } = useFireproof(\"dbname\");\n * const { database, useLiveQuery, useDocument } = useFireproof(\"dbname\", { ...options });\n * ```\n *\n * ## Overview\n *\n * TL;DR: Only use this hook if you need to configure a database name other than the default `useFireproof`.\n *\n * For most applications, using the `useLiveQuery` or `useDocument` hooks exported from `use-fireproof` should\n * suffice for the majority of use-cases. Under the hood, they act against a database named `useFireproof` instantiated with\n * default configurations. However, if you need to do a custom database setup or configure a database name more to your liking\n * than the default `useFireproof`, then use `useFireproof` as it exists for that purpose. It will provide you with the\n * custom database accessor and *lexically scoped* versions of `useLiveQuery` and `useDocument` that act against said\n * custom database.\n *\n */\nexport function useFireproof(name: string | Database = \"useFireproof\", config: ConfigOpts = {}): UseFireproof {\n const database = typeof name === \"string\" ? fireproof(name, config) : name;\n\n const updateHappenedRef = useRef(false);\n\n function useDocument<T extends DocTypes>(initialDocOrFn?: UseDocumentInitialDocOrFn<T>): UseDocumentResult<T> {\n let initialDoc: DocSet<T>;\n if (typeof initialDocOrFn === \"function\") {\n initialDoc = initialDocOrFn();\n } else {\n initialDoc = initialDocOrFn ?? ({} as T);\n }\n\n const originalInitialDoc = useMemo(() => deepClone({ ...initialDoc }), []);\n\n const [doc, setDoc] = useState(initialDoc);\n\n const refresh = useCallback(async () => {\n const gotDoc = doc._id ? await database.get<T>(doc._id).catch(() => initialDoc) : initialDoc;\n setDoc(gotDoc);\n }, [doc._id]);\n\n const save: StoreDocFn<T> = useCallback(\n async (existingDoc) => {\n updateHappenedRef.current = false;\n const toSave = existingDoc ?? doc;\n const res = await database.put(toSave);\n\n if (!updateHappenedRef.current && !doc._id && !existingDoc) {\n setDoc((d) => ({ ...d, _id: res.id }));\n }\n\n return res;\n },\n [doc],\n );\n\n const remove: DeleteDocFn<T> = useCallback(\n async (existingDoc) => {\n const id = existingDoc?._id ?? doc._id;\n if (!id) throw database.logger.Error().Msg(`Document must have an _id to be removed`).AsError();\n const gotDoc = await database.get<T>(id).catch(() => undefined);\n if (!gotDoc) throw database.logger.Error().Str(\"id\", id).Msg(`Document not found`).AsError();\n const res = await database.del(id);\n setDoc(initialDoc);\n return res;\n },\n [doc, initialDoc],\n );\n\n // New granular update methods\n const merge = useCallback((newDoc: Partial<T>) => {\n updateHappenedRef.current = true;\n setDoc((prev) => ({ ...prev, ...newDoc }));\n }, []);\n\n const replace = useCallback((newDoc: T) => {\n updateHappenedRef.current = true;\n setDoc(newDoc);\n }, []);\n\n const reset = useCallback(() => {\n updateHappenedRef.current = true;\n setDoc({ ...originalInitialDoc });\n }, [originalInitialDoc]);\n\n // Legacy-compatible updateDoc\n const updateDoc = useCallback(\n (newDoc?: DocSet<T>, opts = { replace: false, reset: false }) => {\n if (!newDoc) {\n return opts.reset ? reset() : refresh();\n }\n return opts.replace ? replace(newDoc as T) : merge(newDoc);\n },\n [refresh, reset, replace, merge],\n );\n\n useEffect(() => {\n if (!doc._id) return;\n return database.subscribe((changes) => {\n if (updateHappenedRef.current) {\n return;\n }\n if (changes.find((c) => c._id === doc._id)) {\n void refresh();\n }\n }, true);\n }, [doc._id, refresh]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const submit = useCallback(\n async (e?: Event) => {\n if (e?.preventDefault) e.preventDefault();\n await save();\n reset();\n },\n [save, reset],\n );\n\n // Primary Object API with both new and legacy methods\n const apiObject = {\n doc: { ...doc } as DocWithId<T>,\n merge,\n replace,\n reset,\n refresh,\n save,\n remove,\n submit,\n };\n\n // Make the object properly iterable\n const tuple = [{ ...doc }, updateDoc, save, remove, reset, refresh];\n Object.assign(apiObject, tuple);\n Object.defineProperty(apiObject, Symbol.iterator, {\n enumerable: false,\n value: function* () {\n yield* tuple;\n },\n });\n\n return apiObject as UseDocumentResult<T>;\n }\n\n function useLiveQuery<T extends DocTypes, K extends IndexKeyType = string, R extends DocFragment = T>(\n mapFn: MapFn<T> | string,\n query = {},\n initialRows: IndexRow<K, T, R>[] = [],\n ): LiveQueryResult<T, K, R> {\n const [result, setResult] = useState<LiveQueryResult<T, K, R>>(() => {\n const docs = initialRows.map((r) => r.doc).filter((r): r is DocWithId<T> => !!r);\n return {\n rows: initialRows,\n docs,\n length: docs.length,\n map: (fn) => docs.map(fn),\n filter: (fn) => docs.filter(fn),\n forEach: (fn) => docs.forEach(fn),\n [Symbol.iterator]: () => docs[Symbol.iterator](),\n };\n });\n\n const queryString = useMemo(() => JSON.stringify(query), [query]);\n const mapFnString = useMemo(() => mapFn.toString(), [mapFn]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.query<K, T, R>(mapFn, query);\n const docs = res.rows.map((r) => r.doc as DocWithId<T>).filter((r): r is DocWithId<T> => !!r);\n setResult({\n ...res,\n docs,\n length: docs.length,\n map: (fn) => docs.map(fn),\n filter: (fn) => docs.filter(fn),\n forEach: (fn) => docs.forEach(fn),\n [Symbol.iterator]: () => docs[Symbol.iterator](),\n });\n }, [mapFnString, queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n function useAllDocs<T extends DocTypes>(query: AllDocsQueryOpts = {}): AllDocsResult<T> {\n const [result, setResult] = useState<AllDocsResult<T>>({\n docs: [],\n });\n\n const queryString = useMemo(() => JSON.stringify(query), [query]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.allDocs<T>(query);\n setResult({ ...res, docs: res.rows.map((r) => r.value as DocWithId<T>) });\n }, [queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n function useChanges<T extends DocTypes>(since: ClockHead = [], opts: ChangesOptions = {}): ChangesResult<T> {\n const [result, setResult] = useState<ChangesResult<T>>({\n docs: [],\n });\n\n const queryString = useMemo(() => JSON.stringify(opts), [opts]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.changes<T>(since, opts);\n setResult({ ...res, docs: res.rows.map((r) => r.value as DocWithId<T>) });\n }, [since, queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n return { database, useLiveQuery, useDocument, useAllDocs, useChanges };\n}\n","import { Database, DocTypes, DocWithId } from \"@fireproof/core\";\n\nimport { UseDocument, UseDocumentResult, useFireproof } from \"./useFireproof.js\";\n\nexport interface TLUseDocument {\n <T extends DocTypes>(initialDoc: DocWithId<T>): UseDocumentResult<T>;\n database: Database;\n}\n\nfunction topLevelUseDocument(...args: Parameters<UseDocument>) {\n const { useDocument, database } = useFireproof();\n (topLevelUseDocument as TLUseDocument).database = database;\n return useDocument(...args);\n}\n\n/**\n * ## Summary\n *\n * React hook that provides the ability to create and manage Fireproof documents. The creation occurs when\n * you do not pass in an `_id` as part of your initial document -- the database will assign a new one when\n * you call the provided `save` handler.\n *\n * ## Usage\n *\n * ```tsx\n * const todo = useDocument({\n * text: '',\n * date: Date.now(),\n * completed: false\n * })\n * // Access via object properties\n * todo.doc // The current document\n * todo.merge({ completed: true }) // Update specific fields\n * todo.replace({ text: 'new', date: Date.now(), completed: false }) // Replace entire doc\n * todo.save() // Save changes\n * todo.remove() // Delete document\n * todo.reset() // Reset to initial state\n * todo.refresh() // Refresh from database\n * ```\n *\n * ### Create document with custom ID\n * Custom IDs let you create predictable document identifiers for data that has\n * a natural unique key, like userIds or email addresses. This makes it easy to\n * look up and update specific documents without having to query for them first.\n * For example, storing user profiles by customerId:\n *\n * ```tsx\n * const profile = useDocument({\n * _id: `${props.customerId}-profile`, // Predictable ID based on customerId\n * name: \"\",\n * company: \"\",\n * startedAt: Date.now()\n * })\n * ```\n *\n * ## API\n *\n * - `doc`: The current document state\n * - `merge(newDoc)`: Merge new properties into the document\n * - `replace(newDoc)`: Replace the entire document\n * - `reset()`: Reset to initial state\n * - `refresh()`: Refresh from database\n * - `save()`: Save changes to the document\n * - `remove()`: Delete the document\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useDocument = topLevelUseDocument as TLUseDocument;\n","import { Database, DocFragment, DocTypes, IndexKeyType } from \"@fireproof/core\";\n\nimport { LiveQueryResult, useFireproof, UseLiveQuery } from \"./useFireproof.js\";\n\nexport interface TLUseLiveQuery {\n <T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T>(\n ...args: Parameters<UseLiveQuery>\n ): LiveQueryResult<T, K, R>;\n database: Database;\n}\n\nfunction topLevelUseLiveQuery(...args: Parameters<UseLiveQuery>) {\n const { useLiveQuery, database } = useFireproof();\n (topLevelUseLiveQuery as TLUseLiveQuery).database = database;\n return useLiveQuery(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to live query results, enabling real-time updates in your app. This uses\n * the default database named \"useFireproof\" under the hood which you can also access via the `database` accessor.\n *\n * ## Usage\n * ```tsx\n * const results = useLiveQuery(\"date\"); // using string\n * const results = useLiveQuery((doc) => doc.date)); // using map function\n * const database = useLiveQuery.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useLiveQuery = topLevelUseLiveQuery as TLUseLiveQuery;\n","import { Database, DocTypes } from \"@fireproof/core\";\n\nimport { AllDocsResult, useFireproof, UseAllDocs } from \"./useFireproof.js\";\n\nexport interface TLUseAllDocs {\n <T extends DocTypes>(...args: Parameters<UseAllDocs>): AllDocsResult<T>;\n database: Database;\n}\n\nfunction topLevelUseAllDocs(...args: Parameters<UseAllDocs>) {\n const { useAllDocs, database } = useFireproof();\n (topLevelUseAllDocs as TLUseAllDocs).database = database;\n return useAllDocs(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to all documents in the database, sorted by `_id`.\n *\n * ## Usage\n * ```tsx\n * const result = useAllDocs({ limit: 10, descending: true }); // with options\n * const result = useAllDocs(); // without options\n * const database = useAllDocs.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useAllDocs = topLevelUseAllDocs as TLUseAllDocs;\n","import { DocTypes, Database } from \"@fireproof/core\";\n\nimport { ChangesResult, useFireproof, UseChanges } from \"./useFireproof.js\";\n\nexport interface TLUseChanges {\n <T extends DocTypes>(...args: Parameters<UseChanges>): ChangesResult<T>;\n database: Database;\n}\n\nfunction topLevelUseChanges(...args: Parameters<UseChanges>) {\n const { useChanges, database } = useFireproof();\n (topLevelUseChanges as TLUseChanges).database = database;\n return useChanges(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to all new documents in the database added since the last time the changes was called\n *\n * ## Usage\n * ```tsx\n * const result = useChanges(prevresult.clock,{limit:10}); // with options\n * const result = useChanges(); // without options\n * const database = useChanges.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs`, `useChanges` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useChanges = topLevelUseChanges as TLUseChanges;\n","import React, { useState, useEffect, ImgHTMLAttributes } from \"react\";\nimport { DocFileMeta } from \"use-fireproof\";\n\nconst { URL } = window;\n\n// Union type to support both direct File objects and metadata objects\ntype FileType = File | DocFileMeta;\n\ninterface ImgFileProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\"> {\n file?: FileType;\n /**\n * @deprecated Use 'file' instead. This is for internal use only to support legacy code.\n * @internal\n */\n meta?: FileType;\n}\n\n// Helper function to determine if the object is a File-like object\nfunction isFile(obj: FileType): obj is File {\n return \"type\" in obj && \"size\" in obj && \"stream\" in obj && typeof obj.stream === \"function\";\n}\n\n// Helper function to determine if the object is a DocFileMeta\nfunction isFileMeta(obj: FileType): obj is DocFileMeta {\n return \"type\" in obj && \"size\" in obj && \"file\" in obj && typeof obj.file === \"function\";\n}\n\nexport function ImgFile({ file, meta, ...imgProps }: ImgFileProps) {\n const [imgDataUrl, setImgDataUrl] = useState(\"\");\n\n // Use meta as fallback if file is not provided (for backward compatibility)\n const fileData = file || meta;\n\n useEffect(() => {\n if (!fileData) return;\n\n const loadFile = async () => {\n let fileObj: File | null = null;\n let fileType = \"\";\n\n switch (true) {\n case isFile(fileData):\n fileObj = fileData;\n fileType = fileData.type;\n break;\n case isFileMeta(fileData):\n fileType = fileData.type;\n fileObj = (await fileData.file?.()) || null;\n break;\n }\n\n if (fileObj && /image/.test(fileType)) {\n const src = URL.createObjectURL(fileObj);\n setImgDataUrl(src);\n return () => URL.revokeObjectURL(src);\n }\n };\n\n let isMounted = true;\n let cleanup: (() => void) | undefined;\n\n loadFile().then((result) => {\n if (isMounted) {\n cleanup = result;\n } else if (result) {\n result();\n }\n });\n\n return () => {\n isMounted = false;\n if (cleanup) cleanup();\n };\n }, [fileData]);\n\n return imgDataUrl\n ? React.createElement(\"img\", {\n src: imgDataUrl,\n ...imgProps,\n })\n : null;\n}\n\nexport default ImgFile;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaA,kBAA0B;AAC1B,mBAAkE;AA8J3D,IAAM,eAAe,CAAC;AAE7B,SAAS,UAAa,OAAa;AACjC,MAAI,OAAO,oBAAoB,aAAa;AAC1C,WAAO,gBAAgB,KAAK;AAAA,EAC9B,OAAO;AAEL,WAAO,KAAK,MAAM,KAAK,UAAU,KAAK,CAAC;AAAA,EACzC;AACF;AA0BO,SAAS,aAAa,OAA0B,gBAAgB,SAAqB,CAAC,GAAiB;AAC5G,QAAM,WAAW,O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","import_react","React"]}
1
+ {"version":3,"sources":["../../../src/react/index.ts","../../../src/react/useFireproof.ts","../../../src/react/useDocument.ts","../../../src/react/useLiveQuery.ts","../../../src/react/useAllDocs.ts","../../../src/react/useChanges.ts","../../../src/react/img-file.ts"],"sourcesContent":["export {\n type TLUseDocument,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useDocument,\n} from \"./useDocument.js\";\nexport { FireproofCtx, type UseFireproof, useFireproof, type LiveQueryResult, type UseDocumentResult } from \"./useFireproof.js\";\nexport {\n type TLUseLiveQuery,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useLiveQuery,\n} from \"./useLiveQuery.js\";\nexport {\n type TLUseAllDocs,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useAllDocs,\n} from \"./useAllDocs.js\";\nexport {\n type TLUseChanges,\n /** @deprecated Use return values from useFireproof('dbname') instead. Top level usage will be removed in future versions. */\n useChanges,\n} from \"./useChanges.js\";\n\nexport * from \"./img-file.js\";\n","import type {\n ConfigOpts,\n DocFragment,\n DocResponse,\n DocSet,\n DocTypes,\n DocWithId,\n IndexKeyType,\n IndexRow,\n MapFn,\n QueryOpts,\n Database,\n} from \"@fireproof/core\";\nimport { fireproof } from \"@fireproof/core\";\nimport { useCallback, useEffect, useMemo, useState, useRef } from \"react\";\nimport type { AllDocsQueryOpts, ChangesOptions, ClockHead } from \"@fireproof/core\";\n\nexport interface LiveQueryResult<T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T> {\n readonly docs: DocWithId<T>[];\n readonly rows: IndexRow<K, T, R>[];\n /** @internal */\n readonly length: number;\n /** @internal */\n map<U>(callbackfn: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => U): U[];\n /** @internal */\n filter(predicate: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => boolean): DocWithId<T>[];\n /** @internal */\n forEach(callbackfn: (value: DocWithId<T>, index: number, array: DocWithId<T>[]) => void): void;\n /** @internal */\n [Symbol.iterator](): Iterator<DocWithId<T>>;\n}\n\nexport type UseLiveQuery = <T extends DocTypes, K extends IndexKeyType = string, R extends DocFragment = T>(\n mapFn: string | MapFn<T>,\n query?: QueryOpts<K>,\n initialRows?: IndexRow<K, T, R>[],\n) => LiveQueryResult<T, K, R>;\n\nexport interface AllDocsResult<T extends DocTypes> {\n readonly docs: DocWithId<T>[];\n}\n\nexport interface ChangesResult<T extends DocTypes> {\n readonly docs: DocWithId<T>[];\n}\n\nexport type UseAllDocs = <T extends DocTypes>(query?: AllDocsQueryOpts) => AllDocsResult<T>;\n\nexport type UseChanges = <T extends DocTypes>(since: ClockHead, opts: ChangesOptions) => ChangesResult<T>;\n\ninterface UpdateDocFnOptions {\n readonly replace?: boolean;\n readonly reset?: boolean;\n}\n\ntype UpdateDocFn<T extends DocTypes> = (newDoc?: DocSet<T>, options?: UpdateDocFnOptions) => void;\n\ntype StoreDocFn<T extends DocTypes> = (existingDoc?: DocWithId<T>) => Promise<DocResponse>;\n\ntype DeleteDocFn<T extends DocTypes> = (existingDoc?: DocWithId<T>) => Promise<DocResponse>;\n\ntype UseDocumentResultTuple<T extends DocTypes> = [DocWithId<T>, UpdateDocFn<T>, StoreDocFn<T>, DeleteDocFn<T>];\n\ninterface UseDocumentResultObject<T extends DocTypes> {\n doc: DocWithId<T>;\n merge: (newDoc: Partial<T>) => void;\n replace: (newDoc: T) => void;\n reset: () => void;\n refresh: () => Promise<void>;\n save: StoreDocFn<T>;\n remove: DeleteDocFn<T>;\n submit: (e?: Event) => Promise<void>;\n}\n\nexport type UseDocumentResult<T extends DocTypes> = UseDocumentResultObject<T> & UseDocumentResultTuple<T>;\n\nexport type UseDocumentInitialDocOrFn<T extends DocTypes> = DocSet<T> | (() => DocSet<T>);\nexport type UseDocument = <T extends DocTypes>(initialDocOrFn: UseDocumentInitialDocOrFn<T>) => UseDocumentResult<T>;\n\nexport interface UseFireproof {\n readonly database: Database;\n /**\n * ## Summary\n *\n * React hook that provides the ability to create/update/save new Fireproof documents into your custom Fireproof database.\n * The creation occurs when you do not pass in an `_id` as part of your initial document -- the database will assign a new\n * one when you call the provided `save` handler. The hook also provides generics support so you can inline your custom type into\n * the invocation to receive type-safety and auto-complete support in your IDE.\n *\n * ## Usage\n *\n * ```tsx\n * const todo = useDocument<Todo>({\n * text: '',\n * date: Date.now(),\n * completed: false\n * })\n * // Access via object properties\n * todo.doc // The current document\n * todo.merge({ completed: true }) // Update specific fields\n * todo.replace({ text: 'new', date: Date.now(), completed: false }) // Replace entire doc\n * todo.save() // Save changes\n * todo.remove() // Delete document\n * todo.reset() // Reset to initial state\n * todo.refresh() // Refresh from database\n *\n * // Or use tuple destructuring for legacy compatibility\n * const [doc, updateDoc, saveDoc, removeDoc] = todo\n * ```\n *\n * ## Overview\n *\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useDocument: UseDocument;\n /**\n * ## Summary\n * React hook that provides access to live query results, enabling real-time updates in your app.\n *\n * ## Usage\n * ```tsx\n * const result = useLiveQuery(\"date\"); // using string key\n * const result = useLiveQuery('date', { limit: 10, descending: true }) // key + options\n * const result = useLiveQuery<CustomType>(\"date\"); // using generics\n * const result = useLiveQuery((doc) => doc.date)); // using map function\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useLiveQuery: UseLiveQuery;\n /**\n * ## Summary\n * React hook that provides access to all documents in the database, sorted by `_id`.\n *\n * ## Usage\n * ```tsx\n * const result = useAllDocs({ limit: 10, descending: true }); // with options\n * const result = useAllDocs(); // without options\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useAllDocs: UseAllDocs;\n /**\n * ## Summary\n * React hook that provides access to all new documents in the database added since the last time the changes was called\n *\n * ## Usage\n * ```tsx\n * const result = useChanges(prevresult.clock,{limit:10}); // with options\n * const result = useChanges(); // without options\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs`, `useChanges` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\n readonly useChanges: UseChanges;\n}\n\n/**\n * @deprecated Use the `useFireproof` hook instead\n */\nexport const FireproofCtx = {} as UseFireproof;\n\nfunction deepClone<T>(value: T): T {\n if (typeof structuredClone !== \"undefined\") {\n return structuredClone(value);\n } else {\n // Fallback if structuredClone is not available (older browsers, older Node versions, etc.)\n return JSON.parse(JSON.stringify(value));\n }\n}\n\n/**\n *\n * ## Summary\n *\n * React hook to create a custom-named Fireproof database and provides the utility hooks to query against it.\n *\n * ## Usage\n * ```tsx\n * const { database, useLiveQuery, useDocument } = useFireproof(\"dbname\");\n * const { database, useLiveQuery, useDocument } = useFireproof(\"dbname\", { ...options });\n * ```\n *\n * ## Overview\n *\n * TL;DR: Only use this hook if you need to configure a database name other than the default `useFireproof`.\n *\n * For most applications, using the `useLiveQuery` or `useDocument` hooks exported from `use-fireproof` should\n * suffice for the majority of use-cases. Under the hood, they act against a database named `useFireproof` instantiated with\n * default configurations. However, if you need to do a custom database setup or configure a database name more to your liking\n * than the default `useFireproof`, then use `useFireproof` as it exists for that purpose. It will provide you with the\n * custom database accessor and *lexically scoped* versions of `useLiveQuery` and `useDocument` that act against said\n * custom database.\n *\n */\nexport function useFireproof(name: string | Database = \"useFireproof\", config: ConfigOpts = {}): UseFireproof {\n const database = typeof name === \"string\" ? fireproof(name, config) : name;\n\n const updateHappenedRef = useRef(false);\n\n function useDocument<T extends DocTypes>(initialDocOrFn?: UseDocumentInitialDocOrFn<T>): UseDocumentResult<T> {\n let initialDoc: DocSet<T>;\n if (typeof initialDocOrFn === \"function\") {\n initialDoc = initialDocOrFn();\n } else {\n initialDoc = initialDocOrFn ?? ({} as T);\n }\n\n const originalInitialDoc = useMemo(() => deepClone({ ...initialDoc }), []);\n\n const [doc, setDoc] = useState(initialDoc);\n\n const refresh = useCallback(async () => {\n const gotDoc = doc._id ? await database.get<T>(doc._id).catch(() => initialDoc) : initialDoc;\n setDoc(gotDoc);\n }, [doc._id]);\n\n const save: StoreDocFn<T> = useCallback(\n async (existingDoc) => {\n updateHappenedRef.current = false;\n const toSave = existingDoc ?? doc;\n const res = await database.put(toSave);\n\n if (!updateHappenedRef.current && !doc._id && !existingDoc) {\n setDoc((d) => ({ ...d, _id: res.id }));\n }\n\n return res;\n },\n [doc],\n );\n\n const remove: DeleteDocFn<T> = useCallback(\n async (existingDoc) => {\n const id = existingDoc?._id ?? doc._id;\n if (!id) throw database.logger.Error().Msg(`Document must have an _id to be removed`).AsError();\n const gotDoc = await database.get<T>(id).catch(() => undefined);\n if (!gotDoc) throw database.logger.Error().Str(\"id\", id).Msg(`Document not found`).AsError();\n const res = await database.del(id);\n setDoc(initialDoc);\n return res;\n },\n [doc, initialDoc],\n );\n\n // New granular update methods\n const merge = useCallback((newDoc: Partial<T>) => {\n updateHappenedRef.current = true;\n setDoc((prev) => ({ ...prev, ...newDoc }));\n }, []);\n\n const replace = useCallback((newDoc: T) => {\n updateHappenedRef.current = true;\n setDoc(newDoc);\n }, []);\n\n const reset = useCallback(() => {\n updateHappenedRef.current = true;\n setDoc({ ...originalInitialDoc });\n }, [originalInitialDoc]);\n\n // Legacy-compatible updateDoc\n const updateDoc = useCallback(\n (newDoc?: DocSet<T>, opts = { replace: false, reset: false }) => {\n if (!newDoc) {\n return opts.reset ? reset() : refresh();\n }\n return opts.replace ? replace(newDoc as T) : merge(newDoc);\n },\n [refresh, reset, replace, merge],\n );\n\n useEffect(() => {\n if (!doc._id) return;\n return database.subscribe((changes) => {\n if (updateHappenedRef.current) {\n return;\n }\n if (changes.find((c) => c._id === doc._id)) {\n void refresh();\n }\n }, true);\n }, [doc._id, refresh]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const submit = useCallback(\n async (e?: Event) => {\n if (e?.preventDefault) e.preventDefault();\n await save();\n reset();\n },\n [save, reset],\n );\n\n // Primary Object API with both new and legacy methods\n const apiObject = {\n doc: { ...doc } as DocWithId<T>,\n merge,\n replace,\n reset,\n refresh,\n save,\n remove,\n submit,\n };\n\n // Make the object properly iterable\n const tuple = [{ ...doc }, updateDoc, save, remove, reset, refresh];\n Object.assign(apiObject, tuple);\n Object.defineProperty(apiObject, Symbol.iterator, {\n enumerable: false,\n value: function* () {\n yield* tuple;\n },\n });\n\n return apiObject as UseDocumentResult<T>;\n }\n\n function useLiveQuery<T extends DocTypes, K extends IndexKeyType = string, R extends DocFragment = T>(\n mapFn: MapFn<T> | string,\n query = {},\n initialRows: IndexRow<K, T, R>[] = [],\n ): LiveQueryResult<T, K, R> {\n const [result, setResult] = useState<LiveQueryResult<T, K, R>>(() => {\n const docs = initialRows.map((r) => r.doc).filter((r): r is DocWithId<T> => !!r);\n return {\n rows: initialRows,\n docs,\n length: docs.length,\n map: (fn) => docs.map(fn),\n filter: (fn) => docs.filter(fn),\n forEach: (fn) => docs.forEach(fn),\n [Symbol.iterator]: () => docs[Symbol.iterator](),\n };\n });\n\n const queryString = useMemo(() => JSON.stringify(query), [query]);\n const mapFnString = useMemo(() => mapFn.toString(), [mapFn]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.query<K, T, R>(mapFn, query);\n const docs = res.rows.map((r) => r.doc as DocWithId<T>).filter((r): r is DocWithId<T> => !!r);\n setResult({\n ...res,\n docs,\n length: docs.length,\n map: (fn) => docs.map(fn),\n filter: (fn) => docs.filter(fn),\n forEach: (fn) => docs.forEach(fn),\n [Symbol.iterator]: () => docs[Symbol.iterator](),\n });\n }, [mapFnString, queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n function useAllDocs<T extends DocTypes>(query: AllDocsQueryOpts = {}): AllDocsResult<T> {\n const [result, setResult] = useState<AllDocsResult<T>>({\n docs: [],\n });\n\n const queryString = useMemo(() => JSON.stringify(query), [query]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.allDocs<T>(query);\n setResult({ ...res, docs: res.rows.map((r) => r.value as DocWithId<T>) });\n }, [queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n function useChanges<T extends DocTypes>(since: ClockHead = [], opts: ChangesOptions = {}): ChangesResult<T> {\n const [result, setResult] = useState<ChangesResult<T>>({\n docs: [],\n });\n\n const queryString = useMemo(() => JSON.stringify(opts), [opts]);\n\n const refreshRows = useCallback(async () => {\n const res = await database.changes<T>(since, opts);\n setResult({ ...res, docs: res.rows.map((r) => r.value as DocWithId<T>) });\n }, [since, queryString]);\n\n useEffect(() => {\n refreshRows(); // Initial data fetch\n return database.subscribe(refreshRows);\n }, [refreshRows]);\n\n return result;\n }\n\n return { database, useLiveQuery, useDocument, useAllDocs, useChanges };\n}\n","import { Database, DocTypes, DocWithId } from \"@fireproof/core\";\n\nimport { UseDocument, UseDocumentResult, useFireproof } from \"./useFireproof.js\";\n\nexport interface TLUseDocument {\n <T extends DocTypes>(initialDoc: DocWithId<T>): UseDocumentResult<T>;\n database: Database;\n}\n\nfunction topLevelUseDocument(...args: Parameters<UseDocument>) {\n const { useDocument, database } = useFireproof();\n (topLevelUseDocument as TLUseDocument).database = database;\n return useDocument(...args);\n}\n\n/**\n * ## Summary\n *\n * React hook that provides the ability to create and manage Fireproof documents. The creation occurs when\n * you do not pass in an `_id` as part of your initial document -- the database will assign a new one when\n * you call the provided `save` handler.\n *\n * ## Usage\n *\n * ```tsx\n * const todo = useDocument({\n * text: '',\n * date: Date.now(),\n * completed: false\n * })\n * // Access via object properties\n * todo.doc // The current document\n * todo.merge({ completed: true }) // Update specific fields\n * todo.replace({ text: 'new', date: Date.now(), completed: false }) // Replace entire doc\n * todo.save() // Save changes\n * todo.remove() // Delete document\n * todo.reset() // Reset to initial state\n * todo.refresh() // Refresh from database\n * ```\n *\n * ### Create document with custom ID\n * Custom IDs let you create predictable document identifiers for data that has\n * a natural unique key, like userIds or email addresses. This makes it easy to\n * look up and update specific documents without having to query for them first.\n * For example, storing user profiles by customerId:\n *\n * ```tsx\n * const profile = useDocument({\n * _id: `${props.customerId}-profile`, // Predictable ID based on customerId\n * name: \"\",\n * company: \"\",\n * startedAt: Date.now()\n * })\n * ```\n *\n * ## API\n *\n * - `doc`: The current document state\n * - `merge(newDoc)`: Merge new properties into the document\n * - `replace(newDoc)`: Replace the entire document\n * - `reset()`: Reset to initial state\n * - `refresh()`: Refresh from database\n * - `save()`: Save changes to the document\n * - `remove()`: Delete the document\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useDocument = topLevelUseDocument as TLUseDocument;\n","import { Database, DocFragment, DocTypes, IndexKeyType } from \"@fireproof/core\";\n\nimport { LiveQueryResult, useFireproof, UseLiveQuery } from \"./useFireproof.js\";\n\nexport interface TLUseLiveQuery {\n <T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T>(\n ...args: Parameters<UseLiveQuery>\n ): LiveQueryResult<T, K, R>;\n database: Database;\n}\n\nfunction topLevelUseLiveQuery(...args: Parameters<UseLiveQuery>) {\n const { useLiveQuery, database } = useFireproof();\n (topLevelUseLiveQuery as TLUseLiveQuery).database = database;\n return useLiveQuery(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to live query results, enabling real-time updates in your app. This uses\n * the default database named \"useFireproof\" under the hood which you can also access via the `database` accessor.\n *\n * ## Usage\n * ```tsx\n * const results = useLiveQuery(\"date\"); // using string\n * const results = useLiveQuery((doc) => doc.date)); // using map function\n * const database = useLiveQuery.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useLiveQuery` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useLiveQuery = topLevelUseLiveQuery as TLUseLiveQuery;\n","import { Database, DocTypes } from \"@fireproof/core\";\n\nimport { AllDocsResult, useFireproof, UseAllDocs } from \"./useFireproof.js\";\n\nexport interface TLUseAllDocs {\n <T extends DocTypes>(...args: Parameters<UseAllDocs>): AllDocsResult<T>;\n database: Database;\n}\n\nfunction topLevelUseAllDocs(...args: Parameters<UseAllDocs>) {\n const { useAllDocs, database } = useFireproof();\n (topLevelUseAllDocs as TLUseAllDocs).database = database;\n return useAllDocs(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to all documents in the database, sorted by `_id`.\n *\n * ## Usage\n * ```tsx\n * const result = useAllDocs({ limit: 10, descending: true }); // with options\n * const result = useAllDocs(); // without options\n * const database = useAllDocs.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useAllDocs = topLevelUseAllDocs as TLUseAllDocs;\n","import { DocTypes, Database } from \"@fireproof/core\";\n\nimport { ChangesResult, useFireproof, UseChanges } from \"./useFireproof.js\";\n\nexport interface TLUseChanges {\n <T extends DocTypes>(...args: Parameters<UseChanges>): ChangesResult<T>;\n database: Database;\n}\n\nfunction topLevelUseChanges(...args: Parameters<UseChanges>) {\n const { useChanges, database } = useFireproof();\n (topLevelUseChanges as TLUseChanges).database = database;\n return useChanges(...args);\n}\n\n/**\n * ## Summary\n * React hook that provides access to all new documents in the database added since the last time the changes was called\n *\n * ## Usage\n * ```tsx\n * const result = useChanges(prevresult.clock,{limit:10}); // with options\n * const result = useChanges(); // without options\n * const database = useChanges.database; // underlying \"useFireproof\" database accessor\n * ```\n *\n * ## Overview\n * Changes made via remote sync peers, or other members of your cloud replica group will appear automatically\n * when you use the `useAllDocs`, `useChanges` and `useDocument` APIs. By default, Fireproof stores data in the browser's\n * local storage.\n */\nexport const useChanges = topLevelUseChanges as TLUseChanges;\n","import { DocFileMeta } from \"@fireproof/core\";\nimport React, { useState, useEffect, ImgHTMLAttributes } from \"react\";\n\nconst { URL } = globalThis;\n\n// Union type to support both direct File objects and metadata objects\ntype FileType = File | DocFileMeta;\n\ninterface ImgFileProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\"> {\n file?: FileType;\n /**\n * @deprecated Use 'file' instead. This is for internal use only to support legacy code.\n * @internal\n */\n meta?: FileType;\n}\n\n// Helper function to determine if the object is a File-like object\nfunction isFile(obj: FileType): obj is File {\n return \"type\" in obj && \"size\" in obj && \"stream\" in obj && typeof obj.stream === \"function\";\n}\n\n// Helper function to determine if the object is a DocFileMeta\nfunction isFileMeta(obj: FileType): obj is DocFileMeta {\n return \"type\" in obj && \"size\" in obj && \"file\" in obj && typeof obj.file === \"function\";\n}\n\nexport function ImgFile({ file, meta, ...imgProps }: ImgFileProps) {\n const [imgDataUrl, setImgDataUrl] = useState(\"\");\n\n // Use meta as fallback if file is not provided (for backward compatibility)\n const fileData = file || meta;\n\n useEffect(() => {\n if (!fileData) return;\n\n const loadFile = async () => {\n let fileObj: File | null = null;\n let fileType = \"\";\n\n switch (true) {\n case isFile(fileData):\n fileObj = fileData;\n fileType = fileData.type;\n break;\n case isFileMeta(fileData):\n fileType = fileData.type;\n fileObj = (await fileData.file?.()) || null;\n break;\n }\n\n if (fileObj && /image/.test(fileType)) {\n const src = URL.createObjectURL(fileObj);\n setImgDataUrl(src);\n return () => URL.revokeObjectURL(src);\n }\n };\n\n let isMounted = true;\n let cleanup: (() => void) | undefined;\n\n loadFile().then((result) => {\n if (isMounted) {\n cleanup = result;\n } else if (result) {\n result();\n }\n });\n\n return () => {\n isMounted = false;\n if (cleanup) cleanup();\n };\n }, [fileData]);\n\n return im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AG;AACjB,eAAO,MAAM,IAAI,gBAAgB,GAAG;AAAA,MACtC;AAAA,IACF;AAEA,QAAI,YAAY;AAChB,QAAI;AAEJ,aAAS,EAAE,KAAK,CAAC,WAAW;AAC1B,UAAI,WAAW;AACb,kBAAU;AAAA,MACZ,WAAW,QAAQ;AACjB,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AACX,kBAAY;AACZ,UAAI,QAAS,SAAQ;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO,aACH,cAAAC,QAAM,cAAc,OAAO;AAAA,IACzB,KAAK;AAAA,IACL,GAAG;AAAA,EACL,CAAC,IACD;AACN;","names":["useDocument","useLiveQuery","useAllDocs","useChanges","useDocument","useLiveQuery","useAllDocs","useChanges","import_react","React"]}
package/react/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
- import { DocTypes, DocWithId, DocResponse, DocSet, Database, IndexKeyType, DocFragment, MapFn, QueryOpts, IndexRow, AllDocsQueryOpts, ClockHead, ChangesOptions, ConfigOpts } from '@fireproof/core';
1
+ import { DocTypes, DocWithId, DocResponse, DocSet, Database, IndexKeyType, DocFragment, MapFn, QueryOpts, IndexRow, AllDocsQueryOpts, ClockHead, ChangesOptions, ConfigOpts, DocFileMeta } from '@fireproof/core';
2
2
  import React, { ImgHTMLAttributes } from 'react';
3
- import { DocFileMeta } from '@fireproof/core/react';
4
3
 
5
4
  interface LiveQueryResult<T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T> {
6
5
  readonly docs: DocWithId<T>[];
package/react/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { DocTypes, DocWithId, DocResponse, DocSet, Database, IndexKeyType, DocFragment, MapFn, QueryOpts, IndexRow, AllDocsQueryOpts, ClockHead, ChangesOptions, ConfigOpts } from '@fireproof/core';
1
+ import { DocTypes, DocWithId, DocResponse, DocSet, Database, IndexKeyType, DocFragment, MapFn, QueryOpts, IndexRow, AllDocsQueryOpts, ClockHead, ChangesOptions, ConfigOpts, DocFileMeta } from '@fireproof/core';
2
2
  import React, { ImgHTMLAttributes } from 'react';
3
- import { DocFileMeta } from '@fireproof/core/react';
4
3
 
5
4
  interface LiveQueryResult<T extends DocTypes, K extends IndexKeyType, R extends DocFragment = T> {
6
5
  readonly docs: DocWithId<T>[];
package/react/index.js CHANGED
@@ -213,7 +213,7 @@ var useChanges = topLevelUseChanges;
213
213
 
214
214
  // src/react/img-file.ts
215
215
  import React, { useState as useState2, useEffect as useEffect2 } from "react";
216
- var { URL } = window;
216
+ var { URL } = globalThis;
217
217
  function isFile(obj) {
218
218
  return "type" in obj && "size" in obj && "stream" in obj && typeof obj.stream === "function";
219
219
  }