From 87c529749586f574373c35cb3f5e3d3f7f9eed89 Mon Sep 17 00:00:00 2001 From: Peter Vlugter Date: Thu, 31 Mar 2022 02:25:59 +1300 Subject: [PATCH] fix: metadata export and default empty entries (#272) --- sdk/index.js | 2 +- sdk/src/metadata.jsdoc | 2 +- sdk/src/view-support.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/index.js b/sdk/index.js index 39332ed0..1c568928 100644 --- a/sdk/index.js +++ b/sdk/index.js @@ -27,7 +27,7 @@ module.exports.replicatedentity = require('./src/replicated-entity'); module.exports.ReplicatedWriteConsistency = require('./src/akkaserverless').ReplicatedWriteConsistency; module.exports.Action = require('./src/action'); -module.exports.Metadata = require('./src/metadata'); +module.exports.Metadata = require('./src/metadata').Metadata; module.exports.IntegrationTestkit = require('./src/integration-testkit').IntegrationTestkit; module.exports.View = require('./src/view'); diff --git a/sdk/src/metadata.jsdoc b/sdk/src/metadata.jsdoc index 48dc74b1..e7121dda 100644 --- a/sdk/src/metadata.jsdoc +++ b/sdk/src/metadata.jsdoc @@ -39,7 +39,7 @@ * a string using toString. * * @class module:akkaserverless.Metadata - * @param {module:akkaserverless.MetadataEntry[]} entries The list of entries + * @param {module:akkaserverless.MetadataEntry[]} [entries=[]] The list of entries */ /** diff --git a/sdk/src/view-support.js b/sdk/src/view-support.js index 48e5d88c..98b2fb0c 100644 --- a/sdk/src/view-support.js +++ b/sdk/src/view-support.js @@ -88,7 +88,7 @@ module.exports = class ViewServices { try { const anySupport = new AnySupport(service.root), metadata = new Metadata( - receiveEvent.metada ? receiveEvent.metadata.entries : [], + receiveEvent.metadata ? receiveEvent.metadata.entries : [], ), payload = anySupport.deserialize(receiveEvent.payload), existingState = receiveEvent.bySubjectLookupResult