@credal/actions 0.2.220 → 0.2.222

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.
Files changed (89) hide show
  1. package/dist/actions/actionMapper.js +31 -1
  2. package/dist/actions/autogen/templates.d.ts +4 -0
  3. package/dist/actions/autogen/templates.js +274 -0
  4. package/dist/actions/autogen/types.d.ts +261 -5
  5. package/dist/actions/autogen/types.js +106 -0
  6. package/dist/actions/groups.d.ts +6 -0
  7. package/dist/actions/groups.js +248 -0
  8. package/dist/actions/providers/ashby/addCandidateToProject.d.ts +3 -0
  9. package/dist/actions/providers/ashby/addCandidateToProject.js +31 -0
  10. package/dist/actions/providers/ashby/createCandidate.d.ts +3 -0
  11. package/dist/actions/providers/ashby/createCandidate.js +38 -0
  12. package/dist/actions/providers/ashby/createNote.d.ts +3 -0
  13. package/dist/actions/providers/ashby/createNote.js +31 -0
  14. package/dist/actions/providers/ashby/getCandidateInfo.d.ts +3 -0
  15. package/dist/actions/providers/ashby/getCandidateInfo.js +33 -0
  16. package/dist/actions/providers/ashby/listCandidateNotes.d.ts +3 -0
  17. package/dist/actions/providers/ashby/listCandidateNotes.js +33 -0
  18. package/dist/actions/providers/ashby/listCandidates.d.ts +3 -0
  19. package/dist/actions/providers/ashby/listCandidates.js +30 -0
  20. package/dist/actions/providers/ashby/searchCandidates.d.ts +3 -0
  21. package/dist/actions/providers/ashby/searchCandidates.js +34 -0
  22. package/dist/actions/providers/ashby/updateCandidate.d.ts +3 -0
  23. package/dist/actions/providers/ashby/updateCandidate.js +56 -0
  24. package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
  25. package/dist/actions/providers/credal/callCopilot.js +36 -0
  26. package/dist/actions/providers/gong/getGongTranscripts.d.ts +3 -0
  27. package/dist/actions/providers/gong/getGongTranscripts.js +315 -0
  28. package/dist/actions/providers/google-oauth/editAGoogleCalendarEvent.js +3 -1
  29. package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +16 -5
  30. package/dist/actions/providers/google-oauth/updateCalendarEvent.js +2 -0
  31. package/dist/actions/providers/jamf/getJamfComputerInventory.d.ts +3 -0
  32. package/dist/actions/providers/jamf/getJamfComputerInventory.js +37 -0
  33. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.d.ts +3 -0
  34. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +39 -0
  35. package/dist/actions/providers/jamf/getJamfUserComputerId.d.ts +3 -0
  36. package/dist/actions/providers/jamf/getJamfUserComputerId.js +45 -0
  37. package/dist/actions/providers/jamf/lockJamfComputerById.d.ts +3 -0
  38. package/dist/actions/providers/jamf/lockJamfComputerById.js +39 -0
  39. package/dist/actions/providers/jira/getJiraDCIssuesByQuery.js +3 -1
  40. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +3 -1
  41. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.d.ts +3 -0
  42. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +85 -0
  43. package/dist/actions/providers/math/index.d.ts +1 -0
  44. package/dist/actions/providers/math/index.js +37 -0
  45. package/dist/actions/providers/okta/addUserToGroup.d.ts +3 -0
  46. package/dist/actions/providers/okta/addUserToGroup.js +56 -0
  47. package/dist/actions/providers/okta/getOktaGroup.d.ts +3 -0
  48. package/dist/actions/providers/okta/getOktaGroup.js +73 -0
  49. package/dist/actions/providers/okta/getOktaUser.d.ts +3 -0
  50. package/dist/actions/providers/okta/getOktaUser.js +40 -0
  51. package/dist/actions/providers/okta/listMFA.d.ts +3 -0
  52. package/dist/actions/providers/okta/listMFA.js +52 -0
  53. package/dist/actions/providers/okta/listOktaGroupMembers.d.ts +3 -0
  54. package/dist/actions/providers/okta/listOktaGroupMembers.js +99 -0
  55. package/dist/actions/providers/okta/listOktaGroups.d.ts +3 -0
  56. package/dist/actions/providers/okta/listOktaGroups.js +92 -0
  57. package/dist/actions/providers/okta/listOktaUserGroups.d.ts +3 -0
  58. package/dist/actions/providers/okta/listOktaUserGroups.js +83 -0
  59. package/dist/actions/providers/okta/listOktaUsers.d.ts +3 -0
  60. package/dist/actions/providers/okta/listOktaUsers.js +100 -0
  61. package/dist/actions/providers/okta/removeUserFromGroup.d.ts +3 -0
  62. package/dist/actions/providers/okta/removeUserFromGroup.js +56 -0
  63. package/dist/actions/providers/okta/resetMFA.d.ts +3 -0
  64. package/dist/actions/providers/okta/resetMFA.js +62 -0
  65. package/dist/actions/providers/okta/resetPassword.d.ts +3 -0
  66. package/dist/actions/providers/okta/resetPassword.js +57 -0
  67. package/dist/actions/providers/okta/triggerOktaWorkflow.d.ts +3 -0
  68. package/dist/actions/providers/okta/triggerOktaWorkflow.js +44 -0
  69. package/dist/actions/providers/salesforce/fetchSalesforceSchema.d.ts +3 -0
  70. package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +40 -0
  71. package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +3 -0
  72. package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.js +43 -0
  73. package/dist/actions/providers/slack/archiveChannel.d.ts +3 -0
  74. package/dist/actions/providers/slack/archiveChannel.js +35 -0
  75. package/dist/actions/providers/slack/index.d.ts +1 -0
  76. package/dist/actions/providers/slack/index.js +37 -0
  77. package/dist/actions/providers/slack/listConversations.d.ts +3 -0
  78. package/dist/actions/providers/slack/listConversations.js +41 -0
  79. package/dist/actions/providers/smartsheet/addRowToSheet.d.ts +3 -0
  80. package/dist/actions/providers/smartsheet/addRowToSheet.js +34 -0
  81. package/dist/actions/providers/smartsheet/getSheetRows.d.ts +3 -0
  82. package/dist/actions/providers/smartsheet/getSheetRows.js +48 -0
  83. package/dist/actions/providers/smartsheet/listSheets.d.ts +3 -0
  84. package/dist/actions/providers/smartsheet/listSheets.js +26 -0
  85. package/dist/actions/providers/smartsheet/updateRow.d.ts +3 -0
  86. package/dist/actions/providers/smartsheet/updateRow.js +34 -0
  87. package/dist/actions/providers/smartsheet/utils.d.ts +33 -0
  88. package/dist/actions/providers/smartsheet/utils.js +45 -0
  89. package/package.json +2 -2
@@ -0,0 +1,35 @@
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
+ const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
+ if (!authParams.authToken) {
14
+ throw new Error(MISSING_AUTH_TOKEN);
15
+ }
16
+ try {
17
+ const client = new WebClient(authParams.authToken);
18
+ const { channelId } = params;
19
+ const result = yield client.conversations.archive({ channel: channelId });
20
+ if (!result.ok) {
21
+ return {
22
+ success: false,
23
+ error: result.error || "Unknown error archiving channel",
24
+ };
25
+ }
26
+ return { success: true };
27
+ }
28
+ catch (error) {
29
+ return {
30
+ success: false,
31
+ error: error instanceof Error ? error.message : "Unknown error archiving channel",
32
+ };
33
+ }
34
+ });
35
+ export default archiveChannel;
@@ -0,0 +1 @@
1
+ export * as listConversations from "./listConversations";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.listConversations = void 0;
37
+ exports.listConversations = __importStar(require("./listConversations"));
@@ -0,0 +1,3 @@
1
+ import type { slackListConversationsFunction } from "../../autogen/types";
2
+ declare const slackListConversations: slackListConversationsFunction;
3
+ export default slackListConversations;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const web_api_1 = require("@slack/web-api");
13
+ const helpers_1 = require("./helpers");
14
+ const slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
15
+ const client = new web_api_1.WebClient(authParams.authToken);
16
+ try {
17
+ const allChannels = yield (0, helpers_1.getSlackChannels)(client);
18
+ const filteredChannels = [];
19
+ for (const channel of allChannels) {
20
+ if (channel.name && channel.topic && channel.topic.value && channel.purpose && channel.purpose.value) {
21
+ const purpose = channel.purpose.value;
22
+ const topic = channel.topic.value;
23
+ const name = channel.name;
24
+ filteredChannels.push(Object.assign(Object.assign({}, channel), { purpose, topic, name }));
25
+ }
26
+ }
27
+ return {
28
+ channels: filteredChannels,
29
+ };
30
+ }
31
+ catch (error) {
32
+ if (error instanceof Error) {
33
+ // Enhance error with more context
34
+ throw new Error(`Failed to list Slack conversations: ${error.message}`);
35
+ }
36
+ else {
37
+ throw error;
38
+ }
39
+ }
40
+ });
41
+ exports.default = slackListConversations;
@@ -0,0 +1,3 @@
1
+ import type { smartsheetAddRowToSheetFunction } from "../../autogen/types.js";
2
+ declare const addRowToSheet: smartsheetAddRowToSheetFunction;
3
+ export default addRowToSheet;
@@ -0,0 +1,34 @@
1
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
2
+ import { getSmartsheetToken, resolveCellsByColumnTitle, smartsheetRequest } from "./utils.js";
3
+ const addRowToSheet = async ({ params, authParams, }) => {
4
+ const token = getSmartsheetToken(authParams);
5
+ if (!token)
6
+ throw new Error(MISSING_AUTH_TOKEN);
7
+ const { sheetId, cells, toTop } = params;
8
+ try {
9
+ const resolvedCells = await resolveCellsByColumnTitle(token, sheetId, cells);
10
+ if (resolvedCells.length === 0) {
11
+ return { success: false, error: "cells must contain at least one column title to value mapping" };
12
+ }
13
+ const response = await smartsheetRequest(`/sheets/${sheetId}/rows`, token, {
14
+ method: "POST",
15
+ body: {
16
+ ...(toTop ? { toTop: true } : { toBottom: true }),
17
+ cells: resolvedCells,
18
+ },
19
+ });
20
+ const createdRow = Array.isArray(response.result) ? response.result[0] : response.result;
21
+ return {
22
+ success: true,
23
+ rowId: createdRow ? String(createdRow.id) : undefined,
24
+ };
25
+ }
26
+ catch (error) {
27
+ console.error("Error adding row to Smartsheet sheet:", error);
28
+ return {
29
+ success: false,
30
+ error: error instanceof Error ? error.message : "Unknown error",
31
+ };
32
+ }
33
+ };
34
+ export default addRowToSheet;
@@ -0,0 +1,3 @@
1
+ import type { smartsheetGetSheetRowsFunction } from "../../autogen/types.js";
2
+ declare const getSheetRows: smartsheetGetSheetRowsFunction;
3
+ export default getSheetRows;
@@ -0,0 +1,48 @@
1
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
2
+ import { getSmartsheetToken, smartsheetRequest } from "./utils.js";
3
+ const getSheetRows = async ({ params, authParams, }) => {
4
+ const token = getSmartsheetToken(authParams);
5
+ if (!token)
6
+ throw new Error(MISSING_AUTH_TOKEN);
7
+ try {
8
+ const sheet = await smartsheetRequest(`/sheets/${params.sheetId}`, token);
9
+ const columnTitleById = new Map(sheet.columns.map(column => [column.id, column.title]));
10
+ return {
11
+ success: true,
12
+ sheet: {
13
+ id: String(sheet.id),
14
+ name: sheet.name,
15
+ permalink: sheet.permalink,
16
+ columns: sheet.columns.map(column => ({
17
+ id: String(column.id),
18
+ title: column.title,
19
+ type: column.type,
20
+ ...(column.options ? { options: column.options } : {}),
21
+ })),
22
+ rows: sheet.rows.map(row => {
23
+ const cells = {};
24
+ for (const cell of row.cells ?? []) {
25
+ const title = columnTitleById.get(cell.columnId);
26
+ const value = cell.displayValue ?? cell.value;
27
+ if (title && value !== undefined) {
28
+ cells[title] = value;
29
+ }
30
+ }
31
+ return {
32
+ id: String(row.id),
33
+ rowNumber: row.rowNumber,
34
+ cells,
35
+ };
36
+ }),
37
+ },
38
+ };
39
+ }
40
+ catch (error) {
41
+ console.error("Error getting Smartsheet sheet rows:", error);
42
+ return {
43
+ success: false,
44
+ error: error instanceof Error ? error.message : "Unknown error",
45
+ };
46
+ }
47
+ };
48
+ export default getSheetRows;
@@ -0,0 +1,3 @@
1
+ import type { smartsheetListSheetsFunction } from "../../autogen/types.js";
2
+ declare const listSheets: smartsheetListSheetsFunction;
3
+ export default listSheets;
@@ -0,0 +1,26 @@
1
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
2
+ import { getSmartsheetToken, smartsheetRequest } from "./utils.js";
3
+ const listSheets = async ({ authParams, }) => {
4
+ const token = getSmartsheetToken(authParams);
5
+ if (!token)
6
+ throw new Error(MISSING_AUTH_TOKEN);
7
+ try {
8
+ const response = await smartsheetRequest("/sheets?includeAll=true", token);
9
+ return {
10
+ success: true,
11
+ sheets: response.data.map(sheet => ({
12
+ id: String(sheet.id),
13
+ name: sheet.name,
14
+ permalink: sheet.permalink,
15
+ })),
16
+ };
17
+ }
18
+ catch (error) {
19
+ console.error("Error listing Smartsheet sheets:", error);
20
+ return {
21
+ success: false,
22
+ error: error instanceof Error ? error.message : "Unknown error",
23
+ };
24
+ }
25
+ };
26
+ export default listSheets;
@@ -0,0 +1,3 @@
1
+ import type { smartsheetUpdateRowFunction } from "../../autogen/types.js";
2
+ declare const updateRow: smartsheetUpdateRowFunction;
3
+ export default updateRow;
@@ -0,0 +1,34 @@
1
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
2
+ import { getSmartsheetToken, resolveCellsByColumnTitle, smartsheetRequest } from "./utils.js";
3
+ const updateRow = async ({ params, authParams, }) => {
4
+ const token = getSmartsheetToken(authParams);
5
+ if (!token)
6
+ throw new Error(MISSING_AUTH_TOKEN);
7
+ const { sheetId, rowId, cells } = params;
8
+ try {
9
+ const resolvedCells = await resolveCellsByColumnTitle(token, sheetId, cells);
10
+ if (resolvedCells.length === 0) {
11
+ return { success: false, error: "cells must contain at least one column title to value mapping" };
12
+ }
13
+ const response = await smartsheetRequest(`/sheets/${sheetId}/rows`, token, {
14
+ method: "PUT",
15
+ body: {
16
+ id: Number(rowId),
17
+ cells: resolvedCells,
18
+ },
19
+ });
20
+ const updatedRow = Array.isArray(response.result) ? response.result[0] : response.result;
21
+ return {
22
+ success: true,
23
+ rowId: updatedRow ? String(updatedRow.id) : String(rowId),
24
+ };
25
+ }
26
+ catch (error) {
27
+ console.error("Error updating row in Smartsheet sheet:", error);
28
+ return {
29
+ success: false,
30
+ error: error instanceof Error ? error.message : "Unknown error",
31
+ };
32
+ }
33
+ };
34
+ export default updateRow;
@@ -0,0 +1,33 @@
1
+ export type SmartsheetColumn = {
2
+ id: number;
3
+ title: string;
4
+ type: string;
5
+ options?: string[];
6
+ };
7
+ export type SmartsheetCell = {
8
+ columnId: number;
9
+ value?: string | number | boolean;
10
+ displayValue?: string;
11
+ };
12
+ export type SmartsheetRow = {
13
+ id: number;
14
+ rowNumber: number;
15
+ cells?: SmartsheetCell[];
16
+ };
17
+ export declare function getSmartsheetToken(authParams: {
18
+ apiKey?: string;
19
+ authToken?: string;
20
+ }): string | undefined;
21
+ export declare function smartsheetRequest<T>(path: string, token: string, init?: {
22
+ method?: string;
23
+ body?: unknown;
24
+ }): Promise<T>;
25
+ /**
26
+ * Resolves a { "Column Title": value } map to the cell objects the Smartsheet API expects,
27
+ * which address cells by numeric columnId.
28
+ */
29
+ export declare function resolveCellsByColumnTitle(token: string, sheetId: string, cellsByTitle: Record<string, unknown>): Promise<Array<{
30
+ columnId: number;
31
+ value: string | number | boolean;
32
+ strict: boolean;
33
+ }>>;
@@ -0,0 +1,45 @@
1
+ const SMARTSHEET_API_BASE = "https://api.smartsheet.com/2.0";
2
+ export function getSmartsheetToken(authParams) {
3
+ return authParams.apiKey ?? authParams.authToken;
4
+ }
5
+ export async function smartsheetRequest(path, token, init) {
6
+ const response = await fetch(`${SMARTSHEET_API_BASE}${path}`, {
7
+ method: init?.method ?? "GET",
8
+ headers: {
9
+ Authorization: `Bearer ${token}`,
10
+ "Content-Type": "application/json",
11
+ },
12
+ body: init?.body !== undefined ? JSON.stringify(init.body) : undefined,
13
+ });
14
+ const data = await response.json().catch(() => undefined);
15
+ if (!response.ok) {
16
+ const message = data && typeof data === "object" && "message" in data
17
+ ? data.message
18
+ : response.statusText;
19
+ throw new Error(`Smartsheet API error (status ${response.status}): ${message}`);
20
+ }
21
+ return data;
22
+ }
23
+ /**
24
+ * Resolves a { "Column Title": value } map to the cell objects the Smartsheet API expects,
25
+ * which address cells by numeric columnId.
26
+ */
27
+ export async function resolveCellsByColumnTitle(token, sheetId, cellsByTitle) {
28
+ const columnsResponse = await smartsheetRequest(`/sheets/${sheetId}/columns?includeAll=true`, token);
29
+ const columns = columnsResponse.data;
30
+ if (!Array.isArray(columns)) {
31
+ throw new Error(`Could not read columns for sheet "${sheetId}": the Smartsheet API returned an unexpected response shape.`);
32
+ }
33
+ const columnIdByTitle = new Map(columns.map(column => [column.title, column.id]));
34
+ return Object.entries(cellsByTitle).map(([title, value]) => {
35
+ const columnId = columnIdByTitle.get(title);
36
+ if (columnId === undefined) {
37
+ throw new Error(`Column "${title}" does not exist in this sheet. Valid column titles are: ${columns.map(column => `"${column.title}"`).join(", ")}`);
38
+ }
39
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
40
+ throw new Error(`Cell value for column "${title}" must be a string, number, or boolean`);
41
+ }
42
+ // strict: false lets Smartsheet coerce values (e.g. numbers into TEXT_NUMBER columns)
43
+ return { columnId, value, strict: false };
44
+ });
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.220",
3
+ "version": "0.2.222",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -87,7 +87,7 @@
87
87
  },
88
88
  "overrides": {
89
89
  "@xmldom/xmldom": "^0.8.13",
90
- "axios": "^1.15.2",
90
+ "axios": "^1.17.0",
91
91
  "fast-xml-parser": "^5.7.0",
92
92
  "minimatch": "^10.2.1",
93
93
  "file-type": "^22.0.0"