Class: WebdaConfiguration
Extends
Constructors
new WebdaConfiguration(application)
new WebdaConfiguration(
application
):WebdaConfiguration
Parameters
• application: Application
Returns
Overrides
Source
packages/shell/src/handlers/config.ts:132
Properties
_ajv
protected
_ajv:Ajv
JSON Schema validator instance
Inherited from
Source
packages/core/lib/core.d.ts:218
_ajvSchemas
protected
_ajvSchemas:Object
JSON Schema registry Save if a schema was added to Ajv already
Index signature
[key
: string
]: true
Inherited from
Source
packages/core/lib/core.d.ts:223
_configFile
protected
_configFile:string
Inherited from
Source
packages/core/lib/core.d.ts:230
_currentExecutor
protected
_currentExecutor:any
Current executor
Inherited from
Source
packages/core/lib/core.d.ts:229
_init
protected
_init:Promise
<void
>
Init promise to ensure, webda is initiated Used for init() method
Inherited from
Source
packages/core/lib/core.d.ts:209
_initPromise
protected
_initPromise:Promise
<void
>
Contains the current initialization process
Inherited from
Source
packages/core/lib/core.d.ts:234
_initTime
protected
_initTime:number
When the Core was initialized
Inherited from
Source
packages/core/lib/core.d.ts:238
_initiated
protected
_initiated:boolean
If Core is already initiated
Inherited from
Source
packages/core/lib/core.d.ts:198
_requestCORSFilters
protected
_requestCORSFilters:RequestFilter
<WebContext
<any
,any
>>[]
CORS Filter registry
Added via [[Webda.registerCORSRequestFilter]] See [[CorsFilter]]
Inherited from
WebdaServer
._requestCORSFilters
Source
packages/core/lib/core.d.ts:257
_requestFilters
protected
_requestFilters:RequestFilter
<WebContext
<any
,any
>>[]
Request Filter registry
Added via [[Webda.registerRequestFilter]] See [[CorsFilter]]
Inherited from
Source
packages/core/lib/core.d.ts:250
application
protected
application:Application
Application that generates this Core
Inherited from
Source
packages/core/lib/core.d.ts:190
cryptoService
protected
cryptoService:default
<CryptoServiceParameters
>
Manage encryption within the application
Inherited from
Source
packages/core/lib/core.d.ts:275
devMode
protected
devMode:boolean
Inherited from
Source
packages/shell/src/handlers/http.ts:27
failedServices
protected
failedServices:Object
Services who failed to create or initialize
Index signature
[key
: string
]: any
Inherited from
Source
packages/core/lib/core.d.ts:202
globalContext
protected
globalContext:GlobalContext
System context
Inherited from
Source
packages/core/lib/core.d.ts:308
interuptables
interuptables:
Object
[]
Inherited from
Source
packages/core/lib/core.d.ts:312
operations
protected
operations:Object
Contains all operations defined by services
Index signature
[key
: string
]: OperationDefinitionInfo
Inherited from
Source
packages/core/lib/core.d.ts:279
registry
protected
registry:Store
<any
,StoreParameters
,StoreEvents
>
Application registry
Inherited from
Source
packages/core/lib/core.d.ts:271
resourceService
protected
resourceService:default
<ResourceServiceParameters
>
Resource services used to serve static content
Inherited from
Source
packages/shell/src/handlers/http.ts:33
router
protected
router:Router
Router that will route http request in
Inherited from
Source
packages/core/lib/core.d.ts:194
serverStatus
protected
serverStatus:ServerStatus
=ServerStatus.Stopped
Inherited from
Source
packages/shell/src/handlers/http.ts:28
subnetChecker
protected
subnetChecker: (address
) =>boolean
Parameters
• address: string
Returns
boolean
Inherited from
Source
packages/shell/src/handlers/http.ts:29
webdaApplication
webdaApplication:
Application
Source
packages/shell/src/handlers/config.ts:130
captureRejectionSymbol
static
readonly
captureRejectionSymbol: typeofcaptureRejectionSymbol
Inherited from
WebdaServer
.captureRejectionSymbol
Source
packages/shell/node_modules/@types/node/events.d.ts:328
captureRejections
static
captureRejections:boolean
Sets or gets the default captureRejection value for all emitters.
Inherited from
Source
packages/shell/node_modules/@types/node/events.d.ts:333
defaultMaxListeners
static
defaultMaxListeners:number
Inherited from
WebdaServer
.defaultMaxListeners
Source
packages/shell/node_modules/@types/node/events.d.ts:334
errorMonitor
static
readonly
errorMonitor: typeoferrorMonitor
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Inherited from
Source
packages/shell/node_modules/@types/node/events.d.ts:327
Methods
addListener()
addListener(
eventName
,listener
):this
Alias for emitter.on(eventName, listener)
.
Parameters
• eventName: string
| symbol
• listener: (...args
) => void
Returns
this
Inherited from
Since
v0.1.26
Source
packages/shell/node_modules/@types/node/events.d.ts:354
addRoute()
addRoute(
url
,info
):void
Add a route dynamicaly
Parameters
• url: string
of the route can contains dynamic part like {uuid}
• info: RouteInfo
the type of executor
Returns
void
Inherited from
Source
packages/core/lib/core.d.ts:508
callOperation()
callOperation(
context
,operationId
):Promise
<any
>
Call an operation within the framework
Parameters
• context: OperationContext
<any
, any
>
• operationId: string
Returns
Promise
<any
>
Inherited from
Source
packages/core/lib/core.d.ts:444
checkCORSRequest()
protected
checkCORSRequest(ctx
):Promise
<boolean
>
Verify if an origin is allowed to do request on the API
Parameters
• ctx: WebContext
<any
, any
>
Returns
Promise
<boolean
>
Inherited from
Source
packages/core/lib/core.d.ts:711
checkOperation()
checkOperation(
context
,operationId
):Promise
<void
>
Check if an operation can be executed with the current context
Parameters
• context: OperationContext
<any
, any
>
• operationId: string
Returns
Promise
<void
>
Inherited from
Source
packages/core/lib/core.d.ts:440
checkOperationPermission()
checkOperationPermission(
context
,operationId
):boolean
Check if an operation can be executed with the current context
Not checking the input use checkOperation
instead to check everything
Parameters
• context: OperationContext
<any
, any
>
• operationId: string
Returns
boolean
true if operation can be executed
Inherited from
WebdaServer
.checkOperationPermission
Throws
OperationError if operation is unknown
Source
packages/core/lib/core.d.ts:434
checkRequest()
protected
checkRequest(ctx
):Promise
<boolean
>
Verify if a request can be done
Parameters
• ctx: WebContext
<any
, any
>
Returns
Promise
<boolean
>
Inherited from
Source
packages/core/lib/core.d.ts:705
createService()
protected
createService(services
,service
):void
Parameters
• services: any
• service: string
Returns
void
Inherited from
Source
packages/core/lib/core.d.ts:617
emit()
emit<
K
>(eventType
,event
?, ...data
?):boolean
Type parameters
• K extends keyof CoreEvents
Parameters
• eventType: string
| symbol
| K
• event?: CoreEvents
[K
]
• ...data?: any
[]
Returns
boolean
Inherited from
Source
packages/core/lib/core.d.ts:677
emitSync()
emitSync<
K
>(eventType
,event
?, ...data
?):Promise
<any
[]>
Emit the event with data and wait for Promise to finish if listener returned a Promise
Type parameters
• K extends keyof CoreEvents
Parameters
• eventType: symbol
| K
• event?: CoreEvents
[K
]
• ...data?: any
[]
Returns
Promise
<any
[]>
Inherited from
Source
packages/core/lib/core.d.ts:681
eventNames()
eventNames(): (
string
|symbol
)[]
Returns an array listing the events for which the emitter has registered
listeners. The values in the array are strings or Symbol
s.
const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});
const sym = Symbol('symbol');
myEE.on(sym, () => {});
console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
Returns
(string
| symbol
)[]
Inherited from
Since
v6.0.0
Source
packages/shell/node_modules/@types/node/events.d.ts:669
exportOpenAPI()
exportOpenAPI(
skipHidden
?):Document
<Object
>
Export OpenAPI
Parameters
• skipHidden?: boolean
Returns
Document
<Object
>
Inherited from
Source
packages/core/lib/core.d.ts:717
flush()
flush(
ctx
):void
Parameters
• ctx: WebContext
<any
, any
>
Returns
void
Inherited from
Source
packages/shell/src/handlers/http.ts:262
flushHeaders()
flushHeaders(
ctx
):void
Parameters
• ctx: WebContext
<any
, any
>
Returns
void
Inherited from
Source
packages/shell/src/handlers/http.ts:241
getApiUrl()
getApiUrl(
subpath
?):string
Get absolute url with subpath
Parameters
• subpath?: string
Returns
string
Inherited from
Source
packages/core/lib/core.d.ts:381
getAppPath()
getAppPath(
subpath
?):string
Return application path with subpath
Helper that redirect to this.application.getAppPath
Parameters
• subpath?: string
Returns
string
Inherited from
Source
packages/core/lib/core.d.ts:390
getApplication()
getApplication():
Application
Return application definition
Returns
Application
Inherited from
Source
packages/core/lib/core.d.ts:398
getBeans()
getBeans():
any
Returns
any
Inherited from
Source
packages/core/lib/core.d.ts:618
getBinaryStore()
getBinaryStore<
T
>(modelOrConstructor
,attribute
):BinaryService
<BinaryParameters
,BinaryEvents
>
Get the service that manage a model
Type parameters
• T extends CoreModel
Parameters
• modelOrConstructor: T
| Constructor
<T
>
• attribute: string
Returns
BinaryService
<BinaryParameters
, BinaryEvents
>
Inherited from
Source
packages/core/lib/core.d.ts:370
getConfiguration()
getConfiguration():
Configuration
Returns
Configuration
Inherited from
Source
packages/core/lib/core.d.ts:540
getContextFromRequest()
getContextFromRequest(
req
,res
?):Promise
<WebContext
<any
,any
>>
Return a Context object based on a request
Parameters
• req: IncomingMessage
to initiate object from
• res?: ServerResponse
<IncomingMessage
>
to add for body
Returns
Promise
<WebContext
<any
, any
>>
Inherited from
WebdaServer
.getContextFromRequest
Source
packages/shell/src/handlers/http.ts:76
getCrypto()
getCrypto():
default
<CryptoServiceParameters
>
Return the crypto service
Returns
default
<CryptoServiceParameters
>
Inherited from
Source
packages/core/lib/core.d.ts:633
getGlobalContext()
getGlobalContext():
GlobalContext
Get the system context
Returns
GlobalContext
Inherited from
Source
packages/core/lib/core.d.ts:589
getGlobalParams()
getGlobalParams():
any
Return the global parameters of a domain
Returns
any
Inherited from
Source
packages/core/lib/core.d.ts:584
getInstanceId()
getInstanceId():
string
Return Core instance id
It is a random generated string
Returns
string
Inherited from
Source
packages/core/lib/core.d.ts:376
getLocales()
getLocales():
string
[]
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
Inherited from
Source
packages/core/lib/core.d.ts:496
getLogger()
getLogger(
clazz
):Logger
Get a Logger for a class
Parameters
• clazz: string
| Service
<ServiceParameters
, Events
>
Returns
Logger
Inherited from
Source
packages/core/lib/core.d.ts:501
getMaxListeners()
getMaxListeners():
number
Returns the current max listener value for the EventEmitter
which is either
set by emitter.setMaxListeners(n)
or defaults to defaultMaxListeners.
Returns
number
Inherited from
Since
v1.0.0
Source
packages/shell/node_modules/@types/node/events.d.ts:526
getMetric()
getMetric<
T
>(type
,configuration
):T
Get a metric object
Use the Service.getMetric method if possible
This is map from prometheus 3 types of metrics Our hope is that we can adapt them to export to other metrics system if needed
Type parameters
• T = Gauge
<string
> | Counter
<string
> | Histogram
<string
>
Parameters
• type: Constructor
<T
, [MetricConfiguration
<T
, string
>]>
• configuration: MetricConfiguration
<T
, string
>
Returns
T
Inherited from
Source
packages/core/lib/core.d.ts:731
getModel()
getModel<
T
>(name
):CoreModelDefinition
<T
>
Check for a model name and return the wanted class or throw exception if none found
Type parameters
• T extends CoreModel
= CoreModel
Parameters
• name: any
The model name to retrieve
Returns
CoreModelDefinition
<T
>
Inherited from
Source
packages/core/lib/core.d.ts:560
getModelObject()
getModelObject<
T
>(fullUuid
,partials
?):Promise
<T
>
Get an object from the application based on its full uuid
Type parameters
• T extends CoreModel
= CoreModel
Parameters
• fullUuid: string
• partials?: any
Returns
Promise
<T
>
Inherited from
Source
packages/core/lib/core.d.ts:413
getModelStore()
getModelStore<
T
>(modelOrConstructor
):Store
<T
,StoreParameters
,StoreEvents
>
Get the store assigned to this model
Type parameters
• T extends CoreModel
Parameters
• modelOrConstructor: T
| Constructor
<T
>
Returns
Store
<T
, StoreParameters
, StoreEvents
>
Inherited from
Source
packages/core/lib/core.d.ts:363
getModels()
getModels():
Object
Return a map of defined models
Returns
Object
Inherited from
Source
packages/core/lib/core.d.ts:552
getModules()
getModules():
CachedModule
Retrieve all detected modules definition
Returns
CachedModule
Inherited from
Source
packages/core/lib/core.d.ts:394
getRegistry()
getRegistry():
Store
<any
,StoreParameters
,StoreEvents
>
A registry is a predefined store
Returns
Store
<any
, StoreParameters
, StoreEvents
>
Inherited from
Source
packages/core/lib/core.d.ts:628
getRouter()
getRouter():
Router
Return current Router object
Returns
Router
Inherited from
Source
packages/core/lib/core.d.ts:518
getServerStatus()
getServerStatus():
ServerStatus
Get server status
Returns
Inherited from
Source
packages/shell/src/handlers/http.ts:340
getService()
getService<
T
>(name
?):T
Check for a service name and return the wanted singleton or undefined if none found
Type parameters
• T extends Service
<ServiceParameters
, Events
>
Parameters
• name?: string
The service name to retrieve
Returns
T
Inherited from
Source
packages/core/lib/core.d.ts:524
getServiceParams()
getServiceParams(
service
,configuration
?):any
Get a full resolved service parameter
Parameters
• service: string
• configuration?: Object
• configuration.parameters?: any
• configuration.services?: any
Returns
any
Inherited from
Source
packages/core/lib/core.d.ts:613
getServices()
getServices():
Object
Return a map of defined services
Returns
Object
Inherited from
Source
packages/core/lib/core.d.ts:529
getServicesOfType()
getServicesOfType<
T
>(type
?):Object
Return a map of services that extends type
Type parameters
• T extends Service
<ServiceParameters
, Events
>
Parameters
• type?: Constructor
<T
, [Core
<CoreEvents
>, string
, any
]>
The type of implementation
Returns
Object
Inherited from
Source
packages/core/lib/core.d.ts:537
getStores()
getStores():
Object
Return a map of defined stores
Returns
Object
Inherited from
Source
packages/core/lib/core.d.ts:545
getUuid()
getUuid(
format
?):string
Return a UUID
Parameters
• format?: "ascii"
| "base64"
| "binary"
| "hex"
| "uuid"
to return different type of format Plan to implement base64 and maybe base85
Returns
string
Inherited from
Source
packages/core/lib/core.d.ts:673
getVersion()
getVersion():
string
Return webda current version
Returns
string
package version
Inherited from
Since
0.4.0
Source
packages/core/lib/core.d.ts:490
getWebdaApplication()
getWebdaApplication():
Application
Returns
Application
Source
packages/shell/src/handlers/config.ts:137
getWorkerOutput()
getWorkerOutput():
WorkerOutput
Get WorkerOutput
Returns
WorkerOutput
Inherited from
Source
packages/core/lib/core.d.ts:402
handleRequest()
handleRequest(
req
,res
):Promise
<void
>
Manage the request
Parameters
• req: IncomingMessage
• res: ServerResponse
<IncomingMessage
>
Returns
Promise
<void
>
Inherited from
Source
packages/shell/src/handlers/http.ts:132
init()
init():
Promise
<void
>
Returns
Promise
<void
>
Inherited from
Source
packages/shell/src/handlers/http.ts:273
initService()
protected
initService(service
):Promise
<void
>
Init one service
Parameters
• service: string
Returns
Promise
<void
>
Inherited from
Source
packages/core/lib/core.d.ts:407
initStatics()
initStatics():
void
Init services and Beans along with Routes
Returns
void
Inherited from
Source
packages/core/lib/core.d.ts:643
isDebug()
isDebug():
boolean
Return true if devMode is enabled
Returns
boolean
Inherited from
Source
packages/shell/src/handlers/http.ts:52
isProxyTrusted()
isProxyTrusted(
ip
):boolean
Check if a proxy is a trusted proxy
Parameters
• ip: string
Returns
boolean
Inherited from
Source
packages/shell/src/handlers/http.ts:65
jsonFilter()
protected
jsonFilter(key
,value
):any
Parameters
• key: string
• value: any
Returns
any
Inherited from
Source
packages/core/lib/core.d.ts:638
listOperations()
listOperations():
Object
Get available operations
Returns
Object
Inherited from
Source
packages/core/lib/core.d.ts:449
listenerCount()
listenerCount(
eventName
):number
Returns the number of listeners listening to the event named eventName
.
Parameters
• eventName: string
| symbol
The name of the event being listened for
Returns
number
Inherited from
Since
v3.2.0
Source
packages/shell/node_modules/@types/node/events.d.ts:616
listeners()
listeners(
eventName
):Function
[]
Returns a copy of the array of listeners for the event named eventName
.
server.on('connection', (stream) => {
console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]
Parameters
• eventName: string
| symbol
Returns
Function
[]
Inherited from
Since
v0.1.26
Source
packages/shell/node_modules/@types/node/events.d.ts:539
log()
log(
level
, ...args
):void
Logs
Parameters
• level: WorkerLogLevel
• ...args: any
[]
Returns
void
Inherited from
Source
packages/core/lib/core.d.ts:695
newContext()
newContext<
T
>(info
,noInit
?):Promise
<OperationContext
<any
,any
>>
Get a context based on the info
Type parameters
• T extends OperationContext
<any
, any
>
Parameters
• info: ContextProviderInfo
• noInit?: boolean
Returns
Promise
<OperationContext
<any
, any
>>
Inherited from
Source
packages/core/lib/core.d.ts:649
newWebContext()
newWebContext<
T
>(httpContext
,stream
?,noInit
?):Promise
<T
>
Create a new context for a request
Type parameters
• T extends WebContext
<any
, any
>
Parameters
• httpContext: HttpContext
THe HTTP request context