Skip to content

Commit 90c8370

Browse files
authored
Feat: Bidirectional openrpc gen (#349)
* modify spec docs * update schema files * modify compile cmd to take platform & app api
1 parent f49e319 commit 90c8370

39 files changed

+8288
-9291
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas src/schemas --transformations",
1717
"validate:compiled": "npx firebolt-openrpc validate --input dist/firebolt-open-rpc.json --pass-throughs && npm run validate --workspaces",
1818
"validate": "npm run validate:each && npm run validate:compiled ",
19-
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --output ./dist/firebolt-open-rpc.json --schemas src/schemas",
19+
"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",
2020
"slice": "npm run slice --workspaces",
2121
"sdks": "npm run sdk --workspaces",
2222
"docs": "npm run docs --workspaces",
@@ -45,7 +45,7 @@
4545
"devDependencies": {
4646
"@commitlint/cli": "^17.0.3",
4747
"@commitlint/config-conventional": "^17.0.3",
48-
"@firebolt-js/openrpc": "3.1.1",
48+
"@firebolt-js/openrpc": "../firebolt-openrpc",
4949
"@firebolt-js/schemas": "2.0.0",
5050
"@saithodev/semantic-release-backmerge": "^3.2.0",
5151
"@semantic-release/changelog": "^6.0.1",

src/openrpc/_internal.json

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
},
1515
{
1616
"name": "capabilities",
17-
"x-uses": [
18-
"xrn:firebolt:capability:lifecycle:initialize"
19-
]
17+
"x-uses": ["xrn:firebolt:capability:lifecycle:initialize"]
2018
}
2119
],
2220
"summary": "Initialize the SDK / FEE session.",
@@ -26,7 +24,7 @@
2624
"name": "version",
2725
"required": true,
2826
"schema": {
29-
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion"
27+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion"
3028
},
3129
"summary": "The semantic version of the SDK."
3230
}
@@ -35,7 +33,15 @@
3533
"name": "session",
3634
"summary": "Info about the SDK/FEE session",
3735
"schema": {
38-
"$ref": "#/components/schemas/InitializeResult"
36+
"type": "object",
37+
"required": ["version"],
38+
"properties": {
39+
"version": {
40+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/types#/definitions/SemanticVersion",
41+
"description": "The semantic version of the FEE."
42+
}
43+
},
44+
"additionalProperties": false
3945
}
4046
},
4147
"examples": [
@@ -59,28 +65,15 @@
5965
"major": 1,
6066
"minor": 0,
6167
"patch": 0,
62-
"readable": "Firebolt FEE 1.0.0"
68+
"readable": "Firebolt FEE 1.0.0"
6369
}
6470
}
6571
}
66-
}
67-
]
72+
}
73+
]
6874
}
6975
],
7076
"components": {
71-
"schemas": {
72-
"InitializeResult": {
73-
"title": "InitializeResult",
74-
"type": "object",
75-
"required": ["version"],
76-
"properties": {
77-
"version": {
78-
"$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion",
79-
"description": "The semantic version of the FEE."
80-
}
81-
},
82-
"additionalProperties": false
83-
}
84-
}
77+
"schemas": {}
8578
}
86-
}
79+
}

src/openrpc/accessibility.json

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@
1818
},
1919
{
2020
"name": "capabilities",
21-
"x-uses": [
22-
"xrn:firebolt:capability:accessibility:closedcaptions"
23-
]
21+
"x-uses": ["xrn:firebolt:capability:accessibility:closedcaptions"]
2422
}
2523
],
2624
"result": {
2725
"name": "closedCaptionsSettings",
2826
"summary": "the closed captions settings",
2927
"schema": {
30-
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/ClosedCaptionsSettings"
28+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/ClosedCaptionsSettings"
3129
}
3230
},
3331
"examples": [
@@ -52,10 +50,7 @@
5250
"windowColor": "white",
5351
"windowOpacity": 50
5452
},
55-
"preferredLanguages": [
56-
"eng",
57-
"spa"
58-
]
53+
"preferredLanguages": ["eng", "spa"]
5954
}
6055
}
6156
}
@@ -71,16 +66,14 @@
7166
},
7267
{
7368
"name": "capabilities",
74-
"x-uses": [
75-
"xrn:firebolt:capability:accessibility:closedcaptions"
76-
]
69+
"x-uses": ["xrn:firebolt:capability:accessibility:closedcaptions"]
7770
}
7871
],
7972
"result": {
8073
"name": "closedCaptionsSettings",
8174
"summary": "the closed captions settings",
8275
"schema": {
83-
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/ClosedCaptionsSettings"
76+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/ClosedCaptionsSettings"
8477
}
8578
},
8679
"examples": [
@@ -105,10 +98,7 @@
10598
"windowColor": "white",
10699
"windowOpacity": 50
107100
},
108-
"preferredLanguages": [
109-
"eng",
110-
"spa"
111-
]
101+
"preferredLanguages": ["eng", "spa"]
112102
}
113103
}
114104
}
@@ -126,16 +116,14 @@
126116
},
127117
{
128118
"name": "capabilities",
129-
"x-uses": [
130-
"xrn:firebolt:capability:accessibility:voiceguidance"
131-
]
119+
"x-uses": ["xrn:firebolt:capability:accessibility:voiceguidance"]
132120
}
133121
],
134122
"result": {
135123
"name": "settings",
136124
"summary": "the voice guidance settings",
137125
"schema": {
138-
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/VoiceGuidanceSettings"
126+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/VoiceGuidanceSettings"
139127
}
140128
},
141129
"examples": [
@@ -162,16 +150,14 @@
162150
},
163151
{
164152
"name": "capabilities",
165-
"x-uses": [
166-
"xrn:firebolt:capability:accessibility:voiceguidance"
167-
]
153+
"x-uses": ["xrn:firebolt:capability:accessibility:voiceguidance"]
168154
}
169155
],
170156
"result": {
171157
"name": "settings",
172158
"summary": "the voice guidance settings",
173159
"schema": {
174-
"$ref": "https://meta.comcast.com/firebolt/accessibility#/definitions/VoiceGuidanceSettings"
160+
"$ref": "https://meta.rdkcentral.com/firebolt/schemas/accessibility#/definitions/VoiceGuidanceSettings"
175161
}
176162
},
177163
"examples": [
@@ -198,9 +184,7 @@
198184
},
199185
{
200186
"name": "capabilities",
201-
"x-uses": [
202-
"xrn:firebolt:capability:accessibility:audiodescriptions"
203-
]
187+
"x-uses": ["xrn:firebolt:capability:accessibility:audiodescriptions"]
204188
}
205189
],
206190
"result": {
@@ -222,7 +206,7 @@
222206
}
223207
}
224208
]
225-
}
209+
}
226210
],
227211
"components": {
228212
"schemas": {
@@ -236,7 +220,7 @@
236220
"description": "Whether or not audio descriptions should be enabled by default"
237221
}
238222
}
239-
}
223+
}
240224
}
241225
}
242-
}
226+
}

src/openrpc/account.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
},
1717
{
1818
"name": "capabilities",
19-
"x-uses": [
20-
"xrn:firebolt:capability:account:id"
21-
]
19+
"x-uses": ["xrn:firebolt:capability:account:id"]
2220
}
2321
],
2422
"result": {
@@ -49,9 +47,7 @@
4947
},
5048
{
5149
"name": "capabilities",
52-
"x-uses": [
53-
"xrn:firebolt:capability:account:uid"
54-
]
50+
"x-uses": ["xrn:firebolt:capability:account:uid"]
5551
}
5652
],
5753
"result": {
@@ -78,9 +74,7 @@
7874
"tags": [
7975
{
8076
"name": "capabilities",
81-
"x-manages": [
82-
"xrn:firebolt:capability:token:account"
83-
]
77+
"x-manages": ["xrn:firebolt:capability:token:account"]
8478
}
8579
],
8680
"params": [
@@ -139,4 +133,4 @@
139133
}
140134
}
141135
}
142-
}
136+
}

0 commit comments

Comments
 (0)