@credal/actions 0.1.31 → 0.1.32
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 +138 -0
- package/dist/actions/autogen/templates.d.ts +22 -0
- package/dist/actions/autogen/templates.js +883 -1
- package/dist/actions/autogen/types.d.ts +660 -8
- package/dist/actions/autogen/types.js +245 -1
- package/dist/actions/groups.js +20 -3
- package/dist/actions/invoke.js +3 -0
- package/dist/actions/parse.js +3 -0
- package/dist/actions/providers/ashby/addCandidateToProject.d.ts +3 -0
- package/dist/actions/providers/ashby/addCandidateToProject.js +32 -0
- package/dist/actions/providers/ashby/createCandidate.d.ts +3 -0
- package/dist/actions/providers/ashby/createCandidate.js +42 -0
- package/dist/actions/providers/ashby/createNote.d.ts +3 -0
- package/dist/actions/providers/ashby/createNote.js +32 -0
- package/dist/actions/providers/ashby/getCandidateInfo.d.ts +3 -0
- package/dist/actions/providers/ashby/getCandidateInfo.js +34 -0
- package/dist/actions/providers/ashby/listCandidateNotes.d.ts +3 -0
- package/dist/actions/providers/ashby/listCandidateNotes.js +34 -0
- package/dist/actions/providers/ashby/listCandidates.d.ts +3 -0
- package/dist/actions/providers/ashby/listCandidates.js +31 -0
- package/dist/actions/providers/ashby/searchCandidates.d.ts +3 -0
- package/dist/actions/providers/ashby/searchCandidates.js +35 -0
- package/dist/actions/providers/ashby/updateCandidate.d.ts +3 -0
- package/dist/actions/providers/ashby/updateCandidate.js +60 -0
- package/dist/actions/providers/confluence/updatePage.js +15 -14
- package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.d.ts +6 -0
- package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +74 -0
- package/dist/actions/providers/jira/assignJiraTicket.d.ts +3 -0
- package/dist/actions/providers/jira/assignJiraTicket.js +52 -0
- package/dist/actions/providers/jira/commentJiraTicket.d.ts +3 -0
- package/dist/actions/providers/jira/commentJiraTicket.js +56 -0
- package/dist/actions/providers/jira/createJiraTicket.js +3 -24
- package/dist/actions/providers/jira/utils.d.ts +1 -0
- package/dist/actions/providers/jira/utils.js +34 -0
- package/dist/actions/providers/microsoft/messageTeamsChannel.d.ts +3 -0
- package/dist/actions/providers/microsoft/messageTeamsChannel.js +45 -0
- package/dist/actions/providers/microsoft/messageTeamsChat.d.ts +3 -0
- package/dist/actions/providers/microsoft/messageTeamsChat.js +42 -0
- package/dist/actions/providers/microsoft/utils.d.ts +4 -0
- package/dist/actions/providers/microsoft/utils.js +55 -0
- package/dist/actions/providers/salesforce/createCase.d.ts +3 -0
- package/dist/actions/providers/salesforce/createCase.js +44 -0
- package/dist/actions/providers/salesforce/generateSalesReport.d.ts +3 -0
- package/dist/actions/providers/salesforce/generateSalesReport.js +52 -0
- package/dist/actions/providers/salesforce/getRecord.d.ts +3 -0
- package/dist/actions/providers/salesforce/getRecord.js +42 -0
- package/dist/actions/providers/salesforce/updateRecord.d.ts +3 -0
- package/dist/actions/providers/salesforce/updateRecord.js +42 -0
- package/dist/actions/providers/slack/getChannelMessages.d.ts +3 -0
- package/dist/actions/providers/slack/getChannelMessages.js +33 -0
- package/dist/actions/providers/workday/requestTimeOff.d.ts +23 -0
- package/dist/actions/providers/workday/requestTimeOff.js +88 -0
- package/dist/actions/providers/zendesk/addCommentToTicket.d.ts +3 -0
- package/dist/actions/providers/zendesk/addCommentToTicket.js +37 -0
- package/dist/actions/providers/zendesk/assignTicket.d.ts +3 -0
- package/dist/actions/providers/zendesk/assignTicket.js +37 -0
- package/dist/actions/providers/zendesk/getTicketDetails.d.ts +3 -0
- package/dist/actions/providers/zendesk/getTicketDetails.js +35 -0
- package/dist/actions/providers/zendesk/updateTicketStatus.d.ts +3 -0
- package/dist/actions/providers/zendesk/updateTicketStatus.js +37 -0
- package/package.json +6 -1
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +0 -3
- package/dist/actions/providers/googlemaps/nearbysearch.js +0 -96
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.d.ts +0 -3
- package/dist/actions/providers/snowflake/runSnowflakeQueryWriteResultsToS3.js +0 -154
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.d.ts +0 -3
- package/dist/actions/providers/x/scrapeTweetDataWithNitter.js +0 -45
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.firecrawlScrapeUrlParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.AuthParamsSchema = void 0;
|
4
|
+
exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = void 0;
|
4
5
|
const zod_1 = require("zod");
|
5
6
|
exports.AuthParamsSchema = zod_1.z.object({
|
6
7
|
authToken: zod_1.z.string().optional(),
|
@@ -18,6 +19,9 @@ exports.AuthParamsSchema = zod_1.z.object({
|
|
18
19
|
awsSecretAccessKey: zod_1.z.string().optional(),
|
19
20
|
clientId: zod_1.z.string().optional(),
|
20
21
|
clientSecret: zod_1.z.string().optional(),
|
22
|
+
tenantId: zod_1.z.string().optional(),
|
23
|
+
refreshToken: zod_1.z.string().optional(),
|
24
|
+
redirectUri: zod_1.z.string().optional(),
|
21
25
|
});
|
22
26
|
exports.slackSendMessageParamsSchema = zod_1.z.object({
|
23
27
|
channelName: zod_1.z.string().describe("The name of the Slack channel to send the message to (e.g. general, alerts)"),
|
@@ -37,6 +41,21 @@ exports.slackListConversationsOutputSchema = zod_1.z.object({
|
|
37
41
|
.describe("A channel in Slack"))
|
38
42
|
.describe("A list of channels in Slack"),
|
39
43
|
});
|
44
|
+
exports.slackGetChannelMessagesParamsSchema = zod_1.z.object({
|
45
|
+
channelName: zod_1.z.string().describe("Name of the channel to summarize"),
|
46
|
+
oldest: zod_1.z.string().describe("Only messages after this Unix timestamp will be included in results"),
|
47
|
+
});
|
48
|
+
exports.slackGetChannelMessagesOutputSchema = zod_1.z.object({
|
49
|
+
messages: zod_1.z
|
50
|
+
.array(zod_1.z
|
51
|
+
.object({
|
52
|
+
user: zod_1.z.string().describe("The user who sent the message"),
|
53
|
+
text: zod_1.z.string().describe("The text of the message"),
|
54
|
+
ts: zod_1.z.string().describe("The timestamp of the message"),
|
55
|
+
})
|
56
|
+
.describe("A message in the channel"))
|
57
|
+
.describe("The messages in the channel"),
|
58
|
+
});
|
40
59
|
exports.mathAddParamsSchema = zod_1.z.object({
|
41
60
|
a: zod_1.z.number().describe("The first number to add"),
|
42
61
|
b: zod_1.z.number().describe("The second number to add"),
|
@@ -56,6 +75,29 @@ exports.confluenceFetchPageContentOutputSchema = zod_1.z.object({
|
|
56
75
|
title: zod_1.z.string().describe("The title of the page"),
|
57
76
|
content: zod_1.z.string().describe("The content of the page in storage format (HTML)"),
|
58
77
|
});
|
78
|
+
exports.jiraCommentJiraTicketParamsSchema = zod_1.z.object({
|
79
|
+
projectKey: zod_1.z.string().describe("The key for the project you want to add it to"),
|
80
|
+
issueId: zod_1.z.string().describe("The issue ID associated with the ticket to be commented on"),
|
81
|
+
comment: zod_1.z.string().describe("The text to be commented on the ticket"),
|
82
|
+
});
|
83
|
+
exports.jiraCommentJiraTicketOutputSchema = zod_1.z.object({
|
84
|
+
success: zod_1.z.boolean().describe("Whether the comment was sent successfully"),
|
85
|
+
error: zod_1.z.string().describe("The error that occurred if the comment was not sent successfully").optional(),
|
86
|
+
commentUrl: zod_1.z.string().describe("The url to the created Jira comment").optional(),
|
87
|
+
});
|
88
|
+
exports.jiraAssignJiraTicketParamsSchema = zod_1.z.object({
|
89
|
+
projectKey: zod_1.z.string().describe("The key for the project you want to add it to"),
|
90
|
+
assignee: zod_1.z.string().describe("The assignee for the ticket, userID or email"),
|
91
|
+
issueId: zod_1.z.string().describe("The issue ID associated with the ticket to be assigned/re-assigned"),
|
92
|
+
});
|
93
|
+
exports.jiraAssignJiraTicketOutputSchema = zod_1.z.object({
|
94
|
+
success: zod_1.z.boolean().describe("Whether the ticket was successfully assigned/reassigned"),
|
95
|
+
error: zod_1.z
|
96
|
+
.string()
|
97
|
+
.describe("The error that occurred if the ticket was not successfully assigned/reassigned")
|
98
|
+
.optional(),
|
99
|
+
ticketUrl: zod_1.z.string().describe("The url to the newly assigned/reassigned Jira ticket").optional(),
|
100
|
+
});
|
59
101
|
exports.jiraCreateJiraTicketParamsSchema = zod_1.z.object({
|
60
102
|
projectKey: zod_1.z.string().describe("The key for the project you want to add it to"),
|
61
103
|
summary: zod_1.z.string().describe("The summary of the new ticket"),
|
@@ -211,6 +253,38 @@ exports.zendeskCreateZendeskTicketOutputSchema = zod_1.z.object({
|
|
211
253
|
ticketId: zod_1.z.string().describe("The ID of the ticket created"),
|
212
254
|
ticketUrl: zod_1.z.string().describe("The URL of the ticket created").optional(),
|
213
255
|
});
|
256
|
+
exports.zendeskGetTicketDetailsParamsSchema = zod_1.z.object({
|
257
|
+
ticketId: zod_1.z.string().describe("The ID of the ticket"),
|
258
|
+
subdomain: zod_1.z.string().describe("The subdomain of the Zendesk account"),
|
259
|
+
});
|
260
|
+
exports.zendeskGetTicketDetailsOutputSchema = zod_1.z.object({
|
261
|
+
ticket: zod_1.z.object({}).catchall(zod_1.z.any()).describe("The details of the ticket"),
|
262
|
+
});
|
263
|
+
exports.zendeskUpdateTicketStatusParamsSchema = zod_1.z.object({
|
264
|
+
ticketId: zod_1.z.string().describe("The ID of the ticket to update"),
|
265
|
+
subdomain: zod_1.z.string().describe("The subdomain of the Zendesk account"),
|
266
|
+
status: zod_1.z
|
267
|
+
.string()
|
268
|
+
.describe('The state of the ticket. If your account has activated custom ticket statuses, this is the ticket\'s status category. Allowed values are "new", "open", "pending", "hold", "solved", or "closed".'),
|
269
|
+
});
|
270
|
+
exports.zendeskUpdateTicketStatusOutputSchema = zod_1.z.void();
|
271
|
+
exports.zendeskAddCommentToTicketParamsSchema = zod_1.z.object({
|
272
|
+
ticketId: zod_1.z.string().describe("The ID of the ticket to update"),
|
273
|
+
subdomain: zod_1.z.string().describe("The subdomain of the Zendesk account"),
|
274
|
+
comment: zod_1.z
|
275
|
+
.object({
|
276
|
+
body: zod_1.z.string().describe("The body of the comment"),
|
277
|
+
public: zod_1.z.boolean().describe("Whether the comment should be public").optional(),
|
278
|
+
})
|
279
|
+
.describe("The comment to add to the ticket"),
|
280
|
+
});
|
281
|
+
exports.zendeskAddCommentToTicketOutputSchema = zod_1.z.void();
|
282
|
+
exports.zendeskAssignTicketParamsSchema = zod_1.z.object({
|
283
|
+
ticketId: zod_1.z.string().describe("The ID of the ticket to update"),
|
284
|
+
subdomain: zod_1.z.string().describe("The subdomain of the Zendesk account"),
|
285
|
+
assigneeEmail: zod_1.z.string().describe("The email address of the agent to assign the ticket to"),
|
286
|
+
});
|
287
|
+
exports.zendeskAssignTicketOutputSchema = zod_1.z.void();
|
214
288
|
exports.linkedinCreateShareLinkedinPostUrlParamsSchema = zod_1.z.object({
|
215
289
|
text: zod_1.z.string().describe("The text for the linkedin post").optional(),
|
216
290
|
url: zod_1.z.string().describe("The url for the linkedin post").optional(),
|
@@ -318,6 +392,24 @@ exports.googleOauthCreateNewGoogleDocOutputSchema = zod_1.z.object({
|
|
318
392
|
documentId: zod_1.z.string().describe("The ID of the created Google Doc"),
|
319
393
|
documentUrl: zod_1.z.string().describe("The URL to access the created Google Doc").optional(),
|
320
394
|
});
|
395
|
+
exports.googleOauthScheduleCalendarMeetingParamsSchema = zod_1.z.object({
|
396
|
+
calendarId: zod_1.z.string().describe("The ID of the calendar to schedule the meeting on"),
|
397
|
+
name: zod_1.z.string().describe("The name of the meeting"),
|
398
|
+
start: zod_1.z.string().describe("The start time of the meeting"),
|
399
|
+
end: zod_1.z.string().describe("The end time of the meeting"),
|
400
|
+
description: zod_1.z.string().describe("The description of the meeting").optional(),
|
401
|
+
attendees: zod_1.z
|
402
|
+
.array(zod_1.z.string().describe("The email of the attendee"))
|
403
|
+
.describe("The attendees of the meeting")
|
404
|
+
.optional(),
|
405
|
+
useGoogleMeet: zod_1.z.boolean().describe("Whether to use Google Meet for the meeting").optional(),
|
406
|
+
});
|
407
|
+
exports.googleOauthScheduleCalendarMeetingOutputSchema = zod_1.z.object({
|
408
|
+
success: zod_1.z.boolean().describe("Whether the meeting was scheduled successfully"),
|
409
|
+
eventId: zod_1.z.string().describe("The ID of the event that was scheduled").optional(),
|
410
|
+
eventUrl: zod_1.z.string().describe("The URL to access the scheduled event").optional(),
|
411
|
+
error: zod_1.z.string().describe("The error that occurred if the meeting was not scheduled successfully").optional(),
|
412
|
+
});
|
321
413
|
exports.finnhubSymbolLookupParamsSchema = zod_1.z.object({
|
322
414
|
query: zod_1.z.string().describe("The symbol or colloquial name of the company to look up"),
|
323
415
|
});
|
@@ -392,3 +484,155 @@ exports.lookerEnableUserByEmailOutputSchema = zod_1.z.object({
|
|
392
484
|
.describe("Details about the user")
|
393
485
|
.optional(),
|
394
486
|
});
|
487
|
+
exports.ashbyCreateNoteParamsSchema = zod_1.z.object({
|
488
|
+
candidateId: zod_1.z.string().describe("The ID of the candidate to create a note for"),
|
489
|
+
note: zod_1.z.string().describe("The note content"),
|
490
|
+
});
|
491
|
+
exports.ashbyCreateNoteOutputSchema = zod_1.z.void();
|
492
|
+
exports.ashbyGetCandidateInfoParamsSchema = zod_1.z.object({
|
493
|
+
candidateId: zod_1.z.string().describe("The ID of the candidate whose information is to be retrieved"),
|
494
|
+
});
|
495
|
+
exports.ashbyGetCandidateInfoOutputSchema = zod_1.z.object({
|
496
|
+
candidate: zod_1.z.object({}).catchall(zod_1.z.any()).describe("The candidate's information"),
|
497
|
+
});
|
498
|
+
exports.ashbyAddCandidateToProjectParamsSchema = zod_1.z.object({
|
499
|
+
candidateId: zod_1.z.string().describe("The ID of the candidate to add to the project"),
|
500
|
+
projectId: zod_1.z.string().describe("The ID of the project to add the candidate to"),
|
501
|
+
});
|
502
|
+
exports.ashbyAddCandidateToProjectOutputSchema = zod_1.z.void();
|
503
|
+
exports.ashbyListCandidatesParamsSchema = zod_1.z.object({});
|
504
|
+
exports.ashbyListCandidatesOutputSchema = zod_1.z.object({
|
505
|
+
candidates: zod_1.z.array(zod_1.z.any()).describe("A list of candidates"),
|
506
|
+
});
|
507
|
+
exports.ashbySearchCandidatesParamsSchema = zod_1.z.object({
|
508
|
+
email: zod_1.z.string().describe("The email address of the candidate to search for").optional(),
|
509
|
+
name: zod_1.z.string().describe("The name of the candidate to search for").optional(),
|
510
|
+
});
|
511
|
+
exports.ashbySearchCandidatesOutputSchema = zod_1.z.object({
|
512
|
+
candidates: zod_1.z.array(zod_1.z.any()).describe("A list of candidates"),
|
513
|
+
});
|
514
|
+
exports.ashbyListCandidateNotesParamsSchema = zod_1.z.object({
|
515
|
+
candidateId: zod_1.z.string().describe("The ID of the candidate"),
|
516
|
+
});
|
517
|
+
exports.ashbyListCandidateNotesOutputSchema = zod_1.z.object({ notes: zod_1.z.array(zod_1.z.any()).describe("A list of notes") });
|
518
|
+
exports.ashbyCreateCandidateParamsSchema = zod_1.z.object({
|
519
|
+
name: zod_1.z.string().describe("The first and last name of the candidate to be created."),
|
520
|
+
email: zod_1.z.string().describe("Primary, personal email of the candidate to be created.").optional(),
|
521
|
+
phoneNumber: zod_1.z.string().describe("Primary, personal phone number of the candidate to be created.").optional(),
|
522
|
+
linkedInUrl: zod_1.z.string().describe("Url to the candidate's LinkedIn profile. Must be a valid Url.").optional(),
|
523
|
+
githubUrl: zod_1.z.string().describe("Url to the candidate's Github profile. Must be a valid Url.").optional(),
|
524
|
+
website: zod_1.z.string().describe("Url of the candidate's website. Must be a valid Url.").optional(),
|
525
|
+
alternateEmailAddresses: zod_1.z
|
526
|
+
.array(zod_1.z.string())
|
527
|
+
.describe("Array of alternate email address to add to the candidate's profile.")
|
528
|
+
.optional(),
|
529
|
+
sourceId: zod_1.z.string().describe("The source to set on the candidate being created.").optional(),
|
530
|
+
creditedToUserId: zod_1.z.string().describe("The id of the user the candidate will be credited to.").optional(),
|
531
|
+
location: zod_1.z
|
532
|
+
.object({
|
533
|
+
city: zod_1.z.string().describe("The city of the candidate.").optional(),
|
534
|
+
region: zod_1.z.string().describe("The region of the candidate.").optional(),
|
535
|
+
country: zod_1.z.string().describe("The country of the candidate.").optional(),
|
536
|
+
})
|
537
|
+
.describe("The location of the candidate.")
|
538
|
+
.optional(),
|
539
|
+
});
|
540
|
+
exports.ashbyCreateCandidateOutputSchema = zod_1.z.void();
|
541
|
+
exports.ashbyUpdateCandidateParamsSchema = zod_1.z.object({
|
542
|
+
candidateId: zod_1.z.string().describe("The ID of the candidate to update"),
|
543
|
+
name: zod_1.z.string().describe("The first and last name of the candidate to update.").optional(),
|
544
|
+
email: zod_1.z.string().describe("Primary, personal email of the candidate to update.").optional(),
|
545
|
+
phoneNumber: zod_1.z.string().describe("Primary, personal phone number of the candidate to update.").optional(),
|
546
|
+
linkedInUrl: zod_1.z.string().describe("Url to the candidate's LinkedIn profile. Must be a valid Url.").optional(),
|
547
|
+
githubUrl: zod_1.z.string().describe("Url to the candidate's Github profile. Must be a valid Url.").optional(),
|
548
|
+
websiteUrl: zod_1.z.string().describe("Url of the candidate's website. Must be a valid Url.").optional(),
|
549
|
+
alternateEmail: zod_1.z.string().describe("An alternate email address to add to the candidate's profile.").optional(),
|
550
|
+
socialLinks: zod_1.z
|
551
|
+
.array(zod_1.z.object({
|
552
|
+
type: zod_1.z.string().describe("The type of social link").optional(),
|
553
|
+
url: zod_1.z.string().describe("The URL of the social link").optional(),
|
554
|
+
}))
|
555
|
+
.describe("An array of social links to set on the candidate. This value replaces existing socialLinks that have been set on the candidate.")
|
556
|
+
.optional(),
|
557
|
+
sourceId: zod_1.z.string().describe("The id of source for this candidate.").optional(),
|
558
|
+
creditedToUserId: zod_1.z.string().describe("The id of the user the candidate will be credited to.").optional(),
|
559
|
+
location: zod_1.z
|
560
|
+
.object({
|
561
|
+
city: zod_1.z.string().describe("The city of the candidate").optional(),
|
562
|
+
region: zod_1.z.string().describe("The region of the candidate").optional(),
|
563
|
+
country: zod_1.z.string().describe("The country of the candidate").optional(),
|
564
|
+
})
|
565
|
+
.describe("The location of the candidate.")
|
566
|
+
.optional(),
|
567
|
+
createdAt: zod_1.z.string().describe("An ISO date string to set the candidate's createdAt timestamp.").optional(),
|
568
|
+
sendNotifications: zod_1.z
|
569
|
+
.boolean()
|
570
|
+
.describe("Whether or not users who are subscribed to the candidate should be notified that candidate was updated. Default is true.")
|
571
|
+
.optional(),
|
572
|
+
});
|
573
|
+
exports.ashbyUpdateCandidateOutputSchema = zod_1.z.void();
|
574
|
+
exports.salesforceUpdateRecordParamsSchema = zod_1.z.object({
|
575
|
+
objectType: zod_1.z.string().describe("The Salesforce object type to update (e.g., Lead, Account, Contact)"),
|
576
|
+
recordId: zod_1.z.string().describe("The ID of the record to update"),
|
577
|
+
fieldsToUpdate: zod_1.z.record(zod_1.z.string()).describe("The fields to update on the record"),
|
578
|
+
});
|
579
|
+
exports.salesforceUpdateRecordOutputSchema = zod_1.z.object({
|
580
|
+
success: zod_1.z.boolean().describe("Whether the record was successfully updated"),
|
581
|
+
error: zod_1.z.string().describe("The error that occurred if the record was not successfully updated").optional(),
|
582
|
+
});
|
583
|
+
exports.salesforceCreateCaseParamsSchema = zod_1.z.object({
|
584
|
+
subject: zod_1.z.string().describe("The subject of the case"),
|
585
|
+
description: zod_1.z.string().describe("The detailed description of the case"),
|
586
|
+
priority: zod_1.z.string().describe("The priority of the case (e.g., High, Medium, Low)"),
|
587
|
+
origin: zod_1.z.string().describe("The origin of the case (e.g., Phone, Email, Web)"),
|
588
|
+
customFields: zod_1.z.record(zod_1.z.string()).describe("Additional custom fields to set on the case").optional(),
|
589
|
+
});
|
590
|
+
exports.salesforceCreateCaseOutputSchema = zod_1.z.object({
|
591
|
+
success: zod_1.z.boolean().describe("Whether the case was successfully created"),
|
592
|
+
caseId: zod_1.z.string().describe("The ID of the created case").optional(),
|
593
|
+
error: zod_1.z.string().describe("The error that occurred if the case was not successfully created").optional(),
|
594
|
+
});
|
595
|
+
exports.salesforceGenerateSalesReportParamsSchema = zod_1.z.object({
|
596
|
+
startDate: zod_1.z.string().describe("The start date for the sales report in ISO 8601 format (e.g., 2025-01-01)."),
|
597
|
+
endDate: zod_1.z.string().describe("The end date for the sales report in ISO 8601 format (e.g., 2025-01-31)."),
|
598
|
+
filters: zod_1.z
|
599
|
+
.record(zod_1.z.string())
|
600
|
+
.describe("Additional filters for the sales report (e.g., by region, product).")
|
601
|
+
.optional(),
|
602
|
+
});
|
603
|
+
exports.salesforceGenerateSalesReportOutputSchema = zod_1.z.object({
|
604
|
+
success: zod_1.z.boolean().describe("Whether the sales report was successfully generated."),
|
605
|
+
reportData: zod_1.z
|
606
|
+
.array(zod_1.z.record(zod_1.z.string()).describe("A row in the sales report."))
|
607
|
+
.describe("The data of the sales report.")
|
608
|
+
.optional(),
|
609
|
+
error: zod_1.z.string().describe("The error that occurred if the sales report was not successfully generated.").optional(),
|
610
|
+
});
|
611
|
+
exports.salesforceGetRecordParamsSchema = zod_1.z.object({
|
612
|
+
objectType: zod_1.z.string().describe("The Salesforce object type to retrieve (e.g., Lead, Account, Contact)"),
|
613
|
+
recordId: zod_1.z.string().describe("The ID of the record to retrieve"),
|
614
|
+
});
|
615
|
+
exports.salesforceGetRecordOutputSchema = zod_1.z.object({
|
616
|
+
success: zod_1.z.boolean().describe("Whether the record was successfully retrieved"),
|
617
|
+
record: zod_1.z.record(zod_1.z.string()).describe("The retrieved record data").optional(),
|
618
|
+
error: zod_1.z.string().describe("The error that occurred if the record was not successfully retrieved").optional(),
|
619
|
+
});
|
620
|
+
exports.microsoftMessageTeamsChatParamsSchema = zod_1.z.object({
|
621
|
+
chatId: zod_1.z.string().describe("The chat ID of the Microsoft Teams chat"),
|
622
|
+
message: zod_1.z.string().describe("The text to be messaged to the chat"),
|
623
|
+
});
|
624
|
+
exports.microsoftMessageTeamsChatOutputSchema = zod_1.z.object({
|
625
|
+
success: zod_1.z.boolean().describe("Whether the message was sent successfully"),
|
626
|
+
error: zod_1.z.string().describe("The error that occurred if the message was not sent successfully").optional(),
|
627
|
+
messageId: zod_1.z.string().describe("The ID of the message that was sent").optional(),
|
628
|
+
});
|
629
|
+
exports.microsoftMessageTeamsChannelParamsSchema = zod_1.z.object({
|
630
|
+
teamId: zod_1.z.string().describe("The team ID of the Microsoft Teams channel"),
|
631
|
+
channelId: zod_1.z.string().describe("The channel ID of the Microsoft Teams channel"),
|
632
|
+
message: zod_1.z.string().describe("The text to be messaged to the channel"),
|
633
|
+
});
|
634
|
+
exports.microsoftMessageTeamsChannelOutputSchema = zod_1.z.object({
|
635
|
+
success: zod_1.z.boolean().describe("Whether the message was sent successfully"),
|
636
|
+
error: zod_1.z.string().describe("The error that occurred if the message was not sent successfully").optional(),
|
637
|
+
messageId: zod_1.z.string().describe("The ID of the message that was sent").optional(),
|
638
|
+
});
|
package/dist/actions/groups.js
CHANGED
@@ -23,6 +23,10 @@ exports.ACTION_GROUPS = {
|
|
23
23
|
description: "Action for interacting with Google Drive",
|
24
24
|
actions: [templates_1.googleOauthCreateNewGoogleDocDefinition],
|
25
25
|
},
|
26
|
+
GOOGLE_CALENDAR: {
|
27
|
+
description: "Actions for interacting with Google Calendar",
|
28
|
+
actions: [templates_1.googleOauthScheduleCalendarMeetingDefinition],
|
29
|
+
},
|
26
30
|
CREDAL_CALL_COPILOT: {
|
27
31
|
description: "Action for calling a Credal Copilot",
|
28
32
|
actions: [templates_1.credalCallCopilotDefinition],
|
@@ -43,9 +47,9 @@ exports.ACTION_GROUPS = {
|
|
43
47
|
description: "Action for getting content from a Snowflake table",
|
44
48
|
actions: [templates_1.snowflakeGetRowByFieldValueDefinition, templates_1.snowflakeRunSnowflakeQueryDefinition],
|
45
49
|
},
|
46
|
-
|
47
|
-
description: "Action for
|
48
|
-
actions: [templates_1.jiraCreateJiraTicketDefinition],
|
50
|
+
JIRA_ACTIONS: {
|
51
|
+
description: "Action for interating with Jira tickets",
|
52
|
+
actions: [templates_1.jiraCreateJiraTicketDefinition, templates_1.jiraAssignJiraTicketDefinition, templates_1.jiraCommentJiraTicketDefinition],
|
49
53
|
},
|
50
54
|
OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
|
51
55
|
description: "Action for getting the latitude and longitude of a location",
|
@@ -75,4 +79,17 @@ exports.ACTION_GROUPS = {
|
|
75
79
|
description: "Actions for interacting with Looker",
|
76
80
|
actions: [templates_1.lookerEnableUserByEmailDefinition],
|
77
81
|
},
|
82
|
+
SALESFORCE: {
|
83
|
+
description: "Actions for interacting with Salesforce",
|
84
|
+
actions: [
|
85
|
+
templates_1.salesforceUpdateRecordDefinition,
|
86
|
+
templates_1.salesforceCreateCaseDefinition,
|
87
|
+
templates_1.salesforceGenerateSalesReportDefinition,
|
88
|
+
templates_1.salesforceGetRecordDefinition,
|
89
|
+
],
|
90
|
+
},
|
91
|
+
MICROSOFT: {
|
92
|
+
description: "Actions for interacting with Microsoft 365",
|
93
|
+
actions: [templates_1.microsoftMessageTeamsChatDefinition, templates_1.microsoftMessageTeamsChannelDefinition],
|
94
|
+
},
|
78
95
|
};
|
package/dist/actions/invoke.js
CHANGED
@@ -14,6 +14,9 @@ const actionMapper_1 = require("./actionMapper");
|
|
14
14
|
function invokeAction(input) {
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
16
16
|
const { provider, name, parameters, authParams } = input;
|
17
|
+
if (!actionMapper_1.ActionMapper[provider]) {
|
18
|
+
throw new Error(`Provider '${provider}' not found`);
|
19
|
+
}
|
17
20
|
const providerFunction = actionMapper_1.ActionMapper[provider][name].fn;
|
18
21
|
return providerFunction({ params: parameters, authParams });
|
19
22
|
});
|
package/dist/actions/parse.js
CHANGED
@@ -55,6 +55,9 @@ z.object({
|
|
55
55
|
awsSecretAccessKey: z.string().optional(),
|
56
56
|
clientId: z.string().optional(),
|
57
57
|
clientSecret: z.string().optional(),
|
58
|
+
tenantId: z.string().optional(),
|
59
|
+
refreshToken: z.string().optional(),
|
60
|
+
redirectUri: z.string().optional(),
|
58
61
|
})
|
59
62
|
`;
|
60
63
|
function validateObject(object) {
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const addCandidateToProject = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { candidateId, projectId } = params;
|
15
|
+
const { authToken } = authParams;
|
16
|
+
if (!authToken) {
|
17
|
+
throw new Error("Auth token is required");
|
18
|
+
}
|
19
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.addProject`, {
|
20
|
+
candidateId,
|
21
|
+
projectId,
|
22
|
+
}, {
|
23
|
+
auth: {
|
24
|
+
username: authToken,
|
25
|
+
password: "",
|
26
|
+
},
|
27
|
+
});
|
28
|
+
if (!response.data.success) {
|
29
|
+
throw new Error(response.data.errors.join("; "));
|
30
|
+
}
|
31
|
+
});
|
32
|
+
exports.default = addCandidateToProject;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const createCandidate = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { authToken } = authParams;
|
15
|
+
if (!authToken) {
|
16
|
+
throw new Error("Auth token is required");
|
17
|
+
}
|
18
|
+
if (!params.name) {
|
19
|
+
throw new Error("Name is required");
|
20
|
+
}
|
21
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.create`, {
|
22
|
+
name: params.name,
|
23
|
+
email: params.email,
|
24
|
+
phoneNumber: params.phoneNumber,
|
25
|
+
linkedInUrl: params.linkedInUrl,
|
26
|
+
githubUrl: params.githubUrl,
|
27
|
+
website: params.website,
|
28
|
+
alternateEmailAddresses: params.alternateEmailAddresses,
|
29
|
+
sourceId: params.sourceId,
|
30
|
+
creditedToUserId: params.creditedToUserId,
|
31
|
+
location: params.location,
|
32
|
+
}, {
|
33
|
+
auth: {
|
34
|
+
username: authToken,
|
35
|
+
password: "",
|
36
|
+
},
|
37
|
+
});
|
38
|
+
if (!response.data.success) {
|
39
|
+
throw new Error(response.data.errors.join("; "));
|
40
|
+
}
|
41
|
+
});
|
42
|
+
exports.default = createCandidate;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const createNote = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { candidateId, note } = params;
|
15
|
+
const { authToken } = authParams;
|
16
|
+
if (!authToken) {
|
17
|
+
throw new Error("Auth token is required");
|
18
|
+
}
|
19
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.createNote`, {
|
20
|
+
candidateId,
|
21
|
+
note,
|
22
|
+
}, {
|
23
|
+
auth: {
|
24
|
+
username: authToken,
|
25
|
+
password: "",
|
26
|
+
},
|
27
|
+
});
|
28
|
+
if (!response.data.success) {
|
29
|
+
throw new Error(response.data.errors.join("; "));
|
30
|
+
}
|
31
|
+
});
|
32
|
+
exports.default = createNote;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const getCandidateInfo = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { candidateId } = params;
|
15
|
+
const { authToken } = authParams;
|
16
|
+
if (!authToken) {
|
17
|
+
throw new Error("Auth token is required");
|
18
|
+
}
|
19
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.info`, {
|
20
|
+
id: candidateId,
|
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
|
+
candidate: response.data,
|
32
|
+
};
|
33
|
+
});
|
34
|
+
exports.default = getCandidateInfo;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const listCandidateNotes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { candidateId } = params;
|
15
|
+
const { authToken } = authParams;
|
16
|
+
if (!authToken) {
|
17
|
+
throw new Error("Auth token is required");
|
18
|
+
}
|
19
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.listNotes`, {
|
20
|
+
candidateId,
|
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
|
+
notes: response.data.results,
|
32
|
+
};
|
33
|
+
});
|
34
|
+
exports.default = listCandidateNotes;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const listCandidates = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
|
14
|
+
const { authToken } = authParams;
|
15
|
+
if (!authToken) {
|
16
|
+
throw new Error("Auth token is required");
|
17
|
+
}
|
18
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.list`, null, {
|
19
|
+
auth: {
|
20
|
+
username: authToken,
|
21
|
+
password: "",
|
22
|
+
},
|
23
|
+
});
|
24
|
+
if (!response.data.success) {
|
25
|
+
throw new Error(response.data.errors.join("; "));
|
26
|
+
}
|
27
|
+
return {
|
28
|
+
candidates: response.data.results,
|
29
|
+
};
|
30
|
+
});
|
31
|
+
exports.default = listCandidates;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const searchCandidates = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { email, name } = params;
|
15
|
+
const { authToken } = authParams;
|
16
|
+
if (!authToken) {
|
17
|
+
throw new Error("Auth token is required");
|
18
|
+
}
|
19
|
+
const response = yield axiosClient_1.axiosClient.post(`https://api.ashbyhq.com/candidate.search`, {
|
20
|
+
email,
|
21
|
+
name,
|
22
|
+
}, {
|
23
|
+
auth: {
|
24
|
+
username: authToken,
|
25
|
+
password: "",
|
26
|
+
},
|
27
|
+
});
|
28
|
+
if (!response.data.success) {
|
29
|
+
throw new Error(response.data.errors.join("; "));
|
30
|
+
}
|
31
|
+
return {
|
32
|
+
candidates: response.data.results,
|
33
|
+
};
|
34
|
+
});
|
35
|
+
exports.default = searchCandidates;
|