@credal/actions 0.2.159 → 0.2.160
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 +4 -0
- package/dist/actions/autogen/types.d.ts +3 -0
- package/dist/actions/autogen/types.js +1 -0
- package/dist/actions/groups.js +44 -3
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +47 -0
- package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
- package/dist/actions/providers/credal/callCopilot.js +36 -0
- package/dist/actions/providers/jamf/types.d.ts +8 -0
- package/dist/actions/providers/jamf/types.js +7 -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/archiveChannel.js +9 -2
- 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/zendesk/createZendeskTicket.js +2 -1
- package/package.json +1 -1
|
@@ -3565,6 +3565,10 @@ export const zendeskCreateZendeskTicketDefinition = {
|
|
|
3565
3565
|
type: "string",
|
|
3566
3566
|
description: "The subdomain of the Zendesk account",
|
|
3567
3567
|
},
|
|
3568
|
+
groupId: {
|
|
3569
|
+
type: "number",
|
|
3570
|
+
description: "The ID of the group to assign the ticket to",
|
|
3571
|
+
},
|
|
3568
3572
|
},
|
|
3569
3573
|
},
|
|
3570
3574
|
output: {
|
|
@@ -3921,14 +3921,17 @@ export declare const zendeskCreateZendeskTicketParamsSchema: z.ZodObject<{
|
|
|
3921
3921
|
subject: z.ZodString;
|
|
3922
3922
|
body: z.ZodOptional<z.ZodString>;
|
|
3923
3923
|
subdomain: z.ZodString;
|
|
3924
|
+
groupId: z.ZodOptional<z.ZodNumber>;
|
|
3924
3925
|
}, "strip", z.ZodTypeAny, {
|
|
3925
3926
|
subdomain: string;
|
|
3926
3927
|
subject: string;
|
|
3927
3928
|
body?: string | undefined;
|
|
3929
|
+
groupId?: number | undefined;
|
|
3928
3930
|
}, {
|
|
3929
3931
|
subdomain: string;
|
|
3930
3932
|
subject: string;
|
|
3931
3933
|
body?: string | undefined;
|
|
3934
|
+
groupId?: number | undefined;
|
|
3932
3935
|
}>;
|
|
3933
3936
|
export type zendeskCreateZendeskTicketParamsType = z.infer<typeof zendeskCreateZendeskTicketParamsSchema>;
|
|
3934
3937
|
export declare const zendeskCreateZendeskTicketOutputSchema: z.ZodObject<{
|
|
@@ -1153,6 +1153,7 @@ export const zendeskCreateZendeskTicketParamsSchema = z.object({
|
|
|
1153
1153
|
subject: z.string().describe("The subject of the ticket"),
|
|
1154
1154
|
body: z.string().describe("The body of the ticket").optional(),
|
|
1155
1155
|
subdomain: z.string().describe("The subdomain of the Zendesk account"),
|
|
1156
|
+
groupId: z.number().describe("The ID of the group to assign the ticket to").optional(),
|
|
1156
1157
|
});
|
|
1157
1158
|
export const zendeskCreateZendeskTicketOutputSchema = z.object({
|
|
1158
1159
|
ticketId: z.string().describe("The ID of the ticket created"),
|
package/dist/actions/groups.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, 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, } 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",
|
|
@@ -17,7 +17,12 @@ export const ACTION_GROUPS = {
|
|
|
17
17
|
},
|
|
18
18
|
SLACK_LIST_CONVERSATIONS: {
|
|
19
19
|
description: "Actions for interacting with Slack",
|
|
20
|
-
actions: [
|
|
20
|
+
actions: [
|
|
21
|
+
slackSendMessageDefinition,
|
|
22
|
+
slackGetChannelMessagesDefinition,
|
|
23
|
+
slackCreateChannelDefinition,
|
|
24
|
+
slackArchiveChannelDefinition,
|
|
25
|
+
],
|
|
21
26
|
},
|
|
22
27
|
CONFLUENCE: {
|
|
23
28
|
description: "Action for interacting with Confluence",
|
|
@@ -41,6 +46,9 @@ export const ACTION_GROUPS = {
|
|
|
41
46
|
googleOauthCreatePresentationDefinition,
|
|
42
47
|
googleOauthUpdatePresentationDefinition,
|
|
43
48
|
googleOauthSearchDriveByKeywordsDefinition,
|
|
49
|
+
googleOauthSearchDriveByQueryDefinition,
|
|
50
|
+
googleOauthSearchDriveByQueryAndGetFileContentDefinition,
|
|
51
|
+
googleOauthGetDriveFileContentByIdDefinition,
|
|
44
52
|
],
|
|
45
53
|
},
|
|
46
54
|
GOOGLE_CALENDAR: {
|
|
@@ -95,6 +103,21 @@ export const ACTION_GROUPS = {
|
|
|
95
103
|
jiraUpdateJiraTicketDetailsDefinition,
|
|
96
104
|
jiraUpdateJiraTicketStatusDefinition,
|
|
97
105
|
jiraGetJiraIssuesByQueryDefinition,
|
|
106
|
+
jiraGetServiceDesksDefinition,
|
|
107
|
+
jiraCreateServiceDeskRequestDefinition,
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
JIRA_ORG_ACTIONS: {
|
|
111
|
+
description: "Action for interacting with Jira tickets",
|
|
112
|
+
actions: [
|
|
113
|
+
jiraOrgAssignJiraTicketDefinition,
|
|
114
|
+
jiraOrgCreateJiraTicketDefinition,
|
|
115
|
+
jiraOrgCommentJiraTicketDefinition,
|
|
116
|
+
jiraOrgGetJiraTicketDetailsDefinition,
|
|
117
|
+
jiraOrgGetJiraTicketHistoryDefinition,
|
|
118
|
+
jiraOrgUpdateJiraTicketDetailsDefinition,
|
|
119
|
+
jiraOrgUpdateJiraTicketStatusDefinition,
|
|
120
|
+
jiraOrgGetJiraIssuesByQueryDefinition,
|
|
98
121
|
],
|
|
99
122
|
},
|
|
100
123
|
OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
|
|
@@ -131,7 +154,12 @@ export const ACTION_GROUPS = {
|
|
|
131
154
|
},
|
|
132
155
|
JAMF: {
|
|
133
156
|
description: "Actions for interacting with Jamf",
|
|
134
|
-
actions: [
|
|
157
|
+
actions: [
|
|
158
|
+
jamfGetJamfComputerInventoryDefinition,
|
|
159
|
+
jamfGetJamfFileVaultRecoveryKeyDefinition,
|
|
160
|
+
jamfGetJamfUserComputerIdDefinition,
|
|
161
|
+
jamfLockJamfComputerByIdDefinition,
|
|
162
|
+
],
|
|
135
163
|
},
|
|
136
164
|
LOOKER: {
|
|
137
165
|
description: "Actions for interacting with Looker",
|
|
@@ -171,6 +199,8 @@ export const ACTION_GROUPS = {
|
|
|
171
199
|
githubCreateBranchDefinition,
|
|
172
200
|
githubCreatePullRequestDefinition,
|
|
173
201
|
githubListPullRequestsDefinition,
|
|
202
|
+
githubGetFileContentDefinition,
|
|
203
|
+
githubListDirectoryDefinition,
|
|
174
204
|
],
|
|
175
205
|
},
|
|
176
206
|
ASHBY: {
|
|
@@ -215,6 +245,17 @@ export const ACTION_GROUPS = {
|
|
|
215
245
|
oktaResetPasswordDefinition,
|
|
216
246
|
oktaResetMFADefinition,
|
|
217
247
|
oktaListMFADefinition,
|
|
248
|
+
oktaTriggerOktaWorkflowDefinition,
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
LINEAR: {
|
|
252
|
+
description: "Actions for interacting with Linear",
|
|
253
|
+
actions: [
|
|
254
|
+
linearGetIssueDetailsDefinition,
|
|
255
|
+
linearGetProjectsDefinition,
|
|
256
|
+
linearGetProjectDetailsDefinition,
|
|
257
|
+
linearGetTeamDetailsDefinition,
|
|
258
|
+
linearGetTeamsDefinition,
|
|
218
259
|
],
|
|
219
260
|
},
|
|
220
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;
|
|
@@ -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 @@
|
|
|
1
|
+
export * as add from "./add";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.add = void 0;
|
|
37
|
+
exports.add = __importStar(require("./add"));
|
|
@@ -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,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as listConversations from "./listConversations";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.listConversations = void 0;
|
|
37
|
+
exports.listConversations = __importStar(require("./listConversations"));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const web_api_1 = require("@slack/web-api");
|
|
13
|
+
const helpers_1 = require("./helpers");
|
|
14
|
+
const slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
|
|
15
|
+
const client = new web_api_1.WebClient(authParams.authToken);
|
|
16
|
+
try {
|
|
17
|
+
const allChannels = yield (0, helpers_1.getSlackChannels)(client);
|
|
18
|
+
const filteredChannels = [];
|
|
19
|
+
for (const channel of allChannels) {
|
|
20
|
+
if (channel.name && channel.topic && channel.topic.value && channel.purpose && channel.purpose.value) {
|
|
21
|
+
const purpose = channel.purpose.value;
|
|
22
|
+
const topic = channel.topic.value;
|
|
23
|
+
const name = channel.name;
|
|
24
|
+
filteredChannels.push(Object.assign(Object.assign({}, channel), { purpose, topic, name }));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
channels: filteredChannels,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof Error) {
|
|
33
|
+
// Enhance error with more context
|
|
34
|
+
throw new Error(`Failed to list Slack conversations: ${error.message}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
exports.default = slackListConversations;
|
|
@@ -11,7 +11,7 @@ import { createAxiosClientWithRetries } from "../../util/axiosClient.js";
|
|
|
11
11
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
12
|
const createZendeskTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
13
|
const { authToken } = authParams;
|
|
14
|
-
const { subdomain, subject, body } = params;
|
|
14
|
+
const { subdomain, subject, body, groupId } = params;
|
|
15
15
|
const url = `https://${subdomain}.zendesk.com/api/v2/tickets.json`;
|
|
16
16
|
const payload = {
|
|
17
17
|
ticket: {
|
|
@@ -19,6 +19,7 @@ const createZendeskTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
|
19
19
|
comment: {
|
|
20
20
|
body,
|
|
21
21
|
},
|
|
22
|
+
group_id: groupId,
|
|
22
23
|
},
|
|
23
24
|
};
|
|
24
25
|
if (!authToken) {
|