@runbandit/sdk 3.1.3 → 3.3.0
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/dist/chunk-BG5L4PBC.js +319 -0
- package/dist/chunk-BG5L4PBC.js.map +1 -0
- package/dist/decision-cookie-Mb4G_lTe.d.ts +483 -0
- package/dist/index.d.ts +4 -468
- package/dist/index.js +24 -249
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +48 -0
- package/dist/server.js +195 -0
- package/dist/server.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
declare const STOREFRONT_KINDS: readonly ["text", "image", "ordering", "offer"];
|
|
2
|
+
type StorefrontKind = (typeof STOREFRONT_KINDS)[number];
|
|
3
|
+
declare const PLACEMENTS_BY_KIND: {
|
|
4
|
+
readonly text: readonly ["hero_headline", "hero_subhead", "cta_primary", "banner_text", "badge_text"];
|
|
5
|
+
readonly image: readonly ["hero_image", "banner_image", "feature_image"];
|
|
6
|
+
readonly ordering: readonly ["product_list_primary", "product_list_secondary"];
|
|
7
|
+
readonly offer: readonly ["offer_banner"];
|
|
8
|
+
};
|
|
9
|
+
type Placement = (typeof PLACEMENTS_BY_KIND)[StorefrontKind][number];
|
|
10
|
+
declare const PLACEMENTS: readonly Placement[];
|
|
11
|
+
declare function isPlacement(value: unknown): value is Placement;
|
|
12
|
+
declare function kindOfPlacement(placement: Placement): StorefrontKind;
|
|
13
|
+
declare const CONTENT_TYPE_BY_KIND: {
|
|
14
|
+
readonly text: {
|
|
15
|
+
readonly contentType: "TEXT";
|
|
16
|
+
readonly contentSubtype: "plain_text";
|
|
17
|
+
};
|
|
18
|
+
readonly image: {
|
|
19
|
+
readonly contentType: "FILE";
|
|
20
|
+
readonly contentSubtype: "image";
|
|
21
|
+
};
|
|
22
|
+
readonly ordering: {
|
|
23
|
+
readonly contentType: "CODE";
|
|
24
|
+
readonly contentSubtype: "json";
|
|
25
|
+
};
|
|
26
|
+
readonly offer: {
|
|
27
|
+
readonly contentType: "CODE";
|
|
28
|
+
readonly contentSubtype: "json";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
declare const MIN_ORDERING_ITEMS = 2;
|
|
32
|
+
declare const MAX_ORDERING_ITEMS = 12;
|
|
33
|
+
interface ImageContent {
|
|
34
|
+
url: string;
|
|
35
|
+
alt: string;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
sourceId: string;
|
|
39
|
+
}
|
|
40
|
+
interface OfferContent {
|
|
41
|
+
discountId: string;
|
|
42
|
+
code: string;
|
|
43
|
+
headline: string;
|
|
44
|
+
subtext: string;
|
|
45
|
+
}
|
|
46
|
+
type TreatmentContent = {
|
|
47
|
+
kind: 'text';
|
|
48
|
+
text: string;
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'image';
|
|
51
|
+
image: ImageContent;
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'ordering';
|
|
54
|
+
productIds: string[];
|
|
55
|
+
} | {
|
|
56
|
+
kind: 'offer';
|
|
57
|
+
offer: OfferContent | null;
|
|
58
|
+
};
|
|
59
|
+
declare function isShopifyCdnUrl(value: string): boolean;
|
|
60
|
+
declare function parseTreatmentContent(kind: StorefrontKind, config: unknown): TreatmentContent | null;
|
|
61
|
+
declare function serializeTreatmentConfig(content: TreatmentContent): {
|
|
62
|
+
content: unknown;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
declare const SITE_TARGET_KINDS: readonly ["text", "image"];
|
|
66
|
+
type SiteTargetKind = (typeof SITE_TARGET_KINDS)[number];
|
|
67
|
+
interface SiteTarget {
|
|
68
|
+
page: string;
|
|
69
|
+
selector: string;
|
|
70
|
+
tag: string;
|
|
71
|
+
kind: SiteTargetKind;
|
|
72
|
+
original: string;
|
|
73
|
+
}
|
|
74
|
+
type FunnelGoal = {
|
|
75
|
+
kind: 'page';
|
|
76
|
+
page: string;
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'click';
|
|
79
|
+
page: string;
|
|
80
|
+
selector: string;
|
|
81
|
+
tag: string;
|
|
82
|
+
label: string;
|
|
83
|
+
};
|
|
84
|
+
declare function parseSiteContent(config: unknown): string | null;
|
|
85
|
+
declare function normalizeSiteTarget(target: SiteTarget): SiteTarget;
|
|
86
|
+
declare function normalizeFunnelGoal(goal: FunnelGoal): FunnelGoal;
|
|
87
|
+
declare function targetMatchesPage(target: Pick<SiteTarget, 'page'>, pathname: string): boolean;
|
|
88
|
+
declare function goalMatchesPage(goal: Pick<FunnelGoal, 'page'>, pathname: string): boolean;
|
|
89
|
+
declare const MAX_ALTERNATIVES = 5;
|
|
90
|
+
declare const MAX_TEXT_ALTERNATIVE_LENGTH = 300;
|
|
91
|
+
declare const MAX_IMAGE_URL_LENGTH = 2048;
|
|
92
|
+
interface PickDraft {
|
|
93
|
+
target?: SiteTarget;
|
|
94
|
+
alternatives: string[];
|
|
95
|
+
goal?: FunnelGoal;
|
|
96
|
+
}
|
|
97
|
+
interface PickState {
|
|
98
|
+
funnelId: string;
|
|
99
|
+
siteHost: string;
|
|
100
|
+
expiresAt: number;
|
|
101
|
+
draft: PickDraft;
|
|
102
|
+
funnelGoal: FunnelGoal | null;
|
|
103
|
+
experimentId: string | null;
|
|
104
|
+
runningExperiments: number;
|
|
105
|
+
}
|
|
106
|
+
declare const SUGGESTED_SITE_EXPERIMENTS = 3;
|
|
107
|
+
declare function moreExperimentsSentence(running: number, suggested: number): string;
|
|
108
|
+
type PickStep = 'pick' | 'alternatives' | 'goal' | 'ready' | 'live';
|
|
109
|
+
declare function pickStep(state: Pick<PickState, 'draft' | 'funnelGoal' | 'experimentId'>): PickStep;
|
|
110
|
+
declare function parseAlternative(kind: SiteTargetKind, raw: string): string;
|
|
111
|
+
declare const PICK_CHANNEL = "bandit-pick";
|
|
112
|
+
declare const PICK_PROTOCOL_VERSION = 1;
|
|
113
|
+
declare const PICK_MODES: readonly ["idle", "target", "goal-click"];
|
|
114
|
+
type PickMode = (typeof PICK_MODES)[number];
|
|
115
|
+
declare const PICK_REJECTIONS: readonly ["not-text-or-image", "has-markup", "not-clickable", "no-selector"];
|
|
116
|
+
type PickRejection = (typeof PICK_REJECTIONS)[number];
|
|
117
|
+
type ClickFunnelGoal = Extract<FunnelGoal, {
|
|
118
|
+
kind: 'click';
|
|
119
|
+
}>;
|
|
120
|
+
type PickerToPanel = {
|
|
121
|
+
type: 'navigated';
|
|
122
|
+
page: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'target-picked';
|
|
125
|
+
target: SiteTarget;
|
|
126
|
+
} | {
|
|
127
|
+
type: 'goal-picked';
|
|
128
|
+
goal: ClickFunnelGoal;
|
|
129
|
+
} | {
|
|
130
|
+
type: 'rejected';
|
|
131
|
+
reason: PickRejection;
|
|
132
|
+
} | {
|
|
133
|
+
type: 'cancelled';
|
|
134
|
+
};
|
|
135
|
+
type PanelToPicker = {
|
|
136
|
+
type: 'hello';
|
|
137
|
+
} | {
|
|
138
|
+
type: 'mode';
|
|
139
|
+
mode: PickMode;
|
|
140
|
+
} | {
|
|
141
|
+
type: 'preview';
|
|
142
|
+
target: SiteTarget;
|
|
143
|
+
content: string;
|
|
144
|
+
} | {
|
|
145
|
+
type: 'clear-preview';
|
|
146
|
+
} | {
|
|
147
|
+
type: 'finish';
|
|
148
|
+
} | {
|
|
149
|
+
type: 'renew';
|
|
150
|
+
token: string;
|
|
151
|
+
};
|
|
152
|
+
declare const PICK_TOKEN_PREFIX = "bpick_";
|
|
153
|
+
interface PickEnvelope<M> {
|
|
154
|
+
channel: typeof PICK_CHANNEL;
|
|
155
|
+
v: typeof PICK_PROTOCOL_VERSION;
|
|
156
|
+
msg: M;
|
|
157
|
+
}
|
|
158
|
+
declare function pickEnvelope<M extends PickerToPanel | PanelToPicker>(msg: M): PickEnvelope<M>;
|
|
159
|
+
declare function parsePickerMessage(data: unknown): PickerToPanel | null;
|
|
160
|
+
declare function parsePanelMessage(data: unknown): PanelToPicker | null;
|
|
161
|
+
|
|
162
|
+
interface Company {
|
|
163
|
+
id: string;
|
|
164
|
+
name: string;
|
|
165
|
+
subdomain?: string;
|
|
166
|
+
domain?: string;
|
|
167
|
+
plan: string;
|
|
168
|
+
apiKey: string;
|
|
169
|
+
status: string;
|
|
170
|
+
createdAt: Date;
|
|
171
|
+
updatedAt: Date;
|
|
172
|
+
}
|
|
173
|
+
interface User {
|
|
174
|
+
id: string;
|
|
175
|
+
email: string;
|
|
176
|
+
name: string;
|
|
177
|
+
image?: string;
|
|
178
|
+
role: string;
|
|
179
|
+
companyId: string | null;
|
|
180
|
+
emailVerified?: boolean;
|
|
181
|
+
createdAt: Date;
|
|
182
|
+
updatedAt: Date;
|
|
183
|
+
}
|
|
184
|
+
interface Session {
|
|
185
|
+
id: string;
|
|
186
|
+
userId: string;
|
|
187
|
+
token: string;
|
|
188
|
+
expiresAt: Date;
|
|
189
|
+
ipAddress?: string | null;
|
|
190
|
+
userAgent?: string | null;
|
|
191
|
+
createdAt: Date;
|
|
192
|
+
updatedAt: Date;
|
|
193
|
+
}
|
|
194
|
+
interface Account {
|
|
195
|
+
id: string;
|
|
196
|
+
userId: string;
|
|
197
|
+
provider: string;
|
|
198
|
+
providerAccountId: string;
|
|
199
|
+
accessToken?: string;
|
|
200
|
+
refreshToken?: string;
|
|
201
|
+
accessTokenExpiresAt?: Date;
|
|
202
|
+
refreshTokenExpiresAt?: Date;
|
|
203
|
+
scope?: string;
|
|
204
|
+
idToken?: string;
|
|
205
|
+
sessionState?: string;
|
|
206
|
+
createdAt: Date;
|
|
207
|
+
updatedAt: Date;
|
|
208
|
+
}
|
|
209
|
+
interface Experiment {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
description?: string;
|
|
213
|
+
algorithm: BanditAlgorithm;
|
|
214
|
+
forgetting?: ForgettingConfig;
|
|
215
|
+
status: ExperimentStatus;
|
|
216
|
+
contentType: ContentType;
|
|
217
|
+
treatments: Treatment[];
|
|
218
|
+
context?: Record<string, any>;
|
|
219
|
+
bundleId?: string;
|
|
220
|
+
image?: string;
|
|
221
|
+
emoji?: string;
|
|
222
|
+
assignmentTtl: number;
|
|
223
|
+
companyId: string;
|
|
224
|
+
createdAt: Date;
|
|
225
|
+
updatedAt: Date;
|
|
226
|
+
endAt?: Date;
|
|
227
|
+
placement?: Placement;
|
|
228
|
+
}
|
|
229
|
+
interface Treatment {
|
|
230
|
+
id: string;
|
|
231
|
+
experimentId: string;
|
|
232
|
+
name: string;
|
|
233
|
+
description?: string;
|
|
234
|
+
config: VariantConfig;
|
|
235
|
+
weight?: number;
|
|
236
|
+
companyId: string;
|
|
237
|
+
createdAt: Date;
|
|
238
|
+
}
|
|
239
|
+
interface AlgorithmResult {
|
|
240
|
+
treatmentId: string;
|
|
241
|
+
confidence: number;
|
|
242
|
+
probabilityBest?: number;
|
|
243
|
+
}
|
|
244
|
+
interface BanditResult {
|
|
245
|
+
assignmentId: string;
|
|
246
|
+
treatmentId: string;
|
|
247
|
+
confidence: number;
|
|
248
|
+
probabilityBest?: number;
|
|
249
|
+
metadata?: Record<string, any>;
|
|
250
|
+
}
|
|
251
|
+
interface ContextualFeatures {
|
|
252
|
+
[key: string]: string | number | boolean;
|
|
253
|
+
}
|
|
254
|
+
declare enum ExperimentStatus {
|
|
255
|
+
DRAFT = "draft",
|
|
256
|
+
ACTIVE = "active",
|
|
257
|
+
PAUSED = "paused",
|
|
258
|
+
COMPLETED = "completed",
|
|
259
|
+
ARCHIVED = "archived"
|
|
260
|
+
}
|
|
261
|
+
interface TreatmentMetadata {
|
|
262
|
+
strategy?: string;
|
|
263
|
+
tone?: string;
|
|
264
|
+
ctaStyle?: string;
|
|
265
|
+
emotionalHook?: string;
|
|
266
|
+
reasoning?: string;
|
|
267
|
+
tags?: string[];
|
|
268
|
+
generated?: boolean;
|
|
269
|
+
generatedAt?: string;
|
|
270
|
+
}
|
|
271
|
+
interface VariantConfig {
|
|
272
|
+
content: string;
|
|
273
|
+
metadata?: TreatmentMetadata & Record<string, any>;
|
|
274
|
+
}
|
|
275
|
+
declare enum BanditAlgorithm {
|
|
276
|
+
THOMPSON_SAMPLING = "thompson_sampling",
|
|
277
|
+
CONTEXTUAL_LINEAR = "contextual_linear"
|
|
278
|
+
}
|
|
279
|
+
declare enum Posterior {
|
|
280
|
+
BETA = "beta",
|
|
281
|
+
NORMAL_GAMMA = "normal_gamma"
|
|
282
|
+
}
|
|
283
|
+
declare function normalizePosterior(posterior: string | null | undefined): Posterior;
|
|
284
|
+
declare enum ForgettingMode {
|
|
285
|
+
NONE = "none",
|
|
286
|
+
DISCOUNTED = "discounted",
|
|
287
|
+
SLIDING_WINDOW = "sliding_window"
|
|
288
|
+
}
|
|
289
|
+
interface ForgettingConfig {
|
|
290
|
+
mode: ForgettingMode;
|
|
291
|
+
halfLifeMs?: number;
|
|
292
|
+
windowMs?: number;
|
|
293
|
+
}
|
|
294
|
+
declare const DEFAULT_HALF_LIFE_MS: number;
|
|
295
|
+
declare const DEFAULT_WINDOW_MS: number;
|
|
296
|
+
declare const STATIONARY: ForgettingConfig;
|
|
297
|
+
declare function resolveForgetting(config?: Partial<ForgettingConfig> | null): ForgettingConfig;
|
|
298
|
+
declare function normalizeAlgorithm(algorithm: string | null | undefined): BanditAlgorithm;
|
|
299
|
+
declare enum ContentType {
|
|
300
|
+
PLAIN_TEXT = "plain_text",
|
|
301
|
+
MARKDOWN = "markdown",
|
|
302
|
+
HTML = "html",
|
|
303
|
+
CSS = "css",
|
|
304
|
+
JAVASCRIPT = "javascript",
|
|
305
|
+
JSON = "json",
|
|
306
|
+
IMAGE = "image",
|
|
307
|
+
VIDEO = "video",
|
|
308
|
+
AUDIO = "audio",
|
|
309
|
+
DOCUMENT = "document"
|
|
310
|
+
}
|
|
311
|
+
declare function getContentTypeCategory(contentType: ContentType): 'text' | 'code' | 'file';
|
|
312
|
+
interface BanditConfig {
|
|
313
|
+
algorithm: BanditAlgorithm;
|
|
314
|
+
parameters: Record<string, any>;
|
|
315
|
+
}
|
|
316
|
+
interface ExperimentStats {
|
|
317
|
+
totalAssignments: number;
|
|
318
|
+
totalConversions: number;
|
|
319
|
+
conversionRate: number;
|
|
320
|
+
treatmentStats: Record<string, TreatmentStats>;
|
|
321
|
+
}
|
|
322
|
+
interface TreatmentStats {
|
|
323
|
+
assignments: number;
|
|
324
|
+
conversions: number;
|
|
325
|
+
conversionRate: number;
|
|
326
|
+
confidence: number;
|
|
327
|
+
lift?: number;
|
|
328
|
+
}
|
|
329
|
+
interface APIResponse<T = any> {
|
|
330
|
+
success: boolean;
|
|
331
|
+
data?: T;
|
|
332
|
+
error?: string;
|
|
333
|
+
timestamp: Date;
|
|
334
|
+
}
|
|
335
|
+
interface CreateExperimentRequest {
|
|
336
|
+
name: string;
|
|
337
|
+
description?: string;
|
|
338
|
+
algorithm: BanditAlgorithm;
|
|
339
|
+
contentType: ContentType;
|
|
340
|
+
algorithmConfig?: Record<string, any>;
|
|
341
|
+
treatments?: Omit<Treatment, 'id' | 'experimentId' | 'createdAt'>[];
|
|
342
|
+
}
|
|
343
|
+
interface AssignmentRequest {
|
|
344
|
+
experimentId: string;
|
|
345
|
+
userId: string;
|
|
346
|
+
context?: ContextualFeatures;
|
|
347
|
+
sessionId?: string;
|
|
348
|
+
pageUrl?: string;
|
|
349
|
+
}
|
|
350
|
+
interface TrackNamedEventRequest {
|
|
351
|
+
name: string;
|
|
352
|
+
category?: string;
|
|
353
|
+
value?: number;
|
|
354
|
+
metadata?: Record<string, any>;
|
|
355
|
+
sessionId: string;
|
|
356
|
+
userId?: string;
|
|
357
|
+
assignmentId?: string;
|
|
358
|
+
}
|
|
359
|
+
declare enum FunnelStatus {
|
|
360
|
+
DRAFT = "draft",
|
|
361
|
+
ACTIVE = "active",
|
|
362
|
+
PAUSED = "paused",
|
|
363
|
+
COMPLETED = "completed"
|
|
364
|
+
}
|
|
365
|
+
interface Funnel {
|
|
366
|
+
id: string;
|
|
367
|
+
name: string;
|
|
368
|
+
description?: string;
|
|
369
|
+
status: FunnelStatus;
|
|
370
|
+
inactivityTimeoutMs?: number;
|
|
371
|
+
revisionWindowMs?: number;
|
|
372
|
+
companyId: string;
|
|
373
|
+
createdAt: Date;
|
|
374
|
+
updatedAt: Date;
|
|
375
|
+
}
|
|
376
|
+
interface FunnelRewardRequest {
|
|
377
|
+
funnelId: string;
|
|
378
|
+
userId: string;
|
|
379
|
+
value: number;
|
|
380
|
+
}
|
|
381
|
+
interface ApiKey {
|
|
382
|
+
id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
keyPrefix: string;
|
|
385
|
+
status: 'active' | 'revoked';
|
|
386
|
+
createdBy: string;
|
|
387
|
+
createdAt: Date;
|
|
388
|
+
lastUsedAt?: Date;
|
|
389
|
+
revokedAt?: Date;
|
|
390
|
+
revokedBy?: string;
|
|
391
|
+
}
|
|
392
|
+
interface CreateApiKeyRequest {
|
|
393
|
+
name: string;
|
|
394
|
+
}
|
|
395
|
+
interface CreateApiKeyResponse {
|
|
396
|
+
id: string;
|
|
397
|
+
key: string;
|
|
398
|
+
name: string;
|
|
399
|
+
}
|
|
400
|
+
type IdentifyMergeReason = 'user_signup' | 'email_verification' | 'social_login' | 'account_recovery' | 'manual';
|
|
401
|
+
interface IdentifyUserRequest {
|
|
402
|
+
anonymousId: string;
|
|
403
|
+
identifiedUserId: string;
|
|
404
|
+
mergeReason?: IdentifyMergeReason;
|
|
405
|
+
}
|
|
406
|
+
interface IdentifyUserResponse {
|
|
407
|
+
anonymousId: string;
|
|
408
|
+
identifiedUserId: string;
|
|
409
|
+
alreadyMapped: boolean;
|
|
410
|
+
}
|
|
411
|
+
interface ResolvedIdentity {
|
|
412
|
+
canonicalId: string;
|
|
413
|
+
anonymousIds: string[];
|
|
414
|
+
isIdentified: boolean;
|
|
415
|
+
}
|
|
416
|
+
type BundleMode = 'factored' | 'joint';
|
|
417
|
+
interface Bundle {
|
|
418
|
+
id: string;
|
|
419
|
+
name: string;
|
|
420
|
+
description?: string;
|
|
421
|
+
status: ExperimentStatus;
|
|
422
|
+
mode: BundleMode;
|
|
423
|
+
funnelId?: string;
|
|
424
|
+
assignmentTtl: number;
|
|
425
|
+
conversionWindowMs: number;
|
|
426
|
+
inactivityTimeoutMs?: number;
|
|
427
|
+
revisionWindowMs?: number;
|
|
428
|
+
companyId: string;
|
|
429
|
+
createdAt: Date;
|
|
430
|
+
updatedAt: Date;
|
|
431
|
+
}
|
|
432
|
+
interface BundleAssignmentRequest {
|
|
433
|
+
bundleId: string;
|
|
434
|
+
userId: string;
|
|
435
|
+
context?: ContextualFeatures;
|
|
436
|
+
sessionId?: string;
|
|
437
|
+
pageUrl?: string;
|
|
438
|
+
}
|
|
439
|
+
interface BundleSlotAssignment {
|
|
440
|
+
assignmentId: string;
|
|
441
|
+
experimentId: string;
|
|
442
|
+
treatmentId: string;
|
|
443
|
+
config: VariantConfig | Record<string, unknown>;
|
|
444
|
+
}
|
|
445
|
+
interface BundleAssignmentResponse {
|
|
446
|
+
bundleAssignmentId: string;
|
|
447
|
+
slots: Record<string, BundleSlotAssignment>;
|
|
448
|
+
}
|
|
449
|
+
interface SnapshotTreatment {
|
|
450
|
+
id: string;
|
|
451
|
+
name?: string;
|
|
452
|
+
config: unknown;
|
|
453
|
+
pct: number;
|
|
454
|
+
}
|
|
455
|
+
interface SnapshotExperiment {
|
|
456
|
+
name?: string;
|
|
457
|
+
mode: 'snapshot' | 'network';
|
|
458
|
+
assignmentTtl: number;
|
|
459
|
+
treatments: SnapshotTreatment[];
|
|
460
|
+
target?: SiteTarget;
|
|
461
|
+
funnelId?: string;
|
|
462
|
+
}
|
|
463
|
+
interface CompanySnapshot {
|
|
464
|
+
ttl: number;
|
|
465
|
+
generatedAt: number;
|
|
466
|
+
experiments: Record<string, SnapshotExperiment>;
|
|
467
|
+
goals?: Record<string, FunnelGoal>;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare const VISITOR_COOKIE = "bandit_v";
|
|
471
|
+
declare const DECISIONS_COOKIE = "bandit_d";
|
|
472
|
+
interface CookieDecision {
|
|
473
|
+
experimentId: string;
|
|
474
|
+
treatmentId: string;
|
|
475
|
+
clientAssignmentId: string;
|
|
476
|
+
expiresAt: number;
|
|
477
|
+
}
|
|
478
|
+
type CookieDecisions = Record<string, CookieDecision>;
|
|
479
|
+
declare function readCookie(header: string | null | undefined, name: string): string | null;
|
|
480
|
+
declare function parseDecisions(value: string | null | undefined, now: number): CookieDecisions;
|
|
481
|
+
declare function serializeDecisions(decisions: CookieDecisions): string;
|
|
482
|
+
|
|
483
|
+
export { type Bundle as $, type Account as A, type BundleAssignmentResponse as B, type ContextualFeatures as C, DECISIONS_COOKIE as D, type Experiment as E, ForgettingMode as F, type TreatmentStats as G, type APIResponse as H, type CreateExperimentRequest as I, type AssignmentRequest as J, type TrackNamedEventRequest as K, FunnelStatus as L, type Funnel as M, type FunnelRewardRequest as N, type ApiKey as O, Posterior as P, type CreateApiKeyRequest as Q, type CreateApiKeyResponse as R, type SnapshotTreatment as S, type Treatment as T, type User as U, VISITOR_COOKIE as V, type IdentifyMergeReason as W, type IdentifyUserRequest as X, type IdentifyUserResponse as Y, type ResolvedIdentity as Z, type BundleMode as _, type CompanySnapshot as a, type BundleAssignmentRequest as a0, type BundleSlotAssignment as a1, STOREFRONT_KINDS as a2, type StorefrontKind as a3, PLACEMENTS_BY_KIND as a4, type Placement as a5, PLACEMENTS as a6, isPlacement as a7, kindOfPlacement as a8, CONTENT_TYPE_BY_KIND as a9, parseAlternative as aA, PICK_CHANNEL as aB, PICK_PROTOCOL_VERSION as aC, PICK_MODES as aD, type PickMode as aE, PICK_REJECTIONS as aF, type PickRejection as aG, type ClickFunnelGoal as aH, type PickerToPanel as aI, type PanelToPicker as aJ, PICK_TOKEN_PREFIX as aK, type PickEnvelope as aL, pickEnvelope as aM, parsePickerMessage as aN, parsePanelMessage as aO, MIN_ORDERING_ITEMS as aa, MAX_ORDERING_ITEMS as ab, type ImageContent as ac, type OfferContent as ad, type TreatmentContent as ae, isShopifyCdnUrl as af, parseTreatmentContent as ag, serializeTreatmentConfig as ah, SITE_TARGET_KINDS as ai, type SiteTargetKind as aj, type SiteTarget as ak, type FunnelGoal as al, parseSiteContent as am, normalizeSiteTarget as an, normalizeFunnelGoal as ao, targetMatchesPage as ap, goalMatchesPage as aq, MAX_ALTERNATIVES as ar, MAX_TEXT_ALTERNATIVE_LENGTH as as, MAX_IMAGE_URL_LENGTH as at, type PickDraft as au, type PickState as av, SUGGESTED_SITE_EXPERIMENTS as aw, moreExperimentsSentence as ax, type PickStep as ay, pickStep as az, type SnapshotExperiment as b, type CookieDecision as c, type CookieDecisions as d, type Company as e, type Session as f, type AlgorithmResult as g, type BanditResult as h, ExperimentStatus as i, type TreatmentMetadata as j, type VariantConfig as k, BanditAlgorithm as l, type ForgettingConfig as m, normalizePosterior as n, DEFAULT_HALF_LIFE_MS as o, parseDecisions as p, DEFAULT_WINDOW_MS as q, readCookie as r, serializeDecisions as s, STATIONARY as t, resolveForgetting as u, normalizeAlgorithm as v, ContentType as w, getContentTypeCategory as x, type BanditConfig as y, type ExperimentStats as z };
|