import { Logger } from 'pino'; import { Dictionary } from 'ts-essentials'; import { SchemaLoader } from './schema'; import { ArrayRelationship, ObjectRelationship, Schema, Table } from './types'; export declare class HasuraSchemaLoader implements SchemaLoader { private readonly camelCaseFieldNames; private readonly logger; private readonly api; /** * Create a schema loader * @param url Hasura instance URL * @param adminSecret Hasura admin credential * @param camelCaseFieldNames where applicable ensure names that will be * interpreted as GraphQL fields are camel cased. False by default * @param logger */ constructor(url: string, adminSecret?: string, camelCaseFieldNames?: boolean, logger?: Logger); private fetchDbSource; private fetchPrimaryKeys; /** * Builds map from sourceTable to map of targetTable by fk column. * * That is, given: * sourceTable (e.g. cicd_Build) * fk column (e.g. pipeline_id in cicd_Build) * targetTable (e.g. cicd_Pipeline): table.table.name * * The output, res, can be used as: * res['cicd_Build']['pipeline_id'] => 'cicd_Pipeline' */ static indexFkTargetModels(source: Source): Dictionary>; loadSchema(): Promise; private unwrapType; } interface TableWithRelationships { table: Table; object_relationships: ReadonlyArray; array_relationships: ReadonlyArray; } interface Source { name: string; kind: string; tables: ReadonlyArray; configuration: any; } export {};