@ovotech/avro-kafkajs
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -45,10 +45,12 @@ "use strict"; | ||
return async (payload) => { | ||
const { type, value } = await schemaRegistry.decodeWithType(payload.message.value); | ||
const key = encodedKey && payload.message.key | ||
? await schemaRegistry.decode(payload.message.key) | ||
: payload.message.key; | ||
return eachMessage({ | ||
...payload, | ||
message: { ...payload.message, key: key, value, schema: type.schema() }, | ||
}); | ||
if (payload.message.value !== null) { | ||
const { type, value } = await schemaRegistry.decodeWithType(payload.message.value); | ||
return eachMessage({ | ||
...payload, | ||
message: { ...payload.message, key: key, value, schema: type.schema() }, | ||
}); | ||
} | ||
}; | ||
@@ -61,5 +63,7 @@ }; | ||
for (const message of payload.batch.messages) { | ||
const { value, type } = await schemaRegistry.decodeWithType(message.value); | ||
const key = encodedKey && message.key ? await schemaRegistry.decode(message.key) : message.key; | ||
messages.push({ ...message, key: key, value, schema: type.schema() }); | ||
if (message.value) { | ||
const { value, type } = await schemaRegistry.decodeWithType(message.value); | ||
const key = encodedKey && message.key ? await schemaRegistry.decode(message.key) : message.key; | ||
messages.push({ ...message, key: key, value, schema: type.schema() }); | ||
} | ||
} | ||
@@ -66,0 +70,0 @@ avroPayload.batch.messages = messages; |
@@ -46,3 +46,3 @@ "use strict"; | ||
commitOffsetsIfNecessary: () => Promise.resolve(), | ||
uncommittedOffsets: () => Promise.resolve({ topics: [] }), | ||
uncommittedOffsets: () => ({ topics: [] }), | ||
isRunning: () => true, | ||
@@ -49,0 +49,0 @@ isStale: () => false, |
{ | ||
"name": "@ovotech/avro-kafkajs", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"main": "dist/index.js", | ||
@@ -13,15 +13,15 @@ "types": "dist/index.d.ts", | ||
"@ovotech/build-docs": "^0.1.0", | ||
"@types/jest": "^26.0.10", | ||
"@types/node": "^14.6.0", | ||
"@types/jest": "^26.0.14", | ||
"@types/node": "^14.11.2", | ||
"@types/uuid": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^3.10.1", | ||
"@typescript-eslint/parser": "^3.10.1", | ||
"@typescript-eslint/eslint-plugin": "^4.2.0", | ||
"@typescript-eslint/parser": "^4.2.0", | ||
"axios": "^0.19.2", | ||
"eslint": "^7.7.0", | ||
"eslint": "^7.9.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"jest": "^26.4.2", | ||
"kafkajs": "^1.12.0", | ||
"prettier": "^2.1.1", | ||
"kafkajs": "^1.14.0", | ||
"prettier": "^2.1.2", | ||
"stream-mock": "^2.0.5", | ||
"ts-jest": "^26.3.0", | ||
"ts-jest": "^26.4.0", | ||
"ts-node": "^9.0.0", | ||
@@ -48,5 +48,5 @@ "ts-retry-promise": "^0.5.0", | ||
"@ovotech/schema-registry-api": "^1.0.7", | ||
"avsc": "^5.4.21" | ||
"avsc": "^5.4.22" | ||
}, | ||
"gitHead": "2851345b2d18036bdb1ab7ab8a27f267fed3c3f0" | ||
"gitHead": "44cb5b3482b0bec4a7de04d8a1edc133b57edf5b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46964
732
Updatedavsc@^5.4.22