Class Application
Hierarchy
- Application
Constructors
Properties
Methods
Object literals
Constructors
-
Parameters
-
file: string
-
Default value logger: WorkerOutput = undefined
Returns Application
-
Properties
Contains already loaded modules
Get Application root path
Base configuration loaded from webda.config.json
Flag if application has been compiled already
Current deployment
Deployers type registry
Type declaration
-
[key: string]: any
When the application got initiated
Class Logger
Webda namespace
Contains package.json of application
Contains webda section of package.json and workspaces if exist
Detect if running as workspace
Methods
-
Parameters
-
name: string
-
model: any
Returns void
-
-
Parameters
-
name: string
-
model: any
Returns void
-
-
Parameters
-
name: string
-
service: ServiceConstructor<Service>
Returns void
-
-
Compile the application if it is a Typescript application Do nothing otherwise
Returns void
-
Return the full name including namespace
In Webda the ServiceType include namespace
Webda/Store
orWebda/Test
This method will make sure the namespace is present, adding it if no '/' is found in the nameParameters
-
Default value name: string = ""
Returns string
-
-
Parameters
-
obj: any
-
className: any
Returns boolean
-
-
Returns void
-
Parameters
-
Default value subpath: string = undefined
Returns string
-
-
Return the application Configuration for a deployment
Given this inputs:
webda.config.json
{ "parameters": { "param3": "test" }, "services": { "MyService": { "param1": { "sub": "test" }, "param2": "value" } } }
deployment.json
{ "parameters": { "param4": "deployment" } "services": { "MyService": { "param1": { "sub2": "deploymentSub" }, "param2": "${package.version}" } } }
The result would be:
{ "parameters": { "param3": "test", "param4": "deployment" }, "services": { "MyService": { "param1": { "sub": "test", "sub2": "deploymentSub" }, "param2": "1.1.0" } } }
This map can also use parameters replaceVariables
Parameters
-
Default value deploymentName: string = undefined
to use for the Configuration
Returns Configuration
-
-
Return current Configuration of the Application
Same as calling
getConfiguration(this.currentDeployment);
Returns Configuration
-
Get current deployment name
Returns string
-
Returns object
-
[key: string]: ServiceConstructor<Service>
-
-
Parameters
-
Default value deploymentName: string = undefined
Returns Deployment
-
-
Retrieve Git Repository information
GitInformation for more details on how the information is gathered
Returns GitInformation
the git information
-
Retrieve the model implementation
Parameters
-
name: string
model to retrieve
Returns any
-
-
Get all models definitions
Returns object
-
[key: string]: Context | CoreModelDefinition
-
-
Returns CachedModule
-
Retrieve content of package.json
Returns any
-
Retrieve specific webda conf from package.json
In case of workspaces the object is combined
Returns any
-
Get the application files
Returns string[]
-
Parameters
-
name: any
Returns ServiceConstructor<Service<ServiceParameters>>
-
-
Returns object
-
[key: string]: ServiceConstructor<Service>
-
-
Return webda current version
Returns string
package version
-
Returns WorkerOutput
-
Parameters
-
deploymentName: string
Returns boolean
-
-
Return if the application is a typescript application
Returns boolean
-
Load a javascript file and check for Modda
Parameters
-
absolutePath: string
Returns void
-
-
Returns void
-
Load all imported modules and current module It will compile module Generate the current module file Load any imported webda.module.json
Returns void
-
Check package.json
Returns void
-
Parameters
-
level: WorkerLogLevel
-
Rest ...args: any[]
Returns void
-
-
Migrate from v0 to v1 configuration
A V0 is a webda.config.json that does not contain any version tag
Parameters
-
config: any
Returns Configuration
-
-
Migrate from v1 to v2 configuration format
Parameters
-
config: ConfigurationV1
Returns Configuration
-
-
Set the status of the compilation
Parameters
-
compile: boolean
true will avoid trigger new compilation
Returns void
-
-
Allow variable inside object strings
Example
replaceVariables({ myobj: "${test.replace}" }, { test: { replace: 'plop' } })
will return
{ myobj: 'plop' }
By default the replacements map contains
{ git: GitInformation, package: 'package.json content', deployment: string, now: number, ...replacements }
See: GitInformation
Parameters
-
object: any
a duplicated object with replacement done
-
Default value replacements: any = {}
additional replacements to run
Returns any
-
-
Parameters
-
info: string
Returns any
-
-
Set the current deployment for the application Call to getCurrentConfiguration will resolve to the computed configuration for the deployment If needed, you can call the method with undefined to reset to default configuration
Parameters
-
deployment: string
to set
Returns void
-
-
Allow variable inside of string
Parameters
-
templateString: string
to copy
-
Default value replacements: any = {}
additional replacements to run
Returns any
-
Object literals
Contains definitions of current application
Type declaration
Type declaration
Type declaration
Contains all definitions from imported modules and current code
Type declaration
Type declaration
Type declaration
Models type registry
Services type registry
Generated using TypeDoc
Map a Webda Application
It allows to: