@ovotech/schema-registry-api
Advanced tools
Comparing version 1.0.7 to 1.1.0
@@ -5,2 +5,5 @@ import { Schema } from 'avsc'; | ||
} | ||
declare type SubjectsResponse = string[]; | ||
declare type SubjectVersionsResponse = number[]; | ||
declare type DeleteSubjectResponse = number[]; | ||
interface SchemaVersionResponse { | ||
@@ -19,5 +22,6 @@ subject: string; | ||
export declare const getSchema: (baseUrl: string, id: number) => Promise<SchemaResponse>; | ||
export declare const getSubjects: (baseUrl: string) => Promise<string[]>; | ||
export declare const deleteSubject: (baseUrl: string, subject: string) => Promise<number[]>; | ||
export declare const getSubjectVersions: (baseUrl: string, subject: string) => Promise<number[]>; | ||
export declare const getSubjects: (baseUrl: string) => Promise<SubjectsResponse>; | ||
export declare const deleteSubject: (baseUrl: string, subject: string) => Promise<DeleteSubjectResponse>; | ||
export declare const getSubjectVersions: (baseUrl: string, subject: string) => Promise<SubjectVersionsResponse>; | ||
export declare const getSubjectVersion: (baseUrl: string, subject: string, version: number) => Promise<SchemaVersionResponse>; | ||
export declare const getSubjectVersionSchema: (baseUrl: string, subject: string, version: number) => Promise<Schema>; | ||
@@ -27,3 +31,3 @@ export declare const addSubjectVersion: (baseUrl: string, subject: string, schema: Schema) => Promise<AddSubjectVersionResponse>; | ||
export declare const deleteSubjectVersion: (baseUrl: string, subject: string, version: number) => Promise<number>; | ||
export declare const checkCompatibility: (baseUrl: string, subject: string, version: number | "latest", schema: Schema) => Promise<CompatibilityResponse>; | ||
export declare const checkCompatibility: (baseUrl: string, subject: string, version: number | 'latest', schema: Schema) => Promise<CompatibilityResponse>; | ||
export declare const idToSchema: (baseUrl: string, id: number) => Promise<Schema>; | ||
@@ -30,0 +34,0 @@ export declare const schemaToId: (baseUrl: string, subject: string, schema: Schema) => Promise<number>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toSubject = exports.schemaToId = exports.idToSchema = exports.checkCompatibility = exports.deleteSubjectVersion = exports.checkSubjectRegistered = exports.addSubjectVersion = exports.getSubjectVersionSchema = exports.getSubjectVersion = exports.getSubjectVersions = exports.deleteSubject = exports.getSubjects = exports.getSchema = void 0; | ||
const node_fetch_1 = require("node-fetch"); | ||
@@ -34,2 +35,3 @@ const _1 = require("./"); | ||
exports.getSubjectVersions = (baseUrl, subject) => apiFetch(`${baseUrl}/subjects/${subject}/versions`); | ||
exports.getSubjectVersion = (baseUrl, subject, version) => apiFetch(`${baseUrl}/subjects/${subject}/versions/${version}`); | ||
exports.getSubjectVersionSchema = async (baseUrl, subject, version) => apiFetch(`${baseUrl}/subjects/${subject}/versions/${version}/schema`); | ||
@@ -36,0 +38,0 @@ exports.addSubjectVersion = (baseUrl, subject, schema) => apiFetch(`${baseUrl}/subjects/${subject}/versions`, { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var SchemaRegistryError_1 = require("./SchemaRegistryError"); | ||
exports.SchemaRegistryError = SchemaRegistryError_1.SchemaRegistryError; | ||
Object.defineProperty(exports, "SchemaRegistryError", { enumerable: true, get: function () { return SchemaRegistryError_1.SchemaRegistryError; } }); | ||
var api_1 = require("./api"); | ||
exports.addSubjectVersion = api_1.addSubjectVersion; | ||
exports.checkCompatibility = api_1.checkCompatibility; | ||
exports.checkSubjectRegistered = api_1.checkSubjectRegistered; | ||
exports.deleteSubject = api_1.deleteSubject; | ||
exports.deleteSubjectVersion = api_1.deleteSubjectVersion; | ||
exports.getSchema = api_1.getSchema; | ||
exports.getSubjects = api_1.getSubjects; | ||
exports.getSubjectVersions = api_1.getSubjectVersions; | ||
exports.getSubjectVersionSchema = api_1.getSubjectVersionSchema; | ||
exports.idToSchema = api_1.idToSchema; | ||
exports.schemaToId = api_1.schemaToId; | ||
exports.toSubject = api_1.toSubject; | ||
Object.defineProperty(exports, "addSubjectVersion", { enumerable: true, get: function () { return api_1.addSubjectVersion; } }); | ||
Object.defineProperty(exports, "checkCompatibility", { enumerable: true, get: function () { return api_1.checkCompatibility; } }); | ||
Object.defineProperty(exports, "checkSubjectRegistered", { enumerable: true, get: function () { return api_1.checkSubjectRegistered; } }); | ||
Object.defineProperty(exports, "deleteSubject", { enumerable: true, get: function () { return api_1.deleteSubject; } }); | ||
Object.defineProperty(exports, "deleteSubjectVersion", { enumerable: true, get: function () { return api_1.deleteSubjectVersion; } }); | ||
Object.defineProperty(exports, "getSchema", { enumerable: true, get: function () { return api_1.getSchema; } }); | ||
Object.defineProperty(exports, "getSubjects", { enumerable: true, get: function () { return api_1.getSubjects; } }); | ||
Object.defineProperty(exports, "getSubjectVersions", { enumerable: true, get: function () { return api_1.getSubjectVersions; } }); | ||
Object.defineProperty(exports, "getSubjectVersionSchema", { enumerable: true, get: function () { return api_1.getSubjectVersionSchema; } }); | ||
Object.defineProperty(exports, "idToSchema", { enumerable: true, get: function () { return api_1.idToSchema; } }); | ||
Object.defineProperty(exports, "schemaToId", { enumerable: true, get: function () { return api_1.schemaToId; } }); | ||
Object.defineProperty(exports, "toSubject", { enumerable: true, get: function () { return api_1.toSubject; } }); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SchemaRegistryError = void 0; | ||
class SchemaRegistryError extends Error { | ||
@@ -4,0 +5,0 @@ constructor(message, code) { |
{ | ||
"name": "@ovotech/schema-registry-api", | ||
"description": "A simple typescript node-fetch wrapper on the confluent schema-registry api", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"main": "dist/index.js", | ||
@@ -34,3 +34,3 @@ "source": "src/index.ts", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.5.1", | ||
"typescript": "^3.7.0", | ||
"uuid": "^3.3.2" | ||
@@ -41,3 +41,3 @@ }, | ||
}, | ||
"gitHead": "64815901e7c185826de97992eb7af67e7cb40801" | ||
"gitHead": "1ca6f770ca6ccb60cd172f06e88078e44137f0a2" | ||
} |
@@ -65,2 +65,5 @@ import { Schema } from 'avsc'; | ||
export const getSubjectVersion = (baseUrl: string, subject: string, version: number) => | ||
apiFetch<SchemaVersionResponse>(`${baseUrl}/subjects/${subject}/versions/${version}`); | ||
export const getSubjectVersionSchema = async (baseUrl: string, subject: string, version: number) => | ||
@@ -67,0 +70,0 @@ apiFetch<Schema>(`${baseUrl}/subjects/${subject}/versions/${version}/schema`); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
22898
246