@dxos/client-services 0.1.26 → 0.1.27-next.a0dff21
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/lib/browser/{chunk-R2FEBB66.mjs → chunk-OTSGRZZI.mjs} +796 -579
- package/dist/lib/browser/chunk-OTSGRZZI.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +19 -15
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +46 -46
- package/dist/lib/browser/packlets/testing/index.mjs.map +4 -4
- package/dist/lib/node/index.cjs +864 -641
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +753 -631
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/packlets/deprecated/index.d.ts +0 -3
- package/dist/types/src/packlets/deprecated/index.d.ts.map +1 -1
- package/dist/types/src/packlets/{identity/devices-service-impl.d.ts → devices/devices-service.d.ts} +4 -3
- package/dist/types/src/packlets/devices/devices-service.d.ts.map +1 -0
- package/dist/types/src/packlets/devices/index.d.ts +2 -0
- package/dist/types/src/packlets/devices/index.d.ts.map +1 -0
- package/dist/types/src/packlets/identity/authenticator.d.ts +1 -1
- package/dist/types/src/packlets/identity/authenticator.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-manager.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts +14 -0
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -0
- package/dist/types/src/packlets/identity/identity.d.ts +2 -2
- package/dist/types/src/packlets/identity/identity.d.ts.map +1 -1
- package/dist/types/src/packlets/identity/index.d.ts +1 -0
- package/dist/types/src/packlets/identity/index.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/{halo-invitations-handler.d.ts → device-invitations-handler.d.ts} +5 -5
- package/dist/types/src/packlets/invitations/device-invitations-handler.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/device-invitations-handler.test.d.ts +2 -0
- package/dist/types/src/packlets/invitations/device-invitations-handler.test.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/{halo-invitations-proxy.d.ts → device-invitations-proxy.d.ts} +2 -2
- package/dist/types/src/packlets/invitations/device-invitations-proxy.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/{halo-invitations-service.d.ts → device-invitations-service.d.ts} +2 -2
- package/dist/types/src/packlets/invitations/device-invitations-service.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/device-invitations-service.test.d.ts +2 -0
- package/dist/types/src/packlets/invitations/device-invitations-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/index.d.ts +3 -3
- package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +6 -0
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts +1 -1
- package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/services/index.d.ts +0 -1
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +3 -3
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-definitions.d.ts +5 -7
- package/dist/types/src/packlets/services/service-definitions.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +1 -0
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +12 -5
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/system/index.d.ts +2 -0
- package/dist/types/src/packlets/system/index.d.ts.map +1 -0
- package/dist/types/src/packlets/system/system-service.d.ts +28 -0
- package/dist/types/src/packlets/system/system-service.d.ts.map +1 -0
- package/dist/types/src/packlets/system/system-service.test.d.ts +2 -0
- package/dist/types/src/packlets/system/system-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/testing/index.d.ts +1 -1
- package/dist/types/src/packlets/testing/index.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +11 -4
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts +6 -1
- package/dist/types/src/packlets/vault/iframe-proxy-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/index.d.ts +2 -0
- package/dist/types/src/packlets/vault/index.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/services.d.ts +9 -1
- package/dist/types/src/packlets/vault/services.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-controller.d.ts +18 -0
- package/dist/types/src/packlets/vault/shell-controller.d.ts.map +1 -0
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +45 -0
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -0
- package/dist/types/src/packlets/vault/worker-runtime.d.ts +2 -1
- package/dist/types/src/packlets/vault/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts +4 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/package.json +29 -28
- package/src/index.ts +0 -1
- package/src/packlets/deprecated/index.ts +0 -3
- package/src/packlets/{identity/devices-service-impl.ts → devices/devices-service.ts} +10 -8
- package/src/packlets/devices/index.ts +5 -0
- package/src/packlets/devtools/spaces.ts +1 -1
- package/src/packlets/identity/authenticator.ts +1 -1
- package/src/packlets/identity/identity-manager.test.ts +1 -1
- package/src/packlets/identity/identity-manager.ts +2 -2
- package/src/packlets/identity/identity-service.ts +67 -0
- package/src/packlets/identity/identity.test.ts +1 -1
- package/src/packlets/identity/identity.ts +1 -1
- package/src/packlets/identity/index.ts +1 -0
- package/src/packlets/invitations/{halo-invitations-handler.test.ts → device-invitations-handler.test.ts} +2 -2
- package/src/packlets/invitations/{halo-invitations-handler.ts → device-invitations-handler.ts} +4 -4
- package/src/packlets/invitations/{halo-invitations-proxy.ts → device-invitations-proxy.ts} +1 -1
- package/src/packlets/invitations/{halo-invitations-service.test.ts → device-invitations-service.test.ts} +10 -10
- package/src/packlets/invitations/{halo-invitations-service.ts → device-invitations-service.ts} +1 -1
- package/src/packlets/invitations/index.ts +3 -3
- package/src/packlets/invitations/invitations-handler.ts +6 -0
- package/src/packlets/invitations/invitations-service.ts +2 -2
- package/src/packlets/invitations/space-invitations-handler.test.ts +1 -1
- package/src/packlets/invitations/space-invitations-handler.ts +55 -20
- package/src/packlets/services/index.ts +0 -1
- package/src/packlets/services/service-context.test.ts +3 -3
- package/src/packlets/services/service-context.ts +5 -5
- package/src/packlets/services/service-definitions.ts +14 -14
- package/src/packlets/services/service-host.test.ts +9 -9
- package/src/packlets/services/service-host.ts +40 -25
- package/src/packlets/spaces/data-space-manager.test.ts +1 -1
- package/src/packlets/spaces/data-space-manager.ts +4 -4
- package/src/packlets/spaces/data-space.ts +3 -3
- package/src/packlets/spaces/spaces-service.ts +93 -11
- package/src/packlets/system/index.ts +5 -0
- package/src/packlets/system/system-service.test.ts +80 -0
- package/src/packlets/system/system-service.ts +70 -0
- package/src/packlets/testing/index.ts +1 -1
- package/src/packlets/testing/test-builder.ts +3 -3
- package/src/packlets/vault/iframe-host-runtime.ts +28 -10
- package/src/packlets/vault/iframe-proxy-runtime.ts +16 -1
- package/src/packlets/vault/index.ts +2 -0
- package/src/packlets/vault/services.ts +17 -1
- package/src/packlets/vault/shell-controller.ts +56 -0
- package/src/packlets/vault/shell-runtime.ts +121 -0
- package/src/packlets/vault/worker-runtime.ts +3 -1
- package/src/packlets/vault/worker-session.ts +28 -19
- package/dist/lib/browser/chunk-R2FEBB66.mjs.map +0 -7
- package/dist/types/src/packlets/deprecated/invitations.d.ts +0 -47
- package/dist/types/src/packlets/deprecated/invitations.d.ts.map +0 -1
- package/dist/types/src/packlets/deprecated/profile.d.ts +0 -18
- package/dist/types/src/packlets/deprecated/profile.d.ts.map +0 -1
- package/dist/types/src/packlets/deprecated/space.d.ts +0 -23
- package/dist/types/src/packlets/deprecated/space.d.ts.map +0 -1
- package/dist/types/src/packlets/deprecated/system.d.ts +0 -24
- package/dist/types/src/packlets/deprecated/system.d.ts.map +0 -1
- package/dist/types/src/packlets/identity/devices-service-impl.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/halo-invitations-handler.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/halo-invitations-handler.test.d.ts +0 -2
- package/dist/types/src/packlets/invitations/halo-invitations-handler.test.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/halo-invitations-proxy.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/halo-invitations-service.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/halo-invitations-service.test.d.ts +0 -2
- package/dist/types/src/packlets/invitations/halo-invitations-service.test.d.ts.map +0 -1
- package/dist/types/src/packlets/services/signer.d.ts +0 -6
- package/dist/types/src/packlets/services/signer.d.ts.map +0 -1
- package/src/packlets/deprecated/invitations.ts +0 -63
- package/src/packlets/deprecated/profile.ts +0 -85
- package/src/packlets/deprecated/space.ts +0 -258
- package/src/packlets/deprecated/system.ts +0 -48
- package/src/packlets/services/signer.ts +0 -11
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Config } from '@dxos/config';
|
|
2
2
|
import { RpcPort } from '@dxos/rpc';
|
|
3
|
-
import {
|
|
3
|
+
import { Provider } from '@dxos/util';
|
|
4
|
+
import { ClientServicesHost } from '../services';
|
|
5
|
+
import { ShellRuntime } from './shell-runtime';
|
|
4
6
|
export declare type IFrameHostRuntimeParams = {
|
|
5
|
-
configProvider:
|
|
7
|
+
configProvider: Config | Provider<Promise<Config>>;
|
|
6
8
|
appPort: RpcPort;
|
|
9
|
+
shellPort?: RpcPort;
|
|
7
10
|
};
|
|
8
11
|
/**
|
|
9
12
|
* Runs the client services in the main thread.
|
|
@@ -17,11 +20,15 @@ export declare class IFrameHostRuntime {
|
|
|
17
20
|
private readonly _ready;
|
|
18
21
|
private readonly _getService;
|
|
19
22
|
private readonly _appPort;
|
|
23
|
+
private readonly _shellPort?;
|
|
24
|
+
private _config;
|
|
20
25
|
private _clientServices;
|
|
21
26
|
private _clientRpc;
|
|
22
|
-
private
|
|
27
|
+
private _shellRuntime?;
|
|
23
28
|
origin?: string;
|
|
24
|
-
constructor({ configProvider, appPort }: IFrameHostRuntimeParams);
|
|
29
|
+
constructor({ configProvider, appPort, shellPort }: IFrameHostRuntimeParams);
|
|
30
|
+
get services(): ClientServicesHost;
|
|
31
|
+
get shell(): ShellRuntime | undefined;
|
|
25
32
|
start(): Promise<void>;
|
|
26
33
|
stop(): Promise<void>;
|
|
27
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe-host-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/iframe-host-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"iframe-host-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/iframe-host-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAiB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAuC,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;AAIjE,oBAAY,uBAAuB,GAAG;IACpC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IACrE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IACpE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAC3D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAEN;IAEtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAU;IACtC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,aAAa,CAAC,CAAmB;IAGlC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEX,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,uBAAuB;IAwB3E,IAAI,QAAQ,uBAEX;IAED,IAAI,KAAK,IAAI,YAAY,GAAG,SAAS,CAEpC;IAEK,KAAK;IA2CL,IAAI;CAOX"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { RpcPort } from '@dxos/rpc';
|
|
2
|
+
import { ShellRuntime } from './shell-runtime';
|
|
2
3
|
export declare type IFrameProxyRuntimeParams = {
|
|
3
4
|
systemPort: RpcPort;
|
|
4
5
|
workerAppPort: RpcPort;
|
|
5
6
|
windowAppPort: RpcPort;
|
|
7
|
+
shellPort?: RpcPort;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* Manages the client connection to the shared worker.
|
|
@@ -11,9 +13,12 @@ export declare class IFrameProxyRuntime {
|
|
|
11
13
|
private readonly _systemPort;
|
|
12
14
|
private readonly _windowAppPort;
|
|
13
15
|
private readonly _workerAppPort;
|
|
16
|
+
private readonly _shellPort?;
|
|
14
17
|
private readonly _systemRpc;
|
|
18
|
+
private readonly _shellRuntime?;
|
|
15
19
|
private readonly _transportService;
|
|
16
|
-
constructor({ systemPort, workerAppPort, windowAppPort }: IFrameProxyRuntimeParams);
|
|
20
|
+
constructor({ systemPort, workerAppPort, windowAppPort, shellPort }: IFrameProxyRuntimeParams);
|
|
21
|
+
get shell(): ShellRuntime | undefined;
|
|
17
22
|
open(origin: string): Promise<void>;
|
|
18
23
|
close(): Promise<void>;
|
|
19
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe-proxy-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/iframe-proxy-runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"iframe-proxy-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/iframe-proxy-runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AAGtE,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;AAGjE,oBAAY,wBAAwB,GAAG;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAmB;IAClD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAgC;gBAEtD,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,wBAAwB;IA6B7F,IAAI,KAAK,IAAI,YAAY,GAAG,SAAS,CAEpC;IAEK,IAAI,CAAC,MAAM,EAAE,MAAM;IAMnB,KAAK;CAKZ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './iframe-host-runtime';
|
|
2
2
|
export * from './iframe-proxy-runtime';
|
|
3
3
|
export * from './services';
|
|
4
|
+
export * from './shell-controller';
|
|
5
|
+
export * from './shell-runtime';
|
|
4
6
|
export * from './vault-resource-lock';
|
|
5
7
|
export * from './worker-runtime';
|
|
6
8
|
export * from './worker-session';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IframeService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';
|
|
1
|
+
import type { IframeService, AppService, ShellService, WorkerService } from '@dxos/protocols/proto/dxos/iframe';
|
|
2
2
|
import type { BridgeService } from '@dxos/protocols/proto/dxos/mesh/bridge';
|
|
3
3
|
import { ServiceBundle } from '@dxos/rpc';
|
|
4
4
|
export declare type IframeServiceBundle = {
|
|
@@ -10,4 +10,12 @@ export declare type WorkerServiceBundle = {
|
|
|
10
10
|
WorkerService: WorkerService;
|
|
11
11
|
};
|
|
12
12
|
export declare const workerServiceBundle: ServiceBundle<WorkerServiceBundle>;
|
|
13
|
+
export declare type AppServiceBundle = {
|
|
14
|
+
AppService: AppService;
|
|
15
|
+
};
|
|
16
|
+
export declare const appServiceBundle: ServiceBundle<AppServiceBundle>;
|
|
17
|
+
export declare type ShellServiceBundle = {
|
|
18
|
+
ShellService: ShellService;
|
|
19
|
+
};
|
|
20
|
+
export declare const shellServiceBundle: ServiceBundle<ShellServiceBundle>;
|
|
13
21
|
//# sourceMappingURL=services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/services.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/services.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,oBAAY,mBAAmB,GAAG;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAGlE,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAElE,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,gBAAgB,CAE5D,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,kBAAkB,CAEhE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Event } from '@dxos/async';
|
|
2
|
+
import { AppContextRequest, LayoutRequest, ShellDisplay, ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
|
|
3
|
+
import { RpcPort } from '@dxos/rpc';
|
|
4
|
+
/**
|
|
5
|
+
* Provide access to the shell via RPC connection.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ShellController {
|
|
8
|
+
private readonly _port;
|
|
9
|
+
readonly contextUpdate: Event<AppContextRequest>;
|
|
10
|
+
private _shellRpc?;
|
|
11
|
+
private _display;
|
|
12
|
+
constructor(_port: RpcPort);
|
|
13
|
+
get display(): ShellDisplay;
|
|
14
|
+
setLayout(layout: ShellLayout, options?: Omit<LayoutRequest, 'layout'>): Promise<void>;
|
|
15
|
+
open(): Promise<void>;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=shell-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-controller.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/shell-controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AAItE;;GAEG;AACH,qBAAa,eAAe;IAKd,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJlC,QAAQ,CAAC,aAAa,2BAAkC;IACxD,OAAO,CAAC,SAAS,CAAC,CAAmC;IACrD,OAAO,CAAC,QAAQ,CAAqB;gBAER,KAAK,EAAE,OAAO;IAE3C,IAAI,OAAO,iBAEV;IAEK,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAM;IAO1E,IAAI;IAmBJ,KAAK;CAIZ"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Event } from '@dxos/async';
|
|
2
|
+
import { PublicKey } from '@dxos/keys';
|
|
3
|
+
import { AppContextRequest, LayoutRequest, ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
|
|
4
|
+
import { RpcPort } from '@dxos/rpc';
|
|
5
|
+
export interface ShellRuntime {
|
|
6
|
+
layoutUpdate: Event<LayoutRequest>;
|
|
7
|
+
layout: ShellLayout;
|
|
8
|
+
invitationCode?: string;
|
|
9
|
+
spaceKey?: PublicKey;
|
|
10
|
+
setLayout: (layout: ShellLayout, options?: Omit<LayoutRequest, 'layout'>) => void;
|
|
11
|
+
setAppContext: (context: AppContextRequest) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Endpoint that handles shell services.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ShellRuntimeImpl implements ShellRuntime {
|
|
17
|
+
private readonly _port;
|
|
18
|
+
readonly layoutUpdate: Event<LayoutRequest>;
|
|
19
|
+
private _appRpc?;
|
|
20
|
+
private _layout;
|
|
21
|
+
private _invitationCode?;
|
|
22
|
+
private _spaceKey?;
|
|
23
|
+
constructor(_port: RpcPort);
|
|
24
|
+
get layout(): ShellLayout;
|
|
25
|
+
get invitationCode(): string | undefined;
|
|
26
|
+
get spaceKey(): PublicKey | undefined;
|
|
27
|
+
setLayout(layout: ShellLayout, options?: Omit<LayoutRequest, 'layout'>): void;
|
|
28
|
+
setAppContext(context: AppContextRequest): Promise<void>;
|
|
29
|
+
open(): Promise<void>;
|
|
30
|
+
close(): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare class MemoryShellRuntime implements ShellRuntime {
|
|
33
|
+
readonly layoutUpdate: Event<LayoutRequest>;
|
|
34
|
+
readonly contextUpdate: Event<AppContextRequest>;
|
|
35
|
+
private _layout;
|
|
36
|
+
private _invitationCode?;
|
|
37
|
+
private _spaceKey?;
|
|
38
|
+
constructor({ layout, invitationCode, spaceKey }?: Partial<LayoutRequest> & Partial<AppContextRequest>);
|
|
39
|
+
get layout(): ShellLayout;
|
|
40
|
+
get invitationCode(): string | undefined;
|
|
41
|
+
get spaceKey(): PublicKey | undefined;
|
|
42
|
+
setLayout(layout: ShellLayout, options?: Omit<LayoutRequest, 'layout'>): void;
|
|
43
|
+
setAppContext(context: AppContextRequest): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=shell-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/shell-runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AAItE,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACnC,MAAM,EAAE,WAAW,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC;IAClF,aAAa,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D;AAED;;GAEG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IAOvC,OAAO,CAAC,QAAQ,CAAC,KAAK;IANlC,QAAQ,CAAC,YAAY,uBAA8B;IACnD,OAAO,CAAC,OAAO,CAAC,CAAiC;IACjD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,SAAS,CAAC,CAAY;gBAED,KAAK,EAAE,OAAO;IAE3C,IAAI,MAAM,gBAET;IAED,IAAI,cAAc,uBAEjB;IAED,IAAI,QAAQ,0BAEX;IAED,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAM;IAOpE,aAAa,CAAC,OAAO,EAAE,iBAAiB;IAMxC,IAAI;IAoBJ,KAAK;CAIZ;AAED,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,YAAY,uBAA8B;IACnD,QAAQ,CAAC,aAAa,2BAAkC;IACxD,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,SAAS,CAAC,CAAY;gBAElB,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAM;IAM1G,IAAI,MAAM,gBAET;IAED,IAAI,cAAc,uBAEjB;IAED,IAAI,QAAQ,0BAEX;IAED,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAM;IAOpE,aAAa,CAAC,OAAO,EAAE,iBAAiB;CAG/C"}
|
|
@@ -4,6 +4,7 @@ import { MaybePromise } from '@dxos/util';
|
|
|
4
4
|
export declare type CreateSessionParams = {
|
|
5
5
|
appPort: RpcPort;
|
|
6
6
|
systemPort: RpcPort;
|
|
7
|
+
shellPort: RpcPort;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* Runtime for the shared worker.
|
|
@@ -24,7 +25,7 @@ export declare class WorkerRuntime {
|
|
|
24
25
|
/**
|
|
25
26
|
* Create a new session.
|
|
26
27
|
*/
|
|
27
|
-
createSession({ appPort, systemPort }: CreateSessionParams): Promise<void>;
|
|
28
|
+
createSession({ appPort, systemPort, shellPort }: CreateSessionParams): Promise<void>;
|
|
28
29
|
/**
|
|
29
30
|
* Selects one of the existing session fro WebRTC networking.
|
|
30
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/worker-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"worker-runtime.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/worker-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,aAAa;IAUtB,OAAO,CAAC,QAAQ,CAAC,eAAe;IATlC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqC;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;IACrD,OAAO,CAAC,qBAAqB,CAAC,CAAgB;IAC9C,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,OAAO,CAAU;gBAIN,eAAe,EAAE,MAAM,YAAY,CAAC,MAAM,CAAC;IAGxD,KAAK;IAyBL,IAAI;IAKV;;OAEG;IACG,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,mBAAmB;IAiC3E;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAmBzB"}
|
|
@@ -7,6 +7,7 @@ export declare type WorkerSessionParams = {
|
|
|
7
7
|
getService: <Service>(find: (services: Partial<ClientServices>) => Service | undefined) => Promise<Service>;
|
|
8
8
|
systemPort: RpcPort;
|
|
9
9
|
appPort: RpcPort;
|
|
10
|
+
shellPort: RpcPort;
|
|
10
11
|
readySignal: Trigger<Error | undefined>;
|
|
11
12
|
options?: {
|
|
12
13
|
heartbeatInterval: number;
|
|
@@ -17,6 +18,7 @@ export declare type WorkerSessionParams = {
|
|
|
17
18
|
*/
|
|
18
19
|
export declare class WorkerSession {
|
|
19
20
|
private readonly _clientRpc;
|
|
21
|
+
private readonly _shellClientRpc;
|
|
20
22
|
private readonly _iframeRpc;
|
|
21
23
|
private readonly _startTrigger;
|
|
22
24
|
private readonly _getService;
|
|
@@ -25,8 +27,9 @@ export declare class WorkerSession {
|
|
|
25
27
|
readonly onClose: Callback<() => Promise<void>>;
|
|
26
28
|
origin?: string;
|
|
27
29
|
bridgeService?: BridgeService;
|
|
28
|
-
constructor({ getService, systemPort, appPort, options }: WorkerSessionParams);
|
|
30
|
+
constructor({ getService, systemPort, appPort, shellPort, options }: WorkerSessionParams);
|
|
29
31
|
open(): Promise<void>;
|
|
30
32
|
close(): Promise<void>;
|
|
33
|
+
private _maybeOpenShell;
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=worker-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-session.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/worker-session.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"worker-session.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/vault/worker-session.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAoC,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAuB,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlE,oBAAY,mBAAmB,GAAG;IAChC,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,OAAO,GAAG,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5G,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE;QACR,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAC1D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8C;IACvE,OAAO,CAAC,eAAe,CAAC,CAAiB;IAEzC,SAAgB,OAAO,iBAAsB,QAAQ,IAAI,CAAC,EAAI;IAGvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,aAAa,CAAC,EAAE,aAAa,CAAC;gBAEzB,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAEC,EACF,EAAE,mBAAmB;IAkDhB,IAAI;IAuBJ,KAAK;YAeG,eAAe;CAO9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27-next.a0dff21",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -21,36 +21,37 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"base-x": "~3.0.9",
|
|
24
|
-
"@dxos/async": "0.1.
|
|
25
|
-
"@dxos/codec-protobuf": "0.1.
|
|
26
|
-
"@dxos/config": "0.1.
|
|
27
|
-
"@dxos/context": "0.1.
|
|
28
|
-
"@dxos/credentials": "0.1.
|
|
29
|
-
"@dxos/crypto": "0.1.
|
|
30
|
-
"@dxos/debug": "0.1.
|
|
31
|
-
"@dxos/document-model": "0.1.
|
|
32
|
-
"@dxos/echo-db": "0.1.
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/model-factory": "0.1.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/node-std": "0.1.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/teleport
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
24
|
+
"@dxos/async": "0.1.27-next.a0dff21",
|
|
25
|
+
"@dxos/codec-protobuf": "0.1.27-next.a0dff21",
|
|
26
|
+
"@dxos/config": "0.1.27-next.a0dff21",
|
|
27
|
+
"@dxos/context": "0.1.27-next.a0dff21",
|
|
28
|
+
"@dxos/credentials": "0.1.27-next.a0dff21",
|
|
29
|
+
"@dxos/crypto": "0.1.27-next.a0dff21",
|
|
30
|
+
"@dxos/debug": "0.1.27-next.a0dff21",
|
|
31
|
+
"@dxos/document-model": "0.1.27-next.a0dff21",
|
|
32
|
+
"@dxos/echo-db": "0.1.27-next.a0dff21",
|
|
33
|
+
"@dxos/echo-pipeline": "0.1.27-next.a0dff21",
|
|
34
|
+
"@dxos/errors": "0.1.27-next.a0dff21",
|
|
35
|
+
"@dxos/feed-store": "0.1.27-next.a0dff21",
|
|
36
|
+
"@dxos/keyring": "0.1.27-next.a0dff21",
|
|
37
|
+
"@dxos/keys": "0.1.27-next.a0dff21",
|
|
38
|
+
"@dxos/log": "0.1.27-next.a0dff21",
|
|
39
|
+
"@dxos/messaging": "0.1.27-next.a0dff21",
|
|
40
|
+
"@dxos/model-factory": "0.1.27-next.a0dff21",
|
|
41
|
+
"@dxos/network-manager": "0.1.27-next.a0dff21",
|
|
42
|
+
"@dxos/node-std": "0.1.27-next.a0dff21",
|
|
43
|
+
"@dxos/protocols": "0.1.27-next.a0dff21",
|
|
44
|
+
"@dxos/random-access-storage": "0.1.27-next.a0dff21",
|
|
45
|
+
"@dxos/rpc": "0.1.27-next.a0dff21",
|
|
46
|
+
"@dxos/teleport": "0.1.27-next.a0dff21",
|
|
47
|
+
"@dxos/teleport-extension-presence": "0.1.27-next.a0dff21",
|
|
48
|
+
"@dxos/text-model": "0.1.27-next.a0dff21",
|
|
49
|
+
"@dxos/timeframe": "0.1.27-next.a0dff21",
|
|
50
|
+
"@dxos/util": "0.1.27-next.a0dff21"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@types/readable-stream": "^2.3.9",
|
|
53
|
-
"@dxos/signal": "0.1.
|
|
54
|
+
"@dxos/signal": "0.1.27-next.a0dff21"
|
|
54
55
|
},
|
|
55
56
|
"publishConfig": {
|
|
56
57
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import { EventSubscriptions } from '@dxos/async';
|
|
6
6
|
import { Stream } from '@dxos/codec-protobuf';
|
|
7
|
-
import { Device, DevicesService, QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
7
|
+
import { Device, DeviceKind, DevicesService, QueryDevicesResponse } from '@dxos/protocols/proto/dxos/client/services';
|
|
8
|
+
import { ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
8
9
|
|
|
9
|
-
import { IdentityManager } from '
|
|
10
|
+
import { IdentityManager } from '../identity/identity-manager';
|
|
10
11
|
|
|
11
12
|
export class DevicesServiceImpl implements DevicesService {
|
|
12
13
|
constructor(private readonly _identityManager: IdentityManager) {}
|
|
13
14
|
|
|
14
|
-
updateDevice(): Promise<Device> {
|
|
15
|
+
updateDevice(request: ProfileDocument): Promise<Device> {
|
|
15
16
|
throw new Error('Method not implemented.');
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -24,19 +25,20 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
24
25
|
} else {
|
|
25
26
|
next({
|
|
26
27
|
devices: Array.from(deviceKeys.values()).map((key) => ({
|
|
27
|
-
deviceKey: key
|
|
28
|
+
deviceKey: key,
|
|
29
|
+
kind: this._identityManager.identity?.deviceKey.equals(key) ? DeviceKind.CURRENT : DeviceKind.TRUSTED
|
|
28
30
|
}))
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
+
const subscriptions = new EventSubscriptions();
|
|
36
|
+
subscriptions.add(
|
|
35
37
|
this._identityManager.stateUpdate.on(() => {
|
|
36
38
|
update();
|
|
37
39
|
|
|
38
40
|
if (this._identityManager.identity) {
|
|
39
|
-
|
|
41
|
+
subscriptions.add(
|
|
40
42
|
this._identityManager.identity.stateUpdate.on(() => {
|
|
41
43
|
update();
|
|
42
44
|
})
|
|
@@ -47,7 +49,7 @@ export class DevicesServiceImpl implements DevicesService {
|
|
|
47
49
|
|
|
48
50
|
update();
|
|
49
51
|
|
|
50
|
-
return () =>
|
|
52
|
+
return () => subscriptions.clear();
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Stream } from '@dxos/codec-protobuf';
|
|
6
|
-
import { Space } from '@dxos/echo-
|
|
6
|
+
import { Space } from '@dxos/echo-pipeline';
|
|
7
7
|
import { SubscribeToSpacesRequest, SubscribeToSpacesResponse } from '@dxos/protocols/proto/dxos/devtools/host';
|
|
8
8
|
import { SpaceMetadata } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Event, Trigger } from '@dxos/async';
|
|
6
6
|
import { Context } from '@dxos/context';
|
|
7
7
|
import { verifyCredential, CredentialSigner } from '@dxos/credentials';
|
|
8
|
-
import { AuthProvider, AuthVerifier } from '@dxos/echo-
|
|
8
|
+
import { AuthProvider, AuthVerifier } from '@dxos/echo-pipeline';
|
|
9
9
|
import { PublicKey } from '@dxos/keys';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
11
|
import { schema } from '@dxos/protocols';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { expect } from 'chai';
|
|
6
6
|
|
|
7
|
-
import { valueEncoding, MetadataStore, SpaceManager, AuthStatus } from '@dxos/echo-
|
|
7
|
+
import { valueEncoding, MetadataStore, SpaceManager, AuthStatus } from '@dxos/echo-pipeline';
|
|
8
8
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
9
9
|
import { Keyring } from '@dxos/keyring';
|
|
10
10
|
import { MemorySignalManager, MemorySignalManagerContext } from '@dxos/messaging';
|
|
@@ -6,7 +6,7 @@ import assert from 'node:assert';
|
|
|
6
6
|
|
|
7
7
|
import { Event } from '@dxos/async';
|
|
8
8
|
import { createCredentialSignerWithKey, CredentialGenerator } from '@dxos/credentials';
|
|
9
|
-
import { MetadataStore, SpaceManager, SwarmIdentity } from '@dxos/echo-
|
|
9
|
+
import { MetadataStore, SpaceManager, SwarmIdentity } from '@dxos/echo-pipeline';
|
|
10
10
|
import { FeedStore } from '@dxos/feed-store';
|
|
11
11
|
import { Keyring } from '@dxos/keyring';
|
|
12
12
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -15,8 +15,8 @@ import { FeedMessage } from '@dxos/protocols/proto/dxos/echo/feed';
|
|
|
15
15
|
import { AdmittedFeed, IdentityRecord, SpaceRecord } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
16
16
|
import { deferFunction } from '@dxos/util';
|
|
17
17
|
|
|
18
|
-
import { Identity } from '../identity';
|
|
19
18
|
import { createAuthProvider } from './authenticator';
|
|
19
|
+
import { Identity } from './identity';
|
|
20
20
|
|
|
21
21
|
interface ConstructSpaceParams {
|
|
22
22
|
spaceRecord: SpaceRecord;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import assert from 'node:assert';
|
|
6
|
+
|
|
7
|
+
import { Stream } from '@dxos/codec-protobuf';
|
|
8
|
+
import { signPresentation } from '@dxos/credentials';
|
|
9
|
+
import { todo } from '@dxos/debug';
|
|
10
|
+
import {
|
|
11
|
+
Identity,
|
|
12
|
+
IdentityService,
|
|
13
|
+
QueryIdentityResponse,
|
|
14
|
+
RecoverIdentityRequest,
|
|
15
|
+
SignPresentationRequest
|
|
16
|
+
} from '@dxos/protocols/proto/dxos/client/services';
|
|
17
|
+
import { Presentation, ProfileDocument } from '@dxos/protocols/proto/dxos/halo/credentials';
|
|
18
|
+
|
|
19
|
+
import { ServiceContext } from '../services';
|
|
20
|
+
|
|
21
|
+
export class IdentityServiceImpl implements IdentityService {
|
|
22
|
+
// TODO(wittjosiah): Remove dependency on service context.
|
|
23
|
+
constructor(private readonly _serviceContext: ServiceContext) {}
|
|
24
|
+
|
|
25
|
+
async createIdentity(request: ProfileDocument): Promise<Identity> {
|
|
26
|
+
await this._serviceContext.createIdentity(request);
|
|
27
|
+
|
|
28
|
+
return this._getIdentity()!;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async recoverIdentity(request: RecoverIdentityRequest): Promise<Identity> {
|
|
32
|
+
return todo();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
queryIdentity(): Stream<QueryIdentityResponse> {
|
|
36
|
+
return new Stream(({ next }) => {
|
|
37
|
+
const emitNext = () => next({ identity: this._getIdentity() });
|
|
38
|
+
|
|
39
|
+
emitNext();
|
|
40
|
+
return this._serviceContext.identityManager.stateUpdate.on(emitNext);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private _getIdentity(): Identity | undefined {
|
|
45
|
+
if (!this._serviceContext.identityManager.identity) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
identityKey: this._serviceContext.identityManager.identity.identityKey,
|
|
51
|
+
spaceKey: this._serviceContext.identityManager.identity.space.key,
|
|
52
|
+
profile: this._serviceContext.identityManager.identity.profileDocument
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async signPresentation({ presentation, nonce }: SignPresentationRequest): Promise<Presentation> {
|
|
57
|
+
assert(this._serviceContext.identityManager.identity, 'Identity not initialized.');
|
|
58
|
+
|
|
59
|
+
return await signPresentation({
|
|
60
|
+
presentation,
|
|
61
|
+
signer: this._serviceContext.keyring,
|
|
62
|
+
signerKey: this._serviceContext.identityManager.identity.deviceKey,
|
|
63
|
+
chain: this._serviceContext.identityManager.identity.deviceCredentialChain,
|
|
64
|
+
nonce
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import expect from 'expect';
|
|
6
6
|
|
|
7
7
|
import { CredentialGenerator, verifyCredential } from '@dxos/credentials';
|
|
8
|
-
import { MOCK_AUTH_PROVIDER, MOCK_AUTH_VERIFIER, Space, SpaceProtocol, valueEncoding } from '@dxos/echo-
|
|
8
|
+
import { MOCK_AUTH_PROVIDER, MOCK_AUTH_VERIFIER, Space, SpaceProtocol, valueEncoding } from '@dxos/echo-pipeline';
|
|
9
9
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
10
10
|
import { Keyring } from '@dxos/keyring';
|
|
11
11
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '@dxos/credentials';
|
|
16
16
|
import { Signer } from '@dxos/crypto';
|
|
17
17
|
import { failUndefined } from '@dxos/debug';
|
|
18
|
-
import { Space } from '@dxos/echo-
|
|
18
|
+
import { Space } from '@dxos/echo-pipeline';
|
|
19
19
|
import { writeMessages } from '@dxos/feed-store';
|
|
20
20
|
import { PublicKey } from '@dxos/keys';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
@@ -16,7 +16,7 @@ const closeAfterTest = async (peer: ServiceContext) => {
|
|
|
16
16
|
return peer;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
describe('services/
|
|
19
|
+
describe('services/device', () => {
|
|
20
20
|
test('creates identity', async () => {
|
|
21
21
|
const peer = createServiceContext();
|
|
22
22
|
await peer.open();
|
|
@@ -32,7 +32,7 @@ describe('services/halo', () => {
|
|
|
32
32
|
const identity1 = await host.createIdentity();
|
|
33
33
|
expect(host.identityManager.identity).to.eq(identity1);
|
|
34
34
|
|
|
35
|
-
await performInvitation(host.
|
|
35
|
+
await performInvitation(host.deviceInvitations, guest.deviceInvitations, undefined);
|
|
36
36
|
expect(guest.identityManager.identity?.identityKey).to.deep.eq(identity1.identityKey);
|
|
37
37
|
});
|
|
38
38
|
});
|
package/src/packlets/invitations/{halo-invitations-handler.ts → device-invitations-handler.ts}
RENAMED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from './invitations';
|
|
34
34
|
import { AbstractInvitationsHandler, InvitationsOptions } from './invitations-handler';
|
|
35
35
|
|
|
36
|
-
type
|
|
36
|
+
type DeviceInvitationsHandlerParams = {
|
|
37
37
|
networkManager: NetworkManager;
|
|
38
38
|
keyring: Keyring;
|
|
39
39
|
|
|
@@ -42,13 +42,13 @@ type HaloInvitationsHandlerParams = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Handles the life-cycle of
|
|
45
|
+
* Handles the life-cycle of device invitations between peers.
|
|
46
46
|
*/
|
|
47
47
|
// TODO(dmaretskyi): Split into Host and Guest parts.
|
|
48
|
-
export class
|
|
48
|
+
export class DeviceInvitationsHandler extends AbstractInvitationsHandler {
|
|
49
49
|
// prettier-ignore
|
|
50
50
|
constructor(
|
|
51
|
-
private readonly _params:
|
|
51
|
+
private readonly _params: DeviceInvitationsHandlerParams
|
|
52
52
|
) {
|
|
53
53
|
super(_params.networkManager);
|
|
54
54
|
}
|
|
@@ -7,7 +7,7 @@ import { AbstractInvitationsProxy } from './invitations-proxy';
|
|
|
7
7
|
/**
|
|
8
8
|
* Adapts invitation service observable to client/service stream.
|
|
9
9
|
*/
|
|
10
|
-
export class
|
|
10
|
+
export class DeviceInvitationsProxy extends AbstractInvitationsProxy {
|
|
11
11
|
getInvitationOptions() {
|
|
12
12
|
return {};
|
|
13
13
|
}
|