Skip to content

Commit

Permalink
fix: Get app-passthrough working with existing APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlacivita committed Mar 6, 2024
1 parent f9a0145 commit cb441d7
Show file tree
Hide file tree
Showing 12 changed files with 1,196 additions and 737 deletions.
292 changes: 37 additions & 255 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
],
"scripts": {
"fs:setup": "npm run clean && mkdir -p dist",
"validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas node_modules/@firebolt-js/schemas/src/schemas --schemas src/schemas --transformations",
"validate:each": "npx firebolt-openrpc validate --input src/openrpc --schemas src/schemas --transformations",
"validate:compiled": "npx firebolt-openrpc validate --input dist/firebolt-open-rpc.json && npm run validate --workspaces",
"validate": "npm run validate:each && npm run validate:compiled ",
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --output ./dist/firebolt-open-rpc.json --schemas node_modules/@firebolt-js/schemas/src/schemas --schemas src/schemas",
"compile": "npx firebolt-openrpc openrpc --input src --template src/template/openrpc/template.json --output ./dist/firebolt-open-rpc.json --schemas src/schemas",
"slice": "npm run slice --workspaces",
"sdks": "npm run sdk --workspaces",
"docs": "npm run docs --workspaces",
Expand Down Expand Up @@ -44,7 +44,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@firebolt-js/openrpc": "2.3.0",
"@firebolt-js/openrpc": "../firebolt-openrpc",
"@firebolt-js/schemas": "2.0.0",
"@saithodev/semantic-release-backmerge": "^3.2.0",
"@semantic-release/changelog": "^6.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ If the app provided method has an `event` tag then the provider method **MUST**
If an app provided method has no provider method then it is not a valid Firebolt OpenRPC method schema, and a validation error **MUST** be generated.

## 4. Selecting the best provider app

**TODO**: This entire section should be moved into a per-device config for the capability, and not specified in the OpenRPC.

A provider method's `capabilites` tag **MAY** have the `x-lifecycle` property which denotes which lifecycle states the providing app is allowed to be in during an app provided transaction.

If the `x-lifecycle` property is not present then it **MUST** be assumed to be `["foreground", "background", "inactive"]` for the remainder of this section.
Expand Down
298 changes: 295 additions & 3 deletions src/openrpc/discovery.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
{
"name": "capabilities",
"x-provides": "xrn:firebolt:capability:discovery:entity-info"
},
{
"name": "deprecated",
"x-alternative": "Discovery.details"
}
],
"summary": "Provide information about a program entity and its available watchable assets, such as entitlement status and price, via either a push or pull call flow.",
Expand Down Expand Up @@ -409,12 +413,194 @@
}
],
"result": {
"name": "success",
"name": "result",
"value": true
}
}
]
},
{
"name": "details",
"tags": [
{
"name": "push-pull",
"x-subscriber-type": "global"
},
{
"name": "capabilities",
"x-provides": "xrn:firebolt:capability:discovery:entity-info"
}
],
"summary": "Provide information about a program entity and its available watchable assets, such as entitlement status and price, via either a push or pull call flow.",
"description": "Provide information about a program entity and its available watchable assets, such as entitlement status and price, via either a push or pull call flow. Includes information about the program entity and its relevant associated entities, such as extras, previews, and, in the case of TV series, seasons and episodes.\n\nSee the `EntityInfo` and `WayToWatch` data structures below for more information.\n\nThe app only needs to implement Pull support for `entityInfo` at this time.",
"params": [
{
"name": "entityId",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "result",
"required": true,
"schema": {
"$ref": "https://meta.comcast.com/firebolt/discovery#/definitions/DetailsResult"
},
"summary": "The entityInfo data."
}
],
"result": {
"name": "result",
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Send entity info for a movie to the platform.",
"params": [
{
"name": "entityId",
"value": "345"
},
{
"name": "result",
"value": {
"expires": "2025-01-01T00:00:00.000Z",
"details": {
"identifiers": {
"entityId": "345",
"entityType": "program",
"programType": "movie"
},
"info": {
"title": "Cool Runnings",
"synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.",
"releaseDate": "1993-01-01T00:00:00.000Z",
"contentRatings": [
{
"scheme": "US-Movie",
"rating": "PG"
},
{
"scheme": "CA-Movie",
"rating": "G"
}
]
},
"waysToWatch": [
{
"identifiers": {
"assetId": "123"
},
"expires": "2025-01-01T00:00:00.000Z",
"entitled": true,
"entitledExpires": "2025-01-01T00:00:00.000Z",
"offeringType": "buy",
"price": 2.99,
"videoQuality": [
"UHD"
],
"audioProfile": [
"dolbyAtmos"
],
"audioLanguages": [
"en"
],
"closedCaptions": [
"en"
],
"subtitles": [
"es"
],
"audioDescriptions": [
"en"
]
}
]
}
}
}
],
"result": {
"name": "result",
"value": null
}
},
{
"name": "Send entity info for a movie with a trailer to the platform.",
"params": [
{
"name": "entityId",
"value": "345"
},
{
"name": "result",
"value": {
"expires": "2025-01-01T00:00:00.000Z",
"details": {
"identifiers": {
"entityId": "345",
"entityType": "program",
"programType": "movie"
},
"info": {
"title": "Cool Runnings",
"synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.",
"releaseDate": "1993-01-01T00:00:00.000Z",
"contentRatings": [
{
"scheme": "US-Movie",
"rating": "PG"
},
{
"scheme": "CA-Movie",
"rating": "G"
}
]
},
"waysToWatch": [
{
"identifiers": {
"assetId": "123"
},
"expires": "2025-01-01T00:00:00.000Z",
"entitled": true,
"entitledExpires": "2025-01-01T00:00:00.000Z",
"offeringType": "buy",
"price": 2.99,
"videoQuality": [
"UHD"
],
"audioProfile": [
"dolbyAtmos"
],
"audioLanguages": [
"en"
],
"closedCaptions": [
"en"
],
"subtitles": [
"es"
],
"audioDescriptions": [
"en"
]
}
]
}
}
}
],
"result": {
"name": "result",
"value": null
}
}
]
},
{
"name": "purchasedContent",
"tags": [
Expand All @@ -424,7 +610,11 @@
{
"name": "capabilities",
"x-provides": "xrn:firebolt:capability:discovery:purchased-content"
}
},
{
"name": "deprecated",
"x-alternative": "Discovery.purchases"
}
],
"summary": "Provide a list of purchased content for the authenticated account, such as rentals and electronic sell through purchases.",
"params": [
Expand Down Expand Up @@ -530,6 +720,108 @@
],
"description": "Return content purchased by the user, such as rentals and electronic sell through purchases.\n\nThe app should return the user's 100 most recent purchases in `entries`. The total count of purchases must be provided in `count`. If `count` is greater than the total number of `entries`, the UI may provide a link into the app to see the complete purchase list.\n\nThe `EntityInfo` object returned is not required to have `waysToWatch` populated, but it is recommended that it do so in case the UI wants to surface additional information on the purchases screen.\n\nThe app should implement both Push and Pull methods for `purchasedContent`.\n\nThe app should actively push `purchasedContent` when:\n\n* The app becomes Active.\n* When the state of the purchasedContent set has changed.\n* The app goes into Inactive or Background state, if there is a chance a change event has been missed."
},
{
"name": "purchases",
"tags": [
{
"name": "push-pull"
},
{
"name": "capabilities",
"x-provides": "xrn:firebolt:capability:discovery:purchased-content"
}
],
"summary": "Provide a list of purchased content for the authenticated account, such as rentals and electronic sell through purchases.",
"params": [
{
"name": "result",
"required": true,
"schema": {
"$ref": "https://meta.comcast.com/firebolt/discovery#/definitions/DetailsArrayResult"
},
"summary": "The data for the purchasedContent"
}
],
"result": {
"name": "result",
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Inform the platform of the user's purchased content",
"params": [
{
"name": "result",
"value": {
"totalCount": 10,
"expires": "2025-01-01T00:00:00.000Z",
"entries": [
{
"identifiers": {
"entityId": "345",
"entityType": "program",
"programType": "movie"
},
"info": {
"title": "Cool Runnings",
"synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.",
"releaseDate": "1993-01-01T00:00:00.000Z",
"contentRatings": [
{
"scheme": "US-Movie",
"rating": "PG"
},
{
"scheme": "CA-Movie",
"rating": "G"
}
]
},
"waysToWatch": [
{
"identifiers": {
"assetId": "123"
},
"expires": "2025-01-01T00:00:00.000Z",
"entitled": true,
"entitledExpires": "2025-01-01T00:00:00.000Z",
"offeringType": "buy",
"price": 2.99,
"videoQuality": [
"UHD"
],
"audioProfile": [
"dolbyAtmos"
],
"audioLanguages": [
"en"
],
"closedCaptions": [
"en"
],
"subtitles": [
"es"
],
"audioDescriptions": [
"en"
]
}
]
}
]
}
}
],
"result": {
"name": "result",
"value": null
}
}
],
"description": "Return content purchased by the user, such as rentals and electronic sell through purchases.\n\nThe app should return the user's 100 most recent purchases in `entries`. The total count of purchases must be provided in `count`. If `count` is greater than the total number of `entries`, the UI may provide a link into the app to see the complete purchase list.\n\nThe `EntityInfo` object returned is not required to have `waysToWatch` populated, but it is recommended that it do so in case the UI wants to surface additional information on the purchases screen.\n\nThe app should implement both Push and Pull methods for `purchasedContent`.\n\nThe app should actively push `purchasedContent` when:\n\n* The app becomes Active.\n* When the state of the purchasedContent set has changed.\n* The app goes into Inactive or Background state, if there is a chance a change event has been missed."
},
{
"name": "watched",
"summary": "Notify the platform that content was partially or completely watched",
Expand Down Expand Up @@ -636,7 +928,7 @@
"name": "identifiers",
"summary": "A set of content identifiers for this call to action",
"schema": {
"$ref": "https://meta.comcast.com/firebolt/entertainment#/definitions/ContentIdentifiers"
"$ref": "https://meta.comcast.com/firebolt/entity#/definitions/Entity"
},
"required": true
},
Expand Down
Loading

0 comments on commit cb441d7

Please sign in to comment.