@credal/actions 0.2.214 → 0.2.216
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 +28 -4
- package/dist/actions/autogen/types.d.ts +18 -0
- package/dist/actions/autogen/types.js +36 -3
- package/dist/actions/providers/github/searchRepository.js +7 -7
- package/dist/actions/providers/google-oauth/listFilesWithAssignedComments.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listFilesWithAssignedComments.js +41 -0
- package/dist/actions/providers/jira/getJiraDCIssuesByQuery.d.ts +4 -3
- package/dist/actions/providers/jira/getJiraDCIssuesByQuery.js +7 -3
- package/dist/actions/providers/jira/getJiraIssuesByQuery.js +8 -1
- package/dist/actions/providers/jira/updateServiceDeskRequest.d.ts +3 -0
- package/dist/actions/providers/jira/updateServiceDeskRequest.js +72 -0
- package/dist/actions/providers/microsoft/sendOutlookEmail.d.ts +3 -0
- package/dist/actions/providers/microsoft/sendOutlookEmail.js +48 -0
- package/package.json +1 -1
- package/dist/actions/groups.d.ts +0 -6
- package/dist/actions/groups.js +0 -251
- package/dist/actions/providers/github/fetchFile.d.ts +0 -3
- package/dist/actions/providers/github/fetchFile.js +0 -131
- package/dist/actions/providers/github/getContents.d.ts +0 -3
- package/dist/actions/providers/github/getContents.js +0 -41
- package/dist/actions/providers/slack/archiveChannel.d.ts +0 -3
- package/dist/actions/providers/slack/archiveChannel.js +0 -42
|
@@ -895,7 +895,7 @@ export const slackGetChannelMembersDefinition = {
|
|
|
895
895
|
};
|
|
896
896
|
export const slackUserSearchSlackDefinition = {
|
|
897
897
|
displayName: "Search Slack",
|
|
898
|
-
description: "
|
|
898
|
+
description: "Deprecated. Please use the Slack Real-Time Search action, or ask your Credal admin to enable it if not currently available.",
|
|
899
899
|
scopes: [
|
|
900
900
|
"search:read",
|
|
901
901
|
"channels:read",
|
|
@@ -2018,7 +2018,7 @@ export const jiraGetJiraIssuesByQueryDefinition = {
|
|
|
2018
2018
|
},
|
|
2019
2019
|
limit: {
|
|
2020
2020
|
type: "number",
|
|
2021
|
-
description: "The maximum number of records to retrieve",
|
|
2021
|
+
description: "The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).",
|
|
2022
2022
|
},
|
|
2023
2023
|
},
|
|
2024
2024
|
},
|
|
@@ -2194,6 +2194,14 @@ export const jiraGetJiraIssuesByQueryDefinition = {
|
|
|
2194
2194
|
},
|
|
2195
2195
|
},
|
|
2196
2196
|
},
|
|
2197
|
+
total: {
|
|
2198
|
+
type: "number",
|
|
2199
|
+
description: "The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.",
|
|
2200
|
+
},
|
|
2201
|
+
truncated: {
|
|
2202
|
+
type: "boolean",
|
|
2203
|
+
description: "True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.",
|
|
2204
|
+
},
|
|
2197
2205
|
error: {
|
|
2198
2206
|
type: "string",
|
|
2199
2207
|
description: "The error that occurred if the records were not successfully retrieved",
|
|
@@ -2874,7 +2882,7 @@ export const jiraOrgGetJiraIssuesByQueryDefinition = {
|
|
|
2874
2882
|
},
|
|
2875
2883
|
limit: {
|
|
2876
2884
|
type: "number",
|
|
2877
|
-
description: "The maximum number of records to retrieve",
|
|
2885
|
+
description: "The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).",
|
|
2878
2886
|
},
|
|
2879
2887
|
},
|
|
2880
2888
|
},
|
|
@@ -3050,6 +3058,14 @@ export const jiraOrgGetJiraIssuesByQueryDefinition = {
|
|
|
3050
3058
|
},
|
|
3051
3059
|
},
|
|
3052
3060
|
},
|
|
3061
|
+
total: {
|
|
3062
|
+
type: "number",
|
|
3063
|
+
description: "The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.",
|
|
3064
|
+
},
|
|
3065
|
+
truncated: {
|
|
3066
|
+
type: "boolean",
|
|
3067
|
+
description: "True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.",
|
|
3068
|
+
},
|
|
3053
3069
|
error: {
|
|
3054
3070
|
type: "string",
|
|
3055
3071
|
description: "The error that occurred if the records were not successfully retrieved",
|
|
@@ -3730,7 +3746,7 @@ export const jiraDataCenterGetJiraIssuesByQueryDefinition = {
|
|
|
3730
3746
|
},
|
|
3731
3747
|
limit: {
|
|
3732
3748
|
type: "number",
|
|
3733
|
-
description: "The maximum number of records to retrieve",
|
|
3749
|
+
description: "The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).",
|
|
3734
3750
|
},
|
|
3735
3751
|
},
|
|
3736
3752
|
},
|
|
@@ -3906,6 +3922,14 @@ export const jiraDataCenterGetJiraIssuesByQueryDefinition = {
|
|
|
3906
3922
|
},
|
|
3907
3923
|
},
|
|
3908
3924
|
},
|
|
3925
|
+
total: {
|
|
3926
|
+
type: "number",
|
|
3927
|
+
description: "The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.",
|
|
3928
|
+
},
|
|
3929
|
+
truncated: {
|
|
3930
|
+
type: "boolean",
|
|
3931
|
+
description: "True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.",
|
|
3932
|
+
},
|
|
3909
3933
|
error: {
|
|
3910
3934
|
type: "string",
|
|
3911
3935
|
description: "The error that occurred if the records were not successfully retrieved",
|
|
@@ -2292,6 +2292,8 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
2292
2292
|
resolution?: string | null | undefined;
|
|
2293
2293
|
};
|
|
2294
2294
|
}>, "many">>;
|
|
2295
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
2296
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
2295
2297
|
error: z.ZodOptional<z.ZodString>;
|
|
2296
2298
|
}, "strip", z.ZodTypeAny, {
|
|
2297
2299
|
error?: string | undefined;
|
|
@@ -2339,6 +2341,8 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
2339
2341
|
resolution?: string | null | undefined;
|
|
2340
2342
|
};
|
|
2341
2343
|
}[] | undefined;
|
|
2344
|
+
total?: number | undefined;
|
|
2345
|
+
truncated?: boolean | undefined;
|
|
2342
2346
|
}, {
|
|
2343
2347
|
error?: string | undefined;
|
|
2344
2348
|
results?: {
|
|
@@ -2385,6 +2389,8 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
2385
2389
|
resolution?: string | null | undefined;
|
|
2386
2390
|
};
|
|
2387
2391
|
}[] | undefined;
|
|
2392
|
+
total?: number | undefined;
|
|
2393
|
+
truncated?: boolean | undefined;
|
|
2388
2394
|
}>;
|
|
2389
2395
|
export type jiraGetJiraIssuesByQueryOutputType = z.infer<typeof jiraGetJiraIssuesByQueryOutputSchema>;
|
|
2390
2396
|
export type jiraGetJiraIssuesByQueryFunction = ActionFunction<jiraGetJiraIssuesByQueryParamsType, AuthParamsType, jiraGetJiraIssuesByQueryOutputType>;
|
|
@@ -3101,6 +3107,8 @@ export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
3101
3107
|
resolution?: string | null | undefined;
|
|
3102
3108
|
};
|
|
3103
3109
|
}>, "many">>;
|
|
3110
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
3111
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
3104
3112
|
error: z.ZodOptional<z.ZodString>;
|
|
3105
3113
|
}, "strip", z.ZodTypeAny, {
|
|
3106
3114
|
error?: string | undefined;
|
|
@@ -3148,6 +3156,8 @@ export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
3148
3156
|
resolution?: string | null | undefined;
|
|
3149
3157
|
};
|
|
3150
3158
|
}[] | undefined;
|
|
3159
|
+
total?: number | undefined;
|
|
3160
|
+
truncated?: boolean | undefined;
|
|
3151
3161
|
}, {
|
|
3152
3162
|
error?: string | undefined;
|
|
3153
3163
|
results?: {
|
|
@@ -3194,6 +3204,8 @@ export declare const jiraOrgGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
|
3194
3204
|
resolution?: string | null | undefined;
|
|
3195
3205
|
};
|
|
3196
3206
|
}[] | undefined;
|
|
3207
|
+
total?: number | undefined;
|
|
3208
|
+
truncated?: boolean | undefined;
|
|
3197
3209
|
}>;
|
|
3198
3210
|
export type jiraOrgGetJiraIssuesByQueryOutputType = z.infer<typeof jiraOrgGetJiraIssuesByQueryOutputSchema>;
|
|
3199
3211
|
export type jiraOrgGetJiraIssuesByQueryFunction = ActionFunction<jiraOrgGetJiraIssuesByQueryParamsType, AuthParamsType, jiraOrgGetJiraIssuesByQueryOutputType>;
|
|
@@ -3910,6 +3922,8 @@ export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject
|
|
|
3910
3922
|
resolution?: string | null | undefined;
|
|
3911
3923
|
};
|
|
3912
3924
|
}>, "many">>;
|
|
3925
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
3926
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
3913
3927
|
error: z.ZodOptional<z.ZodString>;
|
|
3914
3928
|
}, "strip", z.ZodTypeAny, {
|
|
3915
3929
|
error?: string | undefined;
|
|
@@ -3957,6 +3971,8 @@ export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject
|
|
|
3957
3971
|
resolution?: string | null | undefined;
|
|
3958
3972
|
};
|
|
3959
3973
|
}[] | undefined;
|
|
3974
|
+
total?: number | undefined;
|
|
3975
|
+
truncated?: boolean | undefined;
|
|
3960
3976
|
}, {
|
|
3961
3977
|
error?: string | undefined;
|
|
3962
3978
|
results?: {
|
|
@@ -4003,6 +4019,8 @@ export declare const jiraDataCenterGetJiraIssuesByQueryOutputSchema: z.ZodObject
|
|
|
4003
4019
|
resolution?: string | null | undefined;
|
|
4004
4020
|
};
|
|
4005
4021
|
}[] | undefined;
|
|
4022
|
+
total?: number | undefined;
|
|
4023
|
+
truncated?: boolean | undefined;
|
|
4006
4024
|
}>;
|
|
4007
4025
|
export type jiraDataCenterGetJiraIssuesByQueryOutputType = z.infer<typeof jiraDataCenterGetJiraIssuesByQueryOutputSchema>;
|
|
4008
4026
|
export type jiraDataCenterGetJiraIssuesByQueryFunction = ActionFunction<jiraDataCenterGetJiraIssuesByQueryParamsType, AuthParamsType, jiraDataCenterGetJiraIssuesByQueryOutputType>;
|
|
@@ -821,7 +821,10 @@ export const jiraUpdateJiraTicketStatusOutputSchema = z.object({
|
|
|
821
821
|
});
|
|
822
822
|
export const jiraGetJiraIssuesByQueryParamsSchema = z.object({
|
|
823
823
|
query: z.string().describe("The JQL query to execute"),
|
|
824
|
-
limit: z
|
|
824
|
+
limit: z
|
|
825
|
+
.number()
|
|
826
|
+
.describe("The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).")
|
|
827
|
+
.optional(),
|
|
825
828
|
});
|
|
826
829
|
export const jiraGetJiraIssuesByQueryOutputSchema = z.object({
|
|
827
830
|
results: z
|
|
@@ -878,6 +881,14 @@ export const jiraGetJiraIssuesByQueryOutputSchema = z.object({
|
|
|
878
881
|
}))
|
|
879
882
|
.describe("The results of the Jira issues")
|
|
880
883
|
.optional(),
|
|
884
|
+
total: z
|
|
885
|
+
.number()
|
|
886
|
+
.describe("The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.")
|
|
887
|
+
.optional(),
|
|
888
|
+
truncated: z
|
|
889
|
+
.boolean()
|
|
890
|
+
.describe("True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.")
|
|
891
|
+
.optional(),
|
|
881
892
|
error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
|
|
882
893
|
});
|
|
883
894
|
export const jiraLinkJiraIssuesParamsSchema = z.object({
|
|
@@ -1073,7 +1084,10 @@ export const jiraOrgUpdateJiraTicketStatusOutputSchema = z.object({
|
|
|
1073
1084
|
});
|
|
1074
1085
|
export const jiraOrgGetJiraIssuesByQueryParamsSchema = z.object({
|
|
1075
1086
|
query: z.string().describe("The JQL query to execute"),
|
|
1076
|
-
limit: z
|
|
1087
|
+
limit: z
|
|
1088
|
+
.number()
|
|
1089
|
+
.describe("The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).")
|
|
1090
|
+
.optional(),
|
|
1077
1091
|
});
|
|
1078
1092
|
export const jiraOrgGetJiraIssuesByQueryOutputSchema = z.object({
|
|
1079
1093
|
results: z
|
|
@@ -1130,6 +1144,14 @@ export const jiraOrgGetJiraIssuesByQueryOutputSchema = z.object({
|
|
|
1130
1144
|
}))
|
|
1131
1145
|
.describe("The results of the Jira issues")
|
|
1132
1146
|
.optional(),
|
|
1147
|
+
total: z
|
|
1148
|
+
.number()
|
|
1149
|
+
.describe("The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.")
|
|
1150
|
+
.optional(),
|
|
1151
|
+
truncated: z
|
|
1152
|
+
.boolean()
|
|
1153
|
+
.describe("True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.")
|
|
1154
|
+
.optional(),
|
|
1133
1155
|
error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
|
|
1134
1156
|
});
|
|
1135
1157
|
export const jiraOrgLinkJiraIssuesParamsSchema = z.object({
|
|
@@ -1325,7 +1347,10 @@ export const jiraDataCenterUpdateJiraTicketStatusOutputSchema = z.object({
|
|
|
1325
1347
|
});
|
|
1326
1348
|
export const jiraDataCenterGetJiraIssuesByQueryParamsSchema = z.object({
|
|
1327
1349
|
query: z.string().describe("The JQL query to execute"),
|
|
1328
|
-
limit: z
|
|
1350
|
+
limit: z
|
|
1351
|
+
.number()
|
|
1352
|
+
.describe("The maximum number of records to retrieve. Defaults to 100. For exhaustive queries where all matching issues are needed, set this to a value larger than the expected result count (e.g. 500 or 1000).")
|
|
1353
|
+
.optional(),
|
|
1329
1354
|
});
|
|
1330
1355
|
export const jiraDataCenterGetJiraIssuesByQueryOutputSchema = z.object({
|
|
1331
1356
|
results: z
|
|
@@ -1382,6 +1407,14 @@ export const jiraDataCenterGetJiraIssuesByQueryOutputSchema = z.object({
|
|
|
1382
1407
|
}))
|
|
1383
1408
|
.describe("The results of the Jira issues")
|
|
1384
1409
|
.optional(),
|
|
1410
|
+
total: z
|
|
1411
|
+
.number()
|
|
1412
|
+
.describe("The total number of Jira issues matching the query. When present and greater than the number of results returned, re-run with a higher limit to retrieve all issues.")
|
|
1413
|
+
.optional(),
|
|
1414
|
+
truncated: z
|
|
1415
|
+
.boolean()
|
|
1416
|
+
.describe("True when the result set was cut off at the requested limit and more issues exist. Re-run with a higher limit to retrieve all issues.")
|
|
1417
|
+
.optional(),
|
|
1385
1418
|
error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
|
|
1386
1419
|
});
|
|
1387
1420
|
export const jiraDataCenterLinkJiraIssuesParamsSchema = z.object({
|
|
@@ -47,7 +47,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
47
47
|
name: item.name,
|
|
48
48
|
path: item.path,
|
|
49
49
|
sha: item.sha.slice(0, 7),
|
|
50
|
-
url: item.
|
|
50
|
+
url: item.url,
|
|
51
51
|
score: item.score,
|
|
52
52
|
textMatches: item.text_matches
|
|
53
53
|
? item.text_matches.map(match => {
|
|
@@ -68,7 +68,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
68
68
|
const full = commitDetails.find(c => c.data.sha === item.sha);
|
|
69
69
|
return {
|
|
70
70
|
sha: item.sha,
|
|
71
|
-
url: item.
|
|
71
|
+
url: item.url,
|
|
72
72
|
commit: {
|
|
73
73
|
message: item.commit.message,
|
|
74
74
|
author: item.commit.author,
|
|
@@ -76,11 +76,11 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
76
76
|
score: item.score,
|
|
77
77
|
author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
|
|
78
78
|
files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
|
|
79
|
-
var _a
|
|
79
|
+
var _a;
|
|
80
80
|
return ({
|
|
81
81
|
filename: f.filename,
|
|
82
82
|
status: f.status,
|
|
83
|
-
patch: (
|
|
83
|
+
patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
|
|
84
84
|
});
|
|
85
85
|
})) || [],
|
|
86
86
|
};
|
|
@@ -104,18 +104,18 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
|
104
104
|
const prIndex = prNumbers.indexOf(item.number);
|
|
105
105
|
const files = isPR && prIndex !== -1
|
|
106
106
|
? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
|
|
107
|
-
var _a
|
|
107
|
+
var _a;
|
|
108
108
|
return ({
|
|
109
109
|
filename: f.filename,
|
|
110
110
|
status: f.status,
|
|
111
|
-
patch: (
|
|
111
|
+
patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
|
|
112
112
|
});
|
|
113
113
|
})
|
|
114
114
|
: undefined;
|
|
115
115
|
return {
|
|
116
116
|
number: item.number,
|
|
117
117
|
title: item.title,
|
|
118
|
-
|
|
118
|
+
html_url: item.html_url,
|
|
119
119
|
state: item.state,
|
|
120
120
|
isPullRequest: isPR,
|
|
121
121
|
body: item.body,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
2
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
3
|
+
import { dedupeByIdKeepFirst, filterReadableFiles } from "./utils.js";
|
|
4
|
+
const ASSIGNED_COMMENTS_QUERY = "followup='assignedcomments' and trashed=false";
|
|
5
|
+
const listFilesWithAssignedComments = async ({ params, authParams, }) => {
|
|
6
|
+
if (!authParams.authToken) {
|
|
7
|
+
return { success: false, error: MISSING_AUTH_TOKEN, files: [] };
|
|
8
|
+
}
|
|
9
|
+
const { limit } = params;
|
|
10
|
+
try {
|
|
11
|
+
const allDrivesUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(ASSIGNED_COMMENTS_QUERY)}&fields=files(id,name,mimeType,webViewLink)&supportsAllDrives=true&includeItemsFromAllDrives=true&corpora=allDrives&pageSize=100`;
|
|
12
|
+
const orgWideUrl = `https://www.googleapis.com/drive/v3/files?q=${encodeURIComponent(ASSIGNED_COMMENTS_QUERY)}&fields=files(id,name,mimeType,webViewLink)&corpora=domain&pageSize=100`;
|
|
13
|
+
const [allDrivesRes, orgWideRes] = await Promise.all([
|
|
14
|
+
axiosClient.get(allDrivesUrl, { headers: { Authorization: `Bearer ${authParams.authToken}` } }),
|
|
15
|
+
axiosClient.get(orgWideUrl, { headers: { Authorization: `Bearer ${authParams.authToken}` } }),
|
|
16
|
+
]);
|
|
17
|
+
const rawFiles = [allDrivesRes.data.files, orgWideRes.data.files]
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
.flatMap(files => filterReadableFiles(files));
|
|
20
|
+
const files = rawFiles.map((file) => ({
|
|
21
|
+
id: file.id || "",
|
|
22
|
+
name: file.name || "",
|
|
23
|
+
mimeType: file.mimeType || "",
|
|
24
|
+
url: file.webViewLink || "",
|
|
25
|
+
}));
|
|
26
|
+
const dedupedFiles = dedupeByIdKeepFirst(files);
|
|
27
|
+
return {
|
|
28
|
+
success: true,
|
|
29
|
+
files: limit ? dedupedFiles.slice(0, limit) : dedupedFiles,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error("Error listing files with assigned comments", error);
|
|
34
|
+
return {
|
|
35
|
+
success: false,
|
|
36
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
37
|
+
files: [],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export default listFilesWithAssignedComments;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { jiraGetJiraIssuesByQueryFunction } from "../../autogen/types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Get Jira issues from Jira Data Center
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Get Jira issues from Jira Data Center using offset-based pagination (startAt).
|
|
4
|
+
* Returns `total` from the Jira API response so callers can detect truncation by
|
|
5
|
+
* comparing total > results.length. Does not return `truncated` — use `total` instead.
|
|
6
|
+
* (Contrast with the Cloud implementation which returns `truncated` but not `total`.)
|
|
6
7
|
*/
|
|
7
8
|
declare const getJiraDCIssuesByQuery: jiraGetJiraIssuesByQueryFunction;
|
|
8
9
|
export default getJiraDCIssuesByQuery;
|
|
@@ -2,9 +2,10 @@ import { axiosClient } from "../../util/axiosClient.js";
|
|
|
2
2
|
import { getJiraApiConfig, getErrorMessage, extractPlainText } from "./utils.js";
|
|
3
3
|
const DEFAULT_LIMIT = 100;
|
|
4
4
|
/**
|
|
5
|
-
* Get Jira issues from Jira Data Center
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Get Jira issues from Jira Data Center using offset-based pagination (startAt).
|
|
6
|
+
* Returns `total` from the Jira API response so callers can detect truncation by
|
|
7
|
+
* comparing total > results.length. Does not return `truncated` — use `total` instead.
|
|
8
|
+
* (Contrast with the Cloud implementation which returns `truncated` but not `total`.)
|
|
8
9
|
*/
|
|
9
10
|
const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
|
|
10
11
|
const { authToken } = authParams;
|
|
@@ -36,6 +37,7 @@ const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
36
37
|
const requestedLimit = limit ?? DEFAULT_LIMIT;
|
|
37
38
|
const allIssues = [];
|
|
38
39
|
let startAt = 0;
|
|
40
|
+
let jiraTotal = undefined;
|
|
39
41
|
try {
|
|
40
42
|
// Keep fetching pages until we have all requested issues
|
|
41
43
|
while (allIssues.length < requestedLimit) {
|
|
@@ -55,6 +57,7 @@ const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
55
57
|
},
|
|
56
58
|
});
|
|
57
59
|
const { issues, total } = response.data;
|
|
60
|
+
jiraTotal = total;
|
|
58
61
|
allIssues.push(...issues);
|
|
59
62
|
if (allIssues.length >= total || issues.length === 0) {
|
|
60
63
|
break;
|
|
@@ -62,6 +65,7 @@ const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
62
65
|
startAt += issues.length;
|
|
63
66
|
}
|
|
64
67
|
return {
|
|
68
|
+
total: jiraTotal,
|
|
65
69
|
results: allIssues.map(issue => {
|
|
66
70
|
const { id, key, fields } = issue;
|
|
67
71
|
const { summary, description, project, issuetype, status, assignee, reporter, creator, created, updated, resolution, duedate, } = fields;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Version3Client } from "jira.js";
|
|
2
2
|
import { getJiraApiConfig, getErrorMessage, extractPlainText, getUserInfoFromAccountId } from "./utils.js";
|
|
3
3
|
const DEFAULT_LIMIT = 100;
|
|
4
|
+
// Jira Cloud implementation using the enhanced search API (cursor-based pagination).
|
|
5
|
+
// Returns `truncated: true` when results were cut off at the limit and more pages exist.
|
|
6
|
+
// Note: the enhanced API does not expose a total count, so `total` is never returned here.
|
|
7
|
+
// Use `jiraDataCenter` provider if you need the exact total count.
|
|
4
8
|
const getJiraIssuesByQuery = async ({ params, authParams, }) => {
|
|
5
9
|
const { authToken, cloudId } = authParams;
|
|
6
10
|
const { query, limit } = params;
|
|
@@ -31,6 +35,7 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
31
35
|
const requestedLimit = limit ?? DEFAULT_LIMIT;
|
|
32
36
|
const allIssues = [];
|
|
33
37
|
let nextPageToken = undefined;
|
|
38
|
+
let truncated = false;
|
|
34
39
|
try {
|
|
35
40
|
// Initialize jira.js client with OAuth 2.0 authentication
|
|
36
41
|
const client = new Version3Client({
|
|
@@ -59,6 +64,8 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
59
64
|
allIssues.push(...searchResults.issues);
|
|
60
65
|
// Check if we've reached the end or have enough results
|
|
61
66
|
if (allIssues.length >= requestedLimit || !searchResults.nextPageToken || searchResults.issues.length === 0) {
|
|
67
|
+
// Truncated when we hit the limit but Jira still has more pages
|
|
68
|
+
truncated = allIssues.length >= requestedLimit && !!searchResults.nextPageToken;
|
|
62
69
|
break;
|
|
63
70
|
}
|
|
64
71
|
nextPageToken = searchResults.nextPageToken;
|
|
@@ -106,7 +113,7 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
|
|
|
106
113
|
},
|
|
107
114
|
};
|
|
108
115
|
}));
|
|
109
|
-
return { results };
|
|
116
|
+
return { results, truncated };
|
|
110
117
|
}
|
|
111
118
|
catch (error) {
|
|
112
119
|
console.error("Error retrieving Jira issues:", error);
|
|
@@ -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;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { getGraphClient } from "./utils.js";
|
|
11
|
+
const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
12
|
+
const { toRecipients, subject, body, ccRecipients, bccRecipients } = params;
|
|
13
|
+
let client = undefined;
|
|
14
|
+
try {
|
|
15
|
+
client = yield getGraphClient(authParams);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
error: "Error while authorizing: " + (error instanceof Error ? error.message : "Unknown error"),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const message = {
|
|
25
|
+
message: Object.assign(Object.assign({ subject, body: {
|
|
26
|
+
contentType: "HTML",
|
|
27
|
+
content: body,
|
|
28
|
+
}, toRecipients: toRecipients.map(email => ({ emailAddress: { address: email } })) }, (ccRecipients && ccRecipients.length > 0
|
|
29
|
+
? { ccRecipients: ccRecipients.map(email => ({ emailAddress: { address: email } })) }
|
|
30
|
+
: {})), (bccRecipients && bccRecipients.length > 0
|
|
31
|
+
? { bccRecipients: bccRecipients.map(email => ({ emailAddress: { address: email } })) }
|
|
32
|
+
: {})),
|
|
33
|
+
saveToSentItems: true,
|
|
34
|
+
};
|
|
35
|
+
yield client.api("/me/sendMail").post(message);
|
|
36
|
+
return {
|
|
37
|
+
success: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error(error);
|
|
42
|
+
return {
|
|
43
|
+
success: false,
|
|
44
|
+
error: "Error sending email: " + (error instanceof Error ? error.message : "Unknown error"),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export default sendEmail;
|
package/package.json
CHANGED
package/dist/actions/groups.d.ts
DELETED
package/dist/actions/groups.js
DELETED
|
@@ -1,251 +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, 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
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
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 { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
|
-
// Limits on the number of results to return
|
|
12
|
-
const MAX_CODE_RESULTS = 15;
|
|
13
|
-
const MAX_COMMITS = 10;
|
|
14
|
-
const MAX_FILES_PER_COMMIT = 5;
|
|
15
|
-
const MAX_ISSUES_OR_PRS = 10;
|
|
16
|
-
const MAX_FILES_PER_PR = 5;
|
|
17
|
-
const MAX_PATCH_LINES = 20;
|
|
18
|
-
const MAX_FRAGMENT_LINES = 20;
|
|
19
|
-
const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
20
|
-
const { Octokit } = yield import("octokit");
|
|
21
|
-
if (!authParams.authToken) {
|
|
22
|
-
throw new Error(MISSING_AUTH_TOKEN);
|
|
23
|
-
}
|
|
24
|
-
const octokit = new Octokit({ auth: authParams.authToken });
|
|
25
|
-
const { organization, repository, query } = params;
|
|
26
|
-
// Search CODE with text match metadata
|
|
27
|
-
const codeResultsResponse = yield octokit.rest.search.code({
|
|
28
|
-
q: `${query} in:file,path repo:${organization}/${repository}`,
|
|
29
|
-
text_match: true,
|
|
30
|
-
headers: {
|
|
31
|
-
accept: "application/vnd.github.v3.text-match+json",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
const codeResults = codeResultsResponse.data.items.slice(0, MAX_CODE_RESULTS).map(item => ({
|
|
35
|
-
name: item.name,
|
|
36
|
-
path: item.path,
|
|
37
|
-
sha: item.sha,
|
|
38
|
-
url: item.url,
|
|
39
|
-
repository: {
|
|
40
|
-
full_name: item.repository.full_name,
|
|
41
|
-
html_url: item.repository.html_url,
|
|
42
|
-
},
|
|
43
|
-
score: item.score,
|
|
44
|
-
textMatches: item.text_matches
|
|
45
|
-
? item.text_matches.map(match => {
|
|
46
|
-
var _a, _b, _c, _d;
|
|
47
|
-
return ({
|
|
48
|
-
object_url: (_a = match.object_url) !== null && _a !== void 0 ? _a : undefined,
|
|
49
|
-
object_type: (_b = match.object_type) !== null && _b !== void 0 ? _b : undefined,
|
|
50
|
-
fragment: (_c = match.fragment) === null || _c === void 0 ? void 0 : _c.split("\n").slice(0, MAX_FRAGMENT_LINES).join("\n"),
|
|
51
|
-
matches: (_d = match.matches) !== null && _d !== void 0 ? _d : [],
|
|
52
|
-
});
|
|
53
|
-
})
|
|
54
|
-
: [],
|
|
55
|
-
}));
|
|
56
|
-
// Search COMMITS
|
|
57
|
-
const commitResults = yield octokit.rest.search.commits({
|
|
58
|
-
q: `${query} repo:${organization}/${repository}`,
|
|
59
|
-
headers: {
|
|
60
|
-
accept: "application/vnd.github.cloak-preview+json",
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const commitSHAs = commitResults.data.items.slice(0, MAX_COMMITS).map(item => item.sha);
|
|
64
|
-
const commitDetails = yield Promise.all(commitSHAs.map(sha => octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha })));
|
|
65
|
-
const enrichedCommits = commitResults.data.items.slice(0, MAX_COMMITS).map(item => {
|
|
66
|
-
var _a, _b;
|
|
67
|
-
const full = commitDetails.find(c => c.data.sha === item.sha);
|
|
68
|
-
return {
|
|
69
|
-
sha: item.sha,
|
|
70
|
-
url: item.url,
|
|
71
|
-
commit: {
|
|
72
|
-
message: item.commit.message,
|
|
73
|
-
author: item.commit.author,
|
|
74
|
-
},
|
|
75
|
-
score: item.score,
|
|
76
|
-
author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
|
|
77
|
-
files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
|
|
78
|
-
var _a;
|
|
79
|
-
return ({
|
|
80
|
-
filename: f.filename,
|
|
81
|
-
status: f.status,
|
|
82
|
-
patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
|
|
83
|
-
});
|
|
84
|
-
})) || [],
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
// Search ISSUES & PRs
|
|
88
|
-
const issueResults = yield octokit.rest.search.issuesAndPullRequests({
|
|
89
|
-
q: `${query} repo:${organization}/${repository}`,
|
|
90
|
-
});
|
|
91
|
-
const prItems = issueResults.data.items.filter(item => item.pull_request).slice(0, MAX_ISSUES_OR_PRS);
|
|
92
|
-
const prNumbers = prItems.map(item => item.number);
|
|
93
|
-
const prFiles = yield Promise.all(prNumbers.map(number => octokit.rest.pulls.listFiles({ owner: organization, repo: repository, pull_number: number })));
|
|
94
|
-
const issuesAndPRs = issueResults.data.items
|
|
95
|
-
.slice(0, MAX_ISSUES_OR_PRS)
|
|
96
|
-
.map(item => {
|
|
97
|
-
var _a, _b, _c, _d;
|
|
98
|
-
const isPR = !!item.pull_request;
|
|
99
|
-
const prIndex = prNumbers.indexOf(item.number);
|
|
100
|
-
const files = isPR && prIndex !== -1
|
|
101
|
-
? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
|
|
102
|
-
var _a;
|
|
103
|
-
return ({
|
|
104
|
-
filename: f.filename,
|
|
105
|
-
status: f.status,
|
|
106
|
-
patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
|
|
107
|
-
});
|
|
108
|
-
})
|
|
109
|
-
: undefined;
|
|
110
|
-
return {
|
|
111
|
-
number: item.number,
|
|
112
|
-
title: item.title,
|
|
113
|
-
html_url: item.html_url,
|
|
114
|
-
state: item.state,
|
|
115
|
-
isPullRequest: isPR,
|
|
116
|
-
body: item.body,
|
|
117
|
-
user: {
|
|
118
|
-
email: (_b = (_a = item.user) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : undefined,
|
|
119
|
-
name: (_d = (_c = item.user) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined,
|
|
120
|
-
},
|
|
121
|
-
score: item.score,
|
|
122
|
-
files,
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
return {
|
|
126
|
-
code: codeResults,
|
|
127
|
-
commits: enrichedCommits,
|
|
128
|
-
issuesAndPullRequests: issuesAndPRs,
|
|
129
|
-
};
|
|
130
|
-
});
|
|
131
|
-
export default searchRepository;
|
|
@@ -1,41 +0,0 @@
|
|
|
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 { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
|
-
// Limits on the number of results to return
|
|
12
|
-
const MAX_CODE_RESULTS = 15;
|
|
13
|
-
const MAX_COMMITS = 10;
|
|
14
|
-
const MAX_FILES_PER_COMMIT = 5;
|
|
15
|
-
const MAX_ISSUES_OR_PRS = 10;
|
|
16
|
-
const MAX_FILES_PER_PR = 5;
|
|
17
|
-
const MAX_PATCH_LINES = 20;
|
|
18
|
-
const MAX_FRAGMENT_LINES = 20;
|
|
19
|
-
const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
20
|
-
const { Octokit } = yield import("octokit");
|
|
21
|
-
if (!authParams.authToken) {
|
|
22
|
-
throw new Error(MISSING_AUTH_TOKEN);
|
|
23
|
-
}
|
|
24
|
-
const octokit = new Octokit({ auth: authParams.authToken });
|
|
25
|
-
const { organization, repository, query } = params;
|
|
26
|
-
// Search CODE with text match metadata
|
|
27
|
-
const codeResultsResponse = yield octokit.rest.search.code({
|
|
28
|
-
q: `${query} in:file,path repo:${organization}/${repository}`,
|
|
29
|
-
text_match: true,
|
|
30
|
-
headers: {
|
|
31
|
-
accept: "application/vnd.github.v3.text-match+json",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
const commitResults = yield octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha });
|
|
35
|
-
return {
|
|
36
|
-
code: codeResults,
|
|
37
|
-
commits: enrichedCommits,
|
|
38
|
-
issuesAndPullRequests: issuesAndPRs,
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
export default searchRepository;
|
|
@@ -1,42 +0,0 @@
|
|
|
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 { WebClient } from "@slack/web-api";
|
|
11
|
-
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
-
import { getSlackChannels } from "./helpers.js";
|
|
13
|
-
const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
14
|
-
if (!authParams.authToken) {
|
|
15
|
-
throw new Error(MISSING_AUTH_TOKEN);
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
const client = new WebClient(authParams.authToken);
|
|
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 });
|
|
27
|
-
if (!result.ok) {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
error: result.error || "Unknown error archiving channel",
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return { success: true };
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
return {
|
|
37
|
-
success: false,
|
|
38
|
-
error: error instanceof Error ? error.message : "Unknown error archiving channel",
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
export default archiveChannel;
|