GitHub – NathanAdhitya/express-mongoose-ra-json-server: creates express.js routes from a mongoose model for ra-data-json-server

export

interface

raExpressMongooseOptions

<

T

>

{

/** Fields to search from ?q (used for autofill and search) */

q

?:

string

[

]

;

/** Base name for ACLs (e.g. list operation does baseName.list) */

aclName

?:

string

;

/** Fields to allow regex based search (non-exact search) */

allowedRegexFields

?:

string

[

]

;

/** Read-only fields to filter out during create and update */

readOnlyFields

?:

string

[

]

;

/** Function to transform inputs received in create and update */

inputTransformer

?:

(

input

:

Partial

<

T

>

)

=>

Promise

<

Partial

<

T

>

>

;

/** Additional queries for list, e.g. deleted/hidden flag. */

listQuery

?:

Record

<

string

,

any

>

;

/** Max rows from a get operation to prevent accidental server suicide (default 100) */

maxRows

?:

number

;

/** Extra selects for mongoose queries (in the case that certain fields are hidden by default) */

extraSelects

?:

string

;

/** Disable or enable certain parts. */

capabilities

?:

raExpressMongooseCapabilities

;

/** Specify a custom express.js router */

router

?:

Router

;

/** Specify an ACL middleware to check against permissions */

ACLMiddleware

?:

(

name

:

string

)

=>

RequestHandler

;

}