- Descriptor ⇒
Array.<String>
Describe an archive dataset - to history commands
- command
Command related tools
- Archive ⇐
AsyncEventEmitter
Buttercup Archive
- ArchiveComparator
- ArchiveManager ⇐
AsyncEventEmitter
Archive manager class
- ArchiveSource ⇐
AsyncEventEmitter
Archive source class
- FormatCommand ⇐
BaseCommand
- BaseCommand
- CommentCommand ⇐
BaseCommand
- CreateEntryCommand ⇐
BaseCommand
- CreateGroupCommand ⇐
BaseCommand
- DeleteArchiveAttributeCommand ⇐
BaseCommand
- DeleteEntryAttributeCommand ⇐
BaseCommand
- DeleteEntryCommand ⇐
BaseCommand
DeleteEntryMetaCommand ⇐BaseCommand
- DeleteEntryPropertyCommand ⇐
BaseCommand
Command for the deletion of property data on an entry
- DeleteGroupAttributeCommand ⇐
BaseCommand
- DeleteGroupCommand ⇐
BaseCommand
- FormatCommand ⇐
BaseCommand
- MoveEntryCommand ⇐
BaseCommand
- MoveGroupCommand ⇐
BaseCommand
- PadCommand ⇐
BaseCommand
- SetArchiveAttributeCommand ⇐
BaseCommand
- SetEntryAttributeCommand ⇐
BaseCommand
SetEntryMetaCommand ⇐BaseCommand
- SetEntryPropertyCommand ⇐
BaseCommand
- SetGroupAttributeCommand ⇐
BaseCommand
- TitleGroupCommand ⇐
BaseCommand
- Entry
Entry class implementation Entries form the low-level data structures used in Buttercup, and are intended to represent logical collections of properties, like a login for a website.
- EntryFinder
Entry searching class
- Flattener
Flattener class for flattening archive history sets
- Group
Group implementation
- InigoCommand
Inigo command generator
- Westley ⇐
AsyncEventEmitter
Westley class Archive object dataset and history manager. Handles parsing and revenge for the princess.
- Workspace
Workspace class implementation Workspaces organise Archives and Datasources, and perform saves and merges with remote changes.
- EntryCollection :
Object
- GroupCollection :
Object
- credentialsToDatasource(sourceCredentials) ⇒
Promise.<{datasource, credentials}>
Convert credentials of a remote archive to a datasource
- credentialsToSource(sourceCredentials, archiveCredentials, [initialise], [contentOverride]) ⇒
Promise.<Object>
Convert credentials to a source for the ArchiveManager
- addExtraFieldsNonDestructive(entry, fields) ⇒
Array.<EntryFacadeField>
Add extra fields to a fields array that are not mentioned in a preset Facades are creaded by presets which don't mention all property values (custom user added items). This method adds the unmentioned items to the facade fields so that they can be edited as well.
- applyFieldDescriptor(entry, descriptor)
Apply a facade field descriptor to an entry Takes data from the descriptor and writes it to the entry.
consumeEntryFacade(entry, facade)Process a modified entry facade
createEntryFacade(entry) ⇒EntryFacade
Create a data/input facade for an Entry instance
getEntryFacadeType(entry) ⇒String
Get the facade type for an entry
- setEntryValue(entry, property, name, value)
Set a value on an entry
- flattenEntries(archives) ⇒
Array.<EntrySearchInfo>
Flatten entries into a searchable structure
- dedupe(arr) ⇒
Array
De-dupe an array
- createFieldDescriptor(entry, title, entryPropertyType, entryPropertyName, options) ⇒
EntryFacadeField
Create a descriptor for a field to be used within a facade
- getEntryURLs(properties, preference)
Get URLs from an entry's properties Allows for preferential sorting
getEntryValue(entry, property, name) ⇒String
Get a value on an entry for a specific property type
- isValidProperty(name) ⇒
Boolean
Check if a property name is valid
- findEntriesByCheck(groups, compareFn) ⇒
Array.<Entry>
Find entry instances by filtering with a compare function
- findGroupsByCheck(groups, compareFn) ⇒
Array.<Group>
Find group instances within groups that satisfy some check
- getAllEntries(groups) ⇒
Array.<Entry>
Get all entries within a collection of groups
- generateUUID() ⇒
String
Generate a UUID (v4)
- ArchiveSourceOptions :
Object
New source options
- ArchiveSourceDescription
- ArchiveDataset :
Object
- EntryHistoryItem :
Object
- EntryFacade :
Object
Entry facade for data input
- EntrySearchInfo :
Object
- EntryFacadeField :
Object
Entry facade data field
- FoundGroupResult :
Object
Describe an archive dataset - to history commands
Returns: Array.<String>
- An array of commands
Param | Type | Description |
---|---|---|
dataset | Object |
The archive dataset |
parentGroupID | String |
The ID of the parent group |
Command related tools
Extract command components from a string
Kind: static method of command
Returns: Array.<String>
- The separated parts
Param | Type | Description |
---|---|---|
command | String |
The command to extract from |
Buttercup Archive
Kind: global class
Extends: AsyncEventEmitter
Mixes: GroupCollection
, EntryCollection
- Archive ⇐
AsyncEventEmitter
- instance
- .id :
String
- .readOnly
- .type :
String
- .findGroupByID ⇒
Group
|null
- .findGroupsByTitle ⇒
Array.<Group>
- .findEntriesByMeta ⇒
Array.<Entry>
- .findEntriesByProperty ⇒
Array.<Entry>
- .findGroupByID ⇒
Group
|null
- .findGroupsByTitle ⇒
Array.<Group>
- .findEntriesByMeta ⇒
Array.<Entry>
- .findEntriesByProperty ⇒
Array.<Entry>
- .createGroup([title]) ⇒
Group
- .deleteAttribute(attributeName) ⇒
Archive
- .emptyTrash()
.getAttribute(attributeName) ⇒undefined
|String
|Object
- .getAttributes() ⇒
Object
- .getFormat() ⇒
string
- .getGroups() ⇒
Array.<Group>
- .getHistory() ⇒
Array.<String>
- .getTrashGroup() ⇒
Group
|null
- .optimise() ⇒
Archive
- .setAttribute(attributeName, value) ⇒
Archive
- .toObject(groupOutputFlags) ⇒
Object
- ._generateID()
- ._getWestley() ⇒
Westley
- .inst.findEntryByID(id) ⇒
null
|Entry
- .inst.findEntryByID(id) ⇒
null
|Entry
- .id :
- static
- instance
The archive ID
Kind: instance property of Archive
Whether the archive is read only or not
Kind: instance property of Archive
Read only: true
Properties
Name | Type |
---|---|
readOnly | Boolean |
Get the instance type
Kind: instance property of Archive
Read only: true
archive.findGroupByID ⇒ Group
| null
Find a group by its ID
Kind: instance property of Archive
Mixes: findGroupByID
Returns: Group
| null
- The group or null if not found
Param | Type | Description |
---|---|---|
id | String |
The group ID to search for |
archive.findGroupsByTitle ⇒ Array.<Group>
Find groups by their title
Kind: instance property of Archive
Mixes: findGroupsByTitle
Returns: Array.<Group>
- An array of groups
Param | Type | Description |
---|---|---|
title | String | RegExp |
The group title |
archive.findEntriesByMeta ⇒ Array.<Entry>
Find entries that match a certain meta property
Kind: instance property of Archive
Mixes: findEntriesByMeta
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
metaName | String |
The meta property to search for |
value | RegExp | string |
The value to search for |
archive.findEntriesByProperty ⇒ Array.<Entry>
Find all entries that match a certain property
Kind: instance property of Archive
Mixes: findEntriesByProperty
Returns: Array.<Entry>
- An array of found extries
Param | Type | Description |
---|---|---|
property | string |
The property to search with |
value | RegExp | string |
The value to search for |
archive.findGroupByID ⇒ Group
| null
Find a group by its ID
Kind: instance property of Archive
Mixes: findGroupByID
Returns: Group
| null
- The group or null if not found
Param | Type | Description |
---|---|---|
id | String |
The group ID to search for |
archive.findGroupsByTitle ⇒ Array.<Group>
Find groups by their title
Kind: instance property of Archive
Mixes: findGroupsByTitle
Returns: Array.<Group>
- An array of groups
Param | Type | Description |
---|---|---|
title | String | RegExp |
The group title |
archive.findEntriesByMeta ⇒ Array.<Entry>
Find entries that match a certain meta property
Kind: instance property of Archive
Mixes: findEntriesByMeta
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
metaName | String |
The meta property to search for |
value | RegExp | string |
The value to search for |
archive.findEntriesByProperty ⇒ Array.<Entry>
Find all entries that match a certain property
Kind: instance property of Archive
Mixes: findEntriesByProperty
Returns: Array.<Entry>
- An array of found extries
Param | Type | Description |
---|---|---|
property | string |
The property to search with |
value | RegExp | string |
The value to search for |
archive.createGroup([title]) ⇒ Group
Create a new group
Kind: instance method of Archive
Returns: Group
- The newly created group
Param | Type | Description |
---|---|---|
[title] | string |
The title for the group |
archive.deleteAttribute(attributeName) ⇒ Archive
Delete an attribute
Kind: instance method of Archive
Returns: Archive
- Self
Param | Type | Description |
---|---|---|
attributeName | String |
The name of the attribute to delete |
Remove all entries and groups from the trash (permanent)
Kind: instance method of Archive
Throws:
Error
Throws if there is no trash group
Deprecated
Get the value of an attribute
Kind: instance method of Archive
Returns: undefined
| String
| Object
- The value of the attribute or undefined if not
set. Returns an object if no attribute name is given.
Param | Type | Description |
---|---|---|
attributeName | String |
The attribute to get |
Get all attributes
Kind: instance method of Archive
Returns: Object
- Attributes object
Get the archive format
Kind: instance method of Archive
Returns: string
- The format of the archive
archive.getGroups() ⇒ Array.<Group>
Get all groups (root) in the archive
Kind: instance method of Archive
Returns: Array.<Group>
- An array of Groups
Get the command array (history) Returned object can be quite large.
Kind: instance method of Archive
Returns: Array.<String>
- The command array
archive.getTrashGroup() ⇒ Group
| null
Get the trash group
Kind: instance method of Archive
Returns: Group
| null
- The trash group if found, null otherwise
archive.optimise() ⇒ Archive
Perform archive optimisations
Kind: instance method of Archive
Returns: Archive
- Self
archive.setAttribute(attributeName, value) ⇒ Archive
Set an attribute on the archive
Kind: instance method of Archive
Returns: Archive
- Self
Param | Type | Description |
---|---|---|
attributeName | String |
The attribute to set |
value | String |
The value to set for the attribute |
Convert the archive to an object
Kind: instance method of Archive
Returns: Object
- The archive in object form
See: Group.toObject
Param | Type | Description |
---|---|---|
groupOutputFlags | Number |
Bitwise flags for Group.toObject |
Generate an archive ID
Kind: instance method of Archive
Access: protected
archive._getWestley() ⇒ Westley
Get the underlying Westley instance
Kind: instance method of Archive
Returns: Westley
- The Westley instance
Access: protected
archive.inst.findEntryByID(id) ⇒ null
| Entry
Find an entry by its ID
Kind: instance method of Archive
Mixes: inst.findEntryByID
Returns: null
| Entry
- Null if not found, or the Entry instance
Param | Type | Description |
---|---|---|
id | String |
The ID to search for |
archive.inst.findEntryByID(id) ⇒ null
| Entry
Find an entry by its ID
Kind: instance method of Archive
Mixes: inst.findEntryByID
Returns: null
| Entry
- Null if not found, or the Entry instance
Param | Type | Description |
---|---|---|
id | String |
The ID to search for |
Archive.createFromHistory(history) ⇒ Archive
Create a new archive instance from a list of commands (history)
Kind: static method of Archive
Returns: Archive
- The archive instance
Param | Type | Description |
---|---|---|
history | Array.<String> |
The command list |
Archive.createWithDefaults() ⇒ Archive
Create an Archive with the default template
Kind: static method of Archive
Returns: Archive
- The new archive
Kind: global class
- ArchiveComparator
- new ArchiveComparator(originalArchive, secondaryArchive)
- .archivesDiffer() ⇒
Boolean
- .calculateDifferences() ⇒
Object
|Boolean
Archive comparison class
Param | Type | Description |
---|---|---|
originalArchive | Archive |
The primary archive |
secondaryArchive | Archive |
The secondary archive |
Check if the current archives differ
Kind: instance method of ArchiveComparator
Returns: Boolean
- True if the archives are different
Calculate the differences, in commands, between the two archives
Kind: instance method of ArchiveComparator
Returns: Object
| Boolean
- Returns false if no common base
is found, or the command differences as two arrays
Archive manager class
Kind: global class
Extends: AsyncEventEmitter
- ArchiveManager ⇐
AsyncEventEmitter
- new ArchiveManager([storageInterface])
- .autoUpdateEnabled :
Boolean
- .nextSourceOrder :
Number
- .sources :
Array.<ArchiveSource>
- .sourcesList :
Array.<ArchiveSourceDescription>
- .storageInterface :
StorageInterface
- .unlockedSources :
Array.<ArchiveSource>
- .updateableSources :
Array.<ArchiveSource>
- .addSource(archiveSource, [obj])
- .dehydrate() ⇒
Promise
- .dehydrateSource(sourceID) ⇒
Promise
- .getSourceForID(sourceID) ⇒
ArchiveSource
|null
- .interruptAutoUpdate(cb) ⇒
Promise
- .rehydrate() ⇒
Promise
- .removeSource(sourceID) ⇒
Promise
- .reorderSource(sourceID, position)
- .reorderSources()
- .toggleAutoUpdating([enable], [delay])
Constructor for the archive manager
Param | Type | Description |
---|---|---|
[storageInterface] | StorageInterface |
The storage interface to use - defaults to storing in memory |
Detect if auto-updating is enabled
Kind: instance property of ArchiveManager
Read only: true
The next available source order
Kind: instance property of ArchiveManager
Read only: true
archiveManager.sources : Array.<ArchiveSource>
The current sources
Kind: instance property of ArchiveManager
Read only: true
archiveManager.sourcesList : Array.<ArchiveSourceDescription>
All sources, listed by their descriptions
Kind: instance property of ArchiveManager
Read only: true
The current storage interface
Kind: instance property of ArchiveManager
Read only: true
archiveManager.unlockedSources : Array.<ArchiveSource>
All unlocked sources
Kind: instance property of ArchiveManager
Read only: true
archiveManager.updateableSources : Array.<ArchiveSource>
All auto-updateable sources
Kind: instance property of ArchiveManager
Read only: true
Add a source to the manager
Kind: instance method of ArchiveManager
Param | Type | Description |
---|---|---|
archiveSource | ArchiveSource |
The source to add |
[obj] | Object |
Optional configuration |
[obj.emitUpdated] | Boolean |
Whether or not to emit an updated event (default: true) |
[obj.order] | Number |
Override the order of the new source |
Dehydrate all sources and write them to storage
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves once all sources have been dehydrated
Dehydrate a single archive source
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves once the source has been dehydrated
Param | Type | Description |
---|---|---|
sourceID | String |
The ID of the source |
archiveManager.getSourceForID(sourceID) ⇒ ArchiveSource
| null
Get a source for an ID
Kind: instance method of ArchiveManager
Returns: ArchiveSource
| null
- The source with the matching ID or null if not found
Param | Type | Description |
---|---|---|
sourceID | String |
The source ID |
Wait for and interrupt state changes when auto-update is running
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves when ready
Param | Type | Description |
---|---|---|
cb | function |
The callback to execute during the auto-update interruption |
Example
archiveManager.interruptAutoUpdate(() => {
// Do something with auto-updating paused
});
Rehydrate sources from storage
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves once rehydration has completed
Throws:
VError
Rejects if rehydrating from storage fails
Remove a source from the storage
Kind: instance method of ArchiveManager
Returns: Promise
- A promise that resolves once the source has been removed
Param | Type | Description |
---|---|---|
sourceID | String |
The ID of the source to remove |
Reorder a source
Kind: instance method of ArchiveManager
Throws:
VError
Throws if no source is found
Param | Type | Description |
---|---|---|
sourceID | String |
The ID of the source to reorder |
position | Number |
The 0-based position to move the source to |
Reorder all sources
Kind: instance method of ArchiveManager
Toggle auto updating of sources
Kind: instance method of ArchiveManager
Param | Type | Description |
---|---|---|
[enable] | Boolean |
Enable or disable auto updating. Leave empty to invert the setting |
[delay] | Number |
Milliseconds between updates |
Archive source class
Kind: global class
Extends: AsyncEventEmitter
- ArchiveSource ⇐
AsyncEventEmitter
- new ArchiveSource(name, sourceCredentials, archiveCredentials, [newSourceOptions])
- instance
- .canBeUpdated :
Boolean
- .colour :
String
- .description :
ArchiveSourceDescription
- .id :
String
- .name :
String
- .status :
ArchiveSourceStatus
- .storageInterface :
StorageInterface
- .workspace :
Workspace
|null
- .checkOfflineCopy() ⇒
Promise.<Boolean>
- .dehydrate() ⇒
Promise.<String>
- .getOfflineContent() ⇒
Promise.<(String|null)>
- .lock() ⇒
Promise.<String>
.unlock(masterPassword, [initialiseRemote], contentOverride, [storeOfflineCopy])- .updateArchiveCredentials(masterPassword) ⇒
Promise.<String>
.updateSourceCredentials(masterPassword, callback) ⇒Promise
- .canBeUpdated :
- static
Constructor for an archive source
Param | Type | Description |
---|---|---|
name | String |
The name of the source |
sourceCredentials | String |
Encrypted archive source credentials |
archiveCredentials | String |
Encrypted archive credentials |
[newSourceOptions] | ArchiveSourceOptions |
Specify source creation options |
Whether this source can be auto updated or not
Kind: instance property of ArchiveSource
Source colour
Kind: instance property of ArchiveSource
archiveSource.description : ArchiveSourceDescription
Get the source description
Kind: instance property of ArchiveSource
Read only: true
Source ID
Kind: instance property of ArchiveSource
Read only: true
Source name
Kind: instance property of ArchiveSource
Read only: true
Source status
Kind: instance property of ArchiveSource
Read only: true
The attached manager's storage interface
Kind: instance property of ArchiveSource
Read only: true
archiveSource.workspace : Workspace
| null
Workspace instance for the source Is null when the source is locked
Kind: instance property of ArchiveSource
Read only: true
Check if the source has an offline copy
Kind: instance method of ArchiveSource
Returns: Promise.<Boolean>
- A promise which resolves with whether an offline
copy is available or not
Dehydrate the source for storage Returns a secure string with locked (encrypted) credentials, even when the source is in the UNLOCKED state. This method does NOT store the source - this must be done separately.
Kind: instance method of ArchiveSource
Returns: Promise.<String>
- A promise that resolves with the dehydrated
source information
Throws:
VError
Rejects is source in PENDING state
Get offline content, if it exists
Kind: instance method of ArchiveSource
Returns: Promise.<(String|null)>
- A promise a resolves with the content, or null
if it doesn't exist
Lock the source Encrypts the credentials and performs dehydration, placing the source into a LOCKED state. No saving is performed before locking.
Kind: instance method of ArchiveSource
Returns: Promise.<String>
- A promise that resolves with dehydrated content
Throws:
VError
Rejects if not in unlocked state
Emits: ArchiveSource#event:sourceLocked
Deprecated
Unlock the source
Kind: instance method of ArchiveSource
Throws:
VError
Rejects if not in locked stateVError
Rejects if not able to create the source from the encrypted credentials
Emits: ArchiveSource#event:sourceUnlocked
Param | Type | Default | Description |
---|---|---|---|
masterPassword | String |
The master password | |
[initialiseRemote] | Boolean |
false |
Optionally initialise the remote (replaces remote archive) (defaults to false) |
contentOverride | String | Boolean |
|
Content for overriding the fetch operation in the datasource, for loading offline content. Can be set to the content (string) or to 'true', which will attempt to load the content from the ArchiveManager's storage. |
[storeOfflineCopy] | Boolean |
true |
Whether or not to store an offline copy. Defaults to true. |
Update the password/credentials for the archive The workspace is saved after changing. Responds with dehydrated details which should be SAVED.
Kind: instance method of ArchiveSource
Returns: Promise.<String>
- A promise that resolves with the dehydrated
source details
Throws:
VError
Rejects if source is not in unlocked state
Param | Type | Description |
---|---|---|
masterPassword | String |
New master password |
Deprecated
Update source credentials (Useful for updating tokens when authentication parameters change)
Kind: instance method of ArchiveSource
Returns: Promise
- A promise that resolves when the update is complete
Param | Type | Description |
---|---|---|
masterPassword | String |
The master password |
callback | function |
Callback that's fired with the source crendentials and datasource. If the source is locked, only the source credentials are provided (datasource is null in this case) |
Archive source status
Kind: static enum of ArchiveSource
Properties
Name | Default |
---|---|
LOCKED | locked |
UNLOCKED | unlocked |
PENDING | pending |
ArchiveSource.rehydrate(dehydratedString) ⇒ ArchiveSource
Rehydrate a dehydrated archive source
Kind: static method of ArchiveSource
Returns: ArchiveSource
- The rehydrated source
Param | Type | Description |
---|---|---|
dehydratedString | String |
A dehydrated archive source |
FormatCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting the archive ID
Command for setting the archive format
Entry tools module
Kind: instance property of FormatCommand
Overrides: entryTools
Search tools module
Kind: instance property of FormatCommand
Overrides: searchTools
Execute the setting of the format
Kind: instance method of FormatCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
format | String |
The archive format |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of FormatCommand
Overrides: executeCallbacks
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of FormatCommand
Overrides: setCallback
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
Kind: global class
Base command class
Entry tools module
Kind: instance property of BaseCommand
Search tools module
Kind: instance property of BaseCommand
Set the entry tools module
Kind: instance property of BaseCommand
Param | Type | Description |
---|---|---|
et | Object |
The entry tools module |
Set the search tools module
Kind: instance property of BaseCommand
Param | Type | Description |
---|---|---|
st | Object |
The search tools module |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of BaseCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of BaseCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
CommentCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for archive comments
Entry tools module
Kind: instance property of CommentCommand
Overrides: entryTools
Search tools module
Kind: instance property of CommentCommand
Overrides: searchTools
Execute comment callbacks
Kind: instance method of CommentCommand
See: BaseCommand.executeCallbacks
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
comment | String |
The comment |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of CommentCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of CommentCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
CreateEntryCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for creating entries
Entry tools module
Kind: instance property of CreateEntryCommand
Overrides: entryTools
Search tools module
Kind: instance property of CreateEntryCommand
Overrides: searchTools
Execute the entry creation
Kind: instance method of CreateEntryCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group to create within |
entryID | String |
The ID of the entry to create |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of CreateEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of CreateEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
CreateGroupCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for creating groups
Entry tools module
Kind: instance property of CreateGroupCommand
Overrides: entryTools
Search tools module
Kind: instance property of CreateGroupCommand
Overrides: searchTools
Execute the group creation
Kind: instance method of CreateGroupCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
parentID | String |
The ID of the parent group to create within |
newID | String |
The ID of the new group |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of CreateGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of CreateGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteArchiveAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for deleting attributes stored on the archive object
Entry tools module
Kind: instance property of DeleteArchiveAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteArchiveAttributeCommand
Overrides: searchTools
Execute the deletion of an attribute
Kind: instance method of DeleteArchiveAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
attributeName | String |
The name of the attribute to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteArchiveAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteArchiveAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteEntryAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for the deletion of entry attributes
Entry tools module
Kind: instance property of DeleteEntryAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteEntryAttributeCommand
Overrides: searchTools
Execute the deletion of an attribute
Kind: instance method of DeleteEntryAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
attributeName | String |
The name of the attribute to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteEntryAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteEntryAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteEntryCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for the deletion of entries
Entry tools module
Kind: instance property of DeleteEntryCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteEntryCommand
Overrides: searchTools
Execute the entry deletion
Kind: instance method of DeleteEntryCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteEntryMetaCommand ⇐ BaseCommand
BaseCommand
Deprecated
Kind: global class
Extends: BaseCommand
Command for the deletion of meta data on an entry
Entry tools module
Kind: instance property of DeleteEntryMetaCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteEntryMetaCommand
Overrides: searchTools
Execute the deletion of a meta property
Kind: instance method of DeleteEntryMetaCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
propertyName | String |
The name of the meta property to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteEntryMetaCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteEntryMetaCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteEntryPropertyCommand ⇐ BaseCommand
Command for the deletion of property data on an entry
Kind: global class
Extends: BaseCommand
Entry tools module
Kind: instance property of DeleteEntryPropertyCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteEntryPropertyCommand
Overrides: searchTools
Execute the deletion of a property
Kind: instance method of DeleteEntryPropertyCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
propertyName | String |
The name of the property to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteEntryPropertyCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteEntryPropertyCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteGroupAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for deleting group attributes
Entry tools module
Kind: instance property of DeleteGroupAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteGroupAttributeCommand
Overrides: searchTools
Execute the deletion of a group attribute
Kind: instance method of DeleteGroupAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group |
attributeName | String |
The attribute to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteGroupAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteGroupAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
DeleteGroupCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for group deletion
Entry tools module
Kind: instance property of DeleteGroupCommand
Overrides: entryTools
Search tools module
Kind: instance property of DeleteGroupCommand
Overrides: searchTools
Execute the deletion of a group
Kind: instance method of DeleteGroupCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group to delete |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of DeleteGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of DeleteGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
FormatCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting the archive ID
Command for setting the archive format
Entry tools module
Kind: instance property of FormatCommand
Overrides: entryTools
Search tools module
Kind: instance property of FormatCommand
Overrides: searchTools
Execute the setting of the format
Kind: instance method of FormatCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
format | String |
The archive format |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of FormatCommand
Overrides: executeCallbacks
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of FormatCommand
Overrides: setCallback
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
MoveEntryCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for the moving of entries
Entry tools module
Kind: instance property of MoveEntryCommand
Overrides: entryTools
Search tools module
Kind: instance property of MoveEntryCommand
Overrides: searchTools
Execute the move
Kind: instance method of MoveEntryCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry to move |
targetGroupID | String |
The ID of the group to move the entry to |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of MoveEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of MoveEntryCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
MoveGroupCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for moving groups
Entry tools module
Kind: instance property of MoveGroupCommand
Overrides: entryTools
Search tools module
Kind: instance property of MoveGroupCommand
Overrides: searchTools
Execute the move
Kind: instance method of MoveGroupCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group to move |
targetGroupID | String |
The ID of the group to move to |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of MoveGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of MoveGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
PadCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
- PadCommand ⇐
BaseCommand
- new PadCommand()
- .entryTools :
Object
- .searchTools :
Object
- .executeCallbacks(key)
- .setCallback(key, fn)
Command for padding Padding is used to identify "blocks" of history.
Entry tools module
Kind: instance property of PadCommand
Overrides: entryTools
Search tools module
Kind: instance property of PadCommand
Overrides: searchTools
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of PadCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of PadCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
SetArchiveAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting archive attributes
Entry tools module
Kind: instance property of SetArchiveAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of SetArchiveAttributeCommand
Overrides: searchTools
Execute the setting of an attribute
Kind: instance method of SetArchiveAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
attributeName | String |
The name of the attribute to set |
value | String |
The value to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of SetArchiveAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of SetArchiveAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
SetEntryAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting entry attributes
Entry tools module
Kind: instance property of SetEntryAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of SetEntryAttributeCommand
Overrides: searchTools
Execute the setting of an attribute
Kind: instance method of SetEntryAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
attributeName | String |
The name of the attribute to set |
value | String |
The value to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of SetEntryAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of SetEntryAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
SetEntryMetaCommand ⇐ BaseCommand
BaseCommand
Deprecated
Kind: global class
Extends: BaseCommand
Command for setting meta properties on entries
Entry tools module
Kind: instance property of SetEntryMetaCommand
Overrides: entryTools
Search tools module
Kind: instance property of SetEntryMetaCommand
Overrides: searchTools
Execute the setting of a meta property
Kind: instance method of SetEntryMetaCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
propertyName | String |
The name of the meta property to set |
value | String |
The value to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of SetEntryMetaCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of SetEntryMetaCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
SetEntryPropertyCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting entry properties
Entry tools module
Kind: instance property of SetEntryPropertyCommand
Overrides: entryTools
Search tools module
Kind: instance property of SetEntryPropertyCommand
Overrides: searchTools
Execute the setting of a property
Kind: instance method of SetEntryPropertyCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
entryID | String |
The ID of the entry |
propertyName | String |
The name of the property to set |
value | String |
The value to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of SetEntryPropertyCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of SetEntryPropertyCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
SetGroupAttributeCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for setting group attributes
Entry tools module
Kind: instance property of SetGroupAttributeCommand
Overrides: entryTools
Search tools module
Kind: instance property of SetGroupAttributeCommand
Overrides: searchTools
Execute the setting of an attribute
Kind: instance method of SetGroupAttributeCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group |
attributeName | String |
The name of the attribute to set |
value | String |
The value to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of SetGroupAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of SetGroupAttributeCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
TitleGroupCommand ⇐ BaseCommand
Kind: global class
Extends: BaseCommand
Command for titling groups
Entry tools module
Kind: instance property of TitleGroupCommand
Overrides: entryTools
Search tools module
Kind: instance property of TitleGroupCommand
Overrides: searchTools
Execute the setting of the title
Kind: instance method of TitleGroupCommand
Param | Type | Description |
---|---|---|
obj | ArchiveDataset |
The archive dataset |
groupID | String |
The ID of the group to set |
title | String |
The title to set |
Execute all callbacks under a key Arguments passed after the key are provided to each callback
Kind: instance method of TitleGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
Example
executeCallbacks("functionName", 1, 2, "three")
Add a callback for a key
Kind: instance method of TitleGroupCommand
Param | Type | Description |
---|---|---|
key | String |
The callback name |
fn | function |
The callback function |
Entry class implementation Entries form the low-level data structures used in Buttercup, and are intended to represent logical collections of properties, like a login for a website.
Kind: global class
- Entry
- new Entry(archive, remoteObj)
- instance
- .id :
String
- .type :
String
- .delete([skipTrash]) ⇒
Boolean
- .deleteAttribute(attr) ⇒
Entry
.deleteMeta(property) ⇒Entry
- .deleteProperty(property) ⇒
Entry
- .getAttribute([attributeName]) ⇒
String
|undefined
|Object
.getAttributes() ⇒Object
.getGroup() ⇒Group
|null
- .getHistory() ⇒
Array.<EntryHistoryItem>
.getMeta([property]) ⇒String
|undefined
|Object
- .getProperty([property]) ⇒
String
|undefined
|Object
- .getProperties(propertyExpression) ⇒
Object
- .getURLs([urlTypePreference]) ⇒
Array.<String>
- .isInTrash() ⇒
Boolean
- .moveToGroup(group) ⇒
Entry
- .setAttribute(attributeName, value) ⇒
Entry
.setMeta(prop, [val]) ⇒Entry
- .setProperty(prop, [val]) ⇒
Entry
- .toObject() ⇒
Object
- .toString() ⇒
String
- ._getArchive() ⇒
Archive
- ._getRemoteObject() ⇒
Object
- ._getWestley() ⇒
Westley
- .id :
- static
Create a new managed entry instance
Param | Type | Description |
---|---|---|
archive | Archive |
The main archive instance |
remoteObj | Object |
The remote object reference |
The ID of the entry
Kind: instance property of Entry
Read only: true
Get the instance type
Kind: instance property of Entry
Read only: true
Delete the entry - either trashes the entry, or removes it completely. If the entry is in the trash already, it is removed (including if there is no trash group). If the entry is in a normal group and a trash group exists, it is moved there instead of being deleted.
Kind: instance method of Entry
Returns: Boolean
- Whether or not the item was deleted
See
- moveToGroup
- Archive.getTrashGroup
Param | Type | Default | Description |
---|---|---|---|
[skipTrash] | Boolean |
false |
Skip the trash and force-delete the entry |
entry.deleteAttribute(attr) ⇒ Entry
Delete an attribute
Kind: instance method of Entry
Returns: Entry
- Self
Throws:
Error
Throws if the attribute doesn't exist, or cannot be deleted
Param | Type | Description |
---|---|---|
attr | String |
The attribute name |
entry.deleteMeta(property) ⇒ Entry
Entry
Deprecated
Delete a meta item
Kind: instance method of Entry
Returns: Entry
- Self
Throws:
Error
Throws if property doesn't exist, or cannot be deleted
Param | Type | Description |
---|---|---|
property | String |
The meta property to delete |
entry.deleteProperty(property) ⇒ Entry
Delete a property
Kind: instance method of Entry
Returns: Entry
- Self
Throws:
Error
Throws if property doesn't exist, or cannot be deleted
Param | Type | Description |
---|---|---|
property | String |
The property to delete |
Get an attribute If no attribute name is specified, an object with all attributes and their values is returned.
Kind: instance method of Entry
Returns: String
| undefined
| Object
- The attribute value or an object
containing all attribute keys and their values if no attribute name
is provided
Param | Type | Description |
---|---|---|
[attributeName] | String |
The name of the attribute to fetch |
Deprecated
Get all attributes
Kind: instance method of Entry
Returns: Object
- Attributes object
entry.getGroup() ⇒ Group
| null
Group
| null
Deprecated
Get the containing group for the entry
Kind: instance method of Entry
Returns: Group
| null
- The parent group
entry.getHistory() ⇒ Array.<EntryHistoryItem>
Get the history of the entry
Kind: instance method of Entry
Deprecated
Get a meta value If no meta name is specified, an object with all meta keys and their values is returned.
Kind: instance method of Entry
Returns: String
| undefined
| Object
- The meta value or an object
containing all meta keys and values if no meta name specified
Param | Type | Description |
---|---|---|
[property] | String |
The name of the meta property |
Get a property value If no property name is specified, an object with all properties and their values is returned.
Kind: instance method of Entry
Returns: String
| undefined
| Object
- The property value or an object with all
values if no property specified
Param | Type | Description |
---|---|---|
[property] | String |
The name of the property to fetch |
Get property values via RegExp expressions. If no property expression is specified, it returns the empty behavior of {@see Entry.getProperty}.
Kind: instance method of Entry
Returns: Object
- A key-value object of the matching properties
Param | Type |
---|---|
propertyExpression | RegExp | String |
Get an array of URLs from the Entry Returns an array of detected URL values in the Entry's properties. The types of URLs can be configured by providing a preference:
- "general" - General URLs (of any type, preferring "URL" named props)
- "login" - Prefer URLs whose key has "login" in it
- "icon" - Return only icon-like URLs
- "any" - Return all found URLs
Kind: instance method of Entry
Returns: Array.<String>
- An array of URLs
Param | Type | Description |
---|---|---|
[urlTypePreference] | String |
The URL type preference |
Check if the entry is in the trash
Kind: instance method of Entry
Returns: Boolean
- Whether or not the entry is in the trash
entry.moveToGroup(group) ⇒ Entry
Move the entry to another group
Kind: instance method of Entry
Returns: Entry
- Returns self
Params: Group
group The target group
Param | Type | Description |
---|---|---|
group | Group |
The target group |
entry.setAttribute(attributeName, value) ⇒ Entry
Set an attribute on the entry
Kind: instance method of Entry
Returns: Entry
- Returns self
Param | Type | Description |
---|---|---|
attributeName | String |
The name of the attribute |
value | String |
The value to set |
entry.setMeta(prop, [val]) ⇒ Entry
Entry
Deprecated
Set a meta value on the entry
Kind: instance method of Entry
Returns: Entry
- Returns self
Param | Type | Description |
---|---|---|
prop | String |
The meta name |
[val] | String |
The value to set |
entry.setProperty(prop, [val]) ⇒ Entry
Set a property on the entry
Kind: instance method of Entry
Returns: Entry
- Returns self
Param | Type | Description |
---|---|---|
prop | String |
The property name |
[val] | String |
The property value |
Export entry to object
Kind: instance method of Entry
Returns: Object
- The entry in object-form
toString override
Kind: instance method of Entry
Returns: String
- The string representation of the Entry
entry._getArchive() ⇒ Archive
Get the archive reference
Kind: instance method of Entry
Returns: Archive
- The Archive reference
Access: protected
Get the remote object that mirrors the data represented here
Kind: instance method of Entry
Returns: Object
- The remote object (in-memory copy)
Access: protected
entry._getWestley() ⇒ Westley
Get the Westley reference
Kind: instance method of Entry
Returns: Westley
- The internal Westley reference
Access: protected
Entry.createNew(archive, groupID) ⇒ Entry
Create a new entry
Kind: static method of Entry
Returns: Entry
- The new entry
Throws:
Error
Throws if the target group doesn't existError
Throws if the target group is the trash group, or if the target group is in the trash
Param | Type | Description |
---|---|---|
archive | Archive |
The archive |
groupID | string |
The ID of the target group |
Entry searching class
Kind: global class
Param | Type | Description |
---|---|---|
target | Array.<Archive> | Archive |
The archive or archives to search |
entryFinder.items : Array.<EntrySearchInfo>
All items available for searching
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 |
Flattener class for flattening archive history sets
Kind: global class
- Flattener
- instance
- .westley :
Westley
- .canBeFlattened() ⇒
Boolean
- .flatten([force]) ⇒
Boolean
- .westley :
- static
- .FLATTENING_MIN_LINES :
Number
- .PRESERVE_LINES :
Number
- .FLATTENING_MIN_LINES :
- instance
flattener.westley : Westley
The working Westley instance
Kind: instance property of Flattener
Read only: true
Check if the dataset can be flattened
Kind: instance method of Flattener
Returns: Boolean
- True if it can be flattened
Flatten a dataset
Kind: instance method of Flattener
Returns: Boolean
- True if flattening occurred, false otherwise
Param | Type | Default | Description |
---|---|---|---|
[force] | Boolean |
false |
Force flattening even if it is detected to be unnecessary |
Minimum history lines before flattening can occur
Kind: static constant of Flattener
Number of lines to preserve (most recent)
Kind: static constant of Flattener
Group implementation
Kind: global class
Mixes: GroupCollection
, EntryCollection
- Group
- new Group(archive, remoteObj)
- instance
- .id :
String
- .type :
String
- .findGroupByID ⇒
Group
|null
- .findGroupsByTitle ⇒
Array.<Group>
- .findEntriesByMeta ⇒
Array.<Entry>
- .findEntriesByProperty ⇒
Array.<Entry>
- .findGroupByID ⇒
Group
|null
- .findGroupsByTitle ⇒
Array.<Group>
- .findEntriesByMeta ⇒
Array.<Entry>
- .findEntriesByProperty ⇒
Array.<Entry>
- .createEntry([title]) ⇒
Entry
- .createGroup([title]) ⇒
Group
- .delete([skipTrash]) ⇒
Boolean
- .deleteAttribute(attr) ⇒
Group
- .getAttribute([attributeName]) ⇒
String
|undefined
|Object
.getAttributes() ⇒Object
- .getEntries() ⇒
Array.<Entry>
- .getGroup() ⇒
Group
|null
- .getGroups() ⇒
Array.<Group>
- .getTitle() ⇒
string
- .isInTrash() ⇒
Boolean
- .isTrash() ⇒
Boolean
- .moveTo(target) ⇒
Group
- .setAttribute(attributeName, value) ⇒
Group
- .setTitle(title) ⇒
Group
- .toObject(outputFlags) ⇒
Object
- .toString(outputFlags) ⇒
string
- ._getArchive() ⇒
Archive
- ._getRemoteObject() ⇒
Object
- ._getWestley() ⇒
Westley
- .inst.findEntryByID(id) ⇒
null
|Entry
- .inst.findEntryByID(id) ⇒
null
|Entry
- .id :
- static
- .Attributes :
enum
- .OutputFlag :
enum
- .createNew(archive, [parentID]) ⇒
Group
- .Attributes :
Managed group class
Param | Type | Description |
---|---|---|
archive | Archive |
The archive instance |
remoteObj | Object |
The remote object reference |
The entry ID
Kind: instance property of Group
Get the instance type
Kind: instance property of Group
Read only: true
group.findGroupByID ⇒ Group
| null
Find a group by its ID
Kind: instance property of Group
Mixes: findGroupByID
Returns: Group
| null
- The group or null if not found
Param | Type | Description |
---|---|---|
id | String |
The group ID to search for |
group.findGroupsByTitle ⇒ Array.<Group>
Find groups by their title
Kind: instance property of Group
Mixes: findGroupsByTitle
Returns: Array.<Group>
- An array of groups
Param | Type | Description |
---|---|---|
title | String | RegExp |
The group title |
group.findEntriesByMeta ⇒ Array.<Entry>
Find entries that match a certain meta property
Kind: instance property of Group
Mixes: findEntriesByMeta
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
metaName | String |
The meta property to search for |
value | RegExp | string |
The value to search for |
group.findEntriesByProperty ⇒ Array.<Entry>
Find all entries that match a certain property
Kind: instance property of Group
Mixes: findEntriesByProperty
Returns: Array.<Entry>
- An array of found extries
Param | Type | Description |
---|---|---|
property | string |
The property to search with |
value | RegExp | string |
The value to search for |
group.findGroupByID ⇒ Group
| null
Find a group by its ID
Kind: instance property of Group
Mixes: findGroupByID
Returns: Group
| null
- The group or null if not found
Param | Type | Description |
---|---|---|
id | String |
The group ID to search for |
group.findGroupsByTitle ⇒ Array.<Group>
Find groups by their title
Kind: instance property of Group
Mixes: findGroupsByTitle
Returns: Array.<Group>
- An array of groups
Param | Type | Description |
---|---|---|
title | String | RegExp |
The group title |
group.findEntriesByMeta ⇒ Array.<Entry>
Find entries that match a certain meta property
Kind: instance property of Group
Mixes: findEntriesByMeta
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
metaName | String |
The meta property to search for |
value | RegExp | string |
The value to search for |
group.findEntriesByProperty ⇒ Array.<Entry>
Find all entries that match a certain property
Kind: instance property of Group
Mixes: findEntriesByProperty
Returns: Array.<Entry>
- An array of found extries
Param | Type | Description |
---|---|---|
property | string |
The property to search with |
value | RegExp | string |
The value to search for |
group.createEntry([title]) ⇒ Entry
Create a new entry with a title
Kind: instance method of Group
Returns: Entry
- The new entry
Param | Type | Description |
---|---|---|
[title] | String |
The title of the new entry |
group.createGroup([title]) ⇒ Group
Create a child group
Kind: instance method of Group
Returns: Group
- The new child group
Param | Type | Description |
---|---|---|
[title] | string |
Optionally set a title |
Delete the group If there is a trash group available, the group is moved there. If the group is already in the trash, it is deleted permanently.
Kind: instance method of Group
Returns: Boolean
- True when deleted, false when moved to trash
Param | Type | Default | Description |
---|---|---|---|
[skipTrash] | Boolean |
false |
Skip the trash |
group.deleteAttribute(attr) ⇒ Group
Delete an attribute
Kind: instance method of Group
Returns: Group
- Returns self
Param | Type | Description |
---|---|---|
attr | string |
The name of the attribute |
Get an attribute
Kind: instance method of Group
Returns: String
| undefined
| Object
- Returns the attribute or undefined if not found.
If no attribute name is provided an object containing all attributes is returned.
Param | Type | Description |
---|---|---|
[attributeName] | String |
The name of the attribute. If none provided the entire attributes object is returned. |
Deprecated
Get all attributes
Kind: instance method of Group
Returns: Object
- Attributes object
group.getEntries() ⇒ Array.<Entry>
Get the entries within the group
Kind: instance method of Group
Returns: Array.<Entry>
- An array of entries
group.getGroup() ⇒ Group
| null
Get the parent group
Kind: instance method of Group
Returns: Group
| null
- Returns the parent group instance or null if the parent
is the archive
Throws:
Error
Throws if no parent could be found (detached)
group.getGroups() ⇒ Array.<Group>
Get the groups within the group
Kind: instance method of Group
Returns: Array.<Group>
- An array of child groups
Get the group title
Kind: instance method of Group
Returns: string
- The title of the group
Check if the group is in the trash
Kind: instance method of Group
Returns: Boolean
- Whether or not the group is within the trash group
Check if the group is used for trash
Kind: instance method of Group
Returns: Boolean
- Whether or not the group is the trash group
group.moveTo(target) ⇒ Group
Move the group to another group or archive
Kind: instance method of Group
Returns: Group
- Self
Param | Type | Description |
---|---|---|
target | Group | Archive |
The destination Group or Archive instance |
group.setAttribute(attributeName, value) ⇒ Group
Set an attribute
Kind: instance method of Group
Returns: Group
- Returns self
Param | Type | Description |
---|---|---|
attributeName | string |
The name of the attribute |
value | string |
The value to set |
group.setTitle(title) ⇒ Group
Set the group title
Kind: instance method of Group
Returns: Group
- Returns self
Param | Type | Description |
---|---|---|
title | string |
The title of the group |
Export group to object
Kind: instance method of Group
Returns: Object
- The group, in raw object form
Param | Type | Description |
---|---|---|
outputFlags | Number |
Bitwise options for outputting entries and child groups |
Example
// output defaults (entries and sub groups)
group.toObject()
Example
// output only entries
group.toObject(Group.OutputFlag.Entries)
Example
// output only the group info
group.toObject(Group.OutputFlag.OnlyGroup)
Export the group to a JSON string
Kind: instance method of Group
Returns: string
- The group (and entries) in JSON string format
See: toObject
Param | Type | Description |
---|---|---|
outputFlags | Number |
Output configuration flags to pass to toObject |
group._getArchive() ⇒ Archive
Get the archive instance reference
Kind: instance method of Group
Returns: Archive
- The archive instance
Access: protected
Get the remotely-managed object (group)
Kind: instance method of Group
Returns: Object
- The object instance for the group
Access: protected
group._getWestley() ⇒ Westley
Get the delta managing instance for the archive
Kind: instance method of Group
Returns: Westley
- The internal Westley object
Access: protected
group.inst.findEntryByID(id) ⇒ null
| Entry
Find an entry by its ID
Kind: instance method of Group
Mixes: inst.findEntryByID
Returns: null
| Entry
- Null if not found, or the Entry instance
Param | Type | Description |
---|---|---|
id | String |
The ID to search for |
group.inst.findEntryByID(id) ⇒ null
| Entry
Find an entry by its ID
Kind: instance method of Group
Mixes: inst.findEntryByID
Returns: null
| Entry
- Null if not found, or the Entry instance
Param | Type | Description |
---|---|---|
id | String |
The ID to search for |
Group attribute names
Kind: static enum of Group
Bitwise output flags for toObject
and toString
Kind: static enum of Group
See
- toObject
- toString
Group.createNew(archive, [parentID]) ⇒ Group
Create a new Group with a delta-manager and parent group ID
Kind: static method of Group
Returns: Group
- A new group
Throws:
Error
Throws if the target group doesn't existError
Throws if the target group is the trash group, or if the target group is within the trash group
Param | Type | Description |
---|---|---|
archive | Archive |
The archive to create the group in |
[parentID] | string |
The parent group ID (default is root) |
Inigo command generator
Param | Type | Description |
---|---|---|
cmdKey | String |
The key for the command |
Westley class Archive object dataset and history manager. Handles parsing and revenge for the princess.
Kind: global class
Extends: AsyncEventEmitter
- Westley ⇐
AsyncEventEmitter
- .isDirty :
Boolean
- .readOnly
- .readOnly
- .clear() ⇒
Westley
- .clearDirtyState()
- .execute(command, [append]) ⇒
Westley
- .getDataset() ⇒
Object
- .getHistory() ⇒
Array.<String>
- .pad() ⇒
Westley
- ._getCommandForKey(commandKey) ⇒
Command
- .isDirty :
Whether the instance is dirty or not (unsaved changes)
Kind: instance property of Westley
Access: public
Read only: true
Kind: instance property of Westley
Access: public
Properties
Name | Type |
---|---|
readOnly | Boolean |
Set the read only value
Kind: instance property of Westley
Param | Type | Description |
---|---|---|
newRO | Boolean |
The new value |
westley.clear() ⇒ Westley
Clear the dataset and history
Kind: instance method of Westley
Returns: Westley
- Returns self
Clear the dirty state of the instance
Kind: instance method of Westley
westley.execute(command, [append]) ⇒ Westley
Execute a command - stored in history and modifies the dataset
Kind: instance method of Westley
Returns: Westley
- Returns self
Param | Type | Description |
---|---|---|
command | String |
The command to execute |
[append] | Boolean |
Whether to append to the end of the history list (default true) |
Get the core dataset
Kind: instance method of Westley
Returns: Object
- The dataset object
Get the history (deltas)
Kind: instance method of Westley
Returns: Array.<String>
- The command array (history)
westley.pad() ⇒ Westley
Insert a padding in the archive (used for delta tracking)
Kind: instance method of Westley
Returns: Westley
- Returns self
Gets a command by its key from the cache with its dependencies injected
Kind: instance method of Westley
Returns: Command
- Returns the command
Access: protected
Param | Type | Description |
---|---|---|
commandKey | String |
The key of the command |
Workspace class implementation Workspaces organise Archives and Datasources, and perform saves and merges with remote changes.
Kind: global class
- Workspace
- .archive :
Archive
- .datasource :
TextDatasource
- .masterCredentials :
Credentials
- .saveChannel :
Channel
- .localDiffersFromRemote() ⇒
Promise.<Boolean>
- .mergeFromRemote() ⇒
Promise.<Archive>
- .save() ⇒
Promise
- .setArchive(archive, datasource, masterCredentials)
- .update() ⇒
Promise
- .updatePrimaryCredentials(masterCredentials)
- .archive :
workspace.archive : Archive
The archive instance
Kind: instance property of Workspace
The datasource instance for the archive
Kind: instance property of Workspace
The master credentials for the archive
Kind: instance property of Workspace
The save channel for queuing save actions
Kind: instance property of Workspace
Detect whether the local archives (in memory) differ from their remote copies Fetches the remote copies from their datasources and detects differences between them and their local counterparts. Does not change/update the local items.
Kind: instance method of Workspace
Returns: Promise.<Boolean>
- A promise that resolves with a boolean - true if
there are differences, false if there is not
workspace.mergeFromRemote() ⇒ Promise.<Archive>
Merge remote contents Detects differences between a local and a remote item, and merges the two copies together.
Kind: instance method of Workspace
Returns: Promise.<Archive>
- A promise that resolves with the newly merged archive -
This archive is automatically saved over the original local copy.
Save the archive to the remote
Kind: instance method of Workspace
Returns: Promise
- A promise that resolves when saving has completed
Set the archive and its accompanying data on the workspace
Kind: instance method of Workspace
Param | Type | Description |
---|---|---|
archive | Archive |
The archive instance |
datasource | TextDatasource |
The datasource for the archive |
masterCredentials | * |
The master credentials for the archive |
Update the archive
Kind: instance method of Workspace
Returns: Promise
- A promise that resolves once the update has
completed
Update the master password of the archive
Kind: instance method of Workspace
Param | Type | Description |
---|---|---|
masterCredentials | Credentials |
The new credentials |
Kind: global mixin
- EntryCollection :
Object
EntryCollection.findEntriesByMeta ⇒ Array.<Entry>
Find entries that match a certain meta property
Kind: static property of EntryCollection
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
metaName | String |
The meta property to search for |
value | RegExp | string |
The value to search for |
EntryCollection.findEntriesByProperty ⇒ Array.<Entry>
Find all entries that match a certain property
Kind: static property of EntryCollection
Returns: Array.<Entry>
- An array of found extries
Param | Type | Description |
---|---|---|
property | string |
The property to search with |
value | RegExp | string |
The value to search for |
EntryCollection.inst.findEntryByID(id) ⇒ null
| Entry
Find an entry by its ID
Kind: static method of EntryCollection
Returns: null
| Entry
- Null if not found, or the Entry instance
Param | Type | Description |
---|---|---|
id | String |
The ID to search for |
Kind: global mixin
- GroupCollection :
Object
- .findGroupByID ⇒
Group
|null
- .findGroupsByTitle ⇒
Array.<Group>
- .findGroupByID ⇒
GroupCollection.findGroupByID ⇒ Group
| null
Find a group by its ID
Kind: static property of GroupCollection
Returns: Group
| null
- The group or null if not found
Param | Type | Description |
---|---|---|
id | String |
The group ID to search for |
GroupCollection.findGroupsByTitle ⇒ Array.<Group>
Find groups by their title
Kind: static property of GroupCollection
Returns: Array.<Group>
- An array of groups
Param | Type | Description |
---|---|---|
title | String | RegExp |
The group title |
Convert credentials of a remote archive to a datasource
Kind: global function
Returns: Promise.<{datasource, credentials}>
- A promise that resolves with the datasource and
source credentials
Param | Type | Description |
---|---|---|
sourceCredentials | Credentials |
The remote credentials. The credentials must have a type field and datasource information field |
credentialsToSource(sourceCredentials, archiveCredentials, [initialise], [contentOverride]) ⇒ Promise.<Object>
Convert credentials to a source for the ArchiveManager
Kind: global function
Returns: Promise.<Object>
- A promise that resolves with an object containing a workspace,
the source credentials and archive credentials
Param | Type | Default | Description |
---|---|---|---|
sourceCredentials | Credentials |
The remote archive credentials | |
archiveCredentials | Credentials |
Credentials for unlocking the archive | |
[initialise] | Boolean |
false |
Whether or not to initialise a new archive (defaults to false) |
[contentOverride] | String |
|
Content for overriding the fetch operation in the datasource, for loading offline content |
addExtraFieldsNonDestructive(entry, fields) ⇒ Array.<EntryFacadeField>
Add extra fields to a fields array that are not mentioned in a preset Facades are creaded by presets which don't mention all property values (custom user added items). This method adds the unmentioned items to the facade fields so that they can be edited as well.
Kind: global function
Returns: Array.<EntryFacadeField>
- A new array with all combined fields
Param | Type | Description |
---|---|---|
entry | Entry |
An Entry instance |
fields | Array.<EntryFacadeField> |
An array of fields |
Apply a facade field descriptor to an entry Takes data from the descriptor and writes it to the entry.
Kind: global function
Param | Type | Description |
---|---|---|
entry | Entry |
The entry to apply to |
descriptor | EntryFacadeField |
The descriptor object |
Deprecated
Process a modified entry facade
Kind: global function
Param | Type | Description |
---|---|---|
entry | Entry |
The entry to apply processed data on |
facade | EntryFacade |
The facade object |
createEntryFacade(entry) ⇒ EntryFacade
EntryFacade
Deprecated
Create a data/input facade for an Entry instance
Kind: global function
Returns: EntryFacade
- A newly created facade
Param | Type | Description |
---|---|---|
entry | Entry |
The Entry instance |
Deprecated
Get the facade type for an entry
Kind: global function
Returns: String
- The facade type
Param | Type | Description |
---|---|---|
entry | Entry |
The entry instance |
Set a value on an entry
Kind: global function
Throws:
Error
Throws if the property type is not recognised
Param | Type | Description |
---|---|---|
entry | Entry |
The entry instance |
property | String |
Type of property ("property"/"meta"/"attribute") |
name | String |
The property name |
value | String |
The value to set |
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 |
De-dupe an array
Kind: global function
Returns: Array
- The de-duped array
Param | Type | Description |
---|---|---|
arr | Array |
The array |
createFieldDescriptor(entry, title, entryPropertyType, entryPropertyName, options) ⇒ EntryFacadeField
Create a descriptor for a field to be used within a facade
Kind: global function
Returns: EntryFacadeField
- The field descriptor
Param | Type | Description |
---|---|---|
entry | Entry |
The entry instance to process |
title | String |
The field title |
entryPropertyType | String |
The type of entry property (property/attribute) |
entryPropertyName | String |
The name of the property |
options | Object |
The options for the field |
Get URLs from an entry's properties Allows for preferential sorting
Kind: global function
Param | Type | Description |
---|---|---|
properties | Object |
The entry properties |
preference | * |
Deprecated
Get a value on an entry for a specific property type
Kind: global function
Returns: String
- The property value
Throws:
Error
Throws for unknown property types
Param | Type | Description |
---|---|---|
entry | Entry |
The entry instance |
property | String |
The type of entry property (property/meta/attribute) |
name | String |
The property name |
Check if a property name is valid
Kind: global function
Returns: Boolean
- True if the name is valid
Param | Type | Description |
---|---|---|
name | String |
The name to check |
findEntriesByCheck(groups, compareFn) ⇒ Array.<Entry>
Find entry instances by filtering with a compare function
Kind: global function
Returns: Array.<Entry>
- An array of found entries
Param | Type | Description |
---|---|---|
groups | Array.<Group> |
The groups to check in |
compareFn | function |
The callback comparison function, return true to keep and false to strip |
findGroupsByCheck(groups, compareFn) ⇒ Array.<Group>
Find group instances within groups that satisfy some check
Kind: global function
Returns: Array.<Group>
- An array of found groups
Param | Type | Description |
---|---|---|
groups | Array.<Group> |
The groups to check within |
compareFn | function |
A comparision function - return true to keep, false to strip |
getAllEntries(groups) ⇒ Array.<Entry>
Get all entries within a collection of groups
Kind: global function
Returns: Array.<Entry>
- An array of entries
Param | Type | Description |
---|---|---|
groups | Array.<Group> |
An array of groups |
Generate a UUID (v4)
Kind: global function
Returns: String
- The new UUID
New source options
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[id] | String |
Override source ID generation |
[type] | String |
Specify the source type |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
name | String |
The name of the source |
id | String |
The source ID |
status | ArchiveSourceStatus |
Status of the source |
type | String |
The source type |
colour | String |
Colour for the source |
order | Number |
The order of the source |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
groups | Array.<Object> |
Array of groups |
entries | Array.<Object> |
Array of entries |
attributes | Object |
Archive attributes |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
type | String |
The type of history item |
[origin] | String |
The origin group ID for a moved-entry |
[destination] | String |
The destination group ID for a moved-entry |
[property] | String |
The property/attribute name of the change |
[value] | String |
The value that was changed (resulting) |
Entry facade for data input
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
type | String |
The type of the facade |
fields | Array.<EntryFacadeField> |
An array of fields |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
entry | Entry |
The entry |
archive | Archive |
The associated archive |
Entry facade data field
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
title | String |
The user-friendly title of the field |
field | String |
The type of data to map back to on the Entry instance (property/attribute) |
property | String |
The property name within the field type of the Entry instance |
value | String |
The value of the property (read/write) |
secret | Boolean |
Wether or not the value should be hidden while viewing (masked) |
multiline | Boolean |
Whether the value should be edited as a multiline value or not |
formatting | Object | Boolean |
Vendor formatting options object, or false if no formatting necessary |
maxLength | Number |
Maximum recommended length of the value (defaults to -1) |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
group | Object |
The found group dataset |
index | Number |
The index the group was located at |