@mozilla/nimbus-schemas 2023.8.4 → 2023.9.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.
Files changed (2) hide show
  1. package/index.d.ts +133 -0
  2. package/package.json +3 -3
package/index.d.ts ADDED
@@ -0,0 +1,133 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
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
+ */
7
+
8
+ export type AnalysisBasis = "enrollments" | "exposures";
9
+ export type LogSource = "jetstream" | "sizing" | "jetstream-preview";
10
+ export type AnalysisErrors = AnalysisError[];
11
+ export type SizingReleaseChannel = "release" | "beta" | "nightly";
12
+ export type SizingUserType = "new" | "existing";
13
+ export type Statistics = Statistic[];
14
+
15
+ export interface AnalysisError {
16
+ analysis_basis?: AnalysisBasis;
17
+ source?: LogSource;
18
+ exception?: string;
19
+ exception_type?: string;
20
+ experiment?: string;
21
+ filename: string;
22
+ func_name: string;
23
+ log_level: string;
24
+ message: string;
25
+ metric?: string;
26
+ segment?: string;
27
+ statistic?: string;
28
+ timestamp: string;
29
+ }
30
+ export interface ExternalConfig {
31
+ reference_branch?: string;
32
+ end_date?: string;
33
+ start_date?: string;
34
+ enrollment_period?: number;
35
+ skip?: boolean;
36
+ url: string;
37
+ }
38
+ export interface Metadata {
39
+ analysis_start_time?: string;
40
+ external_config?: ExternalConfig;
41
+ metrics: {
42
+ [k: string]: Metric;
43
+ };
44
+ outcomes?: {
45
+ [k: string]: Outcome;
46
+ };
47
+ schema_version?: number;
48
+ }
49
+ export interface Metric {
50
+ analysis_bases: AnalysisBasis[];
51
+ bigger_is_better: boolean;
52
+ description?: string;
53
+ friendly_name?: string;
54
+ }
55
+ export interface Outcome {
56
+ commit_hash?: string;
57
+ default_metrics: string[];
58
+ description: string;
59
+ friendly_name: string;
60
+ metrics: string[];
61
+ slug: string;
62
+ }
63
+ /**
64
+ * `extra=Extra.allow` is needed for the pydantic2ts generation of
65
+ * typescript definitions. Without this, models with only a custom
66
+ * __root__ dictionary field will generate as empty types.
67
+ *
68
+ * See https://github.com/phillipdupuis/pydantic-to-typescript/blob/master/pydantic2ts/cli/script.py#L150-L153
69
+ * and https://github.com/phillipdupuis/pydantic-to-typescript/issues/39
70
+ * for more info.
71
+ *
72
+ * If this is fixed we should remove `extra=Extra.allow`.
73
+ */
74
+ export interface SampleSizes {
75
+ [k: string]: SizingByUserType;
76
+ }
77
+ /**
78
+ * `extra=Extra.allow` is needed for the pydantic2ts generation of
79
+ * typescript definitions. Without this, models with only a custom
80
+ * __root__ dictionary field will generate as empty types.
81
+ *
82
+ * See https://github.com/phillipdupuis/pydantic-to-typescript/blob/master/pydantic2ts/cli/script.py#L150-L153
83
+ * and https://github.com/phillipdupuis/pydantic-to-typescript/issues/39
84
+ * for more info.
85
+ *
86
+ * If this is fixed we should remove `extra=Extra.allow`.
87
+ */
88
+ export interface SizingByUserType {
89
+ [k: string]: SizingTarget;
90
+ }
91
+ export interface SizingTarget {
92
+ target_recipe: SizingRecipe;
93
+ sample_sizes: {
94
+ [k: string]: SizingDetails;
95
+ };
96
+ }
97
+ export interface SizingRecipe {
98
+ app_id: string;
99
+ channel: SizingReleaseChannel;
100
+ locale: string;
101
+ country: string;
102
+ new_or_existing: SizingUserType;
103
+ }
104
+ export interface SizingDetails {
105
+ metrics: {
106
+ [k: string]: SizingMetric;
107
+ };
108
+ parameters: SizingParameters;
109
+ }
110
+ export interface SizingMetric {
111
+ number_of_clients_targeted: number;
112
+ sample_size_per_branch: number;
113
+ population_percent_per_branch: number;
114
+ }
115
+ export interface SizingParameters {
116
+ power: number;
117
+ effect_size: number;
118
+ }
119
+ export interface Statistic {
120
+ metric: string;
121
+ statistic: string;
122
+ branch: string;
123
+ parameter?: number;
124
+ comparison?: string;
125
+ comparison_to_branch?: string;
126
+ ci_width?: number;
127
+ point?: number;
128
+ lower?: number;
129
+ upper?: number;
130
+ segment?: string;
131
+ analysis_basis?: AnalysisBasis;
132
+ window_index?: string;
133
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@mozilla/nimbus-schemas",
3
- "version": "2023.8.4",
3
+ "version": "2023.9.1",
4
4
  "description": "Schemas used by Mozilla Nimbus and related projects.",
5
- "main": "index.ts",
5
+ "main": "index.d.ts",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/mozilla/experimenter.git"
@@ -18,6 +18,6 @@
18
18
  "typescript": "^5.1.6"
19
19
  },
20
20
  "files": [
21
- "index.ts"
21
+ "index.d.ts"
22
22
  ]
23
23
  }