@credal/actions 0.2.107 → 0.2.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.js +7 -1
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +272 -0
- package/dist/actions/autogen/types.d.ts +574 -0
- package/dist/actions/autogen/types.js +116 -0
- package/dist/actions/groups.js +11 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +46 -0
- package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
- package/dist/actions/providers/credal/callCopilot.js +36 -0
- package/dist/actions/providers/generic/fillTemplateAction.d.ts +7 -0
- package/dist/actions/providers/generic/fillTemplateAction.js +18 -0
- package/dist/actions/providers/generic/genericApiCall.d.ts +3 -0
- package/dist/actions/providers/generic/genericApiCall.js +38 -0
- package/dist/actions/providers/github/getBranch.d.ts +7 -0
- package/dist/actions/providers/github/getBranch.js +67 -0
- package/dist/actions/providers/google-oauth/editAGoogleCalendarEvent.js +9 -1
- package/dist/actions/providers/google-oauth/getDriveContentById.d.ts +3 -0
- package/dist/actions/providers/google-oauth/getDriveContentById.js +161 -0
- package/dist/actions/providers/google-oauth/listCalendarEvents.js +3 -0
- package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +2 -0
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.js +47 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.js +110 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.js +78 -0
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.d.ts +15 -0
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.js +129 -0
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/math/index.d.ts +1 -0
- package/dist/actions/providers/math/index.js +37 -0
- package/dist/actions/providers/slack/index.d.ts +1 -0
- package/dist/actions/providers/slack/index.js +37 -0
- package/dist/actions/providers/slack/listConversations.d.ts +3 -0
- package/dist/actions/providers/slack/listConversations.js +41 -0
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.d.ts +3 -0
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.js +154 -0
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.d.ts +3 -0
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.js +45 -0
- package/dist/utils/datetime.d.ts +1 -0
- package/dist/utils/datetime.js +7 -0
- package/package.json +1 -1
- package/dist/actions/providers/github/fetchFile.d.ts +0 -3
- package/dist/actions/providers/github/fetchFile.js +0 -131
- package/dist/actions/providers/github/getContents.d.ts +0 -3
- package/dist/actions/providers/github/getContents.js +0 -41
|
@@ -1546,6 +1546,10 @@ export const googleOauthScheduleCalendarMeetingOutputSchema = z.object({
|
|
|
1546
1546
|
success: z.boolean().describe("Whether the meeting was scheduled successfully"),
|
|
1547
1547
|
eventId: z.string().describe("The ID of the event that was scheduled").optional(),
|
|
1548
1548
|
eventUrl: z.string().describe("The URL to access the scheduled event").optional(),
|
|
1549
|
+
eventDayOfWeek: z
|
|
1550
|
+
.string()
|
|
1551
|
+
.describe("The day of the week when the event is scheduled (e.g., Monday, Tuesday, etc.)")
|
|
1552
|
+
.optional(),
|
|
1549
1553
|
error: z.string().describe("The error that occurred if the meeting was not scheduled successfully").optional(),
|
|
1550
1554
|
});
|
|
1551
1555
|
export const googleOauthListCalendarsParamsSchema = z.object({
|
|
@@ -1583,7 +1587,15 @@ export const googleOauthListCalendarEventsOutputSchema = z.object({
|
|
|
1583
1587
|
description: z.string().describe("Description of the event").optional(),
|
|
1584
1588
|
location: z.string().describe("Geographic location of the event as free-form text").optional(),
|
|
1585
1589
|
start: z.string().describe("Start date/time (for timed events, RFC3339 timestamp)").optional(),
|
|
1590
|
+
startDayOfWeek: z
|
|
1591
|
+
.string()
|
|
1592
|
+
.describe("The day of the week when the event starts (e.g., Monday, Tuesday, etc.)")
|
|
1593
|
+
.optional(),
|
|
1586
1594
|
end: z.string().describe("End date/time (for timed events, RFC3339 timestamp)").optional(),
|
|
1595
|
+
endDayOfWeek: z
|
|
1596
|
+
.string()
|
|
1597
|
+
.describe("The day of the week when the event ends (e.g., Monday, Tuesday, etc.)")
|
|
1598
|
+
.optional(),
|
|
1587
1599
|
attendees: z
|
|
1588
1600
|
.array(z.object({
|
|
1589
1601
|
email: z.string().describe("The attendee's email address").optional(),
|
|
@@ -1679,6 +1691,10 @@ export const googleOauthEditAGoogleCalendarEventOutputSchema = z.object({
|
|
|
1679
1691
|
success: z.boolean().describe("Whether the event was edited successfully"),
|
|
1680
1692
|
eventId: z.string().describe("The ID of the edited event").optional(),
|
|
1681
1693
|
eventUrl: z.string().describe("The URL to access the edited event").optional(),
|
|
1694
|
+
eventDayOfWeek: z
|
|
1695
|
+
.string()
|
|
1696
|
+
.describe("The day of the week when the edited event occurs (e.g., Monday, Tuesday, etc.)")
|
|
1697
|
+
.optional(),
|
|
1682
1698
|
error: z.string().describe("The error that occurred if the event was not edited successfully").optional(),
|
|
1683
1699
|
});
|
|
1684
1700
|
export const googleOauthDeleteCalendarEventParamsSchema = z.object({
|
|
@@ -3823,6 +3839,106 @@ export const githubSearchOrganizationOutputSchema = z.object({
|
|
|
3823
3839
|
}))
|
|
3824
3840
|
.describe("A list of issues and pull requests that match the query"),
|
|
3825
3841
|
});
|
|
3842
|
+
export const githubGetBranchParamsSchema = z.object({
|
|
3843
|
+
repositoryOwner: z.string().describe("The owner of the repository"),
|
|
3844
|
+
repositoryName: z.string().describe("The name of the repository"),
|
|
3845
|
+
branchName: z.string().describe("The name of the branch to retrieve"),
|
|
3846
|
+
});
|
|
3847
|
+
export const githubGetBranchOutputSchema = z.object({
|
|
3848
|
+
success: z.boolean().describe("Whether the operation was successful"),
|
|
3849
|
+
error: z.string().describe("The error that occurred if the operation was not successful").optional(),
|
|
3850
|
+
branch: z
|
|
3851
|
+
.object({
|
|
3852
|
+
name: z.string().describe("The name of the branch").optional(),
|
|
3853
|
+
commit: z
|
|
3854
|
+
.object({
|
|
3855
|
+
sha: z.string().describe("The SHA of the commit").optional(),
|
|
3856
|
+
node_id: z.string().describe("The node ID of the commit").optional(),
|
|
3857
|
+
url: z.string().describe("The API URL of the commit").optional(),
|
|
3858
|
+
html_url: z.string().describe("The HTML URL of the commit").optional(),
|
|
3859
|
+
comments_url: z.string().describe("The URL for commit comments").optional(),
|
|
3860
|
+
commit: z
|
|
3861
|
+
.object({
|
|
3862
|
+
author: z
|
|
3863
|
+
.object({ name: z.string().optional(), email: z.string().optional(), date: z.string().optional() })
|
|
3864
|
+
.nullable()
|
|
3865
|
+
.describe("The commit author")
|
|
3866
|
+
.optional(),
|
|
3867
|
+
committer: z
|
|
3868
|
+
.object({ name: z.string().optional(), email: z.string().optional(), date: z.string().optional() })
|
|
3869
|
+
.nullable()
|
|
3870
|
+
.describe("The commit committer")
|
|
3871
|
+
.optional(),
|
|
3872
|
+
message: z.string().describe("The commit message").optional(),
|
|
3873
|
+
tree: z
|
|
3874
|
+
.object({ sha: z.string().optional(), url: z.string().optional() })
|
|
3875
|
+
.describe("The commit tree")
|
|
3876
|
+
.optional(),
|
|
3877
|
+
url: z.string().describe("The commit URL").optional(),
|
|
3878
|
+
comment_count: z.number().int().describe("Number of comments on the commit").optional(),
|
|
3879
|
+
})
|
|
3880
|
+
.describe("The git commit object")
|
|
3881
|
+
.optional(),
|
|
3882
|
+
author: z
|
|
3883
|
+
.object({
|
|
3884
|
+
login: z.string().optional(),
|
|
3885
|
+
id: z.number().int().optional(),
|
|
3886
|
+
node_id: z.string().optional(),
|
|
3887
|
+
avatar_url: z.string().optional(),
|
|
3888
|
+
html_url: z.string().optional(),
|
|
3889
|
+
type: z.string().optional(),
|
|
3890
|
+
})
|
|
3891
|
+
.nullable()
|
|
3892
|
+
.describe("The commit author user")
|
|
3893
|
+
.optional(),
|
|
3894
|
+
committer: z
|
|
3895
|
+
.object({
|
|
3896
|
+
login: z.string().optional(),
|
|
3897
|
+
id: z.number().int().optional(),
|
|
3898
|
+
node_id: z.string().optional(),
|
|
3899
|
+
avatar_url: z.string().optional(),
|
|
3900
|
+
html_url: z.string().optional(),
|
|
3901
|
+
type: z.string().optional(),
|
|
3902
|
+
})
|
|
3903
|
+
.nullable()
|
|
3904
|
+
.describe("The commit committer user")
|
|
3905
|
+
.optional(),
|
|
3906
|
+
parents: z
|
|
3907
|
+
.array(z.object({ sha: z.string().optional(), url: z.string().optional(), html_url: z.string().optional() }))
|
|
3908
|
+
.describe("The commit parents")
|
|
3909
|
+
.optional(),
|
|
3910
|
+
})
|
|
3911
|
+
.describe("The commit information")
|
|
3912
|
+
.optional(),
|
|
3913
|
+
_links: z
|
|
3914
|
+
.object({
|
|
3915
|
+
html: z.string().describe("The HTML URL of the branch").optional(),
|
|
3916
|
+
self: z.string().describe("The API URL of the branch").optional(),
|
|
3917
|
+
})
|
|
3918
|
+
.describe("Links related to the branch")
|
|
3919
|
+
.optional(),
|
|
3920
|
+
protected: z.boolean().describe("Whether the branch is protected").optional(),
|
|
3921
|
+
protection: z
|
|
3922
|
+
.object({
|
|
3923
|
+
enabled: z.boolean().describe("Whether protection is enabled").optional(),
|
|
3924
|
+
required_status_checks: z
|
|
3925
|
+
.object({
|
|
3926
|
+
enforcement_level: z.string().optional(),
|
|
3927
|
+
contexts: z.array(z.string()).optional(),
|
|
3928
|
+
strict: z.boolean().optional(),
|
|
3929
|
+
})
|
|
3930
|
+
.nullable()
|
|
3931
|
+
.describe("Required status checks")
|
|
3932
|
+
.optional(),
|
|
3933
|
+
})
|
|
3934
|
+
.nullable()
|
|
3935
|
+
.describe("Branch protection details")
|
|
3936
|
+
.optional(),
|
|
3937
|
+
protection_url: z.string().describe("The URL of the branch protection settings").optional(),
|
|
3938
|
+
})
|
|
3939
|
+
.describe("The branch information")
|
|
3940
|
+
.optional(),
|
|
3941
|
+
});
|
|
3826
3942
|
export const githubListCommitsParamsSchema = z.object({
|
|
3827
3943
|
repositoryOwner: z.string().describe("The owner of the repository"),
|
|
3828
3944
|
repositoryName: z.string().describe("The name of the repository"),
|
package/dist/actions/groups.js
CHANGED
|
@@ -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, linearGetIssueDetailsDefinition, linearGetProjectsDefinition, linearGetProjectDetailsDefinition, linearGetTeamDetailsDefinition, linearGetTeamsDefinition, 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";
|
|
2
2
|
export const ACTION_GROUPS = {
|
|
3
3
|
GENERIC: {
|
|
4
4
|
description: "Generic utility actions",
|
|
@@ -248,4 +248,14 @@ export const ACTION_GROUPS = {
|
|
|
248
248
|
oktaTriggerOktaWorkflowDefinition,
|
|
249
249
|
],
|
|
250
250
|
},
|
|
251
|
+
LINEAR: {
|
|
252
|
+
description: "Actions for interacting with Linear",
|
|
253
|
+
actions: [
|
|
254
|
+
linearGetIssueDetailsDefinition,
|
|
255
|
+
linearGetProjectsDefinition,
|
|
256
|
+
linearGetProjectDetailsDefinition,
|
|
257
|
+
linearGetTeamDetailsDefinition,
|
|
258
|
+
linearGetTeamsDefinition,
|
|
259
|
+
],
|
|
260
|
+
},
|
|
251
261
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
|
14
|
+
return {
|
|
15
|
+
baseURL: baseUrl,
|
|
16
|
+
headers: {
|
|
17
|
+
Accept: "application/json",
|
|
18
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
23
|
+
const { pageId, content, title } = params;
|
|
24
|
+
const { baseUrl, authToken, username } = authParams;
|
|
25
|
+
if (!baseUrl || !authToken || !username) {
|
|
26
|
+
throw new Error("Missing required authentication information");
|
|
27
|
+
}
|
|
28
|
+
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
|
29
|
+
// Get current version number
|
|
30
|
+
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
|
31
|
+
const currVersion = response.data.version.number;
|
|
32
|
+
const payload = {
|
|
33
|
+
id: pageId,
|
|
34
|
+
status: "current",
|
|
35
|
+
title,
|
|
36
|
+
body: {
|
|
37
|
+
representation: "storage",
|
|
38
|
+
value: content,
|
|
39
|
+
},
|
|
40
|
+
version: {
|
|
41
|
+
number: currVersion + 1,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
|
45
|
+
});
|
|
46
|
+
exports.default = confluenceUpdatePage;
|
|
@@ -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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const fillTemplateAction = (_a) => __awaiter(void 0, [_a], void 0, function* ({ template }) {
|
|
13
|
+
// Simply return the template without any modification
|
|
14
|
+
return {
|
|
15
|
+
result: template,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
exports.default = fillTemplateAction;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
const genericApiCall = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, }) {
|
|
17
|
+
try {
|
|
18
|
+
const { endpoint, method, headers, body } = params;
|
|
19
|
+
const response = yield (0, axios_1.default)({
|
|
20
|
+
url: endpoint,
|
|
21
|
+
method,
|
|
22
|
+
headers,
|
|
23
|
+
data: method !== "GET" ? body : undefined,
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
statusCode: response.status,
|
|
27
|
+
headers: response.headers,
|
|
28
|
+
data: response.data,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
33
|
+
throw Error("Axios Error: " + (error.message || "Failed to make API call"));
|
|
34
|
+
}
|
|
35
|
+
throw Error("Error: " + (error || "Failed to make API call"));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
exports.default = genericApiCall;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { githubGetBranchFunction } from "../../autogen/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get a branch in a GitHub repository
|
|
4
|
+
* https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#get-a-branch
|
|
5
|
+
*/
|
|
6
|
+
declare const getBranch: githubGetBranchFunction;
|
|
7
|
+
export default getBranch;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
|
+
import { getOctokit } from "./utils.js";
|
|
12
|
+
/**
|
|
13
|
+
* Get a branch in a GitHub repository
|
|
14
|
+
* https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#get-a-branch
|
|
15
|
+
*/
|
|
16
|
+
const getBranch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
17
|
+
if (!authParams.authToken) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
error: MISSING_AUTH_TOKEN,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const octokit = yield getOctokit(authParams.authToken);
|
|
24
|
+
const { repositoryOwner, repositoryName, branchName } = params;
|
|
25
|
+
try {
|
|
26
|
+
const response = yield octokit.rest.repos.getBranch({
|
|
27
|
+
owner: repositoryOwner,
|
|
28
|
+
repo: repositoryName,
|
|
29
|
+
branch: branchName,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
branch: {
|
|
34
|
+
name: response.data.name,
|
|
35
|
+
commit: {
|
|
36
|
+
sha: response.data.commit.sha,
|
|
37
|
+
node_id: response.data.commit.node_id,
|
|
38
|
+
url: response.data.commit.url,
|
|
39
|
+
html_url: response.data.commit.html_url,
|
|
40
|
+
comments_url: response.data.commit.comments_url,
|
|
41
|
+
commit: {
|
|
42
|
+
author: response.data.commit.commit.author,
|
|
43
|
+
committer: response.data.commit.commit.committer,
|
|
44
|
+
message: response.data.commit.commit.message,
|
|
45
|
+
tree: response.data.commit.commit.tree,
|
|
46
|
+
url: response.data.commit.commit.url,
|
|
47
|
+
comment_count: response.data.commit.commit.comment_count,
|
|
48
|
+
},
|
|
49
|
+
author: response.data.commit.author,
|
|
50
|
+
committer: response.data.commit.committer,
|
|
51
|
+
parents: response.data.commit.parents,
|
|
52
|
+
},
|
|
53
|
+
_links: response.data._links,
|
|
54
|
+
protected: response.data.protected,
|
|
55
|
+
protection: response.data.protection,
|
|
56
|
+
protection_url: response.data.protection_url,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return {
|
|
62
|
+
success: false,
|
|
63
|
+
error: `Failed to get branch: ${error instanceof Error ? error.message : String(error)}`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export default getBranch;
|
|
@@ -9,9 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
11
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
import { getDayOfWeek } from "../../../utils/datetime.js";
|
|
12
13
|
const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
14
|
+
var _b, _c;
|
|
13
15
|
if (!authParams.authToken) {
|
|
14
|
-
return { success: false, error: MISSING_AUTH_TOKEN, eventId: "", eventUrl: "" };
|
|
16
|
+
return { success: false, error: MISSING_AUTH_TOKEN, eventId: "", eventUrl: "", eventDayOfWeek: "" };
|
|
15
17
|
}
|
|
16
18
|
const { calendarId, eventId, title, description, start, end, location, attendees, status, organizer, timeZone } = params;
|
|
17
19
|
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(eventId)}`;
|
|
@@ -47,10 +49,15 @@ const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, functio
|
|
|
47
49
|
},
|
|
48
50
|
});
|
|
49
51
|
const { id, htmlLink } = res.data;
|
|
52
|
+
// Get the event day of week from the start time (use provided start or fetch from response)
|
|
53
|
+
const eventDayOfWeek = start
|
|
54
|
+
? getDayOfWeek(start)
|
|
55
|
+
: getDayOfWeek(((_b = res.data.start) === null || _b === void 0 ? void 0 : _b.dateTime) || ((_c = res.data.start) === null || _c === void 0 ? void 0 : _c.date) || "");
|
|
50
56
|
return {
|
|
51
57
|
success: true,
|
|
52
58
|
eventId: id,
|
|
53
59
|
eventUrl: htmlLink,
|
|
60
|
+
eventDayOfWeek,
|
|
54
61
|
};
|
|
55
62
|
}
|
|
56
63
|
catch (error) {
|
|
@@ -59,6 +66,7 @@ const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, functio
|
|
|
59
66
|
error: error instanceof Error ? error.message : "Unknown error editing event",
|
|
60
67
|
eventId: "",
|
|
61
68
|
eventUrl: "",
|
|
69
|
+
eventDayOfWeek: "",
|
|
62
70
|
};
|
|
63
71
|
}
|
|
64
72
|
});
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import pdf from "pdf-parse/lib/pdf-parse.js";
|
|
11
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
12
|
+
import mammoth from "mammoth";
|
|
13
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
14
|
+
const getDriveFileContentByID = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
15
|
+
if (!authParams.authToken) {
|
|
16
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
|
17
|
+
}
|
|
18
|
+
const { fileId, limit } = params;
|
|
19
|
+
try {
|
|
20
|
+
// First, get file metadata to determine the file type
|
|
21
|
+
const metadataUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?fields=name,mimeType,size`;
|
|
22
|
+
const metadataRes = yield axiosClient.get(metadataUrl, {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const { name: fileName, mimeType, size } = metadataRes.data;
|
|
28
|
+
// Check if file is too large (50MB limit for safety)
|
|
29
|
+
if (size && parseInt(size) > 50 * 1024 * 1024) {
|
|
30
|
+
return {
|
|
31
|
+
success: false,
|
|
32
|
+
error: "File too large (>50MB)",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
let content = "";
|
|
36
|
+
// Handle different file types - read content directly
|
|
37
|
+
if (mimeType === "application/vnd.google-apps.document") {
|
|
38
|
+
// Google Docs - download as plain text
|
|
39
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=txt`;
|
|
40
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
43
|
+
},
|
|
44
|
+
responseType: 'text',
|
|
45
|
+
});
|
|
46
|
+
content = downloadRes.data;
|
|
47
|
+
}
|
|
48
|
+
else if (mimeType === "application/vnd.google-apps.spreadsheet") {
|
|
49
|
+
// Google Sheets - download as CSV
|
|
50
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=csv`;
|
|
51
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
54
|
+
},
|
|
55
|
+
responseType: 'text',
|
|
56
|
+
});
|
|
57
|
+
content = downloadRes.data;
|
|
58
|
+
}
|
|
59
|
+
else if (mimeType === "application/vnd.google-apps.presentation") {
|
|
60
|
+
// Google Slides - download as plain text
|
|
61
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media&format=txt`;
|
|
62
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
63
|
+
headers: {
|
|
64
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
65
|
+
},
|
|
66
|
+
responseType: 'text',
|
|
67
|
+
});
|
|
68
|
+
content = downloadRes.data;
|
|
69
|
+
}
|
|
70
|
+
else if (mimeType === "application/pdf") {
|
|
71
|
+
// PDF files - use pdf-parse
|
|
72
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
73
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
74
|
+
headers: {
|
|
75
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
76
|
+
},
|
|
77
|
+
responseType: 'arraybuffer',
|
|
78
|
+
});
|
|
79
|
+
try {
|
|
80
|
+
const pdfData = yield pdf(downloadRes.data);
|
|
81
|
+
content = pdfData.text;
|
|
82
|
+
}
|
|
83
|
+
catch (pdfError) {
|
|
84
|
+
return {
|
|
85
|
+
success: false,
|
|
86
|
+
error: `Failed to parse PDF: ${pdfError instanceof Error ? pdfError.message : 'Unknown PDF error'}`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else if (mimeType === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ||
|
|
91
|
+
mimeType === "application/msword") {
|
|
92
|
+
// Word documents (.docx or .doc) - download and extract text using mammoth
|
|
93
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
94
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
97
|
+
},
|
|
98
|
+
responseType: 'arraybuffer',
|
|
99
|
+
});
|
|
100
|
+
try {
|
|
101
|
+
// mammoth works with .docx files. It will ignore formatting and return raw text
|
|
102
|
+
const result = yield mammoth.extractRawText({ buffer: Buffer.from(downloadRes.data) });
|
|
103
|
+
content = result.value; // raw text
|
|
104
|
+
}
|
|
105
|
+
catch (wordError) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
error: `Failed to parse Word document: ${wordError instanceof Error ? wordError.message : 'Unknown Word error'}`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else if (mimeType === "text/plain" ||
|
|
113
|
+
mimeType === "text/html" ||
|
|
114
|
+
mimeType === "application/rtf" ||
|
|
115
|
+
(mimeType === null || mimeType === void 0 ? void 0 : mimeType.startsWith("text/"))) {
|
|
116
|
+
// Text-based files
|
|
117
|
+
const downloadUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?alt=media`;
|
|
118
|
+
const downloadRes = yield axiosClient.get(downloadUrl, {
|
|
119
|
+
headers: {
|
|
120
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
|
121
|
+
},
|
|
122
|
+
responseType: 'text',
|
|
123
|
+
});
|
|
124
|
+
content = downloadRes.data;
|
|
125
|
+
}
|
|
126
|
+
else if (mimeType === null || mimeType === void 0 ? void 0 : mimeType.startsWith("image/")) {
|
|
127
|
+
// Skip images
|
|
128
|
+
return {
|
|
129
|
+
success: false,
|
|
130
|
+
error: "Image files are not supported for text extraction",
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// Unsupported file type
|
|
135
|
+
return {
|
|
136
|
+
success: false,
|
|
137
|
+
error: `Unsupported file type: ${mimeType}`,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
content = content.trim();
|
|
141
|
+
const originalLength = content.length;
|
|
142
|
+
// Naive way to truncate content
|
|
143
|
+
if (limit && content.length > limit) {
|
|
144
|
+
content = content.substring(0, limit);
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
success: true,
|
|
148
|
+
content,
|
|
149
|
+
fileName,
|
|
150
|
+
fileLength: originalLength,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.error("Error getting Google Drive file content", error);
|
|
155
|
+
return {
|
|
156
|
+
success: false,
|
|
157
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
export default getDriveFileContentByID;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
11
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
import { getDayOfWeek } from "../../../utils/datetime.js";
|
|
12
13
|
const listCalendarEvents = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
14
|
if (!authParams.authToken) {
|
|
14
15
|
return { success: false, error: MISSING_AUTH_TOKEN, events: [] };
|
|
@@ -57,7 +58,9 @@ const listCalendarEvents = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
|
57
58
|
description,
|
|
58
59
|
location,
|
|
59
60
|
start: (start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || "",
|
|
61
|
+
startDayOfWeek: getDayOfWeek((start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || ""),
|
|
60
62
|
end: (end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || "",
|
|
63
|
+
endDayOfWeek: getDayOfWeek((end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || ""),
|
|
61
64
|
attendees: Array.isArray(attendees)
|
|
62
65
|
? attendees.map(({ email, displayName, responseStatus }) => ({
|
|
63
66
|
email,
|