"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseLimiter = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ class BaseLimiter { constructor(params) { (0, _defineProperty2.default)(this, "limit", void 0); (0, _defineProperty2.default)(this, "errorMessage", void 0); this.limit = params.limit; this.errorMessage = makeErrorMessage(this.limit, params.attachmentNoun); } } exports.BaseLimiter = BaseLimiter; const makeErrorMessage = (limit, noun) => { return `Case has reached the maximum allowed number (${limit}) of attached ${noun}.`; };