-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] Ashby - new components #18968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
components/ashby/actions/create-application/create-application.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import app from "../../ashby.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "ashby-create-application", | ||
| name: "Create Application", | ||
| description: "Considers a candidate for a job (e.g., when sourcing a candidate for a job posting). [See the documentation](https://developers.ashbyhq.com/reference/applicationcreate)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| candidateId: { | ||
| propDefinition: [ | ||
| app, | ||
| "candidateId", | ||
| ], | ||
| description: "The ID of the candidate to create an application for", | ||
| }, | ||
| jobId: { | ||
| propDefinition: [ | ||
| app, | ||
| "jobId", | ||
| ], | ||
| description: "The ID of the job to apply for", | ||
| }, | ||
| interviewPlanId: { | ||
| optional: true, | ||
| propDefinition: [ | ||
| app, | ||
| "interviewPlanId", | ||
| ], | ||
| }, | ||
| interviewStageId: { | ||
| optional: true, | ||
| propDefinition: [ | ||
| app, | ||
| "interviewStageId", | ||
| ({ interviewPlanId }) => ({ | ||
| interviewPlanId, | ||
| }), | ||
| ], | ||
| }, | ||
| sourceId: { | ||
| optional: true, | ||
| propDefinition: [ | ||
| app, | ||
| "sourceId", | ||
| ], | ||
| }, | ||
| creditedToUserId: { | ||
| label: "Credited To User ID", | ||
| description: "The ID of the user the application will be credited to", | ||
| optional: true, | ||
| propDefinition: [ | ||
| app, | ||
| "userId", | ||
| ], | ||
| }, | ||
| createdAt: { | ||
| type: "string", | ||
| label: "Created At", | ||
| description: "An ISO date string to set the application's createdAt timestamp (e.g., `2024-01-15T10:30:00Z`). Defaults to the current time if not provided.", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| candidateId, | ||
| jobId, | ||
| interviewPlanId, | ||
| interviewStageId, | ||
| sourceId, | ||
| creditedToUserId, | ||
| createdAt, | ||
| } = this; | ||
|
|
||
| const response = await app.createApplication({ | ||
| $, | ||
| data: { | ||
| candidateId, | ||
| jobId, | ||
| interviewPlanId, | ||
| interviewStageId, | ||
| sourceId, | ||
| creditedToUserId, | ||
| createdAt, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created application with ID \`${response.results?.id}\``); | ||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
141 changes: 141 additions & 0 deletions
141
components/ashby/actions/create-candidate/create-candidate.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| import app from "../../ashby.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "ashby-create-candidate", | ||
| name: "Create Candidate", | ||
| description: "Creates a new candidate in Ashby. [See the documentation](https://developers.ashbyhq.com/reference/candidatecreate)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| app, | ||
| "email", | ||
| ], | ||
| description: "Primary, personal email of the candidate to be created", | ||
| }, | ||
| phoneNumber: { | ||
| type: "string", | ||
| label: "Phone Number", | ||
| description: "Primary, personal phone number of the candidate to be created", | ||
| optional: true, | ||
| }, | ||
| linkedInUrl: { | ||
| type: "string", | ||
| label: "LinkedIn URL", | ||
| description: "URL to the candidate's LinkedIn profile. Must be a valid URL.", | ||
| optional: true, | ||
| }, | ||
| githubUrl: { | ||
| type: "string", | ||
| label: "GitHub URL", | ||
| description: "URL to the candidate's GitHub profile. Must be a valid URL.", | ||
| optional: true, | ||
| }, | ||
| website: { | ||
| type: "string", | ||
| label: "Website", | ||
| description: "URL of the candidate's website. Must be a valid URL.", | ||
| optional: true, | ||
| }, | ||
| alternateEmailAddresses: { | ||
| type: "string[]", | ||
| label: "Alternate Email Addresses", | ||
| description: "Array of alternate email addresses to add to the candidate's profile", | ||
| optional: true, | ||
| }, | ||
| sourceId: { | ||
| propDefinition: [ | ||
| app, | ||
| "sourceId", | ||
| ], | ||
| description: "The source to set on the candidate being created", | ||
| optional: true, | ||
| }, | ||
| creditedToUserId: { | ||
| propDefinition: [ | ||
| app, | ||
| "userId", | ||
| ], | ||
| label: "Credited To User ID", | ||
| description: "The ID of the user the candidate will be credited to", | ||
| optional: true, | ||
| }, | ||
| city: { | ||
| type: "string", | ||
| label: "City", | ||
| description: "The city of the candidate's location", | ||
| optional: true, | ||
| }, | ||
| region: { | ||
| type: "string", | ||
| label: "Region", | ||
| description: "The region (state, province, etc.) of the candidate's location", | ||
| optional: true, | ||
| }, | ||
| country: { | ||
| type: "string", | ||
| label: "Country", | ||
| description: "The country of the candidate's location", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| email, | ||
| name, | ||
| phoneNumber, | ||
| linkedInUrl, | ||
| githubUrl, | ||
| website, | ||
| alternateEmailAddresses, | ||
| sourceId, | ||
| creditedToUserId, | ||
| city, | ||
| region, | ||
| country, | ||
| } = this; | ||
|
|
||
| const response = await app.createCandidate({ | ||
| $, | ||
| data: { | ||
| name, | ||
| email, | ||
| phoneNumber, | ||
| linkedInUrl, | ||
| githubUrl, | ||
| website, | ||
| alternateEmailAddresses, | ||
| sourceId, | ||
| creditedToUserId, | ||
| ...(city || region || country | ||
| ? { | ||
| location: { | ||
| city, | ||
| region, | ||
| country, | ||
| }, | ||
| } | ||
| : undefined | ||
| ), | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully created candidate"); | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
71 changes: 71 additions & 0 deletions
71
components/ashby/actions/create-interview-schedule/create-interview-schedule.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import app from "../../ashby.app.mjs"; | ||
| import utils from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "ashby-create-interview-schedule", | ||
| name: "Create Interview Schedule", | ||
| description: "Creates a scheduled interview. [See the documentation](https://developers.ashbyhq.com/reference/interviewschedulecreate)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| applicationId: { | ||
| propDefinition: [ | ||
| app, | ||
| "applicationId", | ||
| ], | ||
| description: "The ID of the application to schedule an interview for", | ||
| }, | ||
| interviewEvents: { | ||
| type: "string[]", | ||
| label: "Interview Events", | ||
| description: `Array of interview events. Each event should contain: | ||
| - **startTime** (string, required): Interview start time in ISO 8601 format (e.g., 2023-01-30T15:00:00.000Z) | ||
| - **endTime** (string, required): Interview end time in ISO 8601 format (e.g., 2023-01-30T16:00:00.000Z) | ||
| - **interviewers** (array, required): Array of interviewer objects with: | ||
| - **email** (string, required): Email address of the interviewer | ||
| - **feedbackRequired** (boolean, optional): Whether feedback from this interviewer is required | ||
|
|
||
| Example: | ||
| \`\`\`json | ||
| [ | ||
| { | ||
| "startTime": "2023-01-30T15:00:00.000Z", | ||
| "endTime": "2023-01-30T16:00:00.000Z", | ||
| "interviewers": [ | ||
| { | ||
| "email": "[email protected]", | ||
| "feedbackRequired": true | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| \`\`\` | ||
| `, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| applicationId, | ||
| interviewEvents, | ||
| } = this; | ||
|
|
||
| const response = await app.createInterviewSchedule({ | ||
| $, | ||
| data: { | ||
| applicationId, | ||
| interviewEvents: utils.parseJson(interviewEvents), | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully created interview schedule"); | ||
|
|
||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import app from "../../ashby.app.mjs"; | ||
| import utils from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "ashby-create-offer", | ||
| name: "Create Offer", | ||
| description: "Creates a new offer. [See the documentation](https://developers.ashbyhq.com/reference/offercreate)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| offerProcessId: { | ||
| propDefinition: [ | ||
| app, | ||
| "offerProcessId", | ||
| ], | ||
| }, | ||
| offerFormId: { | ||
| type: "string", | ||
| label: "Offer Form ID", | ||
| description: "The ID of the form associated with the offer. The ID is included in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).", | ||
| }, | ||
| fieldSubmissions: { | ||
| type: "string[]", | ||
| label: "Field Submissions", | ||
| description: `Array of field submission objects. Each object should contain: | ||
| - **path** (string, required): The form field's "path" value | ||
| - **value** (string, required): The field value (can be a primitive or complex type depending on field type) | ||
|
|
||
| You can find these referebce values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart). | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Each item can be a JSON string or object with the structure: | ||
| \`\`\`json | ||
| [ | ||
| { | ||
| "path": "96377e55-cd34-49e2-aff0-5870ec102360", | ||
| "value": "2025-11-07" | ||
| }, | ||
| { | ||
| "path": "ded2358d-443f-484f-91fa-ec7a13de842b", | ||
| "value": { | ||
| "value": 10000, | ||
| "currencyCode": "USD" | ||
| } | ||
| } | ||
| ] | ||
| \`\`\``, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| offerProcessId, | ||
| offerFormId, | ||
| fieldSubmissions, | ||
| } = this; | ||
|
|
||
| const response = await app.createOffer({ | ||
| $, | ||
| data: { | ||
| offerProcessId, | ||
| offerFormId, | ||
| offerForm: { | ||
| fieldSubmissions: utils.parseJson(fieldSubmissions), | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created offer for process ${offerProcessId}`); | ||
|
|
||
| return response; | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.