@nicia-ai/typegraph 0.14.0 → 0.16.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 (63) hide show
  1. package/dist/backend/postgres/index.cjs +32 -26
  2. package/dist/backend/postgres/index.cjs.map +1 -1
  3. package/dist/backend/postgres/index.d.cts +5 -5
  4. package/dist/backend/postgres/index.d.ts +5 -5
  5. package/dist/backend/postgres/index.js +14 -8
  6. package/dist/backend/postgres/index.js.map +1 -1
  7. package/dist/backend/sqlite/index.cjs +12 -12
  8. package/dist/backend/sqlite/index.d.cts +5 -5
  9. package/dist/backend/sqlite/index.d.ts +5 -5
  10. package/dist/backend/sqlite/index.js +2 -2
  11. package/dist/backend/sqlite/local.cjs +5 -5
  12. package/dist/backend/sqlite/local.cjs.map +1 -1
  13. package/dist/backend/sqlite/local.d.cts +3 -3
  14. package/dist/backend/sqlite/local.d.ts +3 -3
  15. package/dist/backend/sqlite/local.js +5 -5
  16. package/dist/backend/sqlite/local.js.map +1 -1
  17. package/dist/{chunk-QFZ5QB2J.cjs → chunk-3HQLOKS5.cjs} +25 -3
  18. package/dist/chunk-3HQLOKS5.cjs.map +1 -0
  19. package/dist/{chunk-OEKH5PWL.cjs → chunk-56RQFK7U.cjs} +22 -15
  20. package/dist/chunk-56RQFK7U.cjs.map +1 -0
  21. package/dist/{chunk-KE2BL3JZ.cjs → chunk-CRMN2NOM.cjs} +179 -179
  22. package/dist/chunk-CRMN2NOM.cjs.map +1 -0
  23. package/dist/{chunk-BNIBR5U2.js → chunk-HWWF3FOP.js} +91 -91
  24. package/dist/chunk-HWWF3FOP.js.map +1 -0
  25. package/dist/{chunk-KLOSTZDQ.js → chunk-L4ON6RJF.js} +25 -3
  26. package/dist/chunk-L4ON6RJF.js.map +1 -0
  27. package/dist/{chunk-RVUEBUBH.js → chunk-XZBAGJJH.js} +15 -8
  28. package/dist/chunk-XZBAGJJH.js.map +1 -0
  29. package/dist/{ddl-BJg93HDN.d.cts → ddl-BBo2EcFc.d.cts} +2 -2
  30. package/dist/{ddl-CsfWcl_B.d.ts → ddl-D4jlcOH_.d.ts} +2 -2
  31. package/dist/index.cjs +92 -74
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +6 -6
  34. package/dist/index.d.ts +6 -6
  35. package/dist/index.js +61 -43
  36. package/dist/index.js.map +1 -1
  37. package/dist/indexes/index.d.cts +2 -2
  38. package/dist/indexes/index.d.ts +2 -2
  39. package/dist/interchange/index.d.cts +3 -3
  40. package/dist/interchange/index.d.ts +3 -3
  41. package/dist/{manager-oh2mTMvy.d.cts → manager-Bj1UEnhE.d.cts} +2 -2
  42. package/dist/{manager-qRSdnKEO.d.ts → manager-Chhrq1vl.d.ts} +2 -2
  43. package/dist/profiler/index.d.cts +3 -3
  44. package/dist/profiler/index.d.ts +3 -3
  45. package/dist/schema/index.cjs +20 -20
  46. package/dist/schema/index.d.cts +4 -4
  47. package/dist/schema/index.d.ts +4 -4
  48. package/dist/schema/index.js +2 -2
  49. package/dist/{sqlite-DVca_IIy.d.cts → sqlite-Blq-AhmK.d.ts} +1 -1
  50. package/dist/{sqlite-H01wIXvB.d.ts → sqlite-DE-6NWtC.d.cts} +1 -1
  51. package/dist/{store-B9ItxA-Q.d.ts → store-Bitii3qj.d.ts} +85 -16
  52. package/dist/{store-BJPIoe8u.d.cts → store-gTd_qa6u.d.cts} +85 -16
  53. package/dist/{types-Ckfwgv9l.d.cts → types-B3mmOMJV.d.cts} +8 -0
  54. package/dist/{types-C8Ra3ROE.d.cts → types-CZd2PEOc.d.cts} +8 -2
  55. package/dist/{types-CC8eB0PB.d.ts → types-Ceb01czq.d.ts} +8 -2
  56. package/dist/{types-5t_MIcvv.d.ts → types-ThB4cFLp.d.ts} +8 -0
  57. package/package.json +3 -3
  58. package/dist/chunk-BNIBR5U2.js.map +0 -1
  59. package/dist/chunk-KE2BL3JZ.cjs.map +0 -1
  60. package/dist/chunk-KLOSTZDQ.js.map +0 -1
  61. package/dist/chunk-OEKH5PWL.cjs.map +0 -1
  62. package/dist/chunk-QFZ5QB2J.cjs.map +0 -1
  63. package/dist/chunk-RVUEBUBH.js.map +0 -1
@@ -99,7 +99,10 @@ type NonEmptyJsonPointerFor<T> = Exclude<JsonPointerFor<T>, "">;
99
99
  type NonEmptyJsonPointerSegmentsFor<T> = Exclude<JsonPointerSegmentsFor<T>, readonly []>;
100
100
  type IndexFieldInput<T> = (keyof T & string) | NonEmptyJsonPointerFor<T> | NonEmptyJsonPointerSegmentsFor<T> | JsonPointer;
101
101
  type NodeIndexConfig<N extends NodeType> = Readonly<{
102
- fields: readonly IndexFieldInput<z.infer<N["schema"]>>[];
102
+ fields: readonly [
103
+ IndexFieldInput<z.infer<N["schema"]>>,
104
+ ...IndexFieldInput<z.infer<N["schema"]>>[]
105
+ ];
103
106
  coveringFields?: readonly IndexFieldInput<z.infer<N["schema"]>>[] | undefined;
104
107
  unique?: boolean | undefined;
105
108
  name?: string | undefined;
@@ -108,7 +111,10 @@ type NodeIndexConfig<N extends NodeType> = Readonly<{
108
111
  }>;
109
112
  type EdgeIndexDirection = "out" | "in" | "none";
110
113
  type EdgeIndexConfig<E extends AnyEdgeType> = Readonly<{
111
- fields: readonly IndexFieldInput<z.infer<E["schema"]>>[];
114
+ fields: readonly [
115
+ IndexFieldInput<z.infer<E["schema"]>>,
116
+ ...IndexFieldInput<z.infer<E["schema"]>>[]
117
+ ];
112
118
  coveringFields?: readonly IndexFieldInput<z.infer<E["schema"]>>[] | undefined;
113
119
  unique?: boolean | undefined;
114
120
  name?: string | undefined;
@@ -99,7 +99,10 @@ type NonEmptyJsonPointerFor<T> = Exclude<JsonPointerFor<T>, "">;
99
99
  type NonEmptyJsonPointerSegmentsFor<T> = Exclude<JsonPointerSegmentsFor<T>, readonly []>;
100
100
  type IndexFieldInput<T> = (keyof T & string) | NonEmptyJsonPointerFor<T> | NonEmptyJsonPointerSegmentsFor<T> | JsonPointer;
101
101
  type NodeIndexConfig<N extends NodeType> = Readonly<{
102
- fields: readonly IndexFieldInput<z.infer<N["schema"]>>[];
102
+ fields: readonly [
103
+ IndexFieldInput<z.infer<N["schema"]>>,
104
+ ...IndexFieldInput<z.infer<N["schema"]>>[]
105
+ ];
103
106
  coveringFields?: readonly IndexFieldInput<z.infer<N["schema"]>>[] | undefined;
104
107
  unique?: boolean | undefined;
105
108
  name?: string | undefined;
@@ -108,7 +111,10 @@ type NodeIndexConfig<N extends NodeType> = Readonly<{
108
111
  }>;
109
112
  type EdgeIndexDirection = "out" | "in" | "none";
110
113
  type EdgeIndexConfig<E extends AnyEdgeType> = Readonly<{
111
- fields: readonly IndexFieldInput<z.infer<E["schema"]>>[];
114
+ fields: readonly [
115
+ IndexFieldInput<z.infer<E["schema"]>>,
116
+ ...IndexFieldInput<z.infer<E["schema"]>>[]
117
+ ];
112
118
  coveringFields?: readonly IndexFieldInput<z.infer<E["schema"]>>[] | undefined;
113
119
  unique?: boolean | undefined;
114
120
  name?: string | undefined;
@@ -593,6 +593,14 @@ type GraphBackend = Readonly<{
593
593
  * Intended for import-replacement workflows. No hooks, no per-row logic.
594
594
  */
595
595
  clearGraph: (graphId: string) => Promise<void>;
596
+ /**
597
+ * Creates the base TypeGraph tables if they don't already exist.
598
+ *
599
+ * Called automatically by `createStoreWithSchema()` when a fresh database
600
+ * is detected. Users who manage DDL themselves via `createStore()` never
601
+ * hit this path.
602
+ */
603
+ bootstrapTables?: () => Promise<void>;
596
604
  execute: <T>(query: SQL) => Promise<readonly T[]>;
597
605
  /** Execute pre-compiled SQL text with bound parameters. Available on sync SQLite and pg backends. */
598
606
  executeRaw?: <T>(sqlText: string, params: readonly unknown[]) => Promise<readonly T[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicia-ai/typegraph",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "TypeScript-first embedded knowledge graph library with ontological reasoning",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -142,11 +142,11 @@
142
142
  "@types/pg": "^8.20.0",
143
143
  "@vitest/coverage-v8": "^4.1.2",
144
144
  "better-sqlite3": "^12.8.0",
145
- "drizzle-orm": "^0.45.1",
145
+ "drizzle-orm": "^0.45.2",
146
146
  "eslint": "^10.1.0",
147
147
  "fast-check": "^4.6.0",
148
148
  "pg": "^8.20.0",
149
- "sqlite-vec": "^0.1.7",
149
+ "sqlite-vec": "^0.1.8",
150
150
  "tsd": "^0.33.0",
151
151
  "tsup": "^8.5.1",
152
152
  "typescript": "^5.9.3",