From ef1aecd0092a8652bc7b936604f9478b7b55df27 Mon Sep 17 00:00:00 2001 From: Kevin Pearson Date: Tue, 12 Sep 2023 10:24:26 -0700 Subject: [PATCH 1/4] fix: Macro not replaced for provider docs --- src/macrofier/engine.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/macrofier/engine.mjs b/src/macrofier/engine.mjs index d0535d00..73a805fd 100644 --- a/src/macrofier/engine.mjs +++ b/src/macrofier/engine.mjs @@ -1512,6 +1512,8 @@ function insertProviderInterfaceMacros(template, capability, moduleJson = {}, te } } methodBlock = lines.join('\n') + methodBlock = methodBlock.replace(/\$\{if\.provider\.params\}/gms, '') + methodBlock = methodBlock.replace(/\$\{end\.if\.provider\.params\}/gms, '') } else { methodBlock = methodBlock.replace(/\$\{if\.provider\.params\}.*?\$\{end\.if\.provider\.params\}/gms, '') From 4de89447b473ed920ce8d1a3e180c41e1a1c88c9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 14 Sep 2023 17:21:15 +0000 Subject: [PATCH 2/4] chore(release): 2.1.1-next.1 [skip ci] ## [2.1.1-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.0...v2.1.1-next.1) (2023-09-14) ### Bug Fixes * Macro not replaced for provider docs ([ef1aecd](https://github.com/rdkcentral/firebolt-openrpc/commit/ef1aecd0092a8652bc7b936604f9478b7b55df27)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0bc913..835c7a36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.1.1-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.0...v2.1.1-next.1) (2023-09-14) + + +### Bug Fixes + +* Macro not replaced for provider docs ([ef1aecd](https://github.com/rdkcentral/firebolt-openrpc/commit/ef1aecd0092a8652bc7b936604f9478b7b55df27)) + # [2.1.0](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.0.4...v2.1.0) (2023-09-07) diff --git a/package-lock.json b/package-lock.json index d0c42608..141cd883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.0", + "version": "2.1.1-next.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@firebolt-js/openrpc", - "version": "2.1.0", + "version": "2.1.1-next.1", "license": "Apache-2.0", "dependencies": { "ajv": "^8.3.0", diff --git a/package.json b/package.json index 18dfe9b1..628f7b98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.0", + "version": "2.1.1-next.1", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module", From ec8e2599d530f9d2bd38fbb53b36e13c038edf2a Mon Sep 17 00:00:00 2001 From: kpears201 Date: Wed, 1 Nov 2023 10:05:10 -0700 Subject: [PATCH 3/4] fix: Errors thrown in async provider methods do not send the JSONRPC error response (#143) --- .../src/shared/ProvideManager/index.mjs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/languages/javascript/src/shared/ProvideManager/index.mjs b/languages/javascript/src/shared/ProvideManager/index.mjs index dde64557..68ce6e9c 100644 --- a/languages/javascript/src/shared/ProvideManager/index.mjs +++ b/languages/javascript/src/shared/ProvideManager/index.mjs @@ -93,6 +93,18 @@ const provide = function(capability, provider) { const response = { correlationId: request.correlationId } + let handleError = error => { + response.error = { + code: error.code || 1000, // todo: should be some reserved code for "Unknown" + message: error.message || `An error occured while calling provided ${method} method.` + } + + if (error.data) { + response.error.data = JSON.parse(JSON.stringify(error.data)) + } + + Transport.send(module, `${method}Error`, response) + } try { const result = provider[method].apply(provider, providerCallArgs) @@ -107,19 +119,10 @@ const provide = function(capability, provider) { } Transport.send(module, `${method}Response`, response) - }) + }).catch(err => handleError(err)) } catch(error) { - response.error = { - code: error.code || 1000, // todo: should be some reserved code for "Unknown" - message: error.message || `An error occured while calling provided ${method} method.` - } - - if (error.data) { - response.error.data = JSON.parse(JSON.stringify(error.data)) - } - - Transport.send(module, `${method}Error`, response) + handleError(error) } }) }) From c274ac4504abd58aa15febbd5fd5e5dc36645565 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 1 Nov 2023 17:05:50 +0000 Subject: [PATCH 4/4] chore(release): 2.1.1-next.2 [skip ci] ## [2.1.1-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1-next.1...v2.1.1-next.2) (2023-11-01) ### Bug Fixes * Errors thrown in async provider methods do not send the JSONRPC error response ([#143](https://github.com/rdkcentral/firebolt-openrpc/issues/143)) ([ec8e259](https://github.com/rdkcentral/firebolt-openrpc/commit/ec8e2599d530f9d2bd38fbb53b36e13c038edf2a)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 835c7a36..8044b214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.1.1-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1-next.1...v2.1.1-next.2) (2023-11-01) + + +### Bug Fixes + +* Errors thrown in async provider methods do not send the JSONRPC error response ([#143](https://github.com/rdkcentral/firebolt-openrpc/issues/143)) ([ec8e259](https://github.com/rdkcentral/firebolt-openrpc/commit/ec8e2599d530f9d2bd38fbb53b36e13c038edf2a)) + ## [2.1.1-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.0...v2.1.1-next.1) (2023-09-14) diff --git a/package-lock.json b/package-lock.json index 141cd883..a5dcd108 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.1-next.1", + "version": "2.1.1-next.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@firebolt-js/openrpc", - "version": "2.1.1-next.1", + "version": "2.1.1-next.2", "license": "Apache-2.0", "dependencies": { "ajv": "^8.3.0", diff --git a/package.json b/package.json index 628f7b98..6039a61a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.1-next.1", + "version": "2.1.1-next.2", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module",