@credal/actions 0.2.42 → 0.2.44

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.
@@ -1,4 +1,4 @@
1
- import { genericFillTemplateParamsSchema, genericFillTemplateOutputSchema, confluenceOverwritePageParamsSchema, confluenceOverwritePageOutputSchema, googlemapsValidateAddressOutputSchema, googlemapsValidateAddressParamsSchema, googleOauthCreateNewGoogleDocParamsSchema, googleOauthCreateNewGoogleDocOutputSchema, mathAddOutputSchema, mathAddParamsSchema, mongoInsertMongoDocOutputSchema, mongoInsertMongoDocParamsSchema, slackSendMessageOutputSchema, slackSendMessageParamsSchema, slackGetChannelMessagesOutputSchema, slackGetChannelMessagesParamsSchema, slackArchiveChannelParamsSchema, slackArchiveChannelOutputSchema, slackCreateChannelParamsSchema, slackCreateChannelOutputSchema, snowflakeGetRowByFieldValueOutputSchema, snowflakeGetRowByFieldValueParamsSchema, zendeskCreateZendeskTicketOutputSchema, zendeskCreateZendeskTicketParamsSchema, zendeskGetTicketDetailsOutputSchema, zendeskGetTicketDetailsParamsSchema, zendeskUpdateTicketStatusOutputSchema, zendeskUpdateTicketStatusParamsSchema, zendeskAddCommentToTicketOutputSchema, zendeskAddCommentToTicketParamsSchema, zendeskAssignTicketOutputSchema, zendeskAssignTicketParamsSchema, zendeskListZendeskTicketsOutputSchema, zendeskListZendeskTicketsParamsSchema, jiraAssignJiraTicketParamsSchema, jiraAssignJiraTicketOutputSchema, jiraCommentJiraTicketParamsSchema, jiraCommentJiraTicketOutputSchema, jiraCreateJiraTicketParamsSchema, jiraCreateJiraTicketOutputSchema, jiraGetJiraTicketDetailsParamsSchema, jiraGetJiraTicketDetailsOutputSchema, jiraGetJiraTicketHistoryParamsSchema, jiraGetJiraTicketHistoryOutputSchema, jiraUpdateJiraTicketDetailsParamsSchema, jiraUpdateJiraTicketDetailsOutputSchema, jiraUpdateJiraTicketStatusParamsSchema, jiraUpdateJiraTicketStatusOutputSchema, jiraGetServiceDesksParamsSchema, jiraGetServiceDesksOutputSchema, jiraCreateServiceDeskRequestParamsSchema, jiraCreateServiceDeskRequestOutputSchema, openstreetmapGetLatitudeLongitudeFromLocationParamsSchema, openstreetmapGetLatitudeLongitudeFromLocationOutputSchema, nwsGetForecastForLocationParamsSchema, nwsGetForecastForLocationOutputSchema, googlemapsNearbysearchRestaurantsOutputSchema, googlemapsNearbysearchRestaurantsParamsSchema, firecrawlScrapeUrlOutputSchema, firecrawlScrapeUrlParamsSchema, resendSendEmailOutputSchema, firecrawlScrapeTweetDataWithNitterParamsSchema, firecrawlScrapeTweetDataWithNitterOutputSchema, resendSendEmailParamsSchema, linkedinCreateShareLinkedinPostUrlParamsSchema, linkedinCreateShareLinkedinPostUrlOutputSchema, xCreateShareXPostUrlParamsSchema, xCreateShareXPostUrlOutputSchema, finnhubSymbolLookupParamsSchema, finnhubSymbolLookupOutputSchema, finnhubGetBasicFinancialsParamsSchema, finnhubGetBasicFinancialsOutputSchema, confluenceFetchPageContentParamsSchema, confluenceFetchPageContentOutputSchema, snowflakeRunSnowflakeQueryParamsSchema, snowflakeRunSnowflakeQueryOutputSchema, lookerEnableUserByEmailParamsSchema, lookerEnableUserByEmailOutputSchema, googleOauthUpdateDocParamsSchema, googleOauthUpdateDocOutputSchema, googleOauthCreateSpreadsheetParamsSchema, googleOauthCreateSpreadsheetOutputSchema, googleOauthUpdateSpreadsheetParamsSchema, googleOauthUpdateSpreadsheetOutputSchema, googleOauthScheduleCalendarMeetingParamsSchema, googleOauthScheduleCalendarMeetingOutputSchema, googleOauthListCalendarsParamsSchema, googleOauthListCalendarsOutputSchema, googleOauthListCalendarEventsParamsSchema, googleOauthListCalendarEventsOutputSchema, googleOauthUpdateCalendarEventParamsSchema, googleOauthUpdateCalendarEventOutputSchema, googleOauthDeleteCalendarEventParamsSchema, googleOauthDeleteCalendarEventOutputSchema, googleOauthCreatePresentationParamsSchema, googleOauthCreatePresentationOutputSchema, googleOauthUpdatePresentationParamsSchema, googleOauthUpdatePresentationOutputSchema, googleOauthSearchDriveByKeywordsParamsSchema, googleOauthSearchDriveByKeywordsOutputSchema, googleOauthListGroupsOutputSchema, googleOauthListGroupsParamsSchema, googleOauthGetGroupOutputSchema, googleOauthGetGroupParamsSchema, googleOauthListGroupMembersOutputSchema, googleOauthListGroupMembersParamsSchema, googleOauthHasGroupMemberOutputSchema, googleOauthHasGroupMemberParamsSchema, googleOauthAddGroupMemberOutputSchema, googleOauthAddGroupMemberParamsSchema, googleOauthDeleteGroupMemberOutputSchema, googleOauthDeleteGroupMemberParamsSchema, gongGetGongTranscriptsParamsSchema, gongGetGongTranscriptsOutputSchema, ashbyCreateNoteParamsSchema, ashbyCreateNoteOutputSchema, ashbyGetCandidateInfoParamsSchema, ashbyGetCandidateInfoOutputSchema, salesforceUpdateRecordParamsSchema, salesforceUpdateRecordOutputSchema, salesforceCreateCaseParamsSchema, salesforceCreateCaseOutputSchema, salesforceGenerateSalesReportParamsSchema, salesforceGenerateSalesReportOutputSchema, salesforceGetRecordParamsSchema, salesforceGetRecordOutputSchema, ashbyListCandidatesParamsSchema, ashbyListCandidatesOutputSchema, ashbyListCandidateNotesParamsSchema, ashbyListCandidateNotesOutputSchema, ashbySearchCandidatesParamsSchema, ashbySearchCandidatesOutputSchema, ashbyCreateCandidateParamsSchema, ashbyCreateCandidateOutputSchema, ashbyUpdateCandidateParamsSchema, ashbyUpdateCandidateOutputSchema, microsoftMessageTeamsChatParamsSchema, microsoftMessageTeamsChatOutputSchema, microsoftMessageTeamsChannelParamsSchema, microsoftMessageTeamsChannelOutputSchema, salesforceGetSalesforceRecordsByQueryParamsSchema, salesforceGetSalesforceRecordsByQueryOutputSchema, asanaCommentTaskParamsSchema, asanaCommentTaskOutputSchema, asanaCreateTaskParamsSchema, asanaCreateTaskOutputSchema, asanaUpdateTaskParamsSchema, asanaUpdateTaskOutputSchema, githubCreateOrUpdateFileParamsSchema, githubCreateOrUpdateFileOutputSchema, githubCreateBranchParamsSchema, githubCreateBranchOutputSchema, githubCreatePullRequestParamsSchema, githubCreatePullRequestOutputSchema, microsoftUpdateSpreadsheetParamsSchema, microsoftUpdateSpreadsheetOutputSchema, microsoftUpdateDocumentParamsSchema, microsoftUpdateDocumentOutputSchema, microsoftGetDocumentParamsSchema, microsoftGetDocumentOutputSchema, salesforceFetchSalesforceSchemaByObjectParamsSchema, salesforceFetchSalesforceSchemaByObjectOutputSchema, githubListPullRequestsParamsSchema, githubListPullRequestsOutputSchema, jiraGetJiraIssuesByQueryOutputSchema, jiraGetJiraIssuesByQueryParamsSchema, salesforceCreateRecordParamsSchema, salesforceCreateRecordOutputSchema, firecrawlDeepResearchParamsSchema, firecrawlDeepResearchOutputSchema, bingGetTopNSearchResultUrlsParamsSchema, bingGetTopNSearchResultUrlsOutputSchema, ashbyAddCandidateToProjectParamsSchema, ashbyAddCandidateToProjectOutputSchema, microsoftCreateDocumentParamsSchema, microsoftCreateDocumentOutputSchema, kandjiGetFVRecoveryKeyForDeviceParamsSchema, kandjiGetFVRecoveryKeyForDeviceOutputSchema, asanaListAsanaTasksByProjectParamsSchema, asanaListAsanaTasksByProjectOutputSchema, asanaSearchTasksParamsSchema, asanaSearchTasksOutputSchema, asanaGetTasksDetailsParamsSchema, asanaGetTasksDetailsOutputSchema, notionSearchByTitleParamsSchema, notionSearchByTitleOutputSchema, jamfGetJamfComputerInventoryParamsSchema, jamfGetJamfComputerInventoryOutputSchema, jamfGetJamfFileVaultRecoveryKeyParamsSchema, jamfGetJamfFileVaultRecoveryKeyOutputSchema, googlemailSearchGmailMessagesOutputSchema, googlemailSearchGmailMessagesParamsSchema, googlemailListGmailThreadsOutputSchema, googlemailListGmailThreadsParamsSchema, oktaListOktaUsersParamsSchema, oktaListOktaUsersOutputSchema, oktaGetOktaUserParamsSchema, oktaGetOktaUserOutputSchema, oktaListOktaUserGroupsParamsSchema, oktaListOktaUserGroupsOutputSchema, oktaListOktaGroupsParamsSchema, oktaListOktaGroupsOutputSchema, oktaGetOktaGroupParamsSchema, oktaGetOktaGroupOutputSchema, oktaListOktaGroupMembersParamsSchema, oktaListOktaGroupMembersOutputSchema, oktaRemoveUserFromGroupParamsSchema, oktaRemoveUserFromGroupOutputSchema, oktaAddUserToGroupParamsSchema, oktaAddUserToGroupOutputSchema, oktaResetPasswordParamsSchema, oktaResetPasswordOutputSchema, oktaResetMFAParamsSchema, oktaResetMFAOutputSchema, oktaListMFAParamsSchema, oktaListMFAOutputSchema, jamfGetJamfUserComputerIdParamsSchema, jamfGetJamfUserComputerIdOutputSchema, jamfLockJamfComputerByIdParamsSchema, jamfLockJamfComputerByIdOutputSchema, oktaTriggerOktaWorkflowParamsSchema, oktaTriggerOktaWorkflowOutputSchema, gitlabSearchGroupOutputSchema, gitlabSearchGroupParamsSchema, githubSearchRepositoryOutputSchema, githubSearchRepositoryParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, } from "./autogen/types.js";
1
+ import { genericFillTemplateParamsSchema, genericFillTemplateOutputSchema, confluenceOverwritePageParamsSchema, confluenceOverwritePageOutputSchema, googlemapsValidateAddressOutputSchema, googlemapsValidateAddressParamsSchema, googleOauthCreateNewGoogleDocParamsSchema, googleOauthCreateNewGoogleDocOutputSchema, mathAddOutputSchema, mathAddParamsSchema, mongoInsertMongoDocOutputSchema, mongoInsertMongoDocParamsSchema, slackSendMessageOutputSchema, slackSendMessageParamsSchema, slackGetChannelMessagesOutputSchema, slackGetChannelMessagesParamsSchema, slackArchiveChannelParamsSchema, slackArchiveChannelOutputSchema, slackCreateChannelParamsSchema, slackCreateChannelOutputSchema, snowflakeGetRowByFieldValueOutputSchema, snowflakeGetRowByFieldValueParamsSchema, zendeskCreateZendeskTicketOutputSchema, zendeskCreateZendeskTicketParamsSchema, zendeskGetTicketDetailsOutputSchema, zendeskGetTicketDetailsParamsSchema, zendeskUpdateTicketStatusOutputSchema, zendeskUpdateTicketStatusParamsSchema, zendeskAddCommentToTicketOutputSchema, zendeskAddCommentToTicketParamsSchema, zendeskAssignTicketOutputSchema, zendeskAssignTicketParamsSchema, zendeskListZendeskTicketsOutputSchema, zendeskListZendeskTicketsParamsSchema, jiraAssignJiraTicketParamsSchema, jiraAssignJiraTicketOutputSchema, jiraCommentJiraTicketParamsSchema, jiraCommentJiraTicketOutputSchema, jiraCreateJiraTicketParamsSchema, jiraCreateJiraTicketOutputSchema, jiraGetJiraTicketDetailsParamsSchema, jiraGetJiraTicketDetailsOutputSchema, jiraGetJiraTicketHistoryParamsSchema, jiraGetJiraTicketHistoryOutputSchema, jiraUpdateJiraTicketDetailsParamsSchema, jiraUpdateJiraTicketDetailsOutputSchema, jiraUpdateJiraTicketStatusParamsSchema, jiraUpdateJiraTicketStatusOutputSchema, jiraGetServiceDesksParamsSchema, jiraGetServiceDesksOutputSchema, jiraCreateServiceDeskRequestParamsSchema, jiraCreateServiceDeskRequestOutputSchema, openstreetmapGetLatitudeLongitudeFromLocationParamsSchema, openstreetmapGetLatitudeLongitudeFromLocationOutputSchema, nwsGetForecastForLocationParamsSchema, nwsGetForecastForLocationOutputSchema, googlemapsNearbysearchRestaurantsOutputSchema, googlemapsNearbysearchRestaurantsParamsSchema, firecrawlScrapeUrlOutputSchema, firecrawlScrapeUrlParamsSchema, resendSendEmailOutputSchema, firecrawlScrapeTweetDataWithNitterParamsSchema, firecrawlScrapeTweetDataWithNitterOutputSchema, resendSendEmailParamsSchema, linkedinCreateShareLinkedinPostUrlParamsSchema, linkedinCreateShareLinkedinPostUrlOutputSchema, xCreateShareXPostUrlParamsSchema, xCreateShareXPostUrlOutputSchema, finnhubSymbolLookupParamsSchema, finnhubSymbolLookupOutputSchema, finnhubGetBasicFinancialsParamsSchema, finnhubGetBasicFinancialsOutputSchema, confluenceFetchPageContentParamsSchema, confluenceFetchPageContentOutputSchema, snowflakeRunSnowflakeQueryParamsSchema, snowflakeRunSnowflakeQueryOutputSchema, lookerEnableUserByEmailParamsSchema, lookerEnableUserByEmailOutputSchema, googleOauthUpdateDocParamsSchema, googleOauthUpdateDocOutputSchema, googleOauthCreateSpreadsheetParamsSchema, googleOauthCreateSpreadsheetOutputSchema, googleOauthUpdateSpreadsheetParamsSchema, googleOauthUpdateSpreadsheetOutputSchema, googleOauthScheduleCalendarMeetingParamsSchema, googleOauthScheduleCalendarMeetingOutputSchema, googleOauthListCalendarsParamsSchema, googleOauthListCalendarsOutputSchema, googleOauthListCalendarEventsParamsSchema, googleOauthListCalendarEventsOutputSchema, googleOauthUpdateCalendarEventParamsSchema, googleOauthUpdateCalendarEventOutputSchema, googleOauthDeleteCalendarEventParamsSchema, googleOauthDeleteCalendarEventOutputSchema, googleOauthCreatePresentationParamsSchema, googleOauthCreatePresentationOutputSchema, googleOauthUpdatePresentationParamsSchema, googleOauthUpdatePresentationOutputSchema, googleOauthSearchDriveByKeywordsParamsSchema, googleOauthSearchDriveByKeywordsOutputSchema, googleOauthListGroupsOutputSchema, googleOauthListGroupsParamsSchema, googleOauthGetGroupOutputSchema, googleOauthGetGroupParamsSchema, googleOauthListGroupMembersOutputSchema, googleOauthListGroupMembersParamsSchema, googleOauthHasGroupMemberOutputSchema, googleOauthHasGroupMemberParamsSchema, googleOauthAddGroupMemberOutputSchema, googleOauthAddGroupMemberParamsSchema, googleOauthDeleteGroupMemberOutputSchema, googleOauthDeleteGroupMemberParamsSchema, gongGetGongTranscriptsParamsSchema, gongGetGongTranscriptsOutputSchema, ashbyCreateNoteParamsSchema, ashbyCreateNoteOutputSchema, ashbyGetCandidateInfoParamsSchema, ashbyGetCandidateInfoOutputSchema, salesforceUpdateRecordParamsSchema, salesforceUpdateRecordOutputSchema, salesforceCreateCaseParamsSchema, salesforceCreateCaseOutputSchema, salesforceGenerateSalesReportParamsSchema, salesforceGenerateSalesReportOutputSchema, salesforceGetRecordParamsSchema, salesforceGetRecordOutputSchema, ashbyListCandidatesParamsSchema, ashbyListCandidatesOutputSchema, ashbyListCandidateNotesParamsSchema, ashbyListCandidateNotesOutputSchema, ashbySearchCandidatesParamsSchema, ashbySearchCandidatesOutputSchema, ashbyCreateCandidateParamsSchema, ashbyCreateCandidateOutputSchema, ashbyUpdateCandidateParamsSchema, ashbyUpdateCandidateOutputSchema, microsoftMessageTeamsChatParamsSchema, microsoftMessageTeamsChatOutputSchema, microsoftMessageTeamsChannelParamsSchema, microsoftMessageTeamsChannelOutputSchema, salesforceGetSalesforceRecordsByQueryParamsSchema, salesforceGetSalesforceRecordsByQueryOutputSchema, asanaCommentTaskParamsSchema, asanaCommentTaskOutputSchema, asanaCreateTaskParamsSchema, asanaCreateTaskOutputSchema, asanaUpdateTaskParamsSchema, asanaUpdateTaskOutputSchema, githubCreateOrUpdateFileParamsSchema, githubCreateOrUpdateFileOutputSchema, githubCreateBranchParamsSchema, githubCreateBranchOutputSchema, githubCreatePullRequestParamsSchema, githubCreatePullRequestOutputSchema, microsoftUpdateSpreadsheetParamsSchema, microsoftUpdateSpreadsheetOutputSchema, microsoftUpdateDocumentParamsSchema, microsoftUpdateDocumentOutputSchema, microsoftGetDocumentParamsSchema, microsoftGetDocumentOutputSchema, salesforceFetchSalesforceSchemaByObjectParamsSchema, salesforceFetchSalesforceSchemaByObjectOutputSchema, githubListPullRequestsParamsSchema, githubListPullRequestsOutputSchema, jiraGetJiraIssuesByQueryOutputSchema, jiraGetJiraIssuesByQueryParamsSchema, salesforceCreateRecordParamsSchema, salesforceCreateRecordOutputSchema, firecrawlDeepResearchParamsSchema, firecrawlDeepResearchOutputSchema, bingGetTopNSearchResultUrlsParamsSchema, bingGetTopNSearchResultUrlsOutputSchema, ashbyAddCandidateToProjectParamsSchema, ashbyAddCandidateToProjectOutputSchema, microsoftCreateDocumentParamsSchema, microsoftCreateDocumentOutputSchema, kandjiGetFVRecoveryKeyForDeviceParamsSchema, kandjiGetFVRecoveryKeyForDeviceOutputSchema, asanaListAsanaTasksByProjectParamsSchema, asanaListAsanaTasksByProjectOutputSchema, asanaSearchTasksParamsSchema, asanaSearchTasksOutputSchema, asanaGetTasksDetailsParamsSchema, asanaGetTasksDetailsOutputSchema, notionSearchByTitleParamsSchema, notionSearchByTitleOutputSchema, jamfGetJamfComputerInventoryParamsSchema, jamfGetJamfComputerInventoryOutputSchema, jamfGetJamfFileVaultRecoveryKeyParamsSchema, jamfGetJamfFileVaultRecoveryKeyOutputSchema, googlemailSearchGmailMessagesOutputSchema, googlemailSearchGmailMessagesParamsSchema, googlemailListGmailThreadsOutputSchema, googlemailListGmailThreadsParamsSchema, oktaListOktaUsersParamsSchema, oktaListOktaUsersOutputSchema, oktaGetOktaUserParamsSchema, oktaGetOktaUserOutputSchema, oktaListOktaUserGroupsParamsSchema, oktaListOktaUserGroupsOutputSchema, oktaListOktaGroupsParamsSchema, oktaListOktaGroupsOutputSchema, oktaGetOktaGroupParamsSchema, oktaGetOktaGroupOutputSchema, oktaListOktaGroupMembersParamsSchema, oktaListOktaGroupMembersOutputSchema, oktaRemoveUserFromGroupParamsSchema, oktaRemoveUserFromGroupOutputSchema, oktaAddUserToGroupParamsSchema, oktaAddUserToGroupOutputSchema, oktaResetPasswordParamsSchema, oktaResetPasswordOutputSchema, oktaResetMFAParamsSchema, oktaResetMFAOutputSchema, oktaListMFAParamsSchema, oktaListMFAOutputSchema, jamfGetJamfUserComputerIdParamsSchema, jamfGetJamfUserComputerIdOutputSchema, jamfLockJamfComputerByIdParamsSchema, jamfLockJamfComputerByIdOutputSchema, oktaTriggerOktaWorkflowParamsSchema, oktaTriggerOktaWorkflowOutputSchema, gitlabSearchGroupOutputSchema, gitlabSearchGroupParamsSchema, githubSearchRepositoryOutputSchema, githubSearchRepositoryParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentOutputSchema, } from "./autogen/types.js";
2
2
  import validateAddress from "./providers/googlemaps/validateAddress.js";
3
3
  import add from "./providers/math/add.js";
4
4
  import fillTemplate from "./providers/generic/fillTemplate.js";
@@ -115,6 +115,7 @@ import createServiceDeskRequest from "./providers/jira/createServiceDeskRequest.
115
115
  import searchSalesforceRecords from "./providers/salesforce/searchSalesforceRecords.js";
116
116
  import getDriveFileContentById from "./providers/google-oauth/getDriveFileContentById.js";
117
117
  import searchDriveByQuery from "./providers/google-oauth/searchDriveByQuery.js";
118
+ import searchDriveByQueryAndGetFileContent from "./providers/google-oauth/searchDriveByQueryAndGetFileContent.js";
118
119
  const jiraActions = {
119
120
  getJiraIssuesByQuery: {
120
121
  fn: getJiraIssuesByQuery,
@@ -440,6 +441,11 @@ export const ActionMapper = {
440
441
  paramsSchema: googleOauthSearchDriveByQueryParamsSchema,
441
442
  outputSchema: googleOauthSearchDriveByQueryOutputSchema,
442
443
  },
444
+ searchDriveByQueryAndGetFileContent: {
445
+ fn: searchDriveByQueryAndGetFileContent,
446
+ paramsSchema: googleOauthSearchDriveByQueryAndGetFileContentParamsSchema,
447
+ outputSchema: googleOauthSearchDriveByQueryAndGetFileContentOutputSchema,
448
+ },
443
449
  getDriveFileContentById: {
444
450
  fn: getDriveFileContentById,
445
451
  paramsSchema: googleOauthGetDriveFileContentByIdParamsSchema,
@@ -67,6 +67,7 @@ export declare const googleOauthCreatePresentationDefinition: ActionTemplate;
67
67
  export declare const googleOauthUpdatePresentationDefinition: ActionTemplate;
68
68
  export declare const googleOauthSearchDriveByKeywordsDefinition: ActionTemplate;
69
69
  export declare const googleOauthSearchDriveByQueryDefinition: ActionTemplate;
70
+ export declare const googleOauthSearchDriveByQueryAndGetFileContentDefinition: ActionTemplate;
70
71
  export declare const googleOauthGetDriveFileContentByIdDefinition: ActionTemplate;
71
72
  export declare const googleOauthListGroupsDefinition: ActionTemplate;
72
73
  export declare const googleOauthGetGroupDefinition: ActionTemplate;
@@ -6193,11 +6193,11 @@ export const googleOauthSearchDriveByKeywordsDefinition = {
6193
6193
  provider: "googleOauth",
6194
6194
  };
6195
6195
  export const googleOauthSearchDriveByQueryDefinition = {
6196
- description: "Search Google Drive files based on a gdrive query provided.",
6196
+ description: "Search Google Drive files based on a google drive query provided.",
6197
6197
  scopes: ["drive.readonly"],
6198
6198
  parameters: {
6199
6199
  type: "object",
6200
- required: ["query"],
6200
+ required: ["query", "searchDriveByDrive"],
6201
6201
  properties: {
6202
6202
  query: {
6203
6203
  type: "string",
@@ -6207,6 +6207,14 @@ export const googleOauthSearchDriveByQueryDefinition = {
6207
6207
  type: "number",
6208
6208
  description: "The maximum number of files to return",
6209
6209
  },
6210
+ searchDriveByDrive: {
6211
+ type: "boolean",
6212
+ description: "Whether we should search drive by drive or run a general search",
6213
+ },
6214
+ orderByQuery: {
6215
+ type: "string",
6216
+ description: "The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'",
6217
+ },
6210
6218
  },
6211
6219
  },
6212
6220
  output: {
@@ -6252,6 +6260,82 @@ export const googleOauthSearchDriveByQueryDefinition = {
6252
6260
  name: "searchDriveByQuery",
6253
6261
  provider: "googleOauth",
6254
6262
  };
6263
+ export const googleOauthSearchDriveByQueryAndGetFileContentDefinition = {
6264
+ description: "Search Google Drive files based on a google drive query provided and get content for each file",
6265
+ scopes: ["drive.readonly"],
6266
+ parameters: {
6267
+ type: "object",
6268
+ required: ["query", "searchDriveByDrive"],
6269
+ properties: {
6270
+ query: {
6271
+ type: "string",
6272
+ description: "The query to search for in file contents.",
6273
+ },
6274
+ limit: {
6275
+ type: "number",
6276
+ description: "The maximum number of files to return",
6277
+ },
6278
+ fileSizeLimit: {
6279
+ type: "number",
6280
+ description: "The maximum length of a file in characters",
6281
+ },
6282
+ searchDriveByDrive: {
6283
+ type: "boolean",
6284
+ description: "Whether we should search drive by drive or run a general search",
6285
+ },
6286
+ orderByQuery: {
6287
+ type: "string",
6288
+ description: "The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'",
6289
+ },
6290
+ },
6291
+ },
6292
+ output: {
6293
+ type: "object",
6294
+ required: ["success"],
6295
+ properties: {
6296
+ success: {
6297
+ type: "boolean",
6298
+ description: "Whether the search was successful",
6299
+ },
6300
+ files: {
6301
+ type: "array",
6302
+ description: "List of files matching the search",
6303
+ items: {
6304
+ type: "object",
6305
+ required: ["id", "name", "mimeType", "url"],
6306
+ properties: {
6307
+ id: {
6308
+ type: "string",
6309
+ description: "The file ID",
6310
+ },
6311
+ name: {
6312
+ type: "string",
6313
+ description: "The file name",
6314
+ },
6315
+ mimeType: {
6316
+ type: "string",
6317
+ description: "The MIME type of the file",
6318
+ },
6319
+ url: {
6320
+ type: "string",
6321
+ description: "The web link to view the file",
6322
+ },
6323
+ content: {
6324
+ type: "string",
6325
+ description: "The data returned from the file limited by fileLimit",
6326
+ },
6327
+ },
6328
+ },
6329
+ },
6330
+ error: {
6331
+ type: "string",
6332
+ description: "Error message if search failed",
6333
+ },
6334
+ },
6335
+ },
6336
+ name: "searchDriveByQueryAndGetFileContent",
6337
+ provider: "googleOauth",
6338
+ };
6255
6339
  export const googleOauthGetDriveFileContentByIdDefinition = {
6256
6340
  description: "Get text content of a Google Drive file by its ID.",
6257
6341
  scopes: ["drive.readonly"],
@@ -3303,12 +3303,18 @@ export type googleOauthSearchDriveByKeywordsFunction = ActionFunction<googleOaut
3303
3303
  export declare const googleOauthSearchDriveByQueryParamsSchema: z.ZodObject<{
3304
3304
  query: z.ZodString;
3305
3305
  limit: z.ZodOptional<z.ZodNumber>;
3306
+ searchDriveByDrive: z.ZodBoolean;
3307
+ orderByQuery: z.ZodOptional<z.ZodString>;
3306
3308
  }, "strip", z.ZodTypeAny, {
3307
3309
  query: string;
3310
+ searchDriveByDrive: boolean;
3308
3311
  limit?: number | undefined;
3312
+ orderByQuery?: string | undefined;
3309
3313
  }, {
3310
3314
  query: string;
3315
+ searchDriveByDrive: boolean;
3311
3316
  limit?: number | undefined;
3317
+ orderByQuery?: string | undefined;
3312
3318
  }>;
3313
3319
  export type googleOauthSearchDriveByQueryParamsType = z.infer<typeof googleOauthSearchDriveByQueryParamsSchema>;
3314
3320
  export declare const googleOauthSearchDriveByQueryOutputSchema: z.ZodObject<{
@@ -3351,6 +3357,71 @@ export declare const googleOauthSearchDriveByQueryOutputSchema: z.ZodObject<{
3351
3357
  }>;
3352
3358
  export type googleOauthSearchDriveByQueryOutputType = z.infer<typeof googleOauthSearchDriveByQueryOutputSchema>;
3353
3359
  export type googleOauthSearchDriveByQueryFunction = ActionFunction<googleOauthSearchDriveByQueryParamsType, AuthParamsType, googleOauthSearchDriveByQueryOutputType>;
3360
+ export declare const googleOauthSearchDriveByQueryAndGetFileContentParamsSchema: z.ZodObject<{
3361
+ query: z.ZodString;
3362
+ limit: z.ZodOptional<z.ZodNumber>;
3363
+ fileSizeLimit: z.ZodOptional<z.ZodNumber>;
3364
+ searchDriveByDrive: z.ZodBoolean;
3365
+ orderByQuery: z.ZodOptional<z.ZodString>;
3366
+ }, "strip", z.ZodTypeAny, {
3367
+ query: string;
3368
+ searchDriveByDrive: boolean;
3369
+ limit?: number | undefined;
3370
+ orderByQuery?: string | undefined;
3371
+ fileSizeLimit?: number | undefined;
3372
+ }, {
3373
+ query: string;
3374
+ searchDriveByDrive: boolean;
3375
+ limit?: number | undefined;
3376
+ orderByQuery?: string | undefined;
3377
+ fileSizeLimit?: number | undefined;
3378
+ }>;
3379
+ export type googleOauthSearchDriveByQueryAndGetFileContentParamsType = z.infer<typeof googleOauthSearchDriveByQueryAndGetFileContentParamsSchema>;
3380
+ export declare const googleOauthSearchDriveByQueryAndGetFileContentOutputSchema: z.ZodObject<{
3381
+ success: z.ZodBoolean;
3382
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
3383
+ id: z.ZodString;
3384
+ name: z.ZodString;
3385
+ mimeType: z.ZodString;
3386
+ url: z.ZodString;
3387
+ content: z.ZodOptional<z.ZodString>;
3388
+ }, "strip", z.ZodTypeAny, {
3389
+ name: string;
3390
+ id: string;
3391
+ url: string;
3392
+ mimeType: string;
3393
+ content?: string | undefined;
3394
+ }, {
3395
+ name: string;
3396
+ id: string;
3397
+ url: string;
3398
+ mimeType: string;
3399
+ content?: string | undefined;
3400
+ }>, "many">>;
3401
+ error: z.ZodOptional<z.ZodString>;
3402
+ }, "strip", z.ZodTypeAny, {
3403
+ success: boolean;
3404
+ error?: string | undefined;
3405
+ files?: {
3406
+ name: string;
3407
+ id: string;
3408
+ url: string;
3409
+ mimeType: string;
3410
+ content?: string | undefined;
3411
+ }[] | undefined;
3412
+ }, {
3413
+ success: boolean;
3414
+ error?: string | undefined;
3415
+ files?: {
3416
+ name: string;
3417
+ id: string;
3418
+ url: string;
3419
+ mimeType: string;
3420
+ content?: string | undefined;
3421
+ }[] | undefined;
3422
+ }>;
3423
+ export type googleOauthSearchDriveByQueryAndGetFileContentOutputType = z.infer<typeof googleOauthSearchDriveByQueryAndGetFileContentOutputSchema>;
3424
+ export type googleOauthSearchDriveByQueryAndGetFileContentFunction = ActionFunction<googleOauthSearchDriveByQueryAndGetFileContentParamsType, AuthParamsType, googleOauthSearchDriveByQueryAndGetFileContentOutputType>;
3354
3425
  export declare const googleOauthGetDriveFileContentByIdParamsSchema: z.ZodObject<{
3355
3426
  fileId: z.ZodString;
3356
3427
  limit: z.ZodNumber;
@@ -2386,6 +2386,11 @@ export const googleOauthSearchDriveByKeywordsOutputSchema = z.object({
2386
2386
  export const googleOauthSearchDriveByQueryParamsSchema = z.object({
2387
2387
  query: z.string().describe("The query to search for in file contents."),
2388
2388
  limit: z.number().describe("The maximum number of files to return").optional(),
2389
+ searchDriveByDrive: z.boolean().describe("Whether we should search drive by drive or run a general search"),
2390
+ orderByQuery: z
2391
+ .string()
2392
+ .describe("The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'")
2393
+ .optional(),
2389
2394
  });
2390
2395
  export const googleOauthSearchDriveByQueryOutputSchema = z.object({
2391
2396
  success: z.boolean().describe("Whether the search was successful"),
@@ -2400,6 +2405,30 @@ export const googleOauthSearchDriveByQueryOutputSchema = z.object({
2400
2405
  .optional(),
2401
2406
  error: z.string().describe("Error message if search failed").optional(),
2402
2407
  });
2408
+ export const googleOauthSearchDriveByQueryAndGetFileContentParamsSchema = z.object({
2409
+ query: z.string().describe("The query to search for in file contents."),
2410
+ limit: z.number().describe("The maximum number of files to return").optional(),
2411
+ fileSizeLimit: z.number().describe("The maximum length of a file in characters").optional(),
2412
+ searchDriveByDrive: z.boolean().describe("Whether we should search drive by drive or run a general search"),
2413
+ orderByQuery: z
2414
+ .string()
2415
+ .describe("The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'")
2416
+ .optional(),
2417
+ });
2418
+ export const googleOauthSearchDriveByQueryAndGetFileContentOutputSchema = z.object({
2419
+ success: z.boolean().describe("Whether the search was successful"),
2420
+ files: z
2421
+ .array(z.object({
2422
+ id: z.string().describe("The file ID"),
2423
+ name: z.string().describe("The file name"),
2424
+ mimeType: z.string().describe("The MIME type of the file"),
2425
+ url: z.string().describe("The web link to view the file"),
2426
+ content: z.string().describe("The data returned from the file limited by fileLimit").optional(),
2427
+ }))
2428
+ .describe("List of files matching the search")
2429
+ .optional(),
2430
+ error: z.string().describe("Error message if search failed").optional(),
2431
+ });
2403
2432
  export const googleOauthGetDriveFileContentByIdParamsSchema = z.object({
2404
2433
  fileId: z.string().describe("The ID of the file to get content from"),
2405
2434
  limit: z.number().describe("The character limit for the file content"),
@@ -1,4 +1,4 @@
1
- import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
1
+ import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, } from "./autogen/templates.js";
2
2
  export const ACTION_GROUPS = {
3
3
  GENERIC: {
4
4
  description: "Generic utility actions",
@@ -47,6 +47,7 @@ export const ACTION_GROUPS = {
47
47
  googleOauthUpdatePresentationDefinition,
48
48
  googleOauthSearchDriveByKeywordsDefinition,
49
49
  googleOauthSearchDriveByQueryDefinition,
50
+ googleOauthSearchDriveByQueryAndGetFileContentDefinition,
50
51
  googleOauthGetDriveFileContentByIdDefinition,
51
52
  ],
52
53
  },
@@ -34,12 +34,8 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
34
34
  const codeResults = codeResultsResponse.data.items.slice(0, MAX_CODE_RESULTS).map(item => ({
35
35
  name: item.name,
36
36
  path: item.path,
37
- sha: item.sha,
37
+ sha: item.sha.slice(0, 7),
38
38
  url: item.url,
39
- repository: {
40
- full_name: item.repository.full_name,
41
- html_url: item.repository.html_url,
42
- },
43
39
  score: item.score,
44
40
  textMatches: item.text_matches
45
41
  ? item.text_matches.map(match => {
@@ -9,26 +9,47 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { axiosClient } from "../../util/axiosClient.js";
11
11
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
+ // Helper function to check if a file should be excluded (images and folders)
13
+ const shouldExcludeFile = (file) => {
14
+ const mimeType = file.mimeType.toLowerCase();
15
+ // Exclude folders
16
+ if (mimeType === "application/vnd.google-apps.folder") {
17
+ return true;
18
+ }
19
+ // Exclude common image formats
20
+ const imageTypes = [
21
+ "image/jpeg",
22
+ "image/jpg",
23
+ "image/png",
24
+ "image/gif",
25
+ "image/bmp",
26
+ "image/svg+xml",
27
+ "image/webp",
28
+ "image/tiff",
29
+ "image/ico",
30
+ "image/heic",
31
+ "image/heif",
32
+ ];
33
+ return imageTypes.includes(mimeType);
34
+ };
35
+ // Helper function to filter files
36
+ const filterReadableFiles = (files) => {
37
+ return files.filter(file => !shouldExcludeFile(file));
38
+ };
12
39
  const searchDriveByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- var _b;
14
40
  if (!authParams.authToken) {
15
41
  return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
16
42
  }
17
- const { query, limit } = params;
18
- const url = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives`;
43
+ const { query, limit, searchDriveByDrive, orderByQuery } = params;
44
+ // Can't use orderBy on quereis that include fullText
45
+ const safeOrderBy = query.includes("fullText") ? undefined : orderByQuery;
19
46
  try {
20
- const res = yield axiosClient.get(url, {
21
- headers: {
22
- Authorization: `Bearer ${authParams.authToken}`,
23
- },
24
- });
25
- const files = ((_b = res.data.files) === null || _b === void 0 ? void 0 : _b.map((file) => ({
26
- id: file.id || "",
27
- name: file.name || "",
28
- mimeType: file.mimeType || "",
29
- url: file.webViewLink || "",
30
- }))) || [];
31
- return { success: true, files: limit ? files.splice(0, limit) : files };
47
+ if (searchDriveByDrive) {
48
+ return yield searchAllDrivesIndividually(query, authParams.authToken, limit, safeOrderBy);
49
+ }
50
+ else {
51
+ return yield searchAllDrivesAtOnce(query, authParams.authToken, limit, safeOrderBy);
52
+ }
32
53
  }
33
54
  catch (error) {
34
55
  console.error("Error searching Google Drive", error);
@@ -39,4 +60,108 @@ const searchDriveByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({
39
60
  };
40
61
  }
41
62
  });
63
+ // Original search method - search all drives at once
64
+ const searchAllDrivesAtOnce = (query, authToken, limit, orderByQuery) => __awaiter(void 0, void 0, void 0, function* () {
65
+ var _a;
66
+ const orderBy = orderByQuery || "modifiedTime desc";
67
+ const url = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives&pageSize=1000&orderBy=${encodeURIComponent(orderBy)}`;
68
+ const res = yield axiosClient.get(url, {
69
+ headers: {
70
+ Authorization: `Bearer ${authToken}`,
71
+ },
72
+ });
73
+ const files = ((_a = res.data.files) === null || _a === void 0 ? void 0 : _a.map((file) => ({
74
+ id: file.id || "",
75
+ name: file.name || "",
76
+ mimeType: file.mimeType || "",
77
+ url: file.webViewLink || "",
78
+ }))) || [];
79
+ // Filter out images and folders
80
+ const readableFiles = filterReadableFiles(files);
81
+ return {
82
+ success: true,
83
+ files: limit ? readableFiles.slice(0, limit) : readableFiles,
84
+ };
85
+ });
86
+ // New search method - search each drive individually and aggregate results
87
+ const searchAllDrivesIndividually = (query, authToken, limit, orderByQuery) => __awaiter(void 0, void 0, void 0, function* () {
88
+ const drives = yield getAllDrives(authToken);
89
+ let allFiles = [];
90
+ // Search each drive individually
91
+ for (const drive of drives) {
92
+ try {
93
+ const driveFiles = yield searchSingleDrive(query, drive.id, authToken, orderByQuery);
94
+ // Filter out images and folders before adding to results
95
+ const readableDriveFiles = filterReadableFiles(driveFiles);
96
+ allFiles = allFiles.concat(readableDriveFiles);
97
+ // If we have a limit and we've reached it, break early
98
+ if (limit && allFiles.length >= limit) {
99
+ break;
100
+ }
101
+ }
102
+ catch (error) {
103
+ console.error(`Error searching drive ${drive.name} (${drive.id}):`, error);
104
+ }
105
+ }
106
+ return {
107
+ success: true,
108
+ files: limit ? allFiles.slice(0, limit) : allFiles,
109
+ };
110
+ });
111
+ // Get all drives (shared drives + user's drive)
112
+ const getAllDrives = (authToken) => __awaiter(void 0, void 0, void 0, function* () {
113
+ var _a;
114
+ const drives = [];
115
+ // Add user's personal drive (My Drive)
116
+ drives.push({ id: "root", name: "My Drive" });
117
+ // Get all shared drives
118
+ let nextPageToken;
119
+ do {
120
+ const url = `https://www.googleapis.com/drive/v3/drives?pageSize=100${nextPageToken ? `&pageToken=${nextPageToken}` : ""}`;
121
+ const res = yield axiosClient.get(url, {
122
+ headers: {
123
+ Authorization: `Bearer ${authToken}`,
124
+ },
125
+ });
126
+ const sharedDrives = ((_a = res.data.drives) === null || _a === void 0 ? void 0 : _a.map((drive) => ({
127
+ id: drive.id || "",
128
+ name: drive.name || "",
129
+ }))) || [];
130
+ drives.push(...sharedDrives);
131
+ nextPageToken = res.data.nextPageToken;
132
+ } while (nextPageToken);
133
+ return drives;
134
+ });
135
+ // Search a single drive
136
+ const searchSingleDrive = (query, driveId, authToken, orderByQuery) => __awaiter(void 0, void 0, void 0, function* () {
137
+ var _a;
138
+ const files = [];
139
+ const orderBy = orderByQuery || "modifiedTime desc";
140
+ let nextPageToken;
141
+ do {
142
+ let url;
143
+ if (driveId === "root") {
144
+ // Search in user's personal drive
145
+ url = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink),nextPageToken&pageSize=1000&orderBy=${encodeURIComponent(orderBy)}${nextPageToken ? `&pageToken=${nextPageToken}` : ""}`;
146
+ }
147
+ else {
148
+ // Search in specific shared drive
149
+ url = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(`${query} and parents in '${driveId}'`)}&fields=files(id,name,mimeType,webViewLink),nextPageToken&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=drive&driveId=${driveId}&pageSize=1000&orderBy=${encodeURIComponent(orderBy)}${nextPageToken ? `&pageToken=${nextPageToken}` : ""}`;
150
+ }
151
+ const res = yield axiosClient.get(url, {
152
+ headers: {
153
+ Authorization: `Bearer ${authToken}`,
154
+ },
155
+ });
156
+ const driveFiles = ((_a = res.data.files) === null || _a === void 0 ? void 0 : _a.map((file) => ({
157
+ id: file.id || "",
158
+ name: file.name || "",
159
+ mimeType: file.mimeType || "",
160
+ url: file.webViewLink || "",
161
+ }))) || [];
162
+ files.push(...driveFiles);
163
+ nextPageToken = res.data.nextPageToken;
164
+ } while (nextPageToken);
165
+ return files;
166
+ });
42
167
  export default searchDriveByQuery;
@@ -0,0 +1,3 @@
1
+ import type { googleOauthSearchDriveByQueryAndGetFileContentFunction } from "../../autogen/types.js";
2
+ declare const searchDriveByQueryAndGetFileContent: googleOauthSearchDriveByQueryAndGetFileContentFunction;
3
+ export default searchDriveByQueryAndGetFileContent;
@@ -0,0 +1,58 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
11
+ import searchDriveByQuery from "./searchDriveByQuery.js";
12
+ import getDriveFileContentById from "./getDriveFileContentById.js";
13
+ const searchDriveByQueryAndGetFileContent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
+ var _b;
15
+ if (!authParams.authToken) {
16
+ return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
17
+ }
18
+ const { query, limit, searchDriveByDrive, orderByQuery, fileSizeLimit } = params;
19
+ // First, perform the search
20
+ const searchResult = yield searchDriveByQuery({
21
+ params: { query, limit, searchDriveByDrive, orderByQuery },
22
+ authParams,
23
+ });
24
+ // If search failed, return error
25
+ if (!searchResult.success) {
26
+ return { success: false, error: searchResult.error, files: [] };
27
+ }
28
+ // For each file, fetch its content
29
+ const filesWithContent = [];
30
+ const files = (_b = searchResult.files) !== null && _b !== void 0 ? _b : [];
31
+ for (const file of files) {
32
+ try {
33
+ const contentResult = yield getDriveFileContentById({
34
+ params: { fileId: file.id, limit: fileSizeLimit !== null && fileSizeLimit !== void 0 ? fileSizeLimit : 1000 },
35
+ authParams,
36
+ });
37
+ filesWithContent.push({
38
+ id: file.id,
39
+ name: file.name,
40
+ mimeType: file.mimeType,
41
+ url: file.url,
42
+ content: contentResult.success ? contentResult.content : undefined,
43
+ });
44
+ }
45
+ catch (error) {
46
+ console.error(`Error fetching content for file ${file.id}:`, error);
47
+ filesWithContent.push({
48
+ id: file.id,
49
+ name: file.name,
50
+ mimeType: file.mimeType,
51
+ url: file.url,
52
+ });
53
+ }
54
+ }
55
+ // Return combined results
56
+ return { success: true, files: filesWithContent };
57
+ });
58
+ export default searchDriveByQueryAndGetFileContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,