@nicia-ai/typegraph 0.51.0 → 0.51.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/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/{chunk-WRBV2FNH.cjs → chunk-5FVZSE3B.cjs} +48 -48
- package/dist/{chunk-WRBV2FNH.cjs.map → chunk-5FVZSE3B.cjs.map} +1 -1
- package/dist/{chunk-JHRUZ73O.cjs → chunk-AOGOC6JF.cjs} +4 -4
- package/dist/chunk-AOGOC6JF.cjs.map +1 -0
- package/dist/{chunk-YT2IVFAI.js → chunk-EVYW3532.js} +4 -4
- package/dist/chunk-EVYW3532.js.map +1 -0
- package/dist/{chunk-RCBG6YMT.js → chunk-K6OZIHKI.js} +3 -3
- package/dist/{chunk-RCBG6YMT.js.map → chunk-K6OZIHKI.js.map} +1 -1
- package/dist/{chunk-QLLZM5I3.cjs → chunk-TUWSVL6I.cjs} +4 -4
- package/dist/{chunk-QLLZM5I3.cjs.map → chunk-TUWSVL6I.cjs.map} +1 -1
- package/dist/{chunk-CAI6SMP6.js → chunk-WS5MT2UJ.js} +3 -3
- package/dist/{chunk-CAI6SMP6.js.map → chunk-WS5MT2UJ.js.map} +1 -1
- package/dist/graph-merge/index.cjs +9 -9
- package/dist/graph-merge/index.js +2 -2
- package/dist/index.cjs +57 -57
- package/dist/index.js +3 -3
- package/dist/{local-store-impl-OXTOVU2J.js → local-store-impl-JC7OBRAW.js} +4 -4
- package/dist/{local-store-impl-OXTOVU2J.js.map → local-store-impl-JC7OBRAW.js.map} +1 -1
- package/dist/{local-store-impl-6DDTFM32.cjs → local-store-impl-UOS2LUIG.cjs} +5 -5
- package/dist/{local-store-impl-6DDTFM32.cjs.map → local-store-impl-UOS2LUIG.cjs.map} +1 -1
- package/dist/{pglite-store-impl-GJG3Y7RP.cjs → pglite-store-impl-J5J5AA52.cjs} +5 -5
- package/dist/{pglite-store-impl-GJG3Y7RP.cjs.map → pglite-store-impl-J5J5AA52.cjs.map} +1 -1
- package/dist/{pglite-store-impl-6EMZGL7K.js → pglite-store-impl-LDRH2DUH.js} +4 -4
- package/dist/{pglite-store-impl-6EMZGL7K.js.map → pglite-store-impl-LDRH2DUH.js.map} +1 -1
- package/dist/schema/index.cjs +24 -24
- package/dist/schema/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-JHRUZ73O.cjs.map +0 -1
- package/dist/chunk-YT2IVFAI.js.map +0 -1
|
@@ -7,7 +7,7 @@ require('../../chunk-X4GDXBOP.cjs');
|
|
|
7
7
|
async function createLocalPgliteStore(graph, options = {}) {
|
|
8
8
|
const impl = await chunkIVQBLXBK_cjs.loadDrizzleBackedModule(
|
|
9
9
|
"./postgres/pglite",
|
|
10
|
-
() => import('../../pglite-store-impl-
|
|
10
|
+
() => import('../../pglite-store-impl-J5J5AA52.cjs')
|
|
11
11
|
);
|
|
12
12
|
return impl.createLocalPgliteStoreImpl(graph, options);
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@ import '../../chunk-YDEJQWOL.js';
|
|
|
5
5
|
async function createLocalPgliteStore(graph, options = {}) {
|
|
6
6
|
const impl = await loadDrizzleBackedModule(
|
|
7
7
|
"./postgres/pglite",
|
|
8
|
-
() => import('../../pglite-store-impl-
|
|
8
|
+
() => import('../../pglite-store-impl-LDRH2DUH.js')
|
|
9
9
|
);
|
|
10
10
|
return impl.createLocalPgliteStoreImpl(graph, options);
|
|
11
11
|
}
|
|
@@ -8,7 +8,7 @@ require('../../chunk-X4GDXBOP.cjs');
|
|
|
8
8
|
async function createLocalSqliteStore(graph, options = {}) {
|
|
9
9
|
const impl = await chunkIVQBLXBK_cjs.loadDrizzleBackedModule(
|
|
10
10
|
"./sqlite/local",
|
|
11
|
-
() => import('../../local-store-impl-
|
|
11
|
+
() => import('../../local-store-impl-UOS2LUIG.cjs')
|
|
12
12
|
);
|
|
13
13
|
return impl.createLocalSqliteStoreImpl(graph, options);
|
|
14
14
|
}
|
|
@@ -6,7 +6,7 @@ import '../../chunk-YDEJQWOL.js';
|
|
|
6
6
|
async function createLocalSqliteStore(graph, options = {}) {
|
|
7
7
|
const impl = await loadDrizzleBackedModule(
|
|
8
8
|
"./sqlite/local",
|
|
9
|
-
() => import('../../local-store-impl-
|
|
9
|
+
() => import('../../local-store-impl-JC7OBRAW.js')
|
|
10
10
|
);
|
|
11
11
|
return impl.createLocalSqliteStoreImpl(graph, options);
|
|
12
12
|
}
|
|
@@ -4,7 +4,7 @@ var chunk36SX6QXP_cjs = require('./chunk-36SX6QXP.cjs');
|
|
|
4
4
|
var chunk2KCTP3U2_cjs = require('./chunk-2KCTP3U2.cjs');
|
|
5
5
|
var chunk2CVDZCXH_cjs = require('./chunk-2CVDZCXH.cjs');
|
|
6
6
|
var chunkFMMW3KX7_cjs = require('./chunk-FMMW3KX7.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkAOGOC6JF_cjs = require('./chunk-AOGOC6JF.cjs');
|
|
8
8
|
var chunkPS3TUWJM_cjs = require('./chunk-PS3TUWJM.cjs');
|
|
9
9
|
var chunkL6EVYIID_cjs = require('./chunk-L6EVYIID.cjs');
|
|
10
10
|
var chunkJQKMEKKW_cjs = require('./chunk-JQKMEKKW.cjs');
|
|
@@ -15540,7 +15540,7 @@ function createHistoryStoreBackendProjection(backend) {
|
|
|
15540
15540
|
// src/store/introspect.ts
|
|
15541
15541
|
function introspectSchema(graph, context) {
|
|
15542
15542
|
const extension = graph.extension;
|
|
15543
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
15543
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkAOGOC6JF_cjs.extensionKindNames(extension);
|
|
15544
15544
|
const deprecated = graph.deprecatedKinds;
|
|
15545
15545
|
const kinds = [];
|
|
15546
15546
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
@@ -15551,7 +15551,7 @@ function introspectSchema(graph, context) {
|
|
|
15551
15551
|
description: reg.type.description,
|
|
15552
15552
|
annotations: reg.type.annotations,
|
|
15553
15553
|
deprecated: deprecated.has(name),
|
|
15554
|
-
properties:
|
|
15554
|
+
properties: chunkAOGOC6JF_cjs.serializeSchemaProperties(reg.type.schema),
|
|
15555
15555
|
unique: (reg.unique ?? []).map((constraint) => ({
|
|
15556
15556
|
name: constraint.name,
|
|
15557
15557
|
fields: [...constraint.fields],
|
|
@@ -15572,17 +15572,17 @@ function introspectSchema(graph, context) {
|
|
|
15572
15572
|
to: reg.to.map((entry2) => entry2.kind),
|
|
15573
15573
|
cardinality: reg.cardinality ?? "many",
|
|
15574
15574
|
endpointExistence: reg.endpointExistence ?? "notDeleted",
|
|
15575
|
-
properties:
|
|
15575
|
+
properties: chunkAOGOC6JF_cjs.serializeSchemaProperties(edgeType.schema),
|
|
15576
15576
|
annotations: edgeType.annotations,
|
|
15577
15577
|
deprecated: deprecated.has(name)
|
|
15578
15578
|
});
|
|
15579
15579
|
}
|
|
15580
|
-
const runtimeOntologyKeys =
|
|
15580
|
+
const runtimeOntologyKeys = chunkAOGOC6JF_cjs.buildGraphExtensionOntologyKeySet(extension);
|
|
15581
15581
|
const ontology = graph.ontology.map((relation) => ({
|
|
15582
15582
|
metaEdge: relation.metaEdge.name,
|
|
15583
15583
|
from: chunkPS3TUWJM_cjs.getTypeName(relation.from),
|
|
15584
15584
|
to: chunkPS3TUWJM_cjs.getTypeName(relation.to),
|
|
15585
|
-
origin: runtimeOntologyKeys.has(
|
|
15585
|
+
origin: runtimeOntologyKeys.has(chunkAOGOC6JF_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
|
|
15586
15586
|
}));
|
|
15587
15587
|
return {
|
|
15588
15588
|
graphId: context.graphId,
|
|
@@ -16337,7 +16337,7 @@ async function computeIndexSignature(dialect, targetTableName, declaration) {
|
|
|
16337
16337
|
const hashable = {
|
|
16338
16338
|
dialect,
|
|
16339
16339
|
targetTableName,
|
|
16340
|
-
declaration:
|
|
16340
|
+
declaration: chunkAOGOC6JF_cjs.serializeIndexDeclaration(declaration)
|
|
16341
16341
|
};
|
|
16342
16342
|
const json = JSON.stringify(hashable, chunkNLX5OWK7_cjs.sortedReplacer);
|
|
16343
16343
|
return chunkZY4GXIVN_cjs.sha256Hex(json, 16);
|
|
@@ -16359,7 +16359,7 @@ async function materializeRemovals(context, options = {}) {
|
|
|
16359
16359
|
await ensureFocusedStatusTable(backend, backend.ensureKindRemovalsTable);
|
|
16360
16360
|
await reconcilePendingRemovals(context);
|
|
16361
16361
|
const activeRow = await backend.getActiveSchema(graphId);
|
|
16362
|
-
const activeSchema = activeRow === void 0 ? void 0 :
|
|
16362
|
+
const activeSchema = activeRow === void 0 ? void 0 : chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16363
16363
|
const reclaimedVectorFields = await reclaimRemovedVectorFieldTables(
|
|
16364
16364
|
context,
|
|
16365
16365
|
activeRow
|
|
@@ -16428,14 +16428,14 @@ async function reconcilePendingRemovals(context) {
|
|
|
16428
16428
|
const reconciliations = [];
|
|
16429
16429
|
const stopAtVersion = marker ?? 1;
|
|
16430
16430
|
let currentRow = activeRow;
|
|
16431
|
-
let currentSchema =
|
|
16431
|
+
let currentSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16432
16432
|
while (currentRow.version > stopAtVersion) {
|
|
16433
16433
|
const priorRow = await backend.getSchemaVersion(
|
|
16434
16434
|
graphId,
|
|
16435
16435
|
currentRow.version - 1
|
|
16436
16436
|
);
|
|
16437
16437
|
if (priorRow === void 0) break;
|
|
16438
|
-
const priorSchema =
|
|
16438
|
+
const priorSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16439
16439
|
for (const entity of ENTITY_KINDS) {
|
|
16440
16440
|
const priorEntries = priorSchema[entity === "node" ? "nodes" : "edges"];
|
|
16441
16441
|
const currentEntries = currentSchema[entity === "node" ? "nodes" : "edges"];
|
|
@@ -16500,7 +16500,7 @@ async function materializeOne2(row, ctx) {
|
|
|
16500
16500
|
ctx.graphId,
|
|
16501
16501
|
async (target) => {
|
|
16502
16502
|
const activeRow = await target.getActiveSchema(ctx.graphId);
|
|
16503
|
-
const activeSchema = activeRow === void 0 ? void 0 :
|
|
16503
|
+
const activeSchema = activeRow === void 0 ? void 0 : chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16504
16504
|
if (liveKindNamesFrom(activeSchema)[row.entity].has(row.kindName)) {
|
|
16505
16505
|
return "skipped";
|
|
16506
16506
|
}
|
|
@@ -16659,7 +16659,7 @@ async function resolveRemovedKindEmbeddingSlots(backend, row) {
|
|
|
16659
16659
|
if (priorVersion < 1) return [];
|
|
16660
16660
|
const priorRow = await backend.getSchemaVersion(row.graphId, priorVersion);
|
|
16661
16661
|
if (priorRow === void 0) return [];
|
|
16662
|
-
const priorSchema =
|
|
16662
|
+
const priorSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16663
16663
|
const slots = /* @__PURE__ */ new Map();
|
|
16664
16664
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
16665
16665
|
if (declaration.entity === "vector" && declaration.kind === row.kindName) {
|
|
@@ -16696,14 +16696,14 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
|
|
|
16696
16696
|
let perBackend = reclaimCache.get(backend);
|
|
16697
16697
|
const cached = perBackend?.get(cacheKey);
|
|
16698
16698
|
if (cached !== void 0) return cached;
|
|
16699
|
-
const activeSchema =
|
|
16699
|
+
const activeSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
16700
16700
|
const activeVectorFields = vectorFieldKeysFrom(activeSchema);
|
|
16701
16701
|
const survivingKinds = new Set(Object.keys(activeSchema.nodes));
|
|
16702
16702
|
const historical = /* @__PURE__ */ new Map();
|
|
16703
16703
|
for (let version = activeRow.version - 1; version >= 1; version -= 1) {
|
|
16704
16704
|
const priorRow = await backend.getSchemaVersion(graphId, version);
|
|
16705
16705
|
if (priorRow === void 0) continue;
|
|
16706
|
-
const priorSchema =
|
|
16706
|
+
const priorSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
16707
16707
|
for (const declaration of priorSchema.indexes ?? []) {
|
|
16708
16708
|
if (declaration.entity !== "vector") continue;
|
|
16709
16709
|
const key = vectorFieldKey(declaration.kind, declaration.fieldPath);
|
|
@@ -16741,7 +16741,7 @@ async function reclaimRemovedVectorFieldTables(context, activeRow) {
|
|
|
16741
16741
|
async (target) => {
|
|
16742
16742
|
const lockedActiveRow = await target.getActiveSchema(graphId);
|
|
16743
16743
|
if (lockedActiveRow === void 0) return false;
|
|
16744
|
-
const lockedActiveSchema =
|
|
16744
|
+
const lockedActiveSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(
|
|
16745
16745
|
lockedActiveRow.schema_doc
|
|
16746
16746
|
);
|
|
16747
16747
|
const lockedVectorFields = vectorFieldKeysFrom(lockedActiveSchema);
|
|
@@ -18621,7 +18621,7 @@ function syncStoreReplacementRef(ref, replacement) {
|
|
|
18621
18621
|
ref.current = replacement;
|
|
18622
18622
|
}
|
|
18623
18623
|
async function commitEvolvedSchemaWhenRequiredKindsAreEmpty(backend, graph, currentVersion, classification) {
|
|
18624
|
-
const result = await
|
|
18624
|
+
const result = await chunkAOGOC6JF_cjs.commitNewSchemaVersionIfKindsEmpty(
|
|
18625
18625
|
backend,
|
|
18626
18626
|
graph,
|
|
18627
18627
|
currentVersion,
|
|
@@ -18788,7 +18788,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
18788
18788
|
mapRecordedNodeRow: chunk36SX6QXP_cjs.createNodeRowMapper(rowMapperConfig),
|
|
18789
18789
|
mapRecordedEdgeRow: chunk36SX6QXP_cjs.createEdgeRowMapper(rowMapperConfig)
|
|
18790
18790
|
});
|
|
18791
|
-
this.#registry =
|
|
18791
|
+
this.#registry = chunkAOGOC6JF_cjs.buildKindRegistry(graph);
|
|
18792
18792
|
this.#hooks = options?.hooks ?? {};
|
|
18793
18793
|
this.#defaultTraversalExpansion = options?.queryDefaults?.traversalExpansion ?? "inverse";
|
|
18794
18794
|
this.#options = options;
|
|
@@ -19005,7 +19005,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19005
19005
|
* fails leaves no half-published derived relation behind.
|
|
19006
19006
|
*/
|
|
19007
19007
|
async identitySchemaPreflight(target, provisionDerivedRelations) {
|
|
19008
|
-
await
|
|
19008
|
+
await chunkAOGOC6JF_cjs.identitySchemaCommitPreflight(this.#identityContext(this.#backend), {
|
|
19009
19009
|
enablement: false,
|
|
19010
19010
|
provisionDerivedRelations
|
|
19011
19011
|
})(target);
|
|
@@ -19452,7 +19452,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19452
19452
|
* between "proceed" and "ask the user" *before* attempting a commit.
|
|
19453
19453
|
*/
|
|
19454
19454
|
async schemaChanges() {
|
|
19455
|
-
return
|
|
19455
|
+
return chunkAOGOC6JF_cjs.getSchemaChanges(this.#backend, this.#graph);
|
|
19456
19456
|
}
|
|
19457
19457
|
/**
|
|
19458
19458
|
* Whether committing this store's graph would require a schema migration —
|
|
@@ -19464,7 +19464,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
19464
19464
|
* through a user's request.
|
|
19465
19465
|
*/
|
|
19466
19466
|
async requiresMigration() {
|
|
19467
|
-
return
|
|
19467
|
+
return chunkAOGOC6JF_cjs.requiresMigration(this.#backend, this.#graph);
|
|
19468
19468
|
}
|
|
19469
19469
|
/**
|
|
19470
19470
|
* Node operations bound to this store instance.
|
|
@@ -20761,7 +20761,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20761
20761
|
*/
|
|
20762
20762
|
async evolve(extension, options) {
|
|
20763
20763
|
const { activeRow, baseline } = await this.#loadCaughtUp("evolve");
|
|
20764
|
-
const merged =
|
|
20764
|
+
const merged = chunkAOGOC6JF_cjs.mergeGraphExtension(baseline, extension);
|
|
20765
20765
|
if (merged === baseline) {
|
|
20766
20766
|
if (baseline === this.#graph) {
|
|
20767
20767
|
syncStoreReplacementRef(options?.ref, this);
|
|
@@ -20790,7 +20790,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20790
20790
|
);
|
|
20791
20791
|
}
|
|
20792
20792
|
const identityCandidate = merged.identity === void 0 ? void 0 : this.#cloneWithGraph(merged, void 0);
|
|
20793
|
-
const identityProvisioning = identityCandidate === void 0 ? void 0 : await
|
|
20793
|
+
const identityProvisioning = identityCandidate === void 0 ? void 0 : await chunkAOGOC6JF_cjs.ensureIdentitySchemaStorage(
|
|
20794
20794
|
this.#baseBackend,
|
|
20795
20795
|
this.#sqlSchema(),
|
|
20796
20796
|
{
|
|
@@ -20799,7 +20799,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20799
20799
|
// The evolved graph's registry — the one the candidate's own
|
|
20800
20800
|
// preflight rebuilds through, so the predicate and the fill agree
|
|
20801
20801
|
// on which assertions count.
|
|
20802
|
-
registry:
|
|
20802
|
+
registry: chunkAOGOC6JF_cjs.buildKindRegistry(merged)
|
|
20803
20803
|
}
|
|
20804
20804
|
);
|
|
20805
20805
|
const committed = identityCandidate === void 0 ? classification.requireEmpty.length > 0 ? await commitEvolvedSchemaWhenRequiredKindsAreEmpty(
|
|
@@ -20807,7 +20807,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
20807
20807
|
merged,
|
|
20808
20808
|
activeRow.version,
|
|
20809
20809
|
classification
|
|
20810
|
-
) : await
|
|
20810
|
+
) : await chunkAOGOC6JF_cjs.commitNewSchemaVersion(this.#backend, merged, activeRow.version) : await chunkAOGOC6JF_cjs.commitNewSchemaVersionWithPreflight(
|
|
20811
20811
|
this.#backend,
|
|
20812
20812
|
merged,
|
|
20813
20813
|
activeRow.version,
|
|
@@ -21192,8 +21192,8 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21192
21192
|
*/
|
|
21193
21193
|
async verifyConstraintFences() {
|
|
21194
21194
|
const activeRow = await this.#baseBackend.getActiveSchema(this.graphId);
|
|
21195
|
-
const graph = activeRow === void 0 ? this.#graph : this.#catchUpToStored(
|
|
21196
|
-
const registry = graph === this.#graph ? this.#registry :
|
|
21195
|
+
const graph = activeRow === void 0 ? this.#graph : this.#catchUpToStored(chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc));
|
|
21196
|
+
const registry = graph === this.#graph ? this.#registry : chunkAOGOC6JF_cjs.buildKindRegistry(graph);
|
|
21197
21197
|
return verifyConstraintFences({
|
|
21198
21198
|
graph,
|
|
21199
21199
|
registry,
|
|
@@ -21452,7 +21452,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21452
21452
|
*/
|
|
21453
21453
|
async removeKinds(names, options) {
|
|
21454
21454
|
const { activeRow, baseline } = await this.#loadCaughtUp("remove");
|
|
21455
|
-
const plan =
|
|
21455
|
+
const plan = chunkAOGOC6JF_cjs.planRemovals(baseline, names);
|
|
21456
21456
|
if (plan.removedNodeKinds.length === 0 && plan.removedEdgeKinds.length === 0) {
|
|
21457
21457
|
if (baseline === this.#graph) {
|
|
21458
21458
|
syncStoreReplacementRef(options?.ref, this);
|
|
@@ -21464,18 +21464,18 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21464
21464
|
schemaMetadataFromRow(activeRow)
|
|
21465
21465
|
);
|
|
21466
21466
|
}
|
|
21467
|
-
const compileTimeGraph =
|
|
21468
|
-
const merged = plan.document === void 0 ? compileTimeGraph :
|
|
21469
|
-
const finalGraph =
|
|
21467
|
+
const compileTimeGraph = chunkAOGOC6JF_cjs.stripGraphExtension(this.#graph);
|
|
21468
|
+
const merged = plan.document === void 0 ? compileTimeGraph : chunkAOGOC6JF_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
|
|
21469
|
+
const finalGraph = chunkAOGOC6JF_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
|
|
21470
21470
|
const identityCascade = await this.#identityRemovalPreflight(
|
|
21471
21471
|
finalGraph,
|
|
21472
21472
|
plan.removedNodeKinds
|
|
21473
21473
|
);
|
|
21474
|
-
const committedRow = identityCascade === void 0 ? await
|
|
21474
|
+
const committedRow = identityCascade === void 0 ? await chunkAOGOC6JF_cjs.commitNewSchemaVersion(
|
|
21475
21475
|
this.#backend,
|
|
21476
21476
|
finalGraph,
|
|
21477
21477
|
activeRow.version
|
|
21478
|
-
) : await
|
|
21478
|
+
) : await chunkAOGOC6JF_cjs.commitNewSchemaVersionWithPreflight(
|
|
21479
21479
|
this.#backend,
|
|
21480
21480
|
finalGraph,
|
|
21481
21481
|
activeRow.version,
|
|
@@ -21533,7 +21533,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21533
21533
|
async #identityRemovalPreflight(finalGraph, removedNodeKinds) {
|
|
21534
21534
|
if (removedNodeKinds.length === 0) return void 0;
|
|
21535
21535
|
const repairClosure = finalGraph.identity !== void 0;
|
|
21536
|
-
if (!repairClosure && !await
|
|
21536
|
+
if (!repairClosure && !await chunkAOGOC6JF_cjs.identityKindCascadeNeeded(
|
|
21537
21537
|
this.#backend,
|
|
21538
21538
|
this.#sqlSchema(),
|
|
21539
21539
|
this.graphId,
|
|
@@ -21594,8 +21594,8 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21594
21594
|
schemaMetadataFromRow(activeRow)
|
|
21595
21595
|
);
|
|
21596
21596
|
}
|
|
21597
|
-
const merged =
|
|
21598
|
-
const result = await
|
|
21597
|
+
const merged = chunkAOGOC6JF_cjs.applyDeprecatedKinds(baseline, nextSet);
|
|
21598
|
+
const result = await chunkAOGOC6JF_cjs.ensureSchema(this.#backend, merged, {
|
|
21599
21599
|
preloaded: { activeRow, storedSchema },
|
|
21600
21600
|
autoMigrate: true
|
|
21601
21601
|
});
|
|
@@ -21603,9 +21603,9 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21603
21603
|
return this.#cloneWithGraph(merged, options?.ref, metadata);
|
|
21604
21604
|
}
|
|
21605
21605
|
#catchUpToStored(storedSchema) {
|
|
21606
|
-
const compileTimeGraph =
|
|
21607
|
-
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph :
|
|
21608
|
-
return
|
|
21606
|
+
const compileTimeGraph = chunkAOGOC6JF_cjs.stripGraphExtension(this.#graph);
|
|
21607
|
+
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunkAOGOC6JF_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
|
|
21608
|
+
return chunkAOGOC6JF_cjs.applyDeprecatedKinds(
|
|
21609
21609
|
withGraphExtension,
|
|
21610
21610
|
storedSchema.deprecatedKinds
|
|
21611
21611
|
);
|
|
@@ -21623,7 +21623,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21623
21623
|
* serializes the actual commit.
|
|
21624
21624
|
*/
|
|
21625
21625
|
async #loadCaughtUp(verb) {
|
|
21626
|
-
const activeRow = await
|
|
21626
|
+
const activeRow = await chunkAOGOC6JF_cjs.loadActiveSchemaWithBootstrap(
|
|
21627
21627
|
this.#backend,
|
|
21628
21628
|
this.graphId
|
|
21629
21629
|
);
|
|
@@ -21634,7 +21634,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
21634
21634
|
{ code }
|
|
21635
21635
|
);
|
|
21636
21636
|
}
|
|
21637
|
-
const storedSchema =
|
|
21637
|
+
const storedSchema = chunkAOGOC6JF_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
21638
21638
|
const baseline = this.#catchUpToStored(storedSchema);
|
|
21639
21639
|
return { activeRow, storedSchema, baseline };
|
|
21640
21640
|
}
|
|
@@ -22205,7 +22205,7 @@ var IDENTITY_GATE_CODES = {
|
|
|
22205
22205
|
};
|
|
22206
22206
|
async function ensureSchemaWithIdentityPrecedence(backend, graph, options, gate) {
|
|
22207
22207
|
try {
|
|
22208
|
-
return await
|
|
22208
|
+
return await chunkAOGOC6JF_cjs.ensureSchema(backend, graph, options);
|
|
22209
22209
|
} catch (error) {
|
|
22210
22210
|
if (gate === void 0 || !isIdentityOnlyBreakingChange(error)) throw error;
|
|
22211
22211
|
throw identityMigrationRequiredError(graph.id, gate, {
|
|
@@ -22245,20 +22245,20 @@ async function prepareStoreWithSchema(graph, backend, options) {
|
|
|
22245
22245
|
graph: merged,
|
|
22246
22246
|
activeRow,
|
|
22247
22247
|
storedSchema
|
|
22248
|
-
} = await
|
|
22248
|
+
} = await chunkAOGOC6JF_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
|
|
22249
22249
|
const identityProfileChanged = activeRow !== void 0 && storedSchema?.identity?.sameIdAcrossKinds !== merged.identity?.sameIdAcrossKinds;
|
|
22250
22250
|
const identityInitialization = activeRow === void 0 && merged.identity !== void 0;
|
|
22251
22251
|
const identityEnablement = identityInitialization || identityProfileChanged && storedSchema?.identity === void 0 && merged.identity !== void 0;
|
|
22252
22252
|
const identitySemanticsChanged = identityProfileChanged || activeRow !== void 0 && storedSchema !== void 0 && merged.identity !== void 0 && identityOntologyChanged(
|
|
22253
22253
|
storedSchema,
|
|
22254
|
-
|
|
22254
|
+
chunkAOGOC6JF_cjs.serializeSchema(merged, activeRow.version + 1)
|
|
22255
22255
|
);
|
|
22256
22256
|
const identityGate = identitySemanticsChanged ? identityEnablement ? "enablement" : identityProfileChanged ? "profile" : "ontology" : void 0;
|
|
22257
22257
|
const identityProfile = merged.identity;
|
|
22258
22258
|
if (identityProfile !== void 0) {
|
|
22259
22259
|
const resolvedIdentitySchema = options?.schema === void 0 ? chunkNUQ2YFFH_cjs.createSqlSchema(backend.tableNames) : chunkNUQ2YFFH_cjs.requireSqlSchema(options.schema, "store schema");
|
|
22260
|
-
const identityRegistry =
|
|
22261
|
-
await
|
|
22260
|
+
const identityRegistry = chunkAOGOC6JF_cjs.buildKindRegistry(merged);
|
|
22261
|
+
await chunkAOGOC6JF_cjs.ensureIdentitySchemaStorage(backend, resolvedIdentitySchema, {
|
|
22262
22262
|
graphId: merged.id,
|
|
22263
22263
|
enablement: identityEnablement,
|
|
22264
22264
|
registry: identityRegistry,
|
|
@@ -22375,7 +22375,7 @@ async function prepareVerifiedStore(graph, backend, options) {
|
|
|
22375
22375
|
graph: merged,
|
|
22376
22376
|
activeRow,
|
|
22377
22377
|
result
|
|
22378
|
-
} = await
|
|
22378
|
+
} = await chunkAOGOC6JF_cjs.loadAndVerifyGraph(backend, graph);
|
|
22379
22379
|
await assertHistorySchemaOnOpen(backend, merged, options);
|
|
22380
22380
|
return {
|
|
22381
22381
|
graph: merged,
|
|
@@ -22433,5 +22433,5 @@ exports.min = min;
|
|
|
22433
22433
|
exports.offsetFragment = offsetFragment;
|
|
22434
22434
|
exports.orderByFragment = orderByFragment;
|
|
22435
22435
|
exports.sum = sum;
|
|
22436
|
-
//# sourceMappingURL=chunk-
|
|
22437
|
-
//# sourceMappingURL=chunk-
|
|
22436
|
+
//# sourceMappingURL=chunk-5FVZSE3B.cjs.map
|
|
22437
|
+
//# sourceMappingURL=chunk-5FVZSE3B.cjs.map
|