Skip to main content

ConfigApplication

@webda/shell • Readme | API


Class: ConfigApplication

Extends​

  • Application

Constructors​

new ConfigApplication(application)​

new ConfigApplication(application): ConfigApplication

Parameters​

• application: Application

Returns​

ConfigApplication

Overrides​

Application.constructor

Source​

packages/shell/src/handlers/config.ts:94

Properties​

_loaded​

protected _loaded: string[]

Contains already loaded modules

Inherited from​

Application._loaded

Source​

packages/core/lib/application.d.ts:472


appModule​

protected appModule: Module

Contains definitions of current application

Inherited from​

Application.appModule

Source​

packages/core/lib/application.d.ts:468


appPath​

readonly appPath: string

Get Application root path

Inherited from​

Application.appPath

Source​

packages/core/lib/application.d.ts:456


baseConfiguration​

protected baseConfiguration: Configuration

Base configuration loaded from webda.config.json

Inherited from​

Application.baseConfiguration

Source​

packages/core/lib/application.d.ts:460


configurationFile​

readonly configurationFile: string

Configuration file

Inherited from​

Application.configurationFile

Source​

packages/core/lib/application.d.ts:522


currentDeployment​

protected currentDeployment: string

Current deployment

Inherited from​

Application.currentDeployment

Source​

packages/core/lib/application.d.ts:464


deployers​

protected deployers: Object

Deployers type registry

Index signature​

[key: string]: any

Inherited from​

Application.deployers

Source​

packages/core/lib/application.d.ts:476


deploymentFile​

deploymentFile: string

Current deployment file

Inherited from​

Application.deploymentFile

Source​

packages/core/lib/application.d.ts:526


flatHierarchy​

protected flatHierarchy: Object

Direct parent of a model

Index signature​

[key: string]: string

Inherited from​

Application.flatHierarchy

Source​

packages/core/lib/application.d.ts:516


graph​

protected graph: ModelsGraph

Models graph

Inherited from​

Application.graph

Source​

packages/core/lib/application.d.ts:494


initTime​

protected initTime: number

When the application got initiated

Inherited from​

Application.initTime

Source​

packages/core/lib/application.d.ts:512


logger​

protected logger: WorkerOutput

Class Logger

Inherited from​

Application.logger

Source​

packages/core/lib/application.d.ts:504


moddas​

protected moddas: Object

Moddas registry

Index signature​

[key: string]: Modda

Inherited from​

Application.moddas

Source​

packages/core/lib/application.d.ts:482


models​

protected models: Object

Models type registry

Index signature​

[key: string]: CoreModelDefinition

Inherited from​

Application.models

Source​

packages/core/lib/application.d.ts:488


plurals​

protected plurals: Object

Models specific plurals

Index signature​

[key: string]: string

Inherited from​

Application.plurals

Source​

packages/core/lib/application.d.ts:498


workspacesPath​

protected workspacesPath: string

Detect if running as workspace

Inherited from​

Application.workspacesPath

Source​

packages/core/lib/application.d.ts:508


active​

static protected active: Application

Current application

Inherited from​

Application.active

Source​

packages/core/lib/application.d.ts:530

Methods​

addDeployer()​

addDeployer(name, model): this

Add a new deployer

Parameters​

• name: string

• model: any

Returns​

this

Inherited from​

Application.addDeployer

Source​

packages/core/lib/application.d.ts:742


addModel()​

addModel(name, model, dynamic?): this

Add a new model

Parameters​

• name: string

• model: any

• dynamic?: boolean

Returns​

this

Inherited from​

Application.addModel

Source​

packages/core/lib/application.d.ts:735


addService()​

addService(name, service): this

Add a new service

Parameters​

• name: string

• service: Modda

Returns​

this

Inherited from​

Application.addService

Source​

packages/core/lib/application.d.ts:624


completeNamespace()​

completeNamespace(name?): string

Return the full name including namespace

In Webda the ServiceType include namespace Webda/Store or Webda/Test This method will make sure the namespace is present, adding it if no '/' is found in the name

Parameters​

• name?: string

Returns​

string

Inherited from​

Application.completeNamespace

Source​

packages/core/lib/application.d.ts:855


getAppPath()​

getAppPath(subpath?): string

Return the current app path

Parameters​

• subpath?: string

to append to

Returns​

string

Inherited from​

Application.getAppPath

Source​

packages/core/lib/application.d.ts:617


getBeans()​

getBeans(): Object

Return all beans of the application

Returns​

Object

Inherited from​

Application.getBeans

Source​

packages/core/lib/application.d.ts:666


getConfiguration()​

getConfiguration(_deploymentName): Configuration

Parameters​

• _deploymentName: string= undefined

Returns​

Configuration

Overrides​

Application.getConfiguration

Source​

packages/shell/src/handlers/config.ts:101


getCurrentConfiguration()​

getCurrentConfiguration(): Configuration

Return current Configuration of the Application

Same as calling

getConfiguration(this.currentDeployment);

Returns​

Configuration

Inherited from​

Application.getCurrentConfiguration

Source​

packages/core/lib/application.d.ts:826


getCurrentDeployment()​

getCurrentDeployment(): string

Get current deployment name

Returns​

string

Inherited from​

Application.getCurrentDeployment

Source​

packages/core/lib/application.d.ts:804


getDeployers()​

getDeployers(): Object

Return all deployers

Returns​

Object

Inherited from​

Application.getDeployers

Source​

packages/core/lib/application.d.ts:726


getFullNameFromPrototype()​

getFullNameFromPrototype(proto): string

Parameters​

• proto: any

Prototype to send

Returns​

string

Inherited from​

Application.getFullNameFromPrototype

Source​

packages/core/lib/application.d.ts:552


getGitInformation()​

getGitInformation(_packageName?, _version?): GitInformation

Retrieve Git Repository information

GitInformation for more details on how the information is gathered

Parameters​

• _packageName?: string

• _version?: string

Returns​

GitInformation

the git information

Inherited from​

Application.getGitInformation

Source​

packages/core/lib/application.d.ts:756


getGraph()​

getGraph(): ModelsGraph

Get the all graph

Returns​

ModelsGraph

Inherited from​

Application.getGraph

Source​

packages/core/lib/application.d.ts:582


getModda()​

getModda(name): ServiceConstructor<Service<ServiceParameters, Events>>

Parameters​

• name: string

Returns​

ServiceConstructor<Service<ServiceParameters, Events>>

Overrides​

Application.getModda

Source​

packages/shell/src/handlers/config.ts:87


getModdas()​

getModdas(): Object

Return all services of the application

Returns​

Object

Inherited from​

Application.getModdas

Source​

packages/core/lib/application.d.ts:660


getModel()​

getModel(model): any

Parameters​

• model: string

Returns​

any

Overrides​

Application.getModel

Source​

packages/shell/src/handlers/config.ts:78


getModelFromConstructor()​

getModelFromConstructor(model): string

Return the model name for a object

Parameters​

• model: Constructor<CoreModel>

Returns​

string

Inherited from​

Application.getModelFromConstructor

Source​

packages/core/lib/application.d.ts:701


getModelFromInstance()​

getModelFromInstance(object): string

Return the model name for a object

Parameters​

• object: CoreModel

Returns​

string

Inherited from​

Application.getModelFromInstance

Source​

packages/core/lib/application.d.ts:696


getModelHierarchy()​

getModelHierarchy(model): Object

Get the model hierarchy

Parameters​

• model: string | CoreModel | Constructor<CoreModel>

Returns​

Object

ancestors​

ancestors: string[]

children​

children: ModelsTree

Inherited from​

Application.getModelHierarchy

Source​

packages/core/lib/application.d.ts:713


getModelName()​

getModelName(model): string

Get the model name from a model or a constructor

Parameters​

• model: CoreModel | Constructor<CoreModel>

Returns​

string

longId for a model

Inherited from​

Application.getModelName

Source​

packages/core/lib/application.d.ts:708


getModelPlural()​

getModelPlural(name): string

Get plural of an Id

Parameters​

• name: string

Returns​

string

Inherited from​

Application.getModelPlural

Source​

packages/core/lib/application.d.ts:636


getModelTypes()​

getModelTypes(model): string[]

Get all model types with the hierarchy

Parameters​

• model: CoreModel

Returns​

string[]

Inherited from​

Application.getModelTypes

Source​

packages/core/lib/application.d.ts:722


getModels()​

getModels(): Object

Get all models definitions

Returns​

Object

Inherited from​

Application.getModels

Source​

packages/core/lib/application.d.ts:678


getModules()​

getModules(): CachedModule

Return all application modules merged as one

Used when deployed

Returns​

CachedModule

Inherited from​

Application.getModules

Source​

packages/core/lib/application.d.ts:811


getNamespace()​

getNamespace(): string

Return current namespace

Returns​

string

Inherited from​

Application.getNamespace

Source​

packages/core/lib/application.d.ts:860


getPackageDescription()​

getPackageDescription(): PackageDescriptor

Retrieve content of package.json

Returns​

PackageDescriptor

Inherited from​

Application.getPackageDescription

Source​

packages/core/lib/application.d.ts:600


getPackageWebda()​

getPackageWebda(): WebdaPackageDescriptor

Retrieve specific webda conf from package.json

In case of workspaces the object is combined

Returns​

WebdaPackageDescriptor

Inherited from​

Application.getPackageWebda

Source​

packages/core/lib/application.d.ts:596


getRelations()​

getRelations(model): ModelGraph

Get model graph

Parameters​

• model: string | CoreModel | Constructor<CoreModel>

Returns​

ModelGraph

Inherited from​

Application.getRelations

Source​

packages/core/lib/application.d.ts:577


getRootExposedModels()​

getRootExposedModels(): string[]

Return models that do not have parents and are exposed Or specifically set as root via the Expose.root parameter

Returns​

string[]

Inherited from​

Application.getRootExposedModels

Source​

packages/core/lib/application.d.ts:691


getRootModels()​

getRootModels(): string[]

Return models that do not have parents

Returns​

string[]

Inherited from​

Application.getRootModels

Source​

packages/core/lib/application.d.ts:685


getSchema()​

getSchema(type): JSONSchema7

Get a schema from a type

Schema should be precomputed in the default app

Parameters​

• type: string

Returns​

JSONSchema7

Inherited from​

Application.getSchema

Source​

packages/core/lib/application.d.ts:560


getSchemas()​

getSchemas(): Object

Get schemas

Returns​

Object

Inherited from​

Application.getSchemas

Source​

packages/core/lib/application.d.ts:565


getShortId()​

getShortId(name): string

Get short id for a name

Parameters​

• name: string

if name is shortId return longId else return shortId

Returns​

string

Inherited from​

Application.getShortId

Source​

packages/core/lib/application.d.ts:866


getWebdaObject()​

getWebdaObject(section, name, caseSensitive?): any

Parameters​

• section: Section

• name: string

• caseSensitive?: boolean

Returns​

any

Inherited from​

Application.getWebdaObject

Source​

packages/core/lib/application.d.ts:650


getWebdaVersion()​

getWebdaVersion(): string

Return webda current version

Returns​

string

package version

Inherited from​

Application.getWebdaVersion

Since​

0.4.0

Source​

packages/core/lib/application.d.ts:749


getWorkerOutput()​

getWorkerOutput(): WorkerOutput

Get current logger

Returns​

WorkerOutput

Inherited from​

Application.getWorkerOutput

Source​

packages/core/lib/application.d.ts:611


hasSchema()​

hasSchema(type): boolean

Check if a schema exists

Parameters​

• type: string

Returns​

boolean

schema name if it exists

Inherited from​

Application.hasSchema

Source​

packages/core/lib/application.d.ts:573


hasWebdaObject()​

hasWebdaObject(section, name, caseSensitive?): boolean

Parameters​

• section: Section

• name: string

• caseSensitive?: boolean

Returns​

boolean

Inherited from​

Application.hasWebdaObject

Source​

packages/core/lib/application.d.ts:643


importFile()​

importFile(info, withExport?): Promise<any>

Import a file

If the default is set take this or use old format

Parameters​

• info: string

• withExport?: boolean

Returns​

Promise<any>

Inherited from​

Application.importFile

Source​

packages/core/lib/application.d.ts:834


isCached()​

isCached(): boolean

Check if application has cached modules

When deployed the application contains cachedModules in the webda.config.json It allows to avoid the search for webda.module.json inside node_modules and take the schema from the cached modules also

Returns​

boolean

Inherited from​

Application.isCached

Source​

packages/core/lib/application.d.ts:590


load()​

load(): Promise<ConfigApplication>

Import all required modules

Returns​

Promise<ConfigApplication>

Inherited from​

Application.load

Source​

packages/core/lib/application.d.ts:540


loadConfiguration()​

loadConfiguration(file): void

Allow subclass to implement migration

Parameters​

• file: string

Returns​

void

Inherited from​

Application.loadConfiguration

Source​

packages/core/lib/application.d.ts:547


loadLocalModule()​

loadLocalModule(): Promise<void>

Load local module

Returns​

Promise<void>

Inherited from​

Application.loadLocalModule

Source​

packages/core/lib/application.d.ts:838


log()​

log(level, ...args): void

Log information

Parameters​

• level: WorkerLogLevel

to log for

• ...args: any[]

anything to display same as console.log

Returns​

void

Inherited from​

Application.log

Source​

packages/core/lib/application.d.ts:607


registerSchema()​

registerSchema(name, schema): void

Register a new schema in the application

Parameters​

• name: string

• schema: JSONSchema7

Returns​

void

Inherited from​

Application.registerSchema

Source​

packages/core/lib/application.d.ts:630


replaceVariables()​

replaceVariables(object, replacements?): any

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

• replacements?: any

additional replacements to run

Returns​

any

Inherited from​

Application.replaceVariables

Source​

packages/core/lib/application.d.ts:800


stringParameter()​

protected stringParameter(templateString, replacements?): any

Allow variable inside of string

Parameters​

• templateString: string

to copy

• replacements?: any

additional replacements to run

Returns​

any

Inherited from​

Application.stringParameter

Source​

packages/core/lib/application.d.ts:763