Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default ({
auth,
clientId,
host,
retry = {},
}: SchemaRegistryAPIClientArgs): SchemaRegistryAPIClient =>
forge({
clientId: clientId || DEFAULT_API_CLIENT_ID,
ignoreGlobalMiddleware: true,
host,
middleware: [
confluentEncoder,
RetryMiddleware(Object.assign(DEFAULT_RETRY, retry)),
errorMiddleware,
...(auth ? [BasicAuthMiddleware(auth)] : []),
],
resources: {
Schema: {
find: {
method: 'get',
path: '/schemas/ids/{id}',
},
},
Subject: {
all: {
method: 'get',
path: '/subjects',
},
latestVersion: {
method: 'get',
path: '/subjects/{subject}/versions/latest',