@nicia-ai/typegraph 0.10.0 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { G as GraphDef } from '../manager-DGSnJa1v.cjs';
3
- import { L as Store } from '../store-NE18RGqV.cjs';
3
+ import { L as Store } from '../store-C01_WsOg.cjs';
4
4
  import '../types-DMzKq0d5.cjs';
5
5
  import '../types-GLkwvQvS.cjs';
6
6
  import 'drizzle-orm';
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { G as GraphDef } from '../manager-BCLhWysp.js';
3
- import { L as Store } from '../store-BcFe9jJe.js';
3
+ import { L as Store } from '../store-Cy6gSNqg.js';
4
4
  import '../types-DMzKq0d5.js';
5
5
  import '../types-1YJKodRv.js';
6
6
  import 'drizzle-orm';
@@ -1,6 +1,6 @@
1
1
  import { G as GraphDef } from '../manager-DGSnJa1v.cjs';
2
2
  import { Q as QueryAst } from '../ast-Bh2NDeaK.cjs';
3
- import { L as Store } from '../store-NE18RGqV.cjs';
3
+ import { L as Store } from '../store-C01_WsOg.cjs';
4
4
  import { P as ProfilerOptions, a as ProfileReport } from '../types-CVtGFpB9.cjs';
5
5
  export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-CVtGFpB9.cjs';
6
6
  import '../types-DMzKq0d5.cjs';
@@ -1,6 +1,6 @@
1
1
  import { G as GraphDef } from '../manager-BCLhWysp.js';
2
2
  import { Q as QueryAst } from '../ast-COMyNeMn.js';
3
- import { L as Store } from '../store-BcFe9jJe.js';
3
+ import { L as Store } from '../store-Cy6gSNqg.js';
4
4
  import { P as ProfilerOptions, a as ProfileReport } from '../types-COPePE8_.js';
5
5
  export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-COPePE8_.js';
6
6
  import '../types-DMzKq0d5.js';
@@ -340,6 +340,10 @@ type BaseFieldAccessor = Readonly<{
340
340
  notIn: (values: readonly unknown[]) => Predicate;
341
341
  }>;
342
342
  type StringFieldAccessor = BaseFieldAccessor & Readonly<{
343
+ gt: (value: string | ParameterRef) => Predicate;
344
+ gte: (value: string | ParameterRef) => Predicate;
345
+ lt: (value: string | ParameterRef) => Predicate;
346
+ lte: (value: string | ParameterRef) => Predicate;
343
347
  contains: (pattern: string | ParameterRef) => Predicate;
344
348
  startsWith: (pattern: string | ParameterRef) => Predicate;
345
349
  endsWith: (pattern: string | ParameterRef) => Predicate;
@@ -877,6 +881,18 @@ type NodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
877
881
  }>) => Promise<Node<N>[]>;
878
882
  /** Count nodes matching criteria */
879
883
  count: (options?: QueryOptions) => Promise<number>;
884
+ /**
885
+ * Create a node from untyped data, relying on runtime Zod validation.
886
+ *
887
+ * Use this for dynamic dispatch (changesets, migrations, imports) where
888
+ * the data shape is determined at runtime, not compile time.
889
+ * The return type is fully typed — only the input gate is relaxed.
890
+ */
891
+ createFromRecord: (data: Record<string, unknown>, options?: Readonly<{
892
+ id?: string;
893
+ validFrom?: string;
894
+ validTo?: string;
895
+ }>) => Promise<Node<N>>;
880
896
  /**
881
897
  * Create or update a node.
882
898
  *
@@ -887,6 +903,17 @@ type NodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
887
903
  validFrom?: string;
888
904
  validTo?: string;
889
905
  }>) => Promise<Node<N>>;
906
+ /**
907
+ * Upsert a node from untyped data, relying on runtime Zod validation.
908
+ *
909
+ * Use this for dynamic dispatch (changesets, migrations, imports) where
910
+ * the data shape is determined at runtime, not compile time.
911
+ * The return type is fully typed — only the input gate is relaxed.
912
+ */
913
+ upsertByIdFromRecord: (id: string, data: Record<string, unknown>, options?: Readonly<{
914
+ validFrom?: string;
915
+ validTo?: string;
916
+ }>) => Promise<Node<N>>;
890
917
  /**
891
918
  * Create multiple nodes in a batch.
892
919
  *
@@ -340,6 +340,10 @@ type BaseFieldAccessor = Readonly<{
340
340
  notIn: (values: readonly unknown[]) => Predicate;
341
341
  }>;
342
342
  type StringFieldAccessor = BaseFieldAccessor & Readonly<{
343
+ gt: (value: string | ParameterRef) => Predicate;
344
+ gte: (value: string | ParameterRef) => Predicate;
345
+ lt: (value: string | ParameterRef) => Predicate;
346
+ lte: (value: string | ParameterRef) => Predicate;
343
347
  contains: (pattern: string | ParameterRef) => Predicate;
344
348
  startsWith: (pattern: string | ParameterRef) => Predicate;
345
349
  endsWith: (pattern: string | ParameterRef) => Predicate;
@@ -877,6 +881,18 @@ type NodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
877
881
  }>) => Promise<Node<N>[]>;
878
882
  /** Count nodes matching criteria */
879
883
  count: (options?: QueryOptions) => Promise<number>;
884
+ /**
885
+ * Create a node from untyped data, relying on runtime Zod validation.
886
+ *
887
+ * Use this for dynamic dispatch (changesets, migrations, imports) where
888
+ * the data shape is determined at runtime, not compile time.
889
+ * The return type is fully typed — only the input gate is relaxed.
890
+ */
891
+ createFromRecord: (data: Record<string, unknown>, options?: Readonly<{
892
+ id?: string;
893
+ validFrom?: string;
894
+ validTo?: string;
895
+ }>) => Promise<Node<N>>;
880
896
  /**
881
897
  * Create or update a node.
882
898
  *
@@ -887,6 +903,17 @@ type NodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
887
903
  validFrom?: string;
888
904
  validTo?: string;
889
905
  }>) => Promise<Node<N>>;
906
+ /**
907
+ * Upsert a node from untyped data, relying on runtime Zod validation.
908
+ *
909
+ * Use this for dynamic dispatch (changesets, migrations, imports) where
910
+ * the data shape is determined at runtime, not compile time.
911
+ * The return type is fully typed — only the input gate is relaxed.
912
+ */
913
+ upsertByIdFromRecord: (id: string, data: Record<string, unknown>, options?: Readonly<{
914
+ validFrom?: string;
915
+ validTo?: string;
916
+ }>) => Promise<Node<N>>;
890
917
  /**
891
918
  * Create multiple nodes in a batch.
892
919
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicia-ai/typegraph",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "TypeScript-first embedded knowledge graph library with ontological reasoning",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",