Skip to content

Commit b203328

Browse files
committed
fix null fields
1 parent 4b6414f commit b203328

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

apps/sim/tools/google_calendar/create.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ export const createV2Tool: ToolConfig<GoogleCalendarCreateParams, GoogleCalendar
227227
id: data.id,
228228
htmlLink: data.htmlLink,
229229
status: data.status,
230-
summary: data.summary,
231-
description: data.description,
232-
location: data.location,
230+
summary: data.summary ?? null,
231+
description: data.description ?? null,
232+
location: data.location ?? null,
233233
start: data.start,
234234
end: data.end,
235-
attendees: data.attendees,
235+
attendees: data.attendees ?? null,
236236
creator: data.creator,
237237
organizer: data.organizer,
238238
},
@@ -242,12 +242,12 @@ export const createV2Tool: ToolConfig<GoogleCalendarCreateParams, GoogleCalendar
242242
id: { type: 'string', description: 'Event ID' },
243243
htmlLink: { type: 'string', description: 'Event link' },
244244
status: { type: 'string', description: 'Event status' },
245-
summary: { type: 'string', description: 'Event title' },
246-
description: { type: 'string', description: 'Event description' },
247-
location: { type: 'string', description: 'Event location' },
245+
summary: { type: 'string', description: 'Event title', optional: true },
246+
description: { type: 'string', description: 'Event description', optional: true },
247+
location: { type: 'string', description: 'Event location', optional: true },
248248
start: { type: 'json', description: 'Event start' },
249249
end: { type: 'json', description: 'Event end' },
250-
attendees: { type: 'json', description: 'Event attendees' },
250+
attendees: { type: 'json', description: 'Event attendees', optional: true },
251251
creator: { type: 'json', description: 'Event creator' },
252252
organizer: { type: 'json', description: 'Event organizer' },
253253
},

apps/sim/tools/google_calendar/get.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ export const getV2Tool: ToolConfig<GoogleCalendarGetParams, GoogleCalendarGetV2R
117117
id: data.id,
118118
htmlLink: data.htmlLink,
119119
status: data.status,
120-
summary: data.summary,
121-
description: data.description,
122-
location: data.location,
120+
summary: data.summary ?? null,
121+
description: data.description ?? null,
122+
location: data.location ?? null,
123123
start: data.start,
124124
end: data.end,
125-
attendees: data.attendees,
125+
attendees: data.attendees ?? null,
126126
creator: data.creator,
127127
organizer: data.organizer,
128128
},
@@ -132,12 +132,12 @@ export const getV2Tool: ToolConfig<GoogleCalendarGetParams, GoogleCalendarGetV2R
132132
id: { type: 'string', description: 'Event ID' },
133133
htmlLink: { type: 'string', description: 'Event link' },
134134
status: { type: 'string', description: 'Event status' },
135-
summary: { type: 'string', description: 'Event title' },
136-
description: { type: 'string', description: 'Event description' },
137-
location: { type: 'string', description: 'Event location' },
135+
summary: { type: 'string', description: 'Event title', optional: true },
136+
description: { type: 'string', description: 'Event description', optional: true },
137+
location: { type: 'string', description: 'Event location', optional: true },
138138
start: { type: 'json', description: 'Event start' },
139139
end: { type: 'json', description: 'Event end' },
140-
attendees: { type: 'json', description: 'Event attendees' },
140+
attendees: { type: 'json', description: 'Event attendees', optional: true },
141141
creator: { type: 'json', description: 'Event creator' },
142142
organizer: { type: 'json', description: 'Event organizer' },
143143
},

apps/sim/tools/google_calendar/invite.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@ export const inviteV2Tool: ToolConfig<GoogleCalendarInviteParams, GoogleCalendar
387387
id: data.id,
388388
htmlLink: data.htmlLink,
389389
status: data.status,
390-
summary: data.summary,
391-
description: data.description,
392-
location: data.location,
390+
summary: data.summary ?? null,
391+
description: data.description ?? null,
392+
location: data.location ?? null,
393393
start: data.start,
394394
end: data.end,
395-
attendees: data.attendees,
395+
attendees: data.attendees ?? null,
396396
creator: data.creator,
397397
organizer: data.organizer,
398398
},
@@ -402,12 +402,12 @@ export const inviteV2Tool: ToolConfig<GoogleCalendarInviteParams, GoogleCalendar
402402
id: { type: 'string', description: 'Event ID' },
403403
htmlLink: { type: 'string', description: 'Event link' },
404404
status: { type: 'string', description: 'Event status' },
405-
summary: { type: 'string', description: 'Event title' },
406-
description: { type: 'string', description: 'Event description' },
407-
location: { type: 'string', description: 'Event location' },
405+
summary: { type: 'string', description: 'Event title', optional: true },
406+
description: { type: 'string', description: 'Event description', optional: true },
407+
location: { type: 'string', description: 'Event location', optional: true },
408408
start: { type: 'json', description: 'Event start' },
409409
end: { type: 'json', description: 'Event end' },
410-
attendees: { type: 'json', description: 'Event attendees' },
410+
attendees: { type: 'json', description: 'Event attendees', optional: true },
411411
creator: { type: 'json', description: 'Event creator' },
412412
organizer: { type: 'json', description: 'Event organizer' },
413413
},

apps/sim/tools/google_calendar/list.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,18 @@ export const listV2Tool: ToolConfig<GoogleCalendarListParams, GoogleCalendarList
143143
return {
144144
success: true,
145145
output: {
146-
nextPageToken: data.nextPageToken,
147-
timeZone: data.timeZone,
146+
nextPageToken: data.nextPageToken ?? null,
147+
timeZone: data.timeZone ?? null,
148148
events: events.map((event: GoogleCalendarApiEventResponse) => ({
149149
id: event.id,
150150
htmlLink: event.htmlLink,
151151
status: event.status,
152-
summary: event.summary || 'No title',
153-
description: event.description,
154-
location: event.location,
152+
summary: event.summary ?? null,
153+
description: event.description ?? null,
154+
location: event.location ?? null,
155155
start: event.start,
156156
end: event.end,
157-
attendees: event.attendees,
157+
attendees: event.attendees ?? null,
158158
creator: event.creator,
159159
organizer: event.organizer,
160160
})),

apps/sim/tools/google_calendar/quick_add.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ export const quickAddV2Tool: ToolConfig<
274274
id: finalEventData.id,
275275
htmlLink: finalEventData.htmlLink,
276276
status: finalEventData.status,
277-
summary: finalEventData.summary,
278-
description: finalEventData.description,
279-
location: finalEventData.location,
277+
summary: finalEventData.summary ?? null,
278+
description: finalEventData.description ?? null,
279+
location: finalEventData.location ?? null,
280280
start: finalEventData.start,
281281
end: finalEventData.end,
282-
attendees: finalEventData.attendees,
282+
attendees: finalEventData.attendees ?? null,
283283
creator: finalEventData.creator,
284284
organizer: finalEventData.organizer,
285285
},
@@ -289,12 +289,12 @@ export const quickAddV2Tool: ToolConfig<
289289
id: { type: 'string', description: 'Event ID' },
290290
htmlLink: { type: 'string', description: 'Event link' },
291291
status: { type: 'string', description: 'Event status' },
292-
summary: { type: 'string', description: 'Event title' },
293-
description: { type: 'string', description: 'Event description' },
294-
location: { type: 'string', description: 'Event location' },
292+
summary: { type: 'string', description: 'Event title', optional: true },
293+
description: { type: 'string', description: 'Event description', optional: true },
294+
location: { type: 'string', description: 'Event location', optional: true },
295295
start: { type: 'json', description: 'Event start' },
296296
end: { type: 'json', description: 'Event end' },
297-
attendees: { type: 'json', description: 'Event attendees' },
297+
attendees: { type: 'json', description: 'Event attendees', optional: true },
298298
creator: { type: 'json', description: 'Event creator' },
299299
organizer: { type: 'json', description: 'Event organizer' },
300300
},

0 commit comments

Comments
 (0)