@dxos/protocols 0.8.4-main.f9ba587 → 0.8.4-main.fbb7a13
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/dist/src/FunctionProtocol.d.ts +82 -0
- package/dist/src/FunctionProtocol.d.ts.map +1 -0
- package/dist/src/FunctionProtocol.js +4 -0
- package/dist/src/FunctionProtocol.js.map +1 -0
- package/dist/src/automerge.d.ts +8 -0
- package/dist/src/automerge.d.ts.map +1 -1
- package/dist/src/automerge.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/dashboard_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/dashboard_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/echo-proxy_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/echo-proxy_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/epoch_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/epoch_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/functions_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/agent/functions_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/bot_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/bot_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/client/invitation_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/logging_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/client/logging_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +189 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +39 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +65 -19
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js +28 -23
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +40 -7
- package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/config_pb.js +7 -2
- package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/diagnostics_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/diagnostics_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/host_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/swarm_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/devtools/swarm_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/blob_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/blob_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/feed_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/feed_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/filter_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/filter_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/indexing_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/indexing_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/metadata_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/document_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/document_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/messenger_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/messenger_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/text_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/model/text_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/object_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/object_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +13 -3
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +2 -2
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +71 -10
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +16 -6
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/snapshot_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/snapshot_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/timeframe_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/timeframe_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/calls_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/calls_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/messenger_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/signal_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/edge/signal_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/error_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/error_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/field_options_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/field_options_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js +2 -2
- package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/gravity_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/gravity_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/auth_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/auth_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/greet_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/greet_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/identity_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials/identity_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/credentials_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/invitations_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keyring_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keyring_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keys_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/keys_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/signed_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/halo/signed_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +2 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/keys_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/keys_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/bridge_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/bridge_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/broadcast_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/broadcast_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/messaging_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/messaging_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/muxer_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/muxer_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/presence_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/presence_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/protocol_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/protocol_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/replicator_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/replicator_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/signal_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/signal_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/swarm_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/swarm_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/control_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/control_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/registry_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/registry_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/rpc_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/agentmanager_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/agentmanager_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/publisher_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/publisher_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/supervisor_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/supervisor_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/service/tunnel_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/service/tunnel_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js +2 -2
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/type_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/type_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/value_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/dxos/value_pb.js +1 -1
- package/dist/src/buf/proto/gen/example/testing/data_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/example/testing/data_pb.js +1 -1
- package/dist/src/buf/proto/gen/example/testing/rpc_pb.d.ts +1 -1
- package/dist/src/buf/proto/gen/example/testing/rpc_pb.js +1 -1
- package/dist/src/edge/EdgeFunctionEnv.d.ts +120 -0
- package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
- package/dist/src/edge/EdgeFunctionEnv.js +4 -0
- package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
- package/dist/src/edge/edge.d.ts +346 -0
- package/dist/src/edge/edge.d.ts.map +1 -0
- package/dist/src/edge/edge.js +160 -0
- package/dist/src/edge/edge.js.map +1 -0
- package/dist/src/edge/errors.d.ts +29 -0
- package/dist/src/edge/errors.d.ts.map +1 -0
- package/dist/src/edge/errors.js +69 -0
- package/dist/src/edge/errors.js.map +1 -0
- package/dist/src/edge/index.d.ts +4 -0
- package/dist/src/edge/index.d.ts.map +1 -0
- package/dist/src/edge/index.js +7 -0
- package/dist/src/edge/index.js.map +1 -0
- package/dist/src/errors/base-errors.d.ts +86 -8
- package/dist/src/errors/base-errors.d.ts.map +1 -1
- package/dist/src/errors/base-errors.js +4 -19
- package/dist/src/errors/base-errors.js.map +1 -1
- package/dist/src/errors/encoding.d.ts +1 -1
- package/dist/src/errors/encoding.d.ts.map +1 -1
- package/dist/src/errors/encoding.js.map +1 -1
- package/dist/src/errors/errors.d.ts +618 -41
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/errors/errors.js +49 -103
- package/dist/src/errors/errors.js.map +1 -1
- package/dist/src/errors/errors.test.js +1 -1
- package/dist/src/errors/errors.test.js.map +1 -1
- package/dist/src/errors/helpers.d.ts +8 -4
- package/dist/src/errors/helpers.d.ts.map +1 -1
- package/dist/src/errors/helpers.js +3 -3
- package/dist/src/errors/helpers.js.map +1 -1
- package/dist/src/feed-replication.d.ts.map +1 -1
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/indexing.d.ts +1 -1
- package/dist/src/indexing.d.ts.map +1 -1
- package/dist/src/indexing.js +1 -1
- package/dist/src/indexing.js.map +1 -1
- package/dist/src/invitation.d.ts +1 -1
- package/dist/src/invitation.d.ts.map +1 -1
- package/dist/src/invitation.js +1 -1
- package/dist/src/invitation.js.map +1 -1
- package/dist/src/messenger.d.ts +16 -0
- package/dist/src/messenger.d.ts.map +1 -0
- package/dist/src/messenger.js +4 -0
- package/dist/src/messenger.js.map +1 -0
- package/dist/src/proto/gen/dxos/client/services.d.ts +895 -765
- package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/client/services.js +103 -100
- package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/src/proto/gen/dxos/config.d.ts +33 -2
- package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.d.ts +17 -1
- package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +43 -8
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/index.d.ts +10 -0
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/index.d.ts +1 -1
- package/dist/src/proto/index.d.ts.map +1 -1
- package/dist/src/proto/index.js +0 -1
- package/dist/src/proto/index.js.map +1 -1
- package/dist/src/queue.d.ts +2 -23
- package/dist/src/queue.d.ts.map +1 -1
- package/dist/src/queue.js +2 -1
- package/dist/src/queue.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -17
- package/src/FunctionProtocol.ts +104 -0
- package/src/automerge.ts +8 -0
- package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/agent/functions_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/bot_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/invitation_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/logging_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/client/queue_pb.ts +231 -0
- package/src/buf/proto/gen/dxos/client/services_pb.ts +84 -29
- package/src/buf/proto/gen/dxos/config_pb.ts +48 -10
- package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/devtools/host_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/blob_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/feed_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/filter_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/object_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/query_pb.ts +18 -6
- package/src/buf/proto/gen/dxos/echo/service_pb.ts +87 -18
- package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/edge/calls_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/edge/signal_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/error_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/field_options_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/google_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/gravity_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/keys_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/halo/signed_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/iframe_pb.ts +4 -3
- package/src/buf/proto/gen/dxos/keys_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/registry_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/rpc_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/publisher_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/tracing_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/type_pb.ts +3 -3
- package/src/buf/proto/gen/dxos/value_pb.ts +3 -3
- package/src/buf/proto/gen/example/testing/data_pb.ts +3 -3
- package/src/buf/proto/gen/example/testing/rpc_pb.ts +3 -3
- package/src/edge/EdgeFunctionEnv.ts +193 -0
- package/src/edge/edge.ts +484 -0
- package/src/edge/errors.ts +85 -0
- package/src/edge/index.ts +7 -0
- package/src/errors/base-errors.ts +4 -20
- package/src/errors/encoding.ts +2 -1
- package/src/errors/errors.test.ts +1 -1
- package/src/errors/errors.ts +57 -122
- package/src/errors/helpers.ts +5 -5
- package/src/feed-replication.ts +1 -0
- package/src/index.ts +9 -7
- package/src/indexing.ts +1 -1
- package/src/invitation.ts +1 -1
- package/src/messenger.ts +22 -0
- package/src/proto/dxos/client/queue.proto +67 -0
- package/src/proto/dxos/client/services.proto +20 -3
- package/src/proto/dxos/config.proto +38 -40
- package/src/proto/dxos/echo/query.proto +4 -1
- package/src/proto/dxos/echo/service.proto +38 -6
- package/src/proto/dxos/iframe.proto +1 -0
- package/src/proto/gen/dxos/client/services.ts +895 -765
- package/src/proto/gen/dxos/config.ts +33 -2
- package/src/proto/gen/dxos/echo/query.ts +17 -1
- package/src/proto/gen/dxos/echo/service.ts +42 -8
- package/src/proto/gen/index.ts +11 -1
- package/src/proto/index.ts +1 -1
- package/src/queue.ts +10 -29
- package/dist/src/edge-error.d.ts +0 -26
- package/dist/src/edge-error.d.ts.map +0 -1
- package/dist/src/edge-error.js +0 -62
- package/dist/src/edge-error.js.map +0 -1
- package/dist/src/edge.d.ts +0 -198
- package/dist/src/edge.d.ts.map +0 -1
- package/dist/src/edge.js +0 -43
- package/dist/src/edge.js.map +0 -1
- package/dist/src/query.d.ts +0 -5
- package/dist/src/query.d.ts.map +0 -1
- package/dist/src/query.js +0 -8
- package/dist/src/query.js.map +0 -1
- package/src/edge-error.ts +0 -79
- package/src/edge.ts +0 -222
- package/src/query.ts +0 -8
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type EdgeErrorData, type EdgeFailure, EdgeHttpErrorCodec, ErrorCodec } from './edge.js';
|
|
6
|
+
|
|
7
|
+
// TODO(burdon): Reconcile with @dxos/errors.
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when a call to the Edge service fails.
|
|
10
|
+
* There 3 possible sources of failure:
|
|
11
|
+
* 1. EdgeFailure (JSON body with { success: false }) -> Processing the request failed and was gracefully handled by EDGE service.
|
|
12
|
+
* 2. Http failure (non-ok code) -> The HTTP request failed (e.g. timeout, network error).
|
|
13
|
+
* -> Unhandled exception on EDGE side, EDGE would provide serialized error in the response body.
|
|
14
|
+
* 3. Processing failure -> Unhandled exception on client side while processing the response.
|
|
15
|
+
*/
|
|
16
|
+
export class EdgeCallFailedError extends Error {
|
|
17
|
+
public static fromUnsuccessfulResponse(response: Response, body: EdgeFailure): EdgeCallFailedError {
|
|
18
|
+
const error = new EdgeCallFailedError({
|
|
19
|
+
message: body.message,
|
|
20
|
+
data: body.data,
|
|
21
|
+
isRetryable: body.data == null && response.headers.has('Retry-After'),
|
|
22
|
+
retryAfterMs: getRetryAfterMillis(response),
|
|
23
|
+
cause: body.error ? ErrorCodec.decode(body.error) : undefined,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return error;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public static async fromHttpFailure(response: Response): Promise<EdgeCallFailedError> {
|
|
30
|
+
return new EdgeCallFailedError({
|
|
31
|
+
message: `HTTP code ${response.status}: ${response.statusText}.`,
|
|
32
|
+
isRetryable: isRetryableCode(response.status),
|
|
33
|
+
retryAfterMs: getRetryAfterMillis(response),
|
|
34
|
+
cause: await EdgeHttpErrorCodec.decode(response),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static fromProcessingFailureCause(cause: Error): EdgeCallFailedError {
|
|
39
|
+
return new EdgeCallFailedError({
|
|
40
|
+
message: 'Error processing request.',
|
|
41
|
+
isRetryable: true,
|
|
42
|
+
cause,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
readonly data?: EdgeErrorData;
|
|
47
|
+
readonly isRetryable?: boolean;
|
|
48
|
+
readonly retryAfterMs?: number;
|
|
49
|
+
|
|
50
|
+
constructor(args: {
|
|
51
|
+
message: string;
|
|
52
|
+
isRetryable?: boolean;
|
|
53
|
+
data?: EdgeErrorData;
|
|
54
|
+
retryAfterMs?: number;
|
|
55
|
+
cause?: Error;
|
|
56
|
+
}) {
|
|
57
|
+
super(args.message, { cause: args.cause });
|
|
58
|
+
this.message = args.message;
|
|
59
|
+
this.data = args.data;
|
|
60
|
+
this.retryAfterMs = args.retryAfterMs;
|
|
61
|
+
this.isRetryable = Boolean(args.isRetryable);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class EdgeAuthChallengeError extends EdgeCallFailedError {
|
|
66
|
+
constructor(
|
|
67
|
+
public readonly challenge: string,
|
|
68
|
+
data: EdgeErrorData,
|
|
69
|
+
) {
|
|
70
|
+
super({ message: 'Auth challenge.', data, isRetryable: false });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const getRetryAfterMillis = (response: Response) => {
|
|
75
|
+
const retryAfter = Number(response.headers.get('Retry-After'));
|
|
76
|
+
return Number.isNaN(retryAfter) || retryAfter === 0 ? undefined : retryAfter * 1000;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const isRetryableCode = (status: number) => {
|
|
80
|
+
if (status === 501) {
|
|
81
|
+
// Not Implemented
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return !(status >= 400 && status < 500);
|
|
85
|
+
};
|
|
@@ -6,37 +6,21 @@
|
|
|
6
6
|
* NOTE: Messages should be sentences (Start with a capital letter and end with a period).
|
|
7
7
|
* Errors can optionally include a JSON context object.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
readonly code: string,
|
|
12
|
-
message?: string,
|
|
13
|
-
readonly context?: Record<string, any>,
|
|
14
|
-
) {
|
|
15
|
-
// TODO(dmaretskyi): Error.cause.
|
|
16
|
-
super(message ?? code);
|
|
17
|
-
this.name = code;
|
|
18
|
-
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
|
19
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// TODO(dmaretskyi): Consider common error classes with error codes:
|
|
24
|
-
// throw new SystemError(ERROR_CODE_OUT_OF_MEMORY, 'Out of memory', { a: 1, b: 2 });
|
|
9
|
+
import { BaseError } from '@dxos/errors';
|
|
25
10
|
|
|
26
11
|
/**
|
|
27
12
|
* User facing API Errors.
|
|
28
13
|
* E.g., something was misconfigured.
|
|
29
14
|
*/
|
|
30
|
-
export class ApiError extends BaseError {}
|
|
15
|
+
export class ApiError extends BaseError.extend('ApiError') {}
|
|
31
16
|
|
|
32
17
|
/**
|
|
33
18
|
* Internal system errors.
|
|
34
19
|
* E.g., unexpected/unrecoverable runtime error.
|
|
35
20
|
*/
|
|
36
|
-
export class SystemError extends BaseError {}
|
|
21
|
+
export class SystemError extends BaseError.extend('SystemError') {}
|
|
37
22
|
|
|
38
23
|
/**
|
|
39
24
|
* Database errors.
|
|
40
25
|
*/
|
|
41
|
-
|
|
42
|
-
export class DatabaseError extends BaseError {}
|
|
26
|
+
export class DatabaseError extends BaseError.extend('DatabaseError') {}
|
package/src/errors/encoding.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { reconstructError } from './helpers.js';
|
|
6
5
|
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.js';
|
|
7
6
|
|
|
7
|
+
import { reconstructError } from './helpers.js';
|
|
8
|
+
|
|
8
9
|
export const encodeError = (err: any): SerializedErrorProto => {
|
|
9
10
|
if (typeof err === 'object' && err?.message) {
|
|
10
11
|
return {
|
|
@@ -9,7 +9,7 @@ import { ApiError } from './base-errors.js';
|
|
|
9
9
|
describe('Errors', () => {
|
|
10
10
|
test('test', async () => {
|
|
11
11
|
const runTest = async () => {
|
|
12
|
-
throw new ApiError('Test error');
|
|
12
|
+
throw new ApiError({ message: 'Test error' });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
await expect(runTest()).rejects.toThrowError('Test error');
|
package/src/errors/errors.ts
CHANGED
|
@@ -2,207 +2,142 @@
|
|
|
2
2
|
// Copyright 2021 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
5
6
|
import { PublicKey } from '@dxos/keys';
|
|
6
7
|
|
|
7
|
-
import { ApiError, BaseError, DatabaseError, SystemError } from './base-errors.js';
|
|
8
|
-
import { registerError, registerErrorMessageContext, registerErrorNoArgs } from './helpers.js';
|
|
9
8
|
import type { ObjectId } from '../types.js';
|
|
10
9
|
|
|
10
|
+
import { registerError, registerErrorMessageContext, registerErrorNoArgs } from './helpers.js';
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Thrown when request was terminated because the RPC endpoint has been closed.
|
|
13
14
|
*/
|
|
14
|
-
export class RpcClosedError extends
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
export class RpcClosedError extends BaseError.extend(
|
|
16
|
+
'RpcClosedError',
|
|
17
|
+
'Request was terminated because the RPC endpoint is closed.',
|
|
18
|
+
) {}
|
|
19
19
|
|
|
20
|
-
registerErrorNoArgs('
|
|
20
|
+
registerErrorNoArgs('RpcClosedError', RpcClosedError);
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Thrown when `request` is called when RPC has not been opened.
|
|
24
24
|
*/
|
|
25
|
-
export class RpcNotOpenError extends
|
|
26
|
-
constructor() {
|
|
27
|
-
super('RPC_NOT_OPEN', 'RPC has not been opened.');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
25
|
+
export class RpcNotOpenError extends BaseError.extend('RpcNotOpenError', 'RPC has not been opened.') {}
|
|
30
26
|
|
|
31
|
-
registerErrorNoArgs('
|
|
27
|
+
registerErrorNoArgs('RpcNotOpenError', RpcNotOpenError);
|
|
32
28
|
|
|
33
|
-
export class CancelledError extends
|
|
34
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
35
|
-
super('CANCELLED', message, context);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
29
|
+
export class CancelledError extends BaseError.extend('CancelledError') {}
|
|
38
30
|
|
|
39
|
-
registerErrorMessageContext('
|
|
31
|
+
registerErrorMessageContext('CancelledError', CancelledError);
|
|
40
32
|
|
|
41
|
-
export class InvalidConfigError extends
|
|
42
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
43
|
-
super('INVALID_CONFIG', message, context);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
33
|
+
export class InvalidConfigError extends BaseError.extend('InvalidConfigError') {}
|
|
46
34
|
|
|
47
|
-
registerErrorMessageContext('
|
|
35
|
+
registerErrorMessageContext('InvalidConfigError', InvalidConfigError);
|
|
48
36
|
|
|
49
37
|
/**
|
|
50
38
|
* Explicit failure to connect with remote client services.
|
|
51
39
|
*/
|
|
52
|
-
export class RemoteServiceConnectionError extends
|
|
53
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
54
|
-
super('REMOTE_SERVICE_CONNECTION_ERROR', message, context);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
40
|
+
export class RemoteServiceConnectionError extends BaseError.extend('RemoteServiceConnectionError') {}
|
|
57
41
|
|
|
58
|
-
registerErrorMessageContext('
|
|
42
|
+
registerErrorMessageContext('RemoteServiceConnectionError', RemoteServiceConnectionError);
|
|
59
43
|
|
|
60
44
|
/**
|
|
61
45
|
* Failed to open a connection to remote client services.
|
|
62
46
|
*/
|
|
63
|
-
export class RemoteServiceConnectionTimeout extends
|
|
64
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
65
|
-
super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
47
|
+
export class RemoteServiceConnectionTimeout extends BaseError.extend('RemoteServiceConnectionTimeout') {}
|
|
68
48
|
|
|
69
|
-
registerErrorMessageContext('
|
|
49
|
+
registerErrorMessageContext('RemoteServiceConnectionTimeout', RemoteServiceConnectionTimeout);
|
|
70
50
|
|
|
71
|
-
export class DataCorruptionError extends
|
|
72
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
73
|
-
super('DATA_CORRUPTION', message, context);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
51
|
+
export class DataCorruptionError extends BaseError.extend('DataCorruptionError') {}
|
|
76
52
|
|
|
77
|
-
registerErrorMessageContext('
|
|
53
|
+
registerErrorMessageContext('DataCorruptionError', DataCorruptionError);
|
|
78
54
|
|
|
79
|
-
export class InvalidInvitationExtensionRoleError extends
|
|
80
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
81
|
-
super('INVALID_INVITATION_EXTENSION_ROLE', message, context);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
55
|
+
export class InvalidInvitationExtensionRoleError extends BaseError.extend('InvalidInvitationExtensionRoleError') {}
|
|
84
56
|
|
|
85
|
-
registerErrorMessageContext('
|
|
57
|
+
registerErrorMessageContext('InvalidInvitationExtensionRoleError', InvalidInvitationExtensionRoleError);
|
|
86
58
|
|
|
87
|
-
export class IdentityNotInitializedError extends
|
|
88
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
89
|
-
super('IDENTITY_NOT_INITIALIZED', message, context);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
59
|
+
export class IdentityNotInitializedError extends BaseError.extend('IdentityNotInitializedError') {}
|
|
92
60
|
|
|
93
|
-
registerErrorMessageContext('
|
|
61
|
+
registerErrorMessageContext('IdentityNotInitializedError', IdentityNotInitializedError);
|
|
94
62
|
|
|
95
|
-
export class InvalidInvitationError extends
|
|
96
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
97
|
-
super('INVALID_INVITATION', message, context);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
63
|
+
export class InvalidInvitationError extends BaseError.extend('InvalidInvitationError') {}
|
|
100
64
|
|
|
101
|
-
registerErrorMessageContext('
|
|
65
|
+
registerErrorMessageContext('InvalidInvitationError', InvalidInvitationError);
|
|
102
66
|
|
|
103
|
-
export class AlreadyJoinedError extends
|
|
104
|
-
constructor(message?: string, context?: Record<string, any>) {
|
|
105
|
-
super('ALREADY_JOINED', message, context);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
67
|
+
export class AlreadyJoinedError extends BaseError.extend('AlreadyJoinedError') {}
|
|
108
68
|
|
|
109
|
-
registerErrorMessageContext('
|
|
69
|
+
registerErrorMessageContext('AlreadyJoinedError', AlreadyJoinedError);
|
|
110
70
|
|
|
111
|
-
export class ConnectionResetError extends BaseError {
|
|
112
|
-
constructor(message?: string, context?: any) {
|
|
113
|
-
super('CONNECTION_RESET', message, context);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
71
|
+
export class ConnectionResetError extends BaseError.extend('ConnectionResetError') {}
|
|
116
72
|
|
|
117
|
-
registerErrorMessageContext('
|
|
73
|
+
registerErrorMessageContext('ConnectionResetError', ConnectionResetError);
|
|
118
74
|
|
|
119
|
-
export class TimeoutError extends BaseError {
|
|
120
|
-
constructor(message?: string, context?: any) {
|
|
121
|
-
super('TIMEOUT', message, context);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
75
|
+
export class TimeoutError extends BaseError.extend('TimeoutError') {}
|
|
124
76
|
|
|
125
|
-
registerErrorMessageContext('
|
|
77
|
+
registerErrorMessageContext('TimeoutError', TimeoutError);
|
|
126
78
|
|
|
127
79
|
// General protocol error.
|
|
128
|
-
export class ProtocolError extends BaseError {
|
|
129
|
-
constructor(message?: string, context?: any) {
|
|
130
|
-
super('PROTOCOL_ERROR', message, context);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
80
|
+
export class ProtocolError extends BaseError.extend('ProtocolError') {}
|
|
133
81
|
|
|
134
|
-
registerErrorMessageContext(
|
|
82
|
+
registerErrorMessageContext(ProtocolError.name, ProtocolError);
|
|
135
83
|
|
|
136
84
|
// General connectivity errors.
|
|
137
|
-
export class ConnectivityError extends BaseError {
|
|
138
|
-
constructor(message?: string, context?: any) {
|
|
139
|
-
super('CONNECTIVITY_ERROR', message, context);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
85
|
+
export class ConnectivityError extends BaseError.extend('ConnectivityError') {}
|
|
142
86
|
|
|
143
|
-
registerErrorMessageContext('
|
|
87
|
+
registerErrorMessageContext('ConnectivityError', ConnectivityError);
|
|
144
88
|
|
|
145
|
-
export class RateLimitExceededError extends BaseError {
|
|
146
|
-
constructor(message?: string, context?: any) {
|
|
147
|
-
super('RATE_LIMIT_EXCEEDED', message, context);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
89
|
+
export class RateLimitExceededError extends BaseError.extend('RateLimitExceededError') {}
|
|
150
90
|
|
|
151
|
-
registerErrorMessageContext('
|
|
91
|
+
registerErrorMessageContext('RateLimitExceededError', RateLimitExceededError);
|
|
152
92
|
|
|
153
93
|
// TODO(nf): Rename? the protocol isn't what's unknown...
|
|
154
|
-
export class UnknownProtocolError extends BaseError {
|
|
155
|
-
constructor(message?: string, innerError?: Error) {
|
|
156
|
-
super('UNKNOWN_PROTOCOL_ERROR', message, innerError);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
94
|
+
export class UnknownProtocolError extends BaseError.extend('UnknownProtocolError') {}
|
|
159
95
|
|
|
160
|
-
|
|
96
|
+
registerError(UnknownProtocolError.name, (message, context) => new UnknownProtocolError({ message, context }));
|
|
161
97
|
|
|
162
|
-
export class InvalidStorageVersionError extends
|
|
98
|
+
export class InvalidStorageVersionError extends BaseError.extend(
|
|
99
|
+
'InvalidStorageVersionError',
|
|
100
|
+
'Invalid storage version.',
|
|
101
|
+
) {
|
|
163
102
|
constructor(expected: number, actual: number) {
|
|
164
|
-
super(
|
|
103
|
+
super({ context: { expected, actual } });
|
|
165
104
|
}
|
|
166
105
|
}
|
|
167
106
|
|
|
168
|
-
registerError('
|
|
107
|
+
registerError('InvalidStorageVersionError', (_, context) => {
|
|
169
108
|
return new InvalidStorageVersionError(context.expected ?? NaN, context.actual ?? NaN);
|
|
170
109
|
});
|
|
171
110
|
|
|
172
|
-
export class SpaceNotFoundError extends
|
|
111
|
+
export class SpaceNotFoundError extends BaseError.extend('SpaceNotFoundError', 'Space not found.') {
|
|
173
112
|
constructor(spaceKey: PublicKey) {
|
|
174
|
-
super(
|
|
113
|
+
super({ context: { spaceKey } });
|
|
175
114
|
}
|
|
176
115
|
}
|
|
177
116
|
|
|
178
|
-
registerError('
|
|
117
|
+
registerError('SpaceNotFoundError', (_, context) => {
|
|
179
118
|
return new SpaceNotFoundError(PublicKey.safeFrom(context.spaceKey) ?? PublicKey.from('00'));
|
|
180
119
|
});
|
|
181
120
|
|
|
182
|
-
export class EntityNotFoundError extends
|
|
121
|
+
export class EntityNotFoundError extends BaseError.extend('EntityNotFoundError', 'Item not found.') {
|
|
183
122
|
constructor(entityId: ObjectId) {
|
|
184
|
-
super(
|
|
123
|
+
super({ context: { entityId } });
|
|
185
124
|
}
|
|
186
125
|
}
|
|
187
126
|
|
|
188
|
-
registerError('
|
|
127
|
+
registerError('EntityNotFoundError', (_, context) => {
|
|
189
128
|
return new EntityNotFoundError(context.entityId);
|
|
190
129
|
});
|
|
191
130
|
|
|
192
|
-
export class UnknownModelError extends
|
|
131
|
+
export class UnknownModelError extends BaseError.extend('UnknownModelError', 'Unknown model.') {
|
|
193
132
|
constructor(model: string) {
|
|
194
|
-
super(
|
|
133
|
+
super({ context: { model } });
|
|
195
134
|
}
|
|
196
135
|
}
|
|
197
136
|
|
|
198
|
-
registerError('
|
|
137
|
+
registerError('UnknownModelError', (_, context) => {
|
|
199
138
|
return new UnknownModelError(context.model);
|
|
200
139
|
});
|
|
201
140
|
|
|
202
|
-
export class AuthorizationError extends
|
|
203
|
-
constructor(message?: string, context?: any) {
|
|
204
|
-
super('AUTHORIZATION_ERROR', message, context);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
141
|
+
export class AuthorizationError extends BaseError.extend('AuthorizationError') {}
|
|
207
142
|
|
|
208
|
-
registerErrorMessageContext('
|
|
143
|
+
registerErrorMessageContext('AuthorizationError', AuthorizationError);
|
package/src/errors/helpers.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { BaseError } from '@dxos/errors';
|
|
5
6
|
import { invariant } from '@dxos/invariant';
|
|
6
7
|
|
|
7
|
-
import { SystemError } from './base-errors.js';
|
|
8
8
|
import { type Error as SerializedErrorProto } from '../proto/gen/dxos/error.js';
|
|
9
9
|
|
|
10
10
|
export const reconstructError = (error: SerializedErrorProto) => {
|
|
@@ -19,21 +19,21 @@ export const registerError = (code: string, make: (message?: string, context?: a
|
|
|
19
19
|
errorRegistry.set(code, make);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const registerErrorNoArgs = (code: string, Constructor: { new (): Error }) => {
|
|
22
|
+
export const registerErrorNoArgs = (code: string, Constructor: { new (options?: any): Error }) => {
|
|
23
23
|
registerError(code, () => new Constructor());
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const registerErrorMessageContext = (
|
|
27
27
|
code: string,
|
|
28
|
-
Constructor: { new (message?: string
|
|
28
|
+
Constructor: { new (options?: { message?: string; context?: any }): Error },
|
|
29
29
|
) => {
|
|
30
|
-
registerError(code, (message?: string, context?:
|
|
30
|
+
registerError(code, (message?: string, context?: any) => new Constructor({ message, context }));
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const errorFromCode = (code?: string, message?: string, context?: any) => {
|
|
34
34
|
if (code && errorRegistry.has(code)) {
|
|
35
35
|
return errorRegistry.get(code)!(message, context);
|
|
36
36
|
} else {
|
|
37
|
-
return new
|
|
37
|
+
return new BaseError(code ?? 'Error', { message, context });
|
|
38
38
|
}
|
|
39
39
|
};
|
package/src/feed-replication.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright 2021 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// TODO(burdon): Why export .js?
|
|
6
|
+
|
|
7
|
+
export * from './automerge.js';
|
|
8
|
+
export * from './edge/index.js';
|
|
5
9
|
export * from './errors/index.js';
|
|
6
10
|
export * from './indexing.js';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './tracing.js';
|
|
9
|
-
export * from './types.js';
|
|
10
|
-
export * from './query.js';
|
|
11
|
+
export * from './messenger.js';
|
|
11
12
|
export * from './profile-archive.js';
|
|
12
|
-
export * from './automerge.js';
|
|
13
|
-
export * from './edge.js';
|
|
14
13
|
export * from './queue.js';
|
|
15
14
|
export * from './space-archive.js';
|
|
16
|
-
export * from './
|
|
15
|
+
export * from './storage.js';
|
|
16
|
+
export * from './tracing.js';
|
|
17
|
+
export type * from './types.js';
|
|
18
|
+
export * as FunctionProtocol from './FunctionProtocol.js';
|
package/src/indexing.ts
CHANGED
package/src/invitation.ts
CHANGED
package/src/messenger.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type CleanupFn } from '@dxos/async';
|
|
6
|
+
|
|
7
|
+
import { type GossipMessage } from './proto/gen/dxos/mesh/teleport/gossip';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Message passing abstraction.
|
|
11
|
+
*/
|
|
12
|
+
export interface Messenger {
|
|
13
|
+
/**
|
|
14
|
+
* Register channel listener.
|
|
15
|
+
*/
|
|
16
|
+
listen: (channel: string, callback: (message: GossipMessage) => void) => CleanupFn;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Send message to channel.
|
|
20
|
+
*/
|
|
21
|
+
postMessage: (channel: string, message: any) => Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package dxos.client.services;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/struct.proto";
|
|
6
|
+
import "google/protobuf/empty.proto";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
message QueueQuery {
|
|
10
|
+
string space_id = 1;
|
|
11
|
+
|
|
12
|
+
optional string queues_namespace = 2;
|
|
13
|
+
|
|
14
|
+
/// Queries the whole space if missing.
|
|
15
|
+
repeated string queue_ids = 3;
|
|
16
|
+
|
|
17
|
+
/// Filter items after this cursor. Exclusive.
|
|
18
|
+
optional string after = 4;
|
|
19
|
+
|
|
20
|
+
/// Filter items before this cursor. Exclusive.
|
|
21
|
+
optional string before = 5;
|
|
22
|
+
|
|
23
|
+
/// Filter items after this position. Inclusive.
|
|
24
|
+
optional int64 begin_position = 6;
|
|
25
|
+
|
|
26
|
+
/// Filter items before this position. Exclusive.
|
|
27
|
+
optional int64 end_position = 7;
|
|
28
|
+
|
|
29
|
+
optional int32 limit = 8;
|
|
30
|
+
optional bool reverse = 9;
|
|
31
|
+
|
|
32
|
+
// TODO(dmaretskyi): Remove this field -- raw queues dont index object IDs anymore.
|
|
33
|
+
repeated string object_ids = 100;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message QueueQueryResult {
|
|
37
|
+
repeated google.protobuf.Struct objects = 1;
|
|
38
|
+
|
|
39
|
+
/// Cursor to query the next items. Can be passed to `after` in query to keep querying.
|
|
40
|
+
string next_cursor = 2;
|
|
41
|
+
|
|
42
|
+
string prev_cursor = 3;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message QueryQueueRequest {
|
|
46
|
+
QueueQuery query = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message InsertIntoQueueRequest {
|
|
50
|
+
string subspace_tag = 1;
|
|
51
|
+
string space_id = 2;
|
|
52
|
+
string queue_id = 3;
|
|
53
|
+
repeated google.protobuf.Struct objects = 4;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message DeleteFromQueueRequest {
|
|
57
|
+
string subspace_tag = 1;
|
|
58
|
+
string space_id = 2;
|
|
59
|
+
string queue_id = 3;
|
|
60
|
+
repeated string object_ids = 4;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
service QueueService {
|
|
64
|
+
rpc QueryQueue(QueryQueueRequest) returns (QueueQueryResult);
|
|
65
|
+
rpc InsertIntoQueue(InsertIntoQueueRequest) returns (google.protobuf.Empty);
|
|
66
|
+
rpc DeleteFromQueue(DeleteFromQueueRequest) returns (google.protobuf.Empty);
|
|
67
|
+
}
|
|
@@ -596,9 +596,26 @@ service EdgeAgentService {
|
|
|
596
596
|
rpc QueryAgentStatus(google.protobuf.Empty) returns (stream QueryAgentStatusResponse);
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
message EdgeStatus {
|
|
600
|
+
enum ConnectionState {
|
|
601
|
+
NOT_CONNECTED = 0;
|
|
602
|
+
CONNECTED = 1;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
ConnectionState state = 1;
|
|
606
|
+
/** Latency in ms */
|
|
607
|
+
int32 rtt = 2;
|
|
608
|
+
|
|
609
|
+
/** How long the connection has been up */
|
|
610
|
+
int32 uptime = 3;
|
|
611
|
+
|
|
612
|
+
/** Upload rate in bytes per second */
|
|
613
|
+
int32 rate_bytes_up = 4;
|
|
614
|
+
/** Download rate in bytes per second */
|
|
615
|
+
int32 rate_bytes_down = 5;
|
|
616
|
+
|
|
617
|
+
int32 messages_sent = 6;
|
|
618
|
+
int32 messages_received = 7;
|
|
602
619
|
}
|
|
603
620
|
|
|
604
621
|
message QueryEdgeStatusResponse {
|