@dxos/client 2.33.9-dev.9246a07b → 2.33.9-dev.9dc01397
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 +939 -936
- 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 +34 -34
- package/dist/src/packlets/proto/gen/dxos/client.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/client.js +1 -1
- package/dist/src/packlets/proto/gen/dxos/client.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/config.d.ts +27 -27
- package/dist/src/packlets/proto/gen/dxos/config.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/config.js +2 -2
- package/dist/src/packlets/proto/gen/dxos/config.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/credentials.d.ts +4 -4
- 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/{proto → packlets/proto}/gen/dxos/devtools.d.ts +44 -44
- 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/{proto → packlets/proto}/gen/dxos/echo/feed.d.ts +7 -7
- 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 +1 -1
- package/dist/src/packlets/proto/gen/dxos/echo/feed.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/invitation.d.ts +2 -2
- 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 +1 -1
- package/dist/src/packlets/proto/gen/dxos/echo/invitation.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/echo/service.d.ts +9 -9
- 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 +8 -8
- 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/{proto → packlets/proto}/gen/dxos/echo/timeframe.d.ts +2 -2
- 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 +6 -6
- 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 +1 -1
- package/dist/src/packlets/proto/gen/dxos/halo/keys.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/rpc.d.ts +7 -7
- package/dist/src/packlets/proto/gen/dxos/rpc.d.ts.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/dxos/rpc.js +1 -1
- package/dist/src/packlets/proto/gen/dxos/rpc.js.map +1 -0
- package/dist/src/{proto → packlets/proto}/gen/google/protobuf.d.ts +2 -2
- 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/{proto → packlets/proto}/gen/index.js +0 -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} +30 -74
- 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} +2 -2
- 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 +34 -34
- package/src/{proto → packlets/proto}/gen/dxos/config.ts +27 -27
- package/src/{proto → packlets/proto}/gen/dxos/credentials.ts +4 -4
- package/src/{proto → packlets/proto}/gen/dxos/devtools.ts +44 -44
- package/src/{proto → packlets/proto}/gen/dxos/echo/feed.ts +7 -7
- package/src/{proto → packlets/proto}/gen/dxos/echo/invitation.ts +2 -2
- package/src/{proto → packlets/proto}/gen/dxos/echo/service.ts +9 -9
- package/src/{proto → packlets/proto}/gen/dxos/echo/snapshot.ts +8 -8
- package/src/{proto → packlets/proto}/gen/dxos/echo/timeframe.ts +2 -2
- package/src/{proto → packlets/proto}/gen/dxos/halo/keys.ts +6 -6
- package/src/{proto → packlets/proto}/gen/dxos/rpc.ts +7 -7
- package/src/{proto → packlets/proto}/gen/google/protobuf.ts +2 -2
- package/src/{proto → packlets/proto}/gen/index.ts +0 -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} +38 -78
- 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} +2 -2
- 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.map +0 -1
- package/dist/src/proto/gen/dxos/config.js.map +0 -1
- 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.map +0 -1
- package/dist/src/proto/gen/dxos/devtools.js.map +0 -1
- 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.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.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.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.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.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/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
package/dist/browser.js
CHANGED
|
@@ -11979,7 +11979,7 @@ var require_stream_writable = __commonJS({
|
|
|
11979
11979
|
var internalUtil = {
|
|
11980
11980
|
deprecate: require_browser2()
|
|
11981
11981
|
};
|
|
11982
|
-
var
|
|
11982
|
+
var Stream10 = require_stream_browser();
|
|
11983
11983
|
var Buffer3 = (init_Buffer(), __toCommonJS(Buffer_exports)).Buffer;
|
|
11984
11984
|
var OurUint8Array = global.Uint8Array || function() {
|
|
11985
11985
|
};
|
|
@@ -12002,7 +12002,7 @@ var require_stream_writable = __commonJS({
|
|
|
12002
12002
|
var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
|
|
12003
12003
|
var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
12004
12004
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
12005
|
-
require_inherits_browser()(Writable,
|
|
12005
|
+
require_inherits_browser()(Writable, Stream10);
|
|
12006
12006
|
function nop() {
|
|
12007
12007
|
}
|
|
12008
12008
|
function WritableState(options, stream, isDuplex) {
|
|
@@ -12096,7 +12096,7 @@ var require_stream_writable = __commonJS({
|
|
|
12096
12096
|
if (typeof options.final === "function")
|
|
12097
12097
|
this._final = options.final;
|
|
12098
12098
|
}
|
|
12099
|
-
|
|
12099
|
+
Stream10.call(this);
|
|
12100
12100
|
}
|
|
12101
12101
|
Writable.prototype.pipe = function() {
|
|
12102
12102
|
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
@@ -13086,7 +13086,7 @@ var require_stream_readable = __commonJS({
|
|
|
13086
13086
|
var EElistenerCount = function EElistenerCount2(emitter, type) {
|
|
13087
13087
|
return emitter.listeners(type).length;
|
|
13088
13088
|
};
|
|
13089
|
-
var
|
|
13089
|
+
var Stream10 = require_stream_browser();
|
|
13090
13090
|
var Buffer3 = (init_Buffer(), __toCommonJS(Buffer_exports)).Buffer;
|
|
13091
13091
|
var OurUint8Array = global.Uint8Array || function() {
|
|
13092
13092
|
};
|
|
@@ -13116,7 +13116,7 @@ var require_stream_readable = __commonJS({
|
|
|
13116
13116
|
var StringDecoder;
|
|
13117
13117
|
var createReadableStreamAsyncIterator;
|
|
13118
13118
|
var from2;
|
|
13119
|
-
require_inherits_browser()(Readable2,
|
|
13119
|
+
require_inherits_browser()(Readable2, Stream10);
|
|
13120
13120
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
13121
13121
|
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
13122
13122
|
function prependListener(emitter, event, fn) {
|
|
@@ -13180,7 +13180,7 @@ var require_stream_readable = __commonJS({
|
|
|
13180
13180
|
if (typeof options.destroy === "function")
|
|
13181
13181
|
this._destroy = options.destroy;
|
|
13182
13182
|
}
|
|
13183
|
-
|
|
13183
|
+
Stream10.call(this);
|
|
13184
13184
|
}
|
|
13185
13185
|
Object.defineProperty(Readable2.prototype, "destroyed", {
|
|
13186
13186
|
enumerable: false,
|
|
@@ -13620,7 +13620,7 @@ var require_stream_readable = __commonJS({
|
|
|
13620
13620
|
return this;
|
|
13621
13621
|
};
|
|
13622
13622
|
Readable2.prototype.on = function(ev, fn) {
|
|
13623
|
-
var res =
|
|
13623
|
+
var res = Stream10.prototype.on.call(this, ev, fn);
|
|
13624
13624
|
var state = this._readableState;
|
|
13625
13625
|
if (ev === "data") {
|
|
13626
13626
|
state.readableListening = this.listenerCount("readable") > 0;
|
|
@@ -13643,14 +13643,14 @@ var require_stream_readable = __commonJS({
|
|
|
13643
13643
|
};
|
|
13644
13644
|
Readable2.prototype.addListener = Readable2.prototype.on;
|
|
13645
13645
|
Readable2.prototype.removeListener = function(ev, fn) {
|
|
13646
|
-
var res =
|
|
13646
|
+
var res = Stream10.prototype.removeListener.call(this, ev, fn);
|
|
13647
13647
|
if (ev === "readable") {
|
|
13648
13648
|
process.nextTick(updateReadableListening, this);
|
|
13649
13649
|
}
|
|
13650
13650
|
return res;
|
|
13651
13651
|
};
|
|
13652
13652
|
Readable2.prototype.removeAllListeners = function(ev) {
|
|
13653
|
-
var res =
|
|
13653
|
+
var res = Stream10.prototype.removeAllListeners.apply(this, arguments);
|
|
13654
13654
|
if (ev === "readable" || ev === void 0) {
|
|
13655
13655
|
process.nextTick(updateReadableListening, this);
|
|
13656
13656
|
}
|
|
@@ -14086,14 +14086,14 @@ var require_pipeline = __commonJS({
|
|
|
14086
14086
|
// ../../../common/temp/node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/readable.js
|
|
14087
14087
|
var require_readable = __commonJS({
|
|
14088
14088
|
"../../../common/temp/node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/readable.js"(exports, module2) {
|
|
14089
|
-
var
|
|
14090
|
-
if (process.env.READABLE_STREAM === "disable" &&
|
|
14091
|
-
module2.exports =
|
|
14092
|
-
Object.assign(module2.exports,
|
|
14093
|
-
module2.exports.Stream =
|
|
14089
|
+
var Stream10 = require_readable();
|
|
14090
|
+
if (process.env.READABLE_STREAM === "disable" && Stream10) {
|
|
14091
|
+
module2.exports = Stream10.Readable;
|
|
14092
|
+
Object.assign(module2.exports, Stream10);
|
|
14093
|
+
module2.exports.Stream = Stream10;
|
|
14094
14094
|
} else {
|
|
14095
14095
|
exports = module2.exports = require_stream_readable();
|
|
14096
|
-
exports.Stream =
|
|
14096
|
+
exports.Stream = Stream10 || exports;
|
|
14097
14097
|
exports.Readable = exports;
|
|
14098
14098
|
exports.Writable = require_stream_writable();
|
|
14099
14099
|
exports.Duplex = require_stream_duplex();
|
|
@@ -70430,7 +70430,7 @@ var require_streamx = __commonJS({
|
|
|
70430
70430
|
this.push(data);
|
|
70431
70431
|
this._writableState.afterWrite(err);
|
|
70432
70432
|
}
|
|
70433
|
-
var
|
|
70433
|
+
var Stream10 = class extends EventEmitter {
|
|
70434
70434
|
constructor(opts) {
|
|
70435
70435
|
super();
|
|
70436
70436
|
this._duplexState = 0;
|
|
@@ -70504,7 +70504,7 @@ var require_streamx = __commonJS({
|
|
|
70504
70504
|
return super.on(name, fn);
|
|
70505
70505
|
}
|
|
70506
70506
|
};
|
|
70507
|
-
var Readable2 = class extends
|
|
70507
|
+
var Readable2 = class extends Stream10 {
|
|
70508
70508
|
constructor(opts) {
|
|
70509
70509
|
super(opts);
|
|
70510
70510
|
this._duplexState |= OPENING | WRITE_DONE;
|
|
@@ -70655,7 +70655,7 @@ var require_streamx = __commonJS({
|
|
|
70655
70655
|
}
|
|
70656
70656
|
}
|
|
70657
70657
|
};
|
|
70658
|
-
var Writable = class extends
|
|
70658
|
+
var Writable = class extends Stream10 {
|
|
70659
70659
|
constructor(opts) {
|
|
70660
70660
|
super(opts);
|
|
70661
70661
|
this._duplexState |= OPENING | READ_DONE;
|
|
@@ -70856,7 +70856,7 @@ var require_streamx = __commonJS({
|
|
|
70856
70856
|
pipelinePromise,
|
|
70857
70857
|
isStream,
|
|
70858
70858
|
isStreamx,
|
|
70859
|
-
Stream:
|
|
70859
|
+
Stream: Stream10,
|
|
70860
70860
|
Writable,
|
|
70861
70861
|
Readable: Readable2,
|
|
70862
70862
|
Duplex,
|
|
@@ -82357,15 +82357,15 @@ var require_feed = __commonJS({
|
|
|
82357
82357
|
"use strict";
|
|
82358
82358
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82359
82359
|
exports.ItemMutation = void 0;
|
|
82360
|
-
var
|
|
82361
|
-
(function(
|
|
82360
|
+
var ItemMutation2;
|
|
82361
|
+
(function(ItemMutation3) {
|
|
82362
82362
|
let Action;
|
|
82363
82363
|
(function(Action2) {
|
|
82364
82364
|
Action2[Action2["NOOP"] = 0] = "NOOP";
|
|
82365
82365
|
Action2[Action2["DELETE"] = 1] = "DELETE";
|
|
82366
82366
|
Action2[Action2["RESTORE"] = 2] = "RESTORE";
|
|
82367
|
-
})(Action =
|
|
82368
|
-
})(
|
|
82367
|
+
})(Action = ItemMutation3.Action || (ItemMutation3.Action = {}));
|
|
82368
|
+
})(ItemMutation2 = exports.ItemMutation || (exports.ItemMutation = {}));
|
|
82369
82369
|
}
|
|
82370
82370
|
});
|
|
82371
82371
|
|
|
@@ -82375,14 +82375,14 @@ var require_invitation2 = __commonJS({
|
|
|
82375
82375
|
"use strict";
|
|
82376
82376
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
82377
82377
|
exports.InvitationDescriptor = void 0;
|
|
82378
|
-
var
|
|
82379
|
-
(function(
|
|
82378
|
+
var InvitationDescriptor8;
|
|
82379
|
+
(function(InvitationDescriptor9) {
|
|
82380
82380
|
let Type;
|
|
82381
82381
|
(function(Type2) {
|
|
82382
82382
|
Type2[Type2["INTERACTIVE"] = 1] = "INTERACTIVE";
|
|
82383
82383
|
Type2[Type2["OFFLINE"] = 2] = "OFFLINE";
|
|
82384
|
-
})(Type =
|
|
82385
|
-
})(
|
|
82384
|
+
})(Type = InvitationDescriptor9.Type || (InvitationDescriptor9.Type = {}));
|
|
82385
|
+
})(InvitationDescriptor8 = exports.InvitationDescriptor || (exports.InvitationDescriptor = {}));
|
|
82386
82386
|
}
|
|
82387
82387
|
});
|
|
82388
82388
|
|
|
@@ -87013,7 +87013,7 @@ var require_result_set = __commonJS({
|
|
|
87013
87013
|
exports.ResultSet = void 0;
|
|
87014
87014
|
var node_assert_1 = __importDefault(require_assert());
|
|
87015
87015
|
var async_1 = require("@dxos/async");
|
|
87016
|
-
var
|
|
87016
|
+
var ResultSet4 = class {
|
|
87017
87017
|
constructor(itemUpdate, getter) {
|
|
87018
87018
|
this._resultsUpdate = new async_1.Event();
|
|
87019
87019
|
this.update = this._resultsUpdate;
|
|
@@ -87043,7 +87043,7 @@ var require_result_set = __commonJS({
|
|
|
87043
87043
|
return this._resultsUpdate.waitFor(condition);
|
|
87044
87044
|
}
|
|
87045
87045
|
};
|
|
87046
|
-
exports.ResultSet =
|
|
87046
|
+
exports.ResultSet = ResultSet4;
|
|
87047
87047
|
}
|
|
87048
87048
|
});
|
|
87049
87049
|
|
|
@@ -87109,6 +87109,33 @@ var require_schema = __commonJS({
|
|
|
87109
87109
|
}
|
|
87110
87110
|
});
|
|
87111
87111
|
|
|
87112
|
+
// ../../echo/echo-db/dist/src/api/subscription.js
|
|
87113
|
+
var require_subscription = __commonJS({
|
|
87114
|
+
"../../echo/echo-db/dist/src/api/subscription.js"(exports) {
|
|
87115
|
+
"use strict";
|
|
87116
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87117
|
+
exports.streamToResultSet = exports.resultSetToStream = void 0;
|
|
87118
|
+
var async_1 = require("@dxos/async");
|
|
87119
|
+
var codec_protobuf_1 = require("@dxos/codec-protobuf");
|
|
87120
|
+
var result_set_1 = require_result_set();
|
|
87121
|
+
var resultSetToStream3 = (resultSet, map) => new codec_protobuf_1.Stream(({ next }) => {
|
|
87122
|
+
next(map(resultSet.value));
|
|
87123
|
+
return resultSet.update.on(() => next(map(resultSet.value)));
|
|
87124
|
+
});
|
|
87125
|
+
exports.resultSetToStream = resultSetToStream3;
|
|
87126
|
+
var streamToResultSet2 = (stream, map) => {
|
|
87127
|
+
const event = new async_1.Event();
|
|
87128
|
+
let lastItem;
|
|
87129
|
+
stream.subscribe((data) => {
|
|
87130
|
+
lastItem = data;
|
|
87131
|
+
event.emit();
|
|
87132
|
+
});
|
|
87133
|
+
return new result_set_1.ResultSet(event, () => map(lastItem));
|
|
87134
|
+
};
|
|
87135
|
+
exports.streamToResultSet = streamToResultSet2;
|
|
87136
|
+
}
|
|
87137
|
+
});
|
|
87138
|
+
|
|
87112
87139
|
// ../../echo/echo-db/dist/src/api/index.js
|
|
87113
87140
|
var require_api2 = __commonJS({
|
|
87114
87141
|
"../../echo/echo-db/dist/src/api/index.js"(exports) {
|
|
@@ -87136,6 +87163,7 @@ var require_api2 = __commonJS({
|
|
|
87136
87163
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87137
87164
|
__exportStar(require_result_set(), exports);
|
|
87138
87165
|
__exportStar(require_schema(), exports);
|
|
87166
|
+
__exportStar(require_subscription(), exports);
|
|
87139
87167
|
}
|
|
87140
87168
|
});
|
|
87141
87169
|
|
|
@@ -91217,7 +91245,7 @@ var require_invitation_descriptor = __commonJS({
|
|
|
91217
91245
|
var errors_1 = require_errors6();
|
|
91218
91246
|
exports.InvitationDescriptorType = proto.InvitationDescriptor.Type;
|
|
91219
91247
|
var base62 = (0, base_x_1.default)("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
|
91220
|
-
var
|
|
91248
|
+
var InvitationDescriptor8 = class {
|
|
91221
91249
|
constructor(type, swarmKey, invitation, identityKey, secret) {
|
|
91222
91250
|
this.type = type;
|
|
91223
91251
|
this.swarmKey = swarmKey;
|
|
@@ -91236,7 +91264,7 @@ var require_invitation_descriptor = __commonJS({
|
|
|
91236
91264
|
}
|
|
91237
91265
|
static fromQueryParameters(queryParameters) {
|
|
91238
91266
|
const { hash, swarmKey, invitation, identityKey, type } = queryParameters;
|
|
91239
|
-
const descriptor = new
|
|
91267
|
+
const descriptor = new InvitationDescriptor8(parseInvitationType(type), protocols_1.PublicKey.bufferize(swarmKey), protocols_1.PublicKey.bufferize(invitation), identityKey ? protocols_1.PublicKey.from(identityKey) : void 0);
|
|
91240
91268
|
if (hash !== descriptor.hash) {
|
|
91241
91269
|
throw new errors_1.InvalidInvitationError();
|
|
91242
91270
|
}
|
|
@@ -91246,11 +91274,11 @@ var require_invitation_descriptor = __commonJS({
|
|
|
91246
91274
|
(0, node_assert_1.default)(protoInvitation.type, "Invitation type not provided.");
|
|
91247
91275
|
(0, node_assert_1.default)(protoInvitation.swarmKey, "Invitation swarm key not provided.");
|
|
91248
91276
|
(0, node_assert_1.default)(protoInvitation.invitation, "Invitation not provided.");
|
|
91249
|
-
return new
|
|
91277
|
+
return new InvitationDescriptor8(protoInvitation.type, protoInvitation.swarmKey, Buffer.from(protoInvitation.invitation), protoInvitation.identityKey ? protocols_1.PublicKey.from(protoInvitation.identityKey) : void 0, protoInvitation.secret ? Buffer.from(protoInvitation.secret) : void 0);
|
|
91250
91278
|
}
|
|
91251
91279
|
static decode(code) {
|
|
91252
91280
|
const json = base62.decode(code).toString();
|
|
91253
|
-
return
|
|
91281
|
+
return InvitationDescriptor8.fromQueryParameters(JSON.parse(json));
|
|
91254
91282
|
}
|
|
91255
91283
|
get hash() {
|
|
91256
91284
|
const query = this.toQueryParameters();
|
|
@@ -91283,7 +91311,7 @@ var require_invitation_descriptor = __commonJS({
|
|
|
91283
91311
|
return base62.encode(buffer);
|
|
91284
91312
|
}
|
|
91285
91313
|
};
|
|
91286
|
-
exports.InvitationDescriptor =
|
|
91314
|
+
exports.InvitationDescriptor = InvitationDescriptor8;
|
|
91287
91315
|
var parseInvitationType = (str) => {
|
|
91288
91316
|
const type = parseInt(str);
|
|
91289
91317
|
(0, node_assert_1.default)(type === 1 || type === 2, "Invalid invitation type");
|
|
@@ -96129,7 +96157,7 @@ var require_echo2 = __commonJS({
|
|
|
96129
96157
|
var snapshots_1 = require_snapshots();
|
|
96130
96158
|
var log3 = (0, debug_1.default)("dxos:echo");
|
|
96131
96159
|
var error2 = log3.extend("error");
|
|
96132
|
-
var
|
|
96160
|
+
var ECHO5 = class {
|
|
96133
96161
|
constructor({
|
|
96134
96162
|
keyStorage = (0, memdown_1.default)(),
|
|
96135
96163
|
storage = (0, random_access_multi_storage_1.createStorage)("", random_access_multi_storage_1.StorageType.RAM),
|
|
@@ -96290,11 +96318,11 @@ var require_echo2 = __commonJS({
|
|
|
96290
96318
|
};
|
|
96291
96319
|
__decorate([
|
|
96292
96320
|
async_1.synchronized
|
|
96293
|
-
],
|
|
96321
|
+
], ECHO5.prototype, "open", null);
|
|
96294
96322
|
__decorate([
|
|
96295
96323
|
async_1.synchronized
|
|
96296
|
-
],
|
|
96297
|
-
exports.ECHO =
|
|
96324
|
+
], ECHO5.prototype, "close", null);
|
|
96325
|
+
exports.ECHO = ECHO5;
|
|
96298
96326
|
}
|
|
96299
96327
|
});
|
|
96300
96328
|
|
|
@@ -96488,7 +96516,7 @@ __export(src_exports, {
|
|
|
96488
96516
|
InvitationDescriptor: () => import_echo_db9.InvitationDescriptor,
|
|
96489
96517
|
InvitationDescriptorType: () => import_echo_db9.InvitationDescriptorType,
|
|
96490
96518
|
InvitationProxy: () => InvitationProxy,
|
|
96491
|
-
InvitationRequest: () =>
|
|
96519
|
+
InvitationRequest: () => InvitationRequest,
|
|
96492
96520
|
Item: () => import_echo_db9.Item,
|
|
96493
96521
|
ItemFilterDeleted: () => import_echo_db9.ItemFilterDeleted,
|
|
96494
96522
|
ItemID: () => import_echo_protocol2.ItemID,
|
|
@@ -96520,10 +96548,7 @@ __export(src_exports, {
|
|
|
96520
96548
|
defaultConfig: () => defaultConfig,
|
|
96521
96549
|
defaultTestingConfig: () => defaultTestingConfig,
|
|
96522
96550
|
generateSeedPhrase: () => import_credentials5.generateSeedPhrase,
|
|
96523
|
-
|
|
96524
|
-
proto: () => gen_exports,
|
|
96525
|
-
resultSetToStream: () => resultSetToStream,
|
|
96526
|
-
streamToResultSet: () => streamToResultSet
|
|
96551
|
+
proto: () => gen_exports
|
|
96527
96552
|
});
|
|
96528
96553
|
module.exports = __toCommonJS(src_exports);
|
|
96529
96554
|
var import_credentials5 = __toESM(require_src5());
|
|
@@ -96532,480 +96557,26 @@ var import_echo_protocol2 = __toESM(require_src7());
|
|
|
96532
96557
|
var import_object_model2 = __toESM(require_src8());
|
|
96533
96558
|
var import_network_manager = __toESM(require_src9());
|
|
96534
96559
|
|
|
96535
|
-
// src/
|
|
96536
|
-
var import_node_assert = __toESM(require_assert());
|
|
96537
|
-
var import_codec_protobuf2 = require("@dxos/codec-protobuf");
|
|
96538
|
-
var import_util = require("@dxos/util");
|
|
96539
|
-
|
|
96540
|
-
// src/util/platform.ts
|
|
96541
|
-
var isNode = () => typeof process !== "undefined" && process.versions != null && process.versions.node != null;
|
|
96542
|
-
|
|
96543
|
-
// src/util/messages.ts
|
|
96544
|
-
var createWindowMessagePort = () => {
|
|
96545
|
-
if (isNode()) {
|
|
96546
|
-
throw new Error("Connecting to wallet extension is not available in Node environment.");
|
|
96547
|
-
}
|
|
96548
|
-
return {
|
|
96549
|
-
send: async (message) => window.postMessage({
|
|
96550
|
-
payloadFromAppToContentScript: Array.from(message)
|
|
96551
|
-
}, "*"),
|
|
96552
|
-
subscribe: (callback) => {
|
|
96553
|
-
const listener = (event) => {
|
|
96554
|
-
var _a;
|
|
96555
|
-
const payload = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.payloadFromContentScriptToApp;
|
|
96556
|
-
if (payload) {
|
|
96557
|
-
callback(new Uint8Array(payload));
|
|
96558
|
-
}
|
|
96559
|
-
};
|
|
96560
|
-
window.addEventListener("message", listener);
|
|
96561
|
-
return () => window.removeEventListener("message", listener);
|
|
96562
|
-
}
|
|
96563
|
-
};
|
|
96564
|
-
};
|
|
96565
|
-
|
|
96566
|
-
// src/util/subscription.ts
|
|
96567
|
-
var import_async = require("@dxos/async");
|
|
96568
|
-
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
96569
|
-
var import_echo_db = __toESM(require_src14());
|
|
96570
|
-
var resultSetToStream = (resultSet, map) => new import_codec_protobuf.Stream(({ next }) => {
|
|
96571
|
-
next(map(resultSet.value));
|
|
96572
|
-
return resultSet.update.on(() => next(map(resultSet.value)));
|
|
96573
|
-
});
|
|
96574
|
-
var streamToResultSet = (stream, map) => {
|
|
96575
|
-
const event = new import_async.Event();
|
|
96576
|
-
let lastItem;
|
|
96577
|
-
stream.subscribe((data) => {
|
|
96578
|
-
lastItem = data;
|
|
96579
|
-
event.emit();
|
|
96580
|
-
});
|
|
96581
|
-
return new import_echo_db.ResultSet(event, () => map(lastItem));
|
|
96582
|
-
};
|
|
96583
|
-
|
|
96584
|
-
// src/services/impl/halo.ts
|
|
96585
|
-
var HaloService = class {
|
|
96586
|
-
constructor(echo, signer) {
|
|
96587
|
-
this.echo = echo;
|
|
96588
|
-
this.signer = signer;
|
|
96589
|
-
}
|
|
96590
|
-
async sign(request) {
|
|
96591
|
-
(0, import_node_assert.default)(this.signer, "Signer not set.");
|
|
96592
|
-
(0, import_node_assert.default)(request.publicKey, "Provide a publicKey of the key that should be used for signing.");
|
|
96593
|
-
const key = await this.echo.halo.keyring.getFullKey(request.publicKey);
|
|
96594
|
-
(0, import_node_assert.default)(key, "Key not found.");
|
|
96595
|
-
return this.signer.sign(request, key);
|
|
96596
|
-
}
|
|
96597
|
-
async addKeyRecord(request) {
|
|
96598
|
-
(0, import_node_assert.default)(request.keyRecord && request.keyRecord.publicKey, "Missing key record.");
|
|
96599
|
-
await this.echo.halo.keyring.addKeyRecord(request.keyRecord);
|
|
96600
|
-
(0, import_node_assert.default)(await this.echo.halo.keyring.getKey(request.keyRecord.publicKey), "Key not inserted correctly.");
|
|
96601
|
-
}
|
|
96602
|
-
subscribeContacts() {
|
|
96603
|
-
if (this.echo.halo.identity) {
|
|
96604
|
-
return resultSetToStream(this.echo.halo.queryContacts(), (contacts) => ({ contacts }));
|
|
96605
|
-
}
|
|
96606
|
-
return new import_codec_protobuf2.Stream(({ next }) => {
|
|
96607
|
-
if (!this.echo.halo.identity) {
|
|
96608
|
-
next({ contacts: [] });
|
|
96609
|
-
}
|
|
96610
|
-
const subGroup = new import_util.SubscriptionGroup();
|
|
96611
|
-
setImmediate(async () => {
|
|
96612
|
-
await this.echo.halo.identityReady.waitForCondition(() => !!this.echo.halo.identity);
|
|
96613
|
-
const resultSet = this.echo.halo.queryContacts();
|
|
96614
|
-
next({ contacts: resultSet.value });
|
|
96615
|
-
subGroup.push(resultSet.update.on(() => next({ contacts: resultSet.value })));
|
|
96616
|
-
});
|
|
96617
|
-
return () => subGroup.unsubscribe();
|
|
96618
|
-
});
|
|
96619
|
-
}
|
|
96620
|
-
async setGlobalPreference(request) {
|
|
96621
|
-
var _a, _b, _c;
|
|
96622
|
-
(0, import_node_assert.default)(request.key, "Missing key of property.");
|
|
96623
|
-
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getGlobalPreferences()) == null ? void 0 : _c.model;
|
|
96624
|
-
(0, import_node_assert.default)(preferences, "Preferences failed to load.");
|
|
96625
|
-
await preferences.setProperty(request.key, request.value);
|
|
96626
|
-
}
|
|
96627
|
-
async getGlobalPreference(request) {
|
|
96628
|
-
var _a, _b, _c;
|
|
96629
|
-
(0, import_node_assert.default)(request.key, "Missing key of property.");
|
|
96630
|
-
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getGlobalPreferences()) == null ? void 0 : _c.model;
|
|
96631
|
-
return {
|
|
96632
|
-
value: preferences == null ? void 0 : preferences.getProperty(request.key)
|
|
96633
|
-
};
|
|
96634
|
-
}
|
|
96635
|
-
async setDevicePreference(request) {
|
|
96636
|
-
var _a, _b, _c;
|
|
96637
|
-
(0, import_node_assert.default)(request.key, "Missing key of property.");
|
|
96638
|
-
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getDevicePreferences()) == null ? void 0 : _c.model;
|
|
96639
|
-
(0, import_node_assert.default)(preferences, "Preferences failed to load.");
|
|
96640
|
-
await preferences.setProperty(request.key, request.value);
|
|
96641
|
-
}
|
|
96642
|
-
async getDevicePreference(request) {
|
|
96643
|
-
var _a, _b, _c;
|
|
96644
|
-
(0, import_node_assert.default)(request.key, "Missing key of property.");
|
|
96645
|
-
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getDevicePreferences()) == null ? void 0 : _c.model;
|
|
96646
|
-
return {
|
|
96647
|
-
value: preferences == null ? void 0 : preferences.getProperty(request.key)
|
|
96648
|
-
};
|
|
96649
|
-
}
|
|
96650
|
-
};
|
|
96651
|
-
var createHaloService = ({ echo, signer }) => new HaloService(echo, signer);
|
|
96652
|
-
|
|
96653
|
-
// src/services/impl/party.ts
|
|
96654
|
-
var import_node_assert2 = __toESM(require_assert());
|
|
96655
|
-
var import_uuid = require("uuid");
|
|
96656
|
-
var import_async2 = require("@dxos/async");
|
|
96657
|
-
var import_codec_protobuf3 = require("@dxos/codec-protobuf");
|
|
96658
|
-
var import_credentials = __toESM(require_src5());
|
|
96659
|
-
var import_debug = require("@dxos/debug");
|
|
96660
|
-
var import_echo_db2 = __toESM(require_src14());
|
|
96661
|
-
var PartyService = class {
|
|
96662
|
-
constructor(echo) {
|
|
96663
|
-
this.echo = echo;
|
|
96664
|
-
this.inviteeInvitations = /* @__PURE__ */ new Map();
|
|
96665
|
-
}
|
|
96666
|
-
subscribeToParty(request) {
|
|
96667
|
-
const update = (next) => {
|
|
96668
|
-
try {
|
|
96669
|
-
const party2 = this.echo.getParty(request.partyKey);
|
|
96670
|
-
next({
|
|
96671
|
-
party: party2 && {
|
|
96672
|
-
publicKey: party2.key,
|
|
96673
|
-
isOpen: party2.isOpen,
|
|
96674
|
-
isActive: party2.isActive,
|
|
96675
|
-
members: party2.queryMembers().value
|
|
96676
|
-
}
|
|
96677
|
-
});
|
|
96678
|
-
} catch (error2) {
|
|
96679
|
-
if (error2 instanceof import_debug.InvalidStateError) {
|
|
96680
|
-
} else {
|
|
96681
|
-
throw error2;
|
|
96682
|
-
}
|
|
96683
|
-
}
|
|
96684
|
-
};
|
|
96685
|
-
const party = this.echo.getParty(request.partyKey);
|
|
96686
|
-
if (party) {
|
|
96687
|
-
return new import_codec_protobuf3.Stream(({ next }) => party.update.on(() => update(next)));
|
|
96688
|
-
} else {
|
|
96689
|
-
return new import_codec_protobuf3.Stream(({ next }) => {
|
|
96690
|
-
let unsubscribeParty;
|
|
96691
|
-
const unsubscribeParties = this.echo.queryParties().subscribe((parties) => {
|
|
96692
|
-
const party2 = parties.find((party3) => party3.key.equals(request.partyKey));
|
|
96693
|
-
if (party2 && !unsubscribeParty) {
|
|
96694
|
-
unsubscribeParty = party2.update.on(() => update(next));
|
|
96695
|
-
}
|
|
96696
|
-
});
|
|
96697
|
-
update(next);
|
|
96698
|
-
return () => {
|
|
96699
|
-
unsubscribeParties();
|
|
96700
|
-
unsubscribeParty == null ? void 0 : unsubscribeParty();
|
|
96701
|
-
};
|
|
96702
|
-
});
|
|
96703
|
-
}
|
|
96704
|
-
}
|
|
96705
|
-
subscribeParties() {
|
|
96706
|
-
return resultSetToStream(this.echo.queryParties(), (parties) => ({
|
|
96707
|
-
parties: parties.map((party) => ({
|
|
96708
|
-
publicKey: party.key,
|
|
96709
|
-
isOpen: party.isOpen,
|
|
96710
|
-
isActive: party.isActive,
|
|
96711
|
-
members: party.queryMembers().value
|
|
96712
|
-
}))
|
|
96713
|
-
}));
|
|
96714
|
-
}
|
|
96715
|
-
async getPartyDetails(request) {
|
|
96716
|
-
var _a;
|
|
96717
|
-
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug.raise)(new import_echo_db2.PartyNotFoundError(request.partyKey));
|
|
96718
|
-
return {
|
|
96719
|
-
processedTimeframe: party.timeframe
|
|
96720
|
-
};
|
|
96721
|
-
}
|
|
96722
|
-
async createParty() {
|
|
96723
|
-
const party = await this.echo.createParty();
|
|
96724
|
-
return {
|
|
96725
|
-
publicKey: party.key,
|
|
96726
|
-
isOpen: party.isOpen,
|
|
96727
|
-
isActive: party.isActive
|
|
96728
|
-
};
|
|
96729
|
-
}
|
|
96730
|
-
async cloneParty(snapshot) {
|
|
96731
|
-
const party = await this.echo.cloneParty(snapshot);
|
|
96732
|
-
return {
|
|
96733
|
-
publicKey: party.key,
|
|
96734
|
-
isOpen: party.isOpen,
|
|
96735
|
-
isActive: party.isActive
|
|
96736
|
-
};
|
|
96737
|
-
}
|
|
96738
|
-
async setPartyState(request) {
|
|
96739
|
-
const party = this.echo.getParty(request.partyKey);
|
|
96740
|
-
if (!party) {
|
|
96741
|
-
throw new Error("Party not found");
|
|
96742
|
-
}
|
|
96743
|
-
if (request.open === true) {
|
|
96744
|
-
await party.open();
|
|
96745
|
-
} else if (request.open === false) {
|
|
96746
|
-
await party.close();
|
|
96747
|
-
}
|
|
96748
|
-
if (request.activeGlobal === true) {
|
|
96749
|
-
await party.activate({ global: true });
|
|
96750
|
-
} else if (request.activeGlobal === false) {
|
|
96751
|
-
await party.deactivate({ global: true });
|
|
96752
|
-
}
|
|
96753
|
-
if (request.activeDevice === true) {
|
|
96754
|
-
await party.activate({ device: true });
|
|
96755
|
-
} else if (request.activeDevice === false) {
|
|
96756
|
-
await party.deactivate({ device: true });
|
|
96757
|
-
}
|
|
96758
|
-
return {
|
|
96759
|
-
publicKey: party.key,
|
|
96760
|
-
isOpen: party.isOpen,
|
|
96761
|
-
isActive: party.isActive
|
|
96762
|
-
};
|
|
96763
|
-
}
|
|
96764
|
-
createInvitation(request) {
|
|
96765
|
-
return new import_codec_protobuf3.Stream(({ next, close }) => {
|
|
96766
|
-
var _a;
|
|
96767
|
-
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug.raise)(new import_echo_db2.PartyNotFoundError(request.partyKey));
|
|
96768
|
-
setImmediate(async () => {
|
|
96769
|
-
try {
|
|
96770
|
-
let invitation;
|
|
96771
|
-
if (!request.inviteeKey) {
|
|
96772
|
-
const secret = Buffer.from((0, import_credentials.generatePasscode)());
|
|
96773
|
-
const secretProvider = async () => {
|
|
96774
|
-
next({ state: 2 /* CONNECTED */ });
|
|
96775
|
-
return Buffer.from(secret);
|
|
96776
|
-
};
|
|
96777
|
-
invitation = await party.invitationManager.createInvitation({
|
|
96778
|
-
secretProvider,
|
|
96779
|
-
secretValidator: import_credentials.defaultSecretValidator
|
|
96780
|
-
}, {
|
|
96781
|
-
onFinish: () => {
|
|
96782
|
-
next({ state: 3 /* SUCCESS */ });
|
|
96783
|
-
close();
|
|
96784
|
-
}
|
|
96785
|
-
});
|
|
96786
|
-
(0, import_node_assert2.default)(invitation.type === import_echo_db2.InvitationDescriptorType.INTERACTIVE);
|
|
96787
|
-
invitation.secret = Buffer.from(secret);
|
|
96788
|
-
} else {
|
|
96789
|
-
invitation = await party.invitationManager.createOfflineInvitation(request.inviteeKey);
|
|
96790
|
-
}
|
|
96791
|
-
next({ state: 1 /* WAITING_FOR_CONNECTION */, descriptor: invitation.toProto() });
|
|
96792
|
-
if (invitation.type === import_echo_db2.InvitationDescriptorType.OFFLINE) {
|
|
96793
|
-
close();
|
|
96794
|
-
}
|
|
96795
|
-
} catch (error2) {
|
|
96796
|
-
next({ state: 4 /* ERROR */, error: error2.message });
|
|
96797
|
-
close();
|
|
96798
|
-
}
|
|
96799
|
-
});
|
|
96800
|
-
});
|
|
96801
|
-
}
|
|
96802
|
-
acceptInvitation(request) {
|
|
96803
|
-
return new import_codec_protobuf3.Stream(({ next, close }) => {
|
|
96804
|
-
const id = (0, import_uuid.v4)();
|
|
96805
|
-
const [secretLatch, secretTrigger] = (0, import_async2.latch)();
|
|
96806
|
-
const inviteeInvitation = { secretTrigger };
|
|
96807
|
-
const secretProvider = async () => {
|
|
96808
|
-
await secretLatch;
|
|
96809
|
-
const secret = inviteeInvitation.secret;
|
|
96810
|
-
if (!secret) {
|
|
96811
|
-
throw new Error("Secret not provided.");
|
|
96812
|
-
}
|
|
96813
|
-
return Buffer.from(secret);
|
|
96814
|
-
};
|
|
96815
|
-
const partyPromise = this.echo.joinParty(import_echo_db2.InvitationDescriptor.fromProto(request), request.type === import_echo_db2.InvitationDescriptorType.INTERACTIVE ? secretProvider : void 0);
|
|
96816
|
-
this.inviteeInvitations.set(id, inviteeInvitation);
|
|
96817
|
-
next({ id, state: 2 /* CONNECTED */ });
|
|
96818
|
-
partyPromise.then((party) => {
|
|
96819
|
-
next({ id, state: 3 /* SUCCESS */, partyKey: party.key });
|
|
96820
|
-
}).catch((err) => {
|
|
96821
|
-
console.error(err);
|
|
96822
|
-
next({ id, state: 4 /* ERROR */, error: String(err) });
|
|
96823
|
-
}).finally(() => {
|
|
96824
|
-
close();
|
|
96825
|
-
});
|
|
96826
|
-
});
|
|
96827
|
-
}
|
|
96828
|
-
async authenticateInvitation(request) {
|
|
96829
|
-
var _a;
|
|
96830
|
-
(0, import_node_assert2.default)(request.processId, "Process ID is missing.");
|
|
96831
|
-
const invitation = this.inviteeInvitations.get(request.processId);
|
|
96832
|
-
(0, import_node_assert2.default)(invitation, "Invitation not found.");
|
|
96833
|
-
(0, import_node_assert2.default)(request.secret, "Secret not provided.");
|
|
96834
|
-
invitation.secret = request.secret;
|
|
96835
|
-
(_a = invitation.secretTrigger) == null ? void 0 : _a.call(invitation);
|
|
96836
|
-
}
|
|
96837
|
-
subscribeMembers(request) {
|
|
96838
|
-
const party = this.echo.getParty(request.partyKey);
|
|
96839
|
-
if (party) {
|
|
96840
|
-
return resultSetToStream(party.queryMembers(), (members) => ({ members }));
|
|
96841
|
-
} else {
|
|
96842
|
-
return new import_codec_protobuf3.Stream(({ next }) => {
|
|
96843
|
-
let unsubscribeMembers;
|
|
96844
|
-
const unsubscribeParties = this.echo.queryParties().subscribe((parties) => {
|
|
96845
|
-
const party2 = parties.find((party3) => party3.key.equals(request.partyKey));
|
|
96846
|
-
if (!unsubscribeMembers && party2) {
|
|
96847
|
-
const resultSet = party2.queryMembers();
|
|
96848
|
-
next({ members: resultSet.value });
|
|
96849
|
-
unsubscribeMembers = resultSet.update.on(() => next({ members: resultSet.value }));
|
|
96850
|
-
}
|
|
96851
|
-
});
|
|
96852
|
-
return () => {
|
|
96853
|
-
unsubscribeParties();
|
|
96854
|
-
unsubscribeMembers();
|
|
96855
|
-
};
|
|
96856
|
-
});
|
|
96857
|
-
}
|
|
96858
|
-
}
|
|
96859
|
-
async createSnapshot(request) {
|
|
96860
|
-
var _a;
|
|
96861
|
-
(0, import_node_assert2.default)(request.partyKey);
|
|
96862
|
-
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug.raise)(new import_echo_db2.PartyNotFoundError(request.partyKey));
|
|
96863
|
-
return party.createSnapshot();
|
|
96864
|
-
}
|
|
96865
|
-
};
|
|
96866
|
-
var createPartyService = ({ echo }) => new PartyService(echo);
|
|
96867
|
-
|
|
96868
|
-
// src/services/impl/profile.ts
|
|
96869
|
-
var import_node_assert3 = __toESM(require_assert());
|
|
96870
|
-
var import_uuid2 = require("uuid");
|
|
96871
|
-
var import_async3 = require("@dxos/async");
|
|
96872
|
-
var import_codec_protobuf4 = require("@dxos/codec-protobuf");
|
|
96873
|
-
var import_credentials2 = __toESM(require_src5());
|
|
96874
|
-
var import_echo_db3 = __toESM(require_src14());
|
|
96875
|
-
var ProfileService = class {
|
|
96876
|
-
constructor(echo) {
|
|
96877
|
-
this.echo = echo;
|
|
96878
|
-
this.inviteeInvitations = /* @__PURE__ */ new Map();
|
|
96879
|
-
}
|
|
96880
|
-
subscribeProfile() {
|
|
96881
|
-
return new import_codec_protobuf4.Stream(({ next }) => {
|
|
96882
|
-
const emitNext = () => next({
|
|
96883
|
-
profile: this.echo.halo.isInitialized ? this.echo.halo.getProfile() : void 0
|
|
96884
|
-
});
|
|
96885
|
-
emitNext();
|
|
96886
|
-
return this.echo.halo.subscribeToProfile(emitNext);
|
|
96887
|
-
});
|
|
96888
|
-
}
|
|
96889
|
-
async createProfile(request) {
|
|
96890
|
-
return this.echo.halo.createProfile(request);
|
|
96891
|
-
}
|
|
96892
|
-
async recoverProfile(request) {
|
|
96893
|
-
if (!request.seedPhrase) {
|
|
96894
|
-
throw new Error("Recovery SeedPhrase not provided.");
|
|
96895
|
-
}
|
|
96896
|
-
await this.echo.open();
|
|
96897
|
-
await this.echo.halo.recover(request.seedPhrase);
|
|
96898
|
-
const profile = this.echo.halo.getProfile();
|
|
96899
|
-
(0, import_node_assert3.default)(profile, "Recovering profile failed.");
|
|
96900
|
-
return profile;
|
|
96901
|
-
}
|
|
96902
|
-
createInvitation() {
|
|
96903
|
-
return new import_codec_protobuf4.Stream(({ next, close }) => {
|
|
96904
|
-
setImmediate(async () => {
|
|
96905
|
-
const secret = Buffer.from((0, import_credentials2.generatePasscode)());
|
|
96906
|
-
let invitation;
|
|
96907
|
-
const secretProvider = async () => {
|
|
96908
|
-
next({ descriptor: invitation.toProto(), state: 2 /* CONNECTED */ });
|
|
96909
|
-
return Buffer.from(secret);
|
|
96910
|
-
};
|
|
96911
|
-
invitation = await this.echo.halo.createInvitation({
|
|
96912
|
-
secretProvider,
|
|
96913
|
-
secretValidator: import_credentials2.defaultSecretValidator
|
|
96914
|
-
}, {
|
|
96915
|
-
onFinish: () => {
|
|
96916
|
-
next({ state: 3 /* SUCCESS */ });
|
|
96917
|
-
close();
|
|
96918
|
-
}
|
|
96919
|
-
});
|
|
96920
|
-
invitation.secret = secret;
|
|
96921
|
-
next({ descriptor: invitation.toProto(), state: 1 /* WAITING_FOR_CONNECTION */ });
|
|
96922
|
-
});
|
|
96923
|
-
});
|
|
96924
|
-
}
|
|
96925
|
-
acceptInvitation(request) {
|
|
96926
|
-
return new import_codec_protobuf4.Stream(({ next, close }) => {
|
|
96927
|
-
const id = (0, import_uuid2.v4)();
|
|
96928
|
-
const [secretLatch, secretTrigger] = (0, import_async3.latch)();
|
|
96929
|
-
const inviteeInvitation = { secretTrigger };
|
|
96930
|
-
const secretProvider = async () => {
|
|
96931
|
-
await secretLatch;
|
|
96932
|
-
const secret = inviteeInvitation.secret;
|
|
96933
|
-
if (!secret) {
|
|
96934
|
-
throw new Error("Secret not provided.");
|
|
96935
|
-
}
|
|
96936
|
-
return Buffer.from(secret);
|
|
96937
|
-
};
|
|
96938
|
-
const haloPartyPromise = this.echo.halo.join(import_echo_db3.InvitationDescriptor.fromProto(request), secretProvider);
|
|
96939
|
-
this.inviteeInvitations.set(id, inviteeInvitation);
|
|
96940
|
-
next({ id, state: 2 /* CONNECTED */ });
|
|
96941
|
-
haloPartyPromise.then((party) => {
|
|
96942
|
-
next({ id, state: 3 /* SUCCESS */, partyKey: party.key });
|
|
96943
|
-
}).catch((err) => {
|
|
96944
|
-
next({ id, state: 4 /* ERROR */, error: String(err) });
|
|
96945
|
-
});
|
|
96946
|
-
});
|
|
96947
|
-
}
|
|
96948
|
-
async authenticateInvitation(request) {
|
|
96949
|
-
var _a;
|
|
96950
|
-
(0, import_node_assert3.default)(request.processId, "Process ID is missing.");
|
|
96951
|
-
const invitation = this.inviteeInvitations.get(request.processId);
|
|
96952
|
-
(0, import_node_assert3.default)(invitation, "Invitation not found.");
|
|
96953
|
-
(0, import_node_assert3.default)(request.secret, "Secret not provided.");
|
|
96954
|
-
invitation.secret = request.secret;
|
|
96955
|
-
(_a = invitation.secretTrigger) == null ? void 0 : _a.call(invitation);
|
|
96956
|
-
}
|
|
96957
|
-
};
|
|
96958
|
-
var createProfileService = ({ echo }) => new ProfileService(echo);
|
|
96959
|
-
|
|
96960
|
-
// src/services/impl/system.ts
|
|
96961
|
-
var createSystemService = ({ config, echo }) => ({
|
|
96962
|
-
getConfig: async () => config.values,
|
|
96963
|
-
reset: async () => {
|
|
96964
|
-
await echo.reset();
|
|
96965
|
-
}
|
|
96966
|
-
});
|
|
96967
|
-
|
|
96968
|
-
// src/services/impl/services.ts
|
|
96969
|
-
var createServices = (opts) => ({
|
|
96970
|
-
SystemService: createSystemService(opts),
|
|
96971
|
-
ProfileService: createProfileService(opts),
|
|
96972
|
-
HaloService: createHaloService(opts),
|
|
96973
|
-
PartyService: createPartyService(opts),
|
|
96974
|
-
DataService: opts.echo.dataService,
|
|
96975
|
-
TracingService: {
|
|
96976
|
-
setTracingOptions: () => {
|
|
96977
|
-
throw new Error("Tracing not available.");
|
|
96978
|
-
},
|
|
96979
|
-
subscribeToRpcTrace: () => {
|
|
96980
|
-
throw new Error("Tracing not available.");
|
|
96981
|
-
}
|
|
96982
|
-
}
|
|
96983
|
-
});
|
|
96984
|
-
|
|
96985
|
-
// src/services/client-service.ts
|
|
96986
|
-
var import_echo_protocol = __toESM(require_src7());
|
|
96987
|
-
var import_rpc = require("@dxos/rpc");
|
|
96988
|
-
|
|
96989
|
-
// src/proto/gen/index.ts
|
|
96560
|
+
// src/packlets/proto/gen/index.ts
|
|
96990
96561
|
var gen_exports = {};
|
|
96991
96562
|
__export(gen_exports, {
|
|
96992
96563
|
schema: () => schema,
|
|
96993
96564
|
schemaJson: () => schemaJson
|
|
96994
96565
|
});
|
|
96995
|
-
var
|
|
96566
|
+
var import_codec_protobuf2 = require("@dxos/codec-protobuf");
|
|
96996
96567
|
|
|
96997
|
-
// src/proto/substitutions.ts
|
|
96998
|
-
var
|
|
96999
|
-
var
|
|
96568
|
+
// src/packlets/proto/substitutions.ts
|
|
96569
|
+
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
96570
|
+
var import_credentials = __toESM(require_src5());
|
|
97000
96571
|
var import_protocols = require("@dxos/protocols");
|
|
97001
96572
|
var substitutions_default = {
|
|
97002
|
-
...
|
|
96573
|
+
...import_codec_protobuf.timestampSubstitutions,
|
|
97003
96574
|
...import_protocols.publicKeySubstitutions,
|
|
97004
96575
|
...import_protocols.timeframeSubstitutions,
|
|
97005
|
-
...
|
|
96576
|
+
...import_codec_protobuf.anySubstitutions,
|
|
97006
96577
|
"dxos.echo.feed.CredentialsMessage": {
|
|
97007
|
-
encode: (msg) => ({ data:
|
|
97008
|
-
decode: (msg) =>
|
|
96578
|
+
encode: (msg) => ({ data: import_credentials.codec.encode(msg) }),
|
|
96579
|
+
decode: (msg) => import_credentials.codec.decode(msg.data)
|
|
97009
96580
|
},
|
|
97010
96581
|
"dxos.devtools.SubscribeToSwarmInfoResponse.SwarmInfo.ConnectionInfo.Json": {
|
|
97011
96582
|
encode: (value) => ({ data: JSON.stringify(value) }),
|
|
@@ -97013,11 +96584,82 @@ var substitutions_default = {
|
|
|
97013
96584
|
}
|
|
97014
96585
|
};
|
|
97015
96586
|
|
|
97016
|
-
// src/proto/gen/index.ts
|
|
96587
|
+
// src/packlets/proto/gen/index.ts
|
|
97017
96588
|
var schemaJson = JSON.parse('{"nested":{"dxos":{"nested":{"client":{"nested":{"AddKeyRecordRequest":{"fields":{"keyRecord":{"type":"KeyRecord","id":1,"comment":null}},"comment":null},"AuthenticateInvitationRequest":{"fields":{"processId":{"type":"string","id":1,"comment":"Id from corresponding RedeemedInvitation."},"secret":{"type":"bytes","id":2,"comment":null}},"comment":null},"Contact":{"oneofs":{"_displayName":{"oneof":["displayName"]}},"fields":{"publicKey":{"type":"dxos.halo.keys.PubKey","id":1,"comment":null},"displayName":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Contacts":{"fields":{"contacts":{"rule":"repeated","type":"Contact","id":1,"comment":null}},"comment":null},"CreateInvitationRequest":{"oneofs":{"_inviteeKey":{"oneof":["inviteeKey"]}},"fields":{"partyKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"inviteeKey":{"type":"dxos.halo.keys.PubKey","id":2,"options":{"proto3_optional":true},"comment":"When specified the invitation will be of OFFLINE type, not requiring secret exchange."}},"comment":null},"CreateProfileRequest":{"oneofs":{"_username":{"oneof":["username"]},"_publicKey":{"oneof":["publicKey"]},"_secretKey":{"oneof":["secretKey"]}},"fields":{"username":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"publicKey":{"type":"bytes","id":2,"options":{"proto3_optional":true},"comment":null},"secretKey":{"type":"bytes","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"CreateSnaspotRequest":{"fields":{"partyKey":{"type":"dxos.halo.keys.PubKey","id":1,"comment":null}},"comment":null},"GetPartyDetailsRequest":{"fields":{"partyKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null}},"comment":null},"GetPreferenceRequest":{"fields":{"key":{"type":"string","id":1,"comment":null}},"comment":null},"GetPreferenceResponse":{"fields":{"value":{"type":"string","id":1,"comment":null}},"comment":null},"HaloService":{"methods":{"Sign":{"requestType":"SignRequest","responseType":"SignResponse","comment":null},"AddKeyRecord":{"requestType":"AddKeyRecordRequest","responseType":"google.protobuf.Empty","comment":null},"SubscribeContacts":{"requestType":"google.protobuf.Empty","responseType":"Contacts","responseStream":true,"comment":null},"SetGlobalPreference":{"requestType":"SetPreferenceRequest","responseType":"google.protobuf.Empty","comment":null},"GetGlobalPreference":{"requestType":"GetPreferenceRequest","responseType":"GetPreferenceResponse","comment":null},"SetDevicePreference":{"requestType":"SetPreferenceRequest","responseType":"google.protobuf.Empty","comment":null},"GetDevicePreference":{"requestType":"GetPreferenceRequest","responseType":"GetPreferenceResponse","comment":null}},"comment":null},"InvitationRequest":{"oneofs":{"_descriptor":{"oneof":["descriptor"]},"_error":{"oneof":["error"]}},"fields":{"descriptor":{"type":"InvitationDescriptor","id":1,"options":{"proto3_optional":true},"comment":null},"state":{"type":"InvitationState","id":2,"comment":null},"error":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":"Only if state == ERROR."}},"comment":"Invitation process created by sender."},"InvitationState":{"values":{"WAITING_FOR_CONNECTION":1,"CONNECTED":2,"SUCCESS":3,"ERROR":4},"comment":null,"comments":{"WAITING_FOR_CONNECTION":null,"CONNECTED":null,"SUCCESS":null,"ERROR":null}},"Party":{"fields":{"publicKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"isOpen":{"rule":"required","type":"bool","id":2,"comment":null},"isActive":{"rule":"required","type":"bool","id":3,"comment":null},"members":{"rule":"repeated","type":"Member","id":4,"comment":null}},"nested":{"Member":{"oneofs":{"_displayName":{"oneof":["displayName"]}},"fields":{"publicKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"displayName":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"PartyActivationOptions":{"fields":{"global":{"type":"bool","id":1,"comment":null},"device":{"type":"bool","id":2,"comment":null}},"comment":null},"PartyDetails":{"fields":{"processedTimeframe":{"rule":"required","type":"dxos.echo.timeframe.TimeframeVector","id":1,"comment":"The timeframe of mutations processed by the client."}},"comment":null},"PartyService":{"methods":{"SubscribeToParty":{"requestType":"SubscribePartyRequest","responseType":"SubscribePartyResponse","responseStream":true,"comment":null},"SubscribeParties":{"requestType":"google.protobuf.Empty","responseType":"SubscribePartiesResponse","responseStream":true,"comment":null},"GetPartyDetails":{"requestType":"GetPartyDetailsRequest","responseType":"PartyDetails","comment":null},"CreateParty":{"requestType":"google.protobuf.Empty","responseType":"Party","comment":null},"CloneParty":{"requestType":"PartySnapshot","responseType":"Party","comment":null},"SetPartyState":{"requestType":"SetPartyStateRequest","responseType":"Party","comment":"Open and close or activate and deactivate a party."},"CreateInvitation":{"requestType":"CreateInvitationRequest","responseType":"InvitationRequest","responseStream":true,"comment":null},"AcceptInvitation":{"requestType":"InvitationDescriptor","responseType":"RedeemedInvitation","responseStream":true,"comment":null},"AuthenticateInvitation":{"requestType":"AuthenticateInvitationRequest","responseType":"google.protobuf.Empty","comment":null},"SubscribeMembers":{"requestType":"SubscribeMembersRequest","responseType":"SubscribeMembersResponse","responseStream":true,"comment":null},"CreateSnapshot":{"requestType":"CreateSnaspotRequest","responseType":"PartySnapshot","comment":null}},"comment":null},"Profile":{"oneofs":{"_username":{"oneof":["username"]}},"fields":{"publicKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"username":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null},"ProfileService":{"methods":{"SubscribeProfile":{"requestType":"google.protobuf.Empty","responseType":"SubscribeProfileResponse","responseStream":true,"comment":null},"CreateProfile":{"requestType":"CreateProfileRequest","responseType":"Profile","comment":null},"RecoverProfile":{"requestType":"RecoverProfileRequest","responseType":"Profile","comment":null},"CreateInvitation":{"requestType":"google.protobuf.Empty","responseType":"InvitationRequest","responseStream":true,"comment":null},"AcceptInvitation":{"requestType":"InvitationDescriptor","responseType":"RedeemedInvitation","responseStream":true,"comment":null},"AuthenticateInvitation":{"requestType":"AuthenticateInvitationRequest","responseType":"google.protobuf.Empty","comment":null}},"comment":null},"RecoverProfileRequest":{"fields":{"seedPhrase":{"type":"string","id":1,"comment":null}},"comment":null},"RedeemedInvitation":{"oneofs":{"_error":{"oneof":["error"]},"_partyKey":{"oneof":["partyKey"]}},"fields":{"id":{"type":"string","id":1,"comment":null},"state":{"type":"InvitationState","id":2,"comment":null},"error":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":"Only if state == ERROR."},"partyKey":{"type":"dxos.halo.keys.PubKey","id":4,"options":{"proto3_optional":true},"comment":"Only on party invitations that are finished."}},"comment":"Invitation that is being redeemed."},"SetPartyStateRequest":{"oneofs":{"_open":{"oneof":["open"]},"_activeGlobal":{"oneof":["activeGlobal"]},"_activeDevice":{"oneof":["activeDevice"]}},"fields":{"partyKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"open":{"type":"bool","id":2,"options":{"proto3_optional":true},"comment":null},"activeGlobal":{"type":"bool","id":3,"options":{"proto3_optional":true},"comment":null},"activeDevice":{"type":"bool","id":4,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SetPreferenceRequest":{"fields":{"key":{"type":"string","id":1,"comment":null},"value":{"type":"string","id":2,"comment":null}},"comment":null},"SignRequest":{"fields":{"publicKey":{"type":"PubKey","id":1,"comment":"- The public key of the key that is supposed to be used for signing."},"payload":{"type":"bytes","id":2,"comment":null}},"comment":null},"SignResponse":{"fields":{"signed":{"type":"bytes","id":2,"comment":null}},"comment":null},"SubscribeMembersRequest":{"fields":{"partyKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null}},"comment":null},"SubscribeMembersResponse":{"fields":{"members":{"rule":"repeated","type":"PartyMember","id":1,"comment":null}},"nested":{"PartyMember":{"oneofs":{"_displayName":{"oneof":["displayName"]}},"fields":{"publicKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"displayName":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"SubscribePartiesResponse":{"fields":{"parties":{"rule":"repeated","type":"Party","id":1,"comment":null}},"comment":null},"SubscribePartyRequest":{"fields":{"partyKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null}},"comment":null},"SubscribePartyResponse":{"oneofs":{"_party":{"oneof":["party"]}},"fields":{"party":{"type":"Party","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SubscribeProfileResponse":{"oneofs":{"_profile":{"oneof":["profile"]}},"fields":{"profile":{"type":"Profile","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SystemService":{"methods":{"GetConfig":{"requestType":"google.protobuf.Empty","responseType":"Config","comment":null},"Reset":{"requestType":"google.protobuf.Empty","responseType":"google.protobuf.Empty","comment":null}},"comment":null}}},"config":{"nested":{"Config":{"oneofs":{"_version":{"oneof":["version"]},"_package":{"oneof":["package"]},"_runtime":{"oneof":["runtime"]}},"fields":{"version":{"type":"int32","id":1,"options":{"proto3_optional":true},"comment":null},"package":{"type":"Package","id":2,"options":{"proto3_optional":true},"comment":null},"runtime":{"type":"Runtime","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Module":{"oneofs":{"_name":{"oneof":["name"]},"_type":{"oneof":["type"]},"_displayName":{"oneof":["displayName"]},"_description":{"oneof":["description"]},"_build":{"oneof":["build"]},"_record":{"oneof":["record"]}},"fields":{"name":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"type":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"displayName":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"description":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null},"tags":{"rule":"repeated","type":"string","id":5,"comment":null},"build":{"type":"Build","id":100,"options":{"proto3_optional":true},"comment":null},"repos":{"rule":"repeated","type":"Repo","id":101,"comment":null},"record":{"type":"google.protobuf.Any","id":200,"options":{"proto3_optional":true},"comment":"The data will be validated based on the type when being published."}},"nested":{"Build":{"oneofs":{"_command":{"oneof":["command"]},"_outdir":{"oneof":["outdir"]},"_version":{"oneof":["version"]},"_tag":{"oneof":["tag"]}},"fields":{"command":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"outdir":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"version":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"tag":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"Package":{"oneofs":{"_license":{"oneof":["license"]}},"fields":{"license":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"repos":{"rule":"repeated","type":"Repo","id":2,"comment":null},"modules":{"rule":"repeated","type":"Module","id":3,"comment":null}},"comment":null},"Repo":{"oneofs":{"_name":{"oneof":["name"]},"_url":{"oneof":["url"]},"_version":{"oneof":["version"]}},"fields":{"name":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"url":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"version":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Runtime":{"oneofs":{"_client":{"oneof":["client"]},"_app":{"oneof":["app"]},"_cli":{"oneof":["cli"]},"_props":{"oneof":["props"]},"_services":{"oneof":["services"]},"_system":{"oneof":["system"]}},"fields":{"client":{"type":"Client","id":1,"options":{"proto3_optional":true},"comment":null},"app":{"type":"App","id":2,"options":{"proto3_optional":true},"comment":null},"cli":{"type":"CLI","id":3,"options":{"proto3_optional":true},"comment":null},"props":{"type":"Props","id":4,"options":{"proto3_optional":true},"comment":null},"services":{"type":"Services","id":5,"options":{"proto3_optional":true},"comment":null},"system":{"type":"System","id":6,"options":{"proto3_optional":true},"comment":null}},"nested":{"App":{"oneofs":{"_org":{"oneof":["org"]},"_theme":{"oneof":["theme"]},"_website":{"oneof":["website"]},"_publicUrl":{"oneof":["publicUrl"]}},"fields":{"org":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"theme":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"website":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"publicUrl":{"type":"string","id":4,"options":{"(env)":"PUBLIC_URL","proto3_optional":true},"comment":null}},"comment":null},"CLI":{"oneofs":{"_nodePath":{"oneof":["nodePath"]},"_app":{"oneof":["app"]},"_console":{"oneof":["console"]},"_mdns":{"oneof":["mdns"]},"_signal":{"oneof":["signal"]},"_npmClient":{"oneof":["npmClient"]},"_channel":{"oneof":["channel"]}},"fields":{"nodePath":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"app":{"type":"AppServe","id":2,"options":{"proto3_optional":true},"comment":null},"console":{"type":"Package","id":3,"options":{"proto3_optional":true},"comment":null},"mdns":{"type":"Package","id":4,"options":{"proto3_optional":true},"comment":null},"signal":{"type":"Package","id":5,"options":{"proto3_optional":true},"comment":null},"npmClient":{"type":"string","id":6,"options":{"proto3_optional":true},"comment":null},"channel":{"type":"string","id":7,"options":{"proto3_optional":true},"comment":null}},"nested":{"AppServe":{"oneofs":{"_serve":{"oneof":["serve"]}},"fields":{"serve":{"type":"Serve","id":1,"options":{"proto3_optional":true},"comment":null}},"nested":{"Serve":{"oneofs":{"_config":{"oneof":["config"]},"_loginApp":{"oneof":["loginApp"]},"_keyPhrase":{"oneof":["keyPhrase"]}},"fields":{"config":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"loginApp":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"keyPhrase":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"Package":{"oneofs":{"_package":{"oneof":["package"]},"_channel":{"oneof":["channel"]},"_bin":{"oneof":["bin"]},"_config":{"oneof":["config"]}},"fields":{"package":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"channel":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"bin":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"config":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"Client":{"oneofs":{"_debug":{"oneof":["debug"]},"_storage":{"oneof":["storage"]},"_enableSnapshots":{"oneof":["enableSnapshots"]},"_snapshotInterval":{"oneof":["snapshotInterval"]},"_invitationExpiration":{"oneof":["invitationExpiration"]},"_mode":{"oneof":["mode"]}},"fields":{"debug":{"type":"string","id":1,"options":{"(env)":"DEBUG","proto3_optional":true},"comment":null},"storage":{"type":"Storage","id":2,"options":{"proto3_optional":true},"comment":null},"enableSnapshots":{"type":"bool","id":3,"options":{"proto3_optional":true},"comment":null},"snapshotInterval":{"type":"int32","id":4,"options":{"proto3_optional":true},"comment":"Milliseconds"},"invitationExpiration":{"type":"int32","id":5,"options":{"proto3_optional":true},"comment":"Milliseconds"},"mode":{"type":"Mode","id":6,"options":{"proto3_optional":true},"comment":null}},"nested":{"Mode":{"values":{"AUTOMATIC":0,"LOCAL":1,"REMOTE":2},"comment":"Whether the client services are local with ClientServiceHost or remote and need to be accessed via ClientServiceProxy. Defaults to AUTOMATIC.","comments":{"AUTOMATIC":"Connects to the browser wallet if avialable, otherwise runs services in the local mode.","LOCAL":"Run services in the local mode.","REMOTE":"Connect to the browser wallet or to the remote services through the RPC port."}},"Storage":{"oneofs":{"_persistent":{"oneof":["persistent"]},"_storageType":{"oneof":["storageType"]},"_keyStorage":{"oneof":["keyStorage"]},"_path":{"oneof":["path"]}},"fields":{"persistent":{"type":"bool","id":1,"options":{"proto3_optional":true},"comment":null},"storageType":{"type":"StorageDriver","id":2,"options":{"proto3_optional":true},"comment":null},"keyStorage":{"type":"StorageDriver","id":3,"options":{"proto3_optional":true},"comment":null},"path":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null}},"nested":{"StorageDriver":{"values":{"RAM":0,"IDB":1,"CHROME":2,"FIREFOX":3,"NODE":4,"LEVELJS":11,"JSONDOWN":12},"comment":null,"comments":{"RAM":null,"IDB":null,"CHROME":null,"FIREFOX":null,"NODE":null,"LEVELJS":null,"JSONDOWN":null}}},"comment":null}},"comment":null},"Props":{"oneofs":{"_title":{"oneof":["title"]}},"fields":{"title":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Services":{"oneofs":{"_kube":{"oneof":["kube"]},"_app":{"oneof":["app"]},"_dxns":{"oneof":["dxns"]},"_ipfs":{"oneof":["ipfs"]},"_signal":{"oneof":["signal"]},"_machine":{"oneof":["machine"]},"_bot":{"oneof":["bot"]}},"fields":{"kube":{"type":"Kube","id":1,"options":{"proto3_optional":true},"comment":null},"app":{"type":"AppServer","id":2,"options":{"proto3_optional":true},"comment":null},"dxns":{"type":"Dxns","id":3,"options":{"proto3_optional":true},"comment":null},"ipfs":{"type":"Ipfs","id":4,"options":{"proto3_optional":true},"comment":null},"signal":{"type":"Signal","id":5,"options":{"proto3_optional":true},"comment":null},"ice":{"rule":"repeated","type":"Ice","id":6,"comment":null},"machine":{"type":"Machine","id":7,"options":{"proto3_optional":true},"comment":null},"bot":{"type":"BotFactory","id":8,"options":{"proto3_optional":true},"comment":null}},"nested":{"AppServer":{"oneofs":{"_prefix":{"oneof":["prefix"]},"_server":{"oneof":["server"]}},"fields":{"prefix":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"server":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null},"BotFactory":{"oneofs":{"_topic":{"oneof":["topic"]},"_persistent":{"oneof":["persistent"]},"_retryAttempts":{"oneof":["retryAttempts"]},"_retryInterval":{"oneof":["retryInterval"]}},"fields":{"topic":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"persistent":{"type":"bool","id":2,"options":{"proto3_optional":true},"comment":null},"retryAttempts":{"type":"int32","id":3,"options":{"proto3_optional":true},"comment":null},"retryInterval":{"type":"int32","id":4,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Dxns":{"oneofs":{"_server":{"oneof":["server"]},"_accountUri":{"oneof":["accountUri"]},"_address":{"oneof":["address"]},"_account":{"oneof":["account"]},"_faucet":{"oneof":["faucet"]}},"fields":{"server":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":"DXNS endpoint."},"accountUri":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":"Substrate account URI. This is a secret.\\nKUBEs do not serve this with the config but we store it in profile.yml.\\n\\nTODO(dmaretskyi): Deprecate this and move it to keyring."},"address":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":"Public Polkadot Address."},"account":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":"Public address of a DXNS Account."},"faucet":{"type":"string","id":5,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Ice":{"oneofs":{"_urls":{"oneof":["urls"]},"_username":{"oneof":["username"]},"_credential":{"oneof":["credential"]}},"fields":{"urls":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"username":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"credential":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Ipfs":{"oneofs":{"_server":{"oneof":["server"]},"_gateway":{"oneof":["gateway"]}},"fields":{"server":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"gateway":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Kube":{"oneofs":{"_endpoints":{"oneof":["endpoints"]},"_publicUrl":{"oneof":["publicUrl"]}},"fields":{"endpoints":{"type":"Endpoints","id":1,"options":{"proto3_optional":true},"comment":null},"publicUrl":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"nested":{"Endpoints":{"oneofs":{"_logs":{"oneof":["logs"]},"_services":{"oneof":["services"]},"_cert":{"oneof":["cert"]}},"fields":{"logs":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"services":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"cert":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"Machine":{"oneofs":{"_doAccessToken":{"oneof":["doAccessToken"]},"_githubAccessToken":{"oneof":["githubAccessToken"]},"_githubUsername":{"oneof":["githubUsername"]},"_dnsDomain":{"oneof":["dnsDomain"]},"_npmAccessToken":{"oneof":["npmAccessToken"]}},"fields":{"doAccessToken":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"githubAccessToken":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"githubUsername":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"dnsDomain":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null},"npmAccessToken":{"type":"string","id":5,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Signal":{"oneofs":{"_server":{"oneof":["server"]},"_api":{"oneof":["api"]},"_status":{"oneof":["status"]}},"fields":{"server":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"api":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"status":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"System":{"oneofs":{"_debug":{"oneof":["debug"]}},"fields":{"debug":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null}}},"credentials":{"nested":{"Message":{"fields":{"payload":{"rule":"required","type":"google.protobuf.Any","id":1,"comment":null}},"comment":null},"SignedMessage":{"fields":{"signed":{"rule":"required","type":"Signed","id":1,"comment":"The signed message contents."},"signatures":{"rule":"repeated","type":"Signature","id":2,"comment":"An array of Signatures, one for each key that signed the message."}},"nested":{"Signature":{"oneofs":{"_keyChain":{"oneof":["keyChain"]}},"fields":{"key":{"rule":"required","type":"PubKey","id":1,"comment":"The publicKey of the keypair that made this signature."},"signature":{"rule":"required","type":"bytes","id":2,"comment":"The bytes of the signature."},"keyChain":{"type":"KeyChain","id":3,"options":{"proto3_optional":true},"comment":"The certification chain of SignedMessages for this key."}},"comment":null},"Signed":{"fields":{"created":{"rule":"required","type":"string","id":1,"comment":"RFC-3339 datetime string."},"nonce":{"rule":"required","type":"bytes","id":2,"comment":null},"payload":{"rule":"required","type":"google.protobuf.Any","id":10,"comment":"The payload to be signed."}},"comment":null}},"comment":"A generic container message used whenever messages are signed (e.g. PartyCredential)"}}},"devtools":{"nested":{"ClearSnapshotsRequest":{"fields":{},"comment":null},"DevtoolsHost":{"methods":{"Events":{"requestType":"google.protobuf.Empty","responseType":"Event","responseStream":true,"comment":null},"GetConfig":{"requestType":"google.protobuf.Empty","responseType":"GetConfigResponse","comment":null},"ResetStorage":{"requestType":"ResetStorageRequest","responseType":"google.protobuf.Empty","comment":null},"EnableDebugLogging":{"requestType":"EnableDebugLoggingRequest","responseType":"EnableDebugLoggingResponse","comment":null},"DisableDebugLogging":{"requestType":"EnableDebugLoggingRequest","responseType":"EnableDebugLoggingResponse","comment":null},"SubscribeToKeyringKeys":{"requestType":"SubscribeToKeyringKeysRequest","responseType":"SubscribeToKeyringKeysResponse","responseStream":true,"comment":null},"SubscribeToCredentialMessages":{"requestType":"SubscribeToCredentialMessagesRequest","responseType":"SubscribeToCredentialMessagesResponse","responseStream":true,"comment":null},"SubscribeToParties":{"requestType":"SubscribeToPartiesRequest","responseType":"SubscribeToPartiesResponse","responseStream":true,"comment":null},"SubscribeToItems":{"requestType":"SubscribeToItemsRequest","responseType":"SubscribeToItemsResponse","responseStream":true,"comment":null},"SubscribeToFeeds":{"requestType":"SubscribeToFeedsRequest","responseType":"SubscribeToFeedsResponse","responseStream":true,"comment":null},"SubscribeToFeedBlocks":{"requestType":"SubscribeToFeedBlocksRequest","responseType":"SubscribeToFeedBlocksResponse","responseStream":true,"comment":null},"GetPartySnapshot":{"requestType":"GetPartySnapshotRequest","responseType":"GetPartySnapshotResponse","comment":null},"SavePartySnapshot":{"requestType":"SavePartySnapshotRequest","responseType":"SavePartySnapshotResponse","comment":null},"ClearSnapshots":{"requestType":"ClearSnapshotsRequest","responseType":"google.protobuf.Empty","comment":null},"GetNetworkPeers":{"requestType":"GetNetworkPeersRequest","responseType":"GetNetworkPeersResponse","comment":null},"SubscribeToNetworkTopics":{"requestType":"google.protobuf.Empty","responseType":"SubscribeToNetworkTopicsResponse","responseStream":true,"comment":null},"SubscribeToSignalStatus":{"requestType":"google.protobuf.Empty","responseType":"SubscribeToSignalStatusResponse","responseStream":true,"comment":null},"SubscribeToSignalTrace":{"requestType":"google.protobuf.Empty","responseType":"SubscribeToSignalTraceResponse","responseStream":true,"comment":null},"SubscribeToSwarmInfo":{"requestType":"SubscribeToSwarmInfoRequest","responseType":"SubscribeToSwarmInfoResponse","responseStream":true,"comment":null}},"comment":null},"DisableDebugLoggingRequest":{"oneofs":{"_namespaces":{"oneof":["namespaces"]}},"fields":{"namespaces":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"DisableDebugLoggingResponse":{"oneofs":{"_enabledNamespaces":{"oneof":["enabledNamespaces"]}},"fields":{"enabledNamespaces":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"EnableDebugLoggingRequest":{"oneofs":{"_namespaces":{"oneof":["namespaces"]}},"fields":{"namespaces":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"EnableDebugLoggingResponse":{"oneofs":{"_enabledNamespaces":{"oneof":["enabledNamespaces"]}},"fields":{"enabledNamespaces":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"Event":{"oneofs":{"payload":{"oneof":["ready"],"comment":null}},"fields":{"ready":{"type":"ReadyEvent","id":1,"comment":null}},"comment":null},"GetConfigResponse":{"fields":{"config":{"type":"string","id":1,"comment":null}},"comment":null},"GetNetworkPeersRequest":{"fields":{"topic":{"type":"bytes","id":1,"comment":null}},"comment":null},"GetNetworkPeersResponse":{"fields":{"peers":{"rule":"repeated","type":"PeerInfo","id":1,"comment":null}},"nested":{"PeerInfo":{"fields":{"id":{"type":"PubKey","id":1,"comment":null},"state":{"type":"string","id":2,"comment":null},"connections":{"rule":"repeated","type":"bytes","id":3,"comment":null}},"comment":null}},"comment":null},"GetPartySnapshotRequest":{"fields":{"partyKey":{"rule":"required","type":"PubKey","id":1,"comment":null}},"comment":null},"GetPartySnapshotResponse":{"oneofs":{"_snapshot":{"oneof":["snapshot"]}},"fields":{"snapshot":{"type":"PartySnapshot","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"ReadyEvent":{"fields":{},"comment":null},"ResetStorageRequest":{"fields":{},"comment":null},"SavePartySnapshotRequest":{"fields":{"partyKey":{"rule":"required","type":"PubKey","id":1,"comment":null}},"comment":null},"SavePartySnapshotResponse":{"oneofs":{"_snapshot":{"oneof":["snapshot"]}},"fields":{"snapshot":{"type":"PartySnapshot","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SetTracingOptionsRequest":{"fields":{"enable":{"type":"bool","id":1,"comment":null}},"comment":null},"SubscribeToCredentialMessagesRequest":{"oneofs":{"_partyKey":{"oneof":["partyKey"]}},"fields":{"partyKey":{"type":"PubKey","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SubscribeToCredentialMessagesResponse":{"fields":{"messages":{"rule":"repeated","type":"SignedMessage","id":1,"comment":null}},"comment":null},"SubscribeToFeedBlocksRequest":{"oneofs":{"_partyKey":{"oneof":["partyKey"]},"_feedKey":{"oneof":["feedKey"]},"_maxBlocks":{"oneof":["maxBlocks"]}},"fields":{"partyKey":{"type":"PubKey","id":1,"options":{"proto3_optional":true},"comment":null},"feedKey":{"type":"PubKey","id":2,"options":{"proto3_optional":true},"comment":null},"maxBlocks":{"type":"int32","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"SubscribeToFeedBlocksResponse":{"fields":{"blocks":{"rule":"repeated","type":"Block","id":1,"comment":null}},"nested":{"Block":{"fields":{"key":{"type":"bytes","id":1,"comment":null},"seq":{"type":"int32","id":2,"comment":null},"sync":{"type":"bool","id":3,"comment":null},"path":{"type":"string","id":4,"comment":null},"data":{"type":"FeedMessage","id":5,"comment":null}},"comment":null}},"comment":null},"SubscribeToFeedsRequest":{"fields":{"partyKey":{"type":"PubKey","id":1,"comment":null},"feedKeys":{"rule":"repeated","type":"PubKey","id":2,"comment":null}},"comment":null},"SubscribeToFeedsResponse":{"fields":{"feeds":{"rule":"repeated","type":"Feed","id":1,"comment":null}},"nested":{"Feed":{"fields":{"feedKey":{"type":"PubKey","id":1,"comment":null},"length":{"type":"int32","id":2,"comment":null}},"comment":null}},"comment":null},"SubscribeToItemsRequest":{"fields":{},"comment":null},"SubscribeToItemsResponse":{"fields":{"data":{"type":"string","id":1,"comment":null}},"comment":null},"SubscribeToKeyringKeysRequest":{"fields":{},"comment":null},"SubscribeToKeyringKeysResponse":{"fields":{"keys":{"rule":"repeated","type":"KeyRecord","id":1,"comment":null}},"comment":null},"SubscribeToNetworkTopicsResponse":{"fields":{"topics":{"rule":"repeated","type":"Topic","id":1,"comment":null}},"nested":{"Topic":{"oneofs":{"_label":{"oneof":["label"]}},"fields":{"topic":{"type":"PubKey","id":1,"comment":null},"label":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null},"SubscribeToPartiesRequest":{"fields":{"partyKeys":{"rule":"repeated","type":"PubKey","id":1,"comment":null}},"comment":null},"SubscribeToPartiesResponse":{"fields":{"parties":{"rule":"repeated","type":"PartyInfo","id":1,"comment":null}},"nested":{"PartyInfo":{"fields":{"key":{"type":"PubKey","id":1,"comment":null},"isOpen":{"type":"bool","id":2,"comment":null},"isActive":{"type":"bool","id":3,"comment":null},"timeframe":{"type":"TimeframeVector","id":4,"comment":null},"feeds":{"rule":"repeated","type":"PubKey","id":5,"comment":null},"properties":{"keyType":"string","type":"string","id":6,"comment":null}},"comment":null}},"comment":null},"SubscribeToSignalStatusResponse":{"fields":{"servers":{"rule":"repeated","type":"SignalServer","id":1,"comment":null}},"nested":{"SignalServer":{"oneofs":{"_error":{"oneof":["error"]}},"fields":{"host":{"type":"string","id":1,"comment":null},"state":{"type":"string","id":2,"comment":null},"error":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"reconnectIn":{"type":"int32","id":4,"comment":null},"connectionStarted":{"type":"int32","id":5,"comment":null},"lastStateChange":{"type":"int32","id":6,"comment":null}},"comment":null}},"comment":null},"SubscribeToSignalTraceResponse":{"fields":{"events":{"rule":"repeated","type":"string","id":1,"comment":null}},"comment":null},"SubscribeToSwarmInfoRequest":{"fields":{},"comment":null},"SubscribeToSwarmInfoResponse":{"fields":{"data":{"rule":"repeated","type":"SwarmInfo","id":1,"comment":null}},"nested":{"SwarmInfo":{"oneofs":{"_label":{"oneof":["label"]}},"fields":{"id":{"type":"PubKey","id":1,"comment":null},"topic":{"type":"PubKey","id":2,"comment":null},"label":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"isActive":{"type":"bool","id":4,"comment":null},"connections":{"rule":"repeated","type":"ConnectionInfo","id":5,"comment":null}},"nested":{"ConnectionInfo":{"oneofs":{"_transport":{"oneof":["transport"]}},"fields":{"state":{"type":"string","id":1,"comment":null},"sessionId":{"type":"PubKey","id":2,"comment":null},"remotePeerId":{"type":"PubKey","id":3,"comment":null},"transport":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null},"protocolExtensions":{"rule":"repeated","type":"string","id":5,"comment":null},"events":{"rule":"repeated","type":"Json","id":6,"comment":null}},"nested":{"Json":{"oneofs":{"_data":{"oneof":["data"]}},"fields":{"data":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null}},"comment":null}},"comment":null}},"comment":null}},"comment":null},"TracingService":{"methods":{"SetTracingOptions":{"requestType":"SetTracingOptionsRequest","responseType":"google.protobuf.Empty","comment":null},"SubscribeToRpcTrace":{"requestType":"google.protobuf.Empty","responseType":"RpcMessage","responseStream":true,"comment":null}},"comment":null}}},"echo":{"nested":{"feed":{"nested":{"CredentialsMessage":{"fields":{"data":{"type":"bytes","id":1,"comment":null}},"comment":"A container for dxos.credentials.Message"},"EchoEnvelope":{"oneofs":{"_genesis":{"oneof":["genesis"]},"_itemMutation":{"oneof":["itemMutation"]},"_mutation":{"oneof":["mutation"]},"_snapshot":{"oneof":["snapshot"]}},"fields":{"itemId":{"type":"string","id":1,"comment":null},"genesis":{"type":"ItemGenesis","id":10,"options":{"proto3_optional":true},"comment":null},"itemMutation":{"type":"ItemMutation","id":11,"options":{"proto3_optional":true},"comment":null},"mutation":{"type":"bytes","id":12,"options":{"proto3_optional":true},"comment":null},"snapshot":{"type":"ModelSnapshot","id":13,"options":{"proto3_optional":true},"comment":"Set the model to the provided snapshot."}},"comment":"Wrapper for all ECHO messages."},"FeedMessage":{"oneofs":{"payload":{"oneof":["halo","echo"],"comment":null}},"fields":{"timeframe":{"type":"TimeframeVector","id":1,"comment":null},"halo":{"type":"CredentialsMessage","id":10,"comment":null},"echo":{"type":"EchoEnvelope","id":11,"comment":null}},"comment":"Outer message type decoded by Codec.\\nThis is what is written to the feeds."},"ItemGenesis":{"oneofs":{"_itemType":{"oneof":["itemType"]},"_modelVersion":{"oneof":["modelVersion"]},"_link":{"oneof":["link"]}},"fields":{"itemType":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"modelType":{"type":"string","id":2,"comment":null},"modelVersion":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null},"link":{"type":"LinkData","id":4,"options":{"proto3_optional":true},"comment":null}},"comment":null},"ItemMutation":{"oneofs":{"_parentId":{"oneof":["parentId"]},"_action":{"oneof":["action"]}},"fields":{"parentId":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"action":{"type":"Action","id":2,"options":{"proto3_optional":true},"comment":null}},"nested":{"Action":{"values":{"NOOP":0,"DELETE":1,"RESTORE":2},"comment":null,"comments":{"NOOP":null,"DELETE":null,"RESTORE":null}}},"comment":"Item mutation."},"LinkData":{"fields":{"source":{"type":"string","id":1,"comment":null},"target":{"type":"string","id":2,"comment":null}},"comment":null}}},"invitation":{"nested":{"InvitationDescriptor":{"oneofs":{"_identityKey":{"oneof":["identityKey"]},"_secret":{"oneof":["secret"]}},"fields":{"type":{"type":"Type","id":1,"comment":null},"swarmKey":{"type":"bytes","id":2,"comment":null},"invitation":{"type":"bytes","id":3,"comment":null},"identityKey":{"type":"bytes","id":4,"options":{"proto3_optional":true},"comment":"Only present if type == OFFLINE."},"secret":{"type":"bytes","id":5,"options":{"proto3_optional":true},"comment":"Must be stripped out when passing to another peer."}},"nested":{"Type":{"values":{"INTERACTIVE":1,"OFFLINE":2},"comment":"Defines an invitation type.","comments":{"INTERACTIVE":"Interactive invitation is when both peers are online at the same time.","OFFLINE":"Offline is when only a single peer needs to be online at the time."}}},"comment":null}}},"service":{"nested":{"DataService":{"methods":{"SubscribeEntitySet":{"requestType":"SubscribeEntitySetRequest","responseType":"SubscribeEntitySetResponse","responseStream":true,"comment":null},"SubscribeEntityStream":{"requestType":"SubscribeEntityStreamRequest","responseType":"SubscribeEntityStreamResponse","responseStream":true,"comment":null},"Write":{"requestType":"WriteRequest","responseType":"MutationReceipt","comment":null}},"comment":null},"MutationReceipt":{"fields":{"feedKey":{"type":"PubKey","id":1,"comment":null},"seq":{"type":"int32","id":2,"comment":null}},"comment":null},"SubscribeEntitySetRequest":{"fields":{"partyKey":{"type":"PubKey","id":1,"comment":null}},"comment":null},"SubscribeEntitySetResponse":{"fields":{"added":{"rule":"repeated","type":"EchoEnvelope","id":1,"comment":null},"deleted":{"rule":"repeated","type":"EchoEnvelope","id":2,"comment":null}},"comment":null},"SubscribeEntityStreamRequest":{"fields":{"partyKey":{"type":"PubKey","id":1,"comment":null},"itemId":{"type":"string","id":2,"comment":null}},"comment":null},"SubscribeEntityStreamResponse":{"oneofs":{"kind":{"oneof":["snapshot","mutation"],"comment":null}},"fields":{"snapshot":{"type":"ItemSnapshot","id":1,"comment":null},"mutation":{"type":"Mutation","id":2,"comment":null}},"nested":{"Mutation":{"fields":{"data":{"type":"EchoEnvelope","id":1,"comment":null},"meta":{"type":"Metadata","id":2,"comment":null}},"nested":{"Metadata":{"fields":{"feedKey":{"type":"PubKey","id":1,"comment":null},"memberKey":{"type":"PubKey","id":2,"comment":null},"seq":{"type":"int32","id":3,"comment":null},"timeframe":{"type":"TimeframeVector","id":4,"comment":null}},"comment":null}},"comment":null}},"comment":null},"WriteRequest":{"fields":{"partyKey":{"type":"PubKey","id":1,"comment":null},"mutation":{"type":"EchoEnvelope","id":2,"comment":null}},"comment":null}}},"snapshot":{"nested":{"DatabaseSnapshot":{"fields":{"items":{"rule":"repeated","type":"ItemSnapshot","id":1,"comment":null},"links":{"rule":"repeated","type":"LinkSnapshot","id":2,"comment":null}},"comment":null},"HaloStateSnapshot":{"fields":{"messages":{"rule":"repeated","type":"dxos.CredentialsMessage","id":1,"comment":null}},"comment":null},"ItemSnapshot":{"oneofs":{"_itemId":{"oneof":["itemId"]},"_itemType":{"oneof":["itemType"]},"_modelVersion":{"oneof":["modelVersion"]},"_parentId":{"oneof":["parentId"]},"_model":{"oneof":["model"]}},"fields":{"itemId":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"itemType":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"modelType":{"type":"string","id":3,"comment":null},"modelVersion":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null},"parentId":{"type":"string","id":5,"options":{"proto3_optional":true},"comment":null},"model":{"type":"ModelSnapshot","id":6,"options":{"proto3_optional":true},"comment":null}},"comment":null},"LinkSnapshot":{"oneofs":{"_linkId":{"oneof":["linkId"]},"_linkType":{"oneof":["linkType"]},"_modelVersion":{"oneof":["modelVersion"]},"_model":{"oneof":["model"]}},"fields":{"linkId":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"linkType":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"modelType":{"type":"string","id":3,"comment":null},"modelVersion":{"type":"string","id":4,"options":{"proto3_optional":true},"comment":null},"source":{"rule":"required","type":"string","id":5,"comment":null},"target":{"rule":"required","type":"string","id":6,"comment":null},"model":{"type":"ModelSnapshot","id":7,"options":{"proto3_optional":true},"comment":null}},"comment":null},"ModelMutation":{"fields":{"mutation":{"rule":"required","type":"bytes","id":1,"comment":null},"meta":{"rule":"required","type":"ModelMutationMeta","id":2,"comment":null}},"comment":null},"ModelMutationMeta":{"fields":{"feedKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":1,"comment":null},"seq":{"rule":"required","type":"int32","id":2,"comment":null},"memberKey":{"rule":"required","type":"dxos.halo.keys.PubKey","id":3,"comment":null}},"comment":null},"ModelSnapshot":{"oneofs":{"_snapshot":{"oneof":["snapshot"]}},"fields":{"snapshot":{"type":"bytes","id":1,"options":{"proto3_optional":true},"comment":"Encoded model snapshot (defined by the model\'s codec).\\nIf undefined the state machine will be initialized with it\'s default state."},"mutations":{"rule":"repeated","type":"ModelMutation","id":2,"comment":"Mutations to be applied on top of the snapshot, or on top of initial state if the snapshot is undefined."}},"comment":null},"PartySnapshot":{"oneofs":{"_timeframe":{"oneof":["timeframe"]},"_timestamp":{"oneof":["timestamp"]}},"fields":{"partyKey":{"type":"bytes","id":1,"comment":null},"timeframe":{"type":"TimeframeVector","id":2,"options":{"proto3_optional":true},"comment":null},"timestamp":{"type":"int32","id":3,"options":{"proto3_optional":true},"comment":null},"halo":{"type":"HaloStateSnapshot","id":11,"comment":null},"database":{"type":"DatabaseSnapshot","id":12,"comment":null}},"comment":null}}},"timeframe":{"nested":{"TimeframeVector":{"fields":{"frames":{"rule":"repeated","type":"Frame","id":1,"comment":null}},"nested":{"Frame":{"fields":{"feedKey":{"type":"bytes","id":1,"comment":null},"seq":{"type":"int32","id":3,"comment":null}},"comment":null}},"comment":"Vector timestamp used to order messages."}}}}},"halo":{"nested":{"keys":{"nested":{"KeyChain":{"fields":{"publicKey":{"rule":"required","type":"PubKey","id":1,"comment":null},"message":{"rule":"required","type":"SignedMessage","id":2,"comment":null},"parents":{"rule":"repeated","type":"KeyChain","id":3,"comment":null}},"comment":null},"KeyRecord":{"oneofs":{"_secretKey":{"oneof":["secretKey"]},"_hint":{"oneof":["hint"]},"_own":{"oneof":["own"]},"_trusted":{"oneof":["trusted"]},"_added":{"oneof":["added"]},"_created":{"oneof":["created"]}},"fields":{"type":{"rule":"required","type":"KeyType","id":1,"comment":"The `KeyType` type of the key. This is often unknown for keys from other sources."},"publicKey":{"rule":"required","type":"PubKey","id":2,"comment":"The public key as a Buffer (required)."},"secretKey":{"type":"PrivKey","id":3,"options":{"proto3_optional":true},"comment":"The secret key as a Buffer (this will never be visible outside the Keyring)."},"hint":{"type":"bool","id":4,"options":{"proto3_optional":true},"comment":"Is this key from a Greeting \\"hint\\"?"},"own":{"type":"bool","id":5,"options":{"proto3_optional":true},"comment":"Determines if this is our key?\\nUsually true if `secretKey` is present; may be false for \\"inception keys\\" such as the Party key."},"trusted":{"type":"bool","id":6,"options":{"proto3_optional":true},"comment":"Is this key to be trusted?"},"added":{"type":"string","id":7,"options":{"proto3_optional":true},"comment":"An RFC-3339 date/time string for when the key was added to the Keyring."},"created":{"type":"string","id":8,"options":{"proto3_optional":true},"comment":"An RFC-3339 date/time string for when the key was created."}},"comment":null},"KeyRecordList":{"fields":{"keys":{"rule":"repeated","type":"KeyRecord","id":1,"comment":null}},"comment":null},"KeyType":{"values":{"UNKNOWN":0,"IDENTITY":1,"DEVICE":2,"PARTY":3,"FEED":4,"DXNS_ADDRESS":5},"comment":null,"comments":{"UNKNOWN":null,"IDENTITY":null,"DEVICE":null,"PARTY":null,"FEED":null,"DXNS_ADDRESS":null}},"PrivKey":{"fields":{"data":{"type":"bytes","id":1,"comment":null}},"comment":null},"PubKey":{"fields":{"data":{"type":"bytes","id":1,"comment":null}},"comment":null}}}}},"rpc":{"options":{"go_package":"github.com/dxos/kube/go/dxrpc/pb"},"nested":{"Error":{"oneofs":{"_name":{"oneof":["name"]},"_message":{"oneof":["message"]},"_stack":{"oneof":["stack"]}},"fields":{"name":{"type":"string","id":1,"options":{"proto3_optional":true},"comment":null},"message":{"type":"string","id":2,"options":{"proto3_optional":true},"comment":null},"stack":{"type":"string","id":3,"options":{"proto3_optional":true},"comment":null}},"comment":null},"MessageTrace":{"fields":{"direction":{"type":"Direction","id":1,"comment":null},"data":{"type":"bytes","id":2,"comment":null}},"nested":{"Direction":{"values":{"INCOMING":0,"OUTGOING":1},"comment":null,"comments":{"INCOMING":null,"OUTGOING":null}}},"comment":null},"Request":{"fields":{"id":{"type":"int32","id":1,"comment":null},"method":{"type":"string","id":2,"comment":null},"payload":{"type":"google.protobuf.Any","id":3,"comment":null},"stream":{"type":"bool","id":4,"comment":null}},"comment":null},"Response":{"oneofs":{"content":{"oneof":["payload","error","close","streamReady"],"comment":null}},"fields":{"id":{"type":"int32","id":1,"comment":null},"payload":{"type":"google.protobuf.Any","id":2,"comment":null},"error":{"type":"Error","id":3,"comment":null},"close":{"type":"bool","id":4,"comment":"Sent when stream is closed without an error."},"streamReady":{"type":"bool","id":5,"comment":"Sent when the server has processed a request with a streaming response.\\n\\nCan be skipped by the server.\\nIn this case the first payload should be treated as the server being ready."}},"comment":null},"RpcMessage":{"oneofs":{"content":{"oneof":["request","response","open","openAck","streamClose"],"comment":null}},"fields":{"request":{"type":"Request","id":1,"comment":null},"response":{"type":"Response","id":2,"comment":null},"open":{"type":"bool","id":3,"comment":"Means that the node is trying to open the connection."},"openAck":{"type":"bool","id":4,"comment":"Means that the node has received the \\"open\\" message and is ready to perform requests."},"streamClose":{"type":"StreamClose","id":5,"comment":null}},"comment":null},"StreamClose":{"fields":{"id":{"type":"int32","id":1,"comment":null}},"comment":null}}}}},"google":{"nested":{"protobuf":{"nested":{"Any":{"fields":{"type_url":{"type":"string","id":1},"value":{"type":"bytes","id":2}},"comment":null},"DescriptorProto":{"fields":{"name":{"type":"string","id":1},"field":{"rule":"repeated","type":"FieldDescriptorProto","id":2},"extension":{"rule":"repeated","type":"FieldDescriptorProto","id":6},"nestedType":{"rule":"repeated","type":"DescriptorProto","id":3},"enumType":{"rule":"repeated","type":"EnumDescriptorProto","id":4},"extensionRange":{"rule":"repeated","type":"ExtensionRange","id":5},"oneofDecl":{"rule":"repeated","type":"OneofDescriptorProto","id":8},"options":{"type":"MessageOptions","id":7},"reservedRange":{"rule":"repeated","type":"ReservedRange","id":9},"reservedName":{"rule":"repeated","type":"string","id":10}},"nested":{"ExtensionRange":{"fields":{"start":{"type":"int32","id":1},"end":{"type":"int32","id":2}},"comment":null},"ReservedRange":{"fields":{"start":{"type":"int32","id":1},"end":{"type":"int32","id":2}},"comment":null}},"comment":null},"Empty":{"fields":{},"comment":null},"EnumDescriptorProto":{"fields":{"name":{"type":"string","id":1},"value":{"rule":"repeated","type":"EnumValueDescriptorProto","id":2},"options":{"type":"EnumOptions","id":3}},"comment":null},"EnumOptions":{"fields":{"allowAlias":{"type":"bool","id":2},"deprecated":{"type":"bool","id":3},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"comment":null},"EnumValueDescriptorProto":{"fields":{"name":{"type":"string","id":1},"number":{"type":"int32","id":2},"options":{"type":"EnumValueOptions","id":3}},"comment":null},"EnumValueOptions":{"fields":{"deprecated":{"type":"bool","id":1},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"comment":null},"FieldDescriptorProto":{"fields":{"name":{"type":"string","id":1},"number":{"type":"int32","id":3},"label":{"type":"Label","id":4},"type":{"type":"Type","id":5},"typeName":{"type":"string","id":6},"extendee":{"type":"string","id":2},"defaultValue":{"type":"string","id":7},"oneofIndex":{"type":"int32","id":9},"jsonName":{"type":"string","id":10},"options":{"type":"FieldOptions","id":8}},"nested":{"Label":{"values":{"LABEL_OPTIONAL":1,"LABEL_REQUIRED":2,"LABEL_REPEATED":3},"comments":{}},"Type":{"values":{"TYPE_DOUBLE":1,"TYPE_FLOAT":2,"TYPE_INT64":3,"TYPE_UINT64":4,"TYPE_INT32":5,"TYPE_FIXED64":6,"TYPE_FIXED32":7,"TYPE_BOOL":8,"TYPE_STRING":9,"TYPE_GROUP":10,"TYPE_MESSAGE":11,"TYPE_BYTES":12,"TYPE_UINT32":13,"TYPE_ENUM":14,"TYPE_SFIXED32":15,"TYPE_SFIXED64":16,"TYPE_SINT32":17,"TYPE_SINT64":18},"comments":{}}},"comment":null},"FieldOptions":{"fields":{"ctype":{"type":"CType","id":1,"options":{"default":"STRING"}},"packed":{"type":"bool","id":2},"jstype":{"type":"JSType","id":6,"options":{"default":"JS_NORMAL"}},"lazy":{"type":"bool","id":5},"deprecated":{"type":"bool","id":3},"weak":{"type":"bool","id":10},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[4,4]],"nested":{"CType":{"values":{"STRING":0,"CORD":1,"STRING_PIECE":2},"comments":{}},"JSType":{"values":{"JS_NORMAL":0,"JS_STRING":1,"JS_NUMBER":2},"comments":{}}},"comment":null},"FileDescriptorProto":{"fields":{"name":{"type":"string","id":1},"package":{"type":"string","id":2},"dependency":{"rule":"repeated","type":"string","id":3},"publicDependency":{"rule":"repeated","type":"int32","id":10,"options":{"packed":false}},"weakDependency":{"rule":"repeated","type":"int32","id":11,"options":{"packed":false}},"messageType":{"rule":"repeated","type":"DescriptorProto","id":4},"enumType":{"rule":"repeated","type":"EnumDescriptorProto","id":5},"service":{"rule":"repeated","type":"ServiceDescriptorProto","id":6},"extension":{"rule":"repeated","type":"FieldDescriptorProto","id":7},"options":{"type":"FileOptions","id":8},"sourceCodeInfo":{"type":"SourceCodeInfo","id":9},"syntax":{"type":"string","id":12}},"comment":null},"FileDescriptorSet":{"fields":{"file":{"rule":"repeated","type":"FileDescriptorProto","id":1}},"comment":null},"FileOptions":{"fields":{"javaPackage":{"type":"string","id":1},"javaOuterClassname":{"type":"string","id":8},"javaMultipleFiles":{"type":"bool","id":10},"javaGenerateEqualsAndHash":{"type":"bool","id":20,"options":{"deprecated":true}},"javaStringCheckUtf8":{"type":"bool","id":27},"optimizeFor":{"type":"OptimizeMode","id":9,"options":{"default":"SPEED"}},"goPackage":{"type":"string","id":11},"ccGenericServices":{"type":"bool","id":16},"javaGenericServices":{"type":"bool","id":17},"pyGenericServices":{"type":"bool","id":18},"deprecated":{"type":"bool","id":23},"ccEnableArenas":{"type":"bool","id":31},"objcClassPrefix":{"type":"string","id":36},"csharpNamespace":{"type":"string","id":37},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[38,38]],"nested":{"OptimizeMode":{"values":{"SPEED":1,"CODE_SIZE":2,"LITE_RUNTIME":3},"comments":{}}},"comment":null},"GeneratedCodeInfo":{"fields":{"annotation":{"rule":"repeated","type":"Annotation","id":1}},"nested":{"Annotation":{"fields":{"path":{"rule":"repeated","type":"int32","id":1},"sourceFile":{"type":"string","id":2},"begin":{"type":"int32","id":3},"end":{"type":"int32","id":4}},"comment":null}},"comment":null},"MessageOptions":{"fields":{"messageSetWireFormat":{"type":"bool","id":1},"noStandardDescriptorAccessor":{"type":"bool","id":2},"deprecated":{"type":"bool","id":3},"mapEntry":{"type":"bool","id":7},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"reserved":[[8,8]],"comment":null},"MethodDescriptorProto":{"fields":{"name":{"type":"string","id":1},"inputType":{"type":"string","id":2},"outputType":{"type":"string","id":3},"options":{"type":"MethodOptions","id":4},"clientStreaming":{"type":"bool","id":5},"serverStreaming":{"type":"bool","id":6}},"comment":null},"MethodOptions":{"fields":{"deprecated":{"type":"bool","id":33},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"comment":null},"OneofDescriptorProto":{"fields":{"name":{"type":"string","id":1},"options":{"type":"OneofOptions","id":2}},"comment":null},"OneofOptions":{"fields":{"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"comment":null},"ServiceDescriptorProto":{"fields":{"name":{"type":"string","id":1},"method":{"rule":"repeated","type":"MethodDescriptorProto","id":2},"options":{"type":"ServiceOptions","id":3}},"comment":null},"ServiceOptions":{"fields":{"deprecated":{"type":"bool","id":33},"uninterpretedOption":{"rule":"repeated","type":"UninterpretedOption","id":999}},"extensions":[[1000,536870911]],"comment":null},"SourceCodeInfo":{"fields":{"location":{"rule":"repeated","type":"Location","id":1}},"nested":{"Location":{"fields":{"path":{"rule":"repeated","type":"int32","id":1},"span":{"rule":"repeated","type":"int32","id":2},"leadingComments":{"type":"string","id":3},"trailingComments":{"type":"string","id":4},"leadingDetachedComments":{"rule":"repeated","type":"string","id":6}},"comment":null}},"comment":null},"Timestamp":{"fields":{"seconds":{"type":"int64","id":1},"nanos":{"type":"int32","id":2}},"comment":null},"UninterpretedOption":{"fields":{"name":{"rule":"repeated","type":"NamePart","id":2},"identifierValue":{"type":"string","id":3},"positiveIntValue":{"type":"uint64","id":4},"negativeIntValue":{"type":"int64","id":5},"doubleValue":{"type":"double","id":6},"stringValue":{"type":"bytes","id":7},"aggregateValue":{"type":"string","id":8}},"nested":{"NamePart":{"fields":{"namePart":{"rule":"required","type":"string","id":1},"isExtension":{"rule":"required","type":"bool","id":2}},"comment":null}},"comment":null}}}}}}}');
|
|
97018
|
-
var schema =
|
|
96589
|
+
var schema = import_codec_protobuf2.Schema.fromJson(schemaJson, substitutions_default);
|
|
97019
96590
|
|
|
97020
|
-
// src/
|
|
96591
|
+
// src/packlets/proto/gen/dxos/config.ts
|
|
96592
|
+
var Runtime;
|
|
96593
|
+
((Runtime2) => {
|
|
96594
|
+
let Client2;
|
|
96595
|
+
((Client3) => {
|
|
96596
|
+
let Mode;
|
|
96597
|
+
((Mode2) => {
|
|
96598
|
+
Mode2[Mode2["AUTOMATIC"] = 0] = "AUTOMATIC";
|
|
96599
|
+
Mode2[Mode2["LOCAL"] = 1] = "LOCAL";
|
|
96600
|
+
Mode2[Mode2["REMOTE"] = 2] = "REMOTE";
|
|
96601
|
+
})(Mode = Client3.Mode || (Client3.Mode = {}));
|
|
96602
|
+
let Storage;
|
|
96603
|
+
((Storage2) => {
|
|
96604
|
+
let StorageDriver2;
|
|
96605
|
+
((StorageDriver3) => {
|
|
96606
|
+
StorageDriver3[StorageDriver3["RAM"] = 0] = "RAM";
|
|
96607
|
+
StorageDriver3[StorageDriver3["IDB"] = 1] = "IDB";
|
|
96608
|
+
StorageDriver3[StorageDriver3["CHROME"] = 2] = "CHROME";
|
|
96609
|
+
StorageDriver3[StorageDriver3["FIREFOX"] = 3] = "FIREFOX";
|
|
96610
|
+
StorageDriver3[StorageDriver3["NODE"] = 4] = "NODE";
|
|
96611
|
+
StorageDriver3[StorageDriver3["LEVELJS"] = 11] = "LEVELJS";
|
|
96612
|
+
StorageDriver3[StorageDriver3["JSONDOWN"] = 12] = "JSONDOWN";
|
|
96613
|
+
})(StorageDriver2 = Storage2.StorageDriver || (Storage2.StorageDriver = {}));
|
|
96614
|
+
})(Storage = Client3.Storage || (Client3.Storage = {}));
|
|
96615
|
+
})(Client2 = Runtime2.Client || (Runtime2.Client = {}));
|
|
96616
|
+
})(Runtime || (Runtime = {}));
|
|
96617
|
+
|
|
96618
|
+
// src/packlets/proto/gen/dxos/echo/feed.ts
|
|
96619
|
+
var ItemMutation;
|
|
96620
|
+
((ItemMutation2) => {
|
|
96621
|
+
let Action;
|
|
96622
|
+
((Action2) => {
|
|
96623
|
+
Action2[Action2["NOOP"] = 0] = "NOOP";
|
|
96624
|
+
Action2[Action2["DELETE"] = 1] = "DELETE";
|
|
96625
|
+
Action2[Action2["RESTORE"] = 2] = "RESTORE";
|
|
96626
|
+
})(Action = ItemMutation2.Action || (ItemMutation2.Action = {}));
|
|
96627
|
+
})(ItemMutation || (ItemMutation = {}));
|
|
96628
|
+
|
|
96629
|
+
// src/packlets/proto/gen/dxos/echo/invitation.ts
|
|
96630
|
+
var InvitationDescriptor;
|
|
96631
|
+
((InvitationDescriptor8) => {
|
|
96632
|
+
let Type;
|
|
96633
|
+
((Type2) => {
|
|
96634
|
+
Type2[Type2["INTERACTIVE"] = 1] = "INTERACTIVE";
|
|
96635
|
+
Type2[Type2["OFFLINE"] = 2] = "OFFLINE";
|
|
96636
|
+
})(Type = InvitationDescriptor8.Type || (InvitationDescriptor8.Type = {}));
|
|
96637
|
+
})(InvitationDescriptor || (InvitationDescriptor = {}));
|
|
96638
|
+
|
|
96639
|
+
// src/packlets/proto/gen/dxos/halo/keys.ts
|
|
96640
|
+
var KeyType = /* @__PURE__ */ ((KeyType2) => {
|
|
96641
|
+
KeyType2[KeyType2["UNKNOWN"] = 0] = "UNKNOWN";
|
|
96642
|
+
KeyType2[KeyType2["IDENTITY"] = 1] = "IDENTITY";
|
|
96643
|
+
KeyType2[KeyType2["DEVICE"] = 2] = "DEVICE";
|
|
96644
|
+
KeyType2[KeyType2["PARTY"] = 3] = "PARTY";
|
|
96645
|
+
KeyType2[KeyType2["FEED"] = 4] = "FEED";
|
|
96646
|
+
KeyType2[KeyType2["DXNS_ADDRESS"] = 5] = "DXNS_ADDRESS";
|
|
96647
|
+
return KeyType2;
|
|
96648
|
+
})(KeyType || {});
|
|
96649
|
+
|
|
96650
|
+
// src/packlets/proto/gen/dxos/rpc.ts
|
|
96651
|
+
var MessageTrace;
|
|
96652
|
+
((MessageTrace2) => {
|
|
96653
|
+
let Direction;
|
|
96654
|
+
((Direction2) => {
|
|
96655
|
+
Direction2[Direction2["INCOMING"] = 0] = "INCOMING";
|
|
96656
|
+
Direction2[Direction2["OUTGOING"] = 1] = "OUTGOING";
|
|
96657
|
+
})(Direction = MessageTrace2.Direction || (MessageTrace2.Direction = {}));
|
|
96658
|
+
})(MessageTrace || (MessageTrace = {}));
|
|
96659
|
+
|
|
96660
|
+
// src/packlets/api/client-service.ts
|
|
96661
|
+
var import_echo_protocol = __toESM(require_src7());
|
|
96662
|
+
var import_rpc = require("@dxos/rpc");
|
|
97021
96663
|
var clientServiceBundle = (0, import_rpc.createServiceBundle)({
|
|
97022
96664
|
SystemService: schema.getService("dxos.client.SystemService"),
|
|
97023
96665
|
ProfileService: schema.getService("dxos.client.ProfileService"),
|
|
@@ -97028,19 +96670,93 @@ var clientServiceBundle = (0, import_rpc.createServiceBundle)({
|
|
|
97028
96670
|
TracingService: schema.getService("dxos.devtools.TracingService")
|
|
97029
96671
|
});
|
|
97030
96672
|
|
|
97031
|
-
// src/
|
|
97032
|
-
var
|
|
97033
|
-
|
|
96673
|
+
// src/packlets/api/invitations/invitation.ts
|
|
96674
|
+
var Invitation = class {
|
|
96675
|
+
constructor(_descriptor, _invitationPromise, _onAuthenticate) {
|
|
96676
|
+
this._descriptor = _descriptor;
|
|
96677
|
+
this._invitationPromise = _invitationPromise;
|
|
96678
|
+
this._onAuthenticate = _onAuthenticate;
|
|
96679
|
+
}
|
|
96680
|
+
get descriptor() {
|
|
96681
|
+
return this._descriptor;
|
|
96682
|
+
}
|
|
96683
|
+
authenticate(secret) {
|
|
96684
|
+
this._onAuthenticate(secret);
|
|
96685
|
+
}
|
|
96686
|
+
wait() {
|
|
96687
|
+
return this._invitationPromise;
|
|
96688
|
+
}
|
|
96689
|
+
toJSON() {
|
|
96690
|
+
return this.descriptor.toProto();
|
|
96691
|
+
}
|
|
96692
|
+
};
|
|
96693
|
+
|
|
96694
|
+
// src/packlets/api/invitations/invitation-request.ts
|
|
96695
|
+
var import_node_assert = __toESM(require_assert());
|
|
96696
|
+
var import_async = require("@dxos/async");
|
|
96697
|
+
var import_debug = require("@dxos/debug");
|
|
96698
|
+
var InvitationRequest = class {
|
|
96699
|
+
constructor(_descriptor, connected, finished, error2) {
|
|
96700
|
+
this._descriptor = _descriptor;
|
|
96701
|
+
this._hasConnected = false;
|
|
96702
|
+
this._isCanceled = false;
|
|
96703
|
+
this.canceled = new import_async.Event();
|
|
96704
|
+
this.connected = connected;
|
|
96705
|
+
this.finished = finished;
|
|
96706
|
+
this.error = error2;
|
|
96707
|
+
this.connected.on(() => {
|
|
96708
|
+
this._hasConnected = true;
|
|
96709
|
+
});
|
|
96710
|
+
}
|
|
96711
|
+
get descriptor() {
|
|
96712
|
+
return this._descriptor;
|
|
96713
|
+
}
|
|
96714
|
+
get secret() {
|
|
96715
|
+
var _a;
|
|
96716
|
+
return (_a = this._descriptor.secret) != null ? _a : (0, import_debug.raise)(new Error("Invitation secret is not set"));
|
|
96717
|
+
}
|
|
96718
|
+
get hasConnected() {
|
|
96719
|
+
return this._hasConnected;
|
|
96720
|
+
}
|
|
96721
|
+
cancel() {
|
|
96722
|
+
(0, import_node_assert.default)(!this._isCanceled, new Error("Invitation is already canceled"));
|
|
96723
|
+
this._isCanceled = true;
|
|
96724
|
+
this.canceled.emit();
|
|
96725
|
+
}
|
|
96726
|
+
toString() {
|
|
96727
|
+
return `InvitationRequest(${JSON.stringify(this._descriptor.toQueryParameters())})`;
|
|
96728
|
+
}
|
|
96729
|
+
};
|
|
97034
96730
|
|
|
97035
|
-
// src/
|
|
97036
|
-
var
|
|
96731
|
+
// src/packlets/api/echo.ts
|
|
96732
|
+
var PartyInvitation = class extends Invitation {
|
|
96733
|
+
getParty() {
|
|
96734
|
+
return this.wait();
|
|
96735
|
+
}
|
|
96736
|
+
};
|
|
97037
96737
|
|
|
97038
|
-
// src/
|
|
96738
|
+
// src/packlets/api/errors.ts
|
|
96739
|
+
var import_debug2 = require("@dxos/debug");
|
|
96740
|
+
var InvalidConfigurationError = class extends import_debug2.DXOSError {
|
|
96741
|
+
constructor(message) {
|
|
96742
|
+
super("INVALID_CONFIGURATION", message);
|
|
96743
|
+
}
|
|
96744
|
+
};
|
|
96745
|
+
var RemoteServiceConnectionTimeout = class extends import_debug2.DXOSError {
|
|
96746
|
+
constructor(message) {
|
|
96747
|
+
super("REMOTE_SERVICE_CONNECTION_TIMEOUT", message);
|
|
96748
|
+
}
|
|
96749
|
+
};
|
|
96750
|
+
|
|
96751
|
+
// src/packlets/devtools/devtools-host.ts
|
|
96752
|
+
var import_codec_protobuf8 = require("@dxos/codec-protobuf");
|
|
96753
|
+
|
|
96754
|
+
// src/packlets/devtools/config.ts
|
|
97039
96755
|
var getConfig = (hook) => ({
|
|
97040
96756
|
config: JSON.stringify(hook.config.values)
|
|
97041
96757
|
});
|
|
97042
96758
|
|
|
97043
|
-
// src/devtools/debug-logging.ts
|
|
96759
|
+
// src/packlets/devtools/debug-logging.ts
|
|
97044
96760
|
var enableDebugLogging = (hook, data) => {
|
|
97045
96761
|
hook.debug.enable(data.namespaces);
|
|
97046
96762
|
};
|
|
@@ -97048,11 +96764,11 @@ var disableDebugLogging = (hook) => {
|
|
|
97048
96764
|
hook.debug.disable();
|
|
97049
96765
|
};
|
|
97050
96766
|
|
|
97051
|
-
// src/devtools/feeds.ts
|
|
96767
|
+
// src/packlets/devtools/feeds.ts
|
|
97052
96768
|
var import_readable_stream = require("readable-stream");
|
|
97053
|
-
var
|
|
96769
|
+
var import_codec_protobuf3 = require("@dxos/codec-protobuf");
|
|
97054
96770
|
var import_feed_store = __toESM(require_src6());
|
|
97055
|
-
var subscribeToFeeds = ({ echo }, { partyKey, feedKeys }) => new
|
|
96771
|
+
var subscribeToFeeds = ({ echo }, { partyKey, feedKeys }) => new import_codec_protobuf3.Stream(({ next }) => {
|
|
97056
96772
|
if (!partyKey || (feedKeys == null ? void 0 : feedKeys.length) === 0) {
|
|
97057
96773
|
return;
|
|
97058
96774
|
}
|
|
@@ -97093,7 +96809,7 @@ var subscribeToFeeds = ({ echo }, { partyKey, feedKeys }) => new import_codec_pr
|
|
|
97093
96809
|
feedMap.forEach(({ stream }) => stream.destroy());
|
|
97094
96810
|
};
|
|
97095
96811
|
});
|
|
97096
|
-
var subscribeToFeedBlocks = ({ echo }, { partyKey, feedKey, maxBlocks = 10 }) => new
|
|
96812
|
+
var subscribeToFeedBlocks = ({ echo }, { partyKey, feedKey, maxBlocks = 10 }) => new import_codec_protobuf3.Stream(({ next }) => {
|
|
97097
96813
|
if (!partyKey || !feedKey) {
|
|
97098
96814
|
return;
|
|
97099
96815
|
}
|
|
@@ -97121,8 +96837,8 @@ var subscribeToFeedBlocks = ({ echo }, { partyKey, feedKey, maxBlocks = 10 }) =>
|
|
|
97121
96837
|
};
|
|
97122
96838
|
});
|
|
97123
96839
|
|
|
97124
|
-
// src/devtools/items.ts
|
|
97125
|
-
var
|
|
96840
|
+
// src/packlets/devtools/items.ts
|
|
96841
|
+
var import_codec_protobuf4 = require("@dxos/codec-protobuf");
|
|
97126
96842
|
var getData = (echo) => {
|
|
97127
96843
|
const result = {
|
|
97128
96844
|
parties: []
|
|
@@ -97148,7 +96864,7 @@ var getData = (echo) => {
|
|
|
97148
96864
|
data: JSON.stringify(result)
|
|
97149
96865
|
};
|
|
97150
96866
|
};
|
|
97151
|
-
var subscribeToItems = ({ echo }) => new
|
|
96867
|
+
var subscribeToItems = ({ echo }) => new import_codec_protobuf4.Stream(({ next }) => {
|
|
97152
96868
|
const update = () => {
|
|
97153
96869
|
const res = getData(echo);
|
|
97154
96870
|
next(res);
|
|
@@ -97172,16 +96888,16 @@ var subscribeToItems = ({ echo }) => new import_codec_protobuf8.Stream(({ next }
|
|
|
97172
96888
|
};
|
|
97173
96889
|
});
|
|
97174
96890
|
|
|
97175
|
-
// src/devtools/keys.ts
|
|
97176
|
-
var
|
|
97177
|
-
var
|
|
97178
|
-
var subscribeToKeyringKeys = ({ keyring }) => new
|
|
96891
|
+
// src/packlets/devtools/keys.ts
|
|
96892
|
+
var import_codec_protobuf5 = require("@dxos/codec-protobuf");
|
|
96893
|
+
var import_util = require("@dxos/util");
|
|
96894
|
+
var subscribeToKeyringKeys = ({ keyring }) => new import_codec_protobuf5.Stream(({ next }) => {
|
|
97179
96895
|
next({ keys: keyring.keys });
|
|
97180
96896
|
return keyring.keysUpdate.on((keys) => {
|
|
97181
96897
|
next({ keys });
|
|
97182
96898
|
});
|
|
97183
96899
|
});
|
|
97184
|
-
var subscribeToCredentialMessages = ({ echo }, { partyKey }) => new
|
|
96900
|
+
var subscribeToCredentialMessages = ({ echo }, { partyKey }) => new import_codec_protobuf5.Stream(({ next }) => {
|
|
97185
96901
|
const party = partyKey && echo.getParty(partyKey);
|
|
97186
96902
|
if (!party) {
|
|
97187
96903
|
throw new Error("Party not found");
|
|
@@ -97189,17 +96905,17 @@ var subscribeToCredentialMessages = ({ echo }, { partyKey }) => new import_codec
|
|
|
97189
96905
|
const update = () => {
|
|
97190
96906
|
next({ messages: Array.from(party.processor.credentialMessages.values()) });
|
|
97191
96907
|
};
|
|
97192
|
-
const subscriptions = new
|
|
96908
|
+
const subscriptions = new import_util.SubscriptionGroup();
|
|
97193
96909
|
subscriptions.push(party.processor.keyOrInfoAdded.on(() => update()));
|
|
97194
96910
|
subscriptions.push(party.processor.feedAdded.on(() => update()));
|
|
97195
96911
|
update();
|
|
97196
96912
|
return () => subscriptions.unsubscribe();
|
|
97197
96913
|
});
|
|
97198
96914
|
|
|
97199
|
-
// src/devtools/network.ts
|
|
97200
|
-
var
|
|
96915
|
+
// src/packlets/devtools/network.ts
|
|
96916
|
+
var import_codec_protobuf6 = require("@dxos/codec-protobuf");
|
|
97201
96917
|
var import_protocols2 = require("@dxos/protocols");
|
|
97202
|
-
var subscribeToNetworkStatus = (hook) => new
|
|
96918
|
+
var subscribeToNetworkStatus = (hook) => new import_codec_protobuf6.Stream(({ next, close }) => {
|
|
97203
96919
|
const update = () => {
|
|
97204
96920
|
try {
|
|
97205
96921
|
const status = hook.networkManager.signal.getStatus();
|
|
@@ -97211,7 +96927,7 @@ var subscribeToNetworkStatus = (hook) => new import_codec_protobuf10.Stream(({ n
|
|
|
97211
96927
|
hook.networkManager.signal.statusChanged.on(update);
|
|
97212
96928
|
update();
|
|
97213
96929
|
});
|
|
97214
|
-
var subscribeToSignalTrace = (hook) => new
|
|
96930
|
+
var subscribeToSignalTrace = (hook) => new import_codec_protobuf6.Stream(({ next }) => {
|
|
97215
96931
|
next({ events: [] });
|
|
97216
96932
|
const trace = [];
|
|
97217
96933
|
hook.networkManager.signal.commandTrace.on((msg) => {
|
|
@@ -97219,7 +96935,7 @@ var subscribeToSignalTrace = (hook) => new import_codec_protobuf10.Stream(({ nex
|
|
|
97219
96935
|
next({ events: trace.map((msg2) => JSON.stringify(msg2)) });
|
|
97220
96936
|
});
|
|
97221
96937
|
});
|
|
97222
|
-
var subscribeToNetworkTopics = (hook) => new
|
|
96938
|
+
var subscribeToNetworkTopics = (hook) => new import_codec_protobuf6.Stream(({ next, close }) => {
|
|
97223
96939
|
const update = () => {
|
|
97224
96940
|
try {
|
|
97225
96941
|
const topics = hook.networkManager.topics;
|
|
@@ -97238,7 +96954,7 @@ var subscribeToNetworkTopics = (hook) => new import_codec_protobuf10.Stream(({ n
|
|
|
97238
96954
|
hook.networkManager.topicsUpdated.on(update);
|
|
97239
96955
|
update();
|
|
97240
96956
|
});
|
|
97241
|
-
var subscribeToSwarmInfo = (hook) => new
|
|
96957
|
+
var subscribeToSwarmInfo = (hook) => new import_codec_protobuf6.Stream(({ next }) => {
|
|
97242
96958
|
var _a;
|
|
97243
96959
|
const networkManager = hook.networkManager;
|
|
97244
96960
|
const update = () => {
|
|
@@ -97264,9 +96980,9 @@ var getNetworkPeers = (hook, request) => {
|
|
|
97264
96980
|
};
|
|
97265
96981
|
};
|
|
97266
96982
|
|
|
97267
|
-
// src/devtools/parties.ts
|
|
97268
|
-
var
|
|
97269
|
-
var subscribeToParties = ({ echo }, { partyKeys = [] }) => new
|
|
96983
|
+
// src/packlets/devtools/parties.ts
|
|
96984
|
+
var import_codec_protobuf7 = require("@dxos/codec-protobuf");
|
|
96985
|
+
var subscribeToParties = ({ echo }, { partyKeys = [] }) => new import_codec_protobuf7.Stream(({ next }) => {
|
|
97270
96986
|
const update = () => {
|
|
97271
96987
|
const { value: parties } = echo.queryParties();
|
|
97272
96988
|
const filteredParties = parties.filter((party) => !(partyKeys == null ? void 0 : partyKeys.length) || partyKeys.some((partyKey) => partyKey.equals(party.key)));
|
|
@@ -97315,15 +97031,15 @@ var savePartySnapshot = async ({ echo }, request) => {
|
|
|
97315
97031
|
return { snapshot };
|
|
97316
97032
|
};
|
|
97317
97033
|
|
|
97318
|
-
// src/devtools/storage.ts
|
|
97034
|
+
// src/packlets/devtools/storage.ts
|
|
97319
97035
|
var resetStorage = async (hook) => {
|
|
97320
97036
|
await hook.echo.reset();
|
|
97321
97037
|
window.location.reload();
|
|
97322
97038
|
};
|
|
97323
97039
|
|
|
97324
|
-
// src/devtools/devtools-host.ts
|
|
97040
|
+
// src/packlets/devtools/devtools-host.ts
|
|
97325
97041
|
var createDevtoolsHost = (context, events) => ({
|
|
97326
|
-
events: () => new
|
|
97042
|
+
events: () => new import_codec_protobuf8.Stream(({ next }) => {
|
|
97327
97043
|
events.ready.on(() => {
|
|
97328
97044
|
next({ ready: {} });
|
|
97329
97045
|
});
|
|
@@ -97360,18 +97076,25 @@ var createDevtoolsHost = (context, events) => ({
|
|
|
97360
97076
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo(context)
|
|
97361
97077
|
});
|
|
97362
97078
|
|
|
97363
|
-
// src/devtools/devtools-host-events.ts
|
|
97364
|
-
var
|
|
97079
|
+
// src/packlets/devtools/devtools-host-events.ts
|
|
97080
|
+
var import_async2 = require("@dxos/async");
|
|
97365
97081
|
var DevtoolsHostEvents = class {
|
|
97366
97082
|
constructor() {
|
|
97367
|
-
this.ready = new
|
|
97083
|
+
this.ready = new import_async2.Event();
|
|
97368
97084
|
}
|
|
97369
97085
|
};
|
|
97370
97086
|
|
|
97371
|
-
// src/
|
|
97372
|
-
var
|
|
97087
|
+
// src/packlets/proxy/client-proxy.ts
|
|
97088
|
+
var import_debug7 = __toESM(require("debug"));
|
|
97089
|
+
var import_node_assert4 = __toESM(require_assert());
|
|
97090
|
+
var import_async7 = require("@dxos/async");
|
|
97091
|
+
var import_config2 = require("@dxos/config");
|
|
97092
|
+
var import_debug8 = require("@dxos/debug");
|
|
97093
|
+
|
|
97094
|
+
// src/packlets/proxy/devtools.ts
|
|
97095
|
+
var import_debug3 = __toESM(require("debug"));
|
|
97373
97096
|
var import_rpc2 = require("@dxos/rpc");
|
|
97374
|
-
var log = (0,
|
|
97097
|
+
var log = (0, import_debug3.default)("dxos:client:devtools");
|
|
97375
97098
|
var error = log.extend("error");
|
|
97376
97099
|
var port = {
|
|
97377
97100
|
send: async (message) => window.postMessage({
|
|
@@ -97418,273 +97141,38 @@ var createDevtoolsRpcServer = async (client, serviceHost) => {
|
|
|
97418
97141
|
};
|
|
97419
97142
|
};
|
|
97420
97143
|
|
|
97421
|
-
// src/
|
|
97422
|
-
var
|
|
97423
|
-
var import_level_js = __toESM(require("level-js"));
|
|
97424
|
-
var import_memdown = __toESM(require("memdown"));
|
|
97425
|
-
var import_config2 = require("@dxos/config");
|
|
97426
|
-
var import_random_access_multi_storage = require("@dxos/random-access-multi-storage");
|
|
97427
|
-
var StorageDriver = import_config2.defs.Runtime.Client.Storage.StorageDriver;
|
|
97428
|
-
var createStorageObjects = (config) => {
|
|
97429
|
-
const {
|
|
97430
|
-
path = "dxos/storage",
|
|
97431
|
-
storageType,
|
|
97432
|
-
keyStorage,
|
|
97433
|
-
persistent = false
|
|
97434
|
-
} = config != null ? config : {};
|
|
97435
|
-
if (persistent && storageType === StorageDriver.RAM) {
|
|
97436
|
-
throw new InvalidConfigurationError("RAM storage cannot be used in persistent mode.");
|
|
97437
|
-
}
|
|
97438
|
-
if (!persistent && (storageType !== void 0 && storageType !== StorageDriver.RAM)) {
|
|
97439
|
-
throw new InvalidConfigurationError("Cannot use a persistent storage in not persistent mode.");
|
|
97440
|
-
}
|
|
97441
|
-
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
97442
|
-
throw new InvalidConfigurationError("RAM key storage cannot be used in persistent mode.");
|
|
97443
|
-
}
|
|
97444
|
-
if (!persistent && (keyStorage !== StorageDriver.RAM && keyStorage !== void 0)) {
|
|
97445
|
-
throw new InvalidConfigurationError("Cannot use a persistent key storage in not persistent mode.");
|
|
97446
|
-
}
|
|
97447
|
-
return {
|
|
97448
|
-
storage: (0, import_random_access_multi_storage.createStorage)(`${path}/`, persistent ? toStorageType(storageType) : import_random_access_multi_storage.StorageType.RAM),
|
|
97449
|
-
keyStorage: createKeyStorage(`${path}/keystore`, persistent ? toKeyStorageType(keyStorage) : "ram")
|
|
97450
|
-
};
|
|
97451
|
-
};
|
|
97452
|
-
var createKeyStorage = (path, type) => {
|
|
97453
|
-
const defaultedType = type != null ? type : isNode() ? "jsondown" : "leveljs";
|
|
97454
|
-
switch (defaultedType) {
|
|
97455
|
-
case "leveljs":
|
|
97456
|
-
return (0, import_level_js.default)(path);
|
|
97457
|
-
case "jsondown":
|
|
97458
|
-
return (0, import_jsondown.default)(path);
|
|
97459
|
-
case "ram":
|
|
97460
|
-
return (0, import_memdown.default)();
|
|
97461
|
-
default:
|
|
97462
|
-
throw new InvalidConfigurationError(`Invalid key storage type: ${defaultedType}`);
|
|
97463
|
-
}
|
|
97464
|
-
};
|
|
97465
|
-
var toStorageType = (type) => {
|
|
97466
|
-
switch (type) {
|
|
97467
|
-
case void 0:
|
|
97468
|
-
return void 0;
|
|
97469
|
-
case StorageDriver.RAM:
|
|
97470
|
-
return import_random_access_multi_storage.StorageType.RAM;
|
|
97471
|
-
case StorageDriver.CHROME:
|
|
97472
|
-
return import_random_access_multi_storage.StorageType.CHROME;
|
|
97473
|
-
case StorageDriver.FIREFOX:
|
|
97474
|
-
return import_random_access_multi_storage.StorageType.FIREFOX;
|
|
97475
|
-
case StorageDriver.IDB:
|
|
97476
|
-
return import_random_access_multi_storage.StorageType.IDB;
|
|
97477
|
-
case StorageDriver.NODE:
|
|
97478
|
-
return import_random_access_multi_storage.StorageType.NODE;
|
|
97479
|
-
default:
|
|
97480
|
-
throw new Error(`Invalid storage type: ${StorageDriver[type]}`);
|
|
97481
|
-
}
|
|
97482
|
-
};
|
|
97483
|
-
var toKeyStorageType = (type) => {
|
|
97484
|
-
switch (type) {
|
|
97485
|
-
case void 0:
|
|
97486
|
-
return void 0;
|
|
97487
|
-
case StorageDriver.RAM:
|
|
97488
|
-
return "ram";
|
|
97489
|
-
case StorageDriver.LEVELJS:
|
|
97490
|
-
return "leveljs";
|
|
97491
|
-
case StorageDriver.JSONDOWN:
|
|
97492
|
-
return "jsondown";
|
|
97493
|
-
default:
|
|
97494
|
-
throw new Error(`Invalid key storage type: ${StorageDriver[type]}`);
|
|
97495
|
-
}
|
|
97496
|
-
};
|
|
97497
|
-
|
|
97498
|
-
// src/services/service-host.ts
|
|
97499
|
-
var ClientServiceHost = class {
|
|
97500
|
-
constructor(_config, _options) {
|
|
97501
|
-
this._config = _config;
|
|
97502
|
-
this._options = _options;
|
|
97503
|
-
this._devtoolsEvents = new DevtoolsHostEvents();
|
|
97504
|
-
const { storage, keyStorage } = createStorageObjects(this._config.get("runtime.client.storage", {}));
|
|
97505
|
-
this._echo = new import_echo_db4.ECHO({
|
|
97506
|
-
storage,
|
|
97507
|
-
keyStorage,
|
|
97508
|
-
networkManagerOptions: {
|
|
97509
|
-
signal: this._config.get("runtime.services.signal.server") ? [this._config.get("runtime.services.signal.server")] : void 0,
|
|
97510
|
-
ice: this._config.get("runtime.services.ice"),
|
|
97511
|
-
log: true
|
|
97512
|
-
},
|
|
97513
|
-
snapshots: this._config.get("runtime.client.enableSnapshots", false),
|
|
97514
|
-
snapshotInterval: this._config.get("runtime.client.snapshotInterval")
|
|
97515
|
-
});
|
|
97516
|
-
this._services = {
|
|
97517
|
-
...createServices({ config: this._config, echo: this._echo, signer: this._options.signer }),
|
|
97518
|
-
DevtoolsHost: this._createDevtoolsService()
|
|
97519
|
-
};
|
|
97520
|
-
}
|
|
97521
|
-
get services() {
|
|
97522
|
-
return this._services;
|
|
97523
|
-
}
|
|
97524
|
-
async open(onProgressCallback) {
|
|
97525
|
-
await this._echo.open(onProgressCallback);
|
|
97526
|
-
this._devtoolsEvents.ready.emit();
|
|
97527
|
-
}
|
|
97528
|
-
async close() {
|
|
97529
|
-
await this._echo.close();
|
|
97530
|
-
}
|
|
97531
|
-
get echo() {
|
|
97532
|
-
return this._echo;
|
|
97533
|
-
}
|
|
97534
|
-
_createDevtoolsService() {
|
|
97535
|
-
const dependencies = {
|
|
97536
|
-
config: this._config,
|
|
97537
|
-
echo: this._echo,
|
|
97538
|
-
feedStore: this._echo.feedStore,
|
|
97539
|
-
networkManager: this._echo.networkManager,
|
|
97540
|
-
modelFactory: this._echo.modelFactory,
|
|
97541
|
-
keyring: this._echo.halo.keyring,
|
|
97542
|
-
debug: debug2
|
|
97543
|
-
};
|
|
97544
|
-
return createDevtoolsHost(dependencies, this._devtoolsEvents);
|
|
97545
|
-
}
|
|
97546
|
-
};
|
|
97547
|
-
|
|
97548
|
-
// src/services/service-proxy.ts
|
|
97144
|
+
// src/packlets/proxy/echo-proxy.ts
|
|
97145
|
+
var import_node_assert3 = __toESM(require_assert());
|
|
97549
97146
|
var import_async5 = require("@dxos/async");
|
|
97550
|
-
var
|
|
97551
|
-
var
|
|
97552
|
-
constructor(port2, _timeout = 300) {
|
|
97553
|
-
this._timeout = _timeout;
|
|
97554
|
-
this._client = (0, import_rpc3.createBundledRpcClient)(clientServiceBundle, {
|
|
97555
|
-
port: port2
|
|
97556
|
-
});
|
|
97557
|
-
this.services = this._client.rpc;
|
|
97558
|
-
}
|
|
97559
|
-
async open(onProgressCallback) {
|
|
97560
|
-
await (0, import_async5.promiseTimeout)(this._client.open(), this._timeout, new RemoteServiceConnectionTimeout());
|
|
97561
|
-
}
|
|
97562
|
-
async close() {
|
|
97563
|
-
this._client.close();
|
|
97564
|
-
}
|
|
97565
|
-
};
|
|
97566
|
-
|
|
97567
|
-
// src/api/client.ts
|
|
97568
|
-
var import_debug8 = __toESM(require("debug"));
|
|
97569
|
-
var import_node_assert7 = __toESM(require_assert());
|
|
97570
|
-
var import_async10 = require("@dxos/async");
|
|
97571
|
-
var import_config3 = require("@dxos/config");
|
|
97572
|
-
var import_debug9 = require("@dxos/debug");
|
|
97573
|
-
|
|
97574
|
-
// src/proto/gen/dxos/config.ts
|
|
97575
|
-
var Runtime;
|
|
97576
|
-
((Runtime2) => {
|
|
97577
|
-
let Client2;
|
|
97578
|
-
((Client3) => {
|
|
97579
|
-
let Mode;
|
|
97580
|
-
((Mode2) => {
|
|
97581
|
-
Mode2[Mode2["AUTOMATIC"] = 0] = "AUTOMATIC";
|
|
97582
|
-
Mode2[Mode2["LOCAL"] = 1] = "LOCAL";
|
|
97583
|
-
Mode2[Mode2["REMOTE"] = 2] = "REMOTE";
|
|
97584
|
-
})(Mode = Client3.Mode || (Client3.Mode = {}));
|
|
97585
|
-
let Storage;
|
|
97586
|
-
((Storage2) => {
|
|
97587
|
-
let StorageDriver2;
|
|
97588
|
-
((StorageDriver3) => {
|
|
97589
|
-
StorageDriver3[StorageDriver3["RAM"] = 0] = "RAM";
|
|
97590
|
-
StorageDriver3[StorageDriver3["IDB"] = 1] = "IDB";
|
|
97591
|
-
StorageDriver3[StorageDriver3["CHROME"] = 2] = "CHROME";
|
|
97592
|
-
StorageDriver3[StorageDriver3["FIREFOX"] = 3] = "FIREFOX";
|
|
97593
|
-
StorageDriver3[StorageDriver3["NODE"] = 4] = "NODE";
|
|
97594
|
-
StorageDriver3[StorageDriver3["LEVELJS"] = 11] = "LEVELJS";
|
|
97595
|
-
StorageDriver3[StorageDriver3["JSONDOWN"] = 12] = "JSONDOWN";
|
|
97596
|
-
})(StorageDriver2 = Storage2.StorageDriver || (Storage2.StorageDriver = {}));
|
|
97597
|
-
})(Storage = Client3.Storage || (Client3.Storage = {}));
|
|
97598
|
-
})(Client2 = Runtime2.Client || (Runtime2.Client = {}));
|
|
97599
|
-
})(Runtime || (Runtime = {}));
|
|
97600
|
-
|
|
97601
|
-
// src/version.ts
|
|
97602
|
-
var DXOS_VERSION = "2.33.8";
|
|
97603
|
-
|
|
97604
|
-
// src/api/errors.ts
|
|
97605
|
-
var import_debug3 = require("@dxos/debug");
|
|
97606
|
-
var InvalidConfigurationError = class extends import_debug3.DXOSError {
|
|
97607
|
-
constructor(message) {
|
|
97608
|
-
super("INVALID_CONFIGURATION", message);
|
|
97609
|
-
}
|
|
97610
|
-
};
|
|
97611
|
-
var RemoteServiceConnectionTimeout = class extends import_debug3.DXOSError {
|
|
97612
|
-
constructor(message) {
|
|
97613
|
-
super("REMOTE_SERVICE_CONNECTION_TIMEOUT", message);
|
|
97614
|
-
}
|
|
97615
|
-
};
|
|
97616
|
-
|
|
97617
|
-
// src/api/proxies/echo-proxy.ts
|
|
97618
|
-
var import_node_assert6 = __toESM(require_assert());
|
|
97619
|
-
var import_async8 = require("@dxos/async");
|
|
97620
|
-
var import_debug7 = require("@dxos/debug");
|
|
97621
|
-
var import_echo_db7 = __toESM(require_src14());
|
|
97147
|
+
var import_debug6 = require("@dxos/debug");
|
|
97148
|
+
var import_echo_db3 = __toESM(require_src14());
|
|
97622
97149
|
var import_model_factory = require("@dxos/model-factory");
|
|
97623
97150
|
var import_object_model = __toESM(require_src8());
|
|
97624
|
-
var
|
|
97151
|
+
var import_util2 = require("@dxos/util");
|
|
97625
97152
|
|
|
97626
|
-
// src/
|
|
97627
|
-
var
|
|
97628
|
-
var
|
|
97629
|
-
var import_debug5 = require("@dxos/debug");
|
|
97630
|
-
var import_echo_db5 = __toESM(require_src14());
|
|
97631
|
-
var import_rpc4 = require("@dxos/rpc");
|
|
97632
|
-
|
|
97633
|
-
// src/api/invitations/invitation-request.ts
|
|
97634
|
-
var import_node_assert4 = __toESM(require_assert());
|
|
97635
|
-
var import_async6 = require("@dxos/async");
|
|
97153
|
+
// src/packlets/proxy/invitation-proxy.ts
|
|
97154
|
+
var import_node_assert2 = __toESM(require_assert());
|
|
97155
|
+
var import_async3 = require("@dxos/async");
|
|
97636
97156
|
var import_debug4 = require("@dxos/debug");
|
|
97637
|
-
var
|
|
97638
|
-
|
|
97639
|
-
this._descriptor = _descriptor;
|
|
97640
|
-
this._hasConnected = false;
|
|
97641
|
-
this._isCanceled = false;
|
|
97642
|
-
this.canceled = new import_async6.Event();
|
|
97643
|
-
this.connected = connected;
|
|
97644
|
-
this.finished = finished;
|
|
97645
|
-
this.error = error2;
|
|
97646
|
-
this.connected.on(() => {
|
|
97647
|
-
this._hasConnected = true;
|
|
97648
|
-
});
|
|
97649
|
-
}
|
|
97650
|
-
get descriptor() {
|
|
97651
|
-
return this._descriptor;
|
|
97652
|
-
}
|
|
97653
|
-
get secret() {
|
|
97654
|
-
var _a;
|
|
97655
|
-
return (_a = this._descriptor.secret) != null ? _a : (0, import_debug4.raise)(new Error("Invitation secret is not set"));
|
|
97656
|
-
}
|
|
97657
|
-
get hasConnected() {
|
|
97658
|
-
return this._hasConnected;
|
|
97659
|
-
}
|
|
97660
|
-
cancel() {
|
|
97661
|
-
(0, import_node_assert4.default)(!this._isCanceled, new Error("Invitation is already canceled"));
|
|
97662
|
-
this._isCanceled = true;
|
|
97663
|
-
this.canceled.emit();
|
|
97664
|
-
}
|
|
97665
|
-
toString() {
|
|
97666
|
-
return `InvitationRequest(${JSON.stringify(this._descriptor.toQueryParameters())})`;
|
|
97667
|
-
}
|
|
97668
|
-
};
|
|
97669
|
-
|
|
97670
|
-
// src/api/invitations/invitation-proxy.ts
|
|
97157
|
+
var import_echo_db = __toESM(require_src14());
|
|
97158
|
+
var import_rpc3 = require("@dxos/rpc");
|
|
97671
97159
|
var InvitationProxy = class {
|
|
97672
97160
|
constructor() {
|
|
97673
97161
|
this.activeInvitations = [];
|
|
97674
|
-
this.invitationsUpdate = new
|
|
97162
|
+
this.invitationsUpdate = new import_async3.Event();
|
|
97675
97163
|
}
|
|
97676
97164
|
async createInvitationRequest({ stream }) {
|
|
97677
97165
|
return new Promise((resolve, reject) => {
|
|
97678
|
-
const connected = new
|
|
97679
|
-
const finished = new
|
|
97680
|
-
const error2 = new
|
|
97166
|
+
const connected = new import_async3.Event();
|
|
97167
|
+
const finished = new import_async3.Event();
|
|
97168
|
+
const error2 = new import_async3.Event();
|
|
97681
97169
|
let invitation;
|
|
97682
97170
|
connected.on(() => this.invitationsUpdate.emit());
|
|
97683
97171
|
stream.subscribe((invitationMsg) => {
|
|
97684
97172
|
if (!invitation) {
|
|
97685
|
-
(0,
|
|
97686
|
-
const descriptor =
|
|
97687
|
-
invitation = new
|
|
97173
|
+
(0, import_node_assert2.default)(invitationMsg.descriptor, "Missing invitation descriptor.");
|
|
97174
|
+
const descriptor = import_echo_db.InvitationDescriptor.fromProto(invitationMsg.descriptor);
|
|
97175
|
+
invitation = new InvitationRequest(descriptor, connected, finished, error2);
|
|
97688
97176
|
invitation.canceled.on(() => this._removeInvitation(invitation));
|
|
97689
97177
|
this.activeInvitations.push(invitation);
|
|
97690
97178
|
this.invitationsUpdate.emit();
|
|
@@ -97699,7 +97187,7 @@ var InvitationProxy = class {
|
|
|
97699
97187
|
stream.close();
|
|
97700
97188
|
}
|
|
97701
97189
|
if (invitationMsg.state === 4 /* ERROR */) {
|
|
97702
|
-
(0,
|
|
97190
|
+
(0, import_node_assert2.default)(invitationMsg.error, "Unknown error.");
|
|
97703
97191
|
const err = new Error(invitationMsg.error);
|
|
97704
97192
|
reject(err);
|
|
97705
97193
|
error2.emit(err);
|
|
@@ -97718,24 +97206,24 @@ var InvitationProxy = class {
|
|
|
97718
97206
|
this.invitationsUpdate.emit();
|
|
97719
97207
|
}
|
|
97720
97208
|
static handleInvitationRedemption({ stream, invitationDescriptor, onAuthenticate }) {
|
|
97721
|
-
const [getInvitationProcess, resolveInvitationProcess] = (0,
|
|
97722
|
-
const [waitForFinish, resolveFinish] = (0,
|
|
97209
|
+
const [getInvitationProcess, resolveInvitationProcess] = (0, import_async3.trigger)();
|
|
97210
|
+
const [waitForFinish, resolveFinish] = (0, import_async3.trigger)();
|
|
97723
97211
|
stream.subscribe(async (process2) => {
|
|
97724
97212
|
resolveInvitationProcess(process2);
|
|
97725
97213
|
if (process2.state === 3 /* SUCCESS */) {
|
|
97726
97214
|
resolveFinish(process2);
|
|
97727
97215
|
} else if (process2.state === 4 /* ERROR */) {
|
|
97728
|
-
(0,
|
|
97216
|
+
(0, import_node_assert2.default)(process2.error);
|
|
97729
97217
|
const error2 = new Error(process2.error);
|
|
97730
|
-
(0,
|
|
97218
|
+
(0, import_debug4.throwUnhandledRejection)(error2);
|
|
97731
97219
|
}
|
|
97732
97220
|
}, (err) => {
|
|
97733
|
-
if (err && !(err instanceof
|
|
97734
|
-
(0,
|
|
97221
|
+
if (err && !(err instanceof import_rpc3.RpcClosedError)) {
|
|
97222
|
+
(0, import_debug4.throwUnhandledRejection)(err);
|
|
97735
97223
|
}
|
|
97736
97224
|
});
|
|
97737
97225
|
const authenticate = async (secret) => {
|
|
97738
|
-
if (invitationDescriptor.type ===
|
|
97226
|
+
if (invitationDescriptor.type === import_echo_db.InvitationDescriptorType.OFFLINE) {
|
|
97739
97227
|
throw new Error("Cannot authenticate offline invitation.");
|
|
97740
97228
|
}
|
|
97741
97229
|
const invitationProcess = await getInvitationProcess();
|
|
@@ -97744,7 +97232,7 @@ var InvitationProxy = class {
|
|
|
97744
97232
|
secret
|
|
97745
97233
|
});
|
|
97746
97234
|
};
|
|
97747
|
-
if (invitationDescriptor.secret && invitationDescriptor.type ===
|
|
97235
|
+
if (invitationDescriptor.secret && invitationDescriptor.type === import_echo_db.InvitationDescriptorType.INTERACTIVE) {
|
|
97748
97236
|
void authenticate(invitationDescriptor.secret);
|
|
97749
97237
|
}
|
|
97750
97238
|
return {
|
|
@@ -97754,30 +97242,30 @@ var InvitationProxy = class {
|
|
|
97754
97242
|
}
|
|
97755
97243
|
};
|
|
97756
97244
|
|
|
97757
|
-
// src/
|
|
97758
|
-
var
|
|
97759
|
-
|
|
97760
|
-
|
|
97761
|
-
|
|
97762
|
-
|
|
97763
|
-
|
|
97764
|
-
|
|
97765
|
-
|
|
97766
|
-
|
|
97767
|
-
|
|
97768
|
-
|
|
97245
|
+
// src/packlets/proxy/party-proxy.ts
|
|
97246
|
+
var import_debug5 = require("@dxos/debug");
|
|
97247
|
+
var import_echo_db2 = __toESM(require_src14());
|
|
97248
|
+
|
|
97249
|
+
// src/packlets/proxy/service-proxy.ts
|
|
97250
|
+
var import_async4 = require("@dxos/async");
|
|
97251
|
+
var import_rpc4 = require("@dxos/rpc");
|
|
97252
|
+
var ClientServiceProxy = class {
|
|
97253
|
+
constructor(port2, _timeout = 300) {
|
|
97254
|
+
this._timeout = _timeout;
|
|
97255
|
+
this._client = (0, import_rpc4.createBundledRpcClient)(clientServiceBundle, {
|
|
97256
|
+
port: port2
|
|
97257
|
+
});
|
|
97258
|
+
this.services = this._client.rpc;
|
|
97769
97259
|
}
|
|
97770
|
-
|
|
97771
|
-
|
|
97260
|
+
async open(onProgressCallback) {
|
|
97261
|
+
await (0, import_async4.promiseTimeout)(this._client.open(), this._timeout, new RemoteServiceConnectionTimeout());
|
|
97772
97262
|
}
|
|
97773
|
-
|
|
97774
|
-
|
|
97263
|
+
async close() {
|
|
97264
|
+
this._client.close();
|
|
97775
97265
|
}
|
|
97776
97266
|
};
|
|
97777
97267
|
|
|
97778
|
-
// src/
|
|
97779
|
-
var import_debug6 = require("@dxos/debug");
|
|
97780
|
-
var import_echo_db6 = __toESM(require_src14());
|
|
97268
|
+
// src/packlets/proxy/party-proxy.ts
|
|
97781
97269
|
var PartyProxy = class {
|
|
97782
97270
|
constructor(_serviceProvider, _modelFactory, party, memberKey) {
|
|
97783
97271
|
this._serviceProvider = _serviceProvider;
|
|
@@ -97791,9 +97279,9 @@ var PartyProxy = class {
|
|
|
97791
97279
|
return;
|
|
97792
97280
|
}
|
|
97793
97281
|
if (this._serviceProvider instanceof ClientServiceProxy) {
|
|
97794
|
-
this._database = new
|
|
97795
|
-
} else if (this._serviceProvider
|
|
97796
|
-
const party2 = (_a = this._serviceProvider.echo.getParty(this._key)) != null ? _a : (0,
|
|
97282
|
+
this._database = new import_echo_db2.Database(this._modelFactory, new import_echo_db2.RemoteDatabaseBackend(this._serviceProvider.services.DataService, this._key), memberKey);
|
|
97283
|
+
} else if (this._serviceProvider.echo) {
|
|
97284
|
+
const party2 = (_a = this._serviceProvider.echo.getParty(this._key)) != null ? _a : (0, import_debug5.failUndefined)();
|
|
97797
97285
|
this._database = party2.database;
|
|
97798
97286
|
} else {
|
|
97799
97287
|
throw new Error("Unrecognized service provider.");
|
|
@@ -97828,7 +97316,7 @@ var PartyProxy = class {
|
|
|
97828
97316
|
if (this._database && this._serviceProvider instanceof ClientServiceProxy) {
|
|
97829
97317
|
await this._database.initialize();
|
|
97830
97318
|
}
|
|
97831
|
-
this._item = await ((_a = this._database) == null ? void 0 : _a.waitForItem({ type:
|
|
97319
|
+
this._item = await ((_a = this._database) == null ? void 0 : _a.waitForItem({ type: import_echo_db2.PARTY_ITEM_TYPE }));
|
|
97832
97320
|
}
|
|
97833
97321
|
async destroy() {
|
|
97834
97322
|
if (this._database && this._serviceProvider instanceof ClientServiceProxy) {
|
|
@@ -97863,10 +97351,10 @@ var PartyProxy = class {
|
|
|
97863
97351
|
return this._item.model;
|
|
97864
97352
|
}
|
|
97865
97353
|
async setTitle(title) {
|
|
97866
|
-
await this.setProperty(
|
|
97354
|
+
await this.setProperty(import_echo_db2.PARTY_TITLE_PROPERTY, title);
|
|
97867
97355
|
}
|
|
97868
97356
|
getTitle() {
|
|
97869
|
-
return this.getProperty(
|
|
97357
|
+
return this.getProperty(import_echo_db2.PARTY_TITLE_PROPERTY);
|
|
97870
97358
|
}
|
|
97871
97359
|
async setProperty(key, value) {
|
|
97872
97360
|
await this.properties.set(key, value);
|
|
@@ -97875,7 +97363,7 @@ var PartyProxy = class {
|
|
|
97875
97363
|
return this.properties.get(key, defaultValue);
|
|
97876
97364
|
}
|
|
97877
97365
|
queryMembers() {
|
|
97878
|
-
return streamToResultSet(this._serviceProvider.services.PartyService.subscribeMembers({ partyKey: this.key }), (response) => {
|
|
97366
|
+
return (0, import_echo_db2.streamToResultSet)(this._serviceProvider.services.PartyService.subscribeMembers({ partyKey: this.key }), (response) => {
|
|
97879
97367
|
var _a;
|
|
97880
97368
|
return (_a = response == null ? void 0 : response.members) != null ? _a : [];
|
|
97881
97369
|
});
|
|
@@ -97894,35 +97382,30 @@ var PartyProxy = class {
|
|
|
97894
97382
|
}
|
|
97895
97383
|
};
|
|
97896
97384
|
|
|
97897
|
-
// src/
|
|
97898
|
-
var PartyInvitation = class extends Invitation {
|
|
97899
|
-
getParty() {
|
|
97900
|
-
return this.wait();
|
|
97901
|
-
}
|
|
97902
|
-
};
|
|
97385
|
+
// src/packlets/proxy/echo-proxy.ts
|
|
97903
97386
|
var EchoProxy = class {
|
|
97904
97387
|
constructor(_serviceProvider, _haloProxy) {
|
|
97905
97388
|
this._serviceProvider = _serviceProvider;
|
|
97906
97389
|
this._haloProxy = _haloProxy;
|
|
97907
|
-
this._parties = new
|
|
97908
|
-
this._partiesChanged = new
|
|
97909
|
-
this._subscriptions = new
|
|
97910
|
-
this._modelFactory = _serviceProvider instanceof
|
|
97390
|
+
this._parties = new import_util2.ComplexMap((key) => key.toHex());
|
|
97391
|
+
this._partiesChanged = new import_async5.Event();
|
|
97392
|
+
this._subscriptions = new import_util2.SubscriptionGroup();
|
|
97393
|
+
this._modelFactory = _serviceProvider instanceof ClientServiceProxy ? new import_model_factory.ModelFactory() : _serviceProvider.echo.modelFactory;
|
|
97911
97394
|
this._modelFactory.registerModel(import_object_model.ObjectModel);
|
|
97912
97395
|
}
|
|
97913
97396
|
toString() {
|
|
97914
|
-
return `EchoProxy(${JSON.stringify(this.info
|
|
97397
|
+
return `EchoProxy(${JSON.stringify(this.info)})`;
|
|
97915
97398
|
}
|
|
97916
97399
|
get modelFactory() {
|
|
97917
97400
|
return this._modelFactory;
|
|
97918
97401
|
}
|
|
97919
97402
|
get networkManager() {
|
|
97920
|
-
if (this._serviceProvider instanceof
|
|
97921
|
-
|
|
97403
|
+
if (this._serviceProvider instanceof ClientServiceProxy) {
|
|
97404
|
+
throw new Error("Network Manager not available in service proxy.");
|
|
97922
97405
|
}
|
|
97923
|
-
|
|
97406
|
+
return this._serviceProvider.echo.networkManager;
|
|
97924
97407
|
}
|
|
97925
|
-
info() {
|
|
97408
|
+
get info() {
|
|
97926
97409
|
return {
|
|
97927
97410
|
parties: this._parties.size
|
|
97928
97411
|
};
|
|
@@ -97943,7 +97426,7 @@ var EchoProxy = class {
|
|
|
97943
97426
|
await partyProxy.initialize();
|
|
97944
97427
|
this._parties.set(partyProxy.key, partyProxy);
|
|
97945
97428
|
partyProxy.database.entityUpdate.on((entity) => {
|
|
97946
|
-
if (entity.type ===
|
|
97429
|
+
if (entity.type === import_echo_db3.PARTY_ITEM_TYPE) {
|
|
97947
97430
|
this._partiesChanged.emit();
|
|
97948
97431
|
}
|
|
97949
97432
|
});
|
|
@@ -97970,7 +97453,7 @@ var EchoProxy = class {
|
|
|
97970
97453
|
await this._subscriptions.unsubscribe();
|
|
97971
97454
|
}
|
|
97972
97455
|
async createParty() {
|
|
97973
|
-
const [partyReceivedPromise, partyReceived] = (0,
|
|
97456
|
+
const [partyReceivedPromise, partyReceived] = (0, import_async5.latch)();
|
|
97974
97457
|
const party = await this._serviceProvider.services.PartyService.createParty();
|
|
97975
97458
|
const handler = () => {
|
|
97976
97459
|
if (this._parties.has(party.publicKey)) {
|
|
@@ -97984,7 +97467,7 @@ var EchoProxy = class {
|
|
|
97984
97467
|
return this._parties.get(party.publicKey);
|
|
97985
97468
|
}
|
|
97986
97469
|
async cloneParty(snapshot) {
|
|
97987
|
-
const [partyReceivedPromise, partyReceived] = (0,
|
|
97470
|
+
const [partyReceivedPromise, partyReceived] = (0, import_async5.latch)();
|
|
97988
97471
|
const party = await this._serviceProvider.services.PartyService.cloneParty(snapshot);
|
|
97989
97472
|
const handler = () => {
|
|
97990
97473
|
if (this._parties.has(party.publicKey)) {
|
|
@@ -98001,7 +97484,7 @@ var EchoProxy = class {
|
|
|
98001
97484
|
return this._parties.get(partyKey);
|
|
98002
97485
|
}
|
|
98003
97486
|
queryParties() {
|
|
98004
|
-
return new
|
|
97487
|
+
return new import_echo_db3.ResultSet(this._partiesChanged, () => Array.from(this._parties.values()));
|
|
98005
97488
|
}
|
|
98006
97489
|
acceptInvitation(invitationDescriptor) {
|
|
98007
97490
|
const invitationProcessStream = this._serviceProvider.services.PartyService.acceptInvitation(invitationDescriptor.toProto());
|
|
@@ -98015,32 +97498,32 @@ var EchoProxy = class {
|
|
|
98015
97498
|
const waitForParty = async () => {
|
|
98016
97499
|
var _a;
|
|
98017
97500
|
const process2 = await waitForFinish();
|
|
98018
|
-
(0,
|
|
97501
|
+
(0, import_node_assert3.default)(process2.partyKey);
|
|
98019
97502
|
await this._partiesChanged.waitForCondition(() => this._parties.has(process2.partyKey));
|
|
98020
|
-
return (_a = this.getParty(process2.partyKey)) != null ? _a : (0,
|
|
97503
|
+
return (_a = this.getParty(process2.partyKey)) != null ? _a : (0, import_debug6.failUndefined)();
|
|
98021
97504
|
};
|
|
98022
97505
|
return new PartyInvitation(invitationDescriptor, waitForParty(), authenticate);
|
|
98023
97506
|
}
|
|
98024
97507
|
};
|
|
98025
97508
|
|
|
98026
|
-
// src/
|
|
98027
|
-
var
|
|
98028
|
-
var
|
|
98029
|
-
var
|
|
98030
|
-
var
|
|
97509
|
+
// src/packlets/proxy/halo-proxy.ts
|
|
97510
|
+
var import_async6 = require("@dxos/async");
|
|
97511
|
+
var import_credentials2 = __toESM(require_src5());
|
|
97512
|
+
var import_echo_db4 = __toESM(require_src14());
|
|
97513
|
+
var import_util3 = require("@dxos/util");
|
|
98031
97514
|
var HaloProxy = class {
|
|
98032
97515
|
constructor(_serviceProvider) {
|
|
98033
97516
|
this._serviceProvider = _serviceProvider;
|
|
98034
97517
|
this._invitationProxy = new InvitationProxy();
|
|
98035
|
-
this._subscriptions = new
|
|
98036
|
-
this._contactsChanged = new
|
|
98037
|
-
this.profileChanged = new
|
|
97518
|
+
this._subscriptions = new import_util3.SubscriptionGroup();
|
|
97519
|
+
this._contactsChanged = new import_async6.Event();
|
|
97520
|
+
this.profileChanged = new import_async6.Event();
|
|
98038
97521
|
this._contacts = [];
|
|
98039
97522
|
}
|
|
98040
97523
|
toString() {
|
|
98041
|
-
return `HaloProxy(${JSON.stringify(this.info
|
|
97524
|
+
return `HaloProxy(${JSON.stringify(this.info)})`;
|
|
98042
97525
|
}
|
|
98043
|
-
info() {
|
|
97526
|
+
get info() {
|
|
98044
97527
|
var _a;
|
|
98045
97528
|
return {
|
|
98046
97529
|
key: (_a = this._profile) == null ? void 0 : _a.publicKey
|
|
@@ -98065,7 +97548,7 @@ var HaloProxy = class {
|
|
|
98065
97548
|
throw new Error("Seedphrase must not be specified with existing keys");
|
|
98066
97549
|
}
|
|
98067
97550
|
if (seedphrase) {
|
|
98068
|
-
const keyPair = (0,
|
|
97551
|
+
const keyPair = (0, import_credentials2.keyPairFromSeedPhrase)(seedphrase);
|
|
98069
97552
|
publicKey = keyPair.publicKey;
|
|
98070
97553
|
secretKey = keyPair.secretKey;
|
|
98071
97554
|
}
|
|
@@ -98077,7 +97560,7 @@ var HaloProxy = class {
|
|
|
98077
97560
|
return this._profile;
|
|
98078
97561
|
}
|
|
98079
97562
|
queryContacts() {
|
|
98080
|
-
return new
|
|
97563
|
+
return new import_echo_db4.ResultSet(this._contactsChanged, () => this._contacts);
|
|
98081
97564
|
}
|
|
98082
97565
|
async createInvitation() {
|
|
98083
97566
|
const stream = await this._serviceProvider.services.ProfileService.createInvitation();
|
|
@@ -98144,8 +97627,35 @@ var HaloProxy = class {
|
|
|
98144
97627
|
}
|
|
98145
97628
|
};
|
|
98146
97629
|
|
|
98147
|
-
// src/
|
|
98148
|
-
var
|
|
97630
|
+
// src/packlets/proxy/messages.ts
|
|
97631
|
+
var import_util4 = require("@dxos/util");
|
|
97632
|
+
var createWindowMessagePort = () => {
|
|
97633
|
+
if ((0, import_util4.isNode)()) {
|
|
97634
|
+
throw new Error("Connecting to wallet extension is not available in Node environment.");
|
|
97635
|
+
}
|
|
97636
|
+
return {
|
|
97637
|
+
send: async (message) => window.postMessage({
|
|
97638
|
+
payloadFromAppToContentScript: Array.from(message)
|
|
97639
|
+
}, "*"),
|
|
97640
|
+
subscribe: (callback) => {
|
|
97641
|
+
const listener = (event) => {
|
|
97642
|
+
var _a;
|
|
97643
|
+
const payload = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.payloadFromContentScriptToApp;
|
|
97644
|
+
if (payload) {
|
|
97645
|
+
callback(new Uint8Array(payload));
|
|
97646
|
+
}
|
|
97647
|
+
};
|
|
97648
|
+
window.addEventListener("message", listener);
|
|
97649
|
+
return () => window.removeEventListener("message", listener);
|
|
97650
|
+
}
|
|
97651
|
+
};
|
|
97652
|
+
};
|
|
97653
|
+
|
|
97654
|
+
// src/packlets/proxy/version.ts
|
|
97655
|
+
var DXOS_VERSION = "2.33.8";
|
|
97656
|
+
|
|
97657
|
+
// src/packlets/proxy/client-proxy.ts
|
|
97658
|
+
var log2 = (0, import_debug7.default)("dxos:client-proxy");
|
|
98149
97659
|
var EXPECTED_CONFIG_VERSION = 1;
|
|
98150
97660
|
var defaultConfig = { version: 1 };
|
|
98151
97661
|
var defaultTestingConfig = {
|
|
@@ -98162,11 +97672,19 @@ var Client = class {
|
|
|
98162
97672
|
constructor(config = defaultConfig, options = {}) {
|
|
98163
97673
|
this.version = DXOS_VERSION;
|
|
98164
97674
|
this._initialized = false;
|
|
97675
|
+
var _a;
|
|
98165
97676
|
if (typeof config !== "object" || config == null) {
|
|
98166
|
-
throw new
|
|
97677
|
+
throw new import_debug8.InvalidParameterError("Invalid config.");
|
|
98167
97678
|
}
|
|
98168
|
-
this._config = config instanceof
|
|
97679
|
+
this._config = config instanceof import_config2.Config ? config : new import_config2.Config(config);
|
|
98169
97680
|
this._options = options;
|
|
97681
|
+
if (options.serviceProvider) {
|
|
97682
|
+
this._serviceProvider = options.serviceProvider;
|
|
97683
|
+
} else {
|
|
97684
|
+
this._serviceProvider = new ClientServiceProxy((_a = this._options.rpcPort) != null ? _a : createWindowMessagePort(), this._options.timeout);
|
|
97685
|
+
}
|
|
97686
|
+
this._halo = new HaloProxy(this._serviceProvider);
|
|
97687
|
+
this._echo = new EchoProxy(this._serviceProvider, this._halo);
|
|
98170
97688
|
if (Object.keys(this._config.values).length > 0 && this._config.values.version !== EXPECTED_CONFIG_VERSION) {
|
|
98171
97689
|
throw new InvalidConfigurationError(`Invalid config version: ${this._config.values.version} !== ${EXPECTED_CONFIG_VERSION}]`);
|
|
98172
97690
|
}
|
|
@@ -98174,13 +97692,13 @@ var Client = class {
|
|
|
98174
97692
|
log2(`mode=${Runtime.Client.Mode[this._mode]}`);
|
|
98175
97693
|
}
|
|
98176
97694
|
toString() {
|
|
98177
|
-
return `Client(${JSON.stringify(this.info
|
|
97695
|
+
return `Client(${JSON.stringify(this.info)})`;
|
|
98178
97696
|
}
|
|
98179
|
-
info() {
|
|
97697
|
+
get info() {
|
|
98180
97698
|
return {
|
|
98181
97699
|
initialized: this.initialized,
|
|
98182
|
-
echo: this.echo.info
|
|
98183
|
-
halo: this.halo.info
|
|
97700
|
+
echo: this.echo.info,
|
|
97701
|
+
halo: this.halo.info
|
|
98184
97702
|
};
|
|
98185
97703
|
}
|
|
98186
97704
|
get config() {
|
|
@@ -98190,16 +97708,13 @@ var Client = class {
|
|
|
98190
97708
|
return this._initialized;
|
|
98191
97709
|
}
|
|
98192
97710
|
get echo() {
|
|
98193
|
-
(0,
|
|
97711
|
+
(0, import_node_assert4.default)(this._echo, "Client not initialized.");
|
|
98194
97712
|
return this._echo;
|
|
98195
97713
|
}
|
|
98196
97714
|
get halo() {
|
|
98197
|
-
(0,
|
|
97715
|
+
(0, import_node_assert4.default)(this._halo, "Client not initialized.");
|
|
98198
97716
|
return this._halo;
|
|
98199
97717
|
}
|
|
98200
|
-
get isRemote() {
|
|
98201
|
-
return this._serviceProvider instanceof ClientServiceProxy;
|
|
98202
|
-
}
|
|
98203
97718
|
get services() {
|
|
98204
97719
|
return this._serviceProvider.services;
|
|
98205
97720
|
}
|
|
@@ -98209,55 +97724,17 @@ var Client = class {
|
|
|
98209
97724
|
}
|
|
98210
97725
|
const t = 10;
|
|
98211
97726
|
const timeout = setTimeout(() => {
|
|
98212
|
-
throw new
|
|
97727
|
+
throw new import_debug8.TimeoutError(`Initialize timed out after ${t}s.`);
|
|
98213
97728
|
}, t * 1e3);
|
|
98214
|
-
|
|
98215
|
-
|
|
98216
|
-
|
|
98217
|
-
await this.initializeLocal(onProgressCallback);
|
|
98218
|
-
} else {
|
|
98219
|
-
await this.initializeAuto(onProgressCallback);
|
|
98220
|
-
}
|
|
97729
|
+
await this._serviceProvider.open(onProgressCallback);
|
|
97730
|
+
await this._halo._open();
|
|
97731
|
+
await this._echo._open();
|
|
98221
97732
|
if (typeof window !== "undefined") {
|
|
98222
97733
|
await createDevtoolsRpcServer(this, this._serviceProvider);
|
|
98223
97734
|
}
|
|
98224
|
-
this._halo = new HaloProxy(this._serviceProvider);
|
|
98225
|
-
this._echo = new EchoProxy(this._serviceProvider, this._halo);
|
|
98226
|
-
await this._halo._open();
|
|
98227
|
-
await this._echo._open();
|
|
98228
97735
|
this._initialized = true;
|
|
98229
97736
|
clearInterval(timeout);
|
|
98230
97737
|
}
|
|
98231
|
-
async initializeRemote(onProgressCallback) {
|
|
98232
|
-
var _a;
|
|
98233
|
-
if (!this._options.rpcPort && isNode()) {
|
|
98234
|
-
throw new Error("RPC port is required to run client in remote mode on Node environment.");
|
|
98235
|
-
}
|
|
98236
|
-
log2("Creating client proxy.");
|
|
98237
|
-
this._serviceProvider = new ClientServiceProxy((_a = this._options.rpcPort) != null ? _a : createWindowMessagePort(), this._options.timeout);
|
|
98238
|
-
await this._serviceProvider.open(onProgressCallback);
|
|
98239
|
-
}
|
|
98240
|
-
async initializeLocal(onProgressCallback) {
|
|
98241
|
-
log2("Creating client host.");
|
|
98242
|
-
this._serviceProvider = new ClientServiceHost(this._config, this._options);
|
|
98243
|
-
await this._serviceProvider.open(onProgressCallback);
|
|
98244
|
-
}
|
|
98245
|
-
async initializeAuto(onProgressCallback) {
|
|
98246
|
-
if (!this._options.rpcPort && isNode()) {
|
|
98247
|
-
await this.initializeLocal(onProgressCallback);
|
|
98248
|
-
} else {
|
|
98249
|
-
try {
|
|
98250
|
-
await this.initializeRemote(onProgressCallback);
|
|
98251
|
-
} catch (error2) {
|
|
98252
|
-
if (error2 instanceof RemoteServiceConnectionTimeout) {
|
|
98253
|
-
log2("Failed to connect to remote services. Starting local services.");
|
|
98254
|
-
await this.initializeLocal(onProgressCallback);
|
|
98255
|
-
} else {
|
|
98256
|
-
throw error2;
|
|
98257
|
-
}
|
|
98258
|
-
}
|
|
98259
|
-
}
|
|
98260
|
-
}
|
|
98261
97738
|
async destroy() {
|
|
98262
97739
|
await this._echo._close();
|
|
98263
97740
|
this._halo._close();
|
|
@@ -98278,16 +97755,16 @@ var Client = class {
|
|
|
98278
97755
|
}
|
|
98279
97756
|
};
|
|
98280
97757
|
__decorateClass([
|
|
98281
|
-
|
|
97758
|
+
import_async7.synchronized
|
|
98282
97759
|
], Client.prototype, "initialize", 1);
|
|
98283
97760
|
__decorateClass([
|
|
98284
|
-
|
|
97761
|
+
import_async7.synchronized
|
|
98285
97762
|
], Client.prototype, "destroy", 1);
|
|
98286
97763
|
__decorateClass([
|
|
98287
|
-
|
|
97764
|
+
import_async7.synchronized
|
|
98288
97765
|
], Client.prototype, "reset", 1);
|
|
98289
97766
|
|
|
98290
|
-
// src/
|
|
97767
|
+
// src/packlets/proxy/serializer.ts
|
|
98291
97768
|
var partyCodec = schema.getCodecForType("dxos.echo.snapshot.PartySnapshot");
|
|
98292
97769
|
var PartySerializer = class {
|
|
98293
97770
|
constructor(_client) {
|
|
@@ -98302,16 +97779,542 @@ var PartySerializer = class {
|
|
|
98302
97779
|
}
|
|
98303
97780
|
};
|
|
98304
97781
|
|
|
98305
|
-
// src/
|
|
98306
|
-
var
|
|
98307
|
-
|
|
98308
|
-
|
|
98309
|
-
|
|
98310
|
-
|
|
98311
|
-
|
|
98312
|
-
|
|
98313
|
-
|
|
98314
|
-
|
|
97782
|
+
// src/packlets/services/service-host.ts
|
|
97783
|
+
var debug3 = __toESM(require("@dxos/debug"));
|
|
97784
|
+
var import_echo_db8 = __toESM(require_src14());
|
|
97785
|
+
|
|
97786
|
+
// src/packlets/services/impl/halo.ts
|
|
97787
|
+
var import_node_assert5 = __toESM(require_assert());
|
|
97788
|
+
var import_codec_protobuf9 = require("@dxos/codec-protobuf");
|
|
97789
|
+
var import_echo_db5 = __toESM(require_src14());
|
|
97790
|
+
var import_util5 = require("@dxos/util");
|
|
97791
|
+
var HaloService2 = class {
|
|
97792
|
+
constructor(echo, signer) {
|
|
97793
|
+
this.echo = echo;
|
|
97794
|
+
this.signer = signer;
|
|
97795
|
+
}
|
|
97796
|
+
async sign(request) {
|
|
97797
|
+
(0, import_node_assert5.default)(this.signer, "Signer not set.");
|
|
97798
|
+
(0, import_node_assert5.default)(request.publicKey, "Provide a publicKey of the key that should be used for signing.");
|
|
97799
|
+
const key = await this.echo.halo.keyring.getFullKey(request.publicKey);
|
|
97800
|
+
(0, import_node_assert5.default)(key, "Key not found.");
|
|
97801
|
+
return this.signer.sign(request, key);
|
|
97802
|
+
}
|
|
97803
|
+
async addKeyRecord(request) {
|
|
97804
|
+
(0, import_node_assert5.default)(request.keyRecord && request.keyRecord.publicKey, "Missing key record.");
|
|
97805
|
+
await this.echo.halo.keyring.addKeyRecord(request.keyRecord);
|
|
97806
|
+
(0, import_node_assert5.default)(await this.echo.halo.keyring.getKey(request.keyRecord.publicKey), "Key not inserted correctly.");
|
|
97807
|
+
}
|
|
97808
|
+
subscribeContacts() {
|
|
97809
|
+
if (this.echo.halo.identity) {
|
|
97810
|
+
return (0, import_echo_db5.resultSetToStream)(this.echo.halo.queryContacts(), (contacts) => ({ contacts }));
|
|
97811
|
+
}
|
|
97812
|
+
return new import_codec_protobuf9.Stream(({ next }) => {
|
|
97813
|
+
if (!this.echo.halo.identity) {
|
|
97814
|
+
next({ contacts: [] });
|
|
97815
|
+
}
|
|
97816
|
+
const subGroup = new import_util5.SubscriptionGroup();
|
|
97817
|
+
setImmediate(async () => {
|
|
97818
|
+
await this.echo.halo.identityReady.waitForCondition(() => !!this.echo.halo.identity);
|
|
97819
|
+
const resultSet = this.echo.halo.queryContacts();
|
|
97820
|
+
next({ contacts: resultSet.value });
|
|
97821
|
+
subGroup.push(resultSet.update.on(() => next({ contacts: resultSet.value })));
|
|
97822
|
+
});
|
|
97823
|
+
return () => subGroup.unsubscribe();
|
|
97824
|
+
});
|
|
97825
|
+
}
|
|
97826
|
+
async setGlobalPreference(request) {
|
|
97827
|
+
var _a, _b, _c;
|
|
97828
|
+
(0, import_node_assert5.default)(request.key, "Missing key of property.");
|
|
97829
|
+
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getGlobalPreferences()) == null ? void 0 : _c.model;
|
|
97830
|
+
(0, import_node_assert5.default)(preferences, "Preferences failed to load.");
|
|
97831
|
+
await preferences.setProperty(request.key, request.value);
|
|
97832
|
+
}
|
|
97833
|
+
async getGlobalPreference(request) {
|
|
97834
|
+
var _a, _b, _c;
|
|
97835
|
+
(0, import_node_assert5.default)(request.key, "Missing key of property.");
|
|
97836
|
+
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getGlobalPreferences()) == null ? void 0 : _c.model;
|
|
97837
|
+
return {
|
|
97838
|
+
value: preferences == null ? void 0 : preferences.getProperty(request.key)
|
|
97839
|
+
};
|
|
97840
|
+
}
|
|
97841
|
+
async setDevicePreference(request) {
|
|
97842
|
+
var _a, _b, _c;
|
|
97843
|
+
(0, import_node_assert5.default)(request.key, "Missing key of property.");
|
|
97844
|
+
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getDevicePreferences()) == null ? void 0 : _c.model;
|
|
97845
|
+
(0, import_node_assert5.default)(preferences, "Preferences failed to load.");
|
|
97846
|
+
await preferences.setProperty(request.key, request.value);
|
|
97847
|
+
}
|
|
97848
|
+
async getDevicePreference(request) {
|
|
97849
|
+
var _a, _b, _c;
|
|
97850
|
+
(0, import_node_assert5.default)(request.key, "Missing key of property.");
|
|
97851
|
+
const preferences = (_c = (_b = (_a = this.echo.halo.identity) == null ? void 0 : _a.preferences) == null ? void 0 : _b.getDevicePreferences()) == null ? void 0 : _c.model;
|
|
97852
|
+
return {
|
|
97853
|
+
value: preferences == null ? void 0 : preferences.getProperty(request.key)
|
|
97854
|
+
};
|
|
97855
|
+
}
|
|
97856
|
+
};
|
|
97857
|
+
var createHaloService = ({ echo, signer }) => new HaloService2(echo, signer);
|
|
97858
|
+
|
|
97859
|
+
// src/packlets/services/impl/party.ts
|
|
97860
|
+
var import_node_assert6 = __toESM(require_assert());
|
|
97861
|
+
var import_uuid = require("uuid");
|
|
97862
|
+
var import_async8 = require("@dxos/async");
|
|
97863
|
+
var import_codec_protobuf10 = require("@dxos/codec-protobuf");
|
|
97864
|
+
var import_credentials3 = __toESM(require_src5());
|
|
97865
|
+
var import_debug9 = require("@dxos/debug");
|
|
97866
|
+
var import_echo_db6 = __toESM(require_src14());
|
|
97867
|
+
var PartyService2 = class {
|
|
97868
|
+
constructor(echo) {
|
|
97869
|
+
this.echo = echo;
|
|
97870
|
+
this.inviteeInvitations = /* @__PURE__ */ new Map();
|
|
97871
|
+
}
|
|
97872
|
+
subscribeToParty(request) {
|
|
97873
|
+
const update = (next) => {
|
|
97874
|
+
try {
|
|
97875
|
+
const party2 = this.echo.getParty(request.partyKey);
|
|
97876
|
+
next({
|
|
97877
|
+
party: party2 && {
|
|
97878
|
+
publicKey: party2.key,
|
|
97879
|
+
isOpen: party2.isOpen,
|
|
97880
|
+
isActive: party2.isActive,
|
|
97881
|
+
members: party2.queryMembers().value
|
|
97882
|
+
}
|
|
97883
|
+
});
|
|
97884
|
+
} catch (error2) {
|
|
97885
|
+
if (error2 instanceof import_debug9.InvalidStateError) {
|
|
97886
|
+
} else {
|
|
97887
|
+
throw error2;
|
|
97888
|
+
}
|
|
97889
|
+
}
|
|
97890
|
+
};
|
|
97891
|
+
const party = this.echo.getParty(request.partyKey);
|
|
97892
|
+
if (party) {
|
|
97893
|
+
return new import_codec_protobuf10.Stream(({ next }) => party.update.on(() => update(next)));
|
|
97894
|
+
} else {
|
|
97895
|
+
return new import_codec_protobuf10.Stream(({ next }) => {
|
|
97896
|
+
let unsubscribeParty;
|
|
97897
|
+
const unsubscribeParties = this.echo.queryParties().subscribe((parties) => {
|
|
97898
|
+
const party2 = parties.find((party3) => party3.key.equals(request.partyKey));
|
|
97899
|
+
if (party2 && !unsubscribeParty) {
|
|
97900
|
+
unsubscribeParty = party2.update.on(() => update(next));
|
|
97901
|
+
}
|
|
97902
|
+
});
|
|
97903
|
+
update(next);
|
|
97904
|
+
return () => {
|
|
97905
|
+
unsubscribeParties();
|
|
97906
|
+
unsubscribeParty == null ? void 0 : unsubscribeParty();
|
|
97907
|
+
};
|
|
97908
|
+
});
|
|
97909
|
+
}
|
|
97910
|
+
}
|
|
97911
|
+
subscribeParties() {
|
|
97912
|
+
return (0, import_echo_db6.resultSetToStream)(this.echo.queryParties(), (parties) => ({
|
|
97913
|
+
parties: parties.map((party) => ({
|
|
97914
|
+
publicKey: party.key,
|
|
97915
|
+
isOpen: party.isOpen,
|
|
97916
|
+
isActive: party.isActive,
|
|
97917
|
+
members: party.queryMembers().value
|
|
97918
|
+
}))
|
|
97919
|
+
}));
|
|
97920
|
+
}
|
|
97921
|
+
async getPartyDetails(request) {
|
|
97922
|
+
var _a;
|
|
97923
|
+
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug9.raise)(new import_echo_db6.PartyNotFoundError(request.partyKey));
|
|
97924
|
+
return {
|
|
97925
|
+
processedTimeframe: party.timeframe
|
|
97926
|
+
};
|
|
97927
|
+
}
|
|
97928
|
+
async createParty() {
|
|
97929
|
+
const party = await this.echo.createParty();
|
|
97930
|
+
return {
|
|
97931
|
+
publicKey: party.key,
|
|
97932
|
+
isOpen: party.isOpen,
|
|
97933
|
+
isActive: party.isActive
|
|
97934
|
+
};
|
|
97935
|
+
}
|
|
97936
|
+
async cloneParty(snapshot) {
|
|
97937
|
+
const party = await this.echo.cloneParty(snapshot);
|
|
97938
|
+
return {
|
|
97939
|
+
publicKey: party.key,
|
|
97940
|
+
isOpen: party.isOpen,
|
|
97941
|
+
isActive: party.isActive
|
|
97942
|
+
};
|
|
97943
|
+
}
|
|
97944
|
+
async setPartyState(request) {
|
|
97945
|
+
const party = this.echo.getParty(request.partyKey);
|
|
97946
|
+
if (!party) {
|
|
97947
|
+
throw new Error("Party not found");
|
|
97948
|
+
}
|
|
97949
|
+
if (request.open === true) {
|
|
97950
|
+
await party.open();
|
|
97951
|
+
} else if (request.open === false) {
|
|
97952
|
+
await party.close();
|
|
97953
|
+
}
|
|
97954
|
+
if (request.activeGlobal === true) {
|
|
97955
|
+
await party.activate({ global: true });
|
|
97956
|
+
} else if (request.activeGlobal === false) {
|
|
97957
|
+
await party.deactivate({ global: true });
|
|
97958
|
+
}
|
|
97959
|
+
if (request.activeDevice === true) {
|
|
97960
|
+
await party.activate({ device: true });
|
|
97961
|
+
} else if (request.activeDevice === false) {
|
|
97962
|
+
await party.deactivate({ device: true });
|
|
97963
|
+
}
|
|
97964
|
+
return {
|
|
97965
|
+
publicKey: party.key,
|
|
97966
|
+
isOpen: party.isOpen,
|
|
97967
|
+
isActive: party.isActive
|
|
97968
|
+
};
|
|
97969
|
+
}
|
|
97970
|
+
createInvitation(request) {
|
|
97971
|
+
return new import_codec_protobuf10.Stream(({ next, close }) => {
|
|
97972
|
+
var _a;
|
|
97973
|
+
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug9.raise)(new import_echo_db6.PartyNotFoundError(request.partyKey));
|
|
97974
|
+
setImmediate(async () => {
|
|
97975
|
+
try {
|
|
97976
|
+
let invitation;
|
|
97977
|
+
if (!request.inviteeKey) {
|
|
97978
|
+
const secret = Buffer.from((0, import_credentials3.generatePasscode)());
|
|
97979
|
+
const secretProvider = async () => {
|
|
97980
|
+
next({ state: 2 /* CONNECTED */ });
|
|
97981
|
+
return Buffer.from(secret);
|
|
97982
|
+
};
|
|
97983
|
+
invitation = await party.invitationManager.createInvitation({
|
|
97984
|
+
secretProvider,
|
|
97985
|
+
secretValidator: import_credentials3.defaultSecretValidator
|
|
97986
|
+
}, {
|
|
97987
|
+
onFinish: () => {
|
|
97988
|
+
next({ state: 3 /* SUCCESS */ });
|
|
97989
|
+
close();
|
|
97990
|
+
}
|
|
97991
|
+
});
|
|
97992
|
+
(0, import_node_assert6.default)(invitation.type === import_echo_db6.InvitationDescriptorType.INTERACTIVE);
|
|
97993
|
+
invitation.secret = Buffer.from(secret);
|
|
97994
|
+
} else {
|
|
97995
|
+
invitation = await party.invitationManager.createOfflineInvitation(request.inviteeKey);
|
|
97996
|
+
}
|
|
97997
|
+
next({ state: 1 /* WAITING_FOR_CONNECTION */, descriptor: invitation.toProto() });
|
|
97998
|
+
if (invitation.type === import_echo_db6.InvitationDescriptorType.OFFLINE) {
|
|
97999
|
+
close();
|
|
98000
|
+
}
|
|
98001
|
+
} catch (error2) {
|
|
98002
|
+
next({ state: 4 /* ERROR */, error: error2.message });
|
|
98003
|
+
close();
|
|
98004
|
+
}
|
|
98005
|
+
});
|
|
98006
|
+
});
|
|
98007
|
+
}
|
|
98008
|
+
acceptInvitation(request) {
|
|
98009
|
+
return new import_codec_protobuf10.Stream(({ next, close }) => {
|
|
98010
|
+
const id = (0, import_uuid.v4)();
|
|
98011
|
+
const [secretLatch, secretTrigger] = (0, import_async8.latch)();
|
|
98012
|
+
const inviteeInvitation = { secretTrigger };
|
|
98013
|
+
const secretProvider = async () => {
|
|
98014
|
+
await secretLatch;
|
|
98015
|
+
const secret = inviteeInvitation.secret;
|
|
98016
|
+
if (!secret) {
|
|
98017
|
+
throw new Error("Secret not provided.");
|
|
98018
|
+
}
|
|
98019
|
+
return Buffer.from(secret);
|
|
98020
|
+
};
|
|
98021
|
+
const partyPromise = this.echo.joinParty(import_echo_db6.InvitationDescriptor.fromProto(request), request.type === import_echo_db6.InvitationDescriptorType.INTERACTIVE ? secretProvider : void 0);
|
|
98022
|
+
this.inviteeInvitations.set(id, inviteeInvitation);
|
|
98023
|
+
next({ id, state: 2 /* CONNECTED */ });
|
|
98024
|
+
partyPromise.then((party) => {
|
|
98025
|
+
next({ id, state: 3 /* SUCCESS */, partyKey: party.key });
|
|
98026
|
+
}).catch((err) => {
|
|
98027
|
+
console.error(err);
|
|
98028
|
+
next({ id, state: 4 /* ERROR */, error: String(err) });
|
|
98029
|
+
}).finally(() => {
|
|
98030
|
+
close();
|
|
98031
|
+
});
|
|
98032
|
+
});
|
|
98033
|
+
}
|
|
98034
|
+
async authenticateInvitation(request) {
|
|
98035
|
+
var _a;
|
|
98036
|
+
(0, import_node_assert6.default)(request.processId, "Process ID is missing.");
|
|
98037
|
+
const invitation = this.inviteeInvitations.get(request.processId);
|
|
98038
|
+
(0, import_node_assert6.default)(invitation, "Invitation not found.");
|
|
98039
|
+
(0, import_node_assert6.default)(request.secret, "Secret not provided.");
|
|
98040
|
+
invitation.secret = request.secret;
|
|
98041
|
+
(_a = invitation.secretTrigger) == null ? void 0 : _a.call(invitation);
|
|
98042
|
+
}
|
|
98043
|
+
subscribeMembers(request) {
|
|
98044
|
+
const party = this.echo.getParty(request.partyKey);
|
|
98045
|
+
if (party) {
|
|
98046
|
+
return (0, import_echo_db6.resultSetToStream)(party.queryMembers(), (members) => ({ members }));
|
|
98047
|
+
} else {
|
|
98048
|
+
return new import_codec_protobuf10.Stream(({ next }) => {
|
|
98049
|
+
let unsubscribeMembers;
|
|
98050
|
+
const unsubscribeParties = this.echo.queryParties().subscribe((parties) => {
|
|
98051
|
+
const party2 = parties.find((party3) => party3.key.equals(request.partyKey));
|
|
98052
|
+
if (!unsubscribeMembers && party2) {
|
|
98053
|
+
const resultSet = party2.queryMembers();
|
|
98054
|
+
next({ members: resultSet.value });
|
|
98055
|
+
unsubscribeMembers = resultSet.update.on(() => next({ members: resultSet.value }));
|
|
98056
|
+
}
|
|
98057
|
+
});
|
|
98058
|
+
return () => {
|
|
98059
|
+
unsubscribeParties();
|
|
98060
|
+
unsubscribeMembers();
|
|
98061
|
+
};
|
|
98062
|
+
});
|
|
98063
|
+
}
|
|
98064
|
+
}
|
|
98065
|
+
async createSnapshot(request) {
|
|
98066
|
+
var _a;
|
|
98067
|
+
(0, import_node_assert6.default)(request.partyKey);
|
|
98068
|
+
const party = (_a = this.echo.getParty(request.partyKey)) != null ? _a : (0, import_debug9.raise)(new import_echo_db6.PartyNotFoundError(request.partyKey));
|
|
98069
|
+
return party.createSnapshot();
|
|
98070
|
+
}
|
|
98071
|
+
};
|
|
98072
|
+
var createPartyService = ({ echo }) => new PartyService2(echo);
|
|
98073
|
+
|
|
98074
|
+
// src/packlets/services/impl/profile.ts
|
|
98075
|
+
var import_node_assert7 = __toESM(require_assert());
|
|
98076
|
+
var import_uuid2 = require("uuid");
|
|
98077
|
+
var import_async9 = require("@dxos/async");
|
|
98078
|
+
var import_codec_protobuf11 = require("@dxos/codec-protobuf");
|
|
98079
|
+
var import_credentials4 = __toESM(require_src5());
|
|
98080
|
+
var import_echo_db7 = __toESM(require_src14());
|
|
98081
|
+
var ProfileService2 = class {
|
|
98082
|
+
constructor(echo) {
|
|
98083
|
+
this.echo = echo;
|
|
98084
|
+
this.inviteeInvitations = /* @__PURE__ */ new Map();
|
|
98085
|
+
}
|
|
98086
|
+
subscribeProfile() {
|
|
98087
|
+
return new import_codec_protobuf11.Stream(({ next }) => {
|
|
98088
|
+
const emitNext = () => next({
|
|
98089
|
+
profile: this.echo.halo.isInitialized ? this.echo.halo.getProfile() : void 0
|
|
98090
|
+
});
|
|
98091
|
+
emitNext();
|
|
98092
|
+
return this.echo.halo.subscribeToProfile(emitNext);
|
|
98093
|
+
});
|
|
98094
|
+
}
|
|
98095
|
+
async createProfile(request) {
|
|
98096
|
+
return this.echo.halo.createProfile(request);
|
|
98097
|
+
}
|
|
98098
|
+
async recoverProfile(request) {
|
|
98099
|
+
if (!request.seedPhrase) {
|
|
98100
|
+
throw new Error("Recovery SeedPhrase not provided.");
|
|
98101
|
+
}
|
|
98102
|
+
await this.echo.open();
|
|
98103
|
+
await this.echo.halo.recover(request.seedPhrase);
|
|
98104
|
+
const profile = this.echo.halo.getProfile();
|
|
98105
|
+
(0, import_node_assert7.default)(profile, "Recovering profile failed.");
|
|
98106
|
+
return profile;
|
|
98107
|
+
}
|
|
98108
|
+
createInvitation() {
|
|
98109
|
+
return new import_codec_protobuf11.Stream(({ next, close }) => {
|
|
98110
|
+
setImmediate(async () => {
|
|
98111
|
+
const secret = Buffer.from((0, import_credentials4.generatePasscode)());
|
|
98112
|
+
let invitation;
|
|
98113
|
+
const secretProvider = async () => {
|
|
98114
|
+
next({ descriptor: invitation.toProto(), state: 2 /* CONNECTED */ });
|
|
98115
|
+
return Buffer.from(secret);
|
|
98116
|
+
};
|
|
98117
|
+
invitation = await this.echo.halo.createInvitation({
|
|
98118
|
+
secretProvider,
|
|
98119
|
+
secretValidator: import_credentials4.defaultSecretValidator
|
|
98120
|
+
}, {
|
|
98121
|
+
onFinish: () => {
|
|
98122
|
+
next({ state: 3 /* SUCCESS */ });
|
|
98123
|
+
close();
|
|
98124
|
+
}
|
|
98125
|
+
});
|
|
98126
|
+
invitation.secret = secret;
|
|
98127
|
+
next({ descriptor: invitation.toProto(), state: 1 /* WAITING_FOR_CONNECTION */ });
|
|
98128
|
+
});
|
|
98129
|
+
});
|
|
98130
|
+
}
|
|
98131
|
+
acceptInvitation(request) {
|
|
98132
|
+
return new import_codec_protobuf11.Stream(({ next, close }) => {
|
|
98133
|
+
const id = (0, import_uuid2.v4)();
|
|
98134
|
+
const [secretLatch, secretTrigger] = (0, import_async9.latch)();
|
|
98135
|
+
const inviteeInvitation = { secretTrigger };
|
|
98136
|
+
const secretProvider = async () => {
|
|
98137
|
+
await secretLatch;
|
|
98138
|
+
const secret = inviteeInvitation.secret;
|
|
98139
|
+
if (!secret) {
|
|
98140
|
+
throw new Error("Secret not provided.");
|
|
98141
|
+
}
|
|
98142
|
+
return Buffer.from(secret);
|
|
98143
|
+
};
|
|
98144
|
+
const haloPartyPromise = this.echo.halo.join(import_echo_db7.InvitationDescriptor.fromProto(request), secretProvider);
|
|
98145
|
+
this.inviteeInvitations.set(id, inviteeInvitation);
|
|
98146
|
+
next({ id, state: 2 /* CONNECTED */ });
|
|
98147
|
+
haloPartyPromise.then((party) => {
|
|
98148
|
+
next({ id, state: 3 /* SUCCESS */, partyKey: party.key });
|
|
98149
|
+
}).catch((err) => {
|
|
98150
|
+
next({ id, state: 4 /* ERROR */, error: String(err) });
|
|
98151
|
+
});
|
|
98152
|
+
});
|
|
98153
|
+
}
|
|
98154
|
+
async authenticateInvitation(request) {
|
|
98155
|
+
var _a;
|
|
98156
|
+
(0, import_node_assert7.default)(request.processId, "Process ID is missing.");
|
|
98157
|
+
const invitation = this.inviteeInvitations.get(request.processId);
|
|
98158
|
+
(0, import_node_assert7.default)(invitation, "Invitation not found.");
|
|
98159
|
+
(0, import_node_assert7.default)(request.secret, "Secret not provided.");
|
|
98160
|
+
invitation.secret = request.secret;
|
|
98161
|
+
(_a = invitation.secretTrigger) == null ? void 0 : _a.call(invitation);
|
|
98162
|
+
}
|
|
98163
|
+
};
|
|
98164
|
+
var createProfileService = ({ echo }) => new ProfileService2(echo);
|
|
98165
|
+
|
|
98166
|
+
// src/packlets/services/impl/system.ts
|
|
98167
|
+
var createSystemService = ({ config, echo }) => ({
|
|
98168
|
+
getConfig: async () => config.values,
|
|
98169
|
+
reset: async () => {
|
|
98170
|
+
await echo.reset();
|
|
98171
|
+
}
|
|
98172
|
+
});
|
|
98173
|
+
|
|
98174
|
+
// src/packlets/services/impl/services.ts
|
|
98175
|
+
var createServices = (opts) => ({
|
|
98176
|
+
SystemService: createSystemService(opts),
|
|
98177
|
+
ProfileService: createProfileService(opts),
|
|
98178
|
+
HaloService: createHaloService(opts),
|
|
98179
|
+
PartyService: createPartyService(opts),
|
|
98180
|
+
DataService: opts.echo.dataService,
|
|
98181
|
+
TracingService: {
|
|
98182
|
+
setTracingOptions: () => {
|
|
98183
|
+
throw new Error("Tracing not available.");
|
|
98184
|
+
},
|
|
98185
|
+
subscribeToRpcTrace: () => {
|
|
98186
|
+
throw new Error("Tracing not available.");
|
|
98187
|
+
}
|
|
98188
|
+
}
|
|
98189
|
+
});
|
|
98190
|
+
|
|
98191
|
+
// src/packlets/services/storage.ts
|
|
98192
|
+
var import_jsondown = __toESM(require("jsondown"));
|
|
98193
|
+
var import_level_js = __toESM(require("level-js"));
|
|
98194
|
+
var import_memdown = __toESM(require("memdown"));
|
|
98195
|
+
var import_config3 = require("@dxos/config");
|
|
98196
|
+
var import_random_access_multi_storage = require("@dxos/random-access-multi-storage");
|
|
98197
|
+
var import_util6 = require("@dxos/util");
|
|
98198
|
+
var StorageDriver = import_config3.defs.Runtime.Client.Storage.StorageDriver;
|
|
98199
|
+
var createStorageObjects = (config) => {
|
|
98200
|
+
const {
|
|
98201
|
+
path = "dxos/storage",
|
|
98202
|
+
storageType,
|
|
98203
|
+
keyStorage,
|
|
98204
|
+
persistent = false
|
|
98205
|
+
} = config != null ? config : {};
|
|
98206
|
+
if (persistent && storageType === StorageDriver.RAM) {
|
|
98207
|
+
throw new InvalidConfigurationError("RAM storage cannot be used in persistent mode.");
|
|
98208
|
+
}
|
|
98209
|
+
if (!persistent && (storageType !== void 0 && storageType !== StorageDriver.RAM)) {
|
|
98210
|
+
throw new InvalidConfigurationError("Cannot use a persistent storage in not persistent mode.");
|
|
98211
|
+
}
|
|
98212
|
+
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
98213
|
+
throw new InvalidConfigurationError("RAM key storage cannot be used in persistent mode.");
|
|
98214
|
+
}
|
|
98215
|
+
if (!persistent && (keyStorage !== StorageDriver.RAM && keyStorage !== void 0)) {
|
|
98216
|
+
throw new InvalidConfigurationError("Cannot use a persistent key storage in not persistent mode.");
|
|
98217
|
+
}
|
|
98218
|
+
return {
|
|
98219
|
+
storage: (0, import_random_access_multi_storage.createStorage)(`${path}/`, persistent ? toStorageType(storageType) : import_random_access_multi_storage.StorageType.RAM),
|
|
98220
|
+
keyStorage: createKeyStorage(`${path}/keystore`, persistent ? toKeyStorageType(keyStorage) : "ram")
|
|
98221
|
+
};
|
|
98222
|
+
};
|
|
98223
|
+
var createKeyStorage = (path, type) => {
|
|
98224
|
+
const defaultedType = type != null ? type : (0, import_util6.isNode)() ? "jsondown" : "leveljs";
|
|
98225
|
+
switch (defaultedType) {
|
|
98226
|
+
case "leveljs":
|
|
98227
|
+
return (0, import_level_js.default)(path);
|
|
98228
|
+
case "jsondown":
|
|
98229
|
+
return (0, import_jsondown.default)(path);
|
|
98230
|
+
case "ram":
|
|
98231
|
+
return (0, import_memdown.default)();
|
|
98232
|
+
default:
|
|
98233
|
+
throw new InvalidConfigurationError(`Invalid key storage type: ${defaultedType}`);
|
|
98234
|
+
}
|
|
98235
|
+
};
|
|
98236
|
+
var toStorageType = (type) => {
|
|
98237
|
+
switch (type) {
|
|
98238
|
+
case void 0:
|
|
98239
|
+
return void 0;
|
|
98240
|
+
case StorageDriver.RAM:
|
|
98241
|
+
return import_random_access_multi_storage.StorageType.RAM;
|
|
98242
|
+
case StorageDriver.CHROME:
|
|
98243
|
+
return import_random_access_multi_storage.StorageType.CHROME;
|
|
98244
|
+
case StorageDriver.FIREFOX:
|
|
98245
|
+
return import_random_access_multi_storage.StorageType.FIREFOX;
|
|
98246
|
+
case StorageDriver.IDB:
|
|
98247
|
+
return import_random_access_multi_storage.StorageType.IDB;
|
|
98248
|
+
case StorageDriver.NODE:
|
|
98249
|
+
return import_random_access_multi_storage.StorageType.NODE;
|
|
98250
|
+
default:
|
|
98251
|
+
throw new Error(`Invalid storage type: ${StorageDriver[type]}`);
|
|
98252
|
+
}
|
|
98253
|
+
};
|
|
98254
|
+
var toKeyStorageType = (type) => {
|
|
98255
|
+
switch (type) {
|
|
98256
|
+
case void 0:
|
|
98257
|
+
return void 0;
|
|
98258
|
+
case StorageDriver.RAM:
|
|
98259
|
+
return "ram";
|
|
98260
|
+
case StorageDriver.LEVELJS:
|
|
98261
|
+
return "leveljs";
|
|
98262
|
+
case StorageDriver.JSONDOWN:
|
|
98263
|
+
return "jsondown";
|
|
98264
|
+
default:
|
|
98265
|
+
throw new Error(`Invalid key storage type: ${StorageDriver[type]}`);
|
|
98266
|
+
}
|
|
98267
|
+
};
|
|
98268
|
+
|
|
98269
|
+
// src/packlets/services/service-host.ts
|
|
98270
|
+
var ClientServiceHost = class {
|
|
98271
|
+
constructor(_config, _signer) {
|
|
98272
|
+
this._config = _config;
|
|
98273
|
+
this._signer = _signer;
|
|
98274
|
+
this._devtoolsEvents = new DevtoolsHostEvents();
|
|
98275
|
+
const { storage, keyStorage } = createStorageObjects(this._config.get("runtime.client.storage", {}));
|
|
98276
|
+
this._echo = new import_echo_db8.ECHO({
|
|
98277
|
+
storage,
|
|
98278
|
+
keyStorage,
|
|
98279
|
+
networkManagerOptions: {
|
|
98280
|
+
signal: this._config.get("runtime.services.signal.server") ? [this._config.get("runtime.services.signal.server")] : void 0,
|
|
98281
|
+
ice: this._config.get("runtime.services.ice"),
|
|
98282
|
+
log: true
|
|
98283
|
+
},
|
|
98284
|
+
snapshots: this._config.get("runtime.client.enableSnapshots", false),
|
|
98285
|
+
snapshotInterval: this._config.get("runtime.client.snapshotInterval")
|
|
98286
|
+
});
|
|
98287
|
+
this._services = {
|
|
98288
|
+
...createServices({ config: this._config, echo: this._echo, signer: this._signer }),
|
|
98289
|
+
DevtoolsHost: this._createDevtoolsService()
|
|
98290
|
+
};
|
|
98291
|
+
}
|
|
98292
|
+
get services() {
|
|
98293
|
+
return this._services;
|
|
98294
|
+
}
|
|
98295
|
+
async open(onProgressCallback) {
|
|
98296
|
+
await this._echo.open(onProgressCallback);
|
|
98297
|
+
this._devtoolsEvents.ready.emit();
|
|
98298
|
+
}
|
|
98299
|
+
async close() {
|
|
98300
|
+
await this._echo.close();
|
|
98301
|
+
}
|
|
98302
|
+
get echo() {
|
|
98303
|
+
return this._echo;
|
|
98304
|
+
}
|
|
98305
|
+
_createDevtoolsService() {
|
|
98306
|
+
const dependencies = {
|
|
98307
|
+
config: this._config,
|
|
98308
|
+
echo: this._echo,
|
|
98309
|
+
feedStore: this._echo.feedStore,
|
|
98310
|
+
networkManager: this._echo.networkManager,
|
|
98311
|
+
modelFactory: this._echo.modelFactory,
|
|
98312
|
+
keyring: this._echo.halo.keyring,
|
|
98313
|
+
debug: debug3
|
|
98314
|
+
};
|
|
98315
|
+
return createDevtoolsHost(dependencies, this._devtoolsEvents);
|
|
98316
|
+
}
|
|
98317
|
+
};
|
|
98315
98318
|
/*!
|
|
98316
98319
|
* prr
|
|
98317
98320
|
* (c) 2013 Rod Vagg <rod@vagg.org>
|