- ArchiveManager
Archive Manager - manages a set of archives for the browser
- DropboxDatasource ⇐
TextDatasource
Datasource for Dropbox archives
- EntryFinder
- LocalStorageInterface ⇐
StorageInterface
Interface for localStorage
- StorageInterface :
Object
- ArchiveTools :
object
- flattenEntries(archives) ⇒
Array.<EntrySearchInfo>
Flatten entries into a searchable structure
- ArchiveDetailsDisplay :
Object
Archive details for display
- ManagedArchiveItem :
Object
Stored archive entry
- EntrySearchInfo :
Object
Archive Manager - manages a set of archives for the browser
Kind: global class
- ArchiveManager
- new ArchiveManager([storage])
- instance
- .archives :
Object
- .displayList :
Array.<ArchiveDetailsDisplay>
- .storage :
StorageInterface
- .unlockedArchives :
Array.<ManagedArchiveItem>
- .addArchive(archiveName, workspace, credentials, masterPassword)
- .isLocked(archiveName) ⇒
Boolean
- .loadState()
- .lock(archiveName) ⇒
Promise
- .removeArchive(archiveName) ⇒
Boolean
- .saveState() ⇒
Promise
- .unlock(archiveName, password) ⇒
Promise
- .updateUnlocked() ⇒
Promise
- .archives :
- static
Constructor for the manager
Param | Type | Description |
---|---|---|
[storage] | StorageInterface |
Storage interface reference |
Archives reference
Kind: instance property of ArchiveManager
archiveManager.displayList : Array.<ArchiveDetailsDisplay>
Array of archive details ready for display
Kind: instance property of ArchiveManager
archiveManager.storage : StorageInterface
Storage reference
Kind: instance property of ArchiveManager
archiveManager.unlockedArchives : Array.<ManagedArchiveItem>
Array of unlocked archive items
Kind: instance property of ArchiveManager
Add an archive to the manager
Kind: instance method of ArchiveManager
Param | Type | Description |
---|---|---|
archiveName | String |
A unique name for the item |
workspace | Workspace |
The workspace that holds the archive, datasource etc. |
credentials | Credentials |
The credentials for remote storage etc. (these should also already hold datasource meta information) |
masterPassword | String |
The master password |
Check if an item is locked
Kind: instance method of ArchiveManager
Returns: Boolean
- True if locked
Throws:
Error
Throws if the item is not found
Param | Type | Description |
---|---|---|
archiveName | String |
The name of the item |
Load the manager state Used when the page loads to restore the archive items list (all are locked at this stage).
Kind: instance method of ArchiveManager
Lock an item
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves when the item is locked
Throws:
Error
Throws if the item is not foundError
Throws if the item is already lockedError
Throws if the item is currently being processed
Param | Type | Description |
---|---|---|
archiveName | String |
The name of the item to lock |
Remove an archive by name
Kind: instance method of ArchiveManager
Returns: Boolean
- True if deleted, false if not found
Param | Type | Description |
---|---|---|
archiveName | String |
The name of the archive to remove |
Save the state of the manager to the storage
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves once the state has been saved
Unlock a locked item
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves when the item is unlocked
Throws:
Error
Throws if the item is not locked
Param | Type | Description |
---|---|---|
archiveName | String |
The name of the item to unlock |
password | String |
The master password of the item to unlock |
Update workspaces that are unlocked
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves after updating all unlocked workspaces
Stored archive status
Kind: static enum of ArchiveManager
ArchiveManager.getSharedManager() ⇒ ArchiveManager
Get the singleton shared instance
Kind: static method of ArchiveManager
Returns: ArchiveManager
- The shared instance
Datasource for Dropbox archives
Kind: global class
Extends: TextDatasource
- DropboxDatasource ⇐
TextDatasource
Datasource for Dropbox accounts
Param | Type | Description |
---|---|---|
accessToken | String |
The dropbox access token |
resourcePath | String |
The file path |
Output the datasource as an object
Kind: instance method of DropboxDatasource
Returns: Object
- An object describing the datasource
Kind: global class
Param | Type | Description |
---|---|---|
_archives | Array.<Archive> | Archive |
The archives to search |
entryFinder.items : Array.<EntrySearchInfo>
All items
Kind: instance property of EntryFinder
entryFinder.lastResult : Array.<EntrySearchInfo>
The last result
Kind: instance property of EntryFinder
Initialise the searching mechanism
Kind: instance method of EntryFinder
entryFinder.search(term) ⇒ Array.<EntrySearchInfo>
Search and get results
Kind: instance method of EntryFinder
Returns: Array.<EntrySearchInfo>
- The results
Param | Type | Description |
---|---|---|
term | String |
The search term |
LocalStorageInterface ⇐ StorageInterface
Interface for localStorage
Kind: global class
Extends: StorageInterface
- LocalStorageInterface ⇐
StorageInterface
- .getAllKeys() ⇒
Promise.<Array.<String>>
- .getValue(name) ⇒
Promise.<String>
- .setValue(name, value) ⇒
Promise
- .getAllKeys() ⇒
Get all keys from storage
Kind: instance method of LocalStorageInterface
Returns: Promise.<Array.<String>>
- A promise that resolves with an array of keys
Get the value of a key
Kind: instance method of LocalStorageInterface
Returns: Promise.<String>
- A promise that resolves with the value
Param | Type | Description |
---|---|---|
name | String |
The key name |
Set the value for a key
Kind: instance method of LocalStorageInterface
Returns: Promise
- A promise that resolves when the value is set
Param | Type | Description |
---|---|---|
name | String |
The key name |
value | String |
The value to set |
Kind: global variable
- StorageInterface :
Object
Get data from storage
Kind: static property of StorageInterface
Returns: *
- The fetched data
Param | Type | Description |
---|---|---|
key | String |
The key to fetch for |
defaultValue | * |
The default value if the key is not found |
Set data for a key
Kind: static property of StorageInterface
Param | Type | Description |
---|---|---|
key | String |
The key to set for |
rawData | Object | Array | String | Number | * |
The raw data to set |
Kind: global namespace
- ArchiveTools :
object
- .extractDomain(url) ⇒
String
- .getEntriesForURL(archive, url) ⇒
Array.<Entry>
- .extractDomain(url) ⇒
Extract the domain from a URL
Kind: static method of ArchiveTools
Returns: String
- The domain or an empty string if none found
Param | Type | Description |
---|---|---|
url | String |
The URL to extract from |
Get entries for a particular URL
Kind: static method of ArchiveTools
Returns: Array.<Entry>
- An array of entries
Param | Type | Description |
---|---|---|
archive | Archive |
A buttercup archive instance |
url | String |
A URL |
flattenEntries(archives) ⇒ Array.<EntrySearchInfo>
Flatten entries into a searchable structure
Kind: global function
Returns: Array.<EntrySearchInfo>
- An array of searchable objects
Param | Type | Description |
---|---|---|
archives | Array.<Archive> |
An array of archives |
Archive details for display
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
name | String |
The name of the item |
status | ArchiveStatus |
The status of the item |
type | String |
The type of archive connection |
Stored archive entry
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
status | ArchiveStatus |
The status of the item |
workspace | Workspace | undefined |
Reference to the workspace (undefined if locked) |
credentials | Credentials | String |
Reference to Credentials instance (encrypted string if locked) |
password | String | undefined |
The master password (undefined if locked) |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
entry | Entry |
The entry |
archive | Archive |
The associated archive |