File tree Expand file tree Collapse file tree
apps/sim/tools/rocketlane Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ export const rocketlaneAssignPlaceholdersTool: ToolConfig<
6161 method : 'POST' ,
6262 headers : ( params ) => rocketlaneHeaders ( params . apiKey ) ,
6363 body : ( params ) => {
64+ if ( params . userId == null && ! params . userEmailId ) {
65+ throw new Error ( 'Either a user ID or a user email is required to assign a placeholder' )
66+ }
6467 const user : Record < string , unknown > = { }
6568 if ( params . userId != null ) user . userId = params . userId
6669 if ( params . userEmailId ) user . emailId = params . userEmailId
Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ export const rocketlaneCreateTimeOffTool: ToolConfig<
118118 method : 'POST' ,
119119 headers : ( params ) => rocketlaneHeaders ( params . apiKey ) ,
120120 body : ( params ) => {
121+ if ( params . userId == null && ! params . userEmail ) {
122+ throw new Error ( 'Either a user ID or a user email is required to create a time-off' )
123+ }
121124 const user : Record < string , unknown > = { }
122125 if ( params . userId != null ) user . userId = params . userId
123126 if ( params . userEmail ) user . emailId = params . userEmail
Original file line number Diff line number Diff line change @@ -153,9 +153,9 @@ export const rocketlaneUpdateProjectTool: ToolConfig<
153153 headers : ( params ) => rocketlaneHeaders ( params . apiKey ) ,
154154 body : ( params ) => {
155155 const body : Record < string , unknown > = { }
156- if ( params . projectName ) body . projectName = params . projectName
157- if ( params . startDate ) body . startDate = params . startDate
158- if ( params . dueDate ) body . dueDate = params . dueDate
156+ if ( params . projectName !== undefined ) body . projectName = params . projectName
157+ if ( params . startDate !== undefined ) body . startDate = params . startDate
158+ if ( params . dueDate !== undefined ) body . dueDate = params . dueDate
159159 if ( params . visibility ) body . visibility = params . visibility
160160 const owner : Record < string , unknown > = { }
161161 if ( params . ownerUserId != null ) owner . userId = params . ownerUserId
@@ -168,7 +168,8 @@ export const rocketlaneUpdateProjectTool: ToolConfig<
168168 if ( params . projectFee != null ) body . projectFee = params . projectFee
169169 if ( params . autoAllocation != null ) body . autoAllocation = params . autoAllocation
170170 if ( params . budgetedHours != null ) body . budgetedHours = params . budgetedHours
171- if ( params . externalReferenceId ) body . externalReferenceId = params . externalReferenceId
171+ if ( params . externalReferenceId !== undefined )
172+ body . externalReferenceId = params . externalReferenceId
172173 return body
173174 } ,
174175 } ,
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ export const rocketlaneUpdateTimeEntryTool: ToolConfig<
102102 date : params . date ,
103103 minutes : params . minutes ,
104104 }
105- if ( params . activityName ) body . activityName = params . activityName
106- if ( params . notes ) body . notes = params . notes
105+ if ( params . activityName !== undefined ) body . activityName = params . activityName
106+ if ( params . notes !== undefined ) body . notes = params . notes
107107 if ( params . billable != null ) body . billable = params . billable
108108 if ( params . categoryId != null ) body . category = { categoryId : params . categoryId }
109109 return body
You can’t perform that action at this time.
0 commit comments