@dxos/client-services 0.6.3-main.9e4e207 → 0.6.3-next.2f65b78
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-LOXM2SQM.mjs → chunk-XDR7UKWW.mjs} +35 -56
- package/dist/lib/browser/{chunk-LOXM2SQM.mjs.map → chunk-XDR7UKWW.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-MMUSO27N.cjs → chunk-PQML4EXM.cjs} +38 -59
- package/dist/lib/node/{chunk-MMUSO27N.cjs.map → chunk-PQML4EXM.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +45 -45
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts +1 -7
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -36
- package/src/packlets/spaces/data-space-manager.ts +10 -22
- package/src/packlets/spaces/data-space.ts +11 -15
- package/src/packlets/spaces/spaces-service.ts +3 -3
- package/src/version.ts +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
InvitationsManager,
|
|
8
8
|
ServiceContext,
|
|
9
9
|
SpaceInvitationProtocol
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-XDR7UKWW.mjs";
|
|
11
11
|
|
|
12
12
|
// packages/sdk/client-services/src/packlets/testing/credential-utils.ts
|
|
13
13
|
import { createCredential } from "@dxos/credentials";
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_PQML4EXM_exports = {};
|
|
30
|
+
__export(chunk_PQML4EXM_exports, {
|
|
31
31
|
ClientRpcServer: () => ClientRpcServer,
|
|
32
32
|
ClientServicesHost: () => ClientServicesHost,
|
|
33
33
|
ClientServicesProviderResource: () => ClientServicesProviderResource,
|
|
@@ -70,7 +70,7 @@ __export(chunk_MMUSO27N_exports, {
|
|
|
70
70
|
subscribeToSpaces: () => subscribeToSpaces,
|
|
71
71
|
subscribeToSwarmInfo: () => subscribeToSwarmInfo
|
|
72
72
|
});
|
|
73
|
-
module.exports = __toCommonJS(
|
|
73
|
+
module.exports = __toCommonJS(chunk_PQML4EXM_exports);
|
|
74
74
|
var import_async = require("@dxos/async");
|
|
75
75
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
76
76
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -647,7 +647,7 @@ var DevtoolsServiceImpl = class {
|
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
};
|
|
650
|
-
var DXOS_VERSION = "0.6.3-
|
|
650
|
+
var DXOS_VERSION = "0.6.3-next.2f65b78";
|
|
651
651
|
var getPlatform = () => {
|
|
652
652
|
if (process.browser) {
|
|
653
653
|
if (typeof window !== "undefined") {
|
|
@@ -4643,15 +4643,17 @@ var DataSpace = class {
|
|
|
4643
4643
|
};
|
|
4644
4644
|
});
|
|
4645
4645
|
}
|
|
4646
|
-
const root = await this._echoHost.openSpaceRoot(
|
|
4646
|
+
const root = await this._echoHost.openSpaceRoot(handle.url);
|
|
4647
4647
|
this._databaseRoot = root;
|
|
4648
4648
|
if (root.getVersion() !== import_echo_protocol.SpaceDocVersion.CURRENT) {
|
|
4649
|
-
this._state
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4649
|
+
if (this._state !== import_services12.SpaceState.REQUIRES_MIGRATION) {
|
|
4650
|
+
this._state = import_services12.SpaceState.REQUIRES_MIGRATION;
|
|
4651
|
+
this.stateUpdate.emit();
|
|
4652
|
+
}
|
|
4653
4653
|
} else {
|
|
4654
|
-
this.
|
|
4654
|
+
if (this._state !== import_services12.SpaceState.READY) {
|
|
4655
|
+
await this._enterReadyState();
|
|
4656
|
+
}
|
|
4655
4657
|
}
|
|
4656
4658
|
} catch (_) {
|
|
4657
4659
|
_usingCtx.e = _;
|
|
@@ -4668,7 +4670,7 @@ var DataSpace = class {
|
|
|
4668
4670
|
err
|
|
4669
4671
|
}, {
|
|
4670
4672
|
F: __dxlog_file17,
|
|
4671
|
-
L:
|
|
4673
|
+
L: 433,
|
|
4672
4674
|
S: this,
|
|
4673
4675
|
C: (f, a) => f(...a)
|
|
4674
4676
|
});
|
|
@@ -4721,18 +4723,14 @@ var DataSpace = class {
|
|
|
4721
4723
|
credential
|
|
4722
4724
|
}
|
|
4723
4725
|
});
|
|
4724
|
-
|
|
4726
|
+
await this.inner.controlPipeline.state.waitUntilTimeframe(new import_timeframe3.Timeframe([
|
|
4725
4727
|
[
|
|
4726
4728
|
receipt.feedKey,
|
|
4727
4729
|
receipt.seq
|
|
4728
4730
|
]
|
|
4729
|
-
]);
|
|
4730
|
-
await this.inner.controlPipeline.state.waitUntilTimeframe(timeframe);
|
|
4731
|
+
]));
|
|
4731
4732
|
await this._echoHost.updateIndexes();
|
|
4732
|
-
return
|
|
4733
|
-
credential,
|
|
4734
|
-
timeframe
|
|
4735
|
-
};
|
|
4733
|
+
return credential;
|
|
4736
4734
|
}
|
|
4737
4735
|
async activate() {
|
|
4738
4736
|
if (![
|
|
@@ -4758,7 +4756,7 @@ var DataSpace = class {
|
|
|
4758
4756
|
state: import_services12.SpaceState[this._state]
|
|
4759
4757
|
}, {
|
|
4760
4758
|
F: __dxlog_file17,
|
|
4761
|
-
L:
|
|
4759
|
+
L: 514,
|
|
4762
4760
|
S: this,
|
|
4763
4761
|
C: (f, a) => f(...a)
|
|
4764
4762
|
});
|
|
@@ -5257,37 +5255,19 @@ var DataSpaceManager = class {
|
|
|
5257
5255
|
credentialProvider: createAuthProvider(this._signingContext.credentialSigner),
|
|
5258
5256
|
credentialAuthenticator: (0, import_util9.deferFunction)(() => dataSpace.authVerifier.verifier)
|
|
5259
5257
|
},
|
|
5260
|
-
onAuthorizedConnection: (session) =>
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
|
|
5270
|
-
await this._echoHost.authorizeDevice(space.key, session.remotePeerId);
|
|
5271
|
-
if (!session.isOpen) {
|
|
5272
|
-
return;
|
|
5273
|
-
}
|
|
5274
|
-
session.addExtension("dxos.mesh.teleport.automerge", this._echoHost.createReplicationExtension());
|
|
5275
|
-
} catch (err) {
|
|
5276
|
-
import_log15.log.warn("error on authorized connection", {
|
|
5277
|
-
err
|
|
5278
|
-
}, {
|
|
5279
|
-
F: __dxlog_file18,
|
|
5280
|
-
L: 403,
|
|
5281
|
-
S: this,
|
|
5282
|
-
C: (f, a) => f(...a)
|
|
5283
|
-
});
|
|
5284
|
-
await session.close(err);
|
|
5285
|
-
}
|
|
5286
|
-
}),
|
|
5258
|
+
onAuthorizedConnection: (session) => {
|
|
5259
|
+
session.addExtension("dxos.mesh.teleport.admission-discovery", new import_echo_pipeline4.CredentialServerExtension(space));
|
|
5260
|
+
session.addExtension("dxos.mesh.teleport.gossip", gossip.createExtension({
|
|
5261
|
+
remotePeerId: session.remotePeerId
|
|
5262
|
+
}));
|
|
5263
|
+
session.addExtension("dxos.mesh.teleport.notarization", dataSpace.notarizationPlugin.createExtension());
|
|
5264
|
+
this._echoHost.authorizeDevice(space.key, session.remotePeerId);
|
|
5265
|
+
session.addExtension("dxos.mesh.teleport.automerge", this._echoHost.createReplicationExtension());
|
|
5266
|
+
},
|
|
5287
5267
|
onAuthFailure: () => {
|
|
5288
5268
|
import_log15.log.warn("auth failure", void 0, {
|
|
5289
5269
|
F: __dxlog_file18,
|
|
5290
|
-
L:
|
|
5270
|
+
L: 396,
|
|
5291
5271
|
S: this,
|
|
5292
5272
|
C: (f, a) => f(...a)
|
|
5293
5273
|
});
|
|
@@ -5320,7 +5300,7 @@ var DataSpaceManager = class {
|
|
|
5320
5300
|
space: space.key
|
|
5321
5301
|
}, {
|
|
5322
5302
|
F: __dxlog_file18,
|
|
5323
|
-
L:
|
|
5303
|
+
L: 423,
|
|
5324
5304
|
S: this,
|
|
5325
5305
|
C: (f, a) => f(...a)
|
|
5326
5306
|
});
|
|
@@ -5331,7 +5311,7 @@ var DataSpaceManager = class {
|
|
|
5331
5311
|
open: this._isOpen
|
|
5332
5312
|
}, {
|
|
5333
5313
|
F: __dxlog_file18,
|
|
5334
|
-
L:
|
|
5314
|
+
L: 426,
|
|
5335
5315
|
S: this,
|
|
5336
5316
|
C: (f, a) => f(...a)
|
|
5337
5317
|
});
|
|
@@ -5350,7 +5330,7 @@ var DataSpaceManager = class {
|
|
|
5350
5330
|
space: space.key
|
|
5351
5331
|
}, {
|
|
5352
5332
|
F: __dxlog_file18,
|
|
5353
|
-
L:
|
|
5333
|
+
L: 434,
|
|
5354
5334
|
S: this,
|
|
5355
5335
|
C: (f, a) => f(...a)
|
|
5356
5336
|
});
|
|
@@ -5391,7 +5371,7 @@ var DataSpaceManager = class {
|
|
|
5391
5371
|
closedSessions
|
|
5392
5372
|
}, {
|
|
5393
5373
|
F: __dxlog_file18,
|
|
5394
|
-
L:
|
|
5374
|
+
L: 470,
|
|
5395
5375
|
S: this,
|
|
5396
5376
|
C: (f, a) => f(...a)
|
|
5397
5377
|
});
|
|
@@ -5406,7 +5386,7 @@ var DataSpaceManager = class {
|
|
|
5406
5386
|
peerId: peerState.peerId
|
|
5407
5387
|
}, {
|
|
5408
5388
|
F: __dxlog_file18,
|
|
5409
|
-
L:
|
|
5389
|
+
L: 484,
|
|
5410
5390
|
S: this,
|
|
5411
5391
|
C: (f, a) => f(...a)
|
|
5412
5392
|
});
|
|
@@ -5534,9 +5514,9 @@ var SpacesServiceImpl = class {
|
|
|
5534
5514
|
const scheduler = new import_async17.UpdateScheduler(ctx, async () => {
|
|
5535
5515
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
5536
5516
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
5537
|
-
(0, import_log16.log)("update",
|
|
5538
|
-
|
|
5539
|
-
}
|
|
5517
|
+
(0, import_log16.log)("update", {
|
|
5518
|
+
spaces
|
|
5519
|
+
}, {
|
|
5540
5520
|
F: __dxlog_file19,
|
|
5541
5521
|
L: 115,
|
|
5542
5522
|
S: this,
|
|
@@ -5671,13 +5651,12 @@ var SpacesServiceImpl = class {
|
|
|
5671
5651
|
async createEpoch({ spaceKey, migration, automergeRootUrl }) {
|
|
5672
5652
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
5673
5653
|
const space = dataSpaceManager.spaces.get(spaceKey) ?? (0, import_debug5.raise)(new import_protocols12.SpaceNotFoundError(spaceKey));
|
|
5674
|
-
const
|
|
5654
|
+
const credential = await space.createEpoch({
|
|
5675
5655
|
migration,
|
|
5676
5656
|
newAutomergeRoot: automergeRootUrl
|
|
5677
5657
|
});
|
|
5678
5658
|
return {
|
|
5679
|
-
epochCredential:
|
|
5680
|
-
controlTimeframe: result?.timeframe
|
|
5659
|
+
epochCredential: credential ?? void 0
|
|
5681
5660
|
};
|
|
5682
5661
|
}
|
|
5683
5662
|
async admitContact(request) {
|
|
@@ -7156,4 +7135,4 @@ ClientServicesHost = _ts_decorate8([
|
|
|
7156
7135
|
subscribeToSpaces,
|
|
7157
7136
|
subscribeToSwarmInfo
|
|
7158
7137
|
});
|
|
7159
|
-
//# sourceMappingURL=chunk-
|
|
7138
|
+
//# sourceMappingURL=chunk-PQML4EXM.cjs.map
|