<commit_before>/* eslint-disable no-use-before-define, no-param-reassign, global-require */

import type { ObjectTypeComposer, InputTypeComposer, SchemaComposer } from 'graphql-compose';
import { schemaComposer as globalSchemaComposer } from 'graphql-compose';
import type { Model } from 'mongoose';
import { convertModelToGraphQL } from './fieldsConverter';
import * as resolvers from './resolvers';
import type {
  FilterHelperArgsOpts,
  LimitHelperArgsOpts,
  SortHelperArgsOpts,
  RecordHelperArgsOpts,
} from './resolvers/helpers';
import MongoID from './types/MongoID';
import type { PaginationResolverOpts } from './resolvers/pagination';
import type { ConnectionOpts } from './resolvers/connection';

export type ComposeWithMongooseOpts<TContext> = {
  schemaComposer?: SchemaComposer<TContext>;
  name?: string;
  description?: string;
  fields?: {
    only?: string[];
    // rename?: { [oldName: string]: string },
    remove?: string[];
  };
  inputType?: TypeConverterInputTypeOpts;
  resolvers?: false | TypeConverterResolversOpts;
};

export type TypeConverterInputTypeOpts = {
  name?: string;
  description?: string;
  fields?: {
    only?: string[];
    remove?: string[];
    required?: string[];
  };
};

export type TypeConverterResolversOpts = {
  findById?: false;
  findByIds?:
    | false
    | {
        limit?: LimitHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
      };
  findOne?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  findMany?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;
      };
  findByIdLean?: false;
  findByIdsLean?:
    | false
    | {
        limit?: LimitHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
      };
  findOneLean?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  findManyLean?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;
      };
  updateById?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
      };
  updateOne?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  updateMany?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;<commit_msg>chore: fix typescript typings errors<commit_after>/* eslint-disable no-use-before-define, no-param-reassign, global-require */

import type { ObjectTypeComposer, InputTypeComposer, SchemaComposer } from 'graphql-compose';
import { schemaComposer as globalSchemaComposer } from 'graphql-compose';
import type { Model } from 'mongoose';
import { convertModelToGraphQL } from './fieldsConverter';
import * as resolvers from './resolvers';
import type {
  FilterHelperArgsOpts,
  LimitHelperArgsOpts,
  SortHelperArgsOpts,
  RecordHelperArgsOpts,
} from './resolvers/helpers';
import MongoID from './types/MongoID';
import type { PaginationResolverOpts } from './resolvers/pagination';
import type { ConnectionOpts } from './resolvers/connection';

export type ComposeWithMongooseOpts<TContext> = {
  schemaComposer?: SchemaComposer<TContext>;
  name?: string;
  description?: string;
  fields?: {
    only?: string[];
    // rename?: { [oldName: string]: string },
    remove?: string[];
  };
  inputType?: TypeConverterInputTypeOpts;
  resolvers?: false | TypeConverterResolversOpts;
};

export type TypeConverterInputTypeOpts = {
  name?: string;
  description?: string;
  fields?: {
    only?: string[];
    remove?: string[];
    required?: string[];
  };
};

export type TypeConverterResolversOpts = {
  findById?: false;
  findByIds?:
    | false
    | {
        limit?: LimitHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
      };
  findOne?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  findMany?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;
      };
  findByIdLean?: false;
  findByIdsLean?:
    | false
    | {
        limit?: LimitHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
      };
  findOneLean?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  findManyLean?:
    | false
    | {
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;
      };
  dataLoader?: false;
  dataLoaderLean?: false;
  dataLoaderMany?: false;
  dataLoaderManyLean?: false;
  updateById?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
      };
  updateOne?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        skip?: false;
      };
  updateMany?:
    | false
    | {
        record?: RecordHelperArgsOpts | false;
        filter?: FilterHelperArgsOpts | false;
        sort?: SortHelperArgsOpts | false;
        limit?: LimitHelperArgsOpts | false;
        skip?: false;
{'fraction_non_alphanumeric': 0.11855047454702329, 'fraction_numerical': 0.0, 'mean_word_length': 2.887323943661972, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6509371', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1737, 'n_words': 399}