@credal/actions 0.1.98 → 0.1.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.js +73 -9
- package/dist/actions/autogen/templates.d.ts +12 -2
- package/dist/actions/autogen/templates.js +587 -6
- package/dist/actions/autogen/types.d.ts +543 -14
- package/dist/actions/autogen/types.js +171 -7
- package/dist/actions/groups.js +19 -2
- package/dist/actions/providers/confluence/updatePage.js +13 -9
- package/dist/actions/providers/google-oauth/addGroupMember.d.ts +3 -0
- package/dist/actions/providers/google-oauth/addGroupMember.js +37 -0
- package/dist/actions/providers/google-oauth/deleteCalendarEvent.d.ts +3 -0
- package/dist/actions/providers/google-oauth/deleteCalendarEvent.js +35 -0
- package/dist/actions/providers/google-oauth/deleteGroupMember.d.ts +3 -0
- package/dist/actions/providers/google-oauth/deleteGroupMember.js +33 -0
- package/dist/actions/providers/google-oauth/getGroup.d.ts +3 -0
- package/dist/actions/providers/google-oauth/getGroup.js +43 -0
- package/dist/actions/providers/google-oauth/hasGroupMember.d.ts +3 -0
- package/dist/actions/providers/google-oauth/hasGroupMember.js +37 -0
- package/dist/actions/providers/google-oauth/listCalendarEvents.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listCalendarEvents.js +86 -0
- package/dist/actions/providers/google-oauth/listCalendars.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listCalendars.js +63 -0
- package/dist/actions/providers/google-oauth/listGroupMembers.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listGroupMembers.js +54 -0
- package/dist/actions/providers/google-oauth/listGroups.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listGroups.js +56 -0
- package/dist/actions/providers/google-oauth/updateCalendarEvent.d.ts +3 -0
- package/dist/actions/providers/google-oauth/updateCalendarEvent.js +59 -0
- package/dist/actions/providers/googlemail/listGmailThreads.d.ts +3 -0
- package/dist/actions/providers/{google-oauth → googlemail}/listGmailThreads.js +1 -1
- package/dist/actions/providers/googlemail/searchGmailMessages.d.ts +3 -0
- package/dist/actions/providers/{google-oauth → googlemail}/searchGmailMessages.js +1 -1
- package/dist/actions/providers/slack/listConversations.d.ts +1 -1
- package/package.json +1 -1
- package/dist/actions/autogen/definitions.d.ts +0 -5
- package/dist/actions/autogen/definitions.js +0 -132
- package/dist/actions/definitions.js +0 -35
- package/dist/actions/invokeMapper.d.ts +0 -9
- package/dist/actions/invokeMapper.js +0 -33
- package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +0 -3
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +0 -3
- package/dist/actions/providers/googlemaps/nearbysearch.js +0 -96
- package/dist/actions/providers/jira/createTicket.d.ts +0 -3
- package/dist/actions/providers/jira/createTicket.js +0 -34
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +0 -3
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.js +0 -43
- package/dist/actions/providers/slack/list_conversations.d.ts +0 -3
- package/dist/actions/providers/slack/list_conversations.js +0 -60
- package/dist/actions/providers/slack/summarizeChannel.d.ts +0 -3
- package/dist/actions/providers/slack/summarizeChannel.js +0 -51
- package/dist/actions/schema.js +0 -6
- package/dist/actions/types.js +0 -2
- package/dist/main.js +0 -11
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.kandjiGetFVRecoveryKeyForDeviceOutputSchema = exports.kandjiGetFVRecoveryKeyForDeviceParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaGetTasksDetailsOutputSchema = exports.asanaGetTasksDetailsParamsSchema = exports.asanaSearchTasksOutputSchema = exports.asanaSearchTasksParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaListAsanaTasksByProjectOutputSchema = exports.asanaListAsanaTasksByProjectParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
|
4
|
-
exports.
|
5
|
-
exports.
|
6
|
-
exports.notionSearchByTitleOutputSchema = exports.notionSearchByTitleParamsSchema = exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = void 0;
|
4
|
+
exports.googleOauthDeleteCalendarEventParamsSchema = exports.googleOauthUpdateCalendarEventOutputSchema = exports.googleOauthUpdateCalendarEventParamsSchema = exports.googleOauthListCalendarEventsOutputSchema = exports.googleOauthListCalendarEventsParamsSchema = exports.googleOauthListCalendarsOutputSchema = exports.googleOauthListCalendarsParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.googleOauthSearchFilesByKeywordsOutputSchema = exports.googleOauthSearchFilesByKeywordsParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.firecrawlDeepResearchOutputSchema = exports.firecrawlDeepResearchParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = void 0;
|
5
|
+
exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googlemailListGmailThreadsOutputSchema = exports.googlemailListGmailThreadsParamsSchema = exports.googlemailSearchGmailMessagesOutputSchema = exports.googlemailSearchGmailMessagesParamsSchema = exports.googleOauthDeleteGroupMemberOutputSchema = exports.googleOauthDeleteGroupMemberParamsSchema = exports.googleOauthAddGroupMemberOutputSchema = exports.googleOauthAddGroupMemberParamsSchema = exports.googleOauthHasGroupMemberOutputSchema = exports.googleOauthHasGroupMemberParamsSchema = exports.googleOauthListGroupMembersOutputSchema = exports.googleOauthListGroupMembersParamsSchema = exports.googleOauthGetGroupOutputSchema = exports.googleOauthGetGroupParamsSchema = exports.googleOauthListGroupsOutputSchema = exports.googleOauthListGroupsParamsSchema = exports.googleOauthSearchDriveByKeywordsOutputSchema = exports.googleOauthSearchDriveByKeywordsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthDeleteCalendarEventOutputSchema = void 0;
|
6
|
+
exports.notionSearchByTitleOutputSchema = exports.notionSearchByTitleParamsSchema = exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = void 0;
|
7
7
|
const zod_1 = require("zod");
|
8
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
9
9
|
authToken: zod_1.z.string().optional(),
|
@@ -1211,6 +1211,100 @@ exports.googleOauthScheduleCalendarMeetingOutputSchema = zod_1.z.object({
|
|
1211
1211
|
eventUrl: zod_1.z.string().describe("The URL to access the scheduled event").optional(),
|
1212
1212
|
error: zod_1.z.string().describe("The error that occurred if the meeting was not scheduled successfully").optional(),
|
1213
1213
|
});
|
1214
|
+
exports.googleOauthListCalendarsParamsSchema = zod_1.z.object({
|
1215
|
+
maxResults: zod_1.z.number().int().describe("Maximum number of calendars to return, defaults to 250").optional(),
|
1216
|
+
});
|
1217
|
+
exports.googleOauthListCalendarsOutputSchema = zod_1.z.object({
|
1218
|
+
success: zod_1.z.boolean().describe("Whether the calendars were listed successfully"),
|
1219
|
+
calendars: zod_1.z
|
1220
|
+
.array(zod_1.z.object({ id: zod_1.z.string().describe("The calendar ID"), summary: zod_1.z.string().describe("The calendar name") }))
|
1221
|
+
.describe("List of calendars"),
|
1222
|
+
error: zod_1.z.string().describe("Error message if listing failed").optional(),
|
1223
|
+
});
|
1224
|
+
exports.googleOauthListCalendarEventsParamsSchema = zod_1.z.object({
|
1225
|
+
calendarId: zod_1.z.string().describe("The ID of the calendar to list events from"),
|
1226
|
+
query: zod_1.z.string().describe("Optional free-text search query to filter events").optional(),
|
1227
|
+
maxResults: zod_1.z.number().int().describe("Maximum number of events to return, defaults to 250").optional(),
|
1228
|
+
});
|
1229
|
+
exports.googleOauthListCalendarEventsOutputSchema = zod_1.z.object({
|
1230
|
+
success: zod_1.z.boolean().describe("Whether the events were listed successfully"),
|
1231
|
+
events: zod_1.z
|
1232
|
+
.array(zod_1.z
|
1233
|
+
.object({
|
1234
|
+
id: zod_1.z.string().describe("Event unique identifier").optional(),
|
1235
|
+
status: zod_1.z.string().describe("Status of the event (e.g., confirmed, cancelled)").optional(),
|
1236
|
+
url: zod_1.z.string().describe("Link to the event in the Google Calendar web UI").optional(),
|
1237
|
+
title: zod_1.z.string().describe("Title of the event").optional(),
|
1238
|
+
description: zod_1.z.string().describe("Description of the event").optional(),
|
1239
|
+
location: zod_1.z.string().describe("Geographic location of the event as free-form text").optional(),
|
1240
|
+
start: zod_1.z.string().describe("Start date/time (for timed events, RFC3339 timestamp)").optional(),
|
1241
|
+
end: zod_1.z.string().describe("End date/time (for timed events, RFC3339 timestamp)").optional(),
|
1242
|
+
attendees: zod_1.z
|
1243
|
+
.array(zod_1.z.object({
|
1244
|
+
email: zod_1.z.string().describe("The attendee's email address").optional(),
|
1245
|
+
displayName: zod_1.z.string().describe("The attendee's name").optional(),
|
1246
|
+
responseStatus: zod_1.z
|
1247
|
+
.string()
|
1248
|
+
.describe("The attendee's response status (accepted, declined, etc.)")
|
1249
|
+
.optional(),
|
1250
|
+
}))
|
1251
|
+
.describe("List of attendees")
|
1252
|
+
.optional(),
|
1253
|
+
organizer: zod_1.z
|
1254
|
+
.object({
|
1255
|
+
email: zod_1.z.string().describe("The organizer's email address").optional(),
|
1256
|
+
displayName: zod_1.z.string().describe("The organizer's name").optional(),
|
1257
|
+
})
|
1258
|
+
.describe("The organizer of the event")
|
1259
|
+
.optional(),
|
1260
|
+
hangoutLink: zod_1.z.string().describe("Google Meet link for the event, if available").optional(),
|
1261
|
+
created: zod_1.z.string().describe("Creation time of the event (RFC3339 timestamp)").optional(),
|
1262
|
+
updated: zod_1.z.string().describe("Last modification time of the event (RFC3339 timestamp)").optional(),
|
1263
|
+
})
|
1264
|
+
.describe("A calendar event"))
|
1265
|
+
.describe("List of events"),
|
1266
|
+
error: zod_1.z.string().describe("Error message if listing failed").optional(),
|
1267
|
+
});
|
1268
|
+
exports.googleOauthUpdateCalendarEventParamsSchema = zod_1.z.object({
|
1269
|
+
calendarId: zod_1.z.string().describe("The ID of the calendar containing the event"),
|
1270
|
+
eventId: zod_1.z.string().describe("The ID of the event to update"),
|
1271
|
+
updates: zod_1.z
|
1272
|
+
.object({
|
1273
|
+
title: zod_1.z.string().describe("The new title of the event").optional(),
|
1274
|
+
description: zod_1.z.string().describe("The new description of the event").optional(),
|
1275
|
+
start: zod_1.z.string().describe("The new start date/time (RFC3339 timestamp)").optional(),
|
1276
|
+
end: zod_1.z.string().describe("The new end date/time (RFC3339 timestamp)").optional(),
|
1277
|
+
location: zod_1.z.string().describe("The new location of the event").optional(),
|
1278
|
+
attendees: zod_1.z
|
1279
|
+
.array(zod_1.z.string().describe("The email of the attendee"))
|
1280
|
+
.describe("The new list of attendees")
|
1281
|
+
.optional(),
|
1282
|
+
status: zod_1.z.string().describe("The new status of the event (e.g., confirmed, cancelled)").optional(),
|
1283
|
+
organizer: zod_1.z
|
1284
|
+
.object({
|
1285
|
+
email: zod_1.z.string().describe("The organizer's email address").optional(),
|
1286
|
+
displayName: zod_1.z.string().describe("The organizer's name").optional(),
|
1287
|
+
})
|
1288
|
+
.describe("The new organizer of the event")
|
1289
|
+
.optional(),
|
1290
|
+
})
|
1291
|
+
.describe("The fields to update on the event")
|
1292
|
+
.optional(),
|
1293
|
+
});
|
1294
|
+
exports.googleOauthUpdateCalendarEventOutputSchema = zod_1.z.object({
|
1295
|
+
success: zod_1.z.boolean().describe("Whether the event was updated successfully"),
|
1296
|
+
eventId: zod_1.z.string().describe("The ID of the updated event").optional(),
|
1297
|
+
eventUrl: zod_1.z.string().describe("The URL to access the updated event").optional(),
|
1298
|
+
error: zod_1.z.string().describe("The error that occurred if the event was not updated successfully").optional(),
|
1299
|
+
});
|
1300
|
+
exports.googleOauthDeleteCalendarEventParamsSchema = zod_1.z.object({
|
1301
|
+
calendarId: zod_1.z.string().describe("The ID of the calendar containing the event"),
|
1302
|
+
eventId: zod_1.z.string().describe("The ID of the event to delete"),
|
1303
|
+
});
|
1304
|
+
exports.googleOauthDeleteCalendarEventOutputSchema = zod_1.z.object({
|
1305
|
+
success: zod_1.z.boolean().describe("Whether the event was deleted successfully"),
|
1306
|
+
error: zod_1.z.string().describe("The error that occurred if the event was not deleted successfully").optional(),
|
1307
|
+
});
|
1214
1308
|
exports.googleOauthCreateSpreadsheetParamsSchema = zod_1.z.object({
|
1215
1309
|
title: zod_1.z.string().describe("The title of the new spreadsheet"),
|
1216
1310
|
sheets: zod_1.z
|
@@ -2118,11 +2212,81 @@ exports.googleOauthSearchDriveByKeywordsOutputSchema = zod_1.z.object({
|
|
2118
2212
|
.optional(),
|
2119
2213
|
error: zod_1.z.string().describe("Error message if search failed").optional(),
|
2120
2214
|
});
|
2121
|
-
exports.
|
2215
|
+
exports.googleOauthListGroupsParamsSchema = zod_1.z.object({
|
2216
|
+
maxResults: zod_1.z.number().int().describe("The maximum number of groups to return (max allowed is 200)").optional(),
|
2217
|
+
});
|
2218
|
+
exports.googleOauthListGroupsOutputSchema = zod_1.z.object({
|
2219
|
+
success: zod_1.z.boolean().describe("Whether the groups were listed successfully"),
|
2220
|
+
groups: zod_1.z
|
2221
|
+
.array(zod_1.z.object({
|
2222
|
+
id: zod_1.z.string().describe("The unique ID of the group"),
|
2223
|
+
email: zod_1.z.string().describe("The email address of the group"),
|
2224
|
+
name: zod_1.z.string().describe("The name of the group"),
|
2225
|
+
description: zod_1.z.string().describe("The description of the group").optional(),
|
2226
|
+
}))
|
2227
|
+
.describe("The list of Google Groups"),
|
2228
|
+
error: zod_1.z.string().describe("The error that occurred if the groups could not be listed").optional(),
|
2229
|
+
});
|
2230
|
+
exports.googleOauthGetGroupParamsSchema = zod_1.z.object({
|
2231
|
+
groupKey: zod_1.z.string().describe("The group's email address or unique group ID"),
|
2232
|
+
});
|
2233
|
+
exports.googleOauthGetGroupOutputSchema = zod_1.z.object({
|
2234
|
+
success: zod_1.z.boolean().describe("Whether the group was retrieved successfully"),
|
2235
|
+
group: zod_1.z.object({
|
2236
|
+
id: zod_1.z.string().describe("The unique ID of the group"),
|
2237
|
+
email: zod_1.z.string().describe("The email address of the group"),
|
2238
|
+
name: zod_1.z.string().describe("The name of the group"),
|
2239
|
+
description: zod_1.z.string().describe("The description of the group").optional(),
|
2240
|
+
}),
|
2241
|
+
error: zod_1.z.string().describe("The error that occurred if the group could not be retrieved").optional(),
|
2242
|
+
});
|
2243
|
+
exports.googleOauthListGroupMembersParamsSchema = zod_1.z.object({
|
2244
|
+
groupKey: zod_1.z.string().describe("The group's email address or unique group ID"),
|
2245
|
+
maxResults: zod_1.z.number().int().describe("The maximum number of members to return (max allowed is 200)").optional(),
|
2246
|
+
});
|
2247
|
+
exports.googleOauthListGroupMembersOutputSchema = zod_1.z.object({
|
2248
|
+
success: zod_1.z.boolean().describe("Whether the members were listed successfully"),
|
2249
|
+
members: zod_1.z
|
2250
|
+
.array(zod_1.z.object({
|
2251
|
+
id: zod_1.z.string().describe("The unique ID of the member"),
|
2252
|
+
email: zod_1.z.string().describe("The email address of the member"),
|
2253
|
+
role: zod_1.z.string().describe("The role of the member in the group (OWNER, MANAGER, MEMBER)"),
|
2254
|
+
type: zod_1.z.string().describe("The type of the member (USER, GROUP)"),
|
2255
|
+
}))
|
2256
|
+
.describe("The list of group members"),
|
2257
|
+
error: zod_1.z.string().describe("The error that occurred if the members could not be listed").optional(),
|
2258
|
+
});
|
2259
|
+
exports.googleOauthHasGroupMemberParamsSchema = zod_1.z.object({
|
2260
|
+
groupKey: zod_1.z.string().describe("The group's email address or unique group ID"),
|
2261
|
+
memberKey: zod_1.z.string().describe("The member's email address or unique member ID"),
|
2262
|
+
});
|
2263
|
+
exports.googleOauthHasGroupMemberOutputSchema = zod_1.z.object({
|
2264
|
+
success: zod_1.z.boolean().describe("Whether the check was performed successfully"),
|
2265
|
+
isMember: zod_1.z.boolean().describe("Whether the user is a member of the group"),
|
2266
|
+
error: zod_1.z.string().describe("The error that occurred if the check could not be performed").optional(),
|
2267
|
+
});
|
2268
|
+
exports.googleOauthAddGroupMemberParamsSchema = zod_1.z.object({
|
2269
|
+
groupKey: zod_1.z.string().describe("The group's email address or unique group ID"),
|
2270
|
+
email: zod_1.z.string().describe("The email address of the user to add"),
|
2271
|
+
});
|
2272
|
+
exports.googleOauthAddGroupMemberOutputSchema = zod_1.z.object({
|
2273
|
+
success: zod_1.z.boolean().describe("Whether the member was added successfully"),
|
2274
|
+
memberID: zod_1.z.string().describe("The unique ID of the member"),
|
2275
|
+
error: zod_1.z.string().describe("The error that occurred if the member could not be added").optional(),
|
2276
|
+
});
|
2277
|
+
exports.googleOauthDeleteGroupMemberParamsSchema = zod_1.z.object({
|
2278
|
+
groupKey: zod_1.z.string().describe("The group's email address or unique group ID"),
|
2279
|
+
memberKey: zod_1.z.string().describe("The member's email address or unique member ID"),
|
2280
|
+
});
|
2281
|
+
exports.googleOauthDeleteGroupMemberOutputSchema = zod_1.z.object({
|
2282
|
+
success: zod_1.z.boolean().describe("Whether the member was removed successfully"),
|
2283
|
+
error: zod_1.z.string().describe("The error that occurred if the member could not be removed").optional(),
|
2284
|
+
});
|
2285
|
+
exports.googlemailSearchGmailMessagesParamsSchema = zod_1.z.object({
|
2122
2286
|
query: zod_1.z.string().describe('Gmail search query (e.g. "from:alice subject:urgent")'),
|
2123
2287
|
maxResults: zod_1.z.number().int().describe("Maximum number of messages to return (optional)").optional(),
|
2124
2288
|
});
|
2125
|
-
exports.
|
2289
|
+
exports.googlemailSearchGmailMessagesOutputSchema = zod_1.z.object({
|
2126
2290
|
success: zod_1.z.boolean(),
|
2127
2291
|
messages: zod_1.z
|
2128
2292
|
.array(zod_1.z.object({
|
@@ -2136,11 +2300,11 @@ exports.googleOauthSearchGmailMessagesOutputSchema = zod_1.z.object({
|
|
2136
2300
|
.describe("List of matching Gmail messages"),
|
2137
2301
|
error: zod_1.z.string().describe("Error message if search failed").optional(),
|
2138
2302
|
});
|
2139
|
-
exports.
|
2303
|
+
exports.googlemailListGmailThreadsParamsSchema = zod_1.z.object({
|
2140
2304
|
query: zod_1.z.string().describe('Gmail search query (e.g. "from:alice subject:project")'),
|
2141
2305
|
maxResults: zod_1.z.number().int().describe("Maximum number of threads to return").optional(),
|
2142
2306
|
});
|
2143
|
-
exports.
|
2307
|
+
exports.googlemailListGmailThreadsOutputSchema = zod_1.z.object({
|
2144
2308
|
success: zod_1.z.boolean(),
|
2145
2309
|
threads: zod_1.z
|
2146
2310
|
.array(zod_1.z.object({
|
package/dist/actions/groups.js
CHANGED
@@ -48,11 +48,17 @@ exports.ACTION_GROUPS = {
|
|
48
48
|
},
|
49
49
|
GOOGLE_CALENDAR: {
|
50
50
|
description: "Actions for interacting with Google Calendar",
|
51
|
-
actions: [
|
51
|
+
actions: [
|
52
|
+
templates_1.googleOauthScheduleCalendarMeetingDefinition,
|
53
|
+
templates_1.googleOauthListCalendarsDefinition,
|
54
|
+
templates_1.googleOauthListCalendarEventsDefinition,
|
55
|
+
templates_1.googleOauthUpdateCalendarEventDefinition,
|
56
|
+
templates_1.googleOauthDeleteCalendarEventDefinition,
|
57
|
+
],
|
52
58
|
},
|
53
59
|
GMAIL: {
|
54
60
|
description: "Actions for interacting with Gmail",
|
55
|
-
actions: [templates_1.
|
61
|
+
actions: [templates_1.googlemailSearchGmailMessagesDefinition, templates_1.googlemailListGmailThreadsDefinition],
|
56
62
|
},
|
57
63
|
CREDAL_CALL_COPILOT: {
|
58
64
|
description: "Action for calling a Credal Copilot",
|
@@ -187,4 +193,15 @@ exports.ACTION_GROUPS = {
|
|
187
193
|
description: "Actions for interacting with Notion",
|
188
194
|
actions: [templates_1.notionSearchByTitleDefinition],
|
189
195
|
},
|
196
|
+
GOOGLE_GROUPS: {
|
197
|
+
description: "Google Workspace Groups management actions",
|
198
|
+
actions: [
|
199
|
+
templates_1.googleOauthListGroupsDefinition,
|
200
|
+
templates_1.googleOauthGetGroupDefinition,
|
201
|
+
templates_1.googleOauthListGroupMembersDefinition,
|
202
|
+
templates_1.googleOauthHasGroupMemberDefinition,
|
203
|
+
templates_1.googleOauthAddGroupMemberDefinition,
|
204
|
+
templates_1.googleOauthDeleteGroupMemberDefinition,
|
205
|
+
],
|
206
|
+
},
|
190
207
|
};
|
@@ -8,25 +8,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
const
|
13
|
-
function
|
14
|
-
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
16
|
+
function getConfluenceApi(baseUrl, username, apiToken) {
|
17
|
+
const api = axios_1.default.create({
|
15
18
|
baseURL: baseUrl,
|
16
19
|
headers: {
|
17
20
|
Accept: "application/json",
|
21
|
+
// Tokens are associated with a specific user.
|
18
22
|
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
19
23
|
},
|
20
|
-
};
|
24
|
+
});
|
25
|
+
return api;
|
21
26
|
}
|
22
27
|
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
23
28
|
const { pageId, username, content, title } = params;
|
24
29
|
const { baseUrl, authToken } = authParams;
|
25
|
-
const
|
30
|
+
const api = getConfluenceApi(baseUrl, username, authToken);
|
26
31
|
// Get current version number
|
27
|
-
const response = yield
|
32
|
+
const response = yield api.get(`/api/v2/pages/${pageId}`);
|
28
33
|
const currVersion = response.data.version.number;
|
29
|
-
|
34
|
+
yield api.put(`/api/v2/pages/${pageId}`, {
|
30
35
|
id: pageId,
|
31
36
|
status: "current",
|
32
37
|
title,
|
@@ -37,7 +42,6 @@ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
37
42
|
version: {
|
38
43
|
number: currVersion + 1,
|
39
44
|
},
|
40
|
-
};
|
41
|
-
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
45
|
+
});
|
42
46
|
});
|
43
47
|
exports.default = confluenceUpdatePage;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const addGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { authToken } = authParams;
|
16
|
+
const { groupKey, email } = params;
|
17
|
+
if (!authToken) {
|
18
|
+
return { success: false, memberID: "", error: missingAuthConstants_1.MISSING_AUTH_TOKEN };
|
19
|
+
}
|
20
|
+
try {
|
21
|
+
const response = yield axiosClient_1.axiosClient.post(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/members`, { email }, {
|
22
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
23
|
+
});
|
24
|
+
return {
|
25
|
+
success: true,
|
26
|
+
memberID: response.data.id,
|
27
|
+
};
|
28
|
+
}
|
29
|
+
catch (error) {
|
30
|
+
return {
|
31
|
+
success: false,
|
32
|
+
memberID: "",
|
33
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
34
|
+
};
|
35
|
+
}
|
36
|
+
});
|
37
|
+
exports.default = addGroupMember;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const deleteCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
if (!authParams.authToken) {
|
16
|
+
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN };
|
17
|
+
}
|
18
|
+
const { calendarId, eventId } = params;
|
19
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(eventId)}`;
|
20
|
+
try {
|
21
|
+
yield axiosClient_1.axiosClient.delete(url, {
|
22
|
+
headers: {
|
23
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
24
|
+
},
|
25
|
+
});
|
26
|
+
return { success: true };
|
27
|
+
}
|
28
|
+
catch (error) {
|
29
|
+
return {
|
30
|
+
success: false,
|
31
|
+
error: error instanceof Error ? error.message : "Unknown error deleting event",
|
32
|
+
};
|
33
|
+
}
|
34
|
+
});
|
35
|
+
exports.default = deleteCalendarEvent;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const deleteGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { authToken } = authParams;
|
16
|
+
const { groupKey, memberKey } = params;
|
17
|
+
if (!authToken) {
|
18
|
+
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN };
|
19
|
+
}
|
20
|
+
try {
|
21
|
+
yield axiosClient_1.axiosClient.delete(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/members/${encodeURIComponent(memberKey)}`, {
|
22
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
23
|
+
});
|
24
|
+
return { success: true };
|
25
|
+
}
|
26
|
+
catch (error) {
|
27
|
+
return {
|
28
|
+
success: false,
|
29
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
30
|
+
};
|
31
|
+
}
|
32
|
+
});
|
33
|
+
exports.default = deleteGroupMember;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const getGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { authToken } = authParams;
|
16
|
+
const { groupKey } = params;
|
17
|
+
if (!authToken) {
|
18
|
+
return { success: false, group: { id: "", email: "", name: "" }, error: missingAuthConstants_1.MISSING_AUTH_TOKEN };
|
19
|
+
}
|
20
|
+
try {
|
21
|
+
const response = yield axiosClient_1.axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}`, {
|
22
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
23
|
+
});
|
24
|
+
const { id, email, name, description } = response.data;
|
25
|
+
return {
|
26
|
+
success: true,
|
27
|
+
group: {
|
28
|
+
id,
|
29
|
+
email,
|
30
|
+
name,
|
31
|
+
description,
|
32
|
+
},
|
33
|
+
};
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
return {
|
37
|
+
success: false,
|
38
|
+
group: { id: "", email: "", name: "" },
|
39
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
40
|
+
};
|
41
|
+
}
|
42
|
+
});
|
43
|
+
exports.default = getGroup;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const hasGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { authToken } = authParams;
|
16
|
+
const { groupKey, memberKey } = params;
|
17
|
+
if (!authToken) {
|
18
|
+
return { success: false, isMember: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN };
|
19
|
+
}
|
20
|
+
try {
|
21
|
+
const response = yield axiosClient_1.axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/hasMember/${encodeURIComponent(memberKey)}`, {
|
22
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
23
|
+
});
|
24
|
+
return {
|
25
|
+
success: true,
|
26
|
+
isMember: !!response.data.isMember,
|
27
|
+
};
|
28
|
+
}
|
29
|
+
catch (error) {
|
30
|
+
return {
|
31
|
+
success: false,
|
32
|
+
isMember: false,
|
33
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
34
|
+
};
|
35
|
+
}
|
36
|
+
});
|
37
|
+
exports.default = hasGroupMember;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const listCalendarEvents = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
if (!authParams.authToken) {
|
16
|
+
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN, events: [] };
|
17
|
+
}
|
18
|
+
const { calendarId, query, maxResults } = params;
|
19
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events`;
|
20
|
+
const allEvents = [];
|
21
|
+
let pageToken = undefined;
|
22
|
+
let fetchedCount = 0;
|
23
|
+
const max = maxResults !== null && maxResults !== void 0 ? maxResults : 250; // Default to 250 if not specified, Google API max is 250
|
24
|
+
try {
|
25
|
+
while (fetchedCount < max) {
|
26
|
+
const res = yield axiosClient_1.axiosClient.get(url, {
|
27
|
+
headers: {
|
28
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
29
|
+
},
|
30
|
+
params: {
|
31
|
+
q: query,
|
32
|
+
pageToken,
|
33
|
+
maxResults: Math.min(250, max - fetchedCount), // Google API max is 250
|
34
|
+
singleEvents: true,
|
35
|
+
orderBy: "startTime",
|
36
|
+
},
|
37
|
+
});
|
38
|
+
const { items = [], nextPageToken = undefined } = res.data;
|
39
|
+
if (!Array.isArray(items) || items.length <= 0)
|
40
|
+
break;
|
41
|
+
const batch = items.slice(0, max - fetchedCount);
|
42
|
+
allEvents.push(...batch.map(({ id, status, htmlLink, summary, description, location, start, end, attendees, organizer, hangoutLink, created, updated, }) => ({
|
43
|
+
id,
|
44
|
+
status,
|
45
|
+
url: htmlLink,
|
46
|
+
title: summary,
|
47
|
+
description,
|
48
|
+
location,
|
49
|
+
start: (start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || "",
|
50
|
+
end: (end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || "",
|
51
|
+
attendees: Array.isArray(attendees)
|
52
|
+
? attendees.map(({ email, displayName, responseStatus }) => ({
|
53
|
+
email,
|
54
|
+
displayName,
|
55
|
+
responseStatus,
|
56
|
+
}))
|
57
|
+
: [],
|
58
|
+
organizer: organizer
|
59
|
+
? {
|
60
|
+
email: organizer.email,
|
61
|
+
displayName: organizer.displayName,
|
62
|
+
}
|
63
|
+
: undefined,
|
64
|
+
hangoutLink,
|
65
|
+
created,
|
66
|
+
updated,
|
67
|
+
})));
|
68
|
+
fetchedCount = allEvents.length;
|
69
|
+
if (!nextPageToken || fetchedCount >= max)
|
70
|
+
break;
|
71
|
+
pageToken = nextPageToken;
|
72
|
+
}
|
73
|
+
return {
|
74
|
+
success: true,
|
75
|
+
events: allEvents,
|
76
|
+
};
|
77
|
+
}
|
78
|
+
catch (error) {
|
79
|
+
return {
|
80
|
+
success: false,
|
81
|
+
events: [],
|
82
|
+
error: error instanceof Error ? error.message : "Unknown error listing events",
|
83
|
+
};
|
84
|
+
}
|
85
|
+
});
|
86
|
+
exports.default = listCalendarEvents;
|