Skip to content

Commit

Permalink
Feat: Bidirectional openrpc gen (#349)
Browse files Browse the repository at this point in the history
* modify spec docs

* update schema files

* modify compile cmd to take platform & app api
  • Loading branch information
ksentak authored Dec 13, 2024
1 parent f49e319 commit 90c8370
Show file tree
Hide file tree
Showing 39 changed files with 8,288 additions and 9,291 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas src/schemas --transformations",
"validate:compiled": "npx firebolt-openrpc validate --input dist/firebolt-open-rpc.json --pass-throughs && npm run validate --workspaces",
"validate": "npm run validate:each && npm run validate:compiled ",
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --output ./dist/firebolt-open-rpc.json --schemas src/schemas",
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --platformApi ./dist/firebolt-open-rpc.json --appApi ./dist/firebolt-app-open-rpc.json --schemas src/schemas",
"slice": "npm run slice --workspaces",
"sdks": "npm run sdk --workspaces",
"docs": "npm run docs --workspaces",
Expand Down Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@firebolt-js/openrpc": "3.1.1",
"@firebolt-js/openrpc": "../firebolt-openrpc",
"@firebolt-js/schemas": "2.0.0",
"@saithodev/semantic-release-backmerge": "^3.2.0",
"@semantic-release/changelog": "^6.0.1",
Expand Down
39 changes: 16 additions & 23 deletions src/openrpc/_internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:lifecycle:initialize"
]
"x-uses": ["xrn:firebolt:capability:lifecycle:initialize"]
}
],
"summary": "Initialize the SDK / FEE session.",
Expand All @@ -26,7 +24,7 @@
"name": "version",
"required": true,
"schema": {
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion"
},
"summary": "The semantic version of the SDK."
}
Expand All @@ -35,7 +33,15 @@
"name": "session",
"summary": "Info about the SDK/FEE session",
"schema": {
"$ref": "#/components/schemas/InitializeResult"
"type": "object",
"required": ["version"],
"properties": {
"version": {
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion",
"description": "The semantic version of the FEE."
}
},
"additionalProperties": false
}
},
"examples": [
Expand All @@ -59,28 +65,15 @@
"major": 1,
"minor": 0,
"patch": 0,
"readable": "Firebolt FEE 1.0.0"
"readable": "Firebolt FEE 1.0.0"
}
}
}
}
]
}
]
}
],
"components": {
"schemas": {
"InitializeResult": {
"title": "InitializeResult",
"type": "object",
"required": ["version"],
"properties": {
"version": {
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion",
"description": "The semantic version of the FEE."
}
},
"additionalProperties": false
}
}
"schemas": {}
}
}
}
44 changes: 14 additions & 30 deletions src/openrpc/accessibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:closedcaptions"
]
"x-uses": ["xrn:firebolt:capability:accessibility:closedcaptions"]
}
],
"result": {
"name": "closedCaptionsSettings",
"summary": "the closed captions settings",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/ClosedCaptionsSettings"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/ClosedCaptionsSettings"
}
},
"examples": [
Expand All @@ -52,10 +50,7 @@
"windowColor": "white",
"windowOpacity": 50
},
"preferredLanguages": [
"eng",
"spa"
]
"preferredLanguages": ["eng", "spa"]
}
}
}
Expand All @@ -71,16 +66,14 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:closedcaptions"
]
"x-uses": ["xrn:firebolt:capability:accessibility:closedcaptions"]
}
],
"result": {
"name": "closedCaptionsSettings",
"summary": "the closed captions settings",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/ClosedCaptionsSettings"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/ClosedCaptionsSettings"
}
},
"examples": [
Expand All @@ -105,10 +98,7 @@
"windowColor": "white",
"windowOpacity": 50
},
"preferredLanguages": [
"eng",
"spa"
]
"preferredLanguages": ["eng", "spa"]
}
}
}
Expand All @@ -126,16 +116,14 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:voiceguidance"
]
"x-uses": ["xrn:firebolt:capability:accessibility:voiceguidance"]
}
],
"result": {
"name": "settings",
"summary": "the voice guidance settings",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/VoiceGuidanceSettings"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/VoiceGuidanceSettings"
}
},
"examples": [
Expand All @@ -162,16 +150,14 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:voiceguidance"
]
"x-uses": ["xrn:firebolt:capability:accessibility:voiceguidance"]
}
],
"result": {
"name": "settings",
"summary": "the voice guidance settings",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/VoiceGuidanceSettings"
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/VoiceGuidanceSettings"
}
},
"examples": [
Expand All @@ -198,9 +184,7 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:accessibility:audiodescriptions"
]
"x-uses": ["xrn:firebolt:capability:accessibility:audiodescriptions"]
}
],
"result": {
Expand All @@ -222,7 +206,7 @@
}
}
]
}
}
],
"components": {
"schemas": {
Expand All @@ -236,7 +220,7 @@
"description": "Whether or not audio descriptions should be enabled by default"
}
}
}
}
}
}
}
}
14 changes: 4 additions & 10 deletions src/openrpc/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:account:id"
]
"x-uses": ["xrn:firebolt:capability:account:id"]
}
],
"result": {
Expand Down Expand Up @@ -49,9 +47,7 @@
},
{
"name": "capabilities",
"x-uses": [
"xrn:firebolt:capability:account:uid"
]
"x-uses": ["xrn:firebolt:capability:account:uid"]
}
],
"result": {
Expand All @@ -78,9 +74,7 @@
"tags": [
{
"name": "capabilities",
"x-manages": [
"xrn:firebolt:capability:token:account"
]
"x-manages": ["xrn:firebolt:capability:token:account"]
}
],
"params": [
Expand Down Expand Up @@ -139,4 +133,4 @@
}
}
}
}
}
Loading

0 comments on commit 90c8370

Please sign in to comment.