Class Core
Hierarchy
-
EventEmitter
- Core
Constructors
Properties
Methods
Constructors
-
Parameters
-
application: Application
Returns Core
-
Properties
JSON Schema validator instance
JSON Schema registry
Current executor
Init promise to ensure, webda is initiated Used for init() method
CORS Filter registry
Added via [[Webda.registerRequestFilter]] See [[CorsFilter]]
Type declaration
-
[key: string]: any
Methods
-
Return all methods that are setters (startsWith("set"))
Parameters
-
obj: any
service get setter from
Returns any[]
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Add a route dynamicaly
Parameters
-
url: string
of the route can contains dynamic part like {uuid}
-
info: RouteInfo
the type of executor
Returns void
-
-
Auto connect services with setters
Returns void
-
Verify if an origin is allowed to do request on the API
Parameters
-
ctx: Context
Returns Promise<boolean>
-
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
-
-
Emit the event with data and wait for Promise to finish if listener returned a Promise
Parameters
-
event: any
-
Rest ...data: any[]
Returns Promise<any[]>
-
-
Returns Array<string | symbol>
-
Parameters
-
Default value skipHidden: boolean = true
Returns Document
-
-
Flush the entire response to the client
Parameters
-
context: Context
Returns void
-
-
Flush the headers to the response, no more header modification is possible after that
Parameters
-
context: Context
Returns void
-
-
Parameters
-
Default value subpath: string = ""
Returns string
-
-
Return application definition
Returns Application
-
Returns Configuration
-
Retrieve all deployers
Returns object
-
[key: string]: ServiceConstructor<Service>
-
-
Return the global parameters of a domain
Returns any
-
To define the locales just add a locales: ['en-GB', 'fr-FR'] in your host global configuration
Returns string[]
The configured locales or "en-GB" if none are defined
-
Returns number
-
Check for a model name and return the wanted class or throw exception if none found
Parameters
-
name: any
The model name to retrieve
Returns any
-
-
Return a map of defined models
Returns object
-
[key: string]: CoreModelDefinition
-
-
Retrieve all detected modules definition
Returns CachedModule
-
Return current Router object
Returns Router
-
Return a salt to use when doing digest
Returns string
Current salt
-
This should return a "turning" secret with cache and a service to modify it every x mins WARNING The security is lower without this "turning" secret, you can still set the global.secret parameter
Dont rely on this method, it will probably disapear to avoid secret leak
Returns string
Current secret
-
Check for a service name and return the wanted singleton or undefined if none found
Type parameters
-
T: Service
Parameters
-
Default value name: string = ""
The service name to retrieve
Returns T
-
-
Parameters
-
service: string
Returns any
-
-
Return a map of defined services
Returns object
-
[key: string]: Service
-
-
Return a map of services that extends type
Parameters
-
Default value type: any = undefined
The type of implementation
Returns object
-
[key: string]: Service
-
-
Return a map of defined stores
Returns object
-
[key: string]: Service
-
-
Return webda current version
Returns string
package version
-
Get WorkerOutput
Returns WorkerOutput
-
Init Webda
It will resolve Services init method and autolink
Returns Promise<void>
-
Init Routes declare by @Route annotation
Parameters
-
serviceBean: Service
Returns void
-
-
Returns void
-
Return if Webda is in debug mode
Returns boolean
-
Parameters
-
key: string
-
value: any
Returns any
-
-
Parameters
-
type: string | symbol
Returns number
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Logs
Parameters
-
level: WorkerLogLevel
-
Rest ...args: any[]
Returns void
-
-
Create a new context for a request
Type parameters
-
T: Context
Parameters
-
httpContext: HttpContext
THe HTTP request context
-
Default value stream: any = undefined
The request output stream if any
-
Default value noInit: boolean = false
Returns Promise<T>
A new context object to pass along
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Retrieve a global parameter
Parameters
-
name: string
Returns any
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Register model
Parameters
-
name: string
-
clazz: any
Returns void
-
-
Parameters
-
filter: RequestFilter<Context>
Returns void
-
-
Parameters
-
updates: any
Returns Promise<void>
-
-
Reinit the @Route
Returns void
-
Parameters
-
Optional event: string | symbol
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Remove a route dynamicly
Parameters
-
url: string
to remove
Returns void
-
-
Parameters
-
executor: any
The executor to expose as executor
-
code: any
to execute
Returns any
-
-
Parameters
-
n: number
Returns this
-
-
Convert an object to JSON using the Webda json filter
Parameters
-
object: any
The object to export
Returns string
The export of the strip object ( removed all attribute with _ )
-
-
Add to context information and executor based on the http context
Parameters
-
ctx: Context
Returns boolean
-
-
Validate the object with schema
Parameters
-
object: any
to validate
-
schema: any
path to use
Returns any
-
-
Get last errors from AJV schema validator ( called through validate method )
Returns any
-
Parameters
-
emitter: EventEmitter
-
event: string | symbol
Returns number
-
Generated using TypeDoc
This is the main class of the framework, it handles the routing, the services initialization and resolution