@dxos/client-services 0.4.8-main.05fda5d → 0.4.8-main.07ec94b
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-JE57RBNO.mjs → chunk-GMHRKMAU.mjs} +136 -41
- package/dist/lib/browser/{chunk-JE57RBNO.mjs.map → chunk-GMHRKMAU.mjs.map} +4 -4
- 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-4R5TLL7R.cjs → chunk-U2VZM74F.cjs} +148 -57
- package/dist/lib/node/{chunk-4R5TLL7R.cjs.map → chunk-U2VZM74F.cjs.map} +4 -4
- package/dist/lib/node/index.cjs +38 -38
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/indexing/index.d.ts +2 -0
- package/dist/types/src/packlets/indexing/index.d.ts.map +1 -0
- package/dist/types/src/packlets/indexing/util.d.ts +15 -0
- package/dist/types/src/packlets/indexing/util.d.ts.map +1 -0
- package/dist/types/src/packlets/services/service-context.d.ts +2 -1
- package/dist/types/src/packlets/services/service-context.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 +37 -35
- package/src/packlets/indexing/index.ts +5 -0
- package/src/packlets/indexing/util.ts +89 -0
- package/src/packlets/services/service-context.ts +13 -2
- package/src/packlets/services/service-host.ts +6 -0
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"service-context.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/services/service-context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAe,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAc,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EACL,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,4BAA4B,EAElC,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,kBAAkB,EAClB,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,KAAK,6BAA6B,EAAuB,MAAM,WAAW,CAAC;AAEtG,MAAM,MAAM,2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B,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;YAUnD,eAAe;YAMf,oBAAoB;YAUpB,WAAW;CAgE1B"}
|
|
@@ -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;
|
|
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;AAQxC,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;AAGhH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAO3D,OAAO,EAAE,cAAc,EAAE,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAarD,eAAO,MAAM,yBAAyB,oBAErC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO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C,gBAAgB,EAChB,aAAa,EACb,OAAO,EAEP,OAAO,EACP,SAAS,EACT,aAAa,GACd,GAAE,wBAA6B;IAkDhC,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;IA0GjB,KAAK;IAgBL,KAAK;YAYG,eAAe;CAqB9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DXOS_VERSION = "0.4.8-main.
|
|
1
|
+
export declare const DXOS_VERSION = "0.4.8-main.07ec94b";
|
|
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.8-main.
|
|
3
|
+
"version": "0.4.8-main.07ec94b",
|
|
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,46 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"platform": "^1.3.6",
|
|
25
|
-
"@dxos/async": "0.4.8-main.
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/config": "0.4.8-main.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo-pipeline": "0.4.8-main.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/protocols": "0.4.8-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/teleport
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/timeframe": "0.4.8-main.
|
|
57
|
-
"@dxos/
|
|
25
|
+
"@dxos/async": "0.4.8-main.07ec94b",
|
|
26
|
+
"@dxos/automerge": "0.4.8-main.07ec94b",
|
|
27
|
+
"@dxos/client-protocol": "0.4.8-main.07ec94b",
|
|
28
|
+
"@dxos/codec-protobuf": "0.4.8-main.07ec94b",
|
|
29
|
+
"@dxos/config": "0.4.8-main.07ec94b",
|
|
30
|
+
"@dxos/context": "0.4.8-main.07ec94b",
|
|
31
|
+
"@dxos/credentials": "0.4.8-main.07ec94b",
|
|
32
|
+
"@dxos/crypto": "0.4.8-main.07ec94b",
|
|
33
|
+
"@dxos/debug": "0.4.8-main.07ec94b",
|
|
34
|
+
"@dxos/document-model": "0.4.8-main.07ec94b",
|
|
35
|
+
"@dxos/echo-db": "0.4.8-main.07ec94b",
|
|
36
|
+
"@dxos/echo-pipeline": "0.4.8-main.07ec94b",
|
|
37
|
+
"@dxos/feed-store": "0.4.8-main.07ec94b",
|
|
38
|
+
"@dxos/echo-schema": "0.4.8-main.07ec94b",
|
|
39
|
+
"@dxos/indexing": "0.4.8-main.07ec94b",
|
|
40
|
+
"@dxos/invariant": "0.4.8-main.07ec94b",
|
|
41
|
+
"@dxos/keyring": "0.4.8-main.07ec94b",
|
|
42
|
+
"@dxos/keys": "0.4.8-main.07ec94b",
|
|
43
|
+
"@dxos/lock-file": "0.4.8-main.07ec94b",
|
|
44
|
+
"@dxos/log": "0.4.8-main.07ec94b",
|
|
45
|
+
"@dxos/messaging": "0.4.8-main.07ec94b",
|
|
46
|
+
"@dxos/model-factory": "0.4.8-main.07ec94b",
|
|
47
|
+
"@dxos/network-manager": "0.4.8-main.07ec94b",
|
|
48
|
+
"@dxos/protocols": "0.4.8-main.07ec94b",
|
|
49
|
+
"@dxos/node-std": "0.4.8-main.07ec94b",
|
|
50
|
+
"@dxos/random-access-storage": "0.4.8-main.07ec94b",
|
|
51
|
+
"@dxos/rpc": "0.4.8-main.07ec94b",
|
|
52
|
+
"@dxos/teleport": "0.4.8-main.07ec94b",
|
|
53
|
+
"@dxos/teleport-extension-gossip": "0.4.8-main.07ec94b",
|
|
54
|
+
"@dxos/teleport-extension-object-sync": "0.4.8-main.07ec94b",
|
|
55
|
+
"@dxos/text-model": "0.4.8-main.07ec94b",
|
|
56
|
+
"@dxos/timeframe": "0.4.8-main.07ec94b",
|
|
57
|
+
"@dxos/tracing": "0.4.8-main.07ec94b",
|
|
58
|
+
"@dxos/util": "0.4.8-main.07ec94b",
|
|
59
|
+
"@dxos/websocket-rpc": "0.4.8-main.07ec94b"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@types/platform": "^1.3.4",
|
|
61
63
|
"@types/readable-stream": "^2.3.9",
|
|
62
|
-
"@dxos/signal": "0.4.8-main.
|
|
64
|
+
"@dxos/signal": "0.4.8-main.07ec94b"
|
|
63
65
|
},
|
|
64
66
|
"publishConfig": {
|
|
65
67
|
"access": "public"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { getHeads } from '@dxos/automerge/automerge';
|
|
6
|
+
import { type DocHandle } from '@dxos/automerge/automerge-repo';
|
|
7
|
+
import { warnAfterTimeout } from '@dxos/debug';
|
|
8
|
+
import { type AutomergeHost } from '@dxos/echo-pipeline';
|
|
9
|
+
import { type ObjectSnapshot } from '@dxos/indexing';
|
|
10
|
+
import { idCodec } from '@dxos/protocols';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Factory for `loadDocuments` iterator.
|
|
14
|
+
*/
|
|
15
|
+
export const createLoadDocuments = (automergeHost: AutomergeHost) =>
|
|
16
|
+
/**
|
|
17
|
+
* Get object data blobs from Automerge Repo by ids.
|
|
18
|
+
* @param ids
|
|
19
|
+
*/
|
|
20
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
21
|
+
async function* loadDocuments(ids: string[]) {
|
|
22
|
+
for (const id of ids) {
|
|
23
|
+
const { documentId, objectId } = idCodec.decode(id);
|
|
24
|
+
const handle = automergeHost.repo.find(documentId as any);
|
|
25
|
+
await warnAfterTimeout(5000, 'to long to load doc', () => handle.whenReady());
|
|
26
|
+
const doc = handle.docSync();
|
|
27
|
+
const heads = getHeads(doc);
|
|
28
|
+
yield [{ id, object: doc.objects[objectId], currentHash: heads.at(-1)! }];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Factory for `getAllDocuments` iterator.
|
|
34
|
+
*/
|
|
35
|
+
export const createGetAllDocuments = (automergeHost: AutomergeHost) =>
|
|
36
|
+
/**
|
|
37
|
+
* Recursively get all object data blobs from Automerge Repo.
|
|
38
|
+
* @param ids
|
|
39
|
+
*/
|
|
40
|
+
// TODO(mykola): Unload automerge handles after usage.
|
|
41
|
+
async function* getAllDocuments(): AsyncGenerator<ObjectSnapshot[], void, 'done'> {
|
|
42
|
+
/** visited automerge handles */
|
|
43
|
+
const visited = new Set<string>();
|
|
44
|
+
|
|
45
|
+
async function* getObjectsFromHandle(handle: DocHandle<any>): AsyncGenerator<ObjectSnapshot[]> {
|
|
46
|
+
if (visited.has(handle.documentId)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
await warnAfterTimeout(5000, 'to long to load doc', () => handle.whenReady());
|
|
51
|
+
const doc = handle.docSync();
|
|
52
|
+
|
|
53
|
+
const heads = getHeads(doc);
|
|
54
|
+
|
|
55
|
+
if (doc.objects) {
|
|
56
|
+
yield Object.entries(doc.objects as { [key: string]: any }).map(([objectId, object]) => {
|
|
57
|
+
return {
|
|
58
|
+
id: idCodec.encode({ documentId: handle.documentId, objectId }),
|
|
59
|
+
object,
|
|
60
|
+
currentHash: heads.at(-1)!,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (doc.links) {
|
|
66
|
+
for (const id of Object.values(doc.links as { [echoId: string]: string })) {
|
|
67
|
+
if (visited.has(id)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const linkHandle = automergeHost.repo.find(id as any);
|
|
71
|
+
for await (const result of getObjectsFromHandle(linkHandle)) {
|
|
72
|
+
yield result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
visited.add(handle.documentId);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (const handle of Object.values(automergeHost.repo.handles)) {
|
|
81
|
+
if (visited.has(handle.documentId)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
for await (const result of getObjectsFromHandle(handle)) {
|
|
85
|
+
yield result;
|
|
86
|
+
}
|
|
87
|
+
visited.add(handle.documentId);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
SnapshotStore,
|
|
15
15
|
AutomergeHost,
|
|
16
16
|
} from '@dxos/echo-pipeline';
|
|
17
|
-
import { IndexMetadataStore } from '@dxos/echo-schema';
|
|
18
17
|
import { FeedFactory, FeedStore } from '@dxos/feed-store';
|
|
18
|
+
import { IndexMetadataStore, IndexStore, Indexer } from '@dxos/indexing';
|
|
19
19
|
import { invariant } from '@dxos/invariant';
|
|
20
20
|
import { Keyring } from '@dxos/keyring';
|
|
21
21
|
import { PublicKey } from '@dxos/keys';
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
type IdentityManagerRuntimeParams,
|
|
39
39
|
type JoinIdentityParams,
|
|
40
40
|
} from '../identity';
|
|
41
|
+
import { createGetAllDocuments, createLoadDocuments } from '../indexing';
|
|
41
42
|
import {
|
|
42
43
|
DeviceInvitationProtocol,
|
|
43
44
|
InvitationsHandler,
|
|
@@ -70,6 +71,7 @@ export class ServiceContext {
|
|
|
70
71
|
public readonly invitations: InvitationsHandler;
|
|
71
72
|
public readonly automergeHost: AutomergeHost;
|
|
72
73
|
public readonly indexMetadata: IndexMetadataStore;
|
|
74
|
+
public readonly indexer: Indexer;
|
|
73
75
|
|
|
74
76
|
// Initialized after identity is initialized.
|
|
75
77
|
public dataSpaceManager?: DataSpaceManager;
|
|
@@ -92,7 +94,6 @@ export class ServiceContext {
|
|
|
92
94
|
) {
|
|
93
95
|
// TODO(burdon): Move strings to constants.
|
|
94
96
|
this.metadataStore = new MetadataStore(storage.createDirectory('metadata'));
|
|
95
|
-
this.indexMetadata = new IndexMetadataStore({ directory: storage.createDirectory('index-metadata') });
|
|
96
97
|
this.snapshotStore = new SnapshotStore(storage.createDirectory('snapshots'));
|
|
97
98
|
this.blobStore = new BlobStore(storage.createDirectory('blobs'));
|
|
98
99
|
|
|
@@ -125,11 +126,20 @@ export class ServiceContext {
|
|
|
125
126
|
this._runtimeParams as IdentityManagerRuntimeParams,
|
|
126
127
|
);
|
|
127
128
|
|
|
129
|
+
this.indexMetadata = new IndexMetadataStore({ directory: storage.createDirectory('index-metadata') });
|
|
130
|
+
|
|
128
131
|
this.automergeHost = new AutomergeHost({
|
|
129
132
|
directory: storage.createDirectory('automerge'),
|
|
130
133
|
metadata: this.indexMetadata,
|
|
131
134
|
});
|
|
132
135
|
|
|
136
|
+
this.indexer = new Indexer({
|
|
137
|
+
indexStore: new IndexStore({ directory: storage.createDirectory('index-store') }),
|
|
138
|
+
metadataStore: this.indexMetadata,
|
|
139
|
+
loadDocuments: createLoadDocuments(this.automergeHost),
|
|
140
|
+
getAllDocuments: createGetAllDocuments(this.automergeHost),
|
|
141
|
+
});
|
|
142
|
+
|
|
133
143
|
this.invitations = new InvitationsHandler(this.networkManager);
|
|
134
144
|
|
|
135
145
|
// TODO(burdon): _initialize called in multiple places.
|
|
@@ -178,6 +188,7 @@ export class ServiceContext {
|
|
|
178
188
|
await this.signalManager.close();
|
|
179
189
|
this.dataServiceSubscriptions.clear();
|
|
180
190
|
await this.metadataStore.close();
|
|
191
|
+
await this.indexer.destroy();
|
|
181
192
|
log('closed');
|
|
182
193
|
}
|
|
183
194
|
|
|
@@ -9,6 +9,7 @@ import { Context } from '@dxos/context';
|
|
|
9
9
|
import { DocumentModel } from '@dxos/document-model';
|
|
10
10
|
import { DataServiceImpl } from '@dxos/echo-pipeline';
|
|
11
11
|
import { type TypedObject, getRawDoc, type SpaceDoc, getAutomergeObjectCore } from '@dxos/echo-schema';
|
|
12
|
+
import { IndexServiceImpl } from '@dxos/indexing';
|
|
12
13
|
import { invariant } from '@dxos/invariant';
|
|
13
14
|
import { PublicKey } from '@dxos/keys';
|
|
14
15
|
import { log } from '@dxos/log';
|
|
@@ -279,6 +280,11 @@ export class ClientServicesHost {
|
|
|
279
280
|
this._serviceContext.automergeHost,
|
|
280
281
|
),
|
|
281
282
|
|
|
283
|
+
IndexService: new IndexServiceImpl({
|
|
284
|
+
indexer: this._serviceContext.indexer,
|
|
285
|
+
automergeHost: this._serviceContext.automergeHost,
|
|
286
|
+
}),
|
|
287
|
+
|
|
282
288
|
NetworkService: new NetworkServiceImpl(this._serviceContext.networkManager, this._serviceContext.signalManager),
|
|
283
289
|
|
|
284
290
|
LoggingService: this._loggingService,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.4.8-main.
|
|
1
|
+
export const DXOS_VERSION = "0.4.8-main.07ec94b";
|