@nicia-ai/typegraph 0.1.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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/dist/ast-BVyihVbP.d.cts +564 -0
  4. package/dist/ast-BVyihVbP.d.ts +564 -0
  5. package/dist/backend/drizzle/index.cjs +41 -0
  6. package/dist/backend/drizzle/index.cjs.map +1 -0
  7. package/dist/backend/drizzle/index.d.cts +12 -0
  8. package/dist/backend/drizzle/index.d.ts +12 -0
  9. package/dist/backend/drizzle/index.js +12 -0
  10. package/dist/backend/drizzle/index.js.map +1 -0
  11. package/dist/backend/drizzle/postgres.cjs +27 -0
  12. package/dist/backend/drizzle/postgres.cjs.map +1 -0
  13. package/dist/backend/drizzle/postgres.d.cts +37 -0
  14. package/dist/backend/drizzle/postgres.d.ts +37 -0
  15. package/dist/backend/drizzle/postgres.js +10 -0
  16. package/dist/backend/drizzle/postgres.js.map +1 -0
  17. package/dist/backend/drizzle/schema/postgres.cjs +40 -0
  18. package/dist/backend/drizzle/schema/postgres.cjs.map +1 -0
  19. package/dist/backend/drizzle/schema/postgres.d.cts +2419 -0
  20. package/dist/backend/drizzle/schema/postgres.d.ts +2419 -0
  21. package/dist/backend/drizzle/schema/postgres.js +7 -0
  22. package/dist/backend/drizzle/schema/postgres.js.map +1 -0
  23. package/dist/backend/drizzle/schema/sqlite.cjs +40 -0
  24. package/dist/backend/drizzle/schema/sqlite.cjs.map +1 -0
  25. package/dist/backend/drizzle/schema/sqlite.d.cts +2647 -0
  26. package/dist/backend/drizzle/schema/sqlite.d.ts +2647 -0
  27. package/dist/backend/drizzle/schema/sqlite.js +7 -0
  28. package/dist/backend/drizzle/schema/sqlite.js.map +1 -0
  29. package/dist/backend/drizzle/sqlite.cjs +27 -0
  30. package/dist/backend/drizzle/sqlite.cjs.map +1 -0
  31. package/dist/backend/drizzle/sqlite.d.cts +36 -0
  32. package/dist/backend/drizzle/sqlite.d.ts +36 -0
  33. package/dist/backend/drizzle/sqlite.js +10 -0
  34. package/dist/backend/drizzle/sqlite.js.map +1 -0
  35. package/dist/backend/postgres/index.cjs +53 -0
  36. package/dist/backend/postgres/index.cjs.map +1 -0
  37. package/dist/backend/postgres/index.d.cts +12 -0
  38. package/dist/backend/postgres/index.d.ts +12 -0
  39. package/dist/backend/postgres/index.js +12 -0
  40. package/dist/backend/postgres/index.js.map +1 -0
  41. package/dist/backend/sqlite/index.cjs +117 -0
  42. package/dist/backend/sqlite/index.cjs.map +1 -0
  43. package/dist/backend/sqlite/index.d.cts +71 -0
  44. package/dist/backend/sqlite/index.d.ts +71 -0
  45. package/dist/backend/sqlite/index.js +78 -0
  46. package/dist/backend/sqlite/index.js.map +1 -0
  47. package/dist/chunk-2QHQ2C4P.js +146 -0
  48. package/dist/chunk-2QHQ2C4P.js.map +1 -0
  49. package/dist/chunk-3A5TKOEJ.js +306 -0
  50. package/dist/chunk-3A5TKOEJ.js.map +1 -0
  51. package/dist/chunk-4PIEL2VO.js +162 -0
  52. package/dist/chunk-4PIEL2VO.js.map +1 -0
  53. package/dist/chunk-536PH5FT.js +342 -0
  54. package/dist/chunk-536PH5FT.js.map +1 -0
  55. package/dist/chunk-DBFCKELK.cjs +156 -0
  56. package/dist/chunk-DBFCKELK.cjs.map +1 -0
  57. package/dist/chunk-DDM2FZRJ.cjs +1143 -0
  58. package/dist/chunk-DDM2FZRJ.cjs.map +1 -0
  59. package/dist/chunk-DGUM43GV.js +10 -0
  60. package/dist/chunk-DGUM43GV.js.map +1 -0
  61. package/dist/chunk-F32HCHYA.cjs +680 -0
  62. package/dist/chunk-F32HCHYA.cjs.map +1 -0
  63. package/dist/chunk-IIAT36MI.js +353 -0
  64. package/dist/chunk-IIAT36MI.js.map +1 -0
  65. package/dist/chunk-JDAET5LO.js +236 -0
  66. package/dist/chunk-JDAET5LO.js.map +1 -0
  67. package/dist/chunk-JEQ2X3Z6.cjs +12 -0
  68. package/dist/chunk-JEQ2X3Z6.cjs.map +1 -0
  69. package/dist/chunk-JKTO7TW3.js +299 -0
  70. package/dist/chunk-JKTO7TW3.js.map +1 -0
  71. package/dist/chunk-K7SQ3SWP.js +497 -0
  72. package/dist/chunk-K7SQ3SWP.js.map +1 -0
  73. package/dist/chunk-L642L24T.js +142 -0
  74. package/dist/chunk-L642L24T.js.map +1 -0
  75. package/dist/chunk-MFVCSNIY.cjs +308 -0
  76. package/dist/chunk-MFVCSNIY.cjs.map +1 -0
  77. package/dist/chunk-MNO33ASC.cjs +240 -0
  78. package/dist/chunk-MNO33ASC.cjs.map +1 -0
  79. package/dist/chunk-N4AOJ3VF.cjs +154 -0
  80. package/dist/chunk-N4AOJ3VF.cjs.map +1 -0
  81. package/dist/chunk-P5CNM325.cjs +508 -0
  82. package/dist/chunk-P5CNM325.cjs.map +1 -0
  83. package/dist/chunk-RYT4H46I.js +646 -0
  84. package/dist/chunk-RYT4H46I.js.map +1 -0
  85. package/dist/chunk-SV5H3XM5.cjs +321 -0
  86. package/dist/chunk-SV5H3XM5.cjs.map +1 -0
  87. package/dist/chunk-TXHKFLWX.cjs +344 -0
  88. package/dist/chunk-TXHKFLWX.cjs.map +1 -0
  89. package/dist/chunk-UJAGXJDG.cjs +170 -0
  90. package/dist/chunk-UJAGXJDG.cjs.map +1 -0
  91. package/dist/chunk-VXRVGFCI.js +1128 -0
  92. package/dist/chunk-VXRVGFCI.js.map +1 -0
  93. package/dist/chunk-YM5AL65Y.cjs +357 -0
  94. package/dist/chunk-YM5AL65Y.cjs.map +1 -0
  95. package/dist/index.cjs +8334 -0
  96. package/dist/index.cjs.map +1 -0
  97. package/dist/index.d.cts +1365 -0
  98. package/dist/index.d.ts +1365 -0
  99. package/dist/index.js +8105 -0
  100. package/dist/index.js.map +1 -0
  101. package/dist/indexes/index.cjs +67 -0
  102. package/dist/indexes/index.cjs.map +1 -0
  103. package/dist/indexes/index.d.cts +62 -0
  104. package/dist/indexes/index.d.ts +62 -0
  105. package/dist/indexes/index.js +6 -0
  106. package/dist/indexes/index.js.map +1 -0
  107. package/dist/interchange/index.cjs +612 -0
  108. package/dist/interchange/index.cjs.map +1 -0
  109. package/dist/interchange/index.d.cts +288 -0
  110. package/dist/interchange/index.d.ts +288 -0
  111. package/dist/interchange/index.js +598 -0
  112. package/dist/interchange/index.js.map +1 -0
  113. package/dist/profiler/index.cjs +793 -0
  114. package/dist/profiler/index.cjs.map +1 -0
  115. package/dist/profiler/index.d.cts +283 -0
  116. package/dist/profiler/index.d.ts +283 -0
  117. package/dist/profiler/index.js +785 -0
  118. package/dist/profiler/index.js.map +1 -0
  119. package/dist/store-60Lcfi0w.d.ts +2263 -0
  120. package/dist/store-Bifii8MZ.d.cts +2263 -0
  121. package/dist/test-helpers-BjyRYJZX.d.ts +22 -0
  122. package/dist/test-helpers-NoQXhleQ.d.cts +22 -0
  123. package/dist/types-BRzHlhKC.d.cts +14 -0
  124. package/dist/types-BRzHlhKC.d.ts +14 -0
  125. package/dist/types-BrSfFSpW.d.cts +158 -0
  126. package/dist/types-CX4cLd7M.d.ts +152 -0
  127. package/dist/types-CjZ7g_7v.d.ts +442 -0
  128. package/dist/types-DDOSfrih.d.cts +442 -0
  129. package/dist/types-D_3mEv2y.d.ts +158 -0
  130. package/dist/types-a5rAxC92.d.cts +152 -0
  131. package/package.json +201 -0
@@ -0,0 +1,22 @@
1
+ import { PostgresTables } from './backend/drizzle/schema/postgres.js';
2
+ import { SqliteTables } from './backend/drizzle/schema/sqlite.js';
3
+
4
+ /**
5
+ * Generates all DDL statements for the given SQLite tables.
6
+ */
7
+ declare function generateSqliteDDL(tables?: SqliteTables): string[];
8
+ /**
9
+ * Generates a single SQL string for SQLite migrations.
10
+ * Convenience function that joins all DDL statements.
11
+ */
12
+ declare function getSqliteMigrationSQL(tables?: SqliteTables): string;
13
+ /**
14
+ * Generates a single SQL string for PostgreSQL migrations.
15
+ * Convenience function that joins all DDL statements.
16
+ *
17
+ * Includes CREATE EXTENSION for pgvector since the embeddings table
18
+ * uses the native VECTOR type.
19
+ */
20
+ declare function getPostgresMigrationSQL(tables?: PostgresTables): string;
21
+
22
+ export { generateSqliteDDL as a, getSqliteMigrationSQL as b, getPostgresMigrationSQL as g };
@@ -0,0 +1,22 @@
1
+ import { PostgresTables } from './backend/drizzle/schema/postgres.cjs';
2
+ import { SqliteTables } from './backend/drizzle/schema/sqlite.cjs';
3
+
4
+ /**
5
+ * Generates all DDL statements for the given SQLite tables.
6
+ */
7
+ declare function generateSqliteDDL(tables?: SqliteTables): string[];
8
+ /**
9
+ * Generates a single SQL string for SQLite migrations.
10
+ * Convenience function that joins all DDL statements.
11
+ */
12
+ declare function getSqliteMigrationSQL(tables?: SqliteTables): string;
13
+ /**
14
+ * Generates a single SQL string for PostgreSQL migrations.
15
+ * Convenience function that joins all DDL statements.
16
+ *
17
+ * Includes CREATE EXTENSION for pgvector since the embeddings table
18
+ * uses the native VECTOR type.
19
+ */
20
+ declare function getPostgresMigrationSQL(tables?: PostgresTables): string;
21
+
22
+ export { generateSqliteDDL as a, getSqliteMigrationSQL as b, getPostgresMigrationSQL as g };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * SQL Dialect Abstraction Layer
3
+ *
4
+ * Provides a unified interface for dialect-specific SQL generation.
5
+ * Implementing a new dialect (MySQL, SQL Server, etc.) requires
6
+ * implementing this interface.
7
+ */
8
+
9
+ /**
10
+ * Supported SQL dialects.
11
+ */
12
+ type SqlDialect = "sqlite" | "postgres";
13
+
14
+ export type { SqlDialect as S };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * SQL Dialect Abstraction Layer
3
+ *
4
+ * Provides a unified interface for dialect-specific SQL generation.
5
+ * Implementing a new dialect (MySQL, SQL Server, etc.) requires
6
+ * implementing this interface.
7
+ */
8
+
9
+ /**
10
+ * Supported SQL dialects.
11
+ */
12
+ type SqlDialect = "sqlite" | "postgres";
13
+
14
+ export type { SqlDialect as S };
@@ -0,0 +1,158 @@
1
+ import { J as JsonPointer } from './ast-BVyihVbP.cjs';
2
+
3
+ /**
4
+ * QueryProfiler types.
5
+ *
6
+ * Type definitions for the query profiling system that captures
7
+ * property access patterns and generates index recommendations.
8
+ */
9
+
10
+ type ProfileEntityType = "node" | "edge";
11
+ type PropertyTarget = Readonly<{
12
+ __type: "prop";
13
+ pointer: JsonPointer;
14
+ }> | Readonly<{
15
+ __type: "system";
16
+ field: string;
17
+ }>;
18
+ /**
19
+ * Represents a property access path.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Simple property access
24
+ * { entityType: "node", kind: "Person", target: { __type: "prop", pointer: "/email" } }
25
+ *
26
+ * // Nested property access
27
+ * { entityType: "node", kind: "Order", target: { __type: "prop", pointer: "/metadata/priority" } }
28
+ * ```
29
+ */
30
+ type PropertyPath = Readonly<{
31
+ entityType: ProfileEntityType;
32
+ kind: string;
33
+ target: PropertyTarget;
34
+ }>;
35
+ /**
36
+ * Usage context for a property access.
37
+ */
38
+ type UsageContext = "filter" | "sort" | "select" | "groupBy";
39
+ /**
40
+ * Statistics for a property access pattern.
41
+ */
42
+ type PropertyAccessStats = Readonly<{
43
+ /** Number of times this property was accessed */
44
+ count: number;
45
+ /** Contexts in which this property was used */
46
+ contexts: ReadonlySet<UsageContext>;
47
+ /** Predicate types used with this property (eq, contains, gt, etc.) */
48
+ predicateTypes: ReadonlySet<string>;
49
+ /** When this pattern was first observed */
50
+ firstSeen: Date;
51
+ /** When this pattern was last observed */
52
+ lastSeen: Date;
53
+ }>;
54
+ /**
55
+ * A declared index for comparison against usage patterns.
56
+ *
57
+ * Pass these to QueryProfiler to exclude already-indexed
58
+ * properties from recommendations.
59
+ */
60
+ type DeclaredIndex = Readonly<{
61
+ /** Whether this index applies to nodes or edges */
62
+ entityType: ProfileEntityType;
63
+ /** The kind name this index applies to */
64
+ kind: string;
65
+ /** Props JSON pointers covered by this index (in key order for composite indexes) */
66
+ fields: readonly JsonPointer[];
67
+ /** Whether this is a unique index */
68
+ unique: boolean;
69
+ /** Index name (for reference in reports) */
70
+ name: string;
71
+ }>;
72
+ /**
73
+ * Priority level for index recommendations.
74
+ */
75
+ type RecommendationPriority = "high" | "medium" | "low";
76
+ /**
77
+ * An index recommendation based on observed query patterns.
78
+ */
79
+ type IndexRecommendation = Readonly<{
80
+ /** Whether this recommendation is for nodes or edges */
81
+ entityType: ProfileEntityType;
82
+ /** The kind name that would benefit from this index */
83
+ kind: string;
84
+ /** Props JSON pointers to index (in key order for composite indexes) */
85
+ fields: readonly JsonPointer[];
86
+ /** Human-readable reason for the recommendation */
87
+ reason: string;
88
+ /** How often this property was accessed */
89
+ frequency: number;
90
+ /** Priority based on frequency and usage context */
91
+ priority: RecommendationPriority;
92
+ }>;
93
+ /**
94
+ * Summary statistics for a profiling session.
95
+ */
96
+ type ProfileSummary = Readonly<{
97
+ /** Total number of queries executed */
98
+ totalQueries: number;
99
+ /** Number of unique property access patterns */
100
+ uniquePatterns: number;
101
+ /** When profiling started */
102
+ startedAt: Date;
103
+ /** Duration of profiling session in milliseconds */
104
+ durationMs: number;
105
+ }>;
106
+ /**
107
+ * Complete profiler report with patterns, recommendations, and summary.
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * const report = profiler.getReport();
112
+ *
113
+ * console.log(`Total queries: ${report.summary.totalQueries}`);
114
+ * console.log(`Unique patterns: ${report.summary.uniquePatterns}`);
115
+ *
116
+ * for (const rec of report.recommendations) {
117
+ * console.log(`[${rec.priority}] ${rec.entityType}:${rec.kind} ${rec.fields.join(", ")}: ${rec.reason}`);
118
+ * }
119
+ * ```
120
+ */
121
+ type ProfileReport = Readonly<{
122
+ /** All property access patterns aggregated by path */
123
+ patterns: ReadonlyMap<string, PropertyAccessStats>;
124
+ /** Index recommendations sorted by priority */
125
+ recommendations: readonly IndexRecommendation[];
126
+ /** Summary statistics */
127
+ summary: ProfileSummary;
128
+ /** Properties used in filters that lack indexes */
129
+ unindexedFilters: readonly PropertyPath[];
130
+ }>;
131
+ /**
132
+ * Options for configuring the QueryProfiler.
133
+ */
134
+ type ProfilerOptions = Readonly<{
135
+ /**
136
+ * Declared indexes to compare against usage patterns.
137
+ * Properties covered by these indexes will be excluded from recommendations.
138
+ */
139
+ declaredIndexes?: readonly DeclaredIndex[];
140
+ /**
141
+ * Minimum frequency for a property to be included in recommendations.
142
+ * Properties accessed fewer times than this will not generate recommendations.
143
+ * @default 3
144
+ */
145
+ minFrequencyForRecommendation?: number;
146
+ /**
147
+ * Minimum frequency for a `medium` priority recommendation.
148
+ * @default 5
149
+ */
150
+ mediumFrequencyThreshold?: number;
151
+ /**
152
+ * Minimum frequency for a `high` priority recommendation.
153
+ * @default 10
154
+ */
155
+ highFrequencyThreshold?: number;
156
+ }>;
157
+
158
+ export type { DeclaredIndex as D, IndexRecommendation as I, ProfilerOptions as P, RecommendationPriority as R, UsageContext as U, ProfileReport as a, ProfileEntityType as b, PropertyTarget as c, PropertyPath as d, PropertyAccessStats as e, ProfileSummary as f };
@@ -0,0 +1,152 @@
1
+ import { z } from 'zod';
2
+ import { A as AnyEdgeType, E as EdgeType, J as JsonPointer, V as ValueType, a as JsonPointerFor, b as JsonPointerSegmentsFor, N as NodeType } from './ast-BVyihVbP.js';
3
+
4
+ type IndexScope =
5
+ /**
6
+ * Prefix index keys with `(graph_id, kind)` (nodes) or `(graph_id, kind)` (edges).
7
+ *
8
+ * This matches TypeGraph queries which always filter on `graph_id` and `kind`
9
+ * (often as `IN (...)` due to ontology expansion).
10
+ */
11
+ "graphAndKind"
12
+ /**
13
+ * Prefix index keys with `graph_id` only.
14
+ */
15
+ | "graph"
16
+ /**
17
+ * Do not prefix index keys with TypeGraph system columns.
18
+ */
19
+ | "none";
20
+ type IndexWhereOp = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "notIn";
21
+ type IndexWhereExpression = Readonly<{
22
+ __type: "index_where_and";
23
+ predicates: readonly IndexWhereExpression[];
24
+ }> | Readonly<{
25
+ __type: "index_where_or";
26
+ predicates: readonly IndexWhereExpression[];
27
+ }> | Readonly<{
28
+ __type: "index_where_not";
29
+ predicate: IndexWhereExpression;
30
+ }> | Readonly<{
31
+ __type: "index_where_comparison";
32
+ left: IndexWhereOperand;
33
+ op: IndexWhereOp;
34
+ right: IndexWhereLiteral | readonly IndexWhereLiteral[];
35
+ }> | Readonly<{
36
+ __type: "index_where_null_check";
37
+ operand: IndexWhereOperand;
38
+ op: "isNull" | "isNotNull";
39
+ }>;
40
+ type IndexWhereOperand = Readonly<{
41
+ __type: "index_operand_system";
42
+ column: SystemColumnName;
43
+ valueType: ValueType | undefined;
44
+ }> | Readonly<{
45
+ __type: "index_operand_prop";
46
+ field: string;
47
+ valueType: ValueType | undefined;
48
+ }>;
49
+ type IndexWhereLiteral = Readonly<{
50
+ __type: "index_where_literal";
51
+ value: string | number | boolean;
52
+ valueType: ValueType;
53
+ }>;
54
+ type IndexWhereComparableValue<T> = NonNullable<T> extends string ? string : NonNullable<T> extends number ? number : NonNullable<T> extends boolean ? boolean : NonNullable<T> extends Date ? Date | string : never;
55
+ type IndexWhereFieldBuilder<T> = Readonly<{
56
+ eq: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
57
+ neq: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
58
+ gt: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
59
+ gte: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
60
+ lt: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
61
+ lte: (value: IndexWhereComparableValue<T>) => IndexWhereExpression;
62
+ in: (values: readonly IndexWhereComparableValue<T>[]) => IndexWhereExpression;
63
+ notIn: (values: readonly IndexWhereComparableValue<T>[]) => IndexWhereExpression;
64
+ isNull: () => IndexWhereExpression;
65
+ isNotNull: () => IndexWhereExpression;
66
+ }>;
67
+ type NodeIndexWhereBuilder<N extends NodeType> = Readonly<{
68
+ graphId: IndexWhereFieldBuilder<string>;
69
+ kind: IndexWhereFieldBuilder<string>;
70
+ id: IndexWhereFieldBuilder<string>;
71
+ deletedAt: IndexWhereFieldBuilder<string | undefined>;
72
+ validFrom: IndexWhereFieldBuilder<string | undefined>;
73
+ validTo: IndexWhereFieldBuilder<string | undefined>;
74
+ createdAt: IndexWhereFieldBuilder<string>;
75
+ updatedAt: IndexWhereFieldBuilder<string>;
76
+ version: IndexWhereFieldBuilder<number>;
77
+ } & {
78
+ [K in keyof z.infer<N["schema"]>]-?: IndexWhereFieldBuilder<z.infer<N["schema"]>[K]>;
79
+ }>;
80
+ type EdgeIndexWhereBuilder<E extends AnyEdgeType> = Readonly<{
81
+ graphId: IndexWhereFieldBuilder<string>;
82
+ kind: IndexWhereFieldBuilder<string>;
83
+ id: IndexWhereFieldBuilder<string>;
84
+ fromKind: IndexWhereFieldBuilder<string>;
85
+ fromId: IndexWhereFieldBuilder<string>;
86
+ toKind: IndexWhereFieldBuilder<string>;
87
+ toId: IndexWhereFieldBuilder<string>;
88
+ deletedAt: IndexWhereFieldBuilder<string | undefined>;
89
+ validFrom: IndexWhereFieldBuilder<string | undefined>;
90
+ validTo: IndexWhereFieldBuilder<string | undefined>;
91
+ createdAt: IndexWhereFieldBuilder<string>;
92
+ updatedAt: IndexWhereFieldBuilder<string>;
93
+ } & {
94
+ [K in keyof z.infer<E["schema"]>]-?: IndexWhereFieldBuilder<z.infer<E["schema"]>[K]>;
95
+ }>;
96
+ type IndexWhereInput<Builder> = IndexWhereExpression | ((where: Builder) => IndexWhereExpression);
97
+ type NonEmptyJsonPointerFor<T> = Exclude<JsonPointerFor<T>, "">;
98
+ type NonEmptyJsonPointerSegmentsFor<T> = Exclude<JsonPointerSegmentsFor<T>, readonly []>;
99
+ type IndexFieldInput<T> = (keyof T & string) | NonEmptyJsonPointerFor<T> | NonEmptyJsonPointerSegmentsFor<T> | JsonPointer;
100
+ type NodeIndexConfig<N extends NodeType> = Readonly<{
101
+ fields: readonly IndexFieldInput<z.infer<N["schema"]>>[];
102
+ coveringFields?: readonly IndexFieldInput<z.infer<N["schema"]>>[] | undefined;
103
+ unique?: boolean | undefined;
104
+ name?: string | undefined;
105
+ scope?: IndexScope | undefined;
106
+ where?: IndexWhereInput<NodeIndexWhereBuilder<N>> | undefined;
107
+ }>;
108
+ type EdgeIndexDirection = "out" | "in" | "none";
109
+ type EdgeIndexConfig<E extends AnyEdgeType> = Readonly<{
110
+ fields: readonly IndexFieldInput<z.infer<E["schema"]>>[];
111
+ coveringFields?: readonly IndexFieldInput<z.infer<E["schema"]>>[] | undefined;
112
+ unique?: boolean | undefined;
113
+ name?: string | undefined;
114
+ scope?: IndexScope | undefined;
115
+ /**
116
+ * Optional direction hint to prefix edge indexes with the join key that
117
+ * TypeGraph traversal queries use (`from_id` for out, `to_id` for in).
118
+ */
119
+ direction?: EdgeIndexDirection | undefined;
120
+ where?: IndexWhereInput<EdgeIndexWhereBuilder<E>> | undefined;
121
+ }>;
122
+ type NodeIndex<N extends NodeType = NodeType> = Readonly<{
123
+ __type: "typegraph_node_index";
124
+ node: N;
125
+ nodeKind: N["name"];
126
+ fields: readonly JsonPointer[];
127
+ fieldValueTypes: readonly (ValueType | undefined)[];
128
+ coveringFields: readonly JsonPointer[];
129
+ coveringFieldValueTypes: readonly (ValueType | undefined)[];
130
+ unique: boolean;
131
+ scope: IndexScope;
132
+ where: IndexWhereExpression | undefined;
133
+ name: string;
134
+ }>;
135
+ type EdgeIndex<E extends AnyEdgeType = EdgeType> = Readonly<{
136
+ __type: "typegraph_edge_index";
137
+ edge: E;
138
+ edgeKind: E["name"];
139
+ fields: readonly JsonPointer[];
140
+ fieldValueTypes: readonly (ValueType | undefined)[];
141
+ coveringFields: readonly JsonPointer[];
142
+ coveringFieldValueTypes: readonly (ValueType | undefined)[];
143
+ unique: boolean;
144
+ scope: IndexScope;
145
+ direction: EdgeIndexDirection;
146
+ where: IndexWhereExpression | undefined;
147
+ name: string;
148
+ }>;
149
+ type TypeGraphIndex = NodeIndex | EdgeIndex;
150
+ type SystemColumnName = "graph_id" | "kind" | "id" | "from_kind" | "from_id" | "to_kind" | "to_id" | "deleted_at" | "valid_from" | "valid_to" | "created_at" | "updated_at" | "version";
151
+
152
+ export type { EdgeIndex as E, IndexWhereExpression as I, NodeIndex as N, SystemColumnName as S, TypeGraphIndex as T, EdgeIndexConfig as a, NodeIndexConfig as b, EdgeIndexDirection as c, EdgeIndexWhereBuilder as d, IndexScope as e, IndexWhereFieldBuilder as f, IndexWhereInput as g, NodeIndexWhereBuilder as h };