@dxos/client 2.33.8-dev.8609bc45 → 2.33.9-dev.002e8917

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 (58) hide show
  1. package/dist/browser.js +98368 -0
  2. package/dist/src/api/client.d.ts +2 -2
  3. package/dist/src/api/client.d.ts.map +1 -1
  4. package/dist/src/api/client.js +3 -3
  5. package/dist/src/api/client.js.map +1 -1
  6. package/dist/src/api/client.test.js +4 -4
  7. package/dist/src/api/client.test.js.map +1 -1
  8. package/dist/src/api/invitations/invitation-proxy.js +4 -4
  9. package/dist/src/api/invitations/invitation-proxy.js.map +1 -1
  10. package/dist/src/api/invitations/invitation-request.js +2 -2
  11. package/dist/src/api/invitations/invitation-request.js.map +1 -1
  12. package/dist/src/api/proxies/echo-proxy.js +4 -4
  13. package/dist/src/api/proxies/echo-proxy.js.map +1 -1
  14. package/dist/src/index.d.ts +4 -3
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +8 -14
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/proto/gen/google/protobuf.d.ts +4 -4
  19. package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
  20. package/dist/src/proto/index.d.ts +3 -0
  21. package/dist/src/proto/index.d.ts.map +1 -0
  22. package/dist/src/proto/index.js +35 -0
  23. package/dist/src/proto/index.js.map +1 -0
  24. package/dist/src/proto/substitutions.d.ts +2 -2
  25. package/dist/src/proto/substitutions.d.ts.map +1 -1
  26. package/dist/src/proto/substitutions.js +1 -2
  27. package/dist/src/proto/substitutions.js.map +1 -1
  28. package/dist/src/services/impl/halo.d.ts.map +1 -1
  29. package/dist/src/services/impl/halo.js +14 -12
  30. package/dist/src/services/impl/halo.js.map +1 -1
  31. package/dist/src/services/impl/party.js +6 -6
  32. package/dist/src/services/impl/party.js.map +1 -1
  33. package/dist/src/services/impl/profile.d.ts.map +1 -1
  34. package/dist/src/services/impl/profile.js +6 -5
  35. package/dist/src/services/impl/profile.js.map +1 -1
  36. package/dist/src/services/impl/types.d.ts +1 -1
  37. package/dist/src/services/impl/types.d.ts.map +1 -1
  38. package/dist/src/services/services.test.js +2 -2
  39. package/dist/src/services/services.test.js.map +1 -1
  40. package/dist/src/version.d.ts +1 -1
  41. package/dist/src/version.js +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +37 -22
  44. package/src/api/client.test.ts +2 -2
  45. package/src/api/client.ts +2 -2
  46. package/src/api/invitations/invitation-proxy.ts +1 -1
  47. package/src/api/invitations/invitation-request.ts +1 -1
  48. package/src/api/proxies/echo-proxy.ts +3 -3
  49. package/src/index.ts +13 -3
  50. package/src/proto/gen/google/protobuf.ts +4 -4
  51. package/src/proto/index.ts +6 -0
  52. package/src/proto/substitutions.ts +1 -2
  53. package/src/services/impl/halo.ts +3 -1
  54. package/src/services/impl/party.ts +1 -1
  55. package/src/services/impl/profile.ts +2 -1
  56. package/src/services/impl/types.ts +1 -1
  57. package/src/services/services.test.ts +1 -1
  58. package/src/version.ts +1 -1
package/package.json CHANGED
@@ -1,30 +1,27 @@
1
1
  {
2
2
  "name": "@dxos/client",
3
- "version": "2.33.8-dev.8609bc45",
3
+ "version": "2.33.9-dev.002e8917",
4
4
  "license": "MIT",
5
5
  "author": "DXOS.org",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
8
+ "browser": {
9
+ "./dist/src/index.js": "./dist/browser.js",
10
+ "node:assert": "assert"
11
+ },
8
12
  "files": [
9
13
  "dist",
10
14
  "src"
11
15
  ],
12
16
  "dependencies": {
13
- "@dxos/async": "2.33.8-dev.8609bc45",
14
- "@dxos/codec-protobuf": "2.33.8-dev.8609bc45",
15
- "@dxos/config": "2.33.8-dev.8609bc45",
16
- "@dxos/credentials": "2.33.8-dev.8609bc45",
17
- "@dxos/crypto": "2.33.8-dev.8609bc45",
18
- "@dxos/debug": "2.33.8-dev.8609bc45",
19
- "@dxos/echo-db": "2.33.8-dev.8609bc45",
20
- "@dxos/echo-protocol": "2.33.8-dev.8609bc45",
21
- "@dxos/feed-store": "2.33.8-dev.8609bc45",
22
- "@dxos/model-factory": "2.33.8-dev.8609bc45",
23
- "@dxos/network-manager": "2.33.8-dev.8609bc45",
24
- "@dxos/object-model": "2.33.8-dev.8609bc45",
25
- "@dxos/protocols": "2.33.8-dev.8609bc45",
26
- "@dxos/rpc": "2.33.8-dev.8609bc45",
27
- "@dxos/util": "2.33.8-dev.8609bc45",
17
+ "@dxos/async": "2.33.9-dev.002e8917",
18
+ "@dxos/codec-protobuf": "2.33.9-dev.002e8917",
19
+ "@dxos/config": "2.33.9-dev.002e8917",
20
+ "@dxos/debug": "2.33.9-dev.002e8917",
21
+ "@dxos/model-factory": "2.33.9-dev.002e8917",
22
+ "@dxos/protocols": "2.33.9-dev.002e8917",
23
+ "@dxos/rpc": "2.33.9-dev.002e8917",
24
+ "@dxos/util": "2.33.9-dev.002e8917",
28
25
  "abstract-leveldown": "~7.0.0",
29
26
  "assert": "^2.0.0",
30
27
  "debug": "^4.3.3",
@@ -37,12 +34,20 @@
37
34
  "uuid": "^8.3.2"
38
35
  },
39
36
  "devDependencies": {
37
+ "@dxos/credentials": "2.33.9-dev.002e8917",
38
+ "@dxos/crypto": "2.33.9-dev.002e8917",
39
+ "@dxos/echo-db": "2.33.9-dev.002e8917",
40
+ "@dxos/echo-protocol": "2.33.9-dev.002e8917",
40
41
  "@dxos/eslint-plugin": "~1.0.34",
41
- "@dxos/protocols-toolchain": "2.33.7",
42
- "@dxos/random-access-multi-storage": "2.33.8-dev.8609bc45",
43
- "@dxos/testutils": "2.33.7",
42
+ "@dxos/feed-store": "2.33.9-dev.002e8917",
43
+ "@dxos/network-manager": "2.33.9-dev.002e8917",
44
+ "@dxos/object-model": "2.33.9-dev.002e8917",
45
+ "@dxos/protocols-toolchain": "2.33.8",
46
+ "@dxos/random-access-multi-storage": "2.33.9-dev.002e8917",
47
+ "@dxos/testutils": "2.33.8",
48
+ "@koush/wrtc": "^0.5.3",
44
49
  "@types/debug": "^4.1.7",
45
- "@types/jest": "^26.0.7",
50
+ "@types/jest": "^28.1.6",
46
51
  "@types/level-js": "~4.0.1",
47
52
  "@types/lodash.defaultsdeep": "^4.6.6",
48
53
  "@types/memdown": "^3.0.0",
@@ -52,6 +57,7 @@
52
57
  "@types/uuid": "~8.3.3",
53
58
  "eslint": "^7.12.1",
54
59
  "expect": "~27.0.2",
60
+ "jsonify": "^0.0.0",
55
61
  "mocha": "~8.4.0",
56
62
  "typescript": "^4.7.2",
57
63
  "wait-for-expect": "^3.0.2"
@@ -60,12 +66,21 @@
60
66
  "access": "public"
61
67
  },
62
68
  "toolchain": {
69
+ "bundlePackages": [
70
+ "@dxos/credentials",
71
+ "@dxos/crypto",
72
+ "@dxos/echo-db",
73
+ "@dxos/echo-protocol",
74
+ "@dxos/feed-store",
75
+ "@dxos/network-manager",
76
+ "@dxos/object-model"
77
+ ],
63
78
  "testingFramework": "mocha"
64
79
  },
65
80
  "scripts": {
66
81
  "prebuild": "node -p \"'export const DXOS_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
67
- "build": "npm run prebuild && toolchain build",
68
- "build:test": "toolchain build:test",
82
+ "build": "npm run prebuild && toolchain bundle:library",
83
+ "build:test": "toolchain build:test --bundle",
69
84
  "lint": "toolchain lint",
70
85
  "test": "toolchain test"
71
86
  }
@@ -2,9 +2,9 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
6
5
  import expect from 'expect';
7
6
  import { it as test } from 'mocha';
7
+ import assert from 'node:assert';
8
8
  import waitForExpect from 'wait-for-expect';
9
9
 
10
10
  import { sleep, waitForCondition } from '@dxos/async';
@@ -12,9 +12,9 @@ import { ConfigObject } from '@dxos/config';
12
12
  import { generateSeedPhrase, keyPairFromSeedPhrase } from '@dxos/credentials';
13
13
  import { throwUnhandledRejection } from '@dxos/debug';
14
14
  import { InvitationDescriptor } from '@dxos/echo-db';
15
- import { Timeframe } from '@dxos/echo-protocol';
16
15
  import { TestModel } from '@dxos/model-factory';
17
16
  import { ObjectModel } from '@dxos/object-model';
17
+ import { Timeframe } from '@dxos/protocols';
18
18
  import { createBundledRpcServer, createLinkedPorts } from '@dxos/rpc';
19
19
  import { afterTest } from '@dxos/testutils';
20
20
 
package/src/api/client.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
6
5
  import debug from 'debug';
6
+ import assert from 'node:assert';
7
7
 
8
8
  import { synchronized } from '@dxos/async';
9
9
  import { Config, ConfigObject } from '@dxos/config';
@@ -65,10 +65,10 @@ export class Client {
65
65
  private readonly _options: ClientOptions;
66
66
  private readonly _mode: Runtime.Client.Mode;
67
67
 
68
+ private _initialized = false;
68
69
  private _serviceProvider!: ClientServiceProvider;
69
70
  private _halo!: HaloProxy;
70
71
  private _echo!: EchoProxy;
71
- private _initialized = false;
72
72
 
73
73
  // TODO(burdon): Expose some kind of stable ID (e.g., from HALO).
74
74
 
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
 
7
7
  import { Event, trigger } from '@dxos/async';
8
8
  import { Stream } from '@dxos/codec-protobuf';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
 
7
7
  import { Event } from '@dxos/async';
8
8
  import { raise } from '@dxos/debug';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
 
7
7
  import { Event, latch } from '@dxos/async';
8
8
  import { failUndefined } from '@dxos/debug';
@@ -54,8 +54,8 @@ export class EchoProxy implements Echo {
54
54
  private readonly _serviceProvider: ClientServiceProvider,
55
55
  private readonly _haloProxy: HaloProxy
56
56
  ) {
57
- this._modelFactory =
58
- _serviceProvider instanceof ClientServiceHost ? _serviceProvider.echo.modelFactory : new ModelFactory();
57
+ this._modelFactory = _serviceProvider instanceof ClientServiceHost
58
+ ? _serviceProvider.echo.modelFactory : new ModelFactory();
59
59
 
60
60
  this._modelFactory.registerModel(ObjectModel); // Register object-model by default.
61
61
  }
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export { generateSeedPhrase } from '@dxos/credentials';
6
6
 
7
7
  export {
8
8
  PARTY_ITEM_TYPE, // TODO(burdon): Remove?
9
+ TYPE_SCHEMA,
9
10
  Entity,
10
11
  Item,
11
12
  Link,
@@ -17,7 +18,11 @@ export {
17
18
  InvitationDescriptorType,
18
19
  OpenProgress,
19
20
  PartyMember,
20
- ResultSet
21
+ ResultSet,
22
+ Schema,
23
+ SchemaDef,
24
+ SchemaField,
25
+ SchemaRef
21
26
  } from '@dxos/echo-db';
22
27
 
23
28
  export {
@@ -26,13 +31,18 @@ export {
26
31
  } from '@dxos/echo-protocol';
27
32
 
28
33
  export {
29
- ObjectModel
34
+ ObjectModel,
35
+ OrderedList
30
36
  } from '@dxos/object-model';
31
37
 
32
- export * as proto from './proto/gen';
38
+ // TODO(wittjosiah): Remove.
39
+ export {
40
+ NetworkManager
41
+ } from '@dxos/network-manager';
33
42
 
34
43
  export * from './api';
35
44
  export * from './devtools';
45
+ export * from './proto';
36
46
  export * from './services';
37
47
  export * from './util';
38
48
  export * from './version';
@@ -13,14 +13,14 @@ import * as dxos_halo_keys from "../dxos/halo/keys";
13
13
  import * as dxos_rpc from "../dxos/rpc";
14
14
  export interface Empty {
15
15
  }
16
- export interface Timestamp {
17
- seconds?: string;
18
- nanos?: number;
19
- }
20
16
  export interface Any {
21
17
  type_url?: string;
22
18
  value?: Uint8Array;
23
19
  }
20
+ export interface Timestamp {
21
+ seconds?: string;
22
+ nanos?: number;
23
+ }
24
24
  export interface FileDescriptorSet {
25
25
  file?: FileDescriptorProto[];
26
26
  }
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ export * as proto from './gen';
6
+ export * from './gen/dxos/halo/keys';
@@ -4,9 +4,8 @@
4
4
 
5
5
  import { anySubstitutions, timestampSubstitutions } from '@dxos/codec-protobuf';
6
6
  import { codec, Message } from '@dxos/credentials';
7
- import { timeframeSubstitutions } from '@dxos/echo-protocol';
8
7
  import type { ConnectionEvent } from '@dxos/network-manager';
9
- import { publicKeySubstitutions } from '@dxos/protocols';
8
+ import { publicKeySubstitutions, timeframeSubstitutions } from '@dxos/protocols';
10
9
 
11
10
  export default {
12
11
  ...timestampSubstitutions,
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
 
7
7
  import { Stream } from '@dxos/codec-protobuf';
8
8
  import { ECHO } from '@dxos/echo-db';
@@ -47,6 +47,8 @@ export class HaloService implements IHaloService {
47
47
  assert(await this.echo.halo.keyring.getKey(request.keyRecord.publicKey), 'Key not inserted correctly.');
48
48
  }
49
49
 
50
+ // TODO(burdon): subscribeToContacts or just query/contacts with subscription object.
51
+ // ResultSet vs Stream?
50
52
  subscribeContacts (): Stream<Contacts> {
51
53
  if (this.echo.halo.identity) {
52
54
  return resultSetToStream(this.echo.halo.queryContacts(), (contacts): Contacts => ({ contacts }));
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
  import { v4 } from 'uuid';
7
7
 
8
8
  import { latch } from '@dxos/async';
@@ -2,7 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
5
+ import assert from 'node:assert';
6
6
  import { v4 } from 'uuid';
7
7
 
8
8
  import { latch } from '@dxos/async';
@@ -30,6 +30,7 @@ import { CreateServicesOpts, InviteeInvitation, InviteeInvitations } from './typ
30
30
  export class ProfileService implements IProfileService {
31
31
  private inviteeInvitations: InviteeInvitations = new Map();
32
32
 
33
+ // TODO(burdon): Pass in HALO.
33
34
  constructor (
34
35
  private readonly echo: ECHO
35
36
  ) {}
@@ -3,10 +3,10 @@
3
3
  //
4
4
 
5
5
  import { Config } from '@dxos/config';
6
- import { KeyRecord } from '@dxos/credentials';
7
6
  import { ECHO } from '@dxos/echo-db';
8
7
 
9
8
  import { SignRequest, SignResponse } from '../../proto/gen/dxos/client';
9
+ import { KeyRecord } from '../../proto/gen/dxos/halo/keys';
10
10
 
11
11
  /**
12
12
  * Signer plugin.
@@ -2,8 +2,8 @@
2
2
  // Copyright 2020 DXOS.org
3
3
  //
4
4
 
5
- import assert from 'assert';
6
5
  import { it as test } from 'mocha';
6
+ import assert from 'node:assert';
7
7
 
8
8
  import { latch } from '@dxos/async';
9
9
  import { RpcClosedError } from '@dxos/rpc';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const DXOS_VERSION = "2.33.6";
1
+ export const DXOS_VERSION = "2.33.8";