@notidotbot/noti-api-client 1.9.93 → 1.9.95

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.
@@ -0,0 +1,274 @@
1
+ import { CancelOutWebResponses } from '../types';
2
+ import { WebDataManager } from '../core/manager';
3
+ /**
4
+ * A/B experiments (promos, offers). Staff only for the admin methods (403 otherwise); every change is audit-logged.
5
+ * The two `create...ExperimentEvent` methods are for the dashboard: report what the viewer saw and did, for the arm the server
6
+ * gave them (a mismatched or preview arm answers `{ recorded: false }` and is not counted).
7
+ */
8
+ export declare class APIAdminExperiments {
9
+ private web;
10
+ constructor(web: WebDataManager);
11
+ /** Every experiment, newest first (200 max). */
12
+ getAdminExperiments({ auth }: AdminExperimentsFunctionsInput['getAdminExperiments']): Promise<import("../types").WebResponse<{
13
+ experiments: Experiment[];
14
+ }>>;
15
+ /**
16
+ * Create an experiment (stage `draft`). Key: 2-48 lowercase letters, digits, `.`, `-`, `_`. 2-5 variants, one named
17
+ * `control` (the baseline); `exp:<key>:<variant>` must fit 64 characters. 409 if the key exists.
18
+ */
19
+ createAdminExperiment({ auth, experiment }: AdminExperimentsFunctionsInput['createAdminExperiment']): Promise<import("../types").WebResponse<Experiment>>;
20
+ /** Surfaces, rule, variants. Once started, variant keys and weights are locked (only `config` text can change). */
21
+ updateAdminExperiment({ auth, key, experiment }: AdminExperimentsFunctionsInput['updateAdminExperiment']): Promise<import("../types").WebResponse<Experiment>>;
22
+ /** Move an experiment between stages. `rollout` needs a percentage above 0. An `ended` experiment cannot restart. */
23
+ updateAdminExperimentStage({ auth, key, stage, rolloutPct }: AdminExperimentsFunctionsInput['updateAdminExperimentStage']): Promise<import("../types").WebResponse<Experiment>>;
24
+ /** "Make winner": everyone gets this variant from now on and the experiment ends. `control` = show nothing. */
25
+ createAdminExperimentWinner({ auth, key, variant }: AdminExperimentsFunctionsInput['createAdminExperimentWinner']): Promise<import("../types").WebResponse<Experiment>>;
26
+ /**
27
+ * Results: per variant - exposures, clicks, conversions (adopt: the server turned the feature on within 7 days of
28
+ * first seeing it; buy: an attributed purchase within 14 days), revenue, conversion rate, lift and p-value vs
29
+ * control - plus `likelyWinner` (beats control at p < 0.05 with 200+ exposures each, or `control` when the promo
30
+ * hurts) and daily view / click / dismiss counts. Shown only: "Make winner" is still a staff click.
31
+ */
32
+ getAdminExperimentResults({ auth, key }: AdminExperimentsFunctionsInput['getAdminExperimentResults']): Promise<import("../types").WebResponse<ExperimentResults>>;
33
+ /**
34
+ * Dashboard: the feature promo for one surface of a server - `home`, `banner` or `page:<feature>` (0 or 1 card).
35
+ * The server records that it was shown (control included), so do NOT send a `view` event for promos; send `click` on
36
+ * the CTA and `dismiss` on the X (createGuildExperimentEvent). Pass `attribution` into checkout when the CTA buys.
37
+ */
38
+ getGuildPromos({ auth, guildId, surface }: AdminExperimentsFunctionsInput['getGuildPromos']): Promise<import("../types").WebResponse<{
39
+ promos: PromoCard[];
40
+ }>>;
41
+ /**
42
+ * Dashboard: the logged-in person's discount offer banner, or null. The first call starts their window (`endsAt`
43
+ * is fixed from then on). Pass `key` as `offer` to the checkout (premium.createCheckoutSession body) - the server
44
+ * re-checks it. Report `click` / `dismiss` with createExperimentEvent; do not send `view`.
45
+ */
46
+ getMyOffer({ auth }: AdminExperimentsFunctionsInput['getMyOffer']): Promise<import("../types").WebResponse<{
47
+ offer: OfferCard | null;
48
+ }>>;
49
+ /**
50
+ * Dashboard: an "add this too" suggestion for the add-ons in the cart (addon ids, e.g. `TiktokConnections`), or null.
51
+ * Call when the cart changes. Accepting adds `suggestAddon` to the cart and sends `pairOffer: key` with the
52
+ * checkout; report `click` (accepted) / `dismiss` (no thanks) with createExperimentEvent. Do not send `view`.
53
+ */
54
+ getCheckoutSuggestion({ auth, addons }: AdminExperimentsFunctionsInput['getCheckoutSuggestion']): Promise<import("../types").WebResponse<{
55
+ suggestion: PairSuggestion | null;
56
+ }>>;
57
+ /** Dashboard: a server-unit experiment event (promos). Needs access to the server. */
58
+ createGuildExperimentEvent({ auth, guildId, event }: AdminExperimentsFunctionsInput['createGuildExperimentEvent']): Promise<import("../types").WebResponse<{
59
+ recorded: boolean;
60
+ }>>;
61
+ /** Dashboard: a person-unit experiment event (offers). */
62
+ createExperimentEvent({ auth, event }: AdminExperimentsFunctionsInput['createExperimentEvent']): Promise<import("../types").WebResponse<{
63
+ recorded: boolean;
64
+ }>>;
65
+ }
66
+ /** Mirrors EXPERIMENT_STAGES / KINDS / UNITS / GOALS in Noti-v3 `src/modules/experiments/assign.ts`. */
67
+ export declare const EXPERIMENT_STAGES: readonly ["draft", "dev", "beta", "rollout", "live", "ended"];
68
+ export type ExperimentStage = typeof EXPERIMENT_STAGES[number];
69
+ export type ExperimentKind = 'promo' | 'offer' | 'pairOffer';
70
+ export type ExperimentUnit = 'server' | 'person';
71
+ export type ExperimentGoal = 'adopt' | 'buy';
72
+ export type ExperimentEventType = 'view' | 'click' | 'dismiss';
73
+ /** `weight` 0-100 (relative). `config` is per kind (promo copy, offer terms). */
74
+ export type ExperimentVariant = {
75
+ key: string;
76
+ weight: number;
77
+ config?: Record<string, unknown>;
78
+ };
79
+ export type Experiment = {
80
+ dbId: string;
81
+ key: string;
82
+ kind: ExperimentKind;
83
+ unitType: ExperimentUnit;
84
+ goal: ExperimentGoal;
85
+ /** draft (nobody) -> dev (staff) -> beta (+ beta testers) -> rollout (rolloutPct % of units) -> live (everyone) -> ended. */
86
+ stage: ExperimentStage;
87
+ rolloutPct: number;
88
+ winner: string | null;
89
+ /** `home` | `banner` | `discord` | `page:<feature>` */
90
+ surfaces: string[];
91
+ targetRule: unknown;
92
+ variants: ExperimentVariant[];
93
+ startedAt: string | null;
94
+ endedAt: string | null;
95
+ createdAt: string;
96
+ updatedAt: string;
97
+ };
98
+ export type ExperimentInput = {
99
+ key: string;
100
+ kind: ExperimentKind;
101
+ unitType: ExperimentUnit;
102
+ goal: ExperimentGoal;
103
+ surfaces?: string[];
104
+ targetRule?: unknown;
105
+ variants: ExperimentVariant[];
106
+ };
107
+ export type ExperimentEvent = {
108
+ key: string;
109
+ variant: string;
110
+ type: ExperimentEventType;
111
+ };
112
+ export type ExperimentVariantResult = {
113
+ variant: string;
114
+ exposures: number;
115
+ clicks: number;
116
+ conversions: number;
117
+ revenueCents: number;
118
+ conversionRate: number;
119
+ /** vs control, e.g. 0.3 = 30% better; null for control or when control converted nobody. */
120
+ liftVsControl: number | null;
121
+ /** two-sided, vs control; null for control. */
122
+ pValue: number | null;
123
+ };
124
+ export type ExperimentResults = {
125
+ goal: ExperimentGoal;
126
+ variants: ExperimentVariantResult[];
127
+ likelyWinner: string | null;
128
+ minExposures: number;
129
+ days: {
130
+ date: string;
131
+ variants: Record<string, {
132
+ view: number;
133
+ click: number;
134
+ dismiss: number;
135
+ }>;
136
+ }[];
137
+ };
138
+ /**
139
+ * A discount offer banner: "<bannerText>", ending at `endsAt` (show a countdown). `percentOff` applies to the first
140
+ * payment of a new monthly subscription.
141
+ * Admin: an `offer` experiment is unitType `person`, goal `buy`; each non-control variant's config is
142
+ * `{ percentOff (5-90), hours (1-168), bannerText (<=120) }` - the server adds `couponId` itself.
143
+ */
144
+ export type OfferCard = {
145
+ key: string;
146
+ variant: string;
147
+ percentOff: number;
148
+ endsAt: string;
149
+ bannerText: string;
150
+ };
151
+ /**
152
+ * "Add <suggestAddon> for <percentOff>% off" - the discount is on that add-on's first payment only. Never call it a bundle.
153
+ * Admin: a `pairOffer` experiment is unitType `person`, goal `buy`; every non-control variant's config is
154
+ * `{ whenAddon, suggestAddon, percentOff (5-90), text (<=120) }` with the SAME whenAddon / suggestAddon (one pair per
155
+ * experiment); the server adds `couponId`.
156
+ */
157
+ export type PairSuggestion = {
158
+ key: string;
159
+ variant: string;
160
+ suggestAddon: string;
161
+ percentOff: number;
162
+ text: string;
163
+ };
164
+ /** A feature promo to render. `link` is a dashboard path; `premium` = the feature needs a paid plan or add-on. */
165
+ export type PromoCard = {
166
+ key: string;
167
+ variant: string;
168
+ /** Promotable feature id, e.g. `ClipForwarding`. */
169
+ feature: string;
170
+ title: string;
171
+ body: string;
172
+ cta: string;
173
+ link: string;
174
+ premium: boolean;
175
+ /** `exp:<key>:<variant>` - send as the checkout attribution source when this card leads to a purchase. */
176
+ attribution: string;
177
+ /** The variant's Discord tip text, if set. Dashboard: ignore. */
178
+ discord?: string;
179
+ };
180
+ /**
181
+ * A promo experiment's `targetRule`: the feature it promotes and an optional rule. Facts: `uses:<feature>`,
182
+ * `notUses:<feature>`, `paid`, `free`, combined with `{ all: [...] }`, `{ any: [...] }`, `{ not: rule }`.
183
+ * Variant `config` for a promo: `{ title (<=80), body (<=240), cta (<=30), discordText? (<=150) }` - `control` shows
184
+ * nothing. `discordText` is the Discord reply tip when the experiment's surfaces include `discord` (title if unset).
185
+ */
186
+ export type PromoRule = string | {
187
+ all: PromoRule[];
188
+ } | {
189
+ any: PromoRule[];
190
+ } | {
191
+ not: PromoRule;
192
+ };
193
+ export type PromoTarget = {
194
+ feature: string;
195
+ when?: PromoRule;
196
+ };
197
+ export type AdminExperimentsFunctionsInput = {
198
+ 'getAdminExperiments': {
199
+ auth: string;
200
+ };
201
+ 'createAdminExperiment': {
202
+ auth: string;
203
+ experiment: ExperimentInput;
204
+ };
205
+ 'updateAdminExperiment': {
206
+ auth: string;
207
+ key: string;
208
+ experiment: {
209
+ surfaces?: string[];
210
+ targetRule?: unknown;
211
+ variants?: ExperimentVariant[];
212
+ };
213
+ };
214
+ 'updateAdminExperimentStage': {
215
+ auth: string;
216
+ key: string;
217
+ stage: ExperimentStage;
218
+ rolloutPct?: number;
219
+ };
220
+ 'createAdminExperimentWinner': {
221
+ auth: string;
222
+ key: string;
223
+ variant: string;
224
+ };
225
+ 'getAdminExperimentResults': {
226
+ auth: string;
227
+ key: string;
228
+ };
229
+ 'getMyOffer': {
230
+ auth: string;
231
+ };
232
+ 'getCheckoutSuggestion': {
233
+ auth: string;
234
+ addons: string[];
235
+ };
236
+ 'getGuildPromos': {
237
+ auth: string;
238
+ guildId: string;
239
+ surface: string;
240
+ };
241
+ 'createGuildExperimentEvent': {
242
+ auth: string;
243
+ guildId: string;
244
+ event: ExperimentEvent;
245
+ };
246
+ 'createExperimentEvent': {
247
+ auth: string;
248
+ event: ExperimentEvent;
249
+ };
250
+ };
251
+ export type AdminExperimentsGetReturnTypes = {
252
+ 'getAdminExperimentsRaw': Awaited<ReturnType<APIAdminExperiments['getAdminExperiments']>>;
253
+ 'getAdminExperimentsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['getAdminExperiments']>>>;
254
+ 'createAdminExperimentRaw': Awaited<ReturnType<APIAdminExperiments['createAdminExperiment']>>;
255
+ 'createAdminExperimentSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['createAdminExperiment']>>>;
256
+ 'updateAdminExperimentRaw': Awaited<ReturnType<APIAdminExperiments['updateAdminExperiment']>>;
257
+ 'updateAdminExperimentSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['updateAdminExperiment']>>>;
258
+ 'updateAdminExperimentStageRaw': Awaited<ReturnType<APIAdminExperiments['updateAdminExperimentStage']>>;
259
+ 'updateAdminExperimentStageSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['updateAdminExperimentStage']>>>;
260
+ 'createAdminExperimentWinnerRaw': Awaited<ReturnType<APIAdminExperiments['createAdminExperimentWinner']>>;
261
+ 'createAdminExperimentWinnerSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['createAdminExperimentWinner']>>>;
262
+ 'getAdminExperimentResultsRaw': Awaited<ReturnType<APIAdminExperiments['getAdminExperimentResults']>>;
263
+ 'getAdminExperimentResultsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['getAdminExperimentResults']>>>;
264
+ 'getMyOfferRaw': Awaited<ReturnType<APIAdminExperiments['getMyOffer']>>;
265
+ 'getMyOfferSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['getMyOffer']>>>;
266
+ 'getCheckoutSuggestionRaw': Awaited<ReturnType<APIAdminExperiments['getCheckoutSuggestion']>>;
267
+ 'getCheckoutSuggestionSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['getCheckoutSuggestion']>>>;
268
+ 'getGuildPromosRaw': Awaited<ReturnType<APIAdminExperiments['getGuildPromos']>>;
269
+ 'getGuildPromosSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['getGuildPromos']>>>;
270
+ 'createGuildExperimentEventRaw': Awaited<ReturnType<APIAdminExperiments['createGuildExperimentEvent']>>;
271
+ 'createGuildExperimentEventSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['createGuildExperimentEvent']>>>;
272
+ 'createExperimentEventRaw': Awaited<ReturnType<APIAdminExperiments['createExperimentEvent']>>;
273
+ 'createExperimentEventSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdminExperiments['createExperimentEvent']>>>;
274
+ };
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXPERIMENT_STAGES = exports.APIAdminExperiments = void 0;
4
+ // Data.
5
+ /**
6
+ * A/B experiments (promos, offers). Staff only for the admin methods (403 otherwise); every change is audit-logged.
7
+ * The two `create...ExperimentEvent` methods are for the dashboard: report what the viewer saw and did, for the arm the server
8
+ * gave them (a mismatched or preview arm answers `{ recorded: false }` and is not counted).
9
+ */
10
+ class APIAdminExperiments {
11
+ web;
12
+ constructor(web) {
13
+ this.web = web;
14
+ }
15
+ /** Every experiment, newest first (200 max). */
16
+ async getAdminExperiments({ auth }) {
17
+ return await this.web.request({
18
+ method: 'GET', auth,
19
+ endpoint: this.web.qp('/admin/experiments'),
20
+ });
21
+ }
22
+ /**
23
+ * Create an experiment (stage `draft`). Key: 2-48 lowercase letters, digits, `.`, `-`, `_`. 2-5 variants, one named
24
+ * `control` (the baseline); `exp:<key>:<variant>` must fit 64 characters. 409 if the key exists.
25
+ */
26
+ async createAdminExperiment({ auth, experiment }) {
27
+ return await this.web.request({
28
+ method: 'POST', auth,
29
+ endpoint: this.web.qp('/admin/experiments'),
30
+ body: experiment,
31
+ });
32
+ }
33
+ /** Surfaces, rule, variants. Once started, variant keys and weights are locked (only `config` text can change). */
34
+ async updateAdminExperiment({ auth, key, experiment }) {
35
+ return await this.web.request({
36
+ method: 'PATCH', auth,
37
+ endpoint: this.web.qp('/admin/experiments/' + encodeURIComponent(key)),
38
+ body: experiment,
39
+ });
40
+ }
41
+ /** Move an experiment between stages. `rollout` needs a percentage above 0. An `ended` experiment cannot restart. */
42
+ async updateAdminExperimentStage({ auth, key, stage, rolloutPct }) {
43
+ return await this.web.request({
44
+ method: 'PATCH', auth,
45
+ endpoint: this.web.qp('/admin/experiments/' + encodeURIComponent(key) + '/stage'),
46
+ body: { stage, ...(rolloutPct !== undefined ? { rolloutPct } : {}) },
47
+ });
48
+ }
49
+ /** "Make winner": everyone gets this variant from now on and the experiment ends. `control` = show nothing. */
50
+ async createAdminExperimentWinner({ auth, key, variant }) {
51
+ return await this.web.request({
52
+ method: 'POST', auth,
53
+ endpoint: this.web.qp('/admin/experiments/' + encodeURIComponent(key) + '/winner'),
54
+ body: { variant },
55
+ });
56
+ }
57
+ /**
58
+ * Results: per variant - exposures, clicks, conversions (adopt: the server turned the feature on within 7 days of
59
+ * first seeing it; buy: an attributed purchase within 14 days), revenue, conversion rate, lift and p-value vs
60
+ * control - plus `likelyWinner` (beats control at p < 0.05 with 200+ exposures each, or `control` when the promo
61
+ * hurts) and daily view / click / dismiss counts. Shown only: "Make winner" is still a staff click.
62
+ */
63
+ async getAdminExperimentResults({ auth, key }) {
64
+ return await this.web.request({
65
+ method: 'GET', auth,
66
+ endpoint: this.web.qp('/admin/experiments/' + encodeURIComponent(key) + '/results'),
67
+ });
68
+ }
69
+ /**
70
+ * Dashboard: the feature promo for one surface of a server - `home`, `banner` or `page:<feature>` (0 or 1 card).
71
+ * The server records that it was shown (control included), so do NOT send a `view` event for promos; send `click` on
72
+ * the CTA and `dismiss` on the X (createGuildExperimentEvent). Pass `attribution` into checkout when the CTA buys.
73
+ */
74
+ async getGuildPromos({ auth, guildId, surface }) {
75
+ return await this.web.request({
76
+ method: 'GET', auth,
77
+ endpoint: this.web.qp('/data/guild/' + guildId + '/promos', { surface }),
78
+ });
79
+ }
80
+ /**
81
+ * Dashboard: the logged-in person's discount offer banner, or null. The first call starts their window (`endsAt`
82
+ * is fixed from then on). Pass `key` as `offer` to the checkout (premium.createCheckoutSession body) - the server
83
+ * re-checks it. Report `click` / `dismiss` with createExperimentEvent; do not send `view`.
84
+ */
85
+ async getMyOffer({ auth }) {
86
+ return await this.web.request({
87
+ method: 'GET', auth,
88
+ endpoint: this.web.qp('/data/offers'),
89
+ });
90
+ }
91
+ /**
92
+ * Dashboard: an "add this too" suggestion for the add-ons in the cart (addon ids, e.g. `TiktokConnections`), or null.
93
+ * Call when the cart changes. Accepting adds `suggestAddon` to the cart and sends `pairOffer: key` with the
94
+ * checkout; report `click` (accepted) / `dismiss` (no thanks) with createExperimentEvent. Do not send `view`.
95
+ */
96
+ async getCheckoutSuggestion({ auth, addons }) {
97
+ return await this.web.request({
98
+ method: 'GET', auth,
99
+ endpoint: this.web.qp('/data/checkout-suggestions', { addons: addons.join(',') }),
100
+ });
101
+ }
102
+ /** Dashboard: a server-unit experiment event (promos). Needs access to the server. */
103
+ async createGuildExperimentEvent({ auth, guildId, event }) {
104
+ return await this.web.request({
105
+ method: 'POST', auth,
106
+ endpoint: this.web.qp('/data/guild/' + guildId + '/experiment-events'),
107
+ body: event,
108
+ });
109
+ }
110
+ /** Dashboard: a person-unit experiment event (offers). */
111
+ async createExperimentEvent({ auth, event }) {
112
+ return await this.web.request({
113
+ method: 'POST', auth,
114
+ endpoint: this.web.qp('/data/experiment-events'),
115
+ body: event,
116
+ });
117
+ }
118
+ }
119
+ exports.APIAdminExperiments = APIAdminExperiments;
120
+ // Types.
121
+ /** Mirrors EXPERIMENT_STAGES / KINDS / UNITS / GOALS in Noti-v3 `src/modules/experiments/assign.ts`. */
122
+ exports.EXPERIMENT_STAGES = ['draft', 'dev', 'beta', 'rollout', 'live', 'ended'];
@@ -155,7 +155,7 @@ export type GuildFunctionsInput<T extends SendPanelType = never, T2 extends Guil
155
155
  'sendGreetOrBirthdayMessage': {
156
156
  auth: string;
157
157
  guildId: string;
158
- type: 'welcome' | 'leave' | 'birthday';
158
+ type: 'welcome' | 'leave' | 'birthday' | 'anniversary';
159
159
  };
160
160
  };
161
161
  export type GuildReturnTypes = {
@@ -294,3 +294,12 @@ export type StreamRoleCleanupResult = {
294
294
  /** Of those, the ones whose role was stale and has been taken back. */
295
295
  removed: number;
296
296
  };
297
+ /**
298
+ * Join anniversary milestone roles: at most `maxRoles` entries in `guild.anniversaryRoles`, each `years` from `minYears` to
299
+ * `maxYears`. Mirrors ANNIVERSARY_LIMITS in Noti-v3 `src/json/zod/guild.zod.ts` (a test there keeps them equal).
300
+ */
301
+ export declare const ANNIVERSARY_LIMITS: {
302
+ readonly maxRoles: 20;
303
+ readonly minYears: 1;
304
+ readonly maxYears: 100;
305
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APIGuild = void 0;
3
+ exports.ANNIVERSARY_LIMITS = exports.APIGuild = void 0;
4
4
  // Data.
5
5
  class APIGuild {
6
6
  web;
@@ -168,3 +168,8 @@ class APIGuild {
168
168
  }
169
169
  }
170
170
  exports.APIGuild = APIGuild;
171
+ /**
172
+ * Join anniversary milestone roles: at most `maxRoles` entries in `guild.anniversaryRoles`, each `years` from `minYears` to
173
+ * `maxYears`. Mirrors ANNIVERSARY_LIMITS in Noti-v3 `src/json/zod/guild.zod.ts` (a test there keeps them equal).
174
+ */
175
+ exports.ANNIVERSARY_LIMITS = { maxRoles: 20, minYears: 1, maxYears: 100 };
@@ -212,6 +212,19 @@ export type CreateCheckoutSessionBody<T extends 'guild' | 'user'> = T extends 'g
212
212
  * popup sold the thing it was attached to.
213
213
  */
214
214
  attributionGuildId?: string;
215
+ /**
216
+ * A discount offer's key (`OfferCard.key` from getMyOffer). The server applies its coupon only when this account
217
+ * is in the offer, its window is open, and the checkout is monthly with no trial and no `affiliate` code -
218
+ * otherwise the checkout goes on at full price (never an error). While an offer applies, Stripe's own promo-code
219
+ * box is not shown (one discount at a time).
220
+ */
221
+ offer?: string;
222
+ /**
223
+ * An "add this too" pair offer's key (PairSuggestion.key from getCheckoutSuggestion). Applied only when both add-ons
224
+ * are in this checkout, the suggestion was shown to this account, it is monthly with no trial or affiliate, and
225
+ * no `offer` applies (one discount per checkout). Otherwise full price, never an error.
226
+ */
227
+ pairOffer?: string;
215
228
  trialDays?: number;
216
229
  } & ListOfDefaultItems : T extends 'user' ? {
217
230
  email: string;
@@ -237,6 +250,19 @@ export type CreateCheckoutSessionBody<T extends 'guild' | 'user'> = T extends 'g
237
250
  * popup sold the thing it was attached to.
238
251
  */
239
252
  attributionGuildId?: string;
253
+ /**
254
+ * A discount offer's key (`OfferCard.key` from getMyOffer). The server applies its coupon only when this account
255
+ * is in the offer, its window is open, and the checkout is monthly with no trial and no `affiliate` code -
256
+ * otherwise the checkout goes on at full price (never an error). While an offer applies, Stripe's own promo-code
257
+ * box is not shown (one discount at a time).
258
+ */
259
+ offer?: string;
260
+ /**
261
+ * An "add this too" pair offer's key (PairSuggestion.key from getCheckoutSuggestion). Applied only when both add-ons
262
+ * are in this checkout, the suggestion was shown to this account, it is monthly with no trial or affiliate, and
263
+ * no `offer` applies (one discount per checkout). Otherwise full price, never an error.
264
+ */
265
+ pairOffer?: string;
240
266
  trialDays?: number;
241
267
  } & ListOfDefaultItems : never;
242
268
  export type OneTimePaymentUrlBody = {
@@ -43,6 +43,7 @@ import { APIAnnouncements } from '../classes/announcements';
43
43
  import { APIAdminPolls } from '../classes/adminPolls';
44
44
  import { APIFeedback } from '../classes/feedback';
45
45
  import { APIAdminFeedback } from '../classes/adminFeedback';
46
+ import { APIAdminExperiments } from '../classes/adminExperiments';
46
47
  import { APIAdminAnnouncements } from '../classes/adminAnnouncements';
47
48
  import { APIGuildFishing } from '../classes/guildFishing';
48
49
  import { APIAdminFishing } from '../classes/adminFishing';
@@ -75,6 +76,7 @@ export declare class WebDataManager {
75
76
  readonly adminAnnouncements: APIAdminAnnouncements;
76
77
  readonly feedback: APIFeedback;
77
78
  readonly adminFeedback: APIAdminFeedback;
79
+ readonly adminExperiments: APIAdminExperiments;
78
80
  readonly other: APIOther;
79
81
  readonly guild: APIGuild;
80
82
  readonly teams: APITeams;
@@ -48,6 +48,7 @@ const announcements_1 = require("../classes/announcements");
48
48
  const adminPolls_1 = require("../classes/adminPolls");
49
49
  const feedback_1 = require("../classes/feedback");
50
50
  const adminFeedback_1 = require("../classes/adminFeedback");
51
+ const adminExperiments_1 = require("../classes/adminExperiments");
51
52
  const adminAnnouncements_1 = require("../classes/adminAnnouncements");
52
53
  const guildFishing_1 = require("../classes/guildFishing");
53
54
  const adminFishing_1 = require("../classes/adminFishing");
@@ -79,6 +80,7 @@ class WebDataManager {
79
80
  adminAnnouncements = new adminAnnouncements_1.APIAdminAnnouncements(this);
80
81
  feedback = new feedback_1.APIFeedback(this);
81
82
  adminFeedback = new adminFeedback_1.APIAdminFeedback(this);
83
+ adminExperiments = new adminExperiments_1.APIAdminExperiments(this);
82
84
  other = new other_1.APIOther(this);
83
85
  guild = new guild_1.APIGuild(this);
84
86
  teams = new teams_1.APITeams(this);
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './classes/announcements';
15
15
  export * from './classes/adminPolls';
16
16
  export * from './classes/feedback';
17
17
  export * from './classes/adminFeedback';
18
+ export * from './classes/adminExperiments';
18
19
  export * from './classes/adminAnnouncements';
19
20
  export * from './classes/emotes';
20
21
  export * from './classes/files';
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ __exportStar(require("./classes/announcements"), exports);
32
32
  __exportStar(require("./classes/adminPolls"), exports);
33
33
  __exportStar(require("./classes/feedback"), exports);
34
34
  __exportStar(require("./classes/adminFeedback"), exports);
35
+ __exportStar(require("./classes/adminExperiments"), exports);
35
36
  __exportStar(require("./classes/adminAnnouncements"), exports);
36
37
  __exportStar(require("./classes/emotes"), exports);
37
38
  __exportStar(require("./classes/files"), exports);
@@ -135,6 +135,8 @@ export declare const GuildFeatures: {
135
135
  BoostLogsAndStreaks: bigint;
136
136
  BoostBoard: bigint;
137
137
  UnlimitedEmojiRepositions: bigint;
138
+ BirthdayPostOptions: bigint;
139
+ JoinAnniversaries: bigint;
138
140
  };
139
141
  export declare const GuildFeaturesText: Record<keyof typeof GuildFeatures, string>;
140
142
  export declare const UserFeatures: {
@@ -258,8 +260,10 @@ export declare class GuildFeaturesManager extends BitFieldManager<typeof GuildFe
258
260
  BoostLogsAndStreaks: bigint;
259
261
  BoostBoard: bigint;
260
262
  UnlimitedEmojiRepositions: bigint;
263
+ BirthdayPostOptions: bigint;
264
+ JoinAnniversaries: bigint;
261
265
  };
262
- t: Record<"BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickClips" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "StatusRoles" | "ManageBranding" | "StickyMessages" | "Starboards" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "LinkedRoles" | "RandomMessages" | "WeeklyBirthdayPanel" | "GameNotifications" | "GameCategoryRouting" | "GameAllTimeLowAlerts" | "GameChangelogs" | "GameRobloxTracking" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "WhatnotNotifications" | "ScheduledEventMessages" | "ScheduledMessageWebhooks" | "ReactionRoles" | "AdvancedRolePanels" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications" | "RolePanelWebhooks" | "Fishing" | "FishingCustomization" | "FishingWebhooks" | "StreamRoles" | "RoleFilters" | "TwitterNotifications" | "TwitterLiveNotifications" | "BadgeAllGames" | "AutoRoles" | "AutoRoleTimers" | "AutoRoleInvites" | "StickyMessageRoleFilters" | "GiveawayClaims" | "GiveawayWinnerRole" | "InfluencerPanel" | "InfluencerPanelPremium" | "InfluencerPanelPlus" | "StatusRoleKeepOnOffline" | "YouTubeReplayChannel" | "LivePostUpdates" | "MultiDestination" | "InGameRewards" | "BoostNotifications" | "BoostLogsAndStreaks" | "BoostBoard" | "UnlimitedEmojiRepositions", string>;
266
+ t: Record<"BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickClips" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "StatusRoles" | "ManageBranding" | "StickyMessages" | "Starboards" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "LinkedRoles" | "RandomMessages" | "WeeklyBirthdayPanel" | "GameNotifications" | "GameCategoryRouting" | "GameAllTimeLowAlerts" | "GameChangelogs" | "GameRobloxTracking" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "WhatnotNotifications" | "ScheduledEventMessages" | "ScheduledMessageWebhooks" | "ReactionRoles" | "AdvancedRolePanels" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications" | "RolePanelWebhooks" | "Fishing" | "FishingCustomization" | "FishingWebhooks" | "StreamRoles" | "RoleFilters" | "TwitterNotifications" | "TwitterLiveNotifications" | "BadgeAllGames" | "AutoRoles" | "AutoRoleTimers" | "AutoRoleInvites" | "StickyMessageRoleFilters" | "GiveawayClaims" | "GiveawayWinnerRole" | "InfluencerPanel" | "InfluencerPanelPremium" | "InfluencerPanelPlus" | "StatusRoleKeepOnOffline" | "YouTubeReplayChannel" | "LivePostUpdates" | "MultiDestination" | "InGameRewards" | "BoostNotifications" | "BoostLogsAndStreaks" | "BoostBoard" | "UnlimitedEmojiRepositions" | "BirthdayPostOptions" | "JoinAnniversaries", string>;
263
267
  all: bigint;
264
268
  static b: {
265
269
  BaseSyncableRoles: bigint;
@@ -358,8 +362,10 @@ export declare class GuildFeaturesManager extends BitFieldManager<typeof GuildFe
358
362
  BoostLogsAndStreaks: bigint;
359
363
  BoostBoard: bigint;
360
364
  UnlimitedEmojiRepositions: bigint;
365
+ BirthdayPostOptions: bigint;
366
+ JoinAnniversaries: bigint;
361
367
  };
362
- static t: Record<"BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickClips" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "StatusRoles" | "ManageBranding" | "StickyMessages" | "Starboards" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "LinkedRoles" | "RandomMessages" | "WeeklyBirthdayPanel" | "GameNotifications" | "GameCategoryRouting" | "GameAllTimeLowAlerts" | "GameChangelogs" | "GameRobloxTracking" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "WhatnotNotifications" | "ScheduledEventMessages" | "ScheduledMessageWebhooks" | "ReactionRoles" | "AdvancedRolePanels" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications" | "RolePanelWebhooks" | "Fishing" | "FishingCustomization" | "FishingWebhooks" | "StreamRoles" | "RoleFilters" | "TwitterNotifications" | "TwitterLiveNotifications" | "BadgeAllGames" | "AutoRoles" | "AutoRoleTimers" | "AutoRoleInvites" | "StickyMessageRoleFilters" | "GiveawayClaims" | "GiveawayWinnerRole" | "InfluencerPanel" | "InfluencerPanelPremium" | "InfluencerPanelPlus" | "StatusRoleKeepOnOffline" | "YouTubeReplayChannel" | "LivePostUpdates" | "MultiDestination" | "InGameRewards" | "BoostNotifications" | "BoostLogsAndStreaks" | "BoostBoard" | "UnlimitedEmojiRepositions", string>;
368
+ static t: Record<"BaseSyncableRoles" | "FullSyncableRoles" | "LiveRole" | "StatCounters" | "VoteSkipping" | "KickAuditLogs" | "LeaderboardCommand" | "RefreshingLeaderboard" | "LeaderBoardSyncRoles" | "BetaAccess" | "PriorityNotifications" | "KickClips" | "KickNotifications" | "TwitchNotifications" | "ImportEmojis" | "ImportEmojisWithSub" | "CustomWebhooks" | "AnyMessageEditor" | "SyncSocialUsernames" | "AutoDeleteNotifications" | "TestNotificationCommand" | "CustomCooldowns" | "WelcomeAndLeaveNotifications" | "NotificationPingRoleId" | "SwitchStreamerAndGuildEmbeds" | "BirthdayNotifications" | "AllowNotSendingOfflineNotifications" | "AutoStatusLiveRoles" | "RumbleNotifications" | "AllowAutoPublishNotifications" | "NotificationOverrides" | "UseCustomButtons" | "AllowVodFeatures" | "TikTokNotifications" | "StatusRoles" | "ManageBranding" | "StickyMessages" | "Starboards" | "CustomStarboards" | "AutoThreadOnStarboard" | "StarboardRewardRole" | "Giveaways" | "GiveawayLogs" | "ModifyGiveawayWhileRunning" | "ScheduleGiveaways" | "GiveawayRequirements" | "GiveawayBonusEntries" | "GiveawayEntryLimit" | "DisableDoubleVoteEntry" | "YouTubeNotifications" | "LinkedRoles" | "RandomMessages" | "WeeklyBirthdayPanel" | "GameNotifications" | "GameCategoryRouting" | "GameAllTimeLowAlerts" | "GameChangelogs" | "GameRobloxTracking" | "FixUrlWebhook" | "FixUrlCustomRules" | "KickClipperSubscribe" | "WhatnotNotifications" | "ScheduledEventMessages" | "ScheduledMessageWebhooks" | "ReactionRoles" | "AdvancedRolePanels" | "KickClipForwarding" | "TwitchClipForwarding" | "ClubNotifications" | "RolePanelWebhooks" | "Fishing" | "FishingCustomization" | "FishingWebhooks" | "StreamRoles" | "RoleFilters" | "TwitterNotifications" | "TwitterLiveNotifications" | "BadgeAllGames" | "AutoRoles" | "AutoRoleTimers" | "AutoRoleInvites" | "StickyMessageRoleFilters" | "GiveawayClaims" | "GiveawayWinnerRole" | "InfluencerPanel" | "InfluencerPanelPremium" | "InfluencerPanelPlus" | "StatusRoleKeepOnOffline" | "YouTubeReplayChannel" | "LivePostUpdates" | "MultiDestination" | "InGameRewards" | "BoostNotifications" | "BoostLogsAndStreaks" | "BoostBoard" | "UnlimitedEmojiRepositions" | "BirthdayPostOptions" | "JoinAnniversaries", string>;
363
369
  static all: bigint;
364
370
  convertBitToField<T extends EnumValues<typeof GuildFeatures>>(bit: T): string | null;
365
371
  }
@@ -247,6 +247,8 @@ exports.GuildFeatures = {
247
247
  BoostBoard: 1n << 95n,
248
248
  // Reposition Emojis: lifts the free 1-per-7-days cap. Premium.
249
249
  UnlimitedEmojiRepositions: 1n << 96n,
250
+ BirthdayPostOptions: 1n << 97n, // Premium: birthday posts open a thread and / or are pinned for the day (phases/birthday-upgrades/ P2).
251
+ JoinAnniversaries: 1n << 98n, // Premium: yearly join-anniversary posts + milestone roles (phases/birthday-upgrades/ P4).
250
252
  };
251
253
  exports.GuildFeaturesText = {
252
254
  BaseSyncableRoles: 'Basic Syncable Roles',
@@ -347,6 +349,8 @@ exports.GuildFeaturesText = {
347
349
  BoostLogsAndStreaks: 'Boost Log & Boost Roles',
348
350
  BoostBoard: 'Booster Board',
349
351
  UnlimitedEmojiRepositions: 'Unlimited Emoji Repositions',
352
+ BirthdayPostOptions: 'Birthday Threads & Pins',
353
+ JoinAnniversaries: 'Join Anniversaries',
350
354
  };
351
355
  exports.UserFeatures = {
352
356
  HasOneServerPremium: 1n << 0n,
@@ -409,6 +409,15 @@ export declare const placeholders: {
409
409
  boostLevel: string;
410
410
  boostDuration: string;
411
411
  };
412
+ anniversaryMessage: {
413
+ guild: string;
414
+ username: string;
415
+ userId: string;
416
+ userMention: string;
417
+ userAvatar: string;
418
+ years: string;
419
+ joinedAt: string;
420
+ };
412
421
  clipperClip: {
413
422
  streamerName: string;
414
423
  clipperName: string;
@@ -1279,6 +1288,14 @@ export declare const messages: {
1279
1288
  content: string;
1280
1289
  embed: {};
1281
1290
  };
1291
+ anniversaryMessage: {
1292
+ content: string;
1293
+ embed: {
1294
+ title: string;
1295
+ description: string;
1296
+ color: number;
1297
+ };
1298
+ };
1282
1299
  };
1283
1300
  export type Placeholders = {
1284
1301
  [x in keyof typeof placeholders]: typeof placeholders[x];