-
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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; | ||
| }, | ||
| }; | ||
| 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"); | ||
|
|
||
| return response; | ||
| }, | ||
| }; |
| 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; | ||
| }, | ||
| }; |
| 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). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in description. "referebce" should be "reference". Apply this diff: -You can find these referebce values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
+You can find these reference values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| 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; | ||||||
| }, | ||||||
| }; | ||||||
Uh oh!
There was an error while loading. Please reload this page.