From 6010a85e9883480aba71378391f5b6223645fb28 Mon Sep 17 00:00:00 2001 From: Kevin <72702438+kevinshahfws@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:44:42 -0400 Subject: [PATCH] fix: Spec and Doc fixes (#302) * fix: Spec and Doc fixes --- package-lock.json | 6 +- src/json/firebolt-specification.json | 3 - src/openrpc/_internal.json | 24 +- src/openrpc/advertising.json | 54 ++-- src/openrpc/authentication.json | 36 +-- src/openrpc/device.json | 280 ++++++++++++++----- src/schemas/accessibility.json | 6 +- src/schemas/types.json | 2 - src/sdks/core/sdk.config.json | 2 +- src/sdks/core/test/suite/advertising.test.ts | 2 +- 10 files changed, 284 insertions(+), 131 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42027e562..87fbc63cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16962,7 +16962,7 @@ }, "src/sdks/core": { "name": "@firebolt-js/sdk", - "version": "1.3.0-next.3", + "version": "1.3.0", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", @@ -16973,7 +16973,7 @@ }, "src/sdks/discovery": { "name": "@firebolt-js/discovery-sdk", - "version": "1.3.0-next.3", + "version": "1.3.0", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", @@ -16984,7 +16984,7 @@ }, "src/sdks/manage": { "name": "@firebolt-js/manage-sdk", - "version": "1.3.0-next.3", + "version": "1.3.0", "license": "Apache-2.0", "devDependencies": { "jest": "^28.1.0", diff --git a/src/json/firebolt-specification.json b/src/json/firebolt-specification.json index 13f662b93..568f4b9e4 100644 --- a/src/json/firebolt-specification.json +++ b/src/json/firebolt-specification.json @@ -147,9 +147,6 @@ "negotiable": false } }, - "xrn:firebolt:capability:privacy:advertising": { - "level": "could" - }, "xrn:firebolt:capability:metrics:distributor": { "level": "could" }, diff --git a/src/openrpc/_internal.json b/src/openrpc/_internal.json index 7f04a6dc1..a04b45e79 100644 --- a/src/openrpc/_internal.json +++ b/src/openrpc/_internal.json @@ -35,15 +35,7 @@ "name": "session", "summary": "Info about the SDK/FEE session", "schema": { - "type": "object", - "required": ["version"], - "properties": { - "version": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The semantic version of the FEE." - } - }, - "additionalProperties": false + "$ref": "#/components/schemas/InitializeResult" } }, "examples": [ @@ -76,7 +68,19 @@ } ], "components": { - "schemas": { + "schemas": { + "InitializeResult": { + "title": "InitializeResult", + "type": "object", + "required": ["version"], + "properties": { + "version": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The semantic version of the FEE." + } + }, + "additionalProperties": false + } } } } \ No newline at end of file diff --git a/src/openrpc/advertising.json b/src/openrpc/advertising.json index 22a86b312..20235446e 100644 --- a/src/openrpc/advertising.json +++ b/src/openrpc/advertising.json @@ -81,8 +81,7 @@ { "name": "capabilities", "x-uses": [ - "xrn:firebolt:capability:privacy:advertising", - "xrn:firebolt:capability:advertising:configuration" + "xrn:firebolt:capability:advertising:policy" ] } ], @@ -157,7 +156,7 @@ ] } ], - "summary": "Get the advertising ID", + "summary": "Get the IAB compliant identifier for advertising (IFA). It is recommended to use the IFA to manage advertising related activities while respecting the user's privacy settings.", "params": [ { "name": "options", @@ -172,21 +171,7 @@ "name": "advertisingId", "summary": "the advertising ID", "schema": { - "type": "object", - "properties": { - "ifa": { - "type": "string" - }, - "ifa_type": { - "type": "string" - }, - "lmt": { - "type": "string" - } - }, - "required": [ - "ifa" - ] + "$ref": "#/components/schemas/AdvertisingIdResult" } }, "examples": [ @@ -197,7 +182,7 @@ "name": "Default Result", "value": { "ifa": "01234567-89AB-CDEF-GH01-23456789ABCD", - "ifa_type": "idfa", + "ifa_type": "sspid", "lmt": "0" } } @@ -219,7 +204,7 @@ "name": "Default Result", "value": { "ifa": "01234567-89AB-CDEF-GH01-23456789ABCD", - "ifa_type": "idfa", + "ifa_type": "sspid", "lmt": "0" } } @@ -303,7 +288,7 @@ "params": [], "result": { "name": "Default Result", - "value": "operator.app" + "value": "app.operator" } } ] @@ -404,6 +389,33 @@ } } } + }, + "AdvertisingIdResult": { + "title": "AdvertisingIdResult", + "type": "object", + "properties": { + "ifa": { + "type": "string", + "description": "UUID conforming to IAB standard" + }, + "ifa_type": { + "type": "string", + "description": "source of the IFA as defined by IAB" + }, + "lmt": { + "type": "string", + "enum": [ + "0", + "1" + ], + "description": "boolean that if set to 1, user has requested ad tracking and measurement is disabled" + } + }, + "required": [ + "ifa", + "ifa_type", + "lmt" + ] } } } diff --git a/src/openrpc/authentication.json b/src/openrpc/authentication.json index 18a633183..977846b46 100644 --- a/src/openrpc/authentication.json +++ b/src/openrpc/authentication.json @@ -44,22 +44,7 @@ "name": "token", "summary": "the token value, type, and expiration", "schema": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "expires": { - "type": "string", - "format": "date-time" - }, - "type": { - "type": "string" - } - }, - "required": [ - "value" - ] + "$ref": "#/components/schemas/AuthenticationTokenResult" } }, "examples": [ @@ -233,6 +218,25 @@ "device", "distributor" ] + }, + "AuthenticationTokenResult": { + "title": "AuthenticationTokenResult", + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "expires": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + } + }, + "required": [ + "value" + ] } } } diff --git a/src/openrpc/device.json b/src/openrpc/device.json index 04cdced4d..0dd8e11b4 100644 --- a/src/openrpc/device.json +++ b/src/openrpc/device.json @@ -292,34 +292,7 @@ "name": "versions", "summary": "the versions", "schema": { - "type": "object", - "properties": { - "sdk": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The Firebolt SDK version" - }, - "api": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The lateset Firebolt API version supported by the curent device." - }, - "firmware": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "The device firmware version." - }, - "os": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", - "description": "**Deprecated** Use `firmware`, instead." - }, - "debug": { - "type": "string", - "description": "Detail version as a string, for debugging purposes" - } - }, - "required": [ - "api", - "firmware", - "os" - ] + "$ref": "#/components/schemas/DeviceVersion" } }, "examples": [ @@ -361,7 +334,7 @@ }, { "name": "hdcp", - "summary": "Get the supported HDCP profiles", + "summary": "Get the negotiated HDCP profiles for a connected device. \n\n For devices that do not require additional connections (e.g. panels), `true` will be returned for all profiles.", "params": [], "tags": [ { @@ -375,15 +348,15 @@ } ], "result": { - "name": "supportedHdcpProfiles", - "summary": "the supported HDCP profiles", + "name": "supportedHdcpVersions", + "summary": "the supported HDCP versions", "schema": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "$ref": "#/components/schemas/HDCPVersionMap" } }, "examples": [ { - "name": "Getting the supported HDCP profiles", + "name": "Getting the supported HDCP versions", "params": [], "result": { "name": "Default Result", @@ -397,7 +370,7 @@ }, { "name": "hdr", - "summary": "Get the supported HDR profiles", + "summary": "Get the negotiated HDR formats for the connected display and device", "params": [], "tags": [ { @@ -411,15 +384,15 @@ } ], "result": { - "name": "supportedHdrProfiles", - "summary": "the supported HDR profiles", + "name": "supportedHdrFormats", + "summary": "the supported HDR formats", "schema": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "$ref": "#/components/schemas/HDRFormatMap" } }, "examples": [ { - "name": "Getting the supported HDR profiles", + "name": "Getting the supported HDR formats", "params": [], "result": { "name": "Default Result", @@ -435,7 +408,7 @@ }, { "name": "audio", - "summary": "Get the supported audio profiles", + "summary": "Get the supported audio profiles for the connected devices. \n\n It is not recommended to use this API for visual badging on content within your app since this does not reflect the settings of the user.", "params": [], "tags": [ { @@ -473,7 +446,7 @@ }, { "name": "screenResolution", - "summary": "Get the current screen resolution", + "summary": "Get the resolution for the graphical surface of the app. \n\nThe pairs returned will be of a [width, height] format and will correspond to the following values: \n\nNTSC Standard Definition (SD): [720, 480] \n\nPAL Standard Definition (SD): [720, 576] \n\nHigh Definition (HD): [1280, 720] \n\nFull HD (FHD): [1920, 1080]\n\n4K Ultra High Definition (UHD): [3840, 2160]", "params": [], "tags": [ { @@ -509,7 +482,7 @@ }, { "name": "videoResolution", - "summary": "Get the current video resolution", + "summary": "Get the maximum supported video resolution of the currently connected device and display. \n\nThe pairs returned will be of a [width, height] format and will correspond to the following values: \n\nNTSC Standard Definition (SD): [720, 480] \n\nPAL Standard Definition (SD): [720, 576] \n\nHigh Definition (HD): [1280, 720] \n\nFull HD (FHD): [1920, 1080]\n\n4K Ultra High Definition (UHD): [3840, 2160]", "params": [], "tags": [ { @@ -641,19 +614,7 @@ "name": "networkInfo", "summary": "the status and type", "schema": { - "type": "object", - "properties": { - "state": { - "$ref": "#/components/schemas/NetworkState" - }, - "type": { - "$ref": "#/components/schemas/NetworkType" - } - }, - "required": [ - "state", - "type" - ] + "$ref": "#/components/schemas/NetworkInfoResult" } }, "examples": [ @@ -759,18 +720,98 @@ "components": { "schemas": { "Resolution": { - "type": "array", - "items": [ + "oneOf": [ + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 720, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 480, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, { - "type": "integer" + "type": "array", + "items": [ + { + "type": "integer", + "const": 720, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 576, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 1280, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 720, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "type": "integer", + "const": 1920, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 1080, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 }, { - "type": "integer" + "type": "array", + "items": [ + { + "type": "integer", + "const": 3840, + "description": "Width in pixels" + }, + { + "type": "integer", + "const": 2160, + "description": "Height in pixels" + } + ], + "additionalItems": false, + "minItems": 2, + "maxItems": 2 } - ], - "additionalItems": false, - "minItems": 2, - "maxItems": 2 + ] }, "NetworkType": { "title": "NetworkType", @@ -793,16 +834,115 @@ }, "AudioProfiles": { "title": "AudioProfiles", - "allOf": [ - { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/BooleanMap" + "type": "object", + "properties": { + "stereo": { + "type": "boolean" }, - { - "type": "object", - "propertyNames": { - "$ref": "https://meta.comcast.com/firebolt/types#/definitions/AudioProfile" - } + "dolbyDigital5.1": { + "type": "boolean" + }, + "dolbyDigital5.1+": { + "type": "boolean" + }, + "dolbyAtmos": { + "type": "boolean" + } + }, + "required": [ + "stereo", + "dolbyDigital5.1", + "dolbyDigital5.1+", + "dolbyAtmos" + ] + }, + "HDRFormatMap": { + "title": "HDRFormatMap", + "type": "object", + "properties": { + "hdr10": { + "type": "boolean" + }, + "hdr10Plus": { + "type": "boolean" + }, + "dolbyVision": { + "type": "boolean" + }, + "hlg": { + "type": "boolean" } + }, + "required": [ + "hdr10", + "hdr10Plus", + "dolbyVision", + "hlg" + ], + "description": "The type of HDR format that is supported" + }, + "HDCPVersionMap": { + "title": "HDCPVersionMap", + "type": "object", + "properties": { + "hdcp1.4": { + "type": "boolean" + }, + "hdcp2.2": { + "type": "boolean" + } + }, + "required": [ + "hdcp1.4", + "hdcp2.2" + ], + "description": "The type of HDCP versions that is supported" + }, + "DeviceVersion": { + "title": "DeviceVersion", + "type": "object", + "properties": { + "sdk": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The Firebolt SDK version" + }, + "api": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The latest Firebolt API version supported by the current device." + }, + "firmware": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "The firmware version as reported by the device" + }, + "os": { + "$ref": "https://meta.comcast.com/firebolt/types#/definitions/SemanticVersion", + "description": "**Deprecated** Use `firmware`, instead." + }, + "debug": { + "type": "string", + "description": "Detailed version as a string, for debugging purposes" + } + }, + "required": [ + "api", + "firmware", + "os" + ] + }, + "NetworkInfoResult": { + "title": "NetworkInfoResult", + "type": "object", + "properties": { + "state": { + "$ref": "#/components/schemas/NetworkState" + }, + "type": { + "$ref": "#/components/schemas/NetworkType" + } + }, + "required": [ + "state", + "type" ] } } diff --git a/src/schemas/accessibility.json b/src/schemas/accessibility.json index ce6ad419a..e274d8b91 100644 --- a/src/schemas/accessibility.json +++ b/src/schemas/accessibility.json @@ -100,8 +100,7 @@ "title": "ClosedCaptionsSettings", "type": "object", "required": [ - "enabled", - "styles" + "enabled" ], "properties": { "enabled": { @@ -152,8 +151,7 @@ "title": "VoiceGuidanceSettings", "type": "object", "required": [ - "enabled", - "speed" + "enabled" ], "properties": { "enabled": { diff --git a/src/schemas/types.json b/src/schemas/types.json index 0caa49c1f..5d5eed60e 100644 --- a/src/schemas/types.json +++ b/src/schemas/types.json @@ -36,9 +36,7 @@ "enum": [ "stereo", "dolbyDigital5.1", - "dolbyDigital7.1", "dolbyDigital5.1+", - "dolbyDigital7.1+", "dolbyAtmos" ] }, diff --git a/src/sdks/core/sdk.config.json b/src/sdks/core/sdk.config.json index 14ba4d55c..f34bf72c8 100644 --- a/src/sdks/core/sdk.config.json +++ b/src/sdks/core/sdk.config.json @@ -23,7 +23,7 @@ "use": [ "xrn:firebolt:capability:advertising:configuration", "xrn:firebolt:capability:advertising:identifier", - "xrn:firebolt:capability:privacy:advertising" + "xrn:firebolt:capability:advertising:policy" ] }, { diff --git a/src/sdks/core/test/suite/advertising.test.ts b/src/sdks/core/test/suite/advertising.test.ts index 95ec53e77..9f788abd4 100644 --- a/src/sdks/core/test/suite/advertising.test.ts +++ b/src/sdks/core/test/suite/advertising.test.ts @@ -50,7 +50,7 @@ test("deviceAttributes()", () => { test("appBundleId()", () => { return Advertising.appBundleId().then((res: string) => { - expect(res).toBe("operator.app"); + expect(res).toBe("app.operator"); expect(typeof res).toBe("string"); }); });