@mozilla/nimbus-schemas 2024.10.1 → 2024.11.1

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/README.md CHANGED
@@ -5,8 +5,8 @@ This directory contains a package of schemas published to various repositories f
5
5
 
6
6
  ## Installation/Usage
7
7
  ### Prerequisites
8
- - python ^3.11
9
- - poetry ^1.2.2
8
+ - python ^3.10
9
+ - poetry ^1.8.4
10
10
  - node ^16
11
11
  - yarn ^1.22
12
12
 
package/index.d.ts CHANGED
@@ -192,6 +192,18 @@ export interface NimbusExperiment {
192
192
  * See-also: https://mozilla-hub.atlassian.net/browse/SDK-405
193
193
  */
194
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;
195
207
  bucketConfig: ExperimentBucketConfig;
196
208
  /**
197
209
  * A list of outcomes relevant to the experiment analysis.
@@ -250,18 +262,7 @@ export interface NimbusExperiment {
250
262
  * Opt out of feature schema validation. Only supported on desktop.
251
263
  */
252
264
  featureValidationOptOut?: boolean;
253
- /**
254
- * Per-locale localization substitutions.
255
- *
256
- * 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.
257
- *
258
- * Only supported on desktop.
259
- */
260
- localizations?: {
261
- [k: string]: {
262
- [k: string]: string;
263
- };
264
- } | null;
265
+ localizations?: ExperimentLocalizations | null;
265
266
  /**
266
267
  * The list of locale codes (e.g., "en-US" or "fr") that this experiment is targeting.
267
268
  *
@@ -358,6 +359,10 @@ export interface ExperimentMultiFeatureDesktopBranch {
358
359
  */
359
360
  features: ExperimentFeatureConfig[];
360
361
  feature: DesktopTombstoneFeatureConfig;
362
+ /**
363
+ * An optional string containing the title of the branch
364
+ */
365
+ firefoxLabsTitle: string;
361
366
  }
362
367
  export interface DesktopTombstoneFeatureConfig {
363
368
  featureId: "unused-feature-id-for-legacy-support";
@@ -387,6 +392,19 @@ export interface ExperimentMultiFeatureMobileBranch {
387
392
  */
388
393
  features: ExperimentFeatureConfig[];
389
394
  }
395
+ /**
396
+ * Per-locale localization substitutions.
397
+ *
398
+ * The top level key is the locale (e.g., "en-US" or "fr"). Each entry is a mapping of
399
+ * string IDs to their localized equivalents.
400
+ *
401
+ * Only supported on desktop.
402
+ */
403
+ export interface ExperimentLocalizations {
404
+ [k: string]: {
405
+ [k: string]: string;
406
+ };
407
+ }
390
408
  /**
391
409
  * The SDK-specific feature manifest.
392
410
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozilla/nimbus-schemas",
3
- "version": "2024.10.1",
3
+ "version": "2024.11.1",
4
4
  "description": "Schemas used by Mozilla Nimbus and related projects.",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -44,6 +44,18 @@
44
44
  "description": "When this property is set to true, treat this experiment as a rollout. Rollouts are currently handled as single-branch experiments separated from the bucketing namespace for normal experiments. See-also: https://mozilla-hub.atlassian.net/browse/SDK-405",
45
45
  "type": "boolean"
46
46
  },
47
+ "isFirefoxLabsOptIn": {
48
+ "description": "When this property is set to true, treat this experiment as aFirefox Labs experiment",
49
+ "type": "boolean"
50
+ },
51
+ "firefoxLabsTitle": {
52
+ "description": "An optional string containing the Fluent ID for the title of the opt-in",
53
+ "type": "string"
54
+ },
55
+ "firefoxLabsDescription": {
56
+ "description": "An optional string containing the Fluent ID for the description of the opt-in",
57
+ "type": "string"
58
+ },
47
59
  "bucketConfig": {
48
60
  "$ref": "#/$defs/ExperimentBucketConfig",
49
61
  "description": "Bucketing configuration."
@@ -158,19 +170,12 @@
158
170
  "localizations": {
159
171
  "anyOf": [
160
172
  {
161
- "additionalProperties": {
162
- "additionalProperties": {
163
- "type": "string"
164
- },
165
- "type": "object"
166
- },
167
- "type": "object"
173
+ "$ref": "#/$defs/ExperimentLocalizations"
168
174
  },
169
175
  {
170
176
  "type": "null"
171
177
  }
172
- ],
173
- "description": "Per-locale localization substitutions. 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. Only supported on desktop."
178
+ ]
174
179
  },
175
180
  "locales": {
176
181
  "anyOf": [
@@ -216,6 +221,52 @@
216
221
  "proposedEnrollment",
217
222
  "referenceBranch"
218
223
  ],
224
+ "dependentSchemas": {
225
+ "isFirefoxLabsOptIn": {
226
+ "if": {
227
+ "properties": {
228
+ "isFirefoxLabsOptIn": {
229
+ "const": true
230
+ }
231
+ }
232
+ },
233
+ "then": {
234
+ "if": {
235
+ "properties": {
236
+ "isRollout": {
237
+ "const": false
238
+ }
239
+ },
240
+ "required": [
241
+ "isRollout"
242
+ ]
243
+ },
244
+ "properties": {
245
+ "firefoxLabsTitle": {
246
+ "type": "string"
247
+ },
248
+ "firefoxLabsDescription": {
249
+ "type": "string"
250
+ }
251
+ },
252
+ "required": [
253
+ "firefoxLabsTitle",
254
+ "firefoxLabsDescription"
255
+ ],
256
+ "then": {
257
+ "properties": {
258
+ "branches": {
259
+ "items": {
260
+ "required": [
261
+ "firefoxLabsTitle"
262
+ ]
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ },
219
270
  "$defs": {
220
271
  "DesktopTombstoneFeatureConfig": {
221
272
  "properties": {
@@ -286,6 +337,16 @@
286
337
  ],
287
338
  "type": "object"
288
339
  },
340
+ "ExperimentLocalizations": {
341
+ "additionalProperties": {
342
+ "additionalProperties": {
343
+ "type": "string"
344
+ },
345
+ "type": "object"
346
+ },
347
+ "description": "Per-locale localization substitutions. 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. Only supported on desktop.",
348
+ "type": "object"
349
+ },
289
350
  "ExperimentMultiFeatureDesktopBranch": {
290
351
  "description": "The branch definition supported on Firefox Desktop 95+.",
291
352
  "properties": {
@@ -307,13 +368,18 @@
307
368
  "feature": {
308
369
  "$ref": "#/$defs/DesktopTombstoneFeatureConfig",
309
370
  "description": "The feature key must be provided with values to prevent crashes if the is encountered by Desktop clients earlier than version 95."
371
+ },
372
+ "firefoxLabsTitle": {
373
+ "description": "An optional string containing the title of the branch",
374
+ "type": "string"
310
375
  }
311
376
  },
312
377
  "required": [
313
378
  "slug",
314
379
  "ratio",
315
380
  "features",
316
- "feature"
381
+ "feature",
382
+ "firefoxLabsTitle"
317
383
  ],
318
384
  "type": "object"
319
385
  },