@dxos/client-services 0.1.57 → 0.1.58-main.0e9c99e
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-ZOFA377V.mjs → chunk-6KSX4KBN.mjs} +181 -131
- package/dist/lib/browser/chunk-6KSX4KBN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -11
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +4 -4
- package/dist/lib/browser/packlets/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +226 -175
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +221 -171
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/invitations/invitation-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts +3 -3
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitations-service.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/packlets/testing/invitation-utils.d.ts +5 -5
- package/dist/types/src/packlets/testing/invitation-utils.d.ts.map +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts +1 -1
- package/dist/types/src/packlets/vault/shell-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/package.json +34 -35
- package/src/packlets/identity/authenticator.ts +1 -1
- package/src/packlets/invitations/invitation-extension.ts +1 -2
- package/src/packlets/invitations/invitations-handler.ts +7 -8
- package/src/packlets/invitations/invitations-service.ts +11 -5
- package/src/packlets/services/service-context.ts +2 -2
- package/src/packlets/spaces/data-space.ts +10 -2
- package/src/packlets/spaces/spaces-service.ts +29 -8
- package/src/packlets/storage/storage.ts +1 -1
- package/src/packlets/testing/invitation-utils.ts +9 -9
- package/src/packlets/vault/iframe-proxy-runtime.ts +1 -1
- package/src/packlets/vault/shell-runtime.ts +4 -4
- package/src/version.ts +1 -5
- package/dist/lib/browser/chunk-ZOFA377V.mjs.map +0 -7
|
@@ -52,7 +52,7 @@ var createMockCredential = async ({ signer, issuer }) => (0, import_credentials.
|
|
|
52
52
|
|
|
53
53
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
54
54
|
var import_async18 = require("@dxos/async");
|
|
55
|
-
var
|
|
55
|
+
var import_invariant16 = require("@dxos/invariant");
|
|
56
56
|
var import_services15 = require("@dxos/protocols/proto/dxos/client/services");
|
|
57
57
|
|
|
58
58
|
// packages/sdk/client-services/src/packlets/services/client-rpc-server.ts
|
|
@@ -71,7 +71,7 @@ var import_protocols = require("@dxos/protocols");
|
|
|
71
71
|
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
72
72
|
|
|
73
73
|
// packages/sdk/client-services/src/version.ts
|
|
74
|
-
var DXOS_VERSION = "0.1.
|
|
74
|
+
var DXOS_VERSION = "0.1.58-main.0e9c99e";
|
|
75
75
|
|
|
76
76
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
77
77
|
var getPlatform = () => {
|
|
@@ -102,7 +102,7 @@ var getPlatform = () => {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
// packages/sdk/client-services/src/packlets/services/diagnostics.ts
|
|
105
|
-
var __dxlog_file = "/
|
|
105
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
|
|
106
106
|
var DEFAULT_TIMEOUT = 1e3;
|
|
107
107
|
var createDiagnostics = async (clientServices, serviceContext, config) => {
|
|
108
108
|
const diagnostics = {
|
|
@@ -224,13 +224,13 @@ var import_async11 = require("@dxos/async");
|
|
|
224
224
|
var import_context8 = require("@dxos/context");
|
|
225
225
|
var import_credentials15 = require("@dxos/credentials");
|
|
226
226
|
var import_debug7 = require("@dxos/debug");
|
|
227
|
-
var
|
|
227
|
+
var import_echo_pipeline2 = require("@dxos/echo-pipeline");
|
|
228
228
|
var import_feed_store3 = require("@dxos/feed-store");
|
|
229
|
-
var
|
|
229
|
+
var import_invariant13 = require("@dxos/invariant");
|
|
230
230
|
var import_keyring = require("@dxos/keyring");
|
|
231
231
|
var import_keys8 = require("@dxos/keys");
|
|
232
232
|
var import_log13 = require("@dxos/log");
|
|
233
|
-
var
|
|
233
|
+
var import_protocols10 = require("@dxos/protocols");
|
|
234
234
|
var import_services10 = require("@dxos/protocols/proto/dxos/client/services");
|
|
235
235
|
var import_teleport_extension_object_sync = require("@dxos/teleport-extension-object-sync");
|
|
236
236
|
var import_tracing4 = require("@dxos/tracing");
|
|
@@ -242,7 +242,7 @@ var import_context = require("@dxos/context");
|
|
|
242
242
|
var import_credentials3 = require("@dxos/credentials");
|
|
243
243
|
var import_log2 = require("@dxos/log");
|
|
244
244
|
var import_protocols2 = require("@dxos/protocols");
|
|
245
|
-
var __dxlog_file2 = "/
|
|
245
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/authenticator.ts";
|
|
246
246
|
var Credential = import_protocols2.schema.getCodecForType("dxos.halo.credentials.Credential");
|
|
247
247
|
var createAuthProvider = (signer) => async (nonce) => {
|
|
248
248
|
const credential = await signer.createCredential({
|
|
@@ -372,7 +372,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
372
372
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
373
373
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
374
374
|
}
|
|
375
|
-
var __dxlog_file3 = "/
|
|
375
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity.ts";
|
|
376
376
|
var Identity = class Identity2 {
|
|
377
377
|
constructor({ space, signer, identityKey, deviceKey }) {
|
|
378
378
|
this.stateUpdate = new import_async2.Event();
|
|
@@ -545,7 +545,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
545
545
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
546
546
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
547
547
|
}
|
|
548
|
-
var __dxlog_file4 = "/
|
|
548
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-manager.ts";
|
|
549
549
|
var IdentityManager = class IdentityManager2 {
|
|
550
550
|
// TODO(burdon): IdentityManagerParams.
|
|
551
551
|
// TODO(dmaretskyi): Perhaps this should take/generate the peerKey outside of an initialized identity.
|
|
@@ -898,7 +898,7 @@ var import_codec_protobuf3 = require("@dxos/codec-protobuf");
|
|
|
898
898
|
var import_credentials8 = require("@dxos/credentials");
|
|
899
899
|
var import_debug3 = require("@dxos/debug");
|
|
900
900
|
var import_invariant4 = require("@dxos/invariant");
|
|
901
|
-
var __dxlog_file5 = "/
|
|
901
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
902
902
|
var IdentityServiceImpl = class {
|
|
903
903
|
constructor(_createIdentity, _identityManager, _keyring) {
|
|
904
904
|
this._createIdentity = _createIdentity;
|
|
@@ -967,7 +967,7 @@ var IdentityServiceImpl = class {
|
|
|
967
967
|
// packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts
|
|
968
968
|
var import_invariant5 = require("@dxos/invariant");
|
|
969
969
|
var import_services2 = require("@dxos/protocols/proto/dxos/client/services");
|
|
970
|
-
var __dxlog_file6 = "/
|
|
970
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/device-invitation-protocol.ts";
|
|
971
971
|
var DeviceInvitationProtocol = class {
|
|
972
972
|
constructor(_keyring, _getIdentity, _acceptIdentity) {
|
|
973
973
|
this._keyring = _keyring;
|
|
@@ -1059,7 +1059,6 @@ var import_async5 = require("@dxos/async");
|
|
|
1059
1059
|
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
1060
1060
|
var import_context4 = require("@dxos/context");
|
|
1061
1061
|
var import_credentials9 = require("@dxos/credentials");
|
|
1062
|
-
var import_errors2 = require("@dxos/errors");
|
|
1063
1062
|
var import_invariant7 = require("@dxos/invariant");
|
|
1064
1063
|
var import_keys4 = require("@dxos/keys");
|
|
1065
1064
|
var import_log6 = require("@dxos/log");
|
|
@@ -1071,7 +1070,6 @@ var import_invitations2 = require("@dxos/protocols/proto/dxos/halo/invitations")
|
|
|
1071
1070
|
// packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts
|
|
1072
1071
|
var import_async4 = require("@dxos/async");
|
|
1073
1072
|
var import_context3 = require("@dxos/context");
|
|
1074
|
-
var import_errors = require("@dxos/errors");
|
|
1075
1073
|
var import_invariant6 = require("@dxos/invariant");
|
|
1076
1074
|
var import_keys3 = require("@dxos/keys");
|
|
1077
1075
|
var import_log5 = require("@dxos/log");
|
|
@@ -1079,7 +1077,7 @@ var import_protocols4 = require("@dxos/protocols");
|
|
|
1079
1077
|
var import_services3 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1080
1078
|
var import_invitations = require("@dxos/protocols/proto/dxos/halo/invitations");
|
|
1081
1079
|
var import_teleport = require("@dxos/teleport");
|
|
1082
|
-
var __dxlog_file7 = "/
|
|
1080
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-extension.ts";
|
|
1083
1081
|
var OPTIONS_TIMEOUT = 1e4;
|
|
1084
1082
|
var MAX_OTP_ATTEMPTS = 3;
|
|
1085
1083
|
var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
@@ -1109,7 +1107,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1109
1107
|
options: async (options) => {
|
|
1110
1108
|
(0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1111
1109
|
F: __dxlog_file7,
|
|
1112
|
-
L:
|
|
1110
|
+
L: 87,
|
|
1113
1111
|
S: this,
|
|
1114
1112
|
A: [
|
|
1115
1113
|
"!this._remoteOptions",
|
|
@@ -1126,7 +1124,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1126
1124
|
id: traceId
|
|
1127
1125
|
}), {
|
|
1128
1126
|
F: __dxlog_file7,
|
|
1129
|
-
L:
|
|
1127
|
+
L: 96,
|
|
1130
1128
|
S: this,
|
|
1131
1129
|
C: (f, a) => f(...a)
|
|
1132
1130
|
});
|
|
@@ -1136,7 +1134,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1136
1134
|
invitationId
|
|
1137
1135
|
}, {
|
|
1138
1136
|
F: __dxlog_file7,
|
|
1139
|
-
L:
|
|
1137
|
+
L: 100,
|
|
1140
1138
|
S: this,
|
|
1141
1139
|
C: (f, a) => f(...a)
|
|
1142
1140
|
});
|
|
@@ -1150,7 +1148,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1150
1148
|
guestProfile: profile
|
|
1151
1149
|
}, {
|
|
1152
1150
|
F: __dxlog_file7,
|
|
1153
|
-
L:
|
|
1151
|
+
L: 109,
|
|
1154
1152
|
S: this,
|
|
1155
1153
|
C: (f, a) => f(...a)
|
|
1156
1154
|
});
|
|
@@ -1163,7 +1161,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1163
1161
|
id: traceId
|
|
1164
1162
|
}), {
|
|
1165
1163
|
F: __dxlog_file7,
|
|
1166
|
-
L:
|
|
1164
|
+
L: 116,
|
|
1167
1165
|
S: this,
|
|
1168
1166
|
C: (f, a) => f(...a)
|
|
1169
1167
|
});
|
|
@@ -1178,7 +1176,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1178
1176
|
id: traceId
|
|
1179
1177
|
}), {
|
|
1180
1178
|
F: __dxlog_file7,
|
|
1181
|
-
L:
|
|
1179
|
+
L: 125,
|
|
1182
1180
|
S: this,
|
|
1183
1181
|
C: (f, a) => f(...a)
|
|
1184
1182
|
});
|
|
@@ -1186,14 +1184,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1186
1184
|
authCode: code
|
|
1187
1185
|
}, {
|
|
1188
1186
|
F: __dxlog_file7,
|
|
1189
|
-
L:
|
|
1187
|
+
L: 126,
|
|
1190
1188
|
S: this,
|
|
1191
1189
|
C: (f, a) => f(...a)
|
|
1192
1190
|
});
|
|
1193
1191
|
let status = import_invitations.AuthenticationResponse.Status.OK;
|
|
1194
1192
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1195
1193
|
F: __dxlog_file7,
|
|
1196
|
-
L:
|
|
1194
|
+
L: 129,
|
|
1197
1195
|
S: this,
|
|
1198
1196
|
A: [
|
|
1199
1197
|
"this.invitation",
|
|
@@ -1204,7 +1202,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1204
1202
|
case import_services3.Invitation.AuthMethod.NONE: {
|
|
1205
1203
|
(0, import_log5.log)("authentication not required", void 0, {
|
|
1206
1204
|
F: __dxlog_file7,
|
|
1207
|
-
L:
|
|
1205
|
+
L: 132,
|
|
1208
1206
|
S: this,
|
|
1209
1207
|
C: (f, a) => f(...a)
|
|
1210
1208
|
});
|
|
@@ -1229,7 +1227,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1229
1227
|
authMethod: this.invitation.authMethod
|
|
1230
1228
|
}, {
|
|
1231
1229
|
F: __dxlog_file7,
|
|
1232
|
-
L:
|
|
1230
|
+
L: 150,
|
|
1233
1231
|
S: this,
|
|
1234
1232
|
C: (f, a) => f(...a)
|
|
1235
1233
|
});
|
|
@@ -1244,7 +1242,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1244
1242
|
}
|
|
1245
1243
|
}), {
|
|
1246
1244
|
F: __dxlog_file7,
|
|
1247
|
-
L:
|
|
1245
|
+
L: 156,
|
|
1248
1246
|
S: this,
|
|
1249
1247
|
C: (f, a) => f(...a)
|
|
1250
1248
|
});
|
|
@@ -1258,14 +1256,14 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1258
1256
|
id: traceId
|
|
1259
1257
|
}), {
|
|
1260
1258
|
F: __dxlog_file7,
|
|
1261
|
-
L:
|
|
1259
|
+
L: 162,
|
|
1262
1260
|
S: this,
|
|
1263
1261
|
C: (f, a) => f(...a)
|
|
1264
1262
|
});
|
|
1265
1263
|
try {
|
|
1266
1264
|
(0, import_invariant6.invariant)(this.invitation, "Invitation is not set.", {
|
|
1267
1265
|
F: __dxlog_file7,
|
|
1268
|
-
L:
|
|
1266
|
+
L: 165,
|
|
1269
1267
|
S: this,
|
|
1270
1268
|
A: [
|
|
1271
1269
|
"this.invitation",
|
|
@@ -1280,7 +1278,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1280
1278
|
id: traceId
|
|
1281
1279
|
}), {
|
|
1282
1280
|
F: __dxlog_file7,
|
|
1283
|
-
L:
|
|
1281
|
+
L: 173,
|
|
1284
1282
|
S: this,
|
|
1285
1283
|
C: (f, a) => f(...a)
|
|
1286
1284
|
});
|
|
@@ -1303,7 +1301,7 @@ var InvitationHostExtension = class extends import_teleport.RpcExtension {
|
|
|
1303
1301
|
timeout: OPTIONS_TIMEOUT
|
|
1304
1302
|
}));
|
|
1305
1303
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.GUEST) {
|
|
1306
|
-
throw new
|
|
1304
|
+
throw new import_protocols4.InvalidInvitationExtensionRoleError(void 0, {
|
|
1307
1305
|
expected: import_invitations.Options.Role.GUEST,
|
|
1308
1306
|
remoteOptions: this._remoteOptions
|
|
1309
1307
|
});
|
|
@@ -1337,7 +1335,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1337
1335
|
options: async (options) => {
|
|
1338
1336
|
(0, import_invariant6.invariant)(!this._remoteOptions, "Remote options already set.", {
|
|
1339
1337
|
F: __dxlog_file7,
|
|
1340
|
-
L:
|
|
1338
|
+
L: 240,
|
|
1341
1339
|
S: this,
|
|
1342
1340
|
A: [
|
|
1343
1341
|
"!this._remoteOptions",
|
|
@@ -1364,7 +1362,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1364
1362
|
try {
|
|
1365
1363
|
(0, import_log5.log)("begin options", void 0, {
|
|
1366
1364
|
F: __dxlog_file7,
|
|
1367
|
-
L:
|
|
1365
|
+
L: 261,
|
|
1368
1366
|
S: this,
|
|
1369
1367
|
C: (f, a) => f(...a)
|
|
1370
1368
|
});
|
|
@@ -1376,12 +1374,12 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1376
1374
|
}));
|
|
1377
1375
|
(0, import_log5.log)("end options", void 0, {
|
|
1378
1376
|
F: __dxlog_file7,
|
|
1379
|
-
L:
|
|
1377
|
+
L: 264,
|
|
1380
1378
|
S: this,
|
|
1381
1379
|
C: (f, a) => f(...a)
|
|
1382
1380
|
});
|
|
1383
1381
|
if (this._remoteOptions?.role !== import_invitations.Options.Role.HOST) {
|
|
1384
|
-
throw new
|
|
1382
|
+
throw new import_protocols4.InvalidInvitationExtensionRoleError(void 0, {
|
|
1385
1383
|
expected: import_invitations.Options.Role.HOST,
|
|
1386
1384
|
remoteOptions: this._remoteOptions
|
|
1387
1385
|
});
|
|
@@ -1390,7 +1388,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1390
1388
|
} catch (err) {
|
|
1391
1389
|
(0, import_log5.log)("openError", err, {
|
|
1392
1390
|
F: __dxlog_file7,
|
|
1393
|
-
L:
|
|
1391
|
+
L: 274,
|
|
1394
1392
|
S: this,
|
|
1395
1393
|
C: (f, a) => f(...a)
|
|
1396
1394
|
});
|
|
@@ -1400,7 +1398,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1400
1398
|
async onClose() {
|
|
1401
1399
|
(0, import_log5.log)("onClose", void 0, {
|
|
1402
1400
|
F: __dxlog_file7,
|
|
1403
|
-
L:
|
|
1401
|
+
L: 280,
|
|
1404
1402
|
S: this,
|
|
1405
1403
|
C: (f, a) => f(...a)
|
|
1406
1404
|
});
|
|
@@ -1410,7 +1408,7 @@ var InvitationGuestExtension = class extends import_teleport.RpcExtension {
|
|
|
1410
1408
|
var isAuthenticationRequired = (invitation) => invitation.authMethod !== import_services3.Invitation.AuthMethod.NONE;
|
|
1411
1409
|
|
|
1412
1410
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
1413
|
-
var __dxlog_file8 = "/
|
|
1411
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts";
|
|
1414
1412
|
var InvitationsHandler = class {
|
|
1415
1413
|
/**
|
|
1416
1414
|
* @internal
|
|
@@ -1423,7 +1421,7 @@ var InvitationsHandler = class {
|
|
|
1423
1421
|
const authCode = options?.authCode ?? (authMethod === import_services4.Invitation.AuthMethod.SHARED_SECRET ? (0, import_credentials9.generatePasscode)(import_client_protocol2.AUTHENTICATION_CODE_LENGTH) : void 0);
|
|
1424
1422
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1425
1423
|
F: __dxlog_file8,
|
|
1426
|
-
L:
|
|
1424
|
+
L: 75,
|
|
1427
1425
|
S: this,
|
|
1428
1426
|
A: [
|
|
1429
1427
|
"protocol",
|
|
@@ -1452,7 +1450,7 @@ var InvitationsHandler = class {
|
|
|
1452
1450
|
...protocol.toJSON()
|
|
1453
1451
|
}, {
|
|
1454
1452
|
F: __dxlog_file8,
|
|
1455
|
-
L:
|
|
1453
|
+
L: 97,
|
|
1456
1454
|
S: this,
|
|
1457
1455
|
C: (f, a) => f(...a)
|
|
1458
1456
|
});
|
|
@@ -1477,7 +1475,7 @@ var InvitationsHandler = class {
|
|
|
1477
1475
|
const deviceKey = admissionRequest.device?.deviceKey ?? admissionRequest.space?.deviceKey;
|
|
1478
1476
|
(0, import_invariant7.invariant)(deviceKey, void 0, {
|
|
1479
1477
|
F: __dxlog_file8,
|
|
1480
|
-
L:
|
|
1478
|
+
L: 118,
|
|
1481
1479
|
S: this,
|
|
1482
1480
|
A: [
|
|
1483
1481
|
"deviceKey",
|
|
@@ -1500,7 +1498,7 @@ var InvitationsHandler = class {
|
|
|
1500
1498
|
id: traceId
|
|
1501
1499
|
}), {
|
|
1502
1500
|
F: __dxlog_file8,
|
|
1503
|
-
L:
|
|
1501
|
+
L: 136,
|
|
1504
1502
|
S: this,
|
|
1505
1503
|
C: (f, a) => f(...a)
|
|
1506
1504
|
});
|
|
@@ -1508,7 +1506,7 @@ var InvitationsHandler = class {
|
|
|
1508
1506
|
...protocol.toJSON()
|
|
1509
1507
|
}, {
|
|
1510
1508
|
F: __dxlog_file8,
|
|
1511
|
-
L:
|
|
1509
|
+
L: 137,
|
|
1512
1510
|
S: this,
|
|
1513
1511
|
C: (f, a) => f(...a)
|
|
1514
1512
|
});
|
|
@@ -1524,7 +1522,7 @@ var InvitationsHandler = class {
|
|
|
1524
1522
|
...protocol.toJSON()
|
|
1525
1523
|
}, {
|
|
1526
1524
|
F: __dxlog_file8,
|
|
1527
|
-
L:
|
|
1525
|
+
L: 140,
|
|
1528
1526
|
S: this,
|
|
1529
1527
|
C: (f, a) => f(...a)
|
|
1530
1528
|
});
|
|
@@ -1536,7 +1534,7 @@ var InvitationsHandler = class {
|
|
|
1536
1534
|
id: traceId
|
|
1537
1535
|
}), {
|
|
1538
1536
|
F: __dxlog_file8,
|
|
1539
|
-
L:
|
|
1537
|
+
L: 142,
|
|
1540
1538
|
S: this,
|
|
1541
1539
|
C: (f, a) => f(...a)
|
|
1542
1540
|
});
|
|
@@ -1546,7 +1544,7 @@ var InvitationsHandler = class {
|
|
|
1546
1544
|
...protocol.toJSON()
|
|
1547
1545
|
}, {
|
|
1548
1546
|
F: __dxlog_file8,
|
|
1549
|
-
L:
|
|
1547
|
+
L: 145,
|
|
1550
1548
|
S: this,
|
|
1551
1549
|
C: (f, a) => f(...a)
|
|
1552
1550
|
});
|
|
@@ -1557,7 +1555,7 @@ var InvitationsHandler = class {
|
|
|
1557
1555
|
} else {
|
|
1558
1556
|
import_log6.log.error("failed", err, {
|
|
1559
1557
|
F: __dxlog_file8,
|
|
1560
|
-
L:
|
|
1558
|
+
L: 148,
|
|
1561
1559
|
S: this,
|
|
1562
1560
|
C: (f, a) => f(...a)
|
|
1563
1561
|
});
|
|
@@ -1568,7 +1566,7 @@ var InvitationsHandler = class {
|
|
|
1568
1566
|
error: err
|
|
1569
1567
|
}), {
|
|
1570
1568
|
F: __dxlog_file8,
|
|
1571
|
-
L:
|
|
1569
|
+
L: 151,
|
|
1572
1570
|
S: this,
|
|
1573
1571
|
C: (f, a) => f(...a)
|
|
1574
1572
|
});
|
|
@@ -1581,7 +1579,7 @@ var InvitationsHandler = class {
|
|
|
1581
1579
|
});
|
|
1582
1580
|
},
|
|
1583
1581
|
onError: (err) => {
|
|
1584
|
-
if (err instanceof
|
|
1582
|
+
if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
|
|
1585
1583
|
return;
|
|
1586
1584
|
}
|
|
1587
1585
|
if (err instanceof import_async5.TimeoutError) {
|
|
@@ -1589,7 +1587,7 @@ var InvitationsHandler = class {
|
|
|
1589
1587
|
...protocol.toJSON()
|
|
1590
1588
|
}, {
|
|
1591
1589
|
F: __dxlog_file8,
|
|
1592
|
-
L:
|
|
1590
|
+
L: 166,
|
|
1593
1591
|
S: this,
|
|
1594
1592
|
C: (f, a) => f(...a)
|
|
1595
1593
|
});
|
|
@@ -1600,7 +1598,7 @@ var InvitationsHandler = class {
|
|
|
1600
1598
|
} else {
|
|
1601
1599
|
import_log6.log.error("failed", err, {
|
|
1602
1600
|
F: __dxlog_file8,
|
|
1603
|
-
L:
|
|
1601
|
+
L: 169,
|
|
1604
1602
|
S: this,
|
|
1605
1603
|
C: (f, a) => f(...a)
|
|
1606
1604
|
});
|
|
@@ -1628,7 +1626,7 @@ var InvitationsHandler = class {
|
|
|
1628
1626
|
state: import_services4.Invitation.State.CONNECTING
|
|
1629
1627
|
});
|
|
1630
1628
|
});
|
|
1631
|
-
const observable = new import_client_protocol2.
|
|
1629
|
+
const observable = new import_client_protocol2.CancellableInvitation({
|
|
1632
1630
|
initialInvitation: invitation,
|
|
1633
1631
|
subscriber: stream.observable,
|
|
1634
1632
|
onCancel: async () => {
|
|
@@ -1645,7 +1643,7 @@ var InvitationsHandler = class {
|
|
|
1645
1643
|
const { timeout = import_client_protocol2.INVITATION_TIMEOUT } = invitation;
|
|
1646
1644
|
(0, import_invariant7.invariant)(protocol, void 0, {
|
|
1647
1645
|
F: __dxlog_file8,
|
|
1648
|
-
L:
|
|
1646
|
+
L: 210,
|
|
1649
1647
|
S: this,
|
|
1650
1648
|
A: [
|
|
1651
1649
|
"protocol",
|
|
@@ -1659,7 +1657,7 @@ var InvitationsHandler = class {
|
|
|
1659
1657
|
const setState = (newData) => {
|
|
1660
1658
|
(0, import_invariant7.invariant)(newData.state !== void 0, void 0, {
|
|
1661
1659
|
F: __dxlog_file8,
|
|
1662
|
-
L:
|
|
1660
|
+
L: 221,
|
|
1663
1661
|
S: this,
|
|
1664
1662
|
A: [
|
|
1665
1663
|
"newData.state !== undefined",
|
|
@@ -1679,7 +1677,7 @@ var InvitationsHandler = class {
|
|
|
1679
1677
|
...protocol.toJSON()
|
|
1680
1678
|
}, {
|
|
1681
1679
|
F: __dxlog_file8,
|
|
1682
|
-
L:
|
|
1680
|
+
L: 229,
|
|
1683
1681
|
S: this,
|
|
1684
1682
|
C: (f, a) => f(...a)
|
|
1685
1683
|
});
|
|
@@ -1689,7 +1687,7 @@ var InvitationsHandler = class {
|
|
|
1689
1687
|
} else {
|
|
1690
1688
|
import_log6.log.warn("auth failed", err, {
|
|
1691
1689
|
F: __dxlog_file8,
|
|
1692
|
-
L:
|
|
1690
|
+
L: 232,
|
|
1693
1691
|
S: this,
|
|
1694
1692
|
C: (f, a) => f(...a)
|
|
1695
1693
|
});
|
|
@@ -1703,7 +1701,7 @@ var InvitationsHandler = class {
|
|
|
1703
1701
|
...protocol.toJSON()
|
|
1704
1702
|
}, {
|
|
1705
1703
|
F: __dxlog_file8,
|
|
1706
|
-
L:
|
|
1704
|
+
L: 240,
|
|
1707
1705
|
S: this,
|
|
1708
1706
|
C: (f, a) => f(...a)
|
|
1709
1707
|
});
|
|
@@ -1718,7 +1716,7 @@ var InvitationsHandler = class {
|
|
|
1718
1716
|
currentState
|
|
1719
1717
|
}, {
|
|
1720
1718
|
F: __dxlog_file8,
|
|
1721
|
-
L:
|
|
1719
|
+
L: 250,
|
|
1722
1720
|
S: this,
|
|
1723
1721
|
C: (f, a) => f(...a)
|
|
1724
1722
|
});
|
|
@@ -1733,7 +1731,7 @@ var InvitationsHandler = class {
|
|
|
1733
1731
|
id: traceId
|
|
1734
1732
|
}), {
|
|
1735
1733
|
F: __dxlog_file8,
|
|
1736
|
-
L:
|
|
1734
|
+
L: 259,
|
|
1737
1735
|
S: this,
|
|
1738
1736
|
C: (f, a) => f(...a)
|
|
1739
1737
|
});
|
|
@@ -1745,7 +1743,7 @@ var InvitationsHandler = class {
|
|
|
1745
1743
|
...protocol.toJSON()
|
|
1746
1744
|
}, {
|
|
1747
1745
|
F: __dxlog_file8,
|
|
1748
|
-
L:
|
|
1746
|
+
L: 267,
|
|
1749
1747
|
S: this,
|
|
1750
1748
|
C: (f, a) => f(...a)
|
|
1751
1749
|
});
|
|
@@ -1756,7 +1754,7 @@ var InvitationsHandler = class {
|
|
|
1756
1754
|
...protocol.toJSON()
|
|
1757
1755
|
}, {
|
|
1758
1756
|
F: __dxlog_file8,
|
|
1759
|
-
L:
|
|
1757
|
+
L: 271,
|
|
1760
1758
|
S: this,
|
|
1761
1759
|
C: (f, a) => f(...a)
|
|
1762
1760
|
});
|
|
@@ -1766,7 +1764,7 @@ var InvitationsHandler = class {
|
|
|
1766
1764
|
response: introductionResponse
|
|
1767
1765
|
}, {
|
|
1768
1766
|
F: __dxlog_file8,
|
|
1769
|
-
L:
|
|
1767
|
+
L: 275,
|
|
1770
1768
|
S: this,
|
|
1771
1769
|
C: (f, a) => f(...a)
|
|
1772
1770
|
});
|
|
@@ -1778,7 +1776,7 @@ var InvitationsHandler = class {
|
|
|
1778
1776
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1779
1777
|
(0, import_log6.log)("guest waiting for authentication code...", void 0, {
|
|
1780
1778
|
F: __dxlog_file8,
|
|
1781
|
-
L:
|
|
1779
|
+
L: 284,
|
|
1782
1780
|
S: this,
|
|
1783
1781
|
C: (f, a) => f(...a)
|
|
1784
1782
|
});
|
|
@@ -1790,7 +1788,7 @@ var InvitationsHandler = class {
|
|
|
1790
1788
|
});
|
|
1791
1789
|
(0, import_log6.log)("sending authentication request", void 0, {
|
|
1792
1790
|
F: __dxlog_file8,
|
|
1793
|
-
L:
|
|
1791
|
+
L: 288,
|
|
1794
1792
|
S: this,
|
|
1795
1793
|
C: (f, a) => f(...a)
|
|
1796
1794
|
});
|
|
@@ -1811,7 +1809,7 @@ var InvitationsHandler = class {
|
|
|
1811
1809
|
attempt
|
|
1812
1810
|
}, {
|
|
1813
1811
|
F: __dxlog_file8,
|
|
1814
|
-
L:
|
|
1812
|
+
L: 299,
|
|
1815
1813
|
S: this,
|
|
1816
1814
|
C: (f, a) => f(...a)
|
|
1817
1815
|
});
|
|
@@ -1828,7 +1826,7 @@ var InvitationsHandler = class {
|
|
|
1828
1826
|
...protocol.toJSON()
|
|
1829
1827
|
}, {
|
|
1830
1828
|
F: __dxlog_file8,
|
|
1831
|
-
L:
|
|
1829
|
+
L: 310,
|
|
1832
1830
|
S: this,
|
|
1833
1831
|
C: (f, a) => f(...a)
|
|
1834
1832
|
});
|
|
@@ -1840,7 +1838,7 @@ var InvitationsHandler = class {
|
|
|
1840
1838
|
...protocol.toJSON()
|
|
1841
1839
|
}, {
|
|
1842
1840
|
F: __dxlog_file8,
|
|
1843
|
-
L:
|
|
1841
|
+
L: 321,
|
|
1844
1842
|
S: this,
|
|
1845
1843
|
C: (f, a) => f(...a)
|
|
1846
1844
|
});
|
|
@@ -1852,7 +1850,7 @@ var InvitationsHandler = class {
|
|
|
1852
1850
|
id: traceId
|
|
1853
1851
|
}), {
|
|
1854
1852
|
F: __dxlog_file8,
|
|
1855
|
-
L:
|
|
1853
|
+
L: 323,
|
|
1856
1854
|
S: this,
|
|
1857
1855
|
C: (f, a) => f(...a)
|
|
1858
1856
|
});
|
|
@@ -1862,7 +1860,7 @@ var InvitationsHandler = class {
|
|
|
1862
1860
|
...protocol.toJSON()
|
|
1863
1861
|
}, {
|
|
1864
1862
|
F: __dxlog_file8,
|
|
1865
|
-
L:
|
|
1863
|
+
L: 326,
|
|
1866
1864
|
S: this,
|
|
1867
1865
|
C: (f, a) => f(...a)
|
|
1868
1866
|
});
|
|
@@ -1872,7 +1870,7 @@ var InvitationsHandler = class {
|
|
|
1872
1870
|
} else {
|
|
1873
1871
|
(0, import_log6.log)("auth failed", err, {
|
|
1874
1872
|
F: __dxlog_file8,
|
|
1875
|
-
L:
|
|
1873
|
+
L: 329,
|
|
1876
1874
|
S: this,
|
|
1877
1875
|
C: (f, a) => f(...a)
|
|
1878
1876
|
});
|
|
@@ -1883,7 +1881,7 @@ var InvitationsHandler = class {
|
|
|
1883
1881
|
error: err
|
|
1884
1882
|
}), {
|
|
1885
1883
|
F: __dxlog_file8,
|
|
1886
|
-
L:
|
|
1884
|
+
L: 332,
|
|
1887
1885
|
S: this,
|
|
1888
1886
|
C: (f, a) => f(...a)
|
|
1889
1887
|
});
|
|
@@ -1893,7 +1891,7 @@ var InvitationsHandler = class {
|
|
|
1893
1891
|
});
|
|
1894
1892
|
},
|
|
1895
1893
|
onError: (err) => {
|
|
1896
|
-
if (err instanceof
|
|
1894
|
+
if (err instanceof import_protocols5.InvalidInvitationExtensionRoleError) {
|
|
1897
1895
|
return;
|
|
1898
1896
|
}
|
|
1899
1897
|
if (err instanceof import_async5.TimeoutError) {
|
|
@@ -1901,7 +1899,7 @@ var InvitationsHandler = class {
|
|
|
1901
1899
|
...protocol.toJSON()
|
|
1902
1900
|
}, {
|
|
1903
1901
|
F: __dxlog_file8,
|
|
1904
|
-
L:
|
|
1902
|
+
L: 343,
|
|
1905
1903
|
S: this,
|
|
1906
1904
|
C: (f, a) => f(...a)
|
|
1907
1905
|
});
|
|
@@ -1911,7 +1909,7 @@ var InvitationsHandler = class {
|
|
|
1911
1909
|
} else {
|
|
1912
1910
|
(0, import_log6.log)("auth failed", err, {
|
|
1913
1911
|
F: __dxlog_file8,
|
|
1914
|
-
L:
|
|
1912
|
+
L: 346,
|
|
1915
1913
|
S: this,
|
|
1916
1914
|
C: (f, a) => f(...a)
|
|
1917
1915
|
});
|
|
@@ -1924,7 +1922,7 @@ var InvitationsHandler = class {
|
|
|
1924
1922
|
(0, import_async5.scheduleTask)(ctx, async () => {
|
|
1925
1923
|
(0, import_invariant7.invariant)(invitation.swarmKey, void 0, {
|
|
1926
1924
|
F: __dxlog_file8,
|
|
1927
|
-
L:
|
|
1925
|
+
L: 356,
|
|
1928
1926
|
S: this,
|
|
1929
1927
|
A: [
|
|
1930
1928
|
"invitation.swarmKey",
|
|
@@ -1946,7 +1944,7 @@ var InvitationsHandler = class {
|
|
|
1946
1944
|
state: import_services4.Invitation.State.CONNECTING
|
|
1947
1945
|
});
|
|
1948
1946
|
});
|
|
1949
|
-
const observable = new import_client_protocol2.
|
|
1947
|
+
const observable = new import_client_protocol2.AuthenticatingInvitation({
|
|
1950
1948
|
initialInvitation: invitation,
|
|
1951
1949
|
subscriber: stream.observable,
|
|
1952
1950
|
onCancel: async () => {
|
|
@@ -1969,7 +1967,7 @@ var import_codec_protobuf4 = require("@dxos/codec-protobuf");
|
|
|
1969
1967
|
var import_invariant8 = require("@dxos/invariant");
|
|
1970
1968
|
var import_log7 = require("@dxos/log");
|
|
1971
1969
|
var import_services5 = require("@dxos/protocols/proto/dxos/client/services");
|
|
1972
|
-
var __dxlog_file9 = "/
|
|
1970
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-service.ts";
|
|
1973
1971
|
var InvitationsServiceImpl = class {
|
|
1974
1972
|
constructor(_invitationsHandler, _getHandler) {
|
|
1975
1973
|
this._invitationsHandler = _invitationsHandler;
|
|
@@ -2004,6 +2002,9 @@ var InvitationsServiceImpl = class {
|
|
|
2004
2002
|
}, () => {
|
|
2005
2003
|
close();
|
|
2006
2004
|
this._createInvitations.delete(invitation.get().invitationId);
|
|
2005
|
+
if (invitation.get().type !== import_services5.Invitation.Type.MULTIUSE) {
|
|
2006
|
+
this._removedCreated.emit(invitation.get());
|
|
2007
|
+
}
|
|
2007
2008
|
});
|
|
2008
2009
|
});
|
|
2009
2010
|
}
|
|
@@ -2026,19 +2027,22 @@ var InvitationsServiceImpl = class {
|
|
|
2026
2027
|
}, () => {
|
|
2027
2028
|
close();
|
|
2028
2029
|
this._acceptInvitations.delete(invitation.get().invitationId);
|
|
2030
|
+
if (invitation.get().type !== import_services5.Invitation.Type.MULTIUSE) {
|
|
2031
|
+
this._removedAccepted.emit(invitation.get());
|
|
2032
|
+
}
|
|
2029
2033
|
});
|
|
2030
2034
|
});
|
|
2031
2035
|
}
|
|
2032
2036
|
async authenticate({ invitationId, authCode }) {
|
|
2033
2037
|
(0, import_log7.log)("authenticating...", void 0, {
|
|
2034
2038
|
F: __dxlog_file9,
|
|
2035
|
-
L:
|
|
2039
|
+
L: 108,
|
|
2036
2040
|
S: this,
|
|
2037
2041
|
C: (f, a) => f(...a)
|
|
2038
2042
|
});
|
|
2039
2043
|
(0, import_invariant8.invariant)(invitationId, void 0, {
|
|
2040
2044
|
F: __dxlog_file9,
|
|
2041
|
-
L:
|
|
2045
|
+
L: 109,
|
|
2042
2046
|
S: this,
|
|
2043
2047
|
A: [
|
|
2044
2048
|
"invitationId",
|
|
@@ -2051,7 +2055,7 @@ var InvitationsServiceImpl = class {
|
|
|
2051
2055
|
invitationId
|
|
2052
2056
|
}, {
|
|
2053
2057
|
F: __dxlog_file9,
|
|
2054
|
-
L:
|
|
2058
|
+
L: 112,
|
|
2055
2059
|
S: this,
|
|
2056
2060
|
C: (f, a) => f(...a)
|
|
2057
2061
|
});
|
|
@@ -2062,13 +2066,13 @@ var InvitationsServiceImpl = class {
|
|
|
2062
2066
|
async cancelInvitation({ invitationId }) {
|
|
2063
2067
|
(0, import_log7.log)("deleting...", void 0, {
|
|
2064
2068
|
F: __dxlog_file9,
|
|
2065
|
-
L:
|
|
2069
|
+
L: 119,
|
|
2066
2070
|
S: this,
|
|
2067
2071
|
C: (f, a) => f(...a)
|
|
2068
2072
|
});
|
|
2069
2073
|
(0, import_invariant8.invariant)(invitationId, void 0, {
|
|
2070
2074
|
F: __dxlog_file9,
|
|
2071
|
-
L:
|
|
2075
|
+
L: 120,
|
|
2072
2076
|
S: this,
|
|
2073
2077
|
A: [
|
|
2074
2078
|
"invitationId",
|
|
@@ -2090,7 +2094,7 @@ var InvitationsServiceImpl = class {
|
|
|
2090
2094
|
invitationId
|
|
2091
2095
|
}, {
|
|
2092
2096
|
F: __dxlog_file9,
|
|
2093
|
-
L:
|
|
2097
|
+
L: 132,
|
|
2094
2098
|
S: this,
|
|
2095
2099
|
C: (f, a) => f(...a)
|
|
2096
2100
|
});
|
|
@@ -2154,7 +2158,7 @@ var import_feed_store2 = require("@dxos/feed-store");
|
|
|
2154
2158
|
var import_invariant9 = require("@dxos/invariant");
|
|
2155
2159
|
var import_log8 = require("@dxos/log");
|
|
2156
2160
|
var import_services6 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2157
|
-
var __dxlog_file10 = "/
|
|
2161
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/space-invitation-protocol.ts";
|
|
2158
2162
|
var SpaceInvitationProtocol = class {
|
|
2159
2163
|
constructor(_spaceManager, _signingContext, _keyring, _spaceKey) {
|
|
2160
2164
|
this._spaceManager = _spaceManager;
|
|
@@ -2309,7 +2313,7 @@ var import_credentials14 = require("@dxos/credentials");
|
|
|
2309
2313
|
var import_invariant11 = require("@dxos/invariant");
|
|
2310
2314
|
var import_keys7 = require("@dxos/keys");
|
|
2311
2315
|
var import_log11 = require("@dxos/log");
|
|
2312
|
-
var
|
|
2316
|
+
var import_protocols8 = require("@dxos/protocols");
|
|
2313
2317
|
var import_services8 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2314
2318
|
var import_teleport_extension_gossip = require("@dxos/teleport-extension-gossip");
|
|
2315
2319
|
var import_util4 = require("@dxos/util");
|
|
@@ -2320,9 +2324,9 @@ var import_client_protocol3 = require("@dxos/client-protocol");
|
|
|
2320
2324
|
var import_context6 = require("@dxos/context");
|
|
2321
2325
|
var import_debug4 = require("@dxos/debug");
|
|
2322
2326
|
var import_echo_pipeline = require("@dxos/echo-pipeline");
|
|
2323
|
-
var import_errors3 = require("@dxos/errors");
|
|
2324
2327
|
var import_keys6 = require("@dxos/keys");
|
|
2325
2328
|
var import_log10 = require("@dxos/log");
|
|
2329
|
+
var import_protocols7 = require("@dxos/protocols");
|
|
2326
2330
|
var import_services7 = require("@dxos/protocols/proto/dxos/client/services");
|
|
2327
2331
|
var import_credentials11 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
2328
2332
|
var import_timeframe2 = require("@dxos/timeframe");
|
|
@@ -2338,7 +2342,7 @@ var import_log9 = require("@dxos/log");
|
|
|
2338
2342
|
var import_protocols6 = require("@dxos/protocols");
|
|
2339
2343
|
var import_teleport2 = require("@dxos/teleport");
|
|
2340
2344
|
var import_util2 = require("@dxos/util");
|
|
2341
|
-
var __dxlog_file11 = "/
|
|
2345
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts";
|
|
2342
2346
|
var DEFAULT_RETRY_TIMEOUT = 1e3;
|
|
2343
2347
|
var DEFAULT_SUCCESS_DELAY = 1e3;
|
|
2344
2348
|
var DEFAULT_NOTARIZE_TIMEOUT = 1e4;
|
|
@@ -2608,7 +2612,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
2608
2612
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2609
2613
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2610
2614
|
}
|
|
2611
|
-
var __dxlog_file12 = "/
|
|
2615
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space.ts";
|
|
2612
2616
|
var ENABLE_FEED_PURGE = false;
|
|
2613
2617
|
var DataSpace = class DataSpace2 {
|
|
2614
2618
|
constructor(params) {
|
|
@@ -2631,7 +2635,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2631
2635
|
this._signingContext = params.signingContext;
|
|
2632
2636
|
this._callbacks = params.callbacks ?? {};
|
|
2633
2637
|
this.authVerifier = new TrustedKeySetAuthVerifier({
|
|
2634
|
-
trustedKeysProvider: () => new import_util3.ComplexSet(import_keys6.PublicKey.hash, Array.from(this._inner.spaceState.members.
|
|
2638
|
+
trustedKeysProvider: () => new import_util3.ComplexSet(import_keys6.PublicKey.hash, Array.from(this._inner.spaceState.members.values()).filter((member) => !member.removed).map((member) => member.key)),
|
|
2635
2639
|
update: this._inner.stateUpdate,
|
|
2636
2640
|
authTimeout: import_client_protocol3.AUTH_TIMEOUT
|
|
2637
2641
|
});
|
|
@@ -2641,7 +2645,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2641
2645
|
state: import_services7.SpaceState[this._state]
|
|
2642
2646
|
}, {
|
|
2643
2647
|
F: __dxlog_file12,
|
|
2644
|
-
L:
|
|
2648
|
+
L: 118,
|
|
2645
2649
|
S: this,
|
|
2646
2650
|
C: (f, a) => f(...a)
|
|
2647
2651
|
});
|
|
@@ -2675,6 +2679,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2675
2679
|
await this._open();
|
|
2676
2680
|
}
|
|
2677
2681
|
async _open() {
|
|
2682
|
+
await this._gossip.open();
|
|
2678
2683
|
await this._notarizationPlugin.open();
|
|
2679
2684
|
await this._inner.spaceState.addCredentialProcessor(this._notarizationPlugin);
|
|
2680
2685
|
await this._inner.open(new import_context6.Context());
|
|
@@ -2683,7 +2688,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2683
2688
|
state: import_services7.SpaceState[this._state]
|
|
2684
2689
|
}, {
|
|
2685
2690
|
F: __dxlog_file12,
|
|
2686
|
-
L:
|
|
2691
|
+
L: 165,
|
|
2687
2692
|
S: this,
|
|
2688
2693
|
C: (f, a) => f(...a)
|
|
2689
2694
|
});
|
|
@@ -2701,7 +2706,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2701
2706
|
state: import_services7.SpaceState[this._state]
|
|
2702
2707
|
}, {
|
|
2703
2708
|
F: __dxlog_file12,
|
|
2704
|
-
L:
|
|
2709
|
+
L: 179,
|
|
2705
2710
|
S: this,
|
|
2706
2711
|
C: (f, a) => f(...a)
|
|
2707
2712
|
});
|
|
@@ -2712,6 +2717,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2712
2717
|
await this._inner.spaceState.removeCredentialProcessor(this._notarizationPlugin);
|
|
2713
2718
|
await this._notarizationPlugin.close();
|
|
2714
2719
|
await this._presence.destroy();
|
|
2720
|
+
await this._gossip.close();
|
|
2715
2721
|
}
|
|
2716
2722
|
async postMessage(channel, message) {
|
|
2717
2723
|
return this._gossip.postMessage(channel, message);
|
|
@@ -2728,10 +2734,10 @@ var DataSpace = class DataSpace2 {
|
|
|
2728
2734
|
this.metrics.pipelineInitBegin = /* @__PURE__ */ new Date();
|
|
2729
2735
|
await this.initializeDataPipeline();
|
|
2730
2736
|
} catch (err) {
|
|
2731
|
-
if (err instanceof
|
|
2737
|
+
if (err instanceof import_protocols7.CancelledError) {
|
|
2732
2738
|
(0, import_log10.log)("data pipeline initialization cancelled", err, {
|
|
2733
2739
|
F: __dxlog_file12,
|
|
2734
|
-
L:
|
|
2740
|
+
L: 211,
|
|
2735
2741
|
S: this,
|
|
2736
2742
|
C: (f, a) => f(...a)
|
|
2737
2743
|
});
|
|
@@ -2739,7 +2745,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2739
2745
|
}
|
|
2740
2746
|
import_log10.log.error("Error initializing data pipeline", err, {
|
|
2741
2747
|
F: __dxlog_file12,
|
|
2742
|
-
L:
|
|
2748
|
+
L: 215,
|
|
2743
2749
|
S: this,
|
|
2744
2750
|
C: (f, a) => f(...a)
|
|
2745
2751
|
});
|
|
@@ -2748,7 +2754,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2748
2754
|
state: import_services7.SpaceState[this._state]
|
|
2749
2755
|
}, {
|
|
2750
2756
|
F: __dxlog_file12,
|
|
2751
|
-
L:
|
|
2757
|
+
L: 217,
|
|
2752
2758
|
S: this,
|
|
2753
2759
|
C: (f, a) => f(...a)
|
|
2754
2760
|
});
|
|
@@ -2761,14 +2767,14 @@ var DataSpace = class DataSpace2 {
|
|
|
2761
2767
|
}
|
|
2762
2768
|
async initializeDataPipeline() {
|
|
2763
2769
|
if (this._state !== import_services7.SpaceState.CONTROL_ONLY) {
|
|
2764
|
-
throw new
|
|
2770
|
+
throw new import_protocols7.SystemError("Invalid operation");
|
|
2765
2771
|
}
|
|
2766
2772
|
this._state = import_services7.SpaceState.INITIALIZING;
|
|
2767
2773
|
(0, import_log10.log)("new state", {
|
|
2768
2774
|
state: import_services7.SpaceState[this._state]
|
|
2769
2775
|
}, {
|
|
2770
2776
|
F: __dxlog_file12,
|
|
2771
|
-
L:
|
|
2777
|
+
L: 233,
|
|
2772
2778
|
S: this,
|
|
2773
2779
|
C: (f, a) => f(...a)
|
|
2774
2780
|
});
|
|
@@ -2779,7 +2785,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2779
2785
|
await (0, import_context6.cancelWithContext)(this._ctx, this._inner.dataPipeline.ensureEpochInitialized());
|
|
2780
2786
|
(0, import_log10.log)("waiting for data pipeline to reach target timeframe", void 0, {
|
|
2781
2787
|
F: __dxlog_file12,
|
|
2782
|
-
L:
|
|
2788
|
+
L: 247,
|
|
2783
2789
|
S: this,
|
|
2784
2790
|
C: (f, a) => f(...a)
|
|
2785
2791
|
});
|
|
@@ -2790,7 +2796,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2790
2796
|
this.metrics.dataPipelineReady = /* @__PURE__ */ new Date();
|
|
2791
2797
|
(0, import_log10.log)("data pipeline ready", void 0, {
|
|
2792
2798
|
F: __dxlog_file12,
|
|
2793
|
-
L:
|
|
2799
|
+
L: 256,
|
|
2794
2800
|
S: this,
|
|
2795
2801
|
C: (f, a) => f(...a)
|
|
2796
2802
|
});
|
|
@@ -2800,7 +2806,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2800
2806
|
state: import_services7.SpaceState[this._state]
|
|
2801
2807
|
}, {
|
|
2802
2808
|
F: __dxlog_file12,
|
|
2803
|
-
L:
|
|
2809
|
+
L: 260,
|
|
2804
2810
|
S: this,
|
|
2805
2811
|
C: (f, a) => f(...a)
|
|
2806
2812
|
});
|
|
@@ -2816,7 +2822,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2816
2822
|
await this._createWritableFeeds();
|
|
2817
2823
|
(0, import_log10.log)("writable feeds created", void 0, {
|
|
2818
2824
|
F: __dxlog_file12,
|
|
2819
|
-
L:
|
|
2825
|
+
L: 276,
|
|
2820
2826
|
S: this,
|
|
2821
2827
|
C: (f, a) => f(...a)
|
|
2822
2828
|
});
|
|
@@ -2921,7 +2927,7 @@ var DataSpace = class DataSpace2 {
|
|
|
2921
2927
|
state: import_services7.SpaceState[this._state]
|
|
2922
2928
|
}, {
|
|
2923
2929
|
F: __dxlog_file12,
|
|
2924
|
-
L:
|
|
2930
|
+
L: 392,
|
|
2925
2931
|
S: this,
|
|
2926
2932
|
C: (f, a) => f(...a)
|
|
2927
2933
|
});
|
|
@@ -3037,7 +3043,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
3037
3043
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3038
3044
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3039
3045
|
}
|
|
3040
|
-
var __dxlog_file13 = "/
|
|
3046
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/data-space-manager.ts";
|
|
3041
3047
|
var DataSpaceManager = class DataSpaceManager2 {
|
|
3042
3048
|
constructor(_spaceManager, _metadataStore, _dataServiceSubscriptions, _keyring, _signingContext, _feedStore) {
|
|
3043
3049
|
this._spaceManager = _spaceManager;
|
|
@@ -3063,7 +3069,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3063
3069
|
S: this,
|
|
3064
3070
|
C: (f, a) => f(...a)
|
|
3065
3071
|
});
|
|
3066
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3072
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.begin({
|
|
3067
3073
|
id: this._instanceId
|
|
3068
3074
|
}), {
|
|
3069
3075
|
F: __dxlog_file13,
|
|
@@ -3109,7 +3115,7 @@ var DataSpaceManager = class DataSpaceManager2 {
|
|
|
3109
3115
|
space.initializeDataPipelineAsync();
|
|
3110
3116
|
}
|
|
3111
3117
|
}
|
|
3112
|
-
import_log11.log.trace("dxos.echo.data-space-manager.open",
|
|
3118
|
+
import_log11.log.trace("dxos.echo.data-space-manager.open", import_protocols8.trace.end({
|
|
3113
3119
|
id: this._instanceId
|
|
3114
3120
|
}), {
|
|
3115
3121
|
F: __dxlog_file13,
|
|
@@ -3363,12 +3369,11 @@ DataSpaceManager = _ts_decorate4([
|
|
|
3363
3369
|
var import_async10 = require("@dxos/async");
|
|
3364
3370
|
var import_codec_protobuf5 = require("@dxos/codec-protobuf");
|
|
3365
3371
|
var import_debug6 = require("@dxos/debug");
|
|
3366
|
-
var
|
|
3367
|
-
var import_errors4 = require("@dxos/errors");
|
|
3372
|
+
var import_invariant12 = require("@dxos/invariant");
|
|
3368
3373
|
var import_log12 = require("@dxos/log");
|
|
3369
|
-
var
|
|
3374
|
+
var import_protocols9 = require("@dxos/protocols");
|
|
3370
3375
|
var import_services9 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3371
|
-
var __dxlog_file14 = "/
|
|
3376
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/spaces-service.ts";
|
|
3372
3377
|
var SpacesServiceImpl = class {
|
|
3373
3378
|
constructor(_identityManager, _spaceManager, _dataServiceSubscriptions, _getDataSpaceManager) {
|
|
3374
3379
|
this._identityManager = _identityManager;
|
|
@@ -3386,7 +3391,7 @@ var SpacesServiceImpl = class {
|
|
|
3386
3391
|
}
|
|
3387
3392
|
async updateSpace({ spaceKey, state }) {
|
|
3388
3393
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3389
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3394
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3390
3395
|
if (state) {
|
|
3391
3396
|
switch (state) {
|
|
3392
3397
|
case import_services9.SpaceState.ACTIVE:
|
|
@@ -3396,7 +3401,7 @@ var SpacesServiceImpl = class {
|
|
|
3396
3401
|
await space.deactivate();
|
|
3397
3402
|
break;
|
|
3398
3403
|
default:
|
|
3399
|
-
throw new
|
|
3404
|
+
throw new import_protocols9.ApiError("Invalid space state");
|
|
3400
3405
|
}
|
|
3401
3406
|
}
|
|
3402
3407
|
}
|
|
@@ -3451,14 +3456,14 @@ var SpacesServiceImpl = class {
|
|
|
3451
3456
|
}
|
|
3452
3457
|
async postMessage({ spaceKey, channel, message }) {
|
|
3453
3458
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3454
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3459
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3455
3460
|
await space.postMessage(getChannelId(channel), message);
|
|
3456
3461
|
}
|
|
3457
3462
|
subscribeMessages({ spaceKey, channel }) {
|
|
3458
3463
|
return new import_codec_protobuf5.Stream(({ ctx, next }) => {
|
|
3459
3464
|
(0, import_async10.scheduleTask)(ctx, async () => {
|
|
3460
3465
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3461
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3466
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3462
3467
|
const handle = space.listen(getChannelId(channel), (message) => {
|
|
3463
3468
|
next(message);
|
|
3464
3469
|
});
|
|
@@ -3466,38 +3471,83 @@ var SpacesServiceImpl = class {
|
|
|
3466
3471
|
});
|
|
3467
3472
|
});
|
|
3468
3473
|
}
|
|
3469
|
-
queryCredentials({ spaceKey }) {
|
|
3470
|
-
return new import_codec_protobuf5.Stream(({ ctx, next }) => {
|
|
3471
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3474
|
+
queryCredentials({ spaceKey, noTail }) {
|
|
3475
|
+
return new import_codec_protobuf5.Stream(({ ctx, next, close }) => {
|
|
3476
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3472
3477
|
const processor = {
|
|
3473
3478
|
processCredential: async (credential) => {
|
|
3474
3479
|
next(credential);
|
|
3475
3480
|
}
|
|
3476
3481
|
};
|
|
3477
3482
|
ctx.onDispose(() => space.spaceState.removeCredentialProcessor(processor));
|
|
3478
|
-
(0, import_async10.scheduleTask)(ctx, () =>
|
|
3483
|
+
(0, import_async10.scheduleTask)(ctx, async () => {
|
|
3484
|
+
await space.spaceState.addCredentialProcessor(processor);
|
|
3485
|
+
if (noTail) {
|
|
3486
|
+
close();
|
|
3487
|
+
}
|
|
3488
|
+
});
|
|
3479
3489
|
});
|
|
3480
3490
|
}
|
|
3481
3491
|
async writeCredentials({ spaceKey, credentials }) {
|
|
3482
|
-
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3492
|
+
const space = this._spaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3483
3493
|
for (const credential of credentials ?? []) {
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
credential
|
|
3487
|
-
|
|
3488
|
-
|
|
3494
|
+
if (credential.proof) {
|
|
3495
|
+
await space.controlPipeline.writer.write({
|
|
3496
|
+
credential: {
|
|
3497
|
+
credential
|
|
3498
|
+
}
|
|
3499
|
+
});
|
|
3500
|
+
} else {
|
|
3501
|
+
(0, import_invariant12.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
3502
|
+
F: __dxlog_file14,
|
|
3503
|
+
L: 168,
|
|
3504
|
+
S: this,
|
|
3505
|
+
A: [
|
|
3506
|
+
"!credential.id",
|
|
3507
|
+
"'Id on unsigned credentials is not allowed'"
|
|
3508
|
+
]
|
|
3509
|
+
});
|
|
3510
|
+
(0, import_invariant12.invariant)(this._identityManager.identity, "Identity is not available", {
|
|
3511
|
+
F: __dxlog_file14,
|
|
3512
|
+
L: 169,
|
|
3513
|
+
S: this,
|
|
3514
|
+
A: [
|
|
3515
|
+
"this._identityManager.identity",
|
|
3516
|
+
"'Identity is not available'"
|
|
3517
|
+
]
|
|
3518
|
+
});
|
|
3519
|
+
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
3520
|
+
(0, import_invariant12.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
3521
|
+
F: __dxlog_file14,
|
|
3522
|
+
L: 171,
|
|
3523
|
+
S: this,
|
|
3524
|
+
A: [
|
|
3525
|
+
"credential.issuer.equals(signer.getIssuer())",
|
|
3526
|
+
""
|
|
3527
|
+
]
|
|
3528
|
+
});
|
|
3529
|
+
const signedCredential = await signer.createCredential({
|
|
3530
|
+
subject: credential.subject.id,
|
|
3531
|
+
assertion: credential.subject.assertion
|
|
3532
|
+
});
|
|
3533
|
+
await space.controlPipeline.writer.write({
|
|
3534
|
+
credential: {
|
|
3535
|
+
credential: signedCredential
|
|
3536
|
+
}
|
|
3537
|
+
});
|
|
3538
|
+
}
|
|
3489
3539
|
}
|
|
3490
3540
|
}
|
|
3491
3541
|
async createEpoch({ spaceKey }) {
|
|
3492
3542
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
3493
|
-
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new
|
|
3543
|
+
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug6.raise)(new import_protocols9.SpaceNotFoundError(spaceKey));
|
|
3494
3544
|
await space.createEpoch();
|
|
3495
3545
|
}
|
|
3496
3546
|
_serializeSpace(space) {
|
|
3497
3547
|
return {
|
|
3498
3548
|
spaceKey: space.key,
|
|
3499
3549
|
state: space.state,
|
|
3500
|
-
error: space.error ? (0,
|
|
3550
|
+
error: space.error ? (0, import_protocols9.encodeError)(space.error) : void 0,
|
|
3501
3551
|
pipeline: {
|
|
3502
3552
|
currentEpoch: space.dataPipeline.currentEpoch,
|
|
3503
3553
|
appliedEpoch: space.dataPipeline.appliedEpoch,
|
|
@@ -3524,7 +3574,7 @@ var SpacesServiceImpl = class {
|
|
|
3524
3574
|
displayName: member.assertion.profile?.displayName
|
|
3525
3575
|
}
|
|
3526
3576
|
},
|
|
3527
|
-
presence: isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3577
|
+
presence: member.removed ? import_services9.SpaceMember.PresenceState.REMOVED : isMe || peers.length > 0 ? import_services9.SpaceMember.PresenceState.ONLINE : import_services9.SpaceMember.PresenceState.OFFLINE,
|
|
3528
3578
|
peerStates: peers
|
|
3529
3579
|
};
|
|
3530
3580
|
}),
|
|
@@ -3547,7 +3597,7 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
3547
3597
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
3548
3598
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3549
3599
|
}
|
|
3550
|
-
var __dxlog_file15 = "/
|
|
3600
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-context.ts";
|
|
3551
3601
|
var ServiceContext = class ServiceContext2 {
|
|
3552
3602
|
// prettier-ignore
|
|
3553
3603
|
constructor(storage, networkManager, signalManager, modelFactory) {
|
|
@@ -3556,11 +3606,11 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3556
3606
|
this.signalManager = signalManager;
|
|
3557
3607
|
this.modelFactory = modelFactory;
|
|
3558
3608
|
this.initialized = new import_async11.Trigger();
|
|
3559
|
-
this.dataServiceSubscriptions = new
|
|
3609
|
+
this.dataServiceSubscriptions = new import_echo_pipeline2.DataServiceSubscriptions();
|
|
3560
3610
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
3561
3611
|
this._instanceId = import_keys8.PublicKey.random().toHex();
|
|
3562
|
-
this.metadataStore = new
|
|
3563
|
-
this.snapshotStore = new
|
|
3612
|
+
this.metadataStore = new import_echo_pipeline2.MetadataStore(storage.createDirectory("metadata"));
|
|
3613
|
+
this.snapshotStore = new import_echo_pipeline2.SnapshotStore(storage.createDirectory("snapshots"));
|
|
3564
3614
|
this.blobStore = new import_teleport_extension_object_sync.BlobStore(storage.createDirectory("blobs"));
|
|
3565
3615
|
this.keyring = new import_keyring.Keyring(storage.createDirectory("keyring"));
|
|
3566
3616
|
this.feedStore = new import_feed_store3.FeedStore({
|
|
@@ -3568,12 +3618,12 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3568
3618
|
root: storage.createDirectory("feeds"),
|
|
3569
3619
|
signer: this.keyring,
|
|
3570
3620
|
hypercore: {
|
|
3571
|
-
valueEncoding:
|
|
3621
|
+
valueEncoding: import_echo_pipeline2.valueEncoding,
|
|
3572
3622
|
stats: true
|
|
3573
3623
|
}
|
|
3574
3624
|
})
|
|
3575
3625
|
});
|
|
3576
|
-
this.spaceManager = new
|
|
3626
|
+
this.spaceManager = new import_echo_pipeline2.SpaceManager({
|
|
3577
3627
|
feedStore: this.feedStore,
|
|
3578
3628
|
networkManager: this.networkManager,
|
|
3579
3629
|
blobStore: this.blobStore,
|
|
@@ -3593,7 +3643,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3593
3643
|
S: this,
|
|
3594
3644
|
C: (f, a) => f(...a)
|
|
3595
3645
|
});
|
|
3596
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
3646
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.begin({
|
|
3597
3647
|
id: this._instanceId
|
|
3598
3648
|
}), {
|
|
3599
3649
|
F: __dxlog_file15,
|
|
@@ -3609,7 +3659,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3609
3659
|
if (this.identityManager.identity) {
|
|
3610
3660
|
await this._initialize(ctx);
|
|
3611
3661
|
}
|
|
3612
|
-
import_log13.log.trace("dxos.sdk.service-context.open",
|
|
3662
|
+
import_log13.log.trace("dxos.sdk.service-context.open", import_protocols10.trace.end({
|
|
3613
3663
|
id: this._instanceId
|
|
3614
3664
|
}), {
|
|
3615
3665
|
F: __dxlog_file15,
|
|
@@ -3656,7 +3706,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3656
3706
|
}
|
|
3657
3707
|
getInvitationHandler(invitation) {
|
|
3658
3708
|
const factory = this._handlerFactories.get(invitation.kind);
|
|
3659
|
-
(0,
|
|
3709
|
+
(0, import_invariant13.invariant)(factory, `Unknown invitation kind: ${invitation.kind}`, {
|
|
3660
3710
|
F: __dxlog_file15,
|
|
3661
3711
|
L: 174,
|
|
3662
3712
|
S: this,
|
|
@@ -3674,8 +3724,8 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3674
3724
|
}
|
|
3675
3725
|
async _checkStorageVersion() {
|
|
3676
3726
|
await this.metadataStore.load();
|
|
3677
|
-
if (this.metadataStore.version !==
|
|
3678
|
-
throw new
|
|
3727
|
+
if (this.metadataStore.version !== import_protocols10.STORAGE_VERSION) {
|
|
3728
|
+
throw new import_protocols10.InvalidStorageVersionError(import_protocols10.STORAGE_VERSION, this.metadataStore.version);
|
|
3679
3729
|
}
|
|
3680
3730
|
}
|
|
3681
3731
|
// Called when identity is created.
|
|
@@ -3703,7 +3753,7 @@ var ServiceContext = class ServiceContext2 {
|
|
|
3703
3753
|
this.dataSpaceManager = new DataSpaceManager(this.spaceManager, this.metadataStore, this.dataServiceSubscriptions, this.keyring, signingContext, this.feedStore);
|
|
3704
3754
|
await this.dataSpaceManager.open();
|
|
3705
3755
|
this._handlerFactories.set(import_services10.Invitation.Kind.SPACE, (invitation) => {
|
|
3706
|
-
(0,
|
|
3756
|
+
(0, import_invariant13.invariant)(this.dataSpaceManager, "dataSpaceManager not initialized yet", {
|
|
3707
3757
|
F: __dxlog_file15,
|
|
3708
3758
|
L: 218,
|
|
3709
3759
|
S: this,
|
|
@@ -3788,14 +3838,14 @@ var import_async17 = require("@dxos/async");
|
|
|
3788
3838
|
var import_client_protocol5 = require("@dxos/client-protocol");
|
|
3789
3839
|
var import_context10 = require("@dxos/context");
|
|
3790
3840
|
var import_document_model2 = require("@dxos/document-model");
|
|
3791
|
-
var
|
|
3792
|
-
var
|
|
3841
|
+
var import_echo_pipeline3 = require("@dxos/echo-pipeline");
|
|
3842
|
+
var import_invariant15 = require("@dxos/invariant");
|
|
3793
3843
|
var import_keys12 = require("@dxos/keys");
|
|
3794
3844
|
var import_log16 = require("@dxos/log");
|
|
3795
3845
|
var import_messaging = require("@dxos/messaging");
|
|
3796
3846
|
var import_model_factory = require("@dxos/model-factory");
|
|
3797
3847
|
var import_network_manager2 = require("@dxos/network-manager");
|
|
3798
|
-
var
|
|
3848
|
+
var import_protocols12 = require("@dxos/protocols");
|
|
3799
3849
|
var import_services14 = require("@dxos/protocols/proto/dxos/client/services");
|
|
3800
3850
|
var import_text_model = require("@dxos/text-model");
|
|
3801
3851
|
var import_tracing5 = require("@dxos/tracing");
|
|
@@ -4153,7 +4203,7 @@ var DevtoolsServiceImpl = class {
|
|
|
4153
4203
|
};
|
|
4154
4204
|
|
|
4155
4205
|
// packages/sdk/client-services/src/packlets/locks/node.ts
|
|
4156
|
-
var
|
|
4206
|
+
var import_invariant14 = require("@dxos/invariant");
|
|
4157
4207
|
var import_lock_file = require("@dxos/lock-file");
|
|
4158
4208
|
var import_log14 = require("@dxos/log");
|
|
4159
4209
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
@@ -4166,7 +4216,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
4166
4216
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4167
4217
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4168
4218
|
}
|
|
4169
|
-
var __dxlog_file16 = "/
|
|
4219
|
+
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/locks/node.ts";
|
|
4170
4220
|
var Lock = class {
|
|
4171
4221
|
constructor({ lockKey: lockPath, onAcquire, onRelease }) {
|
|
4172
4222
|
this._lockPath = lockPath;
|
|
@@ -4194,7 +4244,7 @@ var Lock = class {
|
|
|
4194
4244
|
}
|
|
4195
4245
|
async release() {
|
|
4196
4246
|
await this._onRelease?.();
|
|
4197
|
-
(0,
|
|
4247
|
+
(0, import_invariant14.invariant)(this._fileHandle, "Lock is not acquired", {
|
|
4198
4248
|
F: __dxlog_file16,
|
|
4199
4249
|
L: 42,
|
|
4200
4250
|
S: this,
|
|
@@ -4361,7 +4411,7 @@ var NetworkServiceImpl = class {
|
|
|
4361
4411
|
|
|
4362
4412
|
// packages/sdk/client-services/src/packlets/storage/storage.ts
|
|
4363
4413
|
var import_client_protocol4 = require("@dxos/client-protocol");
|
|
4364
|
-
var
|
|
4414
|
+
var import_protocols11 = require("@dxos/protocols");
|
|
4365
4415
|
var import_config = require("@dxos/protocols/proto/dxos/config");
|
|
4366
4416
|
var import_random_access_storage = require("@dxos/random-access-storage");
|
|
4367
4417
|
var import_util8 = require("@dxos/util");
|
|
@@ -4369,16 +4419,16 @@ var StorageDriver = import_config.Runtime.Client.Storage.StorageDriver;
|
|
|
4369
4419
|
var createStorageObjects = (config) => {
|
|
4370
4420
|
const { path = (0, import_util8.isNode)() ? import_client_protocol4.DX_DATA : "dxos/storage", storageType, keyStorage, persistent = false } = config ?? {};
|
|
4371
4421
|
if (persistent && storageType === StorageDriver.RAM) {
|
|
4372
|
-
throw new
|
|
4422
|
+
throw new import_protocols11.InvalidConfigError("RAM storage cannot be used in persistent mode.");
|
|
4373
4423
|
}
|
|
4374
4424
|
if (!persistent && storageType !== void 0 && storageType !== StorageDriver.RAM) {
|
|
4375
|
-
throw new
|
|
4425
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent storage in not persistent mode.");
|
|
4376
4426
|
}
|
|
4377
4427
|
if (persistent && keyStorage === StorageDriver.RAM) {
|
|
4378
|
-
throw new
|
|
4428
|
+
throw new import_protocols11.InvalidConfigError("RAM key storage cannot be used in persistent mode.");
|
|
4379
4429
|
}
|
|
4380
4430
|
if (!persistent && keyStorage !== StorageDriver.RAM && keyStorage !== void 0) {
|
|
4381
|
-
throw new
|
|
4431
|
+
throw new import_protocols11.InvalidConfigError("Cannot use a persistent key storage in not persistent mode.");
|
|
4382
4432
|
}
|
|
4383
4433
|
return {
|
|
4384
4434
|
storage: (0, import_random_access_storage.createStorage)({
|
|
@@ -4497,7 +4547,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
4497
4547
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
4498
4548
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4499
4549
|
}
|
|
4500
|
-
var __dxlog_file17 = "/
|
|
4550
|
+
var __dxlog_file17 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/service-host.ts";
|
|
4501
4551
|
var createDefaultModelFactory = () => {
|
|
4502
4552
|
return new import_model_factory.ModelFactory().registerModel(import_document_model2.DocumentModel).registerModel(import_text_model.TextModel);
|
|
4503
4553
|
};
|
|
@@ -4585,7 +4635,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4585
4635
|
* Can only be called once.
|
|
4586
4636
|
*/
|
|
4587
4637
|
initialize({ config, ...options }) {
|
|
4588
|
-
(0,
|
|
4638
|
+
(0, import_invariant15.invariant)(!this._open, "service host is open", {
|
|
4589
4639
|
F: __dxlog_file17,
|
|
4590
4640
|
L: 184,
|
|
4591
4641
|
S: this,
|
|
@@ -4601,7 +4651,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4601
4651
|
C: (f, a) => f(...a)
|
|
4602
4652
|
});
|
|
4603
4653
|
if (config) {
|
|
4604
|
-
(0,
|
|
4654
|
+
(0, import_invariant15.invariant)(!this._config, "config already set", {
|
|
4605
4655
|
F: __dxlog_file17,
|
|
4606
4656
|
L: 188,
|
|
4607
4657
|
S: this,
|
|
@@ -4619,7 +4669,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4619
4669
|
iceServers: this._config?.get("runtime.services.ice")
|
|
4620
4670
|
}), signalManager = new import_messaging.WebsocketSignalManager(this._config?.get("runtime.services.signaling") ?? []) } = options;
|
|
4621
4671
|
this._signalManager = signalManager;
|
|
4622
|
-
(0,
|
|
4672
|
+
(0, import_invariant15.invariant)(!this._networkManager, "network manager already set", {
|
|
4623
4673
|
F: __dxlog_file17,
|
|
4624
4674
|
L: 204,
|
|
4625
4675
|
S: this,
|
|
@@ -4645,7 +4695,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4645
4695
|
return;
|
|
4646
4696
|
}
|
|
4647
4697
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4648
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4698
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.begin({
|
|
4649
4699
|
id: traceId
|
|
4650
4700
|
}), {
|
|
4651
4701
|
F: __dxlog_file17,
|
|
@@ -4653,7 +4703,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4653
4703
|
S: this,
|
|
4654
4704
|
C: (f, a) => f(...a)
|
|
4655
4705
|
});
|
|
4656
|
-
(0,
|
|
4706
|
+
(0, import_invariant15.invariant)(this._config, "config not set", {
|
|
4657
4707
|
F: __dxlog_file17,
|
|
4658
4708
|
L: 224,
|
|
4659
4709
|
S: this,
|
|
@@ -4662,7 +4712,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4662
4712
|
"'config not set'"
|
|
4663
4713
|
]
|
|
4664
4714
|
});
|
|
4665
|
-
(0,
|
|
4715
|
+
(0, import_invariant15.invariant)(this._storage, "storage not set", {
|
|
4666
4716
|
F: __dxlog_file17,
|
|
4667
4717
|
L: 225,
|
|
4668
4718
|
S: this,
|
|
@@ -4671,7 +4721,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4671
4721
|
"'storage not set'"
|
|
4672
4722
|
]
|
|
4673
4723
|
});
|
|
4674
|
-
(0,
|
|
4724
|
+
(0, import_invariant15.invariant)(this._signalManager, "signal manager not set", {
|
|
4675
4725
|
F: __dxlog_file17,
|
|
4676
4726
|
L: 226,
|
|
4677
4727
|
S: this,
|
|
@@ -4680,7 +4730,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4680
4730
|
"'signal manager not set'"
|
|
4681
4731
|
]
|
|
4682
4732
|
});
|
|
4683
|
-
(0,
|
|
4733
|
+
(0, import_invariant15.invariant)(this._networkManager, "network manager not set", {
|
|
4684
4734
|
F: __dxlog_file17,
|
|
4685
4735
|
L: 227,
|
|
4686
4736
|
S: this,
|
|
@@ -4710,7 +4760,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4710
4760
|
await this._serviceContext.initialized.wait();
|
|
4711
4761
|
return this._serviceContext.dataSpaceManager;
|
|
4712
4762
|
}),
|
|
4713
|
-
DataService: new
|
|
4763
|
+
DataService: new import_echo_pipeline3.DataServiceImpl(this._serviceContext.dataServiceSubscriptions),
|
|
4714
4764
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
4715
4765
|
LoggingService: this._loggingService,
|
|
4716
4766
|
TracingService: this._tracingService,
|
|
@@ -4744,7 +4794,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4744
4794
|
S: this,
|
|
4745
4795
|
C: (f, a) => f(...a)
|
|
4746
4796
|
});
|
|
4747
|
-
import_log16.log.trace("dxos.client-services.host.open",
|
|
4797
|
+
import_log16.log.trace("dxos.client-services.host.open", import_protocols12.trace.end({
|
|
4748
4798
|
id: traceId
|
|
4749
4799
|
}), {
|
|
4750
4800
|
F: __dxlog_file17,
|
|
@@ -4785,7 +4835,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4785
4835
|
}
|
|
4786
4836
|
async reset() {
|
|
4787
4837
|
const traceId = import_keys12.PublicKey.random().toHex();
|
|
4788
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4838
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.begin({
|
|
4789
4839
|
id: traceId
|
|
4790
4840
|
}), {
|
|
4791
4841
|
F: __dxlog_file17,
|
|
@@ -4807,7 +4857,7 @@ var ClientServicesHost = class ClientServicesHost2 {
|
|
|
4807
4857
|
S: this,
|
|
4808
4858
|
C: (f, a) => f(...a)
|
|
4809
4859
|
});
|
|
4810
|
-
import_log16.log.trace("dxos.sdk.client-services-host.reset",
|
|
4860
|
+
import_log16.log.trace("dxos.sdk.client-services-host.reset", import_protocols12.trace.end({
|
|
4811
4861
|
id: traceId
|
|
4812
4862
|
}), {
|
|
4813
4863
|
F: __dxlog_file17,
|
|
@@ -4837,7 +4887,7 @@ ClientServicesHost = _ts_decorate7([
|
|
|
4837
4887
|
], ClientServicesHost);
|
|
4838
4888
|
|
|
4839
4889
|
// packages/sdk/client-services/src/packlets/testing/invitation-utils.ts
|
|
4840
|
-
var __dxlog_file18 = "/
|
|
4890
|
+
var __dxlog_file18 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/invitation-utils.ts";
|
|
4841
4891
|
var sanitizeInvitation = (invitation) => {
|
|
4842
4892
|
return {
|
|
4843
4893
|
invitationId: invitation.invitationId,
|
|
@@ -4867,7 +4917,7 @@ var performInvitation = ({ host, guest, options, hooks }) => {
|
|
|
4867
4917
|
if (hooks?.guest?.onConnecting?.(guestObservable)) {
|
|
4868
4918
|
break;
|
|
4869
4919
|
}
|
|
4870
|
-
(0,
|
|
4920
|
+
(0, import_invariant16.invariant)(hostInvitation.swarmKey.equals(guestInvitation.swarmKey), void 0, {
|
|
4871
4921
|
F: __dxlog_file18,
|
|
4872
4922
|
L: 84,
|
|
4873
4923
|
S: void 0,
|
|
@@ -5000,7 +5050,7 @@ var createInvitation = (host, options) => {
|
|
|
5000
5050
|
});
|
|
5001
5051
|
return host.invitations.createInvitation(hostHandler, options);
|
|
5002
5052
|
}
|
|
5003
|
-
return host.
|
|
5053
|
+
return host.share(options);
|
|
5004
5054
|
};
|
|
5005
5055
|
var acceptInvitation = (guest, invitation) => {
|
|
5006
5056
|
invitation = sanitizeInvitation(invitation);
|
|
@@ -5010,14 +5060,14 @@ var acceptInvitation = (guest, invitation) => {
|
|
|
5010
5060
|
});
|
|
5011
5061
|
return guest.invitations.acceptInvitation(guestHandler, invitation);
|
|
5012
5062
|
}
|
|
5013
|
-
return guest.
|
|
5063
|
+
return guest.join(invitation);
|
|
5014
5064
|
};
|
|
5015
5065
|
|
|
5016
5066
|
// packages/sdk/client-services/src/packlets/testing/test-builder.ts
|
|
5017
5067
|
var import_context11 = require("@dxos/context");
|
|
5018
5068
|
var import_credentials16 = require("@dxos/credentials");
|
|
5019
5069
|
var import_debug8 = require("@dxos/debug");
|
|
5020
|
-
var
|
|
5070
|
+
var import_echo_pipeline4 = require("@dxos/echo-pipeline");
|
|
5021
5071
|
var import_testing = require("@dxos/echo-pipeline/testing");
|
|
5022
5072
|
var import_feed_store5 = require("@dxos/feed-store");
|
|
5023
5073
|
var import_keyring2 = require("@dxos/keyring");
|
|
@@ -5100,19 +5150,19 @@ var TestPeer = class {
|
|
|
5100
5150
|
root: this.storage.createDirectory("feeds"),
|
|
5101
5151
|
signer: this.keyring,
|
|
5102
5152
|
hypercore: {
|
|
5103
|
-
valueEncoding:
|
|
5153
|
+
valueEncoding: import_echo_pipeline4.valueEncoding
|
|
5104
5154
|
}
|
|
5105
5155
|
})
|
|
5106
5156
|
});
|
|
5107
5157
|
}
|
|
5108
5158
|
get metadataStore() {
|
|
5109
|
-
return this._props.metadataStore ??= new
|
|
5159
|
+
return this._props.metadataStore ??= new import_echo_pipeline4.MetadataStore(this.storage.createDirectory("metadata"));
|
|
5110
5160
|
}
|
|
5111
5161
|
get blobStore() {
|
|
5112
5162
|
return this._props.blobStore ??= new import_teleport_extension_object_sync2.BlobStore(this.storage.createDirectory("blobs"));
|
|
5113
5163
|
}
|
|
5114
5164
|
get snapshotStore() {
|
|
5115
|
-
return this._props.snapshotStore ??= new
|
|
5165
|
+
return this._props.snapshotStore ??= new import_echo_pipeline4.SnapshotStore(this.storage.createDirectory("snapshots"));
|
|
5116
5166
|
}
|
|
5117
5167
|
get networkManager() {
|
|
5118
5168
|
return this._props.networkManager ??= new import_network_manager3.NetworkManager({
|
|
@@ -5121,7 +5171,7 @@ var TestPeer = class {
|
|
|
5121
5171
|
});
|
|
5122
5172
|
}
|
|
5123
5173
|
get spaceManager() {
|
|
5124
|
-
return this._props.spaceManager ??= new
|
|
5174
|
+
return this._props.spaceManager ??= new import_echo_pipeline4.SpaceManager({
|
|
5125
5175
|
feedStore: this.feedStore,
|
|
5126
5176
|
networkManager: this.networkManager,
|
|
5127
5177
|
metadataStore: this.metadataStore,
|
|
@@ -5134,7 +5184,7 @@ var TestPeer = class {
|
|
|
5134
5184
|
return this._props.signingContext ?? (0, import_debug8.failUndefined)();
|
|
5135
5185
|
}
|
|
5136
5186
|
get dataSpaceManager() {
|
|
5137
|
-
return this._props.dataSpaceManager ??= new DataSpaceManager(this.spaceManager, this.metadataStore, new
|
|
5187
|
+
return this._props.dataSpaceManager ??= new DataSpaceManager(this.spaceManager, this.metadataStore, new import_echo_pipeline4.DataServiceSubscriptions(), this.keyring, this.identity, this.feedStore);
|
|
5138
5188
|
}
|
|
5139
5189
|
async createIdentity() {
|
|
5140
5190
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|