File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,10 @@ export const InfisicalBlock: BlockConfig<InfisicalResponse> = {
178178 break
179179 case 'get_secret' :
180180 result . secretName = params . secretName
181- if ( params . secretVersion ) result . version = Number ( params . secretVersion )
181+ if ( params . secretVersion ) {
182+ const v = Number ( params . secretVersion )
183+ if ( ! Number . isNaN ( v ) ) result . version = v
184+ }
182185 break
183186 case 'create_secret' :
184187 result . secretName = params . secretName
@@ -188,7 +191,7 @@ export const InfisicalBlock: BlockConfig<InfisicalResponse> = {
188191 break
189192 case 'update_secret' :
190193 result . secretName = params . secretName
191- if ( params . updateSecretValue != null ) result . secretValue = params . updateSecretValue
194+ if ( params . updateSecretValue ) result . secretValue = params . updateSecretValue
192195 if ( params . secretComment != null ) result . secretComment = params . secretComment
193196 if ( params . newSecretName ) result . newSecretName = params . newSecretName
194197 if ( params . tagIds ) result . tagIds = params . tagIds
Original file line number Diff line number Diff line change @@ -61,21 +61,18 @@ export const deleteSecretTool: ToolConfig<
6161
6262 request : {
6363 method : 'DELETE' ,
64- url : ( params ) =>
65- `${ params . baseUrl ?. replace ( / \/ + $ / , '' ) ?? 'https://us.infisical.com' } /api/v4/secrets/${ encodeURIComponent ( params . secretName . trim ( ) ) } ` ,
64+ url : ( params ) => {
65+ const searchParams = new URLSearchParams ( )
66+ searchParams . set ( 'projectId' , params . projectId )
67+ searchParams . set ( 'environment' , params . environment )
68+ if ( params . secretPath ) searchParams . set ( 'secretPath' , params . secretPath )
69+ if ( params . type ) searchParams . set ( 'type' , params . type )
70+ const base = params . baseUrl ?. replace ( / \/ + $ / , '' ) ?? 'https://us.infisical.com'
71+ return `${ base } /api/v4/secrets/${ encodeURIComponent ( params . secretName . trim ( ) ) } ?${ searchParams . toString ( ) } `
72+ } ,
6673 headers : ( params ) => ( {
67- 'Content-Type' : 'application/json' ,
6874 Authorization : `Bearer ${ params . apiKey } ` ,
6975 } ) ,
70- body : ( params ) => {
71- const body : Record < string , unknown > = {
72- projectId : params . projectId ,
73- environment : params . environment ,
74- }
75- if ( params . secretPath ) body . secretPath = params . secretPath
76- if ( params . type ) body . type = params . type
77- return body
78- } ,
7976 } ,
8077
8178 transformResponse : async ( response ) => {
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export const updateSecretTool: ToolConfig<
9696 projectId : params . projectId ,
9797 environment : params . environment ,
9898 }
99- if ( params . secretValue != null ) body . secretValue = params . secretValue
99+ if ( params . secretValue ) body . secretValue = params . secretValue
100100 if ( params . secretPath ) body . secretPath = params . secretPath
101101 if ( params . secretComment != null ) body . secretComment = params . secretComment
102102 if ( params . newSecretName ) body . newSecretName = params . newSecretName
You can’t perform that action at this time.
0 commit comments