@dxos/client-services 0.6.3-main.9e4e207 → 0.6.3-main.a95c491

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.
Files changed (31) hide show
  1. package/dist/lib/browser/{chunk-LOXM2SQM.mjs → chunk-FUR5CTMN.mjs} +91 -91
  2. package/dist/lib/browser/chunk-FUR5CTMN.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/packlets/testing/index.mjs +1 -1
  6. package/dist/lib/node/{chunk-MMUSO27N.cjs → chunk-SP2FG3SA.cjs} +89 -89
  7. package/dist/lib/node/chunk-SP2FG3SA.cjs.map +7 -0
  8. package/dist/lib/node/index.cjs +45 -45
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/packlets/testing/index.cjs +8 -8
  11. package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts.map +1 -1
  12. package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
  13. package/dist/types/src/packlets/invitations/invitation-topology.d.ts +2 -2
  14. package/dist/types/src/packlets/invitations/invitation-topology.d.ts.map +1 -1
  15. package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
  16. package/dist/types/src/packlets/spaces/data-space.d.ts +1 -1
  17. package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
  18. package/dist/types/src/version.d.ts +1 -1
  19. package/package.json +36 -36
  20. package/src/packlets/identity/identity-service.ts +2 -2
  21. package/src/packlets/invitations/invitation-guest-extenstion.ts +8 -5
  22. package/src/packlets/invitations/invitation-host-extension.ts +5 -5
  23. package/src/packlets/invitations/invitation-topology.ts +4 -4
  24. package/src/packlets/invitations/invitations-handler.ts +13 -12
  25. package/src/packlets/spaces/data-space-manager.test.ts +6 -6
  26. package/src/packlets/spaces/data-space-manager.ts +6 -6
  27. package/src/packlets/spaces/data-space.ts +18 -18
  28. package/src/packlets/spaces/spaces-service.ts +3 -3
  29. package/src/version.ts +1 -1
  30. package/dist/lib/browser/chunk-LOXM2SQM.mjs.map +0 -7
  31. package/dist/lib/node/chunk-MMUSO27N.cjs.map +0 -7
@@ -101,12 +101,12 @@ export class DataSpace {
101
101
 
102
102
  private readonly _epochProcessingMutex = new Mutex();
103
103
 
104
- private _state = SpaceState.CLOSED;
104
+ private _state = SpaceState.SPACE_CLOSED;
105
105
 
106
106
  private _databaseRoot: DatabaseRoot | null = null;
107
107
 
108
108
  /**
109
- * Error for _state === SpaceState.ERROR.
109
+ * Error for _state === SpaceState.SPACE_ERROR.
110
110
  */
111
111
  public error: Error | undefined = undefined;
112
112
 
@@ -200,7 +200,7 @@ export class DataSpace {
200
200
 
201
201
  @synchronized
202
202
  async open() {
203
- if (this._state === SpaceState.CLOSED) {
203
+ if (this._state === SpaceState.SPACE_CLOSED) {
204
204
  await this._open();
205
205
  }
206
206
  }
@@ -213,7 +213,7 @@ export class DataSpace {
213
213
  await this._automergeSpaceState.open();
214
214
  await this._inner.spaceState.addCredentialProcessor(this._automergeSpaceState);
215
215
  await this._inner.open(new Context());
216
- this._state = SpaceState.CONTROL_ONLY;
216
+ this._state = SpaceState.SPACE_CONTROL_ONLY;
217
217
  log('new state', { state: SpaceState[this._state] });
218
218
  this.stateUpdate.emit();
219
219
  this.metrics = {};
@@ -227,7 +227,7 @@ export class DataSpace {
227
227
 
228
228
  private async _close() {
229
229
  await this._callbacks.beforeClose?.();
230
- this._state = SpaceState.CLOSED;
230
+ this._state = SpaceState.SPACE_CLOSED;
231
231
  log('new state', { state: SpaceState[this._state] });
232
232
  await this._ctx.dispose();
233
233
  this._ctx = new Context();
@@ -267,7 +267,7 @@ export class DataSpace {
267
267
  }
268
268
 
269
269
  log.error('Error initializing data pipeline', err);
270
- this._state = SpaceState.ERROR;
270
+ this._state = SpaceState.SPACE_ERROR;
271
271
  log('new state', { state: SpaceState[this._state] });
272
272
  this.error = err as Error;
273
273
  this.stateUpdate.emit();
@@ -279,11 +279,11 @@ export class DataSpace {
279
279
 
280
280
  @trace.span({ showInBrowserTimeline: true })
281
281
  async initializeDataPipeline() {
282
- if (this._state !== SpaceState.CONTROL_ONLY) {
282
+ if (this._state !== SpaceState.SPACE_CONTROL_ONLY) {
283
283
  throw new SystemError('Invalid operation');
284
284
  }
285
285
 
286
- this._state = SpaceState.INITIALIZING;
286
+ this._state = SpaceState.SPACE_INITIALIZING;
287
287
  log('new state', { state: SpaceState[this._state] });
288
288
 
289
289
  await this._initializeAndReadControlPipeline();
@@ -291,7 +291,7 @@ export class DataSpace {
291
291
  // Allow other tasks to run before loading the data pipeline.
292
292
  await sleep(1);
293
293
 
294
- const ready = this.stateUpdate.waitForCondition(() => this._state === SpaceState.READY);
294
+ const ready = this.stateUpdate.waitForCondition(() => this._state === SpaceState.SPACE_READY);
295
295
 
296
296
  this._automergeSpaceState.startProcessingRootDocs();
297
297
 
@@ -302,7 +302,7 @@ export class DataSpace {
302
302
  private async _enterReadyState() {
303
303
  await this._callbacks.beforeReady?.();
304
304
 
305
- this._state = SpaceState.READY;
305
+ this._state = SpaceState.SPACE_READY;
306
306
  log('new state', { state: SpaceState[this._state] });
307
307
  this.stateUpdate.emit();
308
308
 
@@ -417,9 +417,9 @@ export class DataSpace {
417
417
  // NOTE: Make sure this assignment happens synchronously together with the state change.
418
418
  this._databaseRoot = root;
419
419
  if (root.getVersion() !== SpaceDocVersion.CURRENT) {
420
- this._state = SpaceState.REQUIRES_MIGRATION;
420
+ this._state = SpaceState.SPACE_REQUIRES_MIGRATION;
421
421
  this.stateUpdate.emit();
422
- } else if (this._state !== SpaceState.READY) {
422
+ } else if (this._state !== SpaceState.SPACE_READY) {
423
423
  await this._enterReadyState();
424
424
  } else {
425
425
  this.stateUpdate.emit();
@@ -490,26 +490,26 @@ export class DataSpace {
490
490
 
491
491
  @synchronized
492
492
  async activate() {
493
- if (![SpaceState.CLOSED, SpaceState.INACTIVE].includes(this._state)) {
493
+ if (![SpaceState.SPACE_CLOSED, SpaceState.SPACE_INACTIVE].includes(this._state)) {
494
494
  return;
495
495
  }
496
496
 
497
- await this._metadataStore.setSpaceState(this.key, SpaceState.ACTIVE);
497
+ await this._metadataStore.setSpaceState(this.key, SpaceState.SPACE_ACTIVE);
498
498
  await this._open();
499
499
  this.initializeDataPipelineAsync();
500
500
  }
501
501
 
502
502
  @synchronized
503
503
  async deactivate() {
504
- if (this._state === SpaceState.INACTIVE) {
504
+ if (this._state === SpaceState.SPACE_INACTIVE) {
505
505
  return;
506
506
  }
507
507
  // Unregister from data service.
508
- await this._metadataStore.setSpaceState(this.key, SpaceState.INACTIVE);
509
- if (this._state !== SpaceState.CLOSED) {
508
+ await this._metadataStore.setSpaceState(this.key, SpaceState.SPACE_INACTIVE);
509
+ if (this._state !== SpaceState.SPACE_CLOSED) {
510
510
  await this._close();
511
511
  }
512
- this._state = SpaceState.INACTIVE;
512
+ this._state = SpaceState.SPACE_INACTIVE;
513
513
  log('new state', { state: SpaceState[this._state] });
514
514
  this.stateUpdate.emit();
515
515
  }
@@ -66,11 +66,11 @@ export class SpacesServiceImpl implements SpacesService {
66
66
 
67
67
  if (state) {
68
68
  switch (state) {
69
- case SpaceState.ACTIVE:
69
+ case SpaceState.SPACE_ACTIVE:
70
70
  await space.activate();
71
71
  break;
72
72
 
73
- case SpaceState.INACTIVE:
73
+ case SpaceState.SPACE_INACTIVE:
74
74
  await space.deactivate();
75
75
  break;
76
76
  default:
@@ -324,7 +324,7 @@ export class SpacesServiceImpl implements SpacesService {
324
324
  const dataSpaceManager = await this._getDataSpaceManager();
325
325
  const identity = this._identityManager.identity?.identityKey.truncate();
326
326
  if (identity) {
327
- trace.metrics.gauge('echo.space.count', dataSpaceManager.spaces.size, {
327
+ trace.metrics.gauge('dxos.echo.space.count', dataSpaceManager.spaces.size, {
328
328
  tags: { identity },
329
329
  });
330
330
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const DXOS_VERSION = "0.6.3-main.9e4e207";
1
+ export const DXOS_VERSION = "0.6.3-main.a95c491";