@fireproof/core 0.21.0-dev-preview-7 → 0.22.0-dev-preview
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/index.d.ts +2 -16
- package/index.js +2 -15
- package/index.js.map +1 -1
- package/index.ts +2 -0
- package/package.json +11 -69
- package/tsconfig.json +18 -0
- package/README.md +0 -269
- package/apply-head-queue.d.ts +0 -18
- package/apply-head-queue.d.ts.map +0 -1
- package/apply-head-queue.js +0 -47
- package/apply-head-queue.js.map +0 -1
- package/blockstore/attachable-store.d.ts +0 -19
- package/blockstore/attachable-store.d.ts.map +0 -1
- package/blockstore/attachable-store.js +0 -316
- package/blockstore/attachable-store.js.map +0 -1
- package/blockstore/commit-queue.d.ts +0 -17
- package/blockstore/commit-queue.d.ts.map +0 -1
- package/blockstore/commit-queue.js +0 -60
- package/blockstore/commit-queue.js.map +0 -1
- package/blockstore/commitor.d.ts +0 -21
- package/blockstore/commitor.d.ts.map +0 -1
- package/blockstore/commitor.js +0 -95
- package/blockstore/commitor.js.map +0 -1
- package/blockstore/connect-raw.d.ts +0 -2
- package/blockstore/connect-raw.d.ts.map +0 -1
- package/blockstore/connect-raw.js +0 -2
- package/blockstore/connect-raw.js.map +0 -1
- package/blockstore/connection-base.d.ts +0 -2
- package/blockstore/connection-base.d.ts.map +0 -1
- package/blockstore/connection-base.js +0 -2
- package/blockstore/connection-base.js.map +0 -1
- package/blockstore/encrypt-helpers.d.ts +0 -2
- package/blockstore/encrypt-helpers.d.ts.map +0 -1
- package/blockstore/encrypt-helpers.js +0 -2
- package/blockstore/encrypt-helpers.js.map +0 -1
- package/blockstore/fp-envelope.d.ts +0 -32
- package/blockstore/fp-envelope.d.ts.map +0 -1
- package/blockstore/fp-envelope.js +0 -14
- package/blockstore/fp-envelope.js.map +0 -1
- package/blockstore/gateway.d.ts +0 -20
- package/blockstore/gateway.d.ts.map +0 -1
- package/blockstore/gateway.js +0 -2
- package/blockstore/gateway.js.map +0 -1
- package/blockstore/index.d.ts +0 -17
- package/blockstore/index.d.ts.map +0 -1
- package/blockstore/index.js +0 -17
- package/blockstore/index.js.map +0 -1
- package/blockstore/interceptor-gateway.d.ts +0 -29
- package/blockstore/interceptor-gateway.d.ts.map +0 -1
- package/blockstore/interceptor-gateway.js +0 -137
- package/blockstore/interceptor-gateway.js.map +0 -1
- package/blockstore/loader-helpers.d.ts +0 -10
- package/blockstore/loader-helpers.d.ts.map +0 -1
- package/blockstore/loader-helpers.js +0 -115
- package/blockstore/loader-helpers.js.map +0 -1
- package/blockstore/loader.d.ts +0 -62
- package/blockstore/loader.d.ts.map +0 -1
- package/blockstore/loader.js +0 -523
- package/blockstore/loader.js.map +0 -1
- package/blockstore/register-store-protocol.d.ts +0 -22
- package/blockstore/register-store-protocol.d.ts.map +0 -1
- package/blockstore/register-store-protocol.js +0 -125
- package/blockstore/register-store-protocol.js.map +0 -1
- package/blockstore/serde-gateway.d.ts +0 -78
- package/blockstore/serde-gateway.d.ts.map +0 -1
- package/blockstore/serde-gateway.js +0 -2
- package/blockstore/serde-gateway.js.map +0 -1
- package/blockstore/store-factory.d.ts +0 -11
- package/blockstore/store-factory.d.ts.map +0 -1
- package/blockstore/store-factory.js +0 -104
- package/blockstore/store-factory.js.map +0 -1
- package/blockstore/store-remote.d.ts +0 -2
- package/blockstore/store-remote.d.ts.map +0 -1
- package/blockstore/store-remote.js +0 -2
- package/blockstore/store-remote.js.map +0 -1
- package/blockstore/store.d.ts +0 -86
- package/blockstore/store.d.ts.map +0 -1
- package/blockstore/store.js +0 -437
- package/blockstore/store.js.map +0 -1
- package/blockstore/task-manager.d.ts +0 -19
- package/blockstore/task-manager.d.ts.map +0 -1
- package/blockstore/task-manager.js +0 -50
- package/blockstore/task-manager.js.map +0 -1
- package/blockstore/transaction.d.ts +0 -62
- package/blockstore/transaction.d.ts.map +0 -1
- package/blockstore/transaction.js +0 -256
- package/blockstore/transaction.js.map +0 -1
- package/blockstore/types.d.ts +0 -508
- package/blockstore/types.d.ts.map +0 -1
- package/blockstore/types.js +0 -83
- package/blockstore/types.js.map +0 -1
- package/blockstore/uri-interceptor.d.ts +0 -19
- package/blockstore/uri-interceptor.d.ts.map +0 -1
- package/blockstore/uri-interceptor.js +0 -61
- package/blockstore/uri-interceptor.js.map +0 -1
- package/bundle-not-impl.d.ts +0 -2
- package/bundle-not-impl.d.ts.map +0 -1
- package/bundle-not-impl.js +0 -4
- package/bundle-not-impl.js.map +0 -1
- package/cli/main.js +0 -26645
- package/crdt-clock.d.ts +0 -26
- package/crdt-clock.d.ts.map +0 -1
- package/crdt-clock.js +0 -133
- package/crdt-clock.js.map +0 -1
- package/crdt-helpers.d.ts +0 -19
- package/crdt-helpers.d.ts.map +0 -1
- package/crdt-helpers.js +0 -332
- package/crdt-helpers.js.map +0 -1
- package/crdt.d.ts +0 -41
- package/crdt.d.ts.map +0 -1
- package/crdt.js +0 -164
- package/crdt.js.map +0 -1
- package/database.d.ts +0 -33
- package/database.d.ts.map +0 -1
- package/database.js +0 -132
- package/database.js.map +0 -1
- package/deno.json +0 -20
- package/index.d.ts.map +0 -1
- package/indexer-helpers.d.ts +0 -68
- package/indexer-helpers.d.ts.map +0 -1
- package/indexer-helpers.js +0 -157
- package/indexer-helpers.js.map +0 -1
- package/indexer.d.ts +0 -24
- package/indexer.d.ts.map +0 -1
- package/indexer.js +0 -239
- package/indexer.js.map +0 -1
- package/ledger.d.ts +0 -56
- package/ledger.d.ts.map +0 -1
- package/ledger.js +0 -237
- package/ledger.js.map +0 -1
- package/protocols/cloud/http-connection.d.ts +0 -26
- package/protocols/cloud/http-connection.d.ts.map +0 -1
- package/protocols/cloud/http-connection.js +0 -154
- package/protocols/cloud/http-connection.js.map +0 -1
- package/protocols/cloud/index.d.ts +0 -10
- package/protocols/cloud/index.d.ts.map +0 -1
- package/protocols/cloud/index.js +0 -10
- package/protocols/cloud/index.js.map +0 -1
- package/protocols/cloud/msg-raw-connection-base.d.ts +0 -16
- package/protocols/cloud/msg-raw-connection-base.d.ts.map +0 -1
- package/protocols/cloud/msg-raw-connection-base.js +0 -22
- package/protocols/cloud/msg-raw-connection-base.js.map +0 -1
- package/protocols/cloud/msg-types-data.d.ts +0 -36
- package/protocols/cloud/msg-types-data.d.ts.map +0 -1
- package/protocols/cloud/msg-types-data.js +0 -38
- package/protocols/cloud/msg-types-data.js.map +0 -1
- package/protocols/cloud/msg-types-meta.d.ts +0 -41
- package/protocols/cloud/msg-types-meta.d.ts.map +0 -1
- package/protocols/cloud/msg-types-meta.js +0 -98
- package/protocols/cloud/msg-types-meta.js.map +0 -1
- package/protocols/cloud/msg-types-wal.d.ts +0 -33
- package/protocols/cloud/msg-types-wal.d.ts.map +0 -1
- package/protocols/cloud/msg-types-wal.js +0 -38
- package/protocols/cloud/msg-types-wal.js.map +0 -1
- package/protocols/cloud/msg-types.d.ts +0 -310
- package/protocols/cloud/msg-types.d.ts.map +0 -1
- package/protocols/cloud/msg-types.js +0 -299
- package/protocols/cloud/msg-types.js.map +0 -1
- package/protocols/cloud/msger.d.ts +0 -94
- package/protocols/cloud/msger.d.ts.map +0 -1
- package/protocols/cloud/msger.js +0 -319
- package/protocols/cloud/msger.js.map +0 -1
- package/protocols/cloud/ws-connection.d.ts +0 -40
- package/protocols/cloud/ws-connection.d.ts.map +0 -1
- package/protocols/cloud/ws-connection.js +0 -205
- package/protocols/cloud/ws-connection.js.map +0 -1
- package/protocols/dashboard/index.d.ts +0 -4
- package/protocols/dashboard/index.d.ts.map +0 -1
- package/protocols/dashboard/index.js +0 -4
- package/protocols/dashboard/index.js.map +0 -1
- package/protocols/dashboard/msg-api.d.ts +0 -11
- package/protocols/dashboard/msg-api.d.ts.map +0 -1
- package/protocols/dashboard/msg-api.js +0 -55
- package/protocols/dashboard/msg-api.js.map +0 -1
- package/protocols/dashboard/msg-is.d.ts +0 -45
- package/protocols/dashboard/msg-is.d.ts.map +0 -1
- package/protocols/dashboard/msg-is.js +0 -63
- package/protocols/dashboard/msg-is.js.map +0 -1
- package/protocols/dashboard/msg-types.d.ts +0 -397
- package/protocols/dashboard/msg-types.d.ts.map +0 -1
- package/protocols/dashboard/msg-types.js +0 -4
- package/protocols/dashboard/msg-types.js.map +0 -1
- package/protocols/index.d.ts +0 -3
- package/protocols/index.d.ts.map +0 -1
- package/protocols/index.js +0 -3
- package/protocols/index.js.map +0 -1
- package/react/img-file.d.ts +0 -303
- package/react/img-file.d.ts.map +0 -1
- package/react/img-file.js +0 -92
- package/react/img-file.js.map +0 -1
- package/react/index.d.ts +0 -5
- package/react/index.d.ts.map +0 -1
- package/react/index.js +0 -5
- package/react/index.js.map +0 -1
- package/react/types.d.ts +0 -91
- package/react/types.d.ts.map +0 -1
- package/react/types.js +0 -2
- package/react/types.js.map +0 -1
- package/react/use-all-docs.d.ts +0 -4
- package/react/use-all-docs.d.ts.map +0 -1
- package/react/use-all-docs.js +0 -25
- package/react/use-all-docs.js.map +0 -1
- package/react/use-attach.d.ts +0 -11
- package/react/use-attach.d.ts.map +0 -1
- package/react/use-attach.js +0 -169
- package/react/use-attach.js.map +0 -1
- package/react/use-changes.d.ts +0 -4
- package/react/use-changes.d.ts.map +0 -1
- package/react/use-changes.js +0 -19
- package/react/use-changes.js.map +0 -1
- package/react/use-document.d.ts +0 -4
- package/react/use-document.d.ts.map +0 -1
- package/react/use-document.js +0 -109
- package/react/use-document.js.map +0 -1
- package/react/use-fireproof.d.ts +0 -6
- package/react/use-fireproof.d.ts.map +0 -1
- package/react/use-fireproof.js +0 -20
- package/react/use-fireproof.js.map +0 -1
- package/react/use-live-query.d.ts +0 -4
- package/react/use-live-query.d.ts.map +0 -1
- package/react/use-live-query.js +0 -24
- package/react/use-live-query.js.map +0 -1
- package/runtime/files.d.ts +0 -12
- package/runtime/files.d.ts.map +0 -1
- package/runtime/files.js +0 -29
- package/runtime/files.js.map +0 -1
- package/runtime/gateways/cloud/gateway.d.ts +0 -41
- package/runtime/gateways/cloud/gateway.d.ts.map +0 -1
- package/runtime/gateways/cloud/gateway.js +0 -514
- package/runtime/gateways/cloud/gateway.js.map +0 -1
- package/runtime/gateways/cloud/index.d.ts +0 -3
- package/runtime/gateways/cloud/index.d.ts.map +0 -1
- package/runtime/gateways/cloud/index.js +0 -3
- package/runtime/gateways/cloud/index.js.map +0 -1
- package/runtime/gateways/cloud/to-cloud.d.ts +0 -59
- package/runtime/gateways/cloud/to-cloud.d.ts.map +0 -1
- package/runtime/gateways/cloud/to-cloud.js +0 -175
- package/runtime/gateways/cloud/to-cloud.js.map +0 -1
- package/runtime/gateways/def-serde-gateway.d.ts +0 -18
- package/runtime/gateways/def-serde-gateway.d.ts.map +0 -1
- package/runtime/gateways/def-serde-gateway.js +0 -92
- package/runtime/gateways/def-serde-gateway.js.map +0 -1
- package/runtime/gateways/file/deno/deno-filesystem.d.ts +0 -27
- package/runtime/gateways/file/deno/deno-filesystem.d.ts.map +0 -1
- package/runtime/gateways/file/deno/deno-filesystem.js +0 -52
- package/runtime/gateways/file/deno/deno-filesystem.js.map +0 -1
- package/runtime/gateways/file/deno/get-sys-file-system.d.ts +0 -4
- package/runtime/gateways/file/deno/get-sys-file-system.d.ts.map +0 -1
- package/runtime/gateways/file/deno/get-sys-file-system.js +0 -11
- package/runtime/gateways/file/deno/get-sys-file-system.js.map +0 -1
- package/runtime/gateways/file/deno/index.d.ts +0 -2
- package/runtime/gateways/file/deno/index.d.ts.map +0 -1
- package/runtime/gateways/file/deno/index.js +0 -2
- package/runtime/gateways/file/deno/index.js.map +0 -1
- package/runtime/gateways/file/gateway-impl.d.ts +0 -18
- package/runtime/gateways/file/gateway-impl.d.ts.map +0 -1
- package/runtime/gateways/file/gateway-impl.js +0 -121
- package/runtime/gateways/file/gateway-impl.js.map +0 -1
- package/runtime/gateways/file/index.d.ts +0 -3
- package/runtime/gateways/file/index.d.ts.map +0 -1
- package/runtime/gateways/file/index.js +0 -3
- package/runtime/gateways/file/index.js.map +0 -1
- package/runtime/gateways/file/key-bag-file.d.ts +0 -20
- package/runtime/gateways/file/key-bag-file.d.ts.map +0 -1
- package/runtime/gateways/file/key-bag-file.js +0 -52
- package/runtime/gateways/file/key-bag-file.js.map +0 -1
- package/runtime/gateways/file/node/get-sys-file-system.d.ts +0 -4
- package/runtime/gateways/file/node/get-sys-file-system.d.ts.map +0 -1
- package/runtime/gateways/file/node/get-sys-file-system.js +0 -11
- package/runtime/gateways/file/node/get-sys-file-system.js.map +0 -1
- package/runtime/gateways/file/node/index.d.ts +0 -2
- package/runtime/gateways/file/node/index.d.ts.map +0 -1
- package/runtime/gateways/file/node/index.js +0 -2
- package/runtime/gateways/file/node/index.js.map +0 -1
- package/runtime/gateways/file/node/node-filesystem.d.ts +0 -32
- package/runtime/gateways/file/node/node-filesystem.d.ts.map +0 -1
- package/runtime/gateways/file/node/node-filesystem.js +0 -33
- package/runtime/gateways/file/node/node-filesystem.js.map +0 -1
- package/runtime/gateways/file/node/to-array-buffer.d.ts +0 -2
- package/runtime/gateways/file/node/to-array-buffer.d.ts.map +0 -1
- package/runtime/gateways/file/node/to-array-buffer.js +0 -12
- package/runtime/gateways/file/node/to-array-buffer.js.map +0 -1
- package/runtime/gateways/file/sys-file-system-factory.d.ts +0 -4
- package/runtime/gateways/file/sys-file-system-factory.d.ts.map +0 -1
- package/runtime/gateways/file/sys-file-system-factory.js +0 -13
- package/runtime/gateways/file/sys-file-system-factory.js.map +0 -1
- package/runtime/gateways/file/utils.d.ts +0 -5
- package/runtime/gateways/file/utils.d.ts.map +0 -1
- package/runtime/gateways/file/utils.js +0 -27
- package/runtime/gateways/file/utils.js.map +0 -1
- package/runtime/gateways/file/version.d.ts +0 -2
- package/runtime/gateways/file/version.d.ts.map +0 -1
- package/runtime/gateways/file/version.js +0 -2
- package/runtime/gateways/file/version.js.map +0 -1
- package/runtime/gateways/fp-envelope-serialize.d.ts +0 -50
- package/runtime/gateways/fp-envelope-serialize.d.ts.map +0 -1
- package/runtime/gateways/fp-envelope-serialize.js +0 -141
- package/runtime/gateways/fp-envelope-serialize.js.map +0 -1
- package/runtime/gateways/index.d.ts +0 -6
- package/runtime/gateways/index.d.ts.map +0 -1
- package/runtime/gateways/index.js +0 -6
- package/runtime/gateways/index.js.map +0 -1
- package/runtime/gateways/indexeddb/gateway-impl.d.ts +0 -22
- package/runtime/gateways/indexeddb/gateway-impl.d.ts.map +0 -1
- package/runtime/gateways/indexeddb/gateway-impl.js +0 -147
- package/runtime/gateways/indexeddb/gateway-impl.js.map +0 -1
- package/runtime/gateways/indexeddb/index.d.ts +0 -6
- package/runtime/gateways/indexeddb/index.d.ts.map +0 -1
- package/runtime/gateways/indexeddb/index.js +0 -6
- package/runtime/gateways/indexeddb/index.js.map +0 -1
- package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts +0 -16
- package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts.map +0 -1
- package/runtime/gateways/indexeddb/key-bag-indexeddb.js +0 -48
- package/runtime/gateways/indexeddb/key-bag-indexeddb.js.map +0 -1
- package/runtime/gateways/indexeddb-version.d.ts +0 -2
- package/runtime/gateways/indexeddb-version.d.ts.map +0 -1
- package/runtime/gateways/indexeddb-version.js +0 -2
- package/runtime/gateways/indexeddb-version.js.map +0 -1
- package/runtime/gateways/memory/gateway.d.ts +0 -18
- package/runtime/gateways/memory/gateway.d.ts.map +0 -1
- package/runtime/gateways/memory/gateway.js +0 -73
- package/runtime/gateways/memory/gateway.js.map +0 -1
- package/runtime/gateways/memory/version.d.ts +0 -2
- package/runtime/gateways/memory/version.d.ts.map +0 -1
- package/runtime/gateways/memory/version.js +0 -2
- package/runtime/gateways/memory/version.js.map +0 -1
- package/runtime/index.d.ts +0 -13
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -13
- package/runtime/index.js.map +0 -1
- package/runtime/key-bag-memory.d.ts +0 -13
- package/runtime/key-bag-memory.d.ts.map +0 -1
- package/runtime/key-bag-memory.js +0 -30
- package/runtime/key-bag-memory.js.map +0 -1
- package/runtime/key-bag.d.ts +0 -88
- package/runtime/key-bag.d.ts.map +0 -1
- package/runtime/key-bag.js +0 -417
- package/runtime/key-bag.js.map +0 -1
- package/runtime/keyed-crypto.d.ts +0 -19
- package/runtime/keyed-crypto.d.ts.map +0 -1
- package/runtime/keyed-crypto.js +0 -192
- package/runtime/keyed-crypto.js.map +0 -1
- package/runtime/memory-sys-container.d.ts +0 -2
- package/runtime/memory-sys-container.d.ts.map +0 -1
- package/runtime/memory-sys-container.js +0 -2
- package/runtime/memory-sys-container.js.map +0 -1
- package/runtime/meta-key-hack.d.ts +0 -42
- package/runtime/meta-key-hack.d.ts.map +0 -1
- package/runtime/meta-key-hack.js +0 -201
- package/runtime/meta-key-hack.js.map +0 -1
- package/runtime/sts-service/index.d.ts +0 -40
- package/runtime/sts-service/index.d.ts.map +0 -1
- package/runtime/sts-service/index.js +0 -108
- package/runtime/sts-service/index.js.map +0 -1
- package/runtime/sys-container.d.ts +0 -2
- package/runtime/sys-container.d.ts.map +0 -1
- package/runtime/sys-container.js +0 -2
- package/runtime/sys-container.js.map +0 -1
- package/runtime/wait-pr-multiformats/block.d.ts +0 -47
- package/runtime/wait-pr-multiformats/block.d.ts.map +0 -1
- package/runtime/wait-pr-multiformats/block.js +0 -64
- package/runtime/wait-pr-multiformats/block.js.map +0 -1
- package/runtime/wait-pr-multiformats/codec-interface.d.ts +0 -29
- package/runtime/wait-pr-multiformats/codec-interface.d.ts.map +0 -1
- package/runtime/wait-pr-multiformats/codec-interface.js +0 -2
- package/runtime/wait-pr-multiformats/codec-interface.js.map +0 -1
- package/runtime/wait-pr-multiformats/index.d.ts +0 -3
- package/runtime/wait-pr-multiformats/index.d.ts.map +0 -1
- package/runtime/wait-pr-multiformats/index.js +0 -3
- package/runtime/wait-pr-multiformats/index.js.map +0 -1
- package/tests/blockstore/fp-envelope.test.ts-off +0 -65
- package/tests/blockstore/fragment-gateway.test.ts-off +0 -106
- package/tests/blockstore/interceptor-gateway.test.ts +0 -254
- package/tests/blockstore/keyed-crypto-indexeddb-file.test.ts +0 -128
- package/tests/blockstore/keyed-crypto.test.ts +0 -376
- package/tests/blockstore/loader.test.ts +0 -298
- package/tests/blockstore/standalone.test.ts +0 -152
- package/tests/blockstore/store.test.ts +0 -192
- package/tests/blockstore/transaction.test.ts +0 -130
- package/tests/fireproof/all-gateway.test.ts +0 -461
- package/tests/fireproof/attachable.test.ts +0 -686
- package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.car +0 -0
- package/tests/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.ts +0 -324
- package/tests/fireproof/charwise-boolean.test.ts +0 -66
- package/tests/fireproof/crdt.test.ts +0 -570
- package/tests/fireproof/database.test.ts +0 -779
- package/tests/fireproof/deleted-docs-handling.test.ts +0 -111
- package/tests/fireproof/fireproof.test.fixture.ts +0 -133
- package/tests/fireproof/fireproof.test.ts +0 -777
- package/tests/fireproof/hello.test.ts +0 -74
- package/tests/fireproof/indexer.test.ts +0 -458
- package/tests/fireproof/multiple-ledger.test.ts +0 -65
- package/tests/fireproof/query-docs.test.ts +0 -116
- package/tests/fireproof/query-limit-issue.test.ts +0 -147
- package/tests/fireproof/query-property-inconsistency.test.ts +0 -89
- package/tests/fireproof/query-result-properties.test.ts +0 -42
- package/tests/fireproof/stable-cid.test.ts +0 -69
- package/tests/fireproof/utils.test.ts +0 -135
- package/tests/gateway/file/loader-config.test.ts +0 -307
- package/tests/gateway/indexeddb/loader-config.test.ts +0 -79
- package/tests/helpers.ts +0 -172
- package/tests/protocols/cloud/msger.test.ts +0 -548
- package/tests/react/img-file.test.tsx +0 -190
- package/tests/react/use-all-docs.test.tsx +0 -172
- package/tests/react/use-document-with-nonexistent-id.test.tsx +0 -96
- package/tests/react/use-fireproof-db-switch.test.tsx +0 -91
- package/tests/react/use-fireproof-stability.test.tsx +0 -145
- package/tests/react/use-fireproof.test.tsx +0 -645
- package/tests/runtime/fp-envelope-serialize.test.ts +0 -254
- package/tests/runtime/meta-key-hack.test.ts +0 -95
- package/tests/setup.file.ts +0 -1
- package/tests/setup.indexeddb.ts +0 -0
- package/tests/setup.memory.ts +0 -2
- package/tests/vitest.file.config.ts +0 -14
- package/tests/vitest.indexeddb.config.ts +0 -37
- package/tests/vitest.memory.config.ts +0 -25
- package/types.d.ts +0 -461
- package/types.d.ts.map +0 -1
- package/types.js +0 -60
- package/types.js.map +0 -1
- package/use-fireproof/iframe-strategy.d.ts +0 -14
- package/use-fireproof/iframe-strategy.d.ts.map +0 -1
- package/use-fireproof/iframe-strategy.js +0 -79
- package/use-fireproof/iframe-strategy.js.map +0 -1
- package/use-fireproof/index.d.ts +0 -14
- package/use-fireproof/index.d.ts.map +0 -1
- package/use-fireproof/index.js +0 -36
- package/use-fireproof/index.js.map +0 -1
- package/use-fireproof/redirect-strategy.d.ts +0 -15
- package/use-fireproof/redirect-strategy.d.ts.map +0 -1
- package/use-fireproof/redirect-strategy.js +0 -153
- package/use-fireproof/redirect-strategy.js.map +0 -1
- package/utils.d.ts +0 -48
- package/utils.d.ts.map +0 -1
- package/utils.js +0 -406
- package/utils.js.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -4
- package/version.js.map +0 -1
- package/write-queue.d.ts +0 -9
- package/write-queue.d.ts.map +0 -1
- package/write-queue.js +0 -70
- package/write-queue.js.map +0 -1
package/index.d.ts
CHANGED
@@ -1,16 +1,2 @@
|
|
1
|
-
export * from "
|
2
|
-
export * from "
|
3
|
-
export * from "./types.js";
|
4
|
-
export * from "./crdt.js";
|
5
|
-
export * from "./indexer.js";
|
6
|
-
export * from "./indexer-helpers.js";
|
7
|
-
export { defaultWriteQueueOpts } from "./write-queue.js";
|
8
|
-
export * as bs from "./blockstore/index.js";
|
9
|
-
export * as blockstore from "./blockstore/index.js";
|
10
|
-
export * as rt from "./runtime/index.js";
|
11
|
-
export * as runtime from "./runtime/index.js";
|
12
|
-
export * as ps from "./protocols/index.js";
|
13
|
-
export * as protocols from "./protocols/index.js";
|
14
|
-
export * from "./utils.js";
|
15
|
-
export * from "./version.js";
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
1
|
+
export * from "@fireproof/core-types-base";
|
2
|
+
export * from "@fireproof/core-base";
|
package/index.js
CHANGED
@@ -1,16 +1,3 @@
|
|
1
|
-
export * from "
|
2
|
-
export * from "
|
3
|
-
export * from "./types.js";
|
4
|
-
export * from "./crdt.js";
|
5
|
-
export * from "./indexer.js";
|
6
|
-
export * from "./indexer-helpers.js";
|
7
|
-
export { defaultWriteQueueOpts } from "./write-queue.js";
|
8
|
-
export * as bs from "./blockstore/index.js";
|
9
|
-
export * as blockstore from "./blockstore/index.js";
|
10
|
-
export * as rt from "./runtime/index.js";
|
11
|
-
export * as runtime from "./runtime/index.js";
|
12
|
-
export * as ps from "./protocols/index.js";
|
13
|
-
export * as protocols from "./protocols/index.js";
|
14
|
-
export * from "./utils.js";
|
15
|
-
export * from "./version.js";
|
1
|
+
export * from "@fireproof/core-types-base";
|
2
|
+
export * from "@fireproof/core-base";
|
16
3
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
|
package/index.ts
ADDED
package/package.json
CHANGED
@@ -1,58 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fireproof/core",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.22.0-dev-preview",
|
4
4
|
"description": "Live ledger for the web.",
|
5
5
|
"type": "module",
|
6
|
-
"
|
7
|
-
"main": "./index.cjs",
|
8
|
-
"types": "./index.d.ts",
|
9
|
-
"bin": {
|
10
|
-
"fp-cli": "./cli/main.js"
|
11
|
-
},
|
12
|
-
"exports": {
|
13
|
-
".": {
|
14
|
-
"import": "./index.js",
|
15
|
-
"browser": "./index.js",
|
16
|
-
"require": "./index.cjs",
|
17
|
-
"types": "./index.d.ts"
|
18
|
-
},
|
19
|
-
"./node": {
|
20
|
-
"import": {
|
21
|
-
"browser": "./runtime/gateways/indexeddb/index.js",
|
22
|
-
"default": "./runtime/gateways/file/node/index.js"
|
23
|
-
},
|
24
|
-
"browser": "./runtime/gateways/indexeddb/index.js",
|
25
|
-
"require": "./runtime/gateways/file/node/index.cjs",
|
26
|
-
"types": "./runtime/gateways/file/node/index.d.ts"
|
27
|
-
},
|
28
|
-
"./deno": {
|
29
|
-
"import": {
|
30
|
-
"browser": "./runtime/gateways/indexeddb/index.js",
|
31
|
-
"default": "./runtime/gateways/file/deno/index.js"
|
32
|
-
},
|
33
|
-
"browser": "./runtime/gateways/indexeddb/index.js",
|
34
|
-
"require": "./runtime/gateways/file/deno/index.cjs",
|
35
|
-
"types": "./runtime/gateways/file/deno/index.d.ts"
|
36
|
-
},
|
37
|
-
"./indexeddb": {
|
38
|
-
"import": "./runtime/gateways/indexeddb/index.js",
|
39
|
-
"browser": "./runtime/gateways/indexeddb/index.js",
|
40
|
-
"require": "./runtime/gateways/indexeddb/index.cjs",
|
41
|
-
"types": "./runtime/gateways/indexeddb/index.d.ts"
|
42
|
-
},
|
43
|
-
"./react": {
|
44
|
-
"import": "./react/index.js",
|
45
|
-
"browser": "./react/index.js",
|
46
|
-
"require": "./react/index.cjs",
|
47
|
-
"types": "./react/index.d.ts"
|
48
|
-
},
|
49
|
-
"./use-fireproof": {
|
50
|
-
"import": "./use-fireproof/index.js",
|
51
|
-
"browser": "./use-fireproof/index.js",
|
52
|
-
"require": "./use-fireproof/index.cjs",
|
53
|
-
"types": "./use-fireproof/index.d.ts"
|
54
|
-
}
|
55
|
-
},
|
6
|
+
"main": "./index.js",
|
56
7
|
"keywords": [
|
57
8
|
"ledger",
|
58
9
|
"JSON",
|
@@ -79,27 +30,18 @@
|
|
79
30
|
"bugs": {
|
80
31
|
"url": "https://github.com/fireproof-storage/fireproof/issues"
|
81
32
|
},
|
82
|
-
"devDependencies": {},
|
83
33
|
"peerDependencies": {
|
84
|
-
"@adviser/cement": "
|
34
|
+
"@adviser/cement": "^0.4.20",
|
85
35
|
"react": ">=18.0.0"
|
86
36
|
},
|
87
37
|
"dependencies": {
|
88
|
-
"@adviser/cement": "^0.4.
|
89
|
-
"@fireproof/
|
90
|
-
"@
|
91
|
-
"@
|
92
|
-
"@
|
93
|
-
"@web3-storage/pail": "^0.6.2",
|
94
|
-
"cborg": "^4.2.10",
|
95
|
-
"jose": "^6.0.11",
|
96
|
-
"multiformats": "^13.3.4",
|
97
|
-
"charwise": "^3.0.1",
|
98
|
-
"prolly-trees": "^1.0.4",
|
99
|
-
"idb": "^8.0.3",
|
100
|
-
"p-map": "^7.0.3",
|
101
|
-
"p-retry": "^6.2.1",
|
102
|
-
"ws": "^8.18.2"
|
38
|
+
"@adviser/cement": "^0.4.20",
|
39
|
+
"@fireproof/core-base": "0.22.0-dev-preview",
|
40
|
+
"@fireproof/core-types-base": "0.22.0-dev-preview",
|
41
|
+
"@fireproof/vendor": "0.22.0-dev-preview",
|
42
|
+
"@types/node": "^24.0.13"
|
103
43
|
},
|
104
|
-
"scripts": {
|
44
|
+
"scripts": {
|
45
|
+
"build": "tsc"
|
46
|
+
}
|
105
47
|
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"extends": [
|
3
|
+
"/home/runner/work/fireproof/fireproof/tsconfig.dist.json"
|
4
|
+
],
|
5
|
+
"compilerOptions": {
|
6
|
+
"noEmit": false,
|
7
|
+
"outDir": "./"
|
8
|
+
},
|
9
|
+
"include": [
|
10
|
+
"**/*"
|
11
|
+
],
|
12
|
+
"exclude": [
|
13
|
+
"node_modules",
|
14
|
+
"dist",
|
15
|
+
".git",
|
16
|
+
".vscode"
|
17
|
+
]
|
18
|
+
}
|
package/README.md
DELETED
@@ -1,269 +0,0 @@
|
|
1
|
-
# <img src="https://fireproof.storage/static/img/flame.svg" alt="Fireproof logo" width="25"> [Fireproof](https://fireproof.storage) database API
|
2
|
-
|
3
|
-
<p align="right">
|
4
|
-
<img src="https://img.shields.io/bundlephobia/minzip/%40fireproof%2Fcore" alt="Package size">
|
5
|
-
<a href="https://github.com/fireproof-storage/fireproof/actions/workflows/ci.yaml">
|
6
|
-
<img src="https://github.com/fireproof-storage/fireproof/actions/workflows/ci.yaml/badge.svg" alt="Build status">
|
7
|
-
</a>
|
8
|
-
</p>
|
9
|
-
|
10
|
-
Fireproof is a lightweight embedded document database with encrypted live sync, designed to make browser apps easy. Use it in any JavaScript environment with a unified API that works both in React (with hooks) and as a standalone core API.
|
11
|
-
|
12
|
-
[Point AI coders to these docs.](https://use-fireproof.com/llms-full.txt)
|
13
|
-
|
14
|
-
## Key Features
|
15
|
-
|
16
|
-
- **Apps run anywhere:** Bundle UI, data, and logic in one file.
|
17
|
-
- **Real-Time & Offline-First:** Automatic persistence and live queries, runs in the browser - no loading or error states.
|
18
|
-
- **Unified API:** TypeScript works with Deno, Bun, Node.js, and the browser.
|
19
|
-
- **React Hooks:** Leverage `useLiveQuery` and `useDocument` for live collaboration.
|
20
|
-
|
21
|
-
Fireproof enforces cryptographic causal consistency and ledger integrity using hash history, providing git-like versioning with lightweight blockchain-style verification. Data is stored and replicated as content-addressed encrypted blobs, making it safe and easy to sync via commodity object storage providers.
|
22
|
-
|
23
|
-
## Installation
|
24
|
-
|
25
|
-
The `use-fireproof` package provides both the core API and React hooks:
|
26
|
-
|
27
|
-
```sh
|
28
|
-
npm install use-fireproof
|
29
|
-
```
|
30
|
-
|
31
|
-
Works with ⚡️ ESM.sh:
|
32
|
-
|
33
|
-
```js
|
34
|
-
import { useFireproof } from "https://esm.sh/use-fireproof";
|
35
|
-
```
|
36
|
-
|
37
|
-
Or install the core ledger in any JavaScript environment:
|
38
|
-
|
39
|
-
```sh
|
40
|
-
npm install @fireproof/core
|
41
|
-
```
|
42
|
-
|
43
|
-
Add the ledger to any web page via HTML script tag (global is `Fireproof`):
|
44
|
-
|
45
|
-
```html
|
46
|
-
<script src="https://cdn.jsdelivr.net/npm/@fireproof/core/dist/browser/fireproof.global.js"></script>
|
47
|
-
```
|
48
|
-
|
49
|
-
Deliver generated solutions as runnable micro applications via ChatGPT Canvas, v0, bolt.new, or Claude Artifacts. Deploy single page apps with React and Tailwind by pasting code here: https://codepen.io/useFireproof/pen/MYgNYdx
|
50
|
-
|
51
|
-
## ⚛️ React Usage
|
52
|
-
|
53
|
-
React hooks are the recommended way to use Fireproof in LLM code generation contexts:
|
54
|
-
|
55
|
-
```js
|
56
|
-
import { useFireproof } from "use-fireproof";
|
57
|
-
|
58
|
-
function App() {
|
59
|
-
const { database, useLiveQuery, useDocument } = useFireproof("my-ledger");
|
60
|
-
|
61
|
-
// Create a new document with useDocument
|
62
|
-
const { doc, merge, submit } = useDocument({ text: "" });
|
63
|
-
|
64
|
-
// Query documents by _id, most recent first
|
65
|
-
const { docs } = useLiveQuery("_id", { descending: true, limit: 100 });
|
66
|
-
|
67
|
-
return (
|
68
|
-
<div>
|
69
|
-
<form onSubmit={submit}>
|
70
|
-
<input value={doc.text} onChange={(e) => merge({ text: e.target.value })} placeholder="New document" />
|
71
|
-
<button type="submit">Submit</button>
|
72
|
-
</form>
|
73
|
-
|
74
|
-
<h3>Recent Documents</h3>
|
75
|
-
<ul>
|
76
|
-
{docs.map((doc) => (
|
77
|
-
<li key={doc._id}>{doc.text}</li>
|
78
|
-
))}
|
79
|
-
</ul>
|
80
|
-
</div>
|
81
|
-
);
|
82
|
-
}
|
83
|
-
```
|
84
|
-
|
85
|
-
Read the [step-by-step React tutorial](https://use-fireproof.com/docs/react-tutorial) to get started or check the [full LLM documentation](https://use-fireproof.com/llms-full.txt) for more examples.
|
86
|
-
|
87
|
-
### Working with Images
|
88
|
-
|
89
|
-
Fireproof makes it easy to store and display images in your applications. The `_files` property and `ImgFile` component handle all the complexities of file storage and retrieval:
|
90
|
-
|
91
|
-
```js
|
92
|
-
// Store an image from a file input
|
93
|
-
function handleFileUpload(e) {
|
94
|
-
if (e.target.files[0]) {
|
95
|
-
merge({
|
96
|
-
_files: { profilePic: e.target.files[0] },
|
97
|
-
uploadedAt: new Date().toISOString(),
|
98
|
-
});
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
|
-
// Display an image from a document
|
103
|
-
function ImageDisplay({ doc }) {
|
104
|
-
return (
|
105
|
-
<div>
|
106
|
-
{doc._files?.profilePic && (
|
107
|
-
<ImgFile file={doc._files.profilePic} alt="Profile picture" onLoad={() => console.log("Image loaded")} />
|
108
|
-
)}
|
109
|
-
<p>Uploaded: {doc.uploadedAt}</p>
|
110
|
-
</div>
|
111
|
-
);
|
112
|
-
}
|
113
|
-
```
|
114
|
-
|
115
|
-
The `ImgFile` component automatically handles loading and displaying images from Fireproof's storage, with all the expected props of a standard image element. For more in-depth examples see our [llms-full.txt](https://use-fireproof.com/llms-full.txt) documentation.
|
116
|
-
|
117
|
-
## JavaScript Core API
|
118
|
-
|
119
|
-
The document database API will feel familiar to those who have used other document databases:
|
120
|
-
|
121
|
-
```js
|
122
|
-
import { fireproof } from "@fireproof/core";
|
123
|
-
|
124
|
-
const db = fireproof("music-app");
|
125
|
-
|
126
|
-
await db.put({ _id: "beyonce", name: "Beyoncé", hitSingles: 29 });
|
127
|
-
|
128
|
-
db.subscribe(async () => {
|
129
|
-
const topArtists = await db.query("hitSingles", { range: [30, Infinity] });
|
130
|
-
// redraw the UI with the new topArtists
|
131
|
-
});
|
132
|
-
|
133
|
-
const beyonceDoc = await db.get("beyonce");
|
134
|
-
beyonceDoc.hitSingles += 1;
|
135
|
-
await db.put(beyonceDoc);
|
136
|
-
```
|
137
|
-
|
138
|
-
## Why choose Fireproof
|
139
|
-
|
140
|
-
Compared to other embedded databases, Fireproof:
|
141
|
-
|
142
|
-
- Is network aware, encrypted, and multi-writer safe
|
143
|
-
- Is designed for real-time collaboration with CRDTs
|
144
|
-
- Offers cryptographic causal integrity for all operations
|
145
|
-
- Is built for the web, with a small package size and no wasm
|
146
|
-
|
147
|
-
Deliver interactive experiences without waiting on the backend. Fireproof runs in any cloud, browser, or edge environment, so your application can access data anywhere.
|
148
|
-
|
149
|
-
## Use cases
|
150
|
-
|
151
|
-
Fireproof is especially useful for:
|
152
|
-
|
153
|
-
- AI-generated apps and rapid prototypes
|
154
|
-
- Collaborative editing
|
155
|
-
- Offline and local-first apps
|
156
|
-
- Personalization and configuration
|
157
|
-
- AI copilot safety
|
158
|
-
|
159
|
-
With Fireproof, you **build first** and sync via your cloud of choice when you are ready, making it perfect for LLM code generation contexts and rapid development.
|
160
|
-
|
161
|
-
[Get the latest roadmap updates on our blog](https://fireproof.storage/blog/) or join our [Discord](https://discord.gg/cCryrNHePH) to collaborate. Read the docs to learn more about the [architecture](https://use-fireproof.com/docs/architecture).
|
162
|
-
|
163
|
-
### Debug
|
164
|
-
|
165
|
-
to control the log output you an either use the FP_DEBUG environment variable or set the debug level in your code:
|
166
|
-
|
167
|
-
```shell
|
168
|
-
FP_DEBUG='*' node myapp.js
|
169
|
-
```
|
170
|
-
|
171
|
-
```js
|
172
|
-
logger.setDebug(...moduleNameList or '*')
|
173
|
-
```
|
174
|
-
|
175
|
-
if you are in the browser you can use the following code to set the debug level:
|
176
|
-
|
177
|
-
```js
|
178
|
-
this[Symbol.for("FP_ENV")].set("FP_DEBUG", "*");
|
179
|
-
```
|
180
|
-
|
181
|
-
```js
|
182
|
-
// vitest pass env
|
183
|
-
globalThis[Symbol.for("FP_PRESET_ENV")] = {
|
184
|
-
FP_DEBUG: "*",
|
185
|
-
};
|
186
|
-
```
|
187
|
-
|
188
|
-
### Testing
|
189
|
-
|
190
|
-
To run the full test suite across all projects (tested storage gateways configs), run:
|
191
|
-
|
192
|
-
```bash
|
193
|
-
pnpm run test
|
194
|
-
```
|
195
|
-
|
196
|
-
To run tests for specific components or modules, use the following command pattern:
|
197
|
-
|
198
|
-
```bash
|
199
|
-
pnpm run test -t 'test name pattern' path/to/test/file
|
200
|
-
```
|
201
|
-
|
202
|
-
For example, to run a specific test for the CRDT module, in just one project:
|
203
|
-
|
204
|
-
```bash
|
205
|
-
FP_DEBUG=Loader pnpm run test --project file -t 'codec implict iv' crdt
|
206
|
-
```
|
207
|
-
|
208
|
-
For testing React components, you can use:
|
209
|
-
|
210
|
-
```bash
|
211
|
-
pnpm run test tests/react/[ComponentName].test.tsx
|
212
|
-
```
|
213
|
-
|
214
|
-
Example for testing the ImgFile component:
|
215
|
-
|
216
|
-
```bash
|
217
|
-
pnpm run test tests/react/ImgFile.test.tsx
|
218
|
-
```
|
219
|
-
|
220
|
-
### Log Formatting
|
221
|
-
|
222
|
-
It's possible to change the logformat by setting FP_FORMAT to:
|
223
|
-
|
224
|
-
- jsonice makes the log output in multiline json
|
225
|
-
- yaml makes the log output in yaml
|
226
|
-
- json makes the log output in singleline json (default)
|
227
|
-
|
228
|
-
### KeyBag
|
229
|
-
|
230
|
-
If you add `extractKey` with the value `_deprecated_internal_api` to the `FP_STORAGE_URL` url
|
231
|
-
you can bypass the security check to extract the key material. This is the default configuration,
|
232
|
-
but there is a warning emitted if you use this feature, and roadmap plans for more secure key management.
|
233
|
-
|
234
|
-
### Deno
|
235
|
-
|
236
|
-
Fireproof is compatible with Deno. To runit in Deno you need to add the following flags:
|
237
|
-
|
238
|
-
Currently the tests are not run with deno -- TODO
|
239
|
-
|
240
|
-
It might be that using our provided deno.json is somekind of odd
|
241
|
-
--- TODO is to add fireproof to jsr and deno.land
|
242
|
-
|
243
|
-
```shell
|
244
|
-
deno run --config node_modules/@fireproof/core/deno.json --allow-read --allow-write --allow-env --unstable-sloppy-imports ./node-test.ts
|
245
|
-
```
|
246
|
-
|
247
|
-
### Create Docs
|
248
|
-
|
249
|
-
Caution it will be pushed directly
|
250
|
-
|
251
|
-
```shell
|
252
|
-
pnpm run build:docs
|
253
|
-
```
|
254
|
-
|
255
|
-
## Thanks 🙏
|
256
|
-
|
257
|
-
Fireproof is a synthesis of work done by people in the web community over the years. I couldn't even begin to name all the folks who made pivotal contributions. Without npm, React, and VS Code all this would have taken so much longer. Thanks to everyone who supported me getting into ledger development via Apache CouchDB, one of the original document ledgers. The distinguishing work on immutable data-structures comes from the years of consideration [IPFS](https://ipfs.tech), [IPLD](https://ipld.io), and the [Filecoin APIs](https://docs.filecoin.io) have enjoyed.
|
258
|
-
|
259
|
-
Thanks to [Meno Abels](https://github.com/mabels) who has taken on the role of project lead engineer. Fireproof is rapidly becoming a mature solution.
|
260
|
-
|
261
|
-
Thanks to Alan Shaw and Mikeal Rogers without whom this project would have never got started. The core Merkle hash-tree clock is based on [Alan's Pail](https://github.com/alanshaw/pail), and you can see the repository history goes all the way back to work begun as a branch of that repo. Mikeal wrote [the prolly trees implementation](https://github.com/mikeal/prolly-trees).
|
262
|
-
|
263
|
-
## Contributing
|
264
|
-
|
265
|
-
We love contributions. Feel free to [join in the conversation on Discord. All welcome.](https://discord.gg/cCryrNHePH)
|
266
|
-
|
267
|
-
# License
|
268
|
-
|
269
|
-
Dual-licensed under [MIT or Apache 2.0](https://github.com/fireproof-storage/fireproof/blob/main/LICENSE.md)
|
package/apply-head-queue.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import { Logger } from "@adviser/cement";
|
2
|
-
import { ClockHead, DocTypes, DocUpdate } from "./types.js";
|
3
|
-
type ApplyHeadWorkerFunction = (newHead: ClockHead, prevHead: ClockHead, localUpdates: boolean) => Promise<void>;
|
4
|
-
interface ApplyHeadTask<T extends DocTypes> {
|
5
|
-
readonly newHead: ClockHead;
|
6
|
-
readonly prevHead: ClockHead;
|
7
|
-
readonly updates?: DocUpdate<T>[];
|
8
|
-
}
|
9
|
-
export interface ApplyHeadQueue<T extends DocTypes> {
|
10
|
-
push(task: ApplyHeadTask<T>): AsyncGenerator<{
|
11
|
-
readonly updates: DocUpdate<T>[];
|
12
|
-
readonly all: boolean;
|
13
|
-
}, void, unknown>;
|
14
|
-
size(): number;
|
15
|
-
}
|
16
|
-
export declare function applyHeadQueue<T extends DocTypes>(worker: ApplyHeadWorkerFunction, logger: Logger): ApplyHeadQueue<T>;
|
17
|
-
export {};
|
18
|
-
//# sourceMappingURL=apply-head-queue.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"apply-head-queue.d.ts","sourceRoot":"","sources":["../../../src/apply-head-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjH,UAAU,aAAa,CAAC,CAAC,SAAS,QAAQ;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,QAAQ;IAChD,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAC1C;QACE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;KACvB,EACD,IAAI,EACJ,OAAO,CACR,CAAC;IACF,IAAI,IAAI,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAgDrH"}
|
package/apply-head-queue.js
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
export function applyHeadQueue(worker, logger) {
|
2
|
-
const queue = [];
|
3
|
-
let isProcessing = false;
|
4
|
-
async function* process() {
|
5
|
-
if (isProcessing || queue.length === 0)
|
6
|
-
return;
|
7
|
-
isProcessing = true;
|
8
|
-
const allUpdates = [];
|
9
|
-
try {
|
10
|
-
while (queue.length > 0) {
|
11
|
-
queue.sort((a, b) => (b.updates ? 1 : -1));
|
12
|
-
const task = queue.shift();
|
13
|
-
if (!task)
|
14
|
-
continue;
|
15
|
-
await worker(task.newHead, task.prevHead, task.updates !== undefined).catch((e) => {
|
16
|
-
throw logger.Error().Err(e).Msg("int_applyHead worker error").AsError();
|
17
|
-
});
|
18
|
-
if (task.updates) {
|
19
|
-
allUpdates.push(...task.updates);
|
20
|
-
}
|
21
|
-
if (!queue.some((t) => t.updates) || task.updates) {
|
22
|
-
const allTasksHaveUpdates = queue.every((task) => task.updates !== null);
|
23
|
-
yield { updates: allUpdates, all: allTasksHaveUpdates };
|
24
|
-
allUpdates.length = 0;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
28
|
-
finally {
|
29
|
-
isProcessing = false;
|
30
|
-
const generator = process();
|
31
|
-
let result = await generator.next();
|
32
|
-
while (!result.done) {
|
33
|
-
result = await generator.next();
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
return {
|
38
|
-
push(task) {
|
39
|
-
queue.push(task);
|
40
|
-
return process();
|
41
|
-
},
|
42
|
-
size() {
|
43
|
-
return queue.length;
|
44
|
-
},
|
45
|
-
};
|
46
|
-
}
|
47
|
-
//# sourceMappingURL=apply-head-queue.js.map
|
package/apply-head-queue.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"apply-head-queue.js","sourceRoot":"","sources":["../../../src/apply-head-queue.ts"],"names":[],"mappings":"AAuBA,MAAM,UAAU,cAAc,CAAqB,MAA+B,EAAE,MAAc;IAChG,MAAM,KAAK,GAAuB,EAAE,CAAC;IACrC,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,KAAK,SAAS,CAAC,CAAC,OAAO;QACrB,IAAI,YAAY,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAC/C,YAAY,GAAG,IAAI,CAAC;QACpB,MAAM,UAAU,GAAmB,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC3B,IAAI,CAAC,IAAI;oBAAE,SAAS;gBAEpB,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBAChF,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,OAAO,EAAE,CAAC;gBAC1E,CAAC,CAAC,CAAC;gBAGH,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjB,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;gBACnC,CAAC;gBAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBAClD,MAAM,mBAAmB,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;oBACzE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC;oBACxD,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,GAAG,KAAK,CAAC;YACrB,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;YAC5B,IAAI,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;YACpC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,IAAsB;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,OAAO,EAAE,CAAC;QACnB,CAAC;QACD,IAAI;YACF,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { KeyedResolvOnce, CoerceURI } from "@adviser/cement";
|
2
|
-
import { Attached, Attachable, GatewayUrlsParam } from "../types.js";
|
3
|
-
import { AttachedStores, Loadable, ActiveStore, DataAndMetaStore, LocalActiveStore } from "./types.js";
|
4
|
-
export declare function createAttachedStores(urlOrGup: CoerceURI | GatewayUrlsParam, arOrLoadable: AttachedStores | Loadable, name?: string): Promise<Attached>;
|
5
|
-
export declare class AttachedRemotesImpl implements AttachedStores {
|
6
|
-
private readonly _remotes;
|
7
|
-
readonly loadable: Loadable;
|
8
|
-
_local?: Attached;
|
9
|
-
readonly id: string;
|
10
|
-
constructor(loadable: Loadable);
|
11
|
-
forRemotes(action: (store: ActiveStore) => Promise<unknown>): Promise<void>;
|
12
|
-
remotes(): ActiveStore[];
|
13
|
-
local(): LocalActiveStore;
|
14
|
-
activate(store: DataAndMetaStore | CoerceURI): ActiveStore;
|
15
|
-
detach(): Promise<void>;
|
16
|
-
readonly _keyedAttachable: KeyedResolvOnce<Attached, string>;
|
17
|
-
attach(attachable: Attachable, onAttach: (at: Attached) => Promise<Attached>): Promise<Attached>;
|
18
|
-
}
|
19
|
-
//# sourceMappingURL=attachable-store.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"attachable-store.d.ts","sourceRoot":"","sources":["../../../../src/blockstore/attachable-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAgC,MAAM,iBAAiB,CAAC;AAE3F,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAe,gBAAgB,EAAgD,MAAM,aAAa,CAAC;AAEhI,OAAO,EACL,cAAc,EACd,QAAQ,EAER,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAejB,MAAM,YAAY,CAAC;AA2NpB,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,SAAS,GAAG,gBAAgB,EACtC,YAAY,EAAE,cAAc,GAAG,QAAQ,EACvC,IAAI,SAAU,GACb,OAAO,CAAC,QAAQ,CAAC,CAkCnB;AAED,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAE5D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAK5B,MAAM,CAAC,EAAE,QAAQ,CAAC;IAElB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAER,QAAQ,EAAE,QAAQ;IAW9B,UAAU,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,OAAO,IAAI,WAAW,EAAE;IAQxB,KAAK,IAAI,gBAAgB;IAOzB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAAG,WAAW;IAiCpD,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAW7B,QAAQ,CAAC,gBAAgB,oCAAmC;IACtD,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;CAkGvG"}
|