UNPKG

@crowdin/crowdin-api-client

Version:
51 lines (50 loc) 2.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SecurityLogs = void 0; const core_1 = require("../core"); class SecurityLogs extends core_1.CrowdinApi { /** * @param options optional parameters for the request * @see https://support.crowdin.com/enterprise/api/#operation/api.projects.workflow-steps.getMany */ listOrganizationSecurityLogs(options) { let url = `${this.url}/security-logs`; url = this.addQueryParam(url, 'event', options === null || options === void 0 ? void 0 : options.event); url = this.addQueryParam(url, 'createdAfter', options === null || options === void 0 ? void 0 : options.createdAfter); url = this.addQueryParam(url, 'createdBefore', options === null || options === void 0 ? void 0 : options.createdBefore); url = this.addQueryParam(url, 'ipAddress', options === null || options === void 0 ? void 0 : options.ipAddress); url = this.addQueryParam(url, 'userId', options === null || options === void 0 ? void 0 : options.userId); return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); } /** * @param securityLogId security log identifier * @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.security-logs.get */ getOrganizationSecurityLog(securityLogId) { const url = `${this.url}/security-logs/${securityLogId}`; return this.get(url, this.defaultConfig()); } /** * @param userId user identifier * @param options optional parameters for the request * @see https://developer.crowdin.com/api/v2/#operation/api.users.security-logs.getMany */ listUserSecurityLogs(userId, options) { let url = `${this.url}/users/${userId}/security-logs`; url = this.addQueryParam(url, 'event', options === null || options === void 0 ? void 0 : options.event); url = this.addQueryParam(url, 'createdAfter', options === null || options === void 0 ? void 0 : options.createdAfter); url = this.addQueryParam(url, 'createdBefore', options === null || options === void 0 ? void 0 : options.createdBefore); url = this.addQueryParam(url, 'ipAddress', options === null || options === void 0 ? void 0 : options.ipAddress); return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); } /** * @param userId security log identifier * @param securityLogId security log identifier * @see https://developer.crowdin.com/api/v2/#operation/api.users.security-logs.get */ getUserSecurityLog(userId, securityLogId) { const url = `${this.url}/users/${userId}/security-logs/${securityLogId}`; return this.get(url, this.defaultConfig()); } } exports.SecurityLogs = SecurityLogs;