@dxos/client 2.33.9-dev.002e8917 → 2.33.9-dev.227ba79d
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/browser.js +1282 -2084
- package/dist/src/client.d.ts +6 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +24 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/{api/client.test.d.ts → client.test.d.ts} +0 -0
- package/dist/src/{api/client.test.d.ts.map → client.test.d.ts.map} +1 -1
- package/dist/src/{api/client.test.js → client.test.js} +4 -3
- package/dist/src/client.test.js.map +1 -0
- package/dist/src/index.d.ts +5 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/{api/local.test.d.ts → local.test.d.ts} +0 -0
- package/dist/src/{api/local.test.d.ts.map → local.test.d.ts.map} +1 -1
- package/dist/src/{api/local.test.js → local.test.js} +0 -0
- package/dist/src/local.test.js.map +1 -0
- package/dist/src/{services → packlets/api}/client-service.d.ts +1 -2
- package/dist/src/packlets/api/client-service.d.ts.map +1 -0
- package/dist/src/{services → packlets/api}/client-service.js +7 -7
- package/dist/src/packlets/api/client-service.js.map +1 -0
- package/dist/src/packlets/api/echo.d.ts +62 -0
- package/dist/src/packlets/api/echo.d.ts.map +1 -0
- package/dist/src/packlets/api/echo.js +17 -0
- package/dist/src/packlets/api/echo.js.map +1 -0
- package/dist/src/{api → packlets/api}/errors.d.ts +0 -0
- package/dist/src/packlets/api/errors.d.ts.map +1 -0
- package/dist/src/{api → packlets/api}/errors.js +0 -0
- package/dist/src/packlets/api/errors.js.map +1 -0
- package/dist/src/packlets/api/halo.d.ts +37 -0
- package/dist/src/packlets/api/halo.d.ts.map +1 -0
- package/dist/src/packlets/api/halo.js +6 -0
- package/dist/src/packlets/api/halo.js.map +1 -0
- package/dist/src/packlets/api/index.d.ts +6 -0
- package/dist/src/packlets/api/index.d.ts.map +1 -0
- package/dist/src/{api → packlets/api}/index.js +3 -3
- package/dist/src/packlets/api/index.js.map +1 -0
- package/dist/src/packlets/api/invitations/index.d.ts +3 -0
- package/dist/src/packlets/api/invitations/index.d.ts.map +1 -0
- package/dist/src/{api → packlets/api}/invitations/index.js +2 -3
- package/dist/src/packlets/api/invitations/index.js.map +1 -0
- package/dist/src/{api → packlets/api}/invitations/invitation-request.d.ts +0 -0
- package/dist/src/packlets/api/invitations/invitation-request.d.ts.map +1 -0
- package/dist/src/{api → packlets/api}/invitations/invitation-request.js +0 -0
- package/dist/src/packlets/api/invitations/invitation-request.js.map +1 -0
- package/dist/src/{api → packlets/api}/invitations/invitation.d.ts +0 -0
- package/dist/src/packlets/api/invitations/invitation.d.ts.map +1 -0
- package/dist/src/{api → packlets/api}/invitations/invitation.js +1 -0
- package/dist/src/packlets/api/invitations/invitation.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/config.d.ts +1 -1
- package/dist/src/packlets/devtools/config.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/config.js +0 -0
- package/dist/src/packlets/devtools/config.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/debug-logging.d.ts +1 -1
- package/dist/src/packlets/devtools/debug-logging.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/debug-logging.js +0 -0
- package/dist/src/packlets/devtools/debug-logging.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-context.d.ts +0 -8
- package/dist/src/packlets/devtools/devtools-context.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-context.js +0 -0
- package/dist/src/packlets/devtools/devtools-context.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-host-events.d.ts +0 -0
- package/dist/src/packlets/devtools/devtools-host-events.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-host-events.js +0 -0
- package/dist/src/packlets/devtools/devtools-host-events.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-host.d.ts +1 -1
- package/dist/src/packlets/devtools/devtools-host.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/devtools-host.js +0 -0
- package/dist/src/packlets/devtools/devtools-host.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/feeds.d.ts +1 -1
- package/dist/src/packlets/devtools/feeds.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/feeds.js +0 -0
- package/dist/src/packlets/devtools/feeds.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/index.d.ts +0 -1
- package/dist/src/packlets/devtools/index.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/index.js +0 -1
- package/dist/src/packlets/devtools/index.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/items.d.ts +1 -1
- package/dist/src/packlets/devtools/items.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/items.js +0 -0
- package/dist/src/packlets/devtools/items.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/keys.d.ts +1 -1
- package/dist/src/packlets/devtools/keys.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/keys.js +0 -0
- package/dist/src/packlets/devtools/keys.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/network.d.ts +1 -1
- package/dist/src/packlets/devtools/network.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/network.js +0 -0
- package/dist/src/packlets/devtools/network.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/parties.d.ts +1 -1
- package/dist/src/packlets/devtools/parties.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/parties.js +0 -0
- package/dist/src/packlets/devtools/parties.js.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/storage.d.ts +0 -0
- package/dist/src/packlets/devtools/storage.d.ts.map +1 -0
- package/dist/src/{devtools → packlets/devtools}/storage.js +0 -0
- package/dist/src/packlets/devtools/storage.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/client.d.ts +216 -18
- package/dist/src/packlets/proto/gen/dxos/client.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/client.js +4 -0
- package/dist/src/packlets/proto/gen/dxos/client.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/config.d.ts +666 -0
- package/dist/src/packlets/proto/gen/dxos/config.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/config.js +10 -0
- package/dist/src/packlets/proto/gen/dxos/config.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/credentials.d.ts +64 -0
- package/dist/src/packlets/proto/gen/dxos/credentials.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/credentials.js +0 -0
- package/dist/src/packlets/proto/gen/dxos/credentials.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/devtools.d.ts +437 -0
- package/dist/src/packlets/proto/gen/dxos/devtools.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/devtools.js +0 -0
- package/dist/src/packlets/proto/gen/dxos/devtools.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/echo/feed.d.ts +114 -0
- package/dist/src/packlets/proto/gen/dxos/echo/feed.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/feed.js +4 -0
- package/dist/src/packlets/proto/gen/dxos/echo/feed.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/echo/invitation.d.ts +36 -0
- package/dist/src/packlets/proto/gen/dxos/echo/invitation.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/invitation.js +6 -0
- package/dist/src/packlets/proto/gen/dxos/echo/invitation.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/echo/service.d.ts +83 -0
- package/dist/src/packlets/proto/gen/dxos/echo/service.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/service.js +0 -0
- package/dist/src/packlets/proto/gen/dxos/echo/service.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/snapshot.d.ts +45 -13
- package/dist/src/packlets/proto/gen/dxos/echo/snapshot.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/snapshot.js +0 -0
- package/dist/src/packlets/proto/gen/dxos/echo/snapshot.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/echo/timeframe.d.ts +20 -0
- package/dist/src/packlets/proto/gen/dxos/echo/timeframe.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/timeframe.js +0 -0
- package/dist/src/packlets/proto/gen/dxos/echo/timeframe.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/halo/keys.d.ts +44 -2
- package/dist/src/packlets/proto/gen/dxos/halo/keys.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/halo/keys.js +4 -0
- package/dist/src/packlets/proto/gen/dxos/halo/keys.js.map +1 -0
- package/dist/src/packlets/proto/gen/dxos/rpc.d.ts +95 -0
- package/dist/src/packlets/proto/gen/dxos/rpc.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/rpc.js +4 -0
- package/dist/src/packlets/proto/gen/dxos/rpc.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/google/protobuf.d.ts +82 -82
- package/dist/src/packlets/proto/gen/google/protobuf.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/google/protobuf.js +0 -0
- package/dist/src/packlets/proto/gen/google/protobuf.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/index.d.ts +0 -0
- package/dist/src/packlets/proto/gen/index.d.ts.map +1 -0
- package/dist/src/packlets/proto/gen/index.js +11 -0
- package/dist/src/packlets/proto/gen/index.js.map +1 -0
- package/dist/src/packlets/proto/index.d.ts +14 -0
- package/dist/src/packlets/proto/index.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/index.js +13 -1
- package/dist/src/packlets/proto/index.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/substitutions.d.ts +0 -0
- package/dist/src/packlets/proto/substitutions.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/substitutions.js +0 -0
- package/dist/src/packlets/proto/substitutions.js.map +1 -0
- package/dist/src/{api/client.d.ts → packlets/proxy/client-proxy.d.ts} +7 -15
- package/dist/src/packlets/proxy/client-proxy.d.ts.map +1 -0
- package/dist/src/{api/client.js → packlets/proxy/client-proxy.js} +31 -75
- package/dist/src/packlets/proxy/client-proxy.js.map +1 -0
- package/dist/src/packlets/proxy/devtools.d.ts +11 -0
- package/dist/src/packlets/proxy/devtools.d.ts.map +1 -0
- package/dist/src/{devtools/devtools-rpc-server.js → packlets/proxy/devtools.js} +3 -3
- package/dist/src/packlets/proxy/devtools.js.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/echo-proxy.d.ts +3 -25
- package/dist/src/packlets/proxy/echo-proxy.d.ts.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/echo-proxy.js +15 -21
- package/dist/src/packlets/proxy/echo-proxy.js.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/halo-proxy.d.ts +6 -32
- package/dist/src/packlets/proxy/halo-proxy.d.ts.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/halo-proxy.js +7 -6
- package/dist/src/packlets/proxy/halo-proxy.js.map +1 -0
- package/dist/src/packlets/proxy/index.d.ts +11 -0
- package/dist/src/packlets/proxy/index.d.ts.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/index.js +8 -1
- package/dist/src/packlets/proxy/index.js.map +1 -0
- package/dist/src/{api/invitations → packlets/proxy}/invitation-proxy.d.ts +2 -2
- package/dist/src/packlets/proxy/invitation-proxy.d.ts.map +1 -0
- package/dist/src/{api/invitations → packlets/proxy}/invitation-proxy.js +8 -8
- package/dist/src/packlets/proxy/invitation-proxy.js.map +1 -0
- package/dist/src/{util → packlets/proxy}/messages.d.ts +0 -0
- package/dist/src/packlets/proxy/messages.d.ts.map +1 -0
- package/dist/src/{util → packlets/proxy}/messages.js +2 -2
- package/dist/src/packlets/proxy/messages.js.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/party-proxy.d.ts +6 -40
- package/dist/src/packlets/proxy/party-proxy.d.ts.map +1 -0
- package/dist/src/{api/proxies → packlets/proxy}/party-proxy.js +9 -9
- package/dist/src/{api/proxies → packlets/proxy}/party-proxy.js.map +1 -1
- package/dist/src/{api → packlets/proxy}/serializer.d.ts +2 -1
- package/dist/src/packlets/proxy/serializer.d.ts.map +1 -0
- package/dist/src/{api → packlets/proxy}/serializer.js +2 -2
- package/dist/src/packlets/proxy/serializer.js.map +1 -0
- package/dist/src/{services → packlets/proxy}/service-proxy.d.ts +1 -1
- package/dist/src/packlets/proxy/service-proxy.d.ts.map +1 -0
- package/dist/src/{services → packlets/proxy}/service-proxy.js +1 -2
- package/dist/src/packlets/proxy/service-proxy.js.map +1 -0
- package/dist/src/{version.d.ts → packlets/proxy/version.d.ts} +0 -0
- package/dist/src/packlets/proxy/version.d.ts.map +1 -0
- package/dist/src/{version.js → packlets/proxy/version.js} +0 -0
- package/dist/src/packlets/proxy/version.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/halo.d.ts +3 -2
- package/dist/src/packlets/services/impl/halo.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/halo.js +2 -2
- package/dist/src/packlets/services/impl/halo.js.map +1 -0
- package/dist/src/packlets/services/impl/index.d.ts +2 -0
- package/dist/src/packlets/services/impl/index.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/index.js +0 -0
- package/dist/src/packlets/services/impl/index.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/party.d.ts +1 -3
- package/dist/src/packlets/services/impl/party.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/party.js +10 -11
- package/dist/src/packlets/services/impl/party.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/profile.d.ts +1 -2
- package/dist/src/packlets/services/impl/profile.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/profile.js +7 -7
- package/dist/src/packlets/services/impl/profile.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/services.d.ts +1 -1
- package/dist/src/packlets/services/impl/services.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/services.js +0 -0
- package/dist/src/packlets/services/impl/services.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/system.d.ts +1 -1
- package/dist/src/packlets/services/impl/system.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/system.js +0 -0
- package/dist/src/packlets/services/impl/system.js.map +1 -0
- package/dist/src/{services → packlets/services}/impl/types.d.ts +1 -8
- package/dist/src/packlets/services/impl/types.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/impl/types.js +0 -0
- package/dist/src/packlets/services/impl/types.js.map +1 -0
- package/dist/src/packlets/services/index.d.ts +2 -0
- package/dist/src/packlets/services/index.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/index.js +0 -2
- package/dist/src/packlets/services/index.js.map +1 -0
- package/dist/src/{services → packlets/services}/service-host.d.ts +3 -4
- package/dist/src/packlets/services/service-host.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/service-host.js +3 -3
- package/dist/src/packlets/services/service-host.js.map +1 -0
- package/dist/src/{services → packlets/services}/storage.d.ts +0 -0
- package/dist/src/packlets/services/storage.d.ts.map +1 -0
- package/dist/src/{services → packlets/services}/storage.js +1 -1
- package/dist/src/packlets/services/storage.js.map +1 -0
- package/dist/src/{services/services.test.d.ts → services.test.d.ts} +0 -0
- package/dist/src/services.test.d.ts.map +1 -0
- package/dist/src/{services/services.test.js → services.test.js} +5 -3
- package/dist/src/services.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -18
- package/src/{api/client.test.ts → client.test.ts} +4 -3
- package/src/client.ts +21 -0
- package/src/index.ts +13 -6
- package/src/{api/local.test.ts → local.test.ts} +0 -0
- package/src/{services → packlets/api}/client-service.ts +1 -3
- package/src/packlets/api/echo.ts +88 -0
- package/src/{api → packlets/api}/errors.ts +0 -0
- package/src/packlets/api/halo.ts +48 -0
- package/src/packlets/api/index.ts +9 -0
- package/src/{api → packlets/api}/invitations/index.ts +2 -3
- package/src/{api → packlets/api}/invitations/invitation-request.ts +0 -0
- package/src/{api → packlets/api}/invitations/invitation.ts +1 -0
- package/src/{devtools → packlets/devtools}/config.ts +1 -1
- package/src/{devtools → packlets/devtools}/debug-logging.ts +1 -1
- package/src/{devtools → packlets/devtools}/devtools-context.ts +0 -10
- package/src/{devtools → packlets/devtools}/devtools-host-events.ts +0 -0
- package/src/{devtools → packlets/devtools}/devtools-host.ts +1 -1
- package/src/{devtools → packlets/devtools}/feeds.ts +1 -1
- package/src/{devtools → packlets/devtools}/index.ts +0 -1
- package/src/{devtools → packlets/devtools}/items.ts +1 -1
- package/src/{devtools → packlets/devtools}/keys.ts +1 -1
- package/src/{devtools → packlets/devtools}/network.ts +1 -1
- package/src/{devtools → packlets/devtools}/parties.ts +1 -1
- package/src/{devtools → packlets/devtools}/storage.ts +0 -0
- package/src/{proto → packlets/proto}/gen/dxos/client.ts +216 -18
- package/src/packlets/proto/gen/dxos/config.ts +677 -0
- package/src/{proto → packlets/proto}/gen/dxos/credentials.ts +39 -0
- package/src/packlets/proto/gen/dxos/devtools.ts +442 -0
- package/src/{proto → packlets/proto}/gen/dxos/echo/feed.ts +65 -6
- package/src/{proto → packlets/proto}/gen/dxos/echo/invitation.ts +19 -3
- package/src/packlets/proto/gen/dxos/echo/service.ts +91 -0
- package/src/{proto → packlets/proto}/gen/dxos/echo/snapshot.ts +45 -13
- package/src/{proto → packlets/proto}/gen/dxos/echo/timeframe.ts +9 -2
- package/src/{proto → packlets/proto}/gen/dxos/halo/keys.ts +44 -2
- package/src/packlets/proto/gen/dxos/rpc.ts +106 -0
- package/src/{proto → packlets/proto}/gen/google/protobuf.ts +82 -82
- package/src/packlets/proto/gen/index.ts +203 -0
- package/src/{proto → packlets/proto}/imports.proto +0 -0
- package/src/packlets/proto/index.ts +17 -0
- package/src/{proto → packlets/proto}/substitutions.ts +0 -0
- package/src/{api/client.ts → packlets/proxy/client-proxy.ts} +39 -79
- package/src/{devtools/devtools-rpc-server.ts → packlets/proxy/devtools.ts} +10 -3
- package/src/{api/proxies → packlets/proxy}/echo-proxy.ts +13 -33
- package/src/{api/proxies → packlets/proxy}/halo-proxy.ts +5 -37
- package/src/packlets/proxy/index.ts +14 -0
- package/src/{api/invitations → packlets/proxy}/invitation-proxy.ts +2 -2
- package/src/{util → packlets/proxy}/messages.ts +1 -2
- package/src/{api/proxies → packlets/proxy}/party-proxy.ts +9 -56
- package/src/{api → packlets/proxy}/serializer.ts +3 -2
- package/src/{services → packlets/proxy}/service-proxy.ts +1 -2
- package/src/{version.ts → packlets/proxy/version.ts} +0 -0
- package/src/{services → packlets/services}/impl/halo.ts +4 -4
- package/src/{services → packlets/services}/impl/index.ts +0 -1
- package/src/{services → packlets/services}/impl/party.ts +15 -16
- package/src/{services → packlets/services}/impl/profile.ts +2 -2
- package/src/{services → packlets/services}/impl/services.ts +1 -1
- package/src/{services → packlets/services}/impl/system.ts +1 -1
- package/src/{services → packlets/services}/impl/types.ts +1 -9
- package/src/packlets/services/index.ts +5 -0
- package/src/{services → packlets/services}/service-host.ts +4 -5
- package/src/{services → packlets/services}/storage.ts +1 -1
- package/src/{services/services.test.ts → services.test.ts} +4 -3
- package/dist/src/api/client.d.ts.map +0 -1
- package/dist/src/api/client.js.map +0 -1
- package/dist/src/api/client.test.js.map +0 -1
- package/dist/src/api/errors.d.ts.map +0 -1
- package/dist/src/api/errors.js.map +0 -1
- package/dist/src/api/index.d.ts +0 -8
- package/dist/src/api/index.d.ts.map +0 -1
- package/dist/src/api/index.js.map +0 -1
- package/dist/src/api/invitations/index.d.ts +0 -4
- package/dist/src/api/invitations/index.d.ts.map +0 -1
- package/dist/src/api/invitations/index.js.map +0 -1
- package/dist/src/api/invitations/invitation-proxy.d.ts.map +0 -1
- package/dist/src/api/invitations/invitation-proxy.js.map +0 -1
- package/dist/src/api/invitations/invitation-request.d.ts.map +0 -1
- package/dist/src/api/invitations/invitation-request.js.map +0 -1
- package/dist/src/api/invitations/invitation.d.ts.map +0 -1
- package/dist/src/api/invitations/invitation.js.map +0 -1
- package/dist/src/api/local.test.js.map +0 -1
- package/dist/src/api/proxies/echo-proxy.d.ts.map +0 -1
- package/dist/src/api/proxies/echo-proxy.js.map +0 -1
- package/dist/src/api/proxies/halo-proxy.d.ts.map +0 -1
- package/dist/src/api/proxies/halo-proxy.js.map +0 -1
- package/dist/src/api/proxies/index.d.ts +0 -4
- package/dist/src/api/proxies/index.d.ts.map +0 -1
- package/dist/src/api/proxies/index.js.map +0 -1
- package/dist/src/api/proxies/party-proxy.d.ts.map +0 -1
- package/dist/src/api/serializer.d.ts.map +0 -1
- package/dist/src/api/serializer.js.map +0 -1
- package/dist/src/devtools/config.d.ts.map +0 -1
- package/dist/src/devtools/config.js.map +0 -1
- package/dist/src/devtools/debug-logging.d.ts.map +0 -1
- package/dist/src/devtools/debug-logging.js.map +0 -1
- package/dist/src/devtools/devtools-context.d.ts.map +0 -1
- package/dist/src/devtools/devtools-context.js.map +0 -1
- package/dist/src/devtools/devtools-host-events.d.ts.map +0 -1
- package/dist/src/devtools/devtools-host-events.js.map +0 -1
- package/dist/src/devtools/devtools-host.d.ts.map +0 -1
- package/dist/src/devtools/devtools-host.js.map +0 -1
- package/dist/src/devtools/devtools-rpc-server.d.ts +0 -4
- package/dist/src/devtools/devtools-rpc-server.d.ts.map +0 -1
- package/dist/src/devtools/devtools-rpc-server.js.map +0 -1
- package/dist/src/devtools/feeds.d.ts.map +0 -1
- package/dist/src/devtools/feeds.js.map +0 -1
- package/dist/src/devtools/index.d.ts.map +0 -1
- package/dist/src/devtools/index.js.map +0 -1
- package/dist/src/devtools/items.d.ts.map +0 -1
- package/dist/src/devtools/items.js.map +0 -1
- package/dist/src/devtools/keys.d.ts.map +0 -1
- package/dist/src/devtools/keys.js.map +0 -1
- package/dist/src/devtools/network.d.ts.map +0 -1
- package/dist/src/devtools/network.js.map +0 -1
- package/dist/src/devtools/parties.d.ts.map +0 -1
- package/dist/src/devtools/parties.js.map +0 -1
- package/dist/src/devtools/storage.d.ts.map +0 -1
- package/dist/src/devtools/storage.js.map +0 -1
- package/dist/src/proto/gen/dxos/client.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/client.js.map +0 -1
- package/dist/src/proto/gen/dxos/config.d.ts +0 -209
- package/dist/src/proto/gen/dxos/config.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/config.js.map +0 -1
- package/dist/src/proto/gen/dxos/credentials.d.ts +0 -25
- package/dist/src/proto/gen/dxos/credentials.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/credentials.js.map +0 -1
- package/dist/src/proto/gen/dxos/devtools.d.ts +0 -201
- package/dist/src/proto/gen/dxos/devtools.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/devtools.js.map +0 -1
- package/dist/src/proto/gen/dxos/echo/feed.d.ts +0 -55
- package/dist/src/proto/gen/dxos/echo/feed.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/echo/feed.js.map +0 -1
- package/dist/src/proto/gen/dxos/echo/invitation.d.ts +0 -20
- package/dist/src/proto/gen/dxos/echo/invitation.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/echo/invitation.js.map +0 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +0 -47
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/echo/service.js.map +0 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/echo/snapshot.js.map +0 -1
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts +0 -13
- package/dist/src/proto/gen/dxos/echo/timeframe.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/echo/timeframe.js.map +0 -1
- package/dist/src/proto/gen/dxos/halo/keys.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/halo/keys.js.map +0 -1
- package/dist/src/proto/gen/dxos/rpc.d.ts +0 -45
- package/dist/src/proto/gen/dxos/rpc.d.ts.map +0 -1
- package/dist/src/proto/gen/dxos/rpc.js.map +0 -1
- package/dist/src/proto/gen/google/protobuf.d.ts.map +0 -1
- package/dist/src/proto/gen/google/protobuf.js.map +0 -1
- package/dist/src/proto/gen/index.d.ts.map +0 -1
- package/dist/src/proto/gen/index.js +0 -11
- package/dist/src/proto/gen/index.js.map +0 -1
- package/dist/src/proto/index.d.ts +0 -3
- package/dist/src/proto/index.d.ts.map +0 -1
- package/dist/src/proto/index.js.map +0 -1
- package/dist/src/proto/substitutions.d.ts.map +0 -1
- package/dist/src/proto/substitutions.js.map +0 -1
- package/dist/src/services/client-service.d.ts.map +0 -1
- package/dist/src/services/client-service.js.map +0 -1
- package/dist/src/services/impl/halo.d.ts.map +0 -1
- package/dist/src/services/impl/halo.js.map +0 -1
- package/dist/src/services/impl/index.d.ts +0 -3
- package/dist/src/services/impl/index.d.ts.map +0 -1
- package/dist/src/services/impl/index.js.map +0 -1
- package/dist/src/services/impl/party.d.ts.map +0 -1
- package/dist/src/services/impl/party.js.map +0 -1
- package/dist/src/services/impl/profile.d.ts.map +0 -1
- package/dist/src/services/impl/profile.js.map +0 -1
- package/dist/src/services/impl/services.d.ts.map +0 -1
- package/dist/src/services/impl/services.js.map +0 -1
- package/dist/src/services/impl/system.d.ts.map +0 -1
- package/dist/src/services/impl/system.js.map +0 -1
- package/dist/src/services/impl/types.d.ts.map +0 -1
- package/dist/src/services/impl/types.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -5
- package/dist/src/services/index.d.ts.map +0 -1
- package/dist/src/services/index.js.map +0 -1
- package/dist/src/services/service-host.d.ts.map +0 -1
- package/dist/src/services/service-host.js.map +0 -1
- package/dist/src/services/service-proxy.d.ts.map +0 -1
- package/dist/src/services/service-proxy.js.map +0 -1
- package/dist/src/services/services.test.d.ts.map +0 -1
- package/dist/src/services/services.test.js.map +0 -1
- package/dist/src/services/storage.d.ts.map +0 -1
- package/dist/src/services/storage.js.map +0 -1
- package/dist/src/util/index.d.ts +0 -4
- package/dist/src/util/index.d.ts.map +0 -1
- package/dist/src/util/index.js +0 -23
- package/dist/src/util/index.js.map +0 -1
- package/dist/src/util/messages.d.ts.map +0 -1
- package/dist/src/util/messages.js.map +0 -1
- package/dist/src/util/platform.d.ts +0 -2
- package/dist/src/util/platform.d.ts.map +0 -1
- package/dist/src/util/platform.js +0 -11
- package/dist/src/util/platform.js.map +0 -1
- package/dist/src/util/platform.test.d.ts +0 -2
- package/dist/src/util/platform.test.d.ts.map +0 -1
- package/dist/src/util/platform.test.js +0 -15
- package/dist/src/util/platform.test.js.map +0 -1
- package/dist/src/util/subscription.d.ts +0 -5
- package/dist/src/util/subscription.d.ts.map +0 -1
- package/dist/src/util/subscription.js +0 -25
- package/dist/src/util/subscription.js.map +0 -1
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js.map +0 -1
- package/src/api/index.ts +0 -12
- package/src/api/proxies/index.ts +0 -7
- package/src/proto/gen/dxos/config.ts +0 -220
- package/src/proto/gen/dxos/devtools.ts +0 -206
- package/src/proto/gen/dxos/echo/service.ts +0 -55
- package/src/proto/gen/dxos/rpc.ts +0 -56
- package/src/proto/gen/index.ts +0 -203
- package/src/proto/index.ts +0 -6
- package/src/services/index.ts +0 -9
- package/src/util/index.ts +0 -7
- package/src/util/platform.test.ts +0 -12
- package/src/util/platform.ts +0 -7
- package/src/util/subscription.ts +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import debug from 'debug';
|
|
@@ -12,15 +12,16 @@ import { OpenProgress } from '@dxos/echo-db';
|
|
|
12
12
|
import { ModelConstructor } from '@dxos/model-factory';
|
|
13
13
|
import { RpcPort } from '@dxos/rpc';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import { Runtime } from '../proto
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
15
|
+
import { InvalidConfigurationError, ClientServiceProvider, ClientServices, Echo, Halo, HaloSigner } from '../api';
|
|
16
|
+
import { Runtime } from '../proto';
|
|
17
|
+
import { createDevtoolsRpcServer } from './devtools';
|
|
18
|
+
import { EchoProxy } from './echo-proxy';
|
|
19
|
+
import { HaloProxy } from './halo-proxy';
|
|
20
|
+
import { createWindowMessagePort } from './messages';
|
|
21
|
+
import { ClientServiceProxy } from './service-proxy';
|
|
22
|
+
import { DXOS_VERSION } from './version';
|
|
22
23
|
|
|
23
|
-
const log = debug('dxos:client');
|
|
24
|
+
const log = debug('dxos:client-proxy');
|
|
24
25
|
|
|
25
26
|
const EXPECTED_CONFIG_VERSION = 1;
|
|
26
27
|
|
|
@@ -31,7 +32,7 @@ export const defaultTestingConfig: ConfigObject = {
|
|
|
31
32
|
runtime: {
|
|
32
33
|
services: {
|
|
33
34
|
signal: {
|
|
34
|
-
server: 'ws://localhost:4000'
|
|
35
|
+
server: 'ws://localhost:4000/.well-known/dx/signal'
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -41,7 +42,12 @@ export interface ClientOptions {
|
|
|
41
42
|
/**
|
|
42
43
|
* Only used when remote=true.
|
|
43
44
|
*/
|
|
44
|
-
rpcPort?: RpcPort
|
|
45
|
+
rpcPort?: RpcPort
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
serviceProvider?: ClientServiceProvider
|
|
45
51
|
|
|
46
52
|
/**
|
|
47
53
|
*
|
|
@@ -54,10 +60,6 @@ export interface ClientOptions {
|
|
|
54
60
|
timeout?: number
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
/**
|
|
58
|
-
* The main DXOS client API.
|
|
59
|
-
* An entrypoint to ECHO, HALO, MESH, and DXNS.
|
|
60
|
-
*/
|
|
61
63
|
export class Client {
|
|
62
64
|
public readonly version = DXOS_VERSION;
|
|
63
65
|
|
|
@@ -66,9 +68,9 @@ export class Client {
|
|
|
66
68
|
private readonly _mode: Runtime.Client.Mode;
|
|
67
69
|
|
|
68
70
|
private _initialized = false;
|
|
69
|
-
private _serviceProvider
|
|
70
|
-
private _halo
|
|
71
|
-
private _echo
|
|
71
|
+
private _serviceProvider: ClientServiceProvider;
|
|
72
|
+
private _halo: HaloProxy;
|
|
73
|
+
private _echo: EchoProxy;
|
|
72
74
|
|
|
73
75
|
// TODO(burdon): Expose some kind of stable ID (e.g., from HALO).
|
|
74
76
|
|
|
@@ -85,6 +87,18 @@ export class Client {
|
|
|
85
87
|
this._config = (config instanceof Config) ? config : new Config(config);
|
|
86
88
|
this._options = options;
|
|
87
89
|
|
|
90
|
+
if (options.serviceProvider) {
|
|
91
|
+
this._serviceProvider = options.serviceProvider;
|
|
92
|
+
} else {
|
|
93
|
+
this._serviceProvider = new ClientServiceProxy(
|
|
94
|
+
this._options.rpcPort ?? createWindowMessagePort(),
|
|
95
|
+
this._options.timeout
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
this._halo = new HaloProxy(this._serviceProvider);
|
|
100
|
+
this._echo = new EchoProxy(this._serviceProvider, this._halo);
|
|
101
|
+
|
|
88
102
|
if (Object.keys(this._config.values).length > 0 && this._config.values.version !== EXPECTED_CONFIG_VERSION) {
|
|
89
103
|
throw new InvalidConfigurationError(
|
|
90
104
|
`Invalid config version: ${this._config.values.version} !== ${EXPECTED_CONFIG_VERSION}]`);
|
|
@@ -98,14 +112,14 @@ export class Client {
|
|
|
98
112
|
}
|
|
99
113
|
|
|
100
114
|
toString () {
|
|
101
|
-
return `Client(${JSON.stringify(this.info
|
|
115
|
+
return `Client(${JSON.stringify(this.info)})`;
|
|
102
116
|
}
|
|
103
117
|
|
|
104
|
-
info () {
|
|
118
|
+
get info () {
|
|
105
119
|
return {
|
|
106
120
|
initialized: this.initialized,
|
|
107
|
-
echo: this.echo.info
|
|
108
|
-
halo: this.halo.info
|
|
121
|
+
echo: this.echo.info,
|
|
122
|
+
halo: this.halo.info
|
|
109
123
|
};
|
|
110
124
|
}
|
|
111
125
|
|
|
@@ -139,17 +153,9 @@ export class Client {
|
|
|
139
153
|
|
|
140
154
|
// TODO(burdon): Expose mesh for messaging?
|
|
141
155
|
|
|
142
|
-
/**
|
|
143
|
-
* Returns true if client is connected to a remote services protvider.
|
|
144
|
-
*/
|
|
145
|
-
get isRemote (): boolean {
|
|
146
|
-
return this._serviceProvider instanceof ClientServiceProxy;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
156
|
/**
|
|
150
157
|
* Client services that can be proxied.
|
|
151
158
|
*/
|
|
152
|
-
// TODO(burdon): Remove from API?
|
|
153
159
|
get services (): ClientServices {
|
|
154
160
|
return this._serviceProvider.services;
|
|
155
161
|
}
|
|
@@ -170,64 +176,18 @@ export class Client {
|
|
|
170
176
|
throw new TimeoutError(`Initialize timed out after ${t}s.`);
|
|
171
177
|
}, t * 1000);
|
|
172
178
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
await this.initializeLocal(onProgressCallback);
|
|
177
|
-
} else {
|
|
178
|
-
await this.initializeAuto(onProgressCallback);
|
|
179
|
-
}
|
|
179
|
+
await this._serviceProvider.open(onProgressCallback);
|
|
180
|
+
await this._halo._open();
|
|
181
|
+
await this._echo._open();
|
|
180
182
|
|
|
181
183
|
if (typeof window !== 'undefined') {
|
|
182
184
|
await createDevtoolsRpcServer(this, this._serviceProvider);
|
|
183
185
|
}
|
|
184
186
|
|
|
185
|
-
this._halo = new HaloProxy(this._serviceProvider);
|
|
186
|
-
this._echo = new EchoProxy(this._serviceProvider, this._halo);
|
|
187
|
-
|
|
188
|
-
await this._halo._open();
|
|
189
|
-
await this._echo._open();
|
|
190
|
-
|
|
191
187
|
this._initialized = true; // TODO(burdon): Initialized === halo.initialized?
|
|
192
188
|
clearInterval(timeout);
|
|
193
189
|
}
|
|
194
190
|
|
|
195
|
-
private async initializeRemote (onProgressCallback: Parameters<this['initialize']>[0]) {
|
|
196
|
-
if (!this._options.rpcPort && isNode()) {
|
|
197
|
-
throw new Error('RPC port is required to run client in remote mode on Node environment.');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
log('Creating client proxy.');
|
|
201
|
-
this._serviceProvider = new ClientServiceProxy(
|
|
202
|
-
this._options.rpcPort ?? createWindowMessagePort(),
|
|
203
|
-
this._options.timeout
|
|
204
|
-
);
|
|
205
|
-
await this._serviceProvider.open(onProgressCallback);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
private async initializeLocal (onProgressCallback: Parameters<this['initialize']>[0]) {
|
|
209
|
-
log('Creating client host.');
|
|
210
|
-
this._serviceProvider = new ClientServiceHost(this._config, this._options);
|
|
211
|
-
await this._serviceProvider.open(onProgressCallback);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
private async initializeAuto (onProgressCallback: Parameters<this['initialize']>[0]) {
|
|
215
|
-
if (!this._options.rpcPort && isNode()) {
|
|
216
|
-
await this.initializeLocal(onProgressCallback);
|
|
217
|
-
} else {
|
|
218
|
-
try {
|
|
219
|
-
await this.initializeRemote(onProgressCallback);
|
|
220
|
-
} catch (error) {
|
|
221
|
-
if (error instanceof RemoteServiceConnectionTimeout) {
|
|
222
|
-
log('Failed to connect to remote services. Starting local services.');
|
|
223
|
-
await this.initializeLocal(onProgressCallback);
|
|
224
|
-
} else {
|
|
225
|
-
throw error;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
191
|
/**
|
|
232
192
|
* Cleanup, release resources.
|
|
233
193
|
*/
|
|
@@ -6,13 +6,20 @@ import debug from 'debug';
|
|
|
6
6
|
|
|
7
7
|
import { createBundledRpcServer, RpcPeer, RpcPort } from '@dxos/rpc';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { DevtoolsHook } from './devtools-context';
|
|
9
|
+
import { clientServiceBundle, ClientServiceProvider } from '../api';
|
|
10
|
+
import { Client } from './client-proxy';
|
|
12
11
|
|
|
13
12
|
const log = debug('dxos:client:devtools');
|
|
14
13
|
const error = log.extend('error');
|
|
15
14
|
|
|
15
|
+
/**
|
|
16
|
+
* A hook bound to window.__DXOS__.
|
|
17
|
+
*/
|
|
18
|
+
export interface DevtoolsHook {
|
|
19
|
+
client: Client
|
|
20
|
+
openClientRpcServer: () => Promise<boolean>
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
const port: RpcPort = {
|
|
17
24
|
send: async message => window.postMessage({
|
|
18
25
|
data: Array.from(message),
|
|
@@ -13,33 +13,11 @@ import { ObjectModel } from '@dxos/object-model';
|
|
|
13
13
|
import { PublicKey } from '@dxos/protocols';
|
|
14
14
|
import { ComplexMap, SubscriptionGroup } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
import { Invitation, InvitationProxy } from '../invitations';
|
|
16
|
+
import { ClientServiceProvider, Echo, Party, PartyInvitation } from '../api';
|
|
18
17
|
import { HaloProxy } from './halo-proxy';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Wait for the invitation flow to complete and return the target party.
|
|
24
|
-
*/
|
|
25
|
-
getParty (): Promise<Party> {
|
|
26
|
-
return this.wait();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* ECHO API.
|
|
32
|
-
*/
|
|
33
|
-
// TODO(burdon): Separate public API form implementation (move comments here).
|
|
34
|
-
export interface Echo {
|
|
35
|
-
info (): { parties: number }
|
|
36
|
-
registerModel (constructor: ModelConstructor<any>): void
|
|
37
|
-
createParty (): Promise<Party>
|
|
38
|
-
cloneParty (snapshot: PartySnapshot): Promise<Party>
|
|
39
|
-
getParty (partyKey: PartyKey): Party | undefined
|
|
40
|
-
queryParties (): ResultSet<Party>
|
|
41
|
-
acceptInvitation (invitationDescriptor: InvitationDescriptor): PartyInvitation
|
|
42
|
-
}
|
|
18
|
+
import { InvitationProxy } from './invitation-proxy';
|
|
19
|
+
import { PartyProxy } from './party-proxy';
|
|
20
|
+
import { ClientServiceProxy } from './service-proxy';
|
|
43
21
|
|
|
44
22
|
/**
|
|
45
23
|
* Client proxy to local/remote ECHO service.
|
|
@@ -54,14 +32,15 @@ export class EchoProxy implements Echo {
|
|
|
54
32
|
private readonly _serviceProvider: ClientServiceProvider,
|
|
55
33
|
private readonly _haloProxy: HaloProxy
|
|
56
34
|
) {
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
// TODO(wittjosiah): Reconcile service provider host with interface.
|
|
36
|
+
this._modelFactory = _serviceProvider instanceof ClientServiceProxy
|
|
37
|
+
? new ModelFactory() : (_serviceProvider as any).echo.modelFactory;
|
|
59
38
|
|
|
60
39
|
this._modelFactory.registerModel(ObjectModel); // Register object-model by default.
|
|
61
40
|
}
|
|
62
41
|
|
|
63
42
|
toString () {
|
|
64
|
-
return `EchoProxy(${JSON.stringify(this.info
|
|
43
|
+
return `EchoProxy(${JSON.stringify(this.info)})`;
|
|
65
44
|
}
|
|
66
45
|
|
|
67
46
|
get modelFactory (): ModelFactory {
|
|
@@ -69,15 +48,16 @@ export class EchoProxy implements Echo {
|
|
|
69
48
|
}
|
|
70
49
|
|
|
71
50
|
get networkManager () {
|
|
72
|
-
if (this._serviceProvider instanceof
|
|
73
|
-
|
|
51
|
+
if (this._serviceProvider instanceof ClientServiceProxy) {
|
|
52
|
+
throw new Error('Network Manager not available in service proxy.');
|
|
74
53
|
}
|
|
75
54
|
|
|
76
|
-
|
|
55
|
+
// TODO(wittjosiah): Reconcile service provider host with interface.
|
|
56
|
+
return (this._serviceProvider as any).echo.networkManager;
|
|
77
57
|
}
|
|
78
58
|
|
|
79
59
|
// TODO(burdon): Client ID?
|
|
80
|
-
info () {
|
|
60
|
+
get info () {
|
|
81
61
|
return {
|
|
82
62
|
parties: this._parties.size
|
|
83
63
|
};
|
|
@@ -5,43 +5,11 @@
|
|
|
5
5
|
import { Event } from '@dxos/async';
|
|
6
6
|
import { DeviceInfo, keyPairFromSeedPhrase, KeyRecord } from '@dxos/credentials';
|
|
7
7
|
import { Contact, CreateProfileOptions, InvitationDescriptor, PartyMember, ResultSet } from '@dxos/echo-db';
|
|
8
|
-
import { PublicKey } from '@dxos/protocols';
|
|
9
8
|
import { SubscriptionGroup } from '@dxos/util';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* HALO API.
|
|
17
|
-
*/
|
|
18
|
-
// TODO(burdon): Separate public API form implementation (move comments here).
|
|
19
|
-
export interface Halo {
|
|
20
|
-
info (): { key?: PublicKey }
|
|
21
|
-
|
|
22
|
-
get profile (): Profile | undefined
|
|
23
|
-
createProfile (options?: CreateProfileOptions): Promise<Profile>
|
|
24
|
-
recoverProfile (seedPhrase: string): Promise<Profile>
|
|
25
|
-
|
|
26
|
-
sign (request: SignRequest): Promise<SignResponse>
|
|
27
|
-
addKeyRecord (keyRecord: KeyRecord): Promise<void>
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated
|
|
31
|
-
*/
|
|
32
|
-
subscribeToProfile (callback: (profile: Profile) => void): void
|
|
33
|
-
|
|
34
|
-
queryContacts (): ResultSet<Contact>
|
|
35
|
-
createInvitation (): Promise<InvitationRequest>
|
|
36
|
-
acceptInvitation (invitationDescriptor: InvitationDescriptor): Invitation
|
|
37
|
-
|
|
38
|
-
queryDevices (): Promise<DeviceInfo[]>
|
|
39
|
-
setDevicePreference (key: string, value: string): Promise<void>
|
|
40
|
-
getDevicePreference (key: string): Promise<string | undefined>
|
|
41
|
-
|
|
42
|
-
setGlobalPreference (key: string, value: string): Promise<void>
|
|
43
|
-
getGlobalPreference (key: string): Promise<string | undefined>
|
|
44
|
-
}
|
|
10
|
+
import { ClientServiceProvider, Halo, Invitation, InvitationRequest } from '../api';
|
|
11
|
+
import { Profile, SignRequest } from '../proto';
|
|
12
|
+
import { InvitationProxy } from './invitation-proxy';
|
|
45
13
|
|
|
46
14
|
/**
|
|
47
15
|
* Client proxy to local/remote HALO service.
|
|
@@ -61,10 +29,10 @@ export class HaloProxy implements Halo {
|
|
|
61
29
|
) {}
|
|
62
30
|
|
|
63
31
|
toString () {
|
|
64
|
-
return `HaloProxy(${JSON.stringify(this.info
|
|
32
|
+
return `HaloProxy(${JSON.stringify(this.info)})`;
|
|
65
33
|
}
|
|
66
34
|
|
|
67
|
-
info () {
|
|
35
|
+
get info () {
|
|
68
36
|
return {
|
|
69
37
|
key: this._profile?.publicKey
|
|
70
38
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export * from './client-proxy';
|
|
6
|
+
export * from './devtools';
|
|
7
|
+
export * from './echo-proxy';
|
|
8
|
+
export * from './halo-proxy';
|
|
9
|
+
export * from './invitation-proxy';
|
|
10
|
+
export * from './messages';
|
|
11
|
+
export * from './party-proxy';
|
|
12
|
+
export * from './serializer';
|
|
13
|
+
export * from './service-proxy';
|
|
14
|
+
export * from './version';
|
|
@@ -10,8 +10,8 @@ import { throwUnhandledRejection } from '@dxos/debug';
|
|
|
10
10
|
import { InvitationDescriptor, InvitationDescriptorType } from '@dxos/echo-db';
|
|
11
11
|
import { RpcClosedError } from '@dxos/rpc';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { InvitationRequest } from '
|
|
13
|
+
import { InvitationRequest } from '../api';
|
|
14
|
+
import { AuthenticateInvitationRequest, InvitationRequest as InvitationRequestProto, InvitationState, RedeemedInvitation as RedeemedInvitationProto } from '../proto';
|
|
15
15
|
|
|
16
16
|
export interface CreateInvitationRequestOpts {
|
|
17
17
|
stream: Stream<InvitationRequestProto>
|
|
@@ -10,65 +10,17 @@ import {
|
|
|
10
10
|
Database,
|
|
11
11
|
Item,
|
|
12
12
|
RemoteDatabaseBackend,
|
|
13
|
-
|
|
14
|
-
PartyMember
|
|
13
|
+
streamToResultSet
|
|
15
14
|
} from '@dxos/echo-db';
|
|
16
|
-
import { PartyKey
|
|
15
|
+
import { PartyKey } from '@dxos/echo-protocol';
|
|
17
16
|
import { ModelFactory } from '@dxos/model-factory';
|
|
18
17
|
import { ObjectModel, ObjectProperties } from '@dxos/object-model';
|
|
19
18
|
import { PublicKey } from '@dxos/protocols';
|
|
20
19
|
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
export interface CreationInvitationOptions {
|
|
27
|
-
inviteeKey?: PublicKey
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Party API.
|
|
32
|
-
*/
|
|
33
|
-
// TODO(burdon): Separate public API form implementation (move comments here).
|
|
34
|
-
export interface Party {
|
|
35
|
-
get key (): PublicKey
|
|
36
|
-
get isOpen (): boolean
|
|
37
|
-
get isActive (): boolean
|
|
38
|
-
|
|
39
|
-
// TODO(burdon): Verbs should be on same interface.
|
|
40
|
-
get database (): Database
|
|
41
|
-
get select (): Database['select']
|
|
42
|
-
get reduce (): Database['reduce']
|
|
43
|
-
|
|
44
|
-
initialize (): Promise<void>
|
|
45
|
-
destroy (): Promise<void>
|
|
46
|
-
|
|
47
|
-
open (): Promise<void>
|
|
48
|
-
close (): Promise<void>
|
|
49
|
-
setActive (active: boolean, options: ActivationOptions): Promise<void>
|
|
50
|
-
|
|
51
|
-
setTitle (title: string): Promise<void>
|
|
52
|
-
getTitle (): string
|
|
53
|
-
|
|
54
|
-
// TODO(burdon): Rename (info?)
|
|
55
|
-
getDetails(): Promise<PartyDetails>
|
|
56
|
-
|
|
57
|
-
get properties (): ObjectProperties
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated
|
|
60
|
-
*/
|
|
61
|
-
setProperty (key: string, value?: any): Promise<void>
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated
|
|
64
|
-
*/
|
|
65
|
-
getProperty (key: string, defaultValue?: any): any
|
|
66
|
-
|
|
67
|
-
queryMembers (): ResultSet<PartyMember>
|
|
68
|
-
createInvitation (options?: CreationInvitationOptions): Promise<InvitationRequest>
|
|
69
|
-
|
|
70
|
-
createSnapshot (): Promise<PartySnapshot>
|
|
71
|
-
}
|
|
20
|
+
import { ClientServiceProvider, CreationInvitationOptions, InvitationRequest, Party } from '../api';
|
|
21
|
+
import { Party as PartyProto, PartyDetails } from '../proto';
|
|
22
|
+
import { InvitationProxy } from './invitation-proxy';
|
|
23
|
+
import { ClientServiceProxy } from './service-proxy';
|
|
72
24
|
|
|
73
25
|
/**
|
|
74
26
|
* Main public Party API.
|
|
@@ -105,8 +57,9 @@ export class PartyProxy implements Party {
|
|
|
105
57
|
new RemoteDatabaseBackend(this._serviceProvider.services.DataService, this._key),
|
|
106
58
|
memberKey
|
|
107
59
|
);
|
|
108
|
-
} else if (this._serviceProvider
|
|
109
|
-
|
|
60
|
+
} else if ((this._serviceProvider as any).echo) {
|
|
61
|
+
// TODO(wittjosiah): Reconcile service provider host with interface.
|
|
62
|
+
const party = (this._serviceProvider as any).echo.getParty(this._key) ?? failUndefined();
|
|
110
63
|
this._database = party.database;
|
|
111
64
|
} else {
|
|
112
65
|
throw new Error('Unrecognized service provider.');
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { schema } from '../proto
|
|
5
|
+
import { Party } from '../api';
|
|
6
|
+
import { schema } from '../proto';
|
|
7
|
+
import { Client } from './client-proxy';
|
|
7
8
|
|
|
8
9
|
const partyCodec = schema.getCodecForType('dxos.echo.snapshot.PartySnapshot');
|
|
9
10
|
|
|
@@ -6,8 +6,7 @@ import { promiseTimeout } from '@dxos/async';
|
|
|
6
6
|
import { OpenProgress } from '@dxos/echo-db';
|
|
7
7
|
import { createBundledRpcClient, ProtoRpcClient, RpcPort } from '@dxos/rpc';
|
|
8
8
|
|
|
9
|
-
import { RemoteServiceConnectionTimeout } from '../api';
|
|
10
|
-
import { clientServiceBundle, ClientServiceProvider, ClientServices } from './client-service';
|
|
9
|
+
import { clientServiceBundle, ClientServiceProvider, ClientServices, RemoteServiceConnectionTimeout } from '../api';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Implements services that are not local to the app.
|
|
File without changes
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import assert from 'node:assert';
|
|
6
6
|
|
|
7
7
|
import { Stream } from '@dxos/codec-protobuf';
|
|
8
|
-
import { ECHO } from '@dxos/echo-db';
|
|
8
|
+
import { ECHO, resultSetToStream } from '@dxos/echo-db';
|
|
9
9
|
import { ObjectModel } from '@dxos/object-model';
|
|
10
10
|
import { SubscriptionGroup } from '@dxos/util';
|
|
11
11
|
|
|
12
|
+
import { HaloSigner } from '../../api';
|
|
12
13
|
import {
|
|
13
14
|
AddKeyRecordRequest,
|
|
14
15
|
Contacts,
|
|
@@ -18,9 +19,8 @@ import {
|
|
|
18
19
|
SetPreferenceRequest,
|
|
19
20
|
GetPreferenceRequest,
|
|
20
21
|
GetPreferenceResponse
|
|
21
|
-
} from '../../proto
|
|
22
|
-
import {
|
|
23
|
-
import { CreateServicesOpts, HaloSigner } from './types';
|
|
22
|
+
} from '../../proto';
|
|
23
|
+
import { CreateServicesOpts } from './types';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* HALO service implementation.
|
|
@@ -9,29 +9,28 @@ import { latch } from '@dxos/async';
|
|
|
9
9
|
import { Stream } from '@dxos/codec-protobuf';
|
|
10
10
|
import { defaultSecretValidator, generatePasscode, SecretProvider } from '@dxos/credentials';
|
|
11
11
|
import { InvalidStateError, raise } from '@dxos/debug';
|
|
12
|
-
import { ECHO, InvitationDescriptor, InvitationDescriptorType, PartyNotFoundError } from '@dxos/echo-db';
|
|
12
|
+
import { ECHO, InvitationDescriptor, InvitationDescriptorType, PartyNotFoundError, resultSetToStream } from '@dxos/echo-db';
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
+
AuthenticateInvitationRequest,
|
|
16
|
+
CreateInvitationRequest,
|
|
17
|
+
CreateSnaspotRequest,
|
|
18
|
+
GetPartyDetailsRequest,
|
|
19
|
+
InvitationDescriptor as InvitationDescriptorProto,
|
|
20
|
+
InvitationRequest,
|
|
15
21
|
InvitationState,
|
|
22
|
+
Party,
|
|
23
|
+
PartyDetails,
|
|
16
24
|
PartyService as IPartyService,
|
|
25
|
+
PartySnapshot,
|
|
26
|
+
RedeemedInvitation,
|
|
27
|
+
SetPartyStateRequest,
|
|
28
|
+
SubscribeMembersRequest,
|
|
17
29
|
SubscribeMembersResponse,
|
|
18
30
|
SubscribePartiesResponse,
|
|
19
|
-
SubscribePartyResponse,
|
|
20
31
|
SubscribePartyRequest,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
AuthenticateInvitationRequest,
|
|
24
|
-
InvitationRequest,
|
|
25
|
-
RedeemedInvitation,
|
|
26
|
-
SubscribeMembersRequest,
|
|
27
|
-
Party,
|
|
28
|
-
CreateSnaspotRequest,
|
|
29
|
-
GetPartyDetailsRequest,
|
|
30
|
-
PartyDetails
|
|
31
|
-
} from '../../proto/gen/dxos/client';
|
|
32
|
-
import { InvitationDescriptor as InvitationDescriptorProto } from '../../proto/gen/dxos/echo/invitation';
|
|
33
|
-
import { PartySnapshot } from '../../proto/gen/dxos/echo/snapshot';
|
|
34
|
-
import { resultSetToStream } from '../../util';
|
|
32
|
+
SubscribePartyResponse
|
|
33
|
+
} from '../../proto';
|
|
35
34
|
import { CreateServicesOpts, InviteeInvitation, InviteeInvitations } from './types';
|
|
36
35
|
|
|
37
36
|
/**
|
|
@@ -13,6 +13,7 @@ import { ECHO, InvitationDescriptor } from '@dxos/echo-db';
|
|
|
13
13
|
import {
|
|
14
14
|
AuthenticateInvitationRequest,
|
|
15
15
|
CreateProfileRequest,
|
|
16
|
+
InvitationDescriptor as InvitationDescriptorProto,
|
|
16
17
|
InvitationRequest,
|
|
17
18
|
InvitationState,
|
|
18
19
|
Profile,
|
|
@@ -20,8 +21,7 @@ import {
|
|
|
20
21
|
RecoverProfileRequest,
|
|
21
22
|
RedeemedInvitation,
|
|
22
23
|
SubscribeProfileResponse
|
|
23
|
-
} from '../../proto
|
|
24
|
-
import { InvitationDescriptor as InvitationDescriptorProto } from '../../proto/gen/dxos/echo/invitation';
|
|
24
|
+
} from '../../proto';
|
|
25
25
|
import { CreateServicesOpts, InviteeInvitation, InviteeInvitations } from './types';
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ClientServices } from '../../
|
|
5
|
+
import { ClientServices } from '../../api';
|
|
6
6
|
import { createHaloService } from './halo';
|
|
7
7
|
import { createPartyService } from './party';
|
|
8
8
|
import { createProfileService } from './profile';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { SystemService } from '../../proto
|
|
5
|
+
import { SystemService } from '../../proto';
|
|
6
6
|
import { CreateServicesOpts } from './types';
|
|
7
7
|
|
|
8
8
|
export const createSystemService = ({ config, echo }: CreateServicesOpts): SystemService => ({
|
|
@@ -5,15 +5,7 @@
|
|
|
5
5
|
import { Config } from '@dxos/config';
|
|
6
6
|
import { ECHO } from '@dxos/echo-db';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { KeyRecord } from '../../proto/gen/dxos/halo/keys';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Signer plugin.
|
|
13
|
-
*/
|
|
14
|
-
export interface HaloSigner {
|
|
15
|
-
sign: (request: SignRequest, key: KeyRecord) => Promise<SignResponse>
|
|
16
|
-
}
|
|
8
|
+
import { HaloSigner } from '../../api';
|
|
17
9
|
|
|
18
10
|
export type CreateServicesOpts = {
|
|
19
11
|
config: Config
|