@dxos/echo 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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/index.mjs +76 -26
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +77 -25
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +76 -26
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +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 +3 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/type/Obj.d.ts +12 -0
- package/dist/types/src/type/Obj.d.ts.map +1 -0
- package/dist/types/src/type/Ref.d.ts +3 -0
- package/dist/types/src/type/Ref.d.ts.map +1 -0
- package/dist/types/src/type/Relation.d.ts +16 -0
- package/dist/types/src/type/Relation.d.ts.map +1 -0
- package/dist/types/src/type/Type.d.ts +77 -0
- package/dist/types/src/type/Type.d.ts.map +1 -0
- package/dist/types/src/{api.test.d.ts.map → type/api.test.d.ts.map} +1 -1
- package/dist/types/src/type/index.d.ts +5 -0
- package/dist/types/src/type/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- 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 +3 -7
- package/src/type/Obj.ts +18 -0
- package/src/type/Ref.ts +7 -0
- package/src/type/Relation.ts +17 -0
- package/src/type/Type.ts +134 -0
- package/src/type/api.test.ts +128 -0
- package/src/type/index.ts +8 -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/dist/types/src/Type.d.ts +0 -49
- package/dist/types/src/Type.d.ts.map +0 -1
- package/src/Type.ts +0 -99
- package/src/api.test.ts +0 -92
- /package/dist/types/src/{api.test.d.ts → type/api.test.d.ts} +0 -0
- /package/src/{Space.ts → experimental/space.ts} +0 -0
|
@@ -6,44 +6,94 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// packages/core/echo/echo/src/index.ts
|
|
9
|
+
import { Format, FormatEnum } from "@dxos/echo-schema";
|
|
9
10
|
import { DXN } from "@dxos/keys";
|
|
10
11
|
|
|
11
|
-
// packages/core/echo/echo/src/
|
|
12
|
-
var
|
|
12
|
+
// packages/core/echo/echo/src/type/Obj.ts
|
|
13
|
+
var Obj_exports = {};
|
|
14
|
+
__export(Obj_exports, {
|
|
15
|
+
create: () => create,
|
|
16
|
+
getSchema: () => getSchema
|
|
17
|
+
});
|
|
18
|
+
import { getSchema as getSchema$ } from "@dxos/echo-schema";
|
|
19
|
+
import { live as live$ } from "@dxos/live-object";
|
|
20
|
+
var create = live$;
|
|
21
|
+
var getSchema = getSchema$;
|
|
13
22
|
|
|
14
|
-
// packages/core/echo/echo/src/
|
|
15
|
-
var
|
|
23
|
+
// packages/core/echo/echo/src/type/Ref.ts
|
|
24
|
+
var Ref_exports = {};
|
|
25
|
+
__export(Ref_exports, {
|
|
26
|
+
make: () => make
|
|
27
|
+
});
|
|
28
|
+
import { Ref as Ref$ } from "@dxos/echo-schema";
|
|
29
|
+
var make = Ref$.make;
|
|
16
30
|
|
|
17
|
-
// packages/core/echo/echo/src/
|
|
18
|
-
var
|
|
31
|
+
// packages/core/echo/echo/src/type/Relation.ts
|
|
32
|
+
var Relation_exports = {};
|
|
33
|
+
__export(Relation_exports, {
|
|
34
|
+
def: () => def
|
|
35
|
+
});
|
|
36
|
+
import { EchoRelation } from "@dxos/echo-schema";
|
|
37
|
+
var def = EchoRelation;
|
|
19
38
|
|
|
20
|
-
// packages/core/echo/echo/src/Type.ts
|
|
39
|
+
// packages/core/echo/echo/src/type/Type.ts
|
|
21
40
|
var Type_exports = {};
|
|
22
41
|
__export(Type_exports, {
|
|
23
|
-
|
|
42
|
+
Expando: () => Expando,
|
|
43
|
+
Kind: () => Kind,
|
|
24
44
|
ObjectId: () => ObjectId,
|
|
25
45
|
Ref: () => Ref,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
SpaceId: () => SpaceId,
|
|
47
|
+
create: () => create2,
|
|
48
|
+
def: () => def2,
|
|
49
|
+
getDXN: () => getDXN,
|
|
50
|
+
getMeta: () => getMeta,
|
|
51
|
+
getSchema: () => getSchema2,
|
|
52
|
+
getTypename: () => getTypename,
|
|
53
|
+
getVersion: () => getVersion,
|
|
54
|
+
instanceOf: () => instanceOf,
|
|
55
|
+
isMutable: () => isMutable,
|
|
56
|
+
toJsonSchema: () => toJsonSchema
|
|
35
57
|
});
|
|
36
|
-
import { EchoObject, EntityKind, ObjectId
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
58
|
+
import { EchoObject, EntityKind, Expando as Expando$, ObjectId as ObjectId$, Ref as Ref$2, getTypeAnnotation, getSchema as getSchema$2, getSchemaDXN, getSchemaTypename, getSchemaVersion, isInstanceOf, isMutable as isMutable$, toJsonSchema as toJsonSchema$ } from "@dxos/echo-schema";
|
|
59
|
+
import { invariant } from "@dxos/invariant";
|
|
60
|
+
import { SpaceId as SpaceId$ } from "@dxos/keys";
|
|
61
|
+
import { live as live$2 } from "@dxos/live-object";
|
|
62
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/type/Type.ts";
|
|
63
|
+
var SpaceId = SpaceId$;
|
|
64
|
+
var ObjectId = ObjectId$;
|
|
65
|
+
var Ref = (self) => Ref$2(self);
|
|
66
|
+
var Kind = EntityKind;
|
|
67
|
+
var Expando = Expando$;
|
|
68
|
+
var def2 = (meta) => EchoObject(meta);
|
|
69
|
+
var create2 = live$2;
|
|
70
|
+
var getSchema2 = getSchema$2;
|
|
71
|
+
var instanceOf = isInstanceOf;
|
|
72
|
+
var getDXN = getSchemaDXN;
|
|
73
|
+
var getMeta = getTypeAnnotation;
|
|
74
|
+
var getTypename = (schema) => {
|
|
75
|
+
const typename = getSchemaTypename(schema);
|
|
76
|
+
invariant(typename, "Invalid object", {
|
|
77
|
+
F: __dxlog_file,
|
|
78
|
+
L: 129,
|
|
79
|
+
S: void 0,
|
|
80
|
+
A: [
|
|
81
|
+
"typename",
|
|
82
|
+
"'Invalid object'"
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
return typename;
|
|
86
|
+
};
|
|
87
|
+
var getVersion = getSchemaVersion;
|
|
88
|
+
var isMutable = isMutable$;
|
|
89
|
+
var toJsonSchema = toJsonSchema$;
|
|
42
90
|
export {
|
|
43
91
|
DXN,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
Format,
|
|
93
|
+
FormatEnum,
|
|
94
|
+
Obj_exports as Obj,
|
|
95
|
+
Ref_exports as Ref,
|
|
96
|
+
Relation_exports as Relation,
|
|
47
97
|
Type_exports as Type
|
|
48
98
|
};
|
|
49
99
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,WAAW;;;
|
|
6
|
-
"names": ["DXN", "EchoObject", "EntityKind", "ObjectId", "Ref", "Ref$", "getTypeAnnotation", "getSchema", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/type/Obj.ts", "../../../src/type/Ref.ts", "../../../src/type/Relation.ts", "../../../src/type/Type.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport { Format, FormatEnum } from '@dxos/echo-schema';\nexport { DXN } from '@dxos/keys';\n\nexport * from './type';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport { type BaseEchoObject, type BaseObject, getSchema as getSchema$ } from '@dxos/echo-schema';\nimport { live as live$ } from '@dxos/live-object';\n\n// TODO(burdon): Remove from Type?\n\nexport declare namespace Obj {\n export type Any = BaseEchoObject;\n export type Live<T extends BaseObject> = AnyLiveObject$<T>;\n}\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Ref as Ref$ } from '@dxos/echo-schema';\n\nexport const make = Ref$.make;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoRelation, type RelationSourceTargetRefs } from '@dxos/echo-schema';\n\nexport const def = EchoRelation;\n\n/**\n * Get relation target type.\n */\nexport type Target<A> = A extends RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n/**\n * Get relation source type.\n */\nexport type Source<A> = A extends RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport {\n type BaseEchoObject,\n type BaseObject,\n type BaseSchema,\n type EchoSchema,\n EchoObject,\n EntityKind,\n Expando as Expando$,\n type ImmutableSchema,\n type JsonSchemaType,\n ObjectId as ObjectId$,\n Ref as Ref$,\n type StoredSchema,\n type TypeMeta,\n getTypeAnnotation,\n getSchema as getSchema$,\n getSchemaDXN,\n getSchemaTypename,\n getSchemaVersion,\n isInstanceOf,\n isMutable as isMutable$,\n toJsonSchema as toJsonSchema$,\n} from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceId as SpaceId$ } from '@dxos/keys';\nimport { live as live$ } from '@dxos/live-object';\n\n/**\n * Type System API.\n *\n * @category api namespace\n * @since 0.9.0\n */\n\n//\n// Keys\n//\n\nexport const SpaceId = SpaceId$;\nexport type SpaceId = SpaceId$;\n\nexport const ObjectId = ObjectId$;\nexport type ObjectId = ObjectId$;\n\n/**\n * Defines a reference to an ECHO object.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Person = Schema.Struct({\n * name: Schema.String,\n * organization: Type.Ref(Organization),\n * }).pipe(Type.def({\n * typename: 'example.com/type/Person',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const Ref = <S extends Schema.Schema.AnyNoContext>(self: S) => Ref$<Schema.Schema.Type<S>>(self);\n\n//\n// Objects\n//\n\nexport const Kind = EntityKind;\nexport type AnyObject = BaseEchoObject;\nexport type AnyLiveObject<T extends BaseObject> = AnyLiveObject$<T>;\n\n//\n// Schema\n//\n\nexport type JsonSchema = JsonSchemaType;\n\n/**\n * A schema that can be extended with arbitrary properties.\n */\nexport const Expando = Expando$;\nexport type Expando = Expando$;\n\n// TODO(burdon): Review/remove.\nexport type Abstract<T = any> = BaseSchema<T>;\nexport type ImmutableType<T> = ImmutableSchema<T>;\nexport type MutableType<T> = EchoSchema<T>;\nexport type StoredType = StoredSchema;\n\n/**\n * Defines an ECHO type.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Organization = Schema.Struct({\n * name: Schema.String,\n * }).pipe(Type.def({\n * typename: 'example.com/type/Organization',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const def = (meta: TypeMeta) => EchoObject(meta);\n\n//\n// Object utils\n//\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\nexport const instanceOf = isInstanceOf;\n\n//\n// Type utils\n//\n\n// TODO(burdon): Reconcile getDXN and getTypename.\nexport const getDXN = getSchemaDXN;\nexport const getMeta = getTypeAnnotation;\nexport const getTypename = (schema: Schema.Schema.AnyNoContext): string => {\n const typename = getSchemaTypename(schema);\n invariant(typename, 'Invalid object');\n return typename;\n};\nexport const getVersion = getSchemaVersion;\nexport const isMutable = isMutable$;\nexport const toJsonSchema = toJsonSchema$;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,QAAQC,kBAAkB;AACnC,SAASC,WAAW;;;ACLpB;;;;;AAKA,SAA+CC,aAAaC,kBAAkB;AAC9E,SAASC,QAAQC,aAAa;AASvB,IAAMC,SAASC;AAEf,IAAMC,YAAYC;;;ACjBzB;;;;AAIA,SAASC,OAAOC,YAAY;AAErB,IAAMC,OAAOC,KAAKD;;;ACNzB;;;;AAIA,SAASE,oBAAmD;AAErD,IAAMC,MAAMC;;;ACNnB;;;;;;;gBAAAC;EAAA,WAAAC;EAAA;;mBAAAC;EAAA;;;;;;AAOA,SAKEC,YACAC,YACAC,WAAWC,UAGXC,YAAYC,WACZC,OAAOC,OAGPC,mBACAT,aAAaU,aACbC,cACAC,mBACAC,kBACAC,cACAC,aAAaC,YACbC,gBAAgBC,qBACX;AACP,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,gBAAgB;AACpC,SAASC,QAAQC,cAAa;;AAavB,IAAMH,UAAUC;AAGhB,IAAMhB,WAAWC;AAkBjB,IAAMC,MAAM,CAAuCiB,SAAYhB,MAA4BgB,IAAAA;AAM3F,IAAMC,OAAOvB;AAab,IAAMC,UAAUC;AAuBhB,IAAML,OAAM,CAAC2B,SAAmBzB,WAAWyB,IAAAA;AAM3C,IAAM5B,UAASyB;AAEf,IAAMvB,aAAYU;AAClB,IAAMiB,aAAab;AAOnB,IAAMc,SAASjB;AACf,IAAMkB,UAAUpB;AAChB,IAAMqB,cAAc,CAACC,WAAAA;AAC1B,QAAMC,WAAWpB,kBAAkBmB,MAAAA;AACnCZ,YAAUa,UAAU,kBAAA;;;;;;;;;AACpB,SAAOA;AACT;AACO,IAAMC,aAAapB;AACnB,IAAME,YAAYC;AAClB,IAAMC,eAAeC;",
|
|
6
|
+
"names": ["Format", "FormatEnum", "DXN", "getSchema", "getSchema$", "live", "live$", "create", "live$", "getSchema", "getSchema$", "Ref", "Ref$", "make", "Ref$", "EchoRelation", "def", "EchoRelation", "create", "def", "getSchema", "EchoObject", "EntityKind", "Expando", "Expando$", "ObjectId", "ObjectId$", "Ref", "Ref$", "getTypeAnnotation", "getSchema$", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "isMutable", "isMutable$", "toJsonSchema", "toJsonSchema$", "invariant", "SpaceId", "SpaceId$", "live", "live$", "self", "Kind", "meta", "instanceOf", "getDXN", "getMeta", "getTypename", "schema", "typename", "getVersion"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/type/Obj.ts":{"bytes":1448,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Ref.ts":{"bytes":726,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Relation.ts":{"bytes":1122,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Type.ts":{"bytes":8579,"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}],"format":"esm"},"packages/core/echo/echo/src/type/index.ts":{"bytes":940,"imports":[{"path":"packages/core/echo/echo/src/type/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/type/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"packages/core/echo/echo/src/type/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/type/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":829,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6065},"packages/core/echo/echo/dist/lib/browser/index.mjs":{"imports":[{"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/live-object","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/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}],"exports":["DXN","Format","FormatEnum","Obj","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":90},"packages/core/echo/echo/src/type/Obj.ts":{"bytesInOutput":263},"packages/core/echo/echo/src/type/index.ts":{"bytesInOutput":0},"packages/core/echo/echo/src/type/Ref.ts":{"bytesInOutput":140},"packages/core/echo/echo/src/type/Relation.ts":{"bytesInOutput":151},"packages/core/echo/echo/src/type/Type.ts":{"bytesInOutput":1643}},"bytes":2887}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -19,48 +19,100 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var node_exports = {};
|
|
20
20
|
__export(node_exports, {
|
|
21
21
|
DXN: () => import_keys.DXN,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
Format: () => import_echo_schema.Format,
|
|
23
|
+
FormatEnum: () => import_echo_schema.FormatEnum,
|
|
24
|
+
Obj: () => Obj_exports,
|
|
25
|
+
Ref: () => Ref_exports,
|
|
26
|
+
Relation: () => Relation_exports,
|
|
25
27
|
Type: () => Type_exports
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(node_exports);
|
|
28
|
-
var import_keys = require("@dxos/keys");
|
|
29
30
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
31
|
+
var import_keys = require("@dxos/keys");
|
|
32
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
30
33
|
var import_live_object = require("@dxos/live-object");
|
|
34
|
+
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
35
|
+
var import_echo_schema4 = require("@dxos/echo-schema");
|
|
36
|
+
var import_echo_schema5 = require("@dxos/echo-schema");
|
|
37
|
+
var import_invariant = require("@dxos/invariant");
|
|
38
|
+
var import_keys2 = require("@dxos/keys");
|
|
39
|
+
var import_live_object2 = require("@dxos/live-object");
|
|
31
40
|
var __defProp2 = Object.defineProperty;
|
|
32
41
|
var __export2 = (target, all) => {
|
|
33
42
|
for (var name in all)
|
|
34
43
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
35
44
|
};
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
var Obj_exports = {};
|
|
46
|
+
__export2(Obj_exports, {
|
|
47
|
+
create: () => create,
|
|
48
|
+
getSchema: () => getSchema
|
|
49
|
+
});
|
|
50
|
+
var create = import_live_object.live;
|
|
51
|
+
var getSchema = import_echo_schema2.getSchema;
|
|
52
|
+
var Ref_exports = {};
|
|
53
|
+
__export2(Ref_exports, {
|
|
54
|
+
make: () => make
|
|
55
|
+
});
|
|
56
|
+
var make = import_echo_schema3.Ref.make;
|
|
57
|
+
var Relation_exports = {};
|
|
58
|
+
__export2(Relation_exports, {
|
|
59
|
+
def: () => def
|
|
60
|
+
});
|
|
61
|
+
var def = import_echo_schema4.EchoRelation;
|
|
39
62
|
var Type_exports = {};
|
|
40
63
|
__export2(Type_exports, {
|
|
41
|
-
|
|
42
|
-
|
|
64
|
+
Expando: () => Expando,
|
|
65
|
+
Kind: () => Kind,
|
|
66
|
+
ObjectId: () => ObjectId,
|
|
43
67
|
Ref: () => Ref,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
SpaceId: () => SpaceId,
|
|
69
|
+
create: () => create2,
|
|
70
|
+
def: () => def2,
|
|
71
|
+
getDXN: () => getDXN,
|
|
72
|
+
getMeta: () => getMeta,
|
|
73
|
+
getSchema: () => getSchema2,
|
|
74
|
+
getTypename: () => getTypename,
|
|
75
|
+
getVersion: () => getVersion,
|
|
76
|
+
instanceOf: () => instanceOf,
|
|
77
|
+
isMutable: () => isMutable,
|
|
78
|
+
toJsonSchema: () => toJsonSchema
|
|
53
79
|
});
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var Ref = (self) => (0,
|
|
80
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/type/Type.ts";
|
|
81
|
+
var SpaceId = import_keys2.SpaceId;
|
|
82
|
+
var ObjectId = import_echo_schema5.ObjectId;
|
|
83
|
+
var Ref = (self) => (0, import_echo_schema5.Ref)(self);
|
|
84
|
+
var Kind = import_echo_schema5.EntityKind;
|
|
85
|
+
var Expando = import_echo_schema5.Expando;
|
|
86
|
+
var def2 = (meta) => (0, import_echo_schema5.EchoObject)(meta);
|
|
87
|
+
var create2 = import_live_object2.live;
|
|
88
|
+
var getSchema2 = import_echo_schema5.getSchema;
|
|
89
|
+
var instanceOf = import_echo_schema5.isInstanceOf;
|
|
90
|
+
var getDXN = import_echo_schema5.getSchemaDXN;
|
|
91
|
+
var getMeta = import_echo_schema5.getTypeAnnotation;
|
|
92
|
+
var getTypename = (schema) => {
|
|
93
|
+
const typename = (0, import_echo_schema5.getSchemaTypename)(schema);
|
|
94
|
+
(0, import_invariant.invariant)(typename, "Invalid object", {
|
|
95
|
+
F: __dxlog_file,
|
|
96
|
+
L: 129,
|
|
97
|
+
S: void 0,
|
|
98
|
+
A: [
|
|
99
|
+
"typename",
|
|
100
|
+
"'Invalid object'"
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
return typename;
|
|
104
|
+
};
|
|
105
|
+
var getVersion = import_echo_schema5.getSchemaVersion;
|
|
106
|
+
var isMutable = import_echo_schema5.isMutable;
|
|
107
|
+
var toJsonSchema = import_echo_schema5.toJsonSchema;
|
|
58
108
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
109
|
0 && (module.exports = {
|
|
60
110
|
DXN,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
111
|
+
Format,
|
|
112
|
+
FormatEnum,
|
|
113
|
+
Obj,
|
|
114
|
+
Ref,
|
|
115
|
+
Relation,
|
|
64
116
|
Type
|
|
65
117
|
});
|
|
66
118
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/type/Obj.ts", "../../../src/type/Ref.ts", "../../../src/type/Relation.ts", "../../../src/type/Type.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport { Format, FormatEnum } from '@dxos/echo-schema';\nexport { DXN } from '@dxos/keys';\n\nexport * from './type';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport { type BaseEchoObject, type BaseObject, getSchema as getSchema$ } from '@dxos/echo-schema';\nimport { live as live$ } from '@dxos/live-object';\n\n// TODO(burdon): Remove from Type?\n\nexport declare namespace Obj {\n export type Any = BaseEchoObject;\n export type Live<T extends BaseObject> = AnyLiveObject$<T>;\n}\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Ref as Ref$ } from '@dxos/echo-schema';\n\nexport const make = Ref$.make;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoRelation, type RelationSourceTargetRefs } from '@dxos/echo-schema';\n\nexport const def = EchoRelation;\n\n/**\n * Get relation target type.\n */\nexport type Target<A> = A extends RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n/**\n * Get relation source type.\n */\nexport type Source<A> = A extends RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport {\n type BaseEchoObject,\n type BaseObject,\n type BaseSchema,\n type EchoSchema,\n EchoObject,\n EntityKind,\n Expando as Expando$,\n type ImmutableSchema,\n type JsonSchemaType,\n ObjectId as ObjectId$,\n Ref as Ref$,\n type StoredSchema,\n type TypeMeta,\n getTypeAnnotation,\n getSchema as getSchema$,\n getSchemaDXN,\n getSchemaTypename,\n getSchemaVersion,\n isInstanceOf,\n isMutable as isMutable$,\n toJsonSchema as toJsonSchema$,\n} from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceId as SpaceId$ } from '@dxos/keys';\nimport { live as live$ } from '@dxos/live-object';\n\n/**\n * Type System API.\n *\n * @category api namespace\n * @since 0.9.0\n */\n\n//\n// Keys\n//\n\nexport const SpaceId = SpaceId$;\nexport type SpaceId = SpaceId$;\n\nexport const ObjectId = ObjectId$;\nexport type ObjectId = ObjectId$;\n\n/**\n * Defines a reference to an ECHO object.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Person = Schema.Struct({\n * name: Schema.String,\n * organization: Type.Ref(Organization),\n * }).pipe(Type.def({\n * typename: 'example.com/type/Person',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const Ref = <S extends Schema.Schema.AnyNoContext>(self: S) => Ref$<Schema.Schema.Type<S>>(self);\n\n//\n// Objects\n//\n\nexport const Kind = EntityKind;\nexport type AnyObject = BaseEchoObject;\nexport type AnyLiveObject<T extends BaseObject> = AnyLiveObject$<T>;\n\n//\n// Schema\n//\n\nexport type JsonSchema = JsonSchemaType;\n\n/**\n * A schema that can be extended with arbitrary properties.\n */\nexport const Expando = Expando$;\nexport type Expando = Expando$;\n\n// TODO(burdon): Review/remove.\nexport type Abstract<T = any> = BaseSchema<T>;\nexport type ImmutableType<T> = ImmutableSchema<T>;\nexport type MutableType<T> = EchoSchema<T>;\nexport type StoredType = StoredSchema;\n\n/**\n * Defines an ECHO type.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Organization = Schema.Struct({\n * name: Schema.String,\n * }).pipe(Type.def({\n * typename: 'example.com/type/Organization',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const def = (meta: TypeMeta) => EchoObject(meta);\n\n//\n// Object utils\n//\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\nexport const instanceOf = isInstanceOf;\n\n//\n// Type utils\n//\n\n// TODO(burdon): Reconcile getDXN and getTypename.\nexport const getDXN = getSchemaDXN;\nexport const getMeta = getTypeAnnotation;\nexport const getTypename = (schema: Schema.Schema.AnyNoContext): string => {\n const typename = getSchemaTypename(schema);\n invariant(typename, 'Invalid object');\n return typename;\n};\nexport const getVersion = getSchemaVersion;\nexport const isMutable = isMutable$;\nexport const toJsonSchema = toJsonSchema$;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAmC;AACnC,kBAAoB;ACApB,IAAAA,sBAA8E;AAC9E,yBAA8B;ACF9B,IAAAA,sBAA4B;ACA5B,IAAAA,sBAA4D;ACG5D,IAAAA,sBAsBO;AACP,uBAA0B;AAC1B,IAAAC,eAAoC;AACpC,IAAAC,sBAA8B;;;;;;AHhC9B,IAAA,cAAA,CAAA;;;;;AAeO,IAAMC,SAASC,mBAAAA;AAEf,IAAMC,YAAYC,oBAAAA;ACjBzB,IAAA,cAAA,CAAA;;;;AAMO,IAAMC,OAAOC,oBAAAA,IAAKD;ACNzB,IAAA,mBAAA,CAAA;;;;AAMO,IAAME,MAAMC;ACNnB,IAAA,eAAA,CAAA;;;;;;;gBAAAP;EAAA,KAAA,MAAAM;EAAA,QAAA,MAAA;;mBAAAJ;EAAA,aAAA,MAAA;;;;;;;AA6CO,IAAMM,UAAUC,aAAAA;AAGhB,IAAMC,WAAWC,oBAAAA;AAkBjB,IAAMC,MAAM,CAAuCC,aAAYR,oBAAAA,KAA4BQ,IAAAA;AAM3F,IAAMC,OAAOC;AAab,IAAMC,UAAUC,oBAAAA;AAuBhB,IAAMX,OAAM,CAACY,aAAmBC,gCAAWD,IAAAA;AAM3C,IAAMlB,UAASC,oBAAAA;AAEf,IAAMC,aAAYC,oBAAAA;AAClB,IAAMiB,aAAaC;AAOnB,IAAMC,SAASC;AACf,IAAMC,UAAUC;AAChB,IAAMC,cAAc,CAACC,WAAAA;AAC1B,QAAMC,eAAWC,uCAAkBF,MAAAA;AACnCG,kCAAUF,UAAU,kBAAA;;;;;;;;;AACpB,SAAOA;AACT;AACO,IAAMG,aAAaC;AACnB,IAAMC,YAAYC,oBAAAA;AAClB,IAAMC,eAAeC,oBAAAA;",
|
|
6
|
+
"names": ["import_echo_schema", "import_keys", "import_live_object", "create", "live$", "getSchema", "getSchema$", "make", "Ref$", "def", "EchoRelation", "SpaceId", "SpaceId$", "ObjectId", "ObjectId$", "Ref", "self", "Kind", "EntityKind", "Expando", "Expando$", "meta", "EchoObject", "instanceOf", "isInstanceOf", "getDXN", "getSchemaDXN", "getMeta", "getTypeAnnotation", "getTypename", "schema", "typename", "getSchemaTypename", "invariant", "getVersion", "getSchemaVersion", "isMutable", "isMutable$", "toJsonSchema", "toJsonSchema$"]
|
|
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/type/Obj.ts":{"bytes":1448,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Ref.ts":{"bytes":726,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Relation.ts":{"bytes":1122,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Type.ts":{"bytes":8579,"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}],"format":"esm"},"packages/core/echo/echo/src/type/index.ts":{"bytes":940,"imports":[{"path":"packages/core/echo/echo/src/type/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/type/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"packages/core/echo/echo/src/type/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/type/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":829,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6064},"packages/core/echo/echo/dist/lib/node/index.cjs":{"imports":[{"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/live-object","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/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}],"exports":["DXN","Format","FormatEnum","Obj","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":90},"packages/core/echo/echo/src/type/Obj.ts":{"bytesInOutput":263},"packages/core/echo/echo/src/type/index.ts":{"bytesInOutput":0},"packages/core/echo/echo/src/type/Ref.ts":{"bytesInOutput":140},"packages/core/echo/echo/src/type/Relation.ts":{"bytesInOutput":151},"packages/core/echo/echo/src/type/Type.ts":{"bytesInOutput":1643}},"bytes":2854}}}
|
|
@@ -6,44 +6,94 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// packages/core/echo/echo/src/index.ts
|
|
9
|
+
import { Format, FormatEnum } from "@dxos/echo-schema";
|
|
9
10
|
import { DXN } from "@dxos/keys";
|
|
10
11
|
|
|
11
|
-
// packages/core/echo/echo/src/
|
|
12
|
-
var
|
|
12
|
+
// packages/core/echo/echo/src/type/Obj.ts
|
|
13
|
+
var Obj_exports = {};
|
|
14
|
+
__export(Obj_exports, {
|
|
15
|
+
create: () => create,
|
|
16
|
+
getSchema: () => getSchema
|
|
17
|
+
});
|
|
18
|
+
import { getSchema as getSchema$ } from "@dxos/echo-schema";
|
|
19
|
+
import { live as live$ } from "@dxos/live-object";
|
|
20
|
+
var create = live$;
|
|
21
|
+
var getSchema = getSchema$;
|
|
13
22
|
|
|
14
|
-
// packages/core/echo/echo/src/
|
|
15
|
-
var
|
|
23
|
+
// packages/core/echo/echo/src/type/Ref.ts
|
|
24
|
+
var Ref_exports = {};
|
|
25
|
+
__export(Ref_exports, {
|
|
26
|
+
make: () => make
|
|
27
|
+
});
|
|
28
|
+
import { Ref as Ref$ } from "@dxos/echo-schema";
|
|
29
|
+
var make = Ref$.make;
|
|
16
30
|
|
|
17
|
-
// packages/core/echo/echo/src/
|
|
18
|
-
var
|
|
31
|
+
// packages/core/echo/echo/src/type/Relation.ts
|
|
32
|
+
var Relation_exports = {};
|
|
33
|
+
__export(Relation_exports, {
|
|
34
|
+
def: () => def
|
|
35
|
+
});
|
|
36
|
+
import { EchoRelation } from "@dxos/echo-schema";
|
|
37
|
+
var def = EchoRelation;
|
|
19
38
|
|
|
20
|
-
// packages/core/echo/echo/src/Type.ts
|
|
39
|
+
// packages/core/echo/echo/src/type/Type.ts
|
|
21
40
|
var Type_exports = {};
|
|
22
41
|
__export(Type_exports, {
|
|
23
|
-
|
|
42
|
+
Expando: () => Expando,
|
|
43
|
+
Kind: () => Kind,
|
|
24
44
|
ObjectId: () => ObjectId,
|
|
25
45
|
Ref: () => Ref,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
SpaceId: () => SpaceId,
|
|
47
|
+
create: () => create2,
|
|
48
|
+
def: () => def2,
|
|
49
|
+
getDXN: () => getDXN,
|
|
50
|
+
getMeta: () => getMeta,
|
|
51
|
+
getSchema: () => getSchema2,
|
|
52
|
+
getTypename: () => getTypename,
|
|
53
|
+
getVersion: () => getVersion,
|
|
54
|
+
instanceOf: () => instanceOf,
|
|
55
|
+
isMutable: () => isMutable,
|
|
56
|
+
toJsonSchema: () => toJsonSchema
|
|
35
57
|
});
|
|
36
|
-
import { EchoObject, EntityKind, ObjectId
|
|
37
|
-
import {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
58
|
+
import { EchoObject, EntityKind, Expando as Expando$, ObjectId as ObjectId$, Ref as Ref$2, getTypeAnnotation, getSchema as getSchema$2, getSchemaDXN, getSchemaTypename, getSchemaVersion, isInstanceOf, isMutable as isMutable$, toJsonSchema as toJsonSchema$ } from "@dxos/echo-schema";
|
|
59
|
+
import { invariant } from "@dxos/invariant";
|
|
60
|
+
import { SpaceId as SpaceId$ } from "@dxos/keys";
|
|
61
|
+
import { live as live$2 } from "@dxos/live-object";
|
|
62
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo/src/type/Type.ts";
|
|
63
|
+
var SpaceId = SpaceId$;
|
|
64
|
+
var ObjectId = ObjectId$;
|
|
65
|
+
var Ref = (self) => Ref$2(self);
|
|
66
|
+
var Kind = EntityKind;
|
|
67
|
+
var Expando = Expando$;
|
|
68
|
+
var def2 = (meta) => EchoObject(meta);
|
|
69
|
+
var create2 = live$2;
|
|
70
|
+
var getSchema2 = getSchema$2;
|
|
71
|
+
var instanceOf = isInstanceOf;
|
|
72
|
+
var getDXN = getSchemaDXN;
|
|
73
|
+
var getMeta = getTypeAnnotation;
|
|
74
|
+
var getTypename = (schema) => {
|
|
75
|
+
const typename = getSchemaTypename(schema);
|
|
76
|
+
invariant(typename, "Invalid object", {
|
|
77
|
+
F: __dxlog_file,
|
|
78
|
+
L: 129,
|
|
79
|
+
S: void 0,
|
|
80
|
+
A: [
|
|
81
|
+
"typename",
|
|
82
|
+
"'Invalid object'"
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
return typename;
|
|
86
|
+
};
|
|
87
|
+
var getVersion = getSchemaVersion;
|
|
88
|
+
var isMutable = isMutable$;
|
|
89
|
+
var toJsonSchema = toJsonSchema$;
|
|
42
90
|
export {
|
|
43
91
|
DXN,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
Format,
|
|
93
|
+
FormatEnum,
|
|
94
|
+
Obj_exports as Obj,
|
|
95
|
+
Ref_exports as Ref,
|
|
96
|
+
Relation_exports as Relation,
|
|
47
97
|
Type_exports as Type
|
|
48
98
|
};
|
|
49
99
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,WAAW;;;
|
|
6
|
-
"names": ["DXN", "EchoObject", "EntityKind", "ObjectId", "Ref", "Ref$", "getTypeAnnotation", "getSchema", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/type/Obj.ts", "../../../src/type/Ref.ts", "../../../src/type/Relation.ts", "../../../src/type/Type.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport { Format, FormatEnum } from '@dxos/echo-schema';\nexport { DXN } from '@dxos/keys';\n\nexport * from './type';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport { type BaseEchoObject, type BaseObject, getSchema as getSchema$ } from '@dxos/echo-schema';\nimport { live as live$ } from '@dxos/live-object';\n\n// TODO(burdon): Remove from Type?\n\nexport declare namespace Obj {\n export type Any = BaseEchoObject;\n export type Live<T extends BaseObject> = AnyLiveObject$<T>;\n}\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Ref as Ref$ } from '@dxos/echo-schema';\n\nexport const make = Ref$.make;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoRelation, type RelationSourceTargetRefs } from '@dxos/echo-schema';\n\nexport const def = EchoRelation;\n\n/**\n * Get relation target type.\n */\nexport type Target<A> = A extends RelationSourceTargetRefs<infer T, infer _S> ? T : never;\n\n/**\n * Get relation source type.\n */\nexport type Source<A> = A extends RelationSourceTargetRefs<infer _T, infer S> ? S : never;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\n\nimport { type AnyLiveObject as AnyLiveObject$ } from '@dxos/echo-db';\nimport {\n type BaseEchoObject,\n type BaseObject,\n type BaseSchema,\n type EchoSchema,\n EchoObject,\n EntityKind,\n Expando as Expando$,\n type ImmutableSchema,\n type JsonSchemaType,\n ObjectId as ObjectId$,\n Ref as Ref$,\n type StoredSchema,\n type TypeMeta,\n getTypeAnnotation,\n getSchema as getSchema$,\n getSchemaDXN,\n getSchemaTypename,\n getSchemaVersion,\n isInstanceOf,\n isMutable as isMutable$,\n toJsonSchema as toJsonSchema$,\n} from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceId as SpaceId$ } from '@dxos/keys';\nimport { live as live$ } from '@dxos/live-object';\n\n/**\n * Type System API.\n *\n * @category api namespace\n * @since 0.9.0\n */\n\n//\n// Keys\n//\n\nexport const SpaceId = SpaceId$;\nexport type SpaceId = SpaceId$;\n\nexport const ObjectId = ObjectId$;\nexport type ObjectId = ObjectId$;\n\n/**\n * Defines a reference to an ECHO object.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Person = Schema.Struct({\n * name: Schema.String,\n * organization: Type.Ref(Organization),\n * }).pipe(Type.def({\n * typename: 'example.com/type/Person',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const Ref = <S extends Schema.Schema.AnyNoContext>(self: S) => Ref$<Schema.Schema.Type<S>>(self);\n\n//\n// Objects\n//\n\nexport const Kind = EntityKind;\nexport type AnyObject = BaseEchoObject;\nexport type AnyLiveObject<T extends BaseObject> = AnyLiveObject$<T>;\n\n//\n// Schema\n//\n\nexport type JsonSchema = JsonSchemaType;\n\n/**\n * A schema that can be extended with arbitrary properties.\n */\nexport const Expando = Expando$;\nexport type Expando = Expando$;\n\n// TODO(burdon): Review/remove.\nexport type Abstract<T = any> = BaseSchema<T>;\nexport type ImmutableType<T> = ImmutableSchema<T>;\nexport type MutableType<T> = EchoSchema<T>;\nexport type StoredType = StoredSchema;\n\n/**\n * Defines an ECHO type.\n *\n * @example\n * ```ts\n * import { Type } from '@dxos/echo';\n * const Organization = Schema.Struct({\n * name: Schema.String,\n * }).pipe(Type.def({\n * typename: 'example.com/type/Organization',\n * version: '0.1.0',\n * }));\n * ```\n */\nexport const def = (meta: TypeMeta) => EchoObject(meta);\n\n//\n// Object utils\n//\n\nexport const create = live$;\n\nexport const getSchema = getSchema$;\nexport const instanceOf = isInstanceOf;\n\n//\n// Type utils\n//\n\n// TODO(burdon): Reconcile getDXN and getTypename.\nexport const getDXN = getSchemaDXN;\nexport const getMeta = getTypeAnnotation;\nexport const getTypename = (schema: Schema.Schema.AnyNoContext): string => {\n const typename = getSchemaTypename(schema);\n invariant(typename, 'Invalid object');\n return typename;\n};\nexport const getVersion = getSchemaVersion;\nexport const isMutable = isMutable$;\nexport const toJsonSchema = toJsonSchema$;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,QAAQC,kBAAkB;AACnC,SAASC,WAAW;;;ACLpB;;;;;AAKA,SAA+CC,aAAaC,kBAAkB;AAC9E,SAASC,QAAQC,aAAa;AASvB,IAAMC,SAASC;AAEf,IAAMC,YAAYC;;;ACjBzB;;;;AAIA,SAASC,OAAOC,YAAY;AAErB,IAAMC,OAAOC,KAAKD;;;ACNzB;;;;AAIA,SAASE,oBAAmD;AAErD,IAAMC,MAAMC;;;ACNnB;;;;;;;gBAAAC;EAAA,WAAAC;EAAA;;mBAAAC;EAAA;;;;;;AAOA,SAKEC,YACAC,YACAC,WAAWC,UAGXC,YAAYC,WACZC,OAAOC,OAGPC,mBACAT,aAAaU,aACbC,cACAC,mBACAC,kBACAC,cACAC,aAAaC,YACbC,gBAAgBC,qBACX;AACP,SAASC,iBAAiB;AAC1B,SAASC,WAAWC,gBAAgB;AACpC,SAASC,QAAQC,cAAa;;AAavB,IAAMH,UAAUC;AAGhB,IAAMhB,WAAWC;AAkBjB,IAAMC,MAAM,CAAuCiB,SAAYhB,MAA4BgB,IAAAA;AAM3F,IAAMC,OAAOvB;AAab,IAAMC,UAAUC;AAuBhB,IAAML,OAAM,CAAC2B,SAAmBzB,WAAWyB,IAAAA;AAM3C,IAAM5B,UAASyB;AAEf,IAAMvB,aAAYU;AAClB,IAAMiB,aAAab;AAOnB,IAAMc,SAASjB;AACf,IAAMkB,UAAUpB;AAChB,IAAMqB,cAAc,CAACC,WAAAA;AAC1B,QAAMC,WAAWpB,kBAAkBmB,MAAAA;AACnCZ,YAAUa,UAAU,kBAAA;;;;;;;;;AACpB,SAAOA;AACT;AACO,IAAMC,aAAapB;AACnB,IAAME,YAAYC;AAClB,IAAMC,eAAeC;",
|
|
6
|
+
"names": ["Format", "FormatEnum", "DXN", "getSchema", "getSchema$", "live", "live$", "create", "live$", "getSchema", "getSchema$", "Ref", "Ref$", "make", "Ref$", "EchoRelation", "def", "EchoRelation", "create", "def", "getSchema", "EchoObject", "EntityKind", "Expando", "Expando$", "ObjectId", "ObjectId$", "Ref", "Ref$", "getTypeAnnotation", "getSchema$", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "isMutable", "isMutable$", "toJsonSchema", "toJsonSchema$", "invariant", "SpaceId", "SpaceId$", "live", "live$", "self", "Kind", "meta", "instanceOf", "getDXN", "getMeta", "getTypename", "schema", "typename", "getVersion"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/type/Obj.ts":{"bytes":1448,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Ref.ts":{"bytes":726,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Relation.ts":{"bytes":1122,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo/src/type/Type.ts":{"bytes":8579,"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}],"format":"esm"},"packages/core/echo/echo/src/type/index.ts":{"bytes":940,"imports":[{"path":"packages/core/echo/echo/src/type/Obj.ts","kind":"import-statement","original":"./Obj"},{"path":"packages/core/echo/echo/src/type/Ref.ts","kind":"import-statement","original":"./Ref"},{"path":"packages/core/echo/echo/src/type/Relation.ts","kind":"import-statement","original":"./Relation"},{"path":"packages/core/echo/echo/src/type/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"},"packages/core/echo/echo/src/index.ts":{"bytes":829,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6065},"packages/core/echo/echo/dist/lib/node-esm/index.mjs":{"imports":[{"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/live-object","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/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}],"exports":["DXN","Format","FormatEnum","Obj","Ref","Relation","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":90},"packages/core/echo/echo/src/type/Obj.ts":{"bytesInOutput":263},"packages/core/echo/echo/src/type/index.ts":{"bytesInOutput":0},"packages/core/echo/echo/src/type/Ref.ts":{"bytesInOutput":140},"packages/core/echo/echo/src/type/Relation.ts":{"bytesInOutput":151},"packages/core/echo/echo/src/type/Type.ts":{"bytesInOutput":1643}},"bytes":2946}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../../src/experimental/database.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,yBAAiB,QAAQ,CAAC,GAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/experimental/index.ts"],"names":[],"mappings":""}
|