@mozilla/nimbus-schemas 2024.9.3 → 2024.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,265 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3
+ "title": "DesktopFeature",
4
+ "description": "A feature.",
5
+ "type": "object",
6
+ "properties": {
7
+ "description": {
8
+ "description": "The description of the feature.",
9
+ "type": "string"
10
+ },
11
+ "hasExposure": {
12
+ "description": "Whether or not this feature records exposure telemetry.",
13
+ "type": "boolean"
14
+ },
15
+ "exposureDescription": {
16
+ "description": "A description of the exposure telemetry collected by this feature. Only required if hasExposure is true.",
17
+ "type": "string"
18
+ },
19
+ "owner": {
20
+ "description": "The owner of the feature.",
21
+ "type": "string"
22
+ },
23
+ "isEarlyStartup": {
24
+ "description": "If true, the feature values will be cached in prefs so that they can be read before Nimbus is initialized during Firefox startup.",
25
+ "type": "boolean"
26
+ },
27
+ "applications": {
28
+ "description": "The applications that can enroll in experiments for this feature. Defaults to \"firefox-desktop\".",
29
+ "items": {
30
+ "$ref": "#/$defs/DesktopApplication"
31
+ },
32
+ "minLength": 1,
33
+ "type": "array"
34
+ },
35
+ "variables": {
36
+ "additionalProperties": {
37
+ "$ref": "#/$defs/DesktopFeatureVariable"
38
+ },
39
+ "description": "The variables that this feature can set.",
40
+ "type": "object"
41
+ },
42
+ "schema": {
43
+ "$ref": "#/$defs/NimbusFeatureSchema",
44
+ "description": "An optional JSON schema that describes the feature variables."
45
+ }
46
+ },
47
+ "required": [
48
+ "description",
49
+ "hasExposure",
50
+ "owner",
51
+ "variables"
52
+ ],
53
+ "if": {
54
+ "properties": {
55
+ "hasExposure": {
56
+ "const": true
57
+ }
58
+ }
59
+ },
60
+ "then": {
61
+ "required": [
62
+ "exposureDescription"
63
+ ]
64
+ },
65
+ "$defs": {
66
+ "DesktopApplication": {
67
+ "enum": [
68
+ "firefox-desktop",
69
+ "firefox-desktop-background-task"
70
+ ],
71
+ "type": "string"
72
+ },
73
+ "DesktopFeatureVariable": {
74
+ "dependentSchemas": {
75
+ "enum": {
76
+ "allOf": [
77
+ {
78
+ "if": {
79
+ "properties": {
80
+ "type": {
81
+ "const": "string"
82
+ }
83
+ }
84
+ },
85
+ "then": {
86
+ "properties": {
87
+ "enum": {
88
+ "items": {
89
+ "type": "string"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "if": {
97
+ "properties": {
98
+ "type": {
99
+ "const": "int"
100
+ }
101
+ }
102
+ },
103
+ "then": {
104
+ "properties": {
105
+ "enum": {
106
+ "items": {
107
+ "type": "integer"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ {
114
+ "if": {
115
+ "properties": {
116
+ "type": {
117
+ "const": "boolean"
118
+ }
119
+ }
120
+ },
121
+ "then": {
122
+ "properties": {
123
+ "enum": {
124
+ "const": null
125
+ }
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "if": {
131
+ "properties": {
132
+ "type": {
133
+ "const": "json"
134
+ }
135
+ }
136
+ },
137
+ "then": {
138
+ "properties": {
139
+ "enum": {
140
+ "const": null
141
+ }
142
+ }
143
+ }
144
+ }
145
+ ]
146
+ },
147
+ "fallbackPref": {
148
+ "description": "setPref is mutually exclusive with fallbackPref",
149
+ "properties": {
150
+ "setPref": {
151
+ "const": null
152
+ }
153
+ }
154
+ },
155
+ "setPref": {
156
+ "description": "fallbackPref is mutually exclusive with setPref",
157
+ "properties": {
158
+ "fallbackPref": {
159
+ "const": null
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "description": "A feature variable.",
165
+ "properties": {
166
+ "description": {
167
+ "description": "A description of the feature.",
168
+ "type": "string"
169
+ },
170
+ "type": {
171
+ "$ref": "#/$defs/FeatureVariableType",
172
+ "description": "The field type."
173
+ },
174
+ "enum": {
175
+ "anyOf": [
176
+ {
177
+ "items": {
178
+ "type": "string"
179
+ },
180
+ "type": "array"
181
+ },
182
+ {
183
+ "items": {
184
+ "type": "integer"
185
+ },
186
+ "type": "array"
187
+ }
188
+ ],
189
+ "description": "An optional list of possible string or integer values. Only allowed when type is string or int. The types in the enum must match the type of the field."
190
+ },
191
+ "fallbackPref": {
192
+ "description": "A pref that provides the default value for a feature when none is present.",
193
+ "type": "string"
194
+ },
195
+ "setPref": {
196
+ "anyOf": [
197
+ {
198
+ "type": "string"
199
+ },
200
+ {
201
+ "$ref": "#/$defs/SetPref"
202
+ }
203
+ ],
204
+ "description": "A pref that should be set to the value of this variable when enrolling in experiments. Using a string is deprecated and unsupported in Firefox 124+."
205
+ }
206
+ },
207
+ "required": [
208
+ "description",
209
+ "type"
210
+ ],
211
+ "type": "object"
212
+ },
213
+ "FeatureVariableType": {
214
+ "enum": [
215
+ "int",
216
+ "string",
217
+ "boolean",
218
+ "json"
219
+ ],
220
+ "type": "string"
221
+ },
222
+ "NimbusFeatureSchema": {
223
+ "description": "Information about a JSON schema.",
224
+ "properties": {
225
+ "uri": {
226
+ "description": "The resource:// or chrome:// URI that can be loaded at runtime within Firefox. Required by Firefox so that Nimbus can import the schema for validation.",
227
+ "type": "string"
228
+ },
229
+ "path": {
230
+ "description": "The path to the schema file in the source checkout. Required by Experimenter so that it can find schema files in source checkouts.",
231
+ "type": "string"
232
+ }
233
+ },
234
+ "required": [
235
+ "uri",
236
+ "path"
237
+ ],
238
+ "type": "object"
239
+ },
240
+ "PrefBranch": {
241
+ "enum": [
242
+ "default",
243
+ "user"
244
+ ],
245
+ "type": "string"
246
+ },
247
+ "SetPref": {
248
+ "properties": {
249
+ "branch": {
250
+ "$ref": "#/$defs/PrefBranch",
251
+ "description": "The branch the pref will be set on. Prefs set on the user branch persists through restarts."
252
+ },
253
+ "pref": {
254
+ "description": "The name of the pref to set.",
255
+ "type": "string"
256
+ }
257
+ },
258
+ "required": [
259
+ "branch",
260
+ "pref"
261
+ ],
262
+ "type": "object"
263
+ }
264
+ }
265
+ }
@@ -0,0 +1,272 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
3
+ "title": "DesktopFeatureManifest",
4
+ "description": "The Firefox Desktop-specific feature manifest. Firefox Desktop requires different fields for its features compared to the general Nimbus feature manifest.",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "$ref": "#/$defs/DesktopFeature"
8
+ },
9
+ "$defs": {
10
+ "DesktopApplication": {
11
+ "enum": [
12
+ "firefox-desktop",
13
+ "firefox-desktop-background-task"
14
+ ],
15
+ "type": "string"
16
+ },
17
+ "DesktopFeature": {
18
+ "description": "A feature.",
19
+ "if": {
20
+ "properties": {
21
+ "hasExposure": {
22
+ "const": true
23
+ }
24
+ }
25
+ },
26
+ "properties": {
27
+ "description": {
28
+ "description": "The description of the feature.",
29
+ "type": "string"
30
+ },
31
+ "hasExposure": {
32
+ "description": "Whether or not this feature records exposure telemetry.",
33
+ "type": "boolean"
34
+ },
35
+ "exposureDescription": {
36
+ "description": "A description of the exposure telemetry collected by this feature. Only required if hasExposure is true.",
37
+ "type": "string"
38
+ },
39
+ "owner": {
40
+ "description": "The owner of the feature.",
41
+ "type": "string"
42
+ },
43
+ "isEarlyStartup": {
44
+ "description": "If true, the feature values will be cached in prefs so that they can be read before Nimbus is initialized during Firefox startup.",
45
+ "type": "boolean"
46
+ },
47
+ "applications": {
48
+ "description": "The applications that can enroll in experiments for this feature. Defaults to \"firefox-desktop\".",
49
+ "items": {
50
+ "$ref": "#/$defs/DesktopApplication"
51
+ },
52
+ "minLength": 1,
53
+ "type": "array"
54
+ },
55
+ "variables": {
56
+ "additionalProperties": {
57
+ "$ref": "#/$defs/DesktopFeatureVariable"
58
+ },
59
+ "description": "The variables that this feature can set.",
60
+ "type": "object"
61
+ },
62
+ "schema": {
63
+ "$ref": "#/$defs/NimbusFeatureSchema",
64
+ "description": "An optional JSON schema that describes the feature variables."
65
+ }
66
+ },
67
+ "required": [
68
+ "description",
69
+ "hasExposure",
70
+ "owner",
71
+ "variables"
72
+ ],
73
+ "then": {
74
+ "required": [
75
+ "exposureDescription"
76
+ ]
77
+ },
78
+ "type": "object"
79
+ },
80
+ "DesktopFeatureVariable": {
81
+ "dependentSchemas": {
82
+ "enum": {
83
+ "allOf": [
84
+ {
85
+ "if": {
86
+ "properties": {
87
+ "type": {
88
+ "const": "string"
89
+ }
90
+ }
91
+ },
92
+ "then": {
93
+ "properties": {
94
+ "enum": {
95
+ "items": {
96
+ "type": "string"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ },
102
+ {
103
+ "if": {
104
+ "properties": {
105
+ "type": {
106
+ "const": "int"
107
+ }
108
+ }
109
+ },
110
+ "then": {
111
+ "properties": {
112
+ "enum": {
113
+ "items": {
114
+ "type": "integer"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ },
120
+ {
121
+ "if": {
122
+ "properties": {
123
+ "type": {
124
+ "const": "boolean"
125
+ }
126
+ }
127
+ },
128
+ "then": {
129
+ "properties": {
130
+ "enum": {
131
+ "const": null
132
+ }
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "if": {
138
+ "properties": {
139
+ "type": {
140
+ "const": "json"
141
+ }
142
+ }
143
+ },
144
+ "then": {
145
+ "properties": {
146
+ "enum": {
147
+ "const": null
148
+ }
149
+ }
150
+ }
151
+ }
152
+ ]
153
+ },
154
+ "fallbackPref": {
155
+ "description": "setPref is mutually exclusive with fallbackPref",
156
+ "properties": {
157
+ "setPref": {
158
+ "const": null
159
+ }
160
+ }
161
+ },
162
+ "setPref": {
163
+ "description": "fallbackPref is mutually exclusive with setPref",
164
+ "properties": {
165
+ "fallbackPref": {
166
+ "const": null
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "description": "A feature variable.",
172
+ "properties": {
173
+ "description": {
174
+ "description": "A description of the feature.",
175
+ "type": "string"
176
+ },
177
+ "type": {
178
+ "$ref": "#/$defs/FeatureVariableType",
179
+ "description": "The field type."
180
+ },
181
+ "enum": {
182
+ "anyOf": [
183
+ {
184
+ "items": {
185
+ "type": "string"
186
+ },
187
+ "type": "array"
188
+ },
189
+ {
190
+ "items": {
191
+ "type": "integer"
192
+ },
193
+ "type": "array"
194
+ }
195
+ ],
196
+ "description": "An optional list of possible string or integer values. Only allowed when type is string or int. The types in the enum must match the type of the field."
197
+ },
198
+ "fallbackPref": {
199
+ "description": "A pref that provides the default value for a feature when none is present.",
200
+ "type": "string"
201
+ },
202
+ "setPref": {
203
+ "anyOf": [
204
+ {
205
+ "type": "string"
206
+ },
207
+ {
208
+ "$ref": "#/$defs/SetPref"
209
+ }
210
+ ],
211
+ "description": "A pref that should be set to the value of this variable when enrolling in experiments. Using a string is deprecated and unsupported in Firefox 124+."
212
+ }
213
+ },
214
+ "required": [
215
+ "description",
216
+ "type"
217
+ ],
218
+ "type": "object"
219
+ },
220
+ "FeatureVariableType": {
221
+ "enum": [
222
+ "int",
223
+ "string",
224
+ "boolean",
225
+ "json"
226
+ ],
227
+ "type": "string"
228
+ },
229
+ "NimbusFeatureSchema": {
230
+ "description": "Information about a JSON schema.",
231
+ "properties": {
232
+ "uri": {
233
+ "description": "The resource:// or chrome:// URI that can be loaded at runtime within Firefox. Required by Firefox so that Nimbus can import the schema for validation.",
234
+ "type": "string"
235
+ },
236
+ "path": {
237
+ "description": "The path to the schema file in the source checkout. Required by Experimenter so that it can find schema files in source checkouts.",
238
+ "type": "string"
239
+ }
240
+ },
241
+ "required": [
242
+ "uri",
243
+ "path"
244
+ ],
245
+ "type": "object"
246
+ },
247
+ "PrefBranch": {
248
+ "enum": [
249
+ "default",
250
+ "user"
251
+ ],
252
+ "type": "string"
253
+ },
254
+ "SetPref": {
255
+ "properties": {
256
+ "branch": {
257
+ "$ref": "#/$defs/PrefBranch",
258
+ "description": "The branch the pref will be set on. Prefs set on the user branch persists through restarts."
259
+ },
260
+ "pref": {
261
+ "description": "The name of the pref to set.",
262
+ "type": "string"
263
+ }
264
+ },
265
+ "required": [
266
+ "branch",
267
+ "pref"
268
+ ],
269
+ "type": "object"
270
+ }
271
+ }
272
+ }