@credal/actions 0.2.167 → 0.2.169

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.
@@ -310,6 +310,10 @@ export const slackUserSearchSlackParamsSchema = z.object({
310
310
  .enum(["latest", "today", "yesterday", "last_7d", "last_30d", "all"])
311
311
  .describe("Optional time filter applied to the search.")
312
312
  .default("latest"),
313
+ messageType: z
314
+ .enum(["im", "group", "channel"])
315
+ .describe("Optional filter for the type of messages to search for. If not specified, all message types will be searched.")
316
+ .optional(),
313
317
  limit: z
314
318
  .number()
315
319
  .gte(1)
@@ -1041,15 +1045,6 @@ export const jiraDataCenterGetJiraIssuesByQueryOutputSchema = z.object({
1041
1045
  .optional(),
1042
1046
  error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
1043
1047
  });
1044
- export const kandjiGetFVRecoveryKeyForDeviceParamsSchema = z.object({
1045
- userEmail: z.string().describe("The email of the user requesting the recovery key"),
1046
- subdomain: z.string().describe("The subdomain of the Kandji account"),
1047
- });
1048
- export const kandjiGetFVRecoveryKeyForDeviceOutputSchema = z.object({
1049
- success: z.boolean().describe("Whether the recovery key was retrieved successfully"),
1050
- recoveryKey: z.string().describe("The FileVault recovery key for the device").optional(),
1051
- error: z.string().describe("The error that occurred if the recovery key was not retrieved successfully").optional(),
1052
- });
1053
1048
  export const googlemapsValidateAddressParamsSchema = z.object({
1054
1049
  regionCode: z.string().describe("The country of the address being verified."),
1055
1050
  locality: z.string().describe("The locality of the address being verified. This is likely a city."),
@@ -3792,93 +3787,6 @@ export const lookerEnableUserByEmailOutputSchema = z.object({
3792
3787
  .describe("Details about the user")
3793
3788
  .optional(),
3794
3789
  });
3795
- export const ashbyCreateNoteParamsSchema = z.object({
3796
- candidateId: z.string().describe("The ID of the candidate to create a note for"),
3797
- note: z.string().describe("The note content"),
3798
- });
3799
- export const ashbyCreateNoteOutputSchema = z.void();
3800
- export const ashbyGetCandidateInfoParamsSchema = z.object({
3801
- candidateId: z.string().describe("The ID of the candidate whose information is to be retrieved"),
3802
- });
3803
- export const ashbyGetCandidateInfoOutputSchema = z.object({
3804
- candidate: z.object({}).catchall(z.any()).describe("The candidate's information"),
3805
- });
3806
- export const ashbyAddCandidateToProjectParamsSchema = z.object({
3807
- candidateId: z.string().describe("The ID of the candidate to add to the project"),
3808
- projectId: z.string().describe("The ID of the project to add the candidate to"),
3809
- });
3810
- export const ashbyAddCandidateToProjectOutputSchema = z.void();
3811
- export const ashbyListCandidatesParamsSchema = z.object({});
3812
- export const ashbyListCandidatesOutputSchema = z.object({
3813
- candidates: z.array(z.any()).describe("A list of candidates"),
3814
- });
3815
- export const ashbySearchCandidatesParamsSchema = z.object({
3816
- email: z.string().describe("The email address of the candidate to search for").optional(),
3817
- name: z.string().describe("The name of the candidate to search for").optional(),
3818
- });
3819
- export const ashbySearchCandidatesOutputSchema = z.object({
3820
- candidates: z.array(z.any()).describe("A list of candidates"),
3821
- });
3822
- export const ashbyListCandidateNotesParamsSchema = z.object({
3823
- candidateId: z.string().describe("The ID of the candidate"),
3824
- });
3825
- export const ashbyListCandidateNotesOutputSchema = z.object({ notes: z.array(z.any()).describe("A list of notes") });
3826
- export const ashbyCreateCandidateParamsSchema = z.object({
3827
- name: z.string().describe("The first and last name of the candidate to be created."),
3828
- email: z.string().describe("Primary, personal email of the candidate to be created.").optional(),
3829
- phoneNumber: z.string().describe("Primary, personal phone number of the candidate to be created.").optional(),
3830
- linkedInUrl: z.string().describe("Url to the candidate's LinkedIn profile. Must be a valid Url.").optional(),
3831
- githubUrl: z.string().describe("Url to the candidate's Github profile. Must be a valid Url.").optional(),
3832
- website: z.string().describe("Url of the candidate's website. Must be a valid Url.").optional(),
3833
- alternateEmailAddresses: z
3834
- .array(z.string())
3835
- .describe("Array of alternate email address to add to the candidate's profile.")
3836
- .optional(),
3837
- sourceId: z.string().describe("The source to set on the candidate being created.").optional(),
3838
- creditedToUserId: z.string().describe("The id of the user the candidate will be credited to.").optional(),
3839
- location: z
3840
- .object({
3841
- city: z.string().describe("The city of the candidate.").optional(),
3842
- region: z.string().describe("The region of the candidate.").optional(),
3843
- country: z.string().describe("The country of the candidate.").optional(),
3844
- })
3845
- .describe("The location of the candidate.")
3846
- .optional(),
3847
- });
3848
- export const ashbyCreateCandidateOutputSchema = z.void();
3849
- export const ashbyUpdateCandidateParamsSchema = z.object({
3850
- candidateId: z.string().describe("The ID of the candidate to update"),
3851
- name: z.string().describe("The first and last name of the candidate to update.").optional(),
3852
- email: z.string().describe("Primary, personal email of the candidate to update.").optional(),
3853
- phoneNumber: z.string().describe("Primary, personal phone number of the candidate to update.").optional(),
3854
- linkedInUrl: z.string().describe("Url to the candidate's LinkedIn profile. Must be a valid Url.").optional(),
3855
- githubUrl: z.string().describe("Url to the candidate's Github profile. Must be a valid Url.").optional(),
3856
- websiteUrl: z.string().describe("Url of the candidate's website. Must be a valid Url.").optional(),
3857
- alternateEmail: z.string().describe("An alternate email address to add to the candidate's profile.").optional(),
3858
- socialLinks: z
3859
- .array(z.object({
3860
- type: z.string().describe("The type of social link").optional(),
3861
- url: z.string().describe("The URL of the social link").optional(),
3862
- }))
3863
- .describe("An array of social links to set on the candidate. This value replaces existing socialLinks that have been set on the candidate.")
3864
- .optional(),
3865
- sourceId: z.string().describe("The id of source for this candidate.").optional(),
3866
- creditedToUserId: z.string().describe("The id of the user the candidate will be credited to.").optional(),
3867
- location: z
3868
- .object({
3869
- city: z.string().describe("The city of the candidate").optional(),
3870
- region: z.string().describe("The region of the candidate").optional(),
3871
- country: z.string().describe("The country of the candidate").optional(),
3872
- })
3873
- .describe("The location of the candidate.")
3874
- .optional(),
3875
- createdAt: z.string().describe("An ISO date string to set the candidate's createdAt timestamp.").optional(),
3876
- sendNotifications: z
3877
- .boolean()
3878
- .describe("Whether or not users who are subscribed to the candidate should be notified that candidate was updated. Default is true.")
3879
- .optional(),
3880
- });
3881
- export const ashbyUpdateCandidateOutputSchema = z.void();
3882
3790
  export const salesforceUpdateRecordParamsSchema = z.object({
3883
3791
  objectType: z.string().describe("The Salesforce object type to update (e.g., Lead, Account, Contact)"),
3884
3792
  recordId: z.string().describe("The ID of the record to update"),
@@ -4649,38 +4557,6 @@ export const notionSearchByTitleOutputSchema = z.object({
4649
4557
  .optional(),
4650
4558
  error: z.string().describe("Error message if search failed").optional(),
4651
4559
  });
4652
- export const jamfGetJamfFileVaultRecoveryKeyParamsSchema = z.object({
4653
- computerId: z.string().describe("The computerId of the device to get the FileVault2 recovery key for"),
4654
- });
4655
- export const jamfGetJamfFileVaultRecoveryKeyOutputSchema = z.object({
4656
- success: z.boolean().describe("Whether the request was successful"),
4657
- data: z.string().describe("The FileVault2 recovery key data").optional(),
4658
- error: z.string().describe("Error message if the request failed").optional(),
4659
- });
4660
- export const jamfGetJamfComputerInventoryParamsSchema = z.object({
4661
- section: z.string().describe("Optional section parameter to filter inventory data").optional(),
4662
- });
4663
- export const jamfGetJamfComputerInventoryOutputSchema = z.object({
4664
- success: z.boolean().describe("Whether the request was successful"),
4665
- data: z.array(z.any()).describe("The computer inventory data").optional(),
4666
- error: z.string().describe("Error message if the request failed").optional(),
4667
- });
4668
- export const jamfGetJamfUserComputerIdParamsSchema = z.object({
4669
- userEmail: z.string().describe("The email of the Jamf user to retrieve the computer ID for"),
4670
- });
4671
- export const jamfGetJamfUserComputerIdOutputSchema = z.object({
4672
- success: z.boolean().describe("Whether the request was successful"),
4673
- computerId: z.string().describe("The computer ID associated with the user").optional(),
4674
- error: z.string().describe("Error message if the request failed").optional(),
4675
- });
4676
- export const jamfLockJamfComputerByIdParamsSchema = z.object({
4677
- computerId: z.string().describe("The computer ID of the device to lock"),
4678
- passcode: z.string().describe("Six digit passcode to unlock the computer afterwards"),
4679
- });
4680
- export const jamfLockJamfComputerByIdOutputSchema = z.object({
4681
- success: z.boolean().describe("Whether the lock command was successful"),
4682
- error: z.string().describe("Error message if the lock command failed").optional(),
4683
- });
4684
4560
  export const gitlabSearchGroupParamsSchema = z.object({
4685
4561
  query: z.string().describe("The query that will be used to search gitlab blobs and merge requests"),
4686
4562
  groupId: z.string().describe("The group ID of the project to search in"),
@@ -1,4 +1,4 @@
1
- import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
1
+ import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, 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",
@@ -47,6 +47,7 @@ export const ACTION_GROUPS = {
47
47
  googleOauthUpdatePresentationDefinition,
48
48
  googleOauthSearchDriveByKeywordsDefinition,
49
49
  googleOauthSearchDriveByQueryDefinition,
50
+ googleOauthSearchDriveByQueryAndGetFileContentDefinition,
50
51
  googleOauthGetDriveFileContentByIdDefinition,
51
52
  ],
52
53
  },
@@ -198,6 +199,8 @@ export const ACTION_GROUPS = {
198
199
  githubCreateBranchDefinition,
199
200
  githubCreatePullRequestDefinition,
200
201
  githubListPullRequestsDefinition,
202
+ githubGetFileContentDefinition,
203
+ githubListDirectoryDefinition,
201
204
  ],
202
205
  },
203
206
  ASHBY: {
@@ -245,4 +248,14 @@ export const ACTION_GROUPS = {
245
248
  oktaTriggerOktaWorkflowDefinition,
246
249
  ],
247
250
  },
251
+ LINEAR: {
252
+ description: "Actions for interacting with Linear",
253
+ actions: [
254
+ linearGetIssueDetailsDefinition,
255
+ linearGetProjectsDefinition,
256
+ linearGetProjectDetailsDefinition,
257
+ linearGetTeamDetailsDefinition,
258
+ linearGetTeamsDefinition,
259
+ ],
260
+ },
248
261
  };
@@ -0,0 +1,3 @@
1
+ import { confluenceUpdatePageFunction } from "../../../actions/autogen/types";
2
+ declare const confluenceUpdatePage: confluenceUpdatePageFunction;
3
+ export default confluenceUpdatePage;
@@ -0,0 +1,47 @@
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
+ function getConfluenceApi(baseUrl, username, apiToken) {
17
+ const api = axios_1.default.create({
18
+ baseURL: baseUrl,
19
+ headers: {
20
+ Accept: "application/json",
21
+ // Tokens are associated with a specific user.
22
+ Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
23
+ },
24
+ });
25
+ return api;
26
+ }
27
+ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
28
+ const { pageId, username, content, title } = params;
29
+ const { baseUrl, authToken } = authParams;
30
+ const api = getConfluenceApi(baseUrl, username, authToken);
31
+ // Get current version number
32
+ const response = yield api.get(`/api/v2/pages/${pageId}`);
33
+ const currVersion = response.data.version.number;
34
+ yield api.put(`/api/v2/pages/${pageId}`, {
35
+ id: pageId,
36
+ status: "current",
37
+ title,
38
+ body: {
39
+ representation: "storage",
40
+ value: content,
41
+ },
42
+ version: {
43
+ number: currVersion + 1,
44
+ },
45
+ });
46
+ });
47
+ exports.default = confluenceUpdatePage;
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const TokenResponseSchema: z.ZodObject<{
3
+ token: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ token: string;
6
+ }, {
7
+ token: string;
8
+ }>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.TokenResponseSchema = zod_1.z.object({
6
+ token: zod_1.z.string(),
7
+ });
@@ -9,14 +9,21 @@ 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";
12
13
  const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
14
  if (!authParams.authToken) {
14
15
  throw new Error(MISSING_AUTH_TOKEN);
15
16
  }
16
17
  try {
17
18
  const client = new WebClient(authParams.authToken);
18
- const { channelId } = params;
19
- const result = yield client.conversations.archive({ channel: channelId });
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 });
20
27
  if (!result.ok) {
21
28
  return {
22
29
  success: false,
@@ -70,6 +70,12 @@ function normalizeChannelOperand(ch) {
70
70
  return s;
71
71
  return s.replace(/^#/, "");
72
72
  }
73
+ function getMessageTypeFilter(messageType) {
74
+ // This converts the LLM readable message type to the Slack search API message type (e.g. "channel" -> "message")
75
+ if (messageType === "channel")
76
+ return "message";
77
+ return messageType;
78
+ }
73
79
  function fmtDaysAgo(n) {
74
80
  const d = new Date();
75
81
  d.setDate(d.getDate() - n);
@@ -203,7 +209,9 @@ function searchScoped(input) {
203
209
  return __awaiter(this, void 0, void 0, function* () {
204
210
  var _a, _b;
205
211
  const { client, scope, topic, timeRange, limit } = input;
206
- const parts = [`in:${scope}`];
212
+ const parts = [];
213
+ if (scope)
214
+ parts.push(`in:${scope}`);
207
215
  if (topic === null || topic === void 0 ? void 0 : topic.trim())
208
216
  parts.push(topic.trim());
209
217
  const tf = timeFilter(timeRange);
@@ -275,7 +283,8 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
275
283
  throw new Error(MISSING_AUTH_TOKEN);
276
284
  const client = new WebClient(authParams.authToken);
277
285
  const cache = new SlackUserCache(client);
278
- const { emails, topic, timeRange, limit = 20, channel, fetchAdjacentMessages = true } = params;
286
+ const { emails, topic, timeRange, limit = 20, channel, fetchAdjacentMessages = true, messageType } = params;
287
+ const messageTypeFilter = getMessageTypeFilter(messageType);
279
288
  const { user_id: myUserId } = yield client.auth.test();
280
289
  if (!myUserId)
281
290
  throw new Error("Failed to get my user ID.");
@@ -292,9 +301,7 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
292
301
  else if (filteredTargetIds.length >= 2) {
293
302
  const searchMPIM = () => __awaiter(void 0, void 0, void 0, function* () {
294
303
  const mpimName = yield tryGetMPIMName(client, filteredTargetIds);
295
- return mpimName
296
- ? searchScoped({ client, scope: mpimName, topic, timeRange, limit: Math.max(Math.floor(limit / 2), 1) })
297
- : [];
304
+ return mpimName ? searchScoped({ client, scope: mpimName, topic, timeRange, limit }) : [];
298
305
  });
299
306
  searchPromises.push(searchMPIM());
300
307
  searchPromises.push(...filteredTargetIds.map(id => searchScoped({
@@ -302,7 +309,7 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
302
309
  scope: `<@${id}>`,
303
310
  topic,
304
311
  timeRange,
305
- limit: Math.max(Math.floor(limit / filteredTargetIds.length), 1),
312
+ limit,
306
313
  })));
307
314
  }
308
315
  else if (channel) {
@@ -311,7 +318,15 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
311
318
  scope: normalizeChannelOperand(channel),
312
319
  topic,
313
320
  timeRange,
314
- limit: Math.max(Math.floor(limit / 2), 1),
321
+ limit,
322
+ }));
323
+ }
324
+ else if (timeRange) {
325
+ searchPromises.push(searchScoped({
326
+ client,
327
+ topic,
328
+ timeRange,
329
+ limit,
315
330
  }));
316
331
  }
317
332
  if (topic) {
@@ -319,11 +334,21 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
319
334
  client,
320
335
  topic,
321
336
  timeRange,
322
- limit: Math.max(Math.floor(limit / Math.max(searchPromises.length, 1)), 1),
337
+ limit,
323
338
  }));
324
339
  }
325
340
  const searchResults = yield Promise.all(searchPromises);
326
- searchResults.forEach(matches => allMatches.push(...matches));
341
+ const searchResultsFilteredByTypeAndLimit = searchResults.map(matches => {
342
+ return matches
343
+ .filter(m => {
344
+ if (messageTypeFilter) {
345
+ return m.type === messageTypeFilter;
346
+ }
347
+ return true;
348
+ })
349
+ .slice(0, Math.max(Math.floor(limit / Math.max(searchPromises.length, 1)), 1));
350
+ });
351
+ searchResultsFilteredByTypeAndLimit.forEach(matches => allMatches.push(...matches));
327
352
  const channelInfoCache = new Map();
328
353
  const expanded = yield Promise.all(allMatches.map(m => limitHit(() => __awaiter(void 0, void 0, void 0, function* () {
329
354
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.167",
3
+ "version": "0.2.169",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- import { salesforceGetSalesforceRecordsByQueryFunction } from "../../autogen/types";
2
- declare const getSalesforceRecordByQuery: salesforceGetSalesforceRecordsByQueryFunction;
3
- export default getSalesforceRecordByQuery;
@@ -1,43 +0,0 @@
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;