- Print
Capabilities
- Print
Capabilities Module 1.0.0
Usage
To use the Capabilities module, you can import it into your project from the Firebolt SDK:
import { Capabilities } from '@firebolt-js/sdk'
Overview
The Capabilities module provides information about which discreet unit of functionality is enabled for the apps.
Methods
available
Returns whether a capability is available now.
function available(capability: Capability): Promise<boolean>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Promise resolution:
boolean
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Device Token.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.available("xrn:firebolt:capability:token:device")
.then(available => {
console.log(available)
})
Value of available
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.available",
"params": {
"capability": "xrn:firebolt:capability:token:device"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
Unavailable Platform token.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.available("xrn:firebolt:capability:token:platform")
.then(available => {
console.log(available)
})
Value of available
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.available",
"params": {
"capability": "xrn:firebolt:capability:token:platform"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
granted
Returns whether the current App has a user grant for passed capability and role.
function granted(capability: Capability, options?: CapabilityOption): Promise<boolean | void>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
, | options | CapabilityOption | false |
Promise resolution:
boolean | void
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Default capabilities without grants.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.granted("xrn:firebolt:capability:input:keyboard", null)
.then(granted => {
console.log(granted)
})
Value of granted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.granted",
"params": {
"capability": "xrn:firebolt:capability:input:keyboard"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
Get Postal code without grants.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.granted("xrn:firebolt:capability:localization:postal-code", null)
.then(granted => {
console.log(granted)
})
Value of granted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.granted",
"params": {
"capability": "xrn:firebolt:capability:localization:postal-code"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
Get Postal code with grants.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.granted("xrn:firebolt:capability:localization:postal-code", null)
.then(granted => {
console.log(granted)
})
Value of granted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.granted",
"params": {
"capability": "xrn:firebolt:capability:localization:postal-code"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
info
Returns an array of CapabilityInfo objects for the passed in capabilities.
function info(capabilities: Capability[]): Promise<CapabilityInfo[]>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capabilities | Capability[] | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Promise resolution:
CapabilityInfo[]
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Default result
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.info([
"xrn:firebolt:capability:device:model",
"xrn:firebolt:capability:input:keyboard",
"xrn:firebolt:capability:protocol:bluetoothle",
"xrn:firebolt:capability:token:device",
"xrn:firebolt:capability:token:platform",
"xrn:firebolt:capability:protocol:moca",
"xrn:firebolt:capability:wifi:scan",
"xrn:firebolt:capability:localization:postal-code",
"xrn:firebolt:capability:localization:locality"
])
.then(info => {
console.log(info)
})
Value of info
:
[
{
"capability": "xrn:firebolt:capability:device:model",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:input:keyboard",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:protocol:bluetoothle",
"supported": false,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unsupported"
]
},
{
"capability": "xrn:firebolt:capability:token:device",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unavailable"
]
},
{
"capability": "xrn:firebolt:capability:protocol:moca",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"disabled",
"unavailable"
]
},
{
"capability": "xrn:firebolt:capability:wifi:scan",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unpermitted"
]
},
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": null
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"ungranted"
]
},
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"ungranted"
]
},
{
"capability": "xrn:firebolt:capability:localization:locality",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"grantDenied",
"ungranted"
]
}
]
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.info",
"params": {
"capabilities": [
"xrn:firebolt:capability:device:model",
"xrn:firebolt:capability:input:keyboard",
"xrn:firebolt:capability:protocol:bluetoothle",
"xrn:firebolt:capability:token:device",
"xrn:firebolt:capability:token:platform",
"xrn:firebolt:capability:protocol:moca",
"xrn:firebolt:capability:wifi:scan",
"xrn:firebolt:capability:localization:postal-code",
"xrn:firebolt:capability:localization:locality"
]
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"capability": "xrn:firebolt:capability:device:model",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:input:keyboard",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:protocol:bluetoothle",
"supported": false,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unsupported"
]
},
{
"capability": "xrn:firebolt:capability:token:device",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
},
{
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unavailable"
]
},
{
"capability": "xrn:firebolt:capability:protocol:moca",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"disabled",
"unavailable"
]
},
{
"capability": "xrn:firebolt:capability:wifi:scan",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unpermitted"
]
},
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": null
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"ungranted"
]
},
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"ungranted"
]
},
{
"capability": "xrn:firebolt:capability:localization:locality",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"grantDenied",
"ungranted"
]
}
]
}
listen
To listen to a specific event pass the event name as the first parameter:
listen(event: string, callback: (data: any) => void): Promise<number>
Parameters:
Param | Type | Required | Summary |
---|---|---|---|
event | string | Yes | The event to listen for, see Events. |
callback | function | Yes | A function that will be invoked when the event occurs. |
Promise resolution:
Type | Description |
---|---|
number | Listener ID to clear the callback method and stop receiving the event, e.g. Capabilities.clear(id) |
Callback parameters:
Param | Type | Required | Summary |
---|---|---|---|
data | any | Yes | The event data, which depends on which event is firing, see Events. |
To listen to all events from this module pass only a callback, without specifying an event name:
listen(callback: (event: string, data: any) => void): Promise<number>
Parameters:
Param | Type | Required | Summary |
---|---|---|---|
callback | function | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see Events. |
Callback parameters:
Param | Type | Required | Summary |
---|---|---|---|
event | string | Yes | The event that has occured listen for, see Events. |
data | any | Yes | The event data, which depends on which event is firing, see Events. |
Promise resolution:
Type | Description |
---|---|
number | Listener ID to clear the callback method and stop receiving the event, e.g. Capabilities.clear(id) |
See Listening for events for more information and examples.
once
To listen to a single instance of a specific event pass the event name as the first parameter:
once(event: string, callback: (data: any) => void): Promise<number>
The once
method will only pass the next instance of this event, and then dicard the listener you provided.
Parameters:
Param | Type | Required | Summary |
---|---|---|---|
event | string | Yes | The event to listen for, see Events. |
callback | function | Yes | A function that will be invoked when the event occurs. |
Promise resolution:
Type | Description |
---|---|
number | Listener ID to clear the callback method and stop receiving the event, e.g. Capabilities.clear(id) |
Callback parameters:
Param | Type | Required | Summary |
---|---|---|---|
data | any | Yes | The event data, which depends on which event is firing, see Events. |
To listen to the next instance only of any events from this module pass only a callback, without specifying an event name:
once(callback: (event: string, data: any) => void): Promise<number>
Parameters:
Param | Type | Required | Summary |
---|---|---|---|
callback | function | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see Events. |
Callback parameters:
Param | Type | Required | Summary |
---|---|---|---|
event | string | Yes | The event that has occured listen for, see Events. |
data | any | Yes | The event data, which depends on which event is firing, see Events. |
Promise resolution:
Type | Description |
---|---|
number | Listener ID to clear the callback method and stop receiving the event, e.g. Capabilities.clear(id) |
See Listening for events for more information and examples.
permitted
Returns whether the current App has permission to the passed capability and role.
function permitted(capability: Capability, options?: CapabilityOption): Promise<boolean>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
, | options | CapabilityOption | false |
Promise resolution:
boolean
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Keyboard
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.permitted("xrn:firebolt:capability:input:keyboard", null)
.then(permitted => {
console.log(permitted)
})
Value of permitted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.permitted",
"params": {
"capability": "xrn:firebolt:capability:input:keyboard"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
Keyboard incorrect manage role capability
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.permitted("xrn:firebolt:capability:input:keyboard", {"role":"manage"})
.then(permitted => {
console.log(permitted)
})
Value of permitted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.permitted",
"params": {
"capability": "xrn:firebolt:capability:input:keyboard",
"options": {
"role": "manage"
}
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
Wifi scan not permitted capability
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.permitted("xrn:firebolt:capability:wifi:scan", null)
.then(permitted => {
console.log(permitted)
})
Value of permitted
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.permitted",
"params": {
"capability": "xrn:firebolt:capability:wifi:scan"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
request
Requests grants for all capability/role combinations in the roles array.
function request(grants: Permission[]): Promise<CapabilityInfo[]>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
grants | Permission[] | true |
Promise resolution:
CapabilityInfo[]
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:request |
Examples
Default result
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.request([{"role":"use","capability":"xrn:firebolt:capability:commerce:purchase"}])
.then(request => {
console.log(request)
})
Value of request
:
[
{
"capability": "xrn:firebolt:capability:commerce:purchase",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
}
]
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.request",
"params": {
"grants": [
{
"role": "use",
"capability": "xrn:firebolt:capability:commerce:purchase"
}
]
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"capability": "xrn:firebolt:capability:commerce:purchase",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
}
]
}
supported
Returns whether the platform supports the passed capability.
function supported(capability: Capability): Promise<boolean>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Promise resolution:
boolean
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Wifi scan supported capability
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.supported("xrn:firebolt:capability:wifi:scan")
.then(supported => {
console.log(supported)
})
Value of supported
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.supported",
"params": {
"capability": "xrn:firebolt:capability:wifi:scan"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
BLE protocol unsupported capability
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.supported("xrn:firebolt:capability:protocol:bluetoothle")
.then(supported => {
console.log(supported)
})
Value of supported
:
true
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.supported",
"params": {
"capability": "xrn:firebolt:capability:protocol:bluetoothle"
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
Events
available
function listen('available', capability: Capability, (CapabilityInfo) => void): Promise<number>
See also: listen(), once(), clear().
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Event value:
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Platform token is available
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.listen('available', value => {
console.log(value)
})
Value of value
:
{
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unpermitted"
]
}
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.onAvailable",
"params": {
"capability": "xrn:firebolt:capability:token:platform",
"listen": true
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unpermitted"
]
}
}
granted
function listen('granted', role: Role, capability: Capability, (CapabilityInfo) => void): Promise<number>
See also: listen(), once(), clear().
Parameters:
Param | Type | Required | Description |
---|---|---|---|
role | Role | true | values: 'use' | 'manage' | 'provide' |
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Event value:
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Postal code granted
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.listen('granted', value => {
console.log(value)
})
Value of value
:
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
}
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.onGranted",
"params": {
"role": "use",
"capability": "xrn:firebolt:capability:localization:postal-code",
"listen": true
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
}
}
}
revoked
function listen('revoked', role: Role, capability: Capability, (CapabilityInfo) => void): Promise<number>
See also: listen(), once(), clear().
Parameters:
Param | Type | Required | Description |
---|---|---|---|
role | Role | true | values: 'use' | 'manage' | 'provide' |
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Event value:
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Postal code revoked
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.listen('revoked', value => {
console.log(value)
})
Value of value
:
{
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"grantDenied"
]
}
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.onRevoked",
"params": {
"role": "use",
"capability": "xrn:firebolt:capability:localization:postal-code",
"listen": true
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capability": "xrn:firebolt:capability:localization:postal-code",
"supported": true,
"available": true,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"grantDenied"
]
}
}
unavailable
function listen('unavailable', capability: Capability, (CapabilityInfo) => void): Promise<number>
See also: listen(), once(), clear().
Parameters:
Param | Type | Required | Description |
---|---|---|---|
capability | Capability | true | pattern: ^xrn:firebolt:capability:([a-z0-9-]+)((:[a-z0-9-]+)?)$ |
Event value:
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:capabilities:info |
Examples
Platform token is unavailable.
JavaScript:
import { Capabilities } from '@firebolt-js/sdk'
Capabilities.listen('unavailable', value => {
console.log(value)
})
Value of value
:
{
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unavailable"
]
}
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Capabilities.onUnavailable",
"params": {
"capability": "xrn:firebolt:capability:token:platform",
"listen": true
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capability": "xrn:firebolt:capability:token:platform",
"supported": true,
"available": false,
"use": {
"permitted": true,
"granted": true
},
"manage": {
"permitted": true,
"granted": true
},
"provide": {
"permitted": true,
"granted": true
},
"details": [
"unavailable"
]
}
}
Types
CapabilityOption
type CapabilityOption = {
role?: Role // Role provides access level for the app for a given capability.
}
See also:
'use' | 'manage' | 'provide'