Skip to content

Commit

Permalink
Added Greenhouse API types.
Browse files Browse the repository at this point in the history
They can be imported as:
```typescript
import type { Greenhose } from 'ts-utils';
```

And each interface can be accessed like:
```typescript
const job: Greenhouse.Job = {};
```
  • Loading branch information
alexiglesias93 committed May 23, 2022
1 parent b9cbdae commit d9b4904
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 2 deletions.
84 changes: 84 additions & 0 deletions dist/types/apis/Greenhouse.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
export interface DepartmentsResponse {
departments: Department[];
}
export interface JobsResponse {
jobs: Job[] | JobWithContent[];
meta: {
total: number;
};
}
export interface JobUniqueResponse {
job: JobWithContent | JobWithQuestions;
}
export interface OfficesResponse {
offices: Office[];
}
export interface Job {
id: number;
internal_job_id: number;
title: string;
updated_at: string;
requisition_id: string;
absolute_url: string;
metadata: null;
location: {
name: string;
};
data_compliance: DataCompliance[];
}
interface DataCompliance {
type: 'gdpr';
requires_consent: boolean;
retention_period: number | null;
}
export interface JobWithContent extends Job {
content: string;
departments: Department[];
offices: Office[];
}
export interface JobWithQuestions extends JobWithContent {
questions: Question[];
compliance: ComplianceQuestions[];
location_questions: Question[];
demographic_questions: DemographicQuestions | null;
}
export interface Question {
label: string;
description: string | null;
fields: Field[];
required: boolean;
}
export interface Field {
name: string;
type: 'input_file' | 'input_text' | 'input_hidden' | 'textarea' | 'multi_value_single_select' | 'multi_value_multi_select';
values?: FieldValue[];
}
interface FieldValue {
value: number;
label: string;
}
interface ComplianceQuestions {
description: string;
questions: Question[];
type: string;
}
interface DemographicQuestions {
header: string;
description: string;
questions: Question[];
}
export interface Department {
id: number;
name: string;
parent_id: number;
child_ids: number[];
jobs: Job[];
}
export interface Office {
id: number;
name: string;
departments: Department[];
parent_id: number | null;
child_ids: number[];
}
export {};
1 change: 1 addition & 0 deletions dist/types/apis/Greenhouse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions dist/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export type { PartialExcept } from './PartialExcept';
export type { PickPartial } from './PickPartial';
export type { PickRequired } from './PickRequired';
export type { RequiredExcept } from './RequiredExcept';
export * as Greenhouse from './apis/Greenhouse';
2 changes: 1 addition & 1 deletion dist/types/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {};
export * as Greenhouse from './apis/Greenhouse';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finsweet/ts-utils",
"version": "0.31.4",
"version": "0.32.0",
"description": "Typescript utils for custom Webflow projects.",
"type": "module",
"main": "dist/index.js",
Expand Down
File renamed without changes.

0 comments on commit d9b4904

Please sign in to comment.