Methods
(async) factory(pkgName) → {class}
Plugin factory
Name | Type | Description |
---|---|---|
pkgName | string | NPM package name |
- Type:
- class
Type Definitions
TPropType
- Object
Name | Type | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
integer | Object | Properties
| |||||||||||||||||||||
smallint | Object | Properties
| |||||||||||||||||||||
text | Object | Properties
| |||||||||||||||||||||
string | Object | Properties
| |||||||||||||||||||||
float | Object | Properties
| |||||||||||||||||||||
double | Object | Properties
| |||||||||||||||||||||
boolean | Object | Properties
| |||||||||||||||||||||
datetime | Object | Properties
| |||||||||||||||||||||
date | Object | Properties
| |||||||||||||||||||||
time | Object | Properties
| |||||||||||||||||||||
timestamp | Object | Properties
| |||||||||||||||||||||
object | Object | {} | |||||||||||||||||||||
array | Object | {} |
TRecordCountOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
noCache | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
- Source
TRecordCreateOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
noValidation | boolean | <optional> | false | If |
noCheckUnique | boolean | <optional> | false | If |
noSanitize | boolean | <optional> | false | If |
noResult | boolean | <optional> | false | If |
truncateString | boolean | <optional> | true | If |
fields | boolean | <optional> | [] | If not empty, return only these fields EXCLUDING hidden fields |
hidden | boolean | <optional> | [] | Additional fields to hide, in addition the one set in model's schema |
forceNoHidden | boolean | <optional> | false | If |
- Source
TRecordFilter
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
query | string | | <optional> | {} | Query definition. See query-language for more |
limit | number | Max number of records per page | ||
page | number | Which page is the returned records currently at | ||
skip | number | Records to skip | ||
sort | TRecordSort | Sort order info |
- Source
TRecordFindOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
count | boolean | <optional> | false | If |
noCache | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
fields | boolean | <optional> | [] | If not empty, return only these fields EXCLUDING hidden fields |
hidden | boolean | <optional> | [] | Additional fields to hide, in addition the one set in model's schema |
forceNoHidden | boolean | <optional> | false | If |
- Source
TRecordFindResult
- Object
Name | Type | Description |
---|---|---|
data | Array.<Object> | Array of returned records |
success | boolean | Whether operation is successfull or failed |
page | number | Which page is the returned records currently at |
limit | number | Max number of records per page |
count | number | Total number of records returned |
pages | number | Total number of pages returned |
- Source
TRecordGetOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
count | boolean | <optional> | false | If |
noCache | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
fields | boolean | <optional> | [] | If not empty, return only these fields EXCLUDING hidden fields |
hidden | boolean | <optional> | [] | Additional fields to hide, in addition the one set in model's schema |
forceNoHidden | boolean | <optional> | false | If |
- Source
TRecordGetResult
- Object
Name | Type | Description |
---|---|---|
data | Object | Returned record |
success | boolean | Whether operation is successfull or failed |
- Source
TRecordPagination
- Object
Name | Type | Description |
---|---|---|
limit | number | Number of records per page |
page | number | Page number |
skip | number | Records to skip |
sort | TRecordSort | Sort order |
TRecordRemoveOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
noResult | boolean | <optional> | false | If |
fields | boolean | <optional> | [] | If not empty, return only these fields EXCLUDING hidden fields |
hidden | boolean | <optional> | [] | Additional fields to hide, in addition the one set in model's schema |
forceNoHidden | boolean | <optional> | false | If |
- Source
TRecordSort
Key value pairs used as sort information:
- Key represent model's field name
- value represent its sort order:
1
for ascending order, and-1
for descending order
Example: to sort by firstName (ascending) and lastName (descending)
const sort = {
firstName: 1,
lastName: -1
}
- Object.<string, TRecordSortKey>
TRecordSortKey
- string
TRecordUpdateOptions
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
dataOnly | boolean | <optional> | true | If |
noHook | boolean | <optional> | false | If |
noFeatureHook | boolean | <optional> | false | If |
noValidation | boolean | <optional> | false | If |
noCheckUnique | boolean | <optional> | false | If |
noSanitize | boolean | <optional> | false | If |
noResult | boolean | <optional> | false | If |
truncateString | boolean | <optional> | true | If |
partial | boolean | <optional> | true | If |
fields | boolean | <optional> | [] | If not empty, return only these fields EXCLUDING hidden fields |
hidden | boolean | <optional> | [] | Additional fields to hide, in addition the one set in model's schema |
forceNoHidden | boolean | <optional> | false | If |
- Source
TValidator
- Object
Name | Type | Description |
---|---|---|
string | TValidatorString | |
number | TValidatorNumber | |
boolean | TValidatorBoolean | |
date | TValidatorDate | |
timestamp | TValidatorTimestamp |
- Source
TValidatorBoolean
- Array.<string>
Name | Type | Default | Description |
---|---|---|---|
0 | string | falsy | |
1 | string | sensitive | |
2 | string | truthy |
- Source
TValidatorDate
- Array.<string>
Name | Type | Default | Description |
---|---|---|---|
0 | string | greater | |
1 | string | iso | |
2 | string | less | |
2 | string | max | |
2 | string | min |
- Source
TValidatorNumber
- Array.<string>
Name | Type | Default | Description |
---|---|---|---|
0 | string | great | |
1 | string | less | |
2 | string | max | |
3 | string | min | |
4 | string | multiple | |
5 | string | negative | |
6 | string | port | |
7 | string | positive | |
8 | string | sign | |
9 | string | unsafe |
- Source
TValidatorString
- Array.<string>
Name | Type | Default | Description |
---|---|---|---|
0 | string | alphanum | |
1 | string | base64 | |
2 | string | case | |
3 | string | creditCard | |
4 | string | dataUri | |
5 | string | ||
6 | string | guid | |
7 | string | uuid | |
8 | string | hex | |
9 | string | hostname | |
10 | string | insenstive | |
11 | string | ip | |
12 | string | isoDate | |
13 | string | isoDuration | |
14 | string | length | |
15 | string | lowercase | |
16 | string | max | |
17 | string | min | |
18 | string | normalize | |
19 | string | pattern | |
20 | string | regex | |
21 | string | replace | |
22 | string | token | |
23 | string | trim | |
24 | string | truncate | |
25 | string | upercase | |
26 | string | uri |
- Source
TValidatorTimestamp
- Array.<string>
Name | Type | Default | Description |
---|---|---|---|
0 | string | timestamp |
- Source