@nicia-ai/typegraph 0.20.0 → 0.22.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/dist/{ast-Bh2NDeaK.d.cts → ast-CSLbPIOC.d.ts} +56 -3
- package/dist/{ast-COMyNeMn.d.ts → ast-DogwbBqA.d.cts} +56 -3
- package/dist/backend/postgres/index.cjs +123 -45
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +15 -7
- package/dist/backend/postgres/index.d.ts +15 -7
- package/dist/backend/postgres/index.js +101 -23
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +15 -15
- package/dist/backend/sqlite/index.d.cts +22 -7
- package/dist/backend/sqlite/index.d.ts +22 -7
- package/dist/backend/sqlite/index.js +5 -5
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +4 -5
- package/dist/backend/sqlite/libsql.d.ts +4 -5
- package/dist/backend/sqlite/libsql.js +5 -5
- package/dist/backend/sqlite/local.cjs +27 -10
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +4 -5
- package/dist/backend/sqlite/local.d.ts +4 -5
- package/dist/backend/sqlite/local.js +22 -6
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-MME3H4ZF.cjs → chunk-3JK66E3I.cjs} +387 -9
- package/dist/chunk-3JK66E3I.cjs.map +1 -0
- package/dist/{chunk-6GWJH6AR.js → chunk-3PPEHLGK.js} +4 -4
- package/dist/{chunk-6GWJH6AR.js.map → chunk-3PPEHLGK.js.map} +1 -1
- package/dist/{chunk-QFZQGEQ3.js → chunk-5ZMMHUWR.js} +199 -38
- package/dist/chunk-5ZMMHUWR.js.map +1 -0
- package/dist/{chunk-GNIYZKBI.js → chunk-753F33CV.js} +378 -8
- package/dist/chunk-753F33CV.js.map +1 -0
- package/dist/{chunk-K7SQ3SWP.js → chunk-EYELZHKY.js} +120 -12
- package/dist/chunk-EYELZHKY.js.map +1 -0
- package/dist/{chunk-HXJXTOXR.cjs → chunk-GUYI6VAS.cjs} +101 -21
- package/dist/chunk-GUYI6VAS.cjs.map +1 -0
- package/dist/{chunk-X33WV2UF.cjs → chunk-HRNQ3DVJ.cjs} +24 -21
- package/dist/chunk-HRNQ3DVJ.cjs.map +1 -0
- package/dist/{chunk-W6M7XWKX.js → chunk-JYUQA77I.js} +21 -18
- package/dist/chunk-JYUQA77I.js.map +1 -0
- package/dist/{chunk-LLHFS53Q.js → chunk-NSLTDXVH.js} +91 -11
- package/dist/chunk-NSLTDXVH.js.map +1 -0
- package/dist/{chunk-LELLOHJK.cjs → chunk-PEE4EWXZ.cjs} +35 -35
- package/dist/{chunk-LELLOHJK.cjs.map → chunk-PEE4EWXZ.cjs.map} +1 -1
- package/dist/{chunk-G5CYWKRF.js → chunk-RS5OLGEW.js} +2 -2
- package/dist/{chunk-G5CYWKRF.js.map → chunk-RS5OLGEW.js.map} +1 -1
- package/dist/{chunk-IYWWXOVK.cjs → chunk-SCXOGKLD.cjs} +252 -91
- package/dist/chunk-SCXOGKLD.cjs.map +1 -0
- package/dist/{chunk-P5CNM325.cjs → chunk-UVZHTBZ5.cjs} +123 -11
- package/dist/chunk-UVZHTBZ5.cjs.map +1 -0
- package/dist/{chunk-5GZMPJOP.cjs → chunk-WRWVWKQL.cjs} +2 -2
- package/dist/{chunk-5GZMPJOP.cjs.map → chunk-WRWVWKQL.cjs.map} +1 -1
- package/dist/{ddl-BBo2EcFc.d.cts → ddl-BqkTShcR.d.ts} +28 -6
- package/dist/{ddl-D4jlcOH_.d.ts → ddl-Dk1NDN3M.d.cts} +28 -6
- package/dist/index.cjs +1809 -513
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -11
- package/dist/index.d.ts +53 -11
- package/dist/index.js +1668 -398
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +17 -17
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +3 -3
- package/dist/interchange/index.cjs +6 -6
- package/dist/interchange/index.d.cts +4 -5
- package/dist/interchange/index.d.ts +4 -5
- package/dist/interchange/index.js +1 -1
- package/dist/{manager-Chhrq1vl.d.ts → manager-0jVZtiE8.d.ts} +1 -2
- package/dist/{manager-Bj1UEnhE.d.cts → manager-BPK-2PUI.d.cts} +1 -2
- package/dist/profiler/index.cjs +15 -8
- package/dist/profiler/index.cjs.map +1 -1
- package/dist/profiler/index.d.cts +7 -8
- package/dist/profiler/index.d.ts +7 -8
- package/dist/profiler/index.js +8 -1
- package/dist/profiler/index.js.map +1 -1
- package/dist/schema/index.cjs +21 -21
- package/dist/schema/index.d.cts +4 -5
- package/dist/schema/index.d.ts +4 -5
- package/dist/schema/index.js +3 -3
- package/dist/{sqlite-DE-6NWtC.d.cts → sqlite-D1rrwcir.d.cts} +14 -1
- package/dist/{sqlite-Blq-AhmK.d.ts → sqlite-W3rmJMlc.d.ts} +14 -1
- package/dist/{store-BMrRi_mY.d.ts → store-2QW2SIRk.d.cts} +404 -5
- package/dist/{store-DRRvALu8.d.cts → store-C0q13mtJ.d.ts} +404 -5
- package/dist/{types-B3mmOMJV.d.cts → types-CQF88McG.d.cts} +475 -2
- package/dist/{types-ThB4cFLp.d.ts → types-CQF88McG.d.ts} +475 -2
- package/dist/{types-COPePE8_.d.ts → types-CglvhPKz.d.ts} +1 -1
- package/dist/{types-CVtGFpB9.d.cts → types-D23slCOA.d.cts} +1 -1
- package/dist/{types-Ceb01czq.d.ts → types-IMQCuser.d.ts} +2 -2
- package/dist/{types-CZd2PEOc.d.cts → types-vgjar7Ch.d.cts} +2 -2
- package/package.json +9 -9
- package/dist/chunk-GNIYZKBI.js.map +0 -1
- package/dist/chunk-HXJXTOXR.cjs.map +0 -1
- package/dist/chunk-IYWWXOVK.cjs.map +0 -1
- package/dist/chunk-K7SQ3SWP.js.map +0 -1
- package/dist/chunk-LLHFS53Q.js.map +0 -1
- package/dist/chunk-MME3H4ZF.cjs.map +0 -1
- package/dist/chunk-P5CNM325.cjs.map +0 -1
- package/dist/chunk-QFZQGEQ3.js.map +0 -1
- package/dist/chunk-W6M7XWKX.js.map +0 -1
- package/dist/chunk-X33WV2UF.cjs.map +0 -1
- package/dist/types-DMzKq0d5.d.cts +0 -181
- package/dist/types-DMzKq0d5.d.ts +0 -181
package/dist/types-DMzKq0d5.d.ts
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/** Brand key for NodeType */
|
|
4
|
-
declare const NODE_TYPE_BRAND: "__nodeType";
|
|
5
|
-
/** Brand key for EdgeType */
|
|
6
|
-
declare const EDGE_TYPE_BRAND: "__edgeType";
|
|
7
|
-
/** Brand symbol for NodeId */
|
|
8
|
-
declare const __nodeId: unique symbol;
|
|
9
|
-
/** Brand symbol for EdgeId */
|
|
10
|
-
declare const __edgeId: unique symbol;
|
|
11
|
-
/**
|
|
12
|
-
* A node type definition.
|
|
13
|
-
*
|
|
14
|
-
* Created via `defineNode()`. Represents a type of node in the graph
|
|
15
|
-
* with an associated Zod schema for properties.
|
|
16
|
-
*/
|
|
17
|
-
type NodeType<K extends string = string, S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = Readonly<{
|
|
18
|
-
[NODE_TYPE_BRAND]: true;
|
|
19
|
-
kind: K;
|
|
20
|
-
schema: S;
|
|
21
|
-
description: string | undefined;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Branded node ID type.
|
|
25
|
-
*
|
|
26
|
-
* Prevents mixing IDs from different node types at compile time.
|
|
27
|
-
*/
|
|
28
|
-
type NodeId<N extends NodeType> = string & Readonly<{
|
|
29
|
-
[__nodeId]: N;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Infer the props type from a NodeType.
|
|
33
|
-
*/
|
|
34
|
-
type NodeProps<N extends NodeType> = z.infer<N["schema"]>;
|
|
35
|
-
/**
|
|
36
|
-
* An edge type definition.
|
|
37
|
-
*
|
|
38
|
-
* Created via `defineEdge()`. Represents a type of edge in the graph
|
|
39
|
-
* with an optional Zod schema for properties.
|
|
40
|
-
*
|
|
41
|
-
* Optionally includes `from` and `to` arrays that define the allowed
|
|
42
|
-
* source and target node types (domain and range constraints).
|
|
43
|
-
*/
|
|
44
|
-
type EdgeType<K extends string = string, S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, From extends readonly NodeType[] | undefined = undefined, To extends readonly NodeType[] | undefined = undefined> = Readonly<{
|
|
45
|
-
[EDGE_TYPE_BRAND]: true;
|
|
46
|
-
kind: K;
|
|
47
|
-
schema: S;
|
|
48
|
-
description: string | undefined;
|
|
49
|
-
from: From;
|
|
50
|
-
to: To;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Base edge type for use in constraints - accepts any from/to configuration.
|
|
54
|
-
*/
|
|
55
|
-
type AnyEdgeType = EdgeType<string, z.ZodObject<z.ZodRawShape>, readonly NodeType[] | undefined, readonly NodeType[] | undefined>;
|
|
56
|
-
/**
|
|
57
|
-
* An edge type that has both from and to constraints defined.
|
|
58
|
-
* Can be used directly in defineGraph without an EdgeRegistration wrapper.
|
|
59
|
-
*/
|
|
60
|
-
type EdgeTypeWithEndpoints = EdgeType<string, z.ZodObject<z.ZodRawShape>, readonly NodeType[], readonly NodeType[]>;
|
|
61
|
-
/**
|
|
62
|
-
* Branded edge ID type.
|
|
63
|
-
*
|
|
64
|
-
* Prevents mixing IDs from different edge types at compile time.
|
|
65
|
-
*/
|
|
66
|
-
type EdgeId<E extends AnyEdgeType = AnyEdgeType> = string & Readonly<{
|
|
67
|
-
[__edgeId]: E;
|
|
68
|
-
}>;
|
|
69
|
-
/**
|
|
70
|
-
* Infer the props type from an EdgeType.
|
|
71
|
-
*/
|
|
72
|
-
type EdgeProps<E extends AnyEdgeType> = z.infer<E["schema"]>;
|
|
73
|
-
/**
|
|
74
|
-
* Delete behaviors for nodes.
|
|
75
|
-
*/
|
|
76
|
-
type DeleteBehavior = "restrict" | "cascade" | "disconnect";
|
|
77
|
-
/**
|
|
78
|
-
* Edge cardinality constraints.
|
|
79
|
-
*/
|
|
80
|
-
type Cardinality = "many" | "one" | "unique" | "oneActive";
|
|
81
|
-
/**
|
|
82
|
-
* Endpoint existence modes for edge validation.
|
|
83
|
-
*/
|
|
84
|
-
type EndpointExistence = "notDeleted" | "currentlyValid" | "ever";
|
|
85
|
-
/**
|
|
86
|
-
* Temporal query modes.
|
|
87
|
-
*/
|
|
88
|
-
type TemporalMode = "current" | "asOf" | "includeEnded" | "includeTombstones";
|
|
89
|
-
/**
|
|
90
|
-
* Uniqueness constraint scope.
|
|
91
|
-
*/
|
|
92
|
-
type UniquenessScope = "kind" | "kindWithSubClasses";
|
|
93
|
-
/**
|
|
94
|
-
* Collation for uniqueness constraints.
|
|
95
|
-
*/
|
|
96
|
-
type Collation = "binary" | "caseInsensitive";
|
|
97
|
-
/**
|
|
98
|
-
* Uniqueness constraint definition.
|
|
99
|
-
*/
|
|
100
|
-
type UniqueConstraint<S extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = Readonly<{
|
|
101
|
-
name: string;
|
|
102
|
-
fields: readonly (keyof z.infer<S> & string)[];
|
|
103
|
-
where?: (props: UniqueConstraintPredicateBuilder<S>) => UniqueConstraintPredicate;
|
|
104
|
-
scope: UniquenessScope;
|
|
105
|
-
collation: Collation;
|
|
106
|
-
}>;
|
|
107
|
-
/**
|
|
108
|
-
* Predicate builder for uniqueness constraint where clause.
|
|
109
|
-
* Uses -? to make all fields required in the builder, even if optional in the schema.
|
|
110
|
-
*/
|
|
111
|
-
type UniqueConstraintPredicateBuilder<S extends z.ZodObject<z.ZodRawShape>> = Readonly<{
|
|
112
|
-
[K in keyof z.infer<S>]-?: UniqueConstraintField;
|
|
113
|
-
}>;
|
|
114
|
-
/**
|
|
115
|
-
* Field operations for uniqueness constraint predicates.
|
|
116
|
-
*/
|
|
117
|
-
type UniqueConstraintField = Readonly<{
|
|
118
|
-
isNull: () => UniqueConstraintPredicate;
|
|
119
|
-
isNotNull: () => UniqueConstraintPredicate;
|
|
120
|
-
}>;
|
|
121
|
-
/**
|
|
122
|
-
* A uniqueness constraint predicate (internal representation).
|
|
123
|
-
*/
|
|
124
|
-
type UniqueConstraintPredicate = Readonly<{
|
|
125
|
-
__type: "unique_predicate";
|
|
126
|
-
field: string;
|
|
127
|
-
op: "isNull" | "isNotNull";
|
|
128
|
-
}>;
|
|
129
|
-
/**
|
|
130
|
-
* Node registration in a graph definition.
|
|
131
|
-
*/
|
|
132
|
-
type NodeRegistration<N extends NodeType = NodeType> = Readonly<{
|
|
133
|
-
type: N;
|
|
134
|
-
unique?: readonly UniqueConstraint<N["schema"]>[];
|
|
135
|
-
onDelete?: DeleteBehavior;
|
|
136
|
-
}>;
|
|
137
|
-
/**
|
|
138
|
-
* Edge registration in a graph definition.
|
|
139
|
-
*/
|
|
140
|
-
type EdgeRegistration<E extends AnyEdgeType = AnyEdgeType, FromTypes extends NodeType = NodeType, ToTypes extends NodeType = NodeType> = Readonly<{
|
|
141
|
-
type: E;
|
|
142
|
-
from: readonly FromTypes[];
|
|
143
|
-
to: readonly ToTypes[];
|
|
144
|
-
cardinality?: Cardinality;
|
|
145
|
-
endpointExistence?: EndpointExistence;
|
|
146
|
-
}>;
|
|
147
|
-
/**
|
|
148
|
-
* Default settings for a graph.
|
|
149
|
-
*/
|
|
150
|
-
type GraphDefaults = Readonly<{
|
|
151
|
-
onNodeDelete?: DeleteBehavior;
|
|
152
|
-
temporalMode?: TemporalMode;
|
|
153
|
-
}>;
|
|
154
|
-
/**
|
|
155
|
-
* Checks if a value is a NodeType.
|
|
156
|
-
*/
|
|
157
|
-
declare function isNodeType(value: unknown): value is NodeType;
|
|
158
|
-
/**
|
|
159
|
-
* Checks if a value is an EdgeType.
|
|
160
|
-
*/
|
|
161
|
-
declare function isEdgeType(value: unknown): value is AnyEdgeType;
|
|
162
|
-
/**
|
|
163
|
-
* Checks if a value is an EdgeType with both from and to constraints defined.
|
|
164
|
-
* Such edges can be used directly in defineGraph without an EdgeRegistration wrapper.
|
|
165
|
-
*/
|
|
166
|
-
declare function isEdgeTypeWithEndpoints(value: unknown): value is EdgeTypeWithEndpoints;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* SQL Dialect Abstraction Layer
|
|
170
|
-
*
|
|
171
|
-
* Provides a unified interface for dialect-specific SQL generation.
|
|
172
|
-
* Implementing a new dialect (MySQL, SQL Server, etc.) requires
|
|
173
|
-
* implementing this interface.
|
|
174
|
-
*/
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Supported SQL dialects.
|
|
178
|
-
*/
|
|
179
|
-
type SqlDialect = "sqlite" | "postgres";
|
|
180
|
-
|
|
181
|
-
export { type AnyEdgeType as A, type Cardinality as C, type DeleteBehavior as D, type EdgeType as E, type GraphDefaults as G, type NodeType as N, type SqlDialect as S, type TemporalMode as T, type UniqueConstraint as U, type Collation as a, type EdgeId as b, type EdgeProps as c, type EdgeRegistration as d, type EdgeTypeWithEndpoints as e, type EndpointExistence as f, type NodeId as g, type NodeProps as h, type NodeRegistration as i, type UniquenessScope as j, isEdgeType as k, isEdgeTypeWithEndpoints as l, isNodeType as m };
|