@credal/actions 0.2.98 → 0.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,3 +36,11 @@ const result = await runAction(
36
36
  ```
37
37
  npm run test tests/testRunMathAction.ts
38
38
  ```
39
+ ## Secret Scanning (TruffleHog)
40
+
41
+ We run TruffleHog on every pull request that actually changes at least one file.
42
+
43
+ - Empty / metadata-only PRs are automatically skipped to avoid noisy false alarms.
44
+ - Any real change is scanned if a secret-like credential is detected the job fails fast (so we can fix it before merging).
45
+
46
+ The workflow lives at `.github/workflows/trufflehog.yml` and is intentionally minimal: skip empty PRs, scan everything else and fail on hits.
@@ -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, jiraGetServiceDesksParamsSchema, jiraGetServiceDesksOutputSchema, 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, googleOauthScheduleCalendarMeetingParamsSchema, googleOauthScheduleCalendarMeetingOutputSchema, googleOauthListCalendarsParamsSchema, googleOauthListCalendarsOutputSchema, googleOauthListCalendarEventsParamsSchema, googleOauthListCalendarEventsOutputSchema, googleOauthUpdateCalendarEventParamsSchema, googleOauthUpdateCalendarEventOutputSchema, googleOauthDeleteCalendarEventParamsSchema, googleOauthDeleteCalendarEventOutputSchema, googleOauthEditAGoogleCalendarEventParamsSchema, googleOauthEditAGoogleCalendarEventOutputSchema, 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, googleOauthQueryGoogleBigQueryParamsSchema, googleOauthQueryGoogleBigQueryOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, 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, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, gitlabListDirectoryParamsSchema, gitlabListDirectoryOutputSchema, firecrawlSearchAndScrapeOutputSchema, firecrawlSearchAndScrapeParamsSchema, firecrawlGetTopNSearchResultUrlsParamsSchema, firecrawlGetTopNSearchResultUrlsOutputSchema, googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema, googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema, } 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, jiraGetServiceDesksParamsSchema, jiraGetServiceDesksOutputSchema, 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, 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, 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, googleOauthQueryGoogleBigQueryParamsSchema, googleOauthQueryGoogleBigQueryOutputSchema, githubGetFileContentParamsSchema, githubGetFileContentOutputSchema, githubListDirectoryOutputSchema, githubListDirectoryParamsSchema, 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, jiraPublicCommentOnServiceDeskRequestParamsSchema, jiraPublicCommentOnServiceDeskRequestOutputSchema, googlemailSendGmailParamsSchema, googlemailSendGmailOutputSchema, gitlabListDirectoryParamsSchema, gitlabListDirectoryOutputSchema, firecrawlSearchAndScrapeOutputSchema, firecrawlSearchAndScrapeParamsSchema, firecrawlGetTopNSearchResultUrlsParamsSchema, firecrawlGetTopNSearchResultUrlsOutputSchema, googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema, googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema, } 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";
@@ -52,6 +52,7 @@ import createSpreadsheet from "./providers/google-oauth/createSpreadsheet.js";
52
52
  import updateSpreadsheet from "./providers/google-oauth/updateSpreadsheet.js";
53
53
  import createPresentation from "./providers/google-oauth/createPresentation.js";
54
54
  import updatePresentation from "./providers/google-oauth/updatePresentation.js";
55
+ import getPresentation from "./providers/google-oauth/getPresentation.js";
55
56
  import createNote from "./providers/ashby/createNote.js";
56
57
  import getCandidateInfo from "./providers/ashby/getCandidateInfo.js";
57
58
  import updateRecord from "./providers/salesforce/updateRecord.js";
@@ -478,6 +479,11 @@ export const ActionMapper = {
478
479
  paramsSchema: googleOauthUpdatePresentationParamsSchema,
479
480
  outputSchema: googleOauthUpdatePresentationOutputSchema,
480
481
  },
482
+ getPresentation: {
483
+ fn: getPresentation,
484
+ paramsSchema: googleOauthGetPresentationParamsSchema,
485
+ outputSchema: googleOauthGetPresentationOutputSchema,
486
+ },
481
487
  searchDriveByKeywords: {
482
488
  fn: searchDriveByKeywords,
483
489
  paramsSchema: googleOauthSearchDriveByKeywordsParamsSchema,
@@ -71,6 +71,7 @@ export declare const googleOauthCreateSpreadsheetDefinition: ActionTemplate;
71
71
  export declare const googleOauthUpdateSpreadsheetDefinition: ActionTemplate;
72
72
  export declare const googleOauthCreatePresentationDefinition: ActionTemplate;
73
73
  export declare const googleOauthUpdatePresentationDefinition: ActionTemplate;
74
+ export declare const googleOauthGetPresentationDefinition: ActionTemplate;
74
75
  export declare const googleOauthSearchDriveByKeywordsDefinition: ActionTemplate;
75
76
  export declare const googleOauthSearchDriveByQueryDefinition: ActionTemplate;
76
77
  export declare const googleOauthSearchDriveByKeywordsAndGetFileContentDefinition: ActionTemplate;
@@ -571,11 +571,11 @@ export const slackSendMessageDefinition = {
571
571
  properties: {
572
572
  success: {
573
573
  type: "boolean",
574
- description: "Whether the email was sent successfully",
574
+ description: "Whether the message was sent successfully",
575
575
  },
576
576
  error: {
577
577
  type: "string",
578
- description: "The error that occurred if the email was not sent successfully",
578
+ description: "The error that occurred if the message was not sent successfully",
579
579
  },
580
580
  messageId: {
581
581
  type: "string",
@@ -6703,6 +6703,62 @@ export const googleOauthUpdatePresentationDefinition = {
6703
6703
  name: "updatePresentation",
6704
6704
  provider: "googleOauth",
6705
6705
  };
6706
+ export const googleOauthGetPresentationDefinition = {
6707
+ description: "Get a presentation by ID",
6708
+ scopes: ["slides.readonly"],
6709
+ parameters: {
6710
+ type: "object",
6711
+ required: ["presentationId"],
6712
+ properties: {
6713
+ presentationId: {
6714
+ type: "string",
6715
+ description: "The ID of the presentation to retrieve",
6716
+ },
6717
+ },
6718
+ },
6719
+ output: {
6720
+ type: "object",
6721
+ required: ["success"],
6722
+ properties: {
6723
+ success: {
6724
+ type: "boolean",
6725
+ description: "Whether the presentation was retrieved successfully",
6726
+ },
6727
+ error: {
6728
+ type: "string",
6729
+ description: "The error that occurred if the presentation was not retrieved successfully",
6730
+ },
6731
+ presentation: {
6732
+ title: "string",
6733
+ slides: {
6734
+ type: "array",
6735
+ description: "The slides in the presentation",
6736
+ items: {
6737
+ type: "object",
6738
+ required: ["objectId", "pageElements"],
6739
+ properties: {
6740
+ objectId: "string",
6741
+ pageElements: {
6742
+ type: "array",
6743
+ items: {
6744
+ type: "object",
6745
+ required: ["objectId", "shape"],
6746
+ properties: {
6747
+ objectId: "string",
6748
+ text: "string",
6749
+ styling: "string",
6750
+ },
6751
+ },
6752
+ },
6753
+ },
6754
+ },
6755
+ },
6756
+ },
6757
+ },
6758
+ },
6759
+ name: "getPresentation",
6760
+ provider: "googleOauth",
6761
+ };
6706
6762
  export const googleOauthSearchDriveByKeywordsDefinition = {
6707
6763
  description: "Search Google Drive files that contain one or more keywords in their full text.",
6708
6764
  scopes: ["drive.readonly"],
@@ -3958,6 +3958,29 @@ export declare const googleOauthUpdatePresentationOutputSchema: z.ZodObject<{
3958
3958
  }>;
3959
3959
  export type googleOauthUpdatePresentationOutputType = z.infer<typeof googleOauthUpdatePresentationOutputSchema>;
3960
3960
  export type googleOauthUpdatePresentationFunction = ActionFunction<googleOauthUpdatePresentationParamsType, AuthParamsType, googleOauthUpdatePresentationOutputType>;
3961
+ export declare const googleOauthGetPresentationParamsSchema: z.ZodObject<{
3962
+ presentationId: z.ZodString;
3963
+ }, "strip", z.ZodTypeAny, {
3964
+ presentationId: string;
3965
+ }, {
3966
+ presentationId: string;
3967
+ }>;
3968
+ export type googleOauthGetPresentationParamsType = z.infer<typeof googleOauthGetPresentationParamsSchema>;
3969
+ export declare const googleOauthGetPresentationOutputSchema: z.ZodObject<{
3970
+ success: z.ZodBoolean;
3971
+ error: z.ZodOptional<z.ZodString>;
3972
+ presentation: z.ZodOptional<z.ZodAny>;
3973
+ }, "strip", z.ZodTypeAny, {
3974
+ success: boolean;
3975
+ error?: string | undefined;
3976
+ presentation?: any;
3977
+ }, {
3978
+ success: boolean;
3979
+ error?: string | undefined;
3980
+ presentation?: any;
3981
+ }>;
3982
+ export type googleOauthGetPresentationOutputType = z.infer<typeof googleOauthGetPresentationOutputSchema>;
3983
+ export type googleOauthGetPresentationFunction = ActionFunction<googleOauthGetPresentationParamsType, AuthParamsType, googleOauthGetPresentationOutputType>;
3961
3984
  export declare const googleOauthSearchDriveByKeywordsParamsSchema: z.ZodObject<{
3962
3985
  keywords: z.ZodArray<z.ZodString, "many">;
3963
3986
  limit: z.ZodOptional<z.ZodNumber>;
@@ -2549,6 +2549,14 @@ export const googleOauthUpdatePresentationOutputSchema = z.object({
2549
2549
  error: z.string().describe("The error that occurred if the presentation was not created successfully").optional(),
2550
2550
  presentationUrl: z.string().describe("The URL of the created presentation").optional(),
2551
2551
  });
2552
+ export const googleOauthGetPresentationParamsSchema = z.object({
2553
+ presentationId: z.string().describe("The ID of the presentation to retrieve"),
2554
+ });
2555
+ export const googleOauthGetPresentationOutputSchema = z.object({
2556
+ success: z.boolean().describe("Whether the presentation was retrieved successfully"),
2557
+ error: z.string().describe("The error that occurred if the presentation was not retrieved successfully").optional(),
2558
+ presentation: z.any().optional(),
2559
+ });
2552
2560
  export const googleOauthSearchDriveByKeywordsParamsSchema = z.object({
2553
2561
  keywords: z.array(z.string()).describe("List of keywords to search for in file contents."),
2554
2562
  limit: z.number().describe("The maximum number of files to return").optional(),
@@ -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, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } 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, } from "./autogen/templates.js";
2
2
  export const ACTION_GROUPS = {
3
3
  GENERIC: {
4
4
  description: "Generic utility actions",
@@ -47,7 +47,6 @@ export const ACTION_GROUPS = {
47
47
  googleOauthUpdatePresentationDefinition,
48
48
  googleOauthSearchDriveByKeywordsDefinition,
49
49
  googleOauthSearchDriveByQueryDefinition,
50
- googleOauthSearchDriveByQueryAndGetFileContentDefinition,
51
50
  googleOauthGetDriveFileContentByIdDefinition,
52
51
  ],
53
52
  },
@@ -199,8 +198,6 @@ export const ACTION_GROUPS = {
199
198
  githubCreateBranchDefinition,
200
199
  githubCreatePullRequestDefinition,
201
200
  githubListPullRequestsDefinition,
202
- githubGetFileContentDefinition,
203
- githubListDirectoryDefinition,
204
201
  ],
205
202
  },
206
203
  ASHBY: {
@@ -0,0 +1,3 @@
1
+ import type { credalCallCopilotFunction } from "../../autogen/types";
2
+ declare const callCopilot: credalCallCopilotFunction;
3
+ export default callCopilot;
@@ -0,0 +1,36 @@
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 sdk_1 = require("@credal/sdk");
13
+ const callCopilot = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
+ var _b;
15
+ const requestBody = {
16
+ agentId: params.agentId,
17
+ query: params.query,
18
+ userEmail: params.userEmail,
19
+ };
20
+ const baseUrl = (_b = authParams.baseUrl) !== null && _b !== void 0 ? _b : "https://app.credal.ai/api";
21
+ const client = new sdk_1.CredalClient({ environment: baseUrl, apiKey: authParams.apiKey });
22
+ const response = yield client.copilots.sendMessage({
23
+ agentId: requestBody.agentId,
24
+ message: requestBody.query,
25
+ userEmail: requestBody.userEmail,
26
+ });
27
+ return {
28
+ response: response.sendChatResult.type === "ai_response_result"
29
+ ? response.sendChatResult.response.message
30
+ : "Error getting response",
31
+ referencedSources: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.referencedSources : [],
32
+ sourcesInDataContext: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.sourcesInDataContext : [],
33
+ webSearchResults: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.webSearchResults : [],
34
+ };
35
+ });
36
+ exports.default = callCopilot;
@@ -0,0 +1,6 @@
1
+ import type { googleOauthGetPresentationFunction } from "../../autogen/types.js";
2
+ /**
3
+ * Gets a Google Slides presentation by ID using OAuth authentication
4
+ */
5
+ declare const getPresentation: googleOauthGetPresentationFunction;
6
+ export default getPresentation;
@@ -0,0 +1,172 @@
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
+ import { z } from "zod";
13
+ // Zod schemas for Google Slides API response structure
14
+ const TextStyleSchema = z
15
+ .object({
16
+ fontSize: z
17
+ .object({
18
+ magnitude: z.number().optional(),
19
+ unit: z.string().optional(),
20
+ })
21
+ .optional(),
22
+ foregroundColor: z
23
+ .object({
24
+ opaqueColor: z
25
+ .object({
26
+ rgbColor: z
27
+ .object({
28
+ red: z.number().optional(),
29
+ green: z.number().optional(),
30
+ blue: z.number().optional(),
31
+ })
32
+ .optional(),
33
+ })
34
+ .optional(),
35
+ })
36
+ .optional(),
37
+ fontFamily: z.string().optional(),
38
+ bold: z.boolean().optional(),
39
+ })
40
+ .passthrough();
41
+ const TextRunSchema = z
42
+ .object({
43
+ content: z.string().optional(),
44
+ style: TextStyleSchema.optional(),
45
+ })
46
+ .passthrough();
47
+ const TextElementSchema = z
48
+ .object({
49
+ textRun: TextRunSchema.optional(),
50
+ })
51
+ .passthrough();
52
+ const TextSchema = z
53
+ .object({
54
+ textElements: z.array(TextElementSchema).optional(),
55
+ })
56
+ .passthrough();
57
+ const ShapeSchema = z
58
+ .object({
59
+ text: TextSchema.optional(),
60
+ })
61
+ .passthrough();
62
+ const PageElementSchema = z
63
+ .object({
64
+ objectId: z.string().optional(),
65
+ shape: ShapeSchema.optional(),
66
+ })
67
+ .passthrough();
68
+ const SlideSchema = z
69
+ .object({
70
+ objectId: z.string().optional(),
71
+ pageElements: z.array(PageElementSchema).optional(),
72
+ })
73
+ .passthrough();
74
+ const GoogleSlidesResponseSchema = z
75
+ .object({
76
+ title: z.string().optional(),
77
+ slides: z.array(SlideSchema).optional(),
78
+ })
79
+ .passthrough();
80
+ /**
81
+ * Formats text styling information into a concatenated string
82
+ */
83
+ const formatStyling = (textStyle) => {
84
+ var _a, _b, _c, _d;
85
+ if (!textStyle)
86
+ return "";
87
+ const parts = [];
88
+ if (((_a = textStyle.fontSize) === null || _a === void 0 ? void 0 : _a.magnitude) && ((_b = textStyle.fontSize) === null || _b === void 0 ? void 0 : _b.unit)) {
89
+ parts.push(`size: ${textStyle.fontSize.magnitude}${textStyle.fontSize.unit}`);
90
+ }
91
+ if ((_d = (_c = textStyle.foregroundColor) === null || _c === void 0 ? void 0 : _c.opaqueColor) === null || _d === void 0 ? void 0 : _d.rgbColor) {
92
+ const { red = 0, green = 0, blue = 0 } = textStyle.foregroundColor.opaqueColor.rgbColor;
93
+ const hexColor = "#" +
94
+ [red, green, blue]
95
+ .map(c => Math.round(c * 255)
96
+ .toString(16)
97
+ .padStart(2, "0"))
98
+ .join("");
99
+ parts.push(`color: ${hexColor}`);
100
+ }
101
+ if (textStyle.fontFamily) {
102
+ parts.push(`family: ${textStyle.fontFamily}`);
103
+ }
104
+ if (textStyle.bold) {
105
+ parts.push(`bold`);
106
+ }
107
+ return parts.join(", ");
108
+ };
109
+ /**
110
+ * Gets a Google Slides presentation by ID using OAuth authentication
111
+ */
112
+ const getPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
113
+ var _b;
114
+ if (!authParams.authToken) {
115
+ throw new Error(MISSING_AUTH_TOKEN);
116
+ }
117
+ const { presentationId } = params;
118
+ const baseApiUrl = `https://slides.googleapis.com/v1/presentations/${presentationId}`;
119
+ try {
120
+ const response = yield axiosClient.get(baseApiUrl, {
121
+ headers: {
122
+ Authorization: `Bearer ${authParams.authToken}`,
123
+ "Content-Type": "application/json",
124
+ },
125
+ });
126
+ if (response.status < 200 || response.status >= 300) {
127
+ return {
128
+ success: false,
129
+ error: response.statusText,
130
+ };
131
+ }
132
+ // Validate and parse the Google Slides API response
133
+ const parsedData = GoogleSlidesResponseSchema.parse(response.data);
134
+ const presentation = {
135
+ title: parsedData.title,
136
+ slides: ((_b = parsedData.slides) === null || _b === void 0 ? void 0 : _b.map(slide => {
137
+ var _a;
138
+ return ({
139
+ objectId: slide.objectId,
140
+ pageElements: ((_a = slide.pageElements) === null || _a === void 0 ? void 0 : _a.flatMap(element => {
141
+ var _a, _b;
142
+ const textElements = ((_b = (_a = element.shape) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.textElements) || [];
143
+ return textElements
144
+ .map(textElement => {
145
+ var _a, _b;
146
+ const content = ((_a = textElement.textRun) === null || _a === void 0 ? void 0 : _a.content) || "";
147
+ const styling = formatStyling((_b = textElement.textRun) === null || _b === void 0 ? void 0 : _b.style);
148
+ return {
149
+ objectId: `${element.objectId}`,
150
+ text: content,
151
+ styling,
152
+ };
153
+ })
154
+ .filter(textRun => textRun.text.trim());
155
+ }).filter(Boolean)) || [],
156
+ });
157
+ })) || [],
158
+ };
159
+ return {
160
+ success: true,
161
+ presentation,
162
+ };
163
+ }
164
+ catch (error) {
165
+ console.error("Error getting presentation:", error);
166
+ return {
167
+ success: false,
168
+ error: error instanceof Error ? error.message : "Unknown error",
169
+ };
170
+ }
171
+ });
172
+ export default getPresentation;
@@ -0,0 +1 @@
1
+ export * as add from "./add";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.add = void 0;
37
+ exports.add = __importStar(require("./add"));
@@ -0,0 +1,3 @@
1
+ import { salesforceGetSalesforceRecordsByQueryFunction } from "../../autogen/types";
2
+ declare const getSalesforceRecordByQuery: salesforceGetSalesforceRecordsByQueryFunction;
3
+ export default getSalesforceRecordByQuery;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const axiosClient_1 = require("../../util/axiosClient");
13
+ const getSalesforceRecordByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
+ const { authToken, baseUrl } = authParams;
15
+ const { query, limit } = params;
16
+ if (!authToken || !baseUrl) {
17
+ return {
18
+ success: false,
19
+ error: "authToken and baseUrl are required for Salesforce API",
20
+ };
21
+ }
22
+ // The API limits the maximum number of records returned to 2000, the limit lets the user set a smaller custom limit
23
+ const url = `${baseUrl}/services/data/v56.0/query/?q=${encodeURIComponent(query + " LIMIT " + (limit != undefined && limit <= 2000 ? limit : 2000))}`;
24
+ try {
25
+ const response = yield axiosClient_1.axiosClient.get(url, {
26
+ headers: {
27
+ Authorization: `Bearer ${authToken}`,
28
+ },
29
+ });
30
+ return {
31
+ success: true,
32
+ records: response.data,
33
+ };
34
+ }
35
+ catch (error) {
36
+ console.error("Error retrieving Salesforce record:", error);
37
+ return {
38
+ success: false,
39
+ error: error instanceof Error ? error.message : "An unknown error occurred",
40
+ };
41
+ }
42
+ });
43
+ exports.default = getSalesforceRecordByQuery;
@@ -9,21 +9,14 @@ 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 { getSlackChannels } from "./helpers.js";
13
12
  const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
13
  if (!authParams.authToken) {
15
14
  throw new Error(MISSING_AUTH_TOKEN);
16
15
  }
17
16
  try {
18
17
  const client = new WebClient(authParams.authToken);
19
- const { channelName } = params;
20
- const allChannels = yield getSlackChannels(client);
21
- const channel = allChannels.find(channel => channel.name == channelName);
22
- if (!channel || !channel.id) {
23
- throw Error(`Channel with name ${channelName} not found`);
24
- }
25
- yield client.conversations.join({ channel: channel.id });
26
- const result = yield client.conversations.archive({ channel: channel.id });
18
+ const { channelId } = params;
19
+ const result = yield client.conversations.archive({ channel: channelId });
27
20
  if (!result.ok) {
28
21
  return {
29
22
  success: false,
@@ -0,0 +1 @@
1
+ export * as listConversations from "./listConversations";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.listConversations = void 0;
37
+ exports.listConversations = __importStar(require("./listConversations"));
@@ -0,0 +1,3 @@
1
+ import type { slackListConversationsFunction } from "../../autogen/types";
2
+ declare const slackListConversations: slackListConversationsFunction;
3
+ export default slackListConversations;
@@ -0,0 +1,41 @@
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 web_api_1 = require("@slack/web-api");
13
+ const helpers_1 = require("./helpers");
14
+ const slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
15
+ const client = new web_api_1.WebClient(authParams.authToken);
16
+ try {
17
+ const allChannels = yield (0, helpers_1.getSlackChannels)(client);
18
+ const filteredChannels = [];
19
+ for (const channel of allChannels) {
20
+ if (channel.name && channel.topic && channel.topic.value && channel.purpose && channel.purpose.value) {
21
+ const purpose = channel.purpose.value;
22
+ const topic = channel.topic.value;
23
+ const name = channel.name;
24
+ filteredChannels.push(Object.assign(Object.assign({}, channel), { purpose, topic, name }));
25
+ }
26
+ }
27
+ return {
28
+ channels: filteredChannels,
29
+ };
30
+ }
31
+ catch (error) {
32
+ if (error instanceof Error) {
33
+ // Enhance error with more context
34
+ throw new Error(`Failed to list Slack conversations: ${error.message}`);
35
+ }
36
+ else {
37
+ throw error;
38
+ }
39
+ }
40
+ });
41
+ exports.default = slackListConversations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.98",
3
+ "version": "0.2.100",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
- declare const searchRepository: githubSearchRepositoryFunction;
3
- export default searchRepository;
@@ -1,131 +0,0 @@
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
- // Limits on the number of results to return
12
- const MAX_CODE_RESULTS = 15;
13
- const MAX_COMMITS = 10;
14
- const MAX_FILES_PER_COMMIT = 5;
15
- const MAX_ISSUES_OR_PRS = 10;
16
- const MAX_FILES_PER_PR = 5;
17
- const MAX_PATCH_LINES = 20;
18
- const MAX_FRAGMENT_LINES = 20;
19
- const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
- const { Octokit } = yield import("octokit");
21
- if (!authParams.authToken) {
22
- throw new Error(MISSING_AUTH_TOKEN);
23
- }
24
- const octokit = new Octokit({ auth: authParams.authToken });
25
- const { organization, repository, query } = params;
26
- // Search CODE with text match metadata
27
- const codeResultsResponse = yield octokit.rest.search.code({
28
- q: `${query} in:file,path repo:${organization}/${repository}`,
29
- text_match: true,
30
- headers: {
31
- accept: "application/vnd.github.v3.text-match+json",
32
- },
33
- });
34
- const codeResults = codeResultsResponse.data.items.slice(0, MAX_CODE_RESULTS).map(item => ({
35
- name: item.name,
36
- path: item.path,
37
- sha: item.sha,
38
- url: item.url,
39
- repository: {
40
- full_name: item.repository.full_name,
41
- html_url: item.repository.html_url,
42
- },
43
- score: item.score,
44
- textMatches: item.text_matches
45
- ? item.text_matches.map(match => {
46
- var _a, _b, _c, _d;
47
- return ({
48
- object_url: (_a = match.object_url) !== null && _a !== void 0 ? _a : undefined,
49
- object_type: (_b = match.object_type) !== null && _b !== void 0 ? _b : undefined,
50
- fragment: (_c = match.fragment) === null || _c === void 0 ? void 0 : _c.split("\n").slice(0, MAX_FRAGMENT_LINES).join("\n"),
51
- matches: (_d = match.matches) !== null && _d !== void 0 ? _d : [],
52
- });
53
- })
54
- : [],
55
- }));
56
- // Search COMMITS
57
- const commitResults = yield octokit.rest.search.commits({
58
- q: `${query} repo:${organization}/${repository}`,
59
- headers: {
60
- accept: "application/vnd.github.cloak-preview+json",
61
- },
62
- });
63
- const commitSHAs = commitResults.data.items.slice(0, MAX_COMMITS).map(item => item.sha);
64
- const commitDetails = yield Promise.all(commitSHAs.map(sha => octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha })));
65
- const enrichedCommits = commitResults.data.items.slice(0, MAX_COMMITS).map(item => {
66
- var _a, _b;
67
- const full = commitDetails.find(c => c.data.sha === item.sha);
68
- return {
69
- sha: item.sha,
70
- url: item.url,
71
- commit: {
72
- message: item.commit.message,
73
- author: item.commit.author,
74
- },
75
- score: item.score,
76
- author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
77
- files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
78
- var _a;
79
- return ({
80
- filename: f.filename,
81
- status: f.status,
82
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
83
- });
84
- })) || [],
85
- };
86
- });
87
- // Search ISSUES & PRs
88
- const issueResults = yield octokit.rest.search.issuesAndPullRequests({
89
- q: `${query} repo:${organization}/${repository}`,
90
- });
91
- const prItems = issueResults.data.items.filter(item => item.pull_request).slice(0, MAX_ISSUES_OR_PRS);
92
- const prNumbers = prItems.map(item => item.number);
93
- const prFiles = yield Promise.all(prNumbers.map(number => octokit.rest.pulls.listFiles({ owner: organization, repo: repository, pull_number: number })));
94
- const issuesAndPRs = issueResults.data.items
95
- .slice(0, MAX_ISSUES_OR_PRS)
96
- .map(item => {
97
- var _a, _b, _c, _d;
98
- const isPR = !!item.pull_request;
99
- const prIndex = prNumbers.indexOf(item.number);
100
- const files = isPR && prIndex !== -1
101
- ? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
102
- var _a;
103
- return ({
104
- filename: f.filename,
105
- status: f.status,
106
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
107
- });
108
- })
109
- : undefined;
110
- return {
111
- number: item.number,
112
- title: item.title,
113
- html_url: item.html_url,
114
- state: item.state,
115
- isPullRequest: isPR,
116
- body: item.body,
117
- user: {
118
- email: (_b = (_a = item.user) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : undefined,
119
- name: (_d = (_c = item.user) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined,
120
- },
121
- score: item.score,
122
- files,
123
- };
124
- });
125
- return {
126
- code: codeResults,
127
- commits: enrichedCommits,
128
- issuesAndPullRequests: issuesAndPRs,
129
- };
130
- });
131
- export default searchRepository;
@@ -1,3 +0,0 @@
1
- import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
- declare const searchRepository: githubSearchRepositoryFunction;
3
- export default searchRepository;
@@ -1,41 +0,0 @@
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
- // Limits on the number of results to return
12
- const MAX_CODE_RESULTS = 15;
13
- const MAX_COMMITS = 10;
14
- const MAX_FILES_PER_COMMIT = 5;
15
- const MAX_ISSUES_OR_PRS = 10;
16
- const MAX_FILES_PER_PR = 5;
17
- const MAX_PATCH_LINES = 20;
18
- const MAX_FRAGMENT_LINES = 20;
19
- const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
- const { Octokit } = yield import("octokit");
21
- if (!authParams.authToken) {
22
- throw new Error(MISSING_AUTH_TOKEN);
23
- }
24
- const octokit = new Octokit({ auth: authParams.authToken });
25
- const { organization, repository, query } = params;
26
- // Search CODE with text match metadata
27
- const codeResultsResponse = yield octokit.rest.search.code({
28
- q: `${query} in:file,path repo:${organization}/${repository}`,
29
- text_match: true,
30
- headers: {
31
- accept: "application/vnd.github.v3.text-match+json",
32
- },
33
- });
34
- const commitResults = yield octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha });
35
- return {
36
- code: codeResults,
37
- commits: enrichedCommits,
38
- issuesAndPullRequests: issuesAndPRs,
39
- };
40
- });
41
- export default searchRepository;