@mozilla/nimbus-schemas 2024.9.1 → 2024.9.3

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.
Files changed (2) hide show
  1. package/index.d.ts +141 -151
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,51 +1,98 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- /* This file was automatically generated from pydantic models by running pydantic2ts.
5
- /* Do not modify it by hand - just update the pydantic models and then re-run the script
6
- */
4
+ /* This file was automatically generated from pydantic models.
5
+ /* Do not modify by hand - update the pydantic models and re-run the script
6
+ */
7
7
 
8
- export type AnalysisBasis = "enrollments" | "exposures";
9
- export type LogSource = "jetstream" | "sizing" | "jetstream-preview";
10
- export type AnalysisErrors = AnalysisError[];
8
+ export type RandomizationUnit = "normandy_id" | "nimbus_id" | "user_id" | "group_id";
11
9
  export type Feature = FeatureWithExposure | FeatureWithoutExposure;
12
10
  export type FeatureVariableType = "int" | "string" | "boolean" | "json";
13
11
  export type PrefBranch = "default" | "user";
14
- export type RandomizationUnit = "normandy_id" | "nimbus_id" | "user_id" | "group_id";
12
+ export type AnalysisBasis = "enrollments" | "exposures";
13
+ export type LogSource = "jetstream" | "sizing" | "jetstream-preview";
14
+ export type AnalysisErrors = AnalysisError[];
15
+ export type AnalysisSegment = "all";
16
+ export type AnalysisSignificance = "positive" | "negative" | "neutral";
17
+ export type AnalysisWindow = "daily" | "weekly" | "overall";
18
+ export type BranchComparison = "absolute" | "difference" | "relative_uplift";
19
+ export type MetricGroup = "search_metrics" | "usage_metrics" | "other_metrics";
20
+ export type MetricIngestEnum = "retained" | "search_count" | "days_of_use" | "identity";
15
21
  export type SizingReleaseChannel = "release" | "beta" | "nightly";
16
22
  export type SizingUserType = "new" | "existing" | "all";
23
+ export type SizingMetricName = "active_hours" | "search_count" | "days_of_use" | "tagged_search_count";
24
+ /**
25
+ * This is the list of statistics supported in Experimenter,
26
+ * not a complete list of statistics available in Jetstream.
27
+ */
28
+ export type StatisticIngestEnum = "percentage" | "binomial" | "mean" | "count";
17
29
  export type Statistics = Statistic[];
18
30
 
19
- export interface AnalysisError {
20
- analysis_basis?: AnalysisBasis;
21
- source?: LogSource;
22
- exception?: string;
23
- exception_type?: string;
24
- experiment?: string;
25
- filename: string;
26
- func_name: string;
27
- log_level: string;
28
- message: string;
29
- metric?: string;
30
- segment?: string;
31
- statistic?: string;
32
- timestamp: string;
31
+ export interface NimbusExperiment {
32
+ schemaVersion: string;
33
+ slug: string;
34
+ id: string;
35
+ appName: string;
36
+ appId: string;
37
+ channel: string;
38
+ userFacingName: string;
39
+ userFacingDescription: string;
40
+ isEnrollmentPaused: boolean;
41
+ isRollout?: boolean | null;
42
+ bucketConfig: ExperimentBucketConfig;
43
+ outcomes?: ExperimentOutcome[] | null;
44
+ featureIds: string[];
45
+ branches: (
46
+ | ExperimentSingleFeatureBranch
47
+ | ExperimentMultiFeatureDesktopBranch
48
+ | ExperimentMultiFeatureMobileBranch
49
+ )[];
50
+ targeting?: string | null;
51
+ startDate?: string | null;
52
+ enrollmentEndDate?: string | null;
53
+ endDate?: string | null;
54
+ proposedDuration?: number | null;
55
+ proposedEnrollment?: number | null;
56
+ referenceBranch?: string | null;
57
+ featureValidationOptOut?: boolean | null;
58
+ localizations?: {
59
+ [k: string]: unknown;
60
+ } | null;
61
+ locales?: string[] | null;
33
62
  }
34
- export interface ConfigVersionDetails {
35
- path?: string;
36
- revision?: string;
63
+ export interface ExperimentBucketConfig {
64
+ randomizationUnit: RandomizationUnit;
65
+ namespace: string;
66
+ start: number;
67
+ count: number;
68
+ total: number;
37
69
  }
38
- export interface ConfigVersions {
39
- metric_definitions?: ConfigVersionDetails[];
40
- jetstream_image?: ConfigVersionDetails;
70
+ export interface ExperimentOutcome {
71
+ slug: string;
72
+ priority: string;
41
73
  }
42
- export interface ExternalConfig {
43
- reference_branch?: string;
44
- end_date?: string;
45
- start_date?: string;
46
- enrollment_period?: number;
47
- skip?: boolean;
48
- url: string;
74
+ export interface ExperimentSingleFeatureBranch {
75
+ slug: string;
76
+ ratio: number;
77
+ feature: ExperimentFeatureConfig;
78
+ }
79
+ export interface ExperimentFeatureConfig {
80
+ featureId: string;
81
+ enabled?: boolean | null;
82
+ value: {
83
+ [k: string]: unknown;
84
+ };
85
+ }
86
+ export interface ExperimentMultiFeatureDesktopBranch {
87
+ slug: string;
88
+ ratio: number;
89
+ feature: ExperimentFeatureConfig;
90
+ features: ExperimentFeatureConfig[];
91
+ }
92
+ export interface ExperimentMultiFeatureMobileBranch {
93
+ slug: string;
94
+ ratio: number;
95
+ features: ExperimentFeatureConfig[];
49
96
  }
50
97
  export interface FeatureManifest {
51
98
  [k: string]: Feature;
@@ -54,21 +101,21 @@ export interface FeatureManifest {
54
101
  * A feature that has exposure.
55
102
  */
56
103
  export interface FeatureWithExposure {
57
- description?: string;
58
- isEarlyStartup?: boolean;
104
+ description?: string | null;
105
+ isEarlyStartup?: boolean | null;
59
106
  variables: {
60
107
  [k: string]: FeatureVariable;
61
108
  };
62
- schema?: NimbusFeatureSchema;
109
+ schema?: NimbusFeatureSchema | null;
63
110
  hasExposure: true;
64
111
  exposureDescription: string;
65
112
  }
66
113
  export interface FeatureVariable {
67
- description?: string;
68
- enum?: string[];
69
- fallbackPref?: string;
70
- type?: FeatureVariableType;
71
- setPref?: string | SetPref;
114
+ description?: string | null;
115
+ enum?: string[] | null;
116
+ fallbackPref?: string | null;
117
+ type?: FeatureVariableType | null;
118
+ setPref?: string | SetPref | null;
72
119
  }
73
120
  export interface SetPref {
74
121
  branch: PrefBranch;
@@ -82,132 +129,75 @@ export interface NimbusFeatureSchema {
82
129
  * A feature without exposure.
83
130
  */
84
131
  export interface FeatureWithoutExposure {
85
- description?: string;
86
- isEarlyStartup?: boolean;
132
+ description?: string | null;
133
+ isEarlyStartup?: boolean | null;
87
134
  variables: {
88
135
  [k: string]: FeatureVariable;
89
136
  };
90
- schema?: NimbusFeatureSchema;
137
+ schema?: NimbusFeatureSchema | null;
91
138
  hasExposure: false;
92
139
  }
140
+ export interface AnalysisError {
141
+ analysis_basis?: AnalysisBasis | null;
142
+ source?: LogSource | null;
143
+ exception?: string | null;
144
+ exception_type?: string | null;
145
+ experiment?: string | null;
146
+ filename: string;
147
+ func_name: string;
148
+ log_level: string;
149
+ message: string;
150
+ metric?: string | null;
151
+ segment?: string | null;
152
+ statistic?: string | null;
153
+ timestamp: string;
154
+ }
155
+ export interface ConfigVersions {
156
+ metric_definitions?: ConfigVersionDetails[] | null;
157
+ jetstream_image?: ConfigVersionDetails | null;
158
+ }
159
+ export interface ConfigVersionDetails {
160
+ path?: string | null;
161
+ revision?: string | null;
162
+ }
163
+ export interface ExternalConfig {
164
+ reference_branch?: string | null;
165
+ end_date?: string | null;
166
+ start_date?: string | null;
167
+ enrollment_period?: number | null;
168
+ skip?: boolean | null;
169
+ url: string;
170
+ }
93
171
  export interface Metadata {
94
- analysis_start_time?: string;
95
- external_config?: ExternalConfig;
172
+ analysis_start_time?: string | null;
173
+ external_config?: ExternalConfig | null;
96
174
  metrics: {
97
175
  [k: string]: Metric;
98
176
  };
99
177
  outcomes?: {
100
178
  [k: string]: Outcome;
101
179
  };
102
- version_info?: ConfigVersions;
103
- version_date?: string;
180
+ version_info?: ConfigVersions | null;
181
+ version_date?: string | null;
104
182
  schema_version?: number;
105
183
  }
106
184
  export interface Metric {
107
185
  analysis_bases: AnalysisBasis[];
108
186
  bigger_is_better: boolean;
109
- description?: string;
110
- friendly_name?: string;
187
+ description?: string | null;
188
+ friendly_name?: string | null;
111
189
  }
112
190
  export interface Outcome {
113
- commit_hash?: string;
191
+ commit_hash?: string | null;
114
192
  default_metrics: string[];
115
193
  description: string;
116
194
  friendly_name: string;
117
195
  metrics: string[];
118
196
  slug: string;
119
197
  }
120
- export interface NimbusExperiment {
121
- schemaVersion: string;
122
- slug: string;
123
- id: string;
124
- appName: string;
125
- appId: string;
126
- channel: string;
127
- userFacingName: string;
128
- userFacingDescription: string;
129
- isEnrollmentPaused: boolean;
130
- isRollout?: boolean;
131
- bucketConfig: ExperimentBucketConfig;
132
- outcomes?: ExperimentOutcome[];
133
- featureIds: string[];
134
- branches: (
135
- | ExperimentSingleFeatureBranch
136
- | ExperimentMultiFeatureDesktopBranch
137
- | ExperimentMultiFeatureMobileBranch
138
- )[];
139
- targeting?: string;
140
- startDate?: string;
141
- enrollmentEndDate?: string;
142
- endDate?: string;
143
- proposedDuration?: number;
144
- proposedEnrollment?: number;
145
- referenceBranch?: string;
146
- featureValidationOptOut?: boolean;
147
- localizations?: {
148
- [k: string]: unknown;
149
- };
150
- locales?: string[];
151
- }
152
- export interface ExperimentBucketConfig {
153
- randomizationUnit: RandomizationUnit;
154
- namespace: string;
155
- start: number;
156
- count: number;
157
- total: number;
158
- }
159
- export interface ExperimentOutcome {
160
- slug: string;
161
- priority: string;
162
- }
163
- export interface ExperimentSingleFeatureBranch {
164
- slug: string;
165
- ratio: number;
166
- feature: ExperimentFeatureConfig;
167
- }
168
- export interface ExperimentFeatureConfig {
169
- featureId: string;
170
- enabled?: boolean;
171
- value: {
172
- [k: string]: unknown;
173
- };
174
- }
175
- export interface ExperimentMultiFeatureDesktopBranch {
176
- slug: string;
177
- ratio: number;
178
- feature: ExperimentFeatureConfig;
179
- features: ExperimentFeatureConfig[];
180
- }
181
- export interface ExperimentMultiFeatureMobileBranch {
182
- slug: string;
183
- ratio: number;
184
- features: ExperimentFeatureConfig[];
185
- }
186
- /**
187
- * `extra=Extra.allow` is needed for the pydantic2ts generation of
188
- * typescript definitions. Without this, models with only a custom
189
- * __root__ dictionary field will generate as empty types.
190
- *
191
- * See https://github.com/phillipdupuis/pydantic-to-typescript/blob/master/pydantic2ts/cli/script.py#L150-L153
192
- * and https://github.com/phillipdupuis/pydantic-to-typescript/issues/39
193
- * for more info.
194
- *
195
- * If this is fixed we should remove `extra=Extra.allow`.
196
- */
197
198
  export interface SampleSizes {
198
199
  [k: string]: SizingByUserType;
199
200
  }
200
- /**
201
- * `extra=Extra.allow` is needed for the pydantic2ts generation of
202
- * typescript definitions. Without this, models with only a custom
203
- * __root__ dictionary field will generate as empty types.
204
- *
205
- * See https://github.com/phillipdupuis/pydantic-to-typescript/blob/master/pydantic2ts/cli/script.py#L150-L153
206
- * and https://github.com/phillipdupuis/pydantic-to-typescript/issues/39
207
- * for more info.
208
- *
209
- * If this is fixed we should remove `extra=Extra.allow`.
210
- */
211
201
  export interface SizingByUserType {
212
202
  [k: string]: SizingTarget;
213
203
  }
@@ -220,8 +210,8 @@ export interface SizingTarget {
220
210
  export interface SizingRecipe {
221
211
  app_id: string;
222
212
  channel: SizingReleaseChannel;
223
- locale?: string;
224
- language?: string;
213
+ locale?: string | null;
214
+ language?: string | null;
225
215
  country: string;
226
216
  new_or_existing: SizingUserType;
227
217
  }
@@ -244,14 +234,14 @@ export interface Statistic {
244
234
  metric: string;
245
235
  statistic: string;
246
236
  branch: string;
247
- parameter?: number;
248
- comparison?: string;
249
- comparison_to_branch?: string;
250
- ci_width?: number;
251
- point?: number;
252
- lower?: number;
253
- upper?: number;
237
+ parameter?: number | null;
238
+ comparison?: string | null;
239
+ comparison_to_branch?: string | null;
240
+ ci_width?: number | null;
241
+ point?: number | null;
242
+ lower?: number | null;
243
+ upper?: number | null;
254
244
  segment?: string;
255
- analysis_basis?: AnalysisBasis;
256
- window_index?: string;
245
+ analysis_basis?: AnalysisBasis | null;
246
+ window_index?: string | null;
257
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozilla/nimbus-schemas",
3
- "version": "2024.9.1",
3
+ "version": "2024.9.3",
4
4
  "description": "Schemas used by Mozilla Nimbus and related projects.",
5
5
  "main": "index.d.ts",
6
6
  "repository": {