@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
package/dist/index.d.ts
CHANGED
|
@@ -1,470 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
mode: 'snapshot' | 'network';
|
|
457
|
-
assignmentTtl: number;
|
|
458
|
-
treatments: SnapshotTreatment[];
|
|
459
|
-
target?: SiteTarget;
|
|
460
|
-
funnelId?: string;
|
|
461
|
-
}
|
|
462
|
-
interface CompanySnapshot {
|
|
463
|
-
ttl: number;
|
|
464
|
-
generatedAt: number;
|
|
465
|
-
experiments: Record<string, SnapshotExperiment>;
|
|
466
|
-
goals?: Record<string, FunnelGoal>;
|
|
467
|
-
}
|
|
1
|
+
import { T as Treatment, C as ContextualFeatures, B as BundleAssignmentResponse, a as CompanySnapshot, S as SnapshotTreatment } from './decision-cookie-Mb4G_lTe.js';
|
|
2
|
+
export { H as APIResponse, A as Account, g as AlgorithmResult, O as ApiKey, J as AssignmentRequest, l as BanditAlgorithm, y as BanditConfig, h as BanditResult, $ as Bundle, a0 as BundleAssignmentRequest, _ as BundleMode, a1 as BundleSlotAssignment, a9 as CONTENT_TYPE_BY_KIND, aH as ClickFunnelGoal, e as Company, w as ContentType, c as CookieDecision, d as CookieDecisions, Q as CreateApiKeyRequest, R as CreateApiKeyResponse, I as CreateExperimentRequest, D as DECISIONS_COOKIE, o as DEFAULT_HALF_LIFE_MS, q as DEFAULT_WINDOW_MS, E as Experiment, z as ExperimentStats, i as ExperimentStatus, m as ForgettingConfig, F as ForgettingMode, M as Funnel, al as FunnelGoal, N as FunnelRewardRequest, L as FunnelStatus, W as IdentifyMergeReason, X as IdentifyUserRequest, Y as IdentifyUserResponse, ac as ImageContent, ar as MAX_ALTERNATIVES, at as MAX_IMAGE_URL_LENGTH, ab as MAX_ORDERING_ITEMS, as as MAX_TEXT_ALTERNATIVE_LENGTH, aa as MIN_ORDERING_ITEMS, ad as OfferContent, aB as PICK_CHANNEL, aD as PICK_MODES, aC as PICK_PROTOCOL_VERSION, aF as PICK_REJECTIONS, aK as PICK_TOKEN_PREFIX, a6 as PLACEMENTS, a4 as PLACEMENTS_BY_KIND, aJ as PanelToPicker, au as PickDraft, aL as PickEnvelope, aE as PickMode, aG as PickRejection, av as PickState, ay as PickStep, aI as PickerToPanel, a5 as Placement, P as Posterior, Z as ResolvedIdentity, ai as SITE_TARGET_KINDS, t as STATIONARY, a2 as STOREFRONT_KINDS, aw as SUGGESTED_SITE_EXPERIMENTS, f as Session, ak as SiteTarget, aj as SiteTargetKind, b as SnapshotExperiment, a3 as StorefrontKind, K as TrackNamedEventRequest, ae as TreatmentContent, j as TreatmentMetadata, G as TreatmentStats, U as User, V as VISITOR_COOKIE, k as VariantConfig, x as getContentTypeCategory, aq as goalMatchesPage, a7 as isPlacement, af as isShopifyCdnUrl, a8 as kindOfPlacement, ax as moreExperimentsSentence, v as normalizeAlgorithm, ao as normalizeFunnelGoal, n as normalizePosterior, an as normalizeSiteTarget, aA as parseAlternative, p as parseDecisions, aO as parsePanelMessage, aN as parsePickerMessage, am as parseSiteContent, ag as parseTreatmentContent, aM as pickEnvelope, az as pickStep, r as readCookie, u as resolveForgetting, s as serializeDecisions, ah as serializeTreatmentConfig, ap as targetMatchesPage } from './decision-cookie-Mb4G_lTe.js';
|
|
468
3
|
|
|
469
4
|
declare function validateTreatmentWeights(treatments: Treatment[]): boolean;
|
|
470
5
|
declare function normalizeTreatmentWeights(treatments: Treatment[]): Treatment[];
|
|
@@ -689,6 +224,7 @@ interface BanditsClientConfig {
|
|
|
689
224
|
batchSize?: number;
|
|
690
225
|
flushInterval?: number;
|
|
691
226
|
sessionTtl?: number;
|
|
227
|
+
visitorId?: string;
|
|
692
228
|
}
|
|
693
229
|
declare class BanditsRequestError extends Error {
|
|
694
230
|
readonly status: number | undefined;
|
|
@@ -831,4 +367,4 @@ declare function reportPlanImpressions(plan: EmailPlan, recipientIds: string[],
|
|
|
831
367
|
alreadyRecorded: boolean;
|
|
832
368
|
}>;
|
|
833
369
|
|
|
834
|
-
export { type
|
|
370
|
+
export { type Assignment, BanditsClient as BanditClient, BanditsClient, type BanditsClientConfig, BanditsRequestError, type Bound, BundleAssignmentResponse, type ButtonBlock, CompanySnapshot, ContextualFeatures, DEFAULT_SESSION_TTL_MS, type DividerBlock, EMAIL_TOKEN_PARAM, type EmailBlock, type EmailDocument, type EmailPlan, type EmailTokenPayload, type HeadingBlock, type ImageBlock, type PlanArm, type PlanRenderResult, type PlanSlot, type RenderEmailOptions, type RenderedDocument, type RenderedEmail, type RewriteOptions, type RewriteResult, SCRIPT_PLATFORMS, SESSION_CREATED_AT_KEY, SESSION_ID_KEY, SITE_PLATFORMS, SITE_PLATFORM_IDS, type ScriptPlatform, type SessionOptions, type SigningKey, type SitePlatform, type SitePlatformId, type SitePlatformPath, type SlotBinding, SnapshotClient, type SnapshotClientConfig, SnapshotTreatment, type SpacerBlock, type SyncAssignment, type TextBlock, Treatment, VISITOR_ID_KEY, type VerifiedToken, appendEmailToken, buildSubdomainUrl, calculateConfidenceInterval, extractDocumentSlots, extractEmailLinks, extractSlotNames, extractSubdomain, generateId, generateSubdomain, getOrCreateSessionId, getOrCreateVisitorId, hashRecipient, impressionManifest, isSlotBinding, isValidEmail, isValidSubdomain, matchesConversionPath, mintEmailToken, normalizeConversionPath, normalizeTreatmentWeights, pickArm, pickTreatment, platformById, renderEmail, renderEmailDocument, renderFromPlan, reportPlanImpressions, rewriteEmailLinks, sampleCombination, sanitizeMetadata, shouldRefreshPlan, uniformFor, validateTreatmentWeights, verifyEmailToken };
|