@credal/actions 0.2.198 → 0.2.200
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 +8 -1
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +65 -0
- package/dist/actions/autogen/types.d.ts +39 -0
- package/dist/actions/autogen/types.js +17 -0
- package/dist/actions/providers/googlemail/replyToGmail.d.ts +3 -0
- package/dist/actions/providers/googlemail/replyToGmail.js +89 -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/ashby/addCandidateToProject.d.ts +0 -3
- package/dist/actions/providers/ashby/addCandidateToProject.js +0 -31
- package/dist/actions/providers/ashby/createCandidate.d.ts +0 -3
- package/dist/actions/providers/ashby/createCandidate.js +0 -38
- package/dist/actions/providers/ashby/createNote.d.ts +0 -3
- package/dist/actions/providers/ashby/createNote.js +0 -31
- package/dist/actions/providers/ashby/getCandidateInfo.d.ts +0 -3
- package/dist/actions/providers/ashby/getCandidateInfo.js +0 -33
- package/dist/actions/providers/ashby/listCandidateNotes.d.ts +0 -3
- package/dist/actions/providers/ashby/listCandidateNotes.js +0 -33
- package/dist/actions/providers/ashby/listCandidates.d.ts +0 -3
- package/dist/actions/providers/ashby/listCandidates.js +0 -30
- package/dist/actions/providers/ashby/searchCandidates.d.ts +0 -3
- package/dist/actions/providers/ashby/searchCandidates.js +0 -34
- package/dist/actions/providers/ashby/updateCandidate.d.ts +0 -3
- package/dist/actions/providers/ashby/updateCandidate.js +0 -56
- 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/gong/getGongTranscripts.d.ts +0 -3
- package/dist/actions/providers/gong/getGongTranscripts.js +0 -315
- package/dist/actions/providers/jamf/getJamfComputerInventory.d.ts +0 -3
- package/dist/actions/providers/jamf/getJamfComputerInventory.js +0 -37
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.d.ts +0 -3
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +0 -39
- package/dist/actions/providers/jamf/getJamfUserComputerId.d.ts +0 -3
- package/dist/actions/providers/jamf/getJamfUserComputerId.js +0 -45
- package/dist/actions/providers/jamf/lockJamfComputerById.d.ts +0 -3
- package/dist/actions/providers/jamf/lockJamfComputerById.js +0 -39
- package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.d.ts +0 -3
- package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +0 -85
- package/dist/actions/providers/okta/addUserToGroup.d.ts +0 -3
- package/dist/actions/providers/okta/addUserToGroup.js +0 -56
- package/dist/actions/providers/okta/getOktaGroup.d.ts +0 -3
- package/dist/actions/providers/okta/getOktaGroup.js +0 -73
- package/dist/actions/providers/okta/getOktaUser.d.ts +0 -3
- package/dist/actions/providers/okta/getOktaUser.js +0 -40
- package/dist/actions/providers/okta/listMFA.d.ts +0 -3
- package/dist/actions/providers/okta/listMFA.js +0 -52
- package/dist/actions/providers/okta/listOktaGroupMembers.d.ts +0 -3
- package/dist/actions/providers/okta/listOktaGroupMembers.js +0 -99
- package/dist/actions/providers/okta/listOktaGroups.d.ts +0 -3
- package/dist/actions/providers/okta/listOktaGroups.js +0 -92
- package/dist/actions/providers/okta/listOktaUserGroups.d.ts +0 -3
- package/dist/actions/providers/okta/listOktaUserGroups.js +0 -83
- package/dist/actions/providers/okta/listOktaUsers.d.ts +0 -3
- package/dist/actions/providers/okta/listOktaUsers.js +0 -100
- package/dist/actions/providers/okta/removeUserFromGroup.d.ts +0 -3
- package/dist/actions/providers/okta/removeUserFromGroup.js +0 -56
- package/dist/actions/providers/okta/resetMFA.d.ts +0 -3
- package/dist/actions/providers/okta/resetMFA.js +0 -62
- package/dist/actions/providers/okta/resetPassword.d.ts +0 -3
- package/dist/actions/providers/okta/resetPassword.js +0 -57
- package/dist/actions/providers/okta/triggerOktaWorkflow.d.ts +0 -3
- package/dist/actions/providers/okta/triggerOktaWorkflow.js +0 -44
- package/dist/actions/providers/salesforce/fetchSalesforceSchema.d.ts +0 -3
- package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +0 -40
- package/dist/actions/providers/slack/archiveChannel.d.ts +0 -3
- package/dist/actions/providers/slack/archiveChannel.js +0 -42
|
@@ -1,62 +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 { AxiosError } from "axios";
|
|
11
|
-
import { axiosClient } from "../../util/axiosClient.js";
|
|
12
|
-
const resetMFA = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, params, }) {
|
|
13
|
-
var _b, _c;
|
|
14
|
-
const { authToken, baseUrl } = authParams;
|
|
15
|
-
if (!authToken || !baseUrl) {
|
|
16
|
-
return {
|
|
17
|
-
success: false,
|
|
18
|
-
error: "Missing Okta OAuth token (authToken) or base URL (baseUrl) in authParams.",
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
let endpointUrl;
|
|
23
|
-
let method;
|
|
24
|
-
if (params.factorId) {
|
|
25
|
-
endpointUrl = new URL(`/api/v1/users/${params.userId}/factors/${params.factorId}`, baseUrl).toString();
|
|
26
|
-
method = "DELETE";
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
endpointUrl = new URL(`/api/v1/users/${params.userId}/lifecycle/reset_factors`, baseUrl).toString();
|
|
30
|
-
method = "POST";
|
|
31
|
-
}
|
|
32
|
-
const requestConfig = {
|
|
33
|
-
headers: {
|
|
34
|
-
Authorization: `Bearer ${authToken}`,
|
|
35
|
-
Accept: "application/json",
|
|
36
|
-
"Content-Type": "application/json",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
const response = yield axiosClient.request(Object.assign({ url: endpointUrl, method, data: method === "POST" ? {} : undefined }, requestConfig));
|
|
40
|
-
if (response.status === 200 || (method === "DELETE" && response.status === 204)) {
|
|
41
|
-
return { success: true };
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const errorDetail = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.errorSummary) || ((_c = response.data) === null || _c === void 0 ? void 0 : _c.message) || `Okta API responded with status ${response.status}`;
|
|
45
|
-
return { success: false, error: `Failed to reset MFA factor(s): ${errorDetail}` };
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
console.error("Error resetting MFA:", error);
|
|
50
|
-
let errorMessage = "Unknown error while resetting MFA";
|
|
51
|
-
if (error instanceof AxiosError && error.response) {
|
|
52
|
-
const oktaError = error.response.data;
|
|
53
|
-
errorMessage =
|
|
54
|
-
(oktaError === null || oktaError === void 0 ? void 0 : oktaError.errorSummary) || (oktaError === null || oktaError === void 0 ? void 0 : oktaError.message) || `Okta API request failed with status ${error.response.status}`;
|
|
55
|
-
}
|
|
56
|
-
else if (error instanceof Error) {
|
|
57
|
-
errorMessage = error.message;
|
|
58
|
-
}
|
|
59
|
-
return { success: false, error: errorMessage };
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
export default resetMFA;
|
|
@@ -1,57 +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 { AxiosError } from "axios";
|
|
11
|
-
import { axiosClient } from "../../util/axiosClient.js";
|
|
12
|
-
const resetPassword = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, params, }) {
|
|
13
|
-
var _b, _c;
|
|
14
|
-
const { authToken, baseUrl } = authParams;
|
|
15
|
-
if (!authToken || !baseUrl) {
|
|
16
|
-
return {
|
|
17
|
-
success: false,
|
|
18
|
-
error: "Missing Okta OAuth token (authToken) or base URL (baseUrl) in authParams.",
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
const endpointUrl = new URL(`/api/v1/users/${params.userId}/lifecycle/reset_password`, baseUrl);
|
|
23
|
-
endpointUrl.searchParams.append("sendEmail", params.sendEmail.toString());
|
|
24
|
-
if (params.revokeSessions !== undefined) {
|
|
25
|
-
endpointUrl.searchParams.append("revokeSessions", params.revokeSessions.toString());
|
|
26
|
-
}
|
|
27
|
-
const requestConfig = {
|
|
28
|
-
headers: {
|
|
29
|
-
Authorization: `Bearer ${authToken}`,
|
|
30
|
-
Accept: "application/json",
|
|
31
|
-
"Content-Type": "application/json",
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
const response = yield axiosClient.post(endpointUrl.toString(), {}, requestConfig);
|
|
35
|
-
if (response.status === 200) {
|
|
36
|
-
return { success: true, resetPasswordUrl: response.data.resetPasswordUrl };
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const errorDetail = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.errorSummary) || ((_c = response.data) === null || _c === void 0 ? void 0 : _c.message) || `Okta API responded with status ${response.status}`;
|
|
40
|
-
return { success: false, error: `Failed to reset password: ${errorDetail}` };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
console.error("Error resetting password:", error);
|
|
45
|
-
let errorMessage = "Unknown error while resetting password";
|
|
46
|
-
if (error instanceof AxiosError && error.response) {
|
|
47
|
-
const oktaError = error.response.data;
|
|
48
|
-
errorMessage =
|
|
49
|
-
(oktaError === null || oktaError === void 0 ? void 0 : oktaError.errorSummary) || (oktaError === null || oktaError === void 0 ? void 0 : oktaError.message) || `Okta API request failed with status ${error.response.status}`;
|
|
50
|
-
}
|
|
51
|
-
else if (error instanceof Error) {
|
|
52
|
-
errorMessage = error.message;
|
|
53
|
-
}
|
|
54
|
-
return { success: false, error: errorMessage };
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
export default resetPassword;
|
|
@@ -1,44 +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 { ApiError, axiosClient } from "../../util/axiosClient.js";
|
|
11
|
-
const triggerOktaWorkflow = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, params, }) {
|
|
12
|
-
var _b, _c;
|
|
13
|
-
const { authToken, subdomain } = authParams;
|
|
14
|
-
const { workflowId, workflowParameters } = params;
|
|
15
|
-
if (!authToken || !subdomain) {
|
|
16
|
-
return { success: false, error: "Missing authToken or subdomain in authParams." };
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const requestConfig = {
|
|
20
|
-
headers: Object.assign({ Accept: "application/json", "Content-Type": "application/json" }, (authToken && { Authorization: `Bearer ${authToken}` })),
|
|
21
|
-
};
|
|
22
|
-
const workflowUrl = `https://${subdomain}.workflows.okta.com/api/flo/${workflowId}/invoke`;
|
|
23
|
-
const response = yield axiosClient.post(workflowUrl, workflowParameters !== null && workflowParameters !== void 0 ? workflowParameters : {}, requestConfig);
|
|
24
|
-
if (response.status >= 200 && response.status < 300) {
|
|
25
|
-
return { success: true, output: response.data };
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const errorDetail = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.errorSummary) || ((_c = response.data) === null || _c === void 0 ? void 0 : _c.message) || `Workflow responded with status ${response.status}`;
|
|
29
|
-
return { success: false, error: `Workflow trigger failed: ${errorDetail}` };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
let errorMessage = "Unknown error while triggering workflow";
|
|
34
|
-
if (error instanceof ApiError && error.data) {
|
|
35
|
-
const workflowError = error.data.error;
|
|
36
|
-
errorMessage = workflowError + ` Status: ${error.status}`;
|
|
37
|
-
}
|
|
38
|
-
else if (error instanceof Error) {
|
|
39
|
-
errorMessage = error.message;
|
|
40
|
-
}
|
|
41
|
-
return { success: false, error: errorMessage };
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export default triggerOktaWorkflow;
|
|
@@ -1,40 +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 { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
-
const fetchSalesforceSchemaByObject = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
12
|
-
const { authToken, baseUrl } = authParams;
|
|
13
|
-
const { objectType } = params;
|
|
14
|
-
if (!authToken || !baseUrl) {
|
|
15
|
-
return {
|
|
16
|
-
success: false,
|
|
17
|
-
error: "authToken and baseUrl are required for Salesforce API",
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const url = `${baseUrl}/services/data/v56.0/sobjects/${objectType}/describe/`;
|
|
21
|
-
try {
|
|
22
|
-
const response = yield axiosClient.get(url, {
|
|
23
|
-
headers: {
|
|
24
|
-
Authorization: `Bearer ${authToken}`,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
success: true,
|
|
29
|
-
schema: response.data.fields,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.error("Error retrieving Salesforce schema:", error);
|
|
34
|
-
return {
|
|
35
|
-
success: false,
|
|
36
|
-
error: error instanceof Error ? error.message : "An unknown error occurred",
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
export default fetchSalesforceSchemaByObject;
|
|
@@ -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;
|