chore: import upstream snapshot with attribution
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildApplicationSubmitOutputs, buildAshbySubBlocks } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Application Submitted Trigger
|
||||
*
|
||||
* This is the PRIMARY trigger - it includes the dropdown for selecting trigger type.
|
||||
* Fires when a candidate submits an application or is manually added.
|
||||
*/
|
||||
export const ashbyApplicationSubmitTrigger: TriggerConfig = {
|
||||
id: 'ashby_application_submit',
|
||||
name: 'Ashby Application Submitted',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a new application is submitted',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_application_submit',
|
||||
eventType: 'Application Submitted',
|
||||
includeDropdown: true,
|
||||
}),
|
||||
|
||||
outputs: buildApplicationSubmitOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildAshbySubBlocks, buildCandidateDeleteOutputs } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Candidate Deleted Trigger
|
||||
*
|
||||
* Fires when a candidate record is deleted from Ashby.
|
||||
*/
|
||||
export const ashbyCandidateDeleteTrigger: TriggerConfig = {
|
||||
id: 'ashby_candidate_delete',
|
||||
name: 'Ashby Candidate Deleted',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a candidate is deleted',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_candidate_delete',
|
||||
eventType: 'Candidate Deleted',
|
||||
}),
|
||||
|
||||
outputs: buildCandidateDeleteOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildAshbySubBlocks, buildCandidateHireOutputs } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Candidate Hired Trigger
|
||||
*
|
||||
* Fires when a candidate is hired. Also triggers applicationUpdate
|
||||
* and candidateStageChange webhooks.
|
||||
*/
|
||||
export const ashbyCandidateHireTrigger: TriggerConfig = {
|
||||
id: 'ashby_candidate_hire',
|
||||
name: 'Ashby Candidate Hired',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a candidate is hired',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_candidate_hire',
|
||||
eventType: 'Candidate Hired',
|
||||
}),
|
||||
|
||||
outputs: buildCandidateHireOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildAshbySubBlocks, buildCandidateStageChangeOutputs } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Candidate Stage Change Trigger
|
||||
*
|
||||
* Fires when a candidate moves to a different interview stage.
|
||||
* Also triggered by candidateHire events.
|
||||
*/
|
||||
export const ashbyCandidateStageChangeTrigger: TriggerConfig = {
|
||||
id: 'ashby_candidate_stage_change',
|
||||
name: 'Ashby Candidate Stage Change',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a candidate changes interview stages',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_candidate_stage_change',
|
||||
eventType: 'Candidate Stage Change',
|
||||
}),
|
||||
|
||||
outputs: buildCandidateStageChangeOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export { ashbyApplicationSubmitTrigger } from './application_submit'
|
||||
export { ashbyCandidateDeleteTrigger } from './candidate_delete'
|
||||
export { ashbyCandidateHireTrigger } from './candidate_hire'
|
||||
export { ashbyCandidateStageChangeTrigger } from './candidate_stage_change'
|
||||
export { ashbyJobCreateTrigger } from './job_create'
|
||||
export { ashbyOfferCreateTrigger } from './offer_create'
|
||||
@@ -0,0 +1,31 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildAshbySubBlocks, buildJobCreateOutputs } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Job Created Trigger
|
||||
*
|
||||
* Fires when a new job posting is created in Ashby.
|
||||
*/
|
||||
export const ashbyJobCreateTrigger: TriggerConfig = {
|
||||
id: 'ashby_job_create',
|
||||
name: 'Ashby Job Created',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a new job is created',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_job_create',
|
||||
eventType: 'Job Created',
|
||||
}),
|
||||
|
||||
outputs: buildJobCreateOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { AshbyIcon } from '@/components/icons'
|
||||
import { buildAshbySubBlocks, buildOfferCreateOutputs } from '@/triggers/ashby/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Ashby Offer Created Trigger
|
||||
*
|
||||
* Fires when a new offer is created for a candidate.
|
||||
*/
|
||||
export const ashbyOfferCreateTrigger: TriggerConfig = {
|
||||
id: 'ashby_offer_create',
|
||||
name: 'Ashby Offer Created',
|
||||
provider: 'ashby',
|
||||
description: 'Trigger workflow when a new offer is created',
|
||||
version: '1.0.0',
|
||||
icon: AshbyIcon,
|
||||
|
||||
subBlocks: buildAshbySubBlocks({
|
||||
triggerId: 'ashby_offer_create',
|
||||
eventType: 'Offer Created',
|
||||
}),
|
||||
|
||||
outputs: buildOfferCreateOutputs(),
|
||||
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
import type { SubBlockConfig } from '@/blocks/types'
|
||||
import type { TriggerOutput } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Dropdown options for the Ashby trigger type selector.
|
||||
*/
|
||||
export const ashbyTriggerOptions = [
|
||||
{ label: 'Application Submitted', id: 'ashby_application_submit' },
|
||||
{ label: 'Candidate Stage Change', id: 'ashby_candidate_stage_change' },
|
||||
{ label: 'Candidate Hired', id: 'ashby_candidate_hire' },
|
||||
{ label: 'Candidate Deleted', id: 'ashby_candidate_delete' },
|
||||
{ label: 'Job Created', id: 'ashby_job_create' },
|
||||
{ label: 'Offer Created', id: 'ashby_offer_create' },
|
||||
]
|
||||
|
||||
/**
|
||||
* Maps Sim trigger IDs to Ashby webhookType / event action values.
|
||||
* Used by webhook.create body and matchEvent filtering.
|
||||
*/
|
||||
export const ASHBY_TRIGGER_ACTION_MAP: Record<string, string> = {
|
||||
ashby_application_submit: 'applicationSubmit',
|
||||
ashby_candidate_stage_change: 'candidateStageChange',
|
||||
ashby_candidate_hire: 'candidateHire',
|
||||
ashby_candidate_delete: 'candidateDelete',
|
||||
ashby_job_create: 'jobCreate',
|
||||
ashby_offer_create: 'offerCreate',
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an Ashby webhook event matches the configured trigger.
|
||||
* Ashby sends a ping event on webhook create/edit; this filter rejects
|
||||
* any event whose `action` does not equal the expected webhookType.
|
||||
*/
|
||||
export function isAshbyEventMatch(triggerId: string, action: string): boolean {
|
||||
const expected = ASHBY_TRIGGER_ACTION_MAP[triggerId]
|
||||
if (!expected) return false
|
||||
return expected === action
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates setup instructions for Ashby webhooks.
|
||||
* Webhooks are automatically created/deleted via the Ashby API.
|
||||
*/
|
||||
export function ashbySetupInstructions(eventType: string): string {
|
||||
const instructions = [
|
||||
'Enter your Ashby API Key above. You can find your API key in Ashby at <strong>Settings > API Keys</strong>.',
|
||||
`The webhook for <strong>${eventType}</strong> events will be automatically created in Ashby when you save the trigger.`,
|
||||
'The webhook will be automatically deleted if you remove this trigger.',
|
||||
]
|
||||
|
||||
return instructions
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join('')
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the complete subBlocks array for an Ashby trigger.
|
||||
* Ashby webhooks are managed via API, so no webhook URL is displayed.
|
||||
*
|
||||
* Structure: [dropdown?] -> apiKey -> instructions
|
||||
*/
|
||||
export function buildAshbySubBlocks(options: {
|
||||
triggerId: string
|
||||
eventType: string
|
||||
includeDropdown?: boolean
|
||||
}): SubBlockConfig[] {
|
||||
const { triggerId, eventType, includeDropdown = false } = options
|
||||
const blocks: SubBlockConfig[] = []
|
||||
|
||||
if (includeDropdown) {
|
||||
blocks.push({
|
||||
id: 'selectedTriggerId',
|
||||
title: 'Trigger Type',
|
||||
type: 'dropdown',
|
||||
mode: 'trigger',
|
||||
options: ashbyTriggerOptions,
|
||||
value: () => triggerId,
|
||||
required: true,
|
||||
})
|
||||
}
|
||||
|
||||
blocks.push({
|
||||
id: 'apiKey',
|
||||
title: 'API Key',
|
||||
type: 'short-input',
|
||||
placeholder: 'Enter your Ashby API key',
|
||||
password: true,
|
||||
required: true,
|
||||
paramVisibility: 'user-only',
|
||||
mode: 'trigger',
|
||||
condition: { field: 'selectedTriggerId', value: triggerId },
|
||||
})
|
||||
|
||||
blocks.push({
|
||||
id: 'triggerInstructions',
|
||||
title: 'Setup Instructions',
|
||||
hideFromPreview: true,
|
||||
type: 'text',
|
||||
defaultValue: ashbySetupInstructions(eventType),
|
||||
mode: 'trigger',
|
||||
condition: { field: 'selectedTriggerId', value: triggerId },
|
||||
})
|
||||
|
||||
return blocks
|
||||
}
|
||||
|
||||
/**
|
||||
* Core fields present in all Ashby webhook payloads.
|
||||
*/
|
||||
const coreOutputs = {
|
||||
action: {
|
||||
type: 'string',
|
||||
description: 'The webhook event type (e.g., applicationSubmit, candidateHire)',
|
||||
},
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Build outputs for applicationSubmit events.
|
||||
* Payload: { action, data: { application: { id, createdAt, updatedAt, status,
|
||||
* candidate: { id, name }, currentInterviewStage: { id, title },
|
||||
* job: { id, title } } } }
|
||||
*/
|
||||
export function buildApplicationSubmitOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
application: {
|
||||
id: { type: 'string', description: 'Application UUID' },
|
||||
createdAt: { type: 'string', description: 'Application creation timestamp (ISO 8601)' },
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
description: 'Application last update timestamp (ISO 8601)',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'Application status (Active, Hired, Archived, Lead)',
|
||||
},
|
||||
candidate: {
|
||||
id: { type: 'string', description: 'Candidate UUID' },
|
||||
name: { type: 'string', description: 'Candidate name' },
|
||||
},
|
||||
currentInterviewStage: {
|
||||
id: { type: 'string', description: 'Current interview stage UUID' },
|
||||
title: { type: 'string', description: 'Current interview stage title' },
|
||||
stageType: {
|
||||
type: 'string',
|
||||
description: 'Current interview stage type (e.g., Lead, Applied, Interview, Offer)',
|
||||
},
|
||||
},
|
||||
job: {
|
||||
id: { type: 'string', description: 'Job UUID' },
|
||||
title: { type: 'string', description: 'Job title' },
|
||||
},
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
|
||||
/**
|
||||
* Build outputs for candidateStageChange events.
|
||||
* Payload matches the application object structure (same as applicationUpdate).
|
||||
* Payload: { action, data: { application: { id, createdAt, updatedAt, status,
|
||||
* candidate: { id, name }, currentInterviewStage: { id, title, type },
|
||||
* job: { id, title } } } }
|
||||
*/
|
||||
export function buildCandidateStageChangeOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
application: {
|
||||
id: { type: 'string', description: 'Application UUID' },
|
||||
createdAt: { type: 'string', description: 'Application creation timestamp (ISO 8601)' },
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
description: 'Application last update timestamp (ISO 8601)',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'Application status (Active, Hired, Archived, Lead)',
|
||||
},
|
||||
candidate: {
|
||||
id: { type: 'string', description: 'Candidate UUID' },
|
||||
name: { type: 'string', description: 'Candidate name' },
|
||||
},
|
||||
currentInterviewStage: {
|
||||
id: { type: 'string', description: 'Current interview stage UUID' },
|
||||
title: { type: 'string', description: 'Current interview stage title' },
|
||||
stageType: {
|
||||
type: 'string',
|
||||
description: 'Current interview stage type (e.g., Lead, Applied, Interview, Offer)',
|
||||
},
|
||||
},
|
||||
job: {
|
||||
id: { type: 'string', description: 'Job UUID' },
|
||||
title: { type: 'string', description: 'Job title' },
|
||||
},
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
|
||||
/**
|
||||
* Build outputs for candidateHire events.
|
||||
* Per Ashby docs, candidateHire payloads include application details and most
|
||||
* recent accepted offer information.
|
||||
*/
|
||||
export function buildCandidateHireOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
application: {
|
||||
id: { type: 'string', description: 'Application UUID' },
|
||||
createdAt: { type: 'string', description: 'Application creation timestamp (ISO 8601)' },
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
description: 'Application last update timestamp (ISO 8601)',
|
||||
},
|
||||
status: { type: 'string', description: 'Application status (Hired)' },
|
||||
candidate: {
|
||||
id: { type: 'string', description: 'Candidate UUID' },
|
||||
name: { type: 'string', description: 'Candidate name' },
|
||||
},
|
||||
currentInterviewStage: {
|
||||
id: { type: 'string', description: 'Current interview stage UUID' },
|
||||
title: { type: 'string', description: 'Current interview stage title' },
|
||||
stageType: {
|
||||
type: 'string',
|
||||
description: 'Current interview stage type (e.g., Lead, Applied, Interview, Offer)',
|
||||
},
|
||||
},
|
||||
job: {
|
||||
id: { type: 'string', description: 'Job UUID' },
|
||||
title: { type: 'string', description: 'Job title' },
|
||||
},
|
||||
},
|
||||
offer: {
|
||||
id: { type: 'string', description: 'Accepted offer UUID' },
|
||||
applicationId: { type: 'string', description: 'Associated application UUID' },
|
||||
acceptanceStatus: { type: 'string', description: 'Offer acceptance status' },
|
||||
offerStatus: { type: 'string', description: 'Offer process status' },
|
||||
decidedAt: {
|
||||
type: 'string',
|
||||
description: 'Offer decision timestamp (ISO 8601)',
|
||||
},
|
||||
latestVersion: {
|
||||
id: { type: 'string', description: 'Latest offer version UUID' },
|
||||
},
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
|
||||
/**
|
||||
* Build outputs for candidateDelete events.
|
||||
* Payload: { action, data: { candidate: { id } } }
|
||||
*/
|
||||
export function buildCandidateDeleteOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
candidate: {
|
||||
id: { type: 'string', description: 'Deleted candidate UUID' },
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
|
||||
/**
|
||||
* Build outputs for jobCreate events.
|
||||
* Payload: { action, data: { job: { id, title, confidential, status, employmentType } } }
|
||||
*/
|
||||
export function buildJobCreateOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
job: {
|
||||
id: { type: 'string', description: 'Job UUID' },
|
||||
title: { type: 'string', description: 'Job title' },
|
||||
confidential: { type: 'boolean', description: 'Whether the job is confidential' },
|
||||
status: { type: 'string', description: 'Job status (Open, Closed, Draft, Archived)' },
|
||||
employmentType: {
|
||||
type: 'string',
|
||||
description: 'Employment type (FullTime, PartTime, Intern, Contract)',
|
||||
},
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
|
||||
/**
|
||||
* Build outputs for offerCreate events.
|
||||
* Payload: { action, data: { offer: { id, decidedAt, applicationId, acceptanceStatus,
|
||||
* offerStatus, latestVersion: { id } } } }
|
||||
*/
|
||||
export function buildOfferCreateOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
...coreOutputs,
|
||||
offer: {
|
||||
id: { type: 'string', description: 'Offer UUID' },
|
||||
applicationId: { type: 'string', description: 'Associated application UUID' },
|
||||
acceptanceStatus: {
|
||||
type: 'string',
|
||||
description: 'Offer acceptance status (Accepted, Declined, Pending, Created, Cancelled)',
|
||||
},
|
||||
offerStatus: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Offer process status (WaitingOnApprovalStart, WaitingOnOfferApproval, WaitingOnApprovalDefinition, WaitingOnCandidateResponse, CandidateRejected, CandidateAccepted, OfferCancelled)',
|
||||
},
|
||||
decidedAt: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Offer decision timestamp (ISO 8601). Typically null at creation; populated after candidate responds.',
|
||||
},
|
||||
latestVersion: {
|
||||
id: { type: 'string', description: 'Latest offer version UUID' },
|
||||
},
|
||||
},
|
||||
} as Record<string, TriggerOutput>
|
||||
}
|
||||
Reference in New Issue
Block a user