Constructor
new NoteShort(treeCache, row)
Parameters:
Name | Type | Description |
---|---|---|
treeCache |
TreeCache | |
row |
Object.<string, Object> |
- Source:
Members
attributes :Array.<string>
Type:
- Array.<string>
- Source:
children :Array.<string>
Type:
- Array.<string>
- Source:
childToBranch :Object.<string, string>
Type:
- Object.<string, string>
- Source:
contentLength
- Source:
isDeleted
- Source:
isProtected
- Source:
mime
- Source:
noteId
- Source:
parents :Array.<string>
Type:
- Array.<string>
- Source:
parentToBranch :Object.<string, string>
Type:
- Object.<string, string>
- Source:
targetRelations :Array.<string>
Type:
- Array.<string>
- Source:
title
- Source:
type
- Source:
Methods
(async) getAttribute(type, name) → {Promise.<Attribute>}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
- Type
- Promise.<Attribute>
(async) getAttributes(typeopt, nameopt) → {Promise.<Array.<Attribute>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string |
<optional> |
(optional) attribute type to filter |
name |
string |
<optional> |
(optional) attribute name to filter |
- Source:
Returns:
all note's attributes, including inherited ones
- Type
- Promise.<Array.<Attribute>>
(async) getAttributeValue(type, name) → {Promise.<string>}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
attribute value of given type and name or null if no such attribute exists.
- Type
- Promise.<string>
(async) getBranches() → {Promise.<Array.<Branch>>}
- Source:
Returns:
- Type
- Promise.<Array.<Branch>>
(async) getChildBranches() → {Promise.<Array.<Branch>>}
- Source:
Returns:
- Type
- Promise.<Array.<Branch>>
getChildNoteIds() → {Array.<string>}
- Source:
Returns:
- Type
- Array.<string>
(async) getChildNotes() → {Promise.<Array.<NoteShort>>}
- Source:
Returns:
- Type
- Promise.<Array.<NoteShort>>
(async) getLabel(name) → {Promise.<Attribute>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
label if it exists, null otherwise
- Type
- Promise.<Attribute>
(async) getLabelDefinitions(nameopt) → {Promise.<Array.<Attribute>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
label name to filter |
- Source:
Returns:
all note's label definitions, including inherited ones
- Type
- Promise.<Array.<Attribute>>
(async) getLabels(nameopt) → {Promise.<Array.<Attribute>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
label name to filter |
- Source:
Returns:
all note's labels (attributes with type label), including inherited ones
- Type
- Promise.<Array.<Attribute>>
(async) getLabelValue(name) → {Promise.<string>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
label value if label exists, null otherwise
- Type
- Promise.<string>
getOwnedAttribute(type, name) → {Attribute}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
- Type
- Attribute
getOwnedAttributes(typeopt, nameopt) → {Array.<Attribute>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string |
<optional> |
(optional) attribute type to filter |
name |
string |
<optional> |
(optional) attribute name to filter |
- Source:
Returns:
all note's attributes, including inherited ones
- Type
- Array.<Attribute>
getOwnedAttributeValue(type, name) → {string}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
attribute value of given type and name or null if no such attribute exists.
- Type
- string
getOwnedLabel(name) → {Attribute}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
label if it exists, null otherwise
- Type
- Attribute
getOwnedLabels(nameopt) → {Array.<Attribute>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
label name to filter |
- Source:
Returns:
all note's labels (attributes with type label), including inherited ones
- Type
- Array.<Attribute>
getOwnedLabelValue(name) → {string}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
label value if label exists, null otherwise
- Type
- string
getOwnedRelation(name) → {Attribute}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
relation if it exists, null otherwise
- Type
- Attribute
getOwnedRelations(nameopt) → {Array.<Attribute>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
relation name to filter |
- Source:
Returns:
all note's relations (attributes with type relation), including inherited ones
- Type
- Array.<Attribute>
getOwnedRelationValue(name) → {string}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
relation value if relation exists, null otherwise
- Type
- string
getParentNoteIds() → {Array.<string>}
- Source:
Returns:
- Type
- Array.<string>
(async) getParentNotes() → {Promise.<Array.<NoteShort>>}
- Source:
Returns:
- Type
- Promise.<Array.<NoteShort>>
(async) getRelation(name) → {Promise.<Attribute>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
relation if it exists, null otherwise
- Type
- Promise.<Attribute>
(async) getRelationDefinitions(nameopt) → {Promise.<Array.<Attribute>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
relation name to filter |
- Source:
Returns:
all note's relation definitions including inherited ones
- Type
- Promise.<Array.<Attribute>>
(async) getRelations(nameopt) → {Promise.<Array.<Attribute>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
relation name to filter |
- Source:
Returns:
all note's relations (attributes with type relation), including inherited ones
- Type
- Promise.<Array.<Attribute>>
(async) getRelationTarget(name) → {Promise.<NoteShort>|null}
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
- Source:
Returns:
target note of the relation or null (if target is empty or note was not found)
- Type
- Promise.<NoteShort> | null
(async) getRelationTargets(nameopt) → {Promise.<Array.<NoteShort>>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
relation name to filter |
- Source:
Returns:
- Type
- Promise.<Array.<NoteShort>>
(async) getRelationValue(name) → {Promise.<string>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
relation value if relation exists, null otherwise
- Type
- Promise.<string>
getTargetRelations() → {Array.<Attribute>}
Get relations which target this note
- Source:
Returns:
- Type
- Array.<Attribute>
(async) hasAttribute(type, name) → {Promise.<boolean>}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
true if note has an attribute with given type and name (including inherited)
- Type
- Promise.<boolean>
hasChildren() → {boolean}
- Source:
Returns:
- Type
- boolean
(async) hasLabel(name) → {Promise.<boolean>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
true if label exists (including inherited)
- Type
- Promise.<boolean>
hasOwnedAttribute(type, name) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
type |
string | attribute type (label, relation, etc.) |
name |
string | attribute name |
- Source:
Returns:
true if note has an attribute with given type and name (including inherited)
- Type
- boolean
hasOwnedLabel(name) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | label name |
- Source:
Returns:
true if label exists (excluding inherited)
- Type
- boolean
hasOwnedRelation(name) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
true if relation exists (excluding inherited)
- Type
- boolean
(async) hasRelation(name) → {Promise.<boolean>}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | relation name |
- Source:
Returns:
true if relation exists (including inherited)
- Type
- Promise.<boolean>
invalidateAttributeCache()
Clear note's attributes cache to force fresh reload for next attribute request.
Cache is note instance scoped.
- Source:
isJson() → {boolean}
- Source:
Returns:
- Type
- boolean