@getzep/zep-cloud 2.12.2 → 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 (81) hide show
  1. package/api/resources/document/client/Client.js +13 -13
  2. package/api/resources/graph/client/Client.d.ts +2 -2
  3. package/api/resources/graph/client/Client.js +8 -8
  4. package/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  5. package/api/resources/graph/resources/edge/client/Client.js +4 -4
  6. package/api/resources/graph/resources/episode/client/Client.js +5 -5
  7. package/api/resources/graph/resources/node/client/Client.js +5 -5
  8. package/api/resources/group/client/Client.js +6 -6
  9. package/api/resources/memory/client/Client.js +22 -22
  10. package/api/resources/user/client/Client.js +8 -8
  11. package/api/types/EdgeType.d.ts +10 -0
  12. package/api/types/EdgeType.js +5 -0
  13. package/api/types/EntityEdge.d.ts +2 -0
  14. package/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  15. package/api/types/EntityEdgeSourceTarget.js +5 -0
  16. package/api/types/EntityTypeResponse.d.ts +1 -0
  17. package/api/types/SearchFilters.d.ts +2 -0
  18. package/api/types/index.d.ts +2 -0
  19. package/api/types/index.js +2 -0
  20. package/dist/api/resources/document/client/Client.js +13 -13
  21. package/dist/api/resources/graph/client/Client.d.ts +2 -2
  22. package/dist/api/resources/graph/client/Client.js +8 -8
  23. package/dist/api/resources/graph/client/requests/EntityTypeRequest.d.ts +1 -0
  24. package/dist/api/resources/graph/resources/edge/client/Client.js +4 -4
  25. package/dist/api/resources/graph/resources/episode/client/Client.js +5 -5
  26. package/dist/api/resources/graph/resources/node/client/Client.js +5 -5
  27. package/dist/api/resources/group/client/Client.js +6 -6
  28. package/dist/api/resources/memory/client/Client.js +22 -22
  29. package/dist/api/resources/user/client/Client.js +8 -8
  30. package/dist/api/types/EdgeType.d.ts +10 -0
  31. package/dist/api/types/EdgeType.js +5 -0
  32. package/dist/api/types/EntityEdge.d.ts +2 -0
  33. package/dist/api/types/EntityEdgeSourceTarget.d.ts +9 -0
  34. package/dist/api/types/EntityEdgeSourceTarget.js +5 -0
  35. package/dist/api/types/EntityTypeResponse.d.ts +1 -0
  36. package/dist/api/types/SearchFilters.d.ts +2 -0
  37. package/dist/api/types/index.d.ts +2 -0
  38. package/dist/api/types/index.js +2 -0
  39. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  40. package/dist/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  41. package/dist/serialization/types/EdgeType.d.ts +17 -0
  42. package/dist/serialization/types/EdgeType.js +48 -0
  43. package/dist/serialization/types/EntityEdge.d.ts +1 -0
  44. package/dist/serialization/types/EntityEdge.js +1 -0
  45. package/dist/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  46. package/dist/serialization/types/EntityEdgeSourceTarget.js +44 -0
  47. package/dist/serialization/types/EntityTypeResponse.d.ts +2 -0
  48. package/dist/serialization/types/EntityTypeResponse.js +2 -0
  49. package/dist/serialization/types/SearchFilters.d.ts +1 -0
  50. package/dist/serialization/types/SearchFilters.js +1 -0
  51. package/dist/serialization/types/index.d.ts +2 -0
  52. package/dist/serialization/types/index.js +2 -0
  53. package/dist/version.d.ts +1 -1
  54. package/dist/version.js +1 -1
  55. package/dist/wrapper/graph.d.ts +40 -2
  56. package/dist/wrapper/graph.js +45 -3
  57. package/dist/wrapper/ontology.d.ts +124 -0
  58. package/dist/wrapper/ontology.js +21 -1
  59. package/examples/graph/entity_type_example.ts +24 -20
  60. package/package.json +1 -1
  61. package/reference.md +2 -2
  62. package/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
  63. package/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
  64. package/serialization/types/EdgeType.d.ts +17 -0
  65. package/serialization/types/EdgeType.js +48 -0
  66. package/serialization/types/EntityEdge.d.ts +1 -0
  67. package/serialization/types/EntityEdge.js +1 -0
  68. package/serialization/types/EntityEdgeSourceTarget.d.ts +13 -0
  69. package/serialization/types/EntityEdgeSourceTarget.js +44 -0
  70. package/serialization/types/EntityTypeResponse.d.ts +2 -0
  71. package/serialization/types/EntityTypeResponse.js +2 -0
  72. package/serialization/types/SearchFilters.d.ts +1 -0
  73. package/serialization/types/SearchFilters.js +1 -0
  74. package/serialization/types/index.d.ts +2 -0
  75. package/serialization/types/index.js +2 -0
  76. package/version.d.ts +1 -1
  77. package/version.js +1 -1
  78. package/wrapper/graph.d.ts +40 -2
  79. package/wrapper/graph.js +45 -3
  80. package/wrapper/ontology.d.ts +124 -0
  81. package/wrapper/ontology.js +21 -1
@@ -79,7 +79,7 @@ class User {
79
79
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
80
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "users"),
81
81
  method: "POST",
82
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  body: serializers.CreateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -162,7 +162,7 @@ class User {
162
162
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
163
163
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "users-ordered"),
164
164
  method: "GET",
165
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
166
166
  contentType: "application/json",
167
167
  queryParameters: _queryParams,
168
168
  requestType: "json",
@@ -237,7 +237,7 @@ class User {
237
237
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
238
238
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
239
239
  method: "GET",
240
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
240
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
241
241
  contentType: "application/json",
242
242
  requestType: "json",
243
243
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -311,7 +311,7 @@ class User {
311
311
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
312
312
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
313
313
  method: "DELETE",
314
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
314
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
315
315
  contentType: "application/json",
316
316
  requestType: "json",
317
317
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -387,7 +387,7 @@ class User {
387
387
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
388
388
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}`),
389
389
  method: "PATCH",
390
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
390
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
391
391
  contentType: "application/json",
392
392
  requestType: "json",
393
393
  body: serializers.UpdateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -470,7 +470,7 @@ class User {
470
470
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
471
471
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/facts`),
472
472
  method: "GET",
473
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
473
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
474
474
  contentType: "application/json",
475
475
  requestType: "json",
476
476
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -544,7 +544,7 @@ class User {
544
544
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
545
545
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/node`),
546
546
  method: "GET",
547
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
547
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
548
548
  contentType: "application/json",
549
549
  requestType: "json",
550
550
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -617,7 +617,7 @@ class User {
617
617
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
618
618
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `users/${encodeURIComponent(userId)}/sessions`),
619
619
  method: "GET",
620
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.12.2", "User-Agent": "zep-cloud/2.12.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
620
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.13.0", "User-Agent": "zep-cloud/2.13.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
621
621
  contentType: "application/json",
622
622
  requestType: "json",
623
623
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Zep from "../index";
5
+ export interface EdgeType {
6
+ description: string;
7
+ name: string;
8
+ properties?: Zep.EntityProperty[];
9
+ sourceTargets?: Zep.EntityEdgeSourceTarget[];
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface EntityEdge {
5
+ /** Additional attributes of the edge. Dependent on edge types */
6
+ attributes?: Record<string, unknown>;
5
7
  /** Creation time of the edge */
6
8
  createdAt: string;
7
9
  /** List of episode ids that reference these entity edges */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface EntityEdgeSourceTarget {
5
+ /** Source represents the originating node identifier in the edge type relationship. (optional) */
6
+ source?: string;
7
+ /** Target represents the target node identifier in the edge type relationship. (optional) */
8
+ target?: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,5 +3,6 @@
3
3
  */
4
4
  import * as Zep from "../index";
5
5
  export interface EntityTypeResponse {
6
+ edgeTypes?: Zep.EdgeType[];
6
7
  entityTypes?: Zep.EntityType[];
7
8
  }
@@ -2,6 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  export interface SearchFilters {
5
+ /** List of edge types to filter on */
6
+ edgeTypes?: string[];
5
7
  /** List of node labels to filter on */
6
8
  nodeLabels?: string[];
7
9
  }
@@ -4,8 +4,10 @@ export * from "./ApidataDocument";
4
4
  export * from "./ApidataDocumentCollection";
5
5
  export * from "./ApidataDocumentSearchResponse";
6
6
  export * from "./ApidataDocumentWithScore";
7
+ export * from "./EdgeType";
7
8
  export * from "./EndSessionResponse";
8
9
  export * from "./EndSessionsResponse";
10
+ export * from "./EntityEdgeSourceTarget";
9
11
  export * from "./EntityProperty";
10
12
  export * from "./EntityType";
11
13
  export * from "./EntityTypeResponse";
@@ -20,8 +20,10 @@ __exportStar(require("./ApidataDocument"), exports);
20
20
  __exportStar(require("./ApidataDocumentCollection"), exports);
21
21
  __exportStar(require("./ApidataDocumentSearchResponse"), exports);
22
22
  __exportStar(require("./ApidataDocumentWithScore"), exports);
23
+ __exportStar(require("./EdgeType"), exports);
23
24
  __exportStar(require("./EndSessionResponse"), exports);
24
25
  __exportStar(require("./EndSessionsResponse"), exports);
26
+ __exportStar(require("./EntityEdgeSourceTarget"), exports);
25
27
  __exportStar(require("./EntityProperty"), exports);
26
28
  __exportStar(require("./EntityType"), exports);
27
29
  __exportStar(require("./EntityTypeResponse"), exports);
@@ -4,10 +4,12 @@
4
4
  import * as serializers from "../../../../index";
5
5
  import * as Zep from "../../../../../api/index";
6
6
  import * as core from "../../../../../core";
7
+ import { EdgeType } from "../../../../types/EdgeType";
7
8
  import { EntityType } from "../../../../types/EntityType";
8
9
  export declare const EntityTypeRequest: core.serialization.Schema<serializers.EntityTypeRequest.Raw, Zep.EntityTypeRequest>;
9
10
  export declare namespace EntityTypeRequest {
10
11
  interface Raw {
12
+ edge_types?: EdgeType.Raw[] | null;
11
13
  entity_types?: EntityType.Raw[] | null;
12
14
  }
13
15
  }
@@ -38,7 +38,9 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityTypeRequest = void 0;
40
40
  const core = __importStar(require("../../../../../core"));
41
+ const EdgeType_1 = require("../../../../types/EdgeType");
41
42
  const EntityType_1 = require("../../../../types/EntityType");
42
43
  exports.EntityTypeRequest = core.serialization.object({
44
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType_1.EdgeType).optional()),
43
45
  entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType_1.EntityType).optional()),
44
46
  });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Zep from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { EntityProperty } from "./EntityProperty";
8
+ import { EntityEdgeSourceTarget } from "./EntityEdgeSourceTarget";
9
+ export declare const EdgeType: core.serialization.ObjectSchema<serializers.EdgeType.Raw, Zep.EdgeType>;
10
+ export declare namespace EdgeType {
11
+ interface Raw {
12
+ description: string;
13
+ name: string;
14
+ properties?: EntityProperty.Raw[] | null;
15
+ source_targets?: EntityEdgeSourceTarget.Raw[] | null;
16
+ }
17
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EdgeType = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ const EntityProperty_1 = require("./EntityProperty");
42
+ const EntityEdgeSourceTarget_1 = require("./EntityEdgeSourceTarget");
43
+ exports.EdgeType = core.serialization.object({
44
+ description: core.serialization.string(),
45
+ name: core.serialization.string(),
46
+ properties: core.serialization.list(EntityProperty_1.EntityProperty).optional(),
47
+ sourceTargets: core.serialization.property("source_targets", core.serialization.list(EntityEdgeSourceTarget_1.EntityEdgeSourceTarget).optional()),
48
+ });
@@ -7,6 +7,7 @@ import * as core from "../../core";
7
7
  export declare const EntityEdge: core.serialization.ObjectSchema<serializers.EntityEdge.Raw, Zep.EntityEdge>;
8
8
  export declare namespace EntityEdge {
9
9
  interface Raw {
10
+ attributes?: Record<string, unknown> | null;
10
11
  created_at: string;
11
12
  episodes?: string[] | null;
12
13
  expired_at?: string | null;
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityEdge = void 0;
40
40
  const core = __importStar(require("../../core"));
41
41
  exports.EntityEdge = core.serialization.object({
42
+ attributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
42
43
  createdAt: core.serialization.property("created_at", core.serialization.string()),
43
44
  episodes: core.serialization.list(core.serialization.string()).optional(),
44
45
  expiredAt: core.serialization.property("expired_at", core.serialization.string().optional()),
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Zep from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const EntityEdgeSourceTarget: core.serialization.ObjectSchema<serializers.EntityEdgeSourceTarget.Raw, Zep.EntityEdgeSourceTarget>;
8
+ export declare namespace EntityEdgeSourceTarget {
9
+ interface Raw {
10
+ source?: string | null;
11
+ target?: string | null;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EntityEdgeSourceTarget = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ exports.EntityEdgeSourceTarget = core.serialization.object({
42
+ source: core.serialization.string().optional(),
43
+ target: core.serialization.string().optional(),
44
+ });
@@ -4,10 +4,12 @@
4
4
  import * as serializers from "../index";
5
5
  import * as Zep from "../../api/index";
6
6
  import * as core from "../../core";
7
+ import { EdgeType } from "./EdgeType";
7
8
  import { EntityType } from "./EntityType";
8
9
  export declare const EntityTypeResponse: core.serialization.ObjectSchema<serializers.EntityTypeResponse.Raw, Zep.EntityTypeResponse>;
9
10
  export declare namespace EntityTypeResponse {
10
11
  interface Raw {
12
+ edge_types?: EdgeType.Raw[] | null;
11
13
  entity_types?: EntityType.Raw[] | null;
12
14
  }
13
15
  }
@@ -38,7 +38,9 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.EntityTypeResponse = void 0;
40
40
  const core = __importStar(require("../../core"));
41
+ const EdgeType_1 = require("./EdgeType");
41
42
  const EntityType_1 = require("./EntityType");
42
43
  exports.EntityTypeResponse = core.serialization.object({
44
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType_1.EdgeType).optional()),
43
45
  entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType_1.EntityType).optional()),
44
46
  });
@@ -7,6 +7,7 @@ import * as core from "../../core";
7
7
  export declare const SearchFilters: core.serialization.ObjectSchema<serializers.SearchFilters.Raw, Zep.SearchFilters>;
8
8
  export declare namespace SearchFilters {
9
9
  interface Raw {
10
+ edge_types?: string[] | null;
10
11
  node_labels?: string[] | null;
11
12
  }
12
13
  }
@@ -39,5 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SearchFilters = void 0;
40
40
  const core = __importStar(require("../../core"));
41
41
  exports.SearchFilters = core.serialization.object({
42
+ edgeTypes: core.serialization.property("edge_types", core.serialization.list(core.serialization.string()).optional()),
42
43
  nodeLabels: core.serialization.property("node_labels", core.serialization.list(core.serialization.string()).optional()),
43
44
  });
@@ -4,8 +4,10 @@ export * from "./ApidataDocument";
4
4
  export * from "./ApidataDocumentCollection";
5
5
  export * from "./ApidataDocumentSearchResponse";
6
6
  export * from "./ApidataDocumentWithScore";
7
+ export * from "./EdgeType";
7
8
  export * from "./EndSessionResponse";
8
9
  export * from "./EndSessionsResponse";
10
+ export * from "./EntityEdgeSourceTarget";
9
11
  export * from "./EntityProperty";
10
12
  export * from "./EntityType";
11
13
  export * from "./EntityTypeResponse";
@@ -20,8 +20,10 @@ __exportStar(require("./ApidataDocument"), exports);
20
20
  __exportStar(require("./ApidataDocumentCollection"), exports);
21
21
  __exportStar(require("./ApidataDocumentSearchResponse"), exports);
22
22
  __exportStar(require("./ApidataDocumentWithScore"), exports);
23
+ __exportStar(require("./EdgeType"), exports);
23
24
  __exportStar(require("./EndSessionResponse"), exports);
24
25
  __exportStar(require("./EndSessionsResponse"), exports);
26
+ __exportStar(require("./EntityEdgeSourceTarget"), exports);
25
27
  __exportStar(require("./EntityProperty"), exports);
26
28
  __exportStar(require("./EntityType"), exports);
27
29
  __exportStar(require("./EntityTypeResponse"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.12.2";
1
+ export declare const SDK_VERSION = "2.13.0";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.12.2";
4
+ exports.SDK_VERSION = "2.13.0";
@@ -1,6 +1,44 @@
1
1
  import { Graph as BaseGraph } from "../api/resources/graph/client/Client";
2
2
  import { Zep } from "../index";
3
- import { EntityType } from "./ontology";
3
+ import { EdgeType, EntityType } from "./ontology";
4
4
  export declare class Graph extends BaseGraph {
5
- setEntityTypes(entityTypes: Record<string, EntityType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
5
+ /**
6
+ * Sets the entity and edge types for a project, replacing any existing ones.
7
+ *
8
+ * @param {Record<string, EntityType>} entityTypes
9
+ * @param {Record<string, EdgeType>} edgeTypes
10
+ * @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
11
+ *
12
+ * @throws {@link Zep.BadRequestError}
13
+ * @throws {@link Zep.InternalServerError}
14
+ *
15
+ * @example
16
+ * const travelDestinationSchema: EntityType = {
17
+ * description: "A travel destination entity",
18
+ * fields: {
19
+ * destination_name: entityFields.text("The name of travel destination"),
20
+ * },
21
+ * };
22
+ *
23
+ * const isTravelingTo: EdgeType = {
24
+ * description: "An edge representing a traveler going to a destination.",
25
+ * fields: {
26
+ * travel_date: entityFields.text("The date of the travel"),
27
+ * purpose: entityFields.text("The purpose of the travel"),
28
+ * },
29
+ * sourceTargets: [
30
+ * {
31
+ * source: "User",
32
+ * target: "TravelDestination",
33
+ * }
34
+ * ]
35
+ * }
36
+ *
37
+ * await client.graph.setEntityTypes({
38
+ * TravelDestination: travelDestinationSchema,
39
+ * }, {
40
+ * IS_TRAVELING_TO: isTravelingTo,
41
+ * });
42
+ */
43
+ setEntityTypes(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
6
44
  }
@@ -13,15 +13,57 @@ exports.Graph = void 0;
13
13
  const Client_1 = require("../api/resources/graph/client/Client");
14
14
  const ontology_1 = require("./ontology");
15
15
  class Graph extends Client_1.Graph {
16
- setEntityTypes(entityTypes, requestOptions) {
16
+ /**
17
+ * Sets the entity and edge types for a project, replacing any existing ones.
18
+ *
19
+ * @param {Record<string, EntityType>} entityTypes
20
+ * @param {Record<string, EdgeType>} edgeTypes
21
+ * @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
22
+ *
23
+ * @throws {@link Zep.BadRequestError}
24
+ * @throws {@link Zep.InternalServerError}
25
+ *
26
+ * @example
27
+ * const travelDestinationSchema: EntityType = {
28
+ * description: "A travel destination entity",
29
+ * fields: {
30
+ * destination_name: entityFields.text("The name of travel destination"),
31
+ * },
32
+ * };
33
+ *
34
+ * const isTravelingTo: EdgeType = {
35
+ * description: "An edge representing a traveler going to a destination.",
36
+ * fields: {
37
+ * travel_date: entityFields.text("The date of the travel"),
38
+ * purpose: entityFields.text("The purpose of the travel"),
39
+ * },
40
+ * sourceTargets: [
41
+ * {
42
+ * source: "User",
43
+ * target: "TravelDestination",
44
+ * }
45
+ * ]
46
+ * }
47
+ *
48
+ * await client.graph.setEntityTypes({
49
+ * TravelDestination: travelDestinationSchema,
50
+ * }, {
51
+ * IS_TRAVELING_TO: isTravelingTo,
52
+ * });
53
+ */
54
+ setEntityTypes(entityTypes, edgeTypes, requestOptions) {
17
55
  return __awaiter(this, void 0, void 0, function* () {
18
56
  const validatedEntityTypes = Object.keys(entityTypes).map((key) => {
19
57
  const schema = entityTypes[key];
20
- const entityType = (0, ontology_1.entityModelToAPISchema)(schema, key);
21
- return entityType;
58
+ return (0, ontology_1.entityModelToAPISchema)(schema, key);
59
+ });
60
+ const validatedEdgeTypes = Object.keys(edgeTypes).map((key) => {
61
+ const schema = edgeTypes[key];
62
+ return (0, ontology_1.edgeModelToAPISchema)(schema, key);
22
63
  });
23
64
  return this.setEntityTypesInternal({
24
65
  entityTypes: validatedEntityTypes,
66
+ edgeTypes: validatedEdgeTypes,
25
67
  }, requestOptions);
26
68
  });
27
69
  }