Skip to content

Server API ​

Exported from @jalsoedesign/filezilla-core.

ts
new Server(properties: ServerProperties, path: string)

The constructor stores its input without runtime schema validation.

MemberTypeBehavior
pathreadonly stringCanonical selection path; escapes literal percent/slash within names
propertiesRawServerPropertiesBacking object after XML field conversion; remote directory remains encoded
propertiesServerPropertiesExtendedNew shallow object; its remoteDirectory getter decodes only when read
toJSON()Omit<ServerPropertiesExtended, 'password'>Password-redacted metadata including path and raw encoded remote directory
siteProtocolNamestringDeliberate protocol-name mapping: CLOUDFLARE_R2 for 24, UNKNOWN for unrecognized values
getRemoteDirectory(defaultRemoteDirectory = '')stringDecode supported FileZilla path, or return default for an absent value

propertiesRaw is not the original XML and is not immutable. It can contain decoded credentials. properties is not a redacted view.

ServerProperties ​

PropertyTypeNotes
hoststringServer address
portnumberXML reader requires an integer from 1 to 65535
protocolServerProtocolSaved protocol ID
typeServerTypeSaved server/path dialect
userstringDeclared required; missing XML values can still produce undefined
password?stringSupported decoded password if included
passwordEncoding?stringOriginal password representation
keyFile?stringSaved local private key path
logonTypeLogonTypeSaved authentication mode
timezoneOffsetnumberMetadata; connectors do not apply it
passiveModePasvModeFTP factory maps active/default/passive
maximumMultipleConnectionsnumberSaved limit; pass it explicitly as ConnectorPool serverMaxConnections to enforce it
encodingTypeCharsetEncodingMetadata; connectors do not map this to transport encoding
customEncoding?stringSaved custom encoding
bypassProxybooleanMetadata; no proxy configuration is implemented
namestringFileZilla site name
comments?stringUser notes
localDirectory?stringSaved local start path
remoteDirectory?stringEncoded in raw view, decoded in extended view
synchronizedBrowsingbooleanSaved UI preference only
directoryComparisonbooleanSaved UI preference only

ServerPropertiesExtended extends the interface with path: string. The XML reader validates its supported fields and defaults. Direct new Server(...) callers still own validation of the typed object they supply. Some logon modes legitimately have no XML username, so user can be undefined at runtime despite the existing interface declaration.

Remote directory grammar ​

The decoder expects a numeric path type, a zero prefix length and length-prefixed segments. 1 0 3 srv 3 app decodes to /srv/app; 1 0 decodes to /. Supported type IDs are 0, 1, 8 and 9. Unsupported/malformed inputs throw when the decoded directory is requested, including by spreading the full properties view. Host/name reads and built-in redacted JSON do not decode it. See paths.

Documentation for the filezilla-js library. An independent project.