@dxos/client 2.28.3-dev.cb8eaf22 → 2.28.3-dev.d914f2b6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client",
3
- "version": "2.28.3-dev.cb8eaf22",
3
+ "version": "2.28.3-dev.d914f2b6",
4
4
  "license": "MIT",
5
5
  "author": "DXOS.org",
6
6
  "main": "dist/src/index.js",
@@ -10,21 +10,21 @@
10
10
  "src"
11
11
  ],
12
12
  "dependencies": {
13
- "@dxos/async": "2.28.3-dev.cb8eaf22",
14
- "@dxos/codec-protobuf": "2.28.3-dev.cb8eaf22",
15
- "@dxos/config": "2.28.3-dev.cb8eaf22",
16
- "@dxos/credentials": "2.28.3-dev.cb8eaf22",
17
- "@dxos/crypto": "2.28.3-dev.cb8eaf22",
18
- "@dxos/debug": "2.28.3-dev.cb8eaf22",
19
- "@dxos/echo-db": "2.28.3-dev.cb8eaf22",
20
- "@dxos/echo-protocol": "2.28.3-dev.cb8eaf22",
21
- "@dxos/feed-store": "2.28.3-dev.cb8eaf22",
22
- "@dxos/model-factory": "2.28.3-dev.cb8eaf22",
23
- "@dxos/network-manager": "2.28.3-dev.cb8eaf22",
24
- "@dxos/object-model": "2.28.3-dev.cb8eaf22",
25
- "@dxos/protocols": "2.28.3-dev.cb8eaf22",
26
- "@dxos/rpc": "2.28.3-dev.cb8eaf22",
27
- "@dxos/util": "2.28.3-dev.cb8eaf22",
13
+ "@dxos/async": "2.28.3-dev.d914f2b6",
14
+ "@dxos/codec-protobuf": "2.28.3-dev.d914f2b6",
15
+ "@dxos/config": "2.28.3-dev.d914f2b6",
16
+ "@dxos/credentials": "2.28.3-dev.d914f2b6",
17
+ "@dxos/crypto": "2.28.3-dev.d914f2b6",
18
+ "@dxos/debug": "2.28.3-dev.d914f2b6",
19
+ "@dxos/echo-db": "2.28.3-dev.d914f2b6",
20
+ "@dxos/echo-protocol": "2.28.3-dev.d914f2b6",
21
+ "@dxos/feed-store": "2.28.3-dev.d914f2b6",
22
+ "@dxos/model-factory": "2.28.3-dev.d914f2b6",
23
+ "@dxos/network-manager": "2.28.3-dev.d914f2b6",
24
+ "@dxos/object-model": "2.28.3-dev.d914f2b6",
25
+ "@dxos/protocols": "2.28.3-dev.d914f2b6",
26
+ "@dxos/rpc": "2.28.3-dev.d914f2b6",
27
+ "@dxos/util": "2.28.3-dev.d914f2b6",
28
28
  "@polkadot/keyring": "6.11.1",
29
29
  "@polkadot/util": "6.11.1",
30
30
  "@polkadot/util-crypto": "6.11.1",
@@ -41,7 +41,8 @@
41
41
  "uuid": "^8.3.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@dxos/random-access-multi-storage": "2.28.3-dev.cb8eaf22",
44
+ "@dxos/eslint-plugin": "~1.0.26",
45
+ "@dxos/random-access-multi-storage": "2.28.3-dev.d914f2b6",
45
46
  "@dxos/testutils": "2.28.2",
46
47
  "@dxos/toolchain-node-library": "2.28.2",
47
48
  "@types/debug": "^4.1.7",
@@ -52,8 +53,10 @@
52
53
  "@types/mocha": "~8.2.2",
53
54
  "@types/readable-stream": "^2.3.9",
54
55
  "@types/uuid": "~8.3.3",
56
+ "eslint": "^7.12.1",
55
57
  "expect": "~27.0.2",
56
58
  "mocha": "~8.4.0",
59
+ "typescript": "^4.5.2",
57
60
  "wait-for-expect": "^3.0.2"
58
61
  },
59
62
  "publishConfig": {
@@ -49,14 +49,6 @@ export class HaloProxy {
49
49
  return this._profile;
50
50
  }
51
51
 
52
- /**
53
- * Reset the identity and delete all key records.
54
- */
55
- async reset () {
56
- await this._serviceProvider.services.SystemService.reset();
57
- this.profileChanged.emit();
58
- }
59
-
60
52
  // TODO(burdon): Should be part of profile object. Or use standard Result object.
61
53
  subscribeToProfile (cb: () => void): () => void {
62
54
  return this.profileChanged.on(cb);
@@ -71,6 +71,7 @@ export class Party {
71
71
  if (this._database && this._serviceProvider instanceof ClientServiceProxy) {
72
72
  await this._database.init();
73
73
  }
74
+
74
75
  await this._database?.waitForItem({ type: PARTY_ITEM_TYPE });
75
76
  }
76
77
 
@@ -189,7 +190,7 @@ export class Party {
189
190
  }
190
191
 
191
192
  private getPropertiesItem () {
192
- const items = this.database.select({ type: PARTY_ITEM_TYPE }).query().result;
193
+ const items = this.database.select({ type: PARTY_ITEM_TYPE }).query().entities;
193
194
  return items[0];
194
195
  }
195
196
 
@@ -330,10 +330,9 @@ describe('Client', () => {
330
330
  client.registerModel(TestModel);
331
331
 
332
332
  const party = client.echo.queryParties().first;
333
- const selection = party.database.select({ type: 'test' }).query();
334
- await selection.update.waitForCondition(() => selection.result.length > 0);
335
-
336
- const item = selection.expectOne();
333
+ const result = party.database.select({ type: 'test' }).query();
334
+ await result.update.waitForCondition(() => result.entities.length > 0);
335
+ const item = result.expectOne();
337
336
 
338
337
  expect(item.model.getProperty('prop')).toEqual('value1');
339
338
 
@@ -232,6 +232,7 @@ export class Client {
232
232
  @synchronized
233
233
  async reset () {
234
234
  await this.services.SystemService.reset();
235
+ this._halo.profileChanged.emit();
235
236
  this._initialized = false;
236
237
  }
237
238
 
@@ -19,8 +19,8 @@ const getData = (echo: DevtoolsServiceDependencies['echo']): SubscribeToItemsRes
19
19
  items: []
20
20
  };
21
21
 
22
- const { result: items } = party.database.select().query();
23
- for (const item of items) {
22
+ const queryResult = party.database.select().query();
23
+ for (const item of queryResult.entities) {
24
24
  partyInfo.items.push({
25
25
  id: item.id,
26
26
  type: item.type,
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2021 DXOS.org
3
+ //
4
+
5
+ import { Config, Envs, Defaults, Dynamics } from '@dxos/config';
6
+
7
+ /**
8
+ * Helper to build config from the files supported by the config plugins.
9
+ */
10
+ export const configProvider = async () => new Config(await Dynamics(), Envs(), Defaults());
package/src/util/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
+ export * from './config';
5
6
  export * from './createWindowMessagePort';
6
7
  export * from './platform';
7
8
  export * from './subscription';