The factory which of this entityManager instance
Readonly
DeviceAn Device factory for user objects. The Device factory can be called to create new instances of devices or can be used to register, push to and check registration status of devices.
A File factory for file objects. The file factory can be called to create new instances for files. The created instances implements the File interface
Readonly
GeoConstructor for a new GeoPoint
Readonly
ListConstructor for a new List collection
Readonly
MapConstructor for a new Map collection
Readonly
RoleAn Role factory for role objects. The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the access permissions through this role The created instances implements the Role interface
Readonly
SetConstructor for a new Set collection
Readonly
UserAn User factory for user objects. The User factory can be called to create new instances of users or can be used to register/login/logout users. The created instances implements the User interface
The bloom filter which contains staleness information of cached objects
Readonly
bloomBloom filter refresh Promise
Bloom filter refresh interval in seconds.
Set of object ids that were updated but are not yet included in the bloom filter. This set essentially implements revalidation by side effect which does not work in Chrome.
Set of object ids that were revalidated after the Bloom filter was loaded.
Readonly
codePrivate
connectthe shared connection data if this EntityManager shares the credentials with the EntityManagerFactory
The connector used for requests
The current registered device object
Private
entitiesAll managed and cached entity instances
Readonly
entityReadonly
logLog messages can created by calling log directly as function, with a specific log level or with the helper methods, which a members of the log method.
Logs will be filtered by the client logger and the before they persisted. The default log level is 'info' therefore all log messages below the given message aren't persisted.
Examples:
// default log level ist info db.log('test message %s', 'my string'); // info: test message my string // pass a explicit log level as the first argument, one of ('trace', 'debug', 'info', 'warn', 'error') db.log('warn', 'test message %d', 123); // warn: test message 123 // debug log level will not be persisted by default, since the default logging level is info db.log('debug', 'test message %j', {number: 123}, {}); // debug: test message {"number":123} // data = {} // One additional json object can be provided, which will be persisted together with the log entry db.log('info', 'test message %s, %s', 'first', 'second', {number: 123}); // info: test message first, second // data = {number: 123} //use the log level helper db.log.info('test message', 'first', 'second', {number: 123}); // info: test message first second // data = {number: 123} //change the default log level to trace, i.e. all log levels will be persisted, note that the log level can be //additionally configured in the baqend db.log.level = 'trace'; //trace will be persisted now db.log.trace('test message', 'first', 'second', {number: 123}); // info: test message first second // data = {number: 123}
The current logged in user object
Readonly
metamodelReadonly
modulesReturns the tokenStorage which will be used to authorize all requests.
Whether caching is disabled
Returns true if the device token is already registered, otherwise false.
Determine whether the entity manager is open. true until the entity manager has been closed
Indicates if there is currently no exclusive operation executed
true
If no exclusive lock is hold
The authentication token if the user is logged in currently
The authentication token if the user is logged in currently
Private
_attachPrivate
_createPrivate
Private
_getPrivate
_locklessPrivate
Save the object state without locking
Optional
depth?: number | booleanOptional
refresh?: booleanPrivate
_loginOAuthPrivate
_logoutPrivate
_optimisticPrivate
pre-safe callback
Private
_savePrivate
Save and lock the object state
Optional
depth?: number | booleanOptional
refresh?: booleanPrivate
_updatePrivate
_updatePrivate
_updatePrivate
_userOptional
loginOption: boolean | LoginOptionClose an application-managed entity manager
After the close method has been invoked, all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it will throw the IllegalStateError except for transaction, and isOpen (which will return false). If this method is called when the entity manager is associated with an active transaction, the persistence context remains managed until the transaction completes.
Creates an instance of Builder
The query results are instances of the resultClass argument.
A query builder to create one ore more queries for the specified class
the type of the query result
Creates a absolute url for the given relative one
a absolute url which is optionally signed with a resource token which authenticates the currently logged in user
the relative url
Optional
authorize: booleanindicates if authorization credentials should be generated and be attached to the url
Delete the entity instance.
Optional
options: { The delete options
Optional
depth?: number | booleanOptional
force?: booleanRemove the given entity from the persistence context, causing a managed entity to become detached
Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.
The entity instance to detach.
Returns the current MFA status of the user
A promise that resolves to the MFA status of the user. Possible values are 'ENABLED' if MFA is enabled, 'DISABLED' if MFA is disabled, or 'PENDING' if MFA status is pending.
Get an instance whose state may be lazily fetched
If the requested instance does not exist in the database, the EntityNotFoundError is thrown when the instance state is first accessed. The application should not expect that the instance state will be available upon detachment, unless it was accessed by the application while the entity manager was open.
Optional
key: stringStarts the MFA initiate process - note you must be logged in, to start the mfa setup process
A promise that resolves to an object with the following properties:
const { qrCode, keyUri } = await db.initMFA();
const code = await setupMFADevice(qrCode, keyUri);
const user = await db.finishMFA(code);
Whether caching is enabled
Search for an entity of the specified oid
If the entity instance is contained in the persistence context, it is returned from there.
the loaded entity or null
Optional
loginOption: boolean | LoginOptionpre-safe callback
Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled
A promise which completes successfully, when the previously requested operation completes
Optional
doneCallback: ((this: EntityManager) => any)The callback which will be invoked when the previously operations on this object is completed.
Optional
failCallback: ((error: Error) => any)When the lock can't be released caused by a none recoverable error
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
entity instance
The refresh options
Optional
depth?: number | booleanThe OS of the device (IOS/Android)
WebPush subscription
Optional
loginOption: boolean | LoginOptionOptional
options: { The save options
Optional
depth?: number | booleanOptional
force?: booleanOptional
refresh?: booleanSet true to save the entity without locking
Optional
options: { Optional
depth?: number | booleanOptional
force?: booleanOptional
refresh?: booleanThe given entity will be checked by the validation code of the entity type.
result
Protected
withProtected
Try to aquire an exclusive lock and executes the given callback.
A promise
If the lock can't be aquired
The exclusive operation to execute
Optional
critical: boolean = falseIndicates if the operation is critical. If the operation is critical and the operation fails, then the lock will not be released
Generated using TypeDoc
This base class provides an lock interface to execute exclusive operations