UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

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