@credal/actions 0.2.132 → 0.2.134

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.
@@ -7184,6 +7184,10 @@ export const googleOauthSearchDriveByKeywordsDefinition = {
7184
7184
  type: "number",
7185
7185
  description: "The maximum number of files to return",
7186
7186
  },
7187
+ includeTrashed: {
7188
+ type: "boolean",
7189
+ description: "Whether to include trashed files in the search results",
7190
+ },
7187
7191
  },
7188
7192
  },
7189
7193
  output: {
@@ -7252,6 +7256,10 @@ export const googleOauthSearchDriveByQueryDefinition = {
7252
7256
  type: "string",
7253
7257
  description: "The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'",
7254
7258
  },
7259
+ includeTrashed: {
7260
+ type: "boolean",
7261
+ description: "Whether to include trashed files in the search results",
7262
+ },
7255
7263
  },
7256
7264
  },
7257
7265
  output: {
@@ -7324,6 +7332,10 @@ export const googleOauthSearchDriveByKeywordsAndGetFileContentDefinition = {
7324
7332
  type: "string",
7325
7333
  description: "The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'",
7326
7334
  },
7335
+ includeTrashed: {
7336
+ type: "boolean",
7337
+ description: "Whether to include trashed files in the search results",
7338
+ },
7327
7339
  },
7328
7340
  },
7329
7341
  output: {
@@ -7415,6 +7427,10 @@ export const googleOauthSearchDriveByQueryAndGetFileContentDefinition = {
7415
7427
  type: "string",
7416
7428
  description: "The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'",
7417
7429
  },
7430
+ includeTrashed: {
7431
+ type: "boolean",
7432
+ description: "Whether to include trashed files in the search results",
7433
+ },
7418
7434
  },
7419
7435
  },
7420
7436
  output: {
@@ -4403,12 +4403,15 @@ export type googleOauthGetPresentationFunction = ActionFunction<googleOauthGetPr
4403
4403
  export declare const googleOauthSearchDriveByKeywordsParamsSchema: z.ZodObject<{
4404
4404
  keywords: z.ZodArray<z.ZodString, "many">;
4405
4405
  limit: z.ZodOptional<z.ZodNumber>;
4406
+ includeTrashed: z.ZodOptional<z.ZodBoolean>;
4406
4407
  }, "strip", z.ZodTypeAny, {
4407
4408
  keywords: string[];
4408
4409
  limit?: number | undefined;
4410
+ includeTrashed?: boolean | undefined;
4409
4411
  }, {
4410
4412
  keywords: string[];
4411
4413
  limit?: number | undefined;
4414
+ includeTrashed?: boolean | undefined;
4412
4415
  }>;
4413
4416
  export type googleOauthSearchDriveByKeywordsParamsType = z.infer<typeof googleOauthSearchDriveByKeywordsParamsSchema>;
4414
4417
  export declare const googleOauthSearchDriveByKeywordsOutputSchema: z.ZodObject<{
@@ -4456,15 +4459,18 @@ export declare const googleOauthSearchDriveByQueryParamsSchema: z.ZodObject<{
4456
4459
  limit: z.ZodOptional<z.ZodNumber>;
4457
4460
  searchDriveByDrive: z.ZodBoolean;
4458
4461
  orderByQuery: z.ZodOptional<z.ZodString>;
4462
+ includeTrashed: z.ZodOptional<z.ZodBoolean>;
4459
4463
  }, "strip", z.ZodTypeAny, {
4460
4464
  query: string;
4461
4465
  searchDriveByDrive: boolean;
4462
4466
  limit?: number | undefined;
4467
+ includeTrashed?: boolean | undefined;
4463
4468
  orderByQuery?: string | undefined;
4464
4469
  }, {
4465
4470
  query: string;
4466
4471
  searchDriveByDrive: boolean;
4467
4472
  limit?: number | undefined;
4473
+ includeTrashed?: boolean | undefined;
4468
4474
  orderByQuery?: string | undefined;
4469
4475
  }>;
4470
4476
  export type googleOauthSearchDriveByQueryParamsType = z.infer<typeof googleOauthSearchDriveByQueryParamsSchema>;
@@ -4514,16 +4520,19 @@ export declare const googleOauthSearchDriveByKeywordsAndGetFileContentParamsSche
4514
4520
  fileSizeLimit: z.ZodOptional<z.ZodNumber>;
4515
4521
  searchDriveByDrive: z.ZodBoolean;
4516
4522
  orderByQuery: z.ZodOptional<z.ZodString>;
4523
+ includeTrashed: z.ZodOptional<z.ZodBoolean>;
4517
4524
  }, "strip", z.ZodTypeAny, {
4518
4525
  searchDriveByDrive: boolean;
4519
4526
  searchQuery: string;
4520
4527
  limit?: number | undefined;
4528
+ includeTrashed?: boolean | undefined;
4521
4529
  orderByQuery?: string | undefined;
4522
4530
  fileSizeLimit?: number | undefined;
4523
4531
  }, {
4524
4532
  searchDriveByDrive: boolean;
4525
4533
  searchQuery: string;
4526
4534
  limit?: number | undefined;
4535
+ includeTrashed?: boolean | undefined;
4527
4536
  orderByQuery?: string | undefined;
4528
4537
  fileSizeLimit?: number | undefined;
4529
4538
  }>;
@@ -4611,16 +4620,19 @@ export declare const googleOauthSearchDriveByQueryAndGetFileContentParamsSchema:
4611
4620
  fileSizeLimit: z.ZodOptional<z.ZodNumber>;
4612
4621
  searchDriveByDrive: z.ZodBoolean;
4613
4622
  orderByQuery: z.ZodOptional<z.ZodString>;
4623
+ includeTrashed: z.ZodOptional<z.ZodBoolean>;
4614
4624
  }, "strip", z.ZodTypeAny, {
4615
4625
  query: string;
4616
4626
  searchDriveByDrive: boolean;
4617
4627
  limit?: number | undefined;
4628
+ includeTrashed?: boolean | undefined;
4618
4629
  orderByQuery?: string | undefined;
4619
4630
  fileSizeLimit?: number | undefined;
4620
4631
  }, {
4621
4632
  query: string;
4622
4633
  searchDriveByDrive: boolean;
4623
4634
  limit?: number | undefined;
4635
+ includeTrashed?: boolean | undefined;
4624
4636
  orderByQuery?: string | undefined;
4625
4637
  fileSizeLimit?: number | undefined;
4626
4638
  }>;
@@ -2714,6 +2714,7 @@ export const googleOauthGetPresentationOutputSchema = z.object({
2714
2714
  export const googleOauthSearchDriveByKeywordsParamsSchema = z.object({
2715
2715
  keywords: z.array(z.string()).describe("List of keywords to search for in file contents."),
2716
2716
  limit: z.number().describe("The maximum number of files to return").optional(),
2717
+ includeTrashed: z.boolean().describe("Whether to include trashed files in the search results").optional(),
2717
2718
  });
2718
2719
  export const googleOauthSearchDriveByKeywordsOutputSchema = z.object({
2719
2720
  success: z.boolean().describe("Whether the search was successful"),
@@ -2736,6 +2737,7 @@ export const googleOauthSearchDriveByQueryParamsSchema = z.object({
2736
2737
  .string()
2737
2738
  .describe("The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'")
2738
2739
  .optional(),
2740
+ includeTrashed: z.boolean().describe("Whether to include trashed files in the search results").optional(),
2739
2741
  });
2740
2742
  export const googleOauthSearchDriveByQueryOutputSchema = z.object({
2741
2743
  success: z.boolean().describe("Whether the search was successful"),
@@ -2759,6 +2761,7 @@ export const googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema = z.o
2759
2761
  .string()
2760
2762
  .describe("The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'")
2761
2763
  .optional(),
2764
+ includeTrashed: z.boolean().describe("Whether to include trashed files in the search results").optional(),
2762
2765
  });
2763
2766
  export const googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema = z.object({
2764
2767
  success: z.boolean().describe("Whether the search was successful"),
@@ -2789,6 +2792,7 @@ export const googleOauthSearchDriveByQueryAndGetFileContentParamsSchema = z.obje
2789
2792
  .string()
2790
2793
  .describe("The orderBy query for sorting results (e.g., 'modifiedTime desc', 'name', 'createdTime desc'). Defaults to 'modifiedTime desc'")
2791
2794
  .optional(),
2795
+ includeTrashed: z.boolean().describe("Whether to include trashed files in the search results").optional(),
2792
2796
  });
2793
2797
  export const googleOauthSearchDriveByQueryAndGetFileContentOutputSchema = z.object({
2794
2798
  success: z.boolean().describe("Whether the search was successful"),
@@ -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;
@@ -14,18 +14,19 @@ const searchDriveByKeywords = (_a) => __awaiter(void 0, [_a], void 0, function*
14
14
  if (!authParams.authToken) {
15
15
  return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
16
16
  }
17
- const { keywords, limit } = params;
17
+ const { keywords, limit, includeTrashed = false } = params;
18
18
  // Build the query: fullText contains 'keyword1' or fullText contains 'keyword2'
19
19
  const query = keywords.map(kw => `fullText contains '${kw.replace(/'/g, "\\'")}'`).join(" or ");
20
+ const finalQuery = includeTrashed ? query : `(${query}) and trashed = false`;
20
21
  try {
21
- const allDrivesUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives&pageSize=1000`;
22
+ const allDrivesUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(finalQuery)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives&pageSize=1000`;
22
23
  const allDrivesRes = axiosClient.get(allDrivesUrl, {
23
24
  headers: {
24
25
  Authorization: `Bearer ${authParams.authToken}`,
25
26
  },
26
27
  });
27
28
  // need to search domain wide separately because the allDrives search doesn't include domain wide files
28
- const orgWideUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(query)}&fields=files(id,name,mimeType,webViewLink)&corpora=domain&pageSize=1000`;
29
+ const orgWideUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(finalQuery)}&fields=files(id,name,mimeType,webViewLink)&corpora=domain&pageSize=1000`;
29
30
  const orgWideRes = axiosClient.get(orgWideUrl, {
30
31
  headers: {
31
32
  Authorization: `Bearer ${authParams.authToken}`,
@@ -15,14 +15,14 @@ const searchDriveByKeywordsAndGetFileContent = (_a) => __awaiter(void 0, [_a], v
15
15
  if (!authParams.authToken) {
16
16
  return { success: false, error: MISSING_AUTH_TOKEN };
17
17
  }
18
- const { searchQuery, limit, searchDriveByDrive, orderByQuery, fileSizeLimit: maxChars } = params;
18
+ const { searchQuery, limit, searchDriveByDrive, orderByQuery, fileSizeLimit: maxChars, includeTrashed = false, } = params;
19
19
  const query = searchQuery
20
20
  .split(" ")
21
21
  .map(kw => kw.replace(/'/g, "\\'"))
22
22
  .map(kw => `fullText contains '${kw}' or name contains '${kw}'`)
23
23
  .join(" or ");
24
24
  const searchResult = yield searchDriveByQuery({
25
- params: { query, limit, searchDriveByDrive, orderByQuery },
25
+ params: { query, limit, searchDriveByDrive, orderByQuery, includeTrashed },
26
26
  authParams,
27
27
  });
28
28
  // If search failed, return error
@@ -14,15 +14,16 @@ const searchDriveByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({
14
14
  if (!authParams.authToken) {
15
15
  return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
16
16
  }
17
- const { query, limit, searchDriveByDrive, orderByQuery } = params;
17
+ const { query, limit, searchDriveByDrive, orderByQuery, includeTrashed = false } = params;
18
18
  // Can't use orderBy on quereis that include fullText
19
19
  const safeOrderBy = query.includes("fullText") ? undefined : (orderByQuery !== null && orderByQuery !== void 0 ? orderByQuery : "modifiedTime desc");
20
+ const finalQuery = includeTrashed ? query : `${query} and trashed=false`;
20
21
  try {
21
22
  if (searchDriveByDrive) {
22
- return yield searchAllDrivesIndividually(query, authParams.authToken, limit, safeOrderBy);
23
+ return yield searchAllDrivesIndividually(finalQuery, authParams.authToken, limit, safeOrderBy);
23
24
  }
24
25
  else {
25
- return yield searchAllDrivesAtOnce(query, authParams.authToken, limit, safeOrderBy);
26
+ return yield searchAllDrivesAtOnce(finalQuery, authParams.authToken, limit, safeOrderBy);
26
27
  }
27
28
  }
28
29
  catch (error) {
@@ -15,10 +15,10 @@ const searchDriveByQueryAndGetFileContent = (_a) => __awaiter(void 0, [_a], void
15
15
  if (!authParams.authToken) {
16
16
  return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
17
17
  }
18
- const { query, limit, searchDriveByDrive, orderByQuery, fileSizeLimit: maxChars } = params;
18
+ const { query, limit, searchDriveByDrive, orderByQuery, fileSizeLimit: maxChars, includeTrashed = false } = params;
19
19
  // First, perform the search
20
20
  const searchResult = yield searchDriveByQuery({
21
- params: { query, limit, searchDriveByDrive, orderByQuery },
21
+ params: { query, limit, searchDriveByDrive, orderByQuery, includeTrashed },
22
22
  authParams,
23
23
  });
24
24
  // If search failed, return error
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.132",
3
+ "version": "0.2.134",
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;