@getzep/zep-cloud 2.12.3 → 2.13.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 (78) hide show
  1. package/api/resources/document/client/Client.js +13 -13
  2. package/api/resources/graph/client/Client.js +6 -6
  3. package/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  4. package/api/resources/graph/resources/edge/client/Client.js +4 -4
  5. package/api/resources/graph/resources/episode/client/Client.js +5 -5
  6. package/api/resources/graph/resources/node/client/Client.js +5 -5
  7. package/api/resources/group/client/Client.js +6 -6
  8. package/api/resources/memory/client/Client.js +22 -22
  9. package/api/resources/user/client/Client.js +8 -8
  10. package/api/types/EdgeType.d.ts +10 -0
  11. package/api/types/EdgeType.js +5 -0
  12. package/api/types/EntityEdge.d.ts +2 -0
  13. package/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  14. package/api/types/EntityEdgeSourceTarget.js +5 -0
  15. package/api/types/EntityTypeResponse.d.ts +1 -0
  16. package/api/types/SearchFilters.d.ts +2 -0
  17. package/api/types/index.d.ts +2 -0
  18. package/api/types/index.js +2 -0
  19. package/dist/api/resources/document/client/Client.js +13 -13
  20. package/dist/api/resources/graph/client/Client.js +6 -6
  21. package/dist/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  22. package/dist/api/resources/graph/resources/edge/client/Client.js +4 -4
  23. package/dist/api/resources/graph/resources/episode/client/Client.js +5 -5
  24. package/dist/api/resources/graph/resources/node/client/Client.js +5 -5
  25. package/dist/api/resources/group/client/Client.js +6 -6
  26. package/dist/api/resources/memory/client/Client.js +22 -22
  27. package/dist/api/resources/user/client/Client.js +8 -8
  28. package/dist/api/types/EdgeType.d.ts +10 -0
  29. package/dist/api/types/EdgeType.js +5 -0
  30. package/dist/api/types/EntityEdge.d.ts +2 -0
  31. package/dist/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  32. package/dist/api/types/EntityEdgeSourceTarget.js +5 -0
  33. package/dist/api/types/EntityTypeResponse.d.ts +1 -0
  34. package/dist/api/types/SearchFilters.d.ts +2 -0
  35. package/dist/api/types/index.d.ts +2 -0
  36. package/dist/api/types/index.js +2 -0
  37. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  38. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  39. package/dist/serialization/types/EdgeType.d.ts +17 -0
  40. package/dist/serialization/types/EdgeType.js +48 -0
  41. package/dist/serialization/types/EntityEdge.d.ts +1 -0
  42. package/dist/serialization/types/EntityEdge.js +1 -0
  43. package/dist/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  44. package/dist/serialization/types/EntityEdgeSourceTarget.js +44 -0
  45. package/dist/serialization/types/EntityTypeResponse.d.ts +2 -0
  46. package/dist/serialization/types/EntityTypeResponse.js +2 -0
  47. package/dist/serialization/types/SearchFilters.d.ts +1 -0
  48. package/dist/serialization/types/SearchFilters.js +1 -0
  49. package/dist/serialization/types/index.d.ts +2 -0
  50. package/dist/serialization/types/index.js +2 -0
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/dist/wrapper/graph.d.ts +40 -2
  54. package/dist/wrapper/graph.js +45 -3
  55. package/dist/wrapper/ontology.d.ts +124 -0
  56. package/dist/wrapper/ontology.js +21 -1
  57. package/examples/graph/entity_type_example.ts +24 -20
  58. package/package.json +1 -1
  59. package/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  60. package/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  61. package/serialization/types/EdgeType.d.ts +17 -0
  62. package/serialization/types/EdgeType.js +48 -0
  63. package/serialization/types/EntityEdge.d.ts +1 -0
  64. package/serialization/types/EntityEdge.js +1 -0
  65. package/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  66. package/serialization/types/EntityEdgeSourceTarget.js +44 -0
  67. package/serialization/types/EntityTypeResponse.d.ts +2 -0
  68. package/serialization/types/EntityTypeResponse.js +2 -0
  69. package/serialization/types/SearchFilters.d.ts +1 -0
  70. package/serialization/types/SearchFilters.js +1 -0
  71. package/serialization/types/index.d.ts +2 -0
  72. package/serialization/types/index.js +2 -0
  73. package/version.d.ts +1 -1
  74. package/version.js +1 -1
  75. package/wrapper/graph.d.ts +40 -2
  76. package/wrapper/graph.js +45 -3
  77. package/wrapper/ontology.d.ts +124 -0
  78. package/wrapper/ontology.js +21 -1
@@ -297,12 +297,135 @@ export declare const EntityTypeSchema: z.ZodObject<{
297
297
  }>;
298
298
  description?: string | undefined;
299
299
  }>;
300
+ export declare const EdgeTypeSchema: z.ZodObject<z.objectUtil.extendShape<{
301
+ description: z.ZodDefault<z.ZodString>;
302
+ fields: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
303
+ type: z.ZodNativeEnum<typeof EntityPropertyType>;
304
+ description: z.ZodString;
305
+ }, {
306
+ type: z.ZodLiteral<EntityPropertyType.Text>;
307
+ value: z.ZodOptional<z.ZodString>;
308
+ }>, "strip", z.ZodTypeAny, {
309
+ type: EntityPropertyType.Text;
310
+ description: string;
311
+ value?: string | undefined;
312
+ }, {
313
+ type: EntityPropertyType.Text;
314
+ description: string;
315
+ value?: string | undefined;
316
+ }>, z.ZodObject<z.objectUtil.extendShape<{
317
+ type: z.ZodNativeEnum<typeof EntityPropertyType>;
318
+ description: z.ZodString;
319
+ }, {
320
+ type: z.ZodLiteral<EntityPropertyType.Int>;
321
+ value: z.ZodOptional<z.ZodNumber>;
322
+ }>, "strip", z.ZodTypeAny, {
323
+ type: EntityPropertyType.Int;
324
+ description: string;
325
+ value?: number | undefined;
326
+ }, {
327
+ type: EntityPropertyType.Int;
328
+ description: string;
329
+ value?: number | undefined;
330
+ }>, z.ZodObject<z.objectUtil.extendShape<{
331
+ type: z.ZodNativeEnum<typeof EntityPropertyType>;
332
+ description: z.ZodString;
333
+ }, {
334
+ type: z.ZodLiteral<EntityPropertyType.Float>;
335
+ value: z.ZodOptional<z.ZodNumber>;
336
+ }>, "strip", z.ZodTypeAny, {
337
+ type: EntityPropertyType.Float;
338
+ description: string;
339
+ value?: number | undefined;
340
+ }, {
341
+ type: EntityPropertyType.Float;
342
+ description: string;
343
+ value?: number | undefined;
344
+ }>, z.ZodObject<z.objectUtil.extendShape<{
345
+ type: z.ZodNativeEnum<typeof EntityPropertyType>;
346
+ description: z.ZodString;
347
+ }, {
348
+ type: z.ZodLiteral<EntityPropertyType.Boolean>;
349
+ value: z.ZodOptional<z.ZodBoolean>;
350
+ }>, "strip", z.ZodTypeAny, {
351
+ type: EntityPropertyType.Boolean;
352
+ description: string;
353
+ value?: boolean | undefined;
354
+ }, {
355
+ type: EntityPropertyType.Boolean;
356
+ description: string;
357
+ value?: boolean | undefined;
358
+ }>]>>;
359
+ }, {
360
+ sourceTargets: z.ZodOptional<z.ZodArray<z.ZodObject<{
361
+ source: z.ZodOptional<z.ZodString>;
362
+ target: z.ZodOptional<z.ZodString>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ source?: string | undefined;
365
+ target?: string | undefined;
366
+ }, {
367
+ source?: string | undefined;
368
+ target?: string | undefined;
369
+ }>, "many">>;
370
+ }>, "strip", z.ZodTypeAny, {
371
+ description: string;
372
+ fields: Record<string, {
373
+ type: EntityPropertyType.Text;
374
+ description: string;
375
+ value?: string | undefined;
376
+ } | {
377
+ type: EntityPropertyType.Int;
378
+ description: string;
379
+ value?: number | undefined;
380
+ } | {
381
+ type: EntityPropertyType.Float;
382
+ description: string;
383
+ value?: number | undefined;
384
+ } | {
385
+ type: EntityPropertyType.Boolean;
386
+ description: string;
387
+ value?: boolean | undefined;
388
+ }>;
389
+ sourceTargets?: {
390
+ source?: string | undefined;
391
+ target?: string | undefined;
392
+ }[] | undefined;
393
+ }, {
394
+ fields: Record<string, {
395
+ type: EntityPropertyType.Text;
396
+ description: string;
397
+ value?: string | undefined;
398
+ } | {
399
+ type: EntityPropertyType.Int;
400
+ description: string;
401
+ value?: number | undefined;
402
+ } | {
403
+ type: EntityPropertyType.Float;
404
+ description: string;
405
+ value?: number | undefined;
406
+ } | {
407
+ type: EntityPropertyType.Boolean;
408
+ description: string;
409
+ value?: boolean | undefined;
410
+ }>;
411
+ description?: string | undefined;
412
+ sourceTargets?: {
413
+ source?: string | undefined;
414
+ target?: string | undefined;
415
+ }[] | undefined;
416
+ }>;
300
417
  export type EntityType = z.infer<typeof EntityTypeSchema>;
418
+ export type EdgeType = z.infer<typeof EdgeTypeSchema>;
301
419
  export type EntityData<T extends EntityType> = {
302
420
  [P in keyof T["fields"]]: T["fields"][P] extends {
303
421
  value?: infer V;
304
422
  } ? V : never;
305
423
  };
424
+ export type EdgeData<T extends EdgeType> = {
425
+ [P in keyof T["fields"]]: T["fields"][P] extends {
426
+ value?: infer V;
427
+ } ? V : never;
428
+ };
306
429
  export declare const entityFields: {
307
430
  text: (description: string) => EntityTextField;
308
431
  integer: (description: string) => EntityIntField;
@@ -310,3 +433,4 @@ export declare const entityFields: {
310
433
  boolean: (description: string) => EntityBooleanField;
311
434
  };
312
435
  export declare function entityModelToAPISchema(entityType: EntityType, name: string): Zep.EntityType;
436
+ export declare function edgeModelToAPISchema(entityType: EdgeType, name: string): Zep.EdgeType;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.entityFields = exports.EntityTypeSchema = exports.EntityFields = exports.EntityTypeFieldSchema = exports.EntityTypeBooleanFieldSchema = exports.EntityTypeFloatFieldSchema = exports.EntityTypeIntFieldSchema = exports.EntityTypeTextFieldSchema = exports.EntityTypeBaseField = exports.EntityPropertyType = void 0;
3
+ exports.entityFields = exports.EdgeTypeSchema = exports.EntityTypeSchema = exports.EntityFields = exports.EntityTypeFieldSchema = exports.EntityTypeBooleanFieldSchema = exports.EntityTypeFloatFieldSchema = exports.EntityTypeIntFieldSchema = exports.EntityTypeTextFieldSchema = exports.EntityTypeBaseField = exports.EntityPropertyType = void 0;
4
4
  exports.entityModelToAPISchema = entityModelToAPISchema;
5
+ exports.edgeModelToAPISchema = edgeModelToAPISchema;
5
6
  const zod_1 = require("zod");
6
7
  var EntityPropertyType;
7
8
  (function (EntityPropertyType) {
@@ -41,6 +42,13 @@ exports.EntityTypeSchema = zod_1.z.object({
41
42
  description: zod_1.z.string().default(""),
42
43
  fields: zod_1.z.record(exports.EntityTypeFieldSchema),
43
44
  });
45
+ const EdgeSourceTarget = zod_1.z.object({
46
+ source: zod_1.z.string().optional(),
47
+ target: zod_1.z.string().optional(),
48
+ });
49
+ exports.EdgeTypeSchema = exports.EntityTypeSchema.extend({
50
+ sourceTargets: zod_1.z.array(EdgeSourceTarget).optional(),
51
+ });
44
52
  exports.entityFields = {
45
53
  text: (description) => {
46
54
  return exports.EntityTypeTextFieldSchema.parse({
@@ -78,3 +86,15 @@ function entityModelToAPISchema(entityType, name) {
78
86
  })),
79
87
  };
80
88
  }
89
+ function edgeModelToAPISchema(entityType, name) {
90
+ return {
91
+ name,
92
+ description: entityType.description,
93
+ sourceTargets: entityType.sourceTargets,
94
+ properties: Object.entries(entityType.fields).map(([fieldName, fieldDef]) => ({
95
+ name: fieldName,
96
+ type: fieldDef.type,
97
+ description: fieldDef.description,
98
+ })),
99
+ };
100
+ }