@credal/actions 0.2.125 → 0.2.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.js +9 -1
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +123 -1
- package/dist/actions/autogen/types.d.ts +110 -7
- package/dist/actions/autogen/types.js +52 -1
- package/dist/actions/providers/firecrawl/scrapeUrl.js +0 -3
- package/dist/actions/providers/googleSearch/customSearch.d.ts +3 -0
- package/dist/actions/providers/googleSearch/customSearch.js +81 -0
- package/dist/actions/providers/jira/createJiraTicket.js +11 -3
- package/dist/actions/providers/jira/updateJiraTicketDetails.js +11 -2
- package/dist/actions/providers/jira/updateServiceDeskRequest.d.ts +3 -0
- package/dist/actions/providers/jira/updateServiceDeskRequest.js +72 -0
- package/dist/actions/providers/jira/utils.d.ts +1 -0
- package/dist/actions/providers/jira/utils.js +40 -0
- package/package.json +1 -1
- package/dist/actions/groups.d.ts +0 -6
- package/dist/actions/groups.js +0 -261
- package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
- package/dist/actions/providers/confluence/updatePage.js +0 -46
- package/dist/actions/providers/credal/callCopilot.d.ts +0 -3
- package/dist/actions/providers/credal/callCopilot.js +0 -36
- package/dist/actions/providers/generic/fillTemplateAction.d.ts +0 -7
- package/dist/actions/providers/generic/fillTemplateAction.js +0 -18
- package/dist/actions/providers/generic/genericApiCall.d.ts +0 -3
- package/dist/actions/providers/generic/genericApiCall.js +0 -38
- package/dist/actions/providers/google-oauth/getDriveContentById.d.ts +0 -3
- package/dist/actions/providers/google-oauth/getDriveContentById.js +0 -161
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchAndGetDriveContentByKeywords.js +0 -47
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByKeywords.js +0 -110
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchDriveAndGetContentByQuery.js +0 -78
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.d.ts +0 -15
- package/dist/actions/providers/google-oauth/utils/extractContentFromDriveFileId.js +0 -129
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +0 -3
- package/dist/actions/providers/googlemaps/nearbysearch.js +0 -96
- package/dist/actions/providers/math/index.d.ts +0 -1
- package/dist/actions/providers/math/index.js +0 -37
- package/dist/actions/providers/slack/archiveChannel.d.ts +0 -3
- package/dist/actions/providers/slack/archiveChannel.js +0 -42
- package/dist/actions/providers/slack/index.d.ts +0 -1
- package/dist/actions/providers/slack/index.js +0 -37
- package/dist/actions/providers/slack/listConversations.d.ts +0 -3
- package/dist/actions/providers/slack/listConversations.js +0 -41
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.d.ts +0 -3
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.js +0 -154
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.d.ts +0 -3
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.js +0 -45
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
22
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
23
|
+
// https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list#request
|
|
24
|
+
const customSearch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
25
|
+
var _b, _c;
|
|
26
|
+
if (!authParams.authToken) {
|
|
27
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
|
28
|
+
}
|
|
29
|
+
const url = "https://customsearch.googleapis.com/customsearch/v1";
|
|
30
|
+
try {
|
|
31
|
+
// Filter out undefined values from params
|
|
32
|
+
const queryParams = Object.fromEntries(Object.entries(params).filter(([, value]) => value !== undefined));
|
|
33
|
+
// Add API key to query parameters
|
|
34
|
+
queryParams.key = authParams.authToken;
|
|
35
|
+
const { query, customSearchEngineId } = queryParams, filteredParams = __rest(queryParams, ["query", "customSearchEngineId"]);
|
|
36
|
+
const res = yield axiosClient.get(url, {
|
|
37
|
+
params: Object.assign({ q: query, cx: customSearchEngineId, filter: "1", safe: "active" }, filteredParams),
|
|
38
|
+
});
|
|
39
|
+
const { items = [], searchInformation } = res.data;
|
|
40
|
+
// Transform the response to match our schema
|
|
41
|
+
const results = items
|
|
42
|
+
.map((item) => {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
return ({
|
|
45
|
+
title: (_a = item.title) !== null && _a !== void 0 ? _a : "",
|
|
46
|
+
link: (_b = item.link) !== null && _b !== void 0 ? _b : "",
|
|
47
|
+
snippet: (_c = item.snippet) !== null && _c !== void 0 ? _c : "",
|
|
48
|
+
displayLink: (_d = item.displayLink) !== null && _d !== void 0 ? _d : "",
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.filter((item) => item.link !== undefined);
|
|
52
|
+
return {
|
|
53
|
+
success: true,
|
|
54
|
+
items: results,
|
|
55
|
+
searchInformation: searchInformation
|
|
56
|
+
? {
|
|
57
|
+
searchTime: searchInformation.searchTime,
|
|
58
|
+
totalResults: searchInformation.totalResults,
|
|
59
|
+
}
|
|
60
|
+
: undefined,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
let errorMessage = "Unknown error performing search";
|
|
65
|
+
if (error && typeof error === "object" && "response" in error) {
|
|
66
|
+
const axiosError = error;
|
|
67
|
+
if ((_c = (_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) {
|
|
68
|
+
const apiError = axiosError.response.data.error;
|
|
69
|
+
errorMessage = apiError.message || `API Error: ${apiError.code}`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (error instanceof Error) {
|
|
73
|
+
errorMessage = error.message;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
success: false,
|
|
77
|
+
error: errorMessage,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export default customSearch;
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
-
import { getUserAccountIdFromEmail } from "./utils.js";
|
|
11
|
+
import { getUserAccountIdFromEmail, getRequestTypeCustomFieldId } from "./utils.js";
|
|
12
12
|
const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
13
|
const { authToken, cloudId, baseUrl } = authParams;
|
|
14
14
|
const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/`;
|
|
@@ -25,6 +25,14 @@ const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
25
25
|
if (params.assignee && typeof params.assignee === "string" && params.assignee.includes("@") && authToken) {
|
|
26
26
|
assigneeId = yield getUserAccountIdFromEmail(params.assignee, apiUrl, authToken);
|
|
27
27
|
}
|
|
28
|
+
// If request type is provided, find the custom field ID and prepare the value
|
|
29
|
+
const requestTypeField = {};
|
|
30
|
+
if (params.requestTypeId && authToken) {
|
|
31
|
+
const requestTypeFieldId = yield getRequestTypeCustomFieldId(params.projectKey, apiUrl, authToken);
|
|
32
|
+
if (requestTypeFieldId) {
|
|
33
|
+
requestTypeField[requestTypeFieldId] = params.requestTypeId;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
28
36
|
const description = {
|
|
29
37
|
type: "doc",
|
|
30
38
|
version: 1,
|
|
@@ -41,11 +49,11 @@ const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
41
49
|
],
|
|
42
50
|
};
|
|
43
51
|
const payload = {
|
|
44
|
-
fields: Object.assign(Object.assign(Object.assign({ project: {
|
|
52
|
+
fields: Object.assign(Object.assign(Object.assign(Object.assign({ project: {
|
|
45
53
|
key: params.projectKey,
|
|
46
54
|
}, summary: params.summary, description: description, issuetype: {
|
|
47
55
|
name: params.issueType,
|
|
48
|
-
} }, (reporterId ? { reporter: { id: reporterId } } : {})), (assigneeId ? { assignee: { id: assigneeId } } : {})), (params.customFields ? params.customFields : {})),
|
|
56
|
+
} }, (reporterId ? { reporter: { id: reporterId } } : {})), (assigneeId ? { assignee: { id: assigneeId } } : {})), requestTypeField), (params.customFields ? params.customFields : {})),
|
|
49
57
|
};
|
|
50
58
|
const response = yield axiosClient.post(`${apiUrl}/issue`, payload, {
|
|
51
59
|
headers: {
|
|
@@ -8,9 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
import { getRequestTypeCustomFieldId } from "./utils.js";
|
|
11
12
|
const updateJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
12
13
|
const { authToken, cloudId, baseUrl } = authParams;
|
|
13
|
-
const { issueId, summary, description, customFields } = params;
|
|
14
|
+
const { issueId, summary, description, customFields, requestTypeId } = params;
|
|
14
15
|
if (!cloudId || !authToken) {
|
|
15
16
|
throw new Error("Valid Cloud ID and auth token are required to comment on Jira ticket");
|
|
16
17
|
}
|
|
@@ -32,8 +33,16 @@ const updateJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function
|
|
|
32
33
|
],
|
|
33
34
|
}
|
|
34
35
|
: undefined;
|
|
36
|
+
// If request type is provided, find the custom field ID and prepare the value
|
|
37
|
+
const requestTypeField = {};
|
|
38
|
+
if (requestTypeId && authToken) {
|
|
39
|
+
const requestTypeFieldId = yield getRequestTypeCustomFieldId(params.projectKey, `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3`, authToken);
|
|
40
|
+
if (requestTypeFieldId) {
|
|
41
|
+
requestTypeField[requestTypeFieldId] = requestTypeId;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
35
44
|
const payload = {
|
|
36
|
-
fields: Object.assign(Object.assign(Object.assign({}, (summary && { summary })), (formattedDescription && { description: formattedDescription })), (customFields && Object.assign({}, customFields))),
|
|
45
|
+
fields: Object.assign(Object.assign(Object.assign(Object.assign({}, (summary && { summary })), (formattedDescription && { description: formattedDescription })), requestTypeField), (customFields && Object.assign({}, customFields))),
|
|
37
46
|
};
|
|
38
47
|
try {
|
|
39
48
|
yield axiosClient.put(apiUrl, payload, {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
const updateServiceDeskRequest = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
12
|
+
const { issueId, requestTypeId, summary, description, priority, customFields } = params;
|
|
13
|
+
const { authToken, cloudId, baseUrl } = authParams;
|
|
14
|
+
if (!cloudId || !authToken) {
|
|
15
|
+
throw new Error("Valid Cloud ID and auth token are required to update service desk request");
|
|
16
|
+
}
|
|
17
|
+
// Use the regular Jira API for updating service desk requests as they are still Jira issues
|
|
18
|
+
const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${issueId}`;
|
|
19
|
+
const formattedDescription = description
|
|
20
|
+
? {
|
|
21
|
+
type: "doc",
|
|
22
|
+
version: 1,
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "paragraph",
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: "text",
|
|
29
|
+
text: description,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
36
|
+
const payload = {
|
|
37
|
+
fields: Object.assign(Object.assign(Object.assign(Object.assign({}, (summary && { summary })), (formattedDescription && { description: formattedDescription })), (priority && { priority: { name: priority } })), (customFields && Object.assign({}, customFields))),
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
yield axiosClient.put(apiUrl, payload, {
|
|
41
|
+
headers: {
|
|
42
|
+
Authorization: `Bearer ${authToken}`,
|
|
43
|
+
Accept: "application/json",
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
// Get the updated issue details to return current status and web link
|
|
48
|
+
const getResponse = yield axiosClient.get(apiUrl, {
|
|
49
|
+
headers: {
|
|
50
|
+
Authorization: `Bearer ${authToken}`,
|
|
51
|
+
Accept: "application/json",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const issueKey = getResponse.data.key;
|
|
55
|
+
const currentStatus = getResponse.data.fields.status.name;
|
|
56
|
+
const webLink = `${baseUrl}/browse/${issueKey}`;
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
issueKey,
|
|
60
|
+
webLink,
|
|
61
|
+
currentStatus,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error("Error updating service desk request:", error);
|
|
66
|
+
return {
|
|
67
|
+
success: false,
|
|
68
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export default updateServiceDeskRequest;
|
|
@@ -29,3 +29,43 @@ export function getUserAccountIdFromEmail(email, apiUrl, authToken) {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
export function getRequestTypeCustomFieldId(projectKey, apiUrl, authToken) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const response = yield axiosClient.get(`${apiUrl}/issue/createmeta?projectKeys=${projectKey}&expand=projects.issuetypes.fields`, {
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${authToken}`,
|
|
38
|
+
Accept: "application/json",
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const projects = response.data.projects;
|
|
42
|
+
if (!projects || projects.length === 0) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const project = projects[0];
|
|
46
|
+
const issueTypes = project.issuetypes;
|
|
47
|
+
if (!issueTypes || issueTypes.length === 0) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
for (const issueType of issueTypes) {
|
|
51
|
+
const fields = issueType.fields;
|
|
52
|
+
if (fields) {
|
|
53
|
+
for (const [fieldId, fieldData] of Object.entries(fields)) {
|
|
54
|
+
if (fieldData && typeof fieldData === "object" && "name" in fieldData) {
|
|
55
|
+
const fieldInfo = fieldData;
|
|
56
|
+
if (fieldInfo.name === "Request Type") {
|
|
57
|
+
return fieldId;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const axiosError = error;
|
|
67
|
+
console.error("Error finding Request Type custom field:", axiosError.message);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
package/package.json
CHANGED
package/dist/actions/groups.d.ts
DELETED
package/dist/actions/groups.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
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
|
-
export const ACTION_GROUPS = {
|
|
3
|
-
GENERIC: {
|
|
4
|
-
description: "Generic utility actions",
|
|
5
|
-
actions: [genericFillTemplateDefinition],
|
|
6
|
-
},
|
|
7
|
-
ASANA: {
|
|
8
|
-
description: "Actions for interacting with Asana",
|
|
9
|
-
actions: [
|
|
10
|
-
asanaCommentTaskDefinition,
|
|
11
|
-
asanaCreateTaskDefinition,
|
|
12
|
-
asanaUpdateTaskDefinition,
|
|
13
|
-
asanaSearchTasksDefinition,
|
|
14
|
-
asanaListAsanaTasksByProjectDefinition,
|
|
15
|
-
asanaGetTasksDetailsDefinition,
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
SLACK_LIST_CONVERSATIONS: {
|
|
19
|
-
description: "Actions for interacting with Slack",
|
|
20
|
-
actions: [
|
|
21
|
-
slackSendMessageDefinition,
|
|
22
|
-
slackGetChannelMessagesDefinition,
|
|
23
|
-
slackCreateChannelDefinition,
|
|
24
|
-
slackArchiveChannelDefinition,
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
CONFLUENCE: {
|
|
28
|
-
description: "Action for interacting with Confluence",
|
|
29
|
-
actions: [confluenceOverwritePageDefinition, confluenceFetchPageContentDefinition],
|
|
30
|
-
},
|
|
31
|
-
MATH_ADD: {
|
|
32
|
-
description: "Action for adding two numbers",
|
|
33
|
-
actions: [mathAddDefinition],
|
|
34
|
-
},
|
|
35
|
-
GOOGLE_MAPS: {
|
|
36
|
-
description: "Action for interacting with Google Maps",
|
|
37
|
-
actions: [googlemapsValidateAddressDefinition, googlemapsNearbysearchRestaurantsDefinition],
|
|
38
|
-
},
|
|
39
|
-
GOOGLE_DRIVE: {
|
|
40
|
-
description: "Action for interacting with Google Drive",
|
|
41
|
-
actions: [
|
|
42
|
-
googleOauthCreateNewGoogleDocDefinition,
|
|
43
|
-
googleOauthUpdateDocDefinition,
|
|
44
|
-
googleOauthCreateSpreadsheetDefinition,
|
|
45
|
-
googleOauthUpdateSpreadsheetDefinition,
|
|
46
|
-
googleOauthCreatePresentationDefinition,
|
|
47
|
-
googleOauthUpdatePresentationDefinition,
|
|
48
|
-
googleOauthSearchDriveByKeywordsDefinition,
|
|
49
|
-
googleOauthSearchDriveByQueryDefinition,
|
|
50
|
-
googleOauthSearchDriveByQueryAndGetFileContentDefinition,
|
|
51
|
-
googleOauthGetDriveFileContentByIdDefinition,
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
GOOGLE_CALENDAR: {
|
|
55
|
-
description: "Actions for interacting with Google Calendar",
|
|
56
|
-
actions: [
|
|
57
|
-
googleOauthScheduleCalendarMeetingDefinition,
|
|
58
|
-
googleOauthListCalendarsDefinition,
|
|
59
|
-
googleOauthListCalendarEventsDefinition,
|
|
60
|
-
googleOauthUpdateCalendarEventDefinition,
|
|
61
|
-
googleOauthDeleteCalendarEventDefinition,
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
GMAIL: {
|
|
65
|
-
description: "Actions for interacting with Gmail",
|
|
66
|
-
actions: [googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition],
|
|
67
|
-
},
|
|
68
|
-
LINKEDIN_SHARE_POST: {
|
|
69
|
-
description: "Action for creating a share post url on linkedin",
|
|
70
|
-
actions: [linkedinCreateShareLinkedinPostUrlDefinition],
|
|
71
|
-
},
|
|
72
|
-
ZENDESK_ACTIONS: {
|
|
73
|
-
description: "Actions for interacting with Zendesk",
|
|
74
|
-
actions: [
|
|
75
|
-
zendeskCreateZendeskTicketDefinition,
|
|
76
|
-
zendeskListZendeskTicketsDefinition,
|
|
77
|
-
zendeskGetTicketDetailsDefinition,
|
|
78
|
-
zendeskUpdateTicketStatusDefinition,
|
|
79
|
-
zendeskAddCommentToTicketDefinition,
|
|
80
|
-
zendeskAssignTicketDefinition,
|
|
81
|
-
],
|
|
82
|
-
},
|
|
83
|
-
BING_SEARCH: {
|
|
84
|
-
description: "Action for searching Bing",
|
|
85
|
-
actions: [bingGetTopNSearchResultUrlsDefinition],
|
|
86
|
-
},
|
|
87
|
-
MONGO_INSERT_DOC: {
|
|
88
|
-
description: "Action for inserting a document into a MongoDB collection",
|
|
89
|
-
actions: [mongoInsertMongoDocDefinition],
|
|
90
|
-
},
|
|
91
|
-
SNOWFLAKE_ACTIONS: {
|
|
92
|
-
description: "Action for getting content from a Snowflake table",
|
|
93
|
-
actions: [snowflakeGetRowByFieldValueDefinition, snowflakeRunSnowflakeQueryDefinition],
|
|
94
|
-
},
|
|
95
|
-
JIRA_ACTIONS: {
|
|
96
|
-
description: "Action for interacting with Jira tickets",
|
|
97
|
-
actions: [
|
|
98
|
-
jiraAssignJiraTicketDefinition,
|
|
99
|
-
jiraCreateJiraTicketDefinition,
|
|
100
|
-
jiraCommentJiraTicketDefinition,
|
|
101
|
-
jiraGetJiraTicketDetailsDefinition,
|
|
102
|
-
jiraGetJiraTicketHistoryDefinition,
|
|
103
|
-
jiraUpdateJiraTicketDetailsDefinition,
|
|
104
|
-
jiraUpdateJiraTicketStatusDefinition,
|
|
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,
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
|
|
124
|
-
description: "Action for getting the latitude and longitude of a location",
|
|
125
|
-
actions: [openstreetmapGetLatitudeLongitudeFromLocationDefinition],
|
|
126
|
-
},
|
|
127
|
-
NWS_GET_FORECAST_FOR_LOCATION: {
|
|
128
|
-
description: "Action for getting the weather forecast for a location",
|
|
129
|
-
actions: [nwsGetForecastForLocationDefinition],
|
|
130
|
-
},
|
|
131
|
-
FIRECRAWL: {
|
|
132
|
-
description: "Actions for interacting with Firecrawl",
|
|
133
|
-
actions: [
|
|
134
|
-
firecrawlScrapeUrlDefinition,
|
|
135
|
-
firecrawlScrapeTweetDataWithNitterDefinition,
|
|
136
|
-
firecrawlDeepResearchDefinition,
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
RESEND: {
|
|
140
|
-
description: "Action for sending an email",
|
|
141
|
-
actions: [resendSendEmailDefinition],
|
|
142
|
-
},
|
|
143
|
-
X: {
|
|
144
|
-
description: "Actions for interacting with X(formerly twitter)",
|
|
145
|
-
actions: [xCreateShareXPostUrlDefinition],
|
|
146
|
-
},
|
|
147
|
-
GONG: {
|
|
148
|
-
description: "Actions for interacting with Gong",
|
|
149
|
-
actions: [gongGetGongTranscriptsDefinition],
|
|
150
|
-
},
|
|
151
|
-
FINNHUB: {
|
|
152
|
-
description: "Action for interacting with Finnhub for stock market data",
|
|
153
|
-
actions: [finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition],
|
|
154
|
-
},
|
|
155
|
-
JAMF: {
|
|
156
|
-
description: "Actions for interacting with Jamf",
|
|
157
|
-
actions: [
|
|
158
|
-
jamfGetJamfComputerInventoryDefinition,
|
|
159
|
-
jamfGetJamfFileVaultRecoveryKeyDefinition,
|
|
160
|
-
jamfGetJamfUserComputerIdDefinition,
|
|
161
|
-
jamfLockJamfComputerByIdDefinition,
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
LOOKER: {
|
|
165
|
-
description: "Actions for interacting with Looker",
|
|
166
|
-
actions: [lookerEnableUserByEmailDefinition],
|
|
167
|
-
},
|
|
168
|
-
SALESFORCE: {
|
|
169
|
-
description: "Actions for interacting with Salesforce",
|
|
170
|
-
actions: [
|
|
171
|
-
salesforceUpdateRecordDefinition,
|
|
172
|
-
salesforceCreateRecordDefinition,
|
|
173
|
-
salesforceCreateCaseDefinition,
|
|
174
|
-
salesforceGenerateSalesReportDefinition,
|
|
175
|
-
salesforceGetRecordDefinition,
|
|
176
|
-
salesforceGetSalesforceRecordsByQueryDefinition,
|
|
177
|
-
salesforceFetchSalesforceSchemaByObjectDefinition,
|
|
178
|
-
],
|
|
179
|
-
},
|
|
180
|
-
MICROSOFT: {
|
|
181
|
-
description: "Actions for interacting with Microsoft 365",
|
|
182
|
-
actions: [
|
|
183
|
-
microsoftMessageTeamsChatDefinition,
|
|
184
|
-
microsoftMessageTeamsChannelDefinition,
|
|
185
|
-
microsoftUpdateSpreadsheetDefinition,
|
|
186
|
-
microsoftUpdateDocumentDefinition,
|
|
187
|
-
microsoftCreateDocumentDefinition,
|
|
188
|
-
microsoftGetDocumentDefinition,
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
KANDJI: {
|
|
192
|
-
description: "Actions for interacting with Kandji",
|
|
193
|
-
actions: [kandjiGetFVRecoveryKeyForDeviceDefinition],
|
|
194
|
-
},
|
|
195
|
-
GITHUB: {
|
|
196
|
-
description: "Actions for interacting with GitHub",
|
|
197
|
-
actions: [
|
|
198
|
-
githubCreateOrUpdateFileDefinition,
|
|
199
|
-
githubCreateBranchDefinition,
|
|
200
|
-
githubCreatePullRequestDefinition,
|
|
201
|
-
githubListPullRequestsDefinition,
|
|
202
|
-
githubGetFileContentDefinition,
|
|
203
|
-
githubListDirectoryDefinition,
|
|
204
|
-
],
|
|
205
|
-
},
|
|
206
|
-
ASHBY: {
|
|
207
|
-
description: "Actions for interacting with Ashby",
|
|
208
|
-
actions: [
|
|
209
|
-
ashbyCreateNoteDefinition,
|
|
210
|
-
ashbyGetCandidateInfoDefinition,
|
|
211
|
-
ashbyListCandidatesDefinition,
|
|
212
|
-
ashbyListCandidateNotesDefinition,
|
|
213
|
-
ashbySearchCandidatesDefinition,
|
|
214
|
-
ashbyCreateCandidateDefinition,
|
|
215
|
-
ashbyUpdateCandidateDefinition,
|
|
216
|
-
ashbyAddCandidateToProjectDefinition,
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
NOTION: {
|
|
220
|
-
description: "Actions for interacting with Notion",
|
|
221
|
-
actions: [notionSearchByTitleDefinition],
|
|
222
|
-
},
|
|
223
|
-
GOOGLE_GROUPS: {
|
|
224
|
-
description: "Google Workspace Groups management actions",
|
|
225
|
-
actions: [
|
|
226
|
-
googleOauthListGroupsDefinition,
|
|
227
|
-
googleOauthGetGroupDefinition,
|
|
228
|
-
googleOauthListGroupMembersDefinition,
|
|
229
|
-
googleOauthHasGroupMemberDefinition,
|
|
230
|
-
googleOauthAddGroupMemberDefinition,
|
|
231
|
-
googleOauthDeleteGroupMemberDefinition,
|
|
232
|
-
],
|
|
233
|
-
},
|
|
234
|
-
OKTA: {
|
|
235
|
-
description: "Actions for interacting with Okta",
|
|
236
|
-
actions: [
|
|
237
|
-
oktaListOktaUsersDefinition,
|
|
238
|
-
oktaGetOktaUserDefinition,
|
|
239
|
-
oktaListOktaUserGroupsDefinition,
|
|
240
|
-
oktaListOktaGroupsDefinition,
|
|
241
|
-
oktaGetOktaGroupDefinition,
|
|
242
|
-
oktaListOktaGroupMembersDefinition,
|
|
243
|
-
oktaRemoveUserFromGroupDefinition,
|
|
244
|
-
oktaAddUserToGroupDefinition,
|
|
245
|
-
oktaResetPasswordDefinition,
|
|
246
|
-
oktaResetMFADefinition,
|
|
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,
|
|
259
|
-
],
|
|
260
|
-
},
|
|
261
|
-
};
|
|
@@ -1,46 +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
|
-
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
|
14
|
-
return {
|
|
15
|
-
baseURL: baseUrl,
|
|
16
|
-
headers: {
|
|
17
|
-
Accept: "application/json",
|
|
18
|
-
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
23
|
-
const { pageId, content, title } = params;
|
|
24
|
-
const { baseUrl, authToken, username } = authParams;
|
|
25
|
-
if (!baseUrl || !authToken || !username) {
|
|
26
|
-
throw new Error("Missing required authentication information");
|
|
27
|
-
}
|
|
28
|
-
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
|
29
|
-
// Get current version number
|
|
30
|
-
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
|
31
|
-
const currVersion = response.data.version.number;
|
|
32
|
-
const payload = {
|
|
33
|
-
id: pageId,
|
|
34
|
-
status: "current",
|
|
35
|
-
title,
|
|
36
|
-
body: {
|
|
37
|
-
representation: "storage",
|
|
38
|
-
value: content,
|
|
39
|
-
},
|
|
40
|
-
version: {
|
|
41
|
-
number: currVersion + 1,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
|
45
|
-
});
|
|
46
|
-
exports.default = confluenceUpdatePage;
|
|
@@ -1,36 +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 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;
|