@@ -3,7 +3,7 @@ import { ActionType } from './apis';
3
3
import { RegionType , ApiServiceType , CapiCredentials } from './../interface' ;
4
4
import { Capi } from '@tencent-sdk/capi' ;
5
5
import { ApiTypeError } from '../../utils/error' ;
6
- import { deepClone , formatInputTags , strip } from '../../utils' ;
6
+ import { deepClone , strip } from '../../utils' ;
7
7
import TagsUtils from '../tag/index' ;
8
8
import ApigwUtils from '../apigw' ;
9
9
import CONFIGS from './config' ;
@@ -260,7 +260,7 @@ export default class Scf {
260
260
namespace : funcInfo . Namespace ,
261
261
functionName : funcInfo . FunctionName ,
262
262
...trigger ,
263
- tags : formatInputTags ( tags ) ,
263
+ tags : this . tagClient . formatInputTags ( tags ) ,
264
264
} ,
265
265
} ) ;
266
266
@@ -371,9 +371,10 @@ export default class Scf {
371
371
}
372
372
373
373
// create/update tags
374
- if ( inputs . tags ) {
374
+ const tags = this . tagClient . formatInputTags ( inputs ?. tags as any ) ;
375
+ if ( tags ) {
375
376
const deployedTags = await this . tagClient . deployResourceTags ( {
376
- tags : Object . entries ( inputs . tags ) . map ( ( [ TagKey , TagValue ] ) => ( { TagKey, TagValue } ) ) ,
377
+ tags : tags . map ( ( { key , value } ) => ( { TagKey : key , TagValue : value } ) ) ,
377
378
resourceId : `${ funcInfo ! . Namespace } /function/${ funcInfo ! . FunctionName } ` ,
378
379
serviceType : ApiServiceType . scf ,
379
380
resourcePrefix : 'namespace' ,
@@ -461,7 +462,7 @@ export default class Scf {
461
462
}
462
463
463
464
checkAddedYunTiTags ( tags : Array < { [ key : string ] : string } > ) : boolean {
464
- const formatTags = formatInputTags ( tags ) ;
465
+ const formatTags = this . tagClient . formatInputTags ( tags ) ;
465
466
const result =
466
467
formatTags ?. length > 0 &&
467
468
[ '运营部门' , '运营产品' , '负责人' ] . every ( ( tagKey ) =>
0 commit comments