@cognigy/rest-api-client
Version:
Cognigy REST-Client
48 lines • 3.17 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addEvalProfileAPIs = void 0;
const GenericAPIFn_1 = require("../../GenericAPIFn");
const rest_1 = require("../../shared/helper/rest");
// ---------------------------------------------------------------------------
// Factory
// ---------------------------------------------------------------------------
function addEvalProfileAPIs(self) {
return {
listEvalProfiles: (_a, options) => {
var { projectId } = _a, params = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles?${(0, rest_1.stringifyQuery)(params)}`, "GET", self)(undefined, options);
},
createEvalProfile: (_a, options) => {
var { projectId } = _a, body = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles`, "POST", self)(body, options);
},
getEvalProfile: ({ projectId, profileId }, options) => (0, GenericAPIFn_1.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 (0, GenericAPIFn_1.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 (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}`, "PATCH", self)(body, options);
},
deleteEvalProfile: ({ projectId, profileId, force }, options) => {
const qs = force !== undefined ? `?${(0, rest_1.stringifyQuery)({ force })}` : "";
return (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}${qs}`, "DELETE", self)(undefined, options);
},
getEvalProfileCatalogue: ({ projectId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/catalogue`, "GET", self)(undefined, options),
getEvalProfileReferences: ({ projectId, profileId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/toolkit/api/v2.0/projects/${projectId}/eval-profiles/${profileId}/references`, "GET", self)(undefined, options)
};
}
exports.addEvalProfileAPIs = addEvalProfileAPIs;
//# sourceMappingURL=evalProfileAPI.js.map