@credal/actions 0.2.187 → 0.2.188
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/autogen/templates.js +15 -8
- package/dist/actions/autogen/types.d.ts +6 -6
- package/dist/actions/autogen/types.js +2 -2
- package/dist/actions/groups.js +14 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +47 -0
- package/dist/actions/providers/jamf/types.d.ts +8 -0
- package/dist/actions/providers/jamf/types.js +7 -0
- package/dist/actions/providers/slack/archiveChannel.js +9 -2
- package/package.json +1 -1
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +0 -3
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.js +0 -43
|
@@ -4480,8 +4480,11 @@ export const resendSendEmailDefinition = {
|
|
|
4480
4480
|
required: ["to", "subject", "content"],
|
|
4481
4481
|
properties: {
|
|
4482
4482
|
to: {
|
|
4483
|
-
type: "
|
|
4484
|
-
|
|
4483
|
+
type: "array",
|
|
4484
|
+
items: {
|
|
4485
|
+
type: "string",
|
|
4486
|
+
},
|
|
4487
|
+
description: "The email address(es) to send the email to",
|
|
4485
4488
|
},
|
|
4486
4489
|
subject: {
|
|
4487
4490
|
type: "string",
|
|
@@ -4520,8 +4523,11 @@ export const resendSendEmailHtmlDefinition = {
|
|
|
4520
4523
|
required: ["to", "subject", "content"],
|
|
4521
4524
|
properties: {
|
|
4522
4525
|
to: {
|
|
4523
|
-
type: "
|
|
4524
|
-
|
|
4526
|
+
type: "array",
|
|
4527
|
+
items: {
|
|
4528
|
+
type: "string",
|
|
4529
|
+
},
|
|
4530
|
+
description: "The email address(es) to send the email to",
|
|
4525
4531
|
},
|
|
4526
4532
|
subject: {
|
|
4527
4533
|
type: "string",
|
|
@@ -6797,7 +6803,7 @@ export const googleOauthUpdateSpreadsheetDefinition = {
|
|
|
6797
6803
|
provider: "googleOauth",
|
|
6798
6804
|
};
|
|
6799
6805
|
export const googleOauthAppendRowsToSpreadsheetDefinition = {
|
|
6800
|
-
displayName: "
|
|
6806
|
+
displayName: "Add rows to a spreadsheet",
|
|
6801
6807
|
description: "Adds new cells after the last row with data in a sheet, inserting new rows into the sheet if necessary.",
|
|
6802
6808
|
scopes: [],
|
|
6803
6809
|
tags: [],
|
|
@@ -10016,7 +10022,7 @@ export const salesforceGenerateSalesReportDefinition = {
|
|
|
10016
10022
|
};
|
|
10017
10023
|
export const salesforceSearchAllSalesforceRecordsDefinition = {
|
|
10018
10024
|
displayName: "Search all salesforce records",
|
|
10019
|
-
description: "Search
|
|
10025
|
+
description: "Search through all Salesforce records by keyword. This works best for searching the content of text fields across all records. For example, searching for any description fields that contain a specific keyword.",
|
|
10020
10026
|
scopes: [],
|
|
10021
10027
|
tags: [],
|
|
10022
10028
|
parameters: {
|
|
@@ -10177,7 +10183,7 @@ export const salesforceExecuteReportDefinition = {
|
|
|
10177
10183
|
};
|
|
10178
10184
|
export const salesforceSearchSalesforceRecordsDefinition = {
|
|
10179
10185
|
displayName: "Search Salesforce records",
|
|
10180
|
-
description: "Search for Salesforce records by keyword",
|
|
10186
|
+
description: "Search for Salesforce records by keyword. This works best for searching the content of text fields on a specific object. For example, searching for Case descriptions that mention a specific keyword.",
|
|
10181
10187
|
scopes: [],
|
|
10182
10188
|
tags: [],
|
|
10183
10189
|
parameters: {
|
|
@@ -10191,6 +10197,7 @@ export const salesforceSearchSalesforceRecordsDefinition = {
|
|
|
10191
10197
|
recordType: {
|
|
10192
10198
|
type: "string",
|
|
10193
10199
|
description: "The type of record to search for",
|
|
10200
|
+
tags: ["recommend-predefined"],
|
|
10194
10201
|
},
|
|
10195
10202
|
fieldsToSearch: {
|
|
10196
10203
|
type: "array",
|
|
@@ -10273,7 +10280,7 @@ export const salesforceSearchSalesforceRecordsDefinition = {
|
|
|
10273
10280
|
};
|
|
10274
10281
|
export const salesforceGetSalesforceRecordsByQueryDefinition = {
|
|
10275
10282
|
displayName: "Get Salesforce records with a query",
|
|
10276
|
-
description:
|
|
10283
|
+
description: 'Retrieve Salesforce records by SOQL query. This works best for structured queries that depend on specific fields, for example "Find all Opportunities associated with the Acme Account" or "Find all contacts with the last name \'Smith\'".',
|
|
10277
10284
|
scopes: [],
|
|
10278
10285
|
tags: [],
|
|
10279
10286
|
parameters: {
|
|
@@ -4536,17 +4536,17 @@ export declare const firecrawlScrapeTweetDataWithNitterOutputSchema: z.ZodObject
|
|
|
4536
4536
|
export type firecrawlScrapeTweetDataWithNitterOutputType = z.infer<typeof firecrawlScrapeTweetDataWithNitterOutputSchema>;
|
|
4537
4537
|
export type firecrawlScrapeTweetDataWithNitterFunction = ActionFunction<firecrawlScrapeTweetDataWithNitterParamsType, AuthParamsType, firecrawlScrapeTweetDataWithNitterOutputType>;
|
|
4538
4538
|
export declare const resendSendEmailParamsSchema: z.ZodObject<{
|
|
4539
|
-
to: z.ZodString
|
|
4539
|
+
to: z.ZodArray<z.ZodString, "many">;
|
|
4540
4540
|
subject: z.ZodString;
|
|
4541
4541
|
content: z.ZodString;
|
|
4542
4542
|
}, "strip", z.ZodTypeAny, {
|
|
4543
4543
|
content: string;
|
|
4544
4544
|
subject: string;
|
|
4545
|
-
to: string;
|
|
4545
|
+
to: string[];
|
|
4546
4546
|
}, {
|
|
4547
4547
|
content: string;
|
|
4548
4548
|
subject: string;
|
|
4549
|
-
to: string;
|
|
4549
|
+
to: string[];
|
|
4550
4550
|
}>;
|
|
4551
4551
|
export type resendSendEmailParamsType = z.infer<typeof resendSendEmailParamsSchema>;
|
|
4552
4552
|
export declare const resendSendEmailOutputSchema: z.ZodObject<{
|
|
@@ -4562,17 +4562,17 @@ export declare const resendSendEmailOutputSchema: z.ZodObject<{
|
|
|
4562
4562
|
export type resendSendEmailOutputType = z.infer<typeof resendSendEmailOutputSchema>;
|
|
4563
4563
|
export type resendSendEmailFunction = ActionFunction<resendSendEmailParamsType, AuthParamsType, resendSendEmailOutputType>;
|
|
4564
4564
|
export declare const resendSendEmailHtmlParamsSchema: z.ZodObject<{
|
|
4565
|
-
to: z.ZodString
|
|
4565
|
+
to: z.ZodArray<z.ZodString, "many">;
|
|
4566
4566
|
subject: z.ZodString;
|
|
4567
4567
|
content: z.ZodString;
|
|
4568
4568
|
}, "strip", z.ZodTypeAny, {
|
|
4569
4569
|
content: string;
|
|
4570
4570
|
subject: string;
|
|
4571
|
-
to: string;
|
|
4571
|
+
to: string[];
|
|
4572
4572
|
}, {
|
|
4573
4573
|
content: string;
|
|
4574
4574
|
subject: string;
|
|
4575
|
-
to: string;
|
|
4575
|
+
to: string[];
|
|
4576
4576
|
}>;
|
|
4577
4577
|
export type resendSendEmailHtmlParamsType = z.infer<typeof resendSendEmailHtmlParamsSchema>;
|
|
4578
4578
|
export declare const resendSendEmailHtmlOutputSchema: z.ZodObject<{
|
|
@@ -1494,7 +1494,7 @@ export const firecrawlScrapeTweetDataWithNitterOutputSchema = z.object({
|
|
|
1494
1494
|
text: z.string().describe("The text in the tweet URL"),
|
|
1495
1495
|
});
|
|
1496
1496
|
export const resendSendEmailParamsSchema = z.object({
|
|
1497
|
-
to: z.string().describe("The email address to send the email to"),
|
|
1497
|
+
to: z.array(z.string()).describe("The email address(es) to send the email to"),
|
|
1498
1498
|
subject: z.string().describe("The subject of the email"),
|
|
1499
1499
|
content: z.string().describe("The content of the email"),
|
|
1500
1500
|
});
|
|
@@ -1503,7 +1503,7 @@ export const resendSendEmailOutputSchema = z.object({
|
|
|
1503
1503
|
error: z.string().describe("The error that occurred if the email was not sent successfully").optional(),
|
|
1504
1504
|
});
|
|
1505
1505
|
export const resendSendEmailHtmlParamsSchema = z.object({
|
|
1506
|
-
to: z.string().describe("The email address to send the email to"),
|
|
1506
|
+
to: z.array(z.string()).describe("The email address(es) to send the email to"),
|
|
1507
1507
|
subject: z.string().describe("The subject of the email"),
|
|
1508
1508
|
content: z.string().describe("The HTML content of the email to be sent"),
|
|
1509
1509
|
});
|
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, } 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,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;
|
|
@@ -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 {
|
|
19
|
-
const
|
|
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,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;
|