@dxos/client 2.31.7 → 2.31.8-dev.415661f8
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/src/api/client.d.ts +5 -2
- package/dist/src/api/client.d.ts.map +1 -1
- package/dist/src/api/client.js +6 -7
- package/dist/src/api/client.js.map +1 -1
- package/dist/src/api/client.test.js +2 -2
- package/dist/src/api/client.test.js.map +1 -1
- package/dist/src/api/proxies/echo-proxy.d.ts +4 -2
- package/dist/src/api/proxies/echo-proxy.d.ts.map +1 -1
- package/dist/src/api/proxies/echo-proxy.js +8 -3
- package/dist/src/api/proxies/echo-proxy.js.map +1 -1
- package/dist/src/api/proxies/halo-proxy.d.ts +1 -1
- package/dist/src/api/proxies/halo-proxy.d.ts.map +1 -1
- package/dist/src/api/proxies/halo-proxy.js +1 -1
- package/dist/src/api/proxies/halo-proxy.js.map +1 -1
- package/dist/src/api/proxies/party-proxy.d.ts.map +1 -1
- package/dist/src/api/proxies/party-proxy.js +1 -1
- package/dist/src/api/proxies/party-proxy.js.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +4 -4
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/util/index.d.ts +0 -1
- package/dist/src/util/index.d.ts.map +1 -1
- package/dist/src/util/index.js +0 -1
- package/dist/src/util/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/api/client.test.ts +2 -2
- package/src/api/client.ts +7 -6
- package/src/api/proxies/echo-proxy.ts +12 -5
- package/src/api/proxies/halo-proxy.ts +1 -1
- package/src/api/proxies/party-proxy.ts +2 -1
- package/src/proto/gen/google/protobuf.ts +4 -4
- package/src/util/index.ts +0 -1
- package/src/version.ts +1 -1
- package/dist/src/util/config.d.ts +0 -6
- package/dist/src/util/config.d.ts.map +0 -1
- package/dist/src/util/config.js +0 -14
- package/dist/src/util/config.js.map +0 -1
- package/src/util/config.ts +0 -11
package/src/api/client.ts
CHANGED
|
@@ -81,12 +81,12 @@ export class Client {
|
|
|
81
81
|
this._options = options;
|
|
82
82
|
|
|
83
83
|
if (Object.keys(this._config.values).length > 0 && this._config.values.version !== EXPECTED_CONFIG_VERSION) {
|
|
84
|
-
throw new InvalidConfigurationError(
|
|
84
|
+
throw new InvalidConfigurationError(
|
|
85
|
+
`Invalid config version: ${this._config.values.version} !== ${EXPECTED_CONFIG_VERSION}]`);
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
// TODO(burdon):
|
|
88
|
-
//
|
|
89
|
-
debug.enable(this._config.values.runtime?.client?.debug ?? process.env.DEBUG ?? 'dxos:*:error');
|
|
88
|
+
// TODO(burdon): Library should not set app-level globals.
|
|
89
|
+
// debug.enable(this._config.values.runtime?.client?.debug ?? process.env.DEBUG ?? 'dxos:*:error');
|
|
90
90
|
|
|
91
91
|
this._mode = this._config.get('runtime.client.mode', Runtime.Client.Mode.AUTOMATIC)!;
|
|
92
92
|
log(`mode=${Runtime.Client.Mode[this._mode]}`);
|
|
@@ -99,7 +99,8 @@ export class Client {
|
|
|
99
99
|
info () {
|
|
100
100
|
return {
|
|
101
101
|
initialized: this.initialized,
|
|
102
|
-
echo: this.echo.info()
|
|
102
|
+
echo: this.echo.info(),
|
|
103
|
+
halo: this.halo.info()
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
|
|
@@ -246,6 +247,7 @@ export class Client {
|
|
|
246
247
|
|
|
247
248
|
/**
|
|
248
249
|
* Registers a new ECHO model.
|
|
250
|
+
* @deprecated
|
|
249
251
|
*/
|
|
250
252
|
registerModel (constructor: ModelConstructor<any>): this {
|
|
251
253
|
this._echo.modelFactory.registerModel(constructor);
|
|
@@ -255,7 +257,6 @@ export class Client {
|
|
|
255
257
|
/**
|
|
256
258
|
* Returns devtools context.
|
|
257
259
|
* Used by the DXOS DevTool Extension.
|
|
258
|
-
*
|
|
259
260
|
* This is what gets assigned to `window.__DXOS__` global.
|
|
260
261
|
*/
|
|
261
262
|
getDevtoolsContext (): DevtoolsHook {
|
|
@@ -9,7 +9,7 @@ import { PublicKey } from '@dxos/crypto';
|
|
|
9
9
|
import { failUndefined } from '@dxos/debug';
|
|
10
10
|
import { InvitationDescriptor, PARTY_ITEM_TYPE, ResultSet } from '@dxos/echo-db';
|
|
11
11
|
import { PartyKey, PartySnapshot } from '@dxos/echo-protocol';
|
|
12
|
-
import { ModelFactory } from '@dxos/model-factory';
|
|
12
|
+
import { ModelConstructor, ModelFactory } from '@dxos/model-factory';
|
|
13
13
|
import { ObjectModel } from '@dxos/object-model';
|
|
14
14
|
import { ComplexMap, SubscriptionGroup } from '@dxos/util';
|
|
15
15
|
|
|
@@ -33,6 +33,7 @@ export class PartyInvitation extends Invitation<Party> {
|
|
|
33
33
|
// TODO(burdon): Separate public API form implementation (move comments here).
|
|
34
34
|
export interface Echo {
|
|
35
35
|
info (): { parties: number }
|
|
36
|
+
registerModel (constructor: ModelConstructor<any>): void
|
|
36
37
|
createParty (): Promise<Party>
|
|
37
38
|
cloneParty (snapshot: PartySnapshot): Promise<Party>
|
|
38
39
|
getParty (partyKey: PartyKey): Party | undefined
|
|
@@ -59,6 +60,10 @@ export class EchoProxy implements Echo {
|
|
|
59
60
|
this._modelFactory.registerModel(ObjectModel); // Register object-model by default.
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
toString () {
|
|
64
|
+
return `EchoProxy(${JSON.stringify(this.info())})`;
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
get modelFactory (): ModelFactory {
|
|
63
68
|
return this._modelFactory;
|
|
64
69
|
}
|
|
@@ -71,16 +76,18 @@ export class EchoProxy implements Echo {
|
|
|
71
76
|
throw new Error('Network Manager not available in service proxy.');
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
return `EchoProxy(${JSON.stringify(this.info())})`;
|
|
76
|
-
}
|
|
77
|
-
|
|
79
|
+
// TODO(burdon): Client ID?
|
|
78
80
|
info () {
|
|
79
81
|
return {
|
|
80
82
|
parties: this._parties.size
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
registerModel (constructor: ModelConstructor<any>): this {
|
|
87
|
+
this._modelFactory.registerModel(constructor);
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
|
|
84
91
|
/**
|
|
85
92
|
* @internal
|
|
86
93
|
*/
|
|
@@ -36,6 +36,7 @@ export interface Party {
|
|
|
36
36
|
get isOpen (): boolean
|
|
37
37
|
get isActive (): boolean
|
|
38
38
|
|
|
39
|
+
// TODO(burdon): Verbs should be on same interface.
|
|
39
40
|
get database (): Database
|
|
40
41
|
get select (): Database['select']
|
|
41
42
|
get reduce (): Database['reduce']
|
|
@@ -129,7 +130,7 @@ export class PartyProxy implements Party {
|
|
|
129
130
|
// TODO(burdon): Invert party/database? (e.g., const db = client.connect()).
|
|
130
131
|
get database (): Database {
|
|
131
132
|
if (!this._database) {
|
|
132
|
-
throw Error('Party not open.');
|
|
133
|
+
throw new Error('Party not open.');
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
return this._database;
|
|
@@ -12,14 +12,14 @@ import * as dxos_halo_keys from "../dxos/halo/keys";
|
|
|
12
12
|
import * as dxos_rpc from "../dxos/rpc";
|
|
13
13
|
export interface Empty {
|
|
14
14
|
}
|
|
15
|
-
export interface Timestamp {
|
|
16
|
-
seconds?: string;
|
|
17
|
-
nanos?: number;
|
|
18
|
-
}
|
|
19
15
|
export interface Any {
|
|
20
16
|
type_url?: string;
|
|
21
17
|
value?: Uint8Array;
|
|
22
18
|
}
|
|
19
|
+
export interface Timestamp {
|
|
20
|
+
seconds?: string;
|
|
21
|
+
nanos?: number;
|
|
22
|
+
}
|
|
23
23
|
export interface FileDescriptorSet {
|
|
24
24
|
file?: FileDescriptorProto[];
|
|
25
25
|
}
|
package/src/util/index.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "2.31.
|
|
1
|
+
export const DXOS_VERSION = "2.31.7";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/util/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,cAAc,EAA4B,MAAM,cAAc,CAAC;AAEhF;;GAEG;AAEH,eAAO,MAAM,cAAc,EAAE,cAA6E,CAAC"}
|
package/dist/src/util/config.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2021 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.configProvider = void 0;
|
|
7
|
-
const config_1 = require("@dxos/config");
|
|
8
|
-
/**
|
|
9
|
-
* Helper to build config from the files supported by the config plugins.
|
|
10
|
-
*/
|
|
11
|
-
// TODO(burdon): Remove or rename defaultConfigProvider.
|
|
12
|
-
const configProvider = async () => new config_1.Config(await (0, config_1.Dynamics)(), (0, config_1.Envs)(), (0, config_1.Defaults)());
|
|
13
|
-
exports.configProvider = configProvider;
|
|
14
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/util/config.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,yCAAgF;AAEhF;;GAEG;AACH,wDAAwD;AACjD,MAAM,cAAc,GAAmB,KAAK,IAAI,EAAE,CAAC,IAAI,eAAM,CAAC,MAAM,IAAA,iBAAQ,GAAE,EAAE,IAAA,aAAI,GAAE,EAAE,IAAA,iBAAQ,GAAE,CAAC,CAAC;AAA9F,QAAA,cAAc,kBAAgF"}
|
package/src/util/config.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2021 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Config, ConfigProvider, Envs, Defaults, Dynamics } from '@dxos/config';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Helper to build config from the files supported by the config plugins.
|
|
9
|
-
*/
|
|
10
|
-
// TODO(burdon): Remove or rename defaultConfigProvider.
|
|
11
|
-
export const configProvider: ConfigProvider = async () => new Config(await Dynamics(), Envs(), Defaults());
|