@dxos/index-core 0.8.4-main.fcfe5033a5 → 0.9.0
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/index.mjs +190 -101
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/types/src/index-engine.d.ts +31 -17
- package/dist/types/src/index-engine.d.ts.map +1 -1
- package/dist/types/src/index-tracker.d.ts +3 -3
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/indexes/entity-meta-index.d.ts +113 -0
- package/dist/types/src/indexes/entity-meta-index.d.ts.map +1 -0
- package/dist/types/src/indexes/entity-meta-index.test.d.ts +2 -0
- package/dist/types/src/indexes/entity-meta-index.test.d.ts.map +1 -0
- package/dist/types/src/indexes/fts-index.d.ts +7 -6
- package/dist/types/src/indexes/fts-index.d.ts.map +1 -1
- package/dist/types/src/indexes/index.d.ts +1 -1
- package/dist/types/src/indexes/interface.d.ts +15 -4
- package/dist/types/src/indexes/interface.d.ts.map +1 -1
- package/dist/types/src/indexes/reverse-ref-index.d.ts +3 -2
- package/dist/types/src/indexes/reverse-ref-index.d.ts.map +1 -1
- package/dist/types/src/utils.d.ts +3 -3
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -18
- package/src/index-engine.test.ts +138 -16
- package/src/index-engine.ts +123 -58
- package/src/index.ts +9 -3
- package/src/indexes/{object-meta-index.test.ts → entity-meta-index.test.ts} +114 -53
- package/src/indexes/{object-meta-index.ts → entity-meta-index.ts} +140 -71
- package/src/indexes/fts-index.test.ts +188 -34
- package/src/indexes/fts-index.ts +32 -15
- package/src/indexes/index.ts +1 -1
- package/src/indexes/interface.ts +16 -4
- package/src/indexes/reverse-ref-index.test.ts +57 -43
- package/src/indexes/reverse-ref-index.ts +22 -14
- package/src/utils.ts +5 -5
- package/dist/types/src/indexes/object-meta-index.d.ts +0 -88
- package/dist/types/src/indexes/object-meta-index.d.ts.map +0 -1
- package/dist/types/src/indexes/object-meta-index.test.d.ts +0 -2
- package/dist/types/src/indexes/object-meta-index.test.d.ts.map +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as SqlClient from '@effect/sql/SqlClient';
|
|
2
|
+
import type * as SqlError from '@effect/sql/SqlError';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import * as Schema from 'effect/Schema';
|
|
5
|
+
import { EID, EntityId, SpaceId, URI } from '@dxos/keys';
|
|
6
|
+
import type { IndexerObject } from './interface';
|
|
7
|
+
import type { Index } from './interface';
|
|
8
|
+
export declare const EntityMeta: Schema.Struct<{
|
|
9
|
+
recordId: typeof Schema.Number;
|
|
10
|
+
objectId: import("@dxos/keys").EntityIdClass;
|
|
11
|
+
/** Empty string for non-queue objects. */
|
|
12
|
+
queueId: typeof Schema.String;
|
|
13
|
+
/** Queue subspace namespace (e.g. 'data', 'trace'). Empty string for non-queue objects. */
|
|
14
|
+
queueNamespace: typeof Schema.String;
|
|
15
|
+
spaceId: Schema.Schema<SpaceId, string, never> & {
|
|
16
|
+
byteLength: number;
|
|
17
|
+
encode: (value: Uint8Array) => SpaceId;
|
|
18
|
+
decode: (value: SpaceId) => Uint8Array;
|
|
19
|
+
isValid: (value: unknown) => value is SpaceId;
|
|
20
|
+
make: (value: string) => SpaceId;
|
|
21
|
+
random: () => SpaceId;
|
|
22
|
+
};
|
|
23
|
+
documentId: typeof Schema.String;
|
|
24
|
+
entityKind: typeof Schema.String;
|
|
25
|
+
/**
|
|
26
|
+
* Type identifier URI for the object — typename DXN for non-stored schemas,
|
|
27
|
+
* schema-as-object EID for stored (dynamic) schemas. Mirrors the value
|
|
28
|
+
* written into the object's `system.type`.
|
|
29
|
+
*/
|
|
30
|
+
typeDXN: Schema.Schema<URI.URI, URI.URI, never>;
|
|
31
|
+
deleted: typeof Schema.Boolean;
|
|
32
|
+
source: Schema.NullOr<Schema.Schema<EID.EID, EID.EID, never>>;
|
|
33
|
+
target: Schema.NullOr<Schema.Schema<EID.EID, EID.EID, never>>;
|
|
34
|
+
/** Parent object id (nullable). */
|
|
35
|
+
parent: Schema.NullOr<Schema.Schema<EID.EID, EID.EID, never>>;
|
|
36
|
+
/** Monotonically increasing sequence number assigned on insert/update for tracking indexing order. */
|
|
37
|
+
version: typeof Schema.Number;
|
|
38
|
+
/** Unix ms timestamp when the object was first indexed. */
|
|
39
|
+
createdAt: Schema.NullOr<typeof Schema.Number>;
|
|
40
|
+
/** Unix ms timestamp when the object was last re-indexed. */
|
|
41
|
+
updatedAt: Schema.NullOr<typeof Schema.Number>;
|
|
42
|
+
}>;
|
|
43
|
+
export interface EntityMeta extends Schema.Schema.Type<typeof EntityMeta> {
|
|
44
|
+
}
|
|
45
|
+
export declare class EntityMetaIndex implements Index {
|
|
46
|
+
migrate: () => Effect.Effect<void, SqlError.SqlError, SqlClient.SqlClient>;
|
|
47
|
+
query: (query: Pick<EntityMeta, "spaceId" | "typeDXN">) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
48
|
+
queryAll: (query: {
|
|
49
|
+
spaceIds: readonly EntityMeta['spaceId'][];
|
|
50
|
+
includeAllQueues?: boolean;
|
|
51
|
+
queueIds?: readonly string[] | null;
|
|
52
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
53
|
+
queryTypes: (args_0: {
|
|
54
|
+
spaceIds: readonly EntityMeta['spaceId'][];
|
|
55
|
+
typeDxns: readonly EntityMeta['typeDXN'][];
|
|
56
|
+
inverted?: boolean;
|
|
57
|
+
includeAllQueues?: boolean;
|
|
58
|
+
queueIds?: readonly string[] | null;
|
|
59
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
60
|
+
queryRelations: (args_0: {
|
|
61
|
+
endpoint: 'source' | 'target';
|
|
62
|
+
anchorDxns: readonly string[];
|
|
63
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
64
|
+
update: (objects: IndexerObject[]) => Effect.Effect<void, SqlError.SqlError, SqlClient.SqlClient>;
|
|
65
|
+
/**
|
|
66
|
+
* Look up `recordIds` for objects that are already stored in the EntityMetaIndex.
|
|
67
|
+
* Mutates the objects in place.
|
|
68
|
+
*/
|
|
69
|
+
lookupRecordIds: (objects: IndexerObject[]) => Effect.Effect<void, SqlError.SqlError, SqlClient.SqlClient>;
|
|
70
|
+
/**
|
|
71
|
+
* Look up object metadata by recordIds.
|
|
72
|
+
*/
|
|
73
|
+
lookupByRecordIds: (recordIds: number[]) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
74
|
+
/**
|
|
75
|
+
* Look up object metadata by object id across one or more spaces (space db and queue items).
|
|
76
|
+
*/
|
|
77
|
+
queryObjectIds: (query: {
|
|
78
|
+
spaceIds: readonly EntityMeta['spaceId'][];
|
|
79
|
+
objectIds: readonly EntityMeta['objectId'][];
|
|
80
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
81
|
+
/**
|
|
82
|
+
* Look up object metadata by objectId, spaceId, and queueId.
|
|
83
|
+
*/
|
|
84
|
+
lookupByObjectId: (query: {
|
|
85
|
+
objectId: string;
|
|
86
|
+
spaceId: string;
|
|
87
|
+
queueId: string;
|
|
88
|
+
}) => Effect.Effect<EntityMeta | null, SqlError.SqlError, SqlClient.SqlClient>;
|
|
89
|
+
/**
|
|
90
|
+
* Query objects by timestamp range.
|
|
91
|
+
*/
|
|
92
|
+
queryByTimeRange: (query: {
|
|
93
|
+
spaceIds: readonly string[];
|
|
94
|
+
updatedAfter?: number;
|
|
95
|
+
updatedBefore?: number;
|
|
96
|
+
createdAfter?: number;
|
|
97
|
+
createdBefore?: number;
|
|
98
|
+
includeAllQueues?: boolean;
|
|
99
|
+
queueIds?: readonly string[] | null;
|
|
100
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
101
|
+
/**
|
|
102
|
+
* Query children by parent object ids.
|
|
103
|
+
* Matches both:
|
|
104
|
+
* - Objects whose `parent` field references one of the given parent ids (standard parent/child hierarchy).
|
|
105
|
+
* - Queue items whose `queueId` equals one of the parent ids (e.g. items inside a Feed, since a feed's queue
|
|
106
|
+
* DXN uses the feed's object id as its queue id — see `Feed.getQueueUri`).
|
|
107
|
+
*/
|
|
108
|
+
queryChildren: (query: {
|
|
109
|
+
spaceId: SpaceId[];
|
|
110
|
+
parentIds: EntityId[];
|
|
111
|
+
}) => Effect.Effect<readonly EntityMeta[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=entity-meta-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-meta-index.d.ts","sourceRoot":"","sources":["../../../../src/indexes/entity-meta-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAO,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA2BzC,eAAO,MAAM,UAAU;;;IAGrB,0CAA0C;;IAE1C,2FAA2F;;;;;;;;;;;;IAK3F;;;;OAIG;;;;;IAKH,mCAAmC;;IAEnC,sGAAsG;;IAEtG,2DAA2D;;IAE3D,6DAA6D;;EAE7D,CAAC;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAiC5E,qBAAa,eAAgB,YAAW,KAAK;IAC3C,OAAO,oEAsCJ;IAEH,KAAK,mIAqBH;IAEF,QAAQ;kBAEM,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE;2BACvB,OAAO;mBACf,SAAS,MAAM,EAAE,GAAG,IAAI;uFAoBrC;IAEF,UAAU;kBAQI,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE;kBAChC,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE;mBAC/B,OAAO;2BACC,OAAO;mBACf,SAAS,MAAM,EAAE,GAAG,IAAI;uFAyCrC;IAEF,cAAc;kBAKA,QAAQ,GAAG,QAAQ;oBACjB,SAAS,MAAM,EAAE;uFAiB/B;IAGF,MAAM,4FAoFJ;IAEF;;;OAGG;IACH,eAAe,4FA+Bb;IAEF;;OAEG;IACH,iBAAiB,wGAef;IAEF;;OAEG;IACH,cAAc;kBAEA,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE;mBAC/B,SAAS,UAAU,CAAC,UAAU,CAAC,EAAE;uFAe9C;IAEF;;OAEG;IACH,gBAAgB;kBAEF,MAAM;iBACP,MAAM;iBACN,MAAM;mFAgBjB;IAEF;;OAEG;IACH,gBAAgB;kBAEF,SAAS,MAAM,EAAE;uBACZ,MAAM;wBACL,MAAM;uBACP,MAAM;wBACL,MAAM;2BACH,OAAO;mBACf,SAAS,MAAM,EAAE,GAAG,IAAI;uFAuCrC;IAEF;;;;;;OAMG;IACH,aAAa;iBAEA,OAAO,EAAE;mBACP,QAAQ,EAAE;uFAkBvB;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-meta-index.test.d.ts","sourceRoot":"","sources":["../../../../src/indexes/entity-meta-index.test.ts"],"names":[],"mappings":""}
|
|
@@ -2,9 +2,9 @@ import * as SqlClient from '@effect/sql/SqlClient';
|
|
|
2
2
|
import type * as SqlError from '@effect/sql/SqlError';
|
|
3
3
|
import * as Effect from 'effect/Effect';
|
|
4
4
|
import type { Obj } from '@dxos/echo';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EntityId, SpaceId } from '@dxos/keys';
|
|
6
|
+
import type { EntityMeta } from './entity-meta-index';
|
|
6
7
|
import type { Index, IndexerObject } from './interface';
|
|
7
|
-
import type { ObjectMeta } from './object-meta-index';
|
|
8
8
|
/**
|
|
9
9
|
* The space and queue constrains are combined together using a logical OR.
|
|
10
10
|
*/
|
|
@@ -24,12 +24,12 @@ export interface FtsQuery {
|
|
|
24
24
|
/**
|
|
25
25
|
* Queue IDs to search within.
|
|
26
26
|
*/
|
|
27
|
-
queueIds: readonly
|
|
27
|
+
queueIds: readonly EntityId[] | null;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Result of FTS query including the indexed snapshot data.
|
|
31
31
|
*/
|
|
32
|
-
export interface FtsResult extends
|
|
32
|
+
export interface FtsResult extends EntityMeta {
|
|
33
33
|
/**
|
|
34
34
|
* The indexed snapshot data (JSON string).
|
|
35
35
|
* Used to load queue objects without going through document loading.
|
|
@@ -39,7 +39,7 @@ export interface FtsResult extends ObjectMeta {
|
|
|
39
39
|
/**
|
|
40
40
|
* Result of FTS query with rank.
|
|
41
41
|
*/
|
|
42
|
-
export interface FtsQueryResult extends
|
|
42
|
+
export interface FtsQueryResult extends EntityMeta {
|
|
43
43
|
/**
|
|
44
44
|
* Relevance rank from FTS5.
|
|
45
45
|
* Higher values indicate better matches.
|
|
@@ -49,10 +49,11 @@ export interface FtsQueryResult extends ObjectMeta {
|
|
|
49
49
|
}
|
|
50
50
|
export declare class FtsIndex implements Index {
|
|
51
51
|
migrate: () => Effect.Effect<void, SqlError.SqlError, SqlClient.SqlClient>;
|
|
52
|
-
query({ query, spaceId, includeAllQueues, queueIds
|
|
52
|
+
query({ query, spaceId, includeAllQueues, queueIds }: FtsQuery): Effect.Effect<readonly FtsQueryResult[], SqlError.SqlError, SqlClient.SqlClient>;
|
|
53
53
|
/**
|
|
54
54
|
* Query snapshots by recordIds.
|
|
55
55
|
* Returns the parsed JSON snapshots for queue objects.
|
|
56
|
+
* RecordIds not present in the FTS index are silently omitted from the result.
|
|
56
57
|
*/
|
|
57
58
|
querySnapshotsJSON(recordIds: number[]): Effect.Effect<readonly {
|
|
58
59
|
recordId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fts-index.d.ts","sourceRoot":"","sources":["../../../../src/indexes/fts-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"fts-index.d.ts","sourceRoot":"","sources":["../../../../src/indexes/fts-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMxD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAyBD,qBAAa,QAAS,YAAW,KAAK;IACpC,OAAO,oEAYJ;IAEH,KAAK,CAAC,EACJ,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACT,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAwE7F;IAED;;;;OAIG;IACH,kBAAkB,CAChB,SAAS,EAAE,MAAM,EAAE,GAClB,MAAM,CAAC,MAAM,CAAC,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAA;KAAE,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CA2B5G;IAED,MAAM,4FA2BJ;CACH"}
|
|
@@ -2,7 +2,7 @@ import type * as SqlClient from '@effect/sql/SqlClient';
|
|
|
2
2
|
import type * as SqlError from '@effect/sql/SqlError';
|
|
3
3
|
import type * as Effect from 'effect/Effect';
|
|
4
4
|
import type { Obj } from '@dxos/echo';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EntityId, SpaceId } from '@dxos/keys';
|
|
6
6
|
/**
|
|
7
7
|
* Data describing objects returned from sources to the indexer.
|
|
8
8
|
*/
|
|
@@ -12,7 +12,12 @@ export interface IndexerObject {
|
|
|
12
12
|
* Queue id if object is from the queue.
|
|
13
13
|
* If null, `documentId` must be set.
|
|
14
14
|
*/
|
|
15
|
-
queueId:
|
|
15
|
+
queueId: EntityId | null;
|
|
16
|
+
/**
|
|
17
|
+
* Queue subspace namespace (e.g. 'data', 'trace') the object lives in.
|
|
18
|
+
* Set together with `queueId`; null for non-queue objects.
|
|
19
|
+
*/
|
|
20
|
+
queueNamespace: string | null;
|
|
16
21
|
/**
|
|
17
22
|
* Document id if object is from the automerge document.
|
|
18
23
|
* If null, `queueId` must be set.
|
|
@@ -20,14 +25,20 @@ export interface IndexerObject {
|
|
|
20
25
|
documentId: string | null;
|
|
21
26
|
/**
|
|
22
27
|
* Record id from the objectMeta index.
|
|
23
|
-
* `Null` before the object is stored in the
|
|
24
|
-
* Enriched by the IndexEngine after the object is stored in the
|
|
28
|
+
* `Null` before the object is stored in the EntityMetaIndex.
|
|
29
|
+
* Enriched by the IndexEngine after the object is stored in the EntityMetaIndex.
|
|
25
30
|
*/
|
|
26
31
|
recordId: number | null;
|
|
27
32
|
/**
|
|
28
33
|
* JSON data of the object.
|
|
29
34
|
*/
|
|
30
35
|
data: Obj.JSON;
|
|
36
|
+
/**
|
|
37
|
+
* Unix ms timestamp when this object was first created.
|
|
38
|
+
* Sourced from system.createdAt in the automerge document; null for legacy objects
|
|
39
|
+
* created before this field was introduced.
|
|
40
|
+
*/
|
|
41
|
+
createdAt: number | null;
|
|
31
42
|
/**
|
|
32
43
|
* Timestamp of the last update of the object.
|
|
33
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/indexes/interface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE3E;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACnG"}
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/indexes/interface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;IAEf;;;;OAIG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE3E;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACnG"}
|
|
@@ -2,10 +2,11 @@ import * as SqlClient from '@effect/sql/SqlClient';
|
|
|
2
2
|
import type * as SqlError from '@effect/sql/SqlError';
|
|
3
3
|
import * as Effect from 'effect/Effect';
|
|
4
4
|
import * as Schema from 'effect/Schema';
|
|
5
|
+
import { EID } from '@dxos/keys';
|
|
5
6
|
import type { Index, IndexerObject } from './interface';
|
|
6
7
|
export declare const ReverseRef: Schema.Struct<{
|
|
7
8
|
recordId: typeof Schema.Number;
|
|
8
|
-
|
|
9
|
+
targetDXN: Schema.Schema<EID.EID, EID.EID, never>;
|
|
9
10
|
/**
|
|
10
11
|
* Escaped property path within an object.
|
|
11
12
|
*
|
|
@@ -20,7 +21,7 @@ export declare const ReverseRef: Schema.Struct<{
|
|
|
20
21
|
export interface ReverseRef extends Schema.Schema.Type<typeof ReverseRef> {
|
|
21
22
|
}
|
|
22
23
|
export interface ReverseRefQuery {
|
|
23
|
-
|
|
24
|
+
targetDXN: EID.EID;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Indexes reverse references - tracks which objects reference which targets.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse-ref-index.d.ts","sourceRoot":"","sources":["../../../../src/indexes/reverse-ref-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"reverse-ref-index.d.ts","sourceRoot":"","sources":["../../../../src/indexes/reverse-ref-index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiCxD,eAAO,MAAM,UAAU;;;IAGrB;;;;;;;;OAQG;;EAEH,CAAC;AACH,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC;CAAG;AAE5E,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC;CAEpB;AAED;;;GAGG;AACH,qBAAa,eAAgB,YAAW,KAAK;IAC3C,OAAO,oEAWJ;IAEH;;OAEG;IACH,KAAK,4GAWH;IAEF,MAAM,4FA+BJ;CACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
export type
|
|
2
|
+
export type EntityPropPath = string[];
|
|
3
3
|
/**
|
|
4
4
|
* Escaped property path within an object.
|
|
5
5
|
*
|
|
@@ -10,8 +10,8 @@ export type ObjectPropPath = string[];
|
|
|
10
10
|
* - contact with .
|
|
11
11
|
*/
|
|
12
12
|
export declare const EscapedPropPath: Schema.SchemaClass<string, string> & {
|
|
13
|
-
escape: (path:
|
|
14
|
-
unescape: (path: EscapedPropPath) =>
|
|
13
|
+
escape: (path: EntityPropPath) => EscapedPropPath;
|
|
14
|
+
unescape: (path: EscapedPropPath) => EntityPropPath;
|
|
15
15
|
};
|
|
16
16
|
export type EscapedPropPath = Schema.Schema.Type<typeof EscapedPropPath>;
|
|
17
17
|
//# sourceMappingURL=utils.d.ts.map
|