Socket
Socket
Sign inDemoInstall

@firebolt-js/openrpc

Package Overview
Dependencies
Maintainers
25
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebolt-js/openrpc - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2-next.1

src/js/shared/Results/index.mjs

29

CHANGELOG.md

@@ -0,1 +1,28 @@

## [1.6.2-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v1.6.1...v1.6.2-next.1) (2022-10-24)
### Bug Fixes
* $ref usage in context parameters ([906eeb6](https://github.com/rdkcentral/firebolt-openrpc/commit/906eeb6c3750594dd18e0c88a4ad86d22ad13897))
* JSONRPC docs for provider response has invalid format ([#61](https://github.com/rdkcentral/firebolt-openrpc/issues/61)) ([34ddeaf](https://github.com/rdkcentral/firebolt-openrpc/commit/34ddeaf7345074a894f901464d366b6eb4488e51))
* multiple provider doc headers for same module are broken ([#56](https://github.com/rdkcentral/firebolt-openrpc/issues/56)) ([e63928f](https://github.com/rdkcentral/firebolt-openrpc/commit/e63928f5160c9d4227f3207c8a7c90495245ff7a))
## [1.4.1-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v1.4.0...v1.4.1-next.1) (2022-10-24)
### Bug Fixes
* $ref usage in context parameters ([906eeb6](https://github.com/rdkcentral/firebolt-openrpc/commit/906eeb6c3750594dd18e0c88a4ad86d22ad13897))
* Add jsonrpc as a protocol for websocket transport ([#43](https://github.com/rdkcentral/firebolt-openrpc/issues/43)) ([091ef01](https://github.com/rdkcentral/firebolt-openrpc/commit/091ef01a141e6d5d5231694a162290dc89b73391))
* **bugs:** Provider examples ([0a74e08](https://github.com/rdkcentral/firebolt-openrpc/commit/0a74e0880c175b5a29e5666e0bdf08a2f3b3dd8a))
* docs for jsonrpc in provider ([#54](https://github.com/rdkcentral/firebolt-openrpc/issues/54)) ([a7d62c4](https://github.com/rdkcentral/firebolt-openrpc/commit/a7d62c432eebc3c839b6ae779693932ee0335219))
* JSONRPC docs for provider response has invalid format ([#61](https://github.com/rdkcentral/firebolt-openrpc/issues/61)) ([34ddeaf](https://github.com/rdkcentral/firebolt-openrpc/commit/34ddeaf7345074a894f901464d366b6eb4488e51))
* move any code execution outside of global execution path. Lazily init transport ([#46](https://github.com/rdkcentral/firebolt-openrpc/issues/46)) ([55830ec](https://github.com/rdkcentral/firebolt-openrpc/commit/55830ec56cef9e73b9712ed73f9c81c6403743f8))
* multiple provider doc headers for same module are broken ([#56](https://github.com/rdkcentral/firebolt-openrpc/issues/56)) ([e63928f](https://github.com/rdkcentral/firebolt-openrpc/commit/e63928f5160c9d4227f3207c8a7c90495245ff7a))
* Open-rpc param name should be value for setters ([#45](https://github.com/rdkcentral/firebolt-openrpc/issues/45)) ([54c4d97](https://github.com/rdkcentral/firebolt-openrpc/commit/54c4d97c1789c2339a94612a7906b1f7e859d43b))
* Property setter jsonrpc should follow set{Prop} pattern ([#44](https://github.com/rdkcentral/firebolt-openrpc/issues/44)) ([68080db](https://github.com/rdkcentral/firebolt-openrpc/commit/68080dba85be1a8da5442c60cec1c861997f8ca8))
* Provider pattern jsonrpc docs ([#50](https://github.com/rdkcentral/firebolt-openrpc/issues/50)) ([5cf4be9](https://github.com/rdkcentral/firebolt-openrpc/commit/5cf4be9601469add06ce7585233b9f2f758fba32))
* Provider TOC link ([#36](https://github.com/rdkcentral/firebolt-openrpc/issues/36)) ([80b5448](https://github.com/rdkcentral/firebolt-openrpc/commit/80b54486e21c7a33cfd28f1cef83680f10081a0f))
* When setting boolean properties to false in mock transport, getter is always returning default ([#37](https://github.com/rdkcentral/firebolt-openrpc/issues/37)) ([0936937](https://github.com/rdkcentral/firebolt-openrpc/commit/09369375b25957977aef01ed124b728f85e32e5c))
# 1.5.0

@@ -10,2 +37,2 @@

- Support for `property` methods that have setters
- Changed JSON-Schema `integer` mapping to `Number` since `bigint` isn't supported in JSON natively
- Changed JSON-Schema `integer` mapping to `Number` since `bigint` isn't supported in JSON natively

21

package.json
{
"name": "@firebolt-js/openrpc",
"version": "1.6.1",
"version": "1.6.2-next.1",
"description": "The Firebolt SDK Code & Doc Generator",

@@ -11,3 +11,3 @@ "main": "src/js/sdk/index.mjs",

"scripts": {
"prepare": "npm run prepare:setup && npm run dist",
"prepack": "npm run prepare:setup && npm run dist",
"prepare:setup": "npx mkdirp ./dist/docs ./build/docs/markdown ./build/docs/wiki ./build/sdk/javascript/src",

@@ -19,9 +19,11 @@ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config=jest.config.json --detectOpenHandles",

"build:sdk": "node ./src/cli.mjs --task sdk --source ./src/ --template ./src/local/template/js --output ./build/sdk/javascript/src --shared-schemas test/sharedSchemas",
"build:d": "node ./src/cli.mjs --task declarations --source ./src/ --output ./dist/lib/sdk.d.ts --shared-schemas src/schemas",
"build:docs": "node ./src/cli.mjs --task docs --source ./src/ --template ./src/template/markdown --output ./build/docs/markdown --shared-schemas test/sharedSchemas --as-path",
"build:wiki": "node ./src/cli.mjs --task docs --source ./src/ --template ./src/template/markdown --output ./build/docs/wiki --shared-schemas test/sharedSchemas",
"dist": "npm run validate && npm run build:sdk && npm run build:docs && npm run test"
"dist": "npm run validate && npm run build:sdk && npm run build:docs && npm run test",
"prepare": "husky install"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rdkcentral/firebolt-core-sdk/blob/main/src/modules//ottx/firebolt-openrpc.git"
"url": "git+https://github.com/rdkcentral/firebolt-openrpc.git"
},

@@ -32,5 +34,12 @@ "author": "",

},
"homepage": "https://github.com/rdkcentral/firebolt-core-sdk/blob/main/src/modules//ottx/firebolt-openrpc#readme",
"homepage": "https://github.com/rdkcentral/firebolt-openrpc#readme",
"devDependencies": {
"jest": "^27.3.1"
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.1",
"husky": "^8.0.0",
"jest": "^27.3.1",
"semantic-release": "^19.0.5"
},

@@ -37,0 +46,0 @@ "keywords": [

@@ -29,9 +29,2 @@ {

"params": [
{
"name": "listen",
"summary": "Whether or not to listen for requests to this interface method.",
"schema": {
"type": "boolean"
}
}
],

@@ -41,10 +34,3 @@ "result": {

"schema": {
"oneOf": [
{
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/ListenResponse"
},
{
"$ref": "#/components/schemas/SimpleProviderRequest"
}
]
"$ref": "#/components/schemas/SimpleProviderRequest"
}

@@ -86,9 +72,2 @@ },

"params": [
{
"name": "listen",
"summary": "Whether or not to listen for requests to this interface method.",
"schema": {
"type": "boolean"
}
}
],

@@ -98,10 +77,3 @@ "result": {

"schema": {
"oneOf": [
{
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/ListenResponse"
},
{
"$ref": "#/components/schemas/SimpleProviderRequest"
}
]
"$ref": "#/components/schemas/SimpleProviderRequest"
}

@@ -143,9 +115,2 @@ },

"params": [
{
"name": "listen",
"summary": "Whether or not to listen for requests to this interface method.",
"schema": {
"type": "boolean"
}
}
],

@@ -155,10 +120,3 @@ "result": {

"schema": {
"oneOf": [
{
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/ListenResponse"
},
{
"$ref": "#/components/schemas/SimpleProviderRequest"
}
]
"$ref": "#/components/schemas/SimpleProviderRequest"
}

@@ -200,9 +158,2 @@ },

"params": [
{
"name": "listen",
"summary": "Whether or not to listen for requests to this interface method.",
"schema": {
"type": "boolean"
}
}
],

@@ -212,10 +163,3 @@ "result": {

"schema": {
"oneOf": [
{
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/ListenResponse"
},
{
"$ref": "#/components/schemas/SimpleProviderRequest"
}
]
"$ref": "#/components/schemas/SimpleProviderRequest"
}

@@ -251,9 +195,2 @@ },

"params": [
{
"name": "listen",
"summary": "Whether or not to listen for requests to this interface method.",
"schema": {
"type": "boolean"
}
}
],

@@ -263,10 +200,3 @@ "result": {

"schema": {
"oneOf": [
{
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/ListenResponse"
},
{
"$ref": "#/components/schemas/NoResponseProviderRequest"
}
]
"$ref": "#/components/schemas/NoResponseProviderRequest"
}

@@ -273,0 +203,0 @@ },

@@ -63,2 +63,56 @@ {

{
"name": "property",
"summary": "A property.",
"tags": [
{
"name": "property"
},
{
"name": "capabilities",
"x-uses": "xrn:firebolt:capability:test:test"
}
],
"description": "A property for testing basic property generation.",
"params": [
],
"result": {
"name": "result",
"summary": "A result for testing basic method generation.",
"schema": {
"type": "object",
"required": [
"foo"
],
"properties": {
"foo": {
"type": "string",
"description": "A required field in the result."
},
"bar": {
"type": "number",
"description": "An optional field in the result."
}
},
"additionalProperties": false
}
},
"examples": [
{
"name": "Default Example",
"params": [
{
"name": "parameter",
"value": true
}
],
"result": {
"name": "Default Result",
"value": {
"foo": "here's foo"
}
}
}
]
},
{
"name": "methodWithMarkdownDescription",

@@ -156,2 +210,51 @@ "summary": "A method that pulls it's description from an external markdown file.",

]
},
{
"name": "methodWithMethodAttribute",
"summary": "A method using a method-attribute transform.",
"description": "A method for testing sub-method generation.",
"params": [
{
"name": "title",
"required": true,
"schema": {
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/LocalizedString"
},
"summary": "A localized string test parameter."
}
],
"result": {
"name": "result",
"summary": "A result for testing basic method generation.",
"schema": {
"type": "object",
"properties": {
"aString": {
"type": "string"
},
"aMethod": {
"type": "string",
"x-method": "Simple.method",
"x-this-param": "accessory"
}
}
}
},
"examples": [
{
"name": "Default Example",
"params": [
{
"name": "title",
"value": "test"
}
],
"result": {
"name": "Default Result",
"value": {
"foo": "here's foo"
}
}
}
]
}

@@ -158,0 +261,0 @@ ],

@@ -36,25 +36,204 @@ {

"Method": {
"type": "object",
"required": [
"examples"
],
"properties": {
"examples": {
"type": "array",
"minItems": 1
}
},
"allOf": [
{
"type": "object",
"required": [
"examples"
],
"properties": {
"examples": {
"type": "array",
"minItems": 1
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/EventTag"
}
}
}
},
"additionalProperties": true
"then": {
"$ref": "#/definitions/EventMethod"
}
},
{
"oneOf": [
{
"$ref": "#/definitions/TaglessMethod"
},
{
"$ref": "#/definitions/TaggedMethod"
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/PropertyTag"
}
}
}
]
},
"then": {
"$ref": "#/definitions/PropertyMethod"
}
},
{
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/CapabilitiesTagForProviderMethod"
}
}
}
},
"then": {
"$ref": "#/definitions/ProviderMethod"
}
},
{
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/CapabilitiesTag"
}
}
}
},
"then": {
"$ref": "#/definitions/CapabilityMethod"
}
},
{
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/RpcOnlyTag"
}
}
}
},
"then": {
"$ref": "#/definitions/RpcOnlyMethod"
}
},
{
"if": {
"required": [ "tags"],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/SynchronousTag"
}
}
}
},
"then": {
"$ref": "#/definitions/SynchronousMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/PolymorphicPullTag"
}
}
}
},
"then": {
"$ref": "#/definitions/PolymorphicPullMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/TemporalSetTag"
}
}
}
},
"then": {
"$ref": "#/definitions/TemporalSetMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/PolymorphicReducerTag"
}
}
}
},
"then": {
"$ref": "#/definitions/PolymorphicReducerMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/CallsMetricsTag"
}
}
}
},
"then": {
"$ref": "#/definitions/CallsMetricsMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/ExcludeTag"
}
}
}
},
"then": {
"$ref": "#/definitions/ExcludeMethod"
}
},
{
"if": {
"required": [ "tags" ],
"properties": {
"tags": {
"type": "array",
"contains": {
"$ref": "#/definitions/DeprecatedTag"
}
}
}
},
"then": {
"$ref": "#/definitions/DeprecatedMethod"
}
}

@@ -102,39 +281,3 @@ ]

"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/CapabilitiesTag"
},
{
"$ref": "#/definitions/EventTag"
},
{
"$ref": "#/definitions/PropertyTag"
},
{
"$ref": "#/definitions/PolymorphicPullTag"
},
{
"$ref": "#/definitions/TemporalSetTag"
},
{
"$ref": "#/definitions/PolymorphicReducerTag"
},
{
"$ref": "#/definitions/SynchronousTag"
},
{
"$ref": "#/definitions/CallsMetricsTag"
},
{
"$ref": "#/definitions/ExcludeTag"
},
{
"$ref": "#/definitions/RpcOnlyTag"
},
{
"$ref": "#/definitions/DeprecatedTag"
}
]
}
"minItems": 1
}

@@ -244,14 +387,19 @@ }

"tags": {
"allOf": [
{
"type": "array",
"contains": {
"$ref": "#/definitions/EventTag"
}
}
]
"type": "array",
"contains": {
"$ref": "#/definitions/EventTag"
}
},
"params": {
"type": "array",
"contains": {
"$ref": "#/definitions/ListenParameter"
},
"items": {
"$ref": "#/definitions/ContextParameter"
}
},
"result": {
"$ref": "#/definitions/EventResult"
}
}
}

@@ -298,5 +446,2 @@ },

},
"result": {
"$ref": "#/definitions/EventResult"
},
"examples": {

@@ -321,2 +466,8 @@ "type": "array",

}
},
"params": {
"type": "array",
"items": {
"$ref": "#/definitions/ContextParameter"
}
}

@@ -438,6 +589,3 @@ }

"name"
],
"propertyNames": {
"type": "string"
}
]
},

@@ -463,3 +611,4 @@ "EventTag": {

"x-since",
"x-pulls-for"
"x-pulls-for",
"x-error"
]

@@ -741,6 +890,6 @@ }

"required": [
"oneOf"
"anyOf"
],
"properties": {
"oneOf": {
"anyOf": {
"type": "array",

@@ -757,3 +906,3 @@ "minItems": 2,

"type": "string",
"pattern": "^https://meta\\.comcast\\.com/firebolt/types/?#/definitions/ListenResponse$"
"pattern": "/ListenResponse$"
}

@@ -805,4 +954,63 @@ }

}
},
"ContextParameter": {
"title":"ContextParameter",
"type": "object",
"additionalProperties": true,
"required": [ "required", "schema" ],
"properties": {
"required": {
"const": true
},
"schema": {
"type": "object",
"oneOf": [
{ "required": [ "type" ] },
{ "required": [ "$ref" ] }
],
"properties": {
"type": {
"type": "string",
"enum": ["integer", "string", "number", "boolean"]
}
}
}
}
},
"ListenParameter": {
"type": "object",
"additionalProperties": true,
"properties": {
"name": {
"const": "listen"
},
"schema": {
"type": "object",
"properties": {
"type": {
"const": "boolean"
}
}
}
}
},
"ListenResponse": {
"title": "ListenResponse",
"type": "object",
"required": [
"event",
"listening"
],
"properties": {
"event": {
"type": "string",
"pattern": "[a-zA-Z]+\\.on[A-Z][a-zA-Z]+"
},
"listening": {
"type": "boolean"
}
},
"additionalProperties": false
}
}
}

@@ -5,3 +5,5 @@

function ${method.name}(${method.params}) {
const p = Transport.send('${info.title}', '${method.name}', { ${method.params} })
const transforms = ${method.transforms}
const p = Transport.send('${info.title}', '${method.name}', { ${method.params} }, transforms)

@@ -8,0 +10,0 @@ p.then(_ => {

function ${method.name}(${method.params}) {
return Transport.send('${info.title}', '${method.name}', { ${method.params} })
const transforms = ${method.transforms}
return Transport.send('${info.title}', '${method.name}', { ${method.params} }, transforms)
}

@@ -1,3 +0,4 @@

function ${method.name}() {
return Prop.prop('${info.title}', '${method.name}', arguments, ${method.property.immutable}, ${method.property.readonly})
function ${method.name}(${method.params}) {
const callbackOrValue = arguments[${method.params.count}]
return Prop.prop('${info.title}', '${method.name}', { ${method.params} }, callbackOrValue, ${method.property.immutable}, ${method.property.readonly}, ${method.params.count})
}
function ${method.name}(${method.params}) {
const transforms = ${method.transforms}
if (arguments.length === 1 && Array.isArray(arguments[0])) {
return Transport.send('${info.title}', '${method.name}', arguments[0])
return Transport.send('${info.title}', '${method.name}', arguments[0], transforms)
}
else {
return Transport.send('${info.title}', '${method.name}', { ${method.params} })
return Transport.send('${info.title}', '${method.name}', { ${method.params} }, transforms)
}
}

@@ -11,4 +11,5 @@ function ${method.name}(...args) {

// function start(module, method, addName, removeName, params, add, remove) {
return TemporalSet.start('${info.title}', '${method.name}', '${method.temporalset.add}', '${method.temporalset.remove}', arguments, add, remove)
}
const transforms = ${method.transforms}
return TemporalSet.start('${info.title}', '${method.name}', '${method.temporalset.add}', '${method.temporalset.remove}', arguments, add, remove, transforms)
}

@@ -35,3 +35,3 @@ ### ${provider}

<details>
<summary>**JSON-RPC**</summary>
<summary>JSON-RPC</summary>

@@ -94,6 +94,4 @@ **Register to recieve each provider API**

"params": {
"result": {
"correlationId": ${provider.interface.example.correlationId},
"result": ${provider.interface.example.result}
}
"correlationId": ${provider.interface.example.correlationId},
"result": ${provider.interface.example.result}
}

@@ -116,1 +114,2 @@ }

</details>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc