-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment.ts
51 lines (47 loc) · 1.29 KB
/
experiment.ts
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
export interface Experiment {
data: {
id: string
type: 'guild'
title: string
description: string[]
buckets: number[]
hash: number
}
rollout: [
number, // hash
string | null, // hash key
number, // revision
Population[], // populations
{ // overrides
/** bucket */ b: number,
/** server IDs */ k: string[]
}[],
[Population[]] // overrides formatted
]
}
export type Population = [
[
number, //bucket
{ // rollout
/** start */ s: number,
/** end */ e: number
}[]
][],
Filter[]
]
export enum FilterType {
Feature = 1604612045,
IDRange = 2404720969,
MemberCount = 2918402255,
ID = 3013771838,
HubType = 4148745523,
VanityURL = 188952590, // format unknown
RangeByHash = 2294888943
}
type FeatureFilter = [FilterType.Feature, [[number, string[]]]]
type IDRangeFilter = [FilterType.IDRange, [[number, number | null], [number, number]]]
type MemberCountFilter = [FilterType.MemberCount, [[number, number | null], [number, number]]]
type IDFilter = [FilterType.ID, [[number, string[]]]]
type HubTypeFilter = [FilterType.HubType, [[number, number[]]]]
type RangeByHashFilter = [FilterType.RangeByHash, [[number, number], [number, number]]]
export type Filter = FeatureFilter | IDRangeFilter | MemberCountFilter | IDFilter | HubTypeFilter | RangeByHashFilter