Padloc Logo Docs & Resources

Class: ServerConfig

server.ServerConfig

Server configuration

Hierarchy

Constructors

constructor

new ServerConfig(init?)

Parameters

Name Type
init Partial<ServerConfig>

Overrides

Config.constructor

Defined in

core/src/server.ts:89

Properties

_paramDefinitions

_paramDefinitions: ParamDefinition[]

Inherited from

Config._paramDefinitions

Defined in

core/src/config.ts:34


_propertySerializationOptions

_propertySerializationOptions: SerializationOptions[]

Inherited from

Config._propertySerializationOptions

Defined in

core/src/encoding.ts:163


clientUrl

clientUrl: string = "http://localhost:8080"

URL where the client interface is hosted. Used for creating links into the application

Defined in

core/src/server.ts:68


defaultAuthTypes

defaultAuthTypes: AuthType[]

Defined in

core/src/server.ts:83


maxRequestAge

maxRequestAge: number

Maximum accepted request age

Defined in

core/src/server.ts:76


reportErrors

reportErrors: string = ""

Email address to report critical errors to

Defined in

core/src/server.ts:72


scimServerUrl

scimServerUrl: string = "http://localhost:5000"

URL where the SCIM directory server is hosted, if used. Used for creating URLs for integrations

Defined in

core/src/server.ts:87


verifyEmailOnSignup

verifyEmailOnSignup: boolean = true

Whether or not to require email verification before creating an account

Defined in

core/src/server.ts:80

Accessors

kind

get kind(): string

A string representing the objects "type", useful for segmenting storage, among other things. Defaults to the lowercase class name, but can be overwritten by subclasses

Returns

string

Inherited from

Config.kind

Defined in

core/src/encoding.ts:159

Methods

_fromRaw

Protected _fromRaw(raw): void

Restore values from a raw object. The default implementation simply copies over all iterable properties from the base object. Overwrite this method for properties that require special treatment

Parameters

Name Type
raw any

Returns

void

Inherited from

Config._fromRaw

Defined in

core/src/encoding.ts:286


_toRaw

Protected _toRaw(version): any

Transform this object into a raw javascript object used for serialization. The default implementation simply copies all iterable properties not included in the [[exlude]] array and calls toRaw on any properties that are themselfes instances of Serializable. This method should be overwritten by subclasses if certain properties require special treatment.

Parameters

Name Type
version undefined | string

Returns

any

Inherited from

Config._toRaw

Defined in

core/src/encoding.ts:257


clone

clone(): ServerConfig

Creates a deep clone of the object

Returns

ServerConfig

Inherited from

Config.clone

Defined in

core/src/encoding.ts:244


fromBytes

fromBytes(bytes): ServerConfig

Deserializes the object from a byte array

Parameters

Name Type
bytes Uint8Array

Returns

ServerConfig

Inherited from

Config.fromBytes

Defined in

core/src/encoding.ts:237


fromEnv

fromEnv(env, prefix?): ServerConfig

Parameters

Name Type Default value
env Object undefined
prefix string "PL_"

Returns

ServerConfig

Inherited from

Config.fromEnv

Defined in

core/src/config.ts:36


fromJSON

fromJSON(json): ServerConfig

Deserializes the object from a JSON string

Parameters

Name Type
json string

Returns

ServerConfig

Inherited from

Config.fromJSON

Defined in

core/src/encoding.ts:223


fromRaw

fromRaw(raw): ServerConfig

Restores propertiers from a raw object of the same form generated by toRaw. The base implementation blindly copies over values from the raw object via Object.assign so subclasses should explictly process any propertyies that need special treatment.

Also takes are of validation and "upgrading" in case the raw object has an old version. Use the protected _fromRaw method to implement subclass-specific behavior.

Parameters

Name Type
raw any

Returns

ServerConfig

Inherited from

Config.fromRaw

Defined in

core/src/encoding.ts:196


toBytes

toBytes(): Uint8Array

Returns a serialization of the object in form of a byte array

Returns

Uint8Array

Inherited from

Config.toBytes

Defined in

core/src/encoding.ts:230


toEnv

toEnv(prefix?, includeUndefined?): Object

Parameters

Name Type Default value
prefix string "PL_"
includeUndefined boolean false

Returns

Object

Inherited from

Config.toEnv

Defined in

core/src/config.ts:74


toJSON

toJSON(): string

Returns a JSON serialization of the object

Returns

string

Inherited from

Config.toJSON

Defined in

core/src/encoding.ts:216


toRaw

toRaw(version?): any

Creates a raw javascript object representation of the class, which can be used for storage or data transmission. Also handles "downgrading" to previous versions. Use _toRaw for subclass-specific behavior.

Parameters

Name Type
version? string

Returns

any

Inherited from

Config.toRaw

Defined in

core/src/config.ts:112


validate

validate(): boolean

This is called during deserialization and should verify that all properties have been populated with values of the correct type. Subclasses should implement this method based on their class structure.

Returns

boolean

Inherited from

Config.validate

Defined in

core/src/encoding.ts:170