Add Docs for Server Config Definitions (#5581)
* Add Docs for Server Config Definitions * protected field and sort alphabetically * Add links * nits
This commit is contained in:
@@ -70,6 +70,17 @@ If your pull request introduces a change that may affect the storage or retrieva
|
||||
- `it_only_db('mongo')` // will make a test that only runs on mongo
|
||||
- `it_exclude_dbs(['postgres'])` // will make a test that runs against all DB's but postgres
|
||||
|
||||
### Generate Parse Server Config Definition
|
||||
|
||||
If you want to make changes to [Parse Server Configuration][config] add the desired configuration to [src/Options/index.js][config-index] and run `npm run definitions`. This will output [src/Options/Definitions.js][config-def] and [src/Options/docs.js][config-docs].
|
||||
|
||||
To view docs run `npm run docs` and check the `/out` directory.
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/parse-server/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code.
|
||||
|
||||
[config]: http://parseplatform.org/parse-server/api/master/ParseServerOptions.html
|
||||
[config-def]: https://github.com/parse-community/parse-server/blob/master/src/Options/Definitions.js
|
||||
[config-docs]: https://github.com/parse-community/parse-server/blob/master/src/Options/docs.js
|
||||
[config-index]: https://github.com/parse-community/parse-server/blob/master/src/Options/index.js
|
||||
|
||||
31
README.md
31
README.md
@@ -189,7 +189,7 @@ app.listen(1337, function() {
|
||||
});
|
||||
```
|
||||
|
||||
For a full list of available options, run `parse-server --help`.
|
||||
For a full list of available options, run `parse-server --help` or take a look at [Parse Server Configurations](http://parseplatform.org/parse-server/api/master/ParseServerOptions.html).
|
||||
|
||||
## Logging
|
||||
|
||||
@@ -209,13 +209,13 @@ Logs are also be viewable in Parse Dashboard.
|
||||
|
||||
# Documentation
|
||||
|
||||
The full documentation for Parse Server is available in the [wiki](https://github.com/parse-community/parse-server/wiki). The [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/) is a good place to get started. If you're interested in developing for Parse Server, the [Development guide](http://docs.parseplatform.org/parse-server/guide/#development-guide) will help you get set up.
|
||||
The full documentation for Parse Server is available in the [wiki](https://github.com/parse-community/parse-server/wiki). The [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/) is a good place to get started. An [API reference](http://parseplatform.org/parse-server/api/) is also available. If you're interested in developing for Parse Server, the [Development guide](http://docs.parseplatform.org/parse-server/guide/#development-guide) will help you get set up.
|
||||
|
||||
## Configuration
|
||||
|
||||
Parse Server can be configured using the following options. You may pass these as parameters when running a standalone `parse-server`, or by loading a configuration file in JSON format using `parse-server path/to/configuration.json`. If you're using Parse Server on Express, you may also pass these to the `ParseServer` object as options.
|
||||
|
||||
For the full list of available options, run `parse-server --help`.
|
||||
For the full list of available options, run `parse-server --help` or take a look at [Parse Server Configurations](http://parseplatform.org/parse-server/api/master/ParseServerOptions.html).
|
||||
|
||||
#### Basic options
|
||||
|
||||
@@ -238,29 +238,6 @@ The client keys used with Parse are no longer necessary with Parse Server. If yo
|
||||
|
||||
#### Advanced options
|
||||
|
||||
* `fileKey` - For migrated apps, this is necessary to provide access to files already hosted on Parse.
|
||||
* `preserveFileName` - Set to true to remove the unique hash added to the file names. Defaults to false.
|
||||
* `allowClientClassCreation` - Set to false to disable client class creation. Defaults to true.
|
||||
* `enableAnonymousUsers` - Set to false to disable anonymous users. Defaults to true.
|
||||
* `auth` - Used to configure support for [3rd party authentication](http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication).
|
||||
* `facebookAppIds` - An array of valid Facebook application IDs that users may authenticate with.
|
||||
* `mountPath` - Mount path for the server. Defaults to `/parse`.
|
||||
* `directAccess` - Replace HTTP Interface when using JS SDK in current node runtime. Defaults to false. Caution, this is an experimental feature that may not be appropriate for production.
|
||||
* `filesAdapter` - The default behavior (GridStore) can be changed by creating an adapter class (see [`FilesAdapter.js`](https://github.com/parse-community/parse-server/blob/master/src/Adapters/Files/FilesAdapter.js)).
|
||||
* `maxUploadSize` - Max file size for uploads. Defaults to 20 MB.
|
||||
* `loggerAdapter` - The default behavior/transport (File) can be changed by creating an adapter class (see [`LoggerAdapter.js`](https://github.com/parse-community/parse-server/blob/master/src/Adapters/Logger/LoggerAdapter.js)).
|
||||
* `logLevel` - Set the specific level you want to log. Defaults to `info`. The default logger uses the npm log levels as defined by the underlying winston logger. Check [Winston logging levels](https://github.com/winstonjs/winston#logging-levels) for details on values to specify.
|
||||
* `sessionLength` - The length of time in seconds that a session should be valid for. Defaults to 31536000 seconds (1 year).
|
||||
* `maxLimit` - The maximum value supported for the limit option on queries. Defaults to unlimited.
|
||||
* `revokeSessionOnPasswordReset` - 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.
|
||||
* `accountLockout` - Lock account when a malicious user is attempting to determine an account password by trial and error.
|
||||
* `passwordPolicy` - Optional password policy rules to enforce.
|
||||
* `customPages` - A hash with urls to override email verification links, password reset links and specify frame url for masking user-facing pages. Available keys: `parseFrameURL`, `invalidLink`, `choosePassword`, `passwordResetSuccess`, `verifyEmailSuccess`.
|
||||
* `middleware` - (CLI only), a module name, function that is an express middleware. When using the CLI, the express app will load it just **before** mounting parse-server on the mount path. This option is useful for injecting a monitoring middleware.
|
||||
* `masterKeyIps` - The array of ip addresses where masterKey usage will be restricted to only these ips. (Default to [] which means allow all ips). If you're using this feature and have `useMasterKey: true` in cloudcode, make sure that you put your own ip in this list.
|
||||
* `readOnlyMasterKey` - A masterKey that has full read access to the data, but no write access. This key should be treated the same way as your masterKey, keeping it private.
|
||||
* `objectIdSize` - The string length of the newly generated object's ids.
|
||||
|
||||
##### Logging
|
||||
|
||||
Use the `PARSE_SERVER_LOGS_FOLDER` environment variable when starting `parse-server` to save your server logfiles to the specified folder.
|
||||
@@ -369,7 +346,7 @@ The default port is 1337, to use a different port set the PORT environment varia
|
||||
$ PORT=8080 parse-server --appId APPLICATION_ID --masterKey MASTER_KEY
|
||||
```
|
||||
|
||||
For the full list of configurable environment variables, run `parse-server --help`.
|
||||
For the full list of configurable environment variables, run `parse-server --help` or take a look at [Parse Server Configuration](https://github.com/parse-community/parse-server/blob/master/src/Options/Definitions.js).
|
||||
|
||||
### Available Adapters
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
"supports-color": "6.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"definitions": "node ./resources/buildConfigDefinitions.js",
|
||||
"docs": "jsdoc -c ./jsdoc-conf.json",
|
||||
"dev": "npm run build && node bin/dev",
|
||||
"lint": "flow && eslint --cache ./",
|
||||
|
||||
@@ -22,6 +22,7 @@ then
|
||||
echo "<meta http-equiv='refresh' content='0; url=/parse-server/api/${DEST}'>" > "docs/api/index.html"
|
||||
fi
|
||||
|
||||
npm run definitions
|
||||
npm run docs
|
||||
|
||||
mkdir -p "docs/api/${DEST}"
|
||||
|
||||
@@ -106,6 +106,7 @@ function processProperty(property, iface) {
|
||||
|
||||
function doInterface(iface) {
|
||||
return iface.body.properties
|
||||
.sort((a, b) => a.key.name.localeCompare(b.key.name))
|
||||
.map((prop) => processProperty(prop, iface))
|
||||
.filter((e) => e !== undefined);
|
||||
}
|
||||
@@ -135,18 +136,18 @@ function mapperFor(elt, t) {
|
||||
}
|
||||
|
||||
function parseDefaultValue(elt, value, t) {
|
||||
let litteralValue;
|
||||
let literalValue;
|
||||
if (t.isStringTypeAnnotation(elt)) {
|
||||
if (value == '""' || value == "''") {
|
||||
litteralValue = t.stringLiteral('');
|
||||
literalValue = t.stringLiteral('');
|
||||
} else {
|
||||
litteralValue = t.stringLiteral(value);
|
||||
literalValue = t.stringLiteral(value);
|
||||
}
|
||||
} else if (t.isNumberTypeAnnotation(elt)) {
|
||||
litteralValue = t.numericLiteral(parsers.numberOrBoolParser('')(value));
|
||||
literalValue = t.numericLiteral(parsers.numberOrBoolParser('')(value));
|
||||
} else if (t.isArrayTypeAnnotation(elt)) {
|
||||
const array = parsers.objectParser(value);
|
||||
litteralValue = t.arrayExpression(array.map((value) => {
|
||||
literalValue = t.arrayExpression(array.map((value) => {
|
||||
if (typeof value == 'string') {
|
||||
return t.stringLiteral(value);
|
||||
} else {
|
||||
@@ -154,23 +155,31 @@ function parseDefaultValue(elt, value, t) {
|
||||
}
|
||||
}));
|
||||
} else if (t.isAnyTypeAnnotation(elt)) {
|
||||
litteralValue = t.arrayExpression([]);
|
||||
literalValue = t.arrayExpression([]);
|
||||
} else if (t.isBooleanTypeAnnotation(elt)) {
|
||||
litteralValue = t.booleanLiteral(parsers.booleanParser(value));
|
||||
literalValue = t.booleanLiteral(parsers.booleanParser(value));
|
||||
} else if (t.isGenericTypeAnnotation(elt)) {
|
||||
const type = elt.typeAnnotation.id.name;
|
||||
if (type == 'NumberOrBoolean') {
|
||||
litteralValue = t.numericLiteral(parsers.numberOrBoolParser('')(value));
|
||||
literalValue = t.numericLiteral(parsers.numberOrBoolParser('')(value));
|
||||
}
|
||||
if (type == 'CustomPagesOptions') {
|
||||
const object = parsers.objectParser(value);
|
||||
const props = Object.keys(object).map((key) => {
|
||||
return t.objectProperty(key, object[value]);
|
||||
});
|
||||
litteralValue = t.objectExpression(props);
|
||||
literalValue = t.objectExpression(props);
|
||||
}
|
||||
if (type == 'ProtectedFields') {
|
||||
const prop = t.objectProperty(
|
||||
t.stringLiteral('_User'), t.objectPattern([
|
||||
t.objectProperty(t.stringLiteral('*'), t.arrayExpression([t.stringLiteral('email')]))
|
||||
])
|
||||
);
|
||||
literalValue = t.objectExpression([prop]);
|
||||
}
|
||||
}
|
||||
return litteralValue;
|
||||
return literalValue;
|
||||
}
|
||||
|
||||
function inject(t, list) {
|
||||
|
||||
@@ -6,266 +6,47 @@ Do not edit manually, but update Options/index.js
|
||||
var parsers = require('./parsers');
|
||||
|
||||
module.exports.ParseServerOptions = {
|
||||
appId: {
|
||||
env: 'PARSE_SERVER_APPLICATION_ID',
|
||||
help: 'Your Parse Application ID',
|
||||
required: true,
|
||||
},
|
||||
masterKey: {
|
||||
env: 'PARSE_SERVER_MASTER_KEY',
|
||||
help: 'Your Parse Master Key',
|
||||
required: true,
|
||||
},
|
||||
serverURL: {
|
||||
env: 'PARSE_SERVER_URL',
|
||||
help: 'URL to your parse server with http:// or https://.',
|
||||
required: true,
|
||||
},
|
||||
masterKeyIps: {
|
||||
env: 'PARSE_SERVER_MASTER_KEY_IPS',
|
||||
help:
|
||||
'Restrict masterKey to be used by only these ips, defaults to [] (allow all ips)',
|
||||
action: parsers.arrayParser,
|
||||
default: [],
|
||||
},
|
||||
appName: {
|
||||
env: 'PARSE_SERVER_APP_NAME',
|
||||
help: 'Sets the app name',
|
||||
},
|
||||
analyticsAdapter: {
|
||||
env: 'PARSE_SERVER_ANALYTICS_ADAPTER',
|
||||
help: 'Adapter module for the analytics',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
filesAdapter: {
|
||||
env: 'PARSE_SERVER_FILES_ADAPTER',
|
||||
help: 'Adapter module for the files sub-system',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
push: {
|
||||
env: 'PARSE_SERVER_PUSH',
|
||||
help:
|
||||
'Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications',
|
||||
accountLockout: {
|
||||
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT',
|
||||
help: 'account lockout policy for failed login attempts',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
scheduledPush: {
|
||||
env: 'PARSE_SERVER_SCHEDULED_PUSH',
|
||||
help: 'Configuration for push scheduling, defaults to false.',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
loggerAdapter: {
|
||||
env: 'PARSE_SERVER_LOGGER_ADAPTER',
|
||||
help: 'Adapter module for the logging sub-system',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
jsonLogs: {
|
||||
env: 'JSON_LOGS',
|
||||
help: 'Log as structured JSON objects',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
logsFolder: {
|
||||
env: 'PARSE_SERVER_LOGS_FOLDER',
|
||||
help:
|
||||
"Folder for the logs (defaults to './logs'); set to null to disable file based logging",
|
||||
default: './logs',
|
||||
},
|
||||
verbose: {
|
||||
env: 'VERBOSE',
|
||||
help: 'Set the logging to verbose',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
logLevel: {
|
||||
env: 'PARSE_SERVER_LOG_LEVEL',
|
||||
help: 'Sets the level for logs',
|
||||
},
|
||||
silent: {
|
||||
env: 'SILENT',
|
||||
help: 'Disables console output',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
databaseURI: {
|
||||
env: 'PARSE_SERVER_DATABASE_URI',
|
||||
help:
|
||||
'The full URI to your database. Supported databases are mongodb or postgres.',
|
||||
required: true,
|
||||
default: 'mongodb://localhost:27017/parse',
|
||||
},
|
||||
databaseOptions: {
|
||||
env: 'PARSE_SERVER_DATABASE_OPTIONS',
|
||||
help: 'Options to pass to the mongodb client',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
databaseAdapter: {
|
||||
env: 'PARSE_SERVER_DATABASE_ADAPTER',
|
||||
help: 'Adapter module for the database',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
cloud: {
|
||||
env: 'PARSE_SERVER_CLOUD',
|
||||
help: 'Full path to your cloud code main.js',
|
||||
},
|
||||
collectionPrefix: {
|
||||
env: 'PARSE_SERVER_COLLECTION_PREFIX',
|
||||
help: 'A collection prefix for the classes',
|
||||
default: '',
|
||||
},
|
||||
clientKey: {
|
||||
env: 'PARSE_SERVER_CLIENT_KEY',
|
||||
help: 'Key for iOS, MacOS, tvOS clients',
|
||||
},
|
||||
javascriptKey: {
|
||||
env: 'PARSE_SERVER_JAVASCRIPT_KEY',
|
||||
help: 'Key for the Javascript SDK',
|
||||
},
|
||||
dotNetKey: {
|
||||
env: 'PARSE_SERVER_DOT_NET_KEY',
|
||||
help: 'Key for Unity and .Net SDK',
|
||||
},
|
||||
restAPIKey: {
|
||||
env: 'PARSE_SERVER_REST_API_KEY',
|
||||
help: 'Key for REST calls',
|
||||
},
|
||||
readOnlyMasterKey: {
|
||||
env: 'PARSE_SERVER_READ_ONLY_MASTER_KEY',
|
||||
help:
|
||||
'Read-only key, which has the same capabilities as MasterKey without writes',
|
||||
},
|
||||
webhookKey: {
|
||||
env: 'PARSE_SERVER_WEBHOOK_KEY',
|
||||
help: 'Key sent with outgoing webhook calls',
|
||||
},
|
||||
fileKey: {
|
||||
env: 'PARSE_SERVER_FILE_KEY',
|
||||
help: 'Key for your files',
|
||||
},
|
||||
preserveFileName: {
|
||||
env: 'PARSE_SERVER_PRESERVE_FILE_NAME',
|
||||
help: 'Enable (or disable) the addition of a unique hash to the file names',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
userSensitiveFields: {
|
||||
env: 'PARSE_SERVER_USER_SENSITIVE_FIELDS',
|
||||
help:
|
||||
'Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields',
|
||||
action: parsers.arrayParser,
|
||||
default: ['email'],
|
||||
},
|
||||
protectedFields: {
|
||||
env: 'PARSE_SERVER_PROTECTED_FIELDS',
|
||||
help:
|
||||
'Protected fields that should be treated with extra security when fetching details.',
|
||||
action: parsers.objectParser,
|
||||
default: [],
|
||||
},
|
||||
enableAnonymousUsers: {
|
||||
env: 'PARSE_SERVER_ENABLE_ANON_USERS',
|
||||
help: 'Enable (or disable) anon users, defaults to true',
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
allowClientClassCreation: {
|
||||
env: 'PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION',
|
||||
help: 'Enable (or disable) client class creation, defaults to true',
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
analyticsAdapter: {
|
||||
env: 'PARSE_SERVER_ANALYTICS_ADAPTER',
|
||||
help: 'Adapter module for the analytics',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
appId: {
|
||||
env: 'PARSE_SERVER_APPLICATION_ID',
|
||||
help: 'Your Parse Application ID',
|
||||
required: true,
|
||||
},
|
||||
appName: {
|
||||
env: 'PARSE_SERVER_APP_NAME',
|
||||
help: 'Sets the app name',
|
||||
},
|
||||
auth: {
|
||||
env: 'PARSE_SERVER_AUTH_PROVIDERS',
|
||||
help:
|
||||
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
maxUploadSize: {
|
||||
env: 'PARSE_SERVER_MAX_UPLOAD_SIZE',
|
||||
help: 'Max file size for uploads, defaults to 20mb',
|
||||
default: '20mb',
|
||||
},
|
||||
verifyUserEmails: {
|
||||
env: 'PARSE_SERVER_VERIFY_USER_EMAILS',
|
||||
help: 'Enable (or disable) user email validation, defaults to false',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
preventLoginWithUnverifiedEmail: {
|
||||
env: 'PARSE_SERVER_PREVENT_LOGIN_WITH_UNVERIFIED_EMAIL',
|
||||
help:
|
||||
'Prevent user from login if email is not verified and PARSE_SERVER_VERIFY_USER_EMAILS is true, defaults to false',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
emailVerifyTokenValidityDuration: {
|
||||
env: 'PARSE_SERVER_EMAIL_VERIFY_TOKEN_VALIDITY_DURATION',
|
||||
help: 'Email verification token validity duration, in seconds',
|
||||
action: parsers.numberParser('emailVerifyTokenValidityDuration'),
|
||||
},
|
||||
accountLockout: {
|
||||
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT',
|
||||
help: 'account lockout policy for failed login attempts',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
passwordPolicy: {
|
||||
env: 'PARSE_SERVER_PASSWORD_POLICY',
|
||||
help: 'Password policy for enforcing password related rules',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
cacheAdapter: {
|
||||
env: 'PARSE_SERVER_CACHE_ADAPTER',
|
||||
help: 'Adapter module for the cache',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
emailAdapter: {
|
||||
env: 'PARSE_SERVER_EMAIL_ADAPTER',
|
||||
help: 'Adapter module for email sending',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
publicServerURL: {
|
||||
env: 'PARSE_PUBLIC_SERVER_URL',
|
||||
help: 'Public URL to your parse server with http:// or https://.',
|
||||
},
|
||||
customPages: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES',
|
||||
help: 'custom pages for password validation and reset',
|
||||
action: parsers.objectParser,
|
||||
default: {},
|
||||
},
|
||||
liveQuery: {
|
||||
env: 'PARSE_SERVER_LIVE_QUERY',
|
||||
help: "parse-server's LiveQuery configuration object",
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
sessionLength: {
|
||||
env: 'PARSE_SERVER_SESSION_LENGTH',
|
||||
help: 'Session duration, in seconds, defaults to 1 year',
|
||||
action: parsers.numberParser('sessionLength'),
|
||||
default: 31536000,
|
||||
},
|
||||
maxLimit: {
|
||||
env: 'PARSE_SERVER_MAX_LIMIT',
|
||||
help: 'Max value for limit option on queries, defaults to unlimited',
|
||||
action: parsers.numberParser('maxLimit'),
|
||||
},
|
||||
expireInactiveSessions: {
|
||||
env: 'PARSE_SERVER_EXPIRE_INACTIVE_SESSIONS',
|
||||
help:
|
||||
'Sets wether we should expire the inactive sessions, defaults to true',
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
revokeSessionOnPasswordReset: {
|
||||
env: 'PARSE_SERVER_REVOKE_SESSION_ON_PASSWORD_RESET',
|
||||
help:
|
||||
"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.",
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
schemaCacheTTL: {
|
||||
env: 'PARSE_SERVER_SCHEMA_CACHE_TTL',
|
||||
help:
|
||||
'The TTL for caching the schema for optimizing read/write operations. You should put a long TTL when your DB is in production. default to 5000; set 0 to disable.',
|
||||
action: parsers.numberParser('schemaCacheTTL'),
|
||||
default: 5000,
|
||||
cacheMaxSize: {
|
||||
env: 'PARSE_SERVER_CACHE_MAX_SIZE',
|
||||
help: 'Sets the maximum size for the in memory cache, defaults to 10000',
|
||||
action: parsers.numberParser('cacheMaxSize'),
|
||||
default: 10000,
|
||||
},
|
||||
cacheTTL: {
|
||||
env: 'PARSE_SERVER_CACHE_TTL',
|
||||
@@ -274,11 +55,47 @@ module.exports.ParseServerOptions = {
|
||||
action: parsers.numberParser('cacheTTL'),
|
||||
default: 5000,
|
||||
},
|
||||
cacheMaxSize: {
|
||||
env: 'PARSE_SERVER_CACHE_MAX_SIZE',
|
||||
help: 'Sets the maximum size for the in memory cache, defaults to 10000',
|
||||
action: parsers.numberParser('cacheMaxSize'),
|
||||
default: 10000,
|
||||
clientKey: {
|
||||
env: 'PARSE_SERVER_CLIENT_KEY',
|
||||
help: 'Key for iOS, MacOS, tvOS clients',
|
||||
},
|
||||
cloud: {
|
||||
env: 'PARSE_SERVER_CLOUD',
|
||||
help: 'Full path to your cloud code main.js',
|
||||
},
|
||||
cluster: {
|
||||
env: 'PARSE_SERVER_CLUSTER',
|
||||
help:
|
||||
'Run with cluster, optionally set the number of processes default to os.cpus().length',
|
||||
action: parsers.numberOrBooleanParser,
|
||||
},
|
||||
collectionPrefix: {
|
||||
env: 'PARSE_SERVER_COLLECTION_PREFIX',
|
||||
help: 'A collection prefix for the classes',
|
||||
default: '',
|
||||
},
|
||||
customPages: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES',
|
||||
help: 'custom pages for password validation and reset',
|
||||
action: parsers.objectParser,
|
||||
default: {},
|
||||
},
|
||||
databaseAdapter: {
|
||||
env: 'PARSE_SERVER_DATABASE_ADAPTER',
|
||||
help: 'Adapter module for the database',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
databaseOptions: {
|
||||
env: 'PARSE_SERVER_DATABASE_OPTIONS',
|
||||
help: 'Options to pass to the mongodb client',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
databaseURI: {
|
||||
env: 'PARSE_SERVER_DATABASE_URI',
|
||||
help:
|
||||
'The full URI to your database. Supported databases are mongodb or postgres.',
|
||||
required: true,
|
||||
default: 'mongodb://localhost:27017/parse',
|
||||
},
|
||||
directAccess: {
|
||||
env: 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS',
|
||||
@@ -287,6 +104,32 @@ module.exports.ParseServerOptions = {
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
dotNetKey: {
|
||||
env: 'PARSE_SERVER_DOT_NET_KEY',
|
||||
help: 'Key for Unity and .Net SDK',
|
||||
},
|
||||
emailAdapter: {
|
||||
env: 'PARSE_SERVER_EMAIL_ADAPTER',
|
||||
help: 'Adapter module for email sending',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
emailVerifyTokenValidityDuration: {
|
||||
env: 'PARSE_SERVER_EMAIL_VERIFY_TOKEN_VALIDITY_DURATION',
|
||||
help: 'Email verification token validity duration, in seconds',
|
||||
action: parsers.numberParser('emailVerifyTokenValidityDuration'),
|
||||
},
|
||||
enableAnonymousUsers: {
|
||||
env: 'PARSE_SERVER_ENABLE_ANON_USERS',
|
||||
help: 'Enable (or disable) anon users, defaults to true',
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
enableExpressErrorHandler: {
|
||||
env: 'PARSE_SERVER_ENABLE_EXPRESS_ERROR_HANDLER',
|
||||
help: 'Enables the default express error handler for all errors',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
enableSingleSchemaCache: {
|
||||
env: 'PARSE_SERVER_ENABLE_SINGLE_SCHEMA_CACHE',
|
||||
help:
|
||||
@@ -294,73 +137,234 @@ module.exports.ParseServerOptions = {
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
enableExpressErrorHandler: {
|
||||
env: 'PARSE_SERVER_ENABLE_EXPRESS_ERROR_HANDLER',
|
||||
help: 'Enables the default express error handler for all errors',
|
||||
expireInactiveSessions: {
|
||||
env: 'PARSE_SERVER_EXPIRE_INACTIVE_SESSIONS',
|
||||
help:
|
||||
'Sets wether we should expire the inactive sessions, defaults to true',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
default: true,
|
||||
},
|
||||
objectIdSize: {
|
||||
env: 'PARSE_SERVER_OBJECT_ID_SIZE',
|
||||
help: "Sets the number of characters in generated object id's, default 10",
|
||||
action: parsers.numberParser('objectIdSize'),
|
||||
default: 10,
|
||||
fileKey: {
|
||||
env: 'PARSE_SERVER_FILE_KEY',
|
||||
help: 'Key for your files',
|
||||
},
|
||||
port: {
|
||||
env: 'PORT',
|
||||
help: 'The port to run the ParseServer, defaults to 1337.',
|
||||
action: parsers.numberParser('port'),
|
||||
default: 1337,
|
||||
filesAdapter: {
|
||||
env: 'PARSE_SERVER_FILES_ADAPTER',
|
||||
help: 'Adapter module for the files sub-system',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
host: {
|
||||
env: 'PARSE_SERVER_HOST',
|
||||
help: 'The host to serve ParseServer on, defaults to 0.0.0.0',
|
||||
default: '0.0.0.0',
|
||||
},
|
||||
mountPath: {
|
||||
env: 'PARSE_SERVER_MOUNT_PATH',
|
||||
help: 'Mount path for the server, defaults to /parse',
|
||||
default: '/parse',
|
||||
javascriptKey: {
|
||||
env: 'PARSE_SERVER_JAVASCRIPT_KEY',
|
||||
help: 'Key for the Javascript SDK',
|
||||
},
|
||||
cluster: {
|
||||
env: 'PARSE_SERVER_CLUSTER',
|
||||
help:
|
||||
'Run with cluster, optionally set the number of processes default to os.cpus().length',
|
||||
action: parsers.numberOrBooleanParser,
|
||||
},
|
||||
middleware: {
|
||||
env: 'PARSE_SERVER_MIDDLEWARE',
|
||||
help: 'middleware for express server, can be string or function',
|
||||
},
|
||||
startLiveQueryServer: {
|
||||
env: 'PARSE_SERVER_START_LIVE_QUERY_SERVER',
|
||||
help: 'Starts the liveQuery server',
|
||||
jsonLogs: {
|
||||
env: 'JSON_LOGS',
|
||||
help: 'Log as structured JSON objects',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
liveQuery: {
|
||||
env: 'PARSE_SERVER_LIVE_QUERY',
|
||||
help: "parse-server's LiveQuery configuration object",
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
liveQueryServerOptions: {
|
||||
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_OPTIONS',
|
||||
help:
|
||||
'Live query server configuration options (will start the liveQuery server)',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
loggerAdapter: {
|
||||
env: 'PARSE_SERVER_LOGGER_ADAPTER',
|
||||
help: 'Adapter module for the logging sub-system',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
logLevel: {
|
||||
env: 'PARSE_SERVER_LOG_LEVEL',
|
||||
help: 'Sets the level for logs',
|
||||
},
|
||||
logsFolder: {
|
||||
env: 'PARSE_SERVER_LOGS_FOLDER',
|
||||
help:
|
||||
"Folder for the logs (defaults to './logs'); set to null to disable file based logging",
|
||||
default: './logs',
|
||||
},
|
||||
masterKey: {
|
||||
env: 'PARSE_SERVER_MASTER_KEY',
|
||||
help: 'Your Parse Master Key',
|
||||
required: true,
|
||||
},
|
||||
masterKeyIps: {
|
||||
env: 'PARSE_SERVER_MASTER_KEY_IPS',
|
||||
help:
|
||||
'Restrict masterKey to be used by only these ips, defaults to [] (allow all ips)',
|
||||
action: parsers.arrayParser,
|
||||
default: [],
|
||||
},
|
||||
maxLimit: {
|
||||
env: 'PARSE_SERVER_MAX_LIMIT',
|
||||
help: 'Max value for limit option on queries, defaults to unlimited',
|
||||
action: parsers.numberParser('maxLimit'),
|
||||
},
|
||||
maxUploadSize: {
|
||||
env: 'PARSE_SERVER_MAX_UPLOAD_SIZE',
|
||||
help: 'Max file size for uploads, defaults to 20mb',
|
||||
default: '20mb',
|
||||
},
|
||||
middleware: {
|
||||
env: 'PARSE_SERVER_MIDDLEWARE',
|
||||
help: 'middleware for express server, can be string or function',
|
||||
},
|
||||
mountPath: {
|
||||
env: 'PARSE_SERVER_MOUNT_PATH',
|
||||
help: 'Mount path for the server, defaults to /parse',
|
||||
default: '/parse',
|
||||
},
|
||||
objectIdSize: {
|
||||
env: 'PARSE_SERVER_OBJECT_ID_SIZE',
|
||||
help: "Sets the number of characters in generated object id's, default 10",
|
||||
action: parsers.numberParser('objectIdSize'),
|
||||
default: 10,
|
||||
},
|
||||
passwordPolicy: {
|
||||
env: 'PARSE_SERVER_PASSWORD_POLICY',
|
||||
help: 'Password policy for enforcing password related rules',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
port: {
|
||||
env: 'PORT',
|
||||
help: 'The port to run the ParseServer, defaults to 1337.',
|
||||
action: parsers.numberParser('port'),
|
||||
default: 1337,
|
||||
},
|
||||
preserveFileName: {
|
||||
env: 'PARSE_SERVER_PRESERVE_FILE_NAME',
|
||||
help: 'Enable (or disable) the addition of a unique hash to the file names',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
preventLoginWithUnverifiedEmail: {
|
||||
env: 'PARSE_SERVER_PREVENT_LOGIN_WITH_UNVERIFIED_EMAIL',
|
||||
help:
|
||||
'Prevent user from login if email is not verified and PARSE_SERVER_VERIFY_USER_EMAILS is true, defaults to false',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
protectedFields: {
|
||||
env: 'PARSE_SERVER_PROTECTED_FIELDS',
|
||||
help:
|
||||
'Protected fields that should be treated with extra security when fetching details.',
|
||||
action: parsers.objectParser,
|
||||
default: {
|
||||
_User: {
|
||||
'*': ['email'],
|
||||
},
|
||||
},
|
||||
},
|
||||
publicServerURL: {
|
||||
env: 'PARSE_PUBLIC_SERVER_URL',
|
||||
help: 'Public URL to your parse server with http:// or https://.',
|
||||
},
|
||||
push: {
|
||||
env: 'PARSE_SERVER_PUSH',
|
||||
help:
|
||||
'Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
readOnlyMasterKey: {
|
||||
env: 'PARSE_SERVER_READ_ONLY_MASTER_KEY',
|
||||
help:
|
||||
'Read-only key, which has the same capabilities as MasterKey without writes',
|
||||
},
|
||||
restAPIKey: {
|
||||
env: 'PARSE_SERVER_REST_API_KEY',
|
||||
help: 'Key for REST calls',
|
||||
},
|
||||
revokeSessionOnPasswordReset: {
|
||||
env: 'PARSE_SERVER_REVOKE_SESSION_ON_PASSWORD_RESET',
|
||||
help:
|
||||
"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.",
|
||||
action: parsers.booleanParser,
|
||||
default: true,
|
||||
},
|
||||
scheduledPush: {
|
||||
env: 'PARSE_SERVER_SCHEDULED_PUSH',
|
||||
help: 'Configuration for push scheduling, defaults to false.',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
schemaCacheTTL: {
|
||||
env: 'PARSE_SERVER_SCHEMA_CACHE_TTL',
|
||||
help:
|
||||
'The TTL for caching the schema for optimizing read/write operations. You should put a long TTL when your DB is in production. default to 5000; set 0 to disable.',
|
||||
action: parsers.numberParser('schemaCacheTTL'),
|
||||
default: 5000,
|
||||
},
|
||||
serverURL: {
|
||||
env: 'PARSE_SERVER_URL',
|
||||
help: 'URL to your parse server with http:// or https://.',
|
||||
required: true,
|
||||
},
|
||||
sessionLength: {
|
||||
env: 'PARSE_SERVER_SESSION_LENGTH',
|
||||
help: 'Session duration, in seconds, defaults to 1 year',
|
||||
action: parsers.numberParser('sessionLength'),
|
||||
default: 31536000,
|
||||
},
|
||||
silent: {
|
||||
env: 'SILENT',
|
||||
help: 'Disables console output',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
startLiveQueryServer: {
|
||||
env: 'PARSE_SERVER_START_LIVE_QUERY_SERVER',
|
||||
help: 'Starts the liveQuery server',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
userSensitiveFields: {
|
||||
env: 'PARSE_SERVER_USER_SENSITIVE_FIELDS',
|
||||
help:
|
||||
'Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields',
|
||||
action: parsers.arrayParser,
|
||||
default: ['email'],
|
||||
},
|
||||
verbose: {
|
||||
env: 'VERBOSE',
|
||||
help: 'Set the logging to verbose',
|
||||
action: parsers.booleanParser,
|
||||
},
|
||||
verifyUserEmails: {
|
||||
env: 'PARSE_SERVER_VERIFY_USER_EMAILS',
|
||||
help: 'Enable (or disable) user email validation, defaults to false',
|
||||
action: parsers.booleanParser,
|
||||
default: false,
|
||||
},
|
||||
webhookKey: {
|
||||
env: 'PARSE_SERVER_WEBHOOK_KEY',
|
||||
help: 'Key sent with outgoing webhook calls',
|
||||
},
|
||||
};
|
||||
module.exports.CustomPagesOptions = {
|
||||
invalidLink: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_INVALID_LINK',
|
||||
help: 'invalid link page path',
|
||||
},
|
||||
verifyEmailSuccess: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_VERIFY_EMAIL_SUCCESS',
|
||||
help: 'verify email success page path',
|
||||
},
|
||||
choosePassword: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_CHOOSE_PASSWORD',
|
||||
help: 'choose password page path',
|
||||
},
|
||||
invalidLink: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_INVALID_LINK',
|
||||
help: 'invalid link page path',
|
||||
},
|
||||
passwordResetSuccess: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_PASSWORD_RESET_SUCCESS',
|
||||
help: 'password reset success page path',
|
||||
},
|
||||
verifyEmailSuccess: {
|
||||
env: 'PARSE_SERVER_CUSTOM_PAGES_VERIFY_EMAIL_SUCCESS',
|
||||
help: 'verify email success page path',
|
||||
},
|
||||
};
|
||||
module.exports.LiveQueryOptions = {
|
||||
classNames: {
|
||||
@@ -368,15 +372,15 @@ module.exports.LiveQueryOptions = {
|
||||
help: "parse-server's LiveQuery classNames",
|
||||
action: parsers.arrayParser,
|
||||
},
|
||||
redisURL: {
|
||||
env: 'PARSE_SERVER_LIVEQUERY_REDIS_URL',
|
||||
help: "parse-server's LiveQuery redisURL",
|
||||
},
|
||||
pubSubAdapter: {
|
||||
env: 'PARSE_SERVER_LIVEQUERY_PUB_SUB_ADAPTER',
|
||||
help: 'LiveQuery pubsub adapter',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
redisURL: {
|
||||
env: 'PARSE_SERVER_LIVEQUERY_REDIS_URL',
|
||||
help: "parse-server's LiveQuery redisURL",
|
||||
},
|
||||
};
|
||||
module.exports.LiveQueryServerOptions = {
|
||||
appId: {
|
||||
@@ -384,15 +388,11 @@ module.exports.LiveQueryServerOptions = {
|
||||
help:
|
||||
'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.',
|
||||
},
|
||||
masterKey: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_MASTER_KEY',
|
||||
cacheTimeout: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_CACHE_TIMEOUT',
|
||||
help:
|
||||
'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.',
|
||||
},
|
||||
serverURL: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_SERVER_URL',
|
||||
help:
|
||||
'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.',
|
||||
"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 30 * 24 * 60 * 60 * 1000 ms (~30 days).",
|
||||
action: parsers.numberParser('cacheTimeout'),
|
||||
},
|
||||
keyPairs: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_KEY_PAIRS',
|
||||
@@ -400,36 +400,40 @@ module.exports.LiveQueryServerOptions = {
|
||||
'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.',
|
||||
action: parsers.objectParser,
|
||||
},
|
||||
websocketTimeout: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_WEBSOCKET_TIMEOUT',
|
||||
help:
|
||||
'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).',
|
||||
action: parsers.numberParser('websocketTimeout'),
|
||||
},
|
||||
cacheTimeout: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_CACHE_TIMEOUT',
|
||||
help:
|
||||
"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 30 * 24 * 60 * 60 * 1000 ms (~30 days).",
|
||||
action: parsers.numberParser('cacheTimeout'),
|
||||
},
|
||||
logLevel: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_LOG_LEVEL',
|
||||
help:
|
||||
'This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE, defaults to INFO.',
|
||||
},
|
||||
masterKey: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_MASTER_KEY',
|
||||
help:
|
||||
'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.',
|
||||
},
|
||||
port: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_PORT',
|
||||
help: 'The port to run the LiveQuery server, defaults to 1337.',
|
||||
action: parsers.numberParser('port'),
|
||||
default: 1337,
|
||||
},
|
||||
redisURL: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_URL',
|
||||
help: "parse-server's LiveQuery redisURL",
|
||||
},
|
||||
pubSubAdapter: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_PUB_SUB_ADAPTER',
|
||||
help: 'LiveQuery pubsub adapter',
|
||||
action: parsers.moduleOrObjectParser,
|
||||
},
|
||||
redisURL: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_URL',
|
||||
help: "parse-server's LiveQuery redisURL",
|
||||
},
|
||||
serverURL: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_SERVER_URL',
|
||||
help:
|
||||
'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.',
|
||||
},
|
||||
websocketTimeout: {
|
||||
env: 'PARSE_LIVE_QUERY_SERVER_WEBSOCKET_TIMEOUT',
|
||||
help:
|
||||
'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).',
|
||||
action: parsers.numberParser('websocketTimeout'),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,94 +1,94 @@
|
||||
/**
|
||||
* @interface ParseServerOptions
|
||||
* @property {String} appId Your Parse Application ID
|
||||
* @property {String} masterKey Your Parse Master Key
|
||||
* @property {String} serverURL URL to your parse server with http:// or https://.
|
||||
* @property {String[]} masterKeyIps Restrict masterKey to be used by only these ips, defaults to [] (allow all ips)
|
||||
* @property {String} appName Sets the app name
|
||||
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
|
||||
* @property {Adapter<FilesAdapter>} filesAdapter Adapter module for the files sub-system
|
||||
* @property {Any} push Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications
|
||||
* @property {Boolean} scheduledPush Configuration for push scheduling, defaults to false.
|
||||
* @property {Adapter<LoggerAdapter>} loggerAdapter Adapter module for the logging sub-system
|
||||
* @property {Boolean} jsonLogs Log as structured JSON objects
|
||||
* @property {String} logsFolder Folder for the logs (defaults to './logs'); set to null to disable file based logging
|
||||
* @property {Boolean} verbose Set the logging to verbose
|
||||
* @property {String} logLevel Sets the level for logs
|
||||
* @property {Boolean} silent Disables console output
|
||||
* @property {String} databaseURI The full URI to your database. Supported databases are mongodb or postgres.
|
||||
* @property {Any} databaseOptions Options to pass to the mongodb client
|
||||
* @property {Adapter<StorageAdapter>} databaseAdapter Adapter module for the database
|
||||
* @property {String} cloud Full path to your cloud code main.js
|
||||
* @property {String} collectionPrefix A collection prefix for the classes
|
||||
* @property {String} clientKey Key for iOS, MacOS, tvOS clients
|
||||
* @property {String} javascriptKey Key for the Javascript SDK
|
||||
* @property {String} dotNetKey Key for Unity and .Net SDK
|
||||
* @property {String} restAPIKey Key for REST calls
|
||||
* @property {String} readOnlyMasterKey Read-only key, which has the same capabilities as MasterKey without writes
|
||||
* @property {String} webhookKey Key sent with outgoing webhook calls
|
||||
* @property {String} fileKey Key for your files
|
||||
* @property {Boolean} preserveFileName Enable (or disable) the addition of a unique hash to the file names
|
||||
* @property {String[]} userSensitiveFields Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields
|
||||
* @property {Any} protectedFields Protected fields that should be treated with extra security when fetching details.
|
||||
* @property {Boolean} enableAnonymousUsers Enable (or disable) anon users, defaults to true
|
||||
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
|
||||
* @property {Any} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
||||
* @property {String} maxUploadSize Max file size for uploads, defaults to 20mb
|
||||
* @property {Boolean} verifyUserEmails Enable (or disable) user email validation, defaults to false
|
||||
* @property {Boolean} preventLoginWithUnverifiedEmail Prevent user from login if email is not verified and PARSE_SERVER_VERIFY_USER_EMAILS is true, defaults to false
|
||||
* @property {Number} emailVerifyTokenValidityDuration Email verification token validity duration, in seconds
|
||||
* @property {Any} accountLockout account lockout policy for failed login attempts
|
||||
* @property {Any} passwordPolicy Password policy for enforcing password related rules
|
||||
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
|
||||
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
|
||||
* @property {String} appId Your Parse Application ID
|
||||
* @property {String} appName Sets the app name
|
||||
* @property {Any} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
||||
* @property {Adapter<CacheAdapter>} cacheAdapter Adapter module for the cache
|
||||
* @property {Adapter<MailAdapter>} emailAdapter Adapter module for email sending
|
||||
* @property {String} publicServerURL Public URL to your parse server with http:// or https://.
|
||||
* @property {CustomPagesOptions} customPages custom pages for password validation and reset
|
||||
* @property {LiveQueryOptions} liveQuery parse-server's LiveQuery configuration object
|
||||
* @property {Number} sessionLength Session duration, in seconds, defaults to 1 year
|
||||
* @property {Number} maxLimit Max value for limit option on queries, defaults to unlimited
|
||||
* @property {Boolean} expireInactiveSessions Sets wether we should expire the inactive sessions, defaults to true
|
||||
* @property {Boolean} revokeSessionOnPasswordReset 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.
|
||||
* @property {Number} schemaCacheTTL The TTL for caching the schema for optimizing read/write operations. You should put a long TTL when your DB is in production. default to 5000; set 0 to disable.
|
||||
* @property {Number} cacheTTL Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)
|
||||
* @property {Number} cacheMaxSize Sets the maximum size for the in memory cache, defaults to 10000
|
||||
* @property {Boolean} directAccess Replace HTTP Interface when using JS SDK in current node runtime, defaults to false. Caution, this is an experimental feature that may not be appropriate for production.
|
||||
* @property {Boolean} enableSingleSchemaCache Use a single schema cache shared across requests. Reduces number of queries made to _SCHEMA, defaults to false, i.e. unique schema cache per request.
|
||||
* @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors
|
||||
* @property {Number} objectIdSize Sets the number of characters in generated object id's, default 10
|
||||
* @property {Number} port The port to run the ParseServer, defaults to 1337.
|
||||
* @property {String} host The host to serve ParseServer on, defaults to 0.0.0.0
|
||||
* @property {String} mountPath Mount path for the server, defaults to /parse
|
||||
* @property {Number} cacheTTL Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)
|
||||
* @property {String} clientKey Key for iOS, MacOS, tvOS clients
|
||||
* @property {String} cloud Full path to your cloud code main.js
|
||||
* @property {Number|Boolean} cluster Run with cluster, optionally set the number of processes default to os.cpus().length
|
||||
* @property {Union} middleware middleware for express server, can be string or function
|
||||
* @property {Boolean} startLiveQueryServer Starts the liveQuery server
|
||||
* @property {String} collectionPrefix A collection prefix for the classes
|
||||
* @property {CustomPagesOptions} customPages custom pages for password validation and reset
|
||||
* @property {Adapter<StorageAdapter>} databaseAdapter Adapter module for the database
|
||||
* @property {Any} databaseOptions Options to pass to the mongodb client
|
||||
* @property {String} databaseURI The full URI to your database. Supported databases are mongodb or postgres.
|
||||
* @property {Boolean} directAccess Replace HTTP Interface when using JS SDK in current node runtime, defaults to false. Caution, this is an experimental feature that may not be appropriate for production.
|
||||
* @property {String} dotNetKey Key for Unity and .Net SDK
|
||||
* @property {Adapter<MailAdapter>} emailAdapter Adapter module for email sending
|
||||
* @property {Number} emailVerifyTokenValidityDuration Email verification token validity duration, in seconds
|
||||
* @property {Boolean} enableAnonymousUsers Enable (or disable) anon users, defaults to true
|
||||
* @property {Boolean} enableExpressErrorHandler Enables the default express error handler for all errors
|
||||
* @property {Boolean} enableSingleSchemaCache Use a single schema cache shared across requests. Reduces number of queries made to _SCHEMA, defaults to false, i.e. unique schema cache per request.
|
||||
* @property {Boolean} expireInactiveSessions Sets wether we should expire the inactive sessions, defaults to true
|
||||
* @property {String} fileKey Key for your files
|
||||
* @property {Adapter<FilesAdapter>} filesAdapter Adapter module for the files sub-system
|
||||
* @property {String} host The host to serve ParseServer on, defaults to 0.0.0.0
|
||||
* @property {String} javascriptKey Key for the Javascript SDK
|
||||
* @property {Boolean} jsonLogs Log as structured JSON objects
|
||||
* @property {LiveQueryOptions} liveQuery parse-server's LiveQuery configuration object
|
||||
* @property {LiveQueryServerOptions} liveQueryServerOptions Live query server configuration options (will start the liveQuery server)
|
||||
* @property {Adapter<LoggerAdapter>} loggerAdapter Adapter module for the logging sub-system
|
||||
* @property {String} logLevel Sets the level for logs
|
||||
* @property {String} logsFolder Folder for the logs (defaults to './logs'); set to null to disable file based logging
|
||||
* @property {String} masterKey Your Parse Master Key
|
||||
* @property {String[]} masterKeyIps Restrict masterKey to be used by only these ips, defaults to [] (allow all ips)
|
||||
* @property {Number} maxLimit Max value for limit option on queries, defaults to unlimited
|
||||
* @property {String} maxUploadSize Max file size for uploads, defaults to 20mb
|
||||
* @property {Union} middleware middleware for express server, can be string or function
|
||||
* @property {String} mountPath Mount path for the server, defaults to /parse
|
||||
* @property {Number} objectIdSize Sets the number of characters in generated object id's, default 10
|
||||
* @property {Any} passwordPolicy Password policy for enforcing password related rules
|
||||
* @property {Number} port The port to run the ParseServer, defaults to 1337.
|
||||
* @property {Boolean} preserveFileName Enable (or disable) the addition of a unique hash to the file names
|
||||
* @property {Boolean} preventLoginWithUnverifiedEmail Prevent user from login if email is not verified and PARSE_SERVER_VERIFY_USER_EMAILS is true, defaults to false
|
||||
* @property {ProtectedFields} protectedFields Protected fields that should be treated with extra security when fetching details.
|
||||
* @property {String} publicServerURL Public URL to your parse server with http:// or https://.
|
||||
* @property {Any} push Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications
|
||||
* @property {String} readOnlyMasterKey Read-only key, which has the same capabilities as MasterKey without writes
|
||||
* @property {String} restAPIKey Key for REST calls
|
||||
* @property {Boolean} revokeSessionOnPasswordReset 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.
|
||||
* @property {Boolean} scheduledPush Configuration for push scheduling, defaults to false.
|
||||
* @property {Number} schemaCacheTTL The TTL for caching the schema for optimizing read/write operations. You should put a long TTL when your DB is in production. default to 5000; set 0 to disable.
|
||||
* @property {String} serverURL URL to your parse server with http:// or https://.
|
||||
* @property {Number} sessionLength Session duration, in seconds, defaults to 1 year
|
||||
* @property {Boolean} silent Disables console output
|
||||
* @property {Boolean} startLiveQueryServer Starts the liveQuery server
|
||||
* @property {String[]} userSensitiveFields Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields
|
||||
* @property {Boolean} verbose Set the logging to verbose
|
||||
* @property {Boolean} verifyUserEmails Enable (or disable) user email validation, defaults to false
|
||||
* @property {String} webhookKey Key sent with outgoing webhook calls
|
||||
*/
|
||||
|
||||
/**
|
||||
* @interface CustomPagesOptions
|
||||
* @property {String} invalidLink invalid link page path
|
||||
* @property {String} verifyEmailSuccess verify email success page path
|
||||
* @property {String} choosePassword choose password page path
|
||||
* @property {String} invalidLink invalid link page path
|
||||
* @property {String} passwordResetSuccess password reset success page path
|
||||
* @property {String} verifyEmailSuccess verify email success page path
|
||||
*/
|
||||
|
||||
/**
|
||||
* @interface LiveQueryOptions
|
||||
* @property {String[]} classNames parse-server's LiveQuery classNames
|
||||
* @property {String} redisURL parse-server's LiveQuery redisURL
|
||||
* @property {Adapter<PubSubAdapter>} pubSubAdapter LiveQuery pubsub adapter
|
||||
* @property {String} redisURL parse-server's LiveQuery redisURL
|
||||
*/
|
||||
|
||||
/**
|
||||
* @interface LiveQueryServerOptions
|
||||
* @property {String} appId 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.
|
||||
* @property {String} masterKey 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.
|
||||
* @property {String} serverURL 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.
|
||||
* @property {Any} keyPairs 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.
|
||||
* @property {Number} websocketTimeout 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).
|
||||
* @property {Number} cacheTimeout 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 30 * 24 * 60 * 60 * 1000 ms (~30 days).
|
||||
* @property {Any} keyPairs 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.
|
||||
* @property {String} logLevel This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE, defaults to INFO.
|
||||
* @property {String} masterKey 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.
|
||||
* @property {Number} port The port to run the LiveQuery server, defaults to 1337.
|
||||
* @property {String} redisURL parse-server's LiveQuery redisURL
|
||||
* @property {Adapter<PubSubAdapter>} pubSubAdapter LiveQuery pubsub adapter
|
||||
* @property {String} redisURL parse-server's LiveQuery redisURL
|
||||
* @property {String} serverURL 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.
|
||||
* @property {Number} websocketTimeout 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).
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import { PubSubAdapter } from '../Adapters/PubSub/PubSubAdapter';
|
||||
// @flow
|
||||
type Adapter<T> = string | any | T;
|
||||
type NumberOrBoolean = number | boolean;
|
||||
type ProtectedFields = any;
|
||||
|
||||
export interface ParseServerOptions {
|
||||
/* Your Parse Application ID
|
||||
@@ -86,7 +87,7 @@ export interface ParseServerOptions {
|
||||
userSensitiveFields: ?(string[]);
|
||||
/* Protected fields that should be treated with extra security when fetching details.
|
||||
:DEFAULT: {"_User": {"*": ["email"]}} */
|
||||
protectedFields: ?any;
|
||||
protectedFields: ?ProtectedFields;
|
||||
/* Enable (or disable) anon users, defaults to true
|
||||
:ENV: PARSE_SERVER_ENABLE_ANON_USERS
|
||||
:DEFAULT: true */
|
||||
|
||||
Reference in New Issue
Block a user