@dxos/echo 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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 +26 -76
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +25 -77
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +26 -76
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/{experimental/database.d.ts → Database.d.ts} +1 -1
- package/dist/types/src/Database.d.ts.map +1 -0
- package/dist/types/src/{experimental/queue.d.ts → Queue.d.ts} +1 -1
- package/dist/types/src/Queue.d.ts.map +1 -0
- package/dist/types/src/{experimental/space.d.ts → Space.d.ts} +1 -1
- package/dist/types/src/Space.d.ts.map +1 -0
- package/dist/types/src/Type.d.ts +49 -0
- package/dist/types/src/Type.d.ts.map +1 -0
- package/dist/types/src/{type/api.test.d.ts.map → api.test.d.ts.map} +1 -1
- package/dist/types/src/index.d.ts +6 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/{experimental/database.ts → Database.ts} +1 -1
- package/src/{experimental/queue.ts → Queue.ts} +1 -1
- package/src/Type.ts +99 -0
- package/src/api.test.ts +94 -0
- package/src/index.ts +7 -3
- package/dist/types/src/experimental/database.d.ts.map +0 -1
- package/dist/types/src/experimental/index.d.ts +0 -1
- package/dist/types/src/experimental/index.d.ts.map +0 -1
- package/dist/types/src/experimental/queue.d.ts.map +0 -1
- package/dist/types/src/experimental/space.d.ts.map +0 -1
- package/dist/types/src/type/Obj.d.ts +0 -12
- package/dist/types/src/type/Obj.d.ts.map +0 -1
- package/dist/types/src/type/Ref.d.ts +0 -3
- package/dist/types/src/type/Ref.d.ts.map +0 -1
- package/dist/types/src/type/Relation.d.ts +0 -16
- package/dist/types/src/type/Relation.d.ts.map +0 -1
- package/dist/types/src/type/Type.d.ts +0 -77
- package/dist/types/src/type/Type.d.ts.map +0 -1
- package/dist/types/src/type/index.d.ts +0 -5
- package/dist/types/src/type/index.d.ts.map +0 -1
- package/src/experimental/index.ts +0 -7
- package/src/type/Obj.ts +0 -18
- package/src/type/Ref.ts +0 -7
- package/src/type/Relation.ts +0 -17
- package/src/type/Type.ts +0 -134
- package/src/type/api.test.ts +0 -128
- package/src/type/index.ts +0 -8
- /package/dist/types/src/{type/api.test.d.ts → api.test.d.ts} +0 -0
- /package/src/{experimental/space.ts → Space.ts} +0 -0
|
@@ -6,94 +6,44 @@ 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";
|
|
10
9
|
import { DXN } from "@dxos/keys";
|
|
11
10
|
|
|
12
|
-
// packages/core/echo/echo/src/
|
|
13
|
-
var
|
|
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$;
|
|
11
|
+
// packages/core/echo/echo/src/Database.ts
|
|
12
|
+
var Database_exports = {};
|
|
22
13
|
|
|
23
|
-
// packages/core/echo/echo/src/
|
|
24
|
-
var
|
|
25
|
-
__export(Ref_exports, {
|
|
26
|
-
make: () => make
|
|
27
|
-
});
|
|
28
|
-
import { Ref as Ref$ } from "@dxos/echo-schema";
|
|
29
|
-
var make = Ref$.make;
|
|
14
|
+
// packages/core/echo/echo/src/Queue.ts
|
|
15
|
+
var Queue_exports = {};
|
|
30
16
|
|
|
31
|
-
// packages/core/echo/echo/src/
|
|
32
|
-
var
|
|
33
|
-
__export(Relation_exports, {
|
|
34
|
-
def: () => def
|
|
35
|
-
});
|
|
36
|
-
import { EchoRelation } from "@dxos/echo-schema";
|
|
37
|
-
var def = EchoRelation;
|
|
17
|
+
// packages/core/echo/echo/src/Space.ts
|
|
18
|
+
var Space_exports = {};
|
|
38
19
|
|
|
39
|
-
// packages/core/echo/echo/src/
|
|
20
|
+
// packages/core/echo/echo/src/Type.ts
|
|
40
21
|
var Type_exports = {};
|
|
41
22
|
__export(Type_exports, {
|
|
42
|
-
|
|
43
|
-
Kind: () => Kind,
|
|
23
|
+
Kind: () => EntityKind,
|
|
44
24
|
ObjectId: () => ObjectId,
|
|
45
25
|
Ref: () => Ref,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
isMutable: () => isMutable,
|
|
56
|
-
toJsonSchema: () => toJsonSchema
|
|
26
|
+
create: () => create,
|
|
27
|
+
def: () => def,
|
|
28
|
+
getDXN: () => getSchemaDXN,
|
|
29
|
+
getMeta: () => getTypeAnnotation,
|
|
30
|
+
getSchema: () => getSchema,
|
|
31
|
+
getTypename: () => getSchemaTypename,
|
|
32
|
+
getVersion: () => getSchemaVersion,
|
|
33
|
+
instanceOf: () => isInstanceOf,
|
|
34
|
+
ref: () => ref
|
|
57
35
|
});
|
|
58
|
-
import { EchoObject, EntityKind,
|
|
59
|
-
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var
|
|
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$;
|
|
36
|
+
import { EchoObject, EntityKind, ObjectId, Ref as Ref$, getTypeAnnotation, getSchema, getSchemaDXN, getSchemaTypename, getSchemaVersion, isInstanceOf } from "@dxos/echo-schema";
|
|
37
|
+
import { create as create$, makeRef } from "@dxos/live-object";
|
|
38
|
+
var ref = makeRef;
|
|
39
|
+
var create = create$;
|
|
40
|
+
var def = (meta) => EchoObject(meta);
|
|
41
|
+
var Ref = (self) => Ref$(self);
|
|
90
42
|
export {
|
|
91
43
|
DXN,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Ref_exports as Ref,
|
|
96
|
-
Relation_exports as Relation,
|
|
44
|
+
Database_exports as Database,
|
|
45
|
+
Queue_exports as Queue,
|
|
46
|
+
Space_exports as Space,
|
|
97
47
|
Type_exports as Type
|
|
98
48
|
};
|
|
99
49
|
//# 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,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/Database.ts", "../../../src/Queue.ts", "../../../src/Space.ts", "../../../src/Type.ts"],
|
|
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": ";;;;;;;;AAIA,SAASA,WAAW;;;ACJpB;;;ACAA;;;ACAA;;;ACAA;;;;;;;;;;;;;;;AAMA,SAOEC,YACAC,YACAC,UACAC,OAAOC,MACPC,mBACAC,WACAC,cACAC,mBACAC,kBACAC,oBACK;AACP,SAASC,UAAUC,SAASC,eAAe;AA2CpC,IAAMC,MAAMC;AACZ,IAAMC,SAASC;AAgBf,IAAMC,MAAM,CAACC,SAAmBC,WAAWD,IAAAA;AAc3C,IAAME,MAAM,CAAuCC,SAAYC,KAA4BD,IAAAA;",
|
|
6
|
+
"names": ["DXN", "EchoObject", "EntityKind", "ObjectId", "Ref", "Ref$", "getTypeAnnotation", "getSchema", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "create", "create$", "makeRef", "ref", "makeRef", "create", "create$", "def", "meta", "EchoObject", "Ref", "self", "Ref$"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/Database.ts":{"bytes":689,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Queue.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Space.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Type.ts":{"bytes":6001,"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/index.ts":{"bytes":1157,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/Database.ts","kind":"import-statement","original":"./Database"},{"path":"packages/core/echo/echo/src/Queue.ts","kind":"import-statement","original":"./Queue"},{"path":"packages/core/echo/echo/src/Space.ts","kind":"import-statement","original":"./Space"},{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4021},"packages/core/echo/echo/dist/lib/browser/index.mjs":{"imports":[{"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}],"exports":["DXN","Database","Queue","Space","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":34},"packages/core/echo/echo/src/Database.ts":{"bytesInOutput":27},"packages/core/echo/echo/src/Queue.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Space.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":744}},"bytes":1421}}}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -19,100 +19,48 @@ 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
|
-
|
|
25
|
-
Ref: () => Ref_exports,
|
|
26
|
-
Relation: () => Relation_exports,
|
|
22
|
+
Database: () => Database_exports,
|
|
23
|
+
Queue: () => Queue_exports,
|
|
24
|
+
Space: () => Space_exports,
|
|
27
25
|
Type: () => Type_exports
|
|
28
26
|
});
|
|
29
27
|
module.exports = __toCommonJS(node_exports);
|
|
30
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
31
28
|
var import_keys = require("@dxos/keys");
|
|
32
|
-
var
|
|
29
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
33
30
|
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");
|
|
40
31
|
var __defProp2 = Object.defineProperty;
|
|
41
32
|
var __export2 = (target, all) => {
|
|
42
33
|
for (var name in all)
|
|
43
34
|
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
35
|
};
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
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;
|
|
36
|
+
var Database_exports = {};
|
|
37
|
+
var Queue_exports = {};
|
|
38
|
+
var Space_exports = {};
|
|
62
39
|
var Type_exports = {};
|
|
63
40
|
__export2(Type_exports, {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
ObjectId: () => ObjectId,
|
|
41
|
+
Kind: () => import_echo_schema.EntityKind,
|
|
42
|
+
ObjectId: () => import_echo_schema.ObjectId,
|
|
67
43
|
Ref: () => Ref,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
isMutable: () => isMutable,
|
|
78
|
-
toJsonSchema: () => toJsonSchema
|
|
44
|
+
create: () => create,
|
|
45
|
+
def: () => def,
|
|
46
|
+
getDXN: () => import_echo_schema.getSchemaDXN,
|
|
47
|
+
getMeta: () => import_echo_schema.getTypeAnnotation,
|
|
48
|
+
getSchema: () => import_echo_schema.getSchema,
|
|
49
|
+
getTypename: () => import_echo_schema.getSchemaTypename,
|
|
50
|
+
getVersion: () => import_echo_schema.getSchemaVersion,
|
|
51
|
+
instanceOf: () => import_echo_schema.isInstanceOf,
|
|
52
|
+
ref: () => ref
|
|
79
53
|
});
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var Ref = (self) => (0,
|
|
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;
|
|
54
|
+
var ref = import_live_object.makeRef;
|
|
55
|
+
var create = import_live_object.create;
|
|
56
|
+
var def = (meta) => (0, import_echo_schema.EchoObject)(meta);
|
|
57
|
+
var Ref = (self) => (0, import_echo_schema.Ref)(self);
|
|
108
58
|
// Annotate the CommonJS export names for ESM import in node:
|
|
109
59
|
0 && (module.exports = {
|
|
110
60
|
DXN,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Ref,
|
|
115
|
-
Relation,
|
|
61
|
+
Database,
|
|
62
|
+
Queue,
|
|
63
|
+
Space,
|
|
116
64
|
Type
|
|
117
65
|
});
|
|
118
66
|
//# 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/Database.ts", "../../../src/Queue.ts", "../../../src/Space.ts", "../../../src/Type.ts"],
|
|
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kBAAoB;AIEpB,yBAiBO;AACP,yBAA2C;;;;;;AHxB3C,IAAA,mBAAA,CAAA;ACAA,IAAA,gBAAA,CAAA;ACAA,IAAA,gBAAA,CAAA;ACAA,IAAA,eAAA,CAAA;;;;;;;;;;;;;;;AAmEO,IAAMA,MAAMC;AACZ,IAAMC,SAASC,mBAAAA;AAgBf,IAAMC,MAAM,CAACC,aAAmBC,+BAAWD,IAAAA;AAc3C,IAAME,MAAM,CAAuCC,aAAYC,mBAAAA,KAA4BD,IAAAA;",
|
|
6
|
+
"names": ["ref", "makeRef", "create", "create$", "def", "meta", "EchoObject", "Ref", "self", "Ref$"]
|
|
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/Database.ts":{"bytes":689,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Queue.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Space.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Type.ts":{"bytes":6001,"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/index.ts":{"bytes":1157,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/Database.ts","kind":"import-statement","original":"./Database"},{"path":"packages/core/echo/echo/src/Queue.ts","kind":"import-statement","original":"./Queue"},{"path":"packages/core/echo/echo/src/Space.ts","kind":"import-statement","original":"./Space"},{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4020},"packages/core/echo/echo/dist/lib/node/index.cjs":{"imports":[{"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}],"exports":["DXN","Database","Queue","Space","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":34},"packages/core/echo/echo/src/Database.ts":{"bytesInOutput":27},"packages/core/echo/echo/src/Queue.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Space.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":744}},"bytes":1388}}}
|
|
@@ -6,94 +6,44 @@ 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";
|
|
10
9
|
import { DXN } from "@dxos/keys";
|
|
11
10
|
|
|
12
|
-
// packages/core/echo/echo/src/
|
|
13
|
-
var
|
|
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$;
|
|
11
|
+
// packages/core/echo/echo/src/Database.ts
|
|
12
|
+
var Database_exports = {};
|
|
22
13
|
|
|
23
|
-
// packages/core/echo/echo/src/
|
|
24
|
-
var
|
|
25
|
-
__export(Ref_exports, {
|
|
26
|
-
make: () => make
|
|
27
|
-
});
|
|
28
|
-
import { Ref as Ref$ } from "@dxos/echo-schema";
|
|
29
|
-
var make = Ref$.make;
|
|
14
|
+
// packages/core/echo/echo/src/Queue.ts
|
|
15
|
+
var Queue_exports = {};
|
|
30
16
|
|
|
31
|
-
// packages/core/echo/echo/src/
|
|
32
|
-
var
|
|
33
|
-
__export(Relation_exports, {
|
|
34
|
-
def: () => def
|
|
35
|
-
});
|
|
36
|
-
import { EchoRelation } from "@dxos/echo-schema";
|
|
37
|
-
var def = EchoRelation;
|
|
17
|
+
// packages/core/echo/echo/src/Space.ts
|
|
18
|
+
var Space_exports = {};
|
|
38
19
|
|
|
39
|
-
// packages/core/echo/echo/src/
|
|
20
|
+
// packages/core/echo/echo/src/Type.ts
|
|
40
21
|
var Type_exports = {};
|
|
41
22
|
__export(Type_exports, {
|
|
42
|
-
|
|
43
|
-
Kind: () => Kind,
|
|
23
|
+
Kind: () => EntityKind,
|
|
44
24
|
ObjectId: () => ObjectId,
|
|
45
25
|
Ref: () => Ref,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
isMutable: () => isMutable,
|
|
56
|
-
toJsonSchema: () => toJsonSchema
|
|
26
|
+
create: () => create,
|
|
27
|
+
def: () => def,
|
|
28
|
+
getDXN: () => getSchemaDXN,
|
|
29
|
+
getMeta: () => getTypeAnnotation,
|
|
30
|
+
getSchema: () => getSchema,
|
|
31
|
+
getTypename: () => getSchemaTypename,
|
|
32
|
+
getVersion: () => getSchemaVersion,
|
|
33
|
+
instanceOf: () => isInstanceOf,
|
|
34
|
+
ref: () => ref
|
|
57
35
|
});
|
|
58
|
-
import { EchoObject, EntityKind,
|
|
59
|
-
import {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var
|
|
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$;
|
|
36
|
+
import { EchoObject, EntityKind, ObjectId, Ref as Ref$, getTypeAnnotation, getSchema, getSchemaDXN, getSchemaTypename, getSchemaVersion, isInstanceOf } from "@dxos/echo-schema";
|
|
37
|
+
import { create as create$, makeRef } from "@dxos/live-object";
|
|
38
|
+
var ref = makeRef;
|
|
39
|
+
var create = create$;
|
|
40
|
+
var def = (meta) => EchoObject(meta);
|
|
41
|
+
var Ref = (self) => Ref$(self);
|
|
90
42
|
export {
|
|
91
43
|
DXN,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Ref_exports as Ref,
|
|
96
|
-
Relation_exports as Relation,
|
|
44
|
+
Database_exports as Database,
|
|
45
|
+
Queue_exports as Queue,
|
|
46
|
+
Space_exports as Space,
|
|
97
47
|
Type_exports as Type
|
|
98
48
|
};
|
|
99
49
|
//# 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,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/index.ts", "../../../src/Database.ts", "../../../src/Queue.ts", "../../../src/Space.ts", "../../../src/Type.ts"],
|
|
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": ";;;;;;;;AAIA,SAASA,WAAW;;;ACJpB;;;ACAA;;;ACAA;;;ACAA;;;;;;;;;;;;;;;AAMA,SAOEC,YACAC,YACAC,UACAC,OAAOC,MACPC,mBACAC,WACAC,cACAC,mBACAC,kBACAC,oBACK;AACP,SAASC,UAAUC,SAASC,eAAe;AA2CpC,IAAMC,MAAMC;AACZ,IAAMC,SAASC;AAgBf,IAAMC,MAAM,CAACC,SAAmBC,WAAWD,IAAAA;AAc3C,IAAME,MAAM,CAAuCC,SAAYC,KAA4BD,IAAAA;",
|
|
6
|
+
"names": ["DXN", "EchoObject", "EntityKind", "ObjectId", "Ref", "Ref$", "getTypeAnnotation", "getSchema", "getSchemaDXN", "getSchemaTypename", "getSchemaVersion", "isInstanceOf", "create", "create$", "makeRef", "ref", "makeRef", "create", "create$", "def", "meta", "EchoObject", "Ref", "self", "Ref$"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo/src/
|
|
1
|
+
{"inputs":{"packages/core/echo/echo/src/Database.ts":{"bytes":689,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Queue.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Space.ts":{"bytes":671,"imports":[],"format":"esm"},"packages/core/echo/echo/src/Type.ts":{"bytes":6001,"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/index.ts":{"bytes":1157,"imports":[{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"packages/core/echo/echo/src/Database.ts","kind":"import-statement","original":"./Database"},{"path":"packages/core/echo/echo/src/Queue.ts","kind":"import-statement","original":"./Queue"},{"path":"packages/core/echo/echo/src/Space.ts","kind":"import-statement","original":"./Space"},{"path":"packages/core/echo/echo/src/Type.ts","kind":"import-statement","original":"./Type"}],"format":"esm"}},"outputs":{"packages/core/echo/echo/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4021},"packages/core/echo/echo/dist/lib/node-esm/index.mjs":{"imports":[{"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}],"exports":["DXN","Database","Queue","Space","Type"],"entryPoint":"packages/core/echo/echo/src/index.ts","inputs":{"packages/core/echo/echo/src/index.ts":{"bytesInOutput":34},"packages/core/echo/echo/src/Database.ts":{"bytesInOutput":27},"packages/core/echo/echo/src/Queue.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Space.ts":{"bytesInOutput":24},"packages/core/echo/echo/src/Type.ts":{"bytesInOutput":744}},"bytes":1480}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["../../../src/Database.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC,GAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Queue.d.ts","sourceRoot":"","sources":["../../../src/Queue.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC,GAAE"}
|