@@ -15,7 +15,9 @@ export class InstanceLevelCICDVariables<C extends boolean = false> extends BaseR
1515 all < E extends boolean = false > (
1616 options ?: Sudo & ShowExpanded < E > ,
1717 ) : Promise < GitlabAPIResponse < CICDVariableSchema [ ] , C , E , void > > {
18- return RequestHelper . get < CICDVariableSchema [ ] > ( ) ( this , 'admin/ci/variables' , options ) ;
18+ const { sudo, showExpanded } = options || { } ;
19+
20+ return RequestHelper . get < CICDVariableSchema [ ] > ( ) ( this , 'admin/ci/variables' , { sudo, showExpanded } ) ;
1921 }
2022
2123 create < E extends boolean = false > (
@@ -29,10 +31,12 @@ export class InstanceLevelCICDVariables<C extends boolean = false> extends BaseR
2931 } & Sudo &
3032 ShowExpanded < E > ,
3133 ) : Promise < GitlabAPIResponse < CICDVariableSchema , C , E , void > > {
34+ const { sudo, showExpanded, ...body } = options || { } ;
35+
3236 return RequestHelper . post < CICDVariableSchema > ( ) ( this , 'admin/ci/variables' , {
33- key ,
34- value ,
35- ...options ,
37+ sudo ,
38+ showExpanded ,
39+ body : { ...body , key , value } ,
3640 } ) ;
3741 }
3842
@@ -47,27 +51,34 @@ export class InstanceLevelCICDVariables<C extends boolean = false> extends BaseR
4751 } & Sudo &
4852 ShowExpanded < E > ,
4953 ) : Promise < GitlabAPIResponse < CICDVariableSchema , C , E , void > > {
54+ const { sudo, showExpanded, ...body } = options || { } ;
55+
5056 return RequestHelper . put < CICDVariableSchema > ( ) ( this , endpoint `admin/ci/variables/${ keyId } ` , {
51- value,
52- ...options ,
57+ sudo,
58+ showExpanded,
59+ body : { ...body , value } ,
5360 } ) ;
5461 }
5562
5663 show < E extends boolean = false > (
5764 keyId : string ,
5865 options ?: Sudo & ShowExpanded < E > ,
5966 ) : Promise < GitlabAPIResponse < CICDVariableSchema , C , E , void > > {
67+ const { sudo, showExpanded } = options || { } ;
68+
6069 return RequestHelper . get < CICDVariableSchema > ( ) (
6170 this ,
6271 endpoint `admin/ci/variables/${ keyId } ` ,
63- options ,
72+ { sudo , showExpanded } ,
6473 ) ;
6574 }
6675
6776 remove < E extends boolean = false > (
6877 keyId : string ,
6978 options ?: Sudo & ShowExpanded < E > ,
7079 ) : Promise < GitlabAPIResponse < void , C , E , void > > {
71- return RequestHelper . get < void > ( ) ( this , endpoint `admin/ci/variables/${ keyId } ` , options ) ;
80+ const { sudo, showExpanded } = options || { } ;
81+
82+ return RequestHelper . del < void > ( ) ( this , endpoint `admin/ci/variables/${ keyId } ` , { sudo, showExpanded } ) ;
7283 }
7384}
0 commit comments