@nicia-ai/typegraph 0.3.0 → 0.4.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/backend/drizzle/index.cjs +6 -6
- package/dist/backend/drizzle/index.d.cts +1 -1
- package/dist/backend/drizzle/index.d.ts +1 -1
- package/dist/backend/drizzle/index.js +4 -4
- package/dist/backend/drizzle/postgres.cjs +4 -4
- package/dist/backend/drizzle/postgres.d.cts +2 -2
- package/dist/backend/drizzle/postgres.d.ts +2 -2
- package/dist/backend/drizzle/postgres.js +3 -3
- package/dist/backend/drizzle/sqlite.cjs +4 -4
- package/dist/backend/drizzle/sqlite.d.cts +1 -1
- package/dist/backend/drizzle/sqlite.d.ts +1 -1
- package/dist/backend/drizzle/sqlite.js +3 -3
- package/dist/backend/postgres/index.cjs +4 -4
- package/dist/backend/postgres/index.d.cts +1 -1
- package/dist/backend/postgres/index.d.ts +1 -1
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +6 -6
- package/dist/backend/sqlite/index.d.cts +1 -1
- package/dist/backend/sqlite/index.d.ts +1 -1
- package/dist/backend/sqlite/index.js +4 -4
- package/dist/{chunk-OYL2SGBD.cjs → chunk-44SXEVF4.cjs} +18 -2
- package/dist/chunk-44SXEVF4.cjs.map +1 -0
- package/dist/{chunk-SFY2PPOY.cjs → chunk-7RVSDXT3.cjs} +50 -10
- package/dist/chunk-7RVSDXT3.cjs.map +1 -0
- package/dist/{chunk-ZJHQZZT2.cjs → chunk-K2ROKOK3.cjs} +6 -6
- package/dist/{chunk-ZJHQZZT2.cjs.map → chunk-K2ROKOK3.cjs.map} +1 -1
- package/dist/{chunk-DD6ONEBN.cjs → chunk-LDM2AFKZ.cjs} +12 -12
- package/dist/{chunk-DD6ONEBN.cjs.map → chunk-LDM2AFKZ.cjs.map} +1 -1
- package/dist/{chunk-V7CS2MDB.cjs → chunk-LUARLSYT.cjs} +18 -18
- package/dist/chunk-LUARLSYT.cjs.map +1 -0
- package/dist/{chunk-NP4G4ZKM.js → chunk-M5SOQ7UV.js} +4 -4
- package/dist/{chunk-NP4G4ZKM.js.map → chunk-M5SOQ7UV.js.map} +1 -1
- package/dist/{chunk-CMHFS34N.cjs → chunk-NYDXJGA3.cjs} +16 -16
- package/dist/{chunk-CMHFS34N.cjs.map → chunk-NYDXJGA3.cjs.map} +1 -1
- package/dist/{chunk-WE5BKYNB.js → chunk-Q6PXIKRQ.js} +3 -3
- package/dist/chunk-Q6PXIKRQ.js.map +1 -0
- package/dist/{chunk-O5XPCJLF.js → chunk-SJ2QMDXY.js} +18 -3
- package/dist/chunk-SJ2QMDXY.js.map +1 -0
- package/dist/{chunk-XDTYTNYL.js → chunk-TGDFBLGS.js} +3 -3
- package/dist/{chunk-XDTYTNYL.js.map → chunk-TGDFBLGS.js.map} +1 -1
- package/dist/{chunk-F2BZSEFE.js → chunk-ZO2FRJ2U.js} +4 -4
- package/dist/{chunk-F2BZSEFE.js.map → chunk-ZO2FRJ2U.js.map} +1 -1
- package/dist/{chunk-4HARSV2G.js → chunk-ZQGOBVXZ.js} +43 -3
- package/dist/chunk-ZQGOBVXZ.js.map +1 -0
- package/dist/{index-Dkicw49A.d.ts → index-DyrR_d-H.d.cts} +9 -1
- package/dist/{index-Dkicw49A.d.cts → index-DyrR_d-H.d.ts} +9 -1
- package/dist/index.cjs +893 -218
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +687 -16
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.cjs +7 -7
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +2 -2
- package/dist/{manager-Jc5Btay9.d.cts → manager-0NysX4s6.d.cts} +1 -1
- package/dist/{manager-e9LXthrx.d.ts → manager-DFKe7ql3.d.ts} +1 -1
- package/dist/profiler/index.d.cts +3 -3
- package/dist/profiler/index.d.ts +3 -3
- package/dist/schema/index.cjs +22 -22
- package/dist/schema/index.d.cts +5 -5
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +4 -4
- package/dist/{store-nbBybLWP.d.cts → store-DhoA5uRc.d.cts} +93 -7
- package/dist/{store-DM3Tk3Pw.d.ts → store-SiovWEYA.d.ts} +93 -7
- package/dist/{types-Cdbi4hcx.d.ts → types-6EKrWTs9.d.ts} +14 -0
- package/dist/{types-DDP0MGBF.d.cts → types-BUy-pHKH.d.cts} +14 -0
- package/package.json +2 -2
- package/dist/chunk-4HARSV2G.js.map +0 -1
- package/dist/chunk-O5XPCJLF.js.map +0 -1
- package/dist/chunk-OYL2SGBD.cjs.map +0 -1
- package/dist/chunk-SFY2PPOY.cjs.map +0 -1
- package/dist/chunk-V7CS2MDB.cjs.map +0 -1
- package/dist/chunk-WE5BKYNB.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkK2ROKOK3_cjs = require('./chunk-K2ROKOK3.cjs');
|
|
4
|
+
var chunk44SXEVF4_cjs = require('./chunk-44SXEVF4.cjs');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
// src/ontology/types.ts
|
|
@@ -37,7 +37,7 @@ function validateProps(schema, props, context) {
|
|
|
37
37
|
}
|
|
38
38
|
const issues = zodIssuesToValidationIssues(result.error);
|
|
39
39
|
const location = buildLocationString(context);
|
|
40
|
-
throw new
|
|
40
|
+
throw new chunk44SXEVF4_cjs.ValidationError(
|
|
41
41
|
`Invalid ${context.entityType} props for ${location}: ${result.error.message}`,
|
|
42
42
|
{
|
|
43
43
|
entityType: context.entityType,
|
|
@@ -64,7 +64,7 @@ function validateEdgeProps(schema, props, context) {
|
|
|
64
64
|
function wrapZodError(error, context) {
|
|
65
65
|
const issues = zodIssuesToValidationIssues(error);
|
|
66
66
|
const location = buildLocationString(context);
|
|
67
|
-
return new
|
|
67
|
+
return new chunk44SXEVF4_cjs.ValidationError(
|
|
68
68
|
`Validation failed for ${context.entityType} ${location}: ${error.message}`,
|
|
69
69
|
{
|
|
70
70
|
entityType: context.entityType,
|
|
@@ -77,7 +77,7 @@ function wrapZodError(error, context) {
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
function createValidationError(message, issues, context) {
|
|
80
|
-
return new
|
|
80
|
+
return new chunk44SXEVF4_cjs.ValidationError(message, {
|
|
81
81
|
...context?.entityType !== void 0 && {
|
|
82
82
|
entityType: context.entityType
|
|
83
83
|
},
|
|
@@ -889,7 +889,7 @@ function serializeSchema(graph, version) {
|
|
|
889
889
|
return {
|
|
890
890
|
graphId: graph.id,
|
|
891
891
|
version,
|
|
892
|
-
generatedAt:
|
|
892
|
+
generatedAt: chunkK2ROKOK3_cjs.nowIso(),
|
|
893
893
|
nodes,
|
|
894
894
|
edges,
|
|
895
895
|
ontology,
|
|
@@ -901,7 +901,7 @@ function serializeSchema(graph, version) {
|
|
|
901
901
|
}
|
|
902
902
|
function serializeNodes(graph) {
|
|
903
903
|
const result = {};
|
|
904
|
-
for (const kindName of
|
|
904
|
+
for (const kindName of chunkK2ROKOK3_cjs.getNodeKinds(graph)) {
|
|
905
905
|
const registration = graph.nodes[kindName];
|
|
906
906
|
if (registration === void 0) continue;
|
|
907
907
|
result[kindName] = serializeNodeDef(registration);
|
|
@@ -964,7 +964,7 @@ function deserializeWherePredicate(serialized) {
|
|
|
964
964
|
}
|
|
965
965
|
function serializeEdges(graph) {
|
|
966
966
|
const result = {};
|
|
967
|
-
for (const kindName of
|
|
967
|
+
for (const kindName of chunkK2ROKOK3_cjs.getEdgeKinds(graph)) {
|
|
968
968
|
const registration = graph.edges[kindName];
|
|
969
969
|
if (registration === void 0) continue;
|
|
970
970
|
result[kindName] = serializeEdgeDef(registration);
|
|
@@ -1162,7 +1162,7 @@ async function ensureSchema(backend, graph, options) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
const actions = getMigrationActions(diff);
|
|
1164
1164
|
if (throwOnBreaking) {
|
|
1165
|
-
throw new
|
|
1165
|
+
throw new chunk44SXEVF4_cjs.MigrationError(
|
|
1166
1166
|
`Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.`,
|
|
1167
1167
|
{
|
|
1168
1168
|
graphId: graph.id,
|
|
@@ -1201,7 +1201,7 @@ async function migrateSchema(backend, graph, currentVersion) {
|
|
|
1201
1201
|
async function rollbackSchema(backend, graphId, targetVersion) {
|
|
1202
1202
|
const row = await backend.getSchemaVersion(graphId, targetVersion);
|
|
1203
1203
|
if (!row) {
|
|
1204
|
-
throw new
|
|
1204
|
+
throw new chunk44SXEVF4_cjs.MigrationError(
|
|
1205
1205
|
`Cannot rollback to version ${targetVersion}: version does not exist.`,
|
|
1206
1206
|
{ graphId, fromVersion: targetVersion, toVersion: targetVersion }
|
|
1207
1207
|
);
|
|
@@ -1260,5 +1260,5 @@ exports.validateEdgeProps = validateEdgeProps;
|
|
|
1260
1260
|
exports.validateNodeProps = validateNodeProps;
|
|
1261
1261
|
exports.validateProps = validateProps;
|
|
1262
1262
|
exports.wrapZodError = wrapZodError;
|
|
1263
|
-
//# sourceMappingURL=chunk-
|
|
1264
|
-
//# sourceMappingURL=chunk-
|
|
1263
|
+
//# sourceMappingURL=chunk-LDM2AFKZ.cjs.map
|
|
1264
|
+
//# sourceMappingURL=chunk-LDM2AFKZ.cjs.map
|