<commit_before>/**
 * The object produced when calling JSON.parse on the react-props of a search results page.
 */
export interface SearchResultsApiResponse {
  readonly baseUrl: string;
  readonly bodyData: WorkerSearchResult[];
}

/**
 * The object produced when calling JSON.parse on the react-props of a user's queue.
 */
export interface QueueApiResponse {
  readonly bodyData: WorkerQueueItem[];
  readonly tableConfig: TableConfig[];
}

/**
 * The object produced when calling JSON.parse on the react-props of an accepted HIT's details modal.
 */
export interface HitDetailsApiResponse {
  readonly children: string;
  readonly modalHeader: string;
  readonly modalOptions: HitModalDetails;
}

export interface WorkerHit {
  readonly assignable_hits_count: number;
  readonly assignment_duration_in_seconds: number;
  readonly caller_meets_preview_requirements: boolean;
  readonly creation_time: string; // Date object converted to JSON string.
  readonly description: string;
  readonly hit_set_id: string;
  readonly last_updated_time: string;
  readonly latest_expiration_time: string;
  readonly monetary_reward: MonetaryReward;
  readonly requester_id: string;
  readonly requester_name: string;
  readonly requester_url: string;
  readonly title: string;
}

/**
 * hit_requirements is renamed to project_requirements in search results as of now.
 */
export interface WorkerHitNew extends WorkerHit {
  readonly project_requirements: WorkerQualification[];
}

export interface WorkerHitOld extends WorkerHit {
  readonly hit_requirements: WorkerQualification[];
}

export interface WorkerSearchResult extends WorkerHitNew {
  readonly accept_project_task_url: string;
  readonly project_tasks_url: string;
}

export interface WorkerQueueItem {
  readonly accepted_at: string; // Date object converted to JSON string.
  readonly assignment_id: string;
  readonly deadline: string; // Date object converted to JSON string.
  readonly expired_task_action_url: string;
  readonly project: WorkerHitOld;
  readonly question: QueueItemQuestion;
  readonly state: 'Assigned'; // Possibly others?;
  readonly time_to_deadline_in_seconds: number;
  readonly task_id: string;
  readonly task_url: string;
}

export interface MonetaryReward {
  readonly amount_in_dollars: number;
  readonly currency_code: string;
}

export interface WorkerQualification {
  readonly caller_meets_requirement: boolean;
  readonly comparator: QualificationComparator;
  readonly qualification_type: QualificationType;
  readonly qualification_type_id: string;
  readonly qualification_values: string[];
  readonly worker_action: string;
}

export interface QualificationType {
  readonly description: string;
  readonly has_test: boolean;
  readonly is_requestable: boolean;
  readonly keywords: string;
  readonly name: string;
  readonly qualification_type_id: string;
  readonly visibility: boolean;
}

export type QualificationComparator =
  | 'DoesNotExist'
  | 'EqualTo'
  | 'NotEqualTo'
  | 'GreaterThan'
  | 'GreaterThanOrEqualTo'
  | 'In';
// Possibly 'LessThan' and 'LessThanOrEqualTo'? I haven't seen one of those yet.

export interface WorkerSearchParams {
  readonly page_size: number;
  readonly page_number: number;
  readonly filters: Partial<WorkerSearchFilters>;
  readonly sort: WorkerSortParam;
}

export interface WorkerSearchFilters {
  readonly qualified: boolean;
  readonly min_reward: number;
  readonly masters: boolean;
  readonly search_term: string;
}

export type WorkerSortParam =
  | 'updated_asc'
  | 'updated_desc'
  | 'reward_asc'
  | 'reward_desc'
  | 'num_hits_asc'
  | 'num_hits_desc';

export interface TableConfig {<commit_msg>Update type definitions.<commit_after>/**
 * The object produced when calling JSON.parse on the react-props of a search results page.
 */
export interface SearchResultsApiResponse {
  readonly baseUrl: string;
  readonly bodyData: WorkerSearchResult[];
}

/**
 * The object produced when calling JSON.parse on the react-props of a user's queue.
 */
export interface QueueApiResponse {
  readonly bodyData: WorkerQueueItem[];
  readonly tableConfig: TableConfig[];
}

/**
 * The object produced when calling JSON.parse on the react-props of an accepted HIT's details modal.
 */
export interface AcceptedHitDetailsModal {
  readonly children: string;
  readonly modalHeader: string;
  readonly modalOptions: HitModalDetails;
}

/**
 * The object produced when calling JSON.parse on the react-props of an accepted HIT's time remaining.
 */
export interface WorkerAcceptedHitTimeRemaining {
  readonly className: string;
  readonly originalTimeToCompleteInSeconds: number;
  readonly timeRemainingInSeconds: number;
  readonly update: boolean;
}

export interface WorkerHit {
  readonly assignable_hits_count: number;
  readonly assignment_duration_in_seconds: number;
  readonly caller_meets_preview_requirements: boolean;
  readonly creation_time: string; // Date object converted to JSON string.
  readonly description: string;
  readonly hit_set_id: string;
  readonly last_updated_time: string;
  readonly latest_expiration_time: string;
  readonly monetary_reward: MonetaryReward;
  readonly requester_id: string;
  readonly requester_name: string;
  readonly requester_url: string;
  readonly title: string;
}

/**
 * hit_requirements is renamed to project_requirements in search results as of now.
 */
export interface WorkerHitNew extends WorkerHit {
  readonly project_requirements: WorkerQualification[];
}

export interface WorkerHitOld extends WorkerHit {
  readonly hit_requirements: WorkerQualification[];
}

export interface WorkerSearchResult extends WorkerHitNew {
  readonly accept_project_task_url: string;
  readonly project_tasks_url: string;
}

export interface WorkerQueueItem {
  readonly accepted_at: string; // Date object converted to JSON string.
  readonly assignment_id: string;
  readonly deadline: string; // Date object converted to JSON string.
  readonly expired_task_action_url: string;
  readonly project: WorkerHitOld;
  readonly question: QueueItemQuestion;
  readonly state: 'Assigned'; // Possibly others?;
  readonly time_to_deadline_in_seconds: number;
  readonly task_id: string;
  readonly task_url: string;
}

export interface MonetaryReward {
  readonly amount_in_dollars: number;
  readonly currency_code: string;
}

export interface WorkerQualification {
  readonly caller_meets_requirement: boolean;
  readonly comparator: QualificationComparator;
  readonly qualification_type: QualificationType;
  readonly qualification_type_id: string;
  readonly qualification_values: string[];
  readonly worker_action: string;
}

export interface QualificationType {
  readonly description: string;
  readonly has_test: boolean;
  readonly is_requestable: boolean;
  readonly keywords: string;
  readonly name: string;
  readonly qualification_type_id: string;
  readonly visibility: boolean;
}

export type QualificationComparator =
  | 'DoesNotExist'
  | 'EqualTo'
  | 'NotEqualTo'
  | 'GreaterThan'
  | 'GreaterThanOrEqualTo'
  | 'LessThan'
  | 'LessThanOrEqualTo'
  | 'In';

export interface WorkerSearchParams {
  readonly page_size: number;
  readonly page_number: number;
  readonly filters: Partial<WorkerSearchFilters>;
  readonly sort: WorkerSortParam;
}

export interface WorkerSearchFilters {
  readonly qualified: boolean;
  readonly min_reward: number;
  readonly masters: boolean;
  readonly search_term: string;
}

export type WorkerSortParam =
  | 'updated_asc'
  | 'updated_desc'
  | 'reward_asc'
  | 'reward_desc'
  | 'num_hits_asc'
  | 'num_hits_desc';

export interface TableConfig {
{'fraction_non_alphanumeric': 0.07031867263629181, 'fraction_numerical': 0.0, 'mean_word_length': 5.382352941176471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2612531', 'n_tokens_mistral': 2119, 'n_tokens_neox': 2125, 'n_words': 667}