@dxos/echo 0.8.2-staging.7ac8446 → 0.8.3-main.672df60
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/README.md +120 -0
- package/dist/lib/browser/index.mjs +274 -32
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +276 -28
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +274 -32
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Obj.d.ts +61 -0
- package/dist/types/src/Obj.d.ts.map +1 -0
- package/dist/types/src/Ref.d.ts +15 -0
- package/dist/types/src/Ref.d.ts.map +1 -0
- package/dist/types/src/Relation.d.ts +32 -0
- package/dist/types/src/Relation.d.ts.map +1 -0
- package/dist/types/src/Type.d.ts +80 -42
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/{Database.d.ts → experimental/database.d.ts} +1 -1
- package/dist/types/src/experimental/database.d.ts.map +1 -0
- package/dist/types/src/experimental/index.d.ts +1 -0
- package/dist/types/src/experimental/index.d.ts.map +1 -0
- package/dist/types/src/{Queue.d.ts → experimental/queue.d.ts} +1 -1
- package/dist/types/src/experimental/queue.d.ts.map +1 -0
- package/dist/types/src/{Space.d.ts → experimental/space.d.ts} +1 -1
- package/dist/types/src/experimental/space.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/{api.test.d.ts.map → test/api.test.d.ts.map} +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -15
- package/src/Obj.ts +120 -0
- package/src/Ref.ts +26 -0
- package/src/Relation.ts +74 -0
- package/src/Type.ts +103 -75
- package/src/{Database.ts → experimental/database.ts} +1 -1
- package/src/experimental/index.ts +7 -0
- package/src/{Queue.ts → experimental/queue.ts} +1 -1
- package/src/index.ts +6 -7
- package/src/test/api.test.ts +128 -0
- package/dist/types/src/Database.d.ts.map +0 -1
- package/dist/types/src/Queue.d.ts.map +0 -1
- package/dist/types/src/Space.d.ts.map +0 -1
- package/src/api.test.ts +0 -94
- /package/dist/types/src/{api.test.d.ts → test/api.test.d.ts} +0 -0
- /package/src/{Space.ts → experimental/space.ts} +0 -0
package/README.md
CHANGED
|
@@ -19,3 +19,123 @@ pnpm i @dxos/echo
|
|
|
19
19
|
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
20
20
|
|
|
21
21
|
License: [MIT](./LICENSE) Copyright 2022 © DXOS
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { Type, Obj, Relation, Ref, Query, Filter } from '@dxos/echo';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| | Object | Relation | Ref |
|
|
30
|
+
| ----------------------------- | ------------------------------- | ------------------------------------------- | --------------- |
|
|
31
|
+
| **SCHEMA API** |
|
|
32
|
+
| Define schema | `Type.Obj()` | `Type.Relation()` | `Type.Ref()` |
|
|
33
|
+
| Any schema type | `Type.Obj.Any` | `Type.Relation.Any` | `Type.Ref.Any` |
|
|
34
|
+
| Get DXN (of schema) | `Type.getDXN(schema)` | `Type.getDXN(schema)` | |
|
|
35
|
+
| Get typename (of schema) | `Type.getTypename(schema)` | `Type.getTypename(schema)` | |
|
|
36
|
+
| Get type metadata (of schema) | `Type.getMeta(schema)` | `Type.getMeta(schema)` | |
|
|
37
|
+
| Is mutable schema | `Type.isMutable(schema)` | `Type.isMutable(schema)` |
|
|
38
|
+
| **DATA API** |
|
|
39
|
+
| Any instance type | `Obj.Any` | `Relation.Any` | `Ref.Any` |
|
|
40
|
+
| Create object | `Obj.make(Schema, { ... })` | `Relation.make(Schema, { ... })` | `Ref.make(obj)` |
|
|
41
|
+
| Check kind | `Obj.isObject(x): x is Obj.Any` | `Relation.isRelation(x): x is Relation.Any` | `Ref.isRef(x)` |
|
|
42
|
+
| Check instance of | `Obj.instanceOf(Schema, obj)` | `Obj.instanceOf(Schema, rel)` | |
|
|
43
|
+
| Get schema | `Obj.getSchema(obj)` | `Obj.getSchema(obj)` | |
|
|
44
|
+
| Get DXN (of instance) | `Obj.getDXN(obj)` | `Obj.getDXN(obj)` | |
|
|
45
|
+
| Get typename (of instance) | `Obj.getTypename(obj)` | `Obj.getTypename(obj)` | |
|
|
46
|
+
| Get Meta | `Obj.getMeta(obj)` | `Obj.getMeta(relation)` | |
|
|
47
|
+
| Is deleted | `Obj.isDeleted(obj)` | `Obj.isDeleted(obj)` | |
|
|
48
|
+
| Get relation source | | `Relation.getSource(relation)` |
|
|
49
|
+
| Get relation target | | `Relation.getTarget(relation)` | |
|
|
50
|
+
| Expando | `Expando` |
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
Type.getDXN(schema) == DXN.parse('dxn:type:example.com/type/Person:0.1.0');
|
|
54
|
+
Type.getMeta(schema) == { typename: }
|
|
55
|
+
Type.getTypename(schema) === 'example.com/type/Person'
|
|
56
|
+
Type.getVersion(schema) === '0.1.0'
|
|
57
|
+
|
|
58
|
+
Obj.getDXN(obj) === DXN.parse('dxn:echo:SSSSSSSSSS:XXXXXXXXXXXXX')
|
|
59
|
+
|
|
60
|
+
// We need this for objects that have typename defined, but their schema can't be resolved (Obj.getSchema(obj) === undefined)
|
|
61
|
+
Obj.getSchemaDXN(obj) === DXN.parse('dxn:type:example.com/type/Person:0.1.0');
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated
|
|
65
|
+
**/
|
|
66
|
+
// TODO(dmaretskyi): Consider keeping it as a shorthand for zType.getTypename(Obj.getSchema(obj)) ?? Obj.getSchemaDXN(obj)?.asTypeDXN()?.type`
|
|
67
|
+
Obj.getTypename(obj) === 'example.com/type/Person'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
ISSUE: Create vs live: Is it fundamentally the same thing?
|
|
71
|
+
|
|
72
|
+
## Object construction
|
|
73
|
+
|
|
74
|
+
Option 1:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
Relation.make(EmployeeOf, {
|
|
78
|
+
[Relation.Source]: cyberdyne,
|
|
79
|
+
[Relation.Target]: bill,
|
|
80
|
+
[Obj.Meta]: {
|
|
81
|
+
keys: [{ url: 'acme.com', id: '123' }],
|
|
82
|
+
},
|
|
83
|
+
since: '2022',
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Option 2:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
Obj.make(Contact, {
|
|
91
|
+
name: 'Bill',
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
Relation.make(
|
|
95
|
+
Employee,
|
|
96
|
+
{
|
|
97
|
+
source: cyberdyne,
|
|
98
|
+
target: bill,
|
|
99
|
+
meta: {
|
|
100
|
+
keys: [{ url: 'acme.com', id: '123' }],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
since: '2022',
|
|
105
|
+
},
|
|
106
|
+
);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Object model representation.
|
|
110
|
+
|
|
111
|
+
### JSON serialization
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
Obj.toJSON(obj);
|
|
115
|
+
Obj.fromJSON(json, { graph, db });
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Defines attributes and encoding placed on objects.
|
|
119
|
+
|
|
120
|
+
| | Optional | Runtime prop | Runtime type | JSON prop | JSON type | Description |
|
|
121
|
+
| ------------------- | ----------------------- | -------------------------------------- | ---------------------- | --------------------------- | ---------- | ------------------------------ |
|
|
122
|
+
| Id | No | `id` | `ObjectID` ULID string | `id` | string | Unique object ID |
|
|
123
|
+
| Self DXN | Yes | `Symbol(@dxos/echo/Self)` | `DXN` | `@self` | string | DXN to the object itself |
|
|
124
|
+
| Type | No | `Symbol(@dxos/echo/Type)` | `DXN` | `@type` | string | DXN to the object type |
|
|
125
|
+
| Schema | Yes | `Symbol(@dxos/echo/Schema)` | Effect-Schema | - | | Reference to the object schema |
|
|
126
|
+
| Tombstone marker | Yes | `Symbol(@dxos/echo/Deleted)` | `boolean` | `@deleted` | boolean | Deletion marker |
|
|
127
|
+
| Metadata | Yes | `Symbol(@dxos/echo/Meta)` | Metadata object | `@meta` | object | Metadata section |
|
|
128
|
+
| Entity kind | No | `Symbol(@dxos/echo/EntityKind)` | `EntityKind` | (inferred from other props) | string | Obj vs Relation |
|
|
129
|
+
| Relation Source DXN | No (only on relations) | `Symbol(@dxos/echo/RelationSourceDXN)` | `DXN` | `@relationSource` | DXN string | Relation source DXN |
|
|
130
|
+
| Relation Target DXN | No (only on relations) | `Symbol(@dxos/echo/RelationTargetDXN)` | `DXN` | `@relationTarget` | DXN string | Relation target DXN |
|
|
131
|
+
| Relation Source | Yes (only on relations) | `Symbol(@dxos/echo/RelationSource)` | `Object` | - | | Relation source object |
|
|
132
|
+
| Relation Target | Yes (only on relations) | `Symbol(@dxos/echo/RelationTarget)` | `Object` | - | | Relation target object |
|
|
133
|
+
|
|
134
|
+
> NOTE: All of the API functions can return `undefined` since they are also designed to work with objects outside of the database.
|
|
135
|
+
> TODO: Consider how Database, Hypergraph, and RefResolver are attached to the object.
|
|
136
|
+
|
|
137
|
+
### Value representation
|
|
138
|
+
|
|
139
|
+
| | Runtime | JSON |
|
|
140
|
+
| --------- | ------- | -------------------- |
|
|
141
|
+
| Reference | `Ref` | `{ "/": "dxn:..." }` |
|
|
@@ -5,45 +5,287 @@ var __export = (target, all) => {
|
|
|
5
5
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
// packages/core/echo/echo/src/index.ts
|
|
9
|
-
import { DXN } from "@dxos/keys";
|
|
10
|
-
|
|
11
|
-
// packages/core/echo/echo/src/Database.ts
|
|
12
|
-
var Database_exports = {};
|
|
13
|
-
|
|
14
|
-
// packages/core/echo/echo/src/Queue.ts
|
|
15
|
-
var Queue_exports = {};
|
|
16
|
-
|
|
17
|
-
// packages/core/echo/echo/src/Space.ts
|
|
18
|
-
var Space_exports = {};
|
|
19
|
-
|
|
20
8
|
// packages/core/echo/echo/src/Type.ts
|
|
21
9
|
var Type_exports = {};
|
|
22
10
|
__export(Type_exports, {
|
|
11
|
+
DXN: () => DXN,
|
|
12
|
+
Expando: () => Expando,
|
|
13
|
+
Format: () => Format,
|
|
14
|
+
JsonSchema: () => JsonSchemaType,
|
|
23
15
|
Kind: () => EntityKind,
|
|
16
|
+
Obj: () => Obj,
|
|
24
17
|
ObjectId: () => ObjectId,
|
|
25
|
-
Ref: () =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
getDXN: () =>
|
|
29
|
-
getMeta: () =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
Ref: () => Ref2,
|
|
19
|
+
Relation: () => Relation,
|
|
20
|
+
SpaceId: () => SpaceId,
|
|
21
|
+
getDXN: () => getDXN,
|
|
22
|
+
getMeta: () => getMeta,
|
|
23
|
+
getTypename: () => getTypename,
|
|
24
|
+
getVersion: () => getVersion,
|
|
25
|
+
isMutable: () => isMutable2,
|
|
26
|
+
toJsonSchema: () => toJsonSchema
|
|
27
|
+
});
|
|
28
|
+
import * as EchoSchema from "@dxos/echo-schema";
|
|
29
|
+
import { invariant } from "@dxos/invariant";
|
|
30
|
+
import { EntityKind } from "@dxos/echo-schema";
|
|
31
|
+
import { SpaceId, ObjectId, DXN } from "@dxos/keys";
|
|
32
|
+
import {
|
|
33
|
+
Expando,
|
|
34
|
+
JsonSchemaType,
|
|
35
|
+
toJsonSchema,
|
|
36
|
+
Format
|
|
37
|
+
} from "@dxos/echo-schema";
|
|
38
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Type.ts";
|
|
39
|
+
var Obj = EchoSchema.EchoObject;
|
|
40
|
+
var Relation = EchoSchema.EchoRelation;
|
|
41
|
+
var Ref2 = EchoSchema.Ref;
|
|
42
|
+
var getDXN = (schema) => {
|
|
43
|
+
return EchoSchema.getSchemaDXN(schema);
|
|
44
|
+
};
|
|
45
|
+
var getTypename = (schema) => {
|
|
46
|
+
const typename = EchoSchema.getSchemaTypename(schema);
|
|
47
|
+
invariant(typeof typename === "string" && !typename.startsWith("dxn:"), "Invalid typename", {
|
|
48
|
+
F: __dxlog_file,
|
|
49
|
+
L: 84,
|
|
50
|
+
S: void 0,
|
|
51
|
+
A: [
|
|
52
|
+
"typeof typename === 'string' && !typename.startsWith('dxn:')",
|
|
53
|
+
"'Invalid typename'"
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
return typename;
|
|
57
|
+
};
|
|
58
|
+
var getVersion = (schema) => {
|
|
59
|
+
const version = EchoSchema.getSchemaVersion(schema);
|
|
60
|
+
invariant(typeof version === "string" && version.match(/^\d+\.\d+\.\d+$/), "Invalid version", {
|
|
61
|
+
F: __dxlog_file,
|
|
62
|
+
L: 94,
|
|
63
|
+
S: void 0,
|
|
64
|
+
A: [
|
|
65
|
+
"typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/)",
|
|
66
|
+
"'Invalid version'"
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
return version;
|
|
70
|
+
};
|
|
71
|
+
var getMeta = (schema) => {
|
|
72
|
+
return EchoSchema.getTypeAnnotation(schema);
|
|
73
|
+
};
|
|
74
|
+
var isMutable2 = (schema) => {
|
|
75
|
+
return EchoSchema.isMutable(schema);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// packages/core/echo/echo/src/Obj.ts
|
|
79
|
+
var Obj_exports = {};
|
|
80
|
+
__export(Obj_exports, {
|
|
81
|
+
fromJSON: () => fromJSON,
|
|
82
|
+
getDXN: () => getDXN2,
|
|
83
|
+
getLabel: () => getLabel2,
|
|
84
|
+
getMeta: () => getMeta3,
|
|
85
|
+
getSchema: () => getSchema2,
|
|
86
|
+
getSchemaDXN: () => getSchemaDXN2,
|
|
87
|
+
getTypename: () => getTypename2,
|
|
88
|
+
instanceOf: () => instanceOf,
|
|
89
|
+
isDeleted: () => isDeleted2,
|
|
90
|
+
isObject: () => isObject,
|
|
91
|
+
make: () => make,
|
|
92
|
+
toJSON: () => toJSON
|
|
35
93
|
});
|
|
36
|
-
import {
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
94
|
+
import { Schema } from "effect";
|
|
95
|
+
import * as EchoSchema2 from "@dxos/echo-schema";
|
|
96
|
+
import { assertArgument, invariant as invariant2 } from "@dxos/invariant";
|
|
97
|
+
import * as LiveObject from "@dxos/live-object";
|
|
98
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Obj.ts";
|
|
99
|
+
var make = LiveObject.live;
|
|
100
|
+
var isObject = (obj) => {
|
|
101
|
+
return LiveObject.isLiveObject(obj);
|
|
102
|
+
};
|
|
103
|
+
var instanceOf = (...args) => {
|
|
104
|
+
if (args.length === 1) {
|
|
105
|
+
return (obj) => EchoSchema2.isInstanceOf(args[0], obj);
|
|
106
|
+
}
|
|
107
|
+
return EchoSchema2.isInstanceOf(args[0], args[1]);
|
|
108
|
+
};
|
|
109
|
+
var getSchema2 = EchoSchema2.getSchema;
|
|
110
|
+
var getDXN2 = (obj) => {
|
|
111
|
+
assertArgument(!Schema.isSchema(obj), "Object should not be a schema.");
|
|
112
|
+
const dxn = EchoSchema2.getObjectDXN(obj);
|
|
113
|
+
invariant2(dxn != null, "Invalid object.", {
|
|
114
|
+
F: __dxlog_file2,
|
|
115
|
+
L: 50,
|
|
116
|
+
S: void 0,
|
|
117
|
+
A: [
|
|
118
|
+
"dxn != null",
|
|
119
|
+
"'Invalid object.'"
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
return dxn;
|
|
123
|
+
};
|
|
124
|
+
var getSchemaDXN2 = (obj) => {
|
|
125
|
+
const type = EchoSchema2.getType(obj);
|
|
126
|
+
invariant2(type != null, "Invalid object.", {
|
|
127
|
+
F: __dxlog_file2,
|
|
128
|
+
L: 61,
|
|
129
|
+
S: void 0,
|
|
130
|
+
A: [
|
|
131
|
+
"type != null",
|
|
132
|
+
"'Invalid object.'"
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
return type;
|
|
136
|
+
};
|
|
137
|
+
var getTypename2 = (obj) => {
|
|
138
|
+
const schema = getSchema2(obj);
|
|
139
|
+
if (schema == null) {
|
|
140
|
+
return getSchemaDXN2(obj)?.asTypeDXN()?.type;
|
|
141
|
+
}
|
|
142
|
+
return EchoSchema2.getSchemaTypename(schema);
|
|
143
|
+
};
|
|
144
|
+
var getMeta3 = (obj) => {
|
|
145
|
+
const meta = EchoSchema2.getMeta(obj);
|
|
146
|
+
invariant2(meta != null, "Invalid object.", {
|
|
147
|
+
F: __dxlog_file2,
|
|
148
|
+
L: 82,
|
|
149
|
+
S: void 0,
|
|
150
|
+
A: [
|
|
151
|
+
"meta != null",
|
|
152
|
+
"'Invalid object.'"
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
return meta;
|
|
156
|
+
};
|
|
157
|
+
var isDeleted2 = (obj) => {
|
|
158
|
+
const deleted = EchoSchema2.isDeleted(obj);
|
|
159
|
+
invariant2(typeof deleted === "boolean", "Invalid object.", {
|
|
160
|
+
F: __dxlog_file2,
|
|
161
|
+
L: 89,
|
|
162
|
+
S: void 0,
|
|
163
|
+
A: [
|
|
164
|
+
"typeof deleted === 'boolean'",
|
|
165
|
+
"'Invalid object.'"
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
return deleted;
|
|
169
|
+
};
|
|
170
|
+
var getLabel2 = (obj) => {
|
|
171
|
+
const schema = getSchema2(obj);
|
|
172
|
+
if (schema != null) {
|
|
173
|
+
return EchoSchema2.getLabel(schema, obj);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var toJSON = (obj) => EchoSchema2.objectToJSON(obj);
|
|
177
|
+
var fromJSON = EchoSchema2.objectFromJSON;
|
|
178
|
+
|
|
179
|
+
// packages/core/echo/echo/src/Relation.ts
|
|
180
|
+
var Relation_exports = {};
|
|
181
|
+
__export(Relation_exports, {
|
|
182
|
+
Source: () => Source,
|
|
183
|
+
Target: () => Target,
|
|
184
|
+
getSource: () => getSource,
|
|
185
|
+
getSourceDXN: () => getSourceDXN,
|
|
186
|
+
getTarget: () => getTarget,
|
|
187
|
+
getTargetDXN: () => getTargetDXN,
|
|
188
|
+
isRelation: () => isRelation,
|
|
189
|
+
make: () => make2
|
|
190
|
+
});
|
|
191
|
+
import * as EchoSchema3 from "@dxos/echo-schema";
|
|
192
|
+
import { assertArgument as assertArgument2, invariant as invariant3 } from "@dxos/invariant";
|
|
193
|
+
import { DXN as DXN2 } from "@dxos/keys";
|
|
194
|
+
import * as LiveObject2 from "@dxos/live-object";
|
|
195
|
+
import { assumeType } from "@dxos/util";
|
|
196
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Relation.ts";
|
|
197
|
+
var Source = EchoSchema3.RelationSourceId;
|
|
198
|
+
var Target = EchoSchema3.RelationTargetId;
|
|
199
|
+
var make2 = LiveObject2.live;
|
|
200
|
+
var isRelation = (value) => {
|
|
201
|
+
if (typeof value !== "object" || value === null) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
if (EchoSchema3.ATTR_RELATION_SOURCE in value || EchoSchema3.ATTR_RELATION_TARGET in value) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
const kind = value[EchoSchema3.EntityKindId];
|
|
208
|
+
return kind === EchoSchema3.EntityKind.Relation;
|
|
209
|
+
};
|
|
210
|
+
var getSourceDXN = (value) => {
|
|
211
|
+
assertArgument2(isRelation(value), "Expected a relation");
|
|
212
|
+
assumeType(value);
|
|
213
|
+
const dxn = value[EchoSchema3.RelationSourceDXNId];
|
|
214
|
+
invariant3(dxn instanceof DXN2, void 0, {
|
|
215
|
+
F: __dxlog_file3,
|
|
216
|
+
L: 38,
|
|
217
|
+
S: void 0,
|
|
218
|
+
A: [
|
|
219
|
+
"dxn instanceof DXN",
|
|
220
|
+
""
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
return dxn;
|
|
224
|
+
};
|
|
225
|
+
var getTargetDXN = (value) => {
|
|
226
|
+
assertArgument2(isRelation(value), "Expected a relation");
|
|
227
|
+
assumeType(value);
|
|
228
|
+
const dxn = value[EchoSchema3.RelationTargetDXNId];
|
|
229
|
+
invariant3(dxn instanceof DXN2, void 0, {
|
|
230
|
+
F: __dxlog_file3,
|
|
231
|
+
L: 50,
|
|
232
|
+
S: void 0,
|
|
233
|
+
A: [
|
|
234
|
+
"dxn instanceof DXN",
|
|
235
|
+
""
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
return dxn;
|
|
239
|
+
};
|
|
240
|
+
var getSource = (relation) => {
|
|
241
|
+
assertArgument2(isRelation(relation), "Expected a relation");
|
|
242
|
+
const obj = relation[EchoSchema3.RelationSourceId];
|
|
243
|
+
invariant3(obj !== void 0, `Invalid source: ${relation.id}`, {
|
|
244
|
+
F: __dxlog_file3,
|
|
245
|
+
L: 61,
|
|
246
|
+
S: void 0,
|
|
247
|
+
A: [
|
|
248
|
+
"obj !== undefined",
|
|
249
|
+
"`Invalid source: ${relation.id}`"
|
|
250
|
+
]
|
|
251
|
+
});
|
|
252
|
+
return obj;
|
|
253
|
+
};
|
|
254
|
+
var getTarget = (relation) => {
|
|
255
|
+
assertArgument2(isRelation(relation), "Expected a relation");
|
|
256
|
+
const obj = relation[EchoSchema3.RelationTargetId];
|
|
257
|
+
invariant3(obj !== void 0, `Invalid target: ${relation.id}`, {
|
|
258
|
+
F: __dxlog_file3,
|
|
259
|
+
L: 72,
|
|
260
|
+
S: void 0,
|
|
261
|
+
A: [
|
|
262
|
+
"obj !== undefined",
|
|
263
|
+
"`Invalid target: ${relation.id}`"
|
|
264
|
+
]
|
|
265
|
+
});
|
|
266
|
+
return obj;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// packages/core/echo/echo/src/Ref.ts
|
|
270
|
+
var Ref_exports = {};
|
|
271
|
+
__export(Ref_exports, {
|
|
272
|
+
fromDXN: () => fromDXN,
|
|
273
|
+
isRef: () => isRef,
|
|
274
|
+
make: () => make3
|
|
275
|
+
});
|
|
276
|
+
import * as EchoSchema4 from "@dxos/echo-schema";
|
|
277
|
+
var make3 = EchoSchema4.Ref.make;
|
|
278
|
+
var isRef = EchoSchema4.Ref.isRef;
|
|
279
|
+
var fromDXN = EchoSchema4.Ref.fromDXN;
|
|
280
|
+
|
|
281
|
+
// packages/core/echo/echo/src/index.ts
|
|
282
|
+
import { Filter, Query } from "@dxos/echo-schema";
|
|
42
283
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
284
|
+
Filter,
|
|
285
|
+
Obj_exports as Obj,
|
|
286
|
+
Query,
|
|
287
|
+
Ref_exports as Ref,
|
|
288
|
+
Relation_exports as Relation,
|
|
47
289
|
Type_exports as Type
|
|
48
290
|
};
|
|
49
291
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { DXN } from '@dxos/keys';\n\nexport { DXN };\n\nexport * as Database from './Database';\nexport * as Queue from './Queue';\nexport * as Space from './Space';\nexport * as Type from './Type';\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Database API.\n *\n * @category api namespace\n * @since 0.9.0\n */\nexport declare namespace Database {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Queue API.\n *\n * @category api namespace\n * @since 0.9.0\n */\nexport declare namespace Queue {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Space API.\n *\n * @category api namespace\n * @since 0.9.0\n */\nexport declare namespace Space {}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport {\n type BaseSchema,\n type EchoSchema,\n type Expando as Expando$,\n type ImmutableSchema,\n type JsonSchemaType,\n type TypeMeta,\n EchoObject,\n EntityKind,\n ObjectId,\n Ref as Ref$,\n getTypeAnnotation,\n getSchema,\n getSchemaDXN,\n getSchemaTypename,\n getSchemaVersion,\n isInstanceOf,\n} from '@dxos/echo-schema';\nimport { create as create$, makeRef } from '@dxos/live-object';\n\n// NOTES:\n// - New Echo package and namespaces allow for incremental migration; vastly simplifies imports.\n// - Split into separate ECHO namespaces: Database, Space, Type, Query, Queue.\n// - Example; import { Database, Type, Query, Queue } from '@dxos/echo';\n// - Use `declare namespace` for types (no code is generated). See Effect pattern, where Schema is a namespace, interface, and function.\n// - Test with @dxos/schema/testing types.\n// - Define user (Composer) types in namespace (e.g., of plugin) and drop Type suffix; remove all deprecated Braneframe types.\n\nexport type { TypeMeta as Meta, JsonSchemaType as JsonSchema };\nexport {\n EntityKind as Kind,\n ObjectId,\n getTypeAnnotation as getMeta,\n getSchema,\n getSchemaDXN as getDXN,\n getSchemaTypename as getTypename,\n getSchemaVersion as getVersion,\n isInstanceOf as instanceOf,\n};\n\n/**\n * Type API.\n *\n * @category api namespace\n * @since 0.9.0\n */\nexport declare namespace Type {\n /**\n * A schema that can be extended with arbitrary properties.\n */\n export type Expando = Expando$;\n\n export type Abstract<T = any> = BaseSchema<T>;\n export type ImmutableType<T> = ImmutableSchema<T>;\n export type MutableType<T> = EchoSchema<T>;\n}\n\n//\n// Constructors\n//\n\nexport const ref = makeRef;\nexport const create = create$;\n\n//\n// Combinators\n//\n\n/**\n * Defines an ECHO type.\n *\n * @example\n * ```ts\n * const Org = S.Struct({\n * name: S.String,\n * }).pipe(Type.def({ typename: 'example.com/type/Org', version: '1.0.0' }));\n * ```\n */\nexport const def = (meta: TypeMeta) => EchoObject(meta);\n\n/**\n * Defines a reference to an ECHO object.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Contact = S.Struct({\n * name: S.String,\n * employer: Type.Ref(Org),\n * }).pipe(Type.def({ typename: 'example.com/type/Contact', version: '1.0.0' }));\n * ```\n */\nexport const Ref = <S extends Schema.Schema.AnyNoContext>(self: S) => Ref$<Schema.Schema.Type<S>>(self);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;
|
|
6
|
-
"names": ["DXN", "EchoObject", "
|
|
3
|
+
"sources": ["../../../src/Type.ts", "../../../src/Obj.ts", "../../../src/Relation.ts", "../../../src/Ref.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport type { EncodedReference } from '@dxos/echo-protocol';\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport type * as Keys from '@dxos/keys';\n\n/**\n * ECHO schema.\n */\nexport type Schema = EchoSchema.EchoSchema;\n\n/**\n * EchoObject schema.\n */\nexport const Obj = EchoSchema.EchoObject;\n\n/**\n * EchoRelation schema.\n */\nexport const Relation = EchoSchema.EchoRelation;\n\n/**\n * Ref schema.\n */\nexport const Ref: <S extends Obj.Any>(schema: S) => EchoSchema.Ref$<Schema.Schema.Type<S>> = EchoSchema.Ref;\n\nexport namespace Obj {\n /**\n * Type that represents an arbitrary schema type of an object.\n * NOTE: This is not an instance type.\n */\n // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.\n export type Any = Schema.Schema.AnyNoContext;\n}\n\nexport namespace Relation {\n /**\n * Type that represents an arbitrary schema type of a relation.\n * NOTE: This is not an instance type.\n */\n // TODO(dmaretskyi): If schema was covariant, we could specify props in here, like `id: ObjectId`.\n export type Any = Schema.Schema.AnyNoContext;\n\n /**\n * Get relation target type.\n */\n export type Target<A> = A extends EchoSchema.RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n /**\n * Get relation source type.\n */\n export type Source<A> = A extends EchoSchema.RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n}\n\nexport namespace Ref {\n /**\n * Type that represents an arbitrary schema type of a reference.\n * NOTE: This is not an instance type.\n */\n export type Any = Schema.Schema<EchoSchema.Ref<any>, EncodedReference>;\n}\n\n/**\n * Gets the full DXN of the schema.\n * Will include the version if it's a `type` DXN.\n * @example \"dxn:example.com/type/Person:0.1.0\"\n * @example \"dxn:echo:SSSSSSSSSS:XXXXXXXXXXXXX\"\n */\nexport const getDXN = (schema: Obj.Any | Relation.Any): Keys.DXN | undefined => {\n return EchoSchema.getSchemaDXN(schema);\n};\n\n/**\n * @param schema - Schema to get the typename from.\n * @returns The typename of the schema. Example: `example.com/type/Person`.\n */\nexport const getTypename = (schema: Obj.Any | Relation.Any): string => {\n const typename = EchoSchema.getSchemaTypename(schema);\n invariant(typeof typename === 'string' && !typename.startsWith('dxn:'), 'Invalid typename');\n return typename;\n};\n\n/**\n * Gets the version of the schema.\n * @example 0.1.0\n */\nexport const getVersion = (schema: Obj.Any | Relation.Any): string => {\n const version = EchoSchema.getSchemaVersion(schema);\n invariant(typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/), 'Invalid version');\n return version;\n};\n\n/**\n * ECHO type metadata.\n */\nexport type Meta = EchoSchema.TypeAnnotation;\n\n/**\n * Gets the meta data of the schema.\n */\nexport const getMeta = (schema: Obj.Any | Relation.Any): Meta | undefined => {\n return EchoSchema.getTypeAnnotation(schema);\n};\n\nexport { EntityKind as Kind } from '@dxos/echo-schema';\n\n/**\n * @returns True if the schema is mutable.\n */\nexport const isMutable = (schema: Obj.Any | Relation.Any): boolean => {\n return EchoSchema.isMutable(schema);\n};\n\nexport { SpaceId, ObjectId, DXN } from '@dxos/keys';\n\nexport {\n //\n Expando,\n JsonSchemaType as JsonSchema,\n toJsonSchema,\n Format,\n} from '@dxos/echo-schema';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { assertArgument, invariant } from '@dxos/invariant';\nimport type { DXN } from '@dxos/keys';\nimport * as LiveObject from '@dxos/live-object';\n\nimport type * as Ref from './Ref';\nimport type * as Type from './Type';\n\nexport type Any = EchoSchema.AnyEchoObject;\n\nexport const make = LiveObject.live;\n\n// TODO(dmaretskyi): Currently broken\nexport const isObject = (obj: unknown): obj is Any => {\n return LiveObject.isLiveObject(obj);\n};\n\n/**\n * Check that object or relation is an instance of a schema.\n * @example\n * ```ts\n * const person = Obj.make(Person, { name: 'John' });\n * const isPerson = Obj.instanceOf(Person);\n * isPerson(person); // true\n * ```\n */\nexport const instanceOf: {\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S): (value: unknown) => value is S;\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S, value: unknown): value is S;\n} = ((...args: any[]) => {\n if (args.length === 1) {\n return (obj: unknown) => EchoSchema.isInstanceOf(args[0], obj);\n }\n\n return EchoSchema.isInstanceOf(args[0], args[1]);\n}) as any;\n\nexport const getSchema = EchoSchema.getSchema;\n\n// TODO(dmaretskyi): Allow returning undefined.\nexport const getDXN = (obj: Any): DXN => {\n assertArgument(!Schema.isSchema(obj), 'Object should not be a schema.');\n const dxn = EchoSchema.getObjectDXN(obj);\n invariant(dxn != null, 'Invalid object.');\n return dxn;\n};\n\n/**\n * @returns The DXN of the object's type.\n * @example dxn:example.com/type/Contact:1.0.0\n */\n// TODO(dmaretskyi): Allow returning undefined.\nexport const getSchemaDXN = (obj: Any): DXN => {\n const type = EchoSchema.getType(obj);\n invariant(type != null, 'Invalid object.');\n return type;\n};\n\n/**\n * @returns The typename of the object's type.\n * @example `example.com/type/Contact`\n */\nexport const getTypename = (obj: Any): string | undefined => {\n const schema = getSchema(obj);\n if (schema == null) {\n // Try to extract typename from DXN.\n return getSchemaDXN(obj)?.asTypeDXN()?.type;\n }\n\n return EchoSchema.getSchemaTypename(schema);\n};\n\n// TODO(dmaretskyi): Allow returning undefined.\nexport const getMeta = (obj: Any): EchoSchema.ObjectMeta => {\n const meta = EchoSchema.getMeta(obj);\n invariant(meta != null, 'Invalid object.');\n return meta;\n};\n\n// TODO(dmaretskyi): Default to `false`.\nexport const isDeleted = (obj: Any): boolean => {\n const deleted = EchoSchema.isDeleted(obj);\n invariant(typeof deleted === 'boolean', 'Invalid object.');\n return deleted;\n};\n\nexport const getLabel = (obj: Any): string | undefined => {\n const schema = getSchema(obj);\n if (schema != null) {\n return EchoSchema.getLabel(schema, obj);\n }\n};\n\n/**\n * JSON representation of an object.\n */\nexport type JSON = EchoSchema.ObjectJSON;\n\n/**\n * Converts object to it's JSON representation.\n *\n * The same algorithm is used when calling the standard `JSON.stringify(obj)` function.\n */\nexport const toJSON = (obj: Any): JSON => EchoSchema.objectToJSON(obj);\n\n/**\n * Creates an object from it's json representation.\n * Performs schema validation.\n * References and schema will be resolvable if the `refResolver` is provided.\n *\n * The function need to be async to support resolving the schema as well as the relation endpoints.\n */\nexport const fromJSON: (json: unknown, options?: { refResolver?: Ref.Resolver }) => Promise<Any> =\n EchoSchema.objectFromJSON;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as EchoSchema from '@dxos/echo-schema';\nimport { assertArgument, invariant } from '@dxos/invariant';\nimport { DXN } from '@dxos/keys';\nimport * as LiveObject from '@dxos/live-object';\nimport { assumeType } from '@dxos/util';\n\nexport type Any = EchoSchema.AnyEchoObject & EchoSchema.RelationSourceTargetRefs;\n\nexport const Source = EchoSchema.RelationSourceId;\nexport const Target = EchoSchema.RelationTargetId;\n\nexport const make = LiveObject.live;\n\nexport const isRelation = (value: unknown): value is Any => {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n if (EchoSchema.ATTR_RELATION_SOURCE in value || EchoSchema.ATTR_RELATION_TARGET in value) {\n return true;\n }\n\n const kind = (value as any)[EchoSchema.EntityKindId];\n return kind === EchoSchema.EntityKind.Relation;\n};\n\n/**\n * @returns Relation source DXN.\n * @throws If the object is not a relation.\n */\nexport const getSourceDXN = (value: Any): DXN => {\n assertArgument(isRelation(value), 'Expected a relation');\n assumeType<EchoSchema.InternalObjectProps>(value);\n const dxn = value[EchoSchema.RelationSourceDXNId];\n invariant(dxn instanceof DXN);\n return dxn;\n};\n\n/**\n * @returns Relation target DXN.\n * @throws If the object is not a relation.\n */\nexport const getTargetDXN = (value: Any): DXN => {\n assertArgument(isRelation(value), 'Expected a relation');\n assumeType<EchoSchema.InternalObjectProps>(value);\n const dxn = value[EchoSchema.RelationTargetDXNId];\n invariant(dxn instanceof DXN);\n return dxn;\n};\n\n/**\n * @returns Relation source.\n * @throws If the object is not a relation.\n */\nexport const getSource = <T extends Any>(relation: T): EchoSchema.RelationSource<T> => {\n assertArgument(isRelation(relation), 'Expected a relation');\n const obj = relation[EchoSchema.RelationSourceId];\n invariant(obj !== undefined, `Invalid source: ${relation.id}`);\n return obj;\n};\n\n/**\n * @returns Relation target.\n * @throws If the object is not a relation.\n */\nexport const getTarget = <T extends Any>(relation: T): EchoSchema.RelationTarget<T> => {\n assertArgument(isRelation(relation), 'Expected a relation');\n const obj = relation[EchoSchema.RelationTargetId];\n invariant(obj !== undefined, `Invalid target: ${relation.id}`);\n return obj;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as EchoSchema from '@dxos/echo-schema';\n\nimport type * as Obj from './Obj';\n\nexport type Any = EchoSchema.Ref<Obj.Any>;\n\nexport const make = EchoSchema.Ref.make;\n\nexport const isRef: (value: unknown) => value is Any = EchoSchema.Ref.isRef;\n\n// TODO(dmaretskyi): Consider just allowing `make` to accept DXN.\nexport const fromDXN = EchoSchema.Ref.fromDXN;\n\n/**\n * Extract reference target.\n */\nexport type Target<R extends Any> = R extends EchoSchema.Ref<infer T> ? T : never;\n\n/**\n * Reference resolver.\n */\nexport type Resolver = EchoSchema.RefResolver;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * as Type from './Type';\nexport * as Obj from './Obj';\nexport * as Relation from './Relation';\nexport * as Ref from './Ref';\n\nexport { type Live } from '@dxos/live-object';\nexport { Filter, Query } from '@dxos/echo-schema';\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Ref", "isMutable", "EchoSchema", "invariant", "Kind", "SpaceId", "ObjectId", "DXN", "Expando", "JsonSchema", "toJsonSchema", "Format", "Obj", "EchoObject", "Relation", "EchoRelation", "getDXN", "schema", "getSchemaDXN", "getTypename", "typename", "getSchemaTypename", "startsWith", "getVersion", "version", "getSchemaVersion", "match", "getMeta", "getTypeAnnotation", "getDXN", "getLabel", "getMeta", "getSchema", "getSchemaDXN", "getTypename", "isDeleted", "Schema", "EchoSchema", "assertArgument", "invariant", "LiveObject", "make", "live", "isObject", "obj", "isLiveObject", "instanceOf", "args", "length", "isInstanceOf", "isSchema", "dxn", "getObjectDXN", "type", "getType", "schema", "asTypeDXN", "getSchemaTypename", "meta", "deleted", "toJSON", "objectToJSON", "fromJSON", "objectFromJSON", "make", "EchoSchema", "assertArgument", "invariant", "DXN", "LiveObject", "assumeType", "Source", "RelationSourceId", "Target", "RelationTargetId", "live", "isRelation", "value", "ATTR_RELATION_SOURCE", "ATTR_RELATION_TARGET", "kind", "EntityKindId", "EntityKind", "Relation", "getSourceDXN", "dxn", "RelationSourceDXNId", "getTargetDXN", "RelationTargetDXNId", "getSource", "relation", "obj", "undefined", "id", "getTarget", "make", "EchoSchema", "make", "Ref", "isRef", "fromDXN", "Filter", "Query"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/Type.ts":{"bytes":8839,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Obj.ts":{"bytes":11074,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Relation.ts":{"bytes":8382,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Ref.ts":{"bytes":1707,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":1162,"imports":[{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"},{"path":"packages/core/echo/echo/src/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15270},"packages/core/echo/echo/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["Filter","Obj","Query","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":1927},"packages/core/echo/echo/src/index.ts":{"bytesInOutput":51},"packages/core/echo/echo/src/Obj.ts":{"bytesInOutput":2553},"packages/core/echo/echo/src/Relation.ts":{"bytesInOutput":2508},"packages/core/echo/echo/src/Ref.ts":{"bytesInOutput":276}},"bytes":7883}}}
|