├── COPYING ├── src ├── sdks │ ├── core │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── CONTRIBUTING.md │ │ ├── tsconfig.json │ │ ├── .npmignore │ │ ├── src │ │ │ ├── cpp │ │ │ │ ├── sdk │ │ │ │ │ ├── cpptest │ │ │ │ │ │ ├── unit │ │ │ │ │ │ │ ├── unit.h │ │ │ │ │ │ │ ├── accountTest.cpp │ │ │ │ │ │ │ ├── lifecycleTest.cpp │ │ │ │ │ │ │ ├── parametersTest.cpp │ │ │ │ │ │ │ ├── profileTest.cpp │ │ │ │ │ │ │ ├── secondscreenTest.cpp │ │ │ │ │ │ │ ├── keyboardTest.cpp │ │ │ │ │ │ │ ├── authenticationTest.cpp │ │ │ │ │ │ │ └── securestorageTest.cpp │ │ │ │ │ │ ├── Unit.cpp │ │ │ │ │ │ └── build.sh │ │ │ │ │ └── test │ │ │ │ │ │ ├── Module.cpp │ │ │ │ │ │ ├── Module.h │ │ │ │ │ │ ├── CoreSDKTestGeneratedCode.h │ │ │ │ │ │ ├── Main.cpp │ │ │ │ │ │ ├── CoreSDKTestStaticCode.cpp │ │ │ │ │ │ ├── CoreSDKTestStaticCode.h │ │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ │ └── CoreSDKTestGeneratedCode.cpp │ │ │ │ └── templates │ │ │ │ │ ├── Metrics │ │ │ │ │ ├── include │ │ │ │ │ │ └── module.h │ │ │ │ │ └── src │ │ │ │ │ │ └── module_impl.h │ │ │ │ │ ├── Device │ │ │ │ │ ├── include │ │ │ │ │ │ └── module.h │ │ │ │ │ └── src │ │ │ │ │ │ ├── module_impl.h │ │ │ │ │ │ └── module_impl.cpp │ │ │ │ │ └── Lifecycle │ │ │ │ │ ├── include │ │ │ │ │ └── module.h │ │ │ │ │ └── src │ │ │ │ │ └── module_impl.h │ │ │ └── js │ │ │ │ └── sdk │ │ │ │ ├── Platform │ │ │ │ ├── defaults.mjs │ │ │ │ └── index.mjs │ │ │ │ ├── index.mjs │ │ │ │ ├── Metrics │ │ │ │ └── index.mjs │ │ │ │ ├── Device │ │ │ │ └── index.mjs │ │ │ │ └── Lifecycle │ │ │ │ ├── index.mjs │ │ │ │ └── defaults.mjs │ │ ├── jest.config.json │ │ ├── test │ │ │ └── suite │ │ │ │ ├── settings.test.ts │ │ │ │ ├── localization.test.ts │ │ │ │ ├── securestorage.test.ts │ │ │ │ ├── accessibility.test.ts │ │ │ │ ├── declarations.test.ts │ │ │ │ ├── metrics.test.ts │ │ │ │ ├── synchronous-transport.test.ts │ │ │ │ ├── advertising.test.ts │ │ │ │ └── listeners-transport.test.ts │ │ └── README.md │ ├── manage │ │ ├── NOTICE │ │ ├── LICENSE │ │ ├── CONTRIBUTING.md │ │ ├── tsconfig.json │ │ ├── .npmignore │ │ ├── src │ │ │ ├── cpp │ │ │ │ └── sdk │ │ │ │ │ ├── cpptest │ │ │ │ │ ├── unit │ │ │ │ │ │ ├── unit.h │ │ │ │ │ │ ├── accountTest.cpp │ │ │ │ │ │ ├── metricsTest.cpp │ │ │ │ │ │ ├── secureStorageTest.cpp │ │ │ │ │ │ ├── discoveryTest.cpp │ │ │ │ │ │ ├── pinChallengeTest.cpp │ │ │ │ │ │ ├── audioDescriptionsTest.cpp │ │ │ │ │ │ ├── acknowledgeChallengeTest.cpp │ │ │ │ │ │ ├── keyboardTest.cpp │ │ │ │ │ │ └── deviceTest.cpp │ │ │ │ │ ├── Unit.cpp │ │ │ │ │ └── build.sh │ │ │ │ │ └── test │ │ │ │ │ ├── Module.cpp │ │ │ │ │ ├── Module.h │ │ │ │ │ ├── ManageSDKTestGeneratedCode.h │ │ │ │ │ ├── Main.cpp │ │ │ │ │ ├── ManageSDKTestStaticCode.cpp │ │ │ │ │ ├── ManageSDKTestStaticCode.h │ │ │ │ │ └── CMakeLists.txt │ │ │ └── js │ │ │ │ └── sdk │ │ │ │ └── index.mjs │ │ ├── jest.config.json │ │ ├── README.md │ │ ├── Setup.js │ │ └── test │ │ │ └── suite │ │ │ ├── device.test.ts │ │ │ ├── account.test.ts │ │ │ ├── privacy.test.ts │ │ │ ├── voiceGuidance.test.ts │ │ │ ├── pinChallenge.test.ts │ │ │ ├── wifi.test.ts │ │ │ ├── localization.test.ts │ │ │ ├── acknowledgeChallenge.test.ts │ │ │ └── hdmi-input.test.ts │ └── discovery │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── CONTRIBUTING.md │ │ ├── tsconfig.json │ │ ├── .npmignore │ │ ├── jest.config.json │ │ ├── sdk.config.json │ │ ├── README.md │ │ ├── CHANGELOG.md │ │ ├── src │ │ ├── cpp │ │ │ └── sdk │ │ │ │ └── cpptest │ │ │ │ ├── build.sh │ │ │ │ ├── DiscoverySDKTest.h │ │ │ │ └── Main.cpp │ │ └── js │ │ │ └── sdk │ │ │ └── index.mjs │ │ └── test │ │ └── suite │ │ └── content.test.ts ├── js │ ├── production-changelog │ │ ├── package.json │ │ └── index.js │ └── version-specification │ │ └── index.mjs ├── template │ ├── declarations │ │ └── template.d.ts │ └── openrpc │ │ └── template.json ├── schemas │ ├── policies.json │ ├── secondscreen.json │ ├── lifecycle.json │ ├── localization.json │ ├── errors.json │ ├── advertising.json │ └── discovery.json ├── descriptions │ └── modules │ │ └── discovery │ │ └── EntityInfo.md └── openrpc │ ├── audio_descriptions.json │ ├── _internal.json │ └── parameters.json ├── .prettierrc.json ├── .husky └── commit-msg ├── requirements ├── images │ ├── governance │ │ ├── branching.png │ │ ├── structure.png │ │ └── approval-track.png │ └── specifications │ │ ├── general │ │ └── capabilities │ │ │ ├── image1.png │ │ │ ├── image2.png │ │ │ ├── image4.png │ │ │ └── user-grants │ │ │ ├── image1.png │ │ │ ├── image2.png │ │ │ ├── image3.png │ │ │ ├── image4.png │ │ │ ├── image5.png │ │ │ ├── image6.png │ │ │ └── image7.png │ │ └── intents │ │ └── user-interest │ │ └── media │ │ ├── image1.png │ │ ├── image2.png │ │ ├── image3.png │ │ └── image4.png └── specifications │ ├── intents │ └── user-interest.md │ └── entities │ ├── channels.md │ ├── music.md │ ├── programs.md │ └── index.md ├── .commitlintrc.json ├── tsconfig.json ├── CONTRIBUTING.md ├── jest.config.json ├── .gitignore ├── .npmignore ├── README.md ├── .github ├── fca │ └── dependency.patch ├── workflows │ ├── cla.yml │ ├── merge-to-main.yml │ ├── node.js.yml │ ├── run-standalone-mfos-tests.yml │ ├── utils.cjs │ ├── pr-comment.yml │ └── merge-to-next-major.yml └── mock-firebolt │ └── config.json ├── test ├── helpers │ └── synchronous-transport.mjs └── Setup.js ├── .releaserc ├── push-docs.sh ├── NOTICE └── package.json /COPYING: -------------------------------------------------------------------------------- 1 | ./LICENSE -------------------------------------------------------------------------------- /src/sdks/core/LICENSE: -------------------------------------------------------------------------------- 1 | ../../../LICENSE -------------------------------------------------------------------------------- /src/sdks/core/NOTICE: -------------------------------------------------------------------------------- 1 | ../../../NOTICE -------------------------------------------------------------------------------- /src/sdks/manage/NOTICE: -------------------------------------------------------------------------------- 1 | ../../../NOTICE -------------------------------------------------------------------------------- /src/sdks/discovery/LICENSE: -------------------------------------------------------------------------------- 1 | ../../../LICENSE -------------------------------------------------------------------------------- /src/sdks/discovery/NOTICE: -------------------------------------------------------------------------------- 1 | ../../../NOTICE -------------------------------------------------------------------------------- /src/sdks/manage/LICENSE: -------------------------------------------------------------------------------- 1 | ../../../LICENSE -------------------------------------------------------------------------------- /src/sdks/core/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../../../CONTRIBUTING.md -------------------------------------------------------------------------------- /src/sdks/discovery/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../../../CONTRIBUTING.md -------------------------------------------------------------------------------- /src/sdks/manage/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../../../CONTRIBUTING.md -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } -------------------------------------------------------------------------------- /src/sdks/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "test/suite/*" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/sdks/discovery/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "test/suite/*" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/sdks/manage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "test/suite/*" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/sdks/core/.npmignore: -------------------------------------------------------------------------------- 1 | build/* 2 | src/* 3 | test/* 4 | .DS_Store 5 | jest.config.* 6 | tsconfig.* -------------------------------------------------------------------------------- /src/sdks/manage/.npmignore: -------------------------------------------------------------------------------- 1 | build/* 2 | src/* 3 | test/* 4 | .DS_Store 5 | jest.config.* 6 | tsconfig.* -------------------------------------------------------------------------------- /src/sdks/discovery/.npmignore: -------------------------------------------------------------------------------- 1 | build/* 2 | src/* 3 | test/* 4 | .DS_Store 5 | jest.config.* 6 | tsconfig.* -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "$1" 5 | -------------------------------------------------------------------------------- /requirements/images/governance/branching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/governance/branching.png -------------------------------------------------------------------------------- /requirements/images/governance/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/governance/structure.png -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/unit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gtest/gtest.h" 4 | #include "../CoreSDKTest.h" 5 | #include "json_engine.h" -------------------------------------------------------------------------------- /requirements/images/governance/approval-track.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/governance/approval-track.png -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/unit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gtest/gtest.h" 4 | #include "../ManageSDKTest.h" 5 | #include "json_engine.h" -------------------------------------------------------------------------------- /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"], 3 | "rules": { 4 | "subject-case": [2, "always", "sentence-case"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "src/sdks/core/test/suite/*", 4 | "src/sdks/manage/test/suite/*", 5 | "src/sdks/discovery/test/suite/*" 6 | ] 7 | } -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/image1.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/image2.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/image4.png -------------------------------------------------------------------------------- /requirements/images/specifications/intents/user-interest/media/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/intents/user-interest/media/image1.png -------------------------------------------------------------------------------- /requirements/images/specifications/intents/user-interest/media/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/intents/user-interest/media/image2.png -------------------------------------------------------------------------------- /requirements/images/specifications/intents/user-interest/media/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/intents/user-interest/media/image3.png -------------------------------------------------------------------------------- /requirements/images/specifications/intents/user-interest/media/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/intents/user-interest/media/image4.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image1.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image2.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image3.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image4.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image5.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image6.png -------------------------------------------------------------------------------- /requirements/images/specifications/general/capabilities/user-grants/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdkcentral/firebolt-apis/HEAD/requirements/images/specifications/general/capabilities/user-grants/image7.png -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | If you would like to contribute code to this project you can do so through GitHub by forking the repository 3 | and sending a pull request. 4 | Before RDK accepts your code into the project you must sign the RDK Contributor License Agreement (CLA). 5 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/Unit.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "CoreSDKTest.h" 3 | 4 | int main(int argc, char **argv) 5 | { 6 | std::string url = "ws://localhost:9998"; 7 | CoreSDKTest::CreateFireboltInstance(url); 8 | ::testing::InitGoogleTest(&argc, argv); 9 | return RUN_ALL_TESTS(); 10 | } -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/Unit.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "ManageSDKTest.h" 3 | 4 | int main(int argc, char **argv) 5 | { 6 | std::string url = "ws://localhost:9998"; 7 | ManageSDKTest::CreateFireboltInstance(url); 8 | ::testing::InitGoogleTest(&argc, argv); 9 | return RUN_ALL_TESTS(); 10 | } -------------------------------------------------------------------------------- /jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?)$", 3 | "transform": {}, 4 | "testPathIgnorePatterns": ["/node_modules/", "/../../../test"], 5 | "moduleFileExtensions": ["js", "jsx", "mjs"], 6 | "verbose": true, 7 | "testEnvironment": "jest-environment-jsdom" 8 | } -------------------------------------------------------------------------------- /src/sdks/core/jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?)$", 3 | "transform": {}, 4 | "testPathIgnorePatterns": ["/node_modules/", "/../../../test"], 5 | "moduleFileExtensions": ["js", "jsx", "mjs"], 6 | "verbose": true, 7 | "testEnvironment": "jest-environment-jsdom" 8 | } -------------------------------------------------------------------------------- /src/sdks/core/test/suite/settings.test.ts: -------------------------------------------------------------------------------- 1 | import Setup from "../../../../../test/Setup" 2 | 3 | import { test, expect } from "@jest/globals" 4 | import { Settings } from "../../build/javascript/src/firebolt"; 5 | 6 | test('Log level tests', () => { 7 | Settings.setLogLevel("DEBUG") 8 | expect(Settings.getLogLevel()).toBe("DEBUG") 9 | }) 10 | -------------------------------------------------------------------------------- /src/sdks/discovery/jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?)$", 3 | "transform": {}, 4 | "testPathIgnorePatterns": ["/node_modules/", "/../../../test"], 5 | "moduleFileExtensions": ["js", "jsx", "mjs"], 6 | "verbose": true, 7 | "testEnvironment": "jest-environment-jsdom" 8 | } -------------------------------------------------------------------------------- /src/sdks/manage/jest.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?)$", 3 | "transform": {}, 4 | "testPathIgnorePatterns": ["/node_modules/", "/../../../test"], 5 | "moduleFileExtensions": ["js", "jsx", "mjs"], 6 | "verbose": true, 7 | "testEnvironment": "jest-environment-jsdom" 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | dist/* 3 | src/sdks/core/build/* 4 | src/sdks/core/dist/* 5 | src/sdks/core/test/transpiled-suite/* 6 | src/sdks/discovery/build/* 7 | src/sdks/discovery/dist/* 8 | src/sdks/discovery/test/transpiled-suite/* 9 | src/sdks/manage/build/* 10 | src/sdks/manage/dist/* 11 | src/sdks/manage/test/transpiled-suite/* 12 | node_modules/* 13 | test/transpiled-suite/* 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github/* 2 | .husky/* 3 | .DS_Store 4 | *.config.js* 5 | .releaserc 6 | .commitlintrc.json 7 | src/descriptions/* 8 | src/js/* 9 | src/openrpc/* 10 | src/schemas/* 11 | src/template/* 12 | src/sdks/*/build/* 13 | src/sdks/*/src/* 14 | src/sdks/*/test/* 15 | src/sdks/*/jest.config.json 16 | src/sdks/*/sdk.config.json 17 | src/sdks/*/tsconfig.json 18 | src/sdks/*/.* 19 | test/* 20 | push-docs.sh 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Firebolt APIs 3 | --- 4 | 5 | [![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 6 | 7 | # Firebolt APIs 8 | Firebolt APIs are defined by [OpenRPC schemas](https://spec.open-rpc.org). 9 | 10 | The schemas are used to generate SDK and Documentation artifacts. 11 | -------------------------------------------------------------------------------- /.github/fca/dependency.patch: -------------------------------------------------------------------------------- 1 | diff --git a/package.json b/package.json 2 | index 8278db0..d6da436 100644 3 | --- a/package.json 4 | +++ b/package.json 5 | @@ -22,7 +22,8 @@ 6 | "uuid": "^9.0.0", 7 | "winston": "3.15.0", 8 | "winston-transport": "4.7.1", 9 | - "xml2js": "^0.5.0" 10 | + "xml2js": "^0.5.0", 11 | + "@dabh/diagnostics": "2.0.3" 12 | }, 13 | "scripts": { 14 | "start": "webpack-dev-server --config webpack.dev.js", 15 | -------------------------------------------------------------------------------- /src/sdks/discovery/sdk.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "title": "Firebolt Discovery SDK" 4 | }, 5 | "methods": [ 6 | { 7 | "module": "Content", 8 | "use": [ 9 | "xrn:firebolt:capability:discovery:purchased-content", 10 | "xrn:firebolt:capability:discovery:entity-info", 11 | "xrn:firebolt:capability:discovery:interest" 12 | ] 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/cla.yml: -------------------------------------------------------------------------------- 1 | name: "CLA" 2 | 3 | permissions: 4 | contents: read 5 | pull-requests: write 6 | actions: write 7 | statuses: write 8 | 9 | on: 10 | issue_comment: 11 | types: [created] 12 | pull_request_target: 13 | types: [opened, closed, synchronize] 14 | 15 | jobs: 16 | CLA-Lite: 17 | name: "Signature" 18 | uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1 19 | secrets: 20 | PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }} 21 | -------------------------------------------------------------------------------- /src/js/production-changelog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "production-changelog", 3 | "description": "semantic-release plugin that scrubs pre-release notes from changelog before writing current release notes.", 4 | "version": "0.0.0-development", 5 | "author": "Jeremy LaCivita", 6 | "dependencies": { 7 | }, 8 | "devDependencies": { 9 | }, 10 | "engines": { 11 | "node": ">=14.17" 12 | }, 13 | "files": [ 14 | "index.js" 15 | ], 16 | "main": "index.js", 17 | "peerDependencies": { 18 | "semantic-release": ">=18.0.0-beta.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/template/declarations/template.d.ts: -------------------------------------------------------------------------------- 1 | export module Settings { 2 | type LogLevel = "WARN" | "INFO" | "DEBUG" | "ERROR" 3 | function setLogLevel(logLevel: LogLevel): void 4 | function getLogLevel(): LogLevel 5 | } 6 | 7 | export module Log { 8 | function info(...args: any[]): void 9 | function debug(...args: any[]): void 10 | function error(...args: any[]): void 11 | function warn(...args: any[]): void 12 | } 13 | 14 | export module Events { 15 | function listen(...args: any[]): Promise 16 | function once(...args: any[]): Promise 17 | function clear(...args: any[]): boolean 18 | } 19 | 20 | /* ${DECLARATIONS} */ -------------------------------------------------------------------------------- /requirements/specifications/intents/user-interest.md: -------------------------------------------------------------------------------- 1 | # User Interest 2 | 3 | Document Status: Candidate Specification 4 | 5 | See [Firebolt Requirements Governance](../../governance.md) for more info. 6 | 7 | | Contributor | Organization | 8 | | -------------- | -------------- | 9 | | Eugene Chung | Comcast | 10 | | Tim Dibben | Sky | 11 | | Mike Horwitz | Comcast | 12 | | Jeremy LaCivita | Comcast | 13 | 14 | ## 1. Overview 15 | This document describes the intent to initiate a [User Interest](../discovery/user-interest.md) flow from an upstream system, e.g. a voice assistant. 16 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/accountTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class AccountTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(AccountTest, session) 21 | { 22 | std::string token = "expiresIn"; 23 | int32_t expiresIn = 84000; 24 | Firebolt::IFireboltAccessor::Instance().AccountInterface().session(token, expiresIn, &error); 25 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling AccountInterface.session() method"; 26 | } 27 | -------------------------------------------------------------------------------- /src/sdks/core/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Firebolt Core SDK 3 | --- 4 | 5 | [![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 6 | 7 | # Firebolt Core SDK 8 | The primary Firebolt SDK for building Firebolt compliant apps. 9 | 10 | ## Usage 11 | To install, run: 12 | 13 | ``` 14 | npm install @firebolt-js/sdk 15 | ``` 16 | 17 | To use the package, import one of it's modules, e.g.: 18 | 19 | ```js 20 | import { Lifecycle } from '@firebolt-js/sdk' 21 | ``` 22 | 23 | ## Contributing 24 | The Firebolt Core SDK is built using the Firebolt OpenRPC toolset: 25 | 26 | See [Firebolt OpenRPC](https://www.github.com/rdkcentral/firebolt-openrpc/), for more info. 27 | -------------------------------------------------------------------------------- /src/schemas/policies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/policies", 3 | "title": "Policies", 4 | "definitions": { 5 | "AgePolicy": { 6 | "title": "AgePolicy", 7 | "description": "The policy that describes various age groups to which content is directed. See distributor documentation for further details.", 8 | "anyOf": [ 9 | { 10 | "type": "string" 11 | }, 12 | { 13 | "type": "string", 14 | "enum": [ 15 | "app:adult", 16 | "app:child", 17 | "app:teen" 18 | ] 19 | } 20 | ] 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/sdks/manage/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Firebolt Manage SDK 3 | --- 4 | 5 | [![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 6 | 7 | # Firebolt Manage SDK 8 | For building Firebolt compliant apps that manage Firebolt devices. 9 | 10 | ## Usage 11 | To install, run: 12 | 13 | ``` 14 | npm install @firebolt-js/manage-sdk 15 | ``` 16 | 17 | To use the package, import one of it's modules, e.g.: 18 | 19 | ```js 20 | import { Privacy } from '@firebolt-js/manage-sdk' 21 | ``` 22 | 23 | ## Contributing 24 | The Firebolt SDKs are built using the Firebolt OpenRPC toolset: 25 | 26 | See [Firebolt OpenRPC](https://www.github.com/rdkcentral/firebolt-openrpc/), for more info. 27 | -------------------------------------------------------------------------------- /src/sdks/discovery/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Firebolt Discovery SDK 3 | --- 4 | 5 | [![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 6 | 7 | # Firebolt Discovery SDK 8 | For building Firebolt compliant apps for discovering first-party content on Firebolt devices. 9 | 10 | ## Usage 11 | To install, run: 12 | 13 | ``` 14 | npm install @firebolt-js/discovery-sdk 15 | ``` 16 | 17 | To use the package, import one of it's modules, e.g.: 18 | 19 | ```js 20 | import { Content } from '@firebolt-js/discovery-sdk' 21 | ``` 22 | 23 | ## Contributing 24 | The Firebolt SDKs are built using the Firebolt OpenRPC toolset: 25 | 26 | See [Firebolt OpenRPC](https://www.github.com/rdkcentral/firebolt-openrpc/), for more info. 27 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/metricsTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class MetricsTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(MetricsTest, event) 21 | { 22 | std::string schema = "http://example.com/schema"; 23 | Firebolt::Metrics::EventObject data; 24 | Firebolt::Error error = Firebolt::Error::None; 25 | 26 | Firebolt::IFireboltAccessor::Instance().MetricsInterface().event(schema, data, &error); 27 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling MetricsInterface.event() method"; 28 | } 29 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/Module.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | MODULE_NAME_DECLARATION(BUILD_REFERENCE) 22 | -------------------------------------------------------------------------------- /src/sdks/discovery/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [1.4.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0...v1.4.1) (2024-01-10) 2 | 3 | # [1.4.0](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.0...v1.4.0) (2024-23-09) 4 | 5 | # [1.3.0](https://github.com/rdkcentral/firebolt-apis/compare/v1.2.0...v1.3.0) (2024-08-12) 6 | 7 | # [1.2.0](https://github.com/rdkcentral/firebolt-apis/compare/v1.1.0...v1.2.0) (2024-06-14) 8 | 9 | ### Features 10 | 11 | * Introduced Discovery SDK for first-party aggregated experiences to connect with third-party apps. 12 | * [User Interest](https://github.com/rdkcentral/firebolt-apis/blob/main/requirements/specifications/discovery/user-interest.md) ([#170](https://github.com/rdkcentral/firebolt-apis/issues/170)) ([48a1094](https://github.com/rdkcentral/firebolt-apis/commit/48a1094aaab6418f09db662dbc81f090a34f32ed)) 13 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/Module.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | MODULE_NAME_DECLARATION(BUILD_REFERENCE) 22 | -------------------------------------------------------------------------------- /src/descriptions/modules/discovery/EntityInfo.md: -------------------------------------------------------------------------------- 1 | An EntityInfo object represents an "entity" on the platform. Currently, only entities of type `program` are supported. `programType` must be supplied to identify the program type. 2 | 3 | Additionally, EntityInfo objects must specify a properly formed 4 | ContentIdentifiers object, `entityType`, and `title`. The app should provide 5 | the `synopsis` property for a good user experience if the contentmetadata is not available another way 6 | 7 | The ContentIdentifiers must be sufficient for navigating the user to the 8 | appropriate entity or detail screen via a `detail` intent or deep link. 9 | EntityInfo objects must provide at least one WayToWatch object when returned as 10 | part of an `entityInfo` method and a streamable asset is available to the user. 11 | It is optional for the `purchasedContent` method, but recommended because the UI 12 | may use those data. -------------------------------------------------------------------------------- /src/schemas/secondscreen.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/secondscreen", 3 | "title": "SecondScreen", 4 | "anyOf": [ 5 | { "$ref": "#/definitions/SecondScreenEvent" } 6 | ], 7 | "definitions": { 8 | "SecondScreenEvent": { 9 | "title": "SecondScreenEvent", 10 | "description": "An a message notification from a second screen device", 11 | "type": "object", 12 | "required": [ 13 | "type" 14 | ], 15 | "properties": { 16 | "type": { 17 | "type": "string", 18 | "enum": [ 19 | "dial" 20 | ] 21 | }, 22 | "version": { 23 | "type": "string" 24 | }, 25 | "data": { 26 | "type": "string" 27 | } 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Metrics/include/module.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "error.h" 4 | /* ${IMPORTS} */ 5 | 6 | ${if.declarations}namespace Firebolt { 7 | namespace ${info.Title} { 8 | ${if.enums} 9 | 10 | // Enums 11 | /* ${ENUMS} */${end.if.enums} 12 | ${if.types} 13 | // Types 14 | /* ${TYPES} */${end.if.types} 15 | ${if.providers}/* ${PROVIDERS} */${end.if.providers}${if.xuses}/* ${XUSES} */${end.if.xuses} 16 | ${if.methods}struct I${info.Title} { 17 | 18 | virtual ~I${info.Title}() = default; 19 | virtual bool ready( Firebolt::Error *err = nullptr ) = 0 ; 20 | virtual bool signIn( Firebolt::Error *err = nullptr ) = 0 ; 21 | virtual bool signOut( Firebolt::Error *err = nullptr ) = 0 ; 22 | 23 | // Methods & Events 24 | /* ${METHODS:declarations} */ 25 | };${end.if.methods} 26 | 27 | } //namespace ${info.Title} 28 | }${end.if.declarations} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/Module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifndef MODULE_NAME 22 | #define MODULE_NAME OpenRPCCoreTestApp 23 | #endif 24 | 25 | #include 26 | 27 | #undef EXTERNAL 28 | #define EXTERNAL 29 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/Module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifndef MODULE_NAME 22 | #define MODULE_NAME OpenRPCManageTestApp 23 | #endif 24 | 25 | #include 26 | 27 | #undef EXTERNAL 28 | #define EXTERNAL 29 | -------------------------------------------------------------------------------- /src/schemas/lifecycle.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/lifecycle", 3 | "title": "Lifecycle", 4 | "oneOf": [ 5 | { 6 | "$ref": "#/definitions/LifecycleState" 7 | }, 8 | { 9 | "$ref": "#/definitions/CloseReason" 10 | } 11 | ], 12 | "definitions": { 13 | "LifecycleState": { 14 | "title": "LifecycleState", 15 | "description": "The application lifecycle state", 16 | "type": "string", 17 | "enum": [ 18 | "initializing", 19 | "inactive", 20 | "foreground", 21 | "background", 22 | "unloading", 23 | "suspended" 24 | ] 25 | }, 26 | "CloseReason": { 27 | "title": "CloseReason", 28 | "description": "The application close reason", 29 | "type": "string", 30 | "enum": [ 31 | "remoteButton", 32 | "userExit", 33 | "done", 34 | "error" 35 | ] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/sdks/manage/Setup.js: -------------------------------------------------------------------------------- 1 | if (!window.__firebolt) { 2 | window.__firebolt = {} 3 | } 4 | 5 | // wires up the mock transport w/out waiting 6 | window.__firebolt.mockTransportLayer = true 7 | 8 | // sets a flag that mock defaults impls can use to speed things up, e.g. Lifecycle/defaults.js 9 | window.__firebolt.automation = true 10 | 11 | let sendListener 12 | let receiver 13 | 14 | export const transport = { 15 | send: function(message) { 16 | const json = JSON.parse(message) 17 | sendListener && sendListener(json) 18 | }, 19 | receive: function(callback) { 20 | // store the callback 21 | receiver = callback 22 | }, 23 | onSend: function(listener) { 24 | sendListener = listener 25 | }, 26 | response: function(id, result) { 27 | let response = { 28 | jsonrpc: '2.0', 29 | id: id, 30 | result: result 31 | } 32 | receiver && receiver(JSON.stringify(response)) 33 | } 34 | } 35 | 36 | window.__firebolt.setTransportLayer(transport) -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Platform/defaults.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import accessibility from '../Accessibility/defaults.mjs' 20 | import device from '../Device/defaults.mjs' 21 | import localization from '../Localization/defaults.mjs' 22 | 23 | export default { 24 | localization: localization, 25 | device: device, 26 | accessibility: accessibility, 27 | } 28 | -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Platform/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import accessibility from '../Accessibility/index.mjs' 20 | import device from '../Device/index.mjs' 21 | import localization from '../Localization/index.mjs' 22 | 23 | // public API 24 | export default { 25 | Localization: localization, 26 | Device: device, 27 | Accessibility: accessibility, 28 | } 29 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | usage() 3 | { 4 | echo "options:" 5 | echo " -t test path" 6 | echo " -s sysroot path" 7 | echo " -f firebolt path" 8 | echo " -c clear build" 9 | echo " -h : help" 10 | echo 11 | echo "usage: " 12 | echo " ./build.sh -t testpath -c -f fireboltpath -s sysrootpath" 13 | } 14 | 15 | TestPath="." 16 | FireboltPath=${FIREBOLT_PATH} 17 | SysrootPath=${SYSROOT_PATH} 18 | ClearBuild="N" 19 | while getopts t:s:f:ch flag 20 | do 21 | case "${flag}" in 22 | t) TestPath="${OPTARG}";; 23 | s) SysrootPath="${OPTARG}";; 24 | f) FireboltPath="${OPTARG}";; 25 | c) ClearBuild="Y";; 26 | h) usage && exit 1;; 27 | esac 28 | done 29 | 30 | if [ "${ClearBuild}" == "Y" ]; 31 | then 32 | rm -rf ${TestPath}/build 33 | fi 34 | 35 | echo "TestPath" 36 | echo "${TestPath}" 37 | echo "FireboltPath" 38 | echo ${FireboltPath} 39 | cmake -B${TestPath}/build -S${TestPath} -DSYSROOT_PATH=${SysrootPath} -DFIREBOLT_PATH=${FireboltPath} 40 | cmake --build ${TestPath}/build 41 | -------------------------------------------------------------------------------- /test/helpers/synchronous-transport.mjs: -------------------------------------------------------------------------------- 1 | if (!window.__firebolt) { 2 | window.__firebolt = {} 3 | } 4 | 5 | let sendCallback 6 | let receiveCallback 7 | let first = false 8 | let _history = [] 9 | 10 | const transport = { 11 | send: function(message) { 12 | const json = JSON.parse(message) 13 | _history.push(json) 14 | sendCallback && sendCallback(json) 15 | }, 16 | response: function(json) { 17 | receiveCallback(JSON.stringify(json)) 18 | }, 19 | receive: function(callback) { 20 | // store the callback 21 | receiveCallback = callback 22 | }, 23 | onSend: function(callback) { 24 | sendCallback = callback 25 | }, 26 | history() { 27 | return _history.concat() 28 | }, 29 | instantiatedBeforeSdk() { 30 | return first 31 | } 32 | } 33 | 34 | if (!window.__firebolt.setTransportLayer) { 35 | first = true 36 | } 37 | 38 | window.__firebolt.getTransportLayer = function() { 39 | // we'll assert on this later... 40 | return transport 41 | } 42 | 43 | export default transport -------------------------------------------------------------------------------- /src/sdks/discovery/src/cpp/sdk/cpptest/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | usage() 3 | { 4 | echo "options:" 5 | echo " -t test path" 6 | echo " -s sysroot path" 7 | echo " -f firebolt path" 8 | echo " -c clear build" 9 | echo " -h : help" 10 | echo 11 | echo "usage: " 12 | echo " ./build.sh -t testpath -c -f fireboltpath -s sysrootpath" 13 | } 14 | 15 | TestPath="." 16 | FireboltPath=${FIREBOLT_PATH} 17 | SysrootPath=${SYSROOT_PATH} 18 | ClearBuild="N" 19 | while getopts t:s:f:ch flag 20 | do 21 | case "${flag}" in 22 | t) TestPath="${OPTARG}";; 23 | s) SysrootPath="${OPTARG}";; 24 | f) FireboltPath="${OPTARG}";; 25 | c) ClearBuild="Y";; 26 | h) usage && exit 1;; 27 | esac 28 | done 29 | 30 | if [ "${ClearBuild}" == "Y" ]; 31 | then 32 | rm -rf ${TestPath}/build 33 | fi 34 | 35 | echo "TestPath" 36 | echo "${TestPath}" 37 | echo "FireboltPath" 38 | echo ${FireboltPath} 39 | cmake -B${TestPath}/build -S${TestPath} -DSYSROOT_PATH=${SysrootPath} -DFIREBOLT_PATH=${FireboltPath} 40 | cmake --build ${TestPath}/build 41 | -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { setMockResponses } from './Transport/MockTransport.mjs' 20 | 21 | /* ${MOCK_IMPORTS} */ 22 | 23 | setMockResponses({ 24 | /* ${MOCK_OBJECTS} */ 25 | }) 26 | 27 | /* ${EXPORTS} */ 28 | export { default as Log } from './Log/index.mjs' 29 | export { default as Events } from './Events/index.mjs' 30 | export { default as Settings } from './Settings/index.mjs' 31 | -------------------------------------------------------------------------------- /src/sdks/discovery/src/js/sdk/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { setMockResponses } from './Transport/MockTransport.mjs' 20 | 21 | /* ${MOCK_IMPORTS} */ 22 | 23 | setMockResponses({ 24 | /* ${MOCK_OBJECTS} */ 25 | }) 26 | 27 | /* ${EXPORTS} */ 28 | export { default as Log } from './Log/index.mjs' 29 | export { default as Events } from './Events/index.mjs' 30 | export { default as Settings } from './Settings/index.mjs' 31 | -------------------------------------------------------------------------------- /src/sdks/manage/src/js/sdk/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { setMockResponses } from './Transport/MockTransport.mjs' 20 | 21 | /* ${MOCK_IMPORTS} */ 22 | 23 | setMockResponses({ 24 | /* ${MOCK_OBJECTS} */ 25 | }) 26 | 27 | /* ${EXPORTS} */ 28 | export { default as Log } from './Log/index.mjs' 29 | export { default as Events } from './Events/index.mjs' 30 | export { default as Settings } from './Settings/index.mjs' 31 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | usage() 3 | { 4 | echo "options:" 5 | echo " -t test path" 6 | echo " -s sysroot path" 7 | echo " -f firebolt path" 8 | echo " -c clear build" 9 | echo " -h : help" 10 | echo 11 | echo "usage: " 12 | echo " ./build.sh -t testpath -c -f fireboltpath -s sysrootpath" 13 | } 14 | 15 | TestPath="." 16 | FireboltPath=${FIREBOLT_PATH} 17 | SysrootPath=${SYSROOT_PATH} 18 | ClearBuild="N" 19 | while getopts t:s:f:ch flag 20 | do 21 | case "${flag}" in 22 | t) TestPath="${OPTARG}";; 23 | s) SysrootPath="${OPTARG}";; 24 | f) FireboltPath="${OPTARG}";; 25 | c) ClearBuild="Y";; 26 | h) usage && exit 1;; 27 | esac 28 | done 29 | 30 | if [ "${ClearBuild}" == "Y" ]; 31 | then 32 | rm -rf ${TestPath}/build 33 | fi 34 | 35 | echo "TestPath" 36 | echo "${TestPath}" 37 | echo "FireboltPath" 38 | echo ${FireboltPath} 39 | cmake -B${TestPath}/build -S${TestPath} -DSYSROOT_PATH=${SysrootPath} -DFIREBOLT_PATH=${FireboltPath} 40 | # -DPOLYMORPHICS_METHODS=ON // Enable this to test 41 | cmake --build ${TestPath}/build 42 | -------------------------------------------------------------------------------- /src/template/openrpc/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "openrpc": "1.2.4", 3 | "info": { 4 | "title": "Firebolt JSON-RPC API", 5 | "version": "" 6 | }, 7 | "methods": [ 8 | { 9 | "name": "rpc.discover", 10 | "summary": "The OpenRPC schema for this JSON-RPC API", 11 | "params": [], 12 | "tags": [ 13 | { 14 | "name": "capabilities", 15 | "x-uses": [ "xrn:firebolt:capability:rpc:discover" ] 16 | } 17 | ], 18 | "result": { 19 | "name": "OpenRPC Schema", 20 | "schema": { 21 | "type": "object" 22 | } 23 | }, 24 | "examples": [ 25 | { 26 | "name": "Default", 27 | "params": [], 28 | "result": { 29 | "name": "schema", 30 | "value": {} 31 | } 32 | } 33 | ] 34 | } 35 | ], 36 | "components": { 37 | "schemas": {} 38 | } 39 | } -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/device.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Device } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("Device.name()", () => { 23 | return Device.name(() => {}).then((res: number) => { 24 | expect(res > 0).toBe(true); 25 | }); 26 | }); 27 | 28 | test("Device.provision()", () => { 29 | return Device.provision("Test_Account_Id", "Test_Device_Id").then((res) => { 30 | expect(res).toEqual(null); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/accountTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class AccountTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(AccountTest, Id) 21 | { 22 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Account.id")); 23 | 24 | std::string account_id = Firebolt::IFireboltAccessor::Instance().AccountInterface().id(&error); 25 | 26 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve account_id from Account.id() method"; 27 | EXPECT_EQ(account_id, expectedValues); 28 | } 29 | 30 | TEST_F(AccountTest, Uid) 31 | { 32 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Account.uid")); 33 | 34 | std::string account_uid = Firebolt::IFireboltAccessor::Instance().AccountInterface().uid(&error); 35 | 36 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve account_uid from Account.uid() method"; 37 | EXPECT_EQ(account_uid, expectedValues); 38 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/lifecycleTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class LifecycleTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(LifecycleTest, Close) 21 | { 22 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Lifecycle.close")); 23 | 24 | Firebolt::IFireboltAccessor::Instance().LifecycleInterface().close(Firebolt::Lifecycle::CloseReason::USER_EXIT, &error); 25 | 26 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling Lifecycle.close() method"; 27 | } 28 | 29 | // Lifecycle.ready method needs events to be supported in mock transport to work 30 | 31 | TEST_F(LifecycleTest, Finished) 32 | { 33 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Lifecycle.finished")); 34 | 35 | Firebolt::IFireboltAccessor::Instance().LifecycleInterface().finished(&error); 36 | 37 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling Lifecycle.background() method"; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/schemas/localization.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/localization", 3 | "title": "Localization", 4 | "oneOf": [ 5 | { 6 | "$ref": "#/definitions/Locality" 7 | }, 8 | { 9 | "$ref": "#/definitions/CountryCode" 10 | }, 11 | { 12 | "$ref": "#/definitions/Language" 13 | }, 14 | { 15 | "$ref": "#/definitions/Locale" 16 | }, 17 | { 18 | "$ref": "#/definitions/TimeZone" 19 | } 20 | ], 21 | "definitions": { 22 | "CountryCode": { 23 | "type": "string", 24 | "pattern": "^[A-Z]{2}$" 25 | }, 26 | "Language": { 27 | "type": "string", 28 | "pattern": "^[A-Za-z]{2}$" 29 | }, 30 | "ISO639_2Language": { 31 | "type": "string", 32 | "pattern": "^[a-z]{3}$" 33 | }, 34 | "Locality": { 35 | "type": "string" 36 | }, 37 | "Locale": { 38 | "type": "string", 39 | "pattern": "^[a-zA-Z]+([a-zA-Z0-9\\-]*)$" 40 | }, 41 | "TimeZone": { 42 | "type": "string", 43 | "pattern": "^[-+_\/ A-Za-z 0-9]*$" 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Metrics/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | /* ${IMPORTS} */ 20 | 21 | /* ${INITIALIZATION} */ 22 | 23 | function ready() { 24 | return Transport.send('metrics', 'ready', {}) 25 | } 26 | 27 | function signIn() { 28 | return Transport.send('metrics', 'signIn', {}) 29 | } 30 | 31 | function signOut() { 32 | return Transport.send('metrics', 'signOut', {}) 33 | } 34 | 35 | 36 | /* ${METHODS} */ 37 | 38 | export default { 39 | 40 | /* ${EVENTS_ENUM} */ 41 | /* ${ENUMS} */ 42 | /* ${METHOD_LIST} */ 43 | 44 | } 45 | 46 | export { 47 | ready, 48 | signIn, 49 | signOut 50 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "error.h" 22 | 23 | class CoreSDKTestGeneratedCode { 24 | 25 | public: 26 | CoreSDKTestGeneratedCode() = default; 27 | virtual ~CoreSDKTestGeneratedCode() = default; 28 | 29 | static void CreateFireboltInstance(); 30 | static void DestroyFireboltInstance(); 31 | static void TestCoreStaticSDK(); 32 | static void GetDeviceName(); 33 | static bool WaitOnConnectionReady(); 34 | 35 | private: 36 | static void ConnectionChanged(const bool, const Firebolt::Error); 37 | static bool _connected; 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include 20 | #include "CoreSDKTestGeneratedCode.h" 21 | 22 | int __cnt = 0; 23 | int __pass = 0; 24 | 25 | int TotalTests = 0; 26 | int TotalTestsPassed = 0; 27 | 28 | int main() 29 | { 30 | CoreSDKTestGeneratedCode::CreateFireboltInstance(); 31 | 32 | if (CoreSDKTestGeneratedCode::WaitOnConnectionReady() == true) { 33 | CoreSDKTestGeneratedCode::GetDeviceName(); 34 | } 35 | CoreSDKTestGeneratedCode::DestroyFireboltInstance(); 36 | printf("TOTAL: %i tests; %i PASSED, %i FAILED\n", TotalTests, TotalTestsPassed, (TotalTests - TotalTestsPassed)); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/ManageSDKTestGeneratedCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "error.h" 22 | 23 | class ManageSDKTestGeneratedCode { 24 | 25 | public: 26 | ManageSDKTestGeneratedCode() = default; 27 | virtual ~ManageSDKTestGeneratedCode() = default; 28 | 29 | static void CreateFireboltInstance(); 30 | static void DestroyFireboltInstance(); 31 | static void TestManageStaticSDK(); 32 | static void GetDeviceName(); 33 | static void SetDeviceName(); 34 | static bool WaitOnConnectionReady(); 35 | 36 | private: 37 | static void ConnectionChanged(const bool, const Firebolt::Error); 38 | static bool _connected; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branches": [ 3 | { 4 | "name": "main", 5 | "prerelease": false 6 | }, 7 | { 8 | "name": "next", 9 | "channel": "next", 10 | "prerelease": true 11 | }, 12 | { 13 | "name": "next-major", 14 | "channel": "next-major", 15 | "prerelease": true 16 | }, 17 | { 18 | "name": "proposed", 19 | "channel": "proposed", 20 | "prerelease": true 21 | } 22 | ], 23 | "dryRun": false, 24 | "plugins": [ 25 | [ 26 | "@semantic-release/commit-analyzer", 27 | { 28 | "preset": "conventionalcommits" 29 | } 30 | ], 31 | "@semantic-release/release-notes-generator", 32 | [ 33 | "production-changelog", 34 | { 35 | "changelogFile": "CHANGELOG.md" 36 | } 37 | ], 38 | [ 39 | "@semantic-release/npm", 40 | { 41 | "npmPublish": false, 42 | "tarballDir": "./" 43 | } 44 | ], 45 | [ 46 | "@semantic-release/git", 47 | { 48 | "assets": ["CHANGELOG.md", "package.json", "package-lock.json", "npm-shrinkwrap.json", "src/sdks/core/package.json", "src/sdks/manage/package.json", "src/sdks/discovery/package.json"] 49 | } 50 | ], 51 | [ 52 | "@semantic-release/github", 53 | { 54 | "assets": [ 55 | { "path":"./*.tgz" } 56 | ] 57 | } 58 | ] 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /src/js/version-specification/index.mjs: -------------------------------------------------------------------------------- 1 | import apis from './apis.mjs' 2 | import capabilities from './capabilities.mjs' 3 | 4 | import nopt from 'nopt' 5 | import path from 'path' 6 | import { readFile, writeFile } from 'fs/promises' 7 | 8 | const loadJson = file => readFile(file).then(data => JSON.parse(data.toString())) 9 | 10 | const knownOpts = { 11 | 'capabilities': [Boolean], 12 | 'legacy-support': [Number], 13 | 'source': [String], 14 | 'report': [Boolean] 15 | } 16 | 17 | const defaultOpts = { 18 | 'capabilities': true, 19 | 'legacy-versions': 2, 20 | 'source': './src/json/firebolt-specification.json', 21 | 'report': false 22 | } 23 | 24 | const shortHands = { 25 | 'l': '--legacy-versions', 26 | 'c': '--capabilities', 27 | 't': '--target', 28 | 's': '--source', 29 | 'r': '--report' 30 | } 31 | 32 | // Last 2 arguments are the defaults. 33 | const parsedArgs = Object.assign(defaultOpts, nopt(knownOpts, shortHands, process.argv, 2)) 34 | 35 | const signOff = () => console.log('\nThis has been a presentation of \x1b[38;5;202mFirebolt\x1b[0m \u{1F525} \u{1F529}\n') 36 | 37 | let version = await loadJson(parsedArgs.source) 38 | 39 | version = await apis(version, parsedArgs) 40 | version = await capabilities(version, parsedArgs) 41 | 42 | if (!parsedArgs.report) { 43 | writeFile(path.join('.', 'dist', 'firebolt-specification.json'), JSON.stringify(version, null, '\t')) 44 | } 45 | 46 | signOff() 47 | -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Device/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | /* ${IMPORTS} */ 20 | 21 | /* ${INITIALIZATION} */ 22 | 23 | function version() { 24 | return new Promise( (resolve, reject) => { 25 | Transport.send('device', 'version').then( v => { 26 | v = v || {} 27 | v.sdk = v.sdk || {} 28 | v.sdk.major = parseInt('${major}') 29 | v.sdk.minor = parseInt('${minor}') 30 | v.sdk.patch = parseInt('${patch}') 31 | v.sdk.readable = '${readable}' 32 | resolve(v) 33 | }).catch(error => { 34 | reject(error) 35 | }) 36 | }) 37 | } 38 | 39 | /* ${METHODS} */ 40 | 41 | export default { 42 | 43 | /* ${EVENTS_ENUM} */ 44 | /* ${ENUMS} */ 45 | 46 | version, 47 | /* ${METHOD_LIST} */ 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/schemas/errors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/errors", 3 | "title": "Errors", 4 | "oneOf": [ 5 | { "$ref": "#/definitions/FireboltError" }, 6 | { "$ref": "#/definitions/UserNotAuthenticatedError" } 7 | ], 8 | "definitions": { 9 | "FireboltError": { 10 | "title": "FireboltError", 11 | "description": "An error resulting from calling a Firebolt method.", 12 | "type": "object", 13 | "required": ["code", "message"], 14 | "properties": { 15 | "code": { 16 | "type": "number" 17 | }, 18 | "message": { 19 | "type": "string" 20 | }, 21 | "data": { 22 | "type": "object" 23 | } 24 | }, 25 | "examples": [ 26 | { 27 | "code": -32601, 28 | "message": "Method not found" 29 | } 30 | ] 31 | }, 32 | "UserNotAuthenticatedError": { 33 | "title": "UserNotAuthenticatedError", 34 | "allOf": [ 35 | { "$ref": "#/definitions/FireboltError" }, 36 | { 37 | "type": "object", 38 | "properties": { 39 | "code": { 40 | "const": 401 41 | }, 42 | "message": { 43 | "const": "User is not authenticated." 44 | } 45 | } 46 | } 47 | ], 48 | "examples": [ 49 | { 50 | "code": 401, 51 | "message": "User is not authenticated." 52 | } 53 | ] 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Device/include/module.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Comcast Cable Communications Management, LLC 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | * 15 | * SPDX-License-Identifier: Apache-2.0 16 | */ 17 | #pragma once 18 | 19 | #include "error.h" 20 | /* ${IMPORTS} */ 21 | 22 | ${if.declarations} 23 | namespace Firebolt { 24 | namespace ${info.Title} { 25 | ${if.enums}/* ${ENUMS} */${end.if.enums} 26 | ${if.types}/* ${TYPES} */${end.if.types} 27 | ${if.providers}/* ${PROVIDERS} */${end.if.providers}${if.xuses}/* ${XUSES} */${end.if.xuses} 28 | ${if.methods}struct I${info.Title} { 29 | // Methods & Events 30 | /* ${METHODS:declarations} */ 31 | virtual ~I${info.Title}() = default; 32 | virtual std::string version( Firebolt::Error *err = nullptr ) const = 0; 33 | }; 34 | ${end.if.methods} 35 | } //namespace ${info.Title} 36 | } 37 | ${end.if.declarations} -------------------------------------------------------------------------------- /src/schemas/advertising.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/advertising", 3 | "title": "Advertising", 4 | "oneOf": [ 5 | { 6 | "$ref": "#/definitions/SkipRestriction" 7 | } 8 | ], 9 | "definitions": { 10 | "SkipRestriction": { 11 | "title": "SkipRestriction", 12 | "$comment": "xrn:advertising:policy:skipRestriction:", 13 | "type": "string", 14 | "enum": [ 15 | "none", 16 | "adsUnwatched", 17 | "adsAll", 18 | "all" 19 | ], 20 | "description": "The advertisement skip restriction.\n\nApplies to fast-forward/rewind (e.g. trick mode), seeking over an entire opportunity (e.g. jump), seeking out of what's currently playing, and \"Skip this ad...\" features. Seeking over multiple ad opportunities only requires playback of the _last_ opportunity, not all opportunities, preceding the seek destination.\n\n| Value | Description |\n|--------------|--------------------------------------------------------------------------------|\n| none |No fast-forward, jump, or skip restrictions |\n| adsUnwatched | Restrict fast-forward, jump, and skip for unwatched ad opportunities only. |\n| adsAll | Restrict fast-forward, jump, and skip for all ad opportunities |\n| all | Restrict fast-forward, jump, and skip for all ad opportunities and all content |\n\nNamespace: `xrn:advertising:policy:skipRestriction:`\n\n" 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /.github/workflows/merge-to-main.yml: -------------------------------------------------------------------------------- 1 | name: Attempt to merge next to main 2 | on: 3 | workflow_dispatch: 4 | 5 | permissions: 6 | contents: read 7 | 8 | jobs: 9 | # Check if next can merge into main 10 | perform_merge: 11 | name: Perform merge if "next" can merge into "main" 12 | runs-on: ubuntu-latest 13 | permissions: 14 | contents: write #because we push - git push origin "main" 15 | pull-requests: write # PR updates 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v2 19 | with: 20 | fetch-depth: 0 21 | repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} 22 | persist-credentials: true 23 | 24 | # Set user identity 25 | - name: Set-Identity 26 | run: | 27 | git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" 28 | git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" 29 | 30 | # Checkout "main" 31 | - name: Checkout main 32 | run: git checkout "main" 33 | 34 | - name: Perform the merge from next to main 35 | run: | 36 | git merge next 37 | git push origin "main" 38 | echo "Push to main succeeded" 39 | 40 | # If the merge cannot be performed, let stakeholders know 41 | message_on_failure: 42 | name: Merge failure 43 | needs: perform_merge 44 | runs-on: ubuntu-latest 45 | if: ${{ failure() }} 46 | 47 | steps: 48 | - name: Post error message (To-Do) 49 | run: echo "Next cannot be merged into main cleanly" 50 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include 20 | #include "ManageSDKTestGeneratedCode.h" 21 | 22 | int __cnt = 0; 23 | int __pass = 0; 24 | 25 | int TotalTests = 0; 26 | int TotalTestsPassed = 0; 27 | 28 | int main() 29 | { 30 | printf("Calling CreateFireboltInstance ---\n"); 31 | ManageSDKTestGeneratedCode::CreateFireboltInstance(); 32 | 33 | if (ManageSDKTestGeneratedCode::WaitOnConnectionReady() == true) { 34 | printf("Calling GetDeviceName ---> \n"); 35 | ManageSDKTestGeneratedCode::GetDeviceName(); 36 | ManageSDKTestGeneratedCode::SetDeviceName(); 37 | ManageSDKTestGeneratedCode::GetDeviceName(); 38 | } 39 | ManageSDKTestGeneratedCode::DestroyFireboltInstance(); 40 | printf("TOTAL: %i tests; %i PASSED, %i FAILED\n", TotalTests, TotalTestsPassed, (TotalTests - TotalTestsPassed)); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/secureStorageTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class SecureStorageTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | Firebolt::SecureStorage::StorageScope scope; 9 | std::string appId = "exampleAppId"; 10 | 11 | void SetUp() override 12 | { 13 | jsonEngine = new JsonEngine(); 14 | } 15 | 16 | void TearDown() override 17 | { 18 | delete jsonEngine; 19 | } 20 | }; 21 | 22 | TEST_F(SecureStorageTest, clearForApp) 23 | { 24 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().clearForApp(appId, scope, &error); 25 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling SecureStorageInterface.clearForApp() method"; 26 | } 27 | 28 | TEST_F(SecureStorageTest, removeForApp) 29 | { 30 | std::string key = "exampleKey"; 31 | 32 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().removeForApp(appId, scope, key, &error); 33 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling SecureStorageInterface.removeForApp() method"; 34 | } 35 | 36 | TEST_F(SecureStorageTest, setForApp) 37 | { 38 | std::string key = "exampleKey"; 39 | std::string value = "exampleValue"; 40 | std::optional options = std::nullopt; 41 | 42 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().setForApp(appId, scope, key, value, options, &error); 43 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling SecureStorageInterface.setForApp() method"; 44 | } 45 | -------------------------------------------------------------------------------- /test/Setup.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | /** 20 | * This module sets up the mock transport layer immediately, instead of letting the SDK wait 500ms 21 | */ 22 | 23 | if (!window.__firebolt) { 24 | window.__firebolt = {} 25 | } 26 | 27 | // wires up the mock transport w/out waiting 28 | window.__firebolt.mockTransportLayer = true 29 | 30 | // sets a flag that mock defaults impls can use to speed things up, e.g. Lifecycle/defaults.js 31 | window.__firebolt.automation = true 32 | 33 | export const sent = [] 34 | 35 | export const testHarness = { 36 | initialize: function(config) { 37 | this.emit = config.emit 38 | }, 39 | onSend: function(module, method, params, id) { 40 | const msg = { 41 | module, 42 | method, 43 | params, 44 | id 45 | } 46 | sent.push(msg) 47 | } 48 | } 49 | 50 | window.__firebolt.testHarness = testHarness 51 | 52 | export default testHarness -------------------------------------------------------------------------------- /push-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021 Comcast Cable Communications Management, LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # SPDX-License-Identifier: Apache-2.0 18 | 19 | mkdir -p /tmp/firebolt-docs/build 20 | mkdir -p /tmp/firebolt-docs/wiki 21 | mkdir -p /tmp/firebolt-docs/ottxdocs 22 | 23 | cp -r ./build/docs/wiki /tmp/firebolt-docs/build 24 | 25 | BRANCH="$(git branch --show-current)" 26 | # grab repo and reformat to git@github.comcast.com:/.wiki.git 27 | REPO="$(git config --get remote.origin.url | sed 's/https:\/\//git\@/' | sed 's/github\.com\//github\.com:/' | sed 's/.git$/.wiki.git/')" 28 | 29 | if [ $BRANCH = 'main' -o $BRANCH = 'master' ] 30 | then 31 | echo "Publishing docs to GitHub wiki..." 32 | echo " $REPO " 33 | 34 | cd /tmp/firebolt-docs/wiki/ 35 | git clone $REPO . 36 | ls 37 | rm -r * 38 | cp -r ../build/wiki ./ 39 | 40 | git add --all 41 | git commit -m 'Publishing docs to wiki' 42 | git push 43 | else 44 | echo "Publishing $BRANCH docs to ottx-docs wiki..." 45 | echo "ERROR: not supported yet..." 46 | fi 47 | 48 | yes | rm -r /tmp/firebolt-docs -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/account.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Account } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("Account.session()", () => { 23 | const expTime: number = new Date().getTime() + 100; 24 | return Account.session("Test_Token", expTime).then((res: void) => { 25 | expect(res).toEqual(null); 26 | }); 27 | }); 28 | 29 | 30 | // Events Test cases 31 | 32 | // test("Account.listen() for requestSession event", () => { 33 | // return Account.listen("requestSession", () => {}).then((res: number) => { 34 | // expect(res > 0).toBe(true); 35 | // }); 36 | // }); 37 | 38 | // test("Account.once() for requestSession event", () => { 39 | // return Account.once("requestSession", () => {}).then((res: number) => { 40 | // expect(res > 0).toBe(true); 41 | // }); 42 | // }); 43 | 44 | // test("Account.clear()", () => { 45 | // const result = Account.clear(2); 46 | // expect(result).toBeFalsy(); 47 | // }); 48 | -------------------------------------------------------------------------------- /requirements/specifications/entities/channels.md: -------------------------------------------------------------------------------- 1 | # Channel Entities 2 | 3 | Document Status: Proposed Specification 4 | 5 | See [Firebolt Requirements Governance](../../governance.md) for more info. 6 | 7 | | Contributor | Organization | 8 | | --------------- | ------------ | 9 | | Jeremy LaCivita | Comcast | 10 | 11 | ## 1. Overview 12 | TBD... 13 | 14 | The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL 15 | NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**NOT 16 | RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be 17 | interpreted as described in [BCP 18 | 14](https://www.rfc-editor.org/rfc/rfc2119.txt) [RFC2119] [RFC8174] when, and 19 | only when, they appear in all capitals, as shown here. 20 | 21 | ## 2. Table of Contents 22 | - [1. Overview](#1-overview) 23 | - [2. Table of Contents](#2-table-of-contents) 24 | - [3. Channel Entities](#3-channel-entities) 25 | 26 | 27 | ## 3. Channel Entities 28 | Every Channel Entity **MUST** be an [Entity](./index.md#3-entities). 29 | 30 | Every Channel Entity **MUST** have a `const` property named `entityType`, which 31 | **MUST** have the value `"channel"`. 32 | 33 | Every Channel Entity **MUST** have a `string` property named `channelType`, 34 | whose value **MUST** be one of: 35 | 36 | - `"streaming"` 37 | - `"broadcast"` 38 | 39 | An example Channel Entity: 40 | 41 | ```json 42 | { 43 | "entityType": "channel", 44 | "channelType": "streaming", 45 | "entityId": "streaming/xyz" 46 | } 47 | ``` 48 | 49 | Another example Channel Entity: 50 | 51 | ```json 52 | { 53 | "entityType": "channel", 54 | "channelType": "broadcast", 55 | "entityId": "broadcast/xyz" 56 | } 57 | ``` 58 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/parametersTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class ParametersTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(ParametersTest, Initialization) 21 | { 22 | nlohmann::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Parameters.initialization")); 23 | 24 | Firebolt::Parameters::AppInitialization appInitialization = Firebolt::IFireboltAccessor::Instance().ParametersInterface().initialization(&error); 25 | 26 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve appInitialization from Parameters.initialization() method"; 27 | EXPECT_EQ(appInitialization.us_privacy, expectedValues["us_privacy"]); 28 | EXPECT_EQ(appInitialization.lmt, expectedValues["lmt"]); 29 | 30 | ASSERT_TRUE(appInitialization.discovery.has_value()); 31 | ASSERT_TRUE(appInitialization.discovery.value().navigateTo.has_value()); 32 | 33 | // Deserialize the actual navigateTo value (double-deserialization to handle extra escaping) 34 | std::string actualNavigateToStr = appInitialization.discovery.value().navigateTo.value(); 35 | nlohmann::json actualNavigateToJson = nlohmann::json::parse(nlohmann::json::parse(actualNavigateToStr).get()); 36 | 37 | // Convert expectedValues["discovery"]["navigateTo"] to a serialized JSON string 38 | nlohmann::json expectedNavigateTo = expectedValues["discovery"]["navigateTo"]; 39 | 40 | EXPECT_EQ(actualNavigateToJson, expectedNavigateTo); 41 | } 42 | -------------------------------------------------------------------------------- /src/openrpc/audio_descriptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "openrpc": "1.2.4", 3 | "info": { 4 | "title": "AudioDescriptions", 5 | "description": "A module for managing audio-description Settings.", 6 | "version": "0.0.0" 7 | }, 8 | "methods": [ 9 | { 10 | "name": "enabled", 11 | "tags": [ 12 | { 13 | "name": "property" 14 | }, 15 | { 16 | "name": "capabilities", 17 | "x-uses": [ 18 | "xrn:firebolt:capability:accessibility:audiodescriptions" 19 | ] 20 | } 21 | ], 22 | "summary": "Whether or not audio-descriptions are enabled.", 23 | "params": [ 24 | ], 25 | "result": { 26 | "name": "enabled", 27 | "schema": { 28 | "type": "boolean" 29 | } 30 | }, 31 | "examples": [ 32 | { 33 | "name": "Default example #1", 34 | "params": [ 35 | ], 36 | "result": { 37 | "name": "enabled", 38 | "value": true 39 | } 40 | }, 41 | { 42 | "name": "Default example #2", 43 | "params": [ 44 | ], 45 | "result": { 46 | "name": "enabled", 47 | "value": false 48 | } 49 | } 50 | ] 51 | } 52 | ], 53 | "components": { 54 | "schemas": { 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include "firebolt.h" 23 | 24 | class DiscoverySDKTest { 25 | class OnUserInterestNotification : public Firebolt::Content::IContent::IOnUserInterestNotification { 26 | public: 27 | void onUserInterest( const Firebolt::Content::InterestEvent& ) override; 28 | }; 29 | 30 | public: 31 | DiscoverySDKTest() = default; 32 | virtual ~DiscoverySDKTest() = default; 33 | 34 | static void CreateFireboltInstance(const std::string& url); 35 | static void DestroyFireboltInstance(); 36 | static void TestDiscoveryStaticSDK(); 37 | 38 | static void SubscribeUserInterest(); 39 | static void UnsubscribeUserInterest(); 40 | static void RequestUserInterest(); 41 | 42 | static bool WaitOnConnectionReady(); 43 | 44 | private: 45 | static void ConnectionChanged(const bool, const Firebolt::Error); 46 | static bool _connected; 47 | static OnUserInterestNotification _userInterestNotification; 48 | 49 | }; -------------------------------------------------------------------------------- /src/sdks/core/test/suite/localization.test.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from "@jest/globals"; 2 | import { Localization } from "../../build/javascript/src/firebolt"; 3 | test("locality", () => { 4 | return Localization.locality().then((res: string) => { 5 | expect(res).toBe("Philadelphia"); 6 | }); 7 | }); 8 | test("postalCode", () => { 9 | return Localization.postalCode().then((res: string) => { 10 | expect(res).toBe("19103"); 11 | }); 12 | }); 13 | test("countryCode", () => { 14 | return Localization.countryCode().then((res: string) => { 15 | expect(res).toBe("US"); 16 | }); 17 | }); 18 | test("language", () => { 19 | return Localization.language().then((res: string) => { 20 | expect(res).toBe("en"); 21 | }); 22 | }); 23 | test("locale", () => { 24 | return Localization.locale().then((res: string) => { 25 | expect(res).toBe("en-US"); 26 | }); 27 | }); 28 | test("additionalInfo", () => { 29 | return Localization.additionalInfo().then((res: object) => { 30 | expect(typeof res).toBe("object"); 31 | }); 32 | }); 33 | test("latlon", () => { 34 | return Localization.latlon().then((res: Array) => { 35 | expect([39.9549, 75.1699]).toEqual(expect.arrayContaining(res)); 36 | }); 37 | }); 38 | 39 | test("listen() languageChanged event.", () => { 40 | return Localization.listen("languageChanged", () => {}).then( 41 | (res: number) => { 42 | expect(res > 0).toBe(true); 43 | } 44 | ); 45 | }); 46 | 47 | test("once() languageChanged event.", () => { 48 | return Localization.once("languageChanged", () => {}).then((res: number) => { 49 | expect(res > 0).toBe(true); 50 | }); 51 | }); 52 | 53 | test("clear()", () => { 54 | const result: boolean = Localization.clear(-1000); 55 | expect(result).toBeFalsy(); 56 | }); 57 | -------------------------------------------------------------------------------- /src/js/production-changelog/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { readFile, writeFile, ensureFile } = require('fs-extra'); 3 | 4 | const getConfig = ({ changelogFile, changelogTitle }) => ({ 5 | changelogFile: !changelogFile ? 'CHANGELOG.md' : changelogFile, 6 | changelogTitle, 7 | }); 8 | 9 | async function prepare(config, { cwd, nextRelease, logger }) { 10 | const notes = nextRelease.notes 11 | const { changelogFile, changelogTitle } = getConfig(config) 12 | const logPath = path.resolve(cwd, changelogFile) 13 | 14 | // scrub prerelease notes if this release is not a prerelease 15 | if (notes) { 16 | await ensureFile(logPath) 17 | const currentFile = (await readFile(logPath)).toString().trim() 18 | 19 | let content = 20 | changelogTitle && currentFile.startsWith(changelogTitle) 21 | ? currentFile.slice(changelogTitle.length).trim() 22 | : currentFile; 23 | 24 | if (nextRelease.channel === 'latest') { 25 | logger.log(`Scrubbing prerelease notes from ${logPath}.`) 26 | 27 | // Looking for things like: 28 | //# [0.10.0-next.5](https://github.com/rdkcentral/firebolt-core-sdk/compare/v0.10.0-next.4...v0.10.0-next.5) (2023-02-01) 29 | const regex = /\# \[[0-9]+\.[0-9]+\.[0-9]+\-[^\]]+\].*?\n+\# /gms 30 | while (content.match(regex)) { 31 | content = content.replace(regex, '\n# ') 32 | } 33 | } 34 | 35 | content = `${notes.trim()}\n${content ? `\n${content}\n` : ''}`; 36 | 37 | logger.log(`Writing changelog file: ${logPath}`) 38 | 39 | await writeFile(logPath, changelogTitle ? `${changelogTitle}\n\n${content}` : content); 40 | } 41 | } 42 | 43 | module.exports = { prepare }; 44 | -------------------------------------------------------------------------------- /src/sdks/discovery/test/suite/content.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Content } from "../../build/javascript/src/firebolt-discovery"; 21 | 22 | test("Content.requestUserInterest()", () => { 23 | return Content.requestUserInterest(Content.InterestType.INTEREST, Content.InterestReason.PLAYLIST).then((interest: Content.InterestResult) => { 24 | const entity = interest.entity 25 | const appId = interest.appId 26 | expect(appId).toBeDefined() 27 | expect(entity).toBeDefined() 28 | expect(entity.info.title).toBe("Cool Runnings") 29 | }) 30 | }); 31 | 32 | test("Content.onUserInterest()", () => { 33 | return Content.listen('userInterest', (interest: Content.InterestEvent) => { 34 | const entity = interest.entity 35 | const appId = interest.appId 36 | const reason = interest.reason 37 | expect(interest['type']).toBeDefined() 38 | expect(reason).toBeDefined() 39 | expect(appId).toBeDefined() 40 | expect(entity).toBeDefined() 41 | expect(entity.info.title).toBe("Cool Runnings") 42 | }) 43 | }); 44 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Device/src/module_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "FireboltSDK.h" 22 | #include "IModule.h" 23 | #include 24 | 25 | 26 | /* ${IMPORTS} */ 27 | #include "${info.title.lowercase}.h" 28 | 29 | ${if.implementations} 30 | namespace Firebolt { 31 | namespace ${info.Title} { 32 | ${if.enums} 33 | 34 | /* ${ENUMS:json-types} */${end.if.enums} 35 | ${if.types} 36 | // Types 37 | /* ${TYPES:json-types} */${end.if.types} 38 | ${if.methods}class ${info.Title}Impl : public I${info.Title}, public IModule { 39 | 40 | public: 41 | ${info.Title}Impl() = default; 42 | ${info.Title}Impl(const ${info.Title}Impl&) = delete; 43 | ${info.Title}Impl& operator=(const ${info.Title}Impl&) = delete; 44 | 45 | ~${info.Title}Impl() override = default; 46 | 47 | std::string version(Firebolt::Error *err = nullptr) const override; 48 | 49 | // Methods & Events 50 | /* ${METHODS:declarations-override} */ 51 | };${end.if.methods} 52 | 53 | }//namespace ${info.Title} 54 | }${end.if.implementations} -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/profileTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | #include "common/types.h" 3 | 4 | class ProfileTest : public ::testing::Test 5 | { 6 | protected: 7 | JsonEngine *jsonEngine; 8 | Firebolt::Error error = Firebolt::Error::None; 9 | 10 | void SetUp() override 11 | { 12 | jsonEngine = new JsonEngine(); 13 | } 14 | 15 | void TearDown() override 16 | { 17 | delete jsonEngine; 18 | } 19 | }; 20 | 21 | TEST_F(ProfileTest, ApproveContentRating) 22 | { 23 | 24 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Profile.approveContentRating")); 25 | 26 | bool status = Firebolt::IFireboltAccessor::Instance().ProfileInterface().approveContentRating(&error); 27 | 28 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve status from Profile.approveContentRating() method"; 29 | EXPECT_EQ(status, expectedValues); 30 | } 31 | 32 | TEST_F(ProfileTest, ApprovePurchase) 33 | { 34 | 35 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Profile.approvePurchase")); 36 | 37 | bool status = Firebolt::IFireboltAccessor::Instance().ProfileInterface().approvePurchase(&error); 38 | 39 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve status from Profile.approvePurchase() method"; 40 | EXPECT_EQ(status, expectedValues); 41 | } 42 | 43 | TEST_F(ProfileTest, Flags) 44 | { 45 | 46 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Profile.flags")); 47 | 48 | Firebolt::Types::FlatMap flag = Firebolt::IFireboltAccessor::Instance().ProfileInterface().flags(&error); 49 | 50 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve flag from Profile.flags() method"; 51 | EXPECT_EQ(flag["userExperience"], expectedValues["userExperience"]); 52 | } -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Lifecycle/index.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | /* ${IMPORTS} */ 20 | import { ready as logReady } from '../Metrics/index.mjs' 21 | import { prioritize } from '../Events/index.mjs' 22 | 23 | /* ${INITIALIZATION} */ 24 | 25 | export const store = { 26 | _current: 'initializing', 27 | get current() { 28 | return this._current 29 | } 30 | } 31 | 32 | async function ready() { 33 | let readyRes; 34 | await prioritize('Lifecycle', (event, value) => { 35 | store._current = event 36 | }) 37 | readyRes =await Transport.send('lifecycle', 'ready', {}) 38 | setTimeout(_ => { 39 | logReady() 40 | }) 41 | return readyRes 42 | } 43 | 44 | /* ${METHODS} */ 45 | 46 | function state() { 47 | return store.current 48 | } 49 | 50 | function finished() { 51 | if (store.current === 'unloading') { 52 | return Transport.send('lifecycle', 'finished') 53 | } else { 54 | throw 'Cannot call finished() except when in the unloading transition' 55 | } 56 | } 57 | 58 | // public API 59 | export default { 60 | 61 | /* ${EVENTS_ENUM} */ 62 | 63 | /* ${ENUMS} */ 64 | 65 | ready, 66 | state, 67 | finished, 68 | 69 | /* ${METHOD_LIST} */ 70 | 71 | } 72 | -------------------------------------------------------------------------------- /.github/mock-firebolt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate": [ 3 | "method", 4 | "params", 5 | "response", 6 | "events" 7 | ], 8 | "multiUserConnections": "warn", 9 | "bidirectional": true, 10 | "supportedOpenRPCs": [ 11 | { 12 | "name": "core", 13 | "cliFlag": null, 14 | "cliShortFlag": null, 15 | "url_Note": "Can be changed to test different versions of the firebolt-open-rpc", 16 | "fileName": "CORE-OPENRPC.json", 17 | "enabled": true 18 | }, 19 | { 20 | "name": "mock", 21 | "cliFlag": "mock", 22 | "cliShortFlag": "m", 23 | "fileName": "../../functional/mockOpenRpc.json", 24 | "enabled": false 25 | } 26 | ], 27 | "supportedToAppOpenRPCs": [ 28 | { 29 | "name": "coreToApp", 30 | "cliFlag": null, 31 | "cliShortFlag": null, 32 | "url_Note": "URL for toApp OpenRPC (Firebolt 2.0 event/provider spec)", 33 | "fileName": "APP-OPENRPC.json", 34 | "enabled": true 35 | }, 36 | { 37 | "name": "mockToApp", 38 | "cliFlag": "mockToApp", 39 | "cliShortFlag": "mt", 40 | "fileName": "../../functional/mockToAppOpenRpc.json", 41 | "enabled": false 42 | } 43 | ], 44 | "eventConfig": { 45 | "registrationMessage": { 46 | "searchRegex": "(?=.*\\\"method\\\".*)(?=.*\\\"listen\\\":true.*).*\\.on\\S*", 47 | "method": "$.method" 48 | }, 49 | "unRegistrationMessage": { 50 | "searchRegex": "(?=.*\\\"method\\\".*)(?=.*\\\"listen\\\":false.*).*\\.on\\S*", 51 | "method": "$.method" 52 | }, 53 | "registrationAck": "{\"jsonrpc\":\"2.0\",\"id\":{{registration.id}},\"result\":null}", 54 | "unRegistrationAck": "{\"jsonrpc\":\"2.0\",\"id\":{{unRegistration.id}},\"result\":null}", 55 | "event": "{\"result\":{{{resultAsJson}}},\"id\":{{registration.id}},\"jsonrpc\":\"2.0\"}", 56 | "eventType": "Firebolt" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Metrics/src/module_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "FireboltSDK.h" 22 | #include "IModule.h" 23 | 24 | /* ${IMPORTS} */ 25 | #include "${info.title.lowercase}.h" 26 | 27 | ${if.implementations} 28 | namespace Firebolt { 29 | namespace ${info.Title} { 30 | ${if.enums} 31 | 32 | /* ${ENUMS:json-types} */${end.if.enums} 33 | ${if.types} 34 | // Types 35 | /* ${TYPES:json-types} */${end.if.types} 36 | ${if.methods}class ${info.Title}Impl : public I${info.Title}, public IModule { 37 | 38 | public: 39 | ${info.Title}Impl() = default; 40 | ${info.Title}Impl(const ${info.Title}Impl&) = delete; 41 | ${info.Title}Impl& operator=(const ${info.Title}Impl&) = delete; 42 | 43 | ~${info.Title}Impl() override = default; 44 | 45 | 46 | bool ready( Firebolt::Error *err = nullptr ) ; 47 | bool signIn( Firebolt::Error *err = nullptr ) ; 48 | bool signOut( Firebolt::Error *err = nullptr ) ; 49 | 50 | 51 | 52 | // Methods & Events 53 | /* ${METHODS:declarations-override} */ 54 | };${end.if.methods} 55 | 56 | }//namespace ${info.Title} 57 | }${end.if.implementations} -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/CoreSDKTestStaticCode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include "Module.h" 20 | #include "CoreSDKTestStaticCode.h" 21 | 22 | namespace FireboltSDK { 23 | CoreTestStaticCode::CoreTestStaticCode() 24 | : Tests() 25 | { 26 | _functionMap.emplace(std::piecewise_construct, std::forward_as_tuple("Get Country Code"), 27 | std::forward_as_tuple(&GetCountryCode)); 28 | } 29 | 30 | /* static */ Firebolt::Error CoreTestStaticCode::GetCountryCode() 31 | { 32 | const string method = _T("localization.countryCode"); 33 | WPEFramework::Core::ProxyType response; 34 | Firebolt::Error status = FireboltSDK::Properties::Get(method, response); 35 | 36 | EXPECT_EQ(status, Firebolt::Error::None); 37 | if (status == Firebolt::Error::None) { 38 | FIREBOLT_LOG_INFO(Logger::Category::Core, Logger::Module(), "CountryCode : %s", response->Value().c_str()); 39 | } else { 40 | FIREBOLT_LOG_ERROR(Logger::Category::Core, Logger::Module(), "Get %s status = %d\n", method.c_str(), status); 41 | } 42 | 43 | return status; 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/ManageSDKTestStaticCode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include "Module.h" 20 | #include "ManageSDKTestStaticCode.h" 21 | 22 | namespace FireboltSDK { 23 | ManageTestStaticCode::ManageTestStaticCode() 24 | : Tests() 25 | { 26 | _functionMap.emplace(std::piecewise_construct, std::forward_as_tuple("Get Country Code"), 27 | std::forward_as_tuple(&GetCountryCode)); 28 | } 29 | 30 | /* static */ Firebolt::Error ManageTestStaticCode::GetCountryCode() 31 | { 32 | const string method = _T("localization.countryCode"); 33 | WPEFramework::Core::ProxyType response; 34 | Firebolt::Error status = FireboltSDK::Properties::Get(method, response); 35 | 36 | EXPECT_EQ(status, Firebolt::Error::None); 37 | if (status == Firebolt::Error::None) { 38 | FIREBOLT_LOG_INFO(Logger::Category::Manage, Logger::Module(), "CountryCode : %s", response->Value().c_str()); 39 | } else { 40 | FIREBOLT_LOG_ERROR(Logger::Category::Manage, Logger::Module(), "Get %s status = %d\n", method.c_str(), status); 41 | } 42 | 43 | return status; 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | [firebolt-apis] 2 | Copyright 2021 Comcast Cable Communications Management, LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | SPDX-License-Identifier: Apache-2.0 16 | 17 | This product includes software developed at Comcast (http://www.comcast.com/). 18 | 19 | The component may include material which is licensed under other licenses / copyrights as 20 | listed below. Your use of this material within the component is also subject to the terms and 21 | conditions of these licenses. The LICENSE file contains the text of all the licenses which apply 22 | within this component.. 23 | 24 | nlohmann::json 25 | Copyright (c) 2013-2025 Niels Lohmann 26 | Licensed under the MIT License 27 | https://github.com/nlohmann/json 28 | 29 | WebSocket++ 30 | Copyright (c) 2014, Peter Thorson. All rights reserved. 31 | Licensed under the BSD 3-clause license 32 | https://github.com/zaphoyd/websocketpp 33 | 34 | Google Test (gtest) 35 | Copyright 2008, Google Inc. 36 | Licensed under the BSD 3-clause license 37 | https://github.com/google/googletest 38 | 39 | Material from husky is: 40 | Copyright (c) 2021 typicode 41 | Licensed under the MIT License 42 | 43 | npm is a registered trademark of npm, Inc. 44 | 45 | Copyright 2025 Sky UK 46 | Licensed under the Apache License, Version 2.0 47 | 48 | A release package with sources for building native (C++) client is prepared from the src/cpp directory, which needs to include the associated license file (Apache-2.0). 49 | 50 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | workflow_dispatch: 8 | push: 9 | branches-ignore: [ main ] 10 | pull_request: 11 | types: 12 | - opened 13 | branches: [ main ] 14 | 15 | permissions: 16 | contents: read # minimal token permissions 17 | security-events: write # required for CodeQL analysis uploads 18 | pull-requests: write 19 | actions: write 20 | statuses: write 21 | env: 22 | HUSKY: 0 23 | # Turns off installing commit hooks in CI environments 24 | 25 | jobs: 26 | build: 27 | 28 | runs-on: ubuntu-latest 29 | 30 | strategy: 31 | matrix: 32 | node-version: [lts/*] 33 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 34 | 35 | steps: 36 | - uses: actions/checkout@v2 37 | with: 38 | submodules: recursive 39 | # CodeQL steps 40 | - name: Initialize CodeQL 41 | uses: github/codeql-action/init@v3 42 | with: 43 | languages: javascript 44 | source-root: src 45 | queries: +security-and-quality 46 | - name: Use Node.js ${{ matrix.node-version }} 47 | uses: actions/setup-node@v4 48 | with: 49 | node-version: ${{ matrix.node-version }} 50 | cache: 'npm' 51 | - run: npm ci 52 | - run: npm run fs:setup 53 | - run: npm run validate:each 54 | - run: npm run compile 55 | - run: npm run slice 56 | - run: npm run validate:compiled 57 | - run: npm run sdks 58 | - run: npm run test 59 | 60 | - name: Perform CodeQL Analysis 61 | uses: github/codeql-action/analyze@v3 62 | with: 63 | category: "/language:javascript" 64 | upload: true -------------------------------------------------------------------------------- /.github/workflows/run-standalone-mfos-tests.yml: -------------------------------------------------------------------------------- 1 | name: MFOS standalone sanity report - CORE,MANAGE,DISCOVERY 2 | 3 | on: 4 | repository_dispatch: 5 | types: [trigger-workflow] 6 | pull_request: 7 | types: 8 | - opened 9 | - synchronize 10 | branches: [ next ] 11 | jobs: 12 | RunStandaloneTests: 13 | if: vars.IGNORE_MFOS != 'true' 14 | permissions: 15 | contents: read # checkout 16 | pull-requests: write # PR updates 17 | # don’t hit the gh api calls, don’t need actions: read. 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v2 22 | 23 | # Set the branch if the workflow is triggered from external 24 | - name: Set PR Branch based on the trigger 25 | id: set-pr-branch 26 | run: | 27 | if [ "${{ github.event_name }}" == "repository_dispatch" ]; then 28 | echo "OPENRPC_PR_BRANCH='${{ github.event.client_payload.OPENRPC_PR_BRANCH }}'" >> $GITHUB_ENV # Set from payload 29 | else 30 | echo "OPENRPC_PR_BRANCH=''" >> $GITHUB_ENV # Clear the variable for other events 31 | fi 32 | 33 | # Run tests 34 | - name: Run Core Manage and Discovery tests and create assets 35 | env: 36 | EVENT_NAME: ${{ github.event_name }} 37 | GITHUB_REF: ${{ github.ref }} 38 | PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} 39 | INTENT: ${{ vars.INTENT }} 40 | OPENRPC_PR_BRANCH: ${{ env.OPENRPC_PR_BRANCH }} # Comes from OPENRPC repo if triggered externally 41 | run: | 42 | ./.github/workflows/utils.sh runTests 43 | 44 | - name: Upload report.json as an artifact 45 | uses: actions/upload-artifact@v4 46 | with: 47 | name: report 48 | path: ${{ github.workspace }}/report 49 | 50 | - name: Get results from report.json 51 | run: | 52 | ./.github/workflows/utils.sh getResults 53 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Lifecycle/include/module.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Comcast Cable Communications Management, LLC 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | * 15 | * SPDX-License-Identifier: Apache-2.0 16 | */ 17 | 18 | #pragma once 19 | 20 | #include "error.h" 21 | #include 22 | /* ${IMPORTS} */ 23 | 24 | ${if.declarations}namespace Firebolt { 25 | namespace ${info.Title} { 26 | 27 | ${if.enums} 28 | // Enums 29 | /* ${ENUMS} */${end.if.enums} 30 | 31 | ${if.types} 32 | // Types 33 | /* ${TYPES} */${end.if.types} 34 | 35 | ${if.providers}/* ${PROVIDERS} */${end.if.providers}${if.xuses}/* ${XUSES} */${end.if.xuses} 36 | 37 | ${if.methods}struct I${info.Title} { 38 | 39 | virtual ~I${info.Title}() = default; 40 | virtual void ready(Firebolt::Error *err = nullptr) = 0; 41 | virtual void finished(Firebolt::Error *err = nullptr) = 0; 42 | virtual std::string state(Firebolt::Error *err = nullptr) = 0; 43 | 44 | // Methods & Events 45 | /* ${METHODS:declarations} */ 46 | };${end.if.methods} 47 | 48 | // Template for mapping enums to strings 49 | template 50 | using EnumMap = std::unordered_map; 51 | 52 | // Function to convert enum values to string representations 53 | template 54 | inline const std::string& ConvertEnum(EnumMap enumMap, T type) 55 | { 56 | return enumMap[type]; 57 | } 58 | 59 | } //namespace ${info.Title} 60 | }${end.if.declarations} 61 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Lifecycle/src/module_impl.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2023 Comcast Cable Communications Management, LLC 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | * 15 | * SPDX-License-Identifier: Apache-2.0 16 | */ 17 | #pragma once 18 | 19 | #include "FireboltSDK.h" 20 | #include "IModule.h" 21 | #include "firebolt.h" 22 | #include "jsondata_lifecycle.h" 23 | #include "${info.title.lowercase}.h" 24 | 25 | /* ${IMPORTS} */ 26 | 27 | 28 | ${if.implementations} 29 | namespace Firebolt { 30 | namespace ${info.Title} { 31 | ${if.enums} 32 | 33 | /* ${ENUMS:json-types} */${end.if.enums} 34 | ${if.types} 35 | // Types 36 | /* ${TYPES:json-types} */${end.if.types} 37 | ${if.methods}class ${info.Title}Impl : public I${info.Title}, public IModule { 38 | 39 | public: 40 | ${info.Title}Impl() = default; 41 | ${info.Title}Impl(const ${info.Title}Impl&) = delete; 42 | ${info.Title}Impl& operator=(const ${info.Title}Impl&) = delete; 43 | ~${info.Title}Impl() override = default; 44 | 45 | std::string currentState = "INITIALIZING"; 46 | 47 | // Methods & Events 48 | /* ${METHODS:declarations-override} */ 49 | 50 | void finished(Firebolt::Error *err = nullptr) override ; 51 | void ready(Firebolt::Error *err = nullptr) override; 52 | std::string state(Firebolt::Error *err = nullptr) override; 53 | 54 | };${end.if.methods} 55 | 56 | } // namespace ${info.Title} 57 | } // namespace Firebolt 58 | ${end.if.implementations} -------------------------------------------------------------------------------- /.github/workflows/utils.cjs: -------------------------------------------------------------------------------- 1 | 2 | async function downloadArtifact(ARTIFACT_ID, JOB_PATH, PR_NUMBER, context, github) { 3 | if (!ARTIFACT_ID) { 4 | console.log("Send the comment to PR and exit the job"); 5 | // Create a comment 6 | const comment = `Failed to create a report:\n Job logs: ${JOB_PATH}`; 7 | 8 | // Post the comment to the pull request 9 | let prcomment = await github.rest.issues.createComment({ 10 | owner: context.repo.owner, 11 | repo: context.repo.repo, 12 | issue_number: PR_NUMBER, 13 | body: comment, 14 | }); 15 | 16 | process.exit(1); 17 | } else { 18 | // Download report.json 19 | let download = await github.rest.actions.downloadArtifact({ 20 | owner: context.repo.owner, 21 | repo: context.repo.repo, 22 | artifact_id: ARTIFACT_ID, 23 | archive_format: 'zip', 24 | }); 25 | 26 | let fs = require('fs'); 27 | fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/report.zip`, Buffer.from(download.data)); 28 | 29 | console.log("Artifact downloaded successfully."); 30 | } 31 | } 32 | 33 | async function createComment(github, context) { 34 | const { issue_number, Passes, Failures, Pending, Skipped, ARTIFACT_URL, JOB_PATH } = process.env; 35 | 36 | const body = ` 37 | MFOS standalone sanity report - CORE,MANAGE,DISCOVERY: 38 | Total: 39 | - Passes: ${Passes} 40 | - Failures: ${Failures} 41 | - Pending: ${Pending} 42 | - Skipped: ${Skipped} 43 | Report JSON/HTML Files: ${ARTIFACT_URL} 44 | Job Logs: ${JOB_PATH} 45 | `; 46 | 47 | const response = await github.rest.issues.createComment({ 48 | owner: context.repo.owner, 49 | repo: context.repo.repo, 50 | issue_number: issue_number, 51 | body: body.trim() 52 | }); 53 | 54 | console.log('Comment updated successfully.'); 55 | } 56 | 57 | module.exports = { downloadArtifact, createComment }; -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/discoveryTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class DiscoveryTest : public ::testing::Test 4 | { 5 | protected: 6 | Firebolt::Error error = Firebolt::Error::None; 7 | }; 8 | 9 | struct SignInSettings : public Firebolt::Discovery::IDiscovery::IOnSignInNotification 10 | { 11 | void onSignIn(const Firebolt::Discovery::Event &) override; 12 | }; 13 | 14 | void SignInSettings::onSignIn(const Firebolt::Discovery::Event &event) 15 | { 16 | std::cout << "onSignIn event fired"; 17 | } 18 | 19 | TEST_F(DiscoveryTest, subscribeOnSignIn) 20 | { 21 | SignInSettings signInSettings; 22 | Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().subscribe(signInSettings, &error); 23 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in subscribing to SignInSettings"; 24 | } 25 | 26 | TEST_F(DiscoveryTest, unsubscribeOnSignIn) 27 | { 28 | SignInSettings signInSettings; 29 | Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().unsubscribe(signInSettings, &error); 30 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in unsubscribing to SignInSettings"; 31 | } 32 | 33 | struct SignOutSettings : public Firebolt::Discovery::IDiscovery::IOnSignOutNotification 34 | { 35 | void onSignOut(const Firebolt::Discovery::Event &) override; 36 | }; 37 | 38 | void SignOutSettings::onSignOut(const Firebolt::Discovery::Event &event) 39 | { 40 | std::cout << "onSignOut event fired"; 41 | } 42 | 43 | TEST_F(DiscoveryTest, subscribeOnSignOut) 44 | { 45 | SignOutSettings signOutSettings; 46 | Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().subscribe(signOutSettings, &error); 47 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in subscribing to SignOutSettings"; 48 | } 49 | 50 | TEST_F(DiscoveryTest, unsubscribeOnSignOut) 51 | { 52 | SignOutSettings signOutSettings; 53 | Firebolt::IFireboltAccessor::Instance().DiscoveryInterface().unsubscribe(signOutSettings, &error); 54 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in unsubscribing to SignOutSettings"; 55 | } 56 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/pinChallengeTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | using namespace Firebolt::PinChallenge; 4 | 5 | struct PinChallengeProvider : public IPinChallengeProvider 6 | { 7 | public: 8 | PinChallengeProvider(); 9 | ~PinChallengeProvider() override = default; 10 | void challenge(const PinChallenge ¶meters, std::unique_ptr session) override; 11 | void SendMessage(bool response); 12 | 13 | private: 14 | void startPinChallengeSession(const PinChallenge ¶meters, std::unique_ptr session); 15 | 16 | private: 17 | std::unique_ptr _session; 18 | PinChallenge _parameters; 19 | bool _challengeInput; 20 | }; 21 | 22 | class PinChallengeTest : public ::testing::Test 23 | { 24 | protected: 25 | JsonEngine *jsonEngine; 26 | Firebolt::Error error = Firebolt::Error::None; 27 | PinChallengeProvider _pinChallengeProvider; 28 | 29 | void SetUp() override 30 | { 31 | jsonEngine = new JsonEngine(); 32 | } 33 | 34 | void TearDown() override 35 | { 36 | delete jsonEngine; 37 | } 38 | }; 39 | 40 | PinChallengeProvider::PinChallengeProvider() 41 | : _session(nullptr), _parameters(), _challengeInput(false) 42 | { 43 | } 44 | 45 | void PinChallengeProvider::SendMessage(bool response) 46 | { 47 | } 48 | 49 | void PinChallengeProvider::challenge(const PinChallenge ¶meters, std::unique_ptr session) 50 | { 51 | std::cout << "PinChallengeProvider challenge is invoked" << std::endl; 52 | startPinChallengeSession(parameters, std::move(session)); 53 | } 54 | 55 | void PinChallengeProvider::startPinChallengeSession(const PinChallenge ¶meters, std::unique_ptr session) 56 | { 57 | _session = std::move(session); 58 | _parameters = parameters; 59 | _challengeInput = true; 60 | } 61 | 62 | TEST_F(PinChallengeTest, registerPinChallengeProvider) 63 | { 64 | Firebolt::IFireboltAccessor::Instance().PinChallengeInterface().provide(_pinChallengeProvider); 65 | } -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/privacy.test.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from "@jest/globals"; 2 | import { Privacy } from "../../build/javascript/src/firebolt-manage"; 3 | 4 | let listenerId: number; 5 | 6 | test("privacy.allowResumePoints()", () => { 7 | return Privacy.allowResumePoints().then((res: boolean) => { 8 | // TODO: fix 9 | expect(true).toBe(true); 10 | }); 11 | }); 12 | 13 | test("privacy.listen() for allowPersonalizationChanged event", () => { 14 | Privacy.once; 15 | return Privacy.listen("allowPersonalizationChanged", () => {}).then( 16 | (res: number) => { 17 | expect(res > 0).toBe(true); 18 | } 19 | ); 20 | }); 21 | 22 | test("privacy.once() for allowPersonalizationChanged event", () => { 23 | Privacy.once; 24 | return Privacy.once("allowPersonalizationChanged", () => {}).then( 25 | (res: number) => { 26 | expect(res > 0).toBe(true); 27 | } 28 | ); 29 | }); 30 | 31 | test("privacy.listen() for allowWatchHistoryChanged event", () => { 32 | Privacy.once; 33 | return Privacy.listen("allowWatchHistoryChanged", () => {}).then( 34 | (res: number) => { 35 | expect(res > 0).toBe(true); 36 | } 37 | ); 38 | }); 39 | 40 | test("privacy.once() for allowWatchHistoryChanged event", () => { 41 | Privacy.once; 42 | return Privacy.once("allowWatchHistoryChanged", () => {}).then( 43 | (res: number) => { 44 | expect(res > 0).toBe(true); 45 | } 46 | ); 47 | }); 48 | 49 | test("privacy.listen() for allowAppContentAdTargetingChanged event", () => { 50 | Privacy.once; 51 | return Privacy.listen("allowAppContentAdTargetingChanged", () => {}).then( 52 | (res: number) => { 53 | expect(res > 0).toBe(true); 54 | } 55 | ); 56 | }); 57 | 58 | test("privacy.once() for allowAppContentAdTargetingChanged event", () => { 59 | Privacy.once; 60 | return Privacy.once("allowAppContentAdTargetingChanged", () => {}).then( 61 | (res: number) => { 62 | expect(res > 0).toBe(true); 63 | } 64 | ); 65 | }); 66 | 67 | test("privacy.clear()", () => { 68 | const result = Privacy.clear(-1000); 69 | expect(result).toBeFalsy(); 70 | }); 71 | -------------------------------------------------------------------------------- /.github/workflows/pr-comment.yml: -------------------------------------------------------------------------------- 1 | name: Comment Artifact URL on PR 2 | 3 | on: 4 | workflow_run: 5 | types: 6 | - "completed" 7 | workflows: 8 | - "MFOS standalone sanity report - CORE,MANAGE,DISCOVERY" 9 | 10 | jobs: 11 | comment-on-pr: 12 | permissions: 13 | contents: read # checkout 14 | pull-requests: write # PR updates 15 | actions: read # required by utils.sh getArtifactData (gh api artifacts) 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v2 20 | 21 | - name: Get Artifact And Job Data 22 | env: 23 | GITHUB_TOKEN: ${{ github.token }} 24 | OWNER: ${{ github.repository_owner }} 25 | REPO: ${{ github.event.repository.name }} 26 | SERVER_URL: ${{ github.server_url }} 27 | GITHUB_REPO: ${{ github.repository }} 28 | WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }} 29 | run: | 30 | ./.github/workflows/utils.sh getArtifactData 31 | 32 | - name: Download an artifact 33 | uses: actions/github-script@v6 34 | with: 35 | script: | 36 | const { downloadArtifact } = require('./.github/workflows/utils.cjs'); 37 | downloadArtifact(process.env.ARTIFACT_ID,process.env.JOB_PATH,process.env.PR_NUMBER,context,github); 38 | 39 | - name: Unzip an artifact 40 | run: | 41 | ./.github/workflows/utils.sh unzipArtifact 42 | 43 | - name: Post a Comment 44 | if: ${{ env.PR_NUMBER != null && env.PR_NUMBER != '' }} 45 | uses: actions/github-script@v6 46 | with: 47 | script: | 48 | const { createComment } = require('./.github/workflows/utils.cjs'); 49 | createComment(github, context); 50 | env: 51 | issue_number: ${{ env.PR_NUMBER }} 52 | Passes: ${{ env.Passes }} 53 | Failures: ${{ env.Failures }} 54 | Pending: ${{ env.Pending }} 55 | Skipped: ${{ env.Skipped }} 56 | ARTIFACT_URL: ${{ env.ARTIFACT_URL }} 57 | JOB_PATH: ${{ env.JOB_PATH }} 58 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/audioDescriptionsTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class AudioDescriptionsTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(AudioDescriptionsTest, enabled) 21 | { 22 | auto expectedValues = jsonEngine->get_value("AudioDescriptions.enabled"); 23 | bool enable = Firebolt::IFireboltAccessor::Instance().AudioDescriptionsInterface().enabled(&error); 24 | 25 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling AudioDescriptions.enabled() method"; 26 | EXPECT_EQ(expectedValues == "true", enable) << "Error: AudioDescriptions.enabled() dose not returns enabled"; 27 | } 28 | 29 | TEST_F(AudioDescriptionsTest, setEnabled) 30 | { 31 | Firebolt::IFireboltAccessor::Instance().AudioDescriptionsInterface().setEnabled(true, &error); 32 | 33 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling AudioDescriptions.setEnabled() method"; 34 | } 35 | 36 | struct EnabledChanged : public Firebolt::AudioDescriptions::IAudioDescriptions::IOnEnabledChangedNotification 37 | { 38 | void onEnabledChanged(const bool) override; 39 | }; 40 | 41 | void EnabledChanged::onEnabledChanged(const bool) 42 | { 43 | std::cout << "onAudioDescriptionEnabledChanged event fired"; 44 | } 45 | 46 | TEST_F(AudioDescriptionsTest, subscribeonEnabledChanged) 47 | { 48 | EnabledChanged enabledChanged; 49 | Firebolt::IFireboltAccessor::Instance().AudioDescriptionsInterface().subscribe(enabledChanged, &error); 50 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in subscribing to EnabledChanged"; 51 | } 52 | 53 | TEST_F(AudioDescriptionsTest, unsubscribeonEnabledChanged) 54 | { 55 | EnabledChanged enabledChanged; 56 | Firebolt::IFireboltAccessor::Instance().AudioDescriptionsInterface().unsubscribe(enabledChanged, &error); 57 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in unsubscribing to EnabledChanged"; 58 | } -------------------------------------------------------------------------------- /requirements/specifications/entities/music.md: -------------------------------------------------------------------------------- 1 | # Music Entities 2 | 3 | Document Status: Proposed Specification 4 | 5 | See [Firebolt Requirements Governance](../../governance.md) for more info. 6 | 7 | | Contributor | Organization | 8 | | --------------- | ------------ | 9 | | Jeremy LaCivita | Comcast | 10 | | Liz Sheffield | Comcast | 11 | 12 | ## 1. Overview 13 | TBD... 14 | 15 | The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL 16 | NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**NOT 17 | RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be 18 | interpreted as described in [BCP 19 | 14](https://www.rfc-editor.org/rfc/rfc2119.txt) [RFC2119] [RFC8174] when, and 20 | only when, they appear in all capitals, as shown here. 21 | 22 | ## 2. Table of Contents 23 | - [1. Overview](#1-overview) 24 | - [2. Table of Contents](#2-table-of-contents) 25 | - [3. Music Entities](#3-music-entities) 26 | - [3.1. Optional Music Entity Properties](#31-optional-music-entity-properties) 27 | 28 | 29 | ## 3. Music Entities 30 | Every Music Entity **MUST** be an [Entity](./index.md#3-entities). 31 | 32 | Every Music Entity **MUST** have a `const` property named `entityType`, which 33 | **MUST** have the value `"music"`. 34 | 35 | Every Music Entity **MUST** have a `string` property named `musicType`, whose 36 | value **MUST** be one of: 37 | 38 | - `"song"` 39 | - `"album"` 40 | 41 | An example Music Entity: 42 | 43 | ```json 44 | { 45 | "entityType": "music", 46 | "musicType": "song", 47 | "entityId": "song/xyz" 48 | } 49 | ``` 50 | 51 | Another example Music Entity: 52 | 53 | ```json 54 | { 55 | "entityType": "music", 56 | "musicType": "album", 57 | "entityId": "album/xyz" 58 | } 59 | ``` 60 | 61 | ### 3.1. Optional Music Entity Properties 62 | A Music Entity **MAY** have a `string` property named `albumId` if its 63 | musicType is `song`, otherwise the entity **MUST NOT** have this property. 64 | 65 | An example Music Entity: 66 | 67 | ```json 68 | { 69 | "entityType": "music", 70 | "musicType": "song", 71 | "entityId": "song/xyz", 72 | "albumId": "album/xyz" 73 | } 74 | ``` 75 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/voiceGuidance.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { VoiceGuidance } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("VoiceGuidance.enabled()", () => { 23 | return VoiceGuidance.enabled().then((res) => { 24 | expect(res).toEqual(true); 25 | }); 26 | }); 27 | 28 | test("VoiceGuidance.speed()", () => { 29 | return VoiceGuidance.speed().then((res: number) => { 30 | expect(res > 0).toBe(true); 31 | }); 32 | }); 33 | 34 | test("VoiceGuidance.listen() for enabledChanged event", () => { 35 | return VoiceGuidance.listen("enabledChanged", () => {}).then( 36 | (res: number) => { 37 | expect(res > 0).toBe(true); 38 | } 39 | ); 40 | }); 41 | 42 | test("VoiceGuidance.once() for enabledChanged event", () => { 43 | return VoiceGuidance.once("enabledChanged", () => {}).then((res: number) => { 44 | expect(res > 0).toBe(true); 45 | }); 46 | }); 47 | 48 | test("VoiceGuidance.listen() for speedChanged event", () => { 49 | return VoiceGuidance.listen("speedChanged", () => {}).then((res: number) => { 50 | expect(res > 0).toBe(true); 51 | }); 52 | }); 53 | 54 | test("VoiceGuidance.once() for speedChanged event", () => { 55 | return VoiceGuidance.once("speedChanged", () => {}).then((res: number) => { 56 | expect(res > 0).toBe(true); 57 | }); 58 | }); 59 | 60 | test("VoiceGuidance.clear()", () => { 61 | const result = VoiceGuidance.clear(-1000); 62 | expect(result).toBeFalsy(); 63 | }); 64 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/secondscreenTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class SecondScreenTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(SecondScreenTest, FriendlyName) 21 | { 22 | nlohmann::json_abi_v3_11_3::json expectedValue = nlohmann::json::parse(jsonEngine->get_value("SecondScreen.friendlyName")); 23 | 24 | auto actualValue = Firebolt::IFireboltAccessor::Instance().SecondScreenInterface().friendlyName(&error); 25 | 26 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve friendlyName from Secondscreen.friendlyName() method"; 27 | EXPECT_EQ(actualValue, expectedValue); 28 | } 29 | 30 | TEST_F(SecondScreenTest, Device) 31 | { 32 | nlohmann::json_abi_v3_11_3::json expectedValue = nlohmann::json::parse(jsonEngine->get_value("SecondScreen.device")); 33 | 34 | auto actualValue = Firebolt::IFireboltAccessor::Instance().SecondScreenInterface().device(std::nullopt, &error); 35 | 36 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve device from Secondscreen.device() method"; 37 | EXPECT_EQ(actualValue, expectedValue); 38 | } 39 | 40 | TEST_F(SecondScreenTest, Protocols) 41 | { 42 | std::string jsonString = jsonEngine->get_value("SecondScreen.protocols"); 43 | 44 | // Check if the JSON string is empty 45 | ASSERT_FALSE(jsonString.empty()) << "JSON string for Secondscreen.protocols is empty"; 46 | 47 | nlohmann::json expectedValues; 48 | try { 49 | expectedValues = nlohmann::json::parse(jsonString); 50 | } catch (const nlohmann::json::parse_error& e) { 51 | FAIL() << "Failed to parse JSON string: " << e.what(); 52 | } 53 | 54 | Firebolt::Types::BooleanMap actualValues = Firebolt::IFireboltAccessor::Instance().SecondScreenInterface().protocols(&error); 55 | 56 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve protocols from Secondscreen.protocols() method"; 57 | EXPECT_EQ(actualValues, expectedValues); 58 | } 59 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/pinChallenge.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { PinChallenge } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | class PCProvider implements PinChallenge.ChallengeProvider { 23 | challenge( 24 | parameters: object, 25 | session: PinChallenge.FocusableProviderSession 26 | ): Promise { 27 | return Promise.resolve(null); 28 | } 29 | } 30 | 31 | test("PinChallenge.provide() declarations", () => { 32 | PinChallenge.provide( 33 | "xrn:firebolt:capability:usergrant:pinchallenge", 34 | new PCProvider() 35 | ); 36 | expect(1).toBe(1); 37 | }); 38 | 39 | test("PinChallenge.provide() with blank object", () => { 40 | expect(() => { 41 | PinChallenge.provide("xrn:firebolt:capability:usergrant:pinchallenge", {}); 42 | }).toThrow(); 43 | }); 44 | 45 | // Events Test cases 46 | 47 | // test("PinChallenge.listen() for requestChallenge event", () => { 48 | // return PinChallenge.listen("requestChallenge", () => {}).then( 49 | // (res: number) => { 50 | // expect(res > 0).toBe(true); 51 | // } 52 | // ); 53 | // }); 54 | 55 | // test("PinChallenge.once() for requestChallenge event", () => { 56 | // return PinChallenge.once("requestChallenge", () => {}).then((res: number) => { 57 | // expect(res > 0).toBe(true); 58 | // }); 59 | // }); 60 | 61 | // test("PinChallenge.clear()", () => { 62 | // const result = PinChallenge.clear(2); 63 | // expect(result).toBeFalsy(); 64 | // }); 65 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/wifi.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Wifi } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("wifi.scan()", () => { 23 | return Wifi.scan().then((res: Wifi.AccessPointList) => { 24 | expect(res).toEqual({ 25 | list: [ 26 | { 27 | frequency: 2.4, 28 | security: "wpa2Psk", 29 | signalStrength: -70, 30 | ssid: "DND", 31 | }, 32 | { 33 | frequency: 5, 34 | security: "WPA2_ENTERPRISE_AES", 35 | signalStrength: -70, 36 | ssid: "Fortnite", 37 | }, 38 | { 39 | frequency: 2.4, 40 | security: "none", 41 | signalStrength: -70, 42 | ssid: "Guardian", 43 | }, 44 | ], 45 | }); 46 | }); 47 | }); 48 | 49 | test("Wifi.connect()", () => { 50 | return Wifi.connect().then((res: Wifi.AccessPoint) => { 51 | expect(res).toEqual({ 52 | frequency: 2.4, 53 | security: "wpa2Psk", 54 | signalStrength: -70, 55 | ssid: "DND", 56 | }); 57 | }); 58 | }); 59 | 60 | test("Wifi.disconnect()", () => { 61 | return Wifi.disconnect().then((res) => { 62 | expect(res).toEqual(null); 63 | }); 64 | }); 65 | 66 | test("Wifi.wps()", () => { 67 | return Wifi.wps().then((res: Wifi.AccessPoint) => { 68 | expect(res).toEqual({ 69 | frequency: 2.4, 70 | security: "wpa2Psk", 71 | signalStrength: -70, 72 | ssid: "DND", 73 | }); 74 | }); 75 | }); 76 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/securestorage.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the 'License'); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an 'AS IS' BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { SecureStorage } from "../../build/javascript/src/firebolt"; 21 | 22 | const value = "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" 23 | const authTokenKey = "authRefreshToken" 24 | 25 | test("get() for type Device", () => { 26 | return SecureStorage.get(SecureStorage.StorageScope.DEVICE, authTokenKey).then((securestorage) => { 27 | expect(securestorage).toBe(value); 28 | }); 29 | }); 30 | 31 | test("get() for type Account", () => { 32 | return SecureStorage.get(SecureStorage.StorageScope.ACCOUNT, authTokenKey).then((securestorage) => { 33 | expect(securestorage).toBe(value); 34 | }); 35 | }); 36 | 37 | test("set() for type device", () => { 38 | return SecureStorage.set(SecureStorage.StorageScope.DEVICE, authTokenKey, value, { 39 | ttl: 600 40 | }).then((res) => { 41 | expect(res).toEqual(null); 42 | }); 43 | }); 44 | 45 | test("set() for type account", () => { 46 | return SecureStorage.set(SecureStorage.StorageScope.ACCOUNT, authTokenKey, value).then((res) => { 47 | expect(res).toEqual(null); 48 | }); 49 | }); 50 | 51 | test("remove() for type device", () => { 52 | return SecureStorage.remove(SecureStorage.StorageScope.DEVICE, authTokenKey).then((res) => { 53 | expect(res).toEqual(null); 54 | }); 55 | }); 56 | 57 | test("remove() for type account", () => { 58 | return SecureStorage.remove(SecureStorage.StorageScope.ACCOUNT, authTokenKey).then((res) => { 59 | expect(res).toEqual(null); 60 | }); 61 | }); -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/CoreSDKTestStaticCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | #include 21 | 22 | namespace FireboltSDK { 23 | class Policy : public WPEFramework::Core::JSON::Container { 24 | public: 25 | Policy(const Policy& copy) = delete; 26 | Policy() 27 | : WPEFramework::Core::JSON::Container() 28 | , EnableRecommendations(false) 29 | , ShareWatchHistory(false) 30 | , RememberWatchedPrograms(false) 31 | { 32 | Add(_T("enableRecommendations"), &EnableRecommendations); 33 | Add(_T("shareWatchHistory"), &ShareWatchHistory); 34 | Add(_T("rememberWatchedPrograms"), &RememberWatchedPrograms); 35 | } 36 | Policy& operator=(const Policy& RHS) 37 | { 38 | EnableRecommendations = RHS.EnableRecommendations; 39 | ShareWatchHistory = RHS.ShareWatchHistory; 40 | RememberWatchedPrograms = RHS.RememberWatchedPrograms; 41 | 42 | return (*this); 43 | } 44 | 45 | ~Policy() override = default; 46 | 47 | public: 48 | WPEFramework::Core::JSON::Boolean EnableRecommendations; 49 | WPEFramework::Core::JSON::Boolean ShareWatchHistory; 50 | WPEFramework::Core::JSON::Boolean RememberWatchedPrograms; 51 | }; 52 | 53 | class CoreTestStaticCode : public Tests { 54 | 55 | public: 56 | CoreTestStaticCode(); 57 | ~CoreTestStaticCode() override = default; 58 | 59 | static Firebolt::Error GetCountryCode(); 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/ManageSDKTestStaticCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #pragma once 20 | #include 21 | 22 | namespace FireboltSDK { 23 | class Policy : public WPEFramework::Core::JSON::Container { 24 | public: 25 | Policy(const Policy& copy) = delete; 26 | Policy() 27 | : WPEFramework::Core::JSON::Container() 28 | , EnableRecommendations(false) 29 | , ShareWatchHistory(false) 30 | , RememberWatchedPrograms(false) 31 | { 32 | Add(_T("enableRecommendations"), &EnableRecommendations); 33 | Add(_T("shareWatchHistory"), &ShareWatchHistory); 34 | Add(_T("rememberWatchedPrograms"), &RememberWatchedPrograms); 35 | } 36 | Policy& operator=(const Policy& RHS) 37 | { 38 | EnableRecommendations = RHS.EnableRecommendations; 39 | ShareWatchHistory = RHS.ShareWatchHistory; 40 | RememberWatchedPrograms = RHS.RememberWatchedPrograms; 41 | 42 | return (*this); 43 | } 44 | 45 | ~Policy() override = default; 46 | 47 | public: 48 | WPEFramework::Core::JSON::Boolean EnableRecommendations; 49 | WPEFramework::Core::JSON::Boolean ShareWatchHistory; 50 | WPEFramework::Core::JSON::Boolean RememberWatchedPrograms; 51 | }; 52 | 53 | class ManageTestStaticCode : public Tests { 54 | 55 | public: 56 | ManageTestStaticCode(); 57 | ~ManageTestStaticCode() override = default; 58 | 59 | static Firebolt::Error GetCountryCode(); 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/acknowledgeChallengeTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | using namespace Firebolt::AcknowledgeChallenge; 4 | 5 | struct AcknowledgeChallengeProvider : public IAcknowledgeChallengeProvider 6 | { 7 | AcknowledgeChallengeProvider(); 8 | ~AcknowledgeChallengeProvider() override = default; 9 | void SendMessage(bool response); 10 | void challenge(const Challenge ¶meters, std::unique_ptr session) override; 11 | 12 | private: 13 | void startAcknowledgeChallengeSession(const Challenge ¶meters, std::unique_ptr session); 14 | 15 | private: 16 | std::unique_ptr _session; 17 | Challenge _parameters; 18 | bool _challengeInput; 19 | }; 20 | 21 | class AcknowledgeChallengeTest : public ::testing::Test 22 | { 23 | protected: 24 | JsonEngine *jsonEngine; 25 | Firebolt::Error error = Firebolt::Error::None; 26 | AcknowledgeChallengeProvider _acknowledgeChallengeProvider; 27 | 28 | void SetUp() override 29 | { 30 | jsonEngine = new JsonEngine(); 31 | } 32 | 33 | void TearDown() override 34 | { 35 | delete jsonEngine; 36 | } 37 | }; 38 | 39 | AcknowledgeChallengeProvider::AcknowledgeChallengeProvider() 40 | : _session(nullptr), _parameters(), _challengeInput(false) 41 | { 42 | } 43 | 44 | void AcknowledgeChallengeProvider::SendMessage(bool response) 45 | { 46 | } 47 | 48 | void AcknowledgeChallengeProvider::startAcknowledgeChallengeSession(const Firebolt::AcknowledgeChallenge::Challenge ¶meters, std::unique_ptr session) 49 | { 50 | _session = std::move(session); 51 | _parameters = parameters; 52 | _challengeInput = true; 53 | } 54 | 55 | void AcknowledgeChallengeProvider::challenge(const Challenge ¶meters, std::unique_ptr session) 56 | { 57 | std::cout << "AcknowledgeChallengeProvider challenge is invoked" << std::endl; 58 | startAcknowledgeChallengeSession(parameters, std::move(session)); 59 | } 60 | 61 | TEST_F(AcknowledgeChallengeTest, registerAcknowledgeChallengeProvider) 62 | { 63 | Firebolt::IFireboltAccessor::Instance().AcknowledgeChallengeInterface().provide(_acknowledgeChallengeProvider); 64 | } 65 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/keyboardTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class KeyboardTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | 19 | struct KeyboardAsyncResponse : public Firebolt::Keyboard::IKeyboardAsyncResponse { 20 | void response(const std::string& result, Firebolt::Error *err) override { 21 | // Handle the response here 22 | std::cout << "Response received: " << result << std::endl; 23 | } 24 | }; 25 | }; 26 | 27 | TEST_F(KeyboardTest, Email) 28 | { 29 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Keyboard.email")); 30 | 31 | Firebolt::Keyboard::EmailUsage type = Firebolt::Keyboard::EmailUsage::SIGN_IN; 32 | std::string message = "abc@123.com"; 33 | KeyboardAsyncResponse responseHandler; 34 | 35 | Firebolt::IFireboltAccessor::Instance().KeyboardInterface().requestEmail(type, message, responseHandler, &error); 36 | 37 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to call keyboard.email() method"; 38 | } 39 | 40 | TEST_F(KeyboardTest, Password) 41 | { 42 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Keyboard.password")); 43 | 44 | std::string message = "abc123"; 45 | KeyboardAsyncResponse responseHandler; 46 | 47 | Firebolt::IFireboltAccessor::Instance().KeyboardInterface().requestPassword(message, responseHandler, &error); 48 | 49 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to call keyboard.password() method"; 50 | } 51 | 52 | TEST_F(KeyboardTest, Standard) 53 | { 54 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Keyboard.standard")); 55 | 56 | std::string message = "hello world"; 57 | KeyboardAsyncResponse responseHandler; 58 | 59 | Firebolt::IFireboltAccessor::Instance().KeyboardInterface().requestStandard(message, responseHandler, &error); 60 | 61 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to call keyboard.standard() method"; 62 | } -------------------------------------------------------------------------------- /src/schemas/discovery.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://meta.comcast.com/firebolt/discovery", 3 | "title": "Discovery", 4 | "anyOf": [ 5 | { 6 | "$ref": "#/definitions/PurchasedContentResult" 7 | } 8 | ], 9 | "definitions": { 10 | "PurchasedContentResult": { 11 | "title": "PurchasedContentResult", 12 | "type": "object", 13 | "properties": { 14 | "expires": { 15 | "type": "string", 16 | "format": "date-time" 17 | }, 18 | "totalCount": { 19 | "type": "integer", 20 | "minimum": 0 21 | }, 22 | "entries": { 23 | "type": "array", 24 | "items": { 25 | "$ref": "https://meta.comcast.com/firebolt/entertainment#/definitions/EntityInfo" 26 | } 27 | } 28 | }, 29 | "required": [ 30 | "expires", 31 | "totalCount", 32 | "entries" 33 | ], 34 | "additionalProperties": false 35 | }, 36 | "EntityInfoResult": { 37 | "title": "EntityInfoResult", 38 | "description": "The result for an `entityInfo()` push or pull.", 39 | "type": "object", 40 | "properties": { 41 | "expires": { 42 | "type": "string", 43 | "format": "date-time" 44 | }, 45 | "entity": { 46 | "$ref": "https://meta.comcast.com/firebolt/entertainment#/definitions/EntityInfo" 47 | }, 48 | "related": { 49 | "type": "array", 50 | "items": { 51 | "$ref": "https://meta.comcast.com/firebolt/entertainment#/definitions/EntityInfo" 52 | } 53 | } 54 | }, 55 | "required": [ 56 | "expires", 57 | "entity" 58 | ], 59 | "additionalProperties": false 60 | }, 61 | "InterestType": { 62 | "title": "InterestType", 63 | "type": "string", 64 | "enum": [ 65 | "interest", 66 | "disinterest" 67 | ] 68 | }, 69 | "InterestReason": { 70 | "title": "InterestReason", 71 | "type": "string", 72 | "enum": [ 73 | "playlist", 74 | "reaction", 75 | "recording" 76 | ] 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/sdks/core/src/js/sdk/Lifecycle/defaults.mjs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import MockTransport from '../Transport/MockTransport.mjs' 20 | 21 | let inactive = 0 /* ${EXAMPLE:onInactive} */ 22 | let foreground = 0 /* ${EXAMPLE:onForeground} */ 23 | let background = 0 /* ${EXAMPLE:onBackground} */ 24 | let suspended = 0 /* ${EXAMPLE:onSuspended} */ 25 | let unloading = 0 /* ${EXAMPLE:onUnloading} */ 26 | 27 | const emit = (value) => { 28 | MockTransport.event('Lifecycle', value.state, value) 29 | } 30 | 31 | const win = typeof window !== 'undefined' ? window : {} 32 | const automation = win.__firebolt ? !!win.__firebolt.automation : false 33 | 34 | export default { 35 | ready: function() { 36 | inactive.previous = 'initializing' 37 | setTimeout(() => emit(inactive), automation ? 1 : 500) 38 | foreground.previous = 'inactive' 39 | setTimeout(() => emit(foreground), automation ? 2 : 1000) 40 | }, 41 | 42 | close: function(params) { 43 | let reason = params.reason 44 | if (reason === 'remoteButton') { 45 | inactive.previous = 'foreground' 46 | setTimeout(() => emit(inactive), automation ? 1 : 500) 47 | } 48 | else if (['userExit', 'error'].includes(reason)) { 49 | inactive.previous = 'foreground' 50 | unloading.previous = 'inactive' 51 | setTimeout(() => emit(inactive), automation ? 1 : 500) 52 | setTimeout(() => emit(unloading), automation ? 2 : 1000) 53 | } 54 | else { 55 | throw "Invalid close reason" 56 | } 57 | }, 58 | 59 | finished: function() { 60 | if (win.location) 61 | win.location.href = "about:blank" 62 | }, 63 | } 64 | 65 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/authenticationTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class AuthenticationTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | TEST_F(AuthenticationTest, Token) 21 | { 22 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Authentication.token")); 23 | 24 | Firebolt::Authentication::TokenType type = Firebolt::Authentication::TokenType::DEVICE; 25 | std::optional options; 26 | 27 | auto token = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().token(type, options, &error); 28 | 29 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve token from Authentication.token() method"; 30 | EXPECT_EQ(token.value, expectedValues["value"]); 31 | } 32 | 33 | TEST_F(AuthenticationTest, Device) 34 | { 35 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Authentication.device")); 36 | 37 | std::string device = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().device(&error); 38 | 39 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve device from Authentication.device() method"; 40 | EXPECT_EQ(device, expectedValues); 41 | } 42 | 43 | TEST_F(AuthenticationTest, Session) 44 | { 45 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Authentication.session")); 46 | 47 | std::string session = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().session(&error); 48 | 49 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve session from Authentication.session() method"; 50 | EXPECT_EQ(session, expectedValues); 51 | } 52 | 53 | TEST_F(AuthenticationTest, Root) 54 | { 55 | nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse(jsonEngine->get_value("Authentication.root")); 56 | 57 | std::string root = Firebolt::IFireboltAccessor::Instance().AuthenticationInterface().root(&error); 58 | 59 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to retrieve root from Authentication.root() method"; 60 | EXPECT_EQ(root, expectedValues); 61 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/cpptest/unit/securestorageTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class SecureStorageTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | // Check enum issue with test app verse actual transport 21 | TEST_F(SecureStorageTest, Get) 22 | { 23 | auto expectedValue = jsonEngine->get_value("SecureStorage.get"); 24 | 25 | Firebolt::SecureStorage::StorageScope scope = Firebolt::SecureStorage::StorageScope::DEVICE; 26 | 27 | std::string actualValue = Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().get(scope, "authRefreshToken", &error); 28 | 29 | EXPECT_EQ(expectedValue, actualValue); 30 | } 31 | 32 | TEST_F(SecureStorageTest, Set) 33 | { 34 | // Call setter to set the value 35 | Firebolt::SecureStorage::StorageScope scope = Firebolt::SecureStorage::StorageScope::DEVICE; 36 | std::string expectedValue = "123456"; 37 | Firebolt::SecureStorage::StorageOptions options; 38 | options.ttl = 6.0; 39 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().set(scope, "authRefreshToken", expectedValue, options, &error); 40 | 41 | // Check if there was an error during the set operation 42 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to set value in SecureStorage.set() method"; 43 | } 44 | 45 | TEST_F(SecureStorageTest, Remove) 46 | { 47 | Firebolt::SecureStorage::StorageScope scope = Firebolt::SecureStorage::StorageScope::DEVICE; 48 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().remove(scope, "authRefreshToken", &error); 49 | 50 | // Check if there was an error during the remove operation 51 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to remove value in SecureStorage.remove() method"; 52 | } 53 | 54 | TEST_F(SecureStorageTest, Clear) 55 | { 56 | Firebolt::SecureStorage::StorageScope scope = Firebolt::SecureStorage::StorageScope::DEVICE; 57 | Firebolt::IFireboltAccessor::Instance().SecureStorageInterface().clear(scope, &error); 58 | 59 | // Check if there was an error during the clear operation 60 | EXPECT_EQ(error, Firebolt::Error::None) << "Failed to clear value in SecureStorage.clear() method"; 61 | } 62 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/localization.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Localization } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("Localization.locality()", () => { 23 | return Localization.locality().then((res: string) => { 24 | expect(res).toBe("Philadelphia"); 25 | }); 26 | }); 27 | 28 | test("Localization.countryCode()", () => { 29 | return Localization.countryCode().then((res: string) => { 30 | expect(res).toBe("US"); 31 | }); 32 | }); 33 | 34 | test("Localization.language()", () => { 35 | return Localization.language().then((res: string) => { 36 | expect(res).toBe("en"); 37 | }); 38 | }); 39 | 40 | test("Localization.locale()", () => { 41 | return Localization.locale().then((res: string) => { 42 | expect(res).toBe("en-US"); 43 | }); 44 | }); 45 | 46 | test("Localization.locale()", () => { 47 | return Localization.locale().then((res: string) => { 48 | expect(res).toBe("en-US"); 49 | }); 50 | }); 51 | 52 | test("Localization.listen()", () => { 53 | return Localization.listen("localityChanged", () => {}).then( 54 | (res: Number) => { 55 | expect(res > 0).toBe(true); 56 | } 57 | ); 58 | }); 59 | 60 | test("Localization.once()", () => { 61 | return Localization.once("localityChanged", () => {}).then((res: Number) => { 62 | expect(res > 0).toBe(true); 63 | }); 64 | }); 65 | 66 | test("Localization.clear()", () => { 67 | const result = Localization.clear(-1000); 68 | expect(result).toBeFalsy(); 69 | }); 70 | 71 | test("Device.postalCode()", () => { 72 | return Localization.postalCode().then((res: string) => { 73 | expect(res).toEqual("19103"); 74 | }); 75 | }); 76 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/acknowledgeChallenge.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { AcknowledgeChallenge } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | class ACKPovider implements AcknowledgeChallenge.ChallengeProvider { 23 | challenge( 24 | parameters: object, 25 | session: AcknowledgeChallenge.FocusableProviderSession 26 | ): Promise { 27 | return Promise.resolve(null); 28 | } 29 | } 30 | 31 | test("AcknowledgeChallenge.provide() declarations", () => { 32 | AcknowledgeChallenge.provide( 33 | "xrn:firebolt:capability:usergrant:acknowledgechallenge", 34 | new ACKPovider() 35 | ); 36 | expect(1).toBe(1); 37 | }); 38 | 39 | test("AcknowledgeChallenge.provide() with blank object", () => { 40 | expect(() => { 41 | AcknowledgeChallenge.provide( 42 | "xrn:firebolt:capability:usergrant:acknowledgechallenge", 43 | {} 44 | ); 45 | }).toThrow(); 46 | }); 47 | 48 | // Events Test cases 49 | 50 | // test("AcknowledgeChallenge.listen() for requestChallenge event", () => { 51 | // return AcknowledgeChallenge.listen("requestChallenge", () => {}).then( 52 | // (res: number) => { 53 | // expect(res > 0).toBe(true); 54 | // } 55 | // ); 56 | // }); 57 | 58 | // test("AcknowledgeChallenge.once() for requestChallenge event", () => { 59 | // return AcknowledgeChallenge.once("requestChallenge", () => {}).then( 60 | // (res: number) => { 61 | // expect(res > 0).toBe(true); 62 | // } 63 | // ); 64 | // }); 65 | 66 | // test("AcknowledgeChallenge.clear()", () => { 67 | // const result = AcknowledgeChallenge.clear(2); 68 | // expect(result).toBeFalsy(); 69 | // }); 70 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/accessibility.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from '@jest/globals'; 20 | import { Accessibility } from '../../build/javascript/src/firebolt'; 21 | 22 | 23 | test('listen', () => { 24 | return Accessibility.listen((event: string, data: object) => { }).then((res: number) => { 25 | expect(res > 0).toBe(true); 26 | }); 27 | }); 28 | 29 | 30 | test('once', () => { 31 | return Accessibility.once((event: string, data: object) => { }).then((res: number) => { 32 | expect(res > 0).toBe(true); 33 | }); 34 | }); 35 | 36 | 37 | test('listen ClosedCaptionsSettings', () => { 38 | return Accessibility.listen((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.ClosedCaptionsSettings }) => { }).then((res: number) => { 39 | expect(res > 0).toBe(true); 40 | }); 41 | }); 42 | 43 | test('once ClosedCaptionsSettings', () => { 44 | return Accessibility.once((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.ClosedCaptionsSettings }) => { }).then((res: number) => { 45 | expect(res > 0).toBe(true); 46 | }); 47 | }); 48 | 49 | test('listen VoiceGuidanceSettings', () => { 50 | return Accessibility.listen((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.VoiceGuidanceSettings }) => { }).then((res: number) => { 51 | expect(res > 0).toBe(true); 52 | }); 53 | }); 54 | 55 | test('once VoiceGuidanceSettings', () => { 56 | return Accessibility.once((event: 'closedCaptionsSettingsChanged', listener: { data: Accessibility.VoiceGuidanceSettings }) => { }).then((res: number) => { 57 | expect(res > 0).toBe(true); 58 | }); 59 | }); 60 | 61 | 62 | test('clear()', () => { 63 | const result: boolean = Accessibility.clear(-1000); 64 | expect(result).toBeFalsy(); 65 | }); 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/sdks/manage/test/suite/hdmi-input.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { HDMIInput } from "../../build/javascript/src/firebolt-manage"; 21 | 22 | test("HDMIInput.ports()", () => { 23 | return HDMIInput.ports().then((ports: HDMIInput.HDMIInputPort[]) => { 24 | expect(ports[0].edidVersion).toBe(HDMIInput.EDIDVersion.V2_0) 25 | }); 26 | }); 27 | 28 | test("HDMIInput.port('HDMI1)", () => { 29 | return HDMIInput.port('HDMI1').then((port: HDMIInput.HDMIInputPort) => { 30 | expect(port.edidVersion).toBe(HDMIInput.EDIDVersion.V2_0) 31 | }); 32 | }); 33 | 34 | test("HDMIInput.edidVersion()", () => { 35 | return HDMIInput.edidVersion('HDMI1').then((version: HDMIInput.EDIDVersion) => { 36 | expect(version).toBe(HDMIInput.EDIDVersion.V2_0) 37 | }) 38 | }) 39 | 40 | test("HDMIInput.onConnectionChanged()", () => { 41 | return HDMIInput.listen('connectionChanged', (info: HDMIInput.ConnectionChangedInfo) => { 42 | }).then( (id: number) => { 43 | expect(typeof id).toBe('number') 44 | }) 45 | }) 46 | 47 | test("HDMIInput.onSignalChanged()", () => { 48 | return HDMIInput.listen('signalChanged', (info: HDMIInput.SignalChangedInfo) => { 49 | }).then( (id: number) => { 50 | expect(typeof id).toBe('number') 51 | }) 52 | }) 53 | 54 | test("HDMIInput.autoLowLatencyModeCapable('HDMI1)", () => { 55 | return HDMIInput.autoLowLatencyModeCapable('HDMI1').then((capable: boolean) => { 56 | expect(capable).toBe(true) 57 | }) 58 | }) 59 | 60 | test("HDMIInput.autoLowLatencyModeCapable() subscriber", () => { 61 | return HDMIInput.autoLowLatencyModeCapable((info: HDMIInput.AutoLowLatencyModeCapableChangedInfo) => { 62 | }).then((id: number) => { 63 | expect(typeof id).toBe('number') 64 | }) 65 | }) 66 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/declarations.test.ts: -------------------------------------------------------------------------------- 1 | import Setup from "../../../../../test/Setup" 2 | import { sent } from "../../../../../test/Setup" 3 | 4 | import { test, expect } from "@jest/globals" 5 | import { Lifecycle, Device, Discovery } from "../../build/javascript/src/firebolt"; 6 | 7 | let listenerId:number 8 | 9 | test('Able to get TypeScript listenerId', () => { 10 | return Lifecycle.listen('inactive', () => {}).then((id:number) => { 11 | listenerId = id 12 | expect(listenerId > 0).toBe(true) 13 | }) 14 | }) 15 | 16 | test('Able to get resolution', () => { 17 | return Device.screenResolution().then( (res:[number, number]) => { 18 | expect(res[0]>0).toBe(true) 19 | expect(res[1]>0).toBe(true) 20 | }) 21 | }) 22 | 23 | test('purchaseContent', () => { 24 | return Discovery.purchasedContent({ 25 | expires: '', 26 | totalCount: 5, 27 | entries: [ 28 | ] 29 | }).then(() => { 30 | let result:Discovery.PurchasedContentResult = sent.find(message => message.method === 'purchasedContent').params.result 31 | expect(result.totalCount).toBe(5) 32 | expect(typeof result.totalCount).toBe('number') 33 | }) 34 | }) 35 | 36 | const result: Discovery.EntityInfoResult = { 37 | entity: { 38 | "entityType": "program", 39 | "identifiers": { 40 | "entityId": "123" 41 | }, 42 | "programType": Discovery.ProgramType.MOVIE, 43 | "title": "A title" 44 | }, 45 | "expires": "" 46 | } 47 | 48 | test('entityInfo', () => { 49 | 50 | return Discovery.entityInfo(result).then(() => { 51 | let result:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result 52 | expect(result.entity.identifiers.entityId).toBe("123") 53 | }) 54 | }) 55 | 56 | test('entityInfo pull', () => { 57 | let resolver 58 | const p = new Promise((resolve, reject) => { 59 | resolver = resolve 60 | }) 61 | 62 | Discovery.entityInfo( (request: Discovery.EntityInfoParameters) => { 63 | setTimeout( _ => { 64 | resolver() 65 | }, 1000) 66 | 67 | return Promise.resolve(result) 68 | }) 69 | 70 | Setup.emit('discovery', 'pullEntityInfo', { 71 | correlationId: '123', 72 | parameters: { 73 | entityId: '123' 74 | } 75 | }) 76 | 77 | let result2:Discovery.EntityInfoResult = sent.find(message => message.method === 'entityInfo').params.result 78 | expect(result2.entity.identifiers.entityId).toBe("123") 79 | 80 | return p 81 | }) -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/templates/Device/src/module_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include "${info.title.lowercase}_impl.h" 20 | 21 | ${if.implementations} 22 | namespace Firebolt { 23 | namespace ${info.Title} { 24 | ${if.providers} 25 | /* ${PROVIDERS} */${end.if.providers} 26 | std::string ${info.Title}Impl::version(Firebolt::Error *err) const 27 | { 28 | JsonObject jsonParameters; 29 | JsonData_DeviceVersion jsonResult; 30 | std::string version; 31 | 32 | Firebolt::Error status = Firebolt::Error::NotConnected; 33 | FireboltSDK::Transport* transport = FireboltSDK::Accessor::Instance().GetTransport(); 34 | if (transport != nullptr) { 35 | 36 | status = transport->Invoke("${info.title.lowercase}.version", jsonParameters, jsonResult); 37 | if (status == Firebolt::Error::None) { 38 | !jsonResult.IsSet() ? jsonResult.Clear() : (void)0; 39 | !jsonResult.Sdk.IsSet() ? jsonResult.Sdk.Clear() : (void)0; 40 | jsonResult.Sdk.Major = static_cast(${major}); 41 | jsonResult.Sdk.Minor = static_cast(${minor}); 42 | jsonResult.Sdk.Patch = static_cast(${patch}); 43 | jsonResult.Sdk.Readable = "${readable}"; 44 | jsonResult.ToString(version); 45 | } 46 | 47 | } else { 48 | FIREBOLT_LOG_ERROR(FireboltSDK::Logger::Category::OpenRPC, FireboltSDK::Logger::Module(), "Error in getting Transport err = %d", status); 49 | } 50 | return version; 51 | } 52 | // Methods 53 | /* ${METHODS} */ 54 | 55 | // Events 56 | /* ${EVENTS} */ 57 | 58 | }//namespace ${info.Title} 59 | }${end.if.implementations} 60 | ${if.enums} 61 | 62 | namespace WPEFramework { 63 | 64 | /* ${ENUMS} */ 65 | }${end.if.enums} -------------------------------------------------------------------------------- /src/openrpc/_internal.json: -------------------------------------------------------------------------------- 1 | { 2 | "openrpc": "1.2.4", 3 | "info": { 4 | "title": "Internal", 5 | "description": "Internal methods for SDK / FEE integration", 6 | "version": "0.0.0" 7 | }, 8 | "methods": [ 9 | { 10 | "name": "initialize", 11 | "tags": [ 12 | { 13 | "name": "rpc-only" 14 | }, 15 | { 16 | "name": "capabilities", 17 | "x-uses": [ 18 | "xrn:firebolt:capability:lifecycle:initialize" 19 | ] 20 | } 21 | ], 22 | "summary": "Initialize the SDK / FEE session.", 23 | "description": "A single version of the Firebolt SDK is compiled into each app. When an app starts up, the SDK **MUST** call this method as soon as possible and **before** any other JSON-RPC methods are sent.", 24 | "params": [ 25 | { 26 | "name": "version", 27 | "required": true, 28 | "schema": { 29 | "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion" 30 | }, 31 | "summary": "The semantic version of the SDK." 32 | } 33 | ], 34 | "result": { 35 | "name": "session", 36 | "summary": "Info about the SDK/FEE session", 37 | "schema": { 38 | "$ref": "#/components/schemas/InitializeResult" 39 | } 40 | }, 41 | "examples": [ 42 | { 43 | "name": "Default Example", 44 | "params": [ 45 | { 46 | "name": "version", 47 | "value": { 48 | "major": 1, 49 | "minor": 0, 50 | "patch": 0, 51 | "readable": "Firebolt SDK 1.0.0" 52 | } 53 | } 54 | ], 55 | "result": { 56 | "name": "Default Result", 57 | "value": { 58 | "version": { 59 | "major": 1, 60 | "minor": 0, 61 | "patch": 0, 62 | "readable": "Firebolt FEE 1.0.0" 63 | } 64 | } 65 | } 66 | } 67 | ] 68 | } 69 | ], 70 | "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 | } 85 | } 86 | } -------------------------------------------------------------------------------- /.github/workflows/merge-to-next-major.yml: -------------------------------------------------------------------------------- 1 | name: Attempt to merge next to next-major 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - 'next' 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | # Check if next can merge into next-major 12 | perform_merge: 13 | name: Perform merge if "next" can merge into "next-major" 14 | permissions: 15 | contents: write #because we push - git push origin "next-major" 16 | pull-requests: write # PR updates 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | with: 22 | fetch-depth: 0 23 | repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} 24 | persist-credentials: true 25 | 26 | # Set user identity 27 | - name: Set-Identity 28 | run: | 29 | git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}" 30 | git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}" 31 | 32 | # Checkout "next-major" 33 | - name: Checkout next-major 34 | run: git checkout "next-major" 35 | 36 | # Get the "next-major" version number 37 | - name: Extract next-major version 38 | id: extract_version 39 | run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" 40 | 41 | # Checkout "next" 42 | - name: Checkout next 43 | run: git checkout "next" 44 | 45 | # Update "next" version to match "next-major" 46 | - name: Update "next" version to match "next-major" 47 | run: | 48 | jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json 49 | 50 | if diff -q "package.json" "temp.json" >/dev/null; then 51 | echo "Versions are identical. No change required." 52 | rm temp.json 53 | else 54 | mv temp.json package.json 55 | git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}" 56 | fi 57 | 58 | # Checkout "next-major" 59 | - name: Checkout next-major 60 | run: git checkout "next-major" 61 | 62 | - name: Perform the merge from next to next-major 63 | run: | 64 | git merge next 65 | git push origin "next-major" 66 | echo "Push to next-major succeeded" 67 | 68 | # If the merge cannot be performed, let stakeholders know 69 | message_on_failure: 70 | name: Merge failure 71 | needs: perform_merge 72 | runs-on: ubuntu-latest 73 | if: ${{ failure() }} 74 | 75 | steps: 76 | - name: Post error message (To-Do) 77 | run: echo "Next cannot be merged into next-major cleanly" 78 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/metrics.test.ts: -------------------------------------------------------------------------------- 1 | 2 | import { test, expect } from '@jest/globals'; 3 | import { Metrics } from '../../build/javascript/src/firebolt'; 4 | 5 | 6 | test('startContent', () => { 7 | return Metrics.startContent().then((res:boolean) => { 8 | expect(res).toBe(true); 9 | }); 10 | }); 11 | 12 | test('stopContent', () => { 13 | return Metrics.stopContent().then((res:boolean) => { 14 | expect(res).toBe(true); 15 | }); 16 | }); 17 | 18 | 19 | test('mediaLoadStart', () => { 20 | return Metrics.mediaLoadStart('string').then((res:boolean) => { 21 | expect(res).toBe(true); 22 | }); 23 | }); 24 | 25 | test('mediaPlay', () => { 26 | return Metrics.mediaPlay('string').then((res:boolean) => { 27 | expect(res).toBe(true); 28 | }); 29 | }); 30 | 31 | test('mediaPlaying', () => { 32 | return Metrics.mediaPlaying('string').then((res:boolean) => { 33 | expect(res).toBe(true); 34 | }); 35 | }); 36 | 37 | test('mediaPause', () => { 38 | return Metrics.mediaPause('string').then((res:boolean) => { 39 | expect(res).toBe(true); 40 | }); 41 | }); 42 | 43 | test('mediaWaiting', () => { 44 | return Metrics.mediaWaiting('string').then((res:boolean) => { 45 | expect(res).toBe(true); 46 | }); 47 | }); 48 | 49 | 50 | test('mediaProgress', () => { 51 | return Metrics.mediaProgress( 'string', 2).then((res:boolean) => { 52 | expect(res).toBe(true); 53 | }); 54 | }); 55 | 56 | 57 | test('mediaSeeking', () => { 58 | return Metrics.mediaSeeking(('string')).then((res:boolean) => { 59 | expect(res).toBe(true); 60 | }); 61 | }); 62 | 63 | 64 | test('mediaSeeked', () => { 65 | return Metrics.mediaSeeked(('string')).then((res:boolean) => { 66 | expect(res).toBe(true); 67 | }); 68 | }); 69 | 70 | test('mediaRateChange', () => { 71 | return Metrics.mediaRateChange('string', 5).then((res:boolean) => { 72 | expect(res).toBe(true); 73 | }); 74 | }); 75 | 76 | test('mediaRenditionChange', () => { 77 | return Metrics.mediaRenditionChange('string', 2, 2, 2,"num").then((res:boolean) => { 78 | expect(res).toBe(true); 79 | }); 80 | }); 81 | 82 | test('action', () => { 83 | return Metrics.action('user', "num").then((res:boolean) => { 84 | expect(res).toBe(true); 85 | }); 86 | }); 87 | 88 | test('error', () => { 89 | return Metrics.error(Metrics.ErrorType.NETWORK, "num", "num", true).then((res:boolean) => { 90 | expect(res).toBe(true); 91 | }); 92 | }); 93 | 94 | test('mediaEnded', () => { 95 | return Metrics.mediaEnded(('string')).then((res:boolean) => { 96 | expect(res).toBe(true); 97 | }); 98 | }); 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/synchronous-transport.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import transport from "../../../../../test/helpers/synchronous-transport.mjs"; 20 | 21 | // These all get set synchronously, so we'll update them as they happen 22 | let sendCalled: boolean = false; 23 | let inactiveListened: boolean = false; 24 | let callbackWiredUp: boolean = false; 25 | 26 | transport.onSend((json) => { 27 | // we'll assert on this later... 28 | sendCalled = true; 29 | if (json.method.toLowerCase() === "device.name") { 30 | // we'll assert on this later... 31 | inactiveListened = true; 32 | 33 | // we'll assert on this later... 34 | callbackWiredUp = true; 35 | let response = { 36 | jsonrpc: "2.0", 37 | id: json.id, 38 | result: "Test Name", 39 | }; 40 | // catching errors, so all tests don't fail if this breaks 41 | try { 42 | // send back the onInactive event immediately, to test for race conditions 43 | transport.response(response); 44 | } catch (err) { 45 | // fail silenetly (the boolean-based tests below will figure it out...) 46 | } 47 | } 48 | }); 49 | 50 | import { test, expect, beforeAll } from "@jest/globals"; 51 | import { Lifecycle, Device } from "../../build/javascript/src/firebolt"; 52 | 53 | Lifecycle.ready(); 54 | 55 | // Wire up our synchronous transport layer before the SDK loads 56 | beforeAll(() => { 57 | return new Promise((resolve, reject) => { 58 | setTimeout(resolve, 1000); 59 | }); 60 | }); 61 | 62 | test("Transport injected before SDK", () => { 63 | expect(transport.instantiatedBeforeSdk()).toBe(true); 64 | }); 65 | 66 | test("Transport send method working", () => { 67 | expect(sendCalled).toBe(true); 68 | }); 69 | 70 | test("Transport was sent `Lifecycle.onInactive` listener", () => { 71 | expect( 72 | !!transport 73 | .history() 74 | .find((json) => json.method.toLowerCase() === "lifecycle.oninactive") 75 | ).toBe(true); 76 | }); 77 | 78 | test("Transport `receive` callback wired up", () => { 79 | return Device.name().then((name) => { 80 | expect(name).toBe("Test Name"); 81 | }); 82 | }); 83 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/keyboardTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | using namespace Firebolt::Keyboard; 4 | 5 | struct KeyboardProvider : public IKeyboardProvider 6 | { 7 | public: 8 | KeyboardProvider(); 9 | ~KeyboardProvider() override = default; 10 | void standard(const KeyboardParameters ¶meters, std::unique_ptr session) override; 11 | void password(const KeyboardParameters ¶meters, std::unique_ptr session) override; 12 | void email(const KeyboardParameters ¶meters, std::unique_ptr session) override; 13 | void SendMessage(bool response); 14 | 15 | private: 16 | void startKeyboardSession(const KeyboardParameters ¶meters, std::unique_ptr session); 17 | 18 | private: 19 | std::unique_ptr _session; 20 | KeyboardParameters _parameters; 21 | bool _keyInput; 22 | }; 23 | 24 | class KeyboardTest : public ::testing::Test 25 | { 26 | protected: 27 | JsonEngine *jsonEngine; 28 | Firebolt::Error error = Firebolt::Error::None; 29 | KeyboardProvider _keyboardProvider; 30 | 31 | void SetUp() override 32 | { 33 | jsonEngine = new JsonEngine(); 34 | } 35 | 36 | void TearDown() override 37 | { 38 | delete jsonEngine; 39 | } 40 | }; 41 | 42 | KeyboardProvider::KeyboardProvider() 43 | : _session(nullptr), _parameters(), _keyInput(false) 44 | { 45 | } 46 | 47 | void KeyboardProvider::standard(const Firebolt::Keyboard::KeyboardParameters& parameters, std::unique_ptr session) 48 | { 49 | std::cout << "KeyboardProvider Standard is invoked" << std::endl; 50 | startKeyboardSession(parameters, std::move(session)); 51 | } 52 | 53 | void KeyboardProvider::password(const Firebolt::Keyboard::KeyboardParameters& parameters, std::unique_ptr session) 54 | { 55 | std::cout << "KeyboardProvider Password is invoked" << std::endl; 56 | startKeyboardSession(parameters, std::move(session)); 57 | } 58 | 59 | void KeyboardProvider::email(const Firebolt::Keyboard::KeyboardParameters& parameters, std::unique_ptr session) 60 | { 61 | std::cout << "KeyboardProvider Email is invoked" << std::endl; 62 | startKeyboardSession(parameters, std::move(session)); 63 | } 64 | 65 | void KeyboardProvider::SendMessage(bool response) 66 | { 67 | } 68 | 69 | void KeyboardProvider::startKeyboardSession(const KeyboardParameters ¶meters, std::unique_ptr session) 70 | { 71 | _session = std::move(session); 72 | _parameters = parameters; 73 | _keyInput = true; 74 | } 75 | 76 | TEST_F(KeyboardTest, registerKeyboardProvider) 77 | { 78 | Firebolt::IFireboltAccessor::Instance().KeyboardInterface().provide(_keyboardProvider); 79 | } 80 | 81 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/advertising.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the 'License'); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an 'AS IS' BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | import { test, expect } from "@jest/globals"; 20 | import { Advertising } from "../../build/javascript/src/firebolt"; 21 | 22 | test("policy()", () => { 23 | return Advertising.policy().then((policy: Advertising.AdPolicy) => { 24 | expect(policy.skipRestriction).toBe("adsUnwatched"); 25 | expect(policy.limitAdTracking).toBe(false); 26 | }); 27 | }); 28 | 29 | test("config()", () => { 30 | return Advertising.config({ 31 | coppa: true, 32 | environment: "test", 33 | authenticationEntity: "Test", 34 | }).then((res: object) => { 35 | expect(typeof res).toBe("object"); 36 | }); 37 | }); 38 | 39 | test("advertisingId()", () => { 40 | return Advertising.advertisingId().then((res: object) => { 41 | expect(typeof res).toBe("object"); 42 | }); 43 | }); 44 | 45 | test("deviceAttributes()", () => { 46 | return Advertising.deviceAttributes().then((res: object) => { 47 | expect(typeof res).toBe("object"); 48 | }); 49 | }); 50 | 51 | test("appBundleId()", () => { 52 | return Advertising.appBundleId().then((res: string) => { 53 | expect(res).toBe("app.operator"); 54 | expect(typeof res).toBe("string"); 55 | }); 56 | }); 57 | 58 | test("listen()", () => { 59 | return Advertising.listen((event: string, data: object) => {}).then( 60 | (res: number) => { 61 | expect(res > 0).toBe(true); 62 | } 63 | ); 64 | }); 65 | 66 | test("once()", () => { 67 | return Advertising.once((event: string, data: object) => {}).then( 68 | (res: number) => { 69 | expect(res > 0).toBe(true); 70 | } 71 | ); 72 | }); 73 | 74 | test("listen() specific Advertising event.", () => { 75 | return Advertising.listen("policyChanged", () => {}).then((res: number) => { 76 | expect(res > 0).toBe(true); 77 | }); 78 | }); 79 | 80 | test("once() specific Advertising event.", () => { 81 | return Advertising.once("policyChanged", () => {}).then((res: number) => { 82 | expect(res > 0).toBe(true); 83 | }); 84 | }); 85 | 86 | test("clear()", () => { 87 | const result: boolean = Advertising.clear(-1000); 88 | expect(result).toBeFalsy(); 89 | }); 90 | -------------------------------------------------------------------------------- /requirements/specifications/entities/programs.md: -------------------------------------------------------------------------------- 1 | # Program Entities 2 | 3 | Document Status: Proposed Specification 4 | 5 | See [Firebolt Requirements Governance](../../governance.md) for more info. 6 | 7 | | Contributor | Organization | 8 | | --------------- | ------------ | 9 | | Seth Kelly | Comcast | 10 | | Jeremy LaCivita | Comcast | 11 | 12 | ## 1. Overview 13 | TBD... 14 | 15 | The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL 16 | NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**NOT 17 | RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be 18 | interpreted as described in [BCP 19 | 14](https://www.rfc-editor.org/rfc/rfc2119.txt) [RFC2119] [RFC8174] when, and 20 | only when, they appear in all capitals, as shown here. 21 | 22 | ## 2. Table of Contents 23 | - [1. Overview](#1-overview) 24 | - [2. Table of Contents](#2-table-of-contents) 25 | - [3. Program Entities](#3-program-entities) 26 | - [3.1. Optional TV Entity Properties](#31-optional-tv-entity-properties) 27 | 28 | 29 | ## 3. Program Entities 30 | Every Program Entity **MUST** be an [Entity](./index.md#3-entities). 31 | 32 | Every Program Entity **MUST** have a `const` property named `entityType`, which 33 | **MUST** have the value `"program"`. 34 | 35 | Every Program Entity **MUST** have a `string` property named `programType`, 36 | whose value **MUST** be one of: 37 | 38 | - `"movie"` 39 | - `"episode"` 40 | - `"season"` 41 | - `"series"` 42 | - `"other"` 43 | - `"preview"` 44 | - `"extra"` 45 | - `"concert"` 46 | - `"sportingEvent"` 47 | - `"advertisement"` 48 | - `"musicVideo"` 49 | - `"minisode"` 50 | 51 | An example Program Entity: 52 | 53 | ```json 54 | { 55 | "entityType": "program", 56 | "programType": "movie", 57 | "entityId": "entity/abc" 58 | } 59 | ``` 60 | 61 | Another example Entity: 62 | 63 | ```json 64 | { 65 | "entityType": "program", 66 | "programType": "episode", 67 | "entityId": "entity/xyz" 68 | } 69 | ``` 70 | 71 | ### 3.1. Optional TV Entity Properties 72 | A Program Entity **MAY** have a `string` property named `seasonId` if its 73 | programType is `episode`, otherwise the entity **MUST NOT** have this property. 74 | 75 | A Program Entity **MAY** have a `string` property named `seriesId` if its 76 | programType is either `episode` or `season`, otherwise the entity **MUST NOT** 77 | have this property. 78 | 79 | An example TV Program Entity: 80 | 81 | ```json 82 | { 83 | "entityType": "program", 84 | "programType": "episode", 85 | "entityId": "entity/def", 86 | "seriesId": "entity/hij", 87 | "seasonId": "entity/klm" 88 | } 89 | ``` 90 | 91 | Another example TV Program Entity: 92 | 93 | ```json 94 | { 95 | "entityType": "program", 96 | "programType": "season", 97 | "entityId": "entity/klm", 98 | "seriesId": "entity/hij" 99 | } 100 | ``` 101 | -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Comcast Cable Communications Management, LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | cmake_minimum_required(VERSION 3.3) 18 | 19 | project(FireboltCoreSDKTests) 20 | project_version(1.0.0) 21 | 22 | set(TESTLIB ${PROJECT_NAME}) 23 | 24 | message("Setup ${TESTLIB} v${PROJECT_VERSION}") 25 | 26 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 27 | find_package(${NAMESPACE}Core CONFIG REQUIRED) 28 | 29 | file(GLOB CPP_SOURCES *.cpp) 30 | list(REMOVE_ITEM CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Main.cpp) 31 | message("After CPP_SOURCES " ${CPP_SOURCES}) 32 | add_library(${TESTLIB} STATIC ${CPP_SOURCES}) 33 | 34 | target_link_libraries(${TESTLIB} 35 | PRIVATE 36 | ${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK 37 | ${NAMESPACE}Core::${NAMESPACE}Core 38 | ) 39 | 40 | target_include_directories(${TESTLIB} 41 | PRIVATE 42 | $ 43 | $ 44 | $ 45 | $ 46 | ) 47 | 48 | set_target_properties(${TESTLIB} PROPERTIES 49 | CXX_STANDARD 17 50 | CXX_STANDARD_REQUIRED YES 51 | LINK_WHAT_YOU_USE TRUE 52 | FRAMEWORK FALSE 53 | ) 54 | 55 | set(TESTAPP FireboltCoreSDKTestApp) 56 | 57 | message("Setup ${TESTAPP} v${PROJECT_VERSION}") 58 | 59 | add_executable(${TESTAPP} Main.cpp) 60 | 61 | target_link_libraries(${TESTAPP} 62 | PRIVATE 63 | ${TESTLIB} 64 | ) 65 | 66 | target_include_directories(${TESTAPP} 67 | PRIVATE 68 | $ 69 | $ 70 | $ 71 | ) 72 | 73 | install( 74 | TARGETS ${TESTLIB} EXPORT ${TESTLIB}Targets 75 | ARCHIVE DESTINATION lib COMPONENT libs # static lib 76 | LIBRARY DESTINATION lib COMPONENT libs # shared lib 77 | ) 78 | 79 | InstallCMakeConfig(TARGETS ${TESTLIB}) 80 | 81 | add_custom_command( 82 | TARGET ${TESTAPP} 83 | POST_BUILD 84 | COMMENT "=================== Installing TestApp ======================" 85 | COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin 86 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin 87 | ) 88 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Comcast Cable Communications Management, LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | cmake_minimum_required(VERSION 3.3) 18 | 19 | project(FireboltManageSDKTests) 20 | project_version(1.0.0) 21 | 22 | set(TESTLIB ${PROJECT_NAME}) 23 | 24 | message("Setup ${TESTLIB} v${PROJECT_VERSION}") 25 | 26 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 27 | find_package(${NAMESPACE}Core CONFIG REQUIRED) 28 | 29 | file(GLOB CPP_SOURCES *.cpp) 30 | list(REMOVE_ITEM CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Main.cpp) 31 | message("After CPP_SOURCES " ${CPP_SOURCES}) 32 | add_library(${TESTLIB} STATIC ${CPP_SOURCES}) 33 | 34 | target_link_libraries(${TESTLIB} 35 | PRIVATE 36 | ${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK 37 | ${NAMESPACE}Core::${NAMESPACE}Core 38 | ) 39 | 40 | target_include_directories(${TESTLIB} 41 | PRIVATE 42 | $ 43 | $ 44 | $ 45 | $ 46 | ) 47 | 48 | set_target_properties(${TESTLIB} PROPERTIES 49 | CXX_STANDARD 17 50 | CXX_STANDARD_REQUIRED YES 51 | LINK_WHAT_YOU_USE TRUE 52 | FRAMEWORK FALSE 53 | ) 54 | 55 | set(TESTAPP FireboltManageSDKTestApp) 56 | 57 | message("Setup ${TESTAPP} v${PROJECT_VERSION}") 58 | 59 | add_executable(${TESTAPP} Main.cpp) 60 | 61 | target_link_libraries(${TESTAPP} 62 | PRIVATE 63 | ${TESTLIB} 64 | ) 65 | 66 | target_include_directories(${TESTAPP} 67 | PRIVATE 68 | $ 69 | $ 70 | $ 71 | ) 72 | 73 | install( 74 | TARGETS ${TESTLIB} EXPORT ${TESTLIB}Targets 75 | ARCHIVE DESTINATION lib COMPONENT libs # static lib 76 | LIBRARY DESTINATION lib COMPONENT libs # shared lib 77 | ) 78 | 79 | InstallCMakeConfig(TARGETS ${TESTLIB}) 80 | 81 | add_custom_command( 82 | TARGET ${TESTAPP} 83 | POST_BUILD 84 | COMMENT "=================== Installing TestApp ======================" 85 | COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin 86 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin 87 | ) 88 | -------------------------------------------------------------------------------- /requirements/specifications/entities/index.md: -------------------------------------------------------------------------------- 1 | # Firebolt Entities 2 | 3 | Document Status: Proposed Specification 4 | 5 | See [Firebolt Requirements Governance](../../governance.md) for more info. 6 | 7 | ## 1. Overview 8 | Entities are object which identify a piece of content that an end-user may 9 | consume within an app. 10 | 11 | Firebolt uses Entities or Entity Ids as parameters and/or results of 12 | content-centric Firebolt APIs that an App may interact with. 13 | 14 | The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL 15 | NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**NOT 16 | RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be 17 | interpreted as described in [BCP 18 | 14](https://www.rfc-editor.org/rfc/rfc2119.txt) [RFC2119] [RFC8174] when, and 19 | only when, they appear in all capitals, as shown here. 20 | 21 | ## 2. Table of Contents 22 | - [1. Overview](#1-overview) 23 | - [2. Table of Contents](#2-table-of-contents) 24 | - [3. Entities](#3-entities) 25 | - [4. Playlist Entities](#4-playlist-entities) 26 | - [5. Entity Specifications](#5-entity-specifications) 27 | 28 | ## 3. Entities 29 | Every Entity **MUST** be of type `object`. 30 | 31 | Every Entity object **MUST** have a `string` property named `entityId`, which 32 | identifies the entity. The scope of entity identifiers **SHOULD** be defined by 33 | the app providing or receiving the Entity, so that the App may work across 34 | Firebolt distrubutions without mapping IDs from a distributor space to the 35 | App's space. 36 | 37 | Every Entity object **MAY** have a `string` property named `assetId`, which 38 | disambiguates the asset from the entity, if needed. The scope of asset 39 | identifiers **SHOULD** be defined by the app providing or receiving the Entity, 40 | so that the App may work across Firebolt distrubutions without mapping IDs from 41 | a distributor space to the App's space. 42 | 43 | Every Entity object **MAY** have a `string` property named `appContentData`, 44 | limited to 256 characters, which provides additional information useful for 45 | targeting that Entity, e.g. a deeplink path. 46 | 47 | An example Entity: 48 | 49 | ```json 50 | { 51 | "entityId": "entity/abc" 52 | } 53 | ``` 54 | 55 | Another example Entity: 56 | 57 | ```json 58 | { 59 | "entityId": "entity/abc", 60 | "assetId": "asset/123", 61 | "appContentData": "xyz" 62 | } 63 | ``` 64 | 65 | Firebolt platforms **MUST NOT** infer anything from the values of these fields, 66 | although back-office systems operated by Firebolt distributors may. 67 | 68 | ## 4. Playlist Entities 69 | A playlist is a type of entity that points to a list of other entities. 70 | 71 | Since entity IDs are in the target app's scope, it is up to each app to know 72 | what to do with the contents of a given playlist. 73 | 74 | 75 | ```json 76 | { 77 | "entityType": "playlist", 78 | "entityId": "playlist/xyz" 79 | } 80 | ``` 81 | 82 | ## 5. Entity Specifications 83 | 84 | - [Program Entities](./programs.md) 85 | - [Channel Entities](./channels.md) 86 | - [Music Entities](./music.md) -------------------------------------------------------------------------------- /src/sdks/discovery/src/cpp/sdk/cpptest/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "DiscoverySDKTest.h" 25 | 26 | using namespace std; 27 | 28 | const char* options = ":hu:"; 29 | 30 | void RunAllTests() { 31 | bool allTestsPassed = true; 32 | vector errorMessages; 33 | 34 | auto runTest = [&allTestsPassed, &errorMessages](auto testFunction, const string& testName) { 35 | try { 36 | testFunction(); 37 | } catch (const exception& e) { 38 | errorMessages.push_back("Test " + testName + " failed: " + e.what()); 39 | allTestsPassed = false; 40 | } 41 | }; 42 | 43 | // Ensure the connection is ready before running tests 44 | if (DiscoverySDKTest::WaitOnConnectionReady()) { 45 | 46 | runTest(DiscoverySDKTest::SubscribeUserInterest, "SubscribeUserInterest"); 47 | runTest(DiscoverySDKTest::UnsubscribeUserInterest, "UnsubscribeUserInterest"); 48 | runTest(DiscoverySDKTest::RequestUserInterest, "RequestUserInterest"); 49 | 50 | if (allTestsPassed) { 51 | cout << "============================" << endl; 52 | cout << "ALL DISCOVERY SDK TESTS SUCCEEDED!" << endl; 53 | cout << "============================" << endl; 54 | } else { 55 | cout << "============================" << endl; 56 | cout << "SOME TESTS FAILED:" << endl; 57 | for (const auto& errorMessage : errorMessages) { 58 | cout << errorMessage << endl; 59 | } 60 | cout << "============================" << endl; 61 | exit(1); 62 | } 63 | } else { 64 | cout << "Discovery Test not able to connect with server..." << endl; 65 | exit(1); 66 | } 67 | } 68 | 69 | int main(int argc, char* argv[]) { 70 | int c; 71 | string url = "ws://127.0.0.1:9998"; 72 | while ((c = getopt(argc, argv, options)) != -1) { 73 | switch (c) { 74 | case 'u': 75 | url = optarg; 76 | break; 77 | case 'h': 78 | printf("./TestFireboltDiscovery -u ws://ip:port\n"); 79 | exit(1); 80 | } 81 | } 82 | 83 | printf("Firebolt Discovery SDK Test\n"); 84 | 85 | DiscoverySDKTest::CreateFireboltInstance(url); 86 | RunAllTests(); 87 | DiscoverySDKTest::DestroyFireboltInstance(); 88 | 89 | return 0; 90 | } -------------------------------------------------------------------------------- /src/openrpc/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "openrpc": "1.2.4", 3 | "info": { 4 | "title": "Parameters", 5 | "description": "Methods for getting initialization parameters for an app cold launch.", 6 | "version": "0.0.0" 7 | }, 8 | "methods": [ 9 | { 10 | "name": "initialization", 11 | "tags": [ 12 | { 13 | "name": "capabilities", 14 | "x-uses": [ 15 | "xrn:firebolt:capability:lifecycle:state" 16 | ] 17 | } 18 | ], 19 | "summary": "Returns any initialization parameters for the app, e.g. initialial `NavigationIntent`.", 20 | "params": [], 21 | "result": { 22 | "name": "init", 23 | "summary": "The initialization parameters.", 24 | "schema": { 25 | "$ref": "#/components/schemas/AppInitialization" 26 | } 27 | }, 28 | "examples": [ 29 | { 30 | "name": "Default Example", 31 | "params": [], 32 | "result": { 33 | "name": "init", 34 | "value": { 35 | "lmt": 0, 36 | "us_privacy": "1-Y-", 37 | "discovery": { 38 | "navigateTo": { 39 | "action": "entity", 40 | "data": { 41 | "entityId": "abc", 42 | "entityType": "program", 43 | "programType": "movie" 44 | }, 45 | "context": { 46 | "source": "voice" 47 | } 48 | } 49 | } 50 | } 51 | } 52 | } 53 | ] 54 | } 55 | ], 56 | "components": { 57 | "schemas": { 58 | "AppInitialization": { 59 | "title": "AppInitialization", 60 | "type": "object", 61 | "properties": { 62 | "us_privacy": { 63 | "type": "string", 64 | "description": "The IAB US Privacy string." 65 | }, 66 | "lmt": { 67 | "type": "integer", 68 | "description": "The IAB limit ad tracking opt out value." 69 | }, 70 | "discovery": { 71 | "type": "object", 72 | "properties": { 73 | "navigateTo": { 74 | "$ref": "https://meta.comcast.com/firebolt/intents#/definitions/NavigationIntent" 75 | } 76 | } 77 | }, 78 | "secondScreen": { 79 | "type": "object", 80 | "properties": { 81 | "launchRequest": { 82 | "$ref": "https://meta.comcast.com/firebolt/secondscreen#/definitions/SecondScreenEvent" 83 | } 84 | } 85 | } 86 | } 87 | } 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | #include 20 | 21 | #include "Module.h" 22 | #include "firebolt.h" 23 | #include "CoreSDKTestStaticCode.h" 24 | #include "CoreSDKTestGeneratedCode.h" 25 | 26 | using namespace std; 27 | bool CoreSDKTestGeneratedCode::_connected; 28 | 29 | void CoreSDKTestGeneratedCode::ConnectionChanged(const bool connected, const Firebolt::Error error) 30 | { 31 | cout << "Change in connection: connected: " << connected << " error: " << static_cast(error) << endl; 32 | _connected = connected; 33 | } 34 | 35 | void CoreSDKTestGeneratedCode::CreateFireboltInstance() 36 | { 37 | const std::string config = _T("{\ 38 | \"waitTime\": 1000,\ 39 | \"logLevel\": \"Info\",\ 40 | \"workerPool\":{\ 41 | \"queueSize\": 8,\ 42 | \"threadCount\": 3\ 43 | },\ 44 | \"wsUrl\": \"ws://127.0.0.1:9998\"\ 45 | }"); 46 | 47 | _connected = false; 48 | Firebolt::IFireboltAccessor::Instance().Initialize(config); 49 | Firebolt::IFireboltAccessor::Instance().Connect(ConnectionChanged); 50 | } 51 | 52 | void CoreSDKTestGeneratedCode::DestroyFireboltInstance() 53 | { 54 | Firebolt::IFireboltAccessor::Instance().Disconnect(); 55 | Firebolt::IFireboltAccessor::Instance().Deinitialize(); 56 | Firebolt::IFireboltAccessor::Instance().Dispose(); 57 | } 58 | 59 | bool CoreSDKTestGeneratedCode::WaitOnConnectionReady() 60 | { 61 | uint32_t waiting = 10000; 62 | static constexpr uint32_t SLEEPSLOT_TIME = 100; 63 | 64 | // Right, a wait till connection is closed is requested.. 65 | while ((waiting > 0) && (_connected == false)) { 66 | 67 | uint32_t sleepSlot = (waiting > SLEEPSLOT_TIME ? SLEEPSLOT_TIME : waiting); 68 | // Right, lets sleep in slices of 100 ms 69 | SleepMs(sleepSlot); 70 | waiting -= sleepSlot; 71 | } 72 | return _connected; 73 | } 74 | 75 | void CoreSDKTestGeneratedCode::TestCoreStaticSDK() 76 | { 77 | FireboltSDK::Tests::Main(); 78 | } 79 | 80 | void CoreSDKTestGeneratedCode::GetDeviceName() 81 | { 82 | Firebolt::Error error = Firebolt::Error::None; 83 | const std::string name = Firebolt::IFireboltAccessor::Instance().DeviceInterface().Name(&error); 84 | 85 | if (error == Firebolt::Error::None) { 86 | cout << "Get DeviceName = " << name.c_str() << endl; 87 | } else { 88 | cout << "Get DeviceName status = " << static_cast(error) << endl; 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/sdks/core/test/suite/listeners-transport.test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Comcast Cable Communications Management, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | const win = globalThis || window; 20 | 21 | import { test, expect } from "@jest/globals"; 22 | import { Lifecycle, Discovery } from "../../build/javascript/src/firebolt"; 23 | 24 | // holds test transport layer state, e.g. callback 25 | const state = { 26 | callback: Function, 27 | }; 28 | 29 | let navigateToListenCount: number = 0; 30 | let callbackWiredUp: boolean = false; 31 | let sendCalled: boolean = false; 32 | 33 | const transport = { 34 | send: function (message: string) { 35 | sendCalled = true; 36 | const json = JSON.parse(message); 37 | if (json.method.toLowerCase() === "discovery.onnavigateto") { 38 | // we'll assert on this later... 39 | navigateToListenCount++; 40 | if (state.callback) { 41 | // we'll assert on this later... 42 | callbackWiredUp = true; 43 | let response = { 44 | jsonrpc: "2.0", 45 | id: json.id, 46 | result: true, 47 | }; 48 | // catching errors, so all tests don't fail if this breaks 49 | try { 50 | // send back the onInactive event immediately, to test for race conditions 51 | state.callback(JSON.stringify(response)); 52 | } catch (err) { 53 | // fail silenetly (the boolean-based tests below will figure it out...) 54 | } 55 | } 56 | } 57 | }, 58 | receive: function (callback: FunctionConstructor) { 59 | // store the callback 60 | state.callback = callback; 61 | }, 62 | }; 63 | 64 | win.__firebolt.setTransportLayer(transport); 65 | 66 | // listen twice, using event-specific call FIRST 67 | Discovery.listen("navigateTo", (value: Discovery.NavigationIntent) => { 68 | callbackWiredUp = true; 69 | }); 70 | 71 | Discovery.listen("navigateTo", (value: Discovery.NavigationIntent) => { 72 | /* this just adds more listen calls to make sure we don't spam */ 73 | }); 74 | Discovery.listen((event: string, value: object) => { 75 | /* testing both listen signatures */ 76 | }); 77 | Discovery.listen((event: string, value: object) => { 78 | /* testing both listen signatures */ 79 | }); 80 | 81 | Lifecycle.ready(); 82 | 83 | test("Transport injected after SDK", () => { 84 | expect(callbackWiredUp).toBe(true); 85 | }); 86 | 87 | test("Transport send method working", () => { 88 | expect(sendCalled).toBe(true); 89 | }); 90 | 91 | test("Transport was sent listeners", () => { 92 | expect(navigateToListenCount).toBeGreaterThan(0); 93 | }); 94 | 95 | test("Transport was sent each listener only once", () => { 96 | expect(navigateToListenCount).toBe(1); 97 | }); 98 | -------------------------------------------------------------------------------- /src/sdks/manage/src/cpp/sdk/cpptest/unit/deviceTest.cpp: -------------------------------------------------------------------------------- 1 | #include "unit.h" 2 | 3 | class DeviceTest : public ::testing::Test 4 | { 5 | protected: 6 | JsonEngine *jsonEngine; 7 | Firebolt::Error error = Firebolt::Error::None; 8 | 9 | void SetUp() override 10 | { 11 | jsonEngine = new JsonEngine(); 12 | } 13 | 14 | void TearDown() override 15 | { 16 | delete jsonEngine; 17 | } 18 | }; 19 | 20 | 21 | TEST_F(DeviceTest, setName) { 22 | std::string expected_name = "MyDevice"; 23 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().setName(expected_name, &error); 24 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling DeviceInterface.setName() method"; 25 | } 26 | 27 | TEST_F(DeviceTest, name) { 28 | std::string expectedValues = jsonEngine->get_value("Device.name"); 29 | std::string name = Firebolt::IFireboltAccessor::Instance().DeviceInterface().name(&error); 30 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling DeviceInterface.name() method"; 31 | EXPECT_EQ(REMOVE_QUOTES(expectedValues), name) << "Error: wrong name returned by DeviceInterface.name()"; 32 | } 33 | 34 | TEST_F(DeviceTest, provision) { 35 | std::string accountId = "12345"; 36 | std::string deviceId = "67890"; 37 | std::optional distributorId = "distributor1"; 38 | 39 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().provision(accountId, deviceId, distributorId, &error); 40 | EXPECT_EQ(error, Firebolt::Error::None) << "Error on calling DeviceInterface.provision() method"; 41 | } 42 | 43 | 44 | // Events related tests 45 | struct DeviceNameSettings : public Firebolt::Device::IDevice::IOnDeviceNameChangedNotification 46 | { 47 | void onDeviceNameChanged(const std::string &) override; 48 | }; 49 | 50 | void DeviceNameSettings::onDeviceNameChanged(const std::string &name) 51 | { 52 | std::cout << "onDeviceNameChanged event fired"; 53 | } 54 | 55 | TEST_F(DeviceTest, subscribeOnDeviceNameChanged) 56 | { 57 | DeviceNameSettings deviceNameSettings; 58 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().subscribe(deviceNameSettings, &error); 59 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in subscribing to DeviceNameSettings"; 60 | } 61 | 62 | TEST_F(DeviceTest, unsubscribeOnDeviceNameChanged) 63 | { 64 | DeviceNameSettings deviceNameSettings; 65 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().unsubscribe(deviceNameSettings, &error); 66 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in unsubscribing to DeviceNameSettings"; 67 | } 68 | 69 | struct NameSettings : public Firebolt::Device::IDevice::IOnNameChangedNotification 70 | { 71 | void onNameChanged(const std::string &) override; 72 | }; 73 | 74 | void NameSettings::onNameChanged(const std::string &name) 75 | { 76 | std::cout << "onNameChanged event fired"; 77 | } 78 | 79 | TEST_F(DeviceTest, subscribeOnNameChanged) 80 | { 81 | NameSettings nameSettings; 82 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().subscribe(nameSettings, &error); 83 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in subscribing to NameSettings"; 84 | } 85 | 86 | TEST_F(DeviceTest, unsubscribeOnNameChanged) 87 | { 88 | NameSettings nameSettings; 89 | Firebolt::IFireboltAccessor::Instance().DeviceInterface().unsubscribe(nameSettings, &error); 90 | EXPECT_EQ(error, Firebolt::Error::None) << "Error in unsubscribing to NameSettings"; 91 | } 92 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@firebolt-js/sdks", 3 | "version": "1.8.0-next.34", 4 | "description": "The Firebolt JS SDK", 5 | "type": "module", 6 | "bin": { 7 | "firebolt-version": "./src/js/version.mjs" 8 | }, 9 | "workspaces": [ 10 | "src/sdks/core", 11 | "src/sdks/manage", 12 | "src/sdks/discovery" 13 | ], 14 | "scripts": { 15 | "fs:setup": "npm run clean && mkdir -p dist", 16 | "validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas src/schemas --transformations", 17 | "validate:compiled": "npx firebolt-openrpc validate --input dist/firebolt-open-rpc.json --pass-throughs && npm run validate --workspaces", 18 | "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", 20 | "slice": "npm run slice --workspaces", 21 | "sdks": "npm run sdk --workspaces", 22 | "docs": "npm run docs --workspaces", 23 | "wiki": "npm run wiki --workspaces", 24 | "test:setup": "npm run test:setup --workspaces", 25 | "test": "npm run test:setup && NODE_OPTIONS=--experimental-vm-modules npx --config=jest.config.json --detectOpenHandles jest", 26 | "clean": "rm -rf dist && npm run clean --workspaces", 27 | "dist": "npm run fs:setup && npm run validate:each && npm run compile && npm run specification && npm run version && npm run dist:notest --workspaces && npm run test", 28 | "specification": "node ./src/js/version-specification/index.mjs --source ./src/json/firebolt-specification.json", 29 | "specification:report": "node ./src/js/version-specification/index.mjs --source ./dist/firebolt-specification.json --report", 30 | "version": "node ./src/js/version.mjs sync", 31 | "dev:setup": "husky install", 32 | "publish:docs": "node ./src/js/github.io/index.mjs --output", 33 | "release-notes": "npx semantic-release --dry-run --repository-url git@github.com:rdkcentral/firebolt-apis.git --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator", 34 | "prepack": "npm run dist" 35 | }, 36 | "repository": { 37 | "type": "git", 38 | "url": "ssh://github.com/rdkcentral/firebolt-apis.git" 39 | }, 40 | "author": "", 41 | "bugs": { 42 | "url": "https://github.com/rdkcentral/firebolt-apis/issues" 43 | }, 44 | "homepage": "https://github.com/rdkcentral/firebolt-apis#readme", 45 | "devDependencies": { 46 | "@commitlint/cli": "^17.0.3", 47 | "@commitlint/config-conventional": "^17.0.3", 48 | "@firebolt-js/openrpc": "3.2.0", 49 | "@firebolt-js/schemas": "2.0.0", 50 | "@saithodev/semantic-release-backmerge": "^3.2.0", 51 | "@semantic-release/changelog": "^6.0.1", 52 | "@semantic-release/exec": "^6.0.3", 53 | "@semantic-release/git": "^10.0.1", 54 | "@semantic-release/npm": "^11.0.3", 55 | "@semantic-release/release-notes-generator": "^10.0.1", 56 | "ajv": "^6.12.6", 57 | "glob": ">=10.5.0", 58 | "form-data": ">=4.0.4", 59 | "husky": "^8.0.0", 60 | "jest": "^28.1.0", 61 | "jest-environment-jsdom": "^28.1.3", 62 | "js-yaml": ">=4.1.1", 63 | "mkdirp": "^2.1.6", 64 | "nopt": "^7.1.0", 65 | "production-changelog": "./src/js/production-changelog/", 66 | "semantic-release": "^21.1.1", 67 | "typescript": "^4.6.4" 68 | }, 69 | "keywords": [ 70 | "firebolt", 71 | "apps", 72 | "sdk" 73 | ], 74 | "license": "Apache-2.0" 75 | } 76 | --------------------------------------------------------------------------------