@credal/actions 0.2.189 → 0.2.190
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 +8 -1
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +53 -2
- package/dist/actions/autogen/types.d.ts +36 -3
- package/dist/actions/autogen/types.js +17 -1
- package/dist/actions/providers/google-oauth/addTextToTopOfDoc.d.ts +3 -0
- package/dist/actions/providers/google-oauth/addTextToTopOfDoc.js +54 -0
- package/dist/actions/providers/slackUser/searchSlack.js +1 -6
- package/dist/actions/providers/slackUser/searchSlackRTS.js +15 -2
- package/dist/actions/providers/slackUser/utils.d.ts +1 -0
- package/dist/actions/providers/slackUser/utils.js +15 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { genericFillTemplateParamsSchema, genericFillTemplateOutputSchema, confluenceOverwritePageParamsSchema, confluenceOverwritePageOutputSchema, googlemapsValidateAddressOutputSchema, googlemapsValidateAddressParamsSchema, googleOauthCreateNewGoogleDocParamsSchema, googleOauthCreateNewGoogleDocOutputSchema, mathAddOutputSchema, mathAddParamsSchema, mongoInsertMongoDocOutputSchema, mongoInsertMongoDocParamsSchema, slackSendMessageOutputSchema, slackSendMessageParamsSchema, slackGetChannelMessagesOutputSchema, slackGetChannelMessagesParamsSchema, 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, jiraCreateServiceDeskRequestParamsSchema, jiraCreateServiceDeskRequestOutputSchema, openstreetmapGetLatitudeLongitudeFromLocationParamsSchema, openstreetmapGetLatitudeLongitudeFromLocationOutputSchema, nwsGetForecastForLocationParamsSchema, nwsGetForecastForLocationOutputSchema, googlemapsNearbysearchRestaurantsOutputSchema, googlemapsNearbysearchRestaurantsParamsSchema, firecrawlScrapeUrlOutputSchema, firecrawlScrapeUrlParamsSchema, resendSendEmailOutputSchema, resendSendEmailHtmlParamsSchema, resendSendEmailHtmlOutputSchema, firecrawlScrapeTweetDataWithNitterParamsSchema, firecrawlScrapeTweetDataWithNitterOutputSchema, resendSendEmailParamsSchema, linkedinCreateShareLinkedinPostUrlParamsSchema, linkedinCreateShareLinkedinPostUrlOutputSchema, xCreateShareXPostUrlParamsSchema, xCreateShareXPostUrlOutputSchema, finnhubSymbolLookupParamsSchema, finnhubSymbolLookupOutputSchema, finnhubGetBasicFinancialsParamsSchema, finnhubGetBasicFinancialsOutputSchema, confluenceFetchPageContentParamsSchema, confluenceFetchPageContentOutputSchema, snowflakeRunSnowflakeQueryParamsSchema, snowflakeRunSnowflakeQueryOutputSchema, lookerEnableUserByEmailParamsSchema, lookerEnableUserByEmailOutputSchema, googleOauthUpdateDocParamsSchema, googleOauthUpdateDocOutputSchema, googleOauthCreateSpreadsheetParamsSchema, googleOauthCreateSpreadsheetOutputSchema, googleOauthUpdateSpreadsheetParamsSchema, googleOauthUpdateSpreadsheetOutputSchema, googleOauthAppendRowsToSpreadsheetParamsSchema, googleOauthAppendRowsToSpreadsheetOutputSchema, googleOauthDeleteRowFromSpreadsheetParamsSchema, googleOauthDeleteRowFromSpreadsheetOutputSchema, googleOauthScheduleCalendarMeetingParamsSchema, googleOauthScheduleCalendarMeetingOutputSchema, googleOauthListCalendarsParamsSchema, googleOauthListCalendarsOutputSchema, googleOauthListCalendarEventsParamsSchema, googleOauthListCalendarEventsOutputSchema, googleOauthUpdateCalendarEventParamsSchema, googleOauthUpdateCalendarEventOutputSchema, googleOauthDeleteCalendarEventParamsSchema, googleOauthDeleteCalendarEventOutputSchema, googleOauthEditAGoogleCalendarEventParamsSchema, googleOauthEditAGoogleCalendarEventOutputSchema, googleOauthCreatePresentationParamsSchema, googleOauthCreatePresentationOutputSchema, googleOauthUpdatePresentationParamsSchema, googleOauthUpdatePresentationOutputSchema, googleOauthGetPresentationParamsSchema, googleOauthGetPresentationOutputSchema, googleOauthSearchDriveByKeywordsParamsSchema, googleOauthSearchDriveByKeywordsOutputSchema, googleOauthListGroupsOutputSchema, googleOauthListGroupsParamsSchema, googleOauthGetGroupOutputSchema, googleOauthGetGroupParamsSchema, googleOauthListGroupMembersOutputSchema, googleOauthListGroupMembersParamsSchema, googleOauthHasGroupMemberOutputSchema, googleOauthHasGroupMemberParamsSchema, googleOauthAddGroupMemberOutputSchema, googleOauthAddGroupMemberParamsSchema, googleOauthDeleteGroupMemberOutputSchema, googleOauthDeleteGroupMemberParamsSchema, salesforceUpdateRecordParamsSchema, salesforceUpdateRecordOutputSchema, salesforceCreateCaseParamsSchema, salesforceCreateCaseOutputSchema, salesforceGenerateSalesReportParamsSchema, salesforceGenerateSalesReportOutputSchema, salesforceGetRecordParamsSchema, salesforceGetRecordOutputSchema, microsoftMessageTeamsChatParamsSchema, microsoftMessageTeamsChatOutputSchema, microsoftMessageTeamsChannelParamsSchema, microsoftMessageTeamsChannelOutputSchema, salesforceGetSalesforceRecordsByQueryParamsSchema, salesforceGetSalesforceRecordsByQueryOutputSchema, asanaCommentTaskParamsSchema, asanaCommentTaskOutputSchema, asanaCreateTaskParamsSchema, asanaCreateTaskOutputSchema, asanaUpdateTaskParamsSchema, asanaUpdateTaskOutputSchema, githubCreateOrUpdateFileParamsSchema, githubCreateOrUpdateFileOutputSchema, githubCreateBranchParamsSchema, githubCreateBranchOutputSchema, githubCreatePullRequestParamsSchema, githubCreatePullRequestOutputSchema, microsoftUpdateSpreadsheetParamsSchema, microsoftUpdateSpreadsheetOutputSchema, microsoftUpdateDocumentParamsSchema, microsoftUpdateDocumentOutputSchema, microsoftGetDocumentParamsSchema, microsoftGetDocumentOutputSchema, githubListPullRequestsParamsSchema, githubListPullRequestsOutputSchema, jiraGetJiraIssuesByQueryOutputSchema, jiraGetJiraIssuesByQueryParamsSchema, salesforceCreateRecordParamsSchema, salesforceCreateRecordOutputSchema, firecrawlDeepResearchParamsSchema, firecrawlDeepResearchOutputSchema, bingGetTopNSearchResultUrlsParamsSchema, bingGetTopNSearchResultUrlsOutputSchema, microsoftCreateDocumentParamsSchema, microsoftCreateDocumentOutputSchema, asanaListAsanaTasksByProjectParamsSchema, asanaListAsanaTasksByProjectOutputSchema, asanaSearchTasksParamsSchema, asanaSearchTasksOutputSchema, asanaGetTasksDetailsParamsSchema, asanaGetTasksDetailsOutputSchema, notionSearchByTitleParamsSchema, notionSearchByTitleOutputSchema, googlemailSearchGmailMessagesOutputSchema, googlemailSearchGmailMessagesParamsSchema, googlemailListGmailThreadsOutputSchema, googlemailListGmailThreadsParamsSchema, gitlabSearchGroupOutputSchema, gitlabSearchGroupParamsSchema, githubSearchOrganizationOutputSchema, githubSearchOrganizationParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentOutputSchema, googleOauthQueryGoogleBigQueryParamsSchema, googleOauthQueryGoogleBigQueryOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, githubGetBranchParamsSchema, githubGetBranchOutputSchema, githubListCommitsParamsSchema, githubListCommitsOutputSchema, githubGetPullRequestDetailsParamsSchema, githubGetPullRequestDetailsOutputSchema, linearGetIssuesParamsSchema, linearGetIssuesOutputSchema, linearGetIssueDetailsParamsSchema, linearGetIssueDetailsOutputSchema, linearGetProjectDetailsParamsSchema, linearGetProjectDetailsOutputSchema, linearGetTeamDetailsParamsSchema, linearGetTeamDetailsOutputSchema, linearGetProjectsParamsSchema, linearGetProjectsOutputSchema, linearGetTeamsParamsSchema, linearGetTeamsOutputSchema, hubspotGetContactsParamsSchema, hubspotGetContactsOutputSchema, hubspotGetContactDetailsParamsSchema, hubspotGetContactDetailsOutputSchema, hubspotGetCompaniesParamsSchema, hubspotGetCompaniesOutputSchema, hubspotGetCompanyDetailsParamsSchema, hubspotGetCompanyDetailsOutputSchema, hubspotGetDealsParamsSchema, hubspotGetDealsOutputSchema, hubspotGetDealDetailsParamsSchema, hubspotGetDealDetailsOutputSchema, hubspotGetTicketsParamsSchema, hubspotGetTicketsOutputSchema, hubspotGetTicketDetailsParamsSchema, hubspotGetTicketDetailsOutputSchema, gitlabGetFileContentParamsSchema, gitlabGetFileContentOutputSchema, gitlabGetMergeRequestParamsSchema, gitlabGetMergeRequestOutputSchema, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, gitlabListDirectoryParamsSchema, gitlabListDirectoryOutputSchema, firecrawlSearchAndScrapeOutputSchema, firecrawlSearchAndScrapeParamsSchema, firecrawlGetTopNSearchResultUrlsParamsSchema, firecrawlGetTopNSearchResultUrlsOutputSchema, googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema, googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema, perplexityPerplexityDeepResearchParamsSchema, perplexityPerplexityDeepResearchOutputSchema, slackUserSearchSlackParamsSchema, slackUserSearchSlackOutputSchema, slackUserSearchSlackRTSParamsSchema, slackUserSearchSlackRTSOutputSchema, oktaOrgGetOktaUserByNameParamsSchema, oktaOrgGetOktaUserByNameOutputSchema, googleSearchCustomSearchParamsSchema, googleSearchCustomSearchOutputSchema, salesforceSearchAllSalesforceRecordsParamsSchema, salesforceSearchAllSalesforceRecordsOutputSchema, salesforceListReportsParamsSchema, salesforceListReportsOutputSchema, salesforceExecuteReportParamsSchema, salesforceExecuteReportOutputSchema, slackSendDmFromBotParamsSchema, slackSendDmFromBotOutputSchema, slackGetChannelMembersParamsSchema, slackGetChannelMembersOutputSchema, salesforceGetReportMetadataParamsSchema, salesforceGetReportMetadataOutputSchema, googleOauthUpdateRowsInSpreadsheetParamsSchema, googleOauthUpdateRowsInSpreadsheetOutputSchema, } from "./autogen/types.js";
|
|
1
|
+
import { genericFillTemplateParamsSchema, genericFillTemplateOutputSchema, confluenceOverwritePageParamsSchema, confluenceOverwritePageOutputSchema, googlemapsValidateAddressOutputSchema, googlemapsValidateAddressParamsSchema, googleOauthCreateNewGoogleDocParamsSchema, googleOauthCreateNewGoogleDocOutputSchema, mathAddOutputSchema, mathAddParamsSchema, mongoInsertMongoDocOutputSchema, mongoInsertMongoDocParamsSchema, slackSendMessageOutputSchema, slackSendMessageParamsSchema, slackGetChannelMessagesOutputSchema, slackGetChannelMessagesParamsSchema, 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, jiraCreateServiceDeskRequestParamsSchema, jiraCreateServiceDeskRequestOutputSchema, openstreetmapGetLatitudeLongitudeFromLocationParamsSchema, openstreetmapGetLatitudeLongitudeFromLocationOutputSchema, nwsGetForecastForLocationParamsSchema, nwsGetForecastForLocationOutputSchema, googlemapsNearbysearchRestaurantsOutputSchema, googlemapsNearbysearchRestaurantsParamsSchema, firecrawlScrapeUrlOutputSchema, firecrawlScrapeUrlParamsSchema, resendSendEmailOutputSchema, resendSendEmailHtmlParamsSchema, resendSendEmailHtmlOutputSchema, firecrawlScrapeTweetDataWithNitterParamsSchema, firecrawlScrapeTweetDataWithNitterOutputSchema, resendSendEmailParamsSchema, linkedinCreateShareLinkedinPostUrlParamsSchema, linkedinCreateShareLinkedinPostUrlOutputSchema, xCreateShareXPostUrlParamsSchema, xCreateShareXPostUrlOutputSchema, finnhubSymbolLookupParamsSchema, finnhubSymbolLookupOutputSchema, finnhubGetBasicFinancialsParamsSchema, finnhubGetBasicFinancialsOutputSchema, confluenceFetchPageContentParamsSchema, confluenceFetchPageContentOutputSchema, snowflakeRunSnowflakeQueryParamsSchema, snowflakeRunSnowflakeQueryOutputSchema, lookerEnableUserByEmailParamsSchema, lookerEnableUserByEmailOutputSchema, googleOauthUpdateDocParamsSchema, googleOauthUpdateDocOutputSchema, googleOauthAddTextToTopOfDocParamsSchema, googleOauthAddTextToTopOfDocOutputSchema, googleOauthCreateSpreadsheetParamsSchema, googleOauthCreateSpreadsheetOutputSchema, googleOauthUpdateSpreadsheetParamsSchema, googleOauthUpdateSpreadsheetOutputSchema, googleOauthAppendRowsToSpreadsheetParamsSchema, googleOauthAppendRowsToSpreadsheetOutputSchema, googleOauthDeleteRowFromSpreadsheetParamsSchema, googleOauthDeleteRowFromSpreadsheetOutputSchema, googleOauthScheduleCalendarMeetingParamsSchema, googleOauthScheduleCalendarMeetingOutputSchema, googleOauthListCalendarsParamsSchema, googleOauthListCalendarsOutputSchema, googleOauthListCalendarEventsParamsSchema, googleOauthListCalendarEventsOutputSchema, googleOauthUpdateCalendarEventParamsSchema, googleOauthUpdateCalendarEventOutputSchema, googleOauthDeleteCalendarEventParamsSchema, googleOauthDeleteCalendarEventOutputSchema, googleOauthEditAGoogleCalendarEventParamsSchema, googleOauthEditAGoogleCalendarEventOutputSchema, googleOauthCreatePresentationParamsSchema, googleOauthCreatePresentationOutputSchema, googleOauthUpdatePresentationParamsSchema, googleOauthUpdatePresentationOutputSchema, googleOauthGetPresentationParamsSchema, googleOauthGetPresentationOutputSchema, googleOauthSearchDriveByKeywordsParamsSchema, googleOauthSearchDriveByKeywordsOutputSchema, googleOauthListGroupsOutputSchema, googleOauthListGroupsParamsSchema, googleOauthGetGroupOutputSchema, googleOauthGetGroupParamsSchema, googleOauthListGroupMembersOutputSchema, googleOauthListGroupMembersParamsSchema, googleOauthHasGroupMemberOutputSchema, googleOauthHasGroupMemberParamsSchema, googleOauthAddGroupMemberOutputSchema, googleOauthAddGroupMemberParamsSchema, googleOauthDeleteGroupMemberOutputSchema, googleOauthDeleteGroupMemberParamsSchema, salesforceUpdateRecordParamsSchema, salesforceUpdateRecordOutputSchema, salesforceCreateCaseParamsSchema, salesforceCreateCaseOutputSchema, salesforceGenerateSalesReportParamsSchema, salesforceGenerateSalesReportOutputSchema, salesforceGetRecordParamsSchema, salesforceGetRecordOutputSchema, microsoftMessageTeamsChatParamsSchema, microsoftMessageTeamsChatOutputSchema, microsoftMessageTeamsChannelParamsSchema, microsoftMessageTeamsChannelOutputSchema, salesforceGetSalesforceRecordsByQueryParamsSchema, salesforceGetSalesforceRecordsByQueryOutputSchema, asanaCommentTaskParamsSchema, asanaCommentTaskOutputSchema, asanaCreateTaskParamsSchema, asanaCreateTaskOutputSchema, asanaUpdateTaskParamsSchema, asanaUpdateTaskOutputSchema, githubCreateOrUpdateFileParamsSchema, githubCreateOrUpdateFileOutputSchema, githubCreateBranchParamsSchema, githubCreateBranchOutputSchema, githubCreatePullRequestParamsSchema, githubCreatePullRequestOutputSchema, microsoftUpdateSpreadsheetParamsSchema, microsoftUpdateSpreadsheetOutputSchema, microsoftUpdateDocumentParamsSchema, microsoftUpdateDocumentOutputSchema, microsoftGetDocumentParamsSchema, microsoftGetDocumentOutputSchema, githubListPullRequestsParamsSchema, githubListPullRequestsOutputSchema, jiraGetJiraIssuesByQueryOutputSchema, jiraGetJiraIssuesByQueryParamsSchema, salesforceCreateRecordParamsSchema, salesforceCreateRecordOutputSchema, firecrawlDeepResearchParamsSchema, firecrawlDeepResearchOutputSchema, bingGetTopNSearchResultUrlsParamsSchema, bingGetTopNSearchResultUrlsOutputSchema, microsoftCreateDocumentParamsSchema, microsoftCreateDocumentOutputSchema, asanaListAsanaTasksByProjectParamsSchema, asanaListAsanaTasksByProjectOutputSchema, asanaSearchTasksParamsSchema, asanaSearchTasksOutputSchema, asanaGetTasksDetailsParamsSchema, asanaGetTasksDetailsOutputSchema, notionSearchByTitleParamsSchema, notionSearchByTitleOutputSchema, googlemailSearchGmailMessagesOutputSchema, googlemailSearchGmailMessagesParamsSchema, googlemailListGmailThreadsOutputSchema, googlemailListGmailThreadsParamsSchema, gitlabSearchGroupOutputSchema, gitlabSearchGroupParamsSchema, githubSearchOrganizationOutputSchema, githubSearchOrganizationParamsSchema, salesforceSearchSalesforceRecordsParamsSchema, salesforceSearchSalesforceRecordsOutputSchema, googleOauthGetDriveFileContentByIdOutputSchema, googleOauthGetDriveFileContentByIdParamsSchema, googleOauthSearchDriveByQueryOutputSchema, googleOauthSearchDriveByQueryParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentParamsSchema, googleOauthSearchDriveByQueryAndGetFileContentOutputSchema, googleOauthQueryGoogleBigQueryParamsSchema, googleOauthQueryGoogleBigQueryOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, githubGetBranchParamsSchema, githubGetBranchOutputSchema, githubListCommitsParamsSchema, githubListCommitsOutputSchema, githubGetPullRequestDetailsParamsSchema, githubGetPullRequestDetailsOutputSchema, linearGetIssuesParamsSchema, linearGetIssuesOutputSchema, linearGetIssueDetailsParamsSchema, linearGetIssueDetailsOutputSchema, linearGetProjectDetailsParamsSchema, linearGetProjectDetailsOutputSchema, linearGetTeamDetailsParamsSchema, linearGetTeamDetailsOutputSchema, linearGetProjectsParamsSchema, linearGetProjectsOutputSchema, linearGetTeamsParamsSchema, linearGetTeamsOutputSchema, hubspotGetContactsParamsSchema, hubspotGetContactsOutputSchema, hubspotGetContactDetailsParamsSchema, hubspotGetContactDetailsOutputSchema, hubspotGetCompaniesParamsSchema, hubspotGetCompaniesOutputSchema, hubspotGetCompanyDetailsParamsSchema, hubspotGetCompanyDetailsOutputSchema, hubspotGetDealsParamsSchema, hubspotGetDealsOutputSchema, hubspotGetDealDetailsParamsSchema, hubspotGetDealDetailsOutputSchema, hubspotGetTicketsParamsSchema, hubspotGetTicketsOutputSchema, hubspotGetTicketDetailsParamsSchema, hubspotGetTicketDetailsOutputSchema, gitlabGetFileContentParamsSchema, gitlabGetFileContentOutputSchema, gitlabGetMergeRequestParamsSchema, gitlabGetMergeRequestOutputSchema, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, gitlabListDirectoryParamsSchema, gitlabListDirectoryOutputSchema, firecrawlSearchAndScrapeOutputSchema, firecrawlSearchAndScrapeParamsSchema, firecrawlGetTopNSearchResultUrlsParamsSchema, firecrawlGetTopNSearchResultUrlsOutputSchema, googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema, googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema, perplexityPerplexityDeepResearchParamsSchema, perplexityPerplexityDeepResearchOutputSchema, slackUserSearchSlackParamsSchema, slackUserSearchSlackOutputSchema, slackUserSearchSlackRTSParamsSchema, slackUserSearchSlackRTSOutputSchema, oktaOrgGetOktaUserByNameParamsSchema, oktaOrgGetOktaUserByNameOutputSchema, googleSearchCustomSearchParamsSchema, googleSearchCustomSearchOutputSchema, salesforceSearchAllSalesforceRecordsParamsSchema, salesforceSearchAllSalesforceRecordsOutputSchema, salesforceListReportsParamsSchema, salesforceListReportsOutputSchema, salesforceExecuteReportParamsSchema, salesforceExecuteReportOutputSchema, slackSendDmFromBotParamsSchema, slackSendDmFromBotOutputSchema, slackGetChannelMembersParamsSchema, slackGetChannelMembersOutputSchema, salesforceGetReportMetadataParamsSchema, salesforceGetReportMetadataOutputSchema, googleOauthUpdateRowsInSpreadsheetParamsSchema, googleOauthUpdateRowsInSpreadsheetOutputSchema, } 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";
|
|
@@ -43,6 +43,7 @@ import confluenceFetchPageContent from "./providers/confluence/fetchPageContent.
|
|
|
43
43
|
import runSnowflakeQuery from "./providers/snowflake/runSnowflakeQuery.js";
|
|
44
44
|
import enableUserByEmail from "./providers/looker/enableUserByEmail.js";
|
|
45
45
|
import updateDoc from "./providers/google-oauth/updateDoc.js";
|
|
46
|
+
import addTextToTopOfDoc from "./providers/google-oauth/addTextToTopOfDoc.js";
|
|
46
47
|
import scheduleCalendarMeeting from "./providers/google-oauth/scheduleCalendarMeeting.js";
|
|
47
48
|
import listCalendars from "./providers/google-oauth/listCalendars.js";
|
|
48
49
|
import listCalendarEvents from "./providers/google-oauth/listCalendarEvents.js";
|
|
@@ -523,6 +524,12 @@ export const ActionMapper = {
|
|
|
523
524
|
outputSchema: googleOauthCreateNewGoogleDocOutputSchema,
|
|
524
525
|
actionType: "write",
|
|
525
526
|
},
|
|
527
|
+
addTextToTopOfDoc: {
|
|
528
|
+
fn: addTextToTopOfDoc,
|
|
529
|
+
paramsSchema: googleOauthAddTextToTopOfDocParamsSchema,
|
|
530
|
+
outputSchema: googleOauthAddTextToTopOfDocOutputSchema,
|
|
531
|
+
actionType: "write",
|
|
532
|
+
},
|
|
526
533
|
updateDoc: {
|
|
527
534
|
fn: updateDoc,
|
|
528
535
|
paramsSchema: googleOauthUpdateDocParamsSchema,
|
|
@@ -72,6 +72,7 @@ export declare const firecrawlScrapeTweetDataWithNitterDefinition: ActionTemplat
|
|
|
72
72
|
export declare const resendSendEmailDefinition: ActionTemplate;
|
|
73
73
|
export declare const resendSendEmailHtmlDefinition: ActionTemplate;
|
|
74
74
|
export declare const googleOauthCreateNewGoogleDocDefinition: ActionTemplate;
|
|
75
|
+
export declare const googleOauthAddTextToTopOfDocDefinition: ActionTemplate;
|
|
75
76
|
export declare const googleOauthUpdateDocDefinition: ActionTemplate;
|
|
76
77
|
export declare const googleOauthScheduleCalendarMeetingDefinition: ActionTemplate;
|
|
77
78
|
export declare const googleOauthListCalendarsDefinition: ActionTemplate;
|
|
@@ -1068,11 +1068,10 @@ export const slackUserSearchSlackRTSDefinition = {
|
|
|
1068
1068
|
tags: [],
|
|
1069
1069
|
parameters: {
|
|
1070
1070
|
type: "object",
|
|
1071
|
-
required: ["query"],
|
|
1072
1071
|
properties: {
|
|
1073
1072
|
query: {
|
|
1074
1073
|
type: "string",
|
|
1075
|
-
description: 'The search query string (e.g., "What is project gizmo?", "mobile UX revamp").
|
|
1074
|
+
description: 'The search query string (e.g., "What is project gizmo?", "mobile UX revamp"). Leave empty if you only want to filter by user or channel.',
|
|
1076
1075
|
},
|
|
1077
1076
|
userEmails: {
|
|
1078
1077
|
type: "array",
|
|
@@ -1081,6 +1080,13 @@ export const slackUserSearchSlackRTSDefinition = {
|
|
|
1081
1080
|
type: "string",
|
|
1082
1081
|
},
|
|
1083
1082
|
},
|
|
1083
|
+
channelIds: {
|
|
1084
|
+
type: "array",
|
|
1085
|
+
description: 'Optional. Channels to restrict results to. Each value can be a Slack channel ID like "C12345678" (or "<#C123...>") OR a channel name like "general" / "#general". Values are formatted into the query as in:<#C...> (ID) or in:#channel-name (name).',
|
|
1086
|
+
items: {
|
|
1087
|
+
type: "string",
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1084
1090
|
channelTypes: {
|
|
1085
1091
|
type: "array",
|
|
1086
1092
|
description: "Filter by channel types to search. If not specified, searches all channel types the user has access to.",
|
|
@@ -4603,6 +4609,51 @@ export const googleOauthCreateNewGoogleDocDefinition = {
|
|
|
4603
4609
|
name: "createNewGoogleDoc",
|
|
4604
4610
|
provider: "googleOauth",
|
|
4605
4611
|
};
|
|
4612
|
+
export const googleOauthAddTextToTopOfDocDefinition = {
|
|
4613
|
+
displayName: "Append text to the top of a Google Doc",
|
|
4614
|
+
description: "Insert the provided text at the very top of an existing Google Doc using OAuth authentication",
|
|
4615
|
+
scopes: [],
|
|
4616
|
+
tags: [],
|
|
4617
|
+
parameters: {
|
|
4618
|
+
type: "object",
|
|
4619
|
+
required: ["documentId", "text"],
|
|
4620
|
+
properties: {
|
|
4621
|
+
documentId: {
|
|
4622
|
+
type: "string",
|
|
4623
|
+
description: "The ID of the Google Doc to update",
|
|
4624
|
+
tags: ["recommend-predefined"],
|
|
4625
|
+
},
|
|
4626
|
+
text: {
|
|
4627
|
+
type: "string",
|
|
4628
|
+
description: "The text to insert at the beginning of the document",
|
|
4629
|
+
},
|
|
4630
|
+
},
|
|
4631
|
+
},
|
|
4632
|
+
output: {
|
|
4633
|
+
type: "object",
|
|
4634
|
+
required: ["success"],
|
|
4635
|
+
properties: {
|
|
4636
|
+
success: {
|
|
4637
|
+
type: "boolean",
|
|
4638
|
+
description: "Whether the document was updated successfully",
|
|
4639
|
+
},
|
|
4640
|
+
documentId: {
|
|
4641
|
+
type: "string",
|
|
4642
|
+
description: "The ID of the updated Google Doc",
|
|
4643
|
+
},
|
|
4644
|
+
documentUrl: {
|
|
4645
|
+
type: "string",
|
|
4646
|
+
description: "The URL to access the updated Google Doc",
|
|
4647
|
+
},
|
|
4648
|
+
error: {
|
|
4649
|
+
type: "string",
|
|
4650
|
+
description: "The error message if the update failed",
|
|
4651
|
+
},
|
|
4652
|
+
},
|
|
4653
|
+
},
|
|
4654
|
+
name: "addTextToTopOfDoc",
|
|
4655
|
+
provider: "googleOauth",
|
|
4656
|
+
};
|
|
4606
4657
|
export const googleOauthUpdateDocDefinition = {
|
|
4607
4658
|
displayName: "Update a Google Doc",
|
|
4608
4659
|
description: "Update an existing Google Docs document using OAuth authentication with batch requests",
|
|
@@ -89,6 +89,7 @@ export declare enum ActionName {
|
|
|
89
89
|
SENDEMAIL = "sendEmail",
|
|
90
90
|
SENDEMAILHTML = "sendEmailHtml",
|
|
91
91
|
CREATENEWGOOGLEDOC = "createNewGoogleDoc",
|
|
92
|
+
ADDTEXTTOTOPOFDOC = "addTextToTopOfDoc",
|
|
92
93
|
UPDATEDOC = "updateDoc",
|
|
93
94
|
SCHEDULECALENDARMEETING = "scheduleCalendarMeeting",
|
|
94
95
|
LISTCALENDARS = "listCalendars",
|
|
@@ -1316,8 +1317,9 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
1316
1317
|
export type slackUserSearchSlackOutputType = z.infer<typeof slackUserSearchSlackOutputSchema>;
|
|
1317
1318
|
export type slackUserSearchSlackFunction = ActionFunction<slackUserSearchSlackParamsType, AuthParamsType, slackUserSearchSlackOutputType>;
|
|
1318
1319
|
export declare const slackUserSearchSlackRTSParamsSchema: z.ZodObject<{
|
|
1319
|
-
query: z.ZodString
|
|
1320
|
+
query: z.ZodOptional<z.ZodString>;
|
|
1320
1321
|
userEmails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1322
|
+
channelIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1321
1323
|
channelTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["public_channel", "private_channel", "mpim", "im"]>, "many">>;
|
|
1322
1324
|
contentTypes: z.ZodDefault<z.ZodArray<z.ZodEnum<["messages", "files", "channels"]>, "many">>;
|
|
1323
1325
|
includeBots: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1326,19 +1328,21 @@ export declare const slackUserSearchSlackRTSParamsSchema: z.ZodObject<{
|
|
|
1326
1328
|
before: z.ZodOptional<z.ZodString>;
|
|
1327
1329
|
after: z.ZodOptional<z.ZodString>;
|
|
1328
1330
|
}, "strip", z.ZodTypeAny, {
|
|
1329
|
-
query: string;
|
|
1330
1331
|
limit: number;
|
|
1331
1332
|
contentTypes: ("messages" | "files" | "channels")[];
|
|
1332
1333
|
includeBots: boolean;
|
|
1333
1334
|
includeContextMessages: boolean;
|
|
1335
|
+
query?: string | undefined;
|
|
1334
1336
|
userEmails?: string[] | undefined;
|
|
1337
|
+
channelIds?: string[] | undefined;
|
|
1335
1338
|
channelTypes?: ("im" | "public_channel" | "private_channel" | "mpim")[] | undefined;
|
|
1336
1339
|
before?: string | undefined;
|
|
1337
1340
|
after?: string | undefined;
|
|
1338
1341
|
}, {
|
|
1339
|
-
query
|
|
1342
|
+
query?: string | undefined;
|
|
1340
1343
|
limit?: number | undefined;
|
|
1341
1344
|
userEmails?: string[] | undefined;
|
|
1345
|
+
channelIds?: string[] | undefined;
|
|
1342
1346
|
channelTypes?: ("im" | "public_channel" | "private_channel" | "mpim")[] | undefined;
|
|
1343
1347
|
contentTypes?: ("messages" | "files" | "channels")[] | undefined;
|
|
1344
1348
|
includeBots?: boolean | undefined;
|
|
@@ -4616,6 +4620,35 @@ export declare const googleOauthCreateNewGoogleDocOutputSchema: z.ZodObject<{
|
|
|
4616
4620
|
}>;
|
|
4617
4621
|
export type googleOauthCreateNewGoogleDocOutputType = z.infer<typeof googleOauthCreateNewGoogleDocOutputSchema>;
|
|
4618
4622
|
export type googleOauthCreateNewGoogleDocFunction = ActionFunction<googleOauthCreateNewGoogleDocParamsType, AuthParamsType, googleOauthCreateNewGoogleDocOutputType>;
|
|
4623
|
+
export declare const googleOauthAddTextToTopOfDocParamsSchema: z.ZodObject<{
|
|
4624
|
+
documentId: z.ZodString;
|
|
4625
|
+
text: z.ZodString;
|
|
4626
|
+
}, "strip", z.ZodTypeAny, {
|
|
4627
|
+
text: string;
|
|
4628
|
+
documentId: string;
|
|
4629
|
+
}, {
|
|
4630
|
+
text: string;
|
|
4631
|
+
documentId: string;
|
|
4632
|
+
}>;
|
|
4633
|
+
export type googleOauthAddTextToTopOfDocParamsType = z.infer<typeof googleOauthAddTextToTopOfDocParamsSchema>;
|
|
4634
|
+
export declare const googleOauthAddTextToTopOfDocOutputSchema: z.ZodObject<{
|
|
4635
|
+
success: z.ZodBoolean;
|
|
4636
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
4637
|
+
documentUrl: z.ZodOptional<z.ZodString>;
|
|
4638
|
+
error: z.ZodOptional<z.ZodString>;
|
|
4639
|
+
}, "strip", z.ZodTypeAny, {
|
|
4640
|
+
success: boolean;
|
|
4641
|
+
error?: string | undefined;
|
|
4642
|
+
documentId?: string | undefined;
|
|
4643
|
+
documentUrl?: string | undefined;
|
|
4644
|
+
}, {
|
|
4645
|
+
success: boolean;
|
|
4646
|
+
error?: string | undefined;
|
|
4647
|
+
documentId?: string | undefined;
|
|
4648
|
+
documentUrl?: string | undefined;
|
|
4649
|
+
}>;
|
|
4650
|
+
export type googleOauthAddTextToTopOfDocOutputType = z.infer<typeof googleOauthAddTextToTopOfDocOutputSchema>;
|
|
4651
|
+
export type googleOauthAddTextToTopOfDocFunction = ActionFunction<googleOauthAddTextToTopOfDocParamsType, AuthParamsType, googleOauthAddTextToTopOfDocOutputType>;
|
|
4619
4652
|
export declare const googleOauthUpdateDocParamsSchema: z.ZodObject<{
|
|
4620
4653
|
documentId: z.ZodString;
|
|
4621
4654
|
requests: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{}, "strip", z.ZodAny, z.objectOutputType<{}, z.ZodAny, "strip">, z.objectInputType<{}, z.ZodAny, "strip">>, z.ZodEffects<z.ZodAny, any, any>>, "many">>;
|
|
@@ -91,6 +91,7 @@ export var ActionName;
|
|
|
91
91
|
ActionName["SENDEMAIL"] = "sendEmail";
|
|
92
92
|
ActionName["SENDEMAILHTML"] = "sendEmailHtml";
|
|
93
93
|
ActionName["CREATENEWGOOGLEDOC"] = "createNewGoogleDoc";
|
|
94
|
+
ActionName["ADDTEXTTOTOPOFDOC"] = "addTextToTopOfDoc";
|
|
94
95
|
ActionName["UPDATEDOC"] = "updateDoc";
|
|
95
96
|
ActionName["SCHEDULECALENDARMEETING"] = "scheduleCalendarMeeting";
|
|
96
97
|
ActionName["LISTCALENDARS"] = "listCalendars";
|
|
@@ -528,11 +529,16 @@ export const slackUserSearchSlackOutputSchema = z.object({
|
|
|
528
529
|
export const slackUserSearchSlackRTSParamsSchema = z.object({
|
|
529
530
|
query: z
|
|
530
531
|
.string()
|
|
531
|
-
.describe('The search query string (e.g., "What is project gizmo?", "mobile UX revamp").
|
|
532
|
+
.describe('The search query string (e.g., "What is project gizmo?", "mobile UX revamp"). Leave empty if you only want to filter by user or channel.')
|
|
533
|
+
.optional(),
|
|
532
534
|
userEmails: z
|
|
533
535
|
.array(z.string())
|
|
534
536
|
.describe('Optional. Users to filter messages from. Each value should be a plain-text email (e.g. "user@company.com"). Will be resolved to a Slack user ID and formatted into the query as from:<@U...>.')
|
|
535
537
|
.optional(),
|
|
538
|
+
channelIds: z
|
|
539
|
+
.array(z.string())
|
|
540
|
+
.describe('Optional. Channels to restrict results to. Each value can be a Slack channel ID like "C12345678" (or "<#C123...>") OR a channel name like "general" / "#general". Values are formatted into the query as in:<#C...> (ID) or in:#channel-name (name).')
|
|
541
|
+
.optional(),
|
|
536
542
|
channelTypes: z
|
|
537
543
|
.array(z.enum(["public_channel", "private_channel", "mpim", "im"]))
|
|
538
544
|
.describe("Filter by channel types to search. If not specified, searches all channel types the user has access to.")
|
|
@@ -1524,6 +1530,16 @@ export const googleOauthCreateNewGoogleDocOutputSchema = z.object({
|
|
|
1524
1530
|
documentId: z.string().describe("The ID of the created Google Doc"),
|
|
1525
1531
|
documentUrl: z.string().describe("The URL to access the created Google Doc").optional(),
|
|
1526
1532
|
});
|
|
1533
|
+
export const googleOauthAddTextToTopOfDocParamsSchema = z.object({
|
|
1534
|
+
documentId: z.string().describe("The ID of the Google Doc to update"),
|
|
1535
|
+
text: z.string().describe("The text to insert at the beginning of the document"),
|
|
1536
|
+
});
|
|
1537
|
+
export const googleOauthAddTextToTopOfDocOutputSchema = z.object({
|
|
1538
|
+
success: z.boolean().describe("Whether the document was updated successfully"),
|
|
1539
|
+
documentId: z.string().describe("The ID of the updated Google Doc").optional(),
|
|
1540
|
+
documentUrl: z.string().describe("The URL to access the updated Google Doc").optional(),
|
|
1541
|
+
error: z.string().describe("The error message if the update failed").optional(),
|
|
1542
|
+
});
|
|
1527
1543
|
export const googleOauthUpdateDocParamsSchema = z.object({
|
|
1528
1544
|
documentId: z.string().describe("The ID of the Google Doc to update"),
|
|
1529
1545
|
requests: z
|
|
@@ -0,0 +1,54 @@
|
|
|
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 addTextToTopOfDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
|
+
if (!authParams.authToken) {
|
|
14
|
+
return {
|
|
15
|
+
success: false,
|
|
16
|
+
documentId: params.documentId,
|
|
17
|
+
error: MISSING_AUTH_TOKEN,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const { documentId, text } = params;
|
|
21
|
+
const baseApiUrl = "https://docs.googleapis.com/v1/documents";
|
|
22
|
+
try {
|
|
23
|
+
yield axiosClient.post(`${baseApiUrl}/${documentId}:batchUpdate`, {
|
|
24
|
+
requests: [
|
|
25
|
+
{
|
|
26
|
+
insertText: {
|
|
27
|
+
location: {
|
|
28
|
+
index: 1,
|
|
29
|
+
},
|
|
30
|
+
text: text + "\n",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}, {
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const documentUrl = `https://docs.google.com/document/d/${documentId}/edit`;
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
documentId,
|
|
43
|
+
documentUrl,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
documentId,
|
|
50
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export default addTextToTopOfDoc;
|
|
@@ -11,6 +11,7 @@ import { WebClient } from "@slack/web-api";
|
|
|
11
11
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
12
|
import pLimit from "p-limit";
|
|
13
13
|
import { extractMessageText, transformToSlackMessage, simplifyFile, } from "../slack/messageTransformers.js";
|
|
14
|
+
import { normalizeChannelOperand } from "./utils.js";
|
|
14
15
|
/* ===================== Constants ===================== */
|
|
15
16
|
const HIT_ENRICH_POOL = 2; // keep concurrency conservative to avoid 429s
|
|
16
17
|
const limitHit = pLimit(HIT_ENRICH_POOL);
|
|
@@ -65,12 +66,6 @@ class SlackUserCache {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
/* ===================== Helpers ===================== */
|
|
68
|
-
function normalizeChannelOperand(ch) {
|
|
69
|
-
const s = ch.trim();
|
|
70
|
-
if (/^[CGD][A-Z0-9]/i.test(s))
|
|
71
|
-
return s;
|
|
72
|
-
return s.replace(/^#/, "");
|
|
73
|
-
}
|
|
74
69
|
function getMessageTypeFilter(messageType) {
|
|
75
70
|
// This converts the LLM readable message type to the Slack search API message type (e.g. "channel" -> "message")
|
|
76
71
|
if (messageType === "channel")
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { WebClient } from "@slack/web-api";
|
|
11
11
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
import { normalizeChannelOperand } from "./utils.js";
|
|
12
13
|
/* ===================== Types ===================== */
|
|
13
14
|
function resolveSlackUserId(client, raw) {
|
|
14
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -42,8 +43,13 @@ const searchSlackRTS = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
|
|
|
42
43
|
if (!authParams.authToken)
|
|
43
44
|
throw new Error(MISSING_AUTH_TOKEN);
|
|
44
45
|
const client = new WebClient(authParams.authToken);
|
|
45
|
-
const { query, userEmails, channelTypes, contentTypes = ["messages", "files", "channels"], includeBots = false, limit = 20, includeContextMessages = true, before, after, } = params;
|
|
46
|
-
|
|
46
|
+
const { query, userEmails, channelIds, channelTypes, contentTypes = ["messages", "files", "channels"], includeBots = false, limit = 20, includeContextMessages = true, before, after, } = params;
|
|
47
|
+
if ((!query || query === "") &&
|
|
48
|
+
(!userEmails || userEmails.length === 0) &&
|
|
49
|
+
(!channelIds || channelIds.length === 0)) {
|
|
50
|
+
throw new Error("If query is left blank, you must provide at least one userEmail or channelId to filter by.");
|
|
51
|
+
}
|
|
52
|
+
let finalQuery = query !== null && query !== void 0 ? query : "";
|
|
47
53
|
if (userEmails != undefined && userEmails.length > 0) {
|
|
48
54
|
const settled = yield Promise.allSettled(userEmails.map((u) => resolveSlackUserId(client, u)));
|
|
49
55
|
const fulfilled = settled.filter((r) => r.status === "fulfilled");
|
|
@@ -54,6 +60,13 @@ const searchSlackRTS = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
|
|
|
54
60
|
finalQuery = appendToQuery(finalQuery, filter);
|
|
55
61
|
}
|
|
56
62
|
}
|
|
63
|
+
if (channelIds != undefined && channelIds.length > 0) {
|
|
64
|
+
const operands = channelIds.map(normalizeChannelOperand).filter((operand) => Boolean(operand));
|
|
65
|
+
if (operands.length > 0) {
|
|
66
|
+
const filter = operands.map(op => `in:${op}`).join(" ");
|
|
67
|
+
finalQuery = appendToQuery(finalQuery, filter);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
57
70
|
// Build the request parameters for assistant.search.context
|
|
58
71
|
const requestParams = {
|
|
59
72
|
query: finalQuery,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeChannelOperand(raw: string): string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function normalizeChannelOperand(raw) {
|
|
2
|
+
const s = raw.trim();
|
|
3
|
+
if (!s)
|
|
4
|
+
return;
|
|
5
|
+
// Accept inputs like "C123", "#C123", "<#C123>", "<#C123|name>", "general", or "#general"
|
|
6
|
+
const m = s.match(/<#(C[A-Z0-9]+)(?:\|[^>]+)?>/i);
|
|
7
|
+
if (m === null || m === void 0 ? void 0 : m[1])
|
|
8
|
+
return `<#${m[1]}>`;
|
|
9
|
+
const stripped = s.replace(/^#/, "");
|
|
10
|
+
if (/^C[A-Z0-9]+$/i.test(stripped))
|
|
11
|
+
return `<#${stripped}>`;
|
|
12
|
+
if (/^[a-z0-9._-]+$/i.test(stripped))
|
|
13
|
+
return `#${stripped}`;
|
|
14
|
+
return;
|
|
15
|
+
}
|