Class SchemaRegistryConnector

Description

Schema registry connector

Features:

  • connector manager for schema registry

Example

import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { IConnector } from '@biorate/connector';
import { SchemaRegistryConnector, ISchemaRegistryConnector } from '@biorate/schema-registry';

export class Root extends Core() {
@inject(SchemaRegistryConnector) public connector: ISchemaRegistryConnector;
}

container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
container
.bind<ISchemaRegistryConnector>(SchemaRegistryConnector)
.toSelf()
.inSingletonScope();
container.bind<Root>(Root).toSelf().inSingletonScope();

container.get<IConfig>(Types.Config).merge({
SchemaRegistry: [{ name: 'connection', baseURL: 'http://localhost:8085' }],
});

(async () => {
const root = container.get<Root>(Root);
await root.$run();

const { PostSubjectsVersions } = root.connector.connection('connection');
const { data } = await PostSubjectsVersions.fetch({
subject: 'test',
schema: {
type: 'record',
name: 'Test',
namespace: 'test',
fields: [
{
name: 'firstName',
type: 'string',
},
{
name: 'lastName',
type: 'string',
},
{
name: 'age',
type: 'int',
},
],
},
});
console.log(data); // { id: 1 }
})();

Hierarchy

Constructors

Properties

#connections: Map<string, {
    decode: ((buffer) => Promise<any>);
    deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
    encode: ((subject, data, version?) => Promise<Buffer>);
    getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
    getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>);
    getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
    getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>);
    getSubjects: (() => Promise<AxiosResponse<string[], any>>);
    getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>);
    getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
    ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
    postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>);
    postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>);
}>

Type declaration

  • decode: ((buffer) => Promise<any>)
      • (buffer): Promise<any>
      • Parameters

        • buffer: Buffer

        Returns Promise<any>

  • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
      • (data): Promise<AxiosResponse<number[], any>>
      • Parameters

        • data: {
              permanent?: boolean;
              subject: string;
          }
          • Optional permanent?: boolean
          • subject: string

        Returns Promise<AxiosResponse<number[], any>>

  • encode: ((subject, data, version?) => Promise<Buffer>)
      • (subject, data, version?): Promise<Buffer>
      • Parameters

        • subject: string
        • data: Record<string, any>
        • version: string | number = 'latest'

        Returns Promise<Buffer>

  • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
      • (data): Promise<AxiosResponse<unknown, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<unknown, any>>

  • getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>)
      • (id): Promise<AxiosResponse<{
            schema: string;
        }, any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            schema: string;
        }, any>>

  • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
  • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>)
      • (id): Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>

  • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
  • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>

  • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
  • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
  • postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>

  • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
        }, any>>

Description

Private connections storage

#connections: Map<string, {
    decode: ((buffer) => Promise<any>);
    deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
    encode: ((subject, data, version?) => Promise<Buffer>);
    getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
    getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>);
    getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
    getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>);
    getSubjects: (() => Promise<AxiosResponse<string[], any>>);
    getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>);
    getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
    ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
    postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>);
    postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>);
}> = ...

Type declaration

  • decode: ((buffer) => Promise<any>)
      • (buffer): Promise<any>
      • Parameters

        • buffer: Buffer

        Returns Promise<any>

  • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
      • (data): Promise<AxiosResponse<number[], any>>
      • Parameters

        • data: {
              permanent?: boolean;
              subject: string;
          }
          • Optional permanent?: boolean
          • subject: string

        Returns Promise<AxiosResponse<number[], any>>

  • encode: ((subject, data, version?) => Promise<Buffer>)
      • (subject, data, version?): Promise<Buffer>
      • Parameters

        • subject: string
        • data: Record<string, any>
        • version: string | number = 'latest'

        Returns Promise<Buffer>

  • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
      • (data): Promise<AxiosResponse<unknown, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<unknown, any>>

  • getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>)
      • (id): Promise<AxiosResponse<{
            schema: string;
        }, any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            schema: string;
        }, any>>

  • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
  • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>)
      • (id): Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>

  • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
  • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>

  • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
  • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
  • postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>

  • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
        }, any>>

Description

Private connections storage

#current: {
    decode: ((buffer) => Promise<any>);
    deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
    encode: ((subject, data, version?) => Promise<Buffer>);
    getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
    getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>);
    getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
    getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>);
    getSubjects: (() => Promise<AxiosResponse<string[], any>>);
    getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>);
    getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
    ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
    postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>);
    postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>);
}

Type declaration

  • decode: ((buffer) => Promise<any>)
      • (buffer): Promise<any>
      • Parameters

        • buffer: Buffer

        Returns Promise<any>

  • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
      • (data): Promise<AxiosResponse<number[], any>>
      • Parameters

        • data: {
              permanent?: boolean;
              subject: string;
          }
          • Optional permanent?: boolean
          • subject: string

        Returns Promise<AxiosResponse<number[], any>>

  • encode: ((subject, data, version?) => Promise<Buffer>)
      • (subject, data, version?): Promise<Buffer>
      • Parameters

        • subject: string
        • data: Record<string, any>
        • version: string | number = 'latest'

        Returns Promise<Buffer>

  • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
      • (data): Promise<AxiosResponse<unknown, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<unknown, any>>

  • getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>)
      • (id): Promise<AxiosResponse<{
            schema: string;
        }, any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            schema: string;
        }, any>>

  • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
  • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>)
      • (id): Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>

  • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
  • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>

  • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
  • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
  • postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>

  • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
        }, any>>

Description

Private link to selected (used) connection

#current: {
    decode: ((buffer) => Promise<any>);
    deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
    encode: ((subject, data, version?) => Promise<Buffer>);
    getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
    getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>);
    getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
    getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>);
    getSubjects: (() => Promise<AxiosResponse<string[], any>>);
    getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>);
    getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
    ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
    postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>);
    postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>);
} = undefined

Type declaration

  • decode: ((buffer) => Promise<any>)
      • (buffer): Promise<any>
      • Parameters

        • buffer: Buffer

        Returns Promise<any>

  • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
      • (data): Promise<AxiosResponse<number[], any>>
      • Parameters

        • data: {
              permanent?: boolean;
              subject: string;
          }
          • Optional permanent?: boolean
          • subject: string

        Returns Promise<AxiosResponse<number[], any>>

  • encode: ((subject, data, version?) => Promise<Buffer>)
      • (subject, data, version?): Promise<Buffer>
      • Parameters

        • subject: string
        • data: Record<string, any>
        • version: string | number = 'latest'

        Returns Promise<Buffer>

  • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
      • (data): Promise<AxiosResponse<unknown, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<unknown, any>>

  • getSchemasById: ((id) => Promise<AxiosResponse<{
        schema: string;
    }, any>>)
      • (id): Promise<AxiosResponse<{
            schema: string;
        }, any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            schema: string;
        }, any>>

  • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
  • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
        subject: string;
        version: number;
    }[], any>>)
      • (id): Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>
      • Parameters

        • id: number

        Returns Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>

  • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
  • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        schemaType: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              subject: string;
              version: string | number;
          }
          • subject: string
          • version: string | number

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>

  • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
  • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
  • postSubjects: ((data) => Promise<AxiosResponse<{
        id: number;
        schema: string;
        subject: string;
        version: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>

  • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
        id: number;
    }, any>>)
      • (data): Promise<AxiosResponse<{
            id: number;
        }, any>>
      • Parameters

        • data: {
              normalize?: boolean;
              reference?: string;
              schema: string | Record<string, any>;
              schemaType?: string;
              subject: string;
          }
          • Optional normalize?: boolean
          • Optional reference?: string
          • schema: string | Record<string, any>
          • Optional schemaType?: string
          • subject: string

        Returns Promise<AxiosResponse<{
            id: number;
        }, any>>

Description

Private link to selected (used) connection

config: IConfig

Description

Config dependency

namespace: "SchemaRegistry" = 'SchemaRegistry'

Description

Namespace path for fetching configuration

Accessors

Methods

  • Parameters

    Returns Promise<{
        decode: ((buffer) => Promise<any>);
        deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
        encode: ((subject, data, version?) => Promise<Buffer>);
        getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
        getSchemasById: ((id) => Promise<AxiosResponse<{
            schema: string;
        }, any>>);
        getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
        getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>);
        getSubjects: (() => Promise<AxiosResponse<string[], any>>);
        getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>);
        getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
        ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
        postSubjects: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>);
        postSubjectsVersions: ((data) => Promise<AxiosResponse<{
            id: number;
        }, any>>);
    }>

    Description

    Create connection

  • Parameters

    • Optional name: string
      Optional

    Returns {
        decode: ((buffer) => Promise<any>);
        deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
        encode: ((subject, data, version?) => Promise<Buffer>);
        getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
        getSchemasById: ((id) => Promise<AxiosResponse<{
            schema: string;
        }, any>>);
        getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
        getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>);
        getSubjects: (() => Promise<AxiosResponse<string[], any>>);
        getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>);
        getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
        ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
        postSubjects: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>);
        postSubjectsVersions: ((data) => Promise<AxiosResponse<{
            id: number;
        }, any>>);
    }

    • decode: ((buffer) => Promise<any>)
        • (buffer): Promise<any>
        • Parameters

          • buffer: Buffer

          Returns Promise<any>

    • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
        • (data): Promise<AxiosResponse<number[], any>>
        • Parameters

          • data: {
                permanent?: boolean;
                subject: string;
            }
            • Optional permanent?: boolean
            • subject: string

          Returns Promise<AxiosResponse<number[], any>>

    • encode: ((subject, data, version?) => Promise<Buffer>)
        • (subject, data, version?): Promise<Buffer>
        • Parameters

          • subject: string
          • data: Record<string, any>
          • version: string | number = 'latest'

          Returns Promise<Buffer>

    • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
        • (data): Promise<AxiosResponse<unknown, any>>
        • Parameters

          • data: {
                subject: string;
                version: string | number;
            }
            • subject: string
            • version: string | number

          Returns Promise<AxiosResponse<unknown, any>>

    • getSchemasById: ((id) => Promise<AxiosResponse<{
          schema: string;
      }, any>>)
        • (id): Promise<AxiosResponse<{
              schema: string;
          }, any>>
        • Parameters

          • id: number

          Returns Promise<AxiosResponse<{
              schema: string;
          }, any>>

    • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
    • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
          subject: string;
          version: number;
      }[], any>>)
        • (id): Promise<AxiosResponse<{
              subject: string;
              version: number;
          }[], any>>
        • Parameters

          • id: number

          Returns Promise<AxiosResponse<{
              subject: string;
              version: number;
          }[], any>>

    • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
    • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
          id: number;
          schema: string;
          schemaType: string;
          subject: string;
          version: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
              schema: string;
              schemaType: string;
              subject: string;
              version: number;
          }, any>>
        • Parameters

          • data: {
                subject: string;
                version: string | number;
            }
            • subject: string
            • version: string | number

          Returns Promise<AxiosResponse<{
              id: number;
              schema: string;
              schemaType: string;
              subject: string;
              version: number;
          }, any>>

    • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
    • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
    • postSubjects: ((data) => Promise<AxiosResponse<{
          id: number;
          schema: string;
          subject: string;
          version: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
              schema: string;
              subject: string;
              version: number;
          }, any>>
        • Parameters

          • data: {
                normalize?: boolean;
                reference?: string;
                schema: string | Record<string, any>;
                schemaType?: string;
                subject: string;
            }
            • Optional normalize?: boolean
            • Optional reference?: string
            • schema: string | Record<string, any>
            • Optional schemaType?: string
            • subject: string

          Returns Promise<AxiosResponse<{
              id: number;
              schema: string;
              subject: string;
              version: number;
          }, any>>

    • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
          id: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
          }, any>>
        • Parameters

          • data: {
                normalize?: boolean;
                reference?: string;
                schema: string | Record<string, any>;
                schemaType?: string;
                subject: string;
            }
            • Optional normalize?: boolean
            • Optional reference?: string
            • schema: string | Record<string, any>
            • Optional schemaType?: string
            • subject: string

          Returns Promise<AxiosResponse<{
              id: number;
          }, any>>

    Description

    Method for get existed the connection

  • Parameters

    Returns Promise<{
        decode: ((buffer) => Promise<any>);
        deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
        encode: ((subject, data, version?) => Promise<Buffer>);
        getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
        getSchemasById: ((id) => Promise<AxiosResponse<{
            schema: string;
        }, any>>);
        getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
        getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>);
        getSubjects: (() => Promise<AxiosResponse<string[], any>>);
        getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>);
        getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
        ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
        postSubjects: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>);
        postSubjectsVersions: ((data) => Promise<AxiosResponse<{
            id: number;
        }, any>>);
    }>

    Description

    Method for creating new connection

  • Parameters

    • Optional name: string
      Optional

    Returns {
        decode: ((buffer) => Promise<any>);
        deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>);
        encode: ((subject, data, version?) => Promise<Buffer>);
        getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>);
        getSchemasById: ((id) => Promise<AxiosResponse<{
            schema: string;
        }, any>>);
        getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>);
        getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
            subject: string;
            version: number;
        }[], any>>);
        getSubjects: (() => Promise<AxiosResponse<string[], any>>);
        getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            schemaType: string;
            subject: string;
            version: number;
        }, any>>);
        getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>);
        ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>);
        postSubjects: ((data) => Promise<AxiosResponse<{
            id: number;
            schema: string;
            subject: string;
            version: number;
        }, any>>);
        postSubjectsVersions: ((data) => Promise<AxiosResponse<{
            id: number;
        }, any>>);
    }

    • decode: ((buffer) => Promise<any>)
        • (buffer): Promise<any>
        • Parameters

          • buffer: Buffer

          Returns Promise<any>

    • deleteSubjects: ((data) => Promise<AxiosResponse<number[], any>>)
        • (data): Promise<AxiosResponse<number[], any>>
        • Parameters

          • data: {
                permanent?: boolean;
                subject: string;
            }
            • Optional permanent?: boolean
            • subject: string

          Returns Promise<AxiosResponse<number[], any>>

    • encode: ((subject, data, version?) => Promise<Buffer>)
        • (subject, data, version?): Promise<Buffer>
        • Parameters

          • subject: string
          • data: Record<string, any>
          • version: string | number = 'latest'

          Returns Promise<Buffer>

    • getSchemaBySubjectsAndVersion: ((data) => Promise<AxiosResponse<unknown, any>>)
        • (data): Promise<AxiosResponse<unknown, any>>
        • Parameters

          • data: {
                subject: string;
                version: string | number;
            }
            • subject: string
            • version: string | number

          Returns Promise<AxiosResponse<unknown, any>>

    • getSchemasById: ((id) => Promise<AxiosResponse<{
          schema: string;
      }, any>>)
        • (id): Promise<AxiosResponse<{
              schema: string;
          }, any>>
        • Parameters

          • id: number

          Returns Promise<AxiosResponse<{
              schema: string;
          }, any>>

    • getSchemasTypes: (() => Promise<AxiosResponse<string[], any>>)
    • getSchemasVersionsById: ((id) => Promise<AxiosResponse<{
          subject: string;
          version: number;
      }[], any>>)
        • (id): Promise<AxiosResponse<{
              subject: string;
              version: number;
          }[], any>>
        • Parameters

          • id: number

          Returns Promise<AxiosResponse<{
              subject: string;
              version: number;
          }[], any>>

    • getSubjects: (() => Promise<AxiosResponse<string[], any>>)
    • getSubjectsByVersion: ((data) => Promise<AxiosResponse<{
          id: number;
          schema: string;
          schemaType: string;
          subject: string;
          version: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
              schema: string;
              schemaType: string;
              subject: string;
              version: number;
          }, any>>
        • Parameters

          • data: {
                subject: string;
                version: string | number;
            }
            • subject: string
            • version: string | number

          Returns Promise<AxiosResponse<{
              id: number;
              schema: string;
              schemaType: string;
              subject: string;
              version: number;
          }, any>>

    • getSubjectsVersions: ((subject) => Promise<AxiosResponse<number[], any>>)
    • ping: (() => Promise<AxiosResponse<Record<string, unknown>, any>>)
    • postSubjects: ((data) => Promise<AxiosResponse<{
          id: number;
          schema: string;
          subject: string;
          version: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
              schema: string;
              subject: string;
              version: number;
          }, any>>
        • Parameters

          • data: {
                normalize?: boolean;
                reference?: string;
                schema: string | Record<string, any>;
                schemaType?: string;
                subject: string;
            }
            • Optional normalize?: boolean
            • Optional reference?: string
            • schema: string | Record<string, any>
            • Optional schemaType?: string
            • subject: string

          Returns Promise<AxiosResponse<{
              id: number;
              schema: string;
              subject: string;
              version: number;
          }, any>>

    • postSubjectsVersions: ((data) => Promise<AxiosResponse<{
          id: number;
      }, any>>)
        • (data): Promise<AxiosResponse<{
              id: number;
          }, any>>
        • Parameters

          • data: {
                normalize?: boolean;
                reference?: string;
                schema: string | Record<string, any>;
                schemaType?: string;
                subject: string;
            }
            • Optional normalize?: boolean
            • Optional reference?: string
            • schema: string | Record<string, any>
            • Optional schemaType?: string
            • subject: string

          Returns Promise<AxiosResponse<{
              id: number;
          }, any>>

    Description

    Alias for connection method

Generated using TypeDoc