@@ -22,7 +22,7 @@ const generateId = () =>
22
22
. substring ( 6 )
23
23
24
24
const getCodeZipPath = async ( instance , inputs ) => {
25
- console . log ( `Packaging ${ CONFIGS . frameworkFullname } application...` )
25
+ console . log ( `Packaging ${ CONFIGS . compFullname } application...` )
26
26
27
27
// unzip source zip file
28
28
let zipPath
@@ -31,7 +31,7 @@ const getCodeZipPath = async (instance, inputs) => {
31
31
const downloadPath = `/tmp/${ generateId ( ) } `
32
32
const filename = 'template'
33
33
34
- console . log ( `Installing Default ${ CONFIGS . frameworkFullname } App...` )
34
+ console . log ( `Installing Default ${ CONFIGS . compFullname } App...` )
35
35
await download ( CONFIGS . templateUrl , downloadPath , {
36
36
filename : `${ filename } .zip`
37
37
} )
@@ -175,7 +175,7 @@ const deleteRecord = (newRecords, historyRcords) => {
175
175
const prepareInputs = async ( instance , credentials , inputs = { } ) => {
176
176
// 对function inputs进行标准化
177
177
const tempFunctionConf = inputs . functionConf ? inputs . functionConf : { }
178
- const fromClientRemark = `tencent-${ CONFIGS . framework } `
178
+ const fromClientRemark = `tencent-${ CONFIGS . compName } `
179
179
const regionList = inputs . region
180
180
? typeof inputs . region == 'string'
181
181
? [ inputs . region ]
@@ -197,7 +197,7 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
197
197
name :
198
198
ensureString ( inputs . functionName , { isOptional : true } ) ||
199
199
stateFunctionName ||
200
- `${ CONFIGS . framework } _component_${ generateId ( ) } ` ,
200
+ `${ CONFIGS . compName } _component_${ generateId ( ) } ` ,
201
201
region : regionList ,
202
202
handler : ensureString ( tempFunctionConf . handler ? tempFunctionConf . handler : inputs . handler , {
203
203
default : CONFIGS . handler
@@ -254,7 +254,7 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
254
254
apigatewayConf . fromClientRemark = fromClientRemark
255
255
apigatewayConf . serviceName = inputs . serviceName
256
256
apigatewayConf . description = `Serverless Framework Tencent-${ capitalString (
257
- CONFIGS . framework
257
+ CONFIGS . compName
258
258
) } Component`
259
259
apigatewayConf . serviceId = inputs . serviceId || stateServiceId
260
260
apigatewayConf . region = functionConf . region
@@ -272,6 +272,20 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
272
272
}
273
273
}
274
274
]
275
+ if ( apigatewayConf . usagePlan ) {
276
+ apigatewayConf . endpoints [ 0 ] . usagePlan = {
277
+ usagePlanId : apigatewayConf . usagePlan . usagePlanId ,
278
+ usagePlanName : apigatewayConf . usagePlan . usagePlanName ,
279
+ usagePlanDesc : apigatewayConf . usagePlan . usagePlanDesc ,
280
+ maxRequestNum : apigatewayConf . usagePlan . maxRequestNum
281
+ }
282
+ }
283
+ if ( apigatewayConf . auth ) {
284
+ apigatewayConf . endpoints [ 0 ] . auth = {
285
+ secretName : apigatewayConf . auth . secretName ,
286
+ secretIds : apigatewayConf . auth . secretIds
287
+ }
288
+ }
275
289
276
290
// 对cns inputs进行标准化
277
291
const tempCnsConf = { }
0 commit comments