@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.
Files changed (75) hide show
  1. package/dist/backend/drizzle/index.cjs +6 -6
  2. package/dist/backend/drizzle/index.d.cts +1 -1
  3. package/dist/backend/drizzle/index.d.ts +1 -1
  4. package/dist/backend/drizzle/index.js +4 -4
  5. package/dist/backend/drizzle/postgres.cjs +4 -4
  6. package/dist/backend/drizzle/postgres.d.cts +2 -2
  7. package/dist/backend/drizzle/postgres.d.ts +2 -2
  8. package/dist/backend/drizzle/postgres.js +3 -3
  9. package/dist/backend/drizzle/sqlite.cjs +4 -4
  10. package/dist/backend/drizzle/sqlite.d.cts +1 -1
  11. package/dist/backend/drizzle/sqlite.d.ts +1 -1
  12. package/dist/backend/drizzle/sqlite.js +3 -3
  13. package/dist/backend/postgres/index.cjs +4 -4
  14. package/dist/backend/postgres/index.d.cts +1 -1
  15. package/dist/backend/postgres/index.d.ts +1 -1
  16. package/dist/backend/postgres/index.js +3 -3
  17. package/dist/backend/sqlite/index.cjs +6 -6
  18. package/dist/backend/sqlite/index.d.cts +1 -1
  19. package/dist/backend/sqlite/index.d.ts +1 -1
  20. package/dist/backend/sqlite/index.js +4 -4
  21. package/dist/{chunk-OYL2SGBD.cjs → chunk-44SXEVF4.cjs} +18 -2
  22. package/dist/chunk-44SXEVF4.cjs.map +1 -0
  23. package/dist/{chunk-SFY2PPOY.cjs → chunk-7RVSDXT3.cjs} +50 -10
  24. package/dist/chunk-7RVSDXT3.cjs.map +1 -0
  25. package/dist/{chunk-ZJHQZZT2.cjs → chunk-K2ROKOK3.cjs} +6 -6
  26. package/dist/{chunk-ZJHQZZT2.cjs.map → chunk-K2ROKOK3.cjs.map} +1 -1
  27. package/dist/{chunk-DD6ONEBN.cjs → chunk-LDM2AFKZ.cjs} +12 -12
  28. package/dist/{chunk-DD6ONEBN.cjs.map → chunk-LDM2AFKZ.cjs.map} +1 -1
  29. package/dist/{chunk-V7CS2MDB.cjs → chunk-LUARLSYT.cjs} +18 -18
  30. package/dist/chunk-LUARLSYT.cjs.map +1 -0
  31. package/dist/{chunk-NP4G4ZKM.js → chunk-M5SOQ7UV.js} +4 -4
  32. package/dist/{chunk-NP4G4ZKM.js.map → chunk-M5SOQ7UV.js.map} +1 -1
  33. package/dist/{chunk-CMHFS34N.cjs → chunk-NYDXJGA3.cjs} +16 -16
  34. package/dist/{chunk-CMHFS34N.cjs.map → chunk-NYDXJGA3.cjs.map} +1 -1
  35. package/dist/{chunk-WE5BKYNB.js → chunk-Q6PXIKRQ.js} +3 -3
  36. package/dist/chunk-Q6PXIKRQ.js.map +1 -0
  37. package/dist/{chunk-O5XPCJLF.js → chunk-SJ2QMDXY.js} +18 -3
  38. package/dist/chunk-SJ2QMDXY.js.map +1 -0
  39. package/dist/{chunk-XDTYTNYL.js → chunk-TGDFBLGS.js} +3 -3
  40. package/dist/{chunk-XDTYTNYL.js.map → chunk-TGDFBLGS.js.map} +1 -1
  41. package/dist/{chunk-F2BZSEFE.js → chunk-ZO2FRJ2U.js} +4 -4
  42. package/dist/{chunk-F2BZSEFE.js.map → chunk-ZO2FRJ2U.js.map} +1 -1
  43. package/dist/{chunk-4HARSV2G.js → chunk-ZQGOBVXZ.js} +43 -3
  44. package/dist/chunk-ZQGOBVXZ.js.map +1 -0
  45. package/dist/{index-Dkicw49A.d.ts → index-DyrR_d-H.d.cts} +9 -1
  46. package/dist/{index-Dkicw49A.d.cts → index-DyrR_d-H.d.ts} +9 -1
  47. package/dist/index.cjs +893 -218
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.cts +7 -7
  50. package/dist/index.d.ts +7 -7
  51. package/dist/index.js +687 -16
  52. package/dist/index.js.map +1 -1
  53. package/dist/interchange/index.cjs +7 -7
  54. package/dist/interchange/index.d.cts +3 -3
  55. package/dist/interchange/index.d.ts +3 -3
  56. package/dist/interchange/index.js +2 -2
  57. package/dist/{manager-Jc5Btay9.d.cts → manager-0NysX4s6.d.cts} +1 -1
  58. package/dist/{manager-e9LXthrx.d.ts → manager-DFKe7ql3.d.ts} +1 -1
  59. package/dist/profiler/index.d.cts +3 -3
  60. package/dist/profiler/index.d.ts +3 -3
  61. package/dist/schema/index.cjs +22 -22
  62. package/dist/schema/index.d.cts +5 -5
  63. package/dist/schema/index.d.ts +5 -5
  64. package/dist/schema/index.js +4 -4
  65. package/dist/{store-nbBybLWP.d.cts → store-DhoA5uRc.d.cts} +93 -7
  66. package/dist/{store-DM3Tk3Pw.d.ts → store-SiovWEYA.d.ts} +93 -7
  67. package/dist/{types-Cdbi4hcx.d.ts → types-6EKrWTs9.d.ts} +14 -0
  68. package/dist/{types-DDP0MGBF.d.cts → types-BUy-pHKH.d.cts} +14 -0
  69. package/package.json +2 -2
  70. package/dist/chunk-4HARSV2G.js.map +0 -1
  71. package/dist/chunk-O5XPCJLF.js.map +0 -1
  72. package/dist/chunk-OYL2SGBD.cjs.map +0 -1
  73. package/dist/chunk-SFY2PPOY.cjs.map +0 -1
  74. package/dist/chunk-V7CS2MDB.cjs.map +0 -1
  75. package/dist/chunk-WE5BKYNB.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkZJHQZZT2_cjs = require('./chunk-ZJHQZZT2.cjs');
4
- var chunkOYL2SGBD_cjs = require('./chunk-OYL2SGBD.cjs');
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 chunkOYL2SGBD_cjs.ValidationError(
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 chunkOYL2SGBD_cjs.ValidationError(
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 chunkOYL2SGBD_cjs.ValidationError(message, {
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: chunkZJHQZZT2_cjs.nowIso(),
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 chunkZJHQZZT2_cjs.getNodeKinds(graph)) {
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 chunkZJHQZZT2_cjs.getEdgeKinds(graph)) {
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 chunkOYL2SGBD_cjs.MigrationError(
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 chunkOYL2SGBD_cjs.MigrationError(
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-DD6ONEBN.cjs.map
1264
- //# sourceMappingURL=chunk-DD6ONEBN.cjs.map
1263
+ //# sourceMappingURL=chunk-LDM2AFKZ.cjs.map
1264
+ //# sourceMappingURL=chunk-LDM2AFKZ.cjs.map