repo_description: Parse Server for Node.js / Express
repo_topics: baas backend file-storage graphql graphql-api graphql-relay graphql-server hacktoberfest mbaas mongodb nodejs notifications object-storage parse-platform parse-server postgres relay rest-api
code: // @flow
  import { AnalyticsAdapter } from '../Adapters/Analytics/AnalyticsAdapter';
  import { CacheAdapter } from '../Adapters/Cache/CacheAdapter';
  import { MailAdapter } from '../Adapters/Email/MailAdapter';
  import { FilesAdapter } from '../Adapters/Files/FilesAdapter';
  import { LoggerAdapter } from '../Adapters/Logger/LoggerAdapter';
  import { PubSubAdapter } from '../Adapters/PubSub/PubSubAdapter';
  import { StorageAdapter } from '../Adapters/Storage/StorageAdapter';
  import { WSSAdapter } from '../Adapters/WebSocketServer/WSSAdapter';
  import { CheckGroup } from '../Security/CheckGroup';
  
  export interface SchemaOptions {
    /* Rest representation on Parse.Schema https://docs.parseplatform.org/rest/guide/#adding-a-schema
    :DEFAULT: [] */
    definitions: any;
    /* Is true if Parse Server should exit if schema update fail.
    :DEFAULT: false */
    strict: ?boolean;
    /* Is true if Parse Server should delete any fields not defined in a schema definition. This should only be used during development.
    :DEFAULT: false */
    deleteExtraFields: ?boolean;
    /* Is true if Parse Server should recreate any fields that are different between the current database schema and theschema definition. This should only be used during development.
    :DEFAULT: false */
    recreateModifiedFields: ?boolean;
    /* Is true if Parse Server will reject any attempts to modify the schema while the server is running.
    :DEFAULT: false */
    lockSchemas: ?boolean;
    /* (Optional) Keep indexes that are present in the database but not defined in the schema. Set this to `true` if you are adding indexes manually, so that they won't be removed when running schema migration. Default is `false`.
    :DEFAULT: false */
    keepUnknownIndexes: ?boolean;
    /* Execute a callback before running schema migrations. */
    beforeMigration: ?() => void | Promise<void>;
    /* Execute a callback after running schema migrations. */
    afterMigration: ?() => void | Promise<void>;
  }
  
  type Adapter<T> = string | any | T;
  type NumberOrBoolean = number | boolean;
  type NumberOrString = number | string;
  type ProtectedFields = any;
  type StringOrStringArray = string | string[];
  type RequestKeywordDenylist = {
    key: string | any,
    value: any,
  };
  type EmailVerificationRequest = {
    original?: any,
    object: any,
    master?: boolean,
    ip?: string,
    installationId?: string,
    createdWith?: {
      action: 'login' | 'signup',
      authProvider: string,
    },
    resendRequest?: boolean,
  };
  type SendEmailVerificationRequest = {
    user: any,
    master?: boolean,
  };
  
  export interface ParseServerOptions {
    /* Your Parse Application ID
    :ENV: PARSE_SERVER_APPLICATION_ID */
    appId: string;
    /* Your Parse Master Key */
    masterKey: (() => void) | string;
    /* (Optional) The duration in seconds for which the current `masterKey` is being used before it is requested again if `masterKey` is set to a function. If `masterKey` is not set to a function, this option has no effect. Default is `0`, which means the master key is requested by invoking the  `masterKey` function every time the master key is used internally by Parse Server. */
    masterKeyTtl: ?number;
    /* (Optional) The maintenance key is used for modifying internal and read-only fields of Parse Server.<br><br>⚠️ This key is not intended to be used as part of a regular operation of Parse Server. This key is intended to conduct out-of-band changes such as one-time migrations or data correction tasks. Internal fields are not officially documented and may change at any time without publication in release changelogs. We strongly advice not to rely on internal fields as part of your regular operation and to investigate the implications of any planned changes *directly in the source code* of your current version of Parse Server. */
    maintenanceKey: string;
    /* The URL to Parse Server.<br><br>⚠️ Certain server features or adapters may require Parse Server to be able to call itself by making requests to the URL set in `serverURL`. If a feature requires this, it is mentioned in the documentation. In that case ensure that the URL is accessible from the server itself.
    :ENV: PARSE_SERVER_URL */
    serverURL: string;
    /* Parse Server makes a HTTP request to the URL set in `serverURL` at the end of its launch routine to verify that the launch succeeded. If this option is set to `false`, the verification will be skipped. This can be useful in environments where the server URL is not accessible from the server itself, such as when running behind a firewall or in certain containerized environments.<br><br>⚠️ Server URL verification requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Default is `true`.
    :DEFAULT: true */
    verifyServerUrl: ?boolean;
    /* (Optional) Restricts the use of master key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the master key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the master key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `"0.0.0.0/0,::0"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['127.0.0.1', '::1']` which means that only `localhost`, the server instance on which Parse Server runs, is allowed to use the master key.
    :DEFAULT: ["127.0.0.1","::1"] */
    masterKeyIps: ?(string[]);
    /* (Optional) Restricts external client access to a list of allowed API routes.<br><br>When this option is set, all external non-master-key requests are denied by default. Only routes matching at least one of the configured regex patterns are allowed through. Internal calls from Cloud Code, Cloud Jobs, and triggers are not affected.<br><br>Each entry is a regex pattern string matched against the normalized route identifier (request path with mount prefix and leading slash stripped). Patterns are auto-anchored with `^` and `$` for full-match semantics.<br><br><b>Examples of normalized route identifiers:</b><ul><li>`classes/GameScore` (class CRUD)</li><li>`classes/GameScore/abc123` (object by ID)</li><li>`users` (user operations)</li><li>`login` (login endpoint)</li><li>`functions/sendEmail` (Cloud Function)</li><li>`jobs/cleanup` (Cloud Job)</li><li>`push` (push notifications)</li><li>`config` (client config)</li><li>`installations` (installations)</li><li>`files/picture.jpg` (file operations)</li></ul><b>Example patterns:</b><ul><li>`classes/ChatMessage` matches only `classes/ChatMessage`</li><li>`classes/Chat.*` matches `classes/ChatMessage`, `classes/ChatRoom`, etc.</li><li>`functions/.*` matches all Cloud Functions</li></ul>Setting an empty array `[]` blocks all external non-master-key requests (full lockdown).<br><br>When setting the option via an environment variable, the notation is a comma-separated string, for example `"classes/ChatMessage,users,functions/.*"`.<br><br>Defaults to `undefined` which means the feature is inactive and all routes are accessible. */
    routeAllowList: ?(string[]);
    /* (Optional) Restricts the use of maintenance key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the maintenance key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the maintenance key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `"0.0.0.0/0,::0"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['127.0.0.1', '::1']` which means that only `localhost`, the server instance on which Parse Server runs, is allowed to use the maintenance key.
    :DEFAULT: ["127.0.0.1","::1"] */
    maintenanceKeyIps: ?(string[]);
    /* (Optional) Restricts the use of read-only master key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the read-only master key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the read-only master key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `"0.0.0.0/0,::0"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['0.0.0.0/0', '::0']` which means that any IP address is allowed to use the read-only master key. It is recommended to set this option to `['127.0.0.1', '::1']` to restrict access to `localhost`.
    :DEFAULT: ["0.0.0.0/0","::0"] */
    readOnlyMasterKeyIps: ?(string[]);
    /* Sets the app name */
    appName: ?string;
    /* Add headers to Access-Control-Allow-Headers */
    allowHeaders: ?(string[]);
    /* Sets origins for Access-Control-Allow-Origin. This can be a string for a single origin or an array of strings for multiple origins. */
    allowOrigin: ?StringOrStringArray;
    /* Adapter module for the analytics */
    analyticsAdapter: ?Adapter<AnalyticsAdapter>;
    /* Adapter module for the files sub-system */
    filesAdapter: ?Adapter<FilesAdapter>;
    /* Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications */
    push: ?any;
    /* Configuration for push scheduling, defaults to false.
    :DEFAULT: false */
    scheduledPush: ?boolean;
    /* Adapter module for the logging sub-system */
    loggerAdapter: ?Adapter<LoggerAdapter>;
    /* Log as structured JSON objects
    :ENV: JSON_LOGS */
    jsonLogs: ?boolean;
    /* Folder for the logs (defaults to './logs'); set to null to disable file based logging
    :ENV: PARSE_SERVER_LOGS_FOLDER
    :DEFAULT: ./logs */
    logsFolder: ?string;
    /* Set the logging to verbose
    :ENV: VERBOSE */
    verbose: ?boolean;
    /* Sets the level for logs */
    logLevel: ?string;
    /* (Optional) Overrides the log levels used internally by Parse Server to log events.
    :DEFAULT: {} */
    logLevels: ?LogLevels;
    /* Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: null) */
    maxLogFiles: ?NumberOrString;
    /* Disables console output
    :ENV: SILENT */
    silent: ?boolean;
    /* The full URI to your database. Supported databases are mongodb or postgres.
    :DEFAULT: mongodb://localhost:27017/parse */
    databaseURI: string;
    /* Options to pass to the database client
    :ENV: PARSE_SERVER_DATABASE_OPTIONS */
    databaseOptions: ?DatabaseOptions;
    /* Adapter module for the database; any options that are not explicitly described here are passed directly to the database client. */
    databaseAdapter: ?Adapter<StorageAdapter>;
    /* Optional. If set to `true`, the collation rule of case comparison for queries and indexes is enabled. Enable this option to run Parse Server with MongoDB Atlas Serverless or AWS Amazon DocumentDB. If `false`, the collation rule of case comparison is disabled. Default is `false`.
    :DEFAULT: false */
    enableCollationCaseComparison: ?boolean;
    /* Optional. If set to `true`, the `email` property of a user is automatically converted to lowercase before being stored in the database. Consequently, queries must match the case as stored in the database, which would be lowercase in this scenario. If `false`, the `email` property is stored as set, without any case modifications. Default is `false`.
    :DEFAULT: false */
    convertEmailToLowercase: ?boolean;
    /* Optional. If set to `true`, the `username` property of a user is automatically converted to lowercase before being stored in the database. Consequently, queries must match the case as stored in the database, which would be lowercase in this scenario. If `false`, the `username` property is stored as set, without any case modifications. Default is `false`.
    :DEFAULT: false */
    convertUsernameToLowercase: ?boolean;
    /* Full path to your cloud code main.js */
    cloud: ?string;
    /* A collection prefix for the classes
    :DEFAULT: '' */
    collectionPrefix: ?string;
    /* Key for iOS, MacOS, tvOS clients */
    clientKey: ?string;
    /* Key for the Javascript SDK */
    javascriptKey: ?string;
    /* Key for Unity and .Net SDK */
    dotNetKey: ?string;
    /* Key for encrypting your files
    :ENV: PARSE_SERVER_ENCRYPTION_KEY */
    encryptionKey: ?string;
    /* Key for REST calls
    :ENV: PARSE_SERVER_REST_API_KEY */
    restAPIKey: ?string;
    /* Read-only key, which has the same capabilities as MasterKey without writes */
    readOnlyMasterKey: ?string;
    /* Key sent with outgoing webhook calls */
    webhookKey: ?string;
    /* Key for your files */
    fileKey: ?string;
    /* Enable (or disable) the addition of a unique hash to the file names
    :ENV: PARSE_SERVER_PRESERVE_FILE_NAME
    :DEFAULT: false */
    preserveFileName: ?boolean;
    /* Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields */
    userSensitiveFields: ?(string[]);
    /* Fields per class that are hidden from query results for specific user groups. Protected fields are stripped from the server response, but can still be used internally (e.g. in Cloud Code triggers). Configure as `{ 'ClassName': { 'UserGroup': ['field1', 'field2'] } }` where `UserGroup` is one of: `'*'` (all users), `'authenticated'` (authenticated users), `'role:RoleName'` (users with a specific role), `'userField:FieldName'` (users referenced by a pointer field), or a user `objectId` to target a specific user. When multiple groups apply, the intersection of their protected fields is used. Any field can be protected, including system fields like `createdAt` and `updatedAt`. By default, `email` is protected on the `_User` class for all users. On the `_User` class, the object owner is exempt from protected fields by default; see `protectedFieldsOwnerExempt` to change this.
    :DEFAULT: {"_User": {"*": ["email"]}} */
    protectedFields: ?ProtectedFields;
    /* Whether the `_User` class is exempt from `protectedFields` when the logged-in user queries their own user object. If `true` (default), a user can see all their own fields regardless of `protectedFields` configuration; default protected fields (e.g. `email`) are merged into any custom `protectedFields` configuration. If `false`, `protectedFields` applies equally to the user's own object, consistent with all other classes; only explicitly configured protected fields apply, defaults are not merged. Defaults to `true`.
    :ENV: PARSE_SERVER_PROTECTED_FIELDS_OWNER_EXEMPT
    :DEFAULT: true */
    protectedFieldsOwnerExempt: ?boolean;
    /* Whether Cloud Code triggers (e.g. `beforeSave`, `afterSave`) are exempt from `protectedFields`. If `true`, triggers receive the full object including protected fields in `request.object` and `request.original`, regardless of the caller's auth context. If `false`, protected fields are stripped from the original object fetch used to build trigger objects. Defaults to `false`.
    :ENV: PARSE_SERVER_PROTECTED_FIELDS_TRIGGER_EXEMPT
    :DEFAULT: false */
    protectedFieldsTriggerExempt: ?boolean;
    /* Whether save operation responses (create, update) are exempt from `protectedFields`. If `true` (default), protected fields modified during a save are included in the response to the client. If `false`, protected fields are stripped from save responses, consistent with how they are stripped from query results. Defaults to `true`.
    :ENV: PARSE_SERVER_PROTECTED_FIELDS_SAVE_RESPONSE_EXEMPT
    :DEFAULT: true */
    protectedFieldsSaveResponseExempt: ?boolean;
    /* Enable (or disable) anonymous users, defaults to true
    :ENV: PARSE_SERVER_ENABLE_ANON_USERS
    :DEFAULT: true */
    enableAnonymousUsers: ?boolean;
    /* Enable (or disable) client class creation, defaults to false
    :ENV: PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION
    :DEFAULT: false */
    allowClientClassCreation: ?boolean;
    /* Enable (or disable) custom objectId
    :ENV: PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID
    :DEFAULT: false */
    allowCustomObjectId: ?boolean;
    /* Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication<br><br>Provider names must start with a letter and contain only letters, digits, and underscores (`/^[A-Za-z][A-Za-z0-9_]*$/`). This is because each provider name is used to construct a database field (`_auth_data_<provider>`), which must comply with Parse Server's field naming rules.
    :ENV: PARSE_SERVER_AUTH_PROVIDERS */
    auth: ?{ [string]: AuthAdapter };
    /* Optional. Enables insecure authentication adapters. Insecure auth adapters are deprecated and will be removed in a future version. Defaults to `false`.
    :ENV: PARSE_SERVER_ENABLE_INSECURE_AUTH_ADAPTERS
    :DEFAULT: false */
    enableInsecureAuthAdapters: ?boolean;
    /* Max file size for uploads, defaults to 20mb
    :DEFAULT: 20mb */
    maxUploadSize: ?string;
    /* Set to `true` to require users to verify their email address to complete the sign-up process. Supports a function with a return value of `true` or `false` for conditional verification. The function receives a request object that includes `createdWith` to indicate whether the invocation is for `signup` or `login` and the used auth provider.
    <br><br>
    The `createdWith` values per scenario:
    <ul><li>Password signup: `{ action: 'signup', authProvider: 'password' }`</li><li>Auth provider signup: `{ action: 'signup', authProvider: '<provider>' }`</li><li>Password login: `{ action: 'login', authProvider: 'password' }`</li><li>Auth provider login: function not invoked; auth provider login bypasses email verification</li><li>Resend verification email: `createdWith` is `undefined`; use the `resendRequest` property to identify those</li></ul>
    Default is `false`.
    :DEFAULT: false */
    verifyUserEmails: ?(boolean | (EmailVerificationRequest => boolean | Promise<boolean>));
    /* Set to `true` to prevent a user from logging in if the email has not yet been verified and email verification is required. Supports a function with a return value of `true` or `false` for conditional prevention. The function receives a request object that includes `createdWith` to indicate whether the invocation is for `signup` or `login` and the used auth provider.
    <br><br>
    The `createdWith` values per scenario:
    <ul><li>Password signup: `{ action: 'signup', authProvider: 'password' }`</li><li>Auth provider signup: `{ action: 'signup', authProvider: '<provider>' }`</li><li>Password login: `{ action: 'login', authProvider: 'password' }`</li><li>Auth provider login: function not invoked; auth provider login bypasses email verification</li></ul>
    Default is `false`.
    <br>
    Requires option `verifyUserEmails: true`.
    :DEFAULT: false */
    preventLoginWithUnverifiedEmail: ?(
      | boolean
      | (EmailVerificationRequest => boolean | Promise<boolean>)
    );
    /* If set to `true` it prevents a user from signing up if the email has not yet been verified and email verification is required. In that case the server responds to the sign-up with HTTP status 400 and a Parse Error 205 `EMAIL_NOT_FOUND`. If set to `false` the server responds with HTTP status 200, and client SDKs return an unauthenticated Parse User without session token. In that case subsequent requests fail until the user's email address is verified.
    <br><br>
    Default is `false`.
    <br>
    Requires option `verifyUserEmails: true`.
    :DEFAULT: false */
    preventSignupWithUnverifiedEmail: ?boolean;
    /* Set the validity duration of the email verification token in seconds after which the token expires. The token is used in the link that is set in the email. After the token expires, the link becomes invalid and a new link has to be sent. If the option is not set or set to `undefined`, then the token never expires.
    <br><br>
    For example, to expire the token after 2 hours, set a value of 7200 seconds (= 60 seconds * 60 minutes * 2 hours).
    <br><br>
    Default is `undefined`.
    <br>
    Requires option `verifyUserEmails: true`.
    */
    emailVerifyTokenValidityDuration: ?number;
    /* Set to `true` if a email verification token should be reused in case another token is requested but there is a token that is still valid, i.e. has not expired. This avoids the often observed issue that a user requests multiple emails and does not know which link contains a valid token because each newly generated token would invalidate the previous token.
    <br><br>
    Default is `false`.
    <br>
    Requires option `verifyUserEmails: true`.
    :DEFAULT: false */
    emailVerifyTokenReuseIfValid: ?boolean;
    /* Set to `true` if a request to verify the email should return a success response even if the provided email address does not belong to a verifiable account, for example because it is unknown or already verified, or `false` if the request should return an error response in those cases.
    <br><br>
    Default is `true`.
    <br>
    Requires option `verifyUserEmails: true`.
    :DEFAULT: true */
    emailVerifySuccessOnInvalidEmail: ?boolean;
    /* Set to `false` to prevent sending of verification email. Supports a function with a return value of `true` or `false` for conditional email sending.
    <br><br>
    Default is `true`.
    <br>
    :DEFAULT: true */
    sendUserEmailVerification: ?(
      | boolean
      | (SendEmailVerificationRequest => boolean | Promise<boolean>)
    );
    /* The account lockout policy for failed login attempts.
    <br><br>
    Note: Setting a user's ACL to an empty object `{}` via master key is a separate mechanism that only prevents new logins; it does not invalidate existing session tokens. To immediately revoke a user's access, destroy their sessions via master key in addition to setting the ACL. */
    accountLockout: ?AccountLockoutOptions;
    /* The password policy for enforcing password related rules. */
    passwordPolicy: ?PasswordPolicyOptions;
    /* Adapter module for the cache */
    cacheAdapter: ?Adapter<CacheAdapter>;
    /* Adapter module for email sending */
    emailAdapter: ?Adapter<MailAdapter>;
    /* Optional. The public URL to Parse Server. This URL will be used to reach Parse Server publicly for features like password reset and email verification links. The option can be set to a string or a function that can be asynchronously resolved. The returned URL string must start with `http://` or `https://`.
    :ENV: PARSE_PUBLIC_SERVER_URL */
    publicServerURL: ?(string | (() => string) | (() => Promise<string>));
    /* The options for pages such as password reset and email verification.
    :DEFAULT: {} */
    pages: ?PagesOptions;
    /* custom pages for password validation and reset
    :DEFAULT: {} */
    customPages: ?CustomPagesOptions;
    /* parse-server's LiveQuery configuration object */
    liveQuery: ?LiveQueryOptions;
    /* Session duration, in seconds, defaults to 1 year
    :DEFAULT: 31536000 */
    sessionLength: ?number;
    /* Whether Parse Server should automatically extend a valid session by the sessionLength. In order to reduce the number of session updates in the database, a session will only be extended when a request is received after at least half of the current session's lifetime has passed.
    :DEFAULT: false */
    extendSessionOnUse: ?boolean;
    /* Default value for limit option on queries, defaults to `100`.
    :DEFAULT: 100 */
    defaultLimit: ?number;
    /* Max value for limit option on queries, defaults to unlimited */
    maxLimit: ?number;
    /* Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.
    :DEFAULT: true */
    expireInactiveSessions: ?boolean;
    /* When a user changes their password, either through the reset password email or while logged in, all sessions are revoked if this is true. Set to false if you don't want to revoke sessions.
    :DEFAULT: true */
    revokeSessionOnPasswordReset: ?boolean;
    /* Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)
    :DEFAULT: 5000 */
    cacheTTL: ?number;
    /* Sets the maximum size for the in memory cache, defaults to 10000
    :DEFAULT: 10000 */
    cacheMaxSize: ?number;
    /* Set to `true` if Parse requests within the same Node.js environment as Parse Server should be routed to Parse Server directly instead of via the HTTP interface. Default is `false`.
    <br><br>
    If set to `false` then Parse requests within the same Node.js environment as Parse Server are executed as HTTP requests sent to Parse Server via the `serverURL`. For example, a `Parse.Query` in Cloud Code is calling Parse Server via a HTTP request. The server is essentially making a HTTP request to itself, unnecessarily using network resources such as network ports.
    <br><br>
    ⚠️ In environments where multiple Parse Server instances run behind a load balancer and Parse requests within the current Node.js environment should be routed via the load balancer and distributed as HTTP requests among all instances via the `serverURL`, this should be set to `false`.
    :DEFAULT: true */
    directAccess: ?boolean;
    /* Enables the default express error handler for all errors
    :DEFAULT: false */
    enableExpressErrorHandler: ?boolean;
    /* Deprecated. Enables the legacy product purchase API including the `_Product` class and the `/validate_purchase` endpoint. This is an undocumented, unmaintained legacy feature inherited from the original Parse platform that may not function as expected. We strongly advise against using it. It will be removed in a future major version.
    :ENV: PARSE_SERVER_ENABLE_PRODUCT_PURCHASE_LEGACY_API
    :DEFAULT: true */
    enableProductPurchaseLegacyApi: ?boolean;
    /* Sets the number of characters in generated object id's, default 10
    :DEFAULT: 10 */
    objectIdSize: ?number;
    /* The port to run the ParseServer, defaults to 1337.
    :ENV: PORT
    :DEFAULT: 1337 */
    port: ?number;
    /* The host to serve ParseServer on, defaults to 0.0.0.0
    :DEFAULT: 0.0.0.0 */
    host: ?string;
    /* Mount path for the server, defaults to /parse
    :DEFAULT: /parse */
    mountPath: ?string;
    /* Run with cluster, optionally set the number of processes default to os.cpus().length */
    cluster: ?NumberOrBoolean;
    /* middleware for express server, can be string or function */
    middleware: ?((() => void) | string);
    /* The trust proxy settings. It is important to understand the exact setup of the reverse proxy, since this setting will trust values provided in the Parse Server API request. See the <a href="https://expressjs.com/en/guide/behind-proxies.html">express trust proxy settings</a> documentation. Defaults to `false`.
    :DEFAULT: false */
    trustProxy: ?any;
    /* Starts the liveQuery server */
    startLiveQueryServer: ?boolean;
    /* Live query server configuration options (will start the liveQuery server) */
    liveQueryServerOptions: ?LiveQueryServerOptions;
    /* Options for request idempotency to deduplicate identical requests that may be caused by network issues. Caution, this is an experimental feature that may not be appropriate for production.
    :ENV: PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS
    :DEFAULT: false */
    idempotencyOptions: ?IdempotencyOptions;
    /* Options for file uploads
    :ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS
    :DEFAULT: {} */
    fileUpload: ?FileUploadOptions;
    /* Options for file downloads
    :ENV: PARSE_SERVER_FILE_DOWNLOAD_OPTIONS
    :DEFAULT: {} */
    fileDownload: ?FileDownloadOptions;
    /* Full path to your GraphQL custom schema.graphql file */
    graphQLSchema: ?string;
    /* Mounts the GraphQL endpoint
    :ENV: PARSE_SERVER_MOUNT_GRAPHQL
    :DEFAULT: false */
    mountGraphQL: ?boolean;
    /* The mount path for the GraphQL endpoint<br><br>⚠️ File upload inside the GraphQL mutation system requires Parse Server to be able to call itself by making requests to the URL set in `serverURL`.<br><br>Defaults is `/graphql`.
    :ENV: PARSE_SERVER_GRAPHQL_PATH
    :DEFAULT: /graphql */
    graphQLPath: ?string;
    /* Enable public introspection for the GraphQL endpoint, defaults to false
    :ENV: PARSE_SERVER_GRAPHQL_PUBLIC_INTROSPECTION
    :DEFAULT: false */
    graphQLPublicIntrospection: ?boolean;
    /* Deprecated. Mounts the GraphQL Playground which is deprecated and will be removed in a future version. The playground exposes the master key in the browser. Use Parse Dashboard as GraphQL IDE or configure a third-party GraphQL client with custom request headers.
    :ENV: PARSE_SERVER_MOUNT_PLAYGROUND
    :DEFAULT: false */
    mountPlayground: ?boolean;
    /* Deprecated. Mount path for the GraphQL Playground. The playground is deprecated and will be removed in a future version.
    :ENV: PARSE_SERVER_PLAYGROUND_PATH
    :DEFAULT: /playground */
    playgroundPath: ?string;
    /* Defined schema
    :ENV: PARSE_SERVER_SCHEMA
    */
    schema: ?SchemaOptions;
    /* Callback when server has closed */
    serverCloseComplete: ?() => void;
    /* Options to limit the complexity of requests to prevent denial-of-service attacks. Limits are enforced for all requests except those using the master or maintenance key. Each property can be set to `-1` to disable that specific limit.
    :ENV: PARSE_SERVER_REQUEST_COMPLEXITY
    :DEFAULT: {} */
    requestComplexity: ?RequestComplexityOptions;
    /* Query-related server defaults.
    :ENV: PARSE_SERVER_QUERY
    :DEFAULT: {} */
    query: ?QueryServerOptions;
    /* The security options to identify and report weak security settings.
    :DEFAULT: {} */
    security: ?SecurityOptions;
    /* Set to true if new users should be created without public read and write access.
    :DEFAULT: true */
    enforcePrivateUsers: ?boolean;
    /* Deprecated. This option will be removed in a future version. Auth providers are always validated on login. On update, if this is set to `true`, auth providers are only re-validated when the auth data has changed. If this is set to `false`, auth providers are re-validated on every update. Defaults to `false`.
    :DEFAULT: false */
    allowExpiredAuthDataToken: ?boolean;
    /* An array of keys and values that are prohibited in database read and write requests to prevent potential security vulnerabilities. It is possible to specify only a key (`{"key":"..."}`), only a value (`{"value":"..."}`) or a key-value pair (`{"key":"...","value":"..."}`). The specification can use the following types: `boolean`, `numeric` or `string`, where `string` will be interpreted as a regex notation. Request data is deep-scanned for matching definitions to detect also any nested occurrences. Defaults are patterns that are likely to be used in malicious requests. Setting this option will override the default patterns.
    :DEFAULT: [{"key":"_bsontype","value":"Code"},{"key":"constructor"},{"key":"__proto__"}] */
    requestKeywordDenylist: ?(RequestKeywordDenylist[]);
    /* Options to limit repeated requests to Parse Server APIs. This can be used to protect sensitive endpoints such as `/requestPasswordReset` from brute-force attacks or Parse Server as a whole from denial-of-service (DoS) attacks.<br><br>ℹ️ Mind the following limitations:<br>- rate limits applied per IP address; this limits protection against distributed denial-of-service (DDoS) attacks where many requests are coming from various IP addresses<br>- if multiple Parse Server instances are behind a load balancer or ran in a cluster, each instance will calculate it's own request rates, independent from other instances; this limits the applicability of this feature when using a load balancer and another rate limiting solution that takes requests across all instances into account may be more suitable<br>- this feature provides basic protection against denial-of-service attacks, but a more sophisticated solution works earlier in the request flow and prevents a malicious requests to even reach a server instance; it's therefore recommended to implement a solution according to architecture and use case.
    :DEFAULT: [] */
    rateLimit: ?(RateLimitOptions[]);
    /* Options to customize the request context using inversion of control/dependency injection.*/
    requestContextMiddleware: ?(req: any, res: any, next: any) => void;
    /* If set to `true`, error details are removed from error messages in responses to client requests, and instead a generic error message is sent. Default is `true`.
    :DEFAULT: true */
    enableSanitizedErrorResponse: ?boolean;
  }
  
  export interface RateLimitOptions {
    /* The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings or string patterns following <a href="https://github.com/pillarjs/path-to-regexp">path-to-regexp v8</a> syntax. */
    requestPath: string;
    /* The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied. */
    requestTimeWindow: ?number;
    /* The number of requests that can be made per IP address within the time window set in `requestTimeWindow` before the rate limit is applied. For batch requests, this also limits the number of sub-requests in a single batch that target this path; however, requests already consumed in the current time window are not counted against the batch, so the effective limit may be higher when combining individual and batch requests. Note that this is a basic server-level rate limit; for comprehensive protection, use a reverse proxy or WAF for rate limiting. */
    requestCount: ?number;
    /* The error message that should be returned in the body of the HTTP 429 response when the rate limit is hit. Default is `Too many requests.`.
    :DEFAULT: Too many requests. */
    errorResponseMessage: ?string;
    /* Optional, the HTTP request methods to which the rate limit should be applied, default is all methods. */
    requestMethods: ?(string[]);
    /* Optional, if `true` the rate limit will also apply to requests using the `masterKey`, default is `false`. Note that a public Cloud Code function that triggers internal requests using the `masterKey` may circumvent rate limiting and be vulnerable to attacks.
    :DEFAULT: false */
    includeMasterKey: ?boolean;
    /* Optional, if `true` the rate limit will also apply to requests that are made in by Cloud Code, default is `false`. Note that a public Cloud Code function that triggers internal requests may circumvent rate limiting and be vulnerable to attacks.
    :DEFAULT: false */
    includeInternalRequests: ?boolean;
    /* Optional, the URL of the Redis server to store rate limit data. This allows to rate limit requests for multiple servers by calculating the sum of all requests across all servers. This is useful if multiple servers are processing requests behind a load balancer. For example, the limit of 10 requests is reached if each of 2 servers processed 5 requests.
     */
    redisUrl: ?string;
    /* The type of rate limit to apply. The following types are supported:
    <ul>
    <li>`global`: rate limit based on the number of requests made by all users</li>
    <li>`ip`: rate limit based on the IP address of the request</li>
    <li>`user`: rate limit based on the user ID of the request</li>
    <li>`session`: rate limit based on the session token of the request</li>
    </ul>
    Default is `ip`.
    :DEFAULT: ip */
    zone: ?string;
  }
  
  export interface RequestComplexityOptions {
    /* Whether to allow the `$regex` query operator. Set to `false` to reject `$regex` in queries for non-master-key users. Default is `true`.
    :ENV: PARSE_SERVER_REQUEST_COMPLEXITY_ALLOW_REGEX
    :DEFAULT: true */
    allowRegex: ?boolean;
    /* Maximum depth of include pointer chains (e.g. `a.b.c` = depth 3). Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    includeDepth: ?number;
    /* Maximum number of include paths in a single query. Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    includeCount: ?number;
    /* Maximum nesting depth of `$inQuery`, `$notInQuery`, `$select`, `$dontSelect` subqueries. Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    subqueryDepth: ?number;
    /* Maximum number of results returned by a `$inQuery`, `$notInQuery`, `$select`, `$dontSelect` subquery. Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    subqueryLimit: ?number;
    /* Maximum nesting depth of `$or`, `$and`, `$nor` query operators. Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    queryDepth: ?number;
    /* Maximum depth of GraphQL field selections. Set to `-1` to disable. Default is `-1`.
    :ENV: PARSE_SERVER_REQUEST_COMPLEXITY_GRAPHQL_DEPTH
    :DEFAULT: -1 */
    graphQLDepth: ?number;
    /* Maximum number of field selections in a GraphQL query. Set to `-1` to disable. Default is `-1`.
    :ENV: PARSE_SERVER_REQUEST_COMPLEXITY_GRAPHQL_FIELDS
    :DEFAULT: -1 */
    graphQLFields: ?number;
    /* Maximum number of sub-requests in a single batch request. Set to `-1` to disable. Default is `-1`.
    :DEFAULT: -1 */
    batchRequestLimit: ?number;
  }
  
  export interface SecurityOptions {
    /* Is true if Parse Server should check for weak security settings.
    :DEFAULT: false */
    enableCheck: ?boolean;
    /* Is true if the security check report should be written to logs. This should only be enabled temporarily to not expose weak security settings in logs.
    :DEFAULT: false */
    enableCheckLog: ?boolean;
    /* The security check groups to run. This allows to add custom security checks or override existing ones. Default are the groups defined in `CheckGroups.js`. */
    checkGroups: ?(CheckGroup[]);
  }
  
  export interface QueryServerOptions {
    /* When `true`, all aggregation queries default to using MongoDB Extended JSON (EJSON) for explicit value typing and skip schema-based value coercion. Individual queries can still override this via the `rawValues` option. Default is `false`.
    :ENV: PARSE_SERVER_QUERY_AGGREGATION_RAW_VALUES
    :DEFAULT: false */
    aggregationRawValues: ?boolean;
    /* When `true`, all aggregation queries default to using native MongoDB field names (no automatic `createdAt` → `_created_at` rewriting). Individual queries can still override this via the `rawFieldNames` option. Default is `false`.
    :ENV: PARSE_SERVER_QUERY_AGGREGATION_RAW_FIELD_NAMES
    :DEFAULT: false */
    aggregationRawFieldNames: ?boolean;
  }
  
  export interface PagesOptions {
    /* Is true if pages should be localized; this has no effect on custom page redirects.
    :DEFAULT: false */
    enableLocalization: ?boolean;
    /* The path to the JSON file for localization; the translations will be used to fill template placeholders according to the locale. */
    localizationJsonPath: ?string;
    /* The fallback locale for localization if no matching translation is provided for the given locale. This is only relevant when providing translation resources via JSON file.
    :DEFAULT: en */
    localizationFallbackLocale: ?string;
    /* The placeholder keys and values which will be filled in pages; this can be a simple object or a callback function.
    :DEFAULT: {} */
    placeholders: ?Object;
    /* Is true if responses should always be redirects and never content, false if the response type should depend on the request type (GET request -> content response; POST request -> redirect response).
    :DEFAULT: false */
    forceRedirect: ?boolean;
    /* The path to the pages directory; this also defines where the static endpoint '/apps' points to. Default is the './public/' directory of the parse-server module. */
    pagesPath: ?string;
    /* The API endpoint for the pages. Default is 'apps'.
    :DEFAULT: apps */
    pagesEndpoint: ?string;
    /* The URLs to the custom pages.
    :DEFAULT: {} */
    customUrls: ?PagesCustomUrlsOptions;
    /* The custom routes.
    :DEFAULT: [] */
    customRoutes: ?(PagesRoute[]);
    /* Is `true` if the page parameter headers should be URI-encoded. This is required if any page parameter value contains non-ASCII characters, such as the app name.
    :DEFAULT: false */
    encodePageParamHeaders: ?boolean;
  }
  
  export interface PagesRoute {
    /* The route path. */
    path: string;
    /* The route method, e.g. 'GET' or 'POST'. */
    method: string;
    /* The route handler that is an async function. */
    handler: () => void;
  }
  
  export interface PagesCustomUrlsOptions {
    /* The URL to the custom page for password reset. */
    passwordReset: ?string;
    /* The URL to the custom page for password reset -> link invalid. */
    passwordResetLinkInvalid: ?string;
    /* The URL to the custom page for password reset -> success. */
    passwordResetSuccess: ?string;
    /* The URL to the custom page for email verification -> success. */
    emailVerificationSuccess: ?string;
    /* The URL to the custom page for email verification -> link send fail. */
    emailVerificationSendFail: ?string;
    /* The URL to the custom page for email verification -> resend link -> success. */
    emailVerificationSendSuccess: ?string;
    /* The URL to the custom page for email verification -> link invalid. */
    emailVerificationLinkInvalid: ?string;
    /* The URL to the custom page for email verification -> link expired. */
    emailVerificationLinkExpired: ?string;
  }
  
  export interface CustomPagesOptions {
    /* invalid link page path */
    invalidLink: ?string;
    /* verification link send fail page path */
    linkSendFail: ?string;
    /* choose password page path */
    choosePassword: ?string;
    /* verification link send success page path */
    linkSendSuccess: ?string;
    /* verify email success page path */
    verifyEmailSuccess: ?string;
    /* password reset success page path */
    passwordResetSuccess: ?string;
    /* invalid verification link page path */
    invalidVerificationLink: ?string;
    /* expired verification link page path */
    expiredVerificationLink: ?string;
    /* invalid password reset link page path */
    invalidPasswordResetLink: ?string;
    /* for masking user-facing pages */
    parseFrameURL: ?string;
  }
  
  export interface LiveQueryOptions {
    /* parse-server's LiveQuery classNames
    :ENV: PARSE_SERVER_LIVEQUERY_CLASSNAMES */
    classNames: ?(string[]);
    /* parse-server's LiveQuery redisOptions */
    redisOptions: ?any;
    /* parse-server's LiveQuery redisURL */
    redisURL: ?string;
    /* LiveQuery pubsub adapter */
    pubSubAdapter: ?Adapter<PubSubAdapter>;
    /* Sets the maximum execution time in milliseconds for regular expression pattern matching in LiveQuery. This protects against Regular Expression Denial of Service (ReDoS) attacks where a malicious regex pattern could block the event loop. A regex that exceeds the timeout will be treated as non-matching.<br><br>The protection runs each regex evaluation in an isolated VM context with a timeout. This adds approximately 50 microseconds of overhead per regex evaluation. For most applications this is negligible, but it can add up if you have a very large number of LiveQuery subscriptions that use `$regex` on the same class. For example, 10,000 concurrent regex subscriptions would add approximately 500ms of processing time per object save event on that class.<br><br>Set to `0` to disable the timeout and use native regex evaluation without protection. Defaults to `100`.
    :DEFAULT: 100 */
    regexTimeout: ?number;
    /* Adapter module for the WebSocketServer */
    wssAdapter: ?Adapter<WSSAdapter>;
  }
  
  export interface LiveQueryServerOptions {
    /* This string should match the appId in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same appId.*/
    appId: ?string;
    /* This string should match the masterKey in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same masterKey.*/
    masterKey: ?string;
    /* This string should match the serverURL in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same serverURL.*/
    serverURL: ?string;
    /* A JSON object that serves as a whitelist of keys. It is used for validating clients when they try to connect to the LiveQuery server. Check the following Security section and our protocol specification for details.*/
    keyPairs: ?any;
    /* Number of milliseconds between ping/pong frames. The WebSocket server sends ping/pong frames to the clients to keep the WebSocket alive. This value defines the interval of the ping/pong frame from the server to clients, defaults to 10 * 1000 ms (10 s).*/
    websocketTimeout: ?number;
    /* Number in milliseconds. When clients provide the sessionToken to the LiveQuery server, the LiveQuery server will try to fetch its ParseUser's objectId from parse server and store it in the cache. The value defines the duration of the cache. Check the following Security section and our protocol specification for details, defaults to 5 * 1000 ms (5 seconds).*/
    cacheTimeout: ?number;
    /* This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE, defaults to INFO.*/
    logLevel: ?string;
    /* The port to run the LiveQuery server, defaults to 1337.
    :DEFAULT: 1337 */
    port: ?number;
    /* parse-server's LiveQuery redisOptions */
    redisOptions: ?any;
    /* parse-server's LiveQuery redisURL */
    redisURL: ?string;
    /* LiveQuery pubsub adapter */
    pubSubAdapter: ?Adapter<PubSubAdapter>;
    /* Adapter module for the WebSocketServer */
    wssAdapter: ?Adapter<WSSAdapter>;
  }
  
  export interface IdempotencyOptions {
    /* An array of paths for which the feature should be enabled. The mount path must not be included, for example instead of `/parse/functions/myFunction` specifiy `functions/myFunction`. The entries are interpreted as regular expression, for example `functions/.*` matches all functions, `jobs/.*` matches all jobs, `classes/.*` matches all classes, `.*` matches all paths.
    :DEFAULT: [] */
    paths: ?(string[]);
    /* The duration in seconds after which a request record is discarded from the database, defaults to 300s.
    :DEFAULT: 300 */
    ttl: ?number;
  }
  
  export interface AccountLockoutOptions {
    /* Set the duration in minutes that a locked-out account remains locked out before automatically becoming unlocked.
    <br><br>
    Valid values are greater than `0` and less than `100000`. */
    duration: ?number;
    /* Set the number of failed sign-in attempts that will cause a user account to be locked. If the account is locked. The account will unlock after the duration set in the `duration` option has passed and no further login attempts have been made.
    <br><br>
    Valid values are greater than `0` and less than `1000`. */
    threshold: ?number;
    /* Set to `true`  if the account should be unlocked after a successful password reset.
    <br><br>
    Default is `false`.
    <br>
    Requires options `duration` and `threshold` to be set.
    :DEFAULT: false */
    unlockOnPasswordReset: ?boolean;
  }
  
  export interface PasswordPolicyOptions {
    /* Set the regular expression validation pattern a password must match to be accepted.
    <br><br>
    If used in combination with `validatorCallback`, the password must pass both to be accepted. */
    validatorPattern: ?string;
    /*   */
    /* Set a callback function to validate a password to be accepted.
    <br><br>
    If used in combination with `validatorPattern`, the password must pass both to be accepted. */
    validatorCallback: ?() => void;
    /* Set the error message to be sent.
    <br><br>
    Default is `Password does not meet the Password Policy requirements.` */
    validationError: ?string;
    /* Set to `true` to disallow the username as part of the password.
    <br><br>
    Default is `false`.
    :DEFAULT: false */
    doNotAllowUsername: ?boolean;
    /* Set the number of days after which a password expires. Login attempts fail if the user does not reset the password before expiration. */
    maxPasswordAge: ?number;
    /* Set the number of previous password that will not be allowed to be set as new password. If the option is not set or set to `0`, no previous passwords will be considered.
    <br><br>
    Valid values are >= `0` and <= `20`.
    <br>
    Default is `0`.
    */
    maxPasswordHistory: ?number;
    /* Set the validity duration of the password reset token in seconds after which the token expires. The token is used in the link that is set in the email. After the token expires, the link becomes invalid and a new link has to be sent. If the option is not set or set to `undefined`, then the token never expires.
    <br><br>
    For example, to expire the token after 2 hours, set a value of 7200 seconds (= 60 seconds * 60 minutes * 2 hours).
    <br><br>
    Default is `undefined`.
    */
    resetTokenValidityDuration: ?number;
    /* Set to `true` if a password reset token should be reused in case another token is requested but there is a token that is still valid, i.e. has not expired. This avoids the often observed issue that a user requests multiple emails and does not know which link contains a valid token because each newly generated token would invalidate the previous token.
    <br><br>
    Default is `false`.
    :DEFAULT: false */
    resetTokenReuseIfValid: ?boolean;
    /* Set to `true` if a request to reset the password should return a success response even if the provided email address is invalid, or `false` if the request should return an error response if the email address is invalid.
    <br><br>
    Default is `true`.
    :DEFAULT: true */
    resetPasswordSuccessOnInvalidEmail: ?boolean;
  }
  
  export interface FileUploadOptions {
    /* Sets the allowed file extensions for uploading files. The extension is defined as an array of file extensions, or a regex pattern.<br><br>It is recommended to only allow the file extensions that your app actually needs, rather than relying on blocking dangerous extensions. This allowlist approach is more secure because new dangerous file extensions may emerge that are not covered by the default blocklist.<br><br>The default blocks the most common file extensions that are known to be rendered as active content by web browsers, such as HTML, SVG, and XML files, which may be used by an attacker to compromise the session token of another user via accessing the browser's local storage. The blocked extensions are: `html`, `htm`, `shtml`, `xhtml`, `xhtml+xml`, `xht`, `svg`, `svgz`, `svg+xml`, `xml`, `xsl`, `xslt`, `xslt+xml`, `xsd`, `rng`, `rdf`, `rdf+xml`, `owl`, `mathml`, `mathml+xml`.<br><br>Defaults to `["^(?!([xXsS]?[hH][tT][mM][lL]?(\\+[xX][mM][lL])?|[xX][hH][tT]|[sS][vV][gG]([zZ]|\\+[xX][mM][lL])?|[xX][mM][lL]|[xX][sS][lL][tT]?(\\+[xX][mM][lL])?|[xX][sS][dD]|[rR][nN][gG]|[rR][dD][fF](\\+[xX][mM][lL])?|[oO][wW][lL]|[mM][aA][tT][hH][mM][lL](\\+[xX][mM][lL])?)$)"]`.
    :DEFAULT: ["^(?!([xXsS]?[hH][tT][mM][lL]?(\\+[xX][mM][lL])?|[xX][hH][tT]|[sS][vV][gG]([zZ]|\\+[xX][mM][lL])?|[xX][mM][lL]|[xX][sS][lL][tT]?(\\+[xX][mM][lL])?|[xX][sS][dD]|[rR][nN][gG]|[rR][dD][fF](\\+[xX][mM][lL])?|[oO][wW][lL]|[mM][aA][tT][hH][mM][lL](\\+[xX][mM][lL])?)$)"] */
    fileExtensions: ?(string[]);
    /*  Is true if file upload should be allowed for anonymous users.
    :DEFAULT: false */
    enableForAnonymousUser: ?boolean;
    /* Is true if file upload should be allowed for authenticated users.
    :DEFAULT: true */
    enableForAuthenticatedUser: ?boolean;
    /* Is true if file upload should be allowed for anyone, regardless of user authentication.
    :DEFAULT: false */
    enableForPublic: ?boolean;
    /* Sets the allowed hostnames for file URLs referenced in Parse objects. When a File object includes a URL, its hostname must match one of these entries to be accepted. Supports exact hostnames (e.g., `'cdn.example.com'`) and wildcard subdomains (e.g., `'*.example.com'`). Use `['*']` to allow any domain. Use `[]` to block all file URLs (only name-based files allowed).
    :DEFAULT: ["*"] */
    allowedFileUrlDomains: ?(string[]);
  }
  
  export interface FileDownloadOptions {
    /* Is true if file download should be allowed for anonymous users.
    :DEFAULT: true */
    enableForAnonymousUser: ?boolean;
    /* Is true if file download should be allowed for authenticated users.
    :DEFAULT: true */
    enableForAuthenticatedUser: ?boolean;
    /* Is true if file download should be allowed for anyone, regardless of user authentication.
    :DEFAULT: true */
    enableForPublic: ?boolean;
  }
  
  /* The available log levels for Parse Server logging. Valid values are:<br>- `'error'` - Error level (highest priority)<br>- `'warn'` - Warning level<br>- `'info'` - Info level (default)<br>- `'verbose'` - Verbose level<br>- `'debug'` - Debug level<br>- `'silly'` - Silly level (lowest priority) */
  export interface LogLevel {
    /* Error level - highest priority */
    error: 'error';
    /* Warning level */
    warn: 'warn';
    /* Info level - default */
    info: 'info';
    /* Verbose level */
    verbose: 'verbose';
    /* Debug level */
    debug: 'debug';
    /* Silly level - lowest priority */
    silly: 'silly';
  }
  
  export interface LogClientEvent {
    /* The MongoDB driver event name to listen for. See the [MongoDB driver events documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/monitoring/) for available events. */
    name: string;
    /* Optional array of dot-notation paths to extract specific data from the event object. If not provided or empty, the entire event object will be logged. */
    keys: ?(string[]);
    /* The log level to use for this event. See [LogLevel](LogLevel.html) for available values. Defaults to `'info'`.
    :DEFAULT: info */
    logLevel: ?string;
  }
  
  export interface DatabaseOptions {
    /* Enables database real-time hooks to update single schema cache. Set to `true` if using multiple Parse Servers instances connected to the same database. Failing to do so will cause a schema change to not propagate to all instances and re-syncing will only happen when the instances restart. To use this feature with MongoDB, a replica set cluster with [change stream](https://docs.mongodb.com/manual/changeStreams/#availability) support is required.
    :DEFAULT: false */
    enableSchemaHooks: ?boolean;
    /* The duration in seconds after which the schema cache expires and will be refetched from the database. Use this option if using multiple Parse Servers instances connected to the same database. A low duration will cause the schema cache to be updated too often, causing unnecessary database reads. A high duration will cause the schema to be updated too rarely, increasing the time required until schema changes propagate to all server instances. This feature can be used as an alternative or in conjunction with the option `enableSchemaHooks`. Default is infinite which means the schema cache never expires. */
    schemaCacheTtl: ?number;
    /* The MongoDB driver option to set whether to retry failed writes. */
    retryWrites: ?boolean;
    /* The number of documents per batch for MongoDB cursor `getMore` operations. A lower value reduces memory usage per batch; a higher value reduces the number of network round-trips.
    :DEFAULT: 1000 */
    batchSize: ?number;
    /* The MongoDB driver option to set a cumulative time limit in milliseconds for processing operations on a cursor. */
    maxTimeMS: ?number;
    /* The MongoDB driver option to set the maximum replication lag for reads from secondary nodes.*/
    maxStalenessSeconds: ?number;
    /* The MongoDB driver option to set the minimum number of opened, cached, ready-to-use database connections maintained by the driver. */
    minPoolSize: ?number;
    /* The MongoDB driver option to set the maximum number of opened, cached, ready-to-use database connections maintained by the driver. */
    maxPoolSize: ?number;
    /* The MongoDB driver option to specify the amount of time in milliseconds for a server to be considered suitable for selection. */
    serverSelectionTimeoutMS: ?number;
    /* The MongoDB driver option to specify the amount of time in milliseconds that a connection can remain idle in the connection pool before being removed and closed. */
    maxIdleTimeMS: ?number;
    /* The MongoDB driver option to specify the frequency in milliseconds at which the driver checks the state of the MongoDB deployment. */
    heartbeatFrequencyMS: ?number;
    /* The MongoDB driver option to specify the amount of time, in milliseconds, to wait to establish a single TCP socket connection to the server before raising an error. Specifying 0 disables the connection timeout. */
    connectTimeoutMS: ?number;
    /* The MongoDB driver option to specify the amount of time, in milliseconds, spent attempting to send or receive on a socket before timing out. Specifying 0 means no timeout. */
    socketTimeoutMS: ?number;
    /* The MongoDB driver option to set whether the socket attempts to connect to IPv6 and IPv4 addresses until a connection is established. If available, the driver will select the first IPv6 address. */
    autoSelectFamily: ?boolean;
    /* The MongoDB driver option to specify the amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the autoSelectFamily option. If set to a positive integer less than 10, the value 10 is used instead. */
    autoSelectFamilyAttemptTimeout: ?number;
    /* The MongoDB driver option to specify the maximum number of connections that may be in the process of being established concurrently by the connection pool. */
    maxConnecting: ?number;
    /* The MongoDB driver option to specify the maximum time in milliseconds that a thread can wait for a connection to become available. */
    waitQueueTimeoutMS: ?number;
    /* The MongoDB driver option to specify the name of the replica set, if the mongod is a member of a replica set. */
    replicaSet: ?string;
    /* The MongoDB driver option to force a Single topology type with a connection string containing one host. */
    directConnection: ?boolean;
    /* The MongoDB driver option to instruct the driver it is connecting to a load balancer fronting a mongos like service. */
    loadBalanced: ?boolean;
    /* The MongoDB driver option to specify the size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */
    localThresholdMS: ?number;
    /* The MongoDB driver option to specify the maximum number of hosts to connect to when using an srv connection string, a setting of 0 means unlimited hosts. */
    srvMaxHosts: ?number;
    /* The MongoDB driver option to modify the srv URI service name. */
    srvServiceName: ?string;
    /* The MongoDB driver option to enable or disable TLS/SSL for the connection. */
    tls: ?boolean;
    /* The MongoDB driver option to enable or disable TLS/SSL for the connection (equivalent to tls option). */
    ssl: ?boolean;
    /* The MongoDB driver option to specify the location of a local .pem file that contains the client's TLS/SSL certificate and key. */
    tlsCertificateKeyFile: ?string;
    /* The MongoDB driver option to specify the password to decrypt the tlsCertificateKeyFile. */
    tlsCertificateKeyFilePassword: ?string;
    /* The MongoDB driver option to specify the location of a local .pem file that contains the root certificate chain from the Certificate Authority. */
    tlsCAFile: ?string;
    /* The MongoDB driver option to bypass validation of the certificates presented by the mongod/mongos instance. */
    tlsAllowInvalidCertificates: ?boolean;
    /* The MongoDB driver option to disable hostname validation of the certificate presented by the mongod/mongos instance. */
    tlsAllowInvalidHostnames: ?boolean;
    /* The MongoDB driver option to disable various certificate validations. */
    tlsInsecure: ?boolean;
    /* The MongoDB driver option to specify an array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */
    compressors: ?(string[] | string);
    /* The MongoDB driver option to specify the compression level if using zlib for network compression (0-9). */
    zlibCompressionLevel: ?number;
    /* The MongoDB driver option to specify the read preferences for this connection. */
    readPreference: ?string;
    /* The MongoDB driver option to specify the tags document as a comma-separated list of colon-separated key-value pairs. */
    readPreferenceTags: ?(any[]);
    /* The MongoDB driver option to specify the level of isolation. */
    readConcernLevel: ?string;
    /* The MongoDB driver option to specify the database name associated with the user's credentials. */
    authSource: ?string;
    /* The MongoDB driver option to specify the authentication mechanism that MongoDB will use to authenticate the connection. */
    authMechanism: ?string;
    /* The MongoDB driver option to specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */
    authMechanismProperties: ?any;
    /* The MongoDB driver option to specify the name of the application that created this MongoClient instance. */
    appName: ?string;
    /* The MongoDB driver option to enable retryable reads. */
    retryReads: ?boolean;
    /* The MongoDB driver option to force server to assign _id values instead of driver. */
    forceServerObjectId: ?boolean;
    /* The MongoDB driver option to instruct the driver monitors to use a specific monitoring mode. */
    serverMonitoringMode: ?string;
    /* The MongoDB driver option to configure a Socks5 proxy host used for creating TCP connections. */
    proxyHost: ?string;
    /* The MongoDB driver option to configure a Socks5 proxy port used for creating TCP connections. */
    proxyPort: ?number;
    /* The MongoDB driver option to configure a Socks5 proxy username when the proxy requires username/password authentication. */
    proxyUsername: ?string;
    /* The MongoDB driver option to configure a Socks5 proxy password when the proxy requires username/password authentication. */
    proxyPassword: ?string;
    /* Set to `true` to automatically create indexes on the email field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserEmail: ?boolean;
    /* Set to `true` to automatically create a case-insensitive index on the email field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserEmailCaseInsensitive: ?boolean;
    /* Set to `true` to automatically create an index on the _email_verify_token field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserEmailVerifyToken: ?boolean;
    /* Set to `true` to automatically create an index on the _perishable_token field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserPasswordResetToken: ?boolean;
    /* Set to `true` to automatically create indexes on the username field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserUsername: ?boolean;
    /* Set to `true` to automatically create a case-insensitive index on the username field of the _User collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexUserUsernameCaseInsensitive: ?boolean;
    /* Set to `true` to automatically create unique indexes on the authData fields of the _User collection for each configured auth provider on server start, including `anonymous` when anonymous users are enabled. These indexes prevent race conditions during concurrent signups with the same authData. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the indexes, keep in mind that the otherwise automatically created indexes may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexAuthDataUniqueness: ?boolean;
    /* Set to `true` to automatically create a unique index on the name field of the _Role collection on server start. Set to `false` to skip index creation. Default is `true`.<br><br>⚠️ When setting this option to `false` to manually create the index, keep in mind that the otherwise automatically created index may change in the future to be optimized for the internal usage by Parse Server.
    :DEFAULT: true */
    createIndexRoleName: ?boolean;
    /* Set to `true` to disable validation of index fields. When disabled, indexes can be created even if the fields do not exist in the schema. This can be useful when creating indexes on fields that will be added later. */
    disableIndexFieldValidation: ?boolean;
    /* Set to `true` to allow `Parse.Query.explain` without master key.<br><br>⚠️ Enabling this option may expose sensitive query performance data to unauthorized users and could potentially be exploited for malicious purposes.
    :DEFAULT: false */
    allowPublicExplain: ?boolean;
    /* An array of MongoDB client event configurations to enable logging of specific events. */
    logClientEvents: ?(LogClientEvent[]);
    /* Custom metadata to append to database client connections for identifying Parse Server instances in database logs. If set, this metadata will be visible in database logs during connection handshakes. This can help with debugging and monitoring in deployments with multiple database clients. Set `name` to identify your application (e.g., 'MyApp') and `version` to your application's version. Leave undefined (default) to disable this feature and avoid the additional data transfer overhead. */
    clientMetadata: ?DatabaseOptionsClientMetadata;
  }
  
  export interface DatabaseOptionsClientMetadata {
    /* The name to identify your application in database logs (e.g., 'MyApp'). */
    name: string;
    /* The version of your application (e.g., '1.0.0'). */
    version: string;
  }
  
  export interface AuthAdapter {
    /* Is `true` if the auth adapter is enabled, `false` otherwise.
    :DEFAULT: false
    :ENV:
    */
    enabled: ?boolean;
  }
  
  export interface LogLevels {
    /* Log level used by the Cloud Code Triggers `afterSave`, `afterDelete`, `afterFind`, `afterLogout`. Default is `info`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: info
    */
    triggerAfter: ?string;
    /* Log level used by the Cloud Code Triggers `beforeSave`, `beforeDelete`, `beforeFind`, `beforeLogin` on success. Default is `info`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: info
    */
    triggerBeforeSuccess: ?string;
    /* Log level used by the Cloud Code Triggers `beforeSave`, `beforeDelete`, `beforeFind`, `beforeLogin` on error. Default is `error`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: error
    */
    triggerBeforeError: ?string;
    /* Log level used by the Cloud Code Functions on success. Default is `info`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: info
    */
    cloudFunctionSuccess: ?string;
    /* Log level used by the Cloud Code Functions on error. Default is `error`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: error
    */
    cloudFunctionError: ?string;
    /* Log level used when a sign-up fails because the username already exists. Default is `info`. See [LogLevel](LogLevel.html) for available values.
    :DEFAULT: info
    */
    signupUsernameTaken: ?string;
  }
  