@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.
package/index.d.ts
CHANGED
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
4
|
/* This file was automatically generated from pydantic models.
|
|
5
|
-
/* Do not modify by hand - update the pydantic models and re-run
|
|
5
|
+
/* Do not modify by hand - update the pydantic models and re-run
|
|
6
|
+
* make schemas_build
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
|
-
export type
|
|
9
|
-
export type Feature = FeatureWithExposure | FeatureWithoutExposure;
|
|
9
|
+
export type DesktopApplication = "firefox-desktop" | "firefox-desktop-background-task";
|
|
10
10
|
export type FeatureVariableType = "int" | "string" | "boolean" | "json";
|
|
11
11
|
export type PrefBranch = "default" | "user";
|
|
12
|
+
/**
|
|
13
|
+
* A unique, stable indentifier for the user used as an input to bucket hashing.
|
|
14
|
+
*/
|
|
15
|
+
export type RandomizationUnit = "normandy_id" | "nimbus_id" | "user_id" | "group_id";
|
|
12
16
|
export type AnalysisBasis = "enrollments" | "exposures";
|
|
13
17
|
export type LogSource = "jetstream" | "sizing" | "jetstream-preview";
|
|
14
18
|
export type AnalysisErrors = AnalysisError[];
|
|
@@ -28,114 +32,423 @@ export type SizingMetricName = "active_hours" | "search_count" | "days_of_use" |
|
|
|
28
32
|
export type StatisticIngestEnum = "percentage" | "binomial" | "mean" | "count";
|
|
29
33
|
export type Statistics = Statistic[];
|
|
30
34
|
|
|
35
|
+
/**
|
|
36
|
+
* A feature.
|
|
37
|
+
*/
|
|
38
|
+
export interface DesktopFeature {
|
|
39
|
+
/**
|
|
40
|
+
* The description of the feature.
|
|
41
|
+
*/
|
|
42
|
+
description: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether or not this feature records exposure telemetry.
|
|
45
|
+
*/
|
|
46
|
+
hasExposure: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A description of the exposure telemetry collected by this feature.
|
|
49
|
+
*
|
|
50
|
+
* Only required if hasExposure is true.
|
|
51
|
+
*/
|
|
52
|
+
exposureDescription?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The owner of the feature.
|
|
55
|
+
*/
|
|
56
|
+
owner: string;
|
|
57
|
+
/**
|
|
58
|
+
* If true, the feature values will be cached in prefs so that they can be read before Nimbus is initialized during Firefox startup.
|
|
59
|
+
*/
|
|
60
|
+
isEarlyStartup?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The applications that can enroll in experiments for this feature.
|
|
63
|
+
*
|
|
64
|
+
* Defaults to "firefox-desktop".
|
|
65
|
+
*/
|
|
66
|
+
applications?: DesktopApplication[];
|
|
67
|
+
/**
|
|
68
|
+
* The variables that this feature can set.
|
|
69
|
+
*/
|
|
70
|
+
variables: {
|
|
71
|
+
[k: string]: DesktopFeatureVariable;
|
|
72
|
+
};
|
|
73
|
+
schema?: NimbusFeatureSchema;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A feature variable.
|
|
77
|
+
*/
|
|
78
|
+
export interface DesktopFeatureVariable {
|
|
79
|
+
/**
|
|
80
|
+
* A description of the feature.
|
|
81
|
+
*/
|
|
82
|
+
description: string;
|
|
83
|
+
type: FeatureVariableType;
|
|
84
|
+
/**
|
|
85
|
+
* An optional list of possible string or integer values.
|
|
86
|
+
*
|
|
87
|
+
* Only allowed when type is string or int.
|
|
88
|
+
*
|
|
89
|
+
* The types in the enum must match the type of the field.
|
|
90
|
+
*/
|
|
91
|
+
enum?: string[] | number[];
|
|
92
|
+
/**
|
|
93
|
+
* A pref that provides the default value for a feature when none is present.
|
|
94
|
+
*/
|
|
95
|
+
fallbackPref?: string;
|
|
96
|
+
/**
|
|
97
|
+
* A pref that should be set to the value of this variable when enrolling in experiments.
|
|
98
|
+
*
|
|
99
|
+
* Using a string is deprecated and unsupported in Firefox 124+.
|
|
100
|
+
*/
|
|
101
|
+
setPref?: string | SetPref;
|
|
102
|
+
}
|
|
103
|
+
export interface SetPref {
|
|
104
|
+
branch: PrefBranch;
|
|
105
|
+
/**
|
|
106
|
+
* The name of the pref to set.
|
|
107
|
+
*/
|
|
108
|
+
pref: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Information about a JSON schema.
|
|
112
|
+
*/
|
|
113
|
+
export interface NimbusFeatureSchema {
|
|
114
|
+
/**
|
|
115
|
+
* The resource:// or chrome:// URI that can be loaded at runtime within Firefox.
|
|
116
|
+
*
|
|
117
|
+
* Required by Firefox so that Nimbus can import the schema for validation.
|
|
118
|
+
*/
|
|
119
|
+
uri: string;
|
|
120
|
+
/**
|
|
121
|
+
* The path to the schema file in the source checkout.
|
|
122
|
+
*
|
|
123
|
+
* Required by Experimenter so that it can find schema files in source checkouts.
|
|
124
|
+
*/
|
|
125
|
+
path: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The Firefox Desktop-specific feature manifest.
|
|
129
|
+
*
|
|
130
|
+
* Firefox Desktop requires different fields for its features compared to the general
|
|
131
|
+
* Nimbus feature manifest.
|
|
132
|
+
*/
|
|
133
|
+
export interface DesktopFeatureManifest {
|
|
134
|
+
[k: string]: DesktopFeature;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The experiment definition accessible to:
|
|
138
|
+
*
|
|
139
|
+
* 1. The Nimbus SDK via Remote Settings
|
|
140
|
+
* 2. Jetstream via the Experimenter API
|
|
141
|
+
*/
|
|
31
142
|
export interface NimbusExperiment {
|
|
143
|
+
/**
|
|
144
|
+
* Version of the NimbusExperiment schema this experiment refers to
|
|
145
|
+
*/
|
|
32
146
|
schemaVersion: string;
|
|
147
|
+
/**
|
|
148
|
+
* Unique identifier for the experiment
|
|
149
|
+
*/
|
|
33
150
|
slug: string;
|
|
151
|
+
/**
|
|
152
|
+
* Unique identifier for the experiiment.
|
|
153
|
+
*
|
|
154
|
+
* This is a duplicate of slug, but is required field for all Remote Settings records.
|
|
155
|
+
*/
|
|
34
156
|
id: string;
|
|
157
|
+
/**
|
|
158
|
+
* A slug identifying the targeted product of this experiment.
|
|
159
|
+
*
|
|
160
|
+
* It should be a lowercased_with_underscores name that is short and unambiguous and it should match the app_name found in https://probeinfo.telemetry.mozilla.org/glean/repositories. Examples are "fenix" and "firefox_desktop".
|
|
161
|
+
*/
|
|
35
162
|
appName: string;
|
|
163
|
+
/**
|
|
164
|
+
* The platform identifier for the targeted app.
|
|
165
|
+
*
|
|
166
|
+
* This should match app's identifier exactly as it appears in the relevant app store listing (for relevant platforms) or the app's Glean initialization (for other platforms).
|
|
167
|
+
*
|
|
168
|
+
* Examples are "org.mozilla.firefox_beta" and "firefox-desktop".
|
|
169
|
+
*/
|
|
36
170
|
appId: string;
|
|
171
|
+
/**
|
|
172
|
+
* A specific channel of an application such as "nightly", "beta", or "release".
|
|
173
|
+
*/
|
|
37
174
|
channel: string;
|
|
175
|
+
/**
|
|
176
|
+
* Public name of the experiment that will be displayed on "about:studies".
|
|
177
|
+
*/
|
|
38
178
|
userFacingName: string;
|
|
179
|
+
/**
|
|
180
|
+
* Short public description of the experiment that will be displayed on "about:studies".
|
|
181
|
+
*/
|
|
39
182
|
userFacingDescription: string;
|
|
183
|
+
/**
|
|
184
|
+
* When this property is set to true, the SDK should not enroll new users into the experiment that have not already been enrolled.
|
|
185
|
+
*/
|
|
40
186
|
isEnrollmentPaused: boolean;
|
|
41
|
-
|
|
187
|
+
/**
|
|
188
|
+
* When this property is set to true, treat this experiment as a rollout.
|
|
189
|
+
*
|
|
190
|
+
* Rollouts are currently handled as single-branch experiments separated from the bucketing namespace for normal experiments.
|
|
191
|
+
*
|
|
192
|
+
* See-also: https://mozilla-hub.atlassian.net/browse/SDK-405
|
|
193
|
+
*/
|
|
194
|
+
isRollout?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* When this property is set to true, treat this experiment as aFirefox Labs experiment
|
|
197
|
+
*/
|
|
198
|
+
isFirefoxLabsOptIn?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* An optional string containing the Fluent ID for the title of the opt-in
|
|
201
|
+
*/
|
|
202
|
+
firefoxLabsTitle?: string;
|
|
203
|
+
/**
|
|
204
|
+
* An optional string containing the Fluent ID for the description of the opt-in
|
|
205
|
+
*/
|
|
206
|
+
firefoxLabsDescription?: string;
|
|
42
207
|
bucketConfig: ExperimentBucketConfig;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
208
|
+
/**
|
|
209
|
+
* A list of outcomes relevant to the experiment analysis.
|
|
210
|
+
*/
|
|
211
|
+
outcomes?: ExperimentOutcome[];
|
|
212
|
+
/**
|
|
213
|
+
* A list of featureIds the experiment contains configurations for.
|
|
214
|
+
*/
|
|
215
|
+
featureIds?: string[];
|
|
216
|
+
/**
|
|
217
|
+
* Branch configuration for the experiment.
|
|
218
|
+
*/
|
|
219
|
+
branches:
|
|
220
|
+
| ExperimentSingleFeatureBranch[]
|
|
221
|
+
| ExperimentMultiFeatureDesktopBranch[]
|
|
222
|
+
| ExperimentMultiFeatureMobileBranch[];
|
|
223
|
+
/**
|
|
224
|
+
* A JEXL targeting expression used to filter out experiments.
|
|
225
|
+
*/
|
|
50
226
|
targeting?: string | null;
|
|
51
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Actual publish date of the experiment.
|
|
229
|
+
*
|
|
230
|
+
* Note that this value is expected to be null in Remote Settings.
|
|
231
|
+
*/
|
|
232
|
+
startDate: string | null;
|
|
233
|
+
/**
|
|
234
|
+
* Actual enrollment end date of the experiment.
|
|
235
|
+
*
|
|
236
|
+
* Note that this value is expected to be null in Remote Settings.
|
|
237
|
+
*/
|
|
52
238
|
enrollmentEndDate?: string | null;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Actual end date of this experiment.
|
|
241
|
+
*
|
|
242
|
+
* Note that this field is expected to be null in Remote Settings.
|
|
243
|
+
*/
|
|
244
|
+
endDate: string | null;
|
|
245
|
+
/**
|
|
246
|
+
* Duration of the experiment from the start date in days.
|
|
247
|
+
*
|
|
248
|
+
* Note that this property is only used during the analysis phase (i.e., not by the SDK).
|
|
249
|
+
*/
|
|
250
|
+
proposedDuration?: number;
|
|
251
|
+
/**
|
|
252
|
+
* This represents the number of days that we expect to enroll new users.
|
|
253
|
+
*
|
|
254
|
+
* Note that this property is only used during the analysis phase (i.e., not by the SDK).
|
|
255
|
+
*/
|
|
256
|
+
proposedEnrollment: number;
|
|
257
|
+
/**
|
|
258
|
+
* The slug of the reference branch (i.e., the branch we consider "control").
|
|
259
|
+
*/
|
|
260
|
+
referenceBranch: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* Opt out of feature schema validation. Only supported on desktop.
|
|
263
|
+
*/
|
|
264
|
+
featureValidationOptOut?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Per-locale localization substitutions.
|
|
267
|
+
*
|
|
268
|
+
* The top level key is the locale (e.g., "en-US" or "fr"). Each entry is a mapping of string IDs to their localized equivalents.
|
|
269
|
+
*
|
|
270
|
+
* Only supported on desktop.
|
|
271
|
+
*/
|
|
58
272
|
localizations?: {
|
|
59
|
-
[k: string]:
|
|
273
|
+
[k: string]: {
|
|
274
|
+
[k: string]: string;
|
|
275
|
+
};
|
|
60
276
|
} | null;
|
|
277
|
+
/**
|
|
278
|
+
* The list of locale codes (e.g., "en-US" or "fr") that this experiment is targeting.
|
|
279
|
+
*
|
|
280
|
+
* If null, all locales are targeted.
|
|
281
|
+
*/
|
|
61
282
|
locales?: string[] | null;
|
|
283
|
+
/**
|
|
284
|
+
* The date that this experiment was first published to Remote Settings.
|
|
285
|
+
*
|
|
286
|
+
* If null, it has not yet been published.
|
|
287
|
+
*/
|
|
288
|
+
publishedDate?: string | null;
|
|
62
289
|
}
|
|
63
290
|
export interface ExperimentBucketConfig {
|
|
64
291
|
randomizationUnit: RandomizationUnit;
|
|
292
|
+
/**
|
|
293
|
+
* Additional inputs to the hashing function.
|
|
294
|
+
*/
|
|
65
295
|
namespace: string;
|
|
296
|
+
/**
|
|
297
|
+
* Index of the starting bucket of the range.
|
|
298
|
+
*/
|
|
66
299
|
start: number;
|
|
300
|
+
/**
|
|
301
|
+
* Number of buckets in the range.
|
|
302
|
+
*/
|
|
67
303
|
count: number;
|
|
304
|
+
/**
|
|
305
|
+
* The total number of buckets.
|
|
306
|
+
*
|
|
307
|
+
* You can assume this will always be 10000
|
|
308
|
+
*/
|
|
68
309
|
total: number;
|
|
69
310
|
}
|
|
70
311
|
export interface ExperimentOutcome {
|
|
312
|
+
/**
|
|
313
|
+
* Identifier for the outcome.
|
|
314
|
+
*/
|
|
71
315
|
slug: string;
|
|
316
|
+
/**
|
|
317
|
+
* e.g., "primary" or "secondary".
|
|
318
|
+
*/
|
|
72
319
|
priority: string;
|
|
73
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* A single-feature branch definition.
|
|
323
|
+
*
|
|
324
|
+
* Supported by Firefox Desktop for versions before 95, Firefox for Android for versions
|
|
325
|
+
* before 96, and Firefox for iOS for versions before 39.
|
|
326
|
+
*/
|
|
74
327
|
export interface ExperimentSingleFeatureBranch {
|
|
328
|
+
/**
|
|
329
|
+
* Identifier for the branch.
|
|
330
|
+
*/
|
|
75
331
|
slug: string;
|
|
332
|
+
/**
|
|
333
|
+
* Relative ratio of population for the branch.
|
|
334
|
+
*
|
|
335
|
+
* e.g., if branch A=1 and branch B=3, then branch A would get 25% of the population.
|
|
336
|
+
*/
|
|
76
337
|
ratio: number;
|
|
77
338
|
feature: ExperimentFeatureConfig;
|
|
78
339
|
}
|
|
79
340
|
export interface ExperimentFeatureConfig {
|
|
341
|
+
/**
|
|
342
|
+
* The identifier for the feature flag.
|
|
343
|
+
*/
|
|
80
344
|
featureId: string;
|
|
81
|
-
|
|
345
|
+
/**
|
|
346
|
+
* The values that define the feature configuration.
|
|
347
|
+
*
|
|
348
|
+
* This should be validated against a schema.
|
|
349
|
+
*/
|
|
82
350
|
value: {
|
|
83
351
|
[k: string]: unknown;
|
|
84
352
|
};
|
|
85
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* The branch definition supported on Firefox Desktop 95+.
|
|
356
|
+
*/
|
|
86
357
|
export interface ExperimentMultiFeatureDesktopBranch {
|
|
358
|
+
/**
|
|
359
|
+
* Identifier for the branch.
|
|
360
|
+
*/
|
|
87
361
|
slug: string;
|
|
362
|
+
/**
|
|
363
|
+
* Relative ratio of population for the branch.
|
|
364
|
+
*
|
|
365
|
+
* e.g., if branch A=1 and branch B=3, then branch A would get 25% of the population.
|
|
366
|
+
*/
|
|
88
367
|
ratio: number;
|
|
89
|
-
|
|
368
|
+
/**
|
|
369
|
+
* An array of feature configurations.
|
|
370
|
+
*/
|
|
90
371
|
features: ExperimentFeatureConfig[];
|
|
372
|
+
feature: DesktopTombstoneFeatureConfig;
|
|
373
|
+
/**
|
|
374
|
+
* An optional string containing the title of the branch
|
|
375
|
+
*/
|
|
376
|
+
firefoxLabsTitle: string;
|
|
91
377
|
}
|
|
378
|
+
export interface DesktopTombstoneFeatureConfig {
|
|
379
|
+
featureId: "unused-feature-id-for-legacy-support";
|
|
380
|
+
value: {
|
|
381
|
+
[k: string]: unknown;
|
|
382
|
+
};
|
|
383
|
+
enabled: false;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* The branch definition for mobile browsers.
|
|
387
|
+
*
|
|
388
|
+
* Supported on Firefox for Android 96+ and Firefox for iOS 39+.
|
|
389
|
+
*/
|
|
92
390
|
export interface ExperimentMultiFeatureMobileBranch {
|
|
391
|
+
/**
|
|
392
|
+
* Identifier for the branch.
|
|
393
|
+
*/
|
|
93
394
|
slug: string;
|
|
395
|
+
/**
|
|
396
|
+
* Relative ratio of population for the branch.
|
|
397
|
+
*
|
|
398
|
+
* e.g., if branch A=1 and branch B=3, then branch A would get 25% of the population.
|
|
399
|
+
*/
|
|
94
400
|
ratio: number;
|
|
401
|
+
/**
|
|
402
|
+
* An array of feature configurations.
|
|
403
|
+
*/
|
|
95
404
|
features: ExperimentFeatureConfig[];
|
|
96
405
|
}
|
|
97
|
-
|
|
98
|
-
|
|
406
|
+
/**
|
|
407
|
+
* The SDK-specific feature manifest.
|
|
408
|
+
*/
|
|
409
|
+
export interface SdkFeatureManifest {
|
|
410
|
+
[k: string]: SdkFeature;
|
|
99
411
|
}
|
|
100
412
|
/**
|
|
101
|
-
* A feature
|
|
413
|
+
* A feature.
|
|
102
414
|
*/
|
|
103
|
-
export interface
|
|
104
|
-
|
|
105
|
-
|
|
415
|
+
export interface SdkFeature {
|
|
416
|
+
/**
|
|
417
|
+
* The description of the feature.
|
|
418
|
+
*/
|
|
419
|
+
description: string;
|
|
420
|
+
/**
|
|
421
|
+
* Whether or not this feature records exposure telemetry.
|
|
422
|
+
*/
|
|
423
|
+
hasExposure: boolean;
|
|
424
|
+
/**
|
|
425
|
+
* A description of the exposure telemetry collected by this feature.
|
|
426
|
+
*
|
|
427
|
+
* Only required if hasExposure is true.
|
|
428
|
+
*/
|
|
429
|
+
exposureDescription?: string;
|
|
430
|
+
/**
|
|
431
|
+
* The variables that this feature can set.
|
|
432
|
+
*/
|
|
106
433
|
variables: {
|
|
107
|
-
[k: string]:
|
|
434
|
+
[k: string]: SdkFeatureVariable;
|
|
108
435
|
};
|
|
109
|
-
schema?: NimbusFeatureSchema | null;
|
|
110
|
-
hasExposure: true;
|
|
111
|
-
exposureDescription: string;
|
|
112
|
-
}
|
|
113
|
-
export interface FeatureVariable {
|
|
114
|
-
description?: string | null;
|
|
115
|
-
enum?: string[] | null;
|
|
116
|
-
fallbackPref?: string | null;
|
|
117
|
-
type?: FeatureVariableType | null;
|
|
118
|
-
setPref?: string | SetPref | null;
|
|
119
|
-
}
|
|
120
|
-
export interface SetPref {
|
|
121
|
-
branch: PrefBranch;
|
|
122
|
-
pref: string;
|
|
123
|
-
}
|
|
124
|
-
export interface NimbusFeatureSchema {
|
|
125
|
-
uri: string;
|
|
126
|
-
path: string;
|
|
127
436
|
}
|
|
128
437
|
/**
|
|
129
|
-
* A feature
|
|
438
|
+
* A feature variable.
|
|
130
439
|
*/
|
|
131
|
-
export interface
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
440
|
+
export interface SdkFeatureVariable {
|
|
441
|
+
/**
|
|
442
|
+
* A description of the feature.
|
|
443
|
+
*/
|
|
444
|
+
description: string;
|
|
445
|
+
type: FeatureVariableType;
|
|
446
|
+
/**
|
|
447
|
+
* An optional list of possible string values.
|
|
448
|
+
*
|
|
449
|
+
* Only allowed when type is string.
|
|
450
|
+
*/
|
|
451
|
+
enum?: string[];
|
|
139
452
|
}
|
|
140
453
|
export interface AnalysisError {
|
|
141
454
|
analysis_basis?: AnalysisBasis | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozilla/nimbus-schemas",
|
|
3
|
-
"version": "2024.
|
|
3
|
+
"version": "2024.10.2",
|
|
4
4
|
"description": "Schemas used by Mozilla Nimbus and related projects.",
|
|
5
5
|
"main": "index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"typescript": "^5.1.6"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"index.d.ts"
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"schemas"
|
|
22
23
|
]
|
|
23
24
|
}
|