diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index 897303fae..c4b6a5f98 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -86,11 +86,17 @@ jobs: npm run dist - name: Check if semantic-release created a build id: check_build - uses: andstor/file-existence-action@v2 + uses: actions/github-script@v6 with: - files: './src/sdks/core/dist/lib/firebolt.mjs' + script: | + const fs = require('fs'); + const path = './src/sdks/core/dist/lib/firebolt.mjs'; + return fs.existsSync(path); + - name: File Existence Output + run: | + echo "File exists: ${{ steps.check_build.outputs.result }}" - name: Release Firebolt SDKs to NPM - if: steps.check_build.outputs.files_exists == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch') + if: steps.check_build.outputs.result == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch') env: NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. run: | @@ -98,19 +104,19 @@ jobs: echo "NPM DIST TAG :: " $NPM_DIST_TAG npm publish --tag $NPM_DIST_TAG --workspaces - name: Dry-run Firebolt SDKs to NPM - if: steps.check_build.outputs.files_exists == 'true' && (github.ref_name == 'main' && github.event_name != 'workflow_dispatch') + if: steps.check_build.outputs.result == 'true' && (github.ref_name == 'main' && github.event_name != 'workflow_dispatch') env: NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth. run: npm publish --tag $NPM_DIST_TAG --workspaces --dry-run - name: Checkout firebolt GitHub.io repository - if: steps.check_build.outputs.files_exists == 'true' + if: steps.check_build.outputs.result == 'true' env: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches run: | cd /tmp git clone https://rdkcentral:$GITHUB_TOKEN@github.com/rdkcentral/firebolt.git ./firebolt-docs - name: Release docs to GitHub.io - if: steps.check_build.outputs.files_exists == 'true' && (github.ref_name == 'main' || github.ref_name == 'next' || github.ref_name == 'next-major' || github.event_name == 'pull_request') + if: steps.check_build.outputs.result == 'true' && (github.ref_name == 'main' || github.ref_name == 'next' || github.ref_name == 'next-major' || github.event_name == 'pull_request') env: GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches run: | diff --git a/.github/workflows/run-standalone-mfos-tests.yml b/.github/workflows/run-standalone-mfos-tests.yml index 675202521..54f281328 100644 --- a/.github/workflows/run-standalone-mfos-tests.yml +++ b/.github/workflows/run-standalone-mfos-tests.yml @@ -24,7 +24,7 @@ jobs: ./.github/workflows/utils.sh runTests - name: Upload report.json as an artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: report path: ${{ github.workspace }}/report diff --git a/CHANGELOG.md b/CHANGELOG.md index b08976f8f..beb4cf2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,108 @@ +# [1.4.0-next.12](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.11...v1.4.0-next.12) (2024-09-20) + + +### Bug Fixes + +* Added deprecation note in screen resolution method ([#323](https://github.com/rdkcentral/firebolt-apis/issues/323)) ([e146c43](https://github.com/rdkcentral/firebolt-apis/commit/e146c4343d9c7989cd9ca1578a5efae4c346f1f3)) + +# [1.4.0-next.11](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.10...v1.4.0-next.11) (2024-09-20) + + +### Bug Fixes + +* Reverted App selection tag change ([#322](https://github.com/rdkcentral/firebolt-apis/issues/322)) ([eee90e4](https://github.com/rdkcentral/firebolt-apis/commit/eee90e4f17deedc689ff858021199de8de772c8e)) + +# [1.4.0-next.10](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.9...v1.4.0-next.10) (2024-09-19) + + +### Features + +* Add global subscribe & HDMI tests to manage test app ([#320](https://github.com/rdkcentral/firebolt-apis/issues/320)) ([63962ab](https://github.com/rdkcentral/firebolt-apis/commit/63962ab3131358f77e97af73bc3e4207f958e5fb)) + +# [1.4.0-next.9](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.8...v1.4.0-next.9) (2024-09-19) + + +### Features + +* Fix Core SDK test app ([#321](https://github.com/rdkcentral/firebolt-apis/issues/321)) ([3a78534](https://github.com/rdkcentral/firebolt-apis/commit/3a78534480928b14723e18eb4f90304de4077160)) + +# [1.4.0-next.8](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.7...v1.4.0-next.8) (2024-09-18) + + +### Bug Fixes + +* Modified device.hdr description ([#319](https://github.com/rdkcentral/firebolt-apis/issues/319)) ([fd2bfb0](https://github.com/rdkcentral/firebolt-apis/commit/fd2bfb04d349e634f96d614713399467f238e1b3)) + +# [1.4.0-next.7](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.6...v1.4.0-next.7) (2024-09-18) + + +### Bug Fixes + +* Addressed architectural review comments ([#316](https://github.com/rdkcentral/firebolt-apis/issues/316)) ([a89275a](https://github.com/rdkcentral/firebolt-apis/commit/a89275a1f6b204e0626a6267f5096116094cb520)) + +# [1.4.0-next.6](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.5...v1.4.0-next.6) (2024-09-17) + + +### Features + +* Add OpenRPC to generated C++ SDK ([#314](https://github.com/rdkcentral/firebolt-apis/issues/314)) ([6ed96cb](https://github.com/rdkcentral/firebolt-apis/commit/6ed96cb2a83216baf1aacedf220e9a83beb50a68)) + +# [1.4.0-next.5](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.4...v1.4.0-next.5) (2024-09-17) + + +### Bug Fixes + +* Updated the artifact upload version for workflow ([#317](https://github.com/rdkcentral/firebolt-apis/issues/317)) ([ef9b441](https://github.com/rdkcentral/firebolt-apis/commit/ef9b441590229e3f4d5abb1eddd8068f2ed997d4)) + +# [1.4.0-next.4](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.3...v1.4.0-next.4) (2024-09-12) + + +### Bug Fixes + +* Added individual sdk openrpcs to the doc specification ([#311](https://github.com/rdkcentral/firebolt-apis/issues/311)) ([ace1d64](https://github.com/rdkcentral/firebolt-apis/commit/ace1d644cac114c457a739a4e4cdfe8990a96fc8)) + +# [1.4.0-next.3](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.2...v1.4.0-next.3) (2024-09-03) + + +### Bug Fixes + +* Updated xrn:firebolt:capability:secondscreen:protocol to should ([#310](https://github.com/rdkcentral/firebolt-apis/issues/310)) ([1895fe6](https://github.com/rdkcentral/firebolt-apis/commit/1895fe69d91f7f31a955103c80a17f1f4beb149a)) + +# [1.4.0-next.2](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0-next.1...v1.4.0-next.2) (2024-09-03) + + +### Bug Fixes + +* CI fix for file exists ([#308](https://github.com/rdkcentral/firebolt-apis/issues/308)) ([b44c11a](https://github.com/rdkcentral/firebolt-apis/commit/b44c11ac3fd96e0a035bf306a064a1acf8ce654f)) + +# [1.4.0-next.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.1-next.3...v1.4.0-next.1) (2024-09-03) + + +### Features + +* Spec and Doc fixes for Release 1.4.0 ([#304](https://github.com/rdkcentral/firebolt-apis/issues/304)) ([191664b](https://github.com/rdkcentral/firebolt-apis/commit/191664b18355cca130d783f850727caf058e116a)) + +## [1.3.1-next.3](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.1-next.2...v1.3.1-next.3) (2024-08-30) + + +### Bug Fixes + +* Adjust type in CPP device template due to openrpc change ([#307](https://github.com/rdkcentral/firebolt-apis/issues/307)) ([1f10a15](https://github.com/rdkcentral/firebolt-apis/commit/1f10a154c45d1c5f6fff45448e0a1d6db243275e)) + +## [1.3.1-next.2](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.1-next.1...v1.3.1-next.2) (2024-08-23) + + +### Bug Fixes + +* Bump firebolt-openrpc to fix typescript ([#305](https://github.com/rdkcentral/firebolt-apis/issues/305)) ([62887cf](https://github.com/rdkcentral/firebolt-apis/commit/62887cf73b2e2202446e9a7cce6ec26d8d5a5842)) + +## [1.3.1-next.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.0...v1.3.1-next.1) (2024-08-19) + + +### Bug Fixes + +* Spec and Doc fixes ([#302](https://github.com/rdkcentral/firebolt-apis/issues/302)) ([6010a85](https://github.com/rdkcentral/firebolt-apis/commit/6010a85e9883480aba71378391f5b6223645fb28)) + # [1.3.0](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.0...v1.3.0) (2024-08-12) diff --git a/package-lock.json b/package-lock.json index 42027e562..6371a529b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/sdks", - "version": "1.3.0", + "version": "1.4.0-next.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@firebolt-js/sdks", - "version": "1.3.0", + "version": "1.4.0-next.12", "license": "Apache-2.0", "workspaces": [ "src/sdks/core", @@ -19,7 +19,7 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@firebolt-js/openrpc": "3.1.0", + "@firebolt-js/openrpc": "3.1.1", "@firebolt-js/schemas": "2.0.0", "@saithodev/semantic-release-backmerge": "^3.2.0", "@semantic-release/changelog": "^6.0.1", @@ -1075,9 +1075,9 @@ "link": true }, "node_modules/@firebolt-js/openrpc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@firebolt-js/openrpc/-/openrpc-3.1.0.tgz", - "integrity": "sha512-OUbEInML9oF8d3P5brYN8iHUdfYxO5xBvnKm52ckyy6nJ7jYL2RJDobpeZa7flfeauuFXzkSK/ZMDtiOFxqQRg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@firebolt-js/openrpc/-/openrpc-3.1.1.tgz", + "integrity": "sha512-+ypWAo02Q/eYc3PQ0pHii/37u2Q9fIdeGyT8o9ghLO1rIYgB5q7N2rTE0hYEKgbOTAq6GdyFLV/TZ4Vj8D2jCA==", "dev": true, "dependencies": { "ajv": "^8.12.0", @@ -16962,7 +16962,7 @@ }, "src/sdks/core": { "name": "@firebolt-js/sdk", - "version": "1.3.0-next.3", + "version": "1.4.0-next.11", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", @@ -16973,7 +16973,7 @@ }, "src/sdks/discovery": { "name": "@firebolt-js/discovery-sdk", - "version": "1.3.0-next.3", + "version": "1.4.0-next.11", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", @@ -16984,7 +16984,7 @@ }, "src/sdks/manage": { "name": "@firebolt-js/manage-sdk", - "version": "1.3.0-next.3", + "version": "1.4.0-next.11", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", diff --git a/package.json b/package.json index fc81d2891..b1cb51b99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/sdks", - "version": "1.3.0", + "version": "1.4.0-next.12", "description": "The Firebolt JS SDK", "type": "module", "bin": { @@ -45,7 +45,7 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@firebolt-js/openrpc": "3.1.0", + "@firebolt-js/openrpc": "3.1.1", "@firebolt-js/schemas": "2.0.0", "@saithodev/semantic-release-backmerge": "^3.2.0", "@semantic-release/changelog": "^6.0.1", diff --git a/requirements/specifications/openrpc-extensions/app-passthrough-apis.md b/requirements/specifications/openrpc-extensions/app-passthrough-apis.md index 826f7bed3..0b774fa71 100644 --- a/requirements/specifications/openrpc-extensions/app-passthrough-apis.md +++ b/requirements/specifications/openrpc-extensions/app-passthrough-apis.md @@ -24,22 +24,23 @@ This document is written using the [IETF Best Common Practice 14](https://www.rf The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**NOT RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be interpreted as described in [BCP 14](https://www.rfc-editor.org/rfc/rfc2119.txt) [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. ## 2. Table of Contents -- [1. Overview](#1-overview) -- [2. Table of Contents](#2-table-of-contents) -- [3. Open RPC Extensions](#3-open-rpc-extensions) - - [3.1. Provided By Extension](#31-provided-by-extension) -- [4. Routing App pass-through APIs](#4-routing-app-pass-through-apis) - - [4.1. No available providers](#41-no-available-providers) - - [4.2. Direct pass-through](#42-direct-pass-through) - - [4.4. Pass-through notifications](#44-pass-through-notifications) -- [5. Provider Candidates](#5-provider-candidates) -- [6. Best Candidate](#6-best-candidate) -- [7. Result Transformations](#7-result-transformations) -- [8. Provider Parameter Injection](#8-provider-parameter-injection) -- [9. API Gateway](#9-api-gateway) -- [10. Example: User Interest](#10-example-user-interest) - - [10.1. User Interest Pull](#101-user-interest-pull) - - [10.2. User Interest Push](#102-user-interest-push) +- [App Pass-through APIs](#app-pass-through-apis) + - [1. Overview](#1-overview) + - [2. Table of Contents](#2-table-of-contents) + - [3. Open RPC Extensions](#3-open-rpc-extensions) + - [3.1. Provided By Extension](#31-provided-by-extension) + - [4. Routing App pass-through APIs](#4-routing-app-pass-through-apis) + - [4.1. No available providers](#41-no-available-providers) + - [4.2. Direct pass-through](#42-direct-pass-through) + - [4.4. Pass-through notifications](#44-pass-through-notifications) + - [5. Provider Candidates](#5-provider-candidates) + - [6. Best Candidate](#6-best-candidate) + - [7. Result Transformations](#7-result-transformations) + - [8. Provider Parameter Injection](#8-provider-parameter-injection) + - [9. API Gateway](#9-api-gateway) + - [10. Example: User Interest](#10-example-user-interest) + - [10.1. User Interest Pull](#101-user-interest-pull) + - [10.2. User Interest Push](#102-user-interest-push) ## 3. Open RPC Extensions @@ -460,4 +461,4 @@ Platform Method: } ] } -``` +``` \ No newline at end of file diff --git a/src/js/github.io/index.mjs b/src/js/github.io/index.mjs index 7681a9d7f..904c97150 100644 --- a/src/js/github.io/index.mjs +++ b/src/js/github.io/index.mjs @@ -95,6 +95,8 @@ packageJson.workspaces.forEach(async workspace => { const specification = await readJson(path.join('dist', 'firebolt-specification.json')) const openrpc = await readJson(path.join('dist', 'firebolt-open-rpc.json')) const corerpc = await readJson(path.join('dist', 'firebolt-core-open-rpc.json')) +const managerpc = await readJson(path.join('dist', 'firebolt-manage-open-rpc.json')) +const discoveryrpc = await readJson(path.join('dist', 'firebolt-discovery-open-rpc.json')) const capabilities = () => { const getOrCreateCapMethodList = (capabilities, c) => capabilities[c] = capabilities[c] || { uses: [], manages: [], provides: [] } @@ -170,6 +172,24 @@ if (version === 'latest') { writeJson(path.join(parsedArgs.output, 'requirements', packageJson.version, 'specifications', 'firebolt-open-rpc.json'), openrpc) } +// this is the firebolt Core OpenRPC spec JSON +writeJson(path.join(parsedArgs.output, 'requirements', version, 'specifications', 'firebolt-core-open-rpc.json'), corerpc) +if (version === 'latest') { + writeJson(path.join(parsedArgs.output, 'requirements', packageJson.version, 'specifications', 'firebolt-core-open-rpc.json'), corerpc) +} + +// this is the firebolt Manage OpenRPC spec JSON +writeJson(path.join(parsedArgs.output, 'requirements', version, 'specifications', 'firebolt-manage-open-rpc.json'), managerpc) +if (version === 'latest') { + writeJson(path.join(parsedArgs.output, 'requirements', packageJson.version, 'specifications', 'firebolt-manage-open-rpc.json'), managerpc) +} + +// this is the firebolt Discovery OpenRPC spec JSON +writeJson(path.join(parsedArgs.output, 'requirements', version, 'specifications', 'firebolt-discovery-open-rpc.json'), discoveryrpc) +if (version === 'latest') { + writeJson(path.join(parsedArgs.output, 'requirements', packageJson.version, 'specifications', 'firebolt-discovery-open-rpc.json'), discoveryrpc) +} + function channel(version) { const parts = version.split("-") diff --git a/src/json/firebolt-specification.json b/src/json/firebolt-specification.json index 13f662b93..828093eb0 100644 --- a/src/json/firebolt-specification.json +++ b/src/json/firebolt-specification.json @@ -147,9 +147,6 @@ "negotiable": false } }, - "xrn:firebolt:capability:privacy:advertising": { - "level": "could" - }, "xrn:firebolt:capability:metrics:distributor": { "level": "could" }, @@ -158,6 +155,9 @@ }, "xrn:firebolt:capability:account:uid": { "level": "should" + }, + "xrn:firebolt:capability:secondscreen:protocol": { + "level": "should" } }, "apis": {} diff --git a/src/openrpc/_internal.json b/src/openrpc/_internal.json index 7f04a6dc1..a04b45e79 100644 --- a/src/openrpc/_internal.json +++ b/src/openrpc/_internal.json @@ -35,15 +35,7 @@ "name": "session", "summary": "Info about the SDK/FEE session", "schema": { - "type": "object", - "required": ["version"], - "properties": { - "version": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The semantic version of the FEE." - } - }, - "additionalProperties": false + "$ref": "#/components/schemas/InitializeResult" } }, "examples": [ @@ -76,7 +68,19 @@ } ], "components": { - "schemas": { + "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 + } } } } \ No newline at end of file diff --git a/src/openrpc/advertising.json b/src/openrpc/advertising.json index 22a86b312..20235446e 100644 --- a/src/openrpc/advertising.json +++ b/src/openrpc/advertising.json @@ -81,8 +81,7 @@ { "name": "capabilities", "x-uses": [ - "xrn:firebolt:capability:privacy:advertising", - "xrn:firebolt:capability:advertising:configuration" + "xrn:firebolt:capability:advertising:policy" ] } ], @@ -157,7 +156,7 @@ ] } ], - "summary": "Get the advertising ID", + "summary": "Get the IAB compliant identifier for advertising (IFA). It is recommended to use the IFA to manage advertising related activities while respecting the user's privacy settings.", "params": [ { "name": "options", @@ -172,21 +171,7 @@ "name": "advertisingId", "summary": "the advertising ID", "schema": { - "type": "object", - "properties": { - "ifa": { - "type": "string" - }, - "ifa_type": { - "type": "string" - }, - "lmt": { - "type": "string" - } - }, - "required": [ - "ifa" - ] + "$ref": "#/components/schemas/AdvertisingIdResult" } }, "examples": [ @@ -197,7 +182,7 @@ "name": "Default Result", "value": { "ifa": "01234567-89AB-CDEF-GH01-23456789ABCD", - "ifa_type": "idfa", + "ifa_type": "sspid", "lmt": "0" } } @@ -219,7 +204,7 @@ "name": "Default Result", "value": { "ifa": "01234567-89AB-CDEF-GH01-23456789ABCD", - "ifa_type": "idfa", + "ifa_type": "sspid", "lmt": "0" } } @@ -303,7 +288,7 @@ "params": [], "result": { "name": "Default Result", - "value": "operator.app" + "value": "app.operator" } } ] @@ -404,6 +389,33 @@ } } } + }, + "AdvertisingIdResult": { + "title": "AdvertisingIdResult", + "type": "object", + "properties": { + "ifa": { + "type": "string", + "description": "UUID conforming to IAB standard" + }, + "ifa_type": { + "type": "string", + "description": "source of the IFA as defined by IAB" + }, + "lmt": { + "type": "string", + "enum": [ + "0", + "1" + ], + "description": "boolean that if set to 1, user has requested ad tracking and measurement is disabled" + } + }, + "required": [ + "ifa", + "ifa_type", + "lmt" + ] } } } diff --git a/src/openrpc/authentication.json b/src/openrpc/authentication.json index 18a633183..977846b46 100644 --- a/src/openrpc/authentication.json +++ b/src/openrpc/authentication.json @@ -44,22 +44,7 @@ "name": "token", "summary": "the token value, type, and expiration", "schema": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "expires": { - "type": "string", - "format": "date-time" - }, - "type": { - "type": "string" - } - }, - "required": [ - "value" - ] + "$ref": "#/components/schemas/AuthenticationTokenResult" } }, "examples": [ @@ -233,6 +218,25 @@ "device", "distributor" ] + }, + "AuthenticationTokenResult": { + "title": "AuthenticationTokenResult", + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "expires": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + } + }, + "required": [ + "value" + ] } } } diff --git a/src/openrpc/device.json b/src/openrpc/device.json index 04cdced4d..9c64ed25c 100644 --- a/src/openrpc/device.json +++ b/src/openrpc/device.json @@ -41,7 +41,7 @@ }, { "name": "distributor", - "summary": "Get the distributor ID for this device", + "summary": "Get the name of the entity which is distributing the current device. There can be multiple distributors which distribute the same device model.", "params": [], "tags": [ { @@ -74,7 +74,7 @@ }, { "name": "platform", - "summary": "Get the platform ID for this device", + "summary": "Get a platform identifier for the device. This API should be used to correlate metrics on the device only and cannot be guaranteed to have consistent responses across platforms.", "params": [], "tags": [ { @@ -173,7 +173,7 @@ }, { "name": "model", - "summary": "Get the device model", + "summary": "Get the manufacturer designated model of the device", "params": [], "tags": [ { @@ -239,7 +239,7 @@ }, { "name": "make", - "summary": "Get the device make", + "summary": "Get the manufacturer of the device model", "params": [], "tags": [ { @@ -292,34 +292,7 @@ "name": "versions", "summary": "the versions", "schema": { - "type": "object", - "properties": { - "sdk": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The Firebolt SDK version" - }, - "api": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The lateset Firebolt API version supported by the curent device." - }, - "firmware": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The device firmware version." - }, - "os": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "**Deprecated** Use `firmware`, instead." - }, - "debug": { - "type": "string", - "description": "Detail version as a string, for debugging purposes" - } - }, - "required": [ - "api", - "firmware", - "os" - ] + "$ref": "#/components/schemas/DeviceVersion" } }, "examples": [ @@ -361,7 +334,7 @@ }, { "name": "hdcp", - "summary": "Get the supported HDCP profiles", + "summary": "Get the negotiated HDCP profiles for a connected device. \n\n For devices that do not require additional connections (e.g. panels), `true` will be returned for all profiles.", "params": [], "tags": [ { @@ -375,15 +348,15 @@ } ], "result": { - "name": "supportedHdcpProfiles", - "summary": "the supported HDCP profiles", + "name": "negotiatedHdcpVersions", + "summary": "the negotiated HDCP versions", "schema": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "$ref": "#/components/schemas/HDCPVersionMap" } }, "examples": [ { - "name": "Getting the supported HDCP profiles", + "name": "Getting the negotiated HDCP versions", "params": [], "result": { "name": "Default Result", @@ -397,7 +370,7 @@ }, { "name": "hdr", - "summary": "Get the supported HDR profiles", + "summary": "Get the negotiated HDR formats for the connected display and device", "params": [], "tags": [ { @@ -411,15 +384,15 @@ } ], "result": { - "name": "supportedHdrProfiles", - "summary": "the supported HDR profiles", + "name": "negotiatedHdrFormats", + "summary": "the negotiated HDR formats", "schema": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "$ref": "#/components/schemas/HDRFormatMap" } }, "examples": [ { - "name": "Getting the supported HDR profiles", + "name": "Getting the negotiated HDR formats", "params": [], "result": { "name": "Default Result", @@ -435,7 +408,7 @@ }, { "name": "audio", - "summary": "Get the supported audio profiles", + "summary": "Get the supported audio profiles for the connected devices. \n\n It is not recommended to use this API for visual badging on content within your app since this does not reflect the settings of the user.", "params": [], "tags": [ { @@ -473,7 +446,7 @@ }, { "name": "screenResolution", - "summary": "Get the current screen resolution", + "summary": "Get the resolution for the graphical surface of the app. \n\nThe pairs returned will be of a [width, height] format and will correspond to the following values: \n\nNTSC Standard Definition (SD): [720, 480] \n\nPAL Standard Definition (SD): [720, 576] \n\nHigh Definition (HD): [1280, 720] \n\nFull HD (FHD): [1920, 1080]\n\n4K Ultra High Definition (UHD): [3840, 2160] \n\n**Deprecated:** Use non-Firebolt APIs specific to your platform, e.g. W3C APIs", "params": [], "tags": [ { @@ -484,6 +457,11 @@ "x-uses": [ "xrn:firebolt:capability:device:info" ] + }, + { + "name": "deprecated", + "x-alternative": "Use non-Firebolt APIs specific to your platform, e.g. W3C APIs", + "x-since": "1.4.0" } ], "result": { @@ -509,7 +487,7 @@ }, { "name": "videoResolution", - "summary": "Get the current video resolution", + "summary": "Get the maximum supported video resolution of the currently connected device and display. \n\nThe pairs returned will be of a [width, height] format and will correspond to the following values: \n\nNTSC Standard Definition (SD): [720, 480] \n\nPAL Standard Definition (SD): [720, 576] \n\nHigh Definition (HD): [1280, 720] \n\nFull HD (FHD): [1920, 1080]\n\n4K Ultra High Definition (UHD): [3840, 2160]", "params": [], "tags": [ { @@ -641,19 +619,7 @@ "name": "networkInfo", "summary": "the status and type", "schema": { - "type": "object", - "properties": { - "state": { - "$ref": "#/components/schemas/NetworkState" - }, - "type": { - "$ref": "#/components/schemas/NetworkType" - } - }, - "required": [ - "state", - "type" - ] + "$ref": "#/components/schemas/NetworkInfoResult" } }, "examples": [ @@ -759,18 +725,98 @@ "components": { "schemas": { "Resolution": { - "type": "array", - "items": [ + "oneOf": [ { - "type": "integer" + "type": "array", + "items": [ + { + "type": "integer", + "const": 720, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 480, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 }, { - "type": "integer" + "type": "array", + "items": [ + { + "type": "integer", + "const": 720, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 576, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 1280, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 720, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 1920, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 1080, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 3840, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 2160, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 } - ], - "additionalItems": false, - "minItems": 2, - "maxItems": 2 + ] }, "NetworkType": { "title": "NetworkType", @@ -793,16 +839,115 @@ }, "AudioProfiles": { "title": "AudioProfiles", - "allOf": [ - { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "type": "object", + "properties": { + "stereo": { + "type": "boolean" }, - { - "type": "object", - "propertyNames": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/AudioProfile" - } + "dolbyDigital5.1": { + "type": "boolean" + }, + "dolbyDigital5.1+": { + "type": "boolean" + }, + "dolbyAtmos": { + "type": "boolean" + } + }, + "required": [ + "stereo", + "dolbyDigital5.1", + "dolbyDigital5.1+", + "dolbyAtmos" + ] + }, + "HDRFormatMap": { + "title": "HDRFormatMap", + "type": "object", + "properties": { + "hdr10": { + "type": "boolean" + }, + "hdr10Plus": { + "type": "boolean" + }, + "dolbyVision": { + "type": "boolean" + }, + "hlg": { + "type": "boolean" + } + }, + "required": [ + "hdr10", + "hdr10Plus", + "dolbyVision", + "hlg" + ], + "description": "The type of HDR format" + }, + "HDCPVersionMap": { + "title": "HDCPVersionMap", + "type": "object", + "properties": { + "hdcp1.4": { + "type": "boolean" + }, + "hdcp2.2": { + "type": "boolean" } + }, + "required": [ + "hdcp1.4", + "hdcp2.2" + ], + "description": "The type of HDCP versions" + }, + "DeviceVersion": { + "title": "DeviceVersion", + "type": "object", + "properties": { + "sdk": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The Firebolt SDK version" + }, + "api": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The latest Firebolt API version supported by the current device." + }, + "firmware": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The firmware version as reported by the device" + }, + "os": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "**Deprecated** Use `firmware`, instead." + }, + "debug": { + "type": "string", + "description": "Detailed version as a string, for debugging purposes" + } + }, + "required": [ + "api", + "firmware", + "os" + ] + }, + "NetworkInfoResult": { + "title": "NetworkInfoResult", + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/NetworkState" + }, + "type": { + "$ref": "#/components/schemas/NetworkType" + } + }, + "required": [ + "state", + "type" ] } } diff --git a/src/openrpc/discovery.json b/src/openrpc/discovery.json index 01ab2205e..19e9e2e04 100644 --- a/src/openrpc/discovery.json +++ b/src/openrpc/discovery.json @@ -561,7 +561,7 @@ }, { "name": "progress", - "summary": "How much of the content has been watched (percentage as 0-1 for VOD, number of seconds for live)", + "summary": "How much of the content has been watched (percentage as (0-0.999) for VOD, number of seconds for live)", "schema": { "type": "number", "minimum": 0 @@ -1181,7 +1181,7 @@ "params": [ { "name": "appId", - "value": "xrn:firebolt:application-type:settings " + "value": "xrn:firebolt:application-type:settings" }, { "name": "intent", diff --git a/src/openrpc/localization.json b/src/openrpc/localization.json index db92eeb5b..cc2a803ce 100644 --- a/src/openrpc/localization.json +++ b/src/openrpc/localization.json @@ -298,7 +298,7 @@ ] } ], - "summary": "Get any platform-specific localization information, in an Map", + "summary": "Get any platform-specific localization information", "params": [], "result": { "name": "info", @@ -306,7 +306,7 @@ "schema": { "type": "object", "additionalProperties": { - "type": "string", + "type": ["number", "string", "boolean"], "maxLength": 1024 }, "maxProperties": 32 @@ -346,9 +346,9 @@ }, { "name": "value", - "summary": "Value to be set for additionalInfo", + "summary": "Value to be set for additionalInfo. Value can be a number, string or boolean", "schema": { - "type": "string" + "type": ["number", "string", "boolean"] }, "required": true } diff --git a/src/openrpc/second_screen.json b/src/openrpc/second_screen.json index af25e2c9d..e7cd1054b 100644 --- a/src/openrpc/second_screen.json +++ b/src/openrpc/second_screen.json @@ -13,7 +13,7 @@ { "name": "capabilities", "x-uses": [ - "xrn:firebolt:capability:device:info" + "xrn:firebolt:capability:secondscreen:protocol" ] } ], diff --git a/src/schemas/accessibility.json b/src/schemas/accessibility.json index ce6ad419a..e274d8b91 100644 --- a/src/schemas/accessibility.json +++ b/src/schemas/accessibility.json @@ -100,8 +100,7 @@ "title": "ClosedCaptionsSettings", "type": "object", "required": [ - "enabled", - "styles" + "enabled" ], "properties": { "enabled": { @@ -152,8 +151,7 @@ "title": "VoiceGuidanceSettings", "type": "object", "required": [ - "enabled", - "speed" + "enabled" ], "properties": { "enabled": { diff --git a/src/schemas/intents.json b/src/schemas/intents.json index 8f5a86c38..4c01f7c39 100644 --- a/src/schemas/intents.json +++ b/src/schemas/intents.json @@ -609,10 +609,16 @@ "properties": { "query": { "type": "string" + }, + "suggestions": { + "type": "array", + "items": { + "$ref": "https://meta.comcast.com/firebolt/entity#/definitions/Entity" + } } }, "additionalProperties": false - } + } } } ], diff --git a/src/schemas/types.json b/src/schemas/types.json index 0caa49c1f..5d5eed60e 100644 --- a/src/schemas/types.json +++ b/src/schemas/types.json @@ -36,9 +36,7 @@ "enum": [ "stereo", "dolbyDigital5.1", - "dolbyDigital7.1", "dolbyDigital5.1+", - "dolbyDigital7.1+", "dolbyAtmos" ] }, diff --git a/src/sdks/core/package.json b/src/sdks/core/package.json index f571e4b5d..e46dbefe7 100644 --- a/src/sdks/core/package.json +++ b/src/sdks/core/package.json @@ -1,18 +1,15 @@ { "name": "@firebolt-js/sdk", - "version": "1.3.0", + "version": "1.4.0-next.12", "description": "The Firebolt JS SDK", "main": "./dist/lib/firebolt.mjs", "types": "./dist/lib/firebolt.d.ts", - "exports": { - ".": "./dist/lib/firebolt.mjs" - }, "type": "module", "scripts": { "validate": "npx firebolt-openrpc validate --input ./dist/firebolt-core-open-rpc.json", "sdk": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/js --output ./build/javascript/src --static-module Platform", "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/c/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/c", - "cpp": "npm run cpp:compile && npm run cpp:install", + "cpp": "npm run cpp:compile && cp ./dist/firebolt-core-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m core", "compile": "cd ../../.. && npm run compile", diff --git a/src/sdks/core/sdk.config.json b/src/sdks/core/sdk.config.json index 14ba4d55c..c682afc3b 100644 --- a/src/sdks/core/sdk.config.json +++ b/src/sdks/core/sdk.config.json @@ -23,7 +23,7 @@ "use": [ "xrn:firebolt:capability:advertising:configuration", "xrn:firebolt:capability:advertising:identifier", - "xrn:firebolt:capability:privacy:advertising" + "xrn:firebolt:capability:advertising:policy" ] }, { @@ -129,7 +129,7 @@ "module": "SecondScreen", "use": [ "xrn:firebolt:capability:protocol:dial", - "xrn:firebolt:capability:device:info" + "xrn:firebolt:capability:secondscreen:protocol" ] }, { diff --git a/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp b/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp index e50d394de..450e70840 100644 --- a/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp +++ b/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.cpp @@ -304,10 +304,12 @@ void CoreSDKTest::GetDeviceSku() void PrintDeviceAudioProfiles(const Firebolt::Device::AudioProfiles& audioProfiles) { - cout << "Get Device AudioProfiles :-> " << endl; - for (auto& item : audioProfiles) { - cout << "Profile: " << static_cast(item.first) << " status: " << item.second << endl; - } + cout << "Get Device AudioProfiles :-> " << endl; + + cout << "Profile: Stereo, Status: " << audioProfiles.stereo << endl; + cout << "Profile: Dolby Digital 5.1, Status: " << audioProfiles.dolbyDigital5_1 << endl; + cout << "Profile: Dolby Digital 5.1 Plus, Status: " << audioProfiles.dolbyDigital5_1_plus << endl; + cout << "Profile: Dolby Atmos, Status: " << audioProfiles.dolbyAtmos << endl; } void CoreSDKTest::GetDeviceAudio() @@ -352,28 +354,28 @@ void CoreSDKTest::UnsubscribeDeviceAudioChanged() } } -void PrintDeviceScreenResolution(const Firebolt::Device::Resolution& resolution) +void PrintDeviceScreenResolution(const std::string screenResolution) { cout << "Get Device ScreenResolution :-> " << endl; - cout << resolution.first << " X " << resolution.second << endl; + cout << screenResolution << endl; } void CoreSDKTest::GetDeviceScreenResolution() { Firebolt::Error error = Firebolt::Error::None; - const Firebolt::Device::Resolution resolution = Firebolt::IFireboltAccessor::Instance().DeviceInterface().screenResolution(&error); + const std::string screenResolution = Firebolt::IFireboltAccessor::Instance().DeviceInterface().screenResolution(&error); if (error == Firebolt::Error::None) { - PrintDeviceScreenResolution(resolution); + PrintDeviceScreenResolution(screenResolution); } else { std::string errorMessage = "Error: " + std::to_string(static_cast(error)); throw std::runtime_error("GetDeviceScreenResolution failed. " + errorMessage); } } -void CoreSDKTest::OnScreenResolutionChangedNotification::onScreenResolutionChanged(const Firebolt::Device::Resolution& resolution) +void CoreSDKTest::OnScreenResolutionChangedNotification::onScreenResolutionChanged(const std::string& screenResolution) { cout << "onScreenResolutionChanged event " << endl; - PrintDeviceScreenResolution(resolution); + PrintDeviceScreenResolution(screenResolution); } void CoreSDKTest::SubscribeDeviceScreenResolutionChanged() @@ -404,42 +406,60 @@ void PrintClosedCaptionsSettings(const Firebolt::Accessibility::ClosedCaptionsSe { cout << "Get Accessibility ClosedCaptionsSettings :-> " << endl; cout << "ClosedCaptionsSettings::Enabled : " << closedCaptionsSettings.enabled << endl; - if (closedCaptionsSettings.styles.fontFamily.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontFamily : " << static_cast(closedCaptionsSettings.styles.fontFamily.value()) << endl; - } - if (closedCaptionsSettings.styles.fontSize.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontSize : " << setprecision(3) << closedCaptionsSettings.styles.fontSize.value() << endl; - } - if (closedCaptionsSettings.styles.fontColor.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontColor : " << closedCaptionsSettings.styles.fontColor.value() << endl; - } - if (closedCaptionsSettings.styles.fontEdge.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontEdge : " << static_cast(closedCaptionsSettings.styles.fontEdge.value()) << endl; - } - if (closedCaptionsSettings.styles.fontEdgeColor.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontEdgeColor : " << closedCaptionsSettings.styles.fontEdgeColor.value() << endl; - } - if (closedCaptionsSettings.styles.fontOpacity.has_value()) { - cout << "ClosedCaptionsSettings::Styles::FontOpacity : " << closedCaptionsSettings.styles.fontOpacity.value() << endl; - } - if (closedCaptionsSettings.styles.backgroundColor.has_value()) { - cout << "ClosedCaptionsSettings::Styles::BackgroundColor : " << closedCaptionsSettings.styles.backgroundColor.value() << endl; - } - if (closedCaptionsSettings.styles.backgroundOpacity.has_value()) { - cout << "ClosedCaptionsSettings::Styles::BackgroundOpacity : " << closedCaptionsSettings.styles.backgroundOpacity.value() << endl; - } - if (closedCaptionsSettings.styles.textAlign.has_value()) { - cout << "ClosedCaptionsSettings::Styles::TextAlign : " << closedCaptionsSettings.styles.textAlign.value() << endl; - } - if (closedCaptionsSettings.styles.textAlignVertical.has_value()) { - cout << "ClosedCaptionsSettings::Styles::TextAlignVertical : " << closedCaptionsSettings.styles.textAlignVertical.value() << endl; - } - if (closedCaptionsSettings.styles.windowColor.has_value()) { - cout << "ClosedCaptionsSettings::Styles::WindowColor : " << closedCaptionsSettings.styles.windowColor.value() << endl; - } - if (closedCaptionsSettings.styles.windowOpacity.has_value()) { - cout << "ClosedCaptionsSettings::Styles::WindowOpacity : " << closedCaptionsSettings.styles.windowOpacity.value() << endl; + + if (closedCaptionsSettings.styles.has_value()) { + const auto& styles = closedCaptionsSettings.styles.value(); + + if (styles.fontFamily.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontFamily : " << static_cast(styles.fontFamily.value()) << endl; + } + + if (styles.fontSize.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontSize : " << setprecision(3) << styles.fontSize.value() << endl; + } + + if (styles.fontColor.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontColor : " << styles.fontColor.value() << endl; + } + + if (styles.fontEdge.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontEdge : " << static_cast(styles.fontEdge.value()) << endl; + } + + if (styles.fontEdgeColor.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontEdgeColor : " << styles.fontEdgeColor.value() << endl; + } + + if (styles.fontOpacity.has_value()) { + cout << "ClosedCaptionsSettings::Styles::FontOpacity : " << styles.fontOpacity.value() << endl; + } + + if (styles.backgroundColor.has_value()) { + cout << "ClosedCaptionsSettings::Styles::BackgroundColor : " << styles.backgroundColor.value() << endl; + } + + if (styles.backgroundOpacity.has_value()) { + cout << "ClosedCaptionsSettings::Styles::BackgroundOpacity : " << styles.backgroundOpacity.value() << endl; + } + + if (styles.textAlign.has_value()) { + cout << "ClosedCaptionsSettings::Styles::TextAlign : " << styles.textAlign.value() << endl; + } + + if (styles.textAlignVertical.has_value()) { + cout << "ClosedCaptionsSettings::Styles::TextAlignVertical : " << styles.textAlignVertical.value() << endl; + } + + if (styles.windowColor.has_value()) { + cout << "ClosedCaptionsSettings::Styles::WindowColor : " << styles.windowColor.value() << endl; + } + + if (styles.windowOpacity.has_value()) { + cout << "ClosedCaptionsSettings::Styles::WindowOpacity : " << styles.windowOpacity.value() << endl; + } } + + if (closedCaptionsSettings.preferredLanguages.has_value()) { cout << "ClosedCaptionsSettings::PreferredLanguages :"; for (auto index: closedCaptionsSettings.preferredLanguages.value()) { @@ -875,7 +895,7 @@ void CoreSDKTest::GetAuthenticationToken() Firebolt::Authentication::TokenType type = Firebolt::Authentication::TokenType::DEVICE; std::optional options; - const Firebolt::Authentication::Token token = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().token(type, options, &error); + const Firebolt::Authentication::AuthenticationTokenResult token = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().token(type, options, &error); if (error == Firebolt::Error::None) { cout << "Get Authentication of token : " << endl; @@ -1535,15 +1555,15 @@ void CoreSDKTest::DiscoveryLaunch() } { - std::optional intent = std::make_optional(); - intent.value().action = "entity"; + std::optional intent = std::make_optional(); + intent.value().action = "search"; intent.value().context.source = "voice"; - intent.value().data = "{\"entityId\":\"example-movie-id\",\"entityType\":\"program\",\"programType\":\"movie\"}"; - intent.value().context.source = "voice"; - cout << "Calling Discovery Launch EntityIntent method " << endl; + intent.value().data = std::make_optional(); + intent.value().data->query = "searching for a movie"; + cout << "Calling Discovery Launch SearchIntent method " << endl; bool status = Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().launch(appId, intent, &error); if (error == Firebolt::Error::None) { - cout << "Discovery Launch EntityIntent is " << (status ? "true" : "false") << endl; + cout << "Discovery Launch HomeIntent is " << (status ? "true" : "false") << endl; } else { std::string errorMessage = "Error: " + std::to_string(static_cast(error)); throw std::runtime_error("DiscoveryLaunch failed. " + errorMessage); diff --git a/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.h b/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.h index d25521043..43096f80c 100644 --- a/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.h +++ b/src/sdks/core/src/cpp/sdk/cpptest/CoreSDKTest.h @@ -36,7 +36,7 @@ class CoreSDKTest { }; class OnScreenResolutionChangedNotification : public Firebolt::Device::IDevice::IOnScreenResolutionChangedNotification { public: - void onScreenResolutionChanged( const Firebolt::Device::Resolution& ) override; + void onScreenResolutionChanged( const std::string& ) override; }; class OnPreferredAudioLanguagesChangedNotification : public Firebolt::Localization::ILocalization::IOnPreferredAudioLanguagesChangedNotification { public: diff --git a/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp b/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp index 242897d9d..076f78e8c 100644 --- a/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp +++ b/src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp @@ -26,7 +26,7 @@ namespace ${info.Title} { std::string ${info.Title}Impl::version(Firebolt::Error *err) const { JsonObject jsonParameters; - JsonData_Versions jsonResult; + JsonData_DeviceVersion jsonResult; std::string version; Firebolt::Error status = Firebolt::Error::NotConnected; diff --git a/src/sdks/core/test/suite/advertising.test.ts b/src/sdks/core/test/suite/advertising.test.ts index 95ec53e77..9f788abd4 100644 --- a/src/sdks/core/test/suite/advertising.test.ts +++ b/src/sdks/core/test/suite/advertising.test.ts @@ -50,7 +50,7 @@ test("deviceAttributes()", () => { test("appBundleId()", () => { return Advertising.appBundleId().then((res: string) => { - expect(res).toBe("operator.app"); + expect(res).toBe("app.operator"); expect(typeof res).toBe("string"); }); }); diff --git a/src/sdks/core/test/suite/device.test.ts b/src/sdks/core/test/suite/device.test.ts index 7f9601cac..f5a55849d 100644 --- a/src/sdks/core/test/suite/device.test.ts +++ b/src/sdks/core/test/suite/device.test.ts @@ -112,17 +112,17 @@ test("Device.make()", () => { }); test("Device.hdcp()", () => { - const expectedOutput: Device.BooleanMap = { + const expectedOutput: Device.HDCPVersionMap = { "hdcp1.4": true, "hdcp2.2": true, }; - return Device.hdcp().then((res: Device.BooleanMap) => { + return Device.hdcp().then((res: Device.HDCPVersionMap) => { expect(res).toEqual(expectedOutput); }); }); test("Device.hdcp(subscriber)", () => { - return Device.hdcp((supportedHdrProfiles: Device.BooleanMap) => {}).then( + return Device.hdcp((supportedHdrProfiles: Device.HDCPVersionMap) => {}).then( (res: number) => { expect(res > 0).toBe(true); } diff --git a/src/sdks/discovery/package.json b/src/sdks/discovery/package.json index 63a2d20ca..c088e7472 100644 --- a/src/sdks/discovery/package.json +++ b/src/sdks/discovery/package.json @@ -1,18 +1,15 @@ { "name": "@firebolt-js/discovery-sdk", - "version": "1.3.0", + "version": "1.4.0-next.12", "description": "The Firebolt Discovery JS SDK", "main": "./dist/lib/firebolt-discovery.mjs", "types": "./dist/lib/firebolt-discovery.d.ts", - "exports": { - ".": "./dist/lib/firebolt-discovery.mjs" - }, "type": "module", "scripts": { "validate": "npx firebolt-openrpc validate --input ./dist/firebolt-discovery-open-rpc.json", "sdk": "npx firebolt-openrpc sdk --input ./dist/firebolt-discovery-open-rpc.json --template ./src/js --output ./build/javascript/src", "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-discovery-open-rpc.json --template ./src/js --output ./build/c/src --language ../../../node_modules/@firebolt-js/openrpc/languages/c", - "cpp": "npm run cpp:compile && npm run cpp:install", + "cpp": "npm run cpp:compile && cp ./dist/firebolt-discovery-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-discovery-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m discovery", "compile": "cd ../../.. && npm run compile", diff --git a/src/sdks/manage/package.json b/src/sdks/manage/package.json index bc7c77473..a4f1ef5fe 100644 --- a/src/sdks/manage/package.json +++ b/src/sdks/manage/package.json @@ -1,18 +1,15 @@ { "name": "@firebolt-js/manage-sdk", - "version": "1.3.0", + "version": "1.4.0-next.12", "description": "The Firebolt Manage JS SDK", "main": "./dist/lib/firebolt-manage.mjs", "types": "./dist/lib/firebolt-manage.d.ts", - "exports": { - ".": "./dist/lib/firebolt-manage.mjs" - }, "type": "module", "scripts": { "validate": "npx firebolt-openrpc validate --input ./dist/firebolt-manage-open-rpc.json", "sdk": "npx firebolt-openrpc sdk --input ./dist/firebolt-manage-open-rpc.json --template ./src/js --output ./build/javascript/src", "native": "npx firebolt-openrpc sdk --input ./dist/firebolt-manage-open-rpc.json --template ./src/js --output ./build/c/src --language ../../../node_modules/@firebolt-js/openrpc/languages/c", - "cpp": "npm run cpp:compile && npm run cpp:install", + "cpp": "npm run cpp:compile && cp ./dist/firebolt-manage-open-rpc.json ./build/cpp/src && npm run cpp:install", "cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-manage-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp", "cpp:install": "./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m manage", "compile": "cd ../../.. && npm run compile", diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp index 4d2698dbe..402bda600 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp +++ b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp @@ -121,6 +121,15 @@ void RunAllTests() { runTest(ManageSDKTest::SendResponseMessageToPinChallengeProvider, "SendResponseMessageToPinChallengeProvider"); runTest(ManageSDKTest::SendErrorMessageToPinChallengeProvider, "SendErrorMessageToPinChallengeProvider"); + runTest(ManageSDKTest::GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged"); + runTest(ManageSDKTest::GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged, "GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged"); + + runTest(ManageSDKTest::GetAutoLowLatencyModeCapable, "GetAutoLowLatencyModeCapable"); + runTest(ManageSDKTest::SetAutoLowLatencyModeCapable, "SetAutoLowLatencyModeCapable"); + runTest(ManageSDKTest::GetEdidVersion, "GetEdidVersion"); + runTest(ManageSDKTest::SetEdidVersion, "SetEdidVersion"); + runTest(ManageSDKTest::GetHdmiPortInfo, "GetHdmiPortInfo"); + if (allTestsPassed) { cout << "============================" << endl; cout << "ALL MANAGE SDK TESTS SUCCEEDED!" << endl; diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp index 6dde2c9c2..04a2bb504 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp +++ b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp @@ -31,6 +31,7 @@ ManageSDKTest::OnPreferredAudioLanguagesChangedNotification ManageSDKTest::_pref ManageSDKTest::OnAllowACRCollectionChangedNotification ManageSDKTest::_allowACRCollectionChangedNotification; ManageSDKTest::OnSignInNotification ManageSDKTest::_signInNotification; ManageSDKTest::OnSignOutNotification ManageSDKTest::_signOutNotification; +ManageSDKTest::OnAutoLowLatencyModeCapableChangedNotification ManageSDKTest::_autoLowLatencyModeCapableChangedNotification; ManageSDKTest::KeyboardProvider ManageSDKTest::_keyboardProvider; ManageSDKTest::AcknowledgeChallengeProvider ManageSDKTest::_acknowledgeChallengeProvider; ManageSDKTest::PinChallengeProvider ManageSDKTest::_pinChallengeProvider; @@ -1012,3 +1013,104 @@ void ManageSDKTest::WifiDisconnect() throw std::runtime_error("WifiDisconnect failed. " + errorMessage); } } + +void ManageSDKTest::OnAutoLowLatencyModeCapableChangedNotification::onAutoLowLatencyModeCapableChanged( const Firebolt::HDMIInput::AutoLowLatencyModeCapableChangedInfo& info) +{ + cout << "Low latency capable changed" << endl; +} + +void ManageSDKTest::GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().globalSubscribe(_autoLowLatencyModeCapableChangedNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Global Subscribe for HDMIInput AutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SubscribeHDMIInputAutoLowLatencyModeCapable failed." + errorMessage); + } +} + +void ManageSDKTest::GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().globalUnsubscribe(_autoLowLatencyModeCapableChangedNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Global Unsubscribe for HDMIInput AutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("UnsubscribeHDMIInputAutoLowLatencyModeCapable failed." + errorMessage); + } +} + +void ManageSDKTest::GetAutoLowLatencyModeCapable() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + bool result = Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().autoLowLatencyModeCapable(port, &error); + + if (error == Firebolt::Error::None) { + cout << "GetAutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetAutoLowLatencyModeCapable failed. " + errorMessage); + } +} + +void ManageSDKTest::SetAutoLowLatencyModeCapable() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + bool value = false; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().setAutoLowLatencyModeCapable(port, value, &error); + + if (error == Firebolt::Error::None) { + cout << "SetAutoLowLatencyModeCapable is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SetAutoLowLatencyModeCapable failed. " + errorMessage); + } +} + +void ManageSDKTest::GetEdidVersion() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().edidVersion(port, &error); + + if (error == Firebolt::Error::None) { + cout << "GetEdidVersion is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetEdidVersion failed. " + errorMessage); + } +} + +void ManageSDKTest::SetEdidVersion() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string port = "HDMI1"; + Firebolt::HDMIInput::EDIDVersion value = Firebolt::HDMIInput::EDIDVersion::V1_4; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().setEdidVersion(port, value, &error); + + if (error == Firebolt::Error::None) { + cout << "SetEdidVersion is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("SetEdidVersionfailed. " + errorMessage); + } +} + +void ManageSDKTest::GetHdmiPortInfo() +{ + Firebolt::Error error = Firebolt::Error::None; + std::string portId = "HDMI1"; + Firebolt::IFireboltAccessor::Instance().HDMIInputInterface().port(portId, &error); + + if (error == Firebolt::Error::None) { + cout << "GetHdmiPortInfo is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("GetHdmiPortInfo failed. " + errorMessage); + } +} diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h index 2f8be7145..018350ec2 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h +++ b/src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.h @@ -108,6 +108,11 @@ class ManageSDKTest { bool _challengeInput; }; + class OnAutoLowLatencyModeCapableChangedNotification : public Firebolt::HDMIInput::IHDMIInput::IOnAutoLowLatencyModeCapableChangedNotification { + public: + void onAutoLowLatencyModeCapableChanged( const Firebolt::HDMIInput::AutoLowLatencyModeCapableChangedInfo& ) override; + }; + public: ManageSDKTest() = default; virtual ~ManageSDKTest() = default; @@ -183,6 +188,15 @@ class ManageSDKTest { static void WifiConnect(); static void WifiDisconnect(); + static void GlobalSubscribeHdmiAutoLowLatencyModeCapableChanged(); + static void GlobalUnsubscribeHdmiAutoLowLatencyModeCapableChanged(); + + static void GetAutoLowLatencyModeCapable(); + static void SetAutoLowLatencyModeCapable(); + static void GetEdidVersion(); + static void SetEdidVersion(); + static void GetHdmiPortInfo(); + static bool WaitOnConnectionReady(); private: @@ -199,6 +213,7 @@ class ManageSDKTest { static PinChallengeProvider _pinChallengeProvider; static OnSignInNotification _signInNotification; static OnSignOutNotification _signOutNotification; + static OnAutoLowLatencyModeCapableChangedNotification _autoLowLatencyModeCapableChangedNotification; static Firebolt::Wifi::AccessPointList _apList; };