@nicia-ai/typegraph 0.24.1 → 0.25.1
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/backend/postgres/index.cjs +226 -55
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +6 -7
- package/dist/backend/postgres/index.d.ts +6 -7
- package/dist/backend/postgres/index.js +195 -28
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +19 -17
- package/dist/backend/sqlite/index.d.cts +6 -7
- package/dist/backend/sqlite/index.d.ts +6 -7
- package/dist/backend/sqlite/index.js +9 -7
- package/dist/backend/sqlite/libsql.cjs +12 -10
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +4 -5
- package/dist/backend/sqlite/libsql.d.ts +4 -5
- package/dist/backend/sqlite/libsql.js +9 -7
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +14 -12
- 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 +9 -7
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-4BOWVUGQ.js +2029 -0
- package/dist/chunk-4BOWVUGQ.js.map +1 -0
- package/dist/chunk-7V335GHG.cjs +112 -0
- package/dist/chunk-7V335GHG.cjs.map +1 -0
- package/dist/chunk-AAA2CR3P.js +2628 -0
- package/dist/chunk-AAA2CR3P.js.map +1 -0
- package/dist/{chunk-QOLTW7OZ.js → chunk-CLEUFN2K.js} +195 -13
- package/dist/chunk-CLEUFN2K.js.map +1 -0
- package/dist/{chunk-OVJ2BE5Q.cjs → chunk-CLGC7AQ2.cjs} +215 -33
- package/dist/chunk-CLGC7AQ2.cjs.map +1 -0
- package/dist/{chunk-GUTQTMOV.js → chunk-CPFR3O7L.js} +2 -2
- package/dist/chunk-CPFR3O7L.js.map +1 -0
- package/dist/{chunk-5HVDOPZU.cjs → chunk-CQVNGKU7.cjs} +452 -104
- package/dist/chunk-CQVNGKU7.cjs.map +1 -0
- package/dist/chunk-CTHNVU6K.cjs +551 -0
- package/dist/chunk-CTHNVU6K.cjs.map +1 -0
- package/dist/chunk-D2GO3RBL.cjs +12 -0
- package/dist/chunk-D2GO3RBL.cjs.map +1 -0
- package/dist/{chunk-WFMTAEEN.js → chunk-DOTEN2FG.js} +81 -7
- package/dist/chunk-DOTEN2FG.js.map +1 -0
- package/dist/chunk-E5JZSEGJ.cjs +301 -0
- package/dist/chunk-E5JZSEGJ.cjs.map +1 -0
- package/dist/chunk-EG6TJ3I5.js +286 -0
- package/dist/chunk-EG6TJ3I5.js.map +1 -0
- package/dist/chunk-EJCDOA37.js +537 -0
- package/dist/chunk-EJCDOA37.js.map +1 -0
- package/dist/{chunk-UVZHTBZ5.cjs → chunk-EK6RJ373.cjs} +7 -150
- package/dist/chunk-EK6RJ373.cjs.map +1 -0
- package/dist/{chunk-3JK66E3I.cjs → chunk-JTI5WT4P.cjs} +630 -59
- package/dist/chunk-JTI5WT4P.cjs.map +1 -0
- package/dist/chunk-NHQWXSTS.js +10 -0
- package/dist/chunk-NHQWXSTS.js.map +1 -0
- package/dist/chunk-NZ5PMBTG.js +105 -0
- package/dist/chunk-NZ5PMBTG.js.map +1 -0
- package/dist/{chunk-SUHW2UYL.cjs → chunk-OECDVACY.cjs} +2 -2
- package/dist/chunk-OECDVACY.cjs.map +1 -0
- package/dist/{chunk-EYELZHKY.js → chunk-OOS2RKRH.js} +5 -140
- package/dist/chunk-OOS2RKRH.js.map +1 -0
- package/dist/{chunk-EY4LBX3F.js → chunk-PSKUWVCB.js} +373 -38
- package/dist/chunk-PSKUWVCB.js.map +1 -0
- package/dist/chunk-QMQYK3IF.cjs +2680 -0
- package/dist/chunk-QMQYK3IF.cjs.map +1 -0
- package/dist/chunk-RCAJZG67.cjs +2069 -0
- package/dist/chunk-RCAJZG67.cjs.map +1 -0
- package/dist/{chunk-O5PST6TB.cjs → chunk-W5MTHMTE.cjs} +83 -6
- package/dist/chunk-W5MTHMTE.cjs.map +1 -0
- package/dist/chunk-WVQXAFP3.js +79 -0
- package/dist/chunk-WVQXAFP3.js.map +1 -0
- package/dist/chunk-X3244EKP.cjs +84 -0
- package/dist/chunk-X3244EKP.cjs.map +1 -0
- package/dist/{chunk-753F33CV.js → chunk-YZZBDCLV.js} +617 -44
- package/dist/chunk-YZZBDCLV.js.map +1 -0
- package/dist/{ddl-B_H8JM-E.d.cts → ddl-BqMmpNor.d.ts} +1328 -283
- package/dist/{ddl-1tFIvt9V.d.ts → ddl-Bwjh8Hff.d.cts} +1328 -283
- package/dist/extension-types-D07e_NTw.d.cts +543 -0
- package/dist/extension-types-D07e_NTw.d.ts +543 -0
- package/dist/graph-extension/index.cjs +71 -0
- package/dist/graph-extension/index.cjs.map +1 -0
- package/dist/graph-extension/index.d.cts +278 -0
- package/dist/graph-extension/index.d.ts +278 -0
- package/dist/graph-extension/index.js +6 -0
- package/dist/graph-extension/index.js.map +1 -0
- package/dist/{index-DXkEXpNz.d.ts → index-CT6nvtxL.d.cts} +114 -5
- package/dist/{index-DXkEXpNz.d.cts → index-DQheiVQV.d.ts} +114 -5
- package/dist/index.cjs +2672 -901
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -10
- package/dist/index.d.ts +29 -10
- package/dist/index.js +2248 -598
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +25 -23
- package/dist/indexes/index.d.cts +40 -22
- package/dist/indexes/index.d.ts +40 -22
- package/dist/indexes/index.js +5 -3
- package/dist/interchange/index.cjs +8 -7
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +5 -4
- package/dist/interchange/index.d.ts +5 -4
- package/dist/interchange/index.js +3 -2
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-Vkz28eAC.d.cts → manager-Cy3dhwYO.d.cts} +194 -6
- package/dist/{manager-nIhmttD-.d.ts → manager-sZkU2VPC.d.ts} +194 -6
- package/dist/materialize-indexes-BB9N5uQl.d.cts +68 -0
- package/dist/materialize-indexes-BYpU2RKh.d.ts +68 -0
- package/dist/profiler/index.cjs +10 -8
- package/dist/profiler/index.cjs.map +1 -1
- package/dist/profiler/index.d.cts +8 -7
- package/dist/profiler/index.d.ts +8 -7
- package/dist/profiler/index.js +3 -1
- package/dist/profiler/index.js.map +1 -1
- package/dist/schema/index.cjs +43 -22
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +17 -8
- package/dist/schema/index.d.ts +17 -8
- package/dist/schema/index.js +9 -4
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-D0aceIe0.d.cts → sqlite-BhFswiAR.d.cts} +837 -120
- package/dist/{sqlite-SUxbZqfy.d.ts → sqlite-h6dta1IJ.d.ts} +837 -120
- package/dist/{store-CpvwTMxV.d.cts → store-BS_hehiz.d.ts} +659 -23
- package/dist/{store-U3i2tUch.d.ts → store-CkCvqRUf.d.cts} +659 -23
- package/dist/{types-yH4_p0XB.d.cts → types-BpgACExN.d.cts} +3 -2
- package/dist/{types-qYFZ9SqD.d.ts → types-Bz-Pi681.d.ts} +3 -2
- package/dist/types-DptZHe-l.d.ts +2132 -0
- package/dist/types-WF5ItKQu.d.cts +2132 -0
- package/dist/where-C40InMIp.d.ts +11 -0
- package/dist/where-DZYMiXVq.d.cts +11 -0
- package/package.json +33 -73
- package/dist/ast-C8S37w1A.d.ts +0 -497
- package/dist/ast-dgLhLOg0.d.cts +0 -497
- package/dist/chunk-3JK66E3I.cjs.map +0 -1
- package/dist/chunk-3PPEHLGK.js +0 -1116
- package/dist/chunk-3PPEHLGK.js.map +0 -1
- package/dist/chunk-5HVDOPZU.cjs.map +0 -1
- package/dist/chunk-753F33CV.js.map +0 -1
- package/dist/chunk-EY4LBX3F.js.map +0 -1
- package/dist/chunk-EYELZHKY.js.map +0 -1
- package/dist/chunk-GFGVREHH.js +0 -1381
- package/dist/chunk-GFGVREHH.js.map +0 -1
- package/dist/chunk-GUTQTMOV.js.map +0 -1
- package/dist/chunk-LBORRUNJ.js +0 -135
- package/dist/chunk-LBORRUNJ.js.map +0 -1
- package/dist/chunk-O5PST6TB.cjs.map +0 -1
- package/dist/chunk-OLROXS2S.cjs +0 -147
- package/dist/chunk-OLROXS2S.cjs.map +0 -1
- package/dist/chunk-OVJ2BE5Q.cjs.map +0 -1
- package/dist/chunk-PAUN562Y.cjs +0 -1417
- package/dist/chunk-PAUN562Y.cjs.map +0 -1
- package/dist/chunk-PEE4EWXZ.cjs +0 -1131
- package/dist/chunk-PEE4EWXZ.cjs.map +0 -1
- package/dist/chunk-QOLTW7OZ.js.map +0 -1
- package/dist/chunk-SUHW2UYL.cjs.map +0 -1
- package/dist/chunk-UVZHTBZ5.cjs.map +0 -1
- package/dist/chunk-WFMTAEEN.js.map +0 -1
- package/dist/types-C-zfYDJB.d.ts +0 -159
- package/dist/types-CQx4iW5Y.d.cts +0 -159
- package/dist/types-Qk2l3IkQ.d.cts +0 -1254
- package/dist/types-Qk2l3IkQ.d.ts +0 -1254
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { K as KindEntity } from './extension-types-D07e_NTw.cjs';
|
|
2
|
+
import { M as MaterializeIndexesResult } from './materialize-indexes-BB9N5uQl.cjs';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* TypeGraph Error Hierarchy
|
|
3
6
|
*
|
|
@@ -21,6 +24,7 @@
|
|
|
21
24
|
* }
|
|
22
25
|
* ```
|
|
23
26
|
*/
|
|
27
|
+
|
|
24
28
|
/**
|
|
25
29
|
* Error category for programmatic handling.
|
|
26
30
|
*
|
|
@@ -83,7 +87,7 @@ type ValidationIssue = Readonly<{
|
|
|
83
87
|
*/
|
|
84
88
|
type ValidationErrorDetails = Readonly<{
|
|
85
89
|
/** Type of entity being validated */
|
|
86
|
-
entityType?:
|
|
90
|
+
entityType?: KindEntity;
|
|
87
91
|
/** Kind/type name of the entity */
|
|
88
92
|
kind?: string;
|
|
89
93
|
/** Operation being performed */
|
|
@@ -143,12 +147,22 @@ declare class EdgeNotFoundError extends TypeGraphError {
|
|
|
143
147
|
});
|
|
144
148
|
}
|
|
145
149
|
/**
|
|
146
|
-
* Thrown when
|
|
150
|
+
* Thrown when an operation references a kind that isn't registered on
|
|
151
|
+
* the graph — `getNodeCollectionOrThrow` against an unknown kind, a
|
|
152
|
+
* `materializeIndexes({ kinds })` filter naming a missing kind, an
|
|
153
|
+
* extension referencing an unresolved endpoint, search facade typos,
|
|
154
|
+
* etc. Carries the offending `kindName` and `entity` plus the host
|
|
155
|
+
* `graphId` so logs are unambiguous when multiple stores share a
|
|
156
|
+
* process.
|
|
147
157
|
*/
|
|
148
158
|
declare class KindNotFoundError extends TypeGraphError {
|
|
149
|
-
|
|
159
|
+
readonly kindName: string;
|
|
160
|
+
readonly entity: KindEntity;
|
|
161
|
+
constructor(kindName: string, entity: KindEntity, options?: Readonly<{
|
|
162
|
+
graphId?: string;
|
|
163
|
+
suggestion?: string;
|
|
150
164
|
cause?: unknown;
|
|
151
|
-
});
|
|
165
|
+
}>);
|
|
152
166
|
}
|
|
153
167
|
/**
|
|
154
168
|
* Thrown when a uniqueness constraint name is not found on a node kind.
|
|
@@ -281,6 +295,101 @@ declare class MigrationError extends TypeGraphError {
|
|
|
281
295
|
cause?: unknown;
|
|
282
296
|
});
|
|
283
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Thrown by `Store.evolve(extension, { eager })` when the schema
|
|
300
|
+
* commit succeeded but the follow-on `materializeIndexes()` produced
|
|
301
|
+
* one or more failed entries.
|
|
302
|
+
*
|
|
303
|
+
* Recovery: the schema commit is NOT rolled back. The new `Store` is
|
|
304
|
+
* fully constructed and (when `options.ref` was supplied) `ref.current`
|
|
305
|
+
* already points to it — the caller can read the new store via the ref
|
|
306
|
+
* and decide how to handle the failed indexes (retry, skip, alert).
|
|
307
|
+
* The full `MaterializeIndexesResult` is attached as `.materialization`.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* const ref = { current: store };
|
|
312
|
+
* try {
|
|
313
|
+
* await store.evolve(extension, { ref, eager: {} });
|
|
314
|
+
* } catch (error) {
|
|
315
|
+
* if (error instanceof EagerMaterializationError) {
|
|
316
|
+
* // schema is committed; ref.current is the new store
|
|
317
|
+
* log.warn(
|
|
318
|
+
* { failed: error.failedIndexNames },
|
|
319
|
+
* "indexes did not materialize; will retry",
|
|
320
|
+
* );
|
|
321
|
+
* await ref.current.materializeIndexes();
|
|
322
|
+
* } else {
|
|
323
|
+
* throw error;
|
|
324
|
+
* }
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
declare class EagerMaterializationError extends TypeGraphError {
|
|
329
|
+
/**
|
|
330
|
+
* The full materialization result, including successful and failed
|
|
331
|
+
* entries. Same shape as `Store.materializeIndexes()` returns.
|
|
332
|
+
*/
|
|
333
|
+
readonly materialization: MaterializeIndexesResult;
|
|
334
|
+
constructor(materialization: MaterializeIndexesResult, graphId: string);
|
|
335
|
+
/**
|
|
336
|
+
* Names of just the indexes that failed — derived from
|
|
337
|
+
* `materialization.results` so the two views can never disagree.
|
|
338
|
+
*/
|
|
339
|
+
get failedIndexNames(): readonly string[];
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Thrown by `commitSchemaVersion` and `setActiveVersion` when the
|
|
343
|
+
* caller's view of the active schema version is out of date — another
|
|
344
|
+
* writer has already advanced it.
|
|
345
|
+
*
|
|
346
|
+
* Recovery: re-read the active version with `getActiveSchema(graphId)`,
|
|
347
|
+
* recompute against the new baseline, and retry. This is a routine
|
|
348
|
+
* concurrency signal, not a bug.
|
|
349
|
+
*
|
|
350
|
+
* `actual` is `0` when no active version exists yet (initial-commit race
|
|
351
|
+
* where another writer initialized first).
|
|
352
|
+
*/
|
|
353
|
+
declare class StaleVersionError extends TypeGraphError {
|
|
354
|
+
readonly details: Readonly<{
|
|
355
|
+
graphId: string;
|
|
356
|
+
expected: number;
|
|
357
|
+
actual: number;
|
|
358
|
+
}>;
|
|
359
|
+
constructor(details: Readonly<{
|
|
360
|
+
graphId: string;
|
|
361
|
+
expected: number;
|
|
362
|
+
actual: number;
|
|
363
|
+
}>, options?: {
|
|
364
|
+
cause?: unknown;
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Thrown by `commitSchemaVersion` when a row already exists at the
|
|
369
|
+
* target version with a *different* schema hash — i.e. two writers
|
|
370
|
+
* committed materially different schemas at the same version number.
|
|
371
|
+
*
|
|
372
|
+
* Distinct from `StaleVersionError`: this is not a refetch-and-retry
|
|
373
|
+
* situation, it's a content disagreement that needs operator
|
|
374
|
+
* intervention. Typically caused by inconsistent application
|
|
375
|
+
* deployments writing schemas that hash differently.
|
|
376
|
+
*/
|
|
377
|
+
declare class SchemaContentConflictError extends TypeGraphError {
|
|
378
|
+
readonly details: Readonly<{
|
|
379
|
+
graphId: string;
|
|
380
|
+
version: number;
|
|
381
|
+
existingHash: string;
|
|
382
|
+
incomingHash: string;
|
|
383
|
+
}>;
|
|
384
|
+
constructor(details: Readonly<{
|
|
385
|
+
graphId: string;
|
|
386
|
+
version: number;
|
|
387
|
+
existingHash: string;
|
|
388
|
+
incomingHash: string;
|
|
389
|
+
}>, options?: {
|
|
390
|
+
cause?: unknown;
|
|
391
|
+
});
|
|
392
|
+
}
|
|
284
393
|
/**
|
|
285
394
|
* Thrown when graph configuration is invalid.
|
|
286
395
|
*
|
|
@@ -390,4 +499,4 @@ declare function isConstraintError(error: unknown): boolean;
|
|
|
390
499
|
*/
|
|
391
500
|
declare function getErrorSuggestion(error: unknown): string | undefined;
|
|
392
501
|
|
|
393
|
-
export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D,
|
|
502
|
+
export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EagerMaterializationError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaContentConflictError as S, TypeGraphError as T, UniquenessError as U, type ValidationIssue as V, ValidationError as a, CompilerInvariantError as b, ConfigurationError as c, DisjointError as d, EdgeNotFoundError as e, EndpointError as f, EndpointNotFoundError as g, type ErrorCategory as h, NodeNotFoundError as i, SchemaMismatchError as j, StaleVersionError as k, type TypeGraphErrorOptions as l, UnsupportedPredicateError as m, type ValidationErrorDetails as n, VersionConflictError as o, getErrorSuggestion as p, isConstraintError as q, isSystemError as r, isTypeGraphError as s, isUserRecoverable as t };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { K as KindEntity } from './extension-types-D07e_NTw.js';
|
|
2
|
+
import { M as MaterializeIndexesResult } from './materialize-indexes-BYpU2RKh.js';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* TypeGraph Error Hierarchy
|
|
3
6
|
*
|
|
@@ -21,6 +24,7 @@
|
|
|
21
24
|
* }
|
|
22
25
|
* ```
|
|
23
26
|
*/
|
|
27
|
+
|
|
24
28
|
/**
|
|
25
29
|
* Error category for programmatic handling.
|
|
26
30
|
*
|
|
@@ -83,7 +87,7 @@ type ValidationIssue = Readonly<{
|
|
|
83
87
|
*/
|
|
84
88
|
type ValidationErrorDetails = Readonly<{
|
|
85
89
|
/** Type of entity being validated */
|
|
86
|
-
entityType?:
|
|
90
|
+
entityType?: KindEntity;
|
|
87
91
|
/** Kind/type name of the entity */
|
|
88
92
|
kind?: string;
|
|
89
93
|
/** Operation being performed */
|
|
@@ -143,12 +147,22 @@ declare class EdgeNotFoundError extends TypeGraphError {
|
|
|
143
147
|
});
|
|
144
148
|
}
|
|
145
149
|
/**
|
|
146
|
-
* Thrown when
|
|
150
|
+
* Thrown when an operation references a kind that isn't registered on
|
|
151
|
+
* the graph — `getNodeCollectionOrThrow` against an unknown kind, a
|
|
152
|
+
* `materializeIndexes({ kinds })` filter naming a missing kind, an
|
|
153
|
+
* extension referencing an unresolved endpoint, search facade typos,
|
|
154
|
+
* etc. Carries the offending `kindName` and `entity` plus the host
|
|
155
|
+
* `graphId` so logs are unambiguous when multiple stores share a
|
|
156
|
+
* process.
|
|
147
157
|
*/
|
|
148
158
|
declare class KindNotFoundError extends TypeGraphError {
|
|
149
|
-
|
|
159
|
+
readonly kindName: string;
|
|
160
|
+
readonly entity: KindEntity;
|
|
161
|
+
constructor(kindName: string, entity: KindEntity, options?: Readonly<{
|
|
162
|
+
graphId?: string;
|
|
163
|
+
suggestion?: string;
|
|
150
164
|
cause?: unknown;
|
|
151
|
-
});
|
|
165
|
+
}>);
|
|
152
166
|
}
|
|
153
167
|
/**
|
|
154
168
|
* Thrown when a uniqueness constraint name is not found on a node kind.
|
|
@@ -281,6 +295,101 @@ declare class MigrationError extends TypeGraphError {
|
|
|
281
295
|
cause?: unknown;
|
|
282
296
|
});
|
|
283
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Thrown by `Store.evolve(extension, { eager })` when the schema
|
|
300
|
+
* commit succeeded but the follow-on `materializeIndexes()` produced
|
|
301
|
+
* one or more failed entries.
|
|
302
|
+
*
|
|
303
|
+
* Recovery: the schema commit is NOT rolled back. The new `Store` is
|
|
304
|
+
* fully constructed and (when `options.ref` was supplied) `ref.current`
|
|
305
|
+
* already points to it — the caller can read the new store via the ref
|
|
306
|
+
* and decide how to handle the failed indexes (retry, skip, alert).
|
|
307
|
+
* The full `MaterializeIndexesResult` is attached as `.materialization`.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* const ref = { current: store };
|
|
312
|
+
* try {
|
|
313
|
+
* await store.evolve(extension, { ref, eager: {} });
|
|
314
|
+
* } catch (error) {
|
|
315
|
+
* if (error instanceof EagerMaterializationError) {
|
|
316
|
+
* // schema is committed; ref.current is the new store
|
|
317
|
+
* log.warn(
|
|
318
|
+
* { failed: error.failedIndexNames },
|
|
319
|
+
* "indexes did not materialize; will retry",
|
|
320
|
+
* );
|
|
321
|
+
* await ref.current.materializeIndexes();
|
|
322
|
+
* } else {
|
|
323
|
+
* throw error;
|
|
324
|
+
* }
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
declare class EagerMaterializationError extends TypeGraphError {
|
|
329
|
+
/**
|
|
330
|
+
* The full materialization result, including successful and failed
|
|
331
|
+
* entries. Same shape as `Store.materializeIndexes()` returns.
|
|
332
|
+
*/
|
|
333
|
+
readonly materialization: MaterializeIndexesResult;
|
|
334
|
+
constructor(materialization: MaterializeIndexesResult, graphId: string);
|
|
335
|
+
/**
|
|
336
|
+
* Names of just the indexes that failed — derived from
|
|
337
|
+
* `materialization.results` so the two views can never disagree.
|
|
338
|
+
*/
|
|
339
|
+
get failedIndexNames(): readonly string[];
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Thrown by `commitSchemaVersion` and `setActiveVersion` when the
|
|
343
|
+
* caller's view of the active schema version is out of date — another
|
|
344
|
+
* writer has already advanced it.
|
|
345
|
+
*
|
|
346
|
+
* Recovery: re-read the active version with `getActiveSchema(graphId)`,
|
|
347
|
+
* recompute against the new baseline, and retry. This is a routine
|
|
348
|
+
* concurrency signal, not a bug.
|
|
349
|
+
*
|
|
350
|
+
* `actual` is `0` when no active version exists yet (initial-commit race
|
|
351
|
+
* where another writer initialized first).
|
|
352
|
+
*/
|
|
353
|
+
declare class StaleVersionError extends TypeGraphError {
|
|
354
|
+
readonly details: Readonly<{
|
|
355
|
+
graphId: string;
|
|
356
|
+
expected: number;
|
|
357
|
+
actual: number;
|
|
358
|
+
}>;
|
|
359
|
+
constructor(details: Readonly<{
|
|
360
|
+
graphId: string;
|
|
361
|
+
expected: number;
|
|
362
|
+
actual: number;
|
|
363
|
+
}>, options?: {
|
|
364
|
+
cause?: unknown;
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Thrown by `commitSchemaVersion` when a row already exists at the
|
|
369
|
+
* target version with a *different* schema hash — i.e. two writers
|
|
370
|
+
* committed materially different schemas at the same version number.
|
|
371
|
+
*
|
|
372
|
+
* Distinct from `StaleVersionError`: this is not a refetch-and-retry
|
|
373
|
+
* situation, it's a content disagreement that needs operator
|
|
374
|
+
* intervention. Typically caused by inconsistent application
|
|
375
|
+
* deployments writing schemas that hash differently.
|
|
376
|
+
*/
|
|
377
|
+
declare class SchemaContentConflictError extends TypeGraphError {
|
|
378
|
+
readonly details: Readonly<{
|
|
379
|
+
graphId: string;
|
|
380
|
+
version: number;
|
|
381
|
+
existingHash: string;
|
|
382
|
+
incomingHash: string;
|
|
383
|
+
}>;
|
|
384
|
+
constructor(details: Readonly<{
|
|
385
|
+
graphId: string;
|
|
386
|
+
version: number;
|
|
387
|
+
existingHash: string;
|
|
388
|
+
incomingHash: string;
|
|
389
|
+
}>, options?: {
|
|
390
|
+
cause?: unknown;
|
|
391
|
+
});
|
|
392
|
+
}
|
|
284
393
|
/**
|
|
285
394
|
* Thrown when graph configuration is invalid.
|
|
286
395
|
*
|
|
@@ -390,4 +499,4 @@ declare function isConstraintError(error: unknown): boolean;
|
|
|
390
499
|
*/
|
|
391
500
|
declare function getErrorSuggestion(error: unknown): string | undefined;
|
|
392
501
|
|
|
393
|
-
export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D,
|
|
502
|
+
export { BackendDisposedError as B, CardinalityError as C, DatabaseOperationError as D, EagerMaterializationError as E, KindNotFoundError as K, MigrationError as M, NodeConstraintNotFoundError as N, RestrictedDeleteError as R, SchemaContentConflictError as S, TypeGraphError as T, UniquenessError as U, type ValidationIssue as V, ValidationError as a, CompilerInvariantError as b, ConfigurationError as c, DisjointError as d, EdgeNotFoundError as e, EndpointError as f, EndpointNotFoundError as g, type ErrorCategory as h, NodeNotFoundError as i, SchemaMismatchError as j, StaleVersionError as k, type TypeGraphErrorOptions as l, UnsupportedPredicateError as m, type ValidationErrorDetails as n, VersionConflictError as o, getErrorSuggestion as p, isConstraintError as q, isSystemError as r, isTypeGraphError as s, isUserRecoverable as t };
|