diff --git a/languages/javascript/templates/examples/default.md b/languages/javascript/templates/examples/default.md index ecc979ba..8a407397 100644 --- a/languages/javascript/templates/examples/default.md +++ b/languages/javascript/templates/examples/default.md @@ -1,6 +1,4 @@ import { ${module} } from '${package.name}' -${module}.${method.name}(${example.params}) - .then(${method.result.name} => { - console.log(${method.result.name}) - }) \ No newline at end of file +let ${method.result.name} = await ${module}.${method.name}(${example.params}) +console.log(${method.result.name}) \ No newline at end of file diff --git a/languages/javascript/templates/examples/polymorphic-pull-event.md b/languages/javascript/templates/examples/polymorphic-pull-event.md index 7bc2baa7..5881ac08 100644 --- a/languages/javascript/templates/examples/polymorphic-pull-event.md +++ b/languages/javascript/templates/examples/polymorphic-pull-event.md @@ -1,9 +1,8 @@ import { ${module} } from '${package.name}' -${module}.${method.pulls.for}(function(parameters) { +let success = await ${module}.${method.pulls.for}(async parameters => { console.log(parameters.entityId) console.log(parameters.assetId) - return Promise.resolve(${originator.params[1].example.value}) -}).then(success => { - console.log(success) -}) \ No newline at end of file + return ${originator.params[1].example.value} +}) +console.log(success) \ No newline at end of file diff --git a/languages/javascript/templates/examples/polymorphic-pull.md b/languages/javascript/templates/examples/polymorphic-pull.md index 7c53080c..d754217d 100644 --- a/languages/javascript/templates/examples/polymorphic-pull.md +++ b/languages/javascript/templates/examples/polymorphic-pull.md @@ -1,6 +1,4 @@ import { ${module} } from '${package.name}' -${module}.${method.name}(${method.params[1].example.value}) - .then(success => { - console.log(success) - }) \ No newline at end of file +let success = await ${module}.${method.name}(${method.params[1].example.value}) +console.log(success) \ No newline at end of file diff --git a/languages/javascript/templates/examples/setter.md b/languages/javascript/templates/examples/setter.md index c258314a..85c2bcff 100644 --- a/languages/javascript/templates/examples/setter.md +++ b/languages/javascript/templates/examples/setter.md @@ -1,6 +1,4 @@ import { ${module} } from '${package.name}' -${module}.${method.setter.for}(${example.params}) - .then(${method.result.name} => { - console.log(${method.result.name}) - }) \ No newline at end of file +let ${method.result.name} = await ${module}.${method.setter.for}(${example.params}) +console.log(${method.result.name}) \ No newline at end of file diff --git a/languages/javascript/templates/examples/subscriber.md b/languages/javascript/templates/examples/subscriber.md index 99c0516f..0dd6a7a3 100644 --- a/languages/javascript/templates/examples/subscriber.md +++ b/languages/javascript/templates/examples/subscriber.md @@ -1,7 +1,6 @@ import { ${module} } from '${package.name}' -${method.alternative}(value => { +let listenerId = await ${method.alternative}(value => { console.log(value) -}).then(listenerId => { - console.log(listenerId) -}) \ No newline at end of file +}) +console.log(listenerId) \ No newline at end of file diff --git a/languages/markdown/templates/codeblocks/provider.md b/languages/markdown/templates/codeblocks/provider.md index 32823cb0..e30d3a19 100644 --- a/languages/markdown/templates/codeblocks/provider.md +++ b/languages/markdown/templates/codeblocks/provider.md @@ -23,7 +23,7 @@ import { ${info.title} } from '${package.name}' class My${provider} { ${provider.interface.start} async ${provider.interface.name}(parameters, session) { - return await Promise.resolve(${provider.interface.example.result}) + return ${provider.interface.example.result} } ${provider.interface.end} } diff --git a/package-lock.json b/package-lock.json index 797832a8..b4220f0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.2", + "version": "2.2.0-next.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@firebolt-js/openrpc", - "version": "2.1.2", + "version": "2.2.0-next.1", "license": "Apache-2.0", "dependencies": { "ajv": "^8.3.0", diff --git a/package.json b/package.json index df369b01..5ecb67ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/openrpc", - "version": "2.1.2", + "version": "2.2.0-next.1", "description": "The Firebolt SDK Code & Doc Generator", "main": "languages/javascript/src/sdk.mjs", "type": "module",