@credal/actions 0.2.218 → 0.2.220

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 (72) hide show
  1. package/dist/actions/actionMapper.js +10 -3
  2. package/dist/actions/autogen/templates.d.ts +1 -0
  3. package/dist/actions/autogen/templates.js +69 -29
  4. package/dist/actions/autogen/types.d.ts +48 -21
  5. package/dist/actions/autogen/types.js +33 -29
  6. package/dist/actions/providers/confluenceDataCenter/createPage.d.ts +3 -0
  7. package/dist/actions/providers/confluenceDataCenter/createPage.js +40 -0
  8. package/dist/actions/providers/github/searchRepository.js +7 -7
  9. package/dist/actions/providers/jira/getJiraDCIssuesByQuery.d.ts +2 -7
  10. package/dist/actions/providers/jira/getJiraDCIssuesByQuery.js +5 -18
  11. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +14 -15
  12. package/package.json +1 -1
  13. package/dist/actions/providers/ashby/addCandidateToProject.d.ts +0 -3
  14. package/dist/actions/providers/ashby/addCandidateToProject.js +0 -31
  15. package/dist/actions/providers/ashby/createCandidate.d.ts +0 -3
  16. package/dist/actions/providers/ashby/createCandidate.js +0 -38
  17. package/dist/actions/providers/ashby/createNote.d.ts +0 -3
  18. package/dist/actions/providers/ashby/createNote.js +0 -31
  19. package/dist/actions/providers/ashby/getCandidateInfo.d.ts +0 -3
  20. package/dist/actions/providers/ashby/getCandidateInfo.js +0 -33
  21. package/dist/actions/providers/ashby/listCandidateNotes.d.ts +0 -3
  22. package/dist/actions/providers/ashby/listCandidateNotes.js +0 -33
  23. package/dist/actions/providers/ashby/listCandidates.d.ts +0 -3
  24. package/dist/actions/providers/ashby/listCandidates.js +0 -30
  25. package/dist/actions/providers/ashby/searchCandidates.d.ts +0 -3
  26. package/dist/actions/providers/ashby/searchCandidates.js +0 -34
  27. package/dist/actions/providers/ashby/updateCandidate.d.ts +0 -3
  28. package/dist/actions/providers/ashby/updateCandidate.js +0 -56
  29. package/dist/actions/providers/gong/getGongTranscripts.d.ts +0 -3
  30. package/dist/actions/providers/gong/getGongTranscripts.js +0 -315
  31. package/dist/actions/providers/google-oauth/listFilesWithAssignedComments.d.ts +0 -3
  32. package/dist/actions/providers/google-oauth/listFilesWithAssignedComments.js +0 -41
  33. package/dist/actions/providers/jamf/getJamfComputerInventory.d.ts +0 -3
  34. package/dist/actions/providers/jamf/getJamfComputerInventory.js +0 -37
  35. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.d.ts +0 -3
  36. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +0 -39
  37. package/dist/actions/providers/jamf/getJamfUserComputerId.d.ts +0 -3
  38. package/dist/actions/providers/jamf/getJamfUserComputerId.js +0 -45
  39. package/dist/actions/providers/jamf/lockJamfComputerById.d.ts +0 -3
  40. package/dist/actions/providers/jamf/lockJamfComputerById.js +0 -39
  41. package/dist/actions/providers/jira/updateServiceDeskRequest.d.ts +0 -3
  42. package/dist/actions/providers/jira/updateServiceDeskRequest.js +0 -72
  43. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.d.ts +0 -3
  44. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +0 -85
  45. package/dist/actions/providers/microsoft/sendOutlookEmail.d.ts +0 -3
  46. package/dist/actions/providers/microsoft/sendOutlookEmail.js +0 -48
  47. package/dist/actions/providers/okta/addUserToGroup.d.ts +0 -3
  48. package/dist/actions/providers/okta/addUserToGroup.js +0 -56
  49. package/dist/actions/providers/okta/getOktaGroup.d.ts +0 -3
  50. package/dist/actions/providers/okta/getOktaGroup.js +0 -73
  51. package/dist/actions/providers/okta/getOktaUser.d.ts +0 -3
  52. package/dist/actions/providers/okta/getOktaUser.js +0 -40
  53. package/dist/actions/providers/okta/listMFA.d.ts +0 -3
  54. package/dist/actions/providers/okta/listMFA.js +0 -52
  55. package/dist/actions/providers/okta/listOktaGroupMembers.d.ts +0 -3
  56. package/dist/actions/providers/okta/listOktaGroupMembers.js +0 -99
  57. package/dist/actions/providers/okta/listOktaGroups.d.ts +0 -3
  58. package/dist/actions/providers/okta/listOktaGroups.js +0 -92
  59. package/dist/actions/providers/okta/listOktaUserGroups.d.ts +0 -3
  60. package/dist/actions/providers/okta/listOktaUserGroups.js +0 -83
  61. package/dist/actions/providers/okta/listOktaUsers.d.ts +0 -3
  62. package/dist/actions/providers/okta/listOktaUsers.js +0 -100
  63. package/dist/actions/providers/okta/removeUserFromGroup.d.ts +0 -3
  64. package/dist/actions/providers/okta/removeUserFromGroup.js +0 -56
  65. package/dist/actions/providers/okta/resetMFA.d.ts +0 -3
  66. package/dist/actions/providers/okta/resetMFA.js +0 -62
  67. package/dist/actions/providers/okta/resetPassword.d.ts +0 -3
  68. package/dist/actions/providers/okta/resetPassword.js +0 -57
  69. package/dist/actions/providers/okta/triggerOktaWorkflow.d.ts +0 -3
  70. package/dist/actions/providers/okta/triggerOktaWorkflow.js +0 -44
  71. package/dist/actions/providers/salesforce/fetchSalesforceSchema.d.ts +0 -3
  72. package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +0 -40
@@ -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.url,
50
+ url: item.html_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.url,
71
+ url: item.html_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, _b, _c;
80
80
  return ({
81
81
  filename: f.filename,
82
82
  status: f.status,
83
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
83
+ patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.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, _b, _c;
108
108
  return ({
109
109
  filename: f.filename,
110
110
  status: f.status,
111
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
111
+ patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
112
112
  });
113
113
  })
114
114
  : undefined;
115
115
  return {
116
116
  number: item.number,
117
117
  title: item.title,
118
- html_url: item.html_url,
118
+ url: item.html_url,
119
119
  state: item.state,
120
120
  isPullRequest: isPR,
121
121
  body: item.body,
@@ -1,8 +1,3 @@
1
- import type { jiraGetJiraIssuesByQueryFunction } from "../../autogen/types.js";
2
- /**
3
- * Get Jira issues from Jira Data Center using offset-based pagination (startAt).
4
- * Returns `itemsReturned` and `truncated` so agents can page through results by
5
- * incrementing startAt by itemsReturned each call until truncated is false.
6
- */
7
- declare const getJiraDCIssuesByQuery: jiraGetJiraIssuesByQueryFunction;
1
+ import type { jiraDataCenterGetJiraIssuesByQueryFunction } from "../../autogen/types.js";
2
+ declare const getJiraDCIssuesByQuery: jiraDataCenterGetJiraIssuesByQueryFunction;
8
3
  export default getJiraDCIssuesByQuery;
@@ -1,14 +1,9 @@
1
1
  import { axiosClient } from "../../util/axiosClient.js";
2
2
  import { getJiraApiConfig, getErrorMessage, extractPlainText } from "./utils.js";
3
3
  const DEFAULT_LIMIT = 100;
4
- /**
5
- * Get Jira issues from Jira Data Center using offset-based pagination (startAt).
6
- * Returns `itemsReturned` and `truncated` so agents can page through results by
7
- * incrementing startAt by itemsReturned each call until truncated is false.
8
- */
9
4
  const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
10
5
  const { authToken } = authParams;
11
- const { query, limit, startAt: paramStartAt } = params;
6
+ const { query, limit } = params;
12
7
  const { apiUrl, browseUrl, strategy } = getJiraApiConfig(authParams);
13
8
  if (!authToken) {
14
9
  throw new Error("Auth token is required");
@@ -35,18 +30,15 @@ const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
35
30
  const searchEndpoint = strategy.getSearchEndpoint();
36
31
  const requestedLimit = limit ?? DEFAULT_LIMIT;
37
32
  const allIssues = [];
38
- let currentStartAt = paramStartAt ?? 0;
39
- let jiraTotal = undefined;
33
+ let startAt = 0;
40
34
  try {
41
- // Keep fetching pages until we have all requested issues
42
35
  while (allIssues.length < requestedLimit) {
43
- // Calculate how many results to fetch in this request
44
36
  const remainingIssues = requestedLimit - allIssues.length;
45
37
  const maxResults = Math.min(remainingIssues, DEFAULT_LIMIT);
46
38
  const queryParams = new URLSearchParams();
47
39
  queryParams.set("jql", query);
48
40
  queryParams.set("maxResults", String(maxResults));
49
- queryParams.set("startAt", String(currentStartAt));
41
+ queryParams.set("startAt", String(startAt));
50
42
  queryParams.set("fields", fields.join(","));
51
43
  const fullApiUrl = `${apiUrl}${searchEndpoint}?${queryParams.toString()}`;
52
44
  const response = await axiosClient.get(fullApiUrl, {
@@ -56,18 +48,13 @@ const getJiraDCIssuesByQuery = async ({ params, authParams, }) => {
56
48
  },
57
49
  });
58
50
  const { issues, total } = response.data;
59
- jiraTotal = total;
60
51
  allIssues.push(...issues);
61
- if ((paramStartAt ?? 0) + allIssues.length >= total || issues.length === 0) {
52
+ if (allIssues.length >= total || issues.length === 0) {
62
53
  break;
63
54
  }
64
- currentStartAt += issues.length;
55
+ startAt += issues.length;
65
56
  }
66
- const absoluteEnd = (paramStartAt ?? 0) + allIssues.length;
67
- const truncated = jiraTotal !== undefined && absoluteEnd < jiraTotal;
68
57
  return {
69
- itemsReturned: allIssues.length,
70
- truncated,
71
58
  results: allIssues.map(issue => {
72
59
  const { id, key, fields } = issue;
73
60
  const { summary, description, project, issuetype, status, assignee, reporter, creator, created, updated, resolution, duedate, } = fields;
@@ -2,11 +2,9 @@ import { Version3Client } from "jira.js";
2
2
  import { axiosClient } from "../../util/axiosClient.js";
3
3
  import { getJiraApiConfig, getErrorMessage, extractPlainText, getUserInfoFromAccountId } from "./utils.js";
4
4
  const DEFAULT_LIMIT = 100;
5
- // Jira Cloud implementation using the legacy offset-based search API (/rest/api/3/search).
6
- // Uses startAt for pagination so agents can resume from any offset even when app-layer truncation occurs.
7
5
  const getJiraIssuesByQuery = async ({ params, authParams, }) => {
8
6
  const { authToken, cloudId } = authParams;
9
- const { query, limit, startAt: paramStartAt } = params;
7
+ const { query, limit, nextPageToken: paramNextPageToken } = params;
10
8
  const { browseUrl } = getJiraApiConfig(authParams);
11
9
  if (!authToken)
12
10
  throw new Error("Auth token is required");
@@ -33,9 +31,7 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
33
31
  ];
34
32
  const requestedLimit = limit ?? DEFAULT_LIMIT;
35
33
  const allIssues = [];
36
- let currentStartAt = paramStartAt ?? 0;
37
- let jiraTotal = undefined;
38
- // jira.js client is kept solely for getUserInfoFromAccountId (user email lookups)
34
+ let currentNextPageToken = paramNextPageToken;
39
35
  const client = new Version3Client({
40
36
  host: `https://api.atlassian.com/ex/jira/${cloudId}`,
41
37
  authentication: { oauth2: { accessToken: authToken } },
@@ -47,19 +43,18 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
47
43
  const queryParams = new URLSearchParams();
48
44
  queryParams.set("jql", query);
49
45
  queryParams.set("maxResults", String(maxResults));
50
- queryParams.set("startAt", String(currentStartAt));
51
46
  queryParams.set("fields", fields.join(","));
52
- const response = await axiosClient.get(`https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/search?${queryParams.toString()}`, { headers: { Authorization: `Bearer ${authToken}`, Accept: "application/json" } });
53
- const { issues, total } = response.data;
54
- jiraTotal = total;
47
+ if (currentNextPageToken) {
48
+ queryParams.set("nextPageToken", currentNextPageToken);
49
+ }
50
+ const response = await axiosClient.get(`https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/search/jql?${queryParams.toString()}`, { headers: { Authorization: `Bearer ${authToken}`, Accept: "application/json" } });
51
+ const { issues, nextPageToken } = response.data;
55
52
  allIssues.push(...issues);
56
- if ((paramStartAt ?? 0) + allIssues.length >= total || issues.length === 0) {
53
+ currentNextPageToken = nextPageToken;
54
+ if (!nextPageToken || issues.length === 0) {
57
55
  break;
58
56
  }
59
- currentStartAt += issues.length;
60
57
  }
61
- const absoluteEnd = (paramStartAt ?? 0) + allIssues.length;
62
- const truncated = jiraTotal !== undefined && absoluteEnd < jiraTotal;
63
58
  const results = await Promise.all(allIssues.map(async ({ id, key, fields }) => {
64
59
  const ticketUrl = `${browseUrl}/browse/${key}`;
65
60
  const { summary, description, project, issuetype, status, assignee, reporter, creator, created, updated, resolution, duedate, } = fields;
@@ -90,7 +85,11 @@ const getJiraIssuesByQuery = async ({ params, authParams, }) => {
90
85
  },
91
86
  };
92
87
  }));
93
- return { itemsReturned: allIssues.length, truncated, results };
88
+ return {
89
+ itemsReturned: allIssues.length,
90
+ nextPageToken: currentNextPageToken,
91
+ results,
92
+ };
94
93
  }
95
94
  catch (error) {
96
95
  console.error("Error retrieving Jira issues:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.218",
3
+ "version": "0.2.220",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- import type { ashbyAddCandidateToProjectFunction } from "../../autogen/types.js";
2
- declare const addCandidateToProject: ashbyAddCandidateToProjectFunction;
3
- export default addCandidateToProject;
@@ -1,31 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const addCandidateToProject = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { candidateId, projectId } = params;
14
- const { authToken } = authParams;
15
- if (!authToken) {
16
- throw new Error(MISSING_AUTH_TOKEN);
17
- }
18
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.addProject`, {
19
- candidateId,
20
- projectId,
21
- }, {
22
- auth: {
23
- username: authToken,
24
- password: "",
25
- },
26
- });
27
- if (!response.data.success) {
28
- throw new Error(response.data.errors.join("; "));
29
- }
30
- });
31
- export default addCandidateToProject;
@@ -1,3 +0,0 @@
1
- import type { ashbyCreateCandidateFunction } from "../../autogen/types.js";
2
- declare const createCandidate: ashbyCreateCandidateFunction;
3
- export default createCandidate;
@@ -1,38 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const createCandidate = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { authToken } = authParams;
14
- if (!authToken) {
15
- throw new Error(MISSING_AUTH_TOKEN);
16
- }
17
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.create`, {
18
- name: params.name,
19
- email: params.email,
20
- phoneNumber: params.phoneNumber,
21
- linkedInUrl: params.linkedInUrl,
22
- githubUrl: params.githubUrl,
23
- website: params.website,
24
- alternateEmailAddresses: params.alternateEmailAddresses,
25
- sourceId: params.sourceId,
26
- creditedToUserId: params.creditedToUserId,
27
- location: params.location,
28
- }, {
29
- auth: {
30
- username: authToken,
31
- password: "",
32
- },
33
- });
34
- if (!response.data.success) {
35
- throw new Error(response.data.errors.join("; "));
36
- }
37
- });
38
- export default createCandidate;
@@ -1,3 +0,0 @@
1
- import type { ashbyCreateNoteFunction } from "../../autogen/types.js";
2
- declare const createNote: ashbyCreateNoteFunction;
3
- export default createNote;
@@ -1,31 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const createNote = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { candidateId, note } = params;
14
- const { authToken } = authParams;
15
- if (!authToken) {
16
- throw new Error(MISSING_AUTH_TOKEN);
17
- }
18
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.createNote`, {
19
- candidateId,
20
- note,
21
- }, {
22
- auth: {
23
- username: authToken,
24
- password: "",
25
- },
26
- });
27
- if (!response.data.success) {
28
- throw new Error(response.data.errors.join("; "));
29
- }
30
- });
31
- export default createNote;
@@ -1,3 +0,0 @@
1
- import type { ashbyGetCandidateInfoFunction } from "../../autogen/types.js";
2
- declare const getCandidateInfo: ashbyGetCandidateInfoFunction;
3
- export default getCandidateInfo;
@@ -1,33 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const getCandidateInfo = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { candidateId } = params;
14
- const { authToken } = authParams;
15
- if (!authToken) {
16
- throw new Error(MISSING_AUTH_TOKEN);
17
- }
18
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.info`, {
19
- id: candidateId,
20
- }, {
21
- auth: {
22
- username: authToken,
23
- password: "",
24
- },
25
- });
26
- if (!response.data.success) {
27
- throw new Error(response.data.errors.join("; "));
28
- }
29
- return {
30
- candidate: response.data,
31
- };
32
- });
33
- export default getCandidateInfo;
@@ -1,3 +0,0 @@
1
- import type { ashbyListCandidateNotesFunction } from "../../autogen/types.js";
2
- declare const listCandidateNotes: ashbyListCandidateNotesFunction;
3
- export default listCandidateNotes;
@@ -1,33 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const listCandidateNotes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { candidateId } = params;
14
- const { authToken } = authParams;
15
- if (!authToken) {
16
- throw new Error(MISSING_AUTH_TOKEN);
17
- }
18
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.listNotes`, {
19
- candidateId,
20
- }, {
21
- auth: {
22
- username: authToken,
23
- password: "",
24
- },
25
- });
26
- if (!response.data.success) {
27
- throw new Error(response.data.errors.join("; "));
28
- }
29
- return {
30
- notes: response.data.results,
31
- };
32
- });
33
- export default listCandidateNotes;
@@ -1,3 +0,0 @@
1
- import type { ashbyListCandidatesFunction } from "../../autogen/types.js";
2
- declare const listCandidates: ashbyListCandidatesFunction;
3
- export default listCandidates;
@@ -1,30 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const listCandidates = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
13
- const { authToken } = authParams;
14
- if (!authToken) {
15
- throw new Error(MISSING_AUTH_TOKEN);
16
- }
17
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.list`, null, {
18
- auth: {
19
- username: authToken,
20
- password: "",
21
- },
22
- });
23
- if (!response.data.success) {
24
- throw new Error(response.data.errors.join("; "));
25
- }
26
- return {
27
- candidates: response.data.results,
28
- };
29
- });
30
- export default listCandidates;
@@ -1,3 +0,0 @@
1
- import type { ashbySearchCandidatesFunction } from "../../autogen/types.js";
2
- declare const searchCandidates: ashbySearchCandidatesFunction;
3
- export default searchCandidates;
@@ -1,34 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const searchCandidates = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { email, name } = params;
14
- const { authToken } = authParams;
15
- if (!authToken) {
16
- throw new Error(MISSING_AUTH_TOKEN);
17
- }
18
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.search`, {
19
- email,
20
- name,
21
- }, {
22
- auth: {
23
- username: authToken,
24
- password: "",
25
- },
26
- });
27
- if (!response.data.success) {
28
- throw new Error(response.data.errors.join("; "));
29
- }
30
- return {
31
- candidates: response.data.results,
32
- };
33
- });
34
- export default searchCandidates;
@@ -1,3 +0,0 @@
1
- import type { ashbyUpdateCandidateFunction } from "../../autogen/types.js";
2
- declare const updateCandidate: ashbyUpdateCandidateFunction;
3
- export default updateCandidate;
@@ -1,56 +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
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const updateCandidate = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- const { authToken } = authParams;
14
- if (!authToken) {
15
- throw new Error(MISSING_AUTH_TOKEN);
16
- }
17
- const body = {
18
- candidateId: params.candidateId,
19
- };
20
- if (params.name !== undefined)
21
- body.name = params.name;
22
- if (params.email !== undefined)
23
- body.email = params.email;
24
- if (params.phoneNumber !== undefined)
25
- body.phoneNumber = params.phoneNumber;
26
- if (params.linkedInUrl !== undefined)
27
- body.linkedInUrl = params.linkedInUrl;
28
- if (params.githubUrl !== undefined)
29
- body.githubUrl = params.githubUrl;
30
- if (params.websiteUrl !== undefined)
31
- body.websiteUrl = params.websiteUrl;
32
- if (params.alternateEmail !== undefined)
33
- body.alternateEmail = params.alternateEmail;
34
- if (params.socialLinks !== undefined)
35
- body.socialLinks = params.socialLinks;
36
- if (params.sourceId !== undefined)
37
- body.sourceId = params.sourceId;
38
- if (params.creditedToUserId !== undefined)
39
- body.creditedToUserId = params.creditedToUserId;
40
- if (params.location !== undefined)
41
- body.location = params.location;
42
- if (params.createdAt !== undefined)
43
- body.createdAt = params.createdAt;
44
- if (params.sendNotifications !== undefined)
45
- body.sendNotifications = params.sendNotifications;
46
- const response = yield axiosClient.post(`https://api.ashbyhq.com/candidate.update`, body, {
47
- auth: {
48
- username: authToken,
49
- password: "",
50
- },
51
- });
52
- if (!response.data.success) {
53
- throw new Error(response.data.errors.join("; "));
54
- }
55
- });
56
- export default updateCandidate;
@@ -1,3 +0,0 @@
1
- import type { gongGetGongTranscriptsFunction } from "../../autogen/types.js";
2
- declare const getGongTranscripts: gongGetGongTranscriptsFunction;
3
- export default getGongTranscripts;