@dxos/echo 0.8.3-main.672df60 → 0.8.3-staging.0fa589b
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/chunk-UYPR62ZB.mjs +624 -0
- package/dist/lib/browser/chunk-UYPR62ZB.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -280
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +70 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node/chunk-4HQE2F3L.cjs +644 -0
- package/dist/lib/node/chunk-4HQE2F3L.cjs.map +7 -0
- package/dist/lib/node/index.cjs +11 -282
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +89 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-BYBICDIO.mjs +624 -0
- package/dist/lib/node-esm/chunk-BYBICDIO.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +11 -280
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +70 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- 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 +37 -18
- 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/Relation.d.ts +36 -10
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +82 -17
- 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/dist/types/src/query/dsl.d.ts +218 -0
- package/dist/types/src/query/dsl.d.ts.map +1 -0
- package/dist/types/src/query/dsl.test.d.ts +2 -0
- package/dist/types/src/query/dsl.test.d.ts.map +1 -0
- package/dist/types/src/query/index.d.ts +2 -0
- package/dist/types/src/query/index.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/types.d.ts +113 -0
- package/dist/types/src/testing/types.d.ts.map +1 -0
- package/package.json +56 -12
- package/src/Key.ts +5 -0
- package/src/Obj.ts +66 -25
- package/src/Ref.ts +9 -6
- package/src/Relation.ts +75 -13
- package/src/Type.ts +122 -18
- package/src/index.ts +5 -3
- package/src/query/dsl.test.ts +323 -0
- package/src/query/dsl.ts +646 -0
- package/src/query/index.ts +5 -0
- package/src/test/api.test.ts +54 -9
- package/src/testing/index.ts +5 -0
- package/src/testing/types.ts +91 -0
package/dist/types/src/Obj.d.ts
CHANGED
|
@@ -1,27 +1,46 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import * as EchoSchema from '@dxos/echo-schema';
|
|
3
|
-
import type
|
|
4
|
-
import * as LiveObject from '@dxos/live-object';
|
|
3
|
+
import { type DXN } from '@dxos/keys';
|
|
4
|
+
import type * as LiveObject from '@dxos/live-object';
|
|
5
5
|
import type * as Ref from './Ref';
|
|
6
|
+
import type * as Relation from './Relation';
|
|
6
7
|
import type * as Type from './Type';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
interface ObjBase extends Type.OfKind<EchoSchema.EntityKind.Object> {
|
|
9
|
+
readonly id: EchoSchema.ObjectId;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Object type with specific properties.
|
|
13
|
+
*/
|
|
14
|
+
export type Obj<Props> = ObjBase & Props;
|
|
15
|
+
/**
|
|
16
|
+
* Base type for all ECHO objects.
|
|
17
|
+
*/
|
|
18
|
+
export interface Any extends ObjBase {
|
|
19
|
+
}
|
|
20
|
+
type MakeProps<T> = {
|
|
21
|
+
id?: EchoSchema.ObjectId;
|
|
22
|
+
} & Type.Properties<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates new object.
|
|
25
|
+
*/
|
|
26
|
+
export declare const make: <S extends Type.Obj.Any>(schema: S, props: NoInfer<MakeProps<Schema.Schema.Type<S>>>, meta?: EchoSchema.ObjectMeta) => LiveObject.Live<Schema.Schema.Type<S>>;
|
|
12
27
|
export declare const isObject: (obj: unknown) => obj is Any;
|
|
13
28
|
/**
|
|
14
|
-
*
|
|
29
|
+
* Test if object or relation is an instance of a schema.
|
|
15
30
|
* @example
|
|
16
31
|
* ```ts
|
|
17
|
-
* const
|
|
32
|
+
* const john = Obj.make(Person, { name: 'John' });
|
|
33
|
+
* const johnIsPerson = Obj.instanceOf(Person)(john);
|
|
34
|
+
*
|
|
18
35
|
* const isPerson = Obj.instanceOf(Person);
|
|
19
|
-
* isPerson(
|
|
36
|
+
* if(isPerson(john)) {
|
|
37
|
+
* // john is Person
|
|
38
|
+
* }
|
|
20
39
|
* ```
|
|
21
40
|
*/
|
|
22
41
|
export declare const instanceOf: {
|
|
23
|
-
<S extends Type.Relation.Any | Type.Obj.Any>(schema: S): (value: unknown) => value is S
|
|
24
|
-
<S extends Type.Relation.Any | Type.Obj.Any>(schema: S, value: unknown): value is S
|
|
42
|
+
<S extends Type.Relation.Any | Type.Obj.Any>(schema: S): (value: unknown) => value is Schema.Schema.Type<S>;
|
|
43
|
+
<S extends Type.Relation.Any | Type.Obj.Any>(schema: S, value: unknown): value is Schema.Schema.Type<S>;
|
|
25
44
|
};
|
|
26
45
|
export declare const getSchema: (obj: unknown | undefined) => Schema.Schema.AnyNoContext | undefined;
|
|
27
46
|
export declare const getDXN: (obj: Any) => DXN;
|
|
@@ -29,7 +48,7 @@ export declare const getDXN: (obj: Any) => DXN;
|
|
|
29
48
|
* @returns The DXN of the object's type.
|
|
30
49
|
* @example dxn:example.com/type/Contact:1.0.0
|
|
31
50
|
*/
|
|
32
|
-
export declare const
|
|
51
|
+
export declare const getTypeDXN: (obj: EchoSchema.BaseObject) => DXN | undefined;
|
|
33
52
|
/**
|
|
34
53
|
* @returns The typename of the object's type.
|
|
35
54
|
* @example `example.com/type/Contact`
|
|
@@ -43,19 +62,19 @@ export declare const getLabel: (obj: Any) => string | undefined;
|
|
|
43
62
|
*/
|
|
44
63
|
export type JSON = EchoSchema.ObjectJSON;
|
|
45
64
|
/**
|
|
46
|
-
* Converts object to
|
|
65
|
+
* Converts object to its JSON representation.
|
|
47
66
|
*
|
|
48
67
|
* The same algorithm is used when calling the standard `JSON.stringify(obj)` function.
|
|
49
68
|
*/
|
|
50
|
-
export declare const toJSON: (obj: Any) => JSON;
|
|
69
|
+
export declare const toJSON: (obj: Any | Relation.Any) => JSON;
|
|
51
70
|
/**
|
|
52
|
-
* Creates an object from
|
|
53
|
-
*
|
|
54
|
-
* References and schema will be resolvable if the `refResolver` is provided.
|
|
71
|
+
* Creates an object from its json representation, performing schema validation.
|
|
72
|
+
* References and schemas will be resolvable if the `refResolver` is provided.
|
|
55
73
|
*
|
|
56
74
|
* The function need to be async to support resolving the schema as well as the relation endpoints.
|
|
57
75
|
*/
|
|
58
76
|
export declare const fromJSON: (json: unknown, options?: {
|
|
59
77
|
refResolver?: Ref.Resolver;
|
|
60
78
|
}) => Promise<Any>;
|
|
79
|
+
export {};
|
|
61
80
|
//# sourceMappingURL=Obj.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Obj.d.ts","sourceRoot":"","sources":["../../../src/Obj.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Obj.d.ts","sourceRoot":"","sources":["../../../src/Obj.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,M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/Ref.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as EchoSchema from '@dxos/echo-schema';
|
|
2
2
|
import type * as Obj from './Obj';
|
|
3
|
+
export type Ref<T> = EchoSchema.Ref<T>;
|
|
3
4
|
export type Any = EchoSchema.Ref<Obj.Any>;
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export declare const Array: Readonly<{
|
|
6
|
+
targets: <T extends EchoSchema.AnyEchoObject>(refs: EchoSchema.Ref<T>[]) => T[];
|
|
7
|
+
loadAll: <T extends EchoSchema.AnyEchoObject>(refs: EchoSchema.Ref<T>[]) => Promise<T[]>;
|
|
8
|
+
removeById: (refs: EchoSchema.Ref<EchoSchema.AnyEchoObject>[], id: EchoSchema.ObjectId) => void;
|
|
9
|
+
}>;
|
|
7
10
|
/**
|
|
8
11
|
* Extract reference target.
|
|
9
12
|
*/
|
|
@@ -12,4 +15,7 @@ export type Target<R extends Any> = R extends EchoSchema.Ref<infer T> ? T : neve
|
|
|
12
15
|
* Reference resolver.
|
|
13
16
|
*/
|
|
14
17
|
export type Resolver = EchoSchema.RefResolver;
|
|
18
|
+
export declare const isRef: (value: unknown) => value is Any;
|
|
19
|
+
export declare const make: <T extends EchoSchema.WithId>(object: T) => EchoSchema.Ref<T>;
|
|
20
|
+
export declare const fromDXN: (dxn: import("@dxos/keys").DXN) => EchoSchema.Ref<any>;
|
|
15
21
|
//# sourceMappingURL=Ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ref.d.ts","sourceRoot":"","sources":["../../../src/Ref.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,KAAK,GAAG,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Ref.d.ts","sourceRoot":"","sources":["../../../src/Ref.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,KAAK,GAAG,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1C,eAAO,MAAM,KAAK;;;;EAAsB,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAC;AAE9C,eAAO,MAAM,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,GAA0B,CAAC;AAE5E,eAAO,MAAM,IAAI,+DAAsB,CAAC;AAGxC,eAAO,MAAM,OAAO,wDAAyB,CAAC"}
|
|
@@ -1,13 +1,38 @@
|
|
|
1
|
+
import { type Schema } from 'effect';
|
|
1
2
|
import * as EchoSchema from '@dxos/echo-schema';
|
|
2
3
|
import { DXN } from '@dxos/keys';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { type Live } from '@dxos/live-object';
|
|
5
|
+
import type * as Obj from './Obj';
|
|
6
|
+
import type * as Type from './Type';
|
|
7
|
+
interface RelationBase<Source, Target> extends Type.Relation.Endpoints<Source, Target>, Type.OfKind<EchoSchema.EntityKind.Relation> {
|
|
8
|
+
readonly id: EchoSchema.ObjectId;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Relation type with specific properties.
|
|
12
|
+
*/
|
|
13
|
+
export type Relation<Source extends Obj.Any, Target extends Obj.Any, Props> = RelationBase<Source, Target> & Props;
|
|
14
|
+
/**
|
|
15
|
+
* Base type for all ECHO relations.
|
|
16
|
+
*/
|
|
17
|
+
export interface Any extends RelationBase<Obj.Any, Obj.Any> {
|
|
18
|
+
}
|
|
19
|
+
export declare const Source: unique symbol;
|
|
20
|
+
export type Source = typeof Source;
|
|
21
|
+
export declare const Target: unique symbol;
|
|
22
|
+
export type Target = typeof Target;
|
|
23
|
+
type MakeProps<T extends Any> = {
|
|
24
|
+
id?: EchoSchema.ObjectId;
|
|
25
|
+
[Source]: T[Source];
|
|
26
|
+
[Target]: T[Target];
|
|
27
|
+
} & Type.Properties<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates new relation.
|
|
30
|
+
* @param schema - Relation schema.
|
|
31
|
+
* @param props - Relation properties. Endpoints are passed as [Relation.Source] and [Relation.Target] keys.
|
|
32
|
+
* @param meta - Relation metadata.
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export declare const make: <S extends Type.Relation.Any>(schema: S, props: NoInfer<MakeProps<Schema.Schema.Type<S>>>, meta?: EchoSchema.ObjectMeta) => Live<Schema.Schema.Type<S> & Type.OfKind<EchoSchema.EntityKind.Relation>>;
|
|
11
36
|
export declare const isRelation: (value: unknown) => value is Any;
|
|
12
37
|
/**
|
|
13
38
|
* @returns Relation source DXN.
|
|
@@ -23,10 +48,11 @@ export declare const getTargetDXN: (value: Any) => DXN;
|
|
|
23
48
|
* @returns Relation source.
|
|
24
49
|
* @throws If the object is not a relation.
|
|
25
50
|
*/
|
|
26
|
-
export declare const getSource: <T extends Any>(relation: T) =>
|
|
51
|
+
export declare const getSource: <T extends Any>(relation: T) => Type.Relation.Source<T>;
|
|
27
52
|
/**
|
|
28
53
|
* @returns Relation target.
|
|
29
54
|
* @throws If the object is not a relation.
|
|
30
55
|
*/
|
|
31
|
-
export declare const getTarget: <T extends Any>(relation: T) =>
|
|
56
|
+
export declare const getTarget: <T extends Any>(relation: T) => Type.Relation.Target<T>;
|
|
57
|
+
export {};
|
|
32
58
|
//# sourceMappingURL=Relation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Relation.d.ts","sourceRoot":"","sources":["../../../src/Relation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Relation.d.ts","sourceRoot":"","sources":["../../../src/Relation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,KAAK,GAAG,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,KAAK,IAAI,MAAM,QAAQ,CAAC;AAGpC,UAAU,YAAY,CAAC,MAAM,EAAE,MAAM,CACnC,SAAQ,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7C,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC7C,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,KAAK,IAAI,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;AAEnH;;GAEG;AACH,MAAM,WAAW,GAAI,SAAQ,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC;CAAG;AAG9D,eAAO,MAAM,MAAM,EAAE,O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,CAAC,SAAS,GAAG,EAAE,UAAU,CAAC,KAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAM5E,CAAC"}
|
package/dist/types/src/Type.d.ts
CHANGED
|
@@ -1,28 +1,53 @@
|
|
|
1
1
|
import { type Schema } from 'effect';
|
|
2
|
+
import type { Simplify } from 'effect/Schema';
|
|
2
3
|
import type { EncodedReference } from '@dxos/echo-protocol';
|
|
3
4
|
import * as EchoSchema from '@dxos/echo-schema';
|
|
5
|
+
import type { ToMutable } from '@dxos/echo-schema';
|
|
4
6
|
import type * as Keys from '@dxos/keys';
|
|
7
|
+
import type * as RelationModule from './Relation';
|
|
8
|
+
export declare const KindId: unique symbol;
|
|
9
|
+
export type KindId = typeof KindId;
|
|
10
|
+
export { EntityKind as Kind } from '@dxos/echo-schema';
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
12
|
+
* Assigns a kind to an Object or Relation instance.
|
|
13
|
+
*/
|
|
14
|
+
export interface OfKind<Kind extends EchoSchema.EntityKind> {
|
|
15
|
+
readonly id: Keys.ObjectId;
|
|
16
|
+
readonly [KindId]: Kind;
|
|
17
|
+
}
|
|
18
|
+
interface ObjJsonProps {
|
|
19
|
+
id: string;
|
|
20
|
+
}
|
|
21
|
+
interface RelationJsonProps {
|
|
22
|
+
id: string;
|
|
23
|
+
[EchoSchema.ATTR_RELATION_SOURCE]: string;
|
|
24
|
+
[EchoSchema.ATTR_RELATION_TARGET]: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns all properties of an object or relation except for the id and kind.
|
|
28
|
+
*/
|
|
29
|
+
export type Properties<T> = Omit<T, 'id' | KindId | RelationModule.Source | RelationModule.Target>;
|
|
30
|
+
/**
|
|
31
|
+
* Base ECHO schema type.
|
|
7
32
|
*/
|
|
8
33
|
export type Schema = EchoSchema.EchoSchema;
|
|
9
34
|
/**
|
|
10
|
-
*
|
|
35
|
+
* Return type of the `Obj` schema constructor.
|
|
36
|
+
*
|
|
37
|
+
* This typedef avoids `TS4023` error (name from external module cannot be used named).
|
|
38
|
+
* See Effect's note on interface types.
|
|
11
39
|
*/
|
|
12
|
-
export
|
|
40
|
+
export interface obj<Self extends Schema.Schema.Any> extends Schema.AnnotableClass<obj<Self>, OfKind<EchoSchema.EntityKind.Object> & ToMutable<Schema.Schema.Type<Self>>, Simplify<ObjJsonProps & ToMutable<Schema.Schema.Encoded<Self>>>, Schema.Schema.Context<Self>>, EchoSchema.TypeMeta {
|
|
41
|
+
}
|
|
13
42
|
/**
|
|
14
|
-
*
|
|
43
|
+
* Object schema.
|
|
15
44
|
*/
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
source: Source;
|
|
20
|
-
target: Target;
|
|
21
|
-
}) => <Self extends Schema.Schema.Any>(self: Self) => EchoSchema.EchoTypeSchema<Self, EchoSchema.RelationSourceTargetRefs<Schema.Schema.Type<Source>, Schema.Schema.Type<Target>>>;
|
|
45
|
+
export declare const Obj: {
|
|
46
|
+
(opts: EchoSchema.TypeMeta): <Self extends Schema.Schema.Any>(self: Self) => obj<Self>;
|
|
47
|
+
};
|
|
22
48
|
/**
|
|
23
|
-
*
|
|
49
|
+
* Object schema type definitions.
|
|
24
50
|
*/
|
|
25
|
-
export declare const Ref: <S extends Obj.Any>(schema: S) => EchoSchema.Ref$<Schema.Schema.Type<S>>;
|
|
26
51
|
export declare namespace Obj {
|
|
27
52
|
/**
|
|
28
53
|
* Type that represents an arbitrary schema type of an object.
|
|
@@ -30,6 +55,23 @@ export declare namespace Obj {
|
|
|
30
55
|
*/
|
|
31
56
|
type Any = Schema.Schema.AnyNoContext;
|
|
32
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Return type of the `Relation` schema constructor.
|
|
60
|
+
*
|
|
61
|
+
* This typedef avoids `TS4023` error (name from external module cannot be used named).
|
|
62
|
+
* See Effect's note on interface types.
|
|
63
|
+
*/
|
|
64
|
+
export interface relation<Self extends Schema.Schema.Any, SourceSchema extends Schema.Schema.Any, TargetSchema extends Schema.Schema.Any> extends Schema.AnnotableClass<relation<Self, SourceSchema, TargetSchema>, OfKind<EchoSchema.EntityKind.Relation> & Relation.Endpoints<Schema.Schema.Type<SourceSchema>, Schema.Schema.Type<TargetSchema>> & ToMutable<Schema.Schema.Type<Self>>, Simplify<RelationJsonProps & ToMutable<Schema.Schema.Encoded<Self>>>, Schema.Schema.Context<Self>>, EchoSchema.TypeMeta {
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Relation schema.
|
|
68
|
+
*/
|
|
69
|
+
export declare const Relation: {
|
|
70
|
+
<Source extends Schema.Schema.AnyNoContext, Target extends Schema.Schema.AnyNoContext>(opts: EchoSchema.EchoRelationOptions<Source, Target>): <Self extends Schema.Schema.Any>(self: Self) => relation<Self, Source, Target>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Relation schema type definitions.
|
|
74
|
+
*/
|
|
33
75
|
export declare namespace Relation {
|
|
34
76
|
/**
|
|
35
77
|
* Type that represents an arbitrary schema type of a relation.
|
|
@@ -39,11 +81,29 @@ export declare namespace Relation {
|
|
|
39
81
|
/**
|
|
40
82
|
* Get relation target type.
|
|
41
83
|
*/
|
|
42
|
-
type Target<A> = A extends
|
|
84
|
+
type Target<A> = A extends Relation.Endpoints<infer _S, infer T> ? T : never;
|
|
43
85
|
/**
|
|
44
86
|
* Get relation source type.
|
|
45
87
|
*/
|
|
46
|
-
type Source<A> = A extends
|
|
88
|
+
type Source<A> = A extends Relation.Endpoints<infer S, infer _T> ? S : never;
|
|
89
|
+
type Endpoints<Source, Target> = {
|
|
90
|
+
[RelationModule.Source]: Source;
|
|
91
|
+
[RelationModule.Target]: Target;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Return type of the `Ref` schema constructor.
|
|
96
|
+
*
|
|
97
|
+
* This typedef avoids `TS4023` error (name from external module cannot be used named).
|
|
98
|
+
* See Effect's note on interface types.
|
|
99
|
+
*/
|
|
100
|
+
export interface ref<TargetSchema extends Schema.Schema.Any> extends EchoSchema.Ref$<Schema.Schema.Type<TargetSchema>> {
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Ref schema.
|
|
104
|
+
*/
|
|
105
|
+
export declare const Ref: <S extends Obj.Any>(schema: S) => ref<S>;
|
|
106
|
+
export interface Ref<T> extends Schema.SchemaClass<EchoSchema.Ref<T>, EncodedReference> {
|
|
47
107
|
}
|
|
48
108
|
export declare namespace Ref {
|
|
49
109
|
/**
|
|
@@ -77,11 +137,16 @@ export type Meta = EchoSchema.TypeAnnotation;
|
|
|
77
137
|
* Gets the meta data of the schema.
|
|
78
138
|
*/
|
|
79
139
|
export declare const getMeta: (schema: Obj.Any | Relation.Any) => Meta | undefined;
|
|
80
|
-
export { EntityKind as Kind } from '@dxos/echo-schema';
|
|
81
140
|
/**
|
|
82
141
|
* @returns True if the schema is mutable.
|
|
83
142
|
*/
|
|
84
|
-
export declare const isMutable: (schema:
|
|
143
|
+
export declare const isMutable: (schema: Schema.Schema.AnyNoContext) => schema is EchoSchema.EchoSchema;
|
|
85
144
|
export { SpaceId, ObjectId, DXN } from '@dxos/keys';
|
|
86
|
-
export
|
|
145
|
+
export interface Expando extends OfKind<EchoSchema.EntityKind.Object> {
|
|
146
|
+
[key: string]: any;
|
|
147
|
+
}
|
|
148
|
+
export declare const Expando: Schema.Schema<Expando, Simplify<ObjJsonProps & {
|
|
149
|
+
[key: string]: any;
|
|
150
|
+
}>, never>;
|
|
151
|
+
export { Format, JsonSchemaType as JsonSchema, toEffectSchema, toJsonSchema, } from '@dxos/echo-schema';
|
|
87
152
|
//# sourceMappingURL=Type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../../src/Type.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Type.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AAM,SAAS,yEAAuB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,OAAQ,SAAQ,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;IACnE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CACjC,OAAO,EACP,QAAQ,CAAC,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC,EAC/C,KAAK,CACsB,CAAC;AAE9B,OAAO,EAEL,MAAM,EACN,cAAc,IAAI,UAAU,EAC5B,cAAc,EACd,YAAY,GACb,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as Key from './Key';
|
|
2
2
|
export * as Obj from './Obj';
|
|
3
|
-
export * as Relation from './Relation';
|
|
4
3
|
export * as Ref from './Ref';
|
|
4
|
+
export * as Relation from './Relation';
|
|
5
|
+
export * as Type from './Type';
|
|
6
|
+
export { DXN } from '@dxos/keys';
|
|
7
|
+
export { Filter, Query } from './query';
|
|
5
8
|
export { type Live } from '@dxos/live-object';
|
|
6
|
-
export { Filter, Query } from '@dxos/echo-schema';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Simplify } from 'effect/Schema';
|
|
3
|
+
import { type ForeignKey, type QueryAST } from '@dxos/echo-protocol';
|
|
4
|
+
import { DXN, ObjectId } from '@dxos/keys';
|
|
5
|
+
import * as Ref from '../Ref';
|
|
6
|
+
import type * as Type from '../Type';
|
|
7
|
+
export interface Query<T> {
|
|
8
|
+
'~Query': {
|
|
9
|
+
value: T;
|
|
10
|
+
};
|
|
11
|
+
ast: QueryAST.Query;
|
|
12
|
+
/**
|
|
13
|
+
* Filter the current selection based on a filter.
|
|
14
|
+
* @param filter - Filter to select the objects.
|
|
15
|
+
* @returns Query for the selected objects.
|
|
16
|
+
*/
|
|
17
|
+
select(filter: Filter<T>): Query<T>;
|
|
18
|
+
select(props: Filter.Props<T>): Query<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Traverse an outgoing reference.
|
|
21
|
+
* @param key - Property path inside T that is a reference.
|
|
22
|
+
* @returns Query for the target of the reference.
|
|
23
|
+
*/
|
|
24
|
+
reference<K extends RefPropKey<T>>(key: K): Query<T[K] extends Ref.Any ? Ref.Target<T[K]> : never>;
|
|
25
|
+
/**
|
|
26
|
+
* Find objects referencing this object.
|
|
27
|
+
* @param target - Schema of the referencing object.
|
|
28
|
+
* @param key - Property path inside the referencing object that is a reference.
|
|
29
|
+
* @returns Query for the referencing objects.
|
|
30
|
+
*/
|
|
31
|
+
referencedBy<S extends Schema.Schema.All>(target: S, key: RefPropKey<Schema.Schema.Type<S>>): Query<Schema.Schema.Type<S>>;
|
|
32
|
+
/**
|
|
33
|
+
* Find relations where this object is the source.
|
|
34
|
+
* @returns Query for the relation objects.
|
|
35
|
+
* @param relation - Schema of the relation.
|
|
36
|
+
* @param predicates - Predicates to filter the relation objects.
|
|
37
|
+
*/
|
|
38
|
+
sourceOf<S extends Schema.Schema.All>(relation: S, predicates?: Filter.Props<Schema.Schema.Type<S>>): Query<Schema.Schema.Type<S>>;
|
|
39
|
+
/**
|
|
40
|
+
* Find relations where this object is the target.
|
|
41
|
+
* @returns Query for the relation objects.
|
|
42
|
+
* @param relation - Schema of the relation.
|
|
43
|
+
* @param predicates - Predicates to filter the relation objects.
|
|
44
|
+
*/
|
|
45
|
+
targetOf<S extends Schema.Schema.All>(relation: S, predicates?: Filter.Props<Schema.Schema.Type<S>>): Query<Schema.Schema.Type<S>>;
|
|
46
|
+
/**
|
|
47
|
+
* For a query for relations, get the source objects.
|
|
48
|
+
* @returns Query for the source objects.
|
|
49
|
+
*/
|
|
50
|
+
source(): Query<Type.Relation.Source<T>>;
|
|
51
|
+
/**
|
|
52
|
+
* For a query for relations, get the target objects.
|
|
53
|
+
* @returns Query for the target objects.
|
|
54
|
+
*/
|
|
55
|
+
target(): Query<Type.Relation.Target<T>>;
|
|
56
|
+
/**
|
|
57
|
+
* Add options to a query.
|
|
58
|
+
*/
|
|
59
|
+
options(options: QueryAST.QueryOptions): Query<T>;
|
|
60
|
+
}
|
|
61
|
+
interface QueryAPI {
|
|
62
|
+
is(value: unknown): value is Query.Any;
|
|
63
|
+
/**
|
|
64
|
+
* Select objects based on a filter.
|
|
65
|
+
* @param filter - Filter to select the objects.
|
|
66
|
+
* @returns Query for the selected objects.
|
|
67
|
+
*/
|
|
68
|
+
select<F extends Filter.Any>(filter: F): Query<Filter.Type<F>>;
|
|
69
|
+
/**
|
|
70
|
+
* Query for objects of a given schema.
|
|
71
|
+
* @param schema - Schema of the objects.
|
|
72
|
+
* @param predicates - Predicates to filter the objects.
|
|
73
|
+
* @returns Query for the objects.
|
|
74
|
+
*
|
|
75
|
+
* Shorthand for: `Query.select(Filter.type(schema, predicates))`.
|
|
76
|
+
*/
|
|
77
|
+
type<S extends Schema.Schema.All>(schema: S, predicates?: Filter.Props<Schema.Schema.Type<S>>): Query<Schema.Schema.Type<S>>;
|
|
78
|
+
/**
|
|
79
|
+
* Combine results of multiple queries.
|
|
80
|
+
* @param queries - Queries to combine.
|
|
81
|
+
* @returns Query for the combined results.
|
|
82
|
+
*/
|
|
83
|
+
all<T>(...queries: Query<T>[]): Query<T>;
|
|
84
|
+
/**
|
|
85
|
+
* Subtract one query from another.
|
|
86
|
+
* @param source - Query to subtract from.
|
|
87
|
+
* @param exclude - Query to subtract.
|
|
88
|
+
* @returns Query for the results of the source query minus the results of the exclude query.
|
|
89
|
+
*/
|
|
90
|
+
without<T>(source: Query<T>, exclude: Query<T>): Query<T>;
|
|
91
|
+
}
|
|
92
|
+
export declare namespace Query {
|
|
93
|
+
type Any = Query<any>;
|
|
94
|
+
type Type<Q extends Any> = Q extends Query<infer T> ? T : never;
|
|
95
|
+
type TextSearchOptions = {
|
|
96
|
+
type?: 'full-text' | 'vector';
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface Filter<T> {
|
|
100
|
+
'~Filter': {
|
|
101
|
+
value: T;
|
|
102
|
+
};
|
|
103
|
+
ast: QueryAST.Filter;
|
|
104
|
+
}
|
|
105
|
+
type Intersection<Types extends readonly unknown[]> = Types extends [infer First, ...infer Rest] ? First & Intersection<Rest> : unknown;
|
|
106
|
+
interface FilterAPI {
|
|
107
|
+
is(value: unknown): value is Filter<any>;
|
|
108
|
+
/**
|
|
109
|
+
* Filter that matches all objects.
|
|
110
|
+
*/
|
|
111
|
+
everything(): Filter<any>;
|
|
112
|
+
/**
|
|
113
|
+
* Filter that matches no objects.
|
|
114
|
+
*/
|
|
115
|
+
nothing(): Filter<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Filter by object IDs.
|
|
118
|
+
*/
|
|
119
|
+
ids(...id: ObjectId[]): Filter<any>;
|
|
120
|
+
/**
|
|
121
|
+
* Filter by type.
|
|
122
|
+
*/
|
|
123
|
+
type<S extends Schema.Schema.All>(schema: S, props?: Filter.Props<Schema.Schema.Type<S>>): Filter<Schema.Schema.Type<S>>;
|
|
124
|
+
/**
|
|
125
|
+
* Filter by non-qualified typename.
|
|
126
|
+
*/
|
|
127
|
+
typename(typename: string): Filter<any>;
|
|
128
|
+
/**
|
|
129
|
+
* Filter by fully qualified type DXN.
|
|
130
|
+
*/
|
|
131
|
+
typeDXN(dxn: DXN): Filter<any>;
|
|
132
|
+
/**
|
|
133
|
+
* Filter by properties.
|
|
134
|
+
*
|
|
135
|
+
* INTERNAL API: Do not use.
|
|
136
|
+
*/
|
|
137
|
+
_props<T>(props: Filter.Props<T>): Filter<T>;
|
|
138
|
+
/**
|
|
139
|
+
* Full-text or vector search.
|
|
140
|
+
*/
|
|
141
|
+
text(text: string, options?: Query.TextSearchOptions): Filter<any>;
|
|
142
|
+
/**
|
|
143
|
+
* Filter by foreign keys.
|
|
144
|
+
*/
|
|
145
|
+
foreignKeys<S extends Schema.Schema.All>(schema: S, keys: ForeignKey[]): Filter<Schema.Schema.Type<S>>;
|
|
146
|
+
/**
|
|
147
|
+
* Predicate for property to be equal to the provided value.
|
|
148
|
+
*/
|
|
149
|
+
eq<T>(value: T): Filter<T>;
|
|
150
|
+
/**
|
|
151
|
+
* Predicate for property to be not equal to the provided value.
|
|
152
|
+
*/
|
|
153
|
+
neq<T>(value: T): Filter<T>;
|
|
154
|
+
/**
|
|
155
|
+
* Predicate for property to be greater than the provided value.
|
|
156
|
+
*/
|
|
157
|
+
gt<T>(value: T): Filter<T>;
|
|
158
|
+
/**
|
|
159
|
+
* Predicate for property to be greater than the provided value.
|
|
160
|
+
*/
|
|
161
|
+
gt<T>(value: T): Filter<T>;
|
|
162
|
+
/**
|
|
163
|
+
* Predicate for property to be greater than or equal to the provided value.
|
|
164
|
+
*/
|
|
165
|
+
gte<T>(value: T): Filter<T>;
|
|
166
|
+
/**
|
|
167
|
+
* Predicate for property to be less than the provided value.
|
|
168
|
+
*/
|
|
169
|
+
lt<T>(value: T): Filter<T>;
|
|
170
|
+
/**
|
|
171
|
+
* Predicate for property to be less than or equal to the provided value.
|
|
172
|
+
*/
|
|
173
|
+
lte<T>(value: T): Filter<T>;
|
|
174
|
+
/**
|
|
175
|
+
* Predicate for property to be in the provided array.
|
|
176
|
+
* @param values - Values to check against.
|
|
177
|
+
*/
|
|
178
|
+
in<T>(...values: T[]): Filter<T>;
|
|
179
|
+
/**
|
|
180
|
+
* Predicate for property to be in the provided range.
|
|
181
|
+
* @param from - Start of the range (inclusive).
|
|
182
|
+
* @param to - End of the range (exclusive).
|
|
183
|
+
*/
|
|
184
|
+
between<T>(from: T, to: T): Filter<T>;
|
|
185
|
+
/**
|
|
186
|
+
* Negate the filter.
|
|
187
|
+
*/
|
|
188
|
+
not<F extends Filter.Any>(filter: F): Filter<Filter.Type<F>>;
|
|
189
|
+
/**
|
|
190
|
+
* Combine filters with a logical AND.
|
|
191
|
+
*/
|
|
192
|
+
and<FS extends Filter.Any[]>(...filters: FS): Filter<Filter.And<FS>>;
|
|
193
|
+
/**
|
|
194
|
+
* Combine filters with a logical OR.
|
|
195
|
+
*/
|
|
196
|
+
or<FS extends Filter.Any[]>(...filters: FS): Filter<Filter.Or<FS>>;
|
|
197
|
+
}
|
|
198
|
+
export declare namespace Filter {
|
|
199
|
+
type Props<T> = {
|
|
200
|
+
[K in keyof T & string]?: Filter<T[K]> | T[K];
|
|
201
|
+
};
|
|
202
|
+
type Any = Filter<any>;
|
|
203
|
+
type Type<F extends Any> = F extends Filter<infer T> ? T : never;
|
|
204
|
+
type And<FS extends readonly Any[]> = Simplify<Intersection<{
|
|
205
|
+
[K in keyof FS]: Type<FS[K]>;
|
|
206
|
+
}>>;
|
|
207
|
+
type Or<FS extends readonly Any[]> = Simplify<{
|
|
208
|
+
[K in keyof FS]: Type<FS[K]>;
|
|
209
|
+
}[number]>;
|
|
210
|
+
}
|
|
211
|
+
export declare const Filter: FilterAPI;
|
|
212
|
+
/**
|
|
213
|
+
* All property paths inside T that are references.
|
|
214
|
+
*/
|
|
215
|
+
type RefPropKey<T> = keyof T & string;
|
|
216
|
+
export declare const Query: QueryAPI;
|
|
217
|
+
export {};
|
|
218
|
+
//# sourceMappingURL=dsl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsl.d.ts","sourceRoot":"","sources":["../../../../src/query/dsl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAKrC,MAAM,WAAW,KAAK,CAAC,CAAC;IAEtB,QAAQ,EAAE;QAAE,KAAK,EAAE,CAAC,CAAA;KAAE,CAAC;IAEvB,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEzC;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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AC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC;AA8ItC,eAAO,MAAM,KAAK,EAAE,QAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsl.test.d.ts","sourceRoot":"","sources":["../../../../src/query/dsl.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/query/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
|