Persistent resources for the web services module.
Requires
Classes
Mixins
Members
-
<static> AUTOASSIGNED
-
Validators to use on auto-assigned required properties in the record types library definition. When a new record is created, requires the property to be empty. When the record is being updated, requires the property to have value.
-
<static> OPTIONALLY_AUTOASSIGNED
-
Validators to use on optionally auto-assigned required properties in the record types library definition. When a new record is created, the property is allowed to be empty or not. When the record is being updated, requires the property to have value.
Methods
-
<static> createResourceHandlersFactory(ds, dboFactory [, defaultOptions])
-
Create resource handlers factory.
Parameters:
Name Type Argument Description ds
module:x2node-dbos.DataSource Data source. dboFactory
module:x2node-dbos~DBOFactory DBO factory. defaultOptions
Object <optional>
Default options for handlers. -
<static> parseSearchQuery(recordTypeDesc, urlQuery, queryParts, queryParams)
-
Parse URL query parameters used for collection search requests into a fetch DBO query specification.
Parameters:
Name Type Description recordTypeDesc
module:x2node-records~RecordTypeDescriptor Descriptor of the record type being queried. urlQuery
Object URL query parameters. queryParts
string Query parts to include in parsing. A line of characters including "p", "f", "o" and "r". queryParams
Object.<string, *> Fetch query parameters to populate. Throws:
-
If query parameters are invalid.
- Type
- common.X2SyntaxError
Returns:
Fetch DBO query specification, ornull
if invalid URL query parameters.- Type
- Object
-
Type Definitions
-
CreateTransactionContext
-
Context object for a new record creation operation.
Type:
Properties:
Name Type Argument Description recordTmpl
Object parentQuerySpec
Object <optional>
parentQueryParams
Object <optional>
parentRecord
Object <optional>
-
DeleteTransactionContext
-
Context object for a record deletion operation.
Type:
Properties:
Name Type Argument Description selectionFilter
Object queryParams
Object.<string, *> fetchProps
Array.<string> <optional>
record
Object <optional>
referredRecords
Object <optional>
deleteResult
module:x2node-dbos~DeleteDBO~Result -
ReadTransactionContext
-
Context object for a single record read operation.
Type:
Properties:
Name Type Argument Description querySpec
Object queryParams
Object.<string, *> referredRecords
Object <optional>
-
SearchTransactionContext
-
Context object for a record search operation.
Type:
Properties:
Name Type Description querySpec
Object Query specification built from the search parameters. Can be modified by the hook. queryParams
Object.<string, *> -
UpdateTransactionContext
-
Context object for a record update operation.
Type:
Properties:
Name Type Description patchSpec
Object patch
module:x2node-patches~RecordPatch prefetchQuerySpec
Object prefetchQueryParams
Object.<string, *> updateResult
module:x2node-dbos~UpdateDBO~Result