@dxos/echo 0.8.3-main.672df60 → 0.8.3-main.7f5a14c
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 +25 -23
- package/dist/lib/browser/index.mjs +139 -136
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +134 -132
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +139 -136
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/Key.d.ts +2 -0
- package/dist/types/src/Key.d.ts.map +1 -0
- package/dist/types/src/Obj.d.ts +15 -11
- package/dist/types/src/Obj.d.ts.map +1 -1
- package/dist/types/src/Ref.d.ts +9 -3
- package/dist/types/src/Ref.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +15 -13
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +5 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/Key.ts +5 -0
- package/src/Obj.ts +23 -20
- package/src/Ref.ts +9 -6
- package/src/Type.ts +19 -14
- package/src/index.ts +5 -3
- package/src/test/api.test.ts +17 -2
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,7 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
+
DXN: () => import_keys4.DXN,
|
|
31
32
|
Filter: () => import_echo_schema3.Filter,
|
|
33
|
+
Key: () => Key_exports,
|
|
32
34
|
Obj: () => Obj_exports,
|
|
33
35
|
Query: () => import_echo_schema3.Query,
|
|
34
36
|
Ref: () => Ref_exports,
|
|
@@ -36,118 +38,69 @@ __export(node_exports, {
|
|
|
36
38
|
Type: () => Type_exports
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(node_exports);
|
|
39
|
-
var EchoSchema = __toESM(require("@dxos/echo-schema"));
|
|
40
|
-
var import_invariant = require("@dxos/invariant");
|
|
41
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
42
41
|
var import_keys = require("@dxos/keys");
|
|
43
|
-
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
44
42
|
var import_effect = require("effect");
|
|
45
|
-
var
|
|
46
|
-
var
|
|
43
|
+
var EchoSchema = __toESM(require("@dxos/echo-schema"));
|
|
44
|
+
var import_invariant = require("@dxos/invariant");
|
|
47
45
|
var LiveObject = __toESM(require("@dxos/live-object"));
|
|
46
|
+
var import_util = require("@dxos/util");
|
|
47
|
+
var EchoSchema2 = __toESM(require("@dxos/echo-schema"));
|
|
48
48
|
var EchoSchema3 = __toESM(require("@dxos/echo-schema"));
|
|
49
|
-
var
|
|
49
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
50
50
|
var import_keys2 = require("@dxos/keys");
|
|
51
51
|
var LiveObject2 = __toESM(require("@dxos/live-object"));
|
|
52
|
-
var
|
|
52
|
+
var import_util2 = require("@dxos/util");
|
|
53
53
|
var EchoSchema4 = __toESM(require("@dxos/echo-schema"));
|
|
54
|
+
var import_invariant3 = require("@dxos/invariant");
|
|
55
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
56
|
+
var import_keys3 = require("@dxos/keys");
|
|
57
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
58
|
+
var import_keys4 = require("@dxos/keys");
|
|
54
59
|
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
55
60
|
var __defProp2 = Object.defineProperty;
|
|
56
61
|
var __export2 = (target, all) => {
|
|
57
62
|
for (var name in all)
|
|
58
63
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
59
64
|
};
|
|
60
|
-
var
|
|
61
|
-
__export2(
|
|
62
|
-
DXN: () => import_keys.DXN,
|
|
63
|
-
Expando: () => import_echo_schema2.Expando,
|
|
64
|
-
Format: () => import_echo_schema2.Format,
|
|
65
|
-
JsonSchema: () => import_echo_schema2.JsonSchemaType,
|
|
66
|
-
Kind: () => import_echo_schema.EntityKind,
|
|
67
|
-
Obj: () => Obj,
|
|
65
|
+
var Key_exports = {};
|
|
66
|
+
__export2(Key_exports, {
|
|
68
67
|
ObjectId: () => import_keys.ObjectId,
|
|
69
|
-
|
|
70
|
-
Relation: () => Relation,
|
|
71
|
-
SpaceId: () => import_keys.SpaceId,
|
|
72
|
-
getDXN: () => getDXN,
|
|
73
|
-
getMeta: () => getMeta,
|
|
74
|
-
getTypename: () => getTypename,
|
|
75
|
-
getVersion: () => getVersion,
|
|
76
|
-
isMutable: () => isMutable2,
|
|
77
|
-
toJsonSchema: () => import_echo_schema2.toJsonSchema
|
|
68
|
+
SpaceId: () => import_keys.SpaceId
|
|
78
69
|
});
|
|
79
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Type.ts";
|
|
80
|
-
var Obj = EchoSchema.EchoObject;
|
|
81
|
-
var Relation = EchoSchema.EchoRelation;
|
|
82
|
-
var Ref2 = EchoSchema.Ref;
|
|
83
|
-
var getDXN = (schema) => {
|
|
84
|
-
return EchoSchema.getSchemaDXN(schema);
|
|
85
|
-
};
|
|
86
|
-
var getTypename = (schema) => {
|
|
87
|
-
const typename = EchoSchema.getSchemaTypename(schema);
|
|
88
|
-
(0, import_invariant.invariant)(typeof typename === "string" && !typename.startsWith("dxn:"), "Invalid typename", {
|
|
89
|
-
F: __dxlog_file,
|
|
90
|
-
L: 84,
|
|
91
|
-
S: void 0,
|
|
92
|
-
A: [
|
|
93
|
-
"typeof typename === 'string' && !typename.startsWith('dxn:')",
|
|
94
|
-
"'Invalid typename'"
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
return typename;
|
|
98
|
-
};
|
|
99
|
-
var getVersion = (schema) => {
|
|
100
|
-
const version = EchoSchema.getSchemaVersion(schema);
|
|
101
|
-
(0, import_invariant.invariant)(typeof version === "string" && version.match(/^\d+\.\d+\.\d+$/), "Invalid version", {
|
|
102
|
-
F: __dxlog_file,
|
|
103
|
-
L: 94,
|
|
104
|
-
S: void 0,
|
|
105
|
-
A: [
|
|
106
|
-
"typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/)",
|
|
107
|
-
"'Invalid version'"
|
|
108
|
-
]
|
|
109
|
-
});
|
|
110
|
-
return version;
|
|
111
|
-
};
|
|
112
|
-
var getMeta = (schema) => {
|
|
113
|
-
return EchoSchema.getTypeAnnotation(schema);
|
|
114
|
-
};
|
|
115
|
-
var isMutable2 = (schema) => {
|
|
116
|
-
return EchoSchema.isMutable(schema);
|
|
117
|
-
};
|
|
118
70
|
var Obj_exports = {};
|
|
119
71
|
__export2(Obj_exports, {
|
|
120
72
|
fromJSON: () => fromJSON,
|
|
121
|
-
getDXN: () =>
|
|
73
|
+
getDXN: () => getDXN,
|
|
122
74
|
getLabel: () => getLabel2,
|
|
123
|
-
getMeta: () =>
|
|
75
|
+
getMeta: () => getMeta2,
|
|
124
76
|
getSchema: () => getSchema2,
|
|
125
|
-
|
|
126
|
-
getTypename: () =>
|
|
77
|
+
getTypeDXN: () => getTypeDXN,
|
|
78
|
+
getTypename: () => getTypename,
|
|
127
79
|
instanceOf: () => instanceOf,
|
|
128
80
|
isDeleted: () => isDeleted2,
|
|
129
81
|
isObject: () => isObject,
|
|
130
82
|
make: () => make,
|
|
131
83
|
toJSON: () => toJSON
|
|
132
84
|
});
|
|
133
|
-
var
|
|
85
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Obj.ts";
|
|
134
86
|
var make = LiveObject.live;
|
|
135
87
|
var isObject = (obj) => {
|
|
136
|
-
|
|
88
|
+
(0, import_util.assumeType)(obj);
|
|
89
|
+
return typeof obj === "object" && obj !== null && obj[EchoSchema.EntityKindId] === EchoSchema.EntityKind.Object;
|
|
137
90
|
};
|
|
138
91
|
var instanceOf = (...args) => {
|
|
139
92
|
if (args.length === 1) {
|
|
140
|
-
return (obj) =>
|
|
93
|
+
return (obj) => EchoSchema.isInstanceOf(args[0], obj);
|
|
141
94
|
}
|
|
142
|
-
return
|
|
95
|
+
return EchoSchema.isInstanceOf(args[0], args[1]);
|
|
143
96
|
};
|
|
144
|
-
var getSchema2 =
|
|
145
|
-
var
|
|
146
|
-
(0,
|
|
147
|
-
const dxn =
|
|
148
|
-
(0,
|
|
149
|
-
F:
|
|
150
|
-
L:
|
|
97
|
+
var getSchema2 = EchoSchema.getSchema;
|
|
98
|
+
var getDXN = (obj) => {
|
|
99
|
+
(0, import_invariant.assertArgument)(!import_effect.Schema.isSchema(obj), "Object should not be a schema.");
|
|
100
|
+
const dxn = EchoSchema.getObjectDXN(obj);
|
|
101
|
+
(0, import_invariant.invariant)(dxn != null, "Invalid object.", {
|
|
102
|
+
F: __dxlog_file,
|
|
103
|
+
L: 58,
|
|
151
104
|
S: void 0,
|
|
152
105
|
A: [
|
|
153
106
|
"dxn != null",
|
|
@@ -156,31 +109,19 @@ var getDXN2 = (obj) => {
|
|
|
156
109
|
});
|
|
157
110
|
return dxn;
|
|
158
111
|
};
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
(0, import_invariant2.invariant)(type != null, "Invalid object.", {
|
|
162
|
-
F: __dxlog_file2,
|
|
163
|
-
L: 61,
|
|
164
|
-
S: void 0,
|
|
165
|
-
A: [
|
|
166
|
-
"type != null",
|
|
167
|
-
"'Invalid object.'"
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
return type;
|
|
171
|
-
};
|
|
172
|
-
var getTypename2 = (obj) => {
|
|
112
|
+
var getTypeDXN = EchoSchema.getType;
|
|
113
|
+
var getTypename = (obj) => {
|
|
173
114
|
const schema = getSchema2(obj);
|
|
174
115
|
if (schema == null) {
|
|
175
|
-
return
|
|
116
|
+
return EchoSchema.getType(obj)?.asTypeDXN()?.type;
|
|
176
117
|
}
|
|
177
|
-
return
|
|
118
|
+
return EchoSchema.getSchemaTypename(schema);
|
|
178
119
|
};
|
|
179
|
-
var
|
|
180
|
-
const meta =
|
|
181
|
-
(0,
|
|
182
|
-
F:
|
|
183
|
-
L:
|
|
120
|
+
var getMeta2 = (obj) => {
|
|
121
|
+
const meta = EchoSchema.getMeta(obj);
|
|
122
|
+
(0, import_invariant.invariant)(meta != null, "Invalid object.", {
|
|
123
|
+
F: __dxlog_file,
|
|
124
|
+
L: 86,
|
|
184
125
|
S: void 0,
|
|
185
126
|
A: [
|
|
186
127
|
"meta != null",
|
|
@@ -190,10 +131,10 @@ var getMeta3 = (obj) => {
|
|
|
190
131
|
return meta;
|
|
191
132
|
};
|
|
192
133
|
var isDeleted2 = (obj) => {
|
|
193
|
-
const deleted =
|
|
194
|
-
(0,
|
|
195
|
-
F:
|
|
196
|
-
L:
|
|
134
|
+
const deleted = EchoSchema.isDeleted(obj);
|
|
135
|
+
(0, import_invariant.invariant)(typeof deleted === "boolean", "Invalid object.", {
|
|
136
|
+
F: __dxlog_file,
|
|
137
|
+
L: 93,
|
|
197
138
|
S: void 0,
|
|
198
139
|
A: [
|
|
199
140
|
"typeof deleted === 'boolean'",
|
|
@@ -205,11 +146,22 @@ var isDeleted2 = (obj) => {
|
|
|
205
146
|
var getLabel2 = (obj) => {
|
|
206
147
|
const schema = getSchema2(obj);
|
|
207
148
|
if (schema != null) {
|
|
208
|
-
return
|
|
149
|
+
return EchoSchema.getLabel(schema, obj);
|
|
209
150
|
}
|
|
210
151
|
};
|
|
211
|
-
var toJSON = (obj) =>
|
|
212
|
-
var fromJSON =
|
|
152
|
+
var toJSON = (obj) => EchoSchema.objectToJSON(obj);
|
|
153
|
+
var fromJSON = EchoSchema.objectFromJSON;
|
|
154
|
+
var Ref_exports = {};
|
|
155
|
+
__export2(Ref_exports, {
|
|
156
|
+
Array: () => Array,
|
|
157
|
+
fromDXN: () => fromDXN,
|
|
158
|
+
isRef: () => isRef,
|
|
159
|
+
make: () => make2
|
|
160
|
+
});
|
|
161
|
+
var Array = EchoSchema2.RefArray;
|
|
162
|
+
var isRef = EchoSchema2.Ref.isRef;
|
|
163
|
+
var make2 = EchoSchema2.Ref.make;
|
|
164
|
+
var fromDXN = EchoSchema2.Ref.fromDXN;
|
|
213
165
|
var Relation_exports = {};
|
|
214
166
|
__export2(Relation_exports, {
|
|
215
167
|
Source: () => Source,
|
|
@@ -219,12 +171,12 @@ __export2(Relation_exports, {
|
|
|
219
171
|
getTarget: () => getTarget,
|
|
220
172
|
getTargetDXN: () => getTargetDXN,
|
|
221
173
|
isRelation: () => isRelation,
|
|
222
|
-
make: () =>
|
|
174
|
+
make: () => make3
|
|
223
175
|
});
|
|
224
|
-
var
|
|
176
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Relation.ts";
|
|
225
177
|
var Source = EchoSchema3.RelationSourceId;
|
|
226
178
|
var Target = EchoSchema3.RelationTargetId;
|
|
227
|
-
var
|
|
179
|
+
var make3 = LiveObject2.live;
|
|
228
180
|
var isRelation = (value) => {
|
|
229
181
|
if (typeof value !== "object" || value === null) {
|
|
230
182
|
return false;
|
|
@@ -236,11 +188,11 @@ var isRelation = (value) => {
|
|
|
236
188
|
return kind === EchoSchema3.EntityKind.Relation;
|
|
237
189
|
};
|
|
238
190
|
var getSourceDXN = (value) => {
|
|
239
|
-
(0,
|
|
240
|
-
(0,
|
|
191
|
+
(0, import_invariant2.assertArgument)(isRelation(value), "Expected a relation");
|
|
192
|
+
(0, import_util2.assumeType)(value);
|
|
241
193
|
const dxn = value[EchoSchema3.RelationSourceDXNId];
|
|
242
|
-
(0,
|
|
243
|
-
F:
|
|
194
|
+
(0, import_invariant2.invariant)(dxn instanceof import_keys2.DXN, void 0, {
|
|
195
|
+
F: __dxlog_file2,
|
|
244
196
|
L: 38,
|
|
245
197
|
S: void 0,
|
|
246
198
|
A: [
|
|
@@ -251,11 +203,11 @@ var getSourceDXN = (value) => {
|
|
|
251
203
|
return dxn;
|
|
252
204
|
};
|
|
253
205
|
var getTargetDXN = (value) => {
|
|
254
|
-
(0,
|
|
255
|
-
(0,
|
|
206
|
+
(0, import_invariant2.assertArgument)(isRelation(value), "Expected a relation");
|
|
207
|
+
(0, import_util2.assumeType)(value);
|
|
256
208
|
const dxn = value[EchoSchema3.RelationTargetDXNId];
|
|
257
|
-
(0,
|
|
258
|
-
F:
|
|
209
|
+
(0, import_invariant2.invariant)(dxn instanceof import_keys2.DXN, void 0, {
|
|
210
|
+
F: __dxlog_file2,
|
|
259
211
|
L: 50,
|
|
260
212
|
S: void 0,
|
|
261
213
|
A: [
|
|
@@ -266,10 +218,10 @@ var getTargetDXN = (value) => {
|
|
|
266
218
|
return dxn;
|
|
267
219
|
};
|
|
268
220
|
var getSource = (relation) => {
|
|
269
|
-
(0,
|
|
221
|
+
(0, import_invariant2.assertArgument)(isRelation(relation), "Expected a relation");
|
|
270
222
|
const obj = relation[EchoSchema3.RelationSourceId];
|
|
271
|
-
(0,
|
|
272
|
-
F:
|
|
223
|
+
(0, import_invariant2.invariant)(obj !== void 0, `Invalid source: ${relation.id}`, {
|
|
224
|
+
F: __dxlog_file2,
|
|
273
225
|
L: 61,
|
|
274
226
|
S: void 0,
|
|
275
227
|
A: [
|
|
@@ -280,10 +232,10 @@ var getSource = (relation) => {
|
|
|
280
232
|
return obj;
|
|
281
233
|
};
|
|
282
234
|
var getTarget = (relation) => {
|
|
283
|
-
(0,
|
|
235
|
+
(0, import_invariant2.assertArgument)(isRelation(relation), "Expected a relation");
|
|
284
236
|
const obj = relation[EchoSchema3.RelationTargetId];
|
|
285
|
-
(0,
|
|
286
|
-
F:
|
|
237
|
+
(0, import_invariant2.invariant)(obj !== void 0, `Invalid target: ${relation.id}`, {
|
|
238
|
+
F: __dxlog_file2,
|
|
287
239
|
L: 72,
|
|
288
240
|
S: void 0,
|
|
289
241
|
A: [
|
|
@@ -293,18 +245,68 @@ var getTarget = (relation) => {
|
|
|
293
245
|
});
|
|
294
246
|
return obj;
|
|
295
247
|
};
|
|
296
|
-
var
|
|
297
|
-
__export2(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
248
|
+
var Type_exports = {};
|
|
249
|
+
__export2(Type_exports, {
|
|
250
|
+
DXN: () => import_keys3.DXN,
|
|
251
|
+
Expando: () => import_echo_schema2.Expando,
|
|
252
|
+
Format: () => import_echo_schema2.Format,
|
|
253
|
+
JsonSchema: () => import_echo_schema2.JsonSchemaType,
|
|
254
|
+
Kind: () => import_echo_schema.EntityKind,
|
|
255
|
+
Obj: () => Obj,
|
|
256
|
+
ObjectId: () => import_keys3.ObjectId,
|
|
257
|
+
Ref: () => Ref3,
|
|
258
|
+
Relation: () => Relation,
|
|
259
|
+
SpaceId: () => import_keys3.SpaceId,
|
|
260
|
+
getDXN: () => getDXN2,
|
|
261
|
+
getMeta: () => getMeta3,
|
|
262
|
+
getTypename: () => getTypename2,
|
|
263
|
+
getVersion: () => getVersion,
|
|
264
|
+
isMutable: () => isMutable2,
|
|
265
|
+
toEffectSchema: () => import_echo_schema2.toEffectSchema,
|
|
266
|
+
toJsonSchema: () => import_echo_schema2.toJsonSchema
|
|
301
267
|
});
|
|
302
|
-
var
|
|
303
|
-
var
|
|
304
|
-
var
|
|
268
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/Type.ts";
|
|
269
|
+
var Obj = EchoSchema4.EchoObject;
|
|
270
|
+
var Relation = EchoSchema4.EchoRelation;
|
|
271
|
+
var Ref3 = EchoSchema4.Ref;
|
|
272
|
+
var getDXN2 = (schema) => {
|
|
273
|
+
return EchoSchema4.getSchemaDXN(schema);
|
|
274
|
+
};
|
|
275
|
+
var getTypename2 = (schema) => {
|
|
276
|
+
const typename = EchoSchema4.getSchemaTypename(schema);
|
|
277
|
+
(0, import_invariant3.invariant)(typeof typename === "string" && !typename.startsWith("dxn:"), "Invalid typename", {
|
|
278
|
+
F: __dxlog_file3,
|
|
279
|
+
L: 89,
|
|
280
|
+
S: void 0,
|
|
281
|
+
A: [
|
|
282
|
+
"typeof typename === 'string' && !typename.startsWith('dxn:')",
|
|
283
|
+
"'Invalid typename'"
|
|
284
|
+
]
|
|
285
|
+
});
|
|
286
|
+
return typename;
|
|
287
|
+
};
|
|
288
|
+
var getVersion = (schema) => {
|
|
289
|
+
const version = EchoSchema4.getSchemaVersion(schema);
|
|
290
|
+
(0, import_invariant3.invariant)(typeof version === "string" && version.match(/^\d+\.\d+\.\d+$/), "Invalid version", {
|
|
291
|
+
F: __dxlog_file3,
|
|
292
|
+
L: 99,
|
|
293
|
+
S: void 0,
|
|
294
|
+
A: [
|
|
295
|
+
"typeof version === 'string' && version.match(/^\\d+\\.\\d+\\.\\d+$/)",
|
|
296
|
+
"'Invalid version'"
|
|
297
|
+
]
|
|
298
|
+
});
|
|
299
|
+
return version;
|
|
300
|
+
};
|
|
301
|
+
var getMeta3 = (schema) => {
|
|
302
|
+
return EchoSchema4.getTypeAnnotation(schema);
|
|
303
|
+
};
|
|
304
|
+
var isMutable2 = EchoSchema4.isMutable;
|
|
305
305
|
// Annotate the CommonJS export names for ESM import in node:
|
|
306
306
|
0 && (module.exports = {
|
|
307
|
+
DXN,
|
|
307
308
|
Filter,
|
|
309
|
+
Key,
|
|
308
310
|
Obj,
|
|
309
311
|
Query,
|
|
310
312
|
Ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
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": "
|
|
6
|
-
"names": ["import_echo_schema", "
|
|
3
|
+
"sources": ["../../../src/Key.ts", "../../../src/Obj.ts", "../../../src/Ref.ts", "../../../src/Relation.ts", "../../../src/Type.ts", "../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport { SpaceId, ObjectId } from '@dxos/keys';\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';\nimport { assumeType } from '@dxos/util';\n\nimport type * as Ref from './Ref';\nimport type * as Type from './Type';\n\nexport type Obj<T = any> = EchoSchema.AnyEchoObject & T;\nexport type Any = EchoSchema.AnyEchoObject;\n\nexport const make = LiveObject.live;\n\nexport const isObject = (obj: unknown): obj is Any => {\n assumeType<EchoSchema.InternalObjectProps>(obj);\n return typeof obj === 'object' && obj !== null && obj[EchoSchema.EntityKindId] === EchoSchema.EntityKind.Object;\n};\n\n/**\n * Test if object or relation is an instance of a schema.\n * @example\n * ```ts\n * const john = Obj.make(Person, { name: 'John' });\n * const johnIsPerson = Obj.instanceOf(Person)(john);\n *\n * const isPerson = Obj.instanceOf(Person);\n * if(isPerson(john)) {\n * // john is Person\n * }\n * ```\n */\nexport const instanceOf: {\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S): (value: unknown) => value is Schema.Schema.Type<S>;\n <S extends Type.Relation.Any | Type.Obj.Any>(schema: S, value: unknown): value is Schema.Schema.Type<S>;\n} = ((\n ...args: [schema: Type.Relation.Any | Type.Obj.Any, value: unknown] | [schema: Type.Relation.Any | Type.Obj.Any]\n) => {\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(burdon): Expando does not have a type.\nexport const getTypeDXN = EchoSchema.getType;\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 EchoSchema.getType(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 its 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 its json representation, performing schema validation.\n * References and schemas 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';\n\nimport type * as Obj from './Obj';\n\nexport type Ref<T extends Obj.Any> = EchoSchema.Ref<T>;\nexport type Any = EchoSchema.Ref<Obj.Any>;\n\nexport const Array = EchoSchema.RefArray;\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\nexport const isRef: (value: unknown) => value is Any = EchoSchema.Ref.isRef;\n\nexport const make = EchoSchema.Ref.make;\n\n// TODO(dmaretskyi): Consider just allowing `make` to accept DXN.\nexport const fromDXN = EchoSchema.Ref.fromDXN;\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 { 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// TODO(buurdon): Move to Obj?\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\n/**\n * EchoRelation schema.\n */\nexport const Relation = EchoSchema.EchoRelation;\n\n// TODO(buurdon): Move to Relation?\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\n/**\n * Ref schema.\n */\nexport const Ref: <S extends Obj.Any>(schema: S) => EchoSchema.Ref$<Schema.Schema.Type<S>> = EchoSchema.Ref;\n\nexport interface Ref<T> extends Schema.SchemaClass<EchoSchema.Ref<T>, EncodedReference> {}\n\n// TODO(buurdon): Move to Ref?\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 = EchoSchema.isMutable;\n\nexport { SpaceId, ObjectId, DXN } from '@dxos/keys';\n\nexport {\n //\n Expando,\n // TODO(burdon): Standardize.\n Format,\n JsonSchemaType as JsonSchema,\n toEffectSchema,\n toJsonSchema,\n} from '@dxos/echo-schema';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport * as Key from './Key';\nexport * as Obj from './Obj';\nexport * as Ref from './Ref';\nexport * as Relation from './Relation';\nexport * as Type from './Type';\n\nexport { DXN } from '@dxos/keys';\nexport { Filter, Query } from '@dxos/echo-schema';\nexport { type Live } from '@dxos/live-object';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kBAAkC;ACAlC,oBAAuB;AAEvB,iBAA4B;AAC5B,uBAA0C;AAE1C,iBAA4B;AAC5B,kBAA2B;ACN3B,kBAA4B;ACA5B,kBAA4B;AAC5B,IAAAA,oBAA0C;AAC1C,IAAAC,eAAoB;AACpB,kBAA4B;AAC5B,IAAAC,eAA2B;ACD3B,kBAA4B;AAC5B,IAAA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AACC,WAAAA;AAC1B,QAAM0C,WAAsBvC,YAAAA,kBAAkBH,MAAAA;AAC9CJ,wBAAAA,WAAU,OAAO8C,aAAa,YAAY,CAACA,SAASC,WAAW,MAAA,GAAS,oBAAA;;;;;;;;;AACxE,SAAOD;AACT;AAMO,IAAME,aAAa,CAAC5C,WAAAA;AACzB,QAAM6C,UAAqBC,YAAAA,iBAAiB9C,MAAAA;AAC5CJ,wBAAAA,WAAU,OAAOiD,YAAY,YAAYA,QAAQE,MAAM,iBAAA,GAAoB,mBAAA;;;;;;;;;AAC3E,SAAOF;AACT;AAUO,IAAMtE,WAAU,CAACyB,WAAAA;AACtB,SAAkBgD,YAAAA,kBAAkBhD,MAAAA;AACtC;AAOO,IAAMqC,aAAuBA,YAAAA;",
|
|
6
|
+
"names": ["import_invariant", "import_keys", "import_util", "import_echo_schema", "getLabel", "getMeta", "getSchema", "isDeleted", "make", "live", "isObject", "obj", "assumeType", "EntityKindId", "EntityKind", "Object", "instanceOf", "args", "length", "isInstanceOf", "getDXN", "assertArgument", "Schema", "isSchema", "dxn", "getObjectDXN", "invariant", "getTypeDXN", "getType", "getTypename", "schema", "asTypeDXN", "type", "getSchemaTypename", "meta", "deleted", "toJSON", "objectToJSON", "fromJSON", "objectFromJSON", "Array", "RefArray", "isRef", "Ref", "fromDXN", "Source", "RelationSourceId", "Target", "RelationTargetId", "isRelation", "value", "ATTR_RELATION_SOURCE", "ATTR_RELATION_TARGET", "kind", "Relation", "getSourceDXN", "RelationSourceDXNId", "DXN", "getTargetDXN", "RelationTargetDXNId", "getSource", "relation", "undefined", "id", "getTarget", "ObjectId", "SpaceId", "isMutable", "Obj", "EchoObject", "EchoRelation", "getSchemaDXN", "typename", "startsWith", "getVersion", "version", "getSchemaVersion", "match", "getTypeAnnotation"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/Key.ts":{"bytes":561,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Obj.ts":{"bytes":11506,"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},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/Ref.ts":{"bytes":1965,"imports":[{"path":"@dxos/echo-schema","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/Type.ts":{"bytes":9107,"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/index.ts":{"bytes":1410,"imports":[{"path":"packages/core/echo/echo/src/Key.ts","kind":"import-statement","original":"./Key"},{"path":"packages/core/echo/echo/src/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"packages/core/echo/echo/src/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16246},"packages/core/echo/echo/dist/lib/node/index.cjs":{"imports":[{"path":"@dxos/keys","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/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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/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":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["DXN","Filter","Key","Obj","Query","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/Key.ts":{"bytesInOutput":151},"packages/core/echo/echo/src/index.ts":{"bytesInOutput":93},"packages/core/echo/echo/src/Obj.ts":{"bytesInOutput":2435},"packages/core/echo/echo/src/Ref.ts":{"bytesInOutput":332},"packages/core/echo/echo/src/Relation.ts":{"bytesInOutput":2515},"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":2037}},"bytes":8174}}}
|