@dxos/client-services 0.4.4-next.e0df51e → 0.4.5-main.4000b4b
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-GJSXXOWH.mjs → chunk-HD5CFBAF.mjs} +46 -72
- package/dist/lib/browser/chunk-HD5CFBAF.mjs.map +7 -0
- 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-CQJYPSCX.cjs → chunk-HCRT3ULU.cjs} +59 -85
- package/dist/lib/node/chunk-HCRT3ULU.cjs.map +7 -0
- package/dist/lib/node/index.cjs +37 -37
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/identity/identity-service.d.ts +1 -1
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +35 -35
- package/src/packlets/identity/identity-service.ts +2 -4
- package/src/packlets/services/service-host.ts +13 -40
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-GJSXXOWH.mjs.map +0 -7
- package/dist/lib/node/chunk-CQJYPSCX.cjs.map +0 -7
|
@@ -31,7 +31,7 @@ __export(testing_exports, {
|
|
|
31
31
|
syncItemsLocal: () => syncItemsLocal
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(testing_exports);
|
|
34
|
-
var
|
|
34
|
+
var import_chunk_HCRT3ULU = require("../../chunk-HCRT3ULU.cjs");
|
|
35
35
|
var import_credentials = require("@dxos/credentials");
|
|
36
36
|
var import_keys = require("@dxos/keys");
|
|
37
37
|
var import_async = require("@dxos/async");
|
|
@@ -209,7 +209,7 @@ var createInvitation = (host, options) => {
|
|
|
209
209
|
authMethod: import_services.Invitation.AuthMethod.NONE,
|
|
210
210
|
...options ?? {}
|
|
211
211
|
};
|
|
212
|
-
if (host instanceof
|
|
212
|
+
if (host instanceof import_chunk_HCRT3ULU.ServiceContext) {
|
|
213
213
|
const hostHandler = host.getInvitationHandler({
|
|
214
214
|
kind: import_services.Invitation.Kind.SPACE,
|
|
215
215
|
...options
|
|
@@ -220,7 +220,7 @@ var createInvitation = (host, options) => {
|
|
|
220
220
|
};
|
|
221
221
|
var acceptInvitation = (guest, invitation) => {
|
|
222
222
|
invitation = sanitizeInvitation(invitation);
|
|
223
|
-
if (guest instanceof
|
|
223
|
+
if (guest instanceof import_chunk_HCRT3ULU.ServiceContext) {
|
|
224
224
|
const guestHandler = guest.getInvitationHandler({
|
|
225
225
|
kind: invitation.kind
|
|
226
226
|
});
|
|
@@ -229,7 +229,7 @@ var acceptInvitation = (guest, invitation) => {
|
|
|
229
229
|
return guest.join(invitation);
|
|
230
230
|
};
|
|
231
231
|
var createServiceHost = (config, signalManagerContext) => {
|
|
232
|
-
return new
|
|
232
|
+
return new import_chunk_HCRT3ULU.ClientServicesHost({
|
|
233
233
|
config,
|
|
234
234
|
signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
|
|
235
235
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
@@ -243,8 +243,8 @@ var createServiceContext = ({ signalContext = new import_messaging.MemorySignalM
|
|
|
243
243
|
signalManager,
|
|
244
244
|
transportFactory: import_network_manager.MemoryTransportFactory
|
|
245
245
|
});
|
|
246
|
-
const modelFactory = (0,
|
|
247
|
-
return new
|
|
246
|
+
const modelFactory = (0, import_chunk_HCRT3ULU.createDefaultModelFactory)();
|
|
247
|
+
return new import_chunk_HCRT3ULU.ServiceContext(storage, networkManager, signalManager, modelFactory);
|
|
248
248
|
};
|
|
249
249
|
var createPeers = async (numPeers) => {
|
|
250
250
|
const signalContext = new import_messaging.MemorySignalManagerContext();
|
|
@@ -328,7 +328,7 @@ var TestPeer = class {
|
|
|
328
328
|
feedStore: this.feedStore,
|
|
329
329
|
networkManager: this.networkManager,
|
|
330
330
|
metadataStore: this.metadataStore,
|
|
331
|
-
modelFactory: (0,
|
|
331
|
+
modelFactory: (0, import_chunk_HCRT3ULU.createDefaultModelFactory)(),
|
|
332
332
|
snapshotStore: this.snapshotStore,
|
|
333
333
|
blobStore: this.blobStore
|
|
334
334
|
});
|
|
@@ -340,7 +340,7 @@ var TestPeer = class {
|
|
|
340
340
|
return this._props.automergeHost ??= new import_echo_pipeline.AutomergeHost(this.storage.createDirectory("automerge"));
|
|
341
341
|
}
|
|
342
342
|
get dataSpaceManager() {
|
|
343
|
-
return this._props.dataSpaceManager ??= new
|
|
343
|
+
return this._props.dataSpaceManager ??= new import_chunk_HCRT3ULU.DataSpaceManager(this.spaceManager, this.metadataStore, new import_echo_pipeline.DataServiceSubscriptions(), this.keyring, this.identity, this.feedStore, this.automergeHost);
|
|
344
344
|
}
|
|
345
345
|
async createIdentity() {
|
|
346
346
|
this._props.signingContext ??= await createSigningContext(this.keyring);
|
|
@@ -8,7 +8,7 @@ export declare class IdentityServiceImpl implements IdentityService {
|
|
|
8
8
|
private readonly _identityManager;
|
|
9
9
|
private readonly _keyring;
|
|
10
10
|
private readonly _onProfileUpdate?;
|
|
11
|
-
constructor(_createIdentity: (params: CreateIdentityOptions
|
|
11
|
+
constructor(_createIdentity: (params: CreateIdentityOptions) => Promise<Identity>, _identityManager: IdentityManager, _keyring: Keyring, _onProfileUpdate?: ((profile: ProfileDocument | undefined) => Promise<void>) | undefined);
|
|
12
12
|
createIdentity(request: CreateIdentityRequest): Promise<Identity>;
|
|
13
13
|
recoverIdentity(request: RecoverIdentityRequest): Promise<Identity>;
|
|
14
14
|
queryIdentity(): Stream<QueryIdentityResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/identity/identity-service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,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AS,KAAK,QAAQ,IAAI,CAAC,aAAA;IAGvF,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKjE,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIzE,aAAa,IAAI,MAAM,CAAC,qBAAqB,CAAC;IAS9C,OAAO,CAAC,YAAY;IAYd,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAO1D,gBAAgB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC;CAWhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAoD,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"service-host.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-host.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOxC,OAAO,EAAE,KAAK,aAAa,EAA0B,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACn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,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,UAAU,CAAC,CAA8B;IACjD,OAAO,CAAC,cAAc,CAAC,CAAyC;IAEhE,OAAO,CAAC,eAAe,CAAkB;IAGzC,OAAO,CAAC,QAAQ,CAAS;IAGzB,OAAO,CAAC,KAAK,CAAS;gBAEV,EACV,MAAM,EACN,YAA0C,EAC1C,gBAAgB,EAChB,aAAa,EACb,OAAO,EAEP,OAAO,EACP,SAAS,GACV,GAAE,wBAA6B;IAiDhC,IAAI,MAAM,YAET;IAED,IAAI,MAAM,uBAET;IAED,IAAI,OAAO,mBAEV;IAED,IAAI,eAAe,oCAElB;IAED,IAAI,WAAW,sDAEd;IAED,IAAI,QAAQ,4BAEX;IAED;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB;IAiC9C,IAAI,CAAC,GAAG,EAAE,OAAO;IA6FjB,KAAK;IAgBL,KAAK;YAYG,eAAe;CAqB9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.5-main.4000b4b";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/client-services",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5-main.4000b4b",
|
|
4
4
|
"description": "DXOS client services implementation",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,44 +22,44 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/context": "0.4.
|
|
30
|
-
"@dxos/credentials": "0.4.
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/echo-
|
|
35
|
-
"@dxos/echo-
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/keyring": "0.4.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/model-factory": "0.4.
|
|
45
|
-
"@dxos/network-manager": "0.4.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/teleport": "0.4.
|
|
51
|
-
"@dxos/teleport-extension-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/util": "0.4.
|
|
57
|
-
"@dxos/websocket-rpc": "0.4.
|
|
25
|
+
"@dxos/async": "0.4.5-main.4000b4b",
|
|
26
|
+
"@dxos/config": "0.4.5-main.4000b4b",
|
|
27
|
+
"@dxos/codec-protobuf": "0.4.5-main.4000b4b",
|
|
28
|
+
"@dxos/client-protocol": "0.4.5-main.4000b4b",
|
|
29
|
+
"@dxos/context": "0.4.5-main.4000b4b",
|
|
30
|
+
"@dxos/credentials": "0.4.5-main.4000b4b",
|
|
31
|
+
"@dxos/debug": "0.4.5-main.4000b4b",
|
|
32
|
+
"@dxos/crypto": "0.4.5-main.4000b4b",
|
|
33
|
+
"@dxos/document-model": "0.4.5-main.4000b4b",
|
|
34
|
+
"@dxos/echo-pipeline": "0.4.5-main.4000b4b",
|
|
35
|
+
"@dxos/echo-db": "0.4.5-main.4000b4b",
|
|
36
|
+
"@dxos/feed-store": "0.4.5-main.4000b4b",
|
|
37
|
+
"@dxos/invariant": "0.4.5-main.4000b4b",
|
|
38
|
+
"@dxos/keyring": "0.4.5-main.4000b4b",
|
|
39
|
+
"@dxos/echo-schema": "0.4.5-main.4000b4b",
|
|
40
|
+
"@dxos/keys": "0.4.5-main.4000b4b",
|
|
41
|
+
"@dxos/log": "0.4.5-main.4000b4b",
|
|
42
|
+
"@dxos/lock-file": "0.4.5-main.4000b4b",
|
|
43
|
+
"@dxos/messaging": "0.4.5-main.4000b4b",
|
|
44
|
+
"@dxos/model-factory": "0.4.5-main.4000b4b",
|
|
45
|
+
"@dxos/network-manager": "0.4.5-main.4000b4b",
|
|
46
|
+
"@dxos/protocols": "0.4.5-main.4000b4b",
|
|
47
|
+
"@dxos/random-access-storage": "0.4.5-main.4000b4b",
|
|
48
|
+
"@dxos/node-std": "0.4.5-main.4000b4b",
|
|
49
|
+
"@dxos/rpc": "0.4.5-main.4000b4b",
|
|
50
|
+
"@dxos/teleport": "0.4.5-main.4000b4b",
|
|
51
|
+
"@dxos/teleport-extension-gossip": "0.4.5-main.4000b4b",
|
|
52
|
+
"@dxos/teleport-extension-object-sync": "0.4.5-main.4000b4b",
|
|
53
|
+
"@dxos/text-model": "0.4.5-main.4000b4b",
|
|
54
|
+
"@dxos/tracing": "0.4.5-main.4000b4b",
|
|
55
|
+
"@dxos/timeframe": "0.4.5-main.4000b4b",
|
|
56
|
+
"@dxos/util": "0.4.5-main.4000b4b",
|
|
57
|
+
"@dxos/websocket-rpc": "0.4.5-main.4000b4b"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/platform": "^1.3.4",
|
|
61
61
|
"@types/readable-stream": "^2.3.9",
|
|
62
|
-
"@dxos/signal": "0.4.
|
|
62
|
+
"@dxos/signal": "0.4.5-main.4000b4b"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
@@ -19,18 +19,16 @@ import { type Presentation, type ProfileDocument } from '@dxos/protocols/proto/d
|
|
|
19
19
|
|
|
20
20
|
import { type CreateIdentityOptions, type IdentityManager } from './identity-manager';
|
|
21
21
|
|
|
22
|
-
const CREATE_PROFILE_WITH_AUTOMERGE_DEFAULT = true;
|
|
23
|
-
|
|
24
22
|
export class IdentityServiceImpl implements IdentityService {
|
|
25
23
|
constructor(
|
|
26
|
-
private readonly _createIdentity: (params: CreateIdentityOptions
|
|
24
|
+
private readonly _createIdentity: (params: CreateIdentityOptions) => Promise<Identity>,
|
|
27
25
|
private readonly _identityManager: IdentityManager,
|
|
28
26
|
private readonly _keyring: Keyring,
|
|
29
27
|
private readonly _onProfileUpdate?: (profile: ProfileDocument | undefined) => Promise<void>,
|
|
30
28
|
) {}
|
|
31
29
|
|
|
32
30
|
async createIdentity(request: CreateIdentityRequest): Promise<Identity> {
|
|
33
|
-
await this._createIdentity(request.profile ?? {}
|
|
31
|
+
await this._createIdentity(request.profile ?? {});
|
|
34
32
|
return this._getIdentity()!;
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -8,7 +8,7 @@ import { type Config } from '@dxos/config';
|
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { DocumentModel } from '@dxos/document-model';
|
|
10
10
|
import { DataServiceImpl } from '@dxos/echo-pipeline';
|
|
11
|
-
import { type TypedObject, base, getRawDoc } from '@dxos/echo-schema';
|
|
11
|
+
import { type TypedObject, base, getRawDoc, type DocStructure } from '@dxos/echo-schema';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
13
|
import { PublicKey } from '@dxos/keys';
|
|
14
14
|
import { log } from '@dxos/log';
|
|
@@ -17,10 +17,10 @@ import { ModelFactory } from '@dxos/model-factory';
|
|
|
17
17
|
import { createSimplePeerTransportFactory, NetworkManager, type TransportFactory } from '@dxos/network-manager';
|
|
18
18
|
import { trace } from '@dxos/protocols';
|
|
19
19
|
import { SystemStatus } from '@dxos/protocols/proto/dxos/client/services';
|
|
20
|
-
import { type EchoObject } from '@dxos/protocols/proto/dxos/echo/object';
|
|
21
20
|
import { type Storage } from '@dxos/random-access-storage';
|
|
22
21
|
import { TextModel } from '@dxos/text-model';
|
|
23
22
|
import { TRACE_PROCESSOR, trace as Trace } from '@dxos/tracing';
|
|
23
|
+
import { assignDeep } from '@dxos/util';
|
|
24
24
|
import { WebsocketRpcClient } from '@dxos/websocket-rpc';
|
|
25
25
|
|
|
26
26
|
import { createDiagnostics } from './diagnostics';
|
|
@@ -42,21 +42,6 @@ export const createDefaultModelFactory = () => {
|
|
|
42
42
|
return new ModelFactory().registerModel(DocumentModel).registerModel(TextModel);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// TODO(wittjosiah): Factor out.
|
|
46
|
-
const createGenesisMutationFromTypedObject = (obj: TypedObject): EchoObject => {
|
|
47
|
-
const snapshot = obj[base]._createSnapshot();
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
objectId: obj[base]._id,
|
|
51
|
-
genesis: {
|
|
52
|
-
modelType: obj[base]._modelConstructor.meta.type,
|
|
53
|
-
},
|
|
54
|
-
snapshot: {
|
|
55
|
-
model: snapshot,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
45
|
export type ClientServicesHostParams = {
|
|
61
46
|
/**
|
|
62
47
|
* Can be omitted if `initialize` is later called.
|
|
@@ -260,7 +245,7 @@ export class ClientServicesHost {
|
|
|
260
245
|
SystemService: this._systemService,
|
|
261
246
|
|
|
262
247
|
IdentityService: new IdentityServiceImpl(
|
|
263
|
-
(params
|
|
248
|
+
(params) => this._createIdentity(params),
|
|
264
249
|
this._serviceContext.identityManager,
|
|
265
250
|
this._serviceContext.keyring,
|
|
266
251
|
(profile) => this._serviceContext.broadcastProfileUpdate(profile),
|
|
@@ -351,36 +336,24 @@ export class ClientServicesHost {
|
|
|
351
336
|
await this._callbacks?.onReset?.();
|
|
352
337
|
}
|
|
353
338
|
|
|
354
|
-
private async _createIdentity(params: CreateIdentityOptions
|
|
339
|
+
private async _createIdentity(params: CreateIdentityOptions) {
|
|
355
340
|
const identity = await this._serviceContext.createIdentity(params);
|
|
356
341
|
|
|
357
342
|
// Setup default space.
|
|
358
343
|
await this._serviceContext.initialized.wait();
|
|
359
344
|
const space = await this._serviceContext.dataSpaceManager!.createSpace();
|
|
360
345
|
|
|
361
|
-
const obj: TypedObject = new Properties(undefined
|
|
346
|
+
const obj: TypedObject = new Properties(undefined);
|
|
362
347
|
obj[defaultKey] = identity.identityKey.toHex();
|
|
363
348
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
} else {
|
|
373
|
-
// TODO(dmaretskyi): Refactor this.
|
|
374
|
-
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
375
|
-
invariant(automergeIndex);
|
|
376
|
-
const document = await this._serviceContext.automergeHost.repo.find(automergeIndex as any);
|
|
377
|
-
await document.whenReady();
|
|
378
|
-
|
|
379
|
-
document.change((doc: any) => {
|
|
380
|
-
doc.objects ??= {};
|
|
381
|
-
doc.objects[obj[base]._id] = getRawDoc(obj).handle.docSync();
|
|
382
|
-
});
|
|
383
|
-
}
|
|
349
|
+
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
350
|
+
invariant(automergeIndex);
|
|
351
|
+
const document = await this._serviceContext.automergeHost.repo.find<DocStructure>(automergeIndex as any);
|
|
352
|
+
await document.whenReady();
|
|
353
|
+
|
|
354
|
+
document.change((doc: DocStructure) => {
|
|
355
|
+
assignDeep(doc, ['objects', obj[base]._id], getRawDoc(obj).handle.docSync());
|
|
356
|
+
});
|
|
384
357
|
|
|
385
358
|
return identity;
|
|
386
359
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.
|
|
1
|
+
export const DXOS_VERSION = "0.4.5-main.4000b4b";
|