<commit_before>import indent from 'indent-string'
import path from 'path'
import { DMMFClass } from '../runtime/dmmf'
import { DMMF } from '../runtime/dmmf-types'

export enum Projection {
  select = 'select',
  include = 'include',
}

export function getScalarsName(modelName: string): string {
  return `${modelName}Scalars`
}

export function getPayloadName(modelName: string): string {
  return `${modelName}GetPayload`
}

// export function getExtractName(modelName: string, projection: Projection) {
//   return `Extract${modelName}${capitalize(projection)}`
// }

export function getSelectName(modelName: string): string {
  return `${modelName}Select`
}

export function getAggregateName(modelName: string): string {
  return `Aggregate${capitalize(modelName)}`
}

export function getAvgAggregateName(modelName: string): string {
  return `${capitalize(modelName)}AvgAggregateOutputType`
}

export function getSumAggregateName(modelName: string): string {
  return `${capitalize(modelName)}SumAggregateOutputType`
}

export function getMinAggregateName(modelName: string): string {
  return `${capitalize(modelName)}MinAggregateOutputType`
}

export function getMaxAggregateName(modelName: string): string {
  return `${capitalize(modelName)}MaxAggregateOutputType`
}

export function getAggregateInputType(aggregateOutputType: string): string {
  return aggregateOutputType.replace(/OutputType$/, 'InputType')
}

export function getAggregateArgsName(modelName: string): string {
  return `Aggregate${modelName}Args`
}

export function getAggregateGetName(modelName: string): string {
  return `Get${modelName}AggregateType`
}

export function getAggregateScalarGetName(modelName: string): string {
  return `Get${modelName}AggregateScalarType`
}

export function getIncludeName(modelName: string): string {
  return `${modelName}Include`
}

export function getDefaultName(modelName: string): string {
  return `${modelName}Default`
}

export function getFieldArgName(field: DMMF.SchemaField): string {
  return getArgName(
    (field.outputType.type as DMMF.OutputType).name,
    field.outputType.isList,
  )
}

export function getArgName(name: string, isList: boolean): string {
  if (!isList) {
    return `${name}Args`<commit_msg>fix(client): unify aggregate type names<commit_after>import indent from 'indent-string'
import path from 'path'
import { DMMFClass } from '../runtime/dmmf'
import { DMMF } from '../runtime/dmmf-types'

export enum Projection {
  select = 'select',
  include = 'include',
}

export function getScalarsName(modelName: string): string {
  return `${modelName}Scalars`
}

export function getPayloadName(modelName: string): string {
  return `${modelName}GetPayload`
}

// export function getExtractName(modelName: string, projection: Projection) {
//   return `Extract${modelName}${capitalize(projection)}`
// }

export function getSelectName(modelName: string): string {
  return `${modelName}Select`
}

export function getAggregateName(modelName: string): string {
  return `Aggregate${capitalize(modelName)}`
}

export function getAvgAggregateName(modelName: string): string {
  return `${capitalize(modelName)}AvgAggregateOutputType`
}

export function getSumAggregateName(modelName: string): string {
  return `${capitalize(modelName)}SumAggregateOutputType`
}

export function getMinAggregateName(modelName: string): string {
  return `${capitalize(modelName)}MinAggregateOutputType`
}

export function getMaxAggregateName(modelName: string): string {
  return `${capitalize(modelName)}MaxAggregateOutputType`
}

export function getAggregateInputType(aggregateOutputType: string): string {
  return aggregateOutputType.replace(/OutputType$/, 'InputType')
}

export function getAggregateArgsName(modelName: string): string {
  return `Aggregate${capitalize(modelName)}Args`
}

export function getAggregateGetName(modelName: string): string {
  return `Get${capitalize(modelName)}AggregateType`
}

export function getAggregateScalarGetName(modelName: string): string {
  return `Get${capitalize(modelName)}AggregateScalarType`
}

export function getIncludeName(modelName: string): string {
  return `${modelName}Include`
}

export function getDefaultName(modelName: string): string {
  return `${modelName}Default`
}

export function getFieldArgName(field: DMMF.SchemaField): string {
  return getArgName(
    (field.outputType.type as DMMF.OutputType).name,
    field.outputType.isList,
  )
}

export function getArgName(name: string, isList: boolean): string {
  if (!isList) {
    return `${name}Args`
{'fraction_non_alphanumeric': 0.11680598328200616, 'fraction_numerical': 0.0, 'mean_word_length': 6.6937394247038915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5385387', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1391, 'n_words': 307}