Adds documentations for adapters and main constructors (#4951)

* wip

* Adds documentations for adapters, and constructors

* nits

* nit
This commit is contained in:
Florent Vilmart
2018-08-10 15:51:31 -04:00
parent 0571675fcd
commit 942b9b5b1a
17 changed files with 3316 additions and 2708 deletions

View File

@@ -1,5 +1,13 @@
import { AnalyticsAdapter } from "../Adapters/Analytics/AnalyticsAdapter";
import { FilesAdapter } from "../Adapters/Files/FilesAdapter";
import { LoggerAdapter } from "../Adapters/Logger/LoggerAdapter";
import { StorageAdapter } from "../Adapters/Storage/StorageAdapter";
import { CacheAdapter } from "../Adapters/Cache/CacheAdapter";
import { MailAdapter } from "../Adapters/Email/MailAdapter";
import { PubSubAdapter } from "../Adapters/PubSub/PubSubAdapter";
// @flow
type Adapter = string|any;
type Adapter<T> = string|any|T;
type NumberOrBoolean = number|boolean;
export interface ParseServerOptions {
@@ -11,20 +19,20 @@ export interface ParseServerOptions {
/* URL to your parse server with http:// or https://.
:ENV: PARSE_SERVER_URL */
serverURL: string;
/* Restrict masterKey to be used by only these ips. defaults to [] (allow all ips) */
/* Restrict masterKey to be used by only these ips, defaults to [] (allow all ips) */
masterKeyIps: ?string[]; // = []
/* Sets the app name */
appName: ?string;
/* Adapter module for the analytics */
analyticsAdapter: ?Adapter;
analyticsAdapter: ?Adapter<AnalyticsAdapter>;
/* Adapter module for the files sub-system */
filesAdapter: ?Adapter;
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. */
/* Configuration for push scheduling, defaults to false. */
scheduledPush: ?boolean; // = false
/* Adapter module for the logging sub-system */
loggerAdapter: ?Adapter;
loggerAdapter: ?Adapter<LoggerAdapter>;
/* Log as structured JSON objects
:ENV: JSON_LOGS */
jsonLogs: ?boolean;
@@ -39,12 +47,12 @@ export interface ParseServerOptions {
/* Disables console output
:ENV: SILENT */
silent: ?boolean;
/* The full URI to your mongodb database */
/* The full URI to your database. Supported databases are mongodb or postgres. */
databaseURI: string; // = mongodb://localhost:27017/parse
/* Options to pass to the mongodb client */
databaseOptions: ?any;
/* Adapter module for the database */
databaseAdapter: ?Adapter;
databaseAdapter: ?Adapter<StorageAdapter>;
/* Full path to your cloud code main.js */
cloud: ?string;
/* A collection prefix for the classes */
@@ -78,22 +86,22 @@ export interface ParseServerOptions {
/* Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
:ENV: PARSE_SERVER_AUTH_PROVIDERS */
auth: ?any;
/* Max file size for uploads. defaults to 20mb */
/* Max file size for uploads, defaults to 20mb */
maxUploadSize: ?string; // = 20mb
/* Enable (or disable) user email validation, defaults to false */
verifyUserEmails: ?boolean; // = false
/* Prevent user from login if email is not verified and PARSE_SERVER_VERIFY_USER_EMAILS is true, defaults to false */
preventLoginWithUnverifiedEmail: ?boolean; // = false
/* Email verification token validity duration */
/* Email verification token validity duration, in seconds */
emailVerifyTokenValidityDuration: ?number;
/* account lockout policy for failed login attempts */
accountLockout: ?any;
/* Password policy for enforcing password related rules */
passwordPolicy: ?any;
/* Adapter module for the cache */
cacheAdapter: ?Adapter;
/* Adapter module for the email sending */
emailAdapter: ?Adapter;
cacheAdapter: ?Adapter<CacheAdapter>;
/* Adapter module for email sending */
emailAdapter: ?Adapter<MailAdapter>;
/* Public URL to your parse server with http:// or https://.
:ENV: PARSE_PUBLIC_SERVER_URL */
publicServerURL: ?string;
@@ -115,16 +123,16 @@ export interface ParseServerOptions {
cacheTTL: ?number; // = 5000
/* Sets the maximum size for the in memory cache, defaults to 10000 */
cacheMaxSize : ?number; // = 10000
/* 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. */
/* 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. */
enableSingleSchemaCache: ?boolean; // = false
/* Enables the default express error handler for all errors */
enableExpressErrorHandler: ?boolean; // = false
/* Sets the number of characters in generated object id's, default 10 */
objectIdSize: ?number; // = 10
/* The port to run the ParseServer. defaults to 1337.
/* The port to run the ParseServer, defaults to 1337.
:ENV: PORT */
port: ?number; // = 1337
/* The host to serve ParseServer on. defaults to 0.0.0.0 */
/* The host to serve ParseServer on, defaults to 0.0.0.0 */
host: ?string; // = 0.0.0.0
/* Mount path for the server, defaults to /parse */
mountPath: ?string; // = /parse
@@ -158,7 +166,7 @@ export interface LiveQueryOptions {
/* parse-server's LiveQuery redisURL */
redisURL: ?string,
/* LiveQuery pubsub adapter */
pubSubAdapter: ?Adapter,
pubSubAdapter: ?Adapter<PubSubAdapter>,
}
export interface LiveQueryServerOptions {
@@ -170,16 +178,16 @@ export interface LiveQueryServerOptions {
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).*/
/* 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 30 * 24 * 60 * 60 * 1000 ms (~30 days).*/
/* 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).*/
cacheTimeout: ?number,
/* This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE. Defaults to INFO.*/
/* 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.*/
/* The port to run the LiveQuery server, defaults to 1337.*/
port: ?number, // = 1337
/* parse-server's LiveQuery redisURL */
redisURL: ?string,
/* LiveQuery pubsub adapter */
pubSubAdapter: ?Adapter,
pubSubAdapter: ?Adapter<PubSubAdapter>,
}