@fireproof/core 0.20.0-dev-preview-63 → 0.20.1-dev-preview-01
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/deno/index.d.ts +7 -0
- package/deno/index.js +66 -0
- package/deno/index.js.map +1 -0
- package/deno/metafile-esm.json +1 -0
- package/deno.json +2 -2
- package/index.cjs +7268 -0
- package/index.cjs.map +1 -0
- package/index.d.cts +2742 -0
- package/index.d.ts +2742 -15
- package/index.js +7267 -14
- package/index.js.map +1 -1
- package/indexeddb/index.cjs +218 -0
- package/indexeddb/index.cjs.map +1 -0
- package/indexeddb/index.d.cts +30 -0
- package/indexeddb/index.d.ts +30 -0
- package/indexeddb/index.js +195 -0
- package/indexeddb/index.js.map +1 -0
- package/indexeddb/metafile-cjs.json +1 -0
- package/indexeddb/metafile-esm.json +1 -0
- package/metafile-cjs.json +1 -0
- package/metafile-esm.json +1 -0
- package/node/index.cjs +97 -0
- package/node/index.cjs.map +1 -0
- package/node/index.d.cts +7 -0
- package/node/index.d.ts +7 -0
- package/node/index.js +64 -0
- package/node/index.js.map +1 -0
- package/node/metafile-cjs.json +1 -0
- package/node/metafile-esm.json +1 -0
- package/package.json +17 -20
- package/react/index.cjs +298 -0
- package/react/index.cjs.map +1 -0
- package/react/{img-file.d.ts → index.d.cts} +53 -6
- package/react/index.d.ts +336 -4
- package/react/index.js +264 -3
- package/react/index.js.map +1 -1
- package/react/metafile-cjs.json +1 -0
- package/react/metafile-esm.json +1 -0
- package/tests/blockstore/loader.test.ts +1 -1
- package/tests/blockstore/store.test.ts +4 -9
- package/tests/fireproof/attachable.test.ts +3 -3
- package/tests/react/use-fireproof-db-switch.test.tsx +91 -0
- package/tests/react/use-fireproof-stability.test.tsx +145 -0
- package/tests/www/gallery.html +132 -0
- package/tests/www/iife.html +42 -0
- package/tests/www/todo-aws.html +232 -0
- package/tests/www/todo-ipfs.html +213 -0
- package/tests/www/todo-local.html +214 -0
- package/tests/www/todo-netlify.html +227 -0
- package/tests/www/todo.html +254 -0
- 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 -17
- package/blockstore/attachable-store.d.ts.map +0 -1
- package/blockstore/attachable-store.js +0 -295
- package/blockstore/attachable-store.js.map +0 -1
- package/blockstore/commit-queue.d.ts +0 -12
- package/blockstore/commit-queue.d.ts.map +0 -1
- package/blockstore/commit-queue.js +0 -52
- 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 -104
- 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 -16
- package/blockstore/index.d.ts.map +0 -1
- package/blockstore/index.js +0 -16
- 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 -4
- package/blockstore/loader-helpers.d.ts.map +0 -1
- package/blockstore/loader-helpers.js +0 -16
- package/blockstore/loader-helpers.js.map +0 -1
- package/blockstore/loader.d.ts +0 -45
- package/blockstore/loader.d.ts.map +0 -1
- package/blockstore/loader.js +0 -352
- 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 -114
- 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 -105
- 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 -82
- package/blockstore/store.d.ts.map +0 -1
- package/blockstore/store.js +0 -438
- 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 -64
- package/blockstore/transaction.d.ts.map +0 -1
- package/blockstore/transaction.js +0 -249
- package/blockstore/transaction.js.map +0 -1
- package/blockstore/types.d.ts +0 -400
- package/blockstore/types.d.ts.map +0 -1
- package/blockstore/types.js +0 -55
- 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 -26114
- package/context.d.ts +0 -7
- package/context.d.ts.map +0 -1
- package/context.js +0 -15
- package/context.js.map +0 -1
- package/crdt-clock.d.ts +0 -27
- package/crdt-clock.d.ts.map +0 -1
- package/crdt-clock.js +0 -140
- package/crdt-clock.js.map +0 -1
- package/crdt-helpers.d.ts +0 -16
- package/crdt-helpers.d.ts.map +0 -1
- package/crdt-helpers.js +0 -316
- package/crdt-helpers.js.map +0 -1
- package/crdt.d.ts +0 -34
- package/crdt.d.ts.map +0 -1
- package/crdt.js +0 -131
- package/crdt.js.map +0 -1
- package/database.d.ts +0 -34
- package/database.d.ts.map +0 -1
- package/database.js +0 -121
- package/database.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/indexer-helpers.d.ts +0 -69
- package/indexer-helpers.d.ts.map +0 -1
- package/indexer-helpers.js +0 -135
- package/indexer-helpers.js.map +0 -1
- package/indexer.d.ts +0 -25
- package/indexer.d.ts.map +0 -1
- package/indexer.js +0 -231
- package/indexer.js.map +0 -1
- package/ledger.d.ts +0 -56
- package/ledger.d.ts.map +0 -1
- package/ledger.js +0 -224
- package/ledger.js.map +0 -1
- package/protocols/cloud/http-connection.d.ts +0 -25
- package/protocols/cloud/http-connection.d.ts.map +0 -1
- package/protocols/cloud/http-connection.js +0 -153
- 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 -279
- package/protocols/cloud/msg-types.d.ts.map +0 -1
- package/protocols/cloud/msg-types.js +0 -278
- package/protocols/cloud/msg-types.js.map +0 -1
- package/protocols/cloud/msger.d.ts +0 -79
- package/protocols/cloud/msger.d.ts.map +0 -1
- package/protocols/cloud/msger.js +0 -198
- package/protocols/cloud/msger.js.map +0 -1
- package/protocols/cloud/ws-connection.d.ts +0 -29
- package/protocols/cloud/ws-connection.d.ts.map +0 -1
- package/protocols/cloud/ws-connection.js +0 -163
- package/protocols/cloud/ws-connection.js.map +0 -1
- package/protocols/index.d.ts +0 -2
- package/protocols/index.d.ts.map +0 -1
- package/protocols/index.js +0 -2
- package/protocols/index.js.map +0 -1
- package/react/img-file.d.ts.map +0 -1
- package/react/img-file.js +0 -58
- package/react/img-file.js.map +0 -1
- package/react/index.d.ts.map +0 -1
- package/react/types.d.ts +0 -43
- 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 -19
- package/react/use-all-docs.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 -99
- 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 -15
- 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 -38
- package/react/use-live-query.js.map +0 -1
- package/react/utils.d.ts +0 -2
- package/react/utils.d.ts.map +0 -1
- package/react/utils.js +0 -4
- package/react/utils.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 -44
- package/runtime/gateways/cloud/gateway.d.ts.map +0 -1
- package/runtime/gateways/cloud/gateway.js +0 -496
- package/runtime/gateways/cloud/gateway.js.map +0 -1
- package/runtime/gateways/def-serde-gateway.d.ts +0 -19
- package/runtime/gateways/def-serde-gateway.d.ts.map +0 -1
- package/runtime/gateways/def-serde-gateway.js +0 -73
- 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 -51
- 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 -19
- package/runtime/gateways/file/key-bag-file.d.ts.map +0 -1
- package/runtime/gateways/file/key-bag-file.js +0 -40
- 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 -37
- 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 -15
- package/runtime/gateways/indexeddb/key-bag-indexeddb.d.ts.map +0 -1
- package/runtime/gateways/indexeddb/key-bag-indexeddb.js +0 -42
- 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 -58
- 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 -12
- package/runtime/key-bag-memory.d.ts.map +0 -1
- package/runtime/key-bag-memory.js +0 -23
- package/runtime/key-bag-memory.js.map +0 -1
- package/runtime/key-bag.d.ts +0 -85
- package/runtime/key-bag.d.ts.map +0 -1
- package/runtime/key-bag.js +0 -415
- 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 -102
- 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/types.d.ts +0 -427
- package/types.d.ts.map +0 -1
- package/types.js +0 -54
- package/types.js.map +0 -1
- package/use-fireproof/index.d.ts +0 -3
- package/use-fireproof/index.d.ts.map +0 -1
- package/use-fireproof/index.js +0 -3
- package/use-fireproof/index.js.map +0 -1
- package/utils.d.ts +0 -36
- package/utils.d.ts.map +0 -1
- package/utils.js +0 -379
- 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
@@ -1,279 +0,0 @@
|
|
1
|
-
import { Future, Logger, Result } from "@adviser/cement";
|
2
|
-
import { SuperThis } from "@fireproof/core";
|
3
|
-
import { CalculatePreSignedUrl } from "./msg-types-data.js";
|
4
|
-
import type { JWTPayload } from "jose";
|
5
|
-
export declare const VERSION = "FP-MSG-1.0";
|
6
|
-
export interface BaseTokenParam {
|
7
|
-
readonly alg: string;
|
8
|
-
readonly issuer: string;
|
9
|
-
readonly audience: string;
|
10
|
-
readonly validFor: number;
|
11
|
-
}
|
12
|
-
export interface FPCloudClaim extends JWTPayload {
|
13
|
-
readonly userId: string;
|
14
|
-
readonly tenants: {
|
15
|
-
readonly id: string;
|
16
|
-
readonly role: string;
|
17
|
-
}[];
|
18
|
-
readonly ledgers: {
|
19
|
-
readonly id: string;
|
20
|
-
readonly role: string;
|
21
|
-
readonly right: string;
|
22
|
-
}[];
|
23
|
-
}
|
24
|
-
export type TokenForParam = FPCloudClaim & Partial<BaseTokenParam>;
|
25
|
-
export type MsgWithError<T extends MsgBase> = T | ErrorMsg;
|
26
|
-
export interface PreSignedMsg extends MsgWithTenantLedger<MsgWithConnAuth> {
|
27
|
-
readonly methodParams: MethodSignedUrlParam;
|
28
|
-
readonly params: SignedUrlParam;
|
29
|
-
}
|
30
|
-
export interface RequestOpts {
|
31
|
-
readonly waitFor: (msg: MsgBase) => boolean;
|
32
|
-
readonly pollInterval?: number;
|
33
|
-
readonly timeout?: number;
|
34
|
-
}
|
35
|
-
export interface EnDeCoder {
|
36
|
-
encode<T>(node: T): Uint8Array;
|
37
|
-
decode<T>(data: Uint8Array): T;
|
38
|
-
}
|
39
|
-
export interface WaitForTid {
|
40
|
-
readonly tid: string;
|
41
|
-
readonly future: Future<MsgBase>;
|
42
|
-
readonly timeout?: number;
|
43
|
-
readonly waitFor: (msg: MsgBase) => boolean;
|
44
|
-
}
|
45
|
-
export interface NextId {
|
46
|
-
readonly nextId: SuperThis["nextId"];
|
47
|
-
}
|
48
|
-
export interface AuthType {
|
49
|
-
readonly type: "ucan" | "error" | "fp-cloud-jwk" | "fp-cloud";
|
50
|
-
}
|
51
|
-
export declare function isAuthTypeFPCloudJWK(a: AuthType): a is FPJWKCloudAuthType;
|
52
|
-
export declare function isAuthTypeFPCloud(a: AuthType): a is FPCloudAuthType;
|
53
|
-
export interface UCanAuth extends AuthType {
|
54
|
-
readonly type: "ucan";
|
55
|
-
readonly params: {
|
56
|
-
readonly tbd: string;
|
57
|
-
};
|
58
|
-
}
|
59
|
-
export interface FPJWKCloudAuthType extends AuthType {
|
60
|
-
readonly type: "fp-cloud-jwk";
|
61
|
-
readonly params: {
|
62
|
-
readonly jwk: string;
|
63
|
-
};
|
64
|
-
}
|
65
|
-
export interface FPCloudAuthType extends AuthType {
|
66
|
-
readonly type: "fp-cloud";
|
67
|
-
readonly params: {
|
68
|
-
readonly claim: TokenForParam;
|
69
|
-
readonly jwk: string;
|
70
|
-
};
|
71
|
-
}
|
72
|
-
export type AuthFactory = (tp?: Partial<TokenForParam>) => Promise<Result<AuthType>>;
|
73
|
-
export interface TenantLedger {
|
74
|
-
readonly tenant: string;
|
75
|
-
readonly ledger: string;
|
76
|
-
}
|
77
|
-
export declare function keyTenantLedger(t: TenantLedger): string;
|
78
|
-
export interface QSId {
|
79
|
-
readonly reqId: string;
|
80
|
-
readonly resId: string;
|
81
|
-
}
|
82
|
-
export declare function qsidEqual(a: QSId, b: QSId): boolean;
|
83
|
-
export declare function qsidKey(qsid: QSId): string;
|
84
|
-
export interface MsgBase {
|
85
|
-
readonly tid: string;
|
86
|
-
readonly type: string;
|
87
|
-
readonly version: string;
|
88
|
-
readonly auth: AuthType;
|
89
|
-
}
|
90
|
-
export declare function MsgIsTid(msg: MsgBase, tid: string): boolean;
|
91
|
-
type MsgWithConn<T extends MsgBase = MsgBase> = T & {
|
92
|
-
readonly conn: QSId;
|
93
|
-
};
|
94
|
-
export type MsgWithConnAuth<T extends MsgBase = MsgBase> = MsgWithConn<T> & {
|
95
|
-
readonly auth: AuthType;
|
96
|
-
};
|
97
|
-
export type MsgWithTenantLedger<T extends MsgWithConnAuth> = T & {
|
98
|
-
readonly tenant: TenantLedger;
|
99
|
-
};
|
100
|
-
export interface ErrorMsg extends MsgBase {
|
101
|
-
readonly type: "error";
|
102
|
-
readonly src: unknown;
|
103
|
-
readonly message: string;
|
104
|
-
readonly body?: string;
|
105
|
-
readonly stack?: string[];
|
106
|
-
}
|
107
|
-
export declare function MsgIsError(rq: MsgBase): rq is ErrorMsg;
|
108
|
-
export declare function MsgIsQSError(rq: ReqRes<MsgBase, MsgBase>): rq is ReqRes<ErrorMsg, ErrorMsg>;
|
109
|
-
export type HttpMethods = "GET" | "PUT" | "DELETE";
|
110
|
-
export type FPStoreTypes = "meta" | "car" | "wal" | "file";
|
111
|
-
export declare function coerceFPStoreTypes(s?: string): FPStoreTypes;
|
112
|
-
export type ProtocolCapabilities = "reqRes" | "stream";
|
113
|
-
export declare function isProtocolCapabilities(s: string): s is ProtocolCapabilities;
|
114
|
-
export interface Gestalt {
|
115
|
-
readonly storeTypes: FPStoreTypes[];
|
116
|
-
readonly id: string;
|
117
|
-
readonly protocolCapabilities: ProtocolCapabilities[];
|
118
|
-
readonly httpEndpoints: string[];
|
119
|
-
readonly wsEndpoints: string[];
|
120
|
-
readonly encodings: ("JSON" | "CBOR")[];
|
121
|
-
readonly auth: AuthType[];
|
122
|
-
readonly requiresAuth: boolean;
|
123
|
-
readonly data?: {
|
124
|
-
readonly inband: boolean;
|
125
|
-
readonly outband: boolean;
|
126
|
-
};
|
127
|
-
readonly meta?: {
|
128
|
-
readonly inband: true;
|
129
|
-
readonly outband: boolean;
|
130
|
-
};
|
131
|
-
readonly wal?: {
|
132
|
-
readonly inband: boolean;
|
133
|
-
readonly outband: boolean;
|
134
|
-
};
|
135
|
-
readonly reqTypes: string[];
|
136
|
-
readonly resTypes: string[];
|
137
|
-
readonly eventTypes: string[];
|
138
|
-
}
|
139
|
-
export interface MsgerParams {
|
140
|
-
readonly mime: string;
|
141
|
-
readonly auth?: AuthType;
|
142
|
-
readonly hasPersistent?: boolean;
|
143
|
-
readonly protocolCapabilities?: ProtocolCapabilities[];
|
144
|
-
readonly timeout: number;
|
145
|
-
}
|
146
|
-
export type GestaltParam = Partial<Gestalt> & {
|
147
|
-
readonly id: string;
|
148
|
-
};
|
149
|
-
export declare function defaultGestalt(msgP: MsgerParams, gestalt: GestaltParam): Gestalt;
|
150
|
-
export interface ReqChat extends MsgWithConn {
|
151
|
-
readonly type: "reqChat";
|
152
|
-
readonly message: string;
|
153
|
-
readonly targets: QSId[];
|
154
|
-
}
|
155
|
-
export interface ResChat extends MsgWithConn {
|
156
|
-
readonly type: "resChat";
|
157
|
-
readonly message: string;
|
158
|
-
readonly targets: QSId[];
|
159
|
-
}
|
160
|
-
export declare function buildReqChat(sthis: NextId, auth: AuthType, conn: QSId, message: string, targets?: QSId[]): ReqChat;
|
161
|
-
export declare function buildResChat(req: ReqChat, conn?: QSId, message?: string, targets?: QSId[], auth?: AuthType): ResChat;
|
162
|
-
export declare function MsgIsReqChat(msg: MsgBase): msg is ReqChat;
|
163
|
-
export declare function MsgIsResChat(msg: MsgBase): msg is ResChat;
|
164
|
-
export interface ReqGestalt extends MsgBase {
|
165
|
-
readonly type: "reqGestalt";
|
166
|
-
readonly gestalt: Gestalt;
|
167
|
-
readonly publish?: boolean;
|
168
|
-
}
|
169
|
-
export declare function MsgIsReqGestalt(msg: MsgBase): msg is ReqGestalt;
|
170
|
-
export declare function buildReqGestalt(sthis: NextId, auth: AuthType, gestalt: Gestalt, publish?: boolean): ReqGestalt;
|
171
|
-
export interface ConnInfo {
|
172
|
-
readonly connIds: string[];
|
173
|
-
}
|
174
|
-
export interface ResGestalt extends MsgBase {
|
175
|
-
readonly type: "resGestalt";
|
176
|
-
readonly gestalt: Gestalt;
|
177
|
-
}
|
178
|
-
export declare function buildResGestalt(req: ReqGestalt, gestalt: Gestalt, auth: AuthType): ResGestalt | ErrorMsg;
|
179
|
-
export declare function MsgIsResGestalt(msg: MsgBase): msg is ResGestalt;
|
180
|
-
export interface ReqOpenConnection {
|
181
|
-
readonly reqId?: string;
|
182
|
-
readonly resId?: string;
|
183
|
-
}
|
184
|
-
export interface ReqOpenConn {
|
185
|
-
readonly reqId: string;
|
186
|
-
readonly resId?: string;
|
187
|
-
}
|
188
|
-
export interface ReqOpen extends MsgBase {
|
189
|
-
readonly type: "reqOpen";
|
190
|
-
readonly conn: ReqOpenConn;
|
191
|
-
}
|
192
|
-
export declare function buildReqOpen(sthis: NextId, auth: AuthType, conn: ReqOpenConnection): ReqOpen;
|
193
|
-
export declare function MsgIsReqOpen(imsg: MsgBase): imsg is MsgWithConn<ReqOpen>;
|
194
|
-
export interface ResOpen extends MsgBase {
|
195
|
-
readonly type: "resOpen";
|
196
|
-
readonly conn: QSId;
|
197
|
-
}
|
198
|
-
export declare function MsgIsWithConn<T extends MsgBase>(msg: T): msg is MsgWithConn<T>;
|
199
|
-
export declare function MsgIsWithConnAuth<T extends MsgBase>(msg: T): msg is MsgWithConnAuth<T>;
|
200
|
-
export declare function MsgIsConnected<T extends MsgBase>(msg: T, qsid: QSId): msg is MsgWithConn<T>;
|
201
|
-
export declare function buildResOpen(sthis: NextId, req: ReqOpen, resStreamId?: string): ResOpen;
|
202
|
-
export declare function MsgIsResOpen(msg: MsgBase): msg is ResOpen;
|
203
|
-
export interface ReqClose extends MsgWithConn {
|
204
|
-
readonly type: "reqClose";
|
205
|
-
}
|
206
|
-
export declare function MsgIsReqClose(msg: MsgBase): msg is ReqClose;
|
207
|
-
export interface ResClose extends MsgWithConn {
|
208
|
-
readonly type: "resClose";
|
209
|
-
}
|
210
|
-
export declare function MsgIsResClose(msg: MsgBase): msg is ResClose;
|
211
|
-
export declare function buildResClose(req: ReqClose, conn: QSId): ResClose;
|
212
|
-
export declare function buildReqClose(sthis: NextId, auth: AuthType, conn: QSId): ReqClose;
|
213
|
-
export interface SignedUrlParam {
|
214
|
-
readonly path?: string;
|
215
|
-
readonly key: string;
|
216
|
-
readonly expires?: number;
|
217
|
-
readonly index?: string;
|
218
|
-
}
|
219
|
-
export interface MethodSignedUrlParam {
|
220
|
-
readonly method: HttpMethods;
|
221
|
-
readonly store: FPStoreTypes;
|
222
|
-
}
|
223
|
-
export interface ReqSignedUrlParam {
|
224
|
-
readonly auth: AuthType;
|
225
|
-
readonly methodParam: MethodSignedUrlParam;
|
226
|
-
readonly params: SignedUrlParam;
|
227
|
-
}
|
228
|
-
export interface UpdateReqRes<Q extends MsgBase, S extends MsgBase> {
|
229
|
-
req: Q;
|
230
|
-
res: S;
|
231
|
-
}
|
232
|
-
export type ReqRes<Q extends MsgBase, S extends MsgBase> = Readonly<UpdateReqRes<Q, S>>;
|
233
|
-
export declare function buildErrorMsg(msgCtx: {
|
234
|
-
readonly logger: Logger;
|
235
|
-
readonly sthis: SuperThis;
|
236
|
-
}, base: Partial<MsgBase & {
|
237
|
-
ref?: unknown;
|
238
|
-
}>, error: Error, body?: string, stack?: string[]): ErrorMsg;
|
239
|
-
export declare function MsgIsTenantLedger<T extends MsgBase>(msg: T): msg is MsgWithTenantLedger<MsgWithConnAuth<T>>;
|
240
|
-
export interface ReqSignedUrl extends ReqSignedUrlWithoutMethodParams {
|
241
|
-
readonly methodParams: MethodSignedUrlParam;
|
242
|
-
}
|
243
|
-
export interface ReqSignedUrlWithoutMethodParams extends MsgWithTenantLedger<MsgWithConnAuth> {
|
244
|
-
readonly params: SignedUrlParam;
|
245
|
-
}
|
246
|
-
export interface GwCtx {
|
247
|
-
readonly tid?: string;
|
248
|
-
readonly conn: QSId;
|
249
|
-
readonly tenant: TenantLedger;
|
250
|
-
}
|
251
|
-
export interface GwCtxConn {
|
252
|
-
readonly tid?: string;
|
253
|
-
readonly conn: QSId;
|
254
|
-
readonly tenant: TenantLedger;
|
255
|
-
}
|
256
|
-
export declare function buildReqSignedUrl<T extends ReqSignedUrl>(sthis: NextId, type: string, rparam: ReqSignedUrlParam, gwCtx: GwCtx): T;
|
257
|
-
export interface ResSignedUrl extends MsgWithTenantLedger<MsgWithConn> {
|
258
|
-
readonly methodParams: MethodSignedUrlParam;
|
259
|
-
readonly params: SignedUrlParam;
|
260
|
-
readonly signedUrl: string;
|
261
|
-
}
|
262
|
-
export interface ResOptionalSignedUrl extends MsgWithTenantLedger<MsgWithConn> {
|
263
|
-
readonly params: SignedUrlParam;
|
264
|
-
readonly methodParams: MethodSignedUrlParam;
|
265
|
-
readonly signedUrl?: string;
|
266
|
-
}
|
267
|
-
export interface MsgTypesCtx {
|
268
|
-
readonly sthis: SuperThis;
|
269
|
-
readonly logger: Logger;
|
270
|
-
}
|
271
|
-
export interface MsgTypesCtxSync {
|
272
|
-
readonly sthis: SuperThis;
|
273
|
-
readonly logger: Logger;
|
274
|
-
readonly auth: AuthType;
|
275
|
-
}
|
276
|
-
export declare function resAuth(msg: MsgBase): Promise<AuthType>;
|
277
|
-
export declare function buildRes<Q extends MsgWithTenantLedger<MsgWithConn<ReqSignedUrlWithoutMethodParams>>, S extends ResSignedUrl>(methodParams: MethodSignedUrlParam, type: string, msgCtx: MsgTypesCtx, req: Q, ctx: CalculatePreSignedUrl): Promise<MsgWithError<S>>;
|
278
|
-
export {};
|
279
|
-
//# sourceMappingURL=msg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AC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAEzB;AAUD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEvD;AAED,wBAAsB,QAAQ,CAAC,CAAC,SAAS,mBAAmB,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAC,EAAE,CAAC,SAAS,YAAY,EAChI,YAAY,EAAE,oBAAoB,EAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,qBAAqB,GACzB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAwB1B"}
|
@@ -1,278 +0,0 @@
|
|
1
|
-
export const VERSION = "FP-MSG-1.0";
|
2
|
-
export function isAuthTypeFPCloudJWK(a) {
|
3
|
-
return a.type === "fp-cloud-jwk";
|
4
|
-
}
|
5
|
-
export function isAuthTypeFPCloud(a) {
|
6
|
-
return a.type === "fp-cloud";
|
7
|
-
}
|
8
|
-
export function keyTenantLedger(t) {
|
9
|
-
return `${t.tenant}:${t.ledger}`;
|
10
|
-
}
|
11
|
-
export function qsidEqual(a, b) {
|
12
|
-
return a.reqId === b.reqId && a.resId === b.resId;
|
13
|
-
}
|
14
|
-
export function qsidKey(qsid) {
|
15
|
-
return `${qsid.reqId}:${qsid.resId}`;
|
16
|
-
}
|
17
|
-
export function MsgIsTid(msg, tid) {
|
18
|
-
return msg.tid === tid;
|
19
|
-
}
|
20
|
-
export function MsgIsError(rq) {
|
21
|
-
return rq.type === "error";
|
22
|
-
}
|
23
|
-
export function MsgIsQSError(rq) {
|
24
|
-
return rq.res.type === "error" || rq.req.type === "error";
|
25
|
-
}
|
26
|
-
export function coerceFPStoreTypes(s) {
|
27
|
-
const x = s?.trim();
|
28
|
-
if (x === "meta" || x === "car" || x === "wal" || x === "file") {
|
29
|
-
return x;
|
30
|
-
}
|
31
|
-
throw new Error(`Invalid FPStoreTypes: ${s}`);
|
32
|
-
}
|
33
|
-
export function isProtocolCapabilities(s) {
|
34
|
-
const x = s.trim();
|
35
|
-
return x === "reqRes" || x === "stream";
|
36
|
-
}
|
37
|
-
export function defaultGestalt(msgP, gestalt) {
|
38
|
-
return {
|
39
|
-
storeTypes: ["meta", "file", "car", "wal"],
|
40
|
-
httpEndpoints: ["/fp"],
|
41
|
-
wsEndpoints: ["/ws"],
|
42
|
-
encodings: ["JSON"],
|
43
|
-
protocolCapabilities: msgP.protocolCapabilities || ["reqRes", "stream"],
|
44
|
-
auth: [],
|
45
|
-
requiresAuth: false,
|
46
|
-
data: msgP.hasPersistent
|
47
|
-
? {
|
48
|
-
inband: true,
|
49
|
-
outband: true,
|
50
|
-
}
|
51
|
-
: undefined,
|
52
|
-
meta: msgP.hasPersistent
|
53
|
-
? {
|
54
|
-
inband: true,
|
55
|
-
outband: true,
|
56
|
-
}
|
57
|
-
: undefined,
|
58
|
-
wal: msgP.hasPersistent
|
59
|
-
? {
|
60
|
-
inband: true,
|
61
|
-
outband: true,
|
62
|
-
}
|
63
|
-
: undefined,
|
64
|
-
reqTypes: [
|
65
|
-
"reqOpen",
|
66
|
-
"reqGestalt",
|
67
|
-
"reqSubscribeMeta",
|
68
|
-
"reqPutMeta",
|
69
|
-
"reqBindMeta",
|
70
|
-
"reqDelMeta",
|
71
|
-
"reqPutData",
|
72
|
-
"reqGetData",
|
73
|
-
"reqDelData",
|
74
|
-
"reqPutWAL",
|
75
|
-
"reqGetWAL",
|
76
|
-
"reqDelWAL",
|
77
|
-
"reqUpdateMeta",
|
78
|
-
],
|
79
|
-
resTypes: [
|
80
|
-
"resOpen",
|
81
|
-
"resGestalt",
|
82
|
-
"resSubscribeMeta",
|
83
|
-
"resPutMeta",
|
84
|
-
"resGetMeta",
|
85
|
-
"resDelMeta",
|
86
|
-
"resPutData",
|
87
|
-
"resGetData",
|
88
|
-
"resDelData",
|
89
|
-
"resPutWAL",
|
90
|
-
"resGetWAL",
|
91
|
-
"resDelWAL",
|
92
|
-
"updateMeta",
|
93
|
-
],
|
94
|
-
eventTypes: ["updateMeta"],
|
95
|
-
...gestalt,
|
96
|
-
};
|
97
|
-
}
|
98
|
-
export function buildReqChat(sthis, auth, conn, message, targets) {
|
99
|
-
return {
|
100
|
-
tid: sthis.nextId().str,
|
101
|
-
type: "reqChat",
|
102
|
-
version: VERSION,
|
103
|
-
auth,
|
104
|
-
conn,
|
105
|
-
message,
|
106
|
-
targets: targets ?? [],
|
107
|
-
};
|
108
|
-
}
|
109
|
-
export function buildResChat(req, conn, message, targets, auth) {
|
110
|
-
return {
|
111
|
-
...req,
|
112
|
-
auth: auth || req.auth,
|
113
|
-
conn: conn || req.conn,
|
114
|
-
message: message || req.message,
|
115
|
-
targets: targets || req.targets,
|
116
|
-
type: "resChat",
|
117
|
-
version: VERSION,
|
118
|
-
};
|
119
|
-
}
|
120
|
-
export function MsgIsReqChat(msg) {
|
121
|
-
return msg.type === "reqChat";
|
122
|
-
}
|
123
|
-
export function MsgIsResChat(msg) {
|
124
|
-
return msg.type === "resChat";
|
125
|
-
}
|
126
|
-
export function MsgIsReqGestalt(msg) {
|
127
|
-
return msg.type === "reqGestalt";
|
128
|
-
}
|
129
|
-
export function buildReqGestalt(sthis, auth, gestalt, publish) {
|
130
|
-
return {
|
131
|
-
tid: sthis.nextId().str,
|
132
|
-
auth,
|
133
|
-
type: "reqGestalt",
|
134
|
-
version: VERSION,
|
135
|
-
gestalt,
|
136
|
-
publish,
|
137
|
-
};
|
138
|
-
}
|
139
|
-
export function buildResGestalt(req, gestalt, auth) {
|
140
|
-
return {
|
141
|
-
tid: req.tid,
|
142
|
-
auth: auth || req.auth,
|
143
|
-
type: "resGestalt",
|
144
|
-
version: VERSION,
|
145
|
-
gestalt,
|
146
|
-
};
|
147
|
-
}
|
148
|
-
export function MsgIsResGestalt(msg) {
|
149
|
-
return msg.type === "resGestalt";
|
150
|
-
}
|
151
|
-
export function buildReqOpen(sthis, auth, conn) {
|
152
|
-
return {
|
153
|
-
tid: sthis.nextId().str,
|
154
|
-
auth,
|
155
|
-
type: "reqOpen",
|
156
|
-
version: VERSION,
|
157
|
-
conn: {
|
158
|
-
...conn,
|
159
|
-
reqId: conn.reqId || sthis.nextId().str,
|
160
|
-
},
|
161
|
-
};
|
162
|
-
}
|
163
|
-
export function MsgIsReqOpen(imsg) {
|
164
|
-
const msg = imsg;
|
165
|
-
return msg.type === "reqOpen" && !!msg.conn && !!msg.conn.reqId;
|
166
|
-
}
|
167
|
-
export function MsgIsWithConn(msg) {
|
168
|
-
const mwc = msg.conn;
|
169
|
-
return mwc && !!mwc.reqId && !!mwc.resId;
|
170
|
-
}
|
171
|
-
export function MsgIsWithConnAuth(msg) {
|
172
|
-
return MsgIsWithConn(msg) && !!msg.auth && typeof msg.auth.type === "string";
|
173
|
-
}
|
174
|
-
export function MsgIsConnected(msg, qsid) {
|
175
|
-
return MsgIsWithConn(msg) && msg.conn.reqId === qsid.reqId && msg.conn.resId === qsid.resId;
|
176
|
-
}
|
177
|
-
export function buildResOpen(sthis, req, resStreamId) {
|
178
|
-
if (!(req.conn && req.conn.reqId)) {
|
179
|
-
throw new Error("req.conn.reqId is required");
|
180
|
-
}
|
181
|
-
return {
|
182
|
-
...req,
|
183
|
-
type: "resOpen",
|
184
|
-
conn: {
|
185
|
-
...req.conn,
|
186
|
-
resId: req.conn.resId || resStreamId || sthis.nextId().str,
|
187
|
-
},
|
188
|
-
};
|
189
|
-
}
|
190
|
-
export function MsgIsResOpen(msg) {
|
191
|
-
return msg.type === "resOpen";
|
192
|
-
}
|
193
|
-
export function MsgIsReqClose(msg) {
|
194
|
-
return msg.type === "reqClose" && MsgIsWithConn(msg);
|
195
|
-
}
|
196
|
-
export function MsgIsResClose(msg) {
|
197
|
-
return msg.type === "resClose" && MsgIsWithConn(msg);
|
198
|
-
}
|
199
|
-
export function buildResClose(req, conn) {
|
200
|
-
return {
|
201
|
-
...req,
|
202
|
-
type: "resClose",
|
203
|
-
conn,
|
204
|
-
};
|
205
|
-
}
|
206
|
-
export function buildReqClose(sthis, auth, conn) {
|
207
|
-
return {
|
208
|
-
tid: sthis.nextId().str,
|
209
|
-
auth,
|
210
|
-
type: "reqClose",
|
211
|
-
version: VERSION,
|
212
|
-
conn,
|
213
|
-
};
|
214
|
-
}
|
215
|
-
export function buildErrorMsg(msgCtx, base, error, body, stack) {
|
216
|
-
if (!stack && msgCtx.sthis.env.get("FP_STACK")) {
|
217
|
-
stack = error.stack?.split("\n");
|
218
|
-
}
|
219
|
-
const msg = {
|
220
|
-
auth: base.auth || { type: "error" },
|
221
|
-
src: base,
|
222
|
-
type: "error",
|
223
|
-
tid: base.tid || "internal",
|
224
|
-
message: error.message,
|
225
|
-
version: VERSION,
|
226
|
-
body,
|
227
|
-
stack,
|
228
|
-
};
|
229
|
-
msgCtx.logger.Any("ErrorMsg", msg);
|
230
|
-
return msg;
|
231
|
-
}
|
232
|
-
export function MsgIsTenantLedger(msg) {
|
233
|
-
if (MsgIsWithConnAuth(msg)) {
|
234
|
-
const t = msg.tenant;
|
235
|
-
return !!t && !!t.tenant && !!t.ledger;
|
236
|
-
}
|
237
|
-
return false;
|
238
|
-
}
|
239
|
-
export function buildReqSignedUrl(sthis, type, rparam, gwCtx) {
|
240
|
-
return {
|
241
|
-
tid: sthis.nextId().str,
|
242
|
-
type,
|
243
|
-
auth: rparam.auth,
|
244
|
-
methodParams: rparam.methodParam,
|
245
|
-
version: VERSION,
|
246
|
-
...gwCtx,
|
247
|
-
params: rparam.params,
|
248
|
-
};
|
249
|
-
}
|
250
|
-
export function resAuth(msg) {
|
251
|
-
return msg.auth ? Promise.resolve(msg.auth) : Promise.reject(new Error("No Auth"));
|
252
|
-
}
|
253
|
-
export async function buildRes(methodParams, type, msgCtx, req, ctx) {
|
254
|
-
const psm = {
|
255
|
-
type: "reqSignedUrl",
|
256
|
-
auth: await resAuth(req),
|
257
|
-
version: req.version,
|
258
|
-
methodParams,
|
259
|
-
params: {
|
260
|
-
...req.params,
|
261
|
-
},
|
262
|
-
conn: req.conn,
|
263
|
-
tenant: req.tenant,
|
264
|
-
tid: req.tid,
|
265
|
-
};
|
266
|
-
const rSignedUrl = await ctx.calculatePreSignedUrl(msgCtx, psm);
|
267
|
-
if (rSignedUrl.isErr()) {
|
268
|
-
return buildErrorMsg(msgCtx, req, rSignedUrl.Err());
|
269
|
-
}
|
270
|
-
return {
|
271
|
-
...req,
|
272
|
-
params: psm.params,
|
273
|
-
methodParams,
|
274
|
-
type,
|
275
|
-
signedUrl: rSignedUrl.Ok().toString(),
|
276
|
-
};
|
277
|
-
}
|
278
|
-
//# sourceMappingURL=msg-types.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"msg-types.js","sourceRoot":"","sources":["../../../../../src/protocols/cloud/msg-types.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;AAuDpC,MAAM,UAAU,oBAAoB,CAAC,CAAW;IAC9C,OAAO,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,CAAW;IAC3C,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;AAC/B,CAAC;AA8BD,MAAM,UAAU,eAAe,CAAC,CAAe;IAC7C,OAAO,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACnC,CAAC;AAOD,MAAM,UAAU,SAAS,CAAC,CAAO,EAAE,CAAO;IACxC,OAAO,CAAC,CAAC,KAAK,KAAK,CA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M,UAAU,OAAO,CAAC,GAAY;IAClC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,YAAkC,EAClC,IAAY,EACZ,MAAmB,EACnB,GAAM,EACN,GAA0B;IAE1B,MAAM,GAAG,GAAG;QACV,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;QACxB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,YAAY;QACZ,MAAM,EAAE;YACN,GAAG,GAAG,CAAC,MAAM;SACd;QACD,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,EAAE,GAAG,CAAC,GAAG;KACU,CAAC;IACzB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChE,IAAI,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;QACvB,OAAO,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO;QACL,GAAG,GAAG;QACN,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,YAAY;QACZ,IAAI;QACJ,SAAS,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE;KACR,CAAC;AAClC,CAAC"}
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import { CoerceURI, Logger, Result, URI } from "@adviser/cement";
|
2
|
-
import { EnDeCoder, Gestalt, MsgBase, MsgerParams, RequestOpts, MsgWithError, MsgWithConnAuth, QSId, AuthFactory, AuthType, FPJWKCloudAuthType } from "./msg-types.js";
|
3
|
-
import { SuperThis } from "../../types.js";
|
4
|
-
export declare function selectRandom<T>(arr: T[]): T;
|
5
|
-
export declare function timeout<T>(ms: number, promise: Promise<T>): Promise<T>;
|
6
|
-
export type OnMsgFn<T extends MsgBase = MsgBase> = (msg: MsgWithError<T>) => void;
|
7
|
-
export type UnReg = () => void;
|
8
|
-
export interface ExchangedGestalt {
|
9
|
-
readonly my: Gestalt;
|
10
|
-
readonly remote: Gestalt;
|
11
|
-
}
|
12
|
-
export type OnErrorFn = (msg: Partial<MsgBase>, err: Error) => Partial<MsgBase>;
|
13
|
-
export interface ActiveStream<S extends MsgBase, Q extends MsgBase> {
|
14
|
-
readonly id: string;
|
15
|
-
readonly bind: {
|
16
|
-
readonly msg: Q;
|
17
|
-
readonly opts: RequestOpts;
|
18
|
-
};
|
19
|
-
timeout?: unknown;
|
20
|
-
controller?: ReadableStreamDefaultController<MsgWithError<S>>;
|
21
|
-
}
|
22
|
-
export interface MsgRawConnection<T extends MsgBase = MsgBase> {
|
23
|
-
readonly sthis: SuperThis;
|
24
|
-
readonly exchangedGestalt: ExchangedGestalt;
|
25
|
-
readonly activeBinds: Map<string, ActiveStream<T, MsgBase>>;
|
26
|
-
bind<S extends T, Q extends T>(req: Q, opts: RequestOpts): ReadableStream<MsgWithError<S>>;
|
27
|
-
request<S extends T, Q extends T>(req: Q, opts: RequestOpts): Promise<MsgWithError<S>>;
|
28
|
-
send<S extends T, Q extends T>(msg: Q): Promise<MsgWithError<S>>;
|
29
|
-
start(): Promise<Result<void>>;
|
30
|
-
close(o: T): Promise<Result<void>>;
|
31
|
-
onMsg(msg: OnMsgFn<T>): UnReg;
|
32
|
-
}
|
33
|
-
export declare function jsonEnDe(sthis: SuperThis): EnDeCoder;
|
34
|
-
export type MsgerParamsWithEnDe = MsgerParams & {
|
35
|
-
readonly ende: EnDeCoder;
|
36
|
-
};
|
37
|
-
export declare function defaultMsgParams(sthis: SuperThis, igs: Partial<MsgerParamsWithEnDe>): MsgerParamsWithEnDe;
|
38
|
-
export interface OpenParams {
|
39
|
-
readonly timeout: number;
|
40
|
-
}
|
41
|
-
export declare function applyStart(prC: Promise<Result<MsgRawConnection>>): Promise<Result<MsgRawConnection>>;
|
42
|
-
export declare function authTypeFromUri(logger: Logger, curi: CoerceURI): Promise<Result<FPJWKCloudAuthType>>;
|
43
|
-
export declare class MsgConnected {
|
44
|
-
static connect(auth: AuthType, mrc: Result<MsgRawConnection> | MsgRawConnection, conn?: Partial<QSId>): Promise<Result<MsgConnected>>;
|
45
|
-
readonly sthis: SuperThis;
|
46
|
-
readonly conn: QSId;
|
47
|
-
readonly raw: MsgRawConnection;
|
48
|
-
readonly exchangedGestalt: ExchangedGestalt;
|
49
|
-
readonly activeBinds: Map<string, ActiveStream<MsgWithConnAuth, MsgBase>>;
|
50
|
-
readonly id: string;
|
51
|
-
private constructor();
|
52
|
-
attachAuth(auth: AuthFactory): MsgConnectedAuth;
|
53
|
-
}
|
54
|
-
export declare class MsgConnectedAuth implements MsgRawConnection<MsgWithConnAuth> {
|
55
|
-
readonly sthis: SuperThis;
|
56
|
-
readonly conn: QSId;
|
57
|
-
readonly raw: MsgRawConnection;
|
58
|
-
readonly exchangedGestalt: ExchangedGestalt;
|
59
|
-
readonly activeBinds: Map<string, ActiveStream<MsgWithConnAuth, MsgBase>>;
|
60
|
-
readonly id: string;
|
61
|
-
readonly authFactory: AuthFactory;
|
62
|
-
constructor(conn: MsgConnected, authFactory: AuthFactory);
|
63
|
-
bind<S extends MsgWithConnAuth, Q extends MsgWithConnAuth>(req: Q, opts: RequestOpts): ReadableStream<MsgWithError<S>>;
|
64
|
-
authType(): Promise<Result<AuthType>>;
|
65
|
-
msgConnAuth(): Promise<Result<MsgWithConnAuth>>;
|
66
|
-
request<S extends MsgWithConnAuth, Q extends MsgWithConnAuth>(req: Q, opts: RequestOpts): Promise<MsgWithError<S>>;
|
67
|
-
send<S extends MsgWithConnAuth, Q extends MsgWithConnAuth>(msg: Q): Promise<MsgWithError<S>>;
|
68
|
-
start(): Promise<Result<void>>;
|
69
|
-
close(t: MsgWithConnAuth): Promise<Result<void>>;
|
70
|
-
onMsg(msgFn: OnMsgFn<MsgWithConnAuth>): UnReg;
|
71
|
-
}
|
72
|
-
export declare class Msger {
|
73
|
-
static openHttp(sthis: SuperThis, urls: URI[], msgP: MsgerParamsWithEnDe, exGestalt: ExchangedGestalt): Promise<Result<MsgRawConnection>>;
|
74
|
-
static openWS(sthis: SuperThis, url: URI, msgP: MsgerParamsWithEnDe, exGestalt: ExchangedGestalt): Promise<Result<MsgRawConnection>>;
|
75
|
-
static open(sthis: SuperThis, auth: AuthType, curl: CoerceURI, imsgP?: Partial<MsgerParamsWithEnDe>): Promise<Result<MsgRawConnection>>;
|
76
|
-
static connect(sthis: SuperThis, auth: AuthType, curl: CoerceURI, imsgP?: Partial<MsgerParamsWithEnDe>, conn?: Partial<QSId>): Promise<Result<MsgConnected>>;
|
77
|
-
private constructor();
|
78
|
-
}
|
79
|
-
//# sourceMappingURL=msger.d.ts.map
|