@cognigy/rest-api-client
Version:
Cognigy REST-Client
34 lines • 2.37 kB
JavaScript
import { __rest } from "tslib";
import { GenericAPIFn } from "../../GenericAPIFn";
import { stringifyQuery } from "../../shared/helper/rest";
// ---------------------------------------------------------------------------
// Factory
// ---------------------------------------------------------------------------
export function addEvalProfileAPIs(self) {
return {
listEvalProfiles: (_a, options) => {
var { projectId } = _a, params = __rest(_a, ["projectId"]);
return GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles?${stringifyQuery(params)}`, "GET", self)(undefined, options);
},
createEvalProfile: (_a, options) => {
var { projectId } = _a, body = __rest(_a, ["projectId"]);
return GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles`, "POST", self)(body, options);
},
getEvalProfile: ({ projectId, profileId }, options) => GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}`, "GET", self)(undefined, options),
updateEvalProfile: (_a, options) => {
var { projectId, profileId } = _a, body = __rest(_a, ["projectId", "profileId"]);
return GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}`, "PUT", self)(body, options);
},
patchEvalProfile: (_a, options) => {
var { projectId, profileId } = _a, body = __rest(_a, ["projectId", "profileId"]);
return GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}`, "PATCH", self)(body, options);
},
deleteEvalProfile: ({ projectId, profileId, force }, options) => {
const qs = force !== undefined ? `?${stringifyQuery({ force })}` : "";
return GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}${qs}`, "DELETE", self)(undefined, options);
},
getEvalProfileCatalogue: ({ projectId }, options) => GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/catalogue`, "GET", self)(undefined, options),
getEvalProfileReferences: ({ projectId, profileId }, options) => GenericAPIFn(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}/references`, "GET", self)(undefined, options)
};
}
//# sourceMappingURL=evalProfileAPI.js.map