@cognigy/rest-api-client
Version:
Cognigy REST-Client
127 lines • 11.2 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.AdministrationAPIGroup_2_0 = void 0;
const GenericAPIFn_1 = require("../GenericAPIFn");
const query_1 = require("../shared/helper/rest/query");
function AdministrationAPIGroup_2_0(instance) {
const self = instance;
return {
requestPasswordReset: (_a, options) => {
var { organisationId } = _a, args = __rest(_a, ["organisationId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/requestpasswordreset?
${(0, query_1.stringifyQuery)({ organisationId })}`, "POST", self)(args, Object.assign({ withAuthentication: false }, options));
},
validatePasswordResetToken: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/validatepasswordresettoken", "POST", self)(args, Object.assign({ withAuthentication: false }, options)),
resetPassword: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/resetpassword", "POST", self)(args, Object.assign({ withAuthentication: false }, options)),
changePassword: (_a, options) => {
var { organisationId } = _a, args = __rest(_a, ["organisationId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/changepassword?
${(0, query_1.stringifyQuery)({ organisationId })}`, "POST", self)(args, Object.assign({ withAuthentication: false }, options));
},
getSystemLicenseState: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/system/license", "GET", self)(undefined, Object.assign({ withAuthentication: false }, options)),
setSystemLicense: (_a, options) => {
var { organisationId } = _a, args = __rest(_a, ["organisationId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/system/license?
${(0, query_1.stringifyQuery)({ organisationId })}`, "POST", self)(args, Object.assign({ withAuthentication: false }, options));
},
getSystemMessage: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/system/message", "GET", self)(undefined, Object.assign({ withAuthentication: false }, options)),
indexAuditEvents: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/auditevents?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(args, options),
readAuditEvent: ({ auditEventId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/auditevents/${auditEventId}`, "GET", self)(undefined, options),
logoutUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}/logout`, "POST", self)(args, options),
resetFailedLoginAttempts: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}/resetfailedloginattempts`, "POST", self)(args, options),
readLastLoginAttemptMe: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me/lastloginattempt", "GET", self)(undefined, options),
indexLoginAttemptsMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/me/loginattempts?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(args, options),
deprecatePassword: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/deprecatepassword", "POST", self)(args, options),
indexUsers: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(args, options),
createUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users", "POST", self)(args, options),
readUserMe: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me", "GET", self)(undefined, options),
readUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}`, "GET", self)(args, options),
updateUser: (_a, options) => {
var { userId } = _a, args = __rest(_a, ["userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${userId}`, "PATCH", self)(args, options);
},
updateUserMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me", "PATCH", self)(args, options),
deleteUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}`, "DELETE", self)(args, options),
deleteUserMe: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me", "DELETE", self)(undefined, options),
createApiKeyMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me/apikeys", "POST", self)(args, options),
deleteApiKeyMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/me/apikeys/${args.apiKeyId}`, "DELETE", self)(args, options),
indexApiKeysMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/me/apikeys?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(args, options),
addRoleToUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}/addroletouser`, "POST", self)(args, options),
removeRoleFromUser: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${args.userId}/removerolefromuser`, "POST", self)(args, options),
readUserAclMe: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me/acl", "GET", self)(undefined, options),
acceptTermsOfService: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me/accepttermsofservice", "POST", self)(undefined, options),
indexProjectMembers: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/members?${(0, query_1.stringifyQuery)(args)}`, "GET", self)(undefined, options);
},
readProjectMember: ({ projectId, userId }, options) => (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/members/${userId}`, "GET", self)(undefined, options),
addProjectMember: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/addprojectmember`, "POST", self)(args, options);
},
updateProjectMember: (_a, options) => {
var { projectId, userId } = _a, args = __rest(_a, ["projectId", "userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/members/${userId}`, "PATCH", self)(args, options);
},
removeProjectMember: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/removeprojectmember`, "POST", self)(args, options);
},
addRoleToMember: (_a, options) => {
var { projectId, userId } = _a, args = __rest(_a, ["projectId", "userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/members/${userId}/addroletomember`, "POST", self)(args, options);
},
removeRoleFromMember: (_a, options) => {
var { projectId, userId } = _a, args = __rest(_a, ["projectId", "userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/members/${userId}/removerolefrommember`, "POST", self)(args, options);
},
addProjectToUser: (_a, options) => {
var { userId } = _a, args = __rest(_a, ["userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${userId}/addproject`, "POST", self)(args, options);
},
removeProjectFromUser: (_a, options) => {
var { userId } = _a, args = __rest(_a, ["userId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/${userId}/removeproject`, "POST", self)(args, options);
},
configureIdentityProvider: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/identityprovider/configure", "POST", self)(args, options),
resetIdentityProvider: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/identityprovider/reset", "POST", self)(undefined, options),
setupCognigyLiveAgent: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/setupliveagent", "POST", self)(undefined, options),
setupCognigyLiveAgentInbox: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/setupinbox`, "POST", self)(args, options);
},
updateCognigyLiveAgentInbox: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/setupinbox`, "PATCH", self)(args, options);
},
readProjectInbox: (_a, options) => {
var { projectId } = _a, args = __rest(_a, ["projectId"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/projects/${projectId}/inbox`, "GET", self)(args, options);
},
readLiveAgentAccount: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/liveagentaccount", "GET", self)(undefined, options),
requestOrganisationDeletion: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/requestdeletion", "POST", self)(undefined, options),
readCollectionsToBeDeleted: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/collections", "GET", self)(undefined, options),
setupVoiceGatewayAccount: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/voicegateway/account", "POST", self)(args, options),
readVoiceGatewayAccount: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/voicegateway/account", "GET", self)(undefined, options),
readOrganisationPolicies: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/policy", "GET", self)(undefined, options),
readOrganisationKnowledgeChunksCount: (options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/organisations/chunkcount", "GET", self)(undefined, options),
pinResourceMe: (args, options) => (0, GenericAPIFn_1.GenericAPIFn)("/new/v2.0/users/me/pin", "POST", self)(args, options),
getPinnedResourcesMe: (_a, options) => {
var { resourceType } = _a, args = __rest(_a, ["resourceType"]);
return (0, GenericAPIFn_1.GenericAPIFn)(`/new/v2.0/users/me/pinned?${(0, query_1.stringifyQuery)({ resourceType })}`, "GET", self)(args, options);
}
};
}
exports.AdministrationAPIGroup_2_0 = AdministrationAPIGroup_2_0;
//# sourceMappingURL=AdministrationAPIGroup_2_0.js.map