summaryrefslogtreecommitdiffstats
path: root/browser/components/extensions/schemas/normandyAddonStudy.json
blob: 61075ab90e796066020fe2ef574b2fa2a246aafc (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "PermissionPrivileged",
        "choices": [
          {
            "type": "string",
            "enum": ["normandyAddonStudy"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "normandyAddonStudy",
    "description": "Normandy Study API",
    "allowedContexts": ["content", "devtools"],
    "defaultContexts": ["content", "devtools"],
    "permissions": ["normandyAddonStudy"],
    "types": [
      {
        "id": "Study",
        "type": "object",
        "properties": {
          "recipeId": {
            "type": "integer",
            "description": "The ID of the recipe for the study."
          },
          "slug": {
            "type": "string",
            "description": "A slug to identify the study."
          },
          "userFacingName": {
            "type": "string",
            "description": "The name presented on about:studies."
          },
          "userFacingDescription": {
            "type": "string",
            "description": "The description presented on about:studies."
          },
          "branch": {
            "type": "string",
            "description": "The study branch in which the user is enrolled."
          },
          "active": {
            "type": "boolean",
            "description": "The state of the study."
          },
          "addonId": {
            "type": "string",
            "description": "The ID of the extension installed by the study."
          },
          "addonUrl": {
            "type": "string",
            "description": "The URL of the XPI that was downloaded and installed by the study."
          },
          "addonVersion": {
            "type": "string",
            "description": "The version of the extension installed by the study."
          },
          "studyStartDate": {
            "$ref": "extensionTypes.Date",
            "description": "The start date for the study."
          },
          "studyEndDate": {
            "$ref": "extensionTypes.Date",
            "description": "The end date for the study."
          },
          "extensionApiId": {
            "type": "integer",
            "description": "The record ID for the extension in Normandy server's database."
          },
          "extensionHash": {
            "type": "string",
            "description": "A hash of the extension XPI file."
          },
          "extensionHashAlgorithm": {
            "type": "string",
            "description": "The algorithm used to hash the extension XPI file."
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getStudy",
        "type": "function",
        "description": "Returns a study object for the current study.",
        "async": true,
        "parameters": []
      },
      {
        "name": "endStudy",
        "type": "function",
        "description": "Marks the study as ended and then uninstalls the addon.",
        "async": true,
        "parameters": [
          {
            "type": "string",
            "name": "reason",
            "description": "The reason why the study is ending."
          }
        ]
      },
      {
        "name": "getClientMetadata",
        "type": "function",
        "description": "Returns an object with metadata about the client which may be required for constructing survey URLs.",
        "async": true,
        "parameters": []
      }
    ],
    "events": [
      {
        "name": "onUnenroll",
        "type": "function",
        "description": "Fired when a user unenrolls from a study but before the addon is uninstalled.",
        "parameters": [
          {
            "type": "string",
            "name": "reason",
            "description": "The reason why the study is ending."
          }
        ]
      }
    ]
  }
]