- ButtercupDatasources
The primary module
- BoxDatasource ⇐
WebDAVDatasource
Datasource for Box archives
- DropboxDatasource ⇐
TextDatasource
Datasource for Dropbox archives
- FileDatasource ⇐
TextDatasource
File datasource for loading and saving files
- NextcloudDatasource ⇐
OwnCloudDatasource
Datasource for Nextcloud archives
- OwnCloudDatasource ⇐
WebDAVDatasource
Datasource for OwnCloud archives
- TextDatasource
Datasource for text input and output
- WebDAVDatasource ⇐
TextDatasource
WebDAV datasource for reading and writing remote archives
- fireInstantiationHandlers(datasource)
Execute all datasource postprocessors
- objectToDatasource(obj, [hostCredentials]) ⇒
null
|TextDatasource
Create a datasource from an object The object must have the required properties (as output by the corresponding
toObject
call of the datasource).- registerDatasource(datasourceType, DSClass)
Register a new datasource This is called internally by the built-in datasources, but should be called if a custom datasource is used.
- registerDatasourcePostProcessor(callback) ⇒
RegisterDatasourcePostProcessorResult
Register a post-processor for a datasource being instantiated
- stringToDatasource(str, [hostCredentials]) ⇒
null
|TextDatasource
Create a datasource from a string
The primary module
BoxDatasource ⇐ WebDAVDatasource
Datasource for Box archives
Kind: global class
Extends: WebDAVDatasource
- BoxDatasource ⇐
WebDAVDatasource
- new BoxDatasource(resourcePath, credentials)
- instance
- .client :
Object
- .endpoint :
String
- .path :
String
- .hasContent :
Boolean
- .toObject() ⇒
Object
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .client :
- static
Datasource for Box connections
Param | Type | Description |
---|---|---|
resourcePath | String |
The file path |
credentials | Credentials |
The credentials (username/password) for Box |
The WebDAV client instance
Kind: instance property of BoxDatasource
The remote WebDAV endpoint
Kind: instance property of BoxDatasource
The remote archive path
Kind: instance property of BoxDatasource
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of BoxDatasource
Output the datasource as an object
Kind: instance method of BoxDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
Load archive history from the datasource
Kind: instance method of BoxDatasource
Returns: Promise.<Array.<String>>
- A promise resolving archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for archive decryption |
Save archive contents to the WebDAV service
Kind: instance method of BoxDatasource
Returns: Promise
- A promise resolving when the save is complete
Param | Type | Description |
---|---|---|
history | Array.<String> |
Archive history |
credentials | Credentials |
The credentials for encryption |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of BoxDatasource
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
boxDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of BoxDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of BoxDatasource
Returns: String
- The string representation of the datasource
BoxDatasource.fromObject(obj, hostCredentials) ⇒ BoxDatasource
Create an instance from an object
Kind: static method of BoxDatasource
Returns: BoxDatasource
- A new instance
Throws:
Error
Throws if credentials are not providedError
Throws if the type specified is invalid
Param | Type | Description |
---|---|---|
obj | Object |
The object representation |
hostCredentials | Credentials |
The box account credentials |
BoxDatasource.fromString(str, hostCredentials) ⇒ BoxDatasource
Create an instance from a string
Kind: static method of BoxDatasource
Returns: BoxDatasource
- A new instance
See: BoxDatasource.fromObject
Param | Type | Description |
---|---|---|
str | String |
The string representation |
hostCredentials | Credentials |
Credentials for the box account |
DropboxDatasource ⇐ TextDatasource
Datasource for Dropbox archives
Kind: global class
Extends: TextDatasource
- DropboxDatasource ⇐
TextDatasource
- new DropboxDatasource(accessToken, resourcePath)
- instance
- .hasContent :
Boolean
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .toObject() ⇒
Object
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .hasContent :
- static
Datasource for Dropbox accounts
Param | Type | Description |
---|---|---|
accessToken | String |
The dropbox access token |
resourcePath | String |
The file path |
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of DropboxDatasource
Load an archive from the datasource
Kind: instance method of DropboxDatasource
Overrides: load
Returns: Promise.<Array.<String>>
- A promise that resolves archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for decryption |
Save an archive using the datasource
Kind: instance method of DropboxDatasource
Overrides: save
Returns: Promise
- A promise that resolves when saving has completed
Param | Type | Description |
---|---|---|
history | Array.<String> |
The archive history to save |
credentials | Credentials |
The credentials to save with |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of DropboxDatasource
Overrides: supportsRemoteBypass
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
Output the datasource as an object
Kind: instance method of DropboxDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
dropboxDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of DropboxDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of DropboxDatasource
Returns: String
- The string representation of the datasource
DropboxDatasource.fromObject(obj) ⇒ DropboxDatasource
Create a new instance from an object
Kind: static method of DropboxDatasource
Returns: DropboxDatasource
- A new instance
Throws:
Error
Throws if the type is invalid
Param | Type | Description |
---|---|---|
obj | Object |
The object representation |
DropboxDatasource.fromString(str) ⇒ DropboxDatasource
Create a new instance from a string
Kind: static method of DropboxDatasource
Returns: DropboxDatasource
- A new instance
Throws:
Error
Throws if the type is invalid
Param | Type | Description |
---|---|---|
str | String |
The string representation |
FileDatasource ⇐ TextDatasource
File datasource for loading and saving files
Kind: global class
Extends: TextDatasource
- FileDatasource ⇐
TextDatasource
- new FileDatasource(filename)
- instance
- .path :
String
- .hasContent :
Boolean
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .toObject() ⇒
Object
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .path :
- static
Constructor for the file datasource
Param | Type | Description |
---|---|---|
filename | string |
The filename to load and save |
The file path
Kind: instance property of FileDatasource
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of FileDatasource
Load from the filename specified in the constructor using a password
Kind: instance method of FileDatasource
Overrides: load
Returns: Promise.<Array.<String>>
- A promise resolving with archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for decryption |
Save archive history to a file
Kind: instance method of FileDatasource
Overrides: save
Returns: Promise
- A promise that resolves when saving is complete
Param | Type | Description |
---|---|---|
history | Array.<String> |
The archive history to save |
credentials | Credentials |
The credentials to save with |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of FileDatasource
Overrides: supportsRemoteBypass
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
Output the datasource as an object
Kind: instance method of FileDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
fileDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of FileDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of FileDatasource
Returns: String
- The string representation of the datasource
FileDatasource.fromObject(obj) ⇒ FileDatasource
Create an instance from an object
Kind: static method of FileDatasource
Returns: FileDatasource
- A new instance
Throws:
Error
Throws for an invalid type specification
Param | Type | Description |
---|---|---|
obj | Object |
The object representation of a datasource |
FileDatasource.fromString(str) ⇒ FileDatasource
Create an instance from a string
Kind: static method of FileDatasource
Returns: FileDatasource
- A new instance
See: FileDatasource.fromObject
Param | Type | Description |
---|---|---|
str | String |
The string representation |
NextcloudDatasource ⇐ OwnCloudDatasource
Datasource for Nextcloud archives
Kind: global class
Extends: OwnCloudDatasource
- NextcloudDatasource ⇐
OwnCloudDatasource
- new NextcloudDatasource()
- instance
- .client :
Object
- .endpoint :
String
- .path :
String
- .hasContent :
Boolean
- .toObject() ⇒
Object
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .client :
- static
Constructor for the datasource
The WebDAV client instance
Kind: instance property of NextcloudDatasource
The remote WebDAV endpoint
Kind: instance property of NextcloudDatasource
The remote archive path
Kind: instance property of NextcloudDatasource
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of NextcloudDatasource
Output the datasource as an object
Kind: instance method of NextcloudDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
Load archive history from the datasource
Kind: instance method of NextcloudDatasource
Returns: Promise.<Array.<String>>
- A promise resolving archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for archive decryption |
Save archive contents to the WebDAV service
Kind: instance method of NextcloudDatasource
Returns: Promise
- A promise resolving when the save is complete
Param | Type | Description |
---|---|---|
history | Array.<String> |
Archive history |
credentials | Credentials |
The credentials for encryption |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of NextcloudDatasource
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
nextcloudDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of NextcloudDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of NextcloudDatasource
Returns: String
- The string representation of the datasource
NextcloudDatasource.fromObject(obj, [hostCredentials]) ⇒ NextcloudDatasource
Create a new instance from an object
Kind: static method of NextcloudDatasource
Returns: NextcloudDatasource
- A new instance
Throws:
Error
Throws for an invalid type specification
Param | Type | Description |
---|---|---|
obj | Object |
The object representation of an instance |
[hostCredentials] | Credentials |
The remote server credentials |
NextcloudDatasource.fromString(str, [hostCredentials]) ⇒ NextcloudDatasource
Create a new instance from a string
Kind: static method of NextcloudDatasource
Returns: NextcloudDatasource
- A new instance
Throws:
Error
Throws for an invalid type specification
Param | Type | Description |
---|---|---|
str | String |
The string representation of an instance |
[hostCredentials] | Credentials |
The remote server credentials |
OwnCloudDatasource ⇐ WebDAVDatasource
Datasource for OwnCloud archives
Kind: global class
Extends: WebDAVDatasource
- OwnCloudDatasource ⇐
WebDAVDatasource
- new OwnCloudDatasource(owncloudURL, resourcePath, [credentials])
- instance
- .client :
Object
- .endpoint :
String
- .path :
String
- .hasContent :
Boolean
- .toObject() ⇒
Object
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .client :
- static
Datasource for Owncloud connections
Param | Type | Description |
---|---|---|
owncloudURL | String |
The URL to the owncloud instance, without "remote.php/webdav" etc. |
resourcePath | String |
The file path |
[credentials] | Credentials |
The credentials (username/password) for owncloud |
The WebDAV client instance
Kind: instance property of OwnCloudDatasource
The remote WebDAV endpoint
Kind: instance property of OwnCloudDatasource
The remote archive path
Kind: instance property of OwnCloudDatasource
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of OwnCloudDatasource
Output the datasource as an object
Kind: instance method of OwnCloudDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
Load archive history from the datasource
Kind: instance method of OwnCloudDatasource
Returns: Promise.<Array.<String>>
- A promise resolving archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for archive decryption |
Save archive contents to the WebDAV service
Kind: instance method of OwnCloudDatasource
Returns: Promise
- A promise resolving when the save is complete
Param | Type | Description |
---|---|---|
history | Array.<String> |
Archive history |
credentials | Credentials |
The credentials for encryption |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of OwnCloudDatasource
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
ownCloudDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of OwnCloudDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of OwnCloudDatasource
Returns: String
- The string representation of the datasource
OwnCloudDatasource.fromObject(obj, [hostCredentials]) ⇒ OwnCloudDatasource
Create an instance from an object
Kind: static method of OwnCloudDatasource
Returns: OwnCloudDatasource
- A new instance
Throws:
Error
Throws for an invalid type specification
Param | Type | Description |
---|---|---|
obj | Object |
The object representation of the datasource |
[hostCredentials] | Credentials |
Remote server credentials |
OwnCloudDatasource.fromString(str, [hostCredentials]) ⇒ OwnCloudDatasource
Create an instance from a string
Kind: static method of OwnCloudDatasource
Returns: OwnCloudDatasource
- A new instance
Throws:
Error
Throws for an invalid type specification
Param | Type | Description |
---|---|---|
str | String |
The string representation of the datasource |
[hostCredentials] | Credentials |
The remote server credentials |
Datasource for text input and output
Kind: global class
- TextDatasource
- new TextDatasource(content)
- .hasContent :
Boolean
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise.<string>
- .setContent(content) ⇒
TextDatasource
- .supportsRemoteBypass() ⇒
Boolean
- .toObject() ⇒
Object
- .toString() ⇒
String
Constructor for the text datasource
Param | Type | Description |
---|---|---|
content | string |
The content to load from |
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of TextDatasource
Load from the stored content using a password to decrypt
Kind: instance method of TextDatasource
Returns: Promise.<Array.<String>>
- A promise that resolves with decrypted history
Throws:
Error
Rejects if content is empty
Param | Type | Description |
---|---|---|
credentials | Credentials |
The password or Credentials instance to decrypt with |
Save archive contents with a password
Kind: instance method of TextDatasource
Returns: Promise.<string>
- A promise resolving with the encrypted content
Param | Type | Description |
---|---|---|
history | Array.<String> |
Archive history to save |
credentials | Credentials |
The Credentials instance to encrypt with |
textDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of TextDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of TextDatasource
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
Output the datasource as an object
Kind: instance method of TextDatasource
Returns: Object
- The object representation
Output the datasource configuration as a string
Kind: instance method of TextDatasource
Returns: String
- The string representation of the datasource
WebDAVDatasource ⇐ TextDatasource
WebDAV datasource for reading and writing remote archives
Kind: global class
Extends: TextDatasource
- WebDAVDatasource ⇐
TextDatasource
- new WebDAVDatasource(endpoint, webDAVPath, [credentials])
- instance
- .client :
Object
- .endpoint :
String
- .path :
String
- .hasContent :
Boolean
- .load(credentials) ⇒
Promise.<Array.<String>>
- .save(history, credentials) ⇒
Promise
- .supportsRemoteBypass() ⇒
Boolean
- .toObject() ⇒
Object
- .setContent(content) ⇒
TextDatasource
- .toString() ⇒
String
- .client :
- static
Constructor for the datasource
Param | Type | Description |
---|---|---|
endpoint | string |
URL for the WebDAV service (without resource path) |
webDAVPath | string |
Resource path on the WebDAV service |
[credentials] | Credentials |
Credentials (username/password) for the WebDAV service |
The WebDAV client instance
Kind: instance property of WebDAVDatasource
The remote WebDAV endpoint
Kind: instance property of WebDAVDatasource
The remote archive path
Kind: instance property of WebDAVDatasource
Whether the datasource currently has content Used to check if the datasource has encrypted content that can be loaded. May be used when attempting to open a vault in offline mode.
Kind: instance property of WebDAVDatasource
Load archive history from the datasource
Kind: instance method of WebDAVDatasource
Overrides: load
Returns: Promise.<Array.<String>>
- A promise resolving archive history
Param | Type | Description |
---|---|---|
credentials | Credentials |
The credentials for archive decryption |
Save archive contents to the WebDAV service
Kind: instance method of WebDAVDatasource
Overrides: save
Returns: Promise
- A promise resolving when the save is complete
Param | Type | Description |
---|---|---|
history | Array.<String> |
Archive history |
credentials | Credentials |
The credentials for encryption |
Whether or not the datasource supports bypassing remote fetch operations
Kind: instance method of WebDAVDatasource
Overrides: supportsRemoteBypass
Returns: Boolean
- True if content can be set to bypass fetch operations,
false otherwise
Output the datasource as an object
Kind: instance method of WebDAVDatasource
Overrides: toObject
Returns: Object
- An object describing the datasource
webDAVDatasource.setContent(content) ⇒ TextDatasource
Set the text content
Kind: instance method of WebDAVDatasource
Returns: TextDatasource
- Self
Param | Type | Description |
---|---|---|
content | String |
The encrypted text content |
Output the datasource configuration as a string
Kind: instance method of WebDAVDatasource
Returns: String
- The string representation of the datasource
Create an instance from an object
Kind: static method of WebDAVDatasource
Param | Type | Description |
---|---|---|
obj | Object |
The WebDAV info object |
[hostCredentials] | Credentials |
The server credentials |
Create an instance from a string
Kind: static method of WebDAVDatasource
Param | Type | Description |
---|---|---|
str | String |
The string representation of the datasource |
[hostCredentials] | Credentials |
The server credentials |
Execute all datasource postprocessors
Kind: global function
Param | Type | Description |
---|---|---|
datasource | TextDatasource |
The datasource instance |
objectToDatasource(obj, [hostCredentials]) ⇒ null
| TextDatasource
Create a datasource from an object
The object must have the required properties (as output by the corresponding
toObject
call of the datasource).
Kind: global function
Returns: null
| TextDatasource
- A datasource instance or null of none found
Access: public
Param | Type | Description |
---|---|---|
obj | Object |
The object |
[hostCredentials] | Credentials |
Credentials instance for remote host authentication (not required for File/Text datasources) |
Register a new datasource This is called internally by the built-in datasources, but should be called if a custom datasource is used.
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
datasourceType | String |
The name (slug) of the datasource |
DSClass | Object |
The class for the new datasource |
registerDatasourcePostProcessor(callback) ⇒ RegisterDatasourcePostProcessorResult
Register a post-processor for a datasource being instantiated
Kind: global function
Returns: RegisterDatasourcePostProcessorResult
- The result of the registration
Param | Type | Description |
---|---|---|
callback | function |
The callback to execute with the instantiated datasource |
stringToDatasource(str, [hostCredentials]) ⇒ null
| TextDatasource
Create a datasource from a string
Kind: global function
Returns: null
| TextDatasource
- A new datasource instance or null of not found
Access: public
See: objectToDatasource
Param | Type | Description |
---|---|---|
str | String |
The string representation of a datasource, as output by the toString method on the corresponding datasource |
[hostCredentials] | Credentials |
The remote authentication credentials |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
remove | function |
Function to call to remove the handler |