summaryrefslogtreecommitdiffstats
path: root/toolkit/components/search/schema/search-config-schema.json
blob: c902044b85b9fe227564f22cacbddac7dde471d0 (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
{
  "type": "object",
  "required": ["webExtension"],
  "properties": {
    "default": {
      "$ref": "#/definitions/default"
    },
    "defaultPrivate": {
      "$ref": "#/definitions/defaultPrivate"
    },
    "orderHint": {
      "$ref": "#/definitions/orderHint"
    },
    "appliesTo": {
      "type": "array",
      "title": "Applies To",
      "description": "This section defines the region/locales/application information for where a search engine is available, and any specifics for that region/locale/application. If there are no entries in the list, it is considered to be included everywhere",
      "items": {
        "$ref": "#/definitions/appliesToSection"
      }
    },
    "telemetryId": {
      "type": "string",
      "title": "Telemetry Id",
      "description": "The telemetry Id as used for search telemetry."
    },
    "webExtension": {
      "$ref": "#/definitions/webExtension"
    },
    "urls": {
      "$ref": "#/definitions/urls"
    },
    "params": {
      "$ref": "#/definitions/params"
    },
    "extraParams": {
      "$ref": "#/definitions/extraParams"
    },
    "suggestExtraParams": {
      "$ref": "#/definitions/extraParams"
    }
  },
  "definitions": {
    "application": {
      "type": "object",
      "title": "Application Details",
      "properties": {
        "name": {
          "type": "array",
          "title": "Name",
          "description": "The application(s) this applies to (default/not specified is everywhere)",
          "items": {
            "type": "string",
            "pattern": "^[a-z]{0,100}$",
            "enum": ["", "firefox"]
          },
          "uniqueItems": true
        },
        "channel": {
          "type": "array",
          "title": "Channel",
          "description": "Which channel this belongs to (not set = everywhere). For ESR this is also keyed from the display version.",
          "items": {
            "type": "string",
            "pattern": "^[a-z]{0,100}$",
            "enum": ["default", "nightly", "aurora", "beta", "release", "esr"]
          },
          "uniqueItems": true
        },
        "distributions": {
          "type": "array",
          "title": "Distributions",
          "description": "Which distributions this applies to.",
          "items": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9.-]{0,100}$"
          },
          "uniqueItems": true
        },
        "excludedDistributions": {
          "type": "array",
          "title": "Excluded Distributions",
          "description": "Which distributions this does not apply to.",
          "items": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9.-]{0,100}$"
          },
          "uniqueItems": true
        },
        "minVersion": {
          "type": "string",
          "title": "Minimum Version",
          "pattern": "^[0-9a-z.]{0,20}$",
          "description": "The minimum version this applies to"
        },
        "maxVersion": {
          "type": "string",
          "title": "Maximum Version",
          "pattern": "^[0-9a-z.]{0,20}$",
          "description": "The maximum version this applies to (less-than comparison)"
        }
      }
    },
    "default": {
      "type": "string",
      "title": "Default Status",
      "pattern": "^[a-z-]{0,20}$",
      "description": "Whether or not this engine should be default.",
      "enum": ["yes", "yes-if-no-other", "no"]
    },
    "defaultPrivate": {
      "type": "string",
      "title": "Default Status (PBM)",
      "pattern": "^[a-z-]{0,20}$",
      "description": "Whether or not this engine should be default in private browsing mode.",
      "enum": ["yes", "yes-if-no-other", "no"]
    },
    "extraParams": {
      "type": "array",
      "title": "Extra Parameters",
      "description": "Extra parameters for the search engine (aka MozParams)",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "pattern": "^[a-z]{0,20}$",
            "description": "Name of the parameter that will be used in the search query"
          },
          "condition": {
            "type": "string",
            "title": "Condition",
            "pattern": "^[a-z]{0,10}$",
            "description": "The type of parameter (pref or purpose)",
            "enum": ["pref", "purpose"]
          },
          "purpose": {
            "type": "string",
            "title": "Purpose",
            "pattern": "^[a-z{}]{0,100}$",
            "description": "The search purpose that triggers this parameter being appended.",
            "enum": [
              "searchbar",
              "keyword",
              "contextmenu",
              "homepage",
              "newtab"
            ]
          },
          "value": {
            "type": "string",
            "title": "Value",
            "pattern": "^[a-zA-Z0-9_]{0,100}$",
            "description": "If this is a purpose type, the value is used as the value of the parameter in the query"
          },
          "pref": {
            "type": "string",
            "title": "Preference name",
            "pattern": "^[a-z0-9_]{0,100}$",
            "description": "The preference name to get the value from (i.e. browser.search.param.<preference name>)."
          }
        }
      }
    },
    "orderHint": {
      "type": "number",
      "title": "Order Hint",
      "description": "A hint to the display order (higher is a higher rank)"
    },
    "searchUrlCodes": {
      "type": "array",
      "title": "Codes",
      "description": "A array of objects - map of parameter name to the parameter value.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "pattern": "^[a-zA-Z0-9.-]{0,100}$",
            "description": "Name of the parameter that will be used in the query"
          },
          "value": {
            "type": "string",
            "title": "Value",
            "pattern": "^[a-zA-Z0-9_{}:/.-]{0,100}$",
            "description": "The value of parameter (pref or purpose)"
          }
        }
      }
    },
    "params": {
      "type": "object",
      "title": "Parameters",
      "description": "Various parameters for the search engines",
      "properties": {
        "searchUrlGetParams": {
          "title": "Search URL GET Parameters",
          "description": "Extra parameters for search URLs (e.g. 'pc=foo').",
          "$ref": "#/definitions/searchUrlCodes"
        },
        "suggestUrlGetParams": {
          "title": "Suggestion URL GET Parameters",
          "description": "Extra parameters for search suggestion URLs (e.g. 'pc=foo').",
          "$ref": "#/definitions/searchUrlCodes"
        },
        "searchUrlPostParams": {
          "title": "Search URL POST Parameters",
          "description": "Extra parameters for search URLs (e.g. 'pc=foo').",
          "$ref": "#/definitions/searchUrlCodes"
        },
        "suggestUrlPostParams": {
          "title": "Suggestion URL POST Parameters",
          "description": "Extra parameters for search suggestion URLs (e.g. 'pc=foo').",
          "$ref": "#/definitions/searchUrlCodes"
        }
      }
    },
    "telemetryId": {
      "type": "string",
      "title": "Telemetry Id",
      "pattern": "^[a-zA-Z0-9-$_]{0,100}$",
      "description": "The telemetry Id as used for search telemetry."
    },
    "webExtension": {
      "type": "object",
      "title": "WebExtension",
      "properties": {
        "id": {
          "type": "string",
          "title": "WebExtension Id",
          "description": "The identifier (local part) of the associated WebExtension should be of the format example@search.mozilla.org",
          "pattern": "^[a-zA-Z0-9-._]*@search.mozilla.org$"
        },
        "locales": {
          "type": "array",
          "title": "WebExtension Locales",
          "description": "Overrides the WebExtension locales and specifies to use a particular one. Ideally this should only be used when really necessary, otherwise considered deprecated.",
          "items": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-$_]{0,100}$"
          }
        }
      }
    },
    "urls": {
      "type": "object",
      "description": "Urls pertaining to this engine",
      "properties": {
        "trending": {
          "type": "object",
          "description": "Details of the url used to fetch trending suggestions",
          "properties": {
            "fullPath": {
              "type": "string",
              "title": "fullPath",
              "format": "uri",
              "description": "The url used to retrieve trending suggestions"
            },
            "query": {
              "type": "string",
              "title": "query",
              "description": "The query parameters to send in a trending suggestions request",
              "pattern": "^[a-zA-Z0-9.={}&-]{0,100}$"
            }
          }
        }
      }
    },
    "regionDetails": {
      "type": "array",
      "title": "Regions",
      "description": "Two-letter region codes.",
      "items": {
        "type": "string",
        "pattern": "^([a-z][a-z]|default)$",
        "minLength": 2,
        "maxLength": 7
      }
    },
    "localeDetails": {
      "type": "object",
      "title": "Locales",
      "description": "Locale codes.",
      "properties": {
        "matches": {
          "type": "array",
          "title": "Matches exactly the codes",
          "items": {
            "type": "string",
            "pattern": "^([a-z]{2,3}(-[a-zA-Z]{2,})?(-macos)?|default)$",
            "minLength": 2
          }
        },
        "startsWith": {
          "type": "array",
          "title": "Matches any code starting with",
          "items": {
            "type": "string",
            "pattern": "^[a-z]{2,3}$",
            "minLength": 2,
            "maxLength": 3
          }
        }
      }
    },
    "included": {
      "type": "object",
      "title": "Included Locations",
      "description": "The locations to which this section applies. Note: Regions and Locales are 'and'ed together.",
      "properties": {
        "everywhere": {
          "type": "boolean",
          "title": "Everywhere",
          "description": "Set to true to signify that this is included everywhere."
        },
        "regions": {
          "$ref": "#/definitions/regionDetails"
        },
        "locales": {
          "$ref": "#/definitions/localeDetails"
        }
      }
    },
    "excluded": {
      "type": "object",
      "title": "Excluded Locations",
      "description": "The locations to which this section applies. Note: Regions and Locales are 'and'ed together.",
      "properties": {
        "regions": {
          "$ref": "#/definitions/regionDetails"
        },
        "locales": {
          "$ref": "#/definitions/localeDetails"
        }
      }
    },
    "appliesToSection": {
      "type": "object",
      "properties": {
        "default": {
          "$ref": "#/definitions/default"
        },
        "defaultPrivate": {
          "$ref": "#/definitions/defaultPrivate"
        },
        "orderHint": {
          "$ref": "#/definitions/orderHint"
        },
        "included": {
          "$ref": "#/definitions/included"
        },
        "excluded": {
          "$ref": "#/definitions/excluded"
        },
        "application": {
          "$ref": "#/definitions/application"
        },
        "webExtension": {
          "$ref": "#/definitions/webExtension"
        },
        "urls": {
          "$ref": "#/definitions/urls"
        },
        "telemetryId": {
          "$ref": "#/definitions/telemetryId"
        },
        "params": {
          "$ref": "#/definitions/params"
        },
        "extraParams": {
          "$ref": "#/definitions/extraParams"
        },
        "experiment": {
          "type": "string",
          "title": "Experiment",
          "pattern": "^[a-zA-Z0-9-]{0,100}$",
          "description": "The experiment this section is associated with, if blank it is associated with any configuration."
        },
        "override": {
          "type": "boolean",
          "title": "Override",
          "description": "This section will override previous appliesTo sections, but not add new locations where this engine is deployed to."
        },
        "suggestExtraParams": {
          "$ref": "#/definitions/extraParams"
        }
      }
    }
  }
}