Skip to content

Commit 3af7dec

Browse files
waleedlatif1claude
andcommitted
fix(ashby): restore documented response fields dropped during refactor
Restore three fields that exist in Ashby's API responses but were dropped during the recent refactor: applicationLimitCalloutHtml on /jobPosting.info, compensation on /job.info (and add the `compensation` expand), and managerId on /user.list. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 5ab87a9 commit 3af7dec

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

apps/sim/tools/ashby/get_job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const getJobTool: ToolConfig<AshbyGetJobParams, AshbyGetJobResponse> = {
2929
headers: (params) => ashbyAuthHeaders(params.apiKey),
3030
body: (params) => ({
3131
id: params.jobId.trim(),
32-
expand: ['openings', 'location'],
32+
expand: ['openings', 'location', 'compensation'],
3333
}),
3434
},
3535

apps/sim/tools/ashby/get_job_posting.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ interface AshbyJobPosting {
6464
}>
6565
shouldDisplayCompensationOnJobBoard: boolean
6666
} | null
67+
applicationLimitCalloutHtml: string | null
6768
updatedAt: string | null
6869
job: Record<string, unknown> | null
6970
}
@@ -218,6 +219,7 @@ export const getJobPostingTool: ToolConfig<AshbyGetJobPostingParams, AshbyGetJob
218219
(comp.shouldDisplayCompensationOnJobBoard as boolean) ?? false,
219220
}
220221
: null,
222+
applicationLimitCalloutHtml: (r.applicationLimitCalloutHtml as string) ?? null,
221223
updatedAt: (r.updatedAt as string) ?? null,
222224
job: (r.job as Record<string, unknown>) ?? null,
223225
},
@@ -400,6 +402,11 @@ export const getJobPostingTool: ToolConfig<AshbyGetJobPostingParams, AshbyGetJob
400402
},
401403
},
402404
},
405+
applicationLimitCalloutHtml: {
406+
type: 'string',
407+
description: 'HTML callout shown when the application limit is reached',
408+
optional: true,
409+
},
403410
updatedAt: {
404411
type: 'string',
405412
description: 'ISO 8601 last update timestamp',

apps/sim/tools/ashby/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface AshbyUserSummary {
4343
globalRole: string | null
4444
isEnabled: boolean
4545
updatedAt: string | null
46+
managerId: string | null
4647
}
4748

4849
export interface AshbySourceSummary {
@@ -227,6 +228,13 @@ export interface AshbyOpening {
227228
latestVersion: AshbyOpeningLatestVersion | null
228229
}
229230

231+
export interface AshbyJobCompensationTier {
232+
id: string | null
233+
title: string | null
234+
additionalInformation: string | null
235+
tierSummary: string | null
236+
}
237+
230238
export interface AshbyJob {
231239
id: string
232240
title: string
@@ -249,6 +257,9 @@ export interface AshbyJob {
249257
closedAt: string | null
250258
location: AshbyJobLocation | null
251259
openings: AshbyOpening[]
260+
compensation: {
261+
compensationTiers: AshbyJobCompensationTier[]
262+
} | null
252263
}
253264

254265
export interface AshbyListJobsResponse extends ToolResponse {

apps/sim/tools/ashby/utils.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export function mapUserSummary(raw: unknown): AshbyUserSummary | null {
9999
globalRole: (u.globalRole as string) ?? null,
100100
isEnabled: (u.isEnabled as boolean) ?? false,
101101
updatedAt: (u.updatedAt as string) ?? null,
102+
managerId: (u.managerId as string) ?? null,
102103
}
103104
}
104105

@@ -233,6 +234,7 @@ export function mapJob(raw: unknown): AshbyJob {
233234
const location = j.location as Unknown | undefined
234235
const address = location?.address as Unknown | undefined
235236
const postalAddress = address?.postalAddress as Unknown | undefined
237+
const compensation = j.compensation as Unknown | undefined
236238
return {
237239
id: (j.id as string) ?? '',
238240
title: (j.title as string) ?? '',
@@ -275,6 +277,25 @@ export function mapJob(raw: unknown): AshbyJob {
275277
}
276278
: null,
277279
openings: mapOpenings(j.openings),
280+
compensation: compensation
281+
? {
282+
compensationTiers: Array.isArray(compensation.compensationTiers)
283+
? (
284+
compensation.compensationTiers as Array<{
285+
id?: string
286+
title?: string
287+
additionalInformation?: string
288+
tierSummary?: string
289+
}>
290+
).map((t) => ({
291+
id: t.id ?? null,
292+
title: t.title ?? null,
293+
additionalInformation: t.additionalInformation ?? null,
294+
tierSummary: t.tierSummary ?? null,
295+
}))
296+
: [],
297+
}
298+
: null,
278299
}
279300
}
280301

@@ -403,6 +424,7 @@ export const USER_SUMMARY_OUTPUT = {
403424
globalRole: { type: 'string', description: 'Role', optional: true },
404425
isEnabled: { type: 'boolean', description: 'Whether enabled' },
405426
updatedAt: { type: 'string', description: 'Last update timestamp', optional: true },
427+
managerId: { type: 'string', description: "User ID of the user's manager", optional: true },
406428
},
407429
} as const satisfies OutputProperty
408430

@@ -859,4 +881,33 @@ export const JOB_OUTPUTS = {
859881
},
860882
},
861883
openings: OPENINGS_OUTPUT,
884+
compensation: {
885+
type: 'object',
886+
description:
887+
'Compensation tiers for the job. Only present when the request includes the `compensation` expand parameter.',
888+
optional: true,
889+
properties: {
890+
compensationTiers: {
891+
type: 'array',
892+
description: 'List of compensation tiers',
893+
items: {
894+
type: 'object',
895+
properties: {
896+
id: { type: 'string', description: 'Tier ID', optional: true },
897+
title: { type: 'string', description: 'Tier title', optional: true },
898+
additionalInformation: {
899+
type: 'string',
900+
description: 'Additional information about the tier',
901+
optional: true,
902+
},
903+
tierSummary: {
904+
type: 'string',
905+
description: 'Human-readable summary of the tier',
906+
optional: true,
907+
},
908+
},
909+
},
910+
},
911+
},
912+
},
862913
} as const satisfies Record<string, OutputProperty>

0 commit comments

Comments
 (0)