/* tslint:disable */
/* eslint-disable */

export type ValueTypes = {
    ["AccountGenderEnum"]:AccountGenderEnum;
	["AccountModel"]: AliasType<{
	_id?:true,
	organisationId?:true,
	createdBy?:true,
	updatedBy?:true,
	deletedBy?:true,
	createdAt?:true,
	updatedAt?:true,
	r?:true,
	w?:true,
	d?:true,
	types?:true,
	organisationIds?:true,
	email?:true,
	userName?:true,
	firstName?:true,
	lastName?:true,
	profilePicture?:ValueTypes["ImageComponent"],
	phoneNumber?:true,
	gender?:true,
	birthDate?:true,
	getAge?:true,
	address?:ValueTypes["AddressComponent"],
	language?:true,
	settings?:ValueTypes["SettingsComponent"],
	securityCheck?:true,
	organisation?:true,
	position?:true,
	profileCompleted?:true,
		__typename?: true
}>;
	["AccountTypeEnum"]:AccountTypeEnum;
	["AddressComponent"]: AliasType<{
	number?:true,
	street?:true,
	streetBis?:true,
	floor?:true,
	box?:true,
	zip?:true,
	state?:true,
	city?:true,
	country?:true,
		__typename?: true
}>;
	["AvailableTranslation"]:AvailableTranslation;
	/** The javascript `Date` as string. Type represents date and time as the ISO Date string. */
["DateTime"]:unknown;
	["EngineFileInitOutput"]: AliasType<{
	uploadUrl?:true,
	file?:ValueTypes["EngineFileSchema"],
		__typename?: true
}>;
	["EngineFileSchema"]: AliasType<{
	accountId?:true,
	mime?:true,
	fileName?:true,
	fileNameMedium?:true,
	fileNameSmall?:true,
	large?:true,
	medium?:true,
	small?:true,
	account?:ValueTypes["AccountModel"],
	_id?:true,
	organisationId?:true,
	paths?:ValueTypes["EnginePathComponent"],
	by?:ValueTypes["MetaBy"],
	permissions?:ValueTypes["MetaPermissions"],
	createdAt?:true,
	updatedAt?:true,
	tagsIds?:true,
	getTags?:ValueTypes["TagSchema"],
getUrl?: [{	size?:ValueTypes["FileSize"]},true],
		__typename?: true
}>;
	["EnginePathComponent"]: AliasType<{
	ressourceModel?:true,
	ressourceId?:true,
		__typename?: true
}>;
	["FileSize"]:FileSize;
	["FilesRessourceEnum"]:FilesRessourceEnum;
	["GetArgs"]: {
	limit:number,
	skip:number,
	sort?:string
};
	["IEngineSchema"]:AliasType<{
		_id?:true,
	organisationId?:true,
	paths?:ValueTypes["EnginePathComponent"],
	by?:ValueTypes["MetaBy"],
	permissions?:ValueTypes["MetaPermissions"],
	createdAt?:true,
	updatedAt?:true,
	tagsIds?:true;
		['...on EngineFileSchema']?: Omit<ValueTypes["EngineFileSchema"],keyof ValueTypes["IEngineSchema"]>;
		['...on TagSchema']?: Omit<ValueTypes["TagSchema"],keyof ValueTypes["IEngineSchema"]>;
		__typename?: true
}>;
	["ImageComponent"]: AliasType<{
	title?:true,
	fileType?:true,
	large?:true,
	medium?:true,
	small?:true,
		__typename?: true
}>;
	["MetaBy"]: AliasType<{
	createdBy?:true,
	updatedBy?:true,
	deletedBy?:true,
		__typename?: true
}>;
	["MetaPermissions"]: AliasType<{
	r?:true,
	w?:true,
	d?:true,
		__typename?: true
}>;
	["ModelLoadersEnum"]:ModelLoadersEnum;
	["Mutation"]: AliasType<{
filesInitUpload?: [{	input:ValueTypes["NewFileUploadInitInput"]},ValueTypes["EngineFileInitOutput"]],
		__typename?: true
}>;
	["NewFileUploadInitInput"]: {
	ressourceModel?:ValueTypes["FilesRessourceEnum"],
	ressourceId?:string,
	fileName:string,
	privateFile?:boolean,
	tagsIds?:string[]
};
	["Query"]: AliasType<{
filesGetMine?: [{	pagination?:ValueTypes["GetArgs"],	sharedWith?:string,	tagsIds?:string[],	search?:string},ValueTypes["EngineFileSchema"]],
filesGetMineCount?: [{	pagination?:ValueTypes["GetArgs"],	sharedWith?:string,	tagsIds?:string[],	search?:string},true],
filesGetSharedWithMe?: [{	pagination?:ValueTypes["GetArgs"],	sharedWith?:string,	tagsIds?:string[],	search?:string},ValueTypes["EngineFileSchema"]],
filesGetSharedWithMeCount?: [{	pagination?:ValueTypes["GetArgs"],	sharedWith?:string,	tagsIds?:string[],	search?:string},true],
filesGetOne?: [{	id:string},ValueTypes["EngineFileSchema"]],
		__typename?: true
}>;
	["SettingsComponent"]: AliasType<{
	type?:true,
	email?:true,
	pushNotifications?:true,
	sms?:true,
		__typename?: true
}>;
	["SettingsTypeEnum"]:SettingsTypeEnum;
	["TagSchema"]: AliasType<{
	title?:true,
	_id?:true,
	organisationId?:true,
	paths?:ValueTypes["EnginePathComponent"],
	by?:ValueTypes["MetaBy"],
	permissions?:ValueTypes["MetaPermissions"],
	createdAt?:true,
	updatedAt?:true,
	tagsIds?:true,
		__typename?: true
}>
  }

export type PartialObjects = {
    ["AccountGenderEnum"]:AccountGenderEnum,
	["AccountModel"]: {
		__typename?: "AccountModel";
			_id?:string,
			organisationId?:string,
			createdBy?:string,
			updatedBy?:string,
			deletedBy?:string,
			createdAt?:PartialObjects["DateTime"],
			updatedAt?:PartialObjects["DateTime"],
			r?:string[],
			w?:string[],
			d?:string[],
			types?:PartialObjects["AccountTypeEnum"][],
			organisationIds?:string[],
			email?:string,
			userName?:string,
			firstName?:string,
			lastName?:string,
			profilePicture?:PartialObjects["ImageComponent"],
			phoneNumber?:string,
			gender?:PartialObjects["AccountGenderEnum"],
			birthDate?:PartialObjects["DateTime"],
			getAge?:number,
			address?:PartialObjects["AddressComponent"],
			language?:PartialObjects["AvailableTranslation"],
			settings?:PartialObjects["SettingsComponent"][],
			securityCheck?:boolean,
			organisation?:string,
			position?:string,
			profileCompleted?:boolean
	},
	["AccountTypeEnum"]:AccountTypeEnum,
	["AddressComponent"]: {
		__typename?: "AddressComponent";
			number?:string,
			street?:string,
			streetBis?:string,
			floor?:string,
			box?:string,
			zip?:string,
			state?:string,
			city?:string,
			country?:string
	},
	["AvailableTranslation"]:AvailableTranslation,
	/** The javascript `Date` as string. Type represents date and time as the ISO Date string. */
["DateTime"]:any,
	["EngineFileInitOutput"]: {
		__typename?: "EngineFileInitOutput";
			uploadUrl?:string,
			file?:PartialObjects["EngineFileSchema"]
	},
	["EngineFileSchema"]: {
		__typename?: "EngineFileSchema";
			accountId?:string,
			mime?:string,
			fileName?:string,
			fileNameMedium?:string,
			fileNameSmall?:string,
			large?:string,
			medium?:string,
			small?:string,
			account?:PartialObjects["AccountModel"],
			_id?:string,
			organisationId?:string,
			paths?:PartialObjects["EnginePathComponent"][],
			by?:PartialObjects["MetaBy"],
			permissions?:PartialObjects["MetaPermissions"],
			createdAt?:PartialObjects["DateTime"],
			updatedAt?:PartialObjects["DateTime"],
			tagsIds?:string[],
			getTags?:PartialObjects["TagSchema"][],
			getUrl?:string
	},
	["EnginePathComponent"]: {
		__typename?: "EnginePathComponent";
			ressourceModel?:PartialObjects["ModelLoadersEnum"],
			ressourceId?:string
	},
	["FileSize"]:FileSize,
	["FilesRessourceEnum"]:FilesRessourceEnum,
	["GetArgs"]: {
	limit:number,
	skip:number,
	sort?:string
},
	["IEngineSchema"]:{
		_id?:string;
	organisationId?:string;
	paths?:PartialObjects["EnginePathComponent"][];
	by?:PartialObjects["MetaBy"];
	permissions?:PartialObjects["MetaPermissions"];
	createdAt?:PartialObjects["DateTime"];
	updatedAt?:PartialObjects["DateTime"];
	tagsIds?:string[]
} & (PartialObjects["EngineFileSchema"] | PartialObjects["TagSchema"]),
	["ImageComponent"]: {
		__typename?: "ImageComponent";
			title?:string,
			fileType?:string,
			large?:string,
			medium?:string,
			small?:string
	},
	["MetaBy"]: {
		__typename?: "MetaBy";
			createdBy?:string,
			updatedBy?:string,
			deletedBy?:string
	},
	["MetaPermissions"]: {
		__typename?: "MetaPermissions";
			r?:string[],
			w?:string[],
			d?:string[]
	},
	["ModelLoadersEnum"]:ModelLoadersEnum,
	["Mutation"]: {
		__typename?: "Mutation";
			filesInitUpload?:PartialObjects["EngineFileInitOutput"]
	},
	["NewFileUploadInitInput"]: {
	ressourceModel?:PartialObjects["FilesRessourceEnum"],
	ressourceId?:string,
	fileName:string,
	privateFile?:boolean,
	tagsIds?:string[]
},
	["Query"]: {
		__typename?: "Query";
			filesGetMine?:PartialObjects["EngineFileSchema"][],
			filesGetMineCount?:number,
			filesGetSharedWithMe?:PartialObjects["EngineFileSchema"][],
			filesGetSharedWithMeCount?:number,
			filesGetOne?:PartialObjects["EngineFileSchema"]
	},
	["SettingsComponent"]: {
		__typename?: "SettingsComponent";
			type?:PartialObjects["SettingsTypeEnum"],
			email?:boolean,
			pushNotifications?:boolean,
			sms?:boolean
	},
	["SettingsTypeEnum"]:SettingsTypeEnum,
	["TagSchema"]: {
		__typename?: "TagSchema";
			title?:string,
			_id?:string,
			organisationId?:string,
			paths?:PartialObjects["EnginePathComponent"][],
			by?:PartialObjects["MetaBy"],
			permissions?:PartialObjects["MetaPermissions"],
			createdAt?:PartialObjects["DateTime"],
			updatedAt?:PartialObjects["DateTime"],
			tagsIds?:string[]
	}
  }

export enum AccountGenderEnum {
	m = "m",
	f = "f",
	other = "other"
}

export type AccountModel = {
	__typename?: "AccountModel",
	_id:string,
	organisationId?:string,
	createdBy?:string,
	updatedBy?:string,
	deletedBy?:string,
	createdAt:DateTime,
	updatedAt:DateTime,
	r:string[],
	w:string[],
	d:string[],
	types:AccountTypeEnum[],
	organisationIds?:string[],
	email:string,
	userName?:string,
	firstName:string,
	lastName:string,
	profilePicture?:ImageComponent,
	phoneNumber?:string,
	gender?:AccountGenderEnum,
	birthDate?:DateTime,
	getAge?:number,
	address?:AddressComponent,
	language?:AvailableTranslation,
	settings?:SettingsComponent[],
	securityCheck:boolean,
	organisation:string,
	position:string,
	profileCompleted:boolean
}

export enum AccountTypeEnum {
	admin = "admin",
	user = "user",
	public = "public",
	blogAuthor = "blogAuthor",
	investor = "investor",
	company = "company",
	bank = "bank",
	consultant = "consultant",
	organisationOwner = "organisationOwner"
}

export type AddressComponent = {
	__typename?: "AddressComponent",
	number?:string,
	street?:string,
	streetBis?:string,
	floor?:string,
	box?:string,
	zip?:string,
	state?:string,
	city:string,
	country:string
}

export enum AvailableTranslation {
	en = "en"
}

/** The javascript `Date` as string. Type represents date and time as the ISO Date string. */
export type DateTime = any

export type EngineFileInitOutput = {
	__typename?: "EngineFileInitOutput",
	uploadUrl:string,
	file:EngineFileSchema
}

export type EngineFileSchema = {
	__typename?: "EngineFileSchema",
	accountId:string,
	mime:string,
	fileName:string,
	fileNameMedium?:string,
	fileNameSmall?:string,
	large?:string,
	medium?:string,
	small?:string,
	account?:AccountModel,
	_id:string,
	organisationId?:string,
	paths?:EnginePathComponent[],
	by?:MetaBy,
	permissions?:MetaPermissions,
	createdAt:DateTime,
	updatedAt:DateTime,
	tagsIds?:string[],
	getTags?:TagSchema[],
	getUrl?:string
}

export type EnginePathComponent = {
	__typename?: "EnginePathComponent",
	ressourceModel:ModelLoadersEnum,
	ressourceId:string
}

export enum FileSize {
	large = "large",
	medium = "medium",
	small = "small"
}

export enum FilesRessourceEnum {
	companiesData = "companiesData"
}

export type GetArgs = {
		limit:number,
	skip:number,
	sort?:string
}

export type IEngineSchema = {
	__interface:{
			_id:string,
	organisationId?:string,
	paths?:EnginePathComponent[],
	by?:MetaBy,
	permissions?:MetaPermissions,
	createdAt:DateTime,
	updatedAt:DateTime,
	tagsIds?:string[]
	};
	__resolve:{
		['...on EngineFileSchema']: EngineFileSchema;
		['...on TagSchema']: TagSchema;
	}
}

export type ImageComponent = {
	__typename?: "ImageComponent",
	title?:string,
	fileType?:string,
	large:string,
	medium?:string,
	small?:string
}

export type MetaBy = {
	__typename?: "MetaBy",
	createdBy?:string,
	updatedBy?:string,
	deletedBy?:string
}

export type MetaPermissions = {
	__typename?: "MetaPermissions",
	r:string[],
	w:string[],
	d:string[]
}

export enum ModelLoadersEnum {
	streams = "streams",
	notifications = "notifications",
	pages = "pages",
	accounts = "accounts",
	companies = "companies",
	naces = "naces",
	companiesData = "companiesData",
	managementInstitutions = "managementInstitutions"
}

export type Mutation = {
	__typename?: "Mutation",
	filesInitUpload:EngineFileInitOutput
}

export type NewFileUploadInitInput = {
		ressourceModel?:FilesRessourceEnum,
	ressourceId?:string,
	fileName:string,
	privateFile?:boolean,
	tagsIds?:string[]
}

export type Query = {
	__typename?: "Query",
	filesGetMine:EngineFileSchema[],
	filesGetMineCount:number,
	filesGetSharedWithMe:EngineFileSchema[],
	filesGetSharedWithMeCount:number,
	filesGetOne:EngineFileSchema
}

export type SettingsComponent = {
	__typename?: "SettingsComponent",
	type:SettingsTypeEnum,
	email?:boolean,
	pushNotifications?:boolean,
	sms?:boolean
}

export enum SettingsTypeEnum {
	notification = "notification"
}

export type TagSchema = {
	__typename?: "TagSchema",
	title:string,
	_id:string,
	organisationId?:string,
	paths?:EnginePathComponent[],
	by?:MetaBy,
	permissions?:MetaPermissions,
	createdAt:DateTime,
	updatedAt:DateTime,
	tagsIds?:string[]
}



export type UnwrapPromise<T> = T extends Promise<infer R> ? R : T;
export type ZeusState<T extends (...args: any[]) => Promise<any>> = NonNullable<
  UnwrapPromise<ReturnType<T>>
>;
export type ZeusHook<
  T extends (
    ...args: any[]
  ) => Record<string, (...args: any[]) => Promise<any>>,
  N extends keyof ReturnType<T>
> = ZeusState<ReturnType<T>[N]>;

type Func<P extends any[], R> = (...args: P) => R;
type AnyFunc = Func<any, any>;

type WithTypeNameValue<T> = T & {
  __typename?: true;
};

type AliasType<T> = WithTypeNameValue<T> & {
  __alias?: Record<string, WithTypeNameValue<T>>;
};

type NotUndefined<T> = T extends undefined ? never : T;

export type ResolverType<F> = NotUndefined<F extends [infer ARGS, any] ? ARGS : undefined>;

export type ArgsType<F extends AnyFunc> = F extends Func<infer P, any> ? P : never;

interface GraphQLResponse {
  data?: Record<string, any>;
  errors?: Array<{
    message: string;
  }>;
}

export type ValuesOf<T> = T[keyof T];

export type MapResolve<SRC, DST> = SRC extends {
    __interface: infer INTERFACE;
    __resolve: Record<string, { __typename?: string }> & infer IMPLEMENTORS;
  }
  ?
  ValuesOf<{
    [k in (keyof SRC['__resolve'] & keyof DST)]: ({
      [rk in (keyof SRC['__resolve'][k] & keyof DST[k])]: LastMapTypeSRCResolver<SRC['__resolve'][k][rk], DST[k][rk]>
    } & {
      __typename: SRC['__resolve'][k]['__typename']
    })
  }>
  :
  never;

export type MapInterface<SRC, DST> = SRC extends {
    __interface: infer INTERFACE;
    __resolve: Record<string, { __typename?: string }> & infer IMPLEMENTORS;
  }
  ?
  (MapResolve<SRC, DST> extends never ? {} : MapResolve<SRC, DST>) & {
  [k in (keyof SRC['__interface'] & keyof DST)]: LastMapTypeSRCResolver<SRC['__interface'][k], DST[k]>
} : never;

export type ValueToUnion<T> = T extends {
  __typename: infer R;
}
  ? {
      [P in keyof Omit<T, '__typename'>]: T[P] & {
        __typename: R;
      };
    }
  : T;

export type ObjectToUnion<T> = {
  [P in keyof T]: T[P];
}[keyof T];

type Anify<T> = { [P in keyof T]?: any };


type LastMapTypeSRCResolver<SRC, DST> = SRC extends undefined
  ? undefined
  : SRC extends Array<infer AR>
  ? LastMapTypeSRCResolver<AR, DST>[]
  : SRC extends { __interface: any; __resolve: any }
  ? MapInterface<SRC, DST>
  : SRC extends { __union: any; __resolve: infer RESOLVE }
  ? ObjectToUnion<MapType<RESOLVE, ValueToUnion<DST>>>
  : DST extends boolean
  ? SRC
  : MapType<SRC, DST>;

export type MapType<SRC extends Anify<DST>, DST> = DST extends boolean
  ? SRC
  : DST extends {
      __alias: any;
    }
  ? {
      [A in keyof DST["__alias"]]: Required<SRC> extends Anify<
        DST["__alias"][A]
      >
        ? MapType<Required<SRC>, DST["__alias"][A]>
        : never;
    } &
      {
        [Key in keyof Omit<DST, "__alias">]: DST[Key] extends [
          any,
          infer PAYLOAD
        ]
          ? LastMapTypeSRCResolver<SRC[Key], PAYLOAD>
          : LastMapTypeSRCResolver<SRC[Key], DST[Key]>;
      }
  : {
      [Key in keyof DST]: DST[Key] extends [any, infer PAYLOAD]
        ? LastMapTypeSRCResolver<SRC[Key], PAYLOAD>
        : LastMapTypeSRCResolver<SRC[Key], DST[Key]>;
    };

type OperationToGraphQL<V, T> = <Z extends V>(o: Z | V, variables?: Record<string, any>) => Promise<MapType<T, Z>>;

type CastToGraphQL<V, T> = (
  resultOfYourQuery: any
) => <Z extends V>(o: Z | V) => MapType<T, Z>;

type fetchOptions = ArgsType<typeof fetch>;

export type SelectionFunction<V> = <T>(t: T | V) => T;
type FetchFunction = (query: string, variables?: Record<string, any>) => Promise<any>;


export declare function Thunder(
  fn: FetchFunction
):{
  query: OperationToGraphQL<ValueTypes["Query"],Query>,mutation: OperationToGraphQL<ValueTypes["Mutation"],Mutation>
}

export declare function Chain(
  ...options: fetchOptions
):{
  query: OperationToGraphQL<ValueTypes["Query"],Query>,mutation: OperationToGraphQL<ValueTypes["Mutation"],Mutation>
}

export declare const Zeus: {
  query: (o: ValueTypes["Query"]) => string,mutation: (o: ValueTypes["Mutation"]) => string
}

export declare const Cast: {
  query: CastToGraphQL<
  ValueTypes["Query"],
  Query
>,mutation: CastToGraphQL<
  ValueTypes["Mutation"],
  Mutation
>
}

export declare const Selectors: {
  query: SelectionFunction<ValueTypes["Query"]>,mutation: SelectionFunction<ValueTypes["Mutation"]>
}


export declare const Gql: ReturnType<typeof Chain>
