@@ -19,7 +19,7 @@ interface ICopyFunctionOptions {
1919 newFunctionName : string
2020 targetEnvId : string
2121 force ?: boolean
22- copyConfig ?: boolean ,
22+ copyConfig ?: boolean
2323 codeSecret ?: string
2424}
2525
@@ -70,7 +70,9 @@ export async function deleteFunction({ functionName, envId }): Promise<void> {
7070 Namespace : envId
7171 } )
7272 } catch ( e ) {
73- throw new CloudBaseError ( `[${ functionName } ] 删除操作失败:${ e . message } !` )
73+ throw new CloudBaseError (
74+ `[${ functionName } ] 删除操作失败:${ e . message } !`
75+ )
7476 }
7577}
7678
@@ -210,7 +212,8 @@ export async function updateFunctionConfig(
210212 } ) )
211213
212214 // 当不存在 L5 配置时,不修改 L5 状态,否则根据 true/false 进行修改
213- const l5Enable = typeof config . l5 === 'undefined' ? null : ( config . l5 ? 'TRUE' : 'FALSE' )
215+ const l5Enable =
216+ typeof config . l5 === 'undefined' ? null : config . l5 ? 'TRUE' : 'FALSE'
214217
215218 const params : any = {
216219 FunctionName : functionName ,
@@ -231,6 +234,12 @@ export async function updateFunctionConfig(
231234 VpcId : ( config . vpc && config . vpc . vpcId ) || ''
232235 }
233236
237+ // 自动安装依赖
238+ params . InstallDependency =
239+ typeof config . installDependency === 'undefined'
240+ ? null
241+ : config . installDependency ? 'TRUE' : 'FALSE'
242+
234243 await scfService . request ( 'UpdateFunctionConfiguration' , params )
235244}
236245
@@ -249,7 +258,9 @@ export async function batchUpdateFunctionConfig(
249258 } )
250259 log && successLog ( `[${ func . name } ] 更新云函数配置成功!` )
251260 } catch ( e ) {
252- throw new CloudBaseError ( `${ func . name } 更新配置失败:${ e . message } ` )
261+ throw new CloudBaseError (
262+ `${ func . name } 更新配置失败:${ e . message } `
263+ )
253264 }
254265 } ) ( )
255266 )
@@ -294,7 +305,9 @@ export async function batchInvokeFunctions(options: IFunctionBatchOptions) {
294305 }
295306 return result
296307 } catch ( e ) {
297- throw new CloudBaseError ( `${ func . name } 函数调用失败:${ e . message } ` )
308+ throw new CloudBaseError (
309+ `${ func . name } 函数调用失败:${ e . message } `
310+ )
298311 }
299312 } ) ( )
300313 )
@@ -304,7 +317,14 @@ export async function batchInvokeFunctions(options: IFunctionBatchOptions) {
304317
305318// 复制云函数
306319export async function copyFunction ( options : ICopyFunctionOptions ) {
307- const { envId, functionName, newFunctionName, targetEnvId, force, codeSecret } = options
320+ const {
321+ envId,
322+ functionName,
323+ newFunctionName,
324+ targetEnvId,
325+ force,
326+ codeSecret
327+ } = options
308328
309329 if ( ! envId || ! functionName || ! newFunctionName ) {
310330 throw new CloudBaseError ( '参数缺失' )
0 commit comments