@dxos/client-services 0.1.28 → 0.1.29-next.1bc50d4
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-OTSGRZZI.mjs → chunk-ILMYW75X.mjs} +740 -1043
- package/dist/lib/browser/chunk-ILMYW75X.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -41
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +163 -50
- package/dist/lib/browser/packlets/testing/index.mjs.map +4 -4
- package/dist/lib/node/index.cjs +645 -969
- 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 +2686 -2637
- package/dist/lib/node/packlets/testing/index.cjs.map +4 -4
- package/dist/types/src/packlets/devices/devices-service.test.d.ts +2 -0
- package/dist/types/src/packlets/devices/devices-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/identity/identity-service.test.d.ts +2 -0
- package/dist/types/src/packlets/identity/identity-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/invitations/device-invitations-handler.d.ts +1 -2
- package/dist/types/src/packlets/invitations/device-invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/device-invitations-service.d.ts +1 -1
- package/dist/types/src/packlets/invitations/device-invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/index.d.ts +0 -6
- package/dist/types/src/packlets/invitations/index.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts +2 -3
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts +2 -4
- package/dist/types/src/packlets/invitations/space-invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitations-service.d.ts +2 -3
- package/dist/types/src/packlets/invitations/space-invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/network/network-service.test.d.ts +2 -0
- package/dist/types/src/packlets/network/network-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/services/index.d.ts +2 -2
- package/dist/types/src/packlets/services/index.d.ts.map +1 -1
- package/dist/types/src/packlets/services/local-client-services.d.ts +15 -0
- package/dist/types/src/packlets/services/local-client-services.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts +3 -5
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/services/utils.d.ts +7 -0
- package/dist/types/src/packlets/services/utils.d.ts.map +1 -0
- package/dist/types/src/packlets/spaces/index.d.ts +2 -0
- package/dist/types/src/packlets/spaces/index.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.test.d.ts +2 -0
- package/dist/types/src/packlets/spaces/spaces-service.test.d.ts.map +1 -0
- package/dist/types/src/packlets/testing/host-test-builder.d.ts +43 -0
- package/dist/types/src/packlets/testing/host-test-builder.d.ts.map +1 -0
- package/dist/types/src/packlets/testing/index.d.ts +1 -0
- package/dist/types/src/packlets/testing/index.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/test-builder.d.ts +30 -34
- package/dist/types/src/packlets/testing/test-builder.d.ts.map +1 -1
- package/dist/types/src/packlets/tests/client-services.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/client-services.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/client.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/client.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/halo-credentials.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/halo-credentials.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/halo-persistent.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/halo-persistent.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/halo-profile.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/halo-profile.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/shared-worker.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/shared-worker.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/spaces-invitations.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/spaces-invitations.test.d.ts.map +1 -0
- package/dist/types/src/packlets/tests/spaces.test.d.ts +2 -0
- package/dist/types/src/packlets/tests/spaces.test.d.ts.map +1 -0
- package/dist/types/src/packlets/vault/iframe-host-runtime.d.ts +2 -2
- 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.map +1 -1
- package/dist/types/src/packlets/vault/index.d.ts +0 -2
- package/dist/types/src/packlets/vault/index.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts +1 -1
- package/dist/types/src/packlets/vault/worker-session.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/devices/devices-service.test.ts +56 -0
- package/src/packlets/identity/identity-service.test.ts +82 -0
- package/src/packlets/invitations/device-invitations-handler.ts +10 -9
- package/src/packlets/invitations/device-invitations-service.test.ts +1 -1
- package/src/packlets/invitations/device-invitations-service.ts +1 -1
- package/src/packlets/invitations/index.ts +0 -6
- package/src/packlets/invitations/invitations-service.ts +7 -2
- package/src/packlets/invitations/space-invitations-handler.test.ts +3 -3
- package/src/packlets/invitations/space-invitations-handler.ts +11 -11
- package/src/packlets/invitations/space-invitations-service.test.ts +1 -1
- package/src/packlets/invitations/space-invitations-service.ts +2 -3
- package/src/packlets/network/network-service.test.ts +52 -0
- package/src/packlets/services/index.ts +2 -2
- package/src/packlets/services/local-client-services.ts +35 -0
- package/src/packlets/services/service-context.test.ts +4 -4
- package/src/packlets/services/service-context.ts +1 -1
- package/src/packlets/services/service-host.ts +3 -11
- package/src/packlets/services/service-registry.test.ts +2 -2
- package/src/packlets/services/utils.ts +53 -0
- package/src/packlets/spaces/data-space-manager.test.ts +4 -4
- package/src/packlets/spaces/data-space-manager.ts +1 -1
- package/src/packlets/spaces/index.ts +2 -0
- package/src/packlets/spaces/spaces-service.test.ts +107 -0
- package/src/packlets/testing/host-test-builder.ts +163 -0
- package/src/packlets/testing/index.ts +1 -0
- package/src/packlets/testing/invitation-utils.ts +1 -2
- package/src/packlets/testing/test-builder.ts +118 -140
- package/src/packlets/tests/client-services.test.ts +252 -0
- package/src/packlets/tests/client.test.ts +143 -0
- package/src/packlets/tests/halo-credentials.test.ts +94 -0
- package/src/packlets/tests/halo-persistent.test.ts +53 -0
- package/src/packlets/tests/halo-profile.test.ts +74 -0
- package/src/packlets/tests/shared-worker.test.ts +96 -0
- package/src/packlets/tests/spaces-invitations.test.ts +24 -0
- package/src/packlets/tests/spaces.test.ts +68 -0
- package/src/packlets/vault/iframe-host-runtime.ts +6 -3
- package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
- package/src/packlets/vault/index.ts +0 -2
- package/src/packlets/vault/shell-runtime.ts +1 -2
- package/src/packlets/vault/worker-session.ts +7 -3
- package/dist/lib/browser/chunk-OTSGRZZI.mjs.map +0 -7
- package/dist/types/src/packlets/invitations/device-invitations-proxy.d.ts +0 -8
- package/dist/types/src/packlets/invitations/device-invitations-proxy.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/encoder.d.ts +0 -9
- package/dist/types/src/packlets/invitations/encoder.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/encoder.test.d.ts +0 -2
- package/dist/types/src/packlets/invitations/encoder.test.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +0 -56
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitations-proxy.d.ts +0 -18
- package/dist/types/src/packlets/invitations/invitations-proxy.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/invitations.d.ts +0 -55
- package/dist/types/src/packlets/invitations/invitations.d.ts.map +0 -1
- package/dist/types/src/packlets/invitations/space-invitations-proxy.d.ts +0 -11
- package/dist/types/src/packlets/invitations/space-invitations-proxy.d.ts.map +0 -1
- package/dist/types/src/packlets/services/service-definitions.d.ts +0 -30
- package/dist/types/src/packlets/services/service-definitions.d.ts.map +0 -1
- package/dist/types/src/packlets/services/service-proxy.d.ts +0 -17
- package/dist/types/src/packlets/services/service-proxy.d.ts.map +0 -1
- package/dist/types/src/packlets/vault/services.d.ts +0 -21
- package/dist/types/src/packlets/vault/services.d.ts.map +0 -1
- package/dist/types/src/packlets/vault/shell-controller.d.ts +0 -18
- package/dist/types/src/packlets/vault/shell-controller.d.ts.map +0 -1
- package/src/packlets/invitations/device-invitations-proxy.ts +0 -14
- package/src/packlets/invitations/encoder.test.ts +0 -23
- package/src/packlets/invitations/encoder.ts +0 -26
- package/src/packlets/invitations/invitations-handler.ts +0 -68
- package/src/packlets/invitations/invitations-proxy.ts +0 -159
- package/src/packlets/invitations/invitations.ts +0 -113
- package/src/packlets/invitations/space-invitations-proxy.ts +0 -16
- package/src/packlets/services/service-definitions.ts +0 -68
- package/src/packlets/services/service-proxy.ts +0 -54
- package/src/packlets/vault/services.ts +0 -42
- package/src/packlets/vault/shell-controller.ts +0 -56
|
@@ -804,79 +804,17 @@ var IdentityServiceImpl = class {
|
|
|
804
804
|
}
|
|
805
805
|
};
|
|
806
806
|
|
|
807
|
-
// packages/sdk/client-services/src/packlets/invitations/encoder.ts
|
|
808
|
-
import base from "base-x";
|
|
809
|
-
import { schema as schema2 } from "@dxos/protocols";
|
|
810
|
-
var base62 = base("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
|
811
|
-
var codec = schema2.getCodecForType("dxos.client.services.Invitation");
|
|
812
|
-
var InvitationEncoder = class {
|
|
813
|
-
static decode(text) {
|
|
814
|
-
return codec.decode(base62.decode(text));
|
|
815
|
-
}
|
|
816
|
-
static encode(invitation) {
|
|
817
|
-
return base62.encode(codec.encode(invitation));
|
|
818
|
-
}
|
|
819
|
-
};
|
|
820
|
-
|
|
821
|
-
// packages/sdk/client-services/src/packlets/invitations/invitations.ts
|
|
822
|
-
import assert4 from "@dxos/node-std/assert";
|
|
823
|
-
import { CancellableObservableProvider } from "@dxos/async";
|
|
824
|
-
import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
|
|
825
|
-
var AUTHENTICATION_CODE_LENGTH = 6;
|
|
826
|
-
var INVITATION_TIMEOUT = 3 * 6e4;
|
|
827
|
-
var ON_CLOSE_DELAY = 1e3;
|
|
828
|
-
var InvitationObservableProvider = class extends CancellableObservableProvider {
|
|
829
|
-
get invitation() {
|
|
830
|
-
return this._invitation;
|
|
831
|
-
}
|
|
832
|
-
setInvitation(invitation) {
|
|
833
|
-
this._invitation = invitation;
|
|
834
|
-
}
|
|
835
|
-
};
|
|
836
|
-
var AuthenticatingInvitationProvider = class extends InvitationObservableProvider {
|
|
837
|
-
// prettier-ignore
|
|
838
|
-
constructor(_actions) {
|
|
839
|
-
super(() => this._actions.onCancel());
|
|
840
|
-
this._actions = _actions;
|
|
841
|
-
}
|
|
842
|
-
async authenticate(authenticationCode) {
|
|
843
|
-
return this._actions.onAuthenticate(authenticationCode);
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
var wrapObservable = async (observable) => {
|
|
847
|
-
return new Promise((resolve, reject) => {
|
|
848
|
-
const unsubscribe = observable.subscribe({
|
|
849
|
-
onSuccess: (invitation) => {
|
|
850
|
-
assert4(invitation.state === Invitation.State.SUCCESS);
|
|
851
|
-
unsubscribe();
|
|
852
|
-
resolve(invitation);
|
|
853
|
-
},
|
|
854
|
-
onError: (err) => {
|
|
855
|
-
unsubscribe();
|
|
856
|
-
reject(err);
|
|
857
|
-
}
|
|
858
|
-
});
|
|
859
|
-
});
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
863
|
-
var AbstractInvitationsHandler = class {
|
|
864
|
-
// prettier-ignore
|
|
865
|
-
constructor(_networkManager) {
|
|
866
|
-
this._networkManager = _networkManager;
|
|
867
|
-
}
|
|
868
|
-
};
|
|
869
|
-
|
|
870
807
|
// packages/sdk/client-services/src/packlets/invitations/device-invitations-handler.ts
|
|
871
|
-
import
|
|
808
|
+
import assert4 from "@dxos/node-std/assert";
|
|
872
809
|
import { scheduleTask, sleep, Trigger as Trigger2 } from "@dxos/async";
|
|
810
|
+
import { AbstractInvitationsHandler, AuthenticatingInvitationProvider, AUTHENTICATION_CODE_LENGTH, InvitationObservableProvider, INVITATION_TIMEOUT, ON_CLOSE_DELAY } from "@dxos/client";
|
|
873
811
|
import { Context as Context3 } from "@dxos/context";
|
|
874
812
|
import { generatePasscode } from "@dxos/credentials";
|
|
875
813
|
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
876
814
|
import { log as log4 } from "@dxos/log";
|
|
877
815
|
import { createTeleportProtocolFactory, StarTopology } from "@dxos/network-manager";
|
|
878
|
-
import { schema as
|
|
879
|
-
import { Invitation
|
|
816
|
+
import { schema as schema2 } from "@dxos/protocols";
|
|
817
|
+
import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
|
|
880
818
|
import { AuthenticationResponse } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
881
819
|
import { RpcExtension } from "@dxos/teleport";
|
|
882
820
|
var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
@@ -890,7 +828,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
890
828
|
*/
|
|
891
829
|
createInvitation(context, options) {
|
|
892
830
|
const { type, timeout = INVITATION_TIMEOUT, swarmKey } = options != null ? options : {};
|
|
893
|
-
|
|
831
|
+
assert4(type !== Invitation.Type.OFFLINE);
|
|
894
832
|
const identity = this._params.getIdentity();
|
|
895
833
|
const invitation = {
|
|
896
834
|
type,
|
|
@@ -916,7 +854,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
916
854
|
host: identity.deviceKey
|
|
917
855
|
}, {
|
|
918
856
|
file: "device-invitations-handler.ts",
|
|
919
|
-
line:
|
|
857
|
+
line: 92,
|
|
920
858
|
scope: this,
|
|
921
859
|
callSite: (f, a) => f(...a)
|
|
922
860
|
});
|
|
@@ -932,7 +870,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
932
870
|
authenticationCode: code
|
|
933
871
|
}, {
|
|
934
872
|
file: "device-invitations-handler.ts",
|
|
935
|
-
line:
|
|
873
|
+
line: 106,
|
|
936
874
|
scope: this,
|
|
937
875
|
callSite: (f, a) => f(...a)
|
|
938
876
|
});
|
|
@@ -944,7 +882,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
944
882
|
// TODO(burdon): Not used: controlFeedKey, dataFeedKey.
|
|
945
883
|
presentAdmissionCredentials: async (credentials) => {
|
|
946
884
|
try {
|
|
947
|
-
if (invitation.type !==
|
|
885
|
+
if (invitation.type !== Invitation.Type.INTERACTIVE_TESTING) {
|
|
948
886
|
if (invitation.authenticationCode === void 0 || invitation.authenticationCode !== authenticationCode) {
|
|
949
887
|
throw new Error(`invalid authentication code: ${authenticationCode}`);
|
|
950
888
|
}
|
|
@@ -954,7 +892,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
954
892
|
guest: credentials.deviceKey
|
|
955
893
|
}, {
|
|
956
894
|
file: "device-invitations-handler.ts",
|
|
957
|
-
line:
|
|
895
|
+
line: 121,
|
|
958
896
|
scope: this,
|
|
959
897
|
callSite: (f, a) => f(...a)
|
|
960
898
|
});
|
|
@@ -973,7 +911,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
973
911
|
host: identity.deviceKey
|
|
974
912
|
}, {
|
|
975
913
|
file: "device-invitations-handler.ts",
|
|
976
|
-
line:
|
|
914
|
+
line: 137,
|
|
977
915
|
scope: this,
|
|
978
916
|
callSite: (f, a) => f(...a)
|
|
979
917
|
});
|
|
@@ -986,7 +924,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
986
924
|
guest: deviceKey
|
|
987
925
|
}, {
|
|
988
926
|
file: "device-invitations-handler.ts",
|
|
989
|
-
line:
|
|
927
|
+
line: 140,
|
|
990
928
|
scope: this,
|
|
991
929
|
callSite: (f, a) => f(...a)
|
|
992
930
|
});
|
|
@@ -995,7 +933,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
995
933
|
if (!observable.cancelled) {
|
|
996
934
|
log4.error("failed", err, {
|
|
997
935
|
file: "device-invitations-handler.ts",
|
|
998
|
-
line:
|
|
936
|
+
line: 144,
|
|
999
937
|
scope: this,
|
|
1000
938
|
callSite: (f, a) => f(...a)
|
|
1001
939
|
});
|
|
@@ -1060,22 +998,22 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1060
998
|
}
|
|
1061
999
|
log4("connected", {}, {
|
|
1062
1000
|
file: "device-invitations-handler.ts",
|
|
1063
|
-
line:
|
|
1001
|
+
line: 215,
|
|
1064
1002
|
scope: this,
|
|
1065
1003
|
callSite: (f, a) => f(...a)
|
|
1066
1004
|
});
|
|
1067
1005
|
(_b = (_a = observable.callback).onConnected) == null ? void 0 : _b.call(_a, invitation);
|
|
1068
1006
|
log4("sending admission request", {}, {
|
|
1069
1007
|
file: "device-invitations-handler.ts",
|
|
1070
|
-
line:
|
|
1008
|
+
line: 219,
|
|
1071
1009
|
scope: this,
|
|
1072
1010
|
callSite: (f, a) => f(...a)
|
|
1073
1011
|
});
|
|
1074
1012
|
const { identityKey, haloSpaceKey, genesisFeedKey } = await extension.rpc.HaloHostService.requestAdmission();
|
|
1075
|
-
if (invitation.type === void 0 || invitation.type ===
|
|
1013
|
+
if (invitation.type === void 0 || invitation.type === Invitation.Type.INTERACTIVE) {
|
|
1076
1014
|
log4("guest waiting for authentication code...", {}, {
|
|
1077
1015
|
file: "device-invitations-handler.ts",
|
|
1078
|
-
line:
|
|
1016
|
+
line: 226,
|
|
1079
1017
|
scope: this,
|
|
1080
1018
|
callSite: (f, a) => f(...a)
|
|
1081
1019
|
});
|
|
@@ -1085,7 +1023,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1085
1023
|
});
|
|
1086
1024
|
log4("sending authentication request", {}, {
|
|
1087
1025
|
file: "device-invitations-handler.ts",
|
|
1088
|
-
line:
|
|
1026
|
+
line: 229,
|
|
1089
1027
|
scope: this,
|
|
1090
1028
|
callSite: (f, a) => f(...a)
|
|
1091
1029
|
});
|
|
@@ -1103,7 +1041,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1103
1041
|
dataFeedKey
|
|
1104
1042
|
}, {
|
|
1105
1043
|
file: "device-invitations-handler.ts",
|
|
1106
|
-
line:
|
|
1044
|
+
line: 238,
|
|
1107
1045
|
scope: this,
|
|
1108
1046
|
callSite: (f, a) => f(...a)
|
|
1109
1047
|
});
|
|
@@ -1125,7 +1063,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1125
1063
|
identityKey
|
|
1126
1064
|
}, {
|
|
1127
1065
|
file: "device-invitations-handler.ts",
|
|
1128
|
-
line:
|
|
1066
|
+
line: 257,
|
|
1129
1067
|
scope: this,
|
|
1130
1068
|
callSite: (f, a) => f(...a)
|
|
1131
1069
|
});
|
|
@@ -1134,7 +1072,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1134
1072
|
if (!observable.cancelled) {
|
|
1135
1073
|
log4.warn("auth failed", err, {
|
|
1136
1074
|
file: "device-invitations-handler.ts",
|
|
1137
|
-
line:
|
|
1075
|
+
line: 261,
|
|
1138
1076
|
scope: this,
|
|
1139
1077
|
callSite: (f, a) => f(...a)
|
|
1140
1078
|
});
|
|
@@ -1150,7 +1088,7 @@ var DeviceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1150
1088
|
};
|
|
1151
1089
|
scheduleTask(ctx, async () => {
|
|
1152
1090
|
var _a, _b;
|
|
1153
|
-
|
|
1091
|
+
assert4(invitation.swarmKey);
|
|
1154
1092
|
const topic = invitation.swarmKey;
|
|
1155
1093
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1156
1094
|
topic,
|
|
@@ -1173,7 +1111,7 @@ var HostHaloInvitationExtension = class extends RpcExtension {
|
|
|
1173
1111
|
constructor(_callbacks) {
|
|
1174
1112
|
super({
|
|
1175
1113
|
exposed: {
|
|
1176
|
-
HaloHostService:
|
|
1114
|
+
HaloHostService: schema2.getService("dxos.halo.invitations.HaloHostService")
|
|
1177
1115
|
}
|
|
1178
1116
|
});
|
|
1179
1117
|
this._callbacks = _callbacks;
|
|
@@ -1205,7 +1143,7 @@ var GuestHaloInvitationExtension = class extends RpcExtension {
|
|
|
1205
1143
|
constructor(_callbacks) {
|
|
1206
1144
|
super({
|
|
1207
1145
|
requested: {
|
|
1208
|
-
HaloHostService:
|
|
1146
|
+
HaloHostService: schema2.getService("dxos.halo.invitations.HaloHostService")
|
|
1209
1147
|
}
|
|
1210
1148
|
});
|
|
1211
1149
|
this._callbacks = _callbacks;
|
|
@@ -1219,152 +1157,11 @@ var GuestHaloInvitationExtension = class extends RpcExtension {
|
|
|
1219
1157
|
}
|
|
1220
1158
|
};
|
|
1221
1159
|
|
|
1222
|
-
// packages/sdk/client-services/src/packlets/invitations/invitations-proxy.ts
|
|
1223
|
-
import assert6 from "@dxos/node-std/assert";
|
|
1224
|
-
import { observableError } from "@dxos/async";
|
|
1225
|
-
import { log as log5 } from "@dxos/log";
|
|
1226
|
-
import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1227
|
-
var AbstractInvitationsProxy = class {
|
|
1228
|
-
// prettier-ignore
|
|
1229
|
-
constructor(_invitationsService) {
|
|
1230
|
-
this._invitationsService = _invitationsService;
|
|
1231
|
-
}
|
|
1232
|
-
createInvitation(context, options) {
|
|
1233
|
-
let invitationId;
|
|
1234
|
-
const observable = new InvitationObservableProvider(async () => {
|
|
1235
|
-
if (invitationId) {
|
|
1236
|
-
await this._invitationsService.cancelInvitation({
|
|
1237
|
-
invitationId
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
});
|
|
1241
|
-
const invitation = {
|
|
1242
|
-
...this.getInvitationOptions(context),
|
|
1243
|
-
...options
|
|
1244
|
-
};
|
|
1245
|
-
const stream = this._invitationsService.createInvitation(invitation);
|
|
1246
|
-
stream.subscribe((invitation2) => {
|
|
1247
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1248
|
-
observable.setInvitation(invitation2);
|
|
1249
|
-
switch (invitation2.state) {
|
|
1250
|
-
case Invitation3.State.CONNECTING: {
|
|
1251
|
-
assert6(invitation2.invitationId);
|
|
1252
|
-
invitationId = invitation2.invitationId;
|
|
1253
|
-
(_b = (_a = observable.callback).onConnecting) == null ? void 0 : _b.call(_a, invitation2);
|
|
1254
|
-
break;
|
|
1255
|
-
}
|
|
1256
|
-
case Invitation3.State.CONNECTED: {
|
|
1257
|
-
(_d = (_c = observable.callback).onConnected) == null ? void 0 : _d.call(_c, invitation2);
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
case Invitation3.State.AUTHENTICATING: {
|
|
1261
|
-
(_f = (_e = observable.callback).onAuthenticating) == null ? void 0 : _f.call(_e, invitation2);
|
|
1262
|
-
break;
|
|
1263
|
-
}
|
|
1264
|
-
case Invitation3.State.SUCCESS: {
|
|
1265
|
-
(_h = (_g = observable.callback).onSuccess) == null ? void 0 : _h.call(_g, invitation2);
|
|
1266
|
-
break;
|
|
1267
|
-
}
|
|
1268
|
-
case Invitation3.State.CANCELLED: {
|
|
1269
|
-
(_j = (_i = observable.callback).onCancelled) == null ? void 0 : _j.call(_i);
|
|
1270
|
-
break;
|
|
1271
|
-
}
|
|
1272
|
-
default: {
|
|
1273
|
-
log5.error(`Invalid state: ${invitation2.state}`, {}, {
|
|
1274
|
-
file: "invitations-proxy.ts",
|
|
1275
|
-
line: 81,
|
|
1276
|
-
scope: this,
|
|
1277
|
-
callSite: (f, a) => f(...a)
|
|
1278
|
-
});
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}, (err) => {
|
|
1282
|
-
if (err) {
|
|
1283
|
-
observableError(observable, err);
|
|
1284
|
-
}
|
|
1285
|
-
});
|
|
1286
|
-
return observable;
|
|
1287
|
-
}
|
|
1288
|
-
acceptInvitation(invitation, options) {
|
|
1289
|
-
assert6(invitation && invitation.swarmKey);
|
|
1290
|
-
const observable = new AuthenticatingInvitationProvider({
|
|
1291
|
-
onCancel: async () => {
|
|
1292
|
-
var _a;
|
|
1293
|
-
const invitationId = (_a = observable.invitation) == null ? void 0 : _a.invitationId;
|
|
1294
|
-
assert6(invitationId);
|
|
1295
|
-
await this._invitationsService.cancelInvitation({
|
|
1296
|
-
invitationId
|
|
1297
|
-
});
|
|
1298
|
-
},
|
|
1299
|
-
onAuthenticate: async (authenticationCode) => {
|
|
1300
|
-
var _a;
|
|
1301
|
-
const invitationId = (_a = observable.invitation) == null ? void 0 : _a.invitationId;
|
|
1302
|
-
assert6(invitationId);
|
|
1303
|
-
await this._invitationsService.authenticate({
|
|
1304
|
-
invitationId,
|
|
1305
|
-
authenticationCode
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1309
|
-
const stream = this._invitationsService.acceptInvitation({
|
|
1310
|
-
...invitation,
|
|
1311
|
-
...options
|
|
1312
|
-
});
|
|
1313
|
-
stream.subscribe((invitation2) => {
|
|
1314
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1315
|
-
assert6(invitation2.invitationId);
|
|
1316
|
-
observable.setInvitation(invitation2);
|
|
1317
|
-
switch (invitation2.state) {
|
|
1318
|
-
case Invitation3.State.CONNECTING: {
|
|
1319
|
-
(_b = (_a = observable.callback).onConnecting) == null ? void 0 : _b.call(_a, invitation2);
|
|
1320
|
-
break;
|
|
1321
|
-
}
|
|
1322
|
-
case Invitation3.State.CONNECTED: {
|
|
1323
|
-
(_d = (_c = observable.callback).onConnected) == null ? void 0 : _d.call(_c, invitation2);
|
|
1324
|
-
break;
|
|
1325
|
-
}
|
|
1326
|
-
case Invitation3.State.AUTHENTICATING: {
|
|
1327
|
-
(_f = (_e = observable.callback).onAuthenticating) == null ? void 0 : _f.call(_e, invitation2);
|
|
1328
|
-
break;
|
|
1329
|
-
}
|
|
1330
|
-
case Invitation3.State.SUCCESS: {
|
|
1331
|
-
(_h = (_g = observable.callback).onSuccess) == null ? void 0 : _h.call(_g, invitation2);
|
|
1332
|
-
break;
|
|
1333
|
-
}
|
|
1334
|
-
case Invitation3.State.CANCELLED: {
|
|
1335
|
-
(_j = (_i = observable.callback).onCancelled) == null ? void 0 : _j.call(_i);
|
|
1336
|
-
break;
|
|
1337
|
-
}
|
|
1338
|
-
default: {
|
|
1339
|
-
log5.error(`Invalid state: ${invitation2.state}`, {}, {
|
|
1340
|
-
file: "invitations-proxy.ts",
|
|
1341
|
-
line: 146,
|
|
1342
|
-
scope: this,
|
|
1343
|
-
callSite: (f, a) => f(...a)
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
}, (err) => {
|
|
1348
|
-
if (err) {
|
|
1349
|
-
observableError(observable, err);
|
|
1350
|
-
}
|
|
1351
|
-
});
|
|
1352
|
-
return observable;
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
|
|
1356
|
-
// packages/sdk/client-services/src/packlets/invitations/device-invitations-proxy.ts
|
|
1357
|
-
var DeviceInvitationsProxy = class extends AbstractInvitationsProxy {
|
|
1358
|
-
getInvitationOptions() {
|
|
1359
|
-
return {};
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
1160
|
// packages/sdk/client-services/src/packlets/invitations/invitations-service.ts
|
|
1364
|
-
import
|
|
1161
|
+
import assert5 from "@dxos/node-std/assert";
|
|
1365
1162
|
import { Stream as Stream7 } from "@dxos/codec-protobuf";
|
|
1366
|
-
import { log as
|
|
1367
|
-
import { Invitation as
|
|
1163
|
+
import { log as log5 } from "@dxos/log";
|
|
1164
|
+
import { Invitation as Invitation2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1368
1165
|
var AbstractInvitationsService = class {
|
|
1369
1166
|
// prettier-ignore
|
|
1370
1167
|
constructor(_identityManager, _getInvitationsHandler) {
|
|
@@ -1384,9 +1181,9 @@ var AbstractInvitationsService = class {
|
|
|
1384
1181
|
return new Stream7(({ next, close }) => {
|
|
1385
1182
|
const invitationsHandler = this._getInvitationsHandler();
|
|
1386
1183
|
const context = this.getContext(invitation);
|
|
1387
|
-
|
|
1184
|
+
log5("stream opened", this.getLoggingContext(), {
|
|
1388
1185
|
file: "invitations-service.ts",
|
|
1389
|
-
line:
|
|
1186
|
+
line: 48,
|
|
1390
1187
|
scope: this,
|
|
1391
1188
|
callSite: (f, a) => f(...a)
|
|
1392
1189
|
});
|
|
@@ -1399,60 +1196,60 @@ var AbstractInvitationsService = class {
|
|
|
1399
1196
|
});
|
|
1400
1197
|
observable.subscribe({
|
|
1401
1198
|
onConnecting: (invitation2) => {
|
|
1402
|
-
|
|
1199
|
+
assert5(invitation2.invitationId);
|
|
1403
1200
|
invitationId = invitation2.invitationId;
|
|
1404
1201
|
this._createInvitations.set(invitation2.invitationId, observable);
|
|
1405
|
-
invitation2.state =
|
|
1202
|
+
invitation2.state = Invitation2.State.CONNECTING;
|
|
1406
1203
|
next(invitation2);
|
|
1407
1204
|
},
|
|
1408
1205
|
onConnected: (invitation2) => {
|
|
1409
|
-
|
|
1410
|
-
invitation2.state =
|
|
1206
|
+
assert5(invitation2.invitationId);
|
|
1207
|
+
invitation2.state = Invitation2.State.CONNECTED;
|
|
1411
1208
|
next(invitation2);
|
|
1412
1209
|
},
|
|
1413
1210
|
onAuthenticating: (invitation2) => {
|
|
1414
|
-
|
|
1415
|
-
invitation2.state =
|
|
1211
|
+
assert5(invitation2.invitationId);
|
|
1212
|
+
invitation2.state = Invitation2.State.AUTHENTICATING;
|
|
1416
1213
|
next(invitation2);
|
|
1417
1214
|
},
|
|
1418
1215
|
onSuccess: (invitation2) => {
|
|
1419
|
-
|
|
1420
|
-
invitation2.state =
|
|
1216
|
+
assert5(invitation2.invitationId);
|
|
1217
|
+
invitation2.state = Invitation2.State.SUCCESS;
|
|
1421
1218
|
next(invitation2);
|
|
1422
1219
|
close();
|
|
1423
1220
|
},
|
|
1424
1221
|
onCancelled: () => {
|
|
1425
|
-
|
|
1222
|
+
assert5(invitationId);
|
|
1426
1223
|
invitation.invitationId = invitationId;
|
|
1427
|
-
invitation.state =
|
|
1224
|
+
invitation.state = Invitation2.State.CANCELLED;
|
|
1428
1225
|
next(invitation);
|
|
1429
1226
|
close();
|
|
1430
1227
|
},
|
|
1431
1228
|
onTimeout: (err) => {
|
|
1432
|
-
invitation.state =
|
|
1229
|
+
invitation.state = Invitation2.State.TIMEOUT;
|
|
1433
1230
|
close(err);
|
|
1434
1231
|
},
|
|
1435
1232
|
onError: (err) => {
|
|
1436
|
-
invitation.state =
|
|
1233
|
+
invitation.state = Invitation2.State.ERROR;
|
|
1437
1234
|
close(err);
|
|
1438
1235
|
}
|
|
1439
1236
|
});
|
|
1440
1237
|
return (err) => {
|
|
1441
1238
|
const context2 = this.getLoggingContext();
|
|
1442
1239
|
if (err) {
|
|
1443
|
-
|
|
1240
|
+
log5.warn("stream closed", {
|
|
1444
1241
|
...context2,
|
|
1445
1242
|
err
|
|
1446
1243
|
}, {
|
|
1447
1244
|
file: "invitations-service.ts",
|
|
1448
|
-
line:
|
|
1245
|
+
line: 97,
|
|
1449
1246
|
scope: this,
|
|
1450
1247
|
callSite: (f, a) => f(...a)
|
|
1451
1248
|
});
|
|
1452
1249
|
} else {
|
|
1453
|
-
|
|
1250
|
+
log5("stream closed", context2, {
|
|
1454
1251
|
file: "invitations-service.ts",
|
|
1455
|
-
line:
|
|
1252
|
+
line: 99,
|
|
1456
1253
|
scope: this,
|
|
1457
1254
|
callSite: (f, a) => f(...a)
|
|
1458
1255
|
});
|
|
@@ -1463,9 +1260,9 @@ var AbstractInvitationsService = class {
|
|
|
1463
1260
|
}
|
|
1464
1261
|
acceptInvitation(invitation, options) {
|
|
1465
1262
|
return new Stream7(({ next, close }) => {
|
|
1466
|
-
|
|
1263
|
+
log5("stream opened", this.getLoggingContext(), {
|
|
1467
1264
|
file: "invitations-service.ts",
|
|
1468
|
-
line:
|
|
1265
|
+
line: 109,
|
|
1469
1266
|
scope: this,
|
|
1470
1267
|
callSite: (f, a) => f(...a)
|
|
1471
1268
|
});
|
|
@@ -1474,59 +1271,59 @@ var AbstractInvitationsService = class {
|
|
|
1474
1271
|
const observable = invitationsHandler.acceptInvitation(invitation, options);
|
|
1475
1272
|
observable.subscribe({
|
|
1476
1273
|
onConnecting: (invitation2) => {
|
|
1477
|
-
|
|
1274
|
+
assert5(invitation2.invitationId);
|
|
1478
1275
|
invitationId = invitation2.invitationId;
|
|
1479
1276
|
this._acceptInvitations.set(invitation2.invitationId, observable);
|
|
1480
|
-
invitation2.state =
|
|
1277
|
+
invitation2.state = Invitation2.State.CONNECTING;
|
|
1481
1278
|
next(invitation2);
|
|
1482
1279
|
},
|
|
1483
1280
|
onConnected: (invitation2) => {
|
|
1484
|
-
|
|
1485
|
-
invitation2.state =
|
|
1281
|
+
assert5(invitation2.invitationId);
|
|
1282
|
+
invitation2.state = Invitation2.State.CONNECTED;
|
|
1486
1283
|
next(invitation2);
|
|
1487
1284
|
},
|
|
1488
1285
|
onAuthenticating: (invitation2) => {
|
|
1489
|
-
|
|
1490
|
-
invitation2.state =
|
|
1286
|
+
assert5(invitation2.invitationId);
|
|
1287
|
+
invitation2.state = Invitation2.State.AUTHENTICATING;
|
|
1491
1288
|
next(invitation2);
|
|
1492
1289
|
},
|
|
1493
1290
|
onSuccess: (invitation2) => {
|
|
1494
|
-
invitation2.state =
|
|
1291
|
+
invitation2.state = Invitation2.State.SUCCESS;
|
|
1495
1292
|
next(invitation2);
|
|
1496
1293
|
close();
|
|
1497
1294
|
},
|
|
1498
1295
|
onCancelled: () => {
|
|
1499
|
-
|
|
1296
|
+
assert5(invitationId);
|
|
1500
1297
|
invitation.invitationId = invitationId;
|
|
1501
|
-
invitation.state =
|
|
1298
|
+
invitation.state = Invitation2.State.CANCELLED;
|
|
1502
1299
|
next(invitation);
|
|
1503
1300
|
close();
|
|
1504
1301
|
},
|
|
1505
1302
|
onTimeout: (err) => {
|
|
1506
|
-
invitation.state =
|
|
1303
|
+
invitation.state = Invitation2.State.TIMEOUT;
|
|
1507
1304
|
close(err);
|
|
1508
1305
|
},
|
|
1509
1306
|
onError: (err) => {
|
|
1510
|
-
invitation.state =
|
|
1307
|
+
invitation.state = Invitation2.State.ERROR;
|
|
1511
1308
|
close(err);
|
|
1512
1309
|
}
|
|
1513
1310
|
});
|
|
1514
1311
|
return (err) => {
|
|
1515
1312
|
const context = this.getLoggingContext();
|
|
1516
1313
|
if (err) {
|
|
1517
|
-
|
|
1314
|
+
log5.warn("stream closed", {
|
|
1518
1315
|
...context,
|
|
1519
1316
|
err
|
|
1520
1317
|
}, {
|
|
1521
1318
|
file: "invitations-service.ts",
|
|
1522
|
-
line:
|
|
1319
|
+
line: 157,
|
|
1523
1320
|
scope: this,
|
|
1524
1321
|
callSite: (f, a) => f(...a)
|
|
1525
1322
|
});
|
|
1526
1323
|
} else {
|
|
1527
|
-
|
|
1324
|
+
log5("stream closed", context, {
|
|
1528
1325
|
file: "invitations-service.ts",
|
|
1529
|
-
line:
|
|
1326
|
+
line: 159,
|
|
1530
1327
|
scope: this,
|
|
1531
1328
|
callSite: (f, a) => f(...a)
|
|
1532
1329
|
});
|
|
@@ -1536,20 +1333,20 @@ var AbstractInvitationsService = class {
|
|
|
1536
1333
|
});
|
|
1537
1334
|
}
|
|
1538
1335
|
async authenticate({ invitationId, authenticationCode }) {
|
|
1539
|
-
|
|
1336
|
+
log5("authenticating...", {}, {
|
|
1540
1337
|
file: "invitations-service.ts",
|
|
1541
|
-
line:
|
|
1338
|
+
line: 168,
|
|
1542
1339
|
scope: this,
|
|
1543
1340
|
callSite: (f, a) => f(...a)
|
|
1544
1341
|
});
|
|
1545
|
-
|
|
1342
|
+
assert5(invitationId);
|
|
1546
1343
|
const observable = this._acceptInvitations.get(invitationId);
|
|
1547
1344
|
if (!observable) {
|
|
1548
|
-
|
|
1345
|
+
log5.warn("invalid invitation", {
|
|
1549
1346
|
invitationId
|
|
1550
1347
|
}, {
|
|
1551
1348
|
file: "invitations-service.ts",
|
|
1552
|
-
line:
|
|
1349
|
+
line: 172,
|
|
1553
1350
|
scope: this,
|
|
1554
1351
|
callSite: (f, a) => f(...a)
|
|
1555
1352
|
});
|
|
@@ -1559,20 +1356,20 @@ var AbstractInvitationsService = class {
|
|
|
1559
1356
|
}
|
|
1560
1357
|
async cancelInvitation(invitation) {
|
|
1561
1358
|
var _a;
|
|
1562
|
-
|
|
1359
|
+
log5("cancelling...", {}, {
|
|
1563
1360
|
file: "invitations-service.ts",
|
|
1564
|
-
line:
|
|
1361
|
+
line: 179,
|
|
1565
1362
|
scope: this,
|
|
1566
1363
|
callSite: (f, a) => f(...a)
|
|
1567
1364
|
});
|
|
1568
|
-
|
|
1365
|
+
assert5(invitation.invitationId);
|
|
1569
1366
|
const observable = (_a = this._createInvitations.get(invitation.invitationId)) != null ? _a : this._acceptInvitations.get(invitation.invitationId);
|
|
1570
1367
|
if (!observable) {
|
|
1571
|
-
|
|
1368
|
+
log5.warn("invalid invitation", {
|
|
1572
1369
|
invitationId: invitation.invitationId
|
|
1573
1370
|
}, {
|
|
1574
1371
|
file: "invitations-service.ts",
|
|
1575
|
-
line:
|
|
1372
|
+
line: 184,
|
|
1576
1373
|
scope: this,
|
|
1577
1374
|
callSite: (f, a) => f(...a)
|
|
1578
1375
|
});
|
|
@@ -1594,20 +1391,21 @@ var DeviceInvitationsServiceImpl = class extends AbstractInvitationsService {
|
|
|
1594
1391
|
};
|
|
1595
1392
|
|
|
1596
1393
|
// packages/sdk/client-services/src/packlets/invitations/space-invitations-handler.ts
|
|
1597
|
-
import
|
|
1394
|
+
import assert6 from "@dxos/node-std/assert";
|
|
1598
1395
|
import { scheduleTask as scheduleTask2, sleep as sleep2, Trigger as Trigger3 } from "@dxos/async";
|
|
1396
|
+
import { AuthenticatingInvitationProvider as AuthenticatingInvitationProvider2, AUTHENTICATION_CODE_LENGTH as AUTHENTICATION_CODE_LENGTH2, InvitationObservableProvider as InvitationObservableProvider2, INVITATION_TIMEOUT as INVITATION_TIMEOUT2, ON_CLOSE_DELAY as ON_CLOSE_DELAY2, AbstractInvitationsHandler as AbstractInvitationsHandler2 } from "@dxos/client";
|
|
1599
1397
|
import { Context as Context4 } from "@dxos/context";
|
|
1600
1398
|
import { createAdmissionCredentials, generatePasscode as generatePasscode2, getCredentialAssertion } from "@dxos/credentials";
|
|
1601
1399
|
import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
1602
1400
|
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1603
|
-
import { log as
|
|
1401
|
+
import { log as log6 } from "@dxos/log";
|
|
1604
1402
|
import { createTeleportProtocolFactory as createTeleportProtocolFactory2, StarTopology as StarTopology2 } from "@dxos/network-manager";
|
|
1605
|
-
import { schema as
|
|
1606
|
-
import { Invitation as
|
|
1403
|
+
import { schema as schema3 } from "@dxos/protocols";
|
|
1404
|
+
import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1607
1405
|
import { AuthenticationResponse as AuthenticationResponse2, AuthMethod } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1608
1406
|
import { RpcExtension as RpcExtension2 } from "@dxos/teleport";
|
|
1609
1407
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1610
|
-
var SpaceInvitationsHandler = class extends
|
|
1408
|
+
var SpaceInvitationsHandler = class extends AbstractInvitationsHandler2 {
|
|
1611
1409
|
constructor(networkManager, _spaceManager, _signingContext, _keyring) {
|
|
1612
1410
|
super(networkManager);
|
|
1613
1411
|
this._spaceManager = _spaceManager;
|
|
@@ -1620,16 +1418,16 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1620
1418
|
createInvitation(space, options) {
|
|
1621
1419
|
var _a;
|
|
1622
1420
|
let swarmConnection;
|
|
1623
|
-
const { type, timeout =
|
|
1624
|
-
|
|
1625
|
-
|
|
1421
|
+
const { type, timeout = INVITATION_TIMEOUT2, swarmKey } = options != null ? options : {};
|
|
1422
|
+
assert6(type !== Invitation3.Type.OFFLINE);
|
|
1423
|
+
assert6(space);
|
|
1626
1424
|
const invitation = {
|
|
1627
1425
|
type,
|
|
1628
1426
|
invitationId: PublicKey4.random().toHex(),
|
|
1629
1427
|
swarmKey: swarmKey != null ? swarmKey : PublicKey4.random(),
|
|
1630
1428
|
spaceKey: space.key,
|
|
1631
1429
|
authMethod: (_a = options == null ? void 0 : options.authMethod) != null ? _a : AuthMethod.SHARED_SECRET,
|
|
1632
|
-
authenticationCode: generatePasscode2(
|
|
1430
|
+
authenticationCode: generatePasscode2(AUTHENTICATION_CODE_LENGTH2)
|
|
1633
1431
|
// TODO(dmaretskyi): Don't generate if authMethod === NONE .
|
|
1634
1432
|
};
|
|
1635
1433
|
const ctx = new Context4({
|
|
@@ -1638,7 +1436,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1638
1436
|
observable.callback.onError(err);
|
|
1639
1437
|
}
|
|
1640
1438
|
});
|
|
1641
|
-
const observable = new
|
|
1439
|
+
const observable = new InvitationObservableProvider2(async () => {
|
|
1642
1440
|
await (swarmConnection == null ? void 0 : swarmConnection.close());
|
|
1643
1441
|
});
|
|
1644
1442
|
let authenticationPassed = false;
|
|
@@ -1649,7 +1447,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1649
1447
|
const hostInvitationExtension = new HostSpaceInvitationExtension({
|
|
1650
1448
|
introduce: async ({ profile }) => {
|
|
1651
1449
|
var _a2, _b;
|
|
1652
|
-
|
|
1450
|
+
log6("guest introduced itself", {
|
|
1653
1451
|
guestProfile: profile,
|
|
1654
1452
|
host: this._signingContext.deviceKey,
|
|
1655
1453
|
spaceKey: space.key
|
|
@@ -1662,12 +1460,12 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1662
1460
|
guestProfile = profile;
|
|
1663
1461
|
(_b = (_a2 = observable.callback).onAuthenticating) == null ? void 0 : _b.call(_a2, invitation);
|
|
1664
1462
|
return {
|
|
1665
|
-
spaceKey: type ===
|
|
1463
|
+
spaceKey: type === Invitation3.Type.INTERACTIVE_TESTING || type === Invitation3.Type.MULTIUSE_TESTING ? space.key : void 0,
|
|
1666
1464
|
authMethod: invitation.authMethod
|
|
1667
1465
|
};
|
|
1668
1466
|
},
|
|
1669
1467
|
authenticate: async ({ authenticationCode: code }) => {
|
|
1670
|
-
|
|
1468
|
+
log6("received authentication request", {
|
|
1671
1469
|
authenticationCode: code
|
|
1672
1470
|
}, {
|
|
1673
1471
|
file: "space-invitations-handler.ts",
|
|
@@ -1678,7 +1476,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1678
1476
|
let status = AuthenticationResponse2.Status.OK;
|
|
1679
1477
|
switch (invitation.authMethod) {
|
|
1680
1478
|
case AuthMethod.NONE: {
|
|
1681
|
-
|
|
1479
|
+
log6("authentication not required", {}, {
|
|
1682
1480
|
file: "space-invitations-handler.ts",
|
|
1683
1481
|
line: 128,
|
|
1684
1482
|
scope: this,
|
|
@@ -1701,7 +1499,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1701
1499
|
break;
|
|
1702
1500
|
}
|
|
1703
1501
|
default: {
|
|
1704
|
-
|
|
1502
|
+
log6.error("invalid authentication method", {
|
|
1705
1503
|
authMethod: invitation.authMethod
|
|
1706
1504
|
}, {
|
|
1707
1505
|
file: "space-invitations-handler.ts",
|
|
@@ -1722,7 +1520,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1722
1520
|
if (isAuthenticationRequired(invitation) && !authenticationPassed) {
|
|
1723
1521
|
throw new Error("Not authenticated");
|
|
1724
1522
|
}
|
|
1725
|
-
|
|
1523
|
+
log6("writing guest credentials", {
|
|
1726
1524
|
host: this._signingContext.deviceKey,
|
|
1727
1525
|
guest: deviceKey
|
|
1728
1526
|
}, {
|
|
@@ -1732,9 +1530,9 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1732
1530
|
callSite: (f, a) => f(...a)
|
|
1733
1531
|
});
|
|
1734
1532
|
const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, identityKey, space.key, space.inner.genesisFeedKey, guestProfile);
|
|
1735
|
-
|
|
1533
|
+
assert6(credentials[0].credential);
|
|
1736
1534
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
1737
|
-
|
|
1535
|
+
assert6(getCredentialAssertion(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember");
|
|
1738
1536
|
await writeMessages2(space.inner.controlPipeline.writer, credentials);
|
|
1739
1537
|
complete.wake(deviceKey);
|
|
1740
1538
|
return {
|
|
@@ -1749,7 +1547,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1749
1547
|
scheduleTask2(ctx, async () => {
|
|
1750
1548
|
var _a2, _b;
|
|
1751
1549
|
try {
|
|
1752
|
-
|
|
1550
|
+
log6("connected", {
|
|
1753
1551
|
host: this._signingContext.deviceKey
|
|
1754
1552
|
}, {
|
|
1755
1553
|
file: "space-invitations-handler.ts",
|
|
@@ -1761,7 +1559,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1761
1559
|
const deviceKey = await complete.wait({
|
|
1762
1560
|
timeout
|
|
1763
1561
|
});
|
|
1764
|
-
|
|
1562
|
+
log6("admitted guest", {
|
|
1765
1563
|
host: this._signingContext.deviceKey,
|
|
1766
1564
|
guest: deviceKey
|
|
1767
1565
|
}, {
|
|
@@ -1773,7 +1571,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1773
1571
|
observable.callback.onSuccess(invitation);
|
|
1774
1572
|
} catch (err) {
|
|
1775
1573
|
if (!observable.cancelled) {
|
|
1776
|
-
|
|
1574
|
+
log6.error("failed", err, {
|
|
1777
1575
|
file: "space-invitations-handler.ts",
|
|
1778
1576
|
line: 198,
|
|
1779
1577
|
scope: this,
|
|
@@ -1782,8 +1580,8 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1782
1580
|
observable.callback.onError(err);
|
|
1783
1581
|
}
|
|
1784
1582
|
} finally {
|
|
1785
|
-
if (type !==
|
|
1786
|
-
await sleep2(
|
|
1583
|
+
if (type !== Invitation3.Type.MULTIUSE_TESTING) {
|
|
1584
|
+
await sleep2(ON_CLOSE_DELAY2);
|
|
1787
1585
|
await ctx.dispose();
|
|
1788
1586
|
}
|
|
1789
1587
|
}
|
|
@@ -1814,7 +1612,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1814
1612
|
* which then writes the guest's credentials to the space.
|
|
1815
1613
|
*/
|
|
1816
1614
|
acceptInvitation(invitation, options) {
|
|
1817
|
-
const { timeout =
|
|
1615
|
+
const { timeout = INVITATION_TIMEOUT2 } = options != null ? options : {};
|
|
1818
1616
|
const ctx = new Context4({
|
|
1819
1617
|
onError: (err) => {
|
|
1820
1618
|
void ctx.dispose();
|
|
@@ -1822,7 +1620,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1822
1620
|
}
|
|
1823
1621
|
});
|
|
1824
1622
|
const authenticated = new Trigger3();
|
|
1825
|
-
const observable = new
|
|
1623
|
+
const observable = new AuthenticatingInvitationProvider2({
|
|
1826
1624
|
onCancel: async () => {
|
|
1827
1625
|
await ctx.dispose();
|
|
1828
1626
|
},
|
|
@@ -1841,7 +1639,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1841
1639
|
if (++connectionCount > 1) {
|
|
1842
1640
|
throw new Error(`multiple connections detected: ${connectionCount}`);
|
|
1843
1641
|
}
|
|
1844
|
-
|
|
1642
|
+
log6("connected", {
|
|
1845
1643
|
guest: this._signingContext.deviceKey
|
|
1846
1644
|
}, {
|
|
1847
1645
|
file: "space-invitations-handler.ts",
|
|
@@ -1850,7 +1648,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1850
1648
|
callSite: (f, a) => f(...a)
|
|
1851
1649
|
});
|
|
1852
1650
|
(_b = (_a = observable.callback).onConnected) == null ? void 0 : _b.call(_a, invitation);
|
|
1853
|
-
|
|
1651
|
+
log6("introduce", {
|
|
1854
1652
|
guest: this._signingContext.deviceKey
|
|
1855
1653
|
}, {
|
|
1856
1654
|
file: "space-invitations-handler.ts",
|
|
@@ -1861,7 +1659,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1861
1659
|
const introductionResponse = await extension.rpc.SpaceHostService.introduce({
|
|
1862
1660
|
profile: this._signingContext.profile
|
|
1863
1661
|
});
|
|
1864
|
-
|
|
1662
|
+
log6("introduce response", {
|
|
1865
1663
|
guest: this._signingContext.deviceKey,
|
|
1866
1664
|
response: introductionResponse
|
|
1867
1665
|
}, {
|
|
@@ -1877,7 +1675,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1877
1675
|
if (isAuthenticationRequired(invitation)) {
|
|
1878
1676
|
(_d = (_c = observable.callback).onAuthenticating) == null ? void 0 : _d.call(_c, invitation);
|
|
1879
1677
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1880
|
-
|
|
1678
|
+
log6("guest waiting for authentication code...", {}, {
|
|
1881
1679
|
file: "space-invitations-handler.ts",
|
|
1882
1680
|
line: 293,
|
|
1883
1681
|
scope: this,
|
|
@@ -1887,7 +1685,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1887
1685
|
const authenticationCode = await authenticated.wait({
|
|
1888
1686
|
timeout
|
|
1889
1687
|
});
|
|
1890
|
-
|
|
1688
|
+
log6("sending authentication request", {}, {
|
|
1891
1689
|
file: "space-invitations-handler.ts",
|
|
1892
1690
|
line: 297,
|
|
1893
1691
|
scope: this,
|
|
@@ -1903,7 +1701,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1903
1701
|
if (attempt === MAX_OTP_ATTEMPTS) {
|
|
1904
1702
|
throw new Error(`Maximum retry attempts: ${MAX_OTP_ATTEMPTS}`);
|
|
1905
1703
|
} else {
|
|
1906
|
-
|
|
1704
|
+
log6("retrying invalid code", {
|
|
1907
1705
|
attempt
|
|
1908
1706
|
}, {
|
|
1909
1707
|
file: "space-invitations-handler.ts",
|
|
@@ -1918,7 +1716,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1918
1716
|
}
|
|
1919
1717
|
const controlFeedKey = await this._keyring.createKey();
|
|
1920
1718
|
const dataFeedKey = await this._keyring.createKey();
|
|
1921
|
-
|
|
1719
|
+
log6("request admission", {
|
|
1922
1720
|
guest: this._signingContext.deviceKey
|
|
1923
1721
|
}, {
|
|
1924
1722
|
file: "space-invitations-handler.ts",
|
|
@@ -1933,14 +1731,14 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1933
1731
|
dataFeedKey
|
|
1934
1732
|
});
|
|
1935
1733
|
const assertion = getCredentialAssertion(credential);
|
|
1936
|
-
|
|
1937
|
-
|
|
1734
|
+
assert6(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential");
|
|
1735
|
+
assert6(credential.subject.id.equals(this._signingContext.identityKey));
|
|
1938
1736
|
const space = await this._spaceManager.acceptSpace({
|
|
1939
1737
|
spaceKey: assertion.spaceKey,
|
|
1940
1738
|
genesisFeedKey: assertion.genesisFeedKey
|
|
1941
1739
|
});
|
|
1942
1740
|
await this._signingContext.recordCredential(credential);
|
|
1943
|
-
|
|
1741
|
+
log6("admitted by host", {
|
|
1944
1742
|
guest: this._signingContext.deviceKey,
|
|
1945
1743
|
spaceKey: space.key
|
|
1946
1744
|
}, {
|
|
@@ -1952,7 +1750,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1952
1750
|
complete.wake();
|
|
1953
1751
|
} catch (err) {
|
|
1954
1752
|
if (!observable.cancelled) {
|
|
1955
|
-
|
|
1753
|
+
log6.warn("auth failed", err, {
|
|
1956
1754
|
file: "space-invitations-handler.ts",
|
|
1957
1755
|
line: 344,
|
|
1958
1756
|
scope: this,
|
|
@@ -1970,7 +1768,7 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1970
1768
|
};
|
|
1971
1769
|
scheduleTask2(ctx, async () => {
|
|
1972
1770
|
var _a, _b;
|
|
1973
|
-
|
|
1771
|
+
assert6(invitation.swarmKey);
|
|
1974
1772
|
const topic = invitation.swarmKey;
|
|
1975
1773
|
const swarmConnection = await this._networkManager.joinSwarm({
|
|
1976
1774
|
topic,
|
|
@@ -1989,12 +1787,12 @@ var SpaceInvitationsHandler = class extends AbstractInvitationsHandler {
|
|
|
1989
1787
|
return observable;
|
|
1990
1788
|
}
|
|
1991
1789
|
};
|
|
1992
|
-
var isAuthenticationRequired = (invitation) => invitation.authMethod !== AuthMethod.NONE && invitation.type !==
|
|
1790
|
+
var isAuthenticationRequired = (invitation) => invitation.authMethod !== AuthMethod.NONE && invitation.type !== Invitation3.Type.INTERACTIVE_TESTING && invitation.type !== Invitation3.Type.MULTIUSE_TESTING;
|
|
1993
1791
|
var HostSpaceInvitationExtension = class extends RpcExtension2 {
|
|
1994
1792
|
constructor(_callbacks) {
|
|
1995
1793
|
super({
|
|
1996
1794
|
exposed: {
|
|
1997
|
-
SpaceHostService:
|
|
1795
|
+
SpaceHostService: schema3.getService("dxos.halo.invitations.SpaceHostService")
|
|
1998
1796
|
}
|
|
1999
1797
|
});
|
|
2000
1798
|
this._callbacks = _callbacks;
|
|
@@ -2025,7 +1823,7 @@ var GuestSpaceInvitationExtension = class extends RpcExtension2 {
|
|
|
2025
1823
|
constructor(_callbacks) {
|
|
2026
1824
|
super({
|
|
2027
1825
|
requested: {
|
|
2028
|
-
SpaceHostService:
|
|
1826
|
+
SpaceHostService: schema3.getService("dxos.halo.invitations.SpaceHostService")
|
|
2029
1827
|
}
|
|
2030
1828
|
});
|
|
2031
1829
|
this._callbacks = _callbacks;
|
|
@@ -2039,17 +1837,8 @@ var GuestSpaceInvitationExtension = class extends RpcExtension2 {
|
|
|
2039
1837
|
}
|
|
2040
1838
|
};
|
|
2041
1839
|
|
|
2042
|
-
// packages/sdk/client-services/src/packlets/invitations/space-invitations-proxy.ts
|
|
2043
|
-
var SpaceInvitationsProxy = class extends AbstractInvitationsProxy {
|
|
2044
|
-
getInvitationOptions(context) {
|
|
2045
|
-
return {
|
|
2046
|
-
spaceKey: context
|
|
2047
|
-
};
|
|
2048
|
-
}
|
|
2049
|
-
};
|
|
2050
|
-
|
|
2051
1840
|
// packages/sdk/client-services/src/packlets/invitations/space-invitations-service.ts
|
|
2052
|
-
import
|
|
1841
|
+
import assert7 from "@dxos/node-std/assert";
|
|
2053
1842
|
var SpaceInvitationsServiceImpl = class extends AbstractInvitationsService {
|
|
2054
1843
|
// prettier-ignore
|
|
2055
1844
|
constructor(identityManager, invitationsHandler, _getSpaceManager) {
|
|
@@ -2058,72 +1847,297 @@ var SpaceInvitationsServiceImpl = class extends AbstractInvitationsService {
|
|
|
2058
1847
|
this._getSpaceManager = _getSpaceManager;
|
|
2059
1848
|
}
|
|
2060
1849
|
getContext(invitation) {
|
|
2061
|
-
|
|
1850
|
+
assert7(invitation.spaceKey);
|
|
2062
1851
|
const spaceManager = this._getSpaceManager();
|
|
2063
1852
|
const space = spaceManager.spaces.get(invitation.spaceKey);
|
|
2064
|
-
|
|
1853
|
+
assert7(space);
|
|
2065
1854
|
return space;
|
|
2066
1855
|
}
|
|
2067
1856
|
};
|
|
2068
1857
|
|
|
2069
|
-
// packages/sdk/client-services/src/packlets/
|
|
2070
|
-
import {
|
|
2071
|
-
import {
|
|
2072
|
-
import {
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
1858
|
+
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
1859
|
+
import { InvalidConfigError } from "@dxos/errors";
|
|
1860
|
+
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
1861
|
+
import { createStorage, StorageType } from "@dxos/random-access-storage";
|
|
1862
|
+
var StorageDriver = Runtime.Client.Storage.StorageDriver;
|
|
1863
|
+
var createStorageObjects = (config) => {
|
|
1864
|
+
const { path = "dxos/storage", storageType, keyStorage, persistent = false } = config != null ? config : {};
|
|
1865
|
+
if (persistent && storageType === StorageDriver.RAM) {
|
|
1866
|
+
throw new InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
1867
|
+
}
|
|
1868
|
+
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
1869
|
+
throw new InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
1870
|
+
}
|
|
1871
|
+
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
1872
|
+
throw new InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
1873
|
+
}
|
|
1874
|
+
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
1875
|
+
throw new InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
1876
|
+
}
|
|
1877
|
+
return {
|
|
1878
|
+
storage: createStorage({
|
|
1879
|
+
type: persistent ? toStorageType(storageType) : StorageType.RAM,
|
|
1880
|
+
root: `${path}/`
|
|
1881
|
+
})
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
var toStorageType = (type) => {
|
|
1885
|
+
switch (type) {
|
|
1886
|
+
case void 0:
|
|
1887
|
+
return void 0;
|
|
1888
|
+
case StorageDriver.RAM:
|
|
1889
|
+
return StorageType.RAM;
|
|
1890
|
+
case StorageDriver.CHROME:
|
|
1891
|
+
return StorageType.CHROME;
|
|
1892
|
+
case StorageDriver.FIREFOX:
|
|
1893
|
+
return StorageType.FIREFOX;
|
|
1894
|
+
case StorageDriver.IDB:
|
|
1895
|
+
return StorageType.IDB;
|
|
1896
|
+
case StorageDriver.NODE:
|
|
1897
|
+
return StorageType.NODE;
|
|
1898
|
+
default:
|
|
1899
|
+
throw new Error(`Invalid storage type: ${StorageDriver[type]}`);
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
2097
1902
|
|
|
2098
|
-
// packages/sdk/client-services/src/packlets/
|
|
2099
|
-
import
|
|
2100
|
-
import {
|
|
2101
|
-
import {
|
|
2102
|
-
import {
|
|
2103
|
-
import {
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
this.
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
this.
|
|
2115
|
-
|
|
1903
|
+
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
1904
|
+
import assert8 from "@dxos/node-std/assert";
|
|
1905
|
+
import { Event as Event3 } from "@dxos/async";
|
|
1906
|
+
import { appServiceBundle, shellServiceBundle } from "@dxos/client";
|
|
1907
|
+
import { ShellLayout } from "@dxos/protocols/proto/dxos/iframe";
|
|
1908
|
+
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
1909
|
+
var ShellRuntimeImpl = class {
|
|
1910
|
+
constructor(_port) {
|
|
1911
|
+
this._port = _port;
|
|
1912
|
+
this.layoutUpdate = new Event3();
|
|
1913
|
+
this._layout = ShellLayout.DEFAULT;
|
|
1914
|
+
}
|
|
1915
|
+
get layout() {
|
|
1916
|
+
return this._layout;
|
|
1917
|
+
}
|
|
1918
|
+
get invitationCode() {
|
|
1919
|
+
return this._invitationCode;
|
|
1920
|
+
}
|
|
1921
|
+
get spaceKey() {
|
|
1922
|
+
return this._spaceKey;
|
|
1923
|
+
}
|
|
1924
|
+
setLayout(layout, options = {}) {
|
|
1925
|
+
this._layout = layout;
|
|
1926
|
+
this._invitationCode = options.invitationCode;
|
|
1927
|
+
this._spaceKey = options.spaceKey;
|
|
1928
|
+
this.layoutUpdate.emit({
|
|
1929
|
+
layout,
|
|
1930
|
+
...options
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
async setAppContext(context) {
|
|
1934
|
+
assert8(this._appRpc, "runtime not open");
|
|
1935
|
+
await this._appRpc.rpc.AppService.setContext(context);
|
|
2116
1936
|
}
|
|
2117
1937
|
async open() {
|
|
1938
|
+
this._appRpc = createProtoRpcPeer({
|
|
1939
|
+
requested: appServiceBundle,
|
|
1940
|
+
exposed: shellServiceBundle,
|
|
1941
|
+
handlers: {
|
|
1942
|
+
ShellService: {
|
|
1943
|
+
setLayout: async (request) => {
|
|
1944
|
+
this._layout = request.layout;
|
|
1945
|
+
this._invitationCode = request.invitationCode;
|
|
1946
|
+
this._spaceKey = request.spaceKey;
|
|
1947
|
+
this.layoutUpdate.emit(request);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
},
|
|
1951
|
+
port: this._port
|
|
1952
|
+
});
|
|
1953
|
+
await this._appRpc.open();
|
|
2118
1954
|
}
|
|
2119
1955
|
async close() {
|
|
2120
|
-
|
|
1956
|
+
var _a;
|
|
1957
|
+
await ((_a = this._appRpc) == null ? void 0 : _a.close());
|
|
1958
|
+
this._appRpc = void 0;
|
|
2121
1959
|
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
1960
|
+
};
|
|
1961
|
+
var MemoryShellRuntime = class {
|
|
1962
|
+
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
1963
|
+
this.layoutUpdate = new Event3();
|
|
1964
|
+
this.contextUpdate = new Event3();
|
|
1965
|
+
this._layout = layout != null ? layout : ShellLayout.DEFAULT;
|
|
1966
|
+
this._invitationCode = invitationCode;
|
|
1967
|
+
this._spaceKey = spaceKey;
|
|
1968
|
+
}
|
|
1969
|
+
get layout() {
|
|
1970
|
+
return this._layout;
|
|
1971
|
+
}
|
|
1972
|
+
get invitationCode() {
|
|
1973
|
+
return this._invitationCode;
|
|
1974
|
+
}
|
|
1975
|
+
get spaceKey() {
|
|
1976
|
+
return this._spaceKey;
|
|
1977
|
+
}
|
|
1978
|
+
setLayout(layout, options = {}) {
|
|
1979
|
+
this._layout = layout;
|
|
1980
|
+
this._invitationCode = options.invitationCode;
|
|
1981
|
+
this._spaceKey = options.spaceKey;
|
|
1982
|
+
this.layoutUpdate.emit({
|
|
1983
|
+
layout,
|
|
1984
|
+
...options
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
async setAppContext(context) {
|
|
1988
|
+
this.contextUpdate.emit(context);
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
1993
|
+
import { Trigger as Trigger9 } from "@dxos/async";
|
|
1994
|
+
import { clientServiceBundle as clientServiceBundle3 } from "@dxos/client";
|
|
1995
|
+
import { log as log16, logInfo as logInfo2 } from "@dxos/log";
|
|
1996
|
+
import { MemorySignalManager as MemorySignalManager3, MemorySignalManagerContext as MemorySignalManagerContext3, WebsocketSignalManager as WebsocketSignalManager3 } from "@dxos/messaging";
|
|
1997
|
+
import { createWebRTCTransportFactory as createWebRTCTransportFactory2, NetworkManager as NetworkManager3 } from "@dxos/network-manager";
|
|
1998
|
+
import { createProtoRpcPeer as createProtoRpcPeer4 } from "@dxos/rpc";
|
|
1999
|
+
import { getAsyncValue } from "@dxos/util";
|
|
2000
|
+
|
|
2001
|
+
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
2002
|
+
import assert12 from "@dxos/node-std/assert";
|
|
2003
|
+
import { Event as Event6 } from "@dxos/async";
|
|
2004
|
+
import { clientServiceBundle as clientServiceBundle2, createDefaultModelFactory } from "@dxos/client";
|
|
2005
|
+
import { raise as raise2 } from "@dxos/debug";
|
|
2006
|
+
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
2007
|
+
import { log as log14 } from "@dxos/log";
|
|
2008
|
+
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
2009
|
+
|
|
2010
|
+
// packages/sdk/client-services/src/packlets/deprecated/tracing.ts
|
|
2011
|
+
var TracingServiceImpl = class {
|
|
2012
|
+
constructor(_config) {
|
|
2013
|
+
this._config = _config;
|
|
2014
|
+
}
|
|
2015
|
+
async setTracingOptions() {
|
|
2016
|
+
throw new Error("Tracing not available.");
|
|
2017
|
+
}
|
|
2018
|
+
subscribeToRpcTrace() {
|
|
2019
|
+
throw new Error("Tracing not available.");
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
2024
|
+
import { EventSubscriptions as EventSubscriptions2 } from "@dxos/async";
|
|
2025
|
+
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
2026
|
+
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
2027
|
+
var DevicesServiceImpl = class {
|
|
2028
|
+
constructor(_identityManager) {
|
|
2029
|
+
this._identityManager = _identityManager;
|
|
2030
|
+
}
|
|
2031
|
+
updateDevice(request) {
|
|
2032
|
+
throw new Error("Method not implemented.");
|
|
2033
|
+
}
|
|
2034
|
+
queryDevices() {
|
|
2035
|
+
return new Stream8(({ next }) => {
|
|
2036
|
+
const update = () => {
|
|
2037
|
+
var _a;
|
|
2038
|
+
const deviceKeys = (_a = this._identityManager.identity) == null ? void 0 : _a.authorizedDeviceKeys;
|
|
2039
|
+
if (!deviceKeys) {
|
|
2040
|
+
next({
|
|
2041
|
+
devices: []
|
|
2042
|
+
});
|
|
2043
|
+
} else {
|
|
2044
|
+
next({
|
|
2045
|
+
devices: Array.from(deviceKeys.values()).map((key) => {
|
|
2046
|
+
var _a2;
|
|
2047
|
+
return {
|
|
2048
|
+
deviceKey: key,
|
|
2049
|
+
kind: ((_a2 = this._identityManager.identity) == null ? void 0 : _a2.deviceKey.equals(key)) ? DeviceKind.CURRENT : DeviceKind.TRUSTED
|
|
2050
|
+
};
|
|
2051
|
+
})
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
};
|
|
2055
|
+
const subscriptions = new EventSubscriptions2();
|
|
2056
|
+
subscriptions.add(this._identityManager.stateUpdate.on(() => {
|
|
2057
|
+
update();
|
|
2058
|
+
if (this._identityManager.identity) {
|
|
2059
|
+
subscriptions.add(this._identityManager.identity.stateUpdate.on(() => {
|
|
2060
|
+
update();
|
|
2061
|
+
}));
|
|
2062
|
+
}
|
|
2063
|
+
}));
|
|
2064
|
+
update();
|
|
2065
|
+
return () => subscriptions.clear();
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
2071
|
+
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
2072
|
+
var NetworkServiceImpl = class {
|
|
2073
|
+
constructor(networkManager) {
|
|
2074
|
+
this.networkManager = networkManager;
|
|
2075
|
+
}
|
|
2076
|
+
subscribeToNetworkStatus() {
|
|
2077
|
+
return new Stream9(({ next }) => {
|
|
2078
|
+
const unsubscribe = this.networkManager.connectionStateChanged.on((state) => next({
|
|
2079
|
+
state
|
|
2080
|
+
}));
|
|
2081
|
+
next({
|
|
2082
|
+
state: this.networkManager.connectionState
|
|
2083
|
+
});
|
|
2084
|
+
return unsubscribe;
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
async setNetworkOptions(request) {
|
|
2088
|
+
await this.networkManager.setConnectionState(request.state);
|
|
2089
|
+
}
|
|
2090
|
+
};
|
|
2091
|
+
|
|
2092
|
+
// packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts
|
|
2093
|
+
import assert10 from "@dxos/node-std/assert";
|
|
2094
|
+
import { Event as Event5, synchronized, trackLeaks as trackLeaks2 } from "@dxos/async";
|
|
2095
|
+
import { Context as Context7 } from "@dxos/context";
|
|
2096
|
+
import { getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
|
|
2097
|
+
import { spaceGenesis, SnapshotManager } from "@dxos/echo-pipeline";
|
|
2098
|
+
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
2099
|
+
import { log as log8 } from "@dxos/log";
|
|
2100
|
+
import { Presence } from "@dxos/teleport-extension-presence";
|
|
2101
|
+
import { ComplexMap as ComplexMap3, deferFunction as deferFunction2 } from "@dxos/util";
|
|
2102
|
+
|
|
2103
|
+
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
2104
|
+
import { trackLeaks } from "@dxos/async";
|
|
2105
|
+
import { Context as Context6 } from "@dxos/context";
|
|
2106
|
+
import { timed } from "@dxos/debug";
|
|
2107
|
+
import { DataPipelineControllerImpl, createMappedFeedWriter } from "@dxos/echo-pipeline";
|
|
2108
|
+
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
2109
|
+
import { AdmittedFeed as AdmittedFeed3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
2110
|
+
import { ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
2111
|
+
|
|
2112
|
+
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2113
|
+
import assert9 from "@dxos/node-std/assert";
|
|
2114
|
+
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, TimeoutError, Trigger as Trigger4 } from "@dxos/async";
|
|
2115
|
+
import { Context as Context5 } from "@dxos/context";
|
|
2116
|
+
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
2117
|
+
import { log as log7 } from "@dxos/log";
|
|
2118
|
+
import { schema as schema4 } from "@dxos/protocols";
|
|
2119
|
+
import { RpcExtension as RpcExtension3 } from "@dxos/teleport";
|
|
2120
|
+
import { ComplexMap as ComplexMap2, ComplexSet, entry } from "@dxos/util";
|
|
2121
|
+
var RETRY_TIMEOUT = 1e3;
|
|
2122
|
+
var NOTARIZE_TIMEOUT = 1e4;
|
|
2123
|
+
var NotarizationPlugin = class {
|
|
2124
|
+
constructor() {
|
|
2125
|
+
this._ctx = new Context5();
|
|
2126
|
+
this._extensionOpened = new Event4();
|
|
2127
|
+
this._extensions = /* @__PURE__ */ new Set();
|
|
2128
|
+
this._processedCredentials = new ComplexSet(PublicKey5.hash);
|
|
2129
|
+
this._processCredentialsTriggers = new ComplexMap2(PublicKey5.hash);
|
|
2130
|
+
}
|
|
2131
|
+
async open() {
|
|
2132
|
+
}
|
|
2133
|
+
async close() {
|
|
2134
|
+
await this._ctx.dispose();
|
|
2135
|
+
}
|
|
2136
|
+
/**
|
|
2137
|
+
* Request credentials to be notarized.
|
|
2138
|
+
*/
|
|
2139
|
+
async notarize(credentials) {
|
|
2140
|
+
log7("notarize", {
|
|
2127
2141
|
credentials
|
|
2128
2142
|
}, {
|
|
2129
2143
|
file: "notarization-plugin.ts",
|
|
@@ -2131,11 +2145,11 @@ var NotarizationPlugin = class {
|
|
|
2131
2145
|
scope: this,
|
|
2132
2146
|
callSite: (f, a) => f(...a)
|
|
2133
2147
|
});
|
|
2134
|
-
|
|
2148
|
+
assert9(credentials.every((credential) => credential.id), "Credentials must have an id");
|
|
2135
2149
|
const errors = new Trigger4();
|
|
2136
2150
|
const ctx = this._ctx.derive({
|
|
2137
2151
|
onError: (err) => {
|
|
2138
|
-
|
|
2152
|
+
log7.warn("Notarization error", {
|
|
2139
2153
|
err
|
|
2140
2154
|
}, {
|
|
2141
2155
|
file: "notarization-plugin.ts",
|
|
@@ -2148,7 +2162,7 @@ var NotarizationPlugin = class {
|
|
|
2148
2162
|
}
|
|
2149
2163
|
});
|
|
2150
2164
|
scheduleTask3(ctx, () => {
|
|
2151
|
-
|
|
2165
|
+
log7.warn("Notarization timeout", {}, {
|
|
2152
2166
|
file: "notarization-plugin.ts",
|
|
2153
2167
|
line: 61,
|
|
2154
2168
|
scope: this,
|
|
@@ -2162,7 +2176,7 @@ var NotarizationPlugin = class {
|
|
|
2162
2176
|
const notarizeTask = new DeferredTask(ctx, async () => {
|
|
2163
2177
|
try {
|
|
2164
2178
|
if (this._extensions.size === 0) {
|
|
2165
|
-
|
|
2179
|
+
log7.warn("No peers to notarize with", {}, {
|
|
2166
2180
|
file: "notarization-plugin.ts",
|
|
2167
2181
|
line: 76,
|
|
2168
2182
|
scope: this,
|
|
@@ -2174,7 +2188,7 @@ var NotarizationPlugin = class {
|
|
|
2174
2188
|
...this._extensions
|
|
2175
2189
|
].find((peer2) => !peersTried.has(peer2));
|
|
2176
2190
|
if (!peer) {
|
|
2177
|
-
|
|
2191
|
+
log7.warn("Exhausted all peers to notarize with", {
|
|
2178
2192
|
retryIn: RETRY_TIMEOUT
|
|
2179
2193
|
}, {
|
|
2180
2194
|
file: "notarization-plugin.ts",
|
|
@@ -2187,7 +2201,7 @@ var NotarizationPlugin = class {
|
|
|
2187
2201
|
return;
|
|
2188
2202
|
}
|
|
2189
2203
|
peersTried.add(peer);
|
|
2190
|
-
|
|
2204
|
+
log7("try notarizing", {
|
|
2191
2205
|
peer: peer.localPeerId,
|
|
2192
2206
|
credentialId: credentials.map((credential) => credential.id)
|
|
2193
2207
|
}, {
|
|
@@ -2199,14 +2213,14 @@ var NotarizationPlugin = class {
|
|
|
2199
2213
|
await peer.rpc.NotarizationService.notarize({
|
|
2200
2214
|
credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
|
|
2201
2215
|
});
|
|
2202
|
-
|
|
2216
|
+
log7("success", {}, {
|
|
2203
2217
|
file: "notarization-plugin.ts",
|
|
2204
2218
|
line: 94,
|
|
2205
2219
|
scope: this,
|
|
2206
2220
|
callSite: (f, a) => f(...a)
|
|
2207
2221
|
});
|
|
2208
2222
|
} catch (err) {
|
|
2209
|
-
|
|
2223
|
+
log7.warn("error notarizing (recoverable)", err, {
|
|
2210
2224
|
file: "notarization-plugin.ts",
|
|
2211
2225
|
line: 96,
|
|
2212
2226
|
scope: this,
|
|
@@ -2222,7 +2236,7 @@ var NotarizationPlugin = class {
|
|
|
2222
2236
|
allNotarized,
|
|
2223
2237
|
errors.wait()
|
|
2224
2238
|
]);
|
|
2225
|
-
|
|
2239
|
+
log7("done", {}, {
|
|
2226
2240
|
file: "notarization-plugin.ts",
|
|
2227
2241
|
line: 107,
|
|
2228
2242
|
scope: this,
|
|
@@ -2245,7 +2259,7 @@ var NotarizationPlugin = class {
|
|
|
2245
2259
|
this._processCredentialsTriggers.delete(credential.id);
|
|
2246
2260
|
}
|
|
2247
2261
|
setWriter(writer) {
|
|
2248
|
-
|
|
2262
|
+
assert9(!this._writer, "Writer already set.");
|
|
2249
2263
|
this._writer = writer;
|
|
2250
2264
|
}
|
|
2251
2265
|
async _waitUntilProcessed(id) {
|
|
@@ -2263,7 +2277,7 @@ var NotarizationPlugin = class {
|
|
|
2263
2277
|
throw new Error("Writer not set");
|
|
2264
2278
|
}
|
|
2265
2279
|
for (const credential of (_a = request.credentials) != null ? _a : []) {
|
|
2266
|
-
|
|
2280
|
+
assert9(credential.id, "Credential must have an id");
|
|
2267
2281
|
if (this._processedCredentials.has(credential.id)) {
|
|
2268
2282
|
continue;
|
|
2269
2283
|
}
|
|
@@ -2273,7 +2287,7 @@ var NotarizationPlugin = class {
|
|
|
2273
2287
|
createExtension() {
|
|
2274
2288
|
const extension = new NotarizationTeleportExtension({
|
|
2275
2289
|
onOpen: async () => {
|
|
2276
|
-
|
|
2290
|
+
log7("extension opened", {
|
|
2277
2291
|
peer: extension.localPeerId
|
|
2278
2292
|
}, {
|
|
2279
2293
|
file: "notarization-plugin.ts",
|
|
@@ -2285,7 +2299,7 @@ var NotarizationPlugin = class {
|
|
|
2285
2299
|
this._extensionOpened.emit();
|
|
2286
2300
|
},
|
|
2287
2301
|
onClose: async () => {
|
|
2288
|
-
|
|
2302
|
+
log7("extension closed", {
|
|
2289
2303
|
peer: extension.localPeerId
|
|
2290
2304
|
}, {
|
|
2291
2305
|
file: "notarization-plugin.ts",
|
|
@@ -2304,10 +2318,10 @@ var NotarizationTeleportExtension = class extends RpcExtension3 {
|
|
|
2304
2318
|
constructor(_params) {
|
|
2305
2319
|
super({
|
|
2306
2320
|
requested: {
|
|
2307
|
-
NotarizationService:
|
|
2321
|
+
NotarizationService: schema4.getService("dxos.mesh.teleport.notarization.NotarizationService")
|
|
2308
2322
|
},
|
|
2309
2323
|
exposed: {
|
|
2310
|
-
NotarizationService:
|
|
2324
|
+
NotarizationService: schema4.getService("dxos.mesh.teleport.notarization.NotarizationService")
|
|
2311
2325
|
}
|
|
2312
2326
|
});
|
|
2313
2327
|
this._params = _params;
|
|
@@ -2486,7 +2500,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2486
2500
|
this._feedStore = _feedStore;
|
|
2487
2501
|
this._snapshotStore = _snapshotStore;
|
|
2488
2502
|
this._ctx = new Context7();
|
|
2489
|
-
this.updated = new
|
|
2503
|
+
this.updated = new Event5();
|
|
2490
2504
|
this._spaces = new ComplexMap3(PublicKey7.hash);
|
|
2491
2505
|
}
|
|
2492
2506
|
// TODO(burdon): Remove.
|
|
@@ -2495,7 +2509,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2495
2509
|
}
|
|
2496
2510
|
async open() {
|
|
2497
2511
|
await this._metadataStore.load();
|
|
2498
|
-
|
|
2512
|
+
log8("metadata loaded", {
|
|
2499
2513
|
spaces: this._metadataStore.spaces.length
|
|
2500
2514
|
}, {
|
|
2501
2515
|
file: "data-space-manager.ts",
|
|
@@ -2504,7 +2518,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2504
2518
|
callSite: (f, a) => f(...a)
|
|
2505
2519
|
});
|
|
2506
2520
|
for (const spaceMetadata of this._metadataStore.spaces) {
|
|
2507
|
-
|
|
2521
|
+
log8("load space", {
|
|
2508
2522
|
spaceMetadata
|
|
2509
2523
|
}, {
|
|
2510
2524
|
file: "data-space-manager.ts",
|
|
@@ -2515,7 +2529,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2515
2529
|
const space = await this._constructSpace(spaceMetadata);
|
|
2516
2530
|
await space.initializeDataPipeline();
|
|
2517
2531
|
if (spaceMetadata.dataTimeframe) {
|
|
2518
|
-
|
|
2532
|
+
log8("waiting for latest timeframe", {
|
|
2519
2533
|
spaceMetadata
|
|
2520
2534
|
}, {
|
|
2521
2535
|
file: "data-space-manager.ts",
|
|
@@ -2550,7 +2564,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2550
2564
|
controlFeedKey,
|
|
2551
2565
|
dataFeedKey
|
|
2552
2566
|
};
|
|
2553
|
-
|
|
2567
|
+
log8("creating space...", {
|
|
2554
2568
|
spaceKey
|
|
2555
2569
|
}, {
|
|
2556
2570
|
file: "data-space-manager.ts",
|
|
@@ -2562,7 +2576,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2562
2576
|
const credentials = await spaceGenesis(this._keyring, this._signingContext, space.inner);
|
|
2563
2577
|
await this._metadataStore.addSpace(metadata);
|
|
2564
2578
|
const memberCredential = credentials[1];
|
|
2565
|
-
|
|
2579
|
+
assert10(getCredentialAssertion2(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember");
|
|
2566
2580
|
await this._signingContext.recordCredential(memberCredential);
|
|
2567
2581
|
await space.initializeDataPipeline();
|
|
2568
2582
|
this._dataServiceSubscriptions.registerSpace(space.key, space.dataPipelineController.databaseBackend.createDataServiceHost());
|
|
@@ -2571,7 +2585,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2571
2585
|
}
|
|
2572
2586
|
// TODO(burdon): Rename join space.
|
|
2573
2587
|
async acceptSpace(opts) {
|
|
2574
|
-
|
|
2588
|
+
assert10(!this._spaces.has(opts.spaceKey), "Space already exists.");
|
|
2575
2589
|
const metadata = {
|
|
2576
2590
|
key: opts.spaceKey,
|
|
2577
2591
|
genesisFeedKey: opts.genesisFeedKey
|
|
@@ -2587,7 +2601,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
2587
2601
|
const presence = new Presence({
|
|
2588
2602
|
localPeerId: this._signingContext.deviceKey,
|
|
2589
2603
|
announceInterval: 1e3,
|
|
2590
|
-
offlineTimeout:
|
|
2604
|
+
offlineTimeout: 1e4,
|
|
2591
2605
|
identityKey: this._signingContext.identityKey
|
|
2592
2606
|
});
|
|
2593
2607
|
const snapshotManager = new SnapshotManager(this._snapshotStore);
|
|
@@ -2639,476 +2653,20 @@ __decorate2([
|
|
|
2639
2653
|
], DataSpaceManager.prototype, "close", null);
|
|
2640
2654
|
__decorate2([
|
|
2641
2655
|
synchronized
|
|
2642
|
-
], DataSpaceManager.prototype, "createSpace", null);
|
|
2643
|
-
__decorate2([
|
|
2644
|
-
synchronized
|
|
2645
|
-
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
2646
|
-
DataSpaceManager = __decorate2([
|
|
2647
|
-
trackLeaks2("open", "close")
|
|
2648
|
-
], DataSpaceManager);
|
|
2649
|
-
|
|
2650
|
-
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
2651
|
-
var ServiceContext = class {
|
|
2652
|
-
// prettier-ignore
|
|
2653
|
-
constructor(storage, networkManager, modelFactory) {
|
|
2654
|
-
this.storage = storage;
|
|
2655
|
-
this.networkManager = networkManager;
|
|
2656
|
-
this.modelFactory = modelFactory;
|
|
2657
|
-
this.initialized = new Trigger5();
|
|
2658
|
-
this.dataServiceSubscriptions = new DataServiceSubscriptions();
|
|
2659
|
-
this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
|
|
2660
|
-
this.snapshotStore = new SnapshotStore(storage.createDirectory("snapshots"));
|
|
2661
|
-
this.keyring = new Keyring(storage.createDirectory("keyring"));
|
|
2662
|
-
this.feedStore = new FeedStore({
|
|
2663
|
-
factory: new FeedFactory({
|
|
2664
|
-
root: storage.createDirectory("feeds"),
|
|
2665
|
-
signer: this.keyring,
|
|
2666
|
-
hypercore: {
|
|
2667
|
-
valueEncoding
|
|
2668
|
-
}
|
|
2669
|
-
})
|
|
2670
|
-
});
|
|
2671
|
-
this.spaceManager = new SpaceManager({
|
|
2672
|
-
feedStore: this.feedStore,
|
|
2673
|
-
networkManager: this.networkManager
|
|
2674
|
-
});
|
|
2675
|
-
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
|
|
2676
|
-
this.deviceInvitations = new DeviceInvitationsHandler({
|
|
2677
|
-
networkManager: this.networkManager,
|
|
2678
|
-
getIdentity: () => {
|
|
2679
|
-
var _a;
|
|
2680
|
-
return (_a = this.identityManager.identity) != null ? _a : failUndefined2();
|
|
2681
|
-
},
|
|
2682
|
-
acceptIdentity: this._acceptIdentity.bind(this),
|
|
2683
|
-
keyring: this.keyring
|
|
2684
|
-
});
|
|
2685
|
-
}
|
|
2686
|
-
async open() {
|
|
2687
|
-
log10("opening...", {}, {
|
|
2688
|
-
file: "service-context.ts",
|
|
2689
|
-
line: 94,
|
|
2690
|
-
scope: this,
|
|
2691
|
-
callSite: (f, a) => f(...a)
|
|
2692
|
-
});
|
|
2693
|
-
await this.networkManager.open();
|
|
2694
|
-
await this.spaceManager.open();
|
|
2695
|
-
await this.identityManager.open();
|
|
2696
|
-
if (this.identityManager.identity) {
|
|
2697
|
-
await this._initialize();
|
|
2698
|
-
}
|
|
2699
|
-
log10("opened", {}, {
|
|
2700
|
-
file: "service-context.ts",
|
|
2701
|
-
line: 101,
|
|
2702
|
-
scope: this,
|
|
2703
|
-
callSite: (f, a) => f(...a)
|
|
2704
|
-
});
|
|
2705
|
-
}
|
|
2706
|
-
async close() {
|
|
2707
|
-
var _a, _b;
|
|
2708
|
-
log10("closing...", {}, {
|
|
2709
|
-
file: "service-context.ts",
|
|
2710
|
-
line: 105,
|
|
2711
|
-
scope: this,
|
|
2712
|
-
callSite: (f, a) => f(...a)
|
|
2713
|
-
});
|
|
2714
|
-
await ((_a = this._deviceSpaceSync) == null ? void 0 : _a.close());
|
|
2715
|
-
await ((_b = this.dataSpaceManager) == null ? void 0 : _b.close());
|
|
2716
|
-
await this.identityManager.close();
|
|
2717
|
-
await this.spaceManager.close();
|
|
2718
|
-
await this.feedStore.close();
|
|
2719
|
-
await this.networkManager.close();
|
|
2720
|
-
this.dataServiceSubscriptions.clear();
|
|
2721
|
-
log10("closed", {}, {
|
|
2722
|
-
file: "service-context.ts",
|
|
2723
|
-
line: 113,
|
|
2724
|
-
scope: this,
|
|
2725
|
-
callSite: (f, a) => f(...a)
|
|
2726
|
-
});
|
|
2727
|
-
}
|
|
2728
|
-
async reset() {
|
|
2729
|
-
log10("resetting...", {}, {
|
|
2730
|
-
file: "service-context.ts",
|
|
2731
|
-
line: 117,
|
|
2732
|
-
scope: this,
|
|
2733
|
-
callSite: (f, a) => f(...a)
|
|
2734
|
-
});
|
|
2735
|
-
await this.close();
|
|
2736
|
-
await this.storage.reset();
|
|
2737
|
-
log10("reset", {}, {
|
|
2738
|
-
file: "service-context.ts",
|
|
2739
|
-
line: 120,
|
|
2740
|
-
scope: this,
|
|
2741
|
-
callSite: (f, a) => f(...a)
|
|
2742
|
-
});
|
|
2743
|
-
}
|
|
2744
|
-
async createIdentity(params = {}) {
|
|
2745
|
-
const identity = await this.identityManager.createIdentity(params);
|
|
2746
|
-
await this._initialize();
|
|
2747
|
-
return identity;
|
|
2748
|
-
}
|
|
2749
|
-
async _acceptIdentity(params) {
|
|
2750
|
-
const identity = await this.identityManager.acceptIdentity(params);
|
|
2751
|
-
await this._initialize();
|
|
2752
|
-
return identity;
|
|
2753
|
-
}
|
|
2754
|
-
// Called when identity is created.
|
|
2755
|
-
async _initialize() {
|
|
2756
|
-
var _a;
|
|
2757
|
-
log10("initializing spaces...", {}, {
|
|
2758
|
-
file: "service-context.ts",
|
|
2759
|
-
line: 139,
|
|
2760
|
-
scope: this,
|
|
2761
|
-
callSite: (f, a) => f(...a)
|
|
2762
|
-
});
|
|
2763
|
-
const identity = (_a = this.identityManager.identity) != null ? _a : failUndefined2();
|
|
2764
|
-
const signingContext = {
|
|
2765
|
-
credentialSigner: identity.getIdentityCredentialSigner(),
|
|
2766
|
-
identityKey: identity.identityKey,
|
|
2767
|
-
deviceKey: identity.deviceKey,
|
|
2768
|
-
profile: identity.profileDocument,
|
|
2769
|
-
recordCredential: async (credential) => {
|
|
2770
|
-
await identity.controlPipeline.writer.write({
|
|
2771
|
-
credential: {
|
|
2772
|
-
credential
|
|
2773
|
-
}
|
|
2774
|
-
});
|
|
2775
|
-
}
|
|
2776
|
-
};
|
|
2777
|
-
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.modelFactory, this.feedStore, this.snapshotStore);
|
|
2778
|
-
await this.dataSpaceManager.open();
|
|
2779
|
-
this.spaceInvitations = new SpaceInvitationsHandler(this.networkManager, this.dataSpaceManager, signingContext, this.keyring);
|
|
2780
|
-
this.initialized.wake();
|
|
2781
|
-
this._deviceSpaceSync = identity.space.spaceState.registerProcessor({
|
|
2782
|
-
process: async (credential) => {
|
|
2783
|
-
const assertion = getCredentialAssertion3(credential);
|
|
2784
|
-
if (assertion["@type"] !== "dxos.halo.credentials.SpaceMember") {
|
|
2785
|
-
return;
|
|
2786
|
-
}
|
|
2787
|
-
if (assertion.spaceKey.equals(identity.space.key)) {
|
|
2788
|
-
return;
|
|
2789
|
-
}
|
|
2790
|
-
if (!this.dataSpaceManager) {
|
|
2791
|
-
log10("dataSpaceManager not initialized yet, ignoring space admission", {
|
|
2792
|
-
details: assertion
|
|
2793
|
-
}, {
|
|
2794
|
-
file: "service-context.ts",
|
|
2795
|
-
line: 182,
|
|
2796
|
-
scope: this,
|
|
2797
|
-
callSite: (f, a) => f(...a)
|
|
2798
|
-
});
|
|
2799
|
-
return;
|
|
2800
|
-
}
|
|
2801
|
-
if (this.dataSpaceManager.spaces.has(assertion.spaceKey)) {
|
|
2802
|
-
log10("space already exists, ignoring space admission", {
|
|
2803
|
-
details: assertion
|
|
2804
|
-
}, {
|
|
2805
|
-
file: "service-context.ts",
|
|
2806
|
-
line: 186,
|
|
2807
|
-
scope: this,
|
|
2808
|
-
callSite: (f, a) => f(...a)
|
|
2809
|
-
});
|
|
2810
|
-
return;
|
|
2811
|
-
}
|
|
2812
|
-
try {
|
|
2813
|
-
log10("accepting space recorded in halo", {
|
|
2814
|
-
details: assertion
|
|
2815
|
-
}, {
|
|
2816
|
-
file: "service-context.ts",
|
|
2817
|
-
line: 191,
|
|
2818
|
-
scope: this,
|
|
2819
|
-
callSite: (f, a) => f(...a)
|
|
2820
|
-
});
|
|
2821
|
-
await this.dataSpaceManager.acceptSpace({
|
|
2822
|
-
spaceKey: assertion.spaceKey,
|
|
2823
|
-
genesisFeedKey: assertion.genesisFeedKey
|
|
2824
|
-
});
|
|
2825
|
-
} catch (err) {
|
|
2826
|
-
log10.catch(err, {}, {
|
|
2827
|
-
file: "service-context.ts",
|
|
2828
|
-
line: 197,
|
|
2829
|
-
scope: this,
|
|
2830
|
-
callSite: (f, a) => f(...a)
|
|
2831
|
-
});
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
});
|
|
2835
|
-
await this._deviceSpaceSync.open();
|
|
2836
|
-
}
|
|
2837
|
-
};
|
|
2838
|
-
|
|
2839
|
-
// packages/sdk/client-services/src/packlets/services/service-definitions.ts
|
|
2840
|
-
import { schema as schema6 } from "@dxos/protocols";
|
|
2841
|
-
import { createServiceBundle } from "@dxos/rpc";
|
|
2842
|
-
var clientServiceBundle = createServiceBundle({
|
|
2843
|
-
SystemService: schema6.getService("dxos.client.services.SystemService"),
|
|
2844
|
-
IdentityService: schema6.getService("dxos.client.services.IdentityService"),
|
|
2845
|
-
DeviceInvitationsService: schema6.getService("dxos.client.services.DeviceInvitationsService"),
|
|
2846
|
-
DevicesService: schema6.getService("dxos.client.services.DevicesService"),
|
|
2847
|
-
SpaceInvitationsService: schema6.getService("dxos.client.services.SpaceInvitationsService"),
|
|
2848
|
-
SpacesService: schema6.getService("dxos.client.services.SpacesService"),
|
|
2849
|
-
DataService: schema6.getService("dxos.echo.service.DataService"),
|
|
2850
|
-
NetworkService: schema6.getService("dxos.client.services.NetworkService"),
|
|
2851
|
-
// TODO(burdon): Deprecated.
|
|
2852
|
-
DevtoolsHost: schema6.getService("dxos.devtools.host.DevtoolsHost"),
|
|
2853
|
-
TracingService: schema6.getService("dxos.devtools.host.TracingService")
|
|
2854
|
-
});
|
|
2855
|
-
|
|
2856
|
-
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
2857
|
-
import { InvalidConfigError } from "@dxos/errors";
|
|
2858
|
-
import { Runtime } from "@dxos/protocols/proto/dxos/config";
|
|
2859
|
-
import { createStorage, StorageType } from "@dxos/random-access-storage";
|
|
2860
|
-
var StorageDriver = Runtime.Client.Storage.StorageDriver;
|
|
2861
|
-
var createStorageObjects = (config) => {
|
|
2862
|
-
const { path = "dxos/storage", storageType, keyStorage, persistent = false } = config != null ? config : {};
|
|
2863
|
-
if (persistent && storageType === StorageDriver.RAM) {
|
|
2864
|
-
throw new InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
2865
|
-
}
|
|
2866
|
-
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
2867
|
-
throw new InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
2868
|
-
}
|
|
2869
|
-
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
2870
|
-
throw new InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
2871
|
-
}
|
|
2872
|
-
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
2873
|
-
throw new InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
2874
|
-
}
|
|
2875
|
-
return {
|
|
2876
|
-
storage: createStorage({
|
|
2877
|
-
type: persistent ? toStorageType(storageType) : StorageType.RAM,
|
|
2878
|
-
root: `${path}/`
|
|
2879
|
-
})
|
|
2880
|
-
};
|
|
2881
|
-
};
|
|
2882
|
-
var toStorageType = (type) => {
|
|
2883
|
-
switch (type) {
|
|
2884
|
-
case void 0:
|
|
2885
|
-
return void 0;
|
|
2886
|
-
case StorageDriver.RAM:
|
|
2887
|
-
return StorageType.RAM;
|
|
2888
|
-
case StorageDriver.CHROME:
|
|
2889
|
-
return StorageType.CHROME;
|
|
2890
|
-
case StorageDriver.FIREFOX:
|
|
2891
|
-
return StorageType.FIREFOX;
|
|
2892
|
-
case StorageDriver.IDB:
|
|
2893
|
-
return StorageType.IDB;
|
|
2894
|
-
case StorageDriver.NODE:
|
|
2895
|
-
return StorageType.NODE;
|
|
2896
|
-
default:
|
|
2897
|
-
throw new Error(`Invalid storage type: ${StorageDriver[type]}`);
|
|
2898
|
-
}
|
|
2899
|
-
};
|
|
2900
|
-
|
|
2901
|
-
// packages/sdk/client-services/src/packlets/vault/services.ts
|
|
2902
|
-
import { schema as schema7 } from "@dxos/protocols";
|
|
2903
|
-
var iframeServiceBundle = {
|
|
2904
|
-
IframeService: schema7.getService("dxos.iframe.IframeService"),
|
|
2905
|
-
BridgeService: schema7.getService("dxos.mesh.bridge.BridgeService")
|
|
2906
|
-
};
|
|
2907
|
-
var workerServiceBundle = {
|
|
2908
|
-
WorkerService: schema7.getService("dxos.iframe.WorkerService")
|
|
2909
|
-
};
|
|
2910
|
-
var appServiceBundle = {
|
|
2911
|
-
AppService: schema7.getService("dxos.iframe.AppService")
|
|
2912
|
-
};
|
|
2913
|
-
var shellServiceBundle = {
|
|
2914
|
-
ShellService: schema7.getService("dxos.iframe.ShellService")
|
|
2915
|
-
};
|
|
2916
|
-
|
|
2917
|
-
// packages/sdk/client-services/src/packlets/vault/shell-runtime.ts
|
|
2918
|
-
import assert12 from "@dxos/node-std/assert";
|
|
2919
|
-
import { Event as Event5 } from "@dxos/async";
|
|
2920
|
-
import { ShellLayout } from "@dxos/protocols/proto/dxos/iframe";
|
|
2921
|
-
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
2922
|
-
var ShellRuntimeImpl = class {
|
|
2923
|
-
constructor(_port) {
|
|
2924
|
-
this._port = _port;
|
|
2925
|
-
this.layoutUpdate = new Event5();
|
|
2926
|
-
this._layout = ShellLayout.DEFAULT;
|
|
2927
|
-
}
|
|
2928
|
-
get layout() {
|
|
2929
|
-
return this._layout;
|
|
2930
|
-
}
|
|
2931
|
-
get invitationCode() {
|
|
2932
|
-
return this._invitationCode;
|
|
2933
|
-
}
|
|
2934
|
-
get spaceKey() {
|
|
2935
|
-
return this._spaceKey;
|
|
2936
|
-
}
|
|
2937
|
-
setLayout(layout, options = {}) {
|
|
2938
|
-
this._layout = layout;
|
|
2939
|
-
this._invitationCode = options.invitationCode;
|
|
2940
|
-
this._spaceKey = options.spaceKey;
|
|
2941
|
-
this.layoutUpdate.emit({
|
|
2942
|
-
layout,
|
|
2943
|
-
...options
|
|
2944
|
-
});
|
|
2945
|
-
}
|
|
2946
|
-
async setAppContext(context) {
|
|
2947
|
-
assert12(this._appRpc, "runtime not open");
|
|
2948
|
-
await this._appRpc.rpc.AppService.setContext(context);
|
|
2949
|
-
}
|
|
2950
|
-
async open() {
|
|
2951
|
-
this._appRpc = createProtoRpcPeer({
|
|
2952
|
-
requested: appServiceBundle,
|
|
2953
|
-
exposed: shellServiceBundle,
|
|
2954
|
-
handlers: {
|
|
2955
|
-
ShellService: {
|
|
2956
|
-
setLayout: async (request) => {
|
|
2957
|
-
this._layout = request.layout;
|
|
2958
|
-
this._invitationCode = request.invitationCode;
|
|
2959
|
-
this._spaceKey = request.spaceKey;
|
|
2960
|
-
this.layoutUpdate.emit(request);
|
|
2961
|
-
}
|
|
2962
|
-
}
|
|
2963
|
-
},
|
|
2964
|
-
port: this._port
|
|
2965
|
-
});
|
|
2966
|
-
await this._appRpc.open();
|
|
2967
|
-
}
|
|
2968
|
-
async close() {
|
|
2969
|
-
var _a;
|
|
2970
|
-
await ((_a = this._appRpc) == null ? void 0 : _a.close());
|
|
2971
|
-
this._appRpc = void 0;
|
|
2972
|
-
}
|
|
2973
|
-
};
|
|
2974
|
-
var MemoryShellRuntime = class {
|
|
2975
|
-
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
2976
|
-
this.layoutUpdate = new Event5();
|
|
2977
|
-
this.contextUpdate = new Event5();
|
|
2978
|
-
this._layout = layout != null ? layout : ShellLayout.DEFAULT;
|
|
2979
|
-
this._invitationCode = invitationCode;
|
|
2980
|
-
this._spaceKey = spaceKey;
|
|
2981
|
-
}
|
|
2982
|
-
get layout() {
|
|
2983
|
-
return this._layout;
|
|
2984
|
-
}
|
|
2985
|
-
get invitationCode() {
|
|
2986
|
-
return this._invitationCode;
|
|
2987
|
-
}
|
|
2988
|
-
get spaceKey() {
|
|
2989
|
-
return this._spaceKey;
|
|
2990
|
-
}
|
|
2991
|
-
setLayout(layout, options = {}) {
|
|
2992
|
-
this._layout = layout;
|
|
2993
|
-
this._invitationCode = options.invitationCode;
|
|
2994
|
-
this._spaceKey = options.spaceKey;
|
|
2995
|
-
this.layoutUpdate.emit({
|
|
2996
|
-
layout,
|
|
2997
|
-
...options
|
|
2998
|
-
});
|
|
2999
|
-
}
|
|
3000
|
-
async setAppContext(context) {
|
|
3001
|
-
this.contextUpdate.emit(context);
|
|
3002
|
-
}
|
|
3003
|
-
};
|
|
3004
|
-
|
|
3005
|
-
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
3006
|
-
import { Trigger as Trigger9 } from "@dxos/async";
|
|
3007
|
-
import { log as log17, logInfo as logInfo2 } from "@dxos/log";
|
|
3008
|
-
import { MemorySignalManager as MemorySignalManager2, MemorySignalManagerContext as MemorySignalManagerContext2, WebsocketSignalManager as WebsocketSignalManager2 } from "@dxos/messaging";
|
|
3009
|
-
import { createWebRTCTransportFactory, NetworkManager as NetworkManager2 } from "@dxos/network-manager";
|
|
3010
|
-
import { createProtoRpcPeer as createProtoRpcPeer6 } from "@dxos/rpc";
|
|
3011
|
-
import { getAsyncValue } from "@dxos/util";
|
|
3012
|
-
|
|
3013
|
-
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
3014
|
-
import assert14 from "@dxos/node-std/assert";
|
|
3015
|
-
import { Event as Event7 } from "@dxos/async";
|
|
3016
|
-
import { raise as raise2 } from "@dxos/debug";
|
|
3017
|
-
import { DocumentModel } from "@dxos/document-model";
|
|
3018
|
-
import { DataServiceImpl } from "@dxos/echo-pipeline";
|
|
3019
|
-
import { log as log16 } from "@dxos/log";
|
|
3020
|
-
import { ModelFactory } from "@dxos/model-factory";
|
|
3021
|
-
import { SystemStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
3022
|
-
import { TextModel } from "@dxos/text-model";
|
|
3023
|
-
|
|
3024
|
-
// packages/sdk/client-services/src/packlets/deprecated/tracing.ts
|
|
3025
|
-
var TracingServiceImpl = class {
|
|
3026
|
-
constructor(_config) {
|
|
3027
|
-
this._config = _config;
|
|
3028
|
-
}
|
|
3029
|
-
async setTracingOptions() {
|
|
3030
|
-
throw new Error("Tracing not available.");
|
|
3031
|
-
}
|
|
3032
|
-
subscribeToRpcTrace() {
|
|
3033
|
-
throw new Error("Tracing not available.");
|
|
3034
|
-
}
|
|
3035
|
-
};
|
|
3036
|
-
|
|
3037
|
-
// packages/sdk/client-services/src/packlets/devices/devices-service.ts
|
|
3038
|
-
import { EventSubscriptions as EventSubscriptions2 } from "@dxos/async";
|
|
3039
|
-
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
3040
|
-
import { DeviceKind } from "@dxos/protocols/proto/dxos/client/services";
|
|
3041
|
-
var DevicesServiceImpl = class {
|
|
3042
|
-
constructor(_identityManager) {
|
|
3043
|
-
this._identityManager = _identityManager;
|
|
3044
|
-
}
|
|
3045
|
-
updateDevice(request) {
|
|
3046
|
-
throw new Error("Method not implemented.");
|
|
3047
|
-
}
|
|
3048
|
-
queryDevices() {
|
|
3049
|
-
return new Stream8(({ next }) => {
|
|
3050
|
-
const update = () => {
|
|
3051
|
-
var _a;
|
|
3052
|
-
const deviceKeys = (_a = this._identityManager.identity) == null ? void 0 : _a.authorizedDeviceKeys;
|
|
3053
|
-
if (!deviceKeys) {
|
|
3054
|
-
next({
|
|
3055
|
-
devices: []
|
|
3056
|
-
});
|
|
3057
|
-
} else {
|
|
3058
|
-
next({
|
|
3059
|
-
devices: Array.from(deviceKeys.values()).map((key) => {
|
|
3060
|
-
var _a2;
|
|
3061
|
-
return {
|
|
3062
|
-
deviceKey: key,
|
|
3063
|
-
kind: ((_a2 = this._identityManager.identity) == null ? void 0 : _a2.deviceKey.equals(key)) ? DeviceKind.CURRENT : DeviceKind.TRUSTED
|
|
3064
|
-
};
|
|
3065
|
-
})
|
|
3066
|
-
});
|
|
3067
|
-
}
|
|
3068
|
-
};
|
|
3069
|
-
const subscriptions = new EventSubscriptions2();
|
|
3070
|
-
subscriptions.add(this._identityManager.stateUpdate.on(() => {
|
|
3071
|
-
update();
|
|
3072
|
-
if (this._identityManager.identity) {
|
|
3073
|
-
subscriptions.add(this._identityManager.identity.stateUpdate.on(() => {
|
|
3074
|
-
update();
|
|
3075
|
-
}));
|
|
3076
|
-
}
|
|
3077
|
-
}));
|
|
3078
|
-
update();
|
|
3079
|
-
return () => subscriptions.clear();
|
|
3080
|
-
});
|
|
3081
|
-
}
|
|
3082
|
-
};
|
|
3083
|
-
|
|
3084
|
-
// packages/sdk/client-services/src/packlets/network/network-service.ts
|
|
3085
|
-
import { Stream as Stream9 } from "@dxos/codec-protobuf";
|
|
3086
|
-
var NetworkServiceImpl = class {
|
|
3087
|
-
constructor(networkManager) {
|
|
3088
|
-
this.networkManager = networkManager;
|
|
3089
|
-
}
|
|
3090
|
-
subscribeToNetworkStatus() {
|
|
3091
|
-
return new Stream9(({ next }) => {
|
|
3092
|
-
const unsubscribe = this.networkManager.connectionStateChanged.on((state) => next({
|
|
3093
|
-
state
|
|
3094
|
-
}));
|
|
3095
|
-
next({
|
|
3096
|
-
state: this.networkManager.connectionState
|
|
3097
|
-
});
|
|
3098
|
-
return unsubscribe;
|
|
3099
|
-
});
|
|
3100
|
-
}
|
|
3101
|
-
async setNetworkOptions(request) {
|
|
3102
|
-
await this.networkManager.setConnectionState(request.state);
|
|
3103
|
-
}
|
|
3104
|
-
};
|
|
2656
|
+
], DataSpaceManager.prototype, "createSpace", null);
|
|
2657
|
+
__decorate2([
|
|
2658
|
+
synchronized
|
|
2659
|
+
], DataSpaceManager.prototype, "acceptSpace", null);
|
|
2660
|
+
DataSpaceManager = __decorate2([
|
|
2661
|
+
trackLeaks2("open", "close")
|
|
2662
|
+
], DataSpaceManager);
|
|
3105
2663
|
|
|
3106
2664
|
// packages/sdk/client-services/src/packlets/spaces/spaces-service.ts
|
|
3107
2665
|
import { EventSubscriptions as EventSubscriptions3, scheduleTask as scheduleTask4 } from "@dxos/async";
|
|
3108
2666
|
import { Stream as Stream10 } from "@dxos/codec-protobuf";
|
|
3109
2667
|
import { raise, todo as todo2 } from "@dxos/debug";
|
|
3110
2668
|
import { SpaceNotFoundError } from "@dxos/echo-pipeline";
|
|
3111
|
-
import { log as
|
|
2669
|
+
import { log as log9 } from "@dxos/log";
|
|
3112
2670
|
import { SpaceMember, SpaceStatus } from "@dxos/protocols/proto/dxos/client/services";
|
|
3113
2671
|
import { humanize } from "@dxos/util";
|
|
3114
2672
|
var SpacesServiceImpl = class {
|
|
@@ -3134,7 +2692,7 @@ var SpacesServiceImpl = class {
|
|
|
3134
2692
|
const onUpdate = async () => {
|
|
3135
2693
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3136
2694
|
const spaces = Array.from(dataSpaceManager.spaces.values()).filter((space) => this._dataServiceSubscriptions.getDataService(space.key)).map((space) => this._transformSpace(space));
|
|
3137
|
-
|
|
2695
|
+
log9("update", {
|
|
3138
2696
|
spaces
|
|
3139
2697
|
}, {
|
|
3140
2698
|
file: "spaces-service.ts",
|
|
@@ -3258,6 +2816,7 @@ var SystemServiceImpl = class {
|
|
|
3258
2816
|
};
|
|
3259
2817
|
|
|
3260
2818
|
// packages/sdk/client-services/src/packlets/vault/iframe-proxy-runtime.ts
|
|
2819
|
+
import { iframeServiceBundle, workerServiceBundle } from "@dxos/client";
|
|
3261
2820
|
import { WebRTCTransportService } from "@dxos/network-manager";
|
|
3262
2821
|
import { createProtoRpcPeer as createProtoRpcPeer2 } from "@dxos/rpc";
|
|
3263
2822
|
var IFrameProxyRuntime = class {
|
|
@@ -3305,72 +2864,9 @@ var IFrameProxyRuntime = class {
|
|
|
3305
2864
|
}
|
|
3306
2865
|
};
|
|
3307
2866
|
|
|
3308
|
-
// packages/sdk/client-services/src/packlets/vault/shell-controller.ts
|
|
3309
|
-
import { Event as Event6 } from "@dxos/async";
|
|
3310
|
-
import { log as log12 } from "@dxos/log";
|
|
3311
|
-
import { ShellDisplay } from "@dxos/protocols/proto/dxos/iframe";
|
|
3312
|
-
import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
|
|
3313
|
-
var ShellController = class {
|
|
3314
|
-
constructor(_port) {
|
|
3315
|
-
this._port = _port;
|
|
3316
|
-
this.contextUpdate = new Event6();
|
|
3317
|
-
this._display = ShellDisplay.NONE;
|
|
3318
|
-
}
|
|
3319
|
-
get display() {
|
|
3320
|
-
return this._display;
|
|
3321
|
-
}
|
|
3322
|
-
async setLayout(layout, options = {}) {
|
|
3323
|
-
var _a;
|
|
3324
|
-
log12("set layout", {
|
|
3325
|
-
layout,
|
|
3326
|
-
...options
|
|
3327
|
-
}, {
|
|
3328
|
-
file: "shell-controller.ts",
|
|
3329
|
-
line: 27,
|
|
3330
|
-
scope: this,
|
|
3331
|
-
callSite: (f, a) => f(...a)
|
|
3332
|
-
});
|
|
3333
|
-
this._display = ShellDisplay.FULLSCREEN;
|
|
3334
|
-
this.contextUpdate.emit({
|
|
3335
|
-
display: this._display
|
|
3336
|
-
});
|
|
3337
|
-
await ((_a = this._shellRpc) == null ? void 0 : _a.rpc.ShellService.setLayout({
|
|
3338
|
-
layout,
|
|
3339
|
-
...options
|
|
3340
|
-
}));
|
|
3341
|
-
}
|
|
3342
|
-
async open() {
|
|
3343
|
-
this._shellRpc = createProtoRpcPeer3({
|
|
3344
|
-
requested: shellServiceBundle,
|
|
3345
|
-
exposed: appServiceBundle,
|
|
3346
|
-
handlers: {
|
|
3347
|
-
AppService: {
|
|
3348
|
-
setContext: async (request) => {
|
|
3349
|
-
log12("set context", request, {
|
|
3350
|
-
file: "shell-controller.ts",
|
|
3351
|
-
line: 40,
|
|
3352
|
-
scope: this,
|
|
3353
|
-
callSite: (f, a) => f(...a)
|
|
3354
|
-
});
|
|
3355
|
-
this._display = request.display;
|
|
3356
|
-
this.contextUpdate.emit(request);
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
},
|
|
3360
|
-
port: this._port
|
|
3361
|
-
});
|
|
3362
|
-
await this._shellRpc.open();
|
|
3363
|
-
}
|
|
3364
|
-
async close() {
|
|
3365
|
-
var _a;
|
|
3366
|
-
await ((_a = this._shellRpc) == null ? void 0 : _a.close());
|
|
3367
|
-
this._shellRpc = void 0;
|
|
3368
|
-
}
|
|
3369
|
-
};
|
|
3370
|
-
|
|
3371
2867
|
// packages/sdk/client-services/src/packlets/vault/vault-resource-lock.ts
|
|
3372
|
-
import { asyncTimeout, Trigger as
|
|
3373
|
-
import { log as
|
|
2868
|
+
import { asyncTimeout, Trigger as Trigger5 } from "@dxos/async";
|
|
2869
|
+
import { log as log10 } from "@dxos/log";
|
|
3374
2870
|
var Message;
|
|
3375
2871
|
(function(Message2) {
|
|
3376
2872
|
Message2["ACQUIRING"] = "acquiring";
|
|
@@ -3378,7 +2874,7 @@ var Message;
|
|
|
3378
2874
|
var VaultResourceLock = class {
|
|
3379
2875
|
constructor({ lockKey, onAcquire, onRelease }) {
|
|
3380
2876
|
this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
|
|
3381
|
-
this._releaseTrigger = new
|
|
2877
|
+
this._releaseTrigger = new Trigger5();
|
|
3382
2878
|
this._lockKey = lockKey;
|
|
3383
2879
|
this._onAcquire = onAcquire;
|
|
3384
2880
|
this._onRelease = onRelease;
|
|
@@ -3403,7 +2899,7 @@ var VaultResourceLock = class {
|
|
|
3403
2899
|
}
|
|
3404
2900
|
}
|
|
3405
2901
|
async _requestLock(steal = false) {
|
|
3406
|
-
|
|
2902
|
+
log10("requesting lock...", {
|
|
3407
2903
|
steal
|
|
3408
2904
|
}, {
|
|
3409
2905
|
file: "vault-resource-lock.ts",
|
|
@@ -3411,23 +2907,23 @@ var VaultResourceLock = class {
|
|
|
3411
2907
|
scope: this,
|
|
3412
2908
|
callSite: (f, a) => f(...a)
|
|
3413
2909
|
});
|
|
3414
|
-
const acquired = new
|
|
2910
|
+
const acquired = new Trigger5();
|
|
3415
2911
|
void navigator.locks.request(this._lockKey, {
|
|
3416
2912
|
steal
|
|
3417
2913
|
}, async () => {
|
|
3418
2914
|
var _a, _b;
|
|
3419
2915
|
await ((_a = this._onAcquire) == null ? void 0 : _a.call(this));
|
|
3420
2916
|
acquired.wake();
|
|
3421
|
-
this._releaseTrigger = new
|
|
2917
|
+
this._releaseTrigger = new Trigger5();
|
|
3422
2918
|
await this._releaseTrigger.wait();
|
|
3423
|
-
|
|
2919
|
+
log10("releasing lock...", {}, {
|
|
3424
2920
|
file: "vault-resource-lock.ts",
|
|
3425
2921
|
line: 65,
|
|
3426
2922
|
scope: this,
|
|
3427
2923
|
callSite: (f, a) => f(...a)
|
|
3428
2924
|
});
|
|
3429
2925
|
await ((_b = this._onRelease) == null ? void 0 : _b.call(this));
|
|
3430
|
-
|
|
2926
|
+
log10("released lock", {}, {
|
|
3431
2927
|
file: "vault-resource-lock.ts",
|
|
3432
2928
|
line: 67,
|
|
3433
2929
|
scope: this,
|
|
@@ -3438,7 +2934,7 @@ var VaultResourceLock = class {
|
|
|
3438
2934
|
await ((_a = this._onRelease) == null ? void 0 : _a.call(this));
|
|
3439
2935
|
});
|
|
3440
2936
|
await acquired.wait();
|
|
3441
|
-
|
|
2937
|
+
log10("recieved lock", {
|
|
3442
2938
|
steal
|
|
3443
2939
|
}, {
|
|
3444
2940
|
file: "vault-resource-lock.ts",
|
|
@@ -3450,16 +2946,17 @@ var VaultResourceLock = class {
|
|
|
3450
2946
|
};
|
|
3451
2947
|
|
|
3452
2948
|
// packages/sdk/client-services/src/packlets/vault/worker-runtime.ts
|
|
3453
|
-
import { Trigger as
|
|
3454
|
-
import { log as
|
|
2949
|
+
import { Trigger as Trigger7 } from "@dxos/async";
|
|
2950
|
+
import { log as log12 } from "@dxos/log";
|
|
3455
2951
|
import { MemorySignalManager, MemorySignalManagerContext, WebsocketSignalManager } from "@dxos/messaging";
|
|
3456
2952
|
import { NetworkManager, WebRTCTransportProxyFactory } from "@dxos/network-manager";
|
|
3457
2953
|
|
|
3458
2954
|
// packages/sdk/client-services/src/packlets/vault/worker-session.ts
|
|
3459
|
-
import
|
|
3460
|
-
import { asyncTimeout as asyncTimeout2, Trigger as
|
|
3461
|
-
import {
|
|
3462
|
-
import {
|
|
2955
|
+
import assert11 from "@dxos/node-std/assert";
|
|
2956
|
+
import { asyncTimeout as asyncTimeout2, Trigger as Trigger6 } from "@dxos/async";
|
|
2957
|
+
import { clientServiceBundle, iframeServiceBundle as iframeServiceBundle2, workerServiceBundle as workerServiceBundle2 } from "@dxos/client";
|
|
2958
|
+
import { log as log11, logInfo } from "@dxos/log";
|
|
2959
|
+
import { createProtoRpcPeer as createProtoRpcPeer3 } from "@dxos/rpc";
|
|
3463
2960
|
import { Callback } from "@dxos/util";
|
|
3464
2961
|
var __decorate3 = function(decorators, target, key, desc) {
|
|
3465
2962
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3475,10 +2972,10 @@ var WorkerSession = class {
|
|
|
3475
2972
|
constructor({ getService, systemPort, appPort, shellPort, options = {
|
|
3476
2973
|
heartbeatInterval: 1e3
|
|
3477
2974
|
} }) {
|
|
3478
|
-
this._startTrigger = new
|
|
2975
|
+
this._startTrigger = new Trigger6();
|
|
3479
2976
|
this.onClose = new Callback();
|
|
3480
|
-
|
|
3481
|
-
|
|
2977
|
+
assert11(options);
|
|
2978
|
+
assert11(getService);
|
|
3482
2979
|
this._options = options;
|
|
3483
2980
|
this._getService = getService;
|
|
3484
2981
|
const handlers = {
|
|
@@ -3493,19 +2990,19 @@ var WorkerSession = class {
|
|
|
3493
2990
|
SystemService: () => this._getService((services) => services.SystemService),
|
|
3494
2991
|
TracingService: () => this._getService((services) => services.TracingService)
|
|
3495
2992
|
};
|
|
3496
|
-
this._clientRpc =
|
|
2993
|
+
this._clientRpc = createProtoRpcPeer3({
|
|
3497
2994
|
exposed: clientServiceBundle,
|
|
3498
2995
|
handlers,
|
|
3499
2996
|
port: appPort
|
|
3500
2997
|
});
|
|
3501
|
-
this._shellClientRpc =
|
|
2998
|
+
this._shellClientRpc = createProtoRpcPeer3({
|
|
3502
2999
|
exposed: clientServiceBundle,
|
|
3503
3000
|
handlers,
|
|
3504
3001
|
port: shellPort
|
|
3505
3002
|
});
|
|
3506
|
-
this._iframeRpc =
|
|
3507
|
-
requested:
|
|
3508
|
-
exposed:
|
|
3003
|
+
this._iframeRpc = createProtoRpcPeer3({
|
|
3004
|
+
requested: iframeServiceBundle2,
|
|
3005
|
+
exposed: workerServiceBundle2,
|
|
3509
3006
|
handlers: {
|
|
3510
3007
|
WorkerService: {
|
|
3511
3008
|
start: async (request) => {
|
|
@@ -3517,9 +3014,9 @@ var WorkerSession = class {
|
|
|
3517
3014
|
try {
|
|
3518
3015
|
await this.close();
|
|
3519
3016
|
} catch (err) {
|
|
3520
|
-
|
|
3017
|
+
log11.catch(err, {}, {
|
|
3521
3018
|
file: "worker-session.ts",
|
|
3522
|
-
line:
|
|
3019
|
+
line: 95,
|
|
3523
3020
|
scope: this,
|
|
3524
3021
|
callSite: (f, a) => f(...a)
|
|
3525
3022
|
});
|
|
@@ -3535,9 +3032,9 @@ var WorkerSession = class {
|
|
|
3535
3032
|
this.bridgeService = this._iframeRpc.rpc.BridgeService;
|
|
3536
3033
|
}
|
|
3537
3034
|
async open() {
|
|
3538
|
-
|
|
3035
|
+
log11.info("opening..", {}, {
|
|
3539
3036
|
file: "worker-session.ts",
|
|
3540
|
-
line:
|
|
3037
|
+
line: 109,
|
|
3541
3038
|
scope: this,
|
|
3542
3039
|
callSite: (f, a) => f(...a)
|
|
3543
3040
|
});
|
|
@@ -3553,20 +3050,20 @@ var WorkerSession = class {
|
|
|
3553
3050
|
try {
|
|
3554
3051
|
await this._iframeRpc.rpc.IframeService.heartbeat();
|
|
3555
3052
|
} catch (err1) {
|
|
3556
|
-
|
|
3053
|
+
log11.warn("Heartbeat failed", {
|
|
3557
3054
|
err: err1
|
|
3558
3055
|
}, {
|
|
3559
3056
|
file: "worker-session.ts",
|
|
3560
|
-
line:
|
|
3057
|
+
line: 121,
|
|
3561
3058
|
scope: this,
|
|
3562
3059
|
callSite: (f, a) => f(...a)
|
|
3563
3060
|
});
|
|
3564
3061
|
try {
|
|
3565
3062
|
await this.close();
|
|
3566
3063
|
} catch (err) {
|
|
3567
|
-
|
|
3064
|
+
log11.catch(err, {}, {
|
|
3568
3065
|
file: "worker-session.ts",
|
|
3569
|
-
line:
|
|
3066
|
+
line: 125,
|
|
3570
3067
|
scope: this,
|
|
3571
3068
|
callSite: (f, a) => f(...a)
|
|
3572
3069
|
});
|
|
@@ -3575,18 +3072,18 @@ var WorkerSession = class {
|
|
|
3575
3072
|
}, this._options.heartbeatInterval);
|
|
3576
3073
|
}
|
|
3577
3074
|
async close() {
|
|
3578
|
-
|
|
3075
|
+
log11.info("closing..", {}, {
|
|
3579
3076
|
file: "worker-session.ts",
|
|
3580
|
-
line:
|
|
3077
|
+
line: 132,
|
|
3581
3078
|
scope: this,
|
|
3582
3079
|
callSite: (f, a) => f(...a)
|
|
3583
3080
|
});
|
|
3584
3081
|
try {
|
|
3585
3082
|
await this.onClose.callIfSet();
|
|
3586
3083
|
} catch (err) {
|
|
3587
|
-
|
|
3084
|
+
log11.catch(err, {}, {
|
|
3588
3085
|
file: "worker-session.ts",
|
|
3589
|
-
line:
|
|
3086
|
+
line: 136,
|
|
3590
3087
|
scope: this,
|
|
3591
3088
|
callSite: (f, a) => f(...a)
|
|
3592
3089
|
});
|
|
@@ -3603,9 +3100,9 @@ var WorkerSession = class {
|
|
|
3603
3100
|
try {
|
|
3604
3101
|
await asyncTimeout2(this._shellClientRpc.open(), 1e3);
|
|
3605
3102
|
} catch (e) {
|
|
3606
|
-
|
|
3103
|
+
log11.info("No shell connected.", {}, {
|
|
3607
3104
|
file: "worker-session.ts",
|
|
3608
|
-
line:
|
|
3105
|
+
line: 150,
|
|
3609
3106
|
scope: this,
|
|
3610
3107
|
callSite: (f, a) => f(...a)
|
|
3611
3108
|
});
|
|
@@ -3622,11 +3119,11 @@ var WorkerRuntime = class {
|
|
|
3622
3119
|
constructor(_configProvider) {
|
|
3623
3120
|
this._configProvider = _configProvider;
|
|
3624
3121
|
this._transportFactory = new WebRTCTransportProxyFactory();
|
|
3625
|
-
this._ready = new
|
|
3122
|
+
this._ready = new Trigger7();
|
|
3626
3123
|
this.sessions = /* @__PURE__ */ new Set();
|
|
3627
3124
|
}
|
|
3628
3125
|
async start() {
|
|
3629
|
-
|
|
3126
|
+
log12("starting...", {}, {
|
|
3630
3127
|
file: "worker-runtime.ts",
|
|
3631
3128
|
line: 42,
|
|
3632
3129
|
scope: this,
|
|
@@ -3647,7 +3144,7 @@ var WorkerRuntime = class {
|
|
|
3647
3144
|
});
|
|
3648
3145
|
await this._clientServices.open();
|
|
3649
3146
|
this._ready.wake(void 0);
|
|
3650
|
-
|
|
3147
|
+
log12("started", {}, {
|
|
3651
3148
|
file: "worker-runtime.ts",
|
|
3652
3149
|
line: 59,
|
|
3653
3150
|
scope: this,
|
|
@@ -3655,7 +3152,7 @@ var WorkerRuntime = class {
|
|
|
3655
3152
|
});
|
|
3656
3153
|
} catch (err) {
|
|
3657
3154
|
this._ready.wake(err);
|
|
3658
|
-
|
|
3155
|
+
log12.catch(err, {}, {
|
|
3659
3156
|
file: "worker-runtime.ts",
|
|
3660
3157
|
line: 62,
|
|
3661
3158
|
scope: this,
|
|
@@ -3716,6 +3213,202 @@ var WorkerRuntime = class {
|
|
|
3716
3213
|
}
|
|
3717
3214
|
};
|
|
3718
3215
|
|
|
3216
|
+
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
3217
|
+
import { Trigger as Trigger8 } from "@dxos/async";
|
|
3218
|
+
import { getCredentialAssertion as getCredentialAssertion3 } from "@dxos/credentials";
|
|
3219
|
+
import { failUndefined as failUndefined2 } from "@dxos/debug";
|
|
3220
|
+
import { valueEncoding, MetadataStore, SpaceManager, DataServiceSubscriptions, SnapshotStore } from "@dxos/echo-pipeline";
|
|
3221
|
+
import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
3222
|
+
import { Keyring } from "@dxos/keyring";
|
|
3223
|
+
import { log as log13 } from "@dxos/log";
|
|
3224
|
+
var ServiceContext = class {
|
|
3225
|
+
// prettier-ignore
|
|
3226
|
+
constructor(storage, networkManager, modelFactory) {
|
|
3227
|
+
this.storage = storage;
|
|
3228
|
+
this.networkManager = networkManager;
|
|
3229
|
+
this.modelFactory = modelFactory;
|
|
3230
|
+
this.initialized = new Trigger8();
|
|
3231
|
+
this.dataServiceSubscriptions = new DataServiceSubscriptions();
|
|
3232
|
+
this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
|
|
3233
|
+
this.snapshotStore = new SnapshotStore(storage.createDirectory("snapshots"));
|
|
3234
|
+
this.keyring = new Keyring(storage.createDirectory("keyring"));
|
|
3235
|
+
this.feedStore = new FeedStore({
|
|
3236
|
+
factory: new FeedFactory({
|
|
3237
|
+
root: storage.createDirectory("feeds"),
|
|
3238
|
+
signer: this.keyring,
|
|
3239
|
+
hypercore: {
|
|
3240
|
+
valueEncoding
|
|
3241
|
+
}
|
|
3242
|
+
})
|
|
3243
|
+
});
|
|
3244
|
+
this.spaceManager = new SpaceManager({
|
|
3245
|
+
feedStore: this.feedStore,
|
|
3246
|
+
networkManager: this.networkManager
|
|
3247
|
+
});
|
|
3248
|
+
this.identityManager = new IdentityManager(this.metadataStore, this.keyring, this.feedStore, this.spaceManager);
|
|
3249
|
+
this.deviceInvitations = new DeviceInvitationsHandler({
|
|
3250
|
+
networkManager: this.networkManager,
|
|
3251
|
+
getIdentity: () => {
|
|
3252
|
+
var _a;
|
|
3253
|
+
return (_a = this.identityManager.identity) != null ? _a : failUndefined2();
|
|
3254
|
+
},
|
|
3255
|
+
acceptIdentity: this._acceptIdentity.bind(this),
|
|
3256
|
+
keyring: this.keyring
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3259
|
+
async open() {
|
|
3260
|
+
log13("opening...", {}, {
|
|
3261
|
+
file: "service-context.ts",
|
|
3262
|
+
line: 94,
|
|
3263
|
+
scope: this,
|
|
3264
|
+
callSite: (f, a) => f(...a)
|
|
3265
|
+
});
|
|
3266
|
+
await this.networkManager.open();
|
|
3267
|
+
await this.spaceManager.open();
|
|
3268
|
+
await this.identityManager.open();
|
|
3269
|
+
if (this.identityManager.identity) {
|
|
3270
|
+
await this._initialize();
|
|
3271
|
+
}
|
|
3272
|
+
log13("opened", {}, {
|
|
3273
|
+
file: "service-context.ts",
|
|
3274
|
+
line: 101,
|
|
3275
|
+
scope: this,
|
|
3276
|
+
callSite: (f, a) => f(...a)
|
|
3277
|
+
});
|
|
3278
|
+
}
|
|
3279
|
+
async close() {
|
|
3280
|
+
var _a, _b;
|
|
3281
|
+
log13("closing...", {}, {
|
|
3282
|
+
file: "service-context.ts",
|
|
3283
|
+
line: 105,
|
|
3284
|
+
scope: this,
|
|
3285
|
+
callSite: (f, a) => f(...a)
|
|
3286
|
+
});
|
|
3287
|
+
await ((_a = this._deviceSpaceSync) == null ? void 0 : _a.close());
|
|
3288
|
+
await ((_b = this.dataSpaceManager) == null ? void 0 : _b.close());
|
|
3289
|
+
await this.identityManager.close();
|
|
3290
|
+
await this.spaceManager.close();
|
|
3291
|
+
await this.feedStore.close();
|
|
3292
|
+
await this.networkManager.close();
|
|
3293
|
+
this.dataServiceSubscriptions.clear();
|
|
3294
|
+
log13("closed", {}, {
|
|
3295
|
+
file: "service-context.ts",
|
|
3296
|
+
line: 113,
|
|
3297
|
+
scope: this,
|
|
3298
|
+
callSite: (f, a) => f(...a)
|
|
3299
|
+
});
|
|
3300
|
+
}
|
|
3301
|
+
async reset() {
|
|
3302
|
+
log13("resetting...", {}, {
|
|
3303
|
+
file: "service-context.ts",
|
|
3304
|
+
line: 117,
|
|
3305
|
+
scope: this,
|
|
3306
|
+
callSite: (f, a) => f(...a)
|
|
3307
|
+
});
|
|
3308
|
+
await this.close();
|
|
3309
|
+
await this.storage.reset();
|
|
3310
|
+
log13("reset", {}, {
|
|
3311
|
+
file: "service-context.ts",
|
|
3312
|
+
line: 120,
|
|
3313
|
+
scope: this,
|
|
3314
|
+
callSite: (f, a) => f(...a)
|
|
3315
|
+
});
|
|
3316
|
+
}
|
|
3317
|
+
async createIdentity(params = {}) {
|
|
3318
|
+
const identity = await this.identityManager.createIdentity(params);
|
|
3319
|
+
await this._initialize();
|
|
3320
|
+
return identity;
|
|
3321
|
+
}
|
|
3322
|
+
async _acceptIdentity(params) {
|
|
3323
|
+
const identity = await this.identityManager.acceptIdentity(params);
|
|
3324
|
+
await this._initialize();
|
|
3325
|
+
return identity;
|
|
3326
|
+
}
|
|
3327
|
+
// Called when identity is created.
|
|
3328
|
+
async _initialize() {
|
|
3329
|
+
var _a;
|
|
3330
|
+
log13("initializing spaces...", {}, {
|
|
3331
|
+
file: "service-context.ts",
|
|
3332
|
+
line: 139,
|
|
3333
|
+
scope: this,
|
|
3334
|
+
callSite: (f, a) => f(...a)
|
|
3335
|
+
});
|
|
3336
|
+
const identity = (_a = this.identityManager.identity) != null ? _a : failUndefined2();
|
|
3337
|
+
const signingContext = {
|
|
3338
|
+
credentialSigner: identity.getIdentityCredentialSigner(),
|
|
3339
|
+
identityKey: identity.identityKey,
|
|
3340
|
+
deviceKey: identity.deviceKey,
|
|
3341
|
+
profile: identity.profileDocument,
|
|
3342
|
+
recordCredential: async (credential) => {
|
|
3343
|
+
await identity.controlPipeline.writer.write({
|
|
3344
|
+
credential: {
|
|
3345
|
+
credential
|
|
3346
|
+
}
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
};
|
|
3350
|
+
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.modelFactory, this.feedStore, this.snapshotStore);
|
|
3351
|
+
await this.dataSpaceManager.open();
|
|
3352
|
+
this.spaceInvitations = new SpaceInvitationsHandler(this.networkManager, this.dataSpaceManager, signingContext, this.keyring);
|
|
3353
|
+
this.initialized.wake();
|
|
3354
|
+
this._deviceSpaceSync = identity.space.spaceState.registerProcessor({
|
|
3355
|
+
process: async (credential) => {
|
|
3356
|
+
const assertion = getCredentialAssertion3(credential);
|
|
3357
|
+
if (assertion["@type"] !== "dxos.halo.credentials.SpaceMember") {
|
|
3358
|
+
return;
|
|
3359
|
+
}
|
|
3360
|
+
if (assertion.spaceKey.equals(identity.space.key)) {
|
|
3361
|
+
return;
|
|
3362
|
+
}
|
|
3363
|
+
if (!this.dataSpaceManager) {
|
|
3364
|
+
log13("dataSpaceManager not initialized yet, ignoring space admission", {
|
|
3365
|
+
details: assertion
|
|
3366
|
+
}, {
|
|
3367
|
+
file: "service-context.ts",
|
|
3368
|
+
line: 182,
|
|
3369
|
+
scope: this,
|
|
3370
|
+
callSite: (f, a) => f(...a)
|
|
3371
|
+
});
|
|
3372
|
+
return;
|
|
3373
|
+
}
|
|
3374
|
+
if (this.dataSpaceManager.spaces.has(assertion.spaceKey)) {
|
|
3375
|
+
log13("space already exists, ignoring space admission", {
|
|
3376
|
+
details: assertion
|
|
3377
|
+
}, {
|
|
3378
|
+
file: "service-context.ts",
|
|
3379
|
+
line: 186,
|
|
3380
|
+
scope: this,
|
|
3381
|
+
callSite: (f, a) => f(...a)
|
|
3382
|
+
});
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
try {
|
|
3386
|
+
log13("accepting space recorded in halo", {
|
|
3387
|
+
details: assertion
|
|
3388
|
+
}, {
|
|
3389
|
+
file: "service-context.ts",
|
|
3390
|
+
line: 191,
|
|
3391
|
+
scope: this,
|
|
3392
|
+
callSite: (f, a) => f(...a)
|
|
3393
|
+
});
|
|
3394
|
+
await this.dataSpaceManager.acceptSpace({
|
|
3395
|
+
spaceKey: assertion.spaceKey,
|
|
3396
|
+
genesisFeedKey: assertion.genesisFeedKey
|
|
3397
|
+
});
|
|
3398
|
+
} catch (err) {
|
|
3399
|
+
log13.catch(err, {}, {
|
|
3400
|
+
file: "service-context.ts",
|
|
3401
|
+
line: 197,
|
|
3402
|
+
scope: this,
|
|
3403
|
+
callSite: (f, a) => f(...a)
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
});
|
|
3408
|
+
await this._deviceSpaceSync.open();
|
|
3409
|
+
}
|
|
3410
|
+
};
|
|
3411
|
+
|
|
3719
3412
|
// packages/sdk/client-services/src/packlets/services/service-registry.ts
|
|
3720
3413
|
var ServiceRegistry = class {
|
|
3721
3414
|
// prettier-ignore
|
|
@@ -3735,9 +3428,6 @@ var ServiceRegistry = class {
|
|
|
3735
3428
|
};
|
|
3736
3429
|
|
|
3737
3430
|
// packages/sdk/client-services/src/packlets/services/service-host.ts
|
|
3738
|
-
var createDefaultModelFactory = () => {
|
|
3739
|
-
return new ModelFactory().registerModel(DocumentModel).registerModel(TextModel);
|
|
3740
|
-
};
|
|
3741
3431
|
var ClientServicesHost = class {
|
|
3742
3432
|
constructor({
|
|
3743
3433
|
config,
|
|
@@ -3748,7 +3438,7 @@ var ClientServicesHost = class {
|
|
|
3748
3438
|
// TODO(wittjosiah): Turn this on by default.
|
|
3749
3439
|
lockKey
|
|
3750
3440
|
}) {
|
|
3751
|
-
this._statusUpdate = new
|
|
3441
|
+
this._statusUpdate = new Event6();
|
|
3752
3442
|
this._open = false;
|
|
3753
3443
|
this._config = config;
|
|
3754
3444
|
this._modelFactory = modelFactory;
|
|
@@ -3772,11 +3462,11 @@ var ClientServicesHost = class {
|
|
|
3772
3462
|
}
|
|
3773
3463
|
},
|
|
3774
3464
|
onReset: async () => {
|
|
3775
|
-
|
|
3465
|
+
assert12(this._serviceContext, "service host is closed");
|
|
3776
3466
|
await this._serviceContext.reset();
|
|
3777
3467
|
}
|
|
3778
3468
|
});
|
|
3779
|
-
this._serviceRegistry = new ServiceRegistry(
|
|
3469
|
+
this._serviceRegistry = new ServiceRegistry(clientServiceBundle2, {
|
|
3780
3470
|
SystemService: this._systemService
|
|
3781
3471
|
});
|
|
3782
3472
|
}
|
|
@@ -3794,9 +3484,9 @@ var ClientServicesHost = class {
|
|
|
3794
3484
|
if (this._open) {
|
|
3795
3485
|
return;
|
|
3796
3486
|
}
|
|
3797
|
-
|
|
3487
|
+
log14("opening...", {}, {
|
|
3798
3488
|
file: "service-host.ts",
|
|
3799
|
-
line:
|
|
3489
|
+
line: 125,
|
|
3800
3490
|
scope: this,
|
|
3801
3491
|
callSite: (f, a) => f(...a)
|
|
3802
3492
|
});
|
|
@@ -3832,11 +3522,11 @@ var ClientServicesHost = class {
|
|
|
3832
3522
|
this._open = true;
|
|
3833
3523
|
this._statusUpdate.emit();
|
|
3834
3524
|
const deviceKey = (_b = this._serviceContext.identityManager.identity) == null ? void 0 : _b.deviceKey;
|
|
3835
|
-
|
|
3525
|
+
log14("opened", {
|
|
3836
3526
|
deviceKey
|
|
3837
3527
|
}, {
|
|
3838
3528
|
file: "service-host.ts",
|
|
3839
|
-
line:
|
|
3529
|
+
line: 178,
|
|
3840
3530
|
scope: this,
|
|
3841
3531
|
callSite: (f, a) => f(...a)
|
|
3842
3532
|
});
|
|
@@ -3847,11 +3537,11 @@ var ClientServicesHost = class {
|
|
|
3847
3537
|
return;
|
|
3848
3538
|
}
|
|
3849
3539
|
const deviceKey = (_a = this._serviceContext.identityManager.identity) == null ? void 0 : _a.deviceKey;
|
|
3850
|
-
|
|
3540
|
+
log14("closing...", {
|
|
3851
3541
|
deviceKey
|
|
3852
3542
|
}, {
|
|
3853
3543
|
file: "service-host.ts",
|
|
3854
|
-
line:
|
|
3544
|
+
line: 187,
|
|
3855
3545
|
scope: this,
|
|
3856
3546
|
callSite: (f, a) => f(...a)
|
|
3857
3547
|
});
|
|
@@ -3861,49 +3551,73 @@ var ClientServicesHost = class {
|
|
|
3861
3551
|
await this._serviceContext.close();
|
|
3862
3552
|
this._open = false;
|
|
3863
3553
|
this._statusUpdate.emit();
|
|
3864
|
-
|
|
3554
|
+
log14("closed", {
|
|
3865
3555
|
deviceKey
|
|
3866
3556
|
}, {
|
|
3867
3557
|
file: "service-host.ts",
|
|
3868
|
-
line:
|
|
3558
|
+
line: 192,
|
|
3869
3559
|
scope: this,
|
|
3870
3560
|
callSite: (f, a) => f(...a)
|
|
3871
3561
|
});
|
|
3872
3562
|
}
|
|
3873
3563
|
};
|
|
3874
3564
|
|
|
3875
|
-
// packages/sdk/client-services/src/packlets/services/
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
var ClientServicesProxy = class {
|
|
3880
|
-
// prettier-ignore
|
|
3881
|
-
constructor(port, _timeout = 3e4) {
|
|
3882
|
-
this._timeout = _timeout;
|
|
3883
|
-
this._proxy = createProtoRpcPeer5({
|
|
3884
|
-
requested: clientServiceBundle,
|
|
3885
|
-
exposed: {},
|
|
3886
|
-
handlers: {},
|
|
3887
|
-
port
|
|
3888
|
-
});
|
|
3889
|
-
}
|
|
3890
|
-
get proxy() {
|
|
3891
|
-
return this._proxy;
|
|
3565
|
+
// packages/sdk/client-services/src/packlets/services/local-client-services.ts
|
|
3566
|
+
var LocalClientServices = class {
|
|
3567
|
+
constructor(params) {
|
|
3568
|
+
this._host = new ClientServicesHost(params);
|
|
3892
3569
|
}
|
|
3893
3570
|
get descriptors() {
|
|
3894
|
-
return
|
|
3571
|
+
return this._host.descriptors;
|
|
3895
3572
|
}
|
|
3896
3573
|
get services() {
|
|
3897
|
-
return this.
|
|
3574
|
+
return this._host.services;
|
|
3898
3575
|
}
|
|
3899
3576
|
async open() {
|
|
3900
|
-
await
|
|
3577
|
+
await this._host.open();
|
|
3901
3578
|
}
|
|
3902
3579
|
async close() {
|
|
3903
|
-
await this.
|
|
3580
|
+
await this._host.close();
|
|
3904
3581
|
}
|
|
3905
3582
|
};
|
|
3906
3583
|
|
|
3584
|
+
// packages/sdk/client-services/src/packlets/services/utils.ts
|
|
3585
|
+
import { Config } from "@dxos/config";
|
|
3586
|
+
import { log as log15 } from "@dxos/log";
|
|
3587
|
+
import { MemorySignalManager as MemorySignalManager2, MemorySignalManagerContext as MemorySignalManagerContext2, WebsocketSignalManager as WebsocketSignalManager2 } from "@dxos/messaging";
|
|
3588
|
+
import { createWebRTCTransportFactory, MemoryTransportFactory, NetworkManager as NetworkManager2 } from "@dxos/network-manager";
|
|
3589
|
+
var fromHost = (config = new Config()) => {
|
|
3590
|
+
return new LocalClientServices({
|
|
3591
|
+
config,
|
|
3592
|
+
networkManager: createNetworkManager(config)
|
|
3593
|
+
});
|
|
3594
|
+
};
|
|
3595
|
+
var createNetworkManager = (config, options = {}) => {
|
|
3596
|
+
const signalServer = config.get("runtime.services.signal.server");
|
|
3597
|
+
if (signalServer) {
|
|
3598
|
+
const { log: log1 = true, signalManager = new WebsocketSignalManager2([
|
|
3599
|
+
signalServer
|
|
3600
|
+
]), transportFactory = createWebRTCTransportFactory({
|
|
3601
|
+
iceServers: config.get("runtime.services.ice")
|
|
3602
|
+
}) } = options;
|
|
3603
|
+
return new NetworkManager2({
|
|
3604
|
+
log: log1,
|
|
3605
|
+
signalManager,
|
|
3606
|
+
transportFactory
|
|
3607
|
+
});
|
|
3608
|
+
}
|
|
3609
|
+
log15.warn("P2P network is not configured.", {}, {
|
|
3610
|
+
file: "utils.ts",
|
|
3611
|
+
line: 48,
|
|
3612
|
+
scope: void 0,
|
|
3613
|
+
callSite: (f, a) => f(...a)
|
|
3614
|
+
});
|
|
3615
|
+
return new NetworkManager2({
|
|
3616
|
+
signalManager: new MemorySignalManager2(new MemorySignalManagerContext2()),
|
|
3617
|
+
transportFactory: MemoryTransportFactory
|
|
3618
|
+
});
|
|
3619
|
+
};
|
|
3620
|
+
|
|
3907
3621
|
// packages/sdk/client-services/src/packlets/vault/iframe-host-runtime.ts
|
|
3908
3622
|
var __decorate4 = function(decorators, target, key, desc) {
|
|
3909
3623
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3918,7 +3632,7 @@ var __decorate4 = function(decorators, target, key, desc) {
|
|
|
3918
3632
|
var LOCK_KEY = "DXOS_RESOURCE_LOCK";
|
|
3919
3633
|
var IFrameHostRuntime = class {
|
|
3920
3634
|
constructor({ configProvider, appPort, shellPort }) {
|
|
3921
|
-
this._transportFactory =
|
|
3635
|
+
this._transportFactory = createWebRTCTransportFactory2();
|
|
3922
3636
|
this._ready = new Trigger9();
|
|
3923
3637
|
this._configProvider = configProvider;
|
|
3924
3638
|
this._appPort = appPort;
|
|
@@ -3946,28 +3660,28 @@ var IFrameHostRuntime = class {
|
|
|
3946
3660
|
}
|
|
3947
3661
|
async start() {
|
|
3948
3662
|
var _a;
|
|
3949
|
-
|
|
3663
|
+
log16("starting...", {}, {
|
|
3950
3664
|
file: "iframe-host-runtime.ts",
|
|
3951
|
-
line:
|
|
3665
|
+
line: 84,
|
|
3952
3666
|
scope: this,
|
|
3953
3667
|
callSite: (f, a) => f(...a)
|
|
3954
3668
|
});
|
|
3955
3669
|
try {
|
|
3956
3670
|
this._config = await getAsyncValue(this._configProvider);
|
|
3957
3671
|
const signalServer = this._config.get("runtime.services.signal.server");
|
|
3958
|
-
this._clientServices = new
|
|
3672
|
+
this._clientServices = new LocalClientServices({
|
|
3959
3673
|
lockKey: LOCK_KEY,
|
|
3960
3674
|
config: this._config,
|
|
3961
|
-
networkManager: new
|
|
3675
|
+
networkManager: new NetworkManager3({
|
|
3962
3676
|
log: true,
|
|
3963
|
-
signalManager: signalServer ? new
|
|
3677
|
+
signalManager: signalServer ? new WebsocketSignalManager3([
|
|
3964
3678
|
signalServer
|
|
3965
|
-
]) : new
|
|
3679
|
+
]) : new MemorySignalManager3(new MemorySignalManagerContext3()),
|
|
3966
3680
|
transportFactory: this._transportFactory
|
|
3967
3681
|
})
|
|
3968
3682
|
});
|
|
3969
|
-
this._clientRpc =
|
|
3970
|
-
exposed:
|
|
3683
|
+
this._clientRpc = createProtoRpcPeer4({
|
|
3684
|
+
exposed: clientServiceBundle3,
|
|
3971
3685
|
handlers: {
|
|
3972
3686
|
DataService: async () => await this._getService((services) => services.DataService),
|
|
3973
3687
|
DeviceInvitationsService: async () => await this._getService((services) => services.DeviceInvitationsService),
|
|
@@ -3988,17 +3702,17 @@ var IFrameHostRuntime = class {
|
|
|
3988
3702
|
(_a = this._shellRuntime) == null ? void 0 : _a.open()
|
|
3989
3703
|
]);
|
|
3990
3704
|
this._ready.wake(void 0);
|
|
3991
|
-
|
|
3705
|
+
log16("started", {}, {
|
|
3992
3706
|
file: "iframe-host-runtime.ts",
|
|
3993
|
-
line:
|
|
3707
|
+
line: 119,
|
|
3994
3708
|
scope: this,
|
|
3995
3709
|
callSite: (f, a) => f(...a)
|
|
3996
3710
|
});
|
|
3997
3711
|
} catch (err) {
|
|
3998
3712
|
this._ready.wake(err);
|
|
3999
|
-
|
|
3713
|
+
log16.catch(err, {}, {
|
|
4000
3714
|
file: "iframe-host-runtime.ts",
|
|
4001
|
-
line:
|
|
3715
|
+
line: 122,
|
|
4002
3716
|
scope: this,
|
|
4003
3717
|
callSite: (f, a) => f(...a)
|
|
4004
3718
|
});
|
|
@@ -4006,18 +3720,18 @@ var IFrameHostRuntime = class {
|
|
|
4006
3720
|
}
|
|
4007
3721
|
async stop() {
|
|
4008
3722
|
var _a;
|
|
4009
|
-
|
|
3723
|
+
log16("stopping...", {}, {
|
|
4010
3724
|
file: "iframe-host-runtime.ts",
|
|
4011
|
-
line:
|
|
3725
|
+
line: 127,
|
|
4012
3726
|
scope: this,
|
|
4013
3727
|
callSite: (f, a) => f(...a)
|
|
4014
3728
|
});
|
|
4015
3729
|
await this._clientRpc.close();
|
|
4016
3730
|
await this._clientServices.close();
|
|
4017
3731
|
await ((_a = this._shellRuntime) == null ? void 0 : _a.close());
|
|
4018
|
-
|
|
3732
|
+
log16("stopped", {}, {
|
|
4019
3733
|
file: "iframe-host-runtime.ts",
|
|
4020
|
-
line:
|
|
3734
|
+
line: 131,
|
|
4021
3735
|
scope: this,
|
|
4022
3736
|
callSite: (f, a) => f(...a)
|
|
4023
3737
|
});
|
|
@@ -4043,40 +3757,23 @@ export {
|
|
|
4043
3757
|
Identity,
|
|
4044
3758
|
IdentityManager,
|
|
4045
3759
|
IdentityServiceImpl,
|
|
4046
|
-
InvitationEncoder,
|
|
4047
|
-
AUTHENTICATION_CODE_LENGTH,
|
|
4048
|
-
INVITATION_TIMEOUT,
|
|
4049
|
-
ON_CLOSE_DELAY,
|
|
4050
|
-
InvitationObservableProvider,
|
|
4051
|
-
AuthenticatingInvitationProvider,
|
|
4052
|
-
wrapObservable,
|
|
4053
|
-
AbstractInvitationsHandler,
|
|
4054
3760
|
DeviceInvitationsHandler,
|
|
4055
|
-
AbstractInvitationsProxy,
|
|
4056
|
-
DeviceInvitationsProxy,
|
|
4057
3761
|
AbstractInvitationsService,
|
|
4058
3762
|
DeviceInvitationsServiceImpl,
|
|
4059
3763
|
SpaceInvitationsHandler,
|
|
4060
|
-
SpaceInvitationsProxy,
|
|
4061
3764
|
SpaceInvitationsServiceImpl,
|
|
4062
|
-
ServiceContext,
|
|
4063
|
-
clientServiceBundle,
|
|
4064
3765
|
createStorageObjects,
|
|
4065
|
-
iframeServiceBundle,
|
|
4066
|
-
workerServiceBundle,
|
|
4067
|
-
appServiceBundle,
|
|
4068
|
-
shellServiceBundle,
|
|
4069
3766
|
ShellRuntimeImpl,
|
|
4070
3767
|
MemoryShellRuntime,
|
|
4071
3768
|
IFrameHostRuntime,
|
|
4072
3769
|
IFrameProxyRuntime,
|
|
4073
|
-
ShellController,
|
|
4074
3770
|
VaultResourceLock,
|
|
4075
3771
|
WorkerSession,
|
|
4076
3772
|
WorkerRuntime,
|
|
3773
|
+
ServiceContext,
|
|
4077
3774
|
ServiceRegistry,
|
|
4078
|
-
createDefaultModelFactory,
|
|
4079
3775
|
ClientServicesHost,
|
|
4080
|
-
|
|
3776
|
+
LocalClientServices,
|
|
3777
|
+
fromHost
|
|
4081
3778
|
};
|
|
4082
|
-
//# sourceMappingURL=chunk-
|
|
3779
|
+
//# sourceMappingURL=chunk-ILMYW75X.mjs.map
|