summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/asrouter/schemas/message-group.schema.json
blob: 421acf159a40cbc46c2a9c2caaa6330316398027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  "title": "MessageGroup",
  "description": "Configuration object for groups of Messaging System messages",
  "type": "object",
  "version": "1.0.0",
  "properties": {
    "id": {
      "type": "string",
      "description": "A unique identifier for the message that should not conflict with any other previous message."
    },
    "enabled": {
      "type": "boolean",
      "description": "Enables or disables all messages associated with this group."
    },
    "userPreferences": {
      "type": "array",
      "description": "Collection of preferences that control if the group is enabled.",
      "items": {
        "type": "string",
        "description": "Preference name"
      }
    },
    "frequency": {
      "type": "object",
      "description": "An object containing frequency cap information for a message.",
      "properties": {
        "lifetime": {
          "type": "integer",
          "description": "The maximum lifetime impressions for a message.",
          "minimum": 1,
          "maximum": 100
        },
        "custom": {
          "type": "array",
          "description": "An array of custom frequency cap definitions.",
          "items": {
            "description": "A frequency cap definition containing time and max impression information",
            "type": "object",
            "properties": {
              "period": {
                "type": "integer",
                "description": "Period of time in milliseconds (e.g. 86400000 for one day)"
              },
              "cap": {
                "type": "integer",
                "description": "The maximum impressions for the message within the defined period.",
                "minimum": 1,
                "maximum": 100
              }
            },
            "required": ["period", "cap"]
          }
        }
      }
    },
    "type": {
      "type": "string",
      "description": "Local auto-generated group or remote group configuration from RS.",
      "enum": ["remote-settings", "local", "default"]
    }
  },
  "required": ["id", "enabled", "type"],
  "additionalProperties": true
}