Optional account call limits (#162)

* add optional account limits with env var

* add env sample and comment

* fix typo in selecti selection of unit

* apply review comments

Co-authored-by: eglehelms <e.helms@cognigy.com>
This commit is contained in:
EgleHandeglehelms authored and GitHub committed 2022-12-10 12:00:02 -05:00
1 parent 6a82102b43
commit 86703dabfb
4 files changed
+77 -9

No files matched your search

+28 -2
View File
@@ -1,5 +1,6 @@
import type {
LimitField,
LimitUnitOption,
PasswordSettings,
SipGateway,
SmppGateway,
@@ -123,10 +124,9 @@ export const WEBHOOK_METHODS: WebhookOption[] = [
];
/** Various system limits */
/** For now we are only supporting `voice_call_session` */
export const LIMITS: LimitField[] = [
{
label: "Max concurrent calls (0=unlimited)",
label: "Max calls",
category: "voice_call_session",
},
// {
@@ -137,6 +137,32 @@ export const LIMITS: LimitField[] = [
// label: "Max api calls per minute (0=unlimited)",
// category: "api_rate",
// },
{
label: "Licensed calls",
category: "voice_call_session_license",
},
{
label: "Max minutes",
category: "voice_call_minutes",
},
{
label: "Licensed minutes",
category: "voice_call_minutes_license",
},
];
export const LIMIT_MINS = "minutes";
export const LIMIT_SESS = "sessions";
export const LIMIT_UNITS: LimitUnitOption[] = [
{
name: "Sessions",
value: LIMIT_SESS,
},
{
name: "Minutes",
value: LIMIT_MINS,
},
];
export const DEFAULT_PSWD_SETTINGS: PasswordSettings = {
+14 -2
View File
@@ -8,10 +8,22 @@ export type CredentialStatus = "ok" | "fail" | "not tested";
export type IpType = "ip" | "fqdn" | "fqdn-top-level" | "invalid";
export type LimitCategories = "api_rate" | "voice_call_session" | "device";
export type LimitCategories =
| "api_rate"
| "voice_call_session"
| "device"
| "voice_call_minutes_license"
| "voice_call_minutes"
| "voice_call_session_license";
export type LimitUnit = "Sessions" | "Minutes";
export interface LimitUnitOption {
name: LimitUnit;
value: Lowercase<LimitUnit>;
}
/** User roles / permissions */
export type UserScopes = "admin" | "service_provider" | "account";
export type UserPermissions =