application
@listenai/lisa_core / Exports / Application
Class: Application
#
Table of contents#
Constructors#
Properties- _apiHost
- _apiPrefix
- _cacheDir
- _context
- _lisaAccessToken
- _logPath
- _lpmRegistryUrl
- _lscloudPersonalToken
- argv
- description
- download_path
- errors
- firmwareConfiguration
- flashLpkPath
- hardwareConfiguration
- packageJSON
- pipeline
- root
- task_path
- tasks
- template_path
- version
#
Accessors#
Methods- addContext
- addGlobalContext
- configuration
- env
- errorLog
- getContextFromPackageName
- gitignore
- log
- logReport
- validateConfig
#
Constructors#
constructor• new Application()
#
Properties#
_apiHost• Private
Optional
_apiHost: string
lisa server api host
#
Defined in#
_apiPrefix• Private
Optional
_apiPrefix: string
lisa server api prefix
#
Defined in#
_cacheDir• Private
Optional
_cacheDir: string
lisa cache 缓存目录
#
Defined in#
_context• Private
_context: any
= {}
自定义参数
#
Defined in#
_lisaAccessToken• Private
Optional
_lisaAccessToken: string
lisa accessToken
#
Defined in#
_logPath• Private
Optional
_logPath: string
log 路径
#
Defined in#
_lpmRegistryUrl• Private
Optional
_lpmRegistryUrl: string
lpm registry url
#
Defined in#
_lscloudPersonalToken• Private
Optional
_lscloudPersonalToken: string
lscloud personalToken
#
Defined in#
argv• argv: string
[] = []
执行命令的参数
#
Defined in#
description• description: string
= "CSK 项目"
项目说明
#
Defined in#
download_path• download_path: string
download 目录
#
Defined in#
errors• errors: ValidationError
[] = []
验证错误信息
#
Defined in#
firmwareConfiguration• firmwareConfiguration: any
= {}
固件配置
#
Defined in#
flashLpkPath• flashLpkPath: string
烧录的lpk包地址
#
Defined in#
hardwareConfiguration• hardwareConfiguration: any
= {}
pin脚设置
#
Defined in#
packageJSON• packageJSON: any
= null
package.json 信息
#
Defined in#
pipeline• pipeline: Pipeline
创建项目时的参数
#
Defined in#
root• root: string
项目主目录
#
Defined in#
task_path• Optional
task_path: string
task 文件地址
#
Defined in#
tasks• tasks: Object
= {}
#
Index signature▪ [key: string
]: TaskObject
#
Defined in#
template_path• template_path: string
template 目录
#
Defined in#
version• version: string
= "1.0.0"
设置版本号,要求为三位表达式, eg: 1.0.0
#
Defined in#
Accessors#
apiHost• get
apiHost(): string
#
Returnsstring
#
Defined in• set
apiHost(url
): void
#
ParametersName | Type |
---|---|
url | string |
#
Returnsvoid
#
Defined in#
apiPrefix• get
apiPrefix(): string
#
Returnsstring
#
Defined in• set
apiPrefix(url
): void
#
ParametersName | Type |
---|---|
url | string |
#
Returnsvoid
#
Defined in#
cacheDir• get
cacheDir(): string
#
Returnsstring
#
Defined in• set
cacheDir(url
): void
#
ParametersName | Type |
---|---|
url | string |
#
Returnsvoid
#
Defined in#
context• get
context(): any
#
Returnsany
#
Defined in#
lisaAccessToken• get
lisaAccessToken(): string
#
Returnsstring
#
Defined in• set
lisaAccessToken(token
): void
#
ParametersName | Type |
---|---|
token | string |
#
Returnsvoid
#
Defined in#
logPath• get
logPath(): string
#
Returnsstring
#
Defined in• set
logPath(url
): void
#
ParametersName | Type |
---|---|
url | string |
#
Returnsvoid
#
Defined in#
lpmRegistryUrl• get
lpmRegistryUrl(): string
#
Returnsstring
#
Defined in• set
lpmRegistryUrl(url
): void
#
ParametersName | Type |
---|---|
url | string |
#
Returnsvoid
#
Defined in#
lscloudPersonalToken• get
lscloudPersonalToken(): string
#
Returnsstring
#
Defined in• set
lscloudPersonalToken(token
): void
#
ParametersName | Type |
---|---|
token | string |
#
Returnsvoid
#
Defined in#
Methods#
addContext▸ addContext(packageName
, context
): void
添加指定包的自定义参数
#
ParametersName | Type | Description |
---|---|---|
packageName | string | lisa lib包名 |
context | Object | 自定义参数 |
#
Returnsvoid
#
Defined in#
addGlobalContext▸ addGlobalContext(context
): void
添加全局的自定义参数
#
ParametersName | Type | Description |
---|---|---|
context | Object | 自定义参数 |
#
Returnsvoid
#
Defined in#
configuration▸ configuration(callback
): void
程序设置
#
ParametersName | Type |
---|---|
callback | ConfigFunc |
#
Returnsvoid
#
Defined in#
env▸ env(): LisaEnv
获取 Lisa 在某个环境中使用, 不可以通过代码设置,仅允许通过环境变量 LISA_ENV 来设置 可选参数 dev prod test 默认是 dev,不用做多修改,允许测试的时候请你使用
npm run build && LISA_ENV=test jest --coverage
#
Returns#
Defined in#
errorLog▸ errorLog(stderr
): void
log stderr 输出
#
ParametersName | Type | Description |
---|---|---|
stderr | string | 输出内容 |
#
Returnsvoid
#
Defined in#
getContextFromPackageName▸ getContextFromPackageName(packaegName
): any
获取包名下面的Context属性
#
ParametersName | Type | Description |
---|---|---|
packaegName | string | 包名 |
#
Returnsany
#
Defined in#
gitignore▸ gitignore(path
, args
): void
gitignore 设置git忽略的目录文件
#
ParametersName | Type | Description |
---|---|---|
path | string | .gitignore 路径 |
args | string [] | 要忽略的目录文件 |
#
Returnsvoid
#
Defined in#
log▸ log(stdout
): void
log stdout 输出
#
ParametersName | Type | Description |
---|---|---|
stdout | string | 输出内容 |
#
Returnsvoid
#
Defined in#
logReport▸ logReport(options
): Promise
<void
>
上报到日志服务
#
ParametersName | Type | Description |
---|---|---|
options | Object | Object 需要上报的内容 |
options.cid? | string | number | - |
options.company_id? | string | number | - |
options.content? | string | - |
options.csk_commit? | string | number | - |
options.project_name? | string | - |
options.res? | null | string | - |
options.type | string | - |
options.user_id? | string | number | - |
options.version? | string | - |
#
ReturnsPromise
<void
>
#
Defined in#
validateConfig▸ validateConfig(): Promise
<boolean
>
#
ReturnsPromise
<boolean
>