web / lib/constants/quota-constants
lib/constants/quota-constants
Constants for the quota system.
This file defines trust levels, default quotas, and quota-related constants used throughout the application to control resource usage and enforce limits.
Interfaces
UserQuotas
User quota configuration interface.
Properties
maxActiveSchedules
maxActiveSchedules:
number
maxUrlFetchesPerDay
maxUrlFetchesPerDay:
number
maxFileUploadsPerDay
maxFileUploadsPerDay:
number
maxEventsPerImport
maxEventsPerImport:
number
maxTotalEvents
maxTotalEvents:
number
maxImportJobsPerDay
maxImportJobsPerDay:
number
maxFileSizeMB
maxFileSizeMB:
number
maxCatalogsPerUser
maxCatalogsPerUser:
number
UserUsage
User usage tracking interface.
Properties
currentActiveSchedules
currentActiveSchedules:
number
urlFetchesToday
urlFetchesToday:
number
fileUploadsToday
fileUploadsToday:
number
importJobsToday
importJobsToday:
number
totalEventsCreated
totalEventsCreated:
number
currentCatalogs
currentCatalogs:
number
lastResetDate
lastResetDate:
string
Type Aliases
TrustLevel
TrustLevel = typeof
TRUST_LEVELS[keyof typeofTRUST_LEVELS]
QuotaType
QuotaType = typeof
QUOTA_TYPES[keyof typeofQUOTA_TYPES]
UsageType
UsageType = typeof
USAGE_TYPES[keyof typeofUSAGE_TYPES]
Variables
TRUST_LEVELS
constTRUST_LEVELS:object
Trust levels for users, determining their access and resource limits.
Type declaration
UNTRUSTED
readonlyUNTRUSTED:0=0
BASIC
readonlyBASIC:1=1
REGULAR
readonlyREGULAR:2=2
TRUSTED
readonlyTRUSTED:3=3
POWER_USER
readonlyPOWER_USER:4=4
UNLIMITED
readonlyUNLIMITED:5=5
DEFAULT_QUOTAS
constDEFAULT_QUOTAS:Record<TrustLevel,UserQuotas>
Default quotas for each trust level. -1 indicates unlimited.
TRUST_LEVEL_LABELS
constTRUST_LEVEL_LABELS:Record<TrustLevel,string>
Trust level labels for UI display.
TRUST_LEVEL_DESCRIPTIONS
constTRUST_LEVEL_DESCRIPTIONS:Record<TrustLevel,string>
Trust level descriptions for UI tooltips.
QUOTA_TYPES
constQUOTA_TYPES:object
Quota type identifiers for tracking and error messages.
Type declaration
ACTIVE_SCHEDULES
readonlyACTIVE_SCHEDULES:"maxActiveSchedules"="maxActiveSchedules"
URL_FETCHES_PER_DAY
readonlyURL_FETCHES_PER_DAY:"maxUrlFetchesPerDay"="maxUrlFetchesPerDay"
FILE_UPLOADS_PER_DAY
readonlyFILE_UPLOADS_PER_DAY:"maxFileUploadsPerDay"="maxFileUploadsPerDay"
EVENTS_PER_IMPORT
readonlyEVENTS_PER_IMPORT:"maxEventsPerImport"="maxEventsPerImport"
TOTAL_EVENTS
readonlyTOTAL_EVENTS:"maxTotalEvents"="maxTotalEvents"
IMPORT_JOBS_PER_DAY
readonlyIMPORT_JOBS_PER_DAY:"maxImportJobsPerDay"="maxImportJobsPerDay"
FILE_SIZE_MB
readonlyFILE_SIZE_MB:"maxFileSizeMB"="maxFileSizeMB"
CATALOGS_PER_USER
readonlyCATALOGS_PER_USER:"maxCatalogsPerUser"="maxCatalogsPerUser"
USAGE_TYPES
constUSAGE_TYPES:object
Usage type identifiers for tracking.
Type declaration
CURRENT_ACTIVE_SCHEDULES
readonlyCURRENT_ACTIVE_SCHEDULES:"currentActiveSchedules"="currentActiveSchedules"
URL_FETCHES_TODAY
readonlyURL_FETCHES_TODAY:"urlFetchesToday"="urlFetchesToday"
FILE_UPLOADS_TODAY
readonlyFILE_UPLOADS_TODAY:"fileUploadsToday"="fileUploadsToday"
IMPORT_JOBS_TODAY
readonlyIMPORT_JOBS_TODAY:"importJobsToday"="importJobsToday"
TOTAL_EVENTS_CREATED
readonlyTOTAL_EVENTS_CREATED:"totalEventsCreated"="totalEventsCreated"
CURRENT_CATALOGS
readonlyCURRENT_CATALOGS:"currentCatalogs"="currentCatalogs"
RATE_LIMITS_BY_TRUST_LEVEL
constRATE_LIMITS_BY_TRUST_LEVEL:object
Rate limit configurations by trust level. Each level has progressively more generous limits.
Type declaration
0
readonly0:object
0.FILE_UPLOAD
readonlyFILE_UPLOAD:object
0.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:1;windowMs:number;name:"burst"; }, {limit:1;windowMs:number;name:"hourly"; }, {limit:1;windowMs:number;name:"daily"; }]
0.API_GENERAL
readonlyAPI_GENERAL:object
0.API_GENERAL.windows
readonlywindows: readonly [{limit:1;windowMs:1000;name:"burst"; }, {limit:10;windowMs:number;name:"hourly"; }]
1
readonly1:object
1.FILE_UPLOAD
readonlyFILE_UPLOAD:object
1.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:1;windowMs:number;name:"burst"; }, {limit:3;windowMs:number;name:"hourly"; }, {limit:3;windowMs:number;name:"daily"; }]
1.API_GENERAL
readonlyAPI_GENERAL:object
1.API_GENERAL.windows
readonlywindows: readonly [{limit:2;windowMs:1000;name:"burst"; }, {limit:30;windowMs:number;name:"hourly"; }]
2
readonly2:object
2.FILE_UPLOAD
readonlyFILE_UPLOAD:object
2.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:1;windowMs:number;name:"burst"; }, {limit:5;windowMs:number;name:"hourly"; }, {limit:20;windowMs:number;name:"daily"; }]
2.API_GENERAL
readonlyAPI_GENERAL:object
2.API_GENERAL.windows
readonlywindows: readonly [{limit:5;windowMs:1000;name:"burst"; }, {limit:50;windowMs:number;name:"hourly"; }]
3
readonly3:object
3.FILE_UPLOAD
readonlyFILE_UPLOAD:object
3.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:2;windowMs:number;name:"burst"; }, {limit:20;windowMs:number;name:"hourly"; }, {limit:50;windowMs:number;name:"daily"; }]
3.API_GENERAL
readonlyAPI_GENERAL:object
3.API_GENERAL.windows
readonlywindows: readonly [{limit:10;windowMs:1000;name:"burst"; }, {limit:200;windowMs:number;name:"hourly"; }]
4
readonly4:object
4.FILE_UPLOAD
readonlyFILE_UPLOAD:object
4.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:5;windowMs:number;name:"burst"; }, {limit:100;windowMs:number;name:"hourly"; }, {limit:200;windowMs:number;name:"daily"; }]
4.API_GENERAL
readonlyAPI_GENERAL:object
4.API_GENERAL.windows
readonlywindows: readonly [{limit:20;windowMs:1000;name:"burst"; }, {limit:1000;windowMs:number;name:"hourly"; }]
5
readonly5:object
5.FILE_UPLOAD
readonlyFILE_UPLOAD:object
5.FILE_UPLOAD.windows
readonlywindows: readonly [{limit:10;windowMs:1000;name:"burst"; }, {limit:1000;windowMs:number;name:"hourly"; }]
5.API_GENERAL
readonlyAPI_GENERAL:object
5.API_GENERAL.windows
readonlywindows: readonly [{limit:100;windowMs:1000;name:"burst"; }, {limit:10000;windowMs:number;name:"hourly"; }]
QUOTA_ERROR_MESSAGES
constQUOTA_ERROR_MESSAGES:Record<QuotaType, (current,limit) =>string>
Error messages for quota exceeded scenarios.