@getzep/zep-cloud 3.0.4 → 3.1.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/errors/index.d.ts +1 -1
- package/dist/cjs/api/errors/index.js +1 -1
- package/dist/cjs/api/resources/graph/client/Client.d.ts +21 -19
- package/dist/cjs/api/resources/graph/client/Client.js +81 -62
- package/dist/cjs/api/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListEntityTypesRequest.d.ts +17 -0
- package/dist/cjs/api/resources/graph/client/requests/GraphListEntityTypesRequest.js +5 -0
- package/dist/cjs/api/resources/graph/client/requests/index.d.ts +2 -1
- package/dist/cjs/serialization/resources/graph/client/requests/EntityTypeRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/graph/client/requests/EntityTypeRequest.js +2 -0
- package/dist/cjs/serialization/resources/graph/client/requests/index.d.ts +1 -1
- package/dist/cjs/serialization/resources/graph/client/requests/index.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/graph.d.ts +14 -7
- package/dist/cjs/wrapper/graph.js +12 -8
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/errors/index.d.mts +1 -1
- package/dist/esm/api/errors/index.mjs +1 -1
- package/dist/esm/api/resources/graph/client/Client.d.mts +21 -19
- package/dist/esm/api/resources/graph/client/Client.mjs +81 -62
- package/dist/esm/api/resources/graph/client/requests/EntityTypeRequest.d.mts +2 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListEntityTypesRequest.d.mts +17 -0
- package/dist/esm/api/resources/graph/client/requests/GraphListEntityTypesRequest.mjs +4 -0
- package/dist/esm/api/resources/graph/client/requests/index.d.mts +2 -1
- package/dist/esm/serialization/resources/graph/client/requests/EntityTypeRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/graph/client/requests/EntityTypeRequest.mjs +2 -0
- package/dist/esm/serialization/resources/graph/client/requests/index.d.mts +1 -1
- package/dist/esm/serialization/resources/graph/client/requests/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/graph.d.mts +14 -7
- package/dist/esm/wrapper/graph.mjs +12 -8
- package/package.json +1 -1
- package/reference.md +26 -18
package/dist/cjs/Client.js
CHANGED
|
@@ -47,8 +47,8 @@ class ZepClient {
|
|
|
47
47
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
48
48
|
"X-Fern-Language": "JavaScript",
|
|
49
49
|
"X-Fern-SDK-Name": "zep-cloud",
|
|
50
|
-
"X-Fern-SDK-Version": "3.0
|
|
51
|
-
"User-Agent": "zep-cloud/3.0
|
|
50
|
+
"X-Fern-SDK-Version": "3.1.0",
|
|
51
|
+
"User-Agent": "zep-cloud/3.1.0",
|
|
52
52
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
53
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
54
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BadRequestError.js"), exports);
|
|
17
18
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
18
19
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
19
|
-
__exportStar(require("./BadRequestError.js"), exports);
|
|
@@ -38,20 +38,22 @@ export declare class Graph {
|
|
|
38
38
|
get episode(): Episode;
|
|
39
39
|
get node(): Node;
|
|
40
40
|
/**
|
|
41
|
-
* Returns all entity types for a project.
|
|
41
|
+
* Returns all entity types for a project, user, or graph.
|
|
42
42
|
*
|
|
43
|
+
* @param {Zep.GraphListEntityTypesRequest} request
|
|
43
44
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
45
|
*
|
|
46
|
+
* @throws {@link Zep.BadRequestError}
|
|
45
47
|
* @throws {@link Zep.NotFoundError}
|
|
46
48
|
* @throws {@link Zep.InternalServerError}
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
49
51
|
* await client.graph.listEntityTypes()
|
|
50
52
|
*/
|
|
51
|
-
listEntityTypes(requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.EntityTypeResponse>;
|
|
53
|
+
listEntityTypes(request?: Zep.GraphListEntityTypesRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.EntityTypeResponse>;
|
|
52
54
|
private __listEntityTypes;
|
|
53
55
|
/**
|
|
54
|
-
* Sets the entity types for
|
|
56
|
+
* Sets the entity types for multiple users and graphs, replacing any existing ones.
|
|
55
57
|
*
|
|
56
58
|
* @param {Zep.EntityTypeRequest} request
|
|
57
59
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -132,22 +134,6 @@ export declare class Graph {
|
|
|
132
134
|
*/
|
|
133
135
|
clone(request?: Zep.CloneGraphRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.CloneGraphResponse>;
|
|
134
136
|
private __clone;
|
|
135
|
-
/**
|
|
136
|
-
* Perform a graph search query.
|
|
137
|
-
*
|
|
138
|
-
* @param {Zep.GraphSearchQuery} request
|
|
139
|
-
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
|
-
*
|
|
141
|
-
* @throws {@link Zep.BadRequestError}
|
|
142
|
-
* @throws {@link Zep.InternalServerError}
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* await client.graph.search({
|
|
146
|
-
* query: "query"
|
|
147
|
-
* })
|
|
148
|
-
*/
|
|
149
|
-
search(request: Zep.GraphSearchQuery, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.GraphSearchResults>;
|
|
150
|
-
private __search;
|
|
151
137
|
/**
|
|
152
138
|
* Creates a new graph.
|
|
153
139
|
*
|
|
@@ -178,6 +164,22 @@ export declare class Graph {
|
|
|
178
164
|
*/
|
|
179
165
|
listAll(request?: Zep.GraphListAllRequest, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.GraphListResponse>;
|
|
180
166
|
private __listAll;
|
|
167
|
+
/**
|
|
168
|
+
* Perform a graph search query.
|
|
169
|
+
*
|
|
170
|
+
* @param {Zep.GraphSearchQuery} request
|
|
171
|
+
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
172
|
+
*
|
|
173
|
+
* @throws {@link Zep.BadRequestError}
|
|
174
|
+
* @throws {@link Zep.InternalServerError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.graph.search({
|
|
178
|
+
* query: "query"
|
|
179
|
+
* })
|
|
180
|
+
*/
|
|
181
|
+
search(request: Zep.GraphSearchQuery, requestOptions?: Graph.RequestOptions): core.HttpResponsePromise<Zep.GraphSearchResults>;
|
|
182
|
+
private __search;
|
|
181
183
|
/**
|
|
182
184
|
* Returns a graph.
|
|
183
185
|
*
|
|
@@ -72,26 +72,37 @@ class Graph {
|
|
|
72
72
|
return ((_a = this._node) !== null && _a !== void 0 ? _a : (this._node = new Client_js_3.Node(this._options)));
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
* Returns all entity types for a project.
|
|
75
|
+
* Returns all entity types for a project, user, or graph.
|
|
76
76
|
*
|
|
77
|
+
* @param {Zep.GraphListEntityTypesRequest} request
|
|
77
78
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
79
|
*
|
|
80
|
+
* @throws {@link Zep.BadRequestError}
|
|
79
81
|
* @throws {@link Zep.NotFoundError}
|
|
80
82
|
* @throws {@link Zep.InternalServerError}
|
|
81
83
|
*
|
|
82
84
|
* @example
|
|
83
85
|
* await client.graph.listEntityTypes()
|
|
84
86
|
*/
|
|
85
|
-
listEntityTypes(requestOptions) {
|
|
86
|
-
return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(requestOptions));
|
|
87
|
+
listEntityTypes(request = {}, requestOptions) {
|
|
88
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntityTypes(request, requestOptions));
|
|
87
89
|
}
|
|
88
|
-
__listEntityTypes(
|
|
89
|
-
return __awaiter(this,
|
|
90
|
+
__listEntityTypes() {
|
|
91
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
90
92
|
var _a, _b, _c, _d;
|
|
93
|
+
const { userId, graphId } = request;
|
|
94
|
+
const _queryParams = {};
|
|
95
|
+
if (userId != null) {
|
|
96
|
+
_queryParams["user_id"] = userId;
|
|
97
|
+
}
|
|
98
|
+
if (graphId != null) {
|
|
99
|
+
_queryParams["graph_id"] = graphId;
|
|
100
|
+
}
|
|
91
101
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
92
102
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "entity-types"),
|
|
93
103
|
method: "GET",
|
|
94
104
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
105
|
+
queryParameters: _queryParams,
|
|
95
106
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
96
107
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
97
108
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -110,6 +121,14 @@ class Graph {
|
|
|
110
121
|
}
|
|
111
122
|
if (_response.error.reason === "status-code") {
|
|
112
123
|
switch (_response.error.statusCode) {
|
|
124
|
+
case 400:
|
|
125
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
126
|
+
unrecognizedObjectKeys: "passthrough",
|
|
127
|
+
allowUnrecognizedUnionMembers: true,
|
|
128
|
+
allowUnrecognizedEnumValues: true,
|
|
129
|
+
skipValidation: true,
|
|
130
|
+
breadcrumbsPrefix: ["response"],
|
|
131
|
+
}), _response.rawResponse);
|
|
113
132
|
case 404:
|
|
114
133
|
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
115
134
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -152,7 +171,7 @@ class Graph {
|
|
|
152
171
|
});
|
|
153
172
|
}
|
|
154
173
|
/**
|
|
155
|
-
* Sets the entity types for
|
|
174
|
+
* Sets the entity types for multiple users and graphs, replacing any existing ones.
|
|
156
175
|
*
|
|
157
176
|
* @param {Zep.EntityTypeRequest} request
|
|
158
177
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -599,32 +618,32 @@ class Graph {
|
|
|
599
618
|
});
|
|
600
619
|
}
|
|
601
620
|
/**
|
|
602
|
-
*
|
|
621
|
+
* Creates a new graph.
|
|
603
622
|
*
|
|
604
|
-
* @param {Zep.
|
|
623
|
+
* @param {Zep.CreateGraphRequest} request
|
|
605
624
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
606
625
|
*
|
|
607
626
|
* @throws {@link Zep.BadRequestError}
|
|
608
627
|
* @throws {@link Zep.InternalServerError}
|
|
609
628
|
*
|
|
610
629
|
* @example
|
|
611
|
-
* await client.graph.
|
|
612
|
-
*
|
|
630
|
+
* await client.graph.create({
|
|
631
|
+
* graphId: "graph_id"
|
|
613
632
|
* })
|
|
614
633
|
*/
|
|
615
|
-
|
|
616
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
634
|
+
create(request, requestOptions) {
|
|
635
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
617
636
|
}
|
|
618
|
-
|
|
637
|
+
__create(request, requestOptions) {
|
|
619
638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
620
639
|
var _a, _b, _c, _d;
|
|
621
640
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
622
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "graph/
|
|
641
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "graph/create"),
|
|
623
642
|
method: "POST",
|
|
624
643
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
625
644
|
contentType: "application/json",
|
|
626
645
|
requestType: "json",
|
|
627
|
-
body: serializers.
|
|
646
|
+
body: serializers.CreateGraphRequest.jsonOrThrow(request, {
|
|
628
647
|
unrecognizedObjectKeys: "strip",
|
|
629
648
|
omitUndefined: true,
|
|
630
649
|
}),
|
|
@@ -634,7 +653,7 @@ class Graph {
|
|
|
634
653
|
});
|
|
635
654
|
if (_response.ok) {
|
|
636
655
|
return {
|
|
637
|
-
data: serializers.
|
|
656
|
+
data: serializers.Graph.parseOrThrow(_response.body, {
|
|
638
657
|
unrecognizedObjectKeys: "passthrough",
|
|
639
658
|
allowUnrecognizedUnionMembers: true,
|
|
640
659
|
allowUnrecognizedEnumValues: true,
|
|
@@ -678,7 +697,7 @@ class Graph {
|
|
|
678
697
|
rawResponse: _response.rawResponse,
|
|
679
698
|
});
|
|
680
699
|
case "timeout":
|
|
681
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/
|
|
700
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/create.");
|
|
682
701
|
case "unknown":
|
|
683
702
|
throw new errors.ZepError({
|
|
684
703
|
message: _response.error.errorMessage,
|
|
@@ -688,42 +707,43 @@ class Graph {
|
|
|
688
707
|
});
|
|
689
708
|
}
|
|
690
709
|
/**
|
|
691
|
-
*
|
|
710
|
+
* Returns all graphs.
|
|
692
711
|
*
|
|
693
|
-
* @param {Zep.
|
|
712
|
+
* @param {Zep.GraphListAllRequest} request
|
|
694
713
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
695
714
|
*
|
|
696
715
|
* @throws {@link Zep.BadRequestError}
|
|
697
716
|
* @throws {@link Zep.InternalServerError}
|
|
698
717
|
*
|
|
699
718
|
* @example
|
|
700
|
-
* await client.graph.
|
|
701
|
-
* graphId: "graph_id"
|
|
702
|
-
* })
|
|
719
|
+
* await client.graph.listAll()
|
|
703
720
|
*/
|
|
704
|
-
|
|
705
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
721
|
+
listAll(request = {}, requestOptions) {
|
|
722
|
+
return core.HttpResponsePromise.fromPromise(this.__listAll(request, requestOptions));
|
|
706
723
|
}
|
|
707
|
-
|
|
708
|
-
return __awaiter(this,
|
|
724
|
+
__listAll() {
|
|
725
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
709
726
|
var _a, _b, _c, _d;
|
|
727
|
+
const { pageNumber, pageSize } = request;
|
|
728
|
+
const _queryParams = {};
|
|
729
|
+
if (pageNumber != null) {
|
|
730
|
+
_queryParams["pageNumber"] = pageNumber.toString();
|
|
731
|
+
}
|
|
732
|
+
if (pageSize != null) {
|
|
733
|
+
_queryParams["pageSize"] = pageSize.toString();
|
|
734
|
+
}
|
|
710
735
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
711
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "
|
|
712
|
-
method: "
|
|
736
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "graph/list-all"),
|
|
737
|
+
method: "GET",
|
|
713
738
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
714
|
-
|
|
715
|
-
requestType: "json",
|
|
716
|
-
body: serializers.CreateGraphRequest.jsonOrThrow(request, {
|
|
717
|
-
unrecognizedObjectKeys: "strip",
|
|
718
|
-
omitUndefined: true,
|
|
719
|
-
}),
|
|
739
|
+
queryParameters: _queryParams,
|
|
720
740
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
721
741
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
722
742
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
723
743
|
});
|
|
724
744
|
if (_response.ok) {
|
|
725
745
|
return {
|
|
726
|
-
data: serializers.
|
|
746
|
+
data: serializers.GraphListResponse.parseOrThrow(_response.body, {
|
|
727
747
|
unrecognizedObjectKeys: "passthrough",
|
|
728
748
|
allowUnrecognizedUnionMembers: true,
|
|
729
749
|
allowUnrecognizedEnumValues: true,
|
|
@@ -767,7 +787,7 @@ class Graph {
|
|
|
767
787
|
rawResponse: _response.rawResponse,
|
|
768
788
|
});
|
|
769
789
|
case "timeout":
|
|
770
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling
|
|
790
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/list-all.");
|
|
771
791
|
case "unknown":
|
|
772
792
|
throw new errors.ZepError({
|
|
773
793
|
message: _response.error.errorMessage,
|
|
@@ -777,43 +797,42 @@ class Graph {
|
|
|
777
797
|
});
|
|
778
798
|
}
|
|
779
799
|
/**
|
|
780
|
-
*
|
|
800
|
+
* Perform a graph search query.
|
|
781
801
|
*
|
|
782
|
-
* @param {Zep.
|
|
802
|
+
* @param {Zep.GraphSearchQuery} request
|
|
783
803
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
784
804
|
*
|
|
785
805
|
* @throws {@link Zep.BadRequestError}
|
|
786
806
|
* @throws {@link Zep.InternalServerError}
|
|
787
807
|
*
|
|
788
808
|
* @example
|
|
789
|
-
* await client.graph.
|
|
809
|
+
* await client.graph.search({
|
|
810
|
+
* query: "query"
|
|
811
|
+
* })
|
|
790
812
|
*/
|
|
791
|
-
|
|
792
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
813
|
+
search(request, requestOptions) {
|
|
814
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
793
815
|
}
|
|
794
|
-
|
|
795
|
-
return __awaiter(this,
|
|
816
|
+
__search(request, requestOptions) {
|
|
817
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
796
818
|
var _a, _b, _c, _d;
|
|
797
|
-
const { pageNumber, pageSize } = request;
|
|
798
|
-
const _queryParams = {};
|
|
799
|
-
if (pageNumber != null) {
|
|
800
|
-
_queryParams["pageNumber"] = pageNumber.toString();
|
|
801
|
-
}
|
|
802
|
-
if (pageSize != null) {
|
|
803
|
-
_queryParams["pageSize"] = pageSize.toString();
|
|
804
|
-
}
|
|
805
819
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
806
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "
|
|
807
|
-
method: "
|
|
820
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, "graph/search"),
|
|
821
|
+
method: "POST",
|
|
808
822
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
809
|
-
|
|
823
|
+
contentType: "application/json",
|
|
824
|
+
requestType: "json",
|
|
825
|
+
body: serializers.GraphSearchQuery.jsonOrThrow(request, {
|
|
826
|
+
unrecognizedObjectKeys: "strip",
|
|
827
|
+
omitUndefined: true,
|
|
828
|
+
}),
|
|
810
829
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
811
830
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
812
831
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
813
832
|
});
|
|
814
833
|
if (_response.ok) {
|
|
815
834
|
return {
|
|
816
|
-
data: serializers.
|
|
835
|
+
data: serializers.GraphSearchResults.parseOrThrow(_response.body, {
|
|
817
836
|
unrecognizedObjectKeys: "passthrough",
|
|
818
837
|
allowUnrecognizedUnionMembers: true,
|
|
819
838
|
allowUnrecognizedEnumValues: true,
|
|
@@ -857,7 +876,7 @@ class Graph {
|
|
|
857
876
|
rawResponse: _response.rawResponse,
|
|
858
877
|
});
|
|
859
878
|
case "timeout":
|
|
860
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling
|
|
879
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /graph/search.");
|
|
861
880
|
case "unknown":
|
|
862
881
|
throw new errors.ZepError({
|
|
863
882
|
message: _response.error.errorMessage,
|
|
@@ -885,7 +904,7 @@ class Graph {
|
|
|
885
904
|
return __awaiter(this, void 0, void 0, function* () {
|
|
886
905
|
var _a, _b, _c, _d;
|
|
887
906
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
888
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `
|
|
907
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `graph/${encodeURIComponent(graphId)}`),
|
|
889
908
|
method: "GET",
|
|
890
909
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
891
910
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -938,7 +957,7 @@ class Graph {
|
|
|
938
957
|
rawResponse: _response.rawResponse,
|
|
939
958
|
});
|
|
940
959
|
case "timeout":
|
|
941
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /
|
|
960
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /graph/{graphId}.");
|
|
942
961
|
case "unknown":
|
|
943
962
|
throw new errors.ZepError({
|
|
944
963
|
message: _response.error.errorMessage,
|
|
@@ -967,7 +986,7 @@ class Graph {
|
|
|
967
986
|
return __awaiter(this, void 0, void 0, function* () {
|
|
968
987
|
var _a, _b, _c, _d;
|
|
969
988
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
970
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `
|
|
989
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `graph/${encodeURIComponent(graphId)}`),
|
|
971
990
|
method: "DELETE",
|
|
972
991
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
973
992
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1028,7 +1047,7 @@ class Graph {
|
|
|
1028
1047
|
rawResponse: _response.rawResponse,
|
|
1029
1048
|
});
|
|
1030
1049
|
case "timeout":
|
|
1031
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /
|
|
1050
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /graph/{graphId}.");
|
|
1032
1051
|
case "unknown":
|
|
1033
1052
|
throw new errors.ZepError({
|
|
1034
1053
|
message: _response.error.errorMessage,
|
|
@@ -1058,7 +1077,7 @@ class Graph {
|
|
|
1058
1077
|
return __awaiter(this, arguments, void 0, function* (graphId, request = {}, requestOptions) {
|
|
1059
1078
|
var _a, _b, _c, _d;
|
|
1060
1079
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1061
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `
|
|
1080
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ZepEnvironment.Default, `graph/${encodeURIComponent(graphId)}`),
|
|
1062
1081
|
method: "PATCH",
|
|
1063
1082
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1064
1083
|
contentType: "application/json",
|
|
@@ -1125,7 +1144,7 @@ class Graph {
|
|
|
1125
1144
|
rawResponse: _response.rawResponse,
|
|
1126
1145
|
});
|
|
1127
1146
|
case "timeout":
|
|
1128
|
-
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /
|
|
1147
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /graph/{graphId}.");
|
|
1129
1148
|
case "unknown":
|
|
1130
1149
|
throw new errors.ZepError({
|
|
1131
1150
|
message: _response.error.errorMessage,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface GraphListEntityTypesRequest {
|
|
9
|
+
/**
|
|
10
|
+
* User ID to get user-specific entity types
|
|
11
|
+
*/
|
|
12
|
+
userId?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Graph ID to get graph-specific entity types
|
|
15
|
+
*/
|
|
16
|
+
graphId?: string;
|
|
17
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
export { type GraphListEntityTypesRequest } from "./GraphListEntityTypesRequest.js";
|
|
1
2
|
export { type EntityTypeRequest } from "./EntityTypeRequest.js";
|
|
2
3
|
export { type AddDataRequest } from "./AddDataRequest.js";
|
|
3
4
|
export { type AddDataBatchRequest } from "./AddDataBatchRequest.js";
|
|
4
5
|
export { type AddTripleRequest } from "./AddTripleRequest.js";
|
|
5
6
|
export { type CloneGraphRequest } from "./CloneGraphRequest.js";
|
|
6
|
-
export { type GraphSearchQuery } from "./GraphSearchQuery.js";
|
|
7
7
|
export { type CreateGraphRequest } from "./CreateGraphRequest.js";
|
|
8
8
|
export { type GraphListAllRequest } from "./GraphListAllRequest.js";
|
|
9
|
+
export { type GraphSearchQuery } from "./GraphSearchQuery.js";
|
|
9
10
|
export { type UpdateGraphRequest } from "./UpdateGraphRequest.js";
|
|
@@ -43,4 +43,6 @@ const EntityType_js_1 = require("../../../../types/EntityType.js");
|
|
|
43
43
|
exports.EntityTypeRequest = core.serialization.object({
|
|
44
44
|
edgeTypes: core.serialization.property("edge_types", core.serialization.list(EdgeType_js_1.EdgeType).optional()),
|
|
45
45
|
entityTypes: core.serialization.property("entity_types", core.serialization.list(EntityType_js_1.EntityType).optional()),
|
|
46
|
+
graphIds: core.serialization.property("graph_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
47
|
+
userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()),
|
|
46
48
|
});
|
|
@@ -3,6 +3,6 @@ export { AddDataRequest } from "./AddDataRequest.js";
|
|
|
3
3
|
export { AddDataBatchRequest } from "./AddDataBatchRequest.js";
|
|
4
4
|
export { AddTripleRequest } from "./AddTripleRequest.js";
|
|
5
5
|
export { CloneGraphRequest } from "./CloneGraphRequest.js";
|
|
6
|
-
export { GraphSearchQuery } from "./GraphSearchQuery.js";
|
|
7
6
|
export { CreateGraphRequest } from "./CreateGraphRequest.js";
|
|
7
|
+
export { GraphSearchQuery } from "./GraphSearchQuery.js";
|
|
8
8
|
export { UpdateGraphRequest } from "./UpdateGraphRequest.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateGraphRequest = exports.
|
|
3
|
+
exports.UpdateGraphRequest = exports.GraphSearchQuery = exports.CreateGraphRequest = exports.CloneGraphRequest = exports.AddTripleRequest = exports.AddDataBatchRequest = exports.AddDataRequest = exports.EntityTypeRequest = void 0;
|
|
4
4
|
var EntityTypeRequest_js_1 = require("./EntityTypeRequest.js");
|
|
5
5
|
Object.defineProperty(exports, "EntityTypeRequest", { enumerable: true, get: function () { return EntityTypeRequest_js_1.EntityTypeRequest; } });
|
|
6
6
|
var AddDataRequest_js_1 = require("./AddDataRequest.js");
|
|
@@ -11,9 +11,9 @@ var AddTripleRequest_js_1 = require("./AddTripleRequest.js");
|
|
|
11
11
|
Object.defineProperty(exports, "AddTripleRequest", { enumerable: true, get: function () { return AddTripleRequest_js_1.AddTripleRequest; } });
|
|
12
12
|
var CloneGraphRequest_js_1 = require("./CloneGraphRequest.js");
|
|
13
13
|
Object.defineProperty(exports, "CloneGraphRequest", { enumerable: true, get: function () { return CloneGraphRequest_js_1.CloneGraphRequest; } });
|
|
14
|
-
var GraphSearchQuery_js_1 = require("./GraphSearchQuery.js");
|
|
15
|
-
Object.defineProperty(exports, "GraphSearchQuery", { enumerable: true, get: function () { return GraphSearchQuery_js_1.GraphSearchQuery; } });
|
|
16
14
|
var CreateGraphRequest_js_1 = require("./CreateGraphRequest.js");
|
|
17
15
|
Object.defineProperty(exports, "CreateGraphRequest", { enumerable: true, get: function () { return CreateGraphRequest_js_1.CreateGraphRequest; } });
|
|
16
|
+
var GraphSearchQuery_js_1 = require("./GraphSearchQuery.js");
|
|
17
|
+
Object.defineProperty(exports, "GraphSearchQuery", { enumerable: true, get: function () { return GraphSearchQuery_js_1.GraphSearchQuery; } });
|
|
18
18
|
var UpdateGraphRequest_js_1 = require("./UpdateGraphRequest.js");
|
|
19
19
|
Object.defineProperty(exports, "UpdateGraphRequest", { enumerable: true, get: function () { return UpdateGraphRequest_js_1.UpdateGraphRequest; } });
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.0
|
|
1
|
+
export declare const SDK_VERSION = "3.1.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Graph as BaseGraph } from "../api/resources/graph/client/Client.js";
|
|
2
2
|
import { Zep } from "../index.js";
|
|
3
3
|
import { EdgeType, EntityType } from "./ontology.js";
|
|
4
|
+
interface OntologyTargets {
|
|
5
|
+
userIds?: string[];
|
|
6
|
+
graphIds?: string[];
|
|
7
|
+
}
|
|
4
8
|
export declare class Graph extends BaseGraph {
|
|
5
9
|
/**
|
|
6
|
-
* Sets the entity and edge types for
|
|
10
|
+
* Sets the entity and edge types for the specified targets, replacing any existing ones in those targets. If no targets are specified, it sets the ontology for the entire project.
|
|
7
11
|
*
|
|
8
12
|
* @param {Record<string, EntityType>} entityTypes
|
|
9
13
|
* @param {Record<string, EdgeType>} edgeTypes
|
|
14
|
+
* @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds or graphIds. If none specified, sets for the entire project.
|
|
10
15
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
11
16
|
*
|
|
12
17
|
* @throws {@link Zep.BadRequestError}
|
|
@@ -38,14 +43,15 @@ export declare class Graph extends BaseGraph {
|
|
|
38
43
|
* TravelDestination: travelDestinationSchema,
|
|
39
44
|
* }, {
|
|
40
45
|
* IS_TRAVELING_TO: isTravelingTo,
|
|
41
|
-
* });
|
|
46
|
+
* }, {userIds: ['user_1234']});
|
|
42
47
|
*/
|
|
43
|
-
setEntityTypes(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
|
|
48
|
+
setEntityTypes(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, ontologyTargets?: OntologyTargets, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
|
|
44
49
|
/**
|
|
45
|
-
* Sets the entity and edge types for
|
|
50
|
+
* Sets the entity and edge types for the specified targets, replacing any existing ones in those targets. If no targets are specified, it sets the ontology for the entire project.
|
|
46
51
|
*
|
|
47
52
|
* @param {Record<string, EntityType>} entityTypes
|
|
48
53
|
* @param {Record<string, EdgeType>} edgeTypes
|
|
54
|
+
* @param {OntologyTargets} [ontologyTargets] - The targets for which to set the ontology. Can include userIds or graphIds. If none specified, sets for the entire project.
|
|
49
55
|
* @param {Graph.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
56
|
*
|
|
51
57
|
* @throws {@link Zep.BadRequestError}
|
|
@@ -73,11 +79,12 @@ export declare class Graph extends BaseGraph {
|
|
|
73
79
|
* ]
|
|
74
80
|
* }
|
|
75
81
|
*
|
|
76
|
-
* await client.graph.
|
|
82
|
+
* await client.graph.setEntityTypes({
|
|
77
83
|
* TravelDestination: travelDestinationSchema,
|
|
78
84
|
* }, {
|
|
79
85
|
* IS_TRAVELING_TO: isTravelingTo,
|
|
80
|
-
* });
|
|
86
|
+
* }, {userIds: ['user_1234']});
|
|
81
87
|
*/
|
|
82
|
-
setOntology(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
|
|
88
|
+
setOntology(entityTypes: Record<string, EntityType>, edgeTypes: Record<string, EdgeType>, ontologyTargets?: OntologyTargets, requestOptions?: BaseGraph.RequestOptions): Promise<Zep.SuccessResponse>;
|
|
83
89
|
}
|
|
90
|
+
export {};
|