Constructor
new Entity(options)
- Description:
- Source:
Parameters:
Name |
Type |
Description |
options |
object
|
|
Classes
- Entity
Members
name
- Description:
- Get entity's human-friendly name string
- Source:
Get entity's human-friendly name string
offline
- Description:
- Is this object operating offline?
- Source:
Is this object operating offline?
Methods
(async) _postOfflineLoad()
- Description:
- Called after loading serialised offline data
- Source:
(async) ensureHasOfflineData()
- Description:
- Await until offline data is present
- Source:
getTimeNow() → {string}
- Description:
- Return the current time for this entity in its local timezone
- Source:
Returns:
-
Type
-
string
getTimeNowMoment() → {moment}
- Description:
- Return the current time for this entity in its local timezone
- Source:
Returns:
-
Type
-
moment
getUniqueID() → {string}
- Description:
- Get a globally unique ID for this entity
- Source:
Returns:
-
Type
-
string
(async) injectForDomain(filter, func)
- Description:
- Register a new injection for a specific domain
- Source:
Parameters:
Name |
Type |
Description |
filter |
object
|
Mongo-type query to use to match a URL |
func |
function
|
Function to call with needle request to inject extra data into.
Function will take arguments: (method, URL, data, options) |
log(…args)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Description |
args |
any
|
<repeatable>
|
Message to debug log |
registerOfflineFunction(functionName)
- Description:
- Register a function on this entity for offline access
- Source:
Parameters:
Name |
Type |
Description |
functionName |
string
|
|
(async) serialise(bundle, saving, optionsopt)
- Description:
- Source:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
bundle |
object
|
|
|
Bundle to read/write from/to |
saving |
boolean
|
|
true
|
Whether we are saving or loading during this serialise operation |
options |
object
|
<optional>
|
|
Properties
Name |
Type |
Attributes |
Default |
Description |
version |
number
|
<optional>
|
1
|
Version of the seialised data |
recursive |
boolean
|
<optional>
|
true
|
Recurse through attached entities? |
|