@credal/actions 0.2.67 → 0.2.68
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 +7 -1
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +46 -0
- package/dist/actions/autogen/types.d.ts +35 -6
- package/dist/actions/autogen/types.js +15 -0
- package/dist/actions/providers/confluence/updatePage.js +14 -15
- package/dist/actions/providers/generic/fillTemplateAction.d.ts +7 -0
- package/dist/actions/providers/generic/fillTemplateAction.js +18 -0
- package/dist/actions/providers/generic/genericApiCall.d.ts +3 -0
- package/dist/actions/providers/generic/genericApiCall.js +38 -0
- package/dist/actions/providers/google-oauth/getDriveContentById.d.ts +3 -0
- package/dist/actions/providers/google-oauth/getDriveContentById.js +161 -0
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.js +47 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.js +110 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.js +78 -0
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.d.ts +15 -0
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.js +129 -0
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.d.ts +3 -0
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.js +154 -0
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.d.ts +3 -0
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.js +45 -0
- package/dist/actions/providers/zendesk/getTicketDetails.js +2 -2
- package/dist/actions/providers/zendesk/searchZendeskByQuery.d.ts +3 -0
- package/dist/actions/providers/zendesk/searchZendeskByQuery.js +35 -0
- package/dist/actions/util/axiosClient.d.ts +1 -0
- package/dist/actions/util/axiosClient.js +16 -0
- package/package.json +2 -1
- package/dist/actions/providers/jamf/types.d.ts +0 -8
- package/dist/actions/providers/jamf/types.js +0 -7
|
@@ -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, githubSearchOrganizationOutputSchema, githubSearchOrganizationParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, linearGetIssuesParamsSchema, linearGetIssuesOutputSchema, linearGetIssueDetailsParamsSchema, linearGetIssueDetailsOutputSchema, linearGetProjectDetailsParamsSchema, linearGetProjectDetailsOutputSchema, linearGetTeamDetailsParamsSchema, linearGetTeamDetailsOutputSchema, linearGetProjectsParamsSchema, linearGetProjectsOutputSchema, linearGetTeamsParamsSchema, linearGetTeamsOutputSchema, gitlabGetFileContentParamsSchema, gitlabGetFileContentOutputSchema, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, } 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, zendeskSearchZendeskByQueryOutputSchema, zendeskSearchZendeskByQueryParamsSchema, 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, githubSearchOrganizationOutputSchema, githubSearchOrganizationParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, linearGetIssuesParamsSchema, linearGetIssuesOutputSchema, linearGetIssueDetailsParamsSchema, linearGetIssueDetailsOutputSchema, linearGetProjectDetailsParamsSchema, linearGetProjectDetailsOutputSchema, linearGetTeamDetailsParamsSchema, linearGetTeamDetailsOutputSchema, linearGetProjectsParamsSchema, linearGetProjectsOutputSchema, linearGetTeamsParamsSchema, linearGetTeamsOutputSchema, gitlabGetFileContentParamsSchema, gitlabGetFileContentOutputSchema, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, } 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";
|
|
@@ -12,6 +12,7 @@ import updateTicketStatus from "./providers/zendesk/updateTicketStatus.js";
|
|
|
12
12
|
import addCommentToTicket from "./providers/zendesk/addCommentToTicket.js";
|
|
13
13
|
import assignTicket from "./providers/zendesk/assignTicket.js";
|
|
14
14
|
import listZendeskTickets from "./providers/zendesk/listTickets.js";
|
|
15
|
+
import searchZendeskByQuery from "./providers/zendesk/searchZendeskByQuery.js";
|
|
15
16
|
import assignJiraTicket from "./providers/jira/assignJiraTicket.js";
|
|
16
17
|
import commentJiraTicket from "./providers/jira/commentJiraTicket.js";
|
|
17
18
|
import createJiraTicket from "./providers/jira/createJiraTicket.js";
|
|
@@ -345,6 +346,11 @@ export const ActionMapper = {
|
|
|
345
346
|
paramsSchema: zendeskListZendeskTicketsParamsSchema,
|
|
346
347
|
outputSchema: zendeskListZendeskTicketsOutputSchema,
|
|
347
348
|
},
|
|
349
|
+
searchZendeskByQuery: {
|
|
350
|
+
fn: searchZendeskByQuery,
|
|
351
|
+
paramsSchema: zendeskSearchZendeskByQueryParamsSchema,
|
|
352
|
+
outputSchema: zendeskSearchZendeskByQueryOutputSchema,
|
|
353
|
+
},
|
|
348
354
|
},
|
|
349
355
|
mongo: {
|
|
350
356
|
insertMongoDoc: {
|
|
@@ -45,6 +45,7 @@ export declare const zendeskGetTicketDetailsDefinition: ActionTemplate;
|
|
|
45
45
|
export declare const zendeskUpdateTicketStatusDefinition: ActionTemplate;
|
|
46
46
|
export declare const zendeskAddCommentToTicketDefinition: ActionTemplate;
|
|
47
47
|
export declare const zendeskAssignTicketDefinition: ActionTemplate;
|
|
48
|
+
export declare const zendeskSearchZendeskByQueryDefinition: ActionTemplate;
|
|
48
49
|
export declare const linkedinCreateShareLinkedinPostUrlDefinition: ActionTemplate;
|
|
49
50
|
export declare const xCreateShareXPostUrlDefinition: ActionTemplate;
|
|
50
51
|
export declare const mongoInsertMongoDocDefinition: ActionTemplate;
|
|
@@ -2347,6 +2347,52 @@ export const zendeskAssignTicketDefinition = {
|
|
|
2347
2347
|
name: "assignTicket",
|
|
2348
2348
|
provider: "zendesk",
|
|
2349
2349
|
};
|
|
2350
|
+
export const zendeskSearchZendeskByQueryDefinition = {
|
|
2351
|
+
description: "Search Zendesk objects by query with flexible filtering options",
|
|
2352
|
+
scopes: [],
|
|
2353
|
+
parameters: {
|
|
2354
|
+
type: "object",
|
|
2355
|
+
required: ["subdomain", "query"],
|
|
2356
|
+
properties: {
|
|
2357
|
+
subdomain: {
|
|
2358
|
+
type: "string",
|
|
2359
|
+
description: "The subdomain of the Zendesk account",
|
|
2360
|
+
},
|
|
2361
|
+
query: {
|
|
2362
|
+
type: "string",
|
|
2363
|
+
description: 'Search query string that can include filters like status, priority, tags, assignee, etc. Examples - status:open, priority:high, tags:bug, assignee:user@example.com, or combination like "status:open priority:high"',
|
|
2364
|
+
},
|
|
2365
|
+
objectType: {
|
|
2366
|
+
type: "string",
|
|
2367
|
+
enum: ["ticket", "user", "organization", "group"],
|
|
2368
|
+
description: "The type of Zendesk object to search (defaults to ticket)",
|
|
2369
|
+
},
|
|
2370
|
+
limit: {
|
|
2371
|
+
type: "number",
|
|
2372
|
+
description: "Maximum number of objects to return (optional, defaults to 100)",
|
|
2373
|
+
},
|
|
2374
|
+
},
|
|
2375
|
+
},
|
|
2376
|
+
output: {
|
|
2377
|
+
type: "object",
|
|
2378
|
+
required: ["results", "count"],
|
|
2379
|
+
properties: {
|
|
2380
|
+
results: {
|
|
2381
|
+
type: "array",
|
|
2382
|
+
description: "List of objects matching the query",
|
|
2383
|
+
items: {
|
|
2384
|
+
type: "object",
|
|
2385
|
+
},
|
|
2386
|
+
},
|
|
2387
|
+
count: {
|
|
2388
|
+
type: "number",
|
|
2389
|
+
description: "Number of objects found",
|
|
2390
|
+
},
|
|
2391
|
+
},
|
|
2392
|
+
},
|
|
2393
|
+
name: "searchZendeskByQuery",
|
|
2394
|
+
provider: "zendesk",
|
|
2395
|
+
};
|
|
2350
2396
|
export const linkedinCreateShareLinkedinPostUrlDefinition = {
|
|
2351
2397
|
description: "Create a share linkedin post link",
|
|
2352
2398
|
scopes: [],
|
|
@@ -2201,6 +2201,35 @@ export type zendeskAssignTicketParamsType = z.infer<typeof zendeskAssignTicketPa
|
|
|
2201
2201
|
export declare const zendeskAssignTicketOutputSchema: z.ZodVoid;
|
|
2202
2202
|
export type zendeskAssignTicketOutputType = z.infer<typeof zendeskAssignTicketOutputSchema>;
|
|
2203
2203
|
export type zendeskAssignTicketFunction = ActionFunction<zendeskAssignTicketParamsType, AuthParamsType, zendeskAssignTicketOutputType>;
|
|
2204
|
+
export declare const zendeskSearchZendeskByQueryParamsSchema: z.ZodObject<{
|
|
2205
|
+
subdomain: z.ZodString;
|
|
2206
|
+
query: z.ZodString;
|
|
2207
|
+
objectType: z.ZodOptional<z.ZodEnum<["ticket", "user", "organization", "group"]>>;
|
|
2208
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2209
|
+
}, "strip", z.ZodTypeAny, {
|
|
2210
|
+
query: string;
|
|
2211
|
+
subdomain: string;
|
|
2212
|
+
limit?: number | undefined;
|
|
2213
|
+
objectType?: "user" | "ticket" | "organization" | "group" | undefined;
|
|
2214
|
+
}, {
|
|
2215
|
+
query: string;
|
|
2216
|
+
subdomain: string;
|
|
2217
|
+
limit?: number | undefined;
|
|
2218
|
+
objectType?: "user" | "ticket" | "organization" | "group" | undefined;
|
|
2219
|
+
}>;
|
|
2220
|
+
export type zendeskSearchZendeskByQueryParamsType = z.infer<typeof zendeskSearchZendeskByQueryParamsSchema>;
|
|
2221
|
+
export declare const zendeskSearchZendeskByQueryOutputSchema: z.ZodObject<{
|
|
2222
|
+
results: z.ZodArray<z.ZodObject<{}, "strip", z.ZodAny, z.objectOutputType<{}, z.ZodAny, "strip">, z.objectInputType<{}, z.ZodAny, "strip">>, "many">;
|
|
2223
|
+
count: z.ZodNumber;
|
|
2224
|
+
}, "strip", z.ZodTypeAny, {
|
|
2225
|
+
results: z.objectOutputType<{}, z.ZodAny, "strip">[];
|
|
2226
|
+
count: number;
|
|
2227
|
+
}, {
|
|
2228
|
+
results: z.objectInputType<{}, z.ZodAny, "strip">[];
|
|
2229
|
+
count: number;
|
|
2230
|
+
}>;
|
|
2231
|
+
export type zendeskSearchZendeskByQueryOutputType = z.infer<typeof zendeskSearchZendeskByQueryOutputSchema>;
|
|
2232
|
+
export type zendeskSearchZendeskByQueryFunction = ActionFunction<zendeskSearchZendeskByQueryParamsType, AuthParamsType, zendeskSearchZendeskByQueryOutputType>;
|
|
2204
2233
|
export declare const linkedinCreateShareLinkedinPostUrlParamsSchema: z.ZodObject<{
|
|
2205
2234
|
text: z.ZodOptional<z.ZodString>;
|
|
2206
2235
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -3971,11 +4000,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
3971
4000
|
countryCode: z.ZodOptional<z.ZodString>;
|
|
3972
4001
|
}, "strip", z.ZodTypeAny, {
|
|
3973
4002
|
title?: string | undefined;
|
|
4003
|
+
organization?: string | undefined;
|
|
3974
4004
|
email?: string | undefined;
|
|
3975
4005
|
firstName?: string | undefined;
|
|
3976
4006
|
lastName?: string | undefined;
|
|
3977
4007
|
state?: string | undefined;
|
|
3978
|
-
organization?: string | undefined;
|
|
3979
4008
|
displayName?: string | undefined;
|
|
3980
4009
|
login?: string | undefined;
|
|
3981
4010
|
nickName?: string | undefined;
|
|
@@ -3995,11 +4024,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
3995
4024
|
countryCode?: string | undefined;
|
|
3996
4025
|
}, {
|
|
3997
4026
|
title?: string | undefined;
|
|
4027
|
+
organization?: string | undefined;
|
|
3998
4028
|
email?: string | undefined;
|
|
3999
4029
|
firstName?: string | undefined;
|
|
4000
4030
|
lastName?: string | undefined;
|
|
4001
4031
|
state?: string | undefined;
|
|
4002
|
-
organization?: string | undefined;
|
|
4003
4032
|
displayName?: string | undefined;
|
|
4004
4033
|
login?: string | undefined;
|
|
4005
4034
|
nickName?: string | undefined;
|
|
@@ -4025,11 +4054,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
4025
4054
|
status?: string | undefined;
|
|
4026
4055
|
profile?: {
|
|
4027
4056
|
title?: string | undefined;
|
|
4057
|
+
organization?: string | undefined;
|
|
4028
4058
|
email?: string | undefined;
|
|
4029
4059
|
firstName?: string | undefined;
|
|
4030
4060
|
lastName?: string | undefined;
|
|
4031
4061
|
state?: string | undefined;
|
|
4032
|
-
organization?: string | undefined;
|
|
4033
4062
|
displayName?: string | undefined;
|
|
4034
4063
|
login?: string | undefined;
|
|
4035
4064
|
nickName?: string | undefined;
|
|
@@ -4061,11 +4090,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
4061
4090
|
status?: string | undefined;
|
|
4062
4091
|
profile?: {
|
|
4063
4092
|
title?: string | undefined;
|
|
4093
|
+
organization?: string | undefined;
|
|
4064
4094
|
email?: string | undefined;
|
|
4065
4095
|
firstName?: string | undefined;
|
|
4066
4096
|
lastName?: string | undefined;
|
|
4067
4097
|
state?: string | undefined;
|
|
4068
|
-
organization?: string | undefined;
|
|
4069
4098
|
displayName?: string | undefined;
|
|
4070
4099
|
login?: string | undefined;
|
|
4071
4100
|
nickName?: string | undefined;
|
|
@@ -4102,11 +4131,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
4102
4131
|
status?: string | undefined;
|
|
4103
4132
|
profile?: {
|
|
4104
4133
|
title?: string | undefined;
|
|
4134
|
+
organization?: string | undefined;
|
|
4105
4135
|
email?: string | undefined;
|
|
4106
4136
|
firstName?: string | undefined;
|
|
4107
4137
|
lastName?: string | undefined;
|
|
4108
4138
|
state?: string | undefined;
|
|
4109
|
-
organization?: string | undefined;
|
|
4110
4139
|
displayName?: string | undefined;
|
|
4111
4140
|
login?: string | undefined;
|
|
4112
4141
|
nickName?: string | undefined;
|
|
@@ -4142,11 +4171,11 @@ export declare const oktaGetOktaUserOutputSchema: z.ZodObject<{
|
|
|
4142
4171
|
status?: string | undefined;
|
|
4143
4172
|
profile?: {
|
|
4144
4173
|
title?: string | undefined;
|
|
4174
|
+
organization?: string | undefined;
|
|
4145
4175
|
email?: string | undefined;
|
|
4146
4176
|
firstName?: string | undefined;
|
|
4147
4177
|
lastName?: string | undefined;
|
|
4148
4178
|
state?: string | undefined;
|
|
4149
|
-
organization?: string | undefined;
|
|
4150
4179
|
displayName?: string | undefined;
|
|
4151
4180
|
login?: string | undefined;
|
|
4152
4181
|
nickName?: string | undefined;
|
|
@@ -723,6 +723,21 @@ export const zendeskAssignTicketParamsSchema = z.object({
|
|
|
723
723
|
assigneeEmail: z.string().describe("The email address of the agent to assign the ticket to"),
|
|
724
724
|
});
|
|
725
725
|
export const zendeskAssignTicketOutputSchema = z.void();
|
|
726
|
+
export const zendeskSearchZendeskByQueryParamsSchema = z.object({
|
|
727
|
+
subdomain: z.string().describe("The subdomain of the Zendesk account"),
|
|
728
|
+
query: z
|
|
729
|
+
.string()
|
|
730
|
+
.describe('Search query string that can include filters like status, priority, tags, assignee, etc. Examples - status:open, priority:high, tags:bug, assignee:user@example.com, or combination like "status:open priority:high"'),
|
|
731
|
+
objectType: z
|
|
732
|
+
.enum(["ticket", "user", "organization", "group"])
|
|
733
|
+
.describe("The type of Zendesk object to search (defaults to ticket)")
|
|
734
|
+
.optional(),
|
|
735
|
+
limit: z.number().describe("Maximum number of objects to return (optional, defaults to 100)").optional(),
|
|
736
|
+
});
|
|
737
|
+
export const zendeskSearchZendeskByQueryOutputSchema = z.object({
|
|
738
|
+
results: z.array(z.object({}).catchall(z.any())).describe("List of objects matching the query"),
|
|
739
|
+
count: z.number().describe("Number of objects found"),
|
|
740
|
+
});
|
|
726
741
|
export const linkedinCreateShareLinkedinPostUrlParamsSchema = z.object({
|
|
727
742
|
text: z.string().describe("The text for the linkedin post").optional(),
|
|
728
743
|
url: z.string().describe("The url for the linkedin post").optional(),
|
|
@@ -8,30 +8,28 @@ 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
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
|
13
|
+
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
|
14
|
+
return {
|
|
18
15
|
baseURL: baseUrl,
|
|
19
16
|
headers: {
|
|
20
17
|
Accept: "application/json",
|
|
21
|
-
// Tokens are associated with a specific user.
|
|
22
18
|
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
23
19
|
},
|
|
24
|
-
}
|
|
25
|
-
return api;
|
|
20
|
+
};
|
|
26
21
|
}
|
|
27
22
|
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
28
|
-
const { pageId,
|
|
29
|
-
const { baseUrl, authToken } = authParams;
|
|
30
|
-
|
|
23
|
+
const { pageId, content, title } = params;
|
|
24
|
+
const { baseUrl, authToken, username } = authParams;
|
|
25
|
+
if (!baseUrl || !authToken || !username) {
|
|
26
|
+
throw new Error("Missing required authentication information");
|
|
27
|
+
}
|
|
28
|
+
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
|
31
29
|
// Get current version number
|
|
32
|
-
const response = yield
|
|
30
|
+
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
|
33
31
|
const currVersion = response.data.version.number;
|
|
34
|
-
|
|
32
|
+
const payload = {
|
|
35
33
|
id: pageId,
|
|
36
34
|
status: "current",
|
|
37
35
|
title,
|
|
@@ -42,6 +40,7 @@ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
42
40
|
version: {
|
|
43
41
|
number: currVersion + 1,
|
|
44
42
|
},
|
|
45
|
-
}
|
|
43
|
+
};
|
|
44
|
+
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
|
46
45
|
});
|
|
47
46
|
exports.default = confluenceUpdatePage;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 fillTemplateAction = (_a) => __awaiter(void 0, [_a], void 0, function* ({ template }) {
|
|
13
|
+
// Simply return the template without any modification
|
|
14
|
+
return {
|
|
15
|
+
result: template,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
exports.default = fillTemplateAction;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
const genericApiCall = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, }) {
|
|
17
|
+
try {
|
|
18
|
+
const { endpoint, method, headers, body } = params;
|
|
19
|
+
const response = yield (0, axios_1.default)({
|
|
20
|
+
url: endpoint,
|
|
21
|
+
method,
|
|
22
|
+
headers,
|
|
23
|
+
data: method !== "GET" ? body : undefined,
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
statusCode: response.status,
|
|
27
|
+
headers: response.headers,
|
|
28
|
+
data: response.data,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
33
|
+
throw Error("Axios Error: " + (error.message || "Failed to make API call"));
|
|
34
|
+
}
|
|
35
|
+
throw Error("Error: " + (error || "Failed to make API call"));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
exports.default = genericApiCall;
|
|
@@ -0,0 +1,161 @@
|
|
|
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 pdf from "pdf-parse/lib/pdf-parse.js";
|
|
11
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
12
|
+
import mammoth from "mammoth";
|
|
13
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
14
|
+
const getDriveFileContentByID = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
15
|
+
if (!authParams.authToken) {
|
|
16
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
|
17
|
+
}
|
|
18
|
+
const { fileId, limit } = params;
|
|
19
|
+
try {
|
|
20
|
+
// First, get file metadata to determine the file type
|
|
21
|
+
const metadataUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?fields=name,mimeType,size`;
|
|
22
|
+
const metadataRes = yield axiosClient.get(metadataUrl, {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const { name: fileName, mimeType, size } = metadataRes.data;
|
|
28
|
+
// Check if file is too large (50MB limit for safety)
|
|
29
|
+
if (size && parseInt(size) > 50 * 1024 * 1024) {
|
|
30
|
+
return {
|
|
31
|
+
success: false,
|
|
32
|
+
error: "File too large (>50MB)",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
let content = "";
|
|
36
|
+
// Handle different file types - read content directly
|
|
37
|
+
if (mimeType === "application/vnd.google-apps.document") {
|
|
38
|
+
// Google Docs - download as plain text
|
|
39
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=txt`;
|
|
40
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
43
|
+
},
|
|
44
|
+
responseType: 'text',
|
|
45
|
+
});
|
|
46
|
+
content = downloadRes.data;
|
|
47
|
+
}
|
|
48
|
+
else if (mimeType === "application/vnd.google-apps.spreadsheet") {
|
|
49
|
+
// Google Sheets - download as CSV
|
|
50
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=csv`;
|
|
51
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
54
|
+
},
|
|
55
|
+
responseType: 'text',
|
|
56
|
+
});
|
|
57
|
+
content = downloadRes.data;
|
|
58
|
+
}
|
|
59
|
+
else if (mimeType === "application/vnd.google-apps.presentation") {
|
|
60
|
+
// Google Slides - download as plain text
|
|
61
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=txt`;
|
|
62
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
63
|
+
headers: {
|
|
64
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
65
|
+
},
|
|
66
|
+
responseType: 'text',
|
|
67
|
+
});
|
|
68
|
+
content = downloadRes.data;
|
|
69
|
+
}
|
|
70
|
+
else if (mimeType === "application/pdf") {
|
|
71
|
+
// PDF files - use pdf-parse
|
|
72
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
73
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
74
|
+
headers: {
|
|
75
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
76
|
+
},
|
|
77
|
+
responseType: 'arraybuffer',
|
|
78
|
+
});
|
|
79
|
+
try {
|
|
80
|
+
const pdfData = yield pdf(downloadRes.data);
|
|
81
|
+
content = pdfData.text;
|
|
82
|
+
}
|
|
83
|
+
catch (pdfError) {
|
|
84
|
+
return {
|
|
85
|
+
success: false,
|
|
86
|
+
error: `Failed to parse PDF: ${pdfError instanceof Error ? pdfError.message : 'Unknown PDF error'}`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (mimeType === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ||
|
|
91
|
+
mimeType === "application/msword") {
|
|
92
|
+
// Word documents (.docx or .doc) - download and extract text using mammoth
|
|
93
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
94
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
97
|
+
},
|
|
98
|
+
responseType: 'arraybuffer',
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
// mammoth works with .docx files. It will ignore formatting and return raw text
|
|
102
|
+
const result = yield mammoth.extractRawText({ buffer: Buffer.from(downloadRes.data) });
|
|
103
|
+
content = result.value; // raw text
|
|
104
|
+
}
|
|
105
|
+
catch (wordError) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
error: `Failed to parse Word document: ${wordError instanceof Error ? wordError.message : 'Unknown Word error'}`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else if (mimeType === "text/plain" ||
|
|
113
|
+
mimeType === "text/html" ||
|
|
114
|
+
mimeType === "application/rtf" ||
|
|
115
|
+
(mimeType === null || mimeType === void 0 ? void 0 : mimeType.startsWith("text/"))) {
|
|
116
|
+
// Text-based files
|
|
117
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
118
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
119
|
+
headers: {
|
|
120
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
121
|
+
},
|
|
122
|
+
responseType: 'text',
|
|
123
|
+
});
|
|
124
|
+
content = downloadRes.data;
|
|
125
|
+
}
|
|
126
|
+
else if (mimeType === null || mimeType === void 0 ? void 0 : mimeType.startsWith("image/")) {
|
|
127
|
+
// Skip images
|
|
128
|
+
return {
|
|
129
|
+
success: false,
|
|
130
|
+
error: "Image files are not supported for text extraction",
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// Unsupported file type
|
|
135
|
+
return {
|
|
136
|
+
success: false,
|
|
137
|
+
error: `Unsupported file type: ${mimeType}`,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
content = content.trim();
|
|
141
|
+
const originalLength = content.length;
|
|
142
|
+
// Naive way to truncate content
|
|
143
|
+
if (limit && content.length > limit) {
|
|
144
|
+
content = content.substring(0, limit);
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
success: true,
|
|
148
|
+
content,
|
|
149
|
+
fileName,
|
|
150
|
+
fileLength: originalLength,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.error("Error getting Google Drive file content", error);
|
|
155
|
+
return {
|
|
156
|
+
success: false,
|
|
157
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
export default getDriveFileContentByID;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
const searchDriveByKeywords = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
|
+
var _b;
|
|
14
|
+
if (!authParams.authToken) {
|
|
15
|
+
return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
|
|
16
|
+
}
|
|
17
|
+
const { keywords, limit } = params;
|
|
18
|
+
// Build the query: fullText contains 'keyword1' or fullText contains 'keyword2' ...
|
|
19
|
+
const query = keywords.map(kw => `fullText contains '${kw.replace(/'/g, "\\'")}'`).join(" or ");
|
|
20
|
+
const url = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true`;
|
|
21
|
+
// 1. Get the file metadata from google drive search
|
|
22
|
+
let files = [];
|
|
23
|
+
try {
|
|
24
|
+
const res = yield axiosClient.get(url, {
|
|
25
|
+
headers: {
|
|
26
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
files =
|
|
30
|
+
((_b = res.data.files) === null || _b === void 0 ? void 0 : _b.map((file) => ({
|
|
31
|
+
id: file.id || "",
|
|
32
|
+
name: file.name || "",
|
|
33
|
+
mimeType: file.mimeType || "",
|
|
34
|
+
url: file.webViewLink || "",
|
|
35
|
+
}))) || [];
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error("Error searching Google Drive", error);
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
42
|
+
files: [],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
files = limit ? files.splice(0, limit) : files;
|
|
46
|
+
});
|
|
47
|
+
export default searchDriveByKeywords;
|