tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

FxMSCommon.schema.json (4188B)


      1 {
      2  "description": "Common elements used across FxMS schemas",
      3  "$id": "file:///FxMSCommon.schema.json",
      4  "$defs": {
      5    "Message": {
      6      "type": "object",
      7      "properties": {
      8        "id": {
      9          "type": "string",
     10          "description": "The message identifier"
     11        },
     12        "groups": {
     13          "description": "Array of preferences used to control `enabled` status of the group. If any is `false` the group is disabled.",
     14          "type": "array",
     15          "items": {
     16            "type": "string",
     17            "description": "Preference name"
     18          }
     19        },
     20        "template": {
     21          "type": "string",
     22          "description": "Which messaging template this message is using."
     23        },
     24        "frequency": {
     25          "type": "object",
     26          "description": "An object containing frequency cap information for a message.",
     27          "properties": {
     28            "lifetime": {
     29              "type": "integer",
     30              "description": "The maximum lifetime impressions for a message.",
     31              "minimum": 1,
     32              "maximum": 100
     33            },
     34            "custom": {
     35              "type": "array",
     36              "description": "An array of custom frequency cap definitions.",
     37              "items": {
     38                "description": "A frequency cap definition containing time and max impression information",
     39                "type": "object",
     40                "properties": {
     41                  "period": {
     42                    "type": "integer",
     43                    "description": "Period of time in milliseconds (e.g. 86400000 for one day)"
     44                  },
     45                  "cap": {
     46                    "type": "integer",
     47                    "description": "The maximum impressions for the message within the defined period.",
     48                    "minimum": 1,
     49                    "maximum": 100
     50                  }
     51                },
     52                "required": ["period", "cap"]
     53              }
     54            }
     55          }
     56        },
     57        "priority": {
     58          "description": "The priority of the message. If there are two competing messages to show, the one with the highest priority will be shown",
     59          "type": "integer"
     60        },
     61        "order": {
     62          "description": "The order in which messages should be shown. Messages will be shown in increasing order.",
     63          "type": "integer"
     64        },
     65        "targeting": {
     66          "description": "A JEXL expression representing targeting information",
     67          "type": "string"
     68        },
     69        "trigger": {
     70          "description": "An action to trigger potentially showing the message",
     71          "type": "object",
     72          "properties": {
     73            "id": {
     74              "type": "string",
     75              "description": "A string identifying the trigger action"
     76            },
     77            "params": {
     78              "type": "array",
     79              "description": "An optional array of string parameters for the trigger action",
     80              "items": {
     81                "anyOf": [
     82                  {
     83                    "type": "integer"
     84                  },
     85                  {
     86                    "type": "string"
     87                  }
     88                ]
     89              }
     90            }
     91          },
     92          "required": ["id"]
     93        },
     94        "provider": {
     95          "description": "An identifier for the provider of this message, such as \"cfr\" or \"preview\".",
     96          "type": "string"
     97        }
     98      },
     99      "additionalProperties": true,
    100      "dependentRequired": {
    101        "content": ["id", "template"],
    102        "template": ["id", "content"]
    103      }
    104    },
    105    "localizedText": {
    106      "type": "object",
    107      "properties": {
    108        "string_id": {
    109          "description": "Id of localized string to be rendered.",
    110          "type": "string"
    111        }
    112      },
    113      "required": ["string_id"]
    114    },
    115    "localizableText": {
    116      "description": "Either a raw string or an object containing the string_id of the localized text",
    117      "oneOf": [
    118        {
    119          "type": "string",
    120          "description": "The string to be rendered."
    121        },
    122        {
    123          "$ref": "#/$defs/localizedText"
    124        }
    125      ]
    126    }
    127  }
    128 }