@syntrologie/runtime-sdk 2.4.0-canary.22 → 2.4.0-canary.24

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 (35) hide show
  1. package/dist/actions/schema.d.ts +3603 -36279
  2. package/dist/actions/schema.js +3 -3
  3. package/dist/{chunk-P5G4KT2U.js → chunk-BU4Z6PD7.js} +9 -4
  4. package/dist/chunk-BU4Z6PD7.js.map +7 -0
  5. package/dist/{chunk-WCQCVPJ7.js → chunk-LD22WJ44.js} +440 -132
  6. package/dist/chunk-LD22WJ44.js.map +7 -0
  7. package/dist/{chunk-HF3D7YFQ.js → chunk-NM5Y27GX.js} +24 -26
  8. package/dist/chunk-NM5Y27GX.js.map +7 -0
  9. package/dist/{chunk-2UYZ5DWI.js → chunk-WILWIL6L.js} +43 -5
  10. package/dist/chunk-WILWIL6L.js.map +7 -0
  11. package/dist/components/ShadowCanvasOverlay.d.ts +2 -1
  12. package/dist/components/TileIcon.d.ts +14 -0
  13. package/dist/config/schema.d.ts +914 -3656
  14. package/dist/config/schema.js +4 -2
  15. package/dist/decisions/schema.d.ts +19 -1467
  16. package/dist/decisions/schema.js +3 -1
  17. package/dist/decisions/types.d.ts +2 -2
  18. package/dist/index.js +87 -94
  19. package/dist/index.js.map +2 -2
  20. package/dist/react.js +4 -4
  21. package/dist/smart-canvas.esm.js +105 -62
  22. package/dist/smart-canvas.esm.js.map +4 -4
  23. package/dist/smart-canvas.js +849 -295
  24. package/dist/smart-canvas.js.map +4 -4
  25. package/dist/smart-canvas.min.js +105 -62
  26. package/dist/smart-canvas.min.js.map +4 -4
  27. package/dist/theme/types.d.ts +2 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/widgets/WidgetRegistry.d.ts +1 -0
  30. package/package.json +9 -8
  31. package/schema/canvas-config.schema.json +1346 -372
  32. package/dist/chunk-2UYZ5DWI.js.map +0 -7
  33. package/dist/chunk-HF3D7YFQ.js.map +0 -7
  34. package/dist/chunk-P5G4KT2U.js.map +0 -7
  35. package/dist/chunk-WCQCVPJ7.js.map +0 -7
@@ -7,7 +7,7 @@
7
7
  * unified JSON Schema generation.
8
8
  */
9
9
  import { z } from 'zod';
10
- export { AnchorVisibleConditionZ, type ConditionSchema, ConditionZ, CooldownActiveConditionZ, CounterDefZ, type DecisionStrategySchema, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ, ExternalStrategyZ, FrequencyLimitConditionZ, MatchOpZ, ModelStrategyZ, PageUrlConditionZ, RouteConditionZ, type RuleSchema, RuleStrategyZ, RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, ViewportConditionZ, } from '@syntrologie/sdk-contracts';
10
+ export { AnchorVisibleConditionZ, type ConditionSchema, ConditionZ, CooldownActiveConditionZ, CounterDefZ, type DecisionStrategySchema, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ, ExternalStrategyZ, FrequencyLimitConditionZ, MatchOpZ, ModelStrategyZ, PageUrlConditionZ, RouteConditionZ, type RuleSchema, RuleStrategyZ, RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, TriggerWhenZ, ViewportConditionZ, } from '@syntrologie/sdk-contracts';
11
11
  export declare const RouteFilterZ: z.ZodObject<{
12
12
  include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
13
  exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -29,663 +29,19 @@ export declare const ActivationConfigZ: z.ZodObject<{
29
29
  include?: string[] | undefined;
30
30
  exclude?: string[] | undefined;
31
31
  }>;
32
- strategy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
33
- type: z.ZodLiteral<"rules">;
34
- rules: z.ZodArray<z.ZodObject<{
35
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
36
- type: z.ZodLiteral<"page_url">;
37
- url: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- type: "page_url";
40
- url: string;
41
- }, {
42
- type: "page_url";
43
- url: string;
44
- }>, z.ZodObject<{
45
- type: z.ZodLiteral<"route">;
46
- routeId: z.ZodString;
47
- }, "strip", z.ZodTypeAny, {
48
- type: "route";
49
- routeId: string;
50
- }, {
51
- type: "route";
52
- routeId: string;
53
- }>, z.ZodObject<{
54
- type: z.ZodLiteral<"anchor_visible">;
55
- anchorId: z.ZodString;
56
- state: z.ZodEnum<["visible", "present", "absent"]>;
57
- }, "strip", z.ZodTypeAny, {
58
- type: "anchor_visible";
59
- anchorId: string;
60
- state: "visible" | "present" | "absent";
61
- }, {
62
- type: "anchor_visible";
63
- anchorId: string;
64
- state: "visible" | "present" | "absent";
65
- }>, z.ZodObject<{
66
- type: z.ZodLiteral<"event_occurred">;
67
- eventName: z.ZodString;
68
- withinMs: z.ZodOptional<z.ZodNumber>;
69
- }, "strip", z.ZodTypeAny, {
70
- type: "event_occurred";
71
- eventName: string;
72
- withinMs?: number | undefined;
73
- }, {
74
- type: "event_occurred";
75
- eventName: string;
76
- withinMs?: number | undefined;
77
- }>, z.ZodObject<{
78
- type: z.ZodLiteral<"state_equals">;
79
- key: z.ZodString;
80
- value: z.ZodUnknown;
81
- }, "strip", z.ZodTypeAny, {
82
- type: "state_equals";
83
- key: string;
84
- value?: unknown;
85
- }, {
86
- type: "state_equals";
87
- key: string;
88
- value?: unknown;
89
- }>, z.ZodObject<{
90
- type: z.ZodLiteral<"viewport">;
91
- minWidth: z.ZodOptional<z.ZodNumber>;
92
- maxWidth: z.ZodOptional<z.ZodNumber>;
93
- minHeight: z.ZodOptional<z.ZodNumber>;
94
- maxHeight: z.ZodOptional<z.ZodNumber>;
95
- }, "strip", z.ZodTypeAny, {
96
- type: "viewport";
97
- minWidth?: number | undefined;
98
- maxWidth?: number | undefined;
99
- minHeight?: number | undefined;
100
- maxHeight?: number | undefined;
101
- }, {
102
- type: "viewport";
103
- minWidth?: number | undefined;
104
- maxWidth?: number | undefined;
105
- minHeight?: number | undefined;
106
- maxHeight?: number | undefined;
107
- }>, z.ZodObject<{
108
- type: z.ZodLiteral<"session_metric">;
109
- key: z.ZodString;
110
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
111
- threshold: z.ZodNumber;
112
- }, "strip", z.ZodTypeAny, {
113
- type: "session_metric";
114
- key: string;
115
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
116
- threshold: number;
117
- }, {
118
- type: "session_metric";
119
- key: string;
120
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
121
- threshold: number;
122
- }>, z.ZodObject<{
123
- type: z.ZodLiteral<"dismissed">;
124
- key: z.ZodString;
125
- inverted: z.ZodOptional<z.ZodBoolean>;
126
- }, "strip", z.ZodTypeAny, {
127
- type: "dismissed";
128
- key: string;
129
- inverted?: boolean | undefined;
130
- }, {
131
- type: "dismissed";
132
- key: string;
133
- inverted?: boolean | undefined;
134
- }>, z.ZodObject<{
135
- type: z.ZodLiteral<"cooldown_active">;
136
- key: z.ZodString;
137
- inverted: z.ZodOptional<z.ZodBoolean>;
138
- }, "strip", z.ZodTypeAny, {
139
- type: "cooldown_active";
140
- key: string;
141
- inverted?: boolean | undefined;
142
- }, {
143
- type: "cooldown_active";
144
- key: string;
145
- inverted?: boolean | undefined;
146
- }>, z.ZodObject<{
147
- type: z.ZodLiteral<"frequency_limit">;
148
- key: z.ZodString;
149
- limit: z.ZodNumber;
150
- inverted: z.ZodOptional<z.ZodBoolean>;
151
- }, "strip", z.ZodTypeAny, {
152
- type: "frequency_limit";
153
- key: string;
154
- limit: number;
155
- inverted?: boolean | undefined;
156
- }, {
157
- type: "frequency_limit";
158
- key: string;
159
- limit: number;
160
- inverted?: boolean | undefined;
161
- }>, z.ZodObject<{
162
- type: z.ZodLiteral<"event_count">;
163
- key: z.ZodString;
164
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
165
- count: z.ZodNumber;
166
- withinMs: z.ZodOptional<z.ZodNumber>;
167
- counter: z.ZodOptional<z.ZodObject<{
168
- events: z.ZodArray<z.ZodString, "many">;
169
- match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
170
- equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
171
- contains: z.ZodOptional<z.ZodString>;
172
- }, "strip", z.ZodTypeAny, {
173
- equals?: string | number | boolean | undefined;
174
- contains?: string | undefined;
175
- }, {
176
- equals?: string | number | boolean | undefined;
177
- contains?: string | undefined;
178
- }>>>;
179
- }, "strip", z.ZodTypeAny, {
180
- events: string[];
181
- match?: Record<string, {
182
- equals?: string | number | boolean | undefined;
183
- contains?: string | undefined;
184
- }> | undefined;
185
- }, {
186
- events: string[];
187
- match?: Record<string, {
188
- equals?: string | number | boolean | undefined;
189
- contains?: string | undefined;
190
- }> | undefined;
191
- }>>;
192
- }, "strip", z.ZodTypeAny, {
193
- type: "event_count";
194
- key: string;
195
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
196
- count: number;
197
- withinMs?: number | undefined;
198
- counter?: {
199
- events: string[];
200
- match?: Record<string, {
201
- equals?: string | number | boolean | undefined;
202
- contains?: string | undefined;
203
- }> | undefined;
204
- } | undefined;
205
- }, {
206
- type: "event_count";
207
- key: string;
208
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
209
- count: number;
210
- withinMs?: number | undefined;
211
- counter?: {
212
- events: string[];
213
- match?: Record<string, {
214
- equals?: string | number | boolean | undefined;
215
- contains?: string | undefined;
216
- }> | undefined;
217
- } | undefined;
218
- }>]>, "many">;
219
- value: z.ZodUnknown;
220
- }, "strip", z.ZodTypeAny, {
221
- conditions: ({
222
- type: "page_url";
223
- url: string;
224
- } | {
225
- type: "route";
226
- routeId: string;
227
- } | {
228
- type: "anchor_visible";
229
- anchorId: string;
230
- state: "visible" | "present" | "absent";
231
- } | {
232
- type: "event_occurred";
233
- eventName: string;
234
- withinMs?: number | undefined;
235
- } | {
236
- type: "state_equals";
237
- key: string;
238
- value?: unknown;
239
- } | {
240
- type: "viewport";
241
- minWidth?: number | undefined;
242
- maxWidth?: number | undefined;
243
- minHeight?: number | undefined;
244
- maxHeight?: number | undefined;
245
- } | {
246
- type: "session_metric";
247
- key: string;
248
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
249
- threshold: number;
250
- } | {
251
- type: "dismissed";
252
- key: string;
253
- inverted?: boolean | undefined;
254
- } | {
255
- type: "cooldown_active";
256
- key: string;
257
- inverted?: boolean | undefined;
258
- } | {
259
- type: "frequency_limit";
260
- key: string;
261
- limit: number;
262
- inverted?: boolean | undefined;
263
- } | {
264
- type: "event_count";
265
- key: string;
266
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
267
- count: number;
268
- withinMs?: number | undefined;
269
- counter?: {
270
- events: string[];
271
- match?: Record<string, {
272
- equals?: string | number | boolean | undefined;
273
- contains?: string | undefined;
274
- }> | undefined;
275
- } | undefined;
276
- })[];
277
- value?: unknown;
278
- }, {
279
- conditions: ({
280
- type: "page_url";
281
- url: string;
282
- } | {
283
- type: "route";
284
- routeId: string;
285
- } | {
286
- type: "anchor_visible";
287
- anchorId: string;
288
- state: "visible" | "present" | "absent";
289
- } | {
290
- type: "event_occurred";
291
- eventName: string;
292
- withinMs?: number | undefined;
293
- } | {
294
- type: "state_equals";
295
- key: string;
296
- value?: unknown;
297
- } | {
298
- type: "viewport";
299
- minWidth?: number | undefined;
300
- maxWidth?: number | undefined;
301
- minHeight?: number | undefined;
302
- maxHeight?: number | undefined;
303
- } | {
304
- type: "session_metric";
305
- key: string;
306
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
307
- threshold: number;
308
- } | {
309
- type: "dismissed";
310
- key: string;
311
- inverted?: boolean | undefined;
312
- } | {
313
- type: "cooldown_active";
314
- key: string;
315
- inverted?: boolean | undefined;
316
- } | {
317
- type: "frequency_limit";
318
- key: string;
319
- limit: number;
320
- inverted?: boolean | undefined;
321
- } | {
322
- type: "event_count";
323
- key: string;
324
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
325
- count: number;
326
- withinMs?: number | undefined;
327
- counter?: {
328
- events: string[];
329
- match?: Record<string, {
330
- equals?: string | number | boolean | undefined;
331
- contains?: string | undefined;
332
- }> | undefined;
333
- } | undefined;
334
- })[];
335
- value?: unknown;
336
- }>, "many">;
337
- default: z.ZodUnknown;
338
- }, "strip", z.ZodTypeAny, {
339
- type: "rules";
340
- rules: {
341
- conditions: ({
342
- type: "page_url";
343
- url: string;
344
- } | {
345
- type: "route";
346
- routeId: string;
347
- } | {
348
- type: "anchor_visible";
349
- anchorId: string;
350
- state: "visible" | "present" | "absent";
351
- } | {
352
- type: "event_occurred";
353
- eventName: string;
354
- withinMs?: number | undefined;
355
- } | {
356
- type: "state_equals";
357
- key: string;
358
- value?: unknown;
359
- } | {
360
- type: "viewport";
361
- minWidth?: number | undefined;
362
- maxWidth?: number | undefined;
363
- minHeight?: number | undefined;
364
- maxHeight?: number | undefined;
365
- } | {
366
- type: "session_metric";
367
- key: string;
368
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
369
- threshold: number;
370
- } | {
371
- type: "dismissed";
372
- key: string;
373
- inverted?: boolean | undefined;
374
- } | {
375
- type: "cooldown_active";
376
- key: string;
377
- inverted?: boolean | undefined;
378
- } | {
379
- type: "frequency_limit";
380
- key: string;
381
- limit: number;
382
- inverted?: boolean | undefined;
383
- } | {
384
- type: "event_count";
385
- key: string;
386
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
387
- count: number;
388
- withinMs?: number | undefined;
389
- counter?: {
390
- events: string[];
391
- match?: Record<string, {
392
- equals?: string | number | boolean | undefined;
393
- contains?: string | undefined;
394
- }> | undefined;
395
- } | undefined;
396
- })[];
397
- value?: unknown;
398
- }[];
399
- default?: unknown;
400
- }, {
401
- type: "rules";
402
- rules: {
403
- conditions: ({
404
- type: "page_url";
405
- url: string;
406
- } | {
407
- type: "route";
408
- routeId: string;
409
- } | {
410
- type: "anchor_visible";
411
- anchorId: string;
412
- state: "visible" | "present" | "absent";
413
- } | {
414
- type: "event_occurred";
415
- eventName: string;
416
- withinMs?: number | undefined;
417
- } | {
418
- type: "state_equals";
419
- key: string;
420
- value?: unknown;
421
- } | {
422
- type: "viewport";
423
- minWidth?: number | undefined;
424
- maxWidth?: number | undefined;
425
- minHeight?: number | undefined;
426
- maxHeight?: number | undefined;
427
- } | {
428
- type: "session_metric";
429
- key: string;
430
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
431
- threshold: number;
432
- } | {
433
- type: "dismissed";
434
- key: string;
435
- inverted?: boolean | undefined;
436
- } | {
437
- type: "cooldown_active";
438
- key: string;
439
- inverted?: boolean | undefined;
440
- } | {
441
- type: "frequency_limit";
442
- key: string;
443
- limit: number;
444
- inverted?: boolean | undefined;
445
- } | {
446
- type: "event_count";
447
- key: string;
448
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
449
- count: number;
450
- withinMs?: number | undefined;
451
- counter?: {
452
- events: string[];
453
- match?: Record<string, {
454
- equals?: string | number | boolean | undefined;
455
- contains?: string | undefined;
456
- }> | undefined;
457
- } | undefined;
458
- })[];
459
- value?: unknown;
460
- }[];
461
- default?: unknown;
462
- }>, z.ZodObject<{
463
- type: z.ZodLiteral<"score">;
464
- field: z.ZodString;
465
- threshold: z.ZodNumber;
466
- above: z.ZodUnknown;
467
- below: z.ZodUnknown;
468
- }, "strip", z.ZodTypeAny, {
469
- type: "score";
470
- threshold: number;
471
- field: string;
472
- above?: unknown;
473
- below?: unknown;
474
- }, {
475
- type: "score";
476
- threshold: number;
477
- field: string;
478
- above?: unknown;
479
- below?: unknown;
480
- }>, z.ZodObject<{
481
- type: z.ZodLiteral<"model">;
482
- modelId: z.ZodString;
483
- inputs: z.ZodArray<z.ZodString, "many">;
484
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
485
- default: z.ZodUnknown;
486
- }, "strip", z.ZodTypeAny, {
487
- type: "model";
488
- modelId: string;
489
- inputs: string[];
490
- outputMapping: Record<string, unknown>;
491
- default?: unknown;
492
- }, {
493
- type: "model";
494
- modelId: string;
495
- inputs: string[];
496
- outputMapping: Record<string, unknown>;
497
- default?: unknown;
498
- }>, z.ZodObject<{
499
- type: z.ZodLiteral<"external">;
500
- endpoint: z.ZodString;
501
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
502
- default: z.ZodUnknown;
503
- timeoutMs: z.ZodOptional<z.ZodNumber>;
504
- }, "strip", z.ZodTypeAny, {
505
- type: "external";
506
- endpoint: string;
507
- default?: unknown;
508
- method?: "GET" | "POST" | undefined;
509
- timeoutMs?: number | undefined;
510
- }, {
511
- type: "external";
512
- endpoint: string;
513
- default?: unknown;
514
- method?: "GET" | "POST" | undefined;
515
- timeoutMs?: number | undefined;
516
- }>]>>;
517
- }, "strip", z.ZodTypeAny, {
518
- routes: {
519
- include?: string[] | undefined;
520
- exclude?: string[] | undefined;
521
- };
522
- strategy?: {
523
- type: "rules";
524
- rules: {
525
- conditions: ({
526
- type: "page_url";
527
- url: string;
528
- } | {
529
- type: "route";
530
- routeId: string;
531
- } | {
532
- type: "anchor_visible";
533
- anchorId: string;
534
- state: "visible" | "present" | "absent";
535
- } | {
536
- type: "event_occurred";
537
- eventName: string;
538
- withinMs?: number | undefined;
539
- } | {
540
- type: "state_equals";
541
- key: string;
542
- value?: unknown;
543
- } | {
544
- type: "viewport";
545
- minWidth?: number | undefined;
546
- maxWidth?: number | undefined;
547
- minHeight?: number | undefined;
548
- maxHeight?: number | undefined;
549
- } | {
550
- type: "session_metric";
551
- key: string;
552
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
553
- threshold: number;
554
- } | {
555
- type: "dismissed";
556
- key: string;
557
- inverted?: boolean | undefined;
558
- } | {
559
- type: "cooldown_active";
560
- key: string;
561
- inverted?: boolean | undefined;
562
- } | {
563
- type: "frequency_limit";
564
- key: string;
565
- limit: number;
566
- inverted?: boolean | undefined;
567
- } | {
568
- type: "event_count";
569
- key: string;
570
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
571
- count: number;
572
- withinMs?: number | undefined;
573
- counter?: {
574
- events: string[];
575
- match?: Record<string, {
576
- equals?: string | number | boolean | undefined;
577
- contains?: string | undefined;
578
- }> | undefined;
579
- } | undefined;
580
- })[];
581
- value?: unknown;
582
- }[];
583
- default?: unknown;
584
- } | {
585
- type: "score";
586
- threshold: number;
587
- field: string;
588
- above?: unknown;
589
- below?: unknown;
590
- } | {
591
- type: "model";
592
- modelId: string;
593
- inputs: string[];
594
- outputMapping: Record<string, unknown>;
595
- default?: unknown;
596
- } | {
597
- type: "external";
598
- endpoint: string;
599
- default?: unknown;
600
- method?: "GET" | "POST" | undefined;
601
- timeoutMs?: number | undefined;
602
- } | undefined;
603
- }, {
604
- routes: {
605
- include?: string[] | undefined;
606
- exclude?: string[] | undefined;
607
- };
608
- strategy?: {
609
- type: "rules";
610
- rules: {
611
- conditions: ({
612
- type: "page_url";
613
- url: string;
614
- } | {
615
- type: "route";
616
- routeId: string;
617
- } | {
618
- type: "anchor_visible";
619
- anchorId: string;
620
- state: "visible" | "present" | "absent";
621
- } | {
622
- type: "event_occurred";
623
- eventName: string;
624
- withinMs?: number | undefined;
625
- } | {
626
- type: "state_equals";
627
- key: string;
628
- value?: unknown;
629
- } | {
630
- type: "viewport";
631
- minWidth?: number | undefined;
632
- maxWidth?: number | undefined;
633
- minHeight?: number | undefined;
634
- maxHeight?: number | undefined;
635
- } | {
636
- type: "session_metric";
637
- key: string;
638
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
639
- threshold: number;
640
- } | {
641
- type: "dismissed";
642
- key: string;
643
- inverted?: boolean | undefined;
644
- } | {
645
- type: "cooldown_active";
646
- key: string;
647
- inverted?: boolean | undefined;
648
- } | {
649
- type: "frequency_limit";
650
- key: string;
651
- limit: number;
652
- inverted?: boolean | undefined;
653
- } | {
654
- type: "event_count";
655
- key: string;
656
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
657
- count: number;
658
- withinMs?: number | undefined;
659
- counter?: {
660
- events: string[];
661
- match?: Record<string, {
662
- equals?: string | number | boolean | undefined;
663
- contains?: string | undefined;
664
- }> | undefined;
665
- } | undefined;
666
- })[];
667
- value?: unknown;
668
- }[];
669
- default?: unknown;
670
- } | {
671
- type: "score";
672
- threshold: number;
673
- field: string;
674
- above?: unknown;
675
- below?: unknown;
676
- } | {
677
- type: "model";
678
- modelId: string;
679
- inputs: string[];
680
- outputMapping: Record<string, unknown>;
681
- default?: unknown;
682
- } | {
683
- type: "external";
684
- endpoint: string;
685
- default?: unknown;
686
- method?: "GET" | "POST" | undefined;
687
- timeoutMs?: number | undefined;
688
- } | undefined;
32
+ onlyIfPopulated: z.ZodOptional<z.ZodBoolean>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ routes: {
35
+ include?: string[] | undefined;
36
+ exclude?: string[] | undefined;
37
+ };
38
+ onlyIfPopulated?: boolean | undefined;
39
+ }, {
40
+ routes: {
41
+ include?: string[] | undefined;
42
+ exclude?: string[] | undefined;
43
+ };
44
+ onlyIfPopulated?: boolean | undefined;
689
45
  }>;
690
46
  /**
691
47
  * Validate a Condition object.
@@ -973,173 +329,13 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
973
329
  include?: string[] | undefined;
974
330
  exclude?: string[] | undefined;
975
331
  };
976
- strategy?: {
977
- type: "rules";
978
- rules: {
979
- conditions: ({
980
- type: "page_url";
981
- url: string;
982
- } | {
983
- type: "route";
984
- routeId: string;
985
- } | {
986
- type: "anchor_visible";
987
- anchorId: string;
988
- state: "visible" | "present" | "absent";
989
- } | {
990
- type: "event_occurred";
991
- eventName: string;
992
- withinMs?: number | undefined;
993
- } | {
994
- type: "state_equals";
995
- key: string;
996
- value?: unknown;
997
- } | {
998
- type: "viewport";
999
- minWidth?: number | undefined;
1000
- maxWidth?: number | undefined;
1001
- minHeight?: number | undefined;
1002
- maxHeight?: number | undefined;
1003
- } | {
1004
- type: "session_metric";
1005
- key: string;
1006
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1007
- threshold: number;
1008
- } | {
1009
- type: "dismissed";
1010
- key: string;
1011
- inverted?: boolean | undefined;
1012
- } | {
1013
- type: "cooldown_active";
1014
- key: string;
1015
- inverted?: boolean | undefined;
1016
- } | {
1017
- type: "frequency_limit";
1018
- key: string;
1019
- limit: number;
1020
- inverted?: boolean | undefined;
1021
- } | {
1022
- type: "event_count";
1023
- key: string;
1024
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1025
- count: number;
1026
- withinMs?: number | undefined;
1027
- counter?: {
1028
- events: string[];
1029
- match?: Record<string, {
1030
- equals?: string | number | boolean | undefined;
1031
- contains?: string | undefined;
1032
- }> | undefined;
1033
- } | undefined;
1034
- })[];
1035
- value?: unknown;
1036
- }[];
1037
- default?: unknown;
1038
- } | {
1039
- type: "score";
1040
- threshold: number;
1041
- field: string;
1042
- above?: unknown;
1043
- below?: unknown;
1044
- } | {
1045
- type: "model";
1046
- modelId: string;
1047
- inputs: string[];
1048
- outputMapping: Record<string, unknown>;
1049
- default?: unknown;
1050
- } | {
1051
- type: "external";
1052
- endpoint: string;
1053
- default?: unknown;
1054
- method?: "GET" | "POST" | undefined;
1055
- timeoutMs?: number | undefined;
1056
- } | undefined;
332
+ onlyIfPopulated?: boolean | undefined;
1057
333
  }, {
1058
334
  routes: {
1059
335
  include?: string[] | undefined;
1060
336
  exclude?: string[] | undefined;
1061
337
  };
1062
- strategy?: {
1063
- type: "rules";
1064
- rules: {
1065
- conditions: ({
1066
- type: "page_url";
1067
- url: string;
1068
- } | {
1069
- type: "route";
1070
- routeId: string;
1071
- } | {
1072
- type: "anchor_visible";
1073
- anchorId: string;
1074
- state: "visible" | "present" | "absent";
1075
- } | {
1076
- type: "event_occurred";
1077
- eventName: string;
1078
- withinMs?: number | undefined;
1079
- } | {
1080
- type: "state_equals";
1081
- key: string;
1082
- value?: unknown;
1083
- } | {
1084
- type: "viewport";
1085
- minWidth?: number | undefined;
1086
- maxWidth?: number | undefined;
1087
- minHeight?: number | undefined;
1088
- maxHeight?: number | undefined;
1089
- } | {
1090
- type: "session_metric";
1091
- key: string;
1092
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1093
- threshold: number;
1094
- } | {
1095
- type: "dismissed";
1096
- key: string;
1097
- inverted?: boolean | undefined;
1098
- } | {
1099
- type: "cooldown_active";
1100
- key: string;
1101
- inverted?: boolean | undefined;
1102
- } | {
1103
- type: "frequency_limit";
1104
- key: string;
1105
- limit: number;
1106
- inverted?: boolean | undefined;
1107
- } | {
1108
- type: "event_count";
1109
- key: string;
1110
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1111
- count: number;
1112
- withinMs?: number | undefined;
1113
- counter?: {
1114
- events: string[];
1115
- match?: Record<string, {
1116
- equals?: string | number | boolean | undefined;
1117
- contains?: string | undefined;
1118
- }> | undefined;
1119
- } | undefined;
1120
- })[];
1121
- value?: unknown;
1122
- }[];
1123
- default?: unknown;
1124
- } | {
1125
- type: "score";
1126
- threshold: number;
1127
- field: string;
1128
- above?: unknown;
1129
- below?: unknown;
1130
- } | {
1131
- type: "model";
1132
- modelId: string;
1133
- inputs: string[];
1134
- outputMapping: Record<string, unknown>;
1135
- default?: unknown;
1136
- } | {
1137
- type: "external";
1138
- endpoint: string;
1139
- default?: unknown;
1140
- method?: "GET" | "POST" | undefined;
1141
- timeoutMs?: number | undefined;
1142
- } | undefined;
338
+ onlyIfPopulated?: boolean | undefined;
1143
339
  }>;
1144
340
  /**
1145
341
  * Decision schemas for unified JSON Schema generation.
@@ -1200,663 +396,19 @@ export declare const decisionSchemas: ({
1200
396
  include?: string[] | undefined;
1201
397
  exclude?: string[] | undefined;
1202
398
  }>;
1203
- strategy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1204
- type: z.ZodLiteral<"rules">;
1205
- rules: z.ZodArray<z.ZodObject<{
1206
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1207
- type: z.ZodLiteral<"page_url">;
1208
- url: z.ZodString;
1209
- }, "strip", z.ZodTypeAny, {
1210
- type: "page_url";
1211
- url: string;
1212
- }, {
1213
- type: "page_url";
1214
- url: string;
1215
- }>, z.ZodObject<{
1216
- type: z.ZodLiteral<"route">;
1217
- routeId: z.ZodString;
1218
- }, "strip", z.ZodTypeAny, {
1219
- type: "route";
1220
- routeId: string;
1221
- }, {
1222
- type: "route";
1223
- routeId: string;
1224
- }>, z.ZodObject<{
1225
- type: z.ZodLiteral<"anchor_visible">;
1226
- anchorId: z.ZodString;
1227
- state: z.ZodEnum<["visible", "present", "absent"]>;
1228
- }, "strip", z.ZodTypeAny, {
1229
- type: "anchor_visible";
1230
- anchorId: string;
1231
- state: "visible" | "present" | "absent";
1232
- }, {
1233
- type: "anchor_visible";
1234
- anchorId: string;
1235
- state: "visible" | "present" | "absent";
1236
- }>, z.ZodObject<{
1237
- type: z.ZodLiteral<"event_occurred">;
1238
- eventName: z.ZodString;
1239
- withinMs: z.ZodOptional<z.ZodNumber>;
1240
- }, "strip", z.ZodTypeAny, {
1241
- type: "event_occurred";
1242
- eventName: string;
1243
- withinMs?: number | undefined;
1244
- }, {
1245
- type: "event_occurred";
1246
- eventName: string;
1247
- withinMs?: number | undefined;
1248
- }>, z.ZodObject<{
1249
- type: z.ZodLiteral<"state_equals">;
1250
- key: z.ZodString;
1251
- value: z.ZodUnknown;
1252
- }, "strip", z.ZodTypeAny, {
1253
- type: "state_equals";
1254
- key: string;
1255
- value?: unknown;
1256
- }, {
1257
- type: "state_equals";
1258
- key: string;
1259
- value?: unknown;
1260
- }>, z.ZodObject<{
1261
- type: z.ZodLiteral<"viewport">;
1262
- minWidth: z.ZodOptional<z.ZodNumber>;
1263
- maxWidth: z.ZodOptional<z.ZodNumber>;
1264
- minHeight: z.ZodOptional<z.ZodNumber>;
1265
- maxHeight: z.ZodOptional<z.ZodNumber>;
1266
- }, "strip", z.ZodTypeAny, {
1267
- type: "viewport";
1268
- minWidth?: number | undefined;
1269
- maxWidth?: number | undefined;
1270
- minHeight?: number | undefined;
1271
- maxHeight?: number | undefined;
1272
- }, {
1273
- type: "viewport";
1274
- minWidth?: number | undefined;
1275
- maxWidth?: number | undefined;
1276
- minHeight?: number | undefined;
1277
- maxHeight?: number | undefined;
1278
- }>, z.ZodObject<{
1279
- type: z.ZodLiteral<"session_metric">;
1280
- key: z.ZodString;
1281
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1282
- threshold: z.ZodNumber;
1283
- }, "strip", z.ZodTypeAny, {
1284
- type: "session_metric";
1285
- key: string;
1286
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1287
- threshold: number;
1288
- }, {
1289
- type: "session_metric";
1290
- key: string;
1291
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1292
- threshold: number;
1293
- }>, z.ZodObject<{
1294
- type: z.ZodLiteral<"dismissed">;
1295
- key: z.ZodString;
1296
- inverted: z.ZodOptional<z.ZodBoolean>;
1297
- }, "strip", z.ZodTypeAny, {
1298
- type: "dismissed";
1299
- key: string;
1300
- inverted?: boolean | undefined;
1301
- }, {
1302
- type: "dismissed";
1303
- key: string;
1304
- inverted?: boolean | undefined;
1305
- }>, z.ZodObject<{
1306
- type: z.ZodLiteral<"cooldown_active">;
1307
- key: z.ZodString;
1308
- inverted: z.ZodOptional<z.ZodBoolean>;
1309
- }, "strip", z.ZodTypeAny, {
1310
- type: "cooldown_active";
1311
- key: string;
1312
- inverted?: boolean | undefined;
1313
- }, {
1314
- type: "cooldown_active";
1315
- key: string;
1316
- inverted?: boolean | undefined;
1317
- }>, z.ZodObject<{
1318
- type: z.ZodLiteral<"frequency_limit">;
1319
- key: z.ZodString;
1320
- limit: z.ZodNumber;
1321
- inverted: z.ZodOptional<z.ZodBoolean>;
1322
- }, "strip", z.ZodTypeAny, {
1323
- type: "frequency_limit";
1324
- key: string;
1325
- limit: number;
1326
- inverted?: boolean | undefined;
1327
- }, {
1328
- type: "frequency_limit";
1329
- key: string;
1330
- limit: number;
1331
- inverted?: boolean | undefined;
1332
- }>, z.ZodObject<{
1333
- type: z.ZodLiteral<"event_count">;
1334
- key: z.ZodString;
1335
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1336
- count: z.ZodNumber;
1337
- withinMs: z.ZodOptional<z.ZodNumber>;
1338
- counter: z.ZodOptional<z.ZodObject<{
1339
- events: z.ZodArray<z.ZodString, "many">;
1340
- match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1341
- equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1342
- contains: z.ZodOptional<z.ZodString>;
1343
- }, "strip", z.ZodTypeAny, {
1344
- equals?: string | number | boolean | undefined;
1345
- contains?: string | undefined;
1346
- }, {
1347
- equals?: string | number | boolean | undefined;
1348
- contains?: string | undefined;
1349
- }>>>;
1350
- }, "strip", z.ZodTypeAny, {
1351
- events: string[];
1352
- match?: Record<string, {
1353
- equals?: string | number | boolean | undefined;
1354
- contains?: string | undefined;
1355
- }> | undefined;
1356
- }, {
1357
- events: string[];
1358
- match?: Record<string, {
1359
- equals?: string | number | boolean | undefined;
1360
- contains?: string | undefined;
1361
- }> | undefined;
1362
- }>>;
1363
- }, "strip", z.ZodTypeAny, {
1364
- type: "event_count";
1365
- key: string;
1366
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1367
- count: number;
1368
- withinMs?: number | undefined;
1369
- counter?: {
1370
- events: string[];
1371
- match?: Record<string, {
1372
- equals?: string | number | boolean | undefined;
1373
- contains?: string | undefined;
1374
- }> | undefined;
1375
- } | undefined;
1376
- }, {
1377
- type: "event_count";
1378
- key: string;
1379
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1380
- count: number;
1381
- withinMs?: number | undefined;
1382
- counter?: {
1383
- events: string[];
1384
- match?: Record<string, {
1385
- equals?: string | number | boolean | undefined;
1386
- contains?: string | undefined;
1387
- }> | undefined;
1388
- } | undefined;
1389
- }>]>, "many">;
1390
- value: z.ZodUnknown;
1391
- }, "strip", z.ZodTypeAny, {
1392
- conditions: ({
1393
- type: "page_url";
1394
- url: string;
1395
- } | {
1396
- type: "route";
1397
- routeId: string;
1398
- } | {
1399
- type: "anchor_visible";
1400
- anchorId: string;
1401
- state: "visible" | "present" | "absent";
1402
- } | {
1403
- type: "event_occurred";
1404
- eventName: string;
1405
- withinMs?: number | undefined;
1406
- } | {
1407
- type: "state_equals";
1408
- key: string;
1409
- value?: unknown;
1410
- } | {
1411
- type: "viewport";
1412
- minWidth?: number | undefined;
1413
- maxWidth?: number | undefined;
1414
- minHeight?: number | undefined;
1415
- maxHeight?: number | undefined;
1416
- } | {
1417
- type: "session_metric";
1418
- key: string;
1419
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1420
- threshold: number;
1421
- } | {
1422
- type: "dismissed";
1423
- key: string;
1424
- inverted?: boolean | undefined;
1425
- } | {
1426
- type: "cooldown_active";
1427
- key: string;
1428
- inverted?: boolean | undefined;
1429
- } | {
1430
- type: "frequency_limit";
1431
- key: string;
1432
- limit: number;
1433
- inverted?: boolean | undefined;
1434
- } | {
1435
- type: "event_count";
1436
- key: string;
1437
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1438
- count: number;
1439
- withinMs?: number | undefined;
1440
- counter?: {
1441
- events: string[];
1442
- match?: Record<string, {
1443
- equals?: string | number | boolean | undefined;
1444
- contains?: string | undefined;
1445
- }> | undefined;
1446
- } | undefined;
1447
- })[];
1448
- value?: unknown;
1449
- }, {
1450
- conditions: ({
1451
- type: "page_url";
1452
- url: string;
1453
- } | {
1454
- type: "route";
1455
- routeId: string;
1456
- } | {
1457
- type: "anchor_visible";
1458
- anchorId: string;
1459
- state: "visible" | "present" | "absent";
1460
- } | {
1461
- type: "event_occurred";
1462
- eventName: string;
1463
- withinMs?: number | undefined;
1464
- } | {
1465
- type: "state_equals";
1466
- key: string;
1467
- value?: unknown;
1468
- } | {
1469
- type: "viewport";
1470
- minWidth?: number | undefined;
1471
- maxWidth?: number | undefined;
1472
- minHeight?: number | undefined;
1473
- maxHeight?: number | undefined;
1474
- } | {
1475
- type: "session_metric";
1476
- key: string;
1477
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1478
- threshold: number;
1479
- } | {
1480
- type: "dismissed";
1481
- key: string;
1482
- inverted?: boolean | undefined;
1483
- } | {
1484
- type: "cooldown_active";
1485
- key: string;
1486
- inverted?: boolean | undefined;
1487
- } | {
1488
- type: "frequency_limit";
1489
- key: string;
1490
- limit: number;
1491
- inverted?: boolean | undefined;
1492
- } | {
1493
- type: "event_count";
1494
- key: string;
1495
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1496
- count: number;
1497
- withinMs?: number | undefined;
1498
- counter?: {
1499
- events: string[];
1500
- match?: Record<string, {
1501
- equals?: string | number | boolean | undefined;
1502
- contains?: string | undefined;
1503
- }> | undefined;
1504
- } | undefined;
1505
- })[];
1506
- value?: unknown;
1507
- }>, "many">;
1508
- default: z.ZodUnknown;
1509
- }, "strip", z.ZodTypeAny, {
1510
- type: "rules";
1511
- rules: {
1512
- conditions: ({
1513
- type: "page_url";
1514
- url: string;
1515
- } | {
1516
- type: "route";
1517
- routeId: string;
1518
- } | {
1519
- type: "anchor_visible";
1520
- anchorId: string;
1521
- state: "visible" | "present" | "absent";
1522
- } | {
1523
- type: "event_occurred";
1524
- eventName: string;
1525
- withinMs?: number | undefined;
1526
- } | {
1527
- type: "state_equals";
1528
- key: string;
1529
- value?: unknown;
1530
- } | {
1531
- type: "viewport";
1532
- minWidth?: number | undefined;
1533
- maxWidth?: number | undefined;
1534
- minHeight?: number | undefined;
1535
- maxHeight?: number | undefined;
1536
- } | {
1537
- type: "session_metric";
1538
- key: string;
1539
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1540
- threshold: number;
1541
- } | {
1542
- type: "dismissed";
1543
- key: string;
1544
- inverted?: boolean | undefined;
1545
- } | {
1546
- type: "cooldown_active";
1547
- key: string;
1548
- inverted?: boolean | undefined;
1549
- } | {
1550
- type: "frequency_limit";
1551
- key: string;
1552
- limit: number;
1553
- inverted?: boolean | undefined;
1554
- } | {
1555
- type: "event_count";
1556
- key: string;
1557
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1558
- count: number;
1559
- withinMs?: number | undefined;
1560
- counter?: {
1561
- events: string[];
1562
- match?: Record<string, {
1563
- equals?: string | number | boolean | undefined;
1564
- contains?: string | undefined;
1565
- }> | undefined;
1566
- } | undefined;
1567
- })[];
1568
- value?: unknown;
1569
- }[];
1570
- default?: unknown;
1571
- }, {
1572
- type: "rules";
1573
- rules: {
1574
- conditions: ({
1575
- type: "page_url";
1576
- url: string;
1577
- } | {
1578
- type: "route";
1579
- routeId: string;
1580
- } | {
1581
- type: "anchor_visible";
1582
- anchorId: string;
1583
- state: "visible" | "present" | "absent";
1584
- } | {
1585
- type: "event_occurred";
1586
- eventName: string;
1587
- withinMs?: number | undefined;
1588
- } | {
1589
- type: "state_equals";
1590
- key: string;
1591
- value?: unknown;
1592
- } | {
1593
- type: "viewport";
1594
- minWidth?: number | undefined;
1595
- maxWidth?: number | undefined;
1596
- minHeight?: number | undefined;
1597
- maxHeight?: number | undefined;
1598
- } | {
1599
- type: "session_metric";
1600
- key: string;
1601
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1602
- threshold: number;
1603
- } | {
1604
- type: "dismissed";
1605
- key: string;
1606
- inverted?: boolean | undefined;
1607
- } | {
1608
- type: "cooldown_active";
1609
- key: string;
1610
- inverted?: boolean | undefined;
1611
- } | {
1612
- type: "frequency_limit";
1613
- key: string;
1614
- limit: number;
1615
- inverted?: boolean | undefined;
1616
- } | {
1617
- type: "event_count";
1618
- key: string;
1619
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1620
- count: number;
1621
- withinMs?: number | undefined;
1622
- counter?: {
1623
- events: string[];
1624
- match?: Record<string, {
1625
- equals?: string | number | boolean | undefined;
1626
- contains?: string | undefined;
1627
- }> | undefined;
1628
- } | undefined;
1629
- })[];
1630
- value?: unknown;
1631
- }[];
1632
- default?: unknown;
1633
- }>, z.ZodObject<{
1634
- type: z.ZodLiteral<"score">;
1635
- field: z.ZodString;
1636
- threshold: z.ZodNumber;
1637
- above: z.ZodUnknown;
1638
- below: z.ZodUnknown;
1639
- }, "strip", z.ZodTypeAny, {
1640
- type: "score";
1641
- threshold: number;
1642
- field: string;
1643
- above?: unknown;
1644
- below?: unknown;
1645
- }, {
1646
- type: "score";
1647
- threshold: number;
1648
- field: string;
1649
- above?: unknown;
1650
- below?: unknown;
1651
- }>, z.ZodObject<{
1652
- type: z.ZodLiteral<"model">;
1653
- modelId: z.ZodString;
1654
- inputs: z.ZodArray<z.ZodString, "many">;
1655
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1656
- default: z.ZodUnknown;
1657
- }, "strip", z.ZodTypeAny, {
1658
- type: "model";
1659
- modelId: string;
1660
- inputs: string[];
1661
- outputMapping: Record<string, unknown>;
1662
- default?: unknown;
1663
- }, {
1664
- type: "model";
1665
- modelId: string;
1666
- inputs: string[];
1667
- outputMapping: Record<string, unknown>;
1668
- default?: unknown;
1669
- }>, z.ZodObject<{
1670
- type: z.ZodLiteral<"external">;
1671
- endpoint: z.ZodString;
1672
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1673
- default: z.ZodUnknown;
1674
- timeoutMs: z.ZodOptional<z.ZodNumber>;
1675
- }, "strip", z.ZodTypeAny, {
1676
- type: "external";
1677
- endpoint: string;
1678
- default?: unknown;
1679
- method?: "GET" | "POST" | undefined;
1680
- timeoutMs?: number | undefined;
1681
- }, {
1682
- type: "external";
1683
- endpoint: string;
1684
- default?: unknown;
1685
- method?: "GET" | "POST" | undefined;
1686
- timeoutMs?: number | undefined;
1687
- }>]>>;
399
+ onlyIfPopulated: z.ZodOptional<z.ZodBoolean>;
1688
400
  }, "strip", z.ZodTypeAny, {
1689
401
  routes: {
1690
402
  include?: string[] | undefined;
1691
403
  exclude?: string[] | undefined;
1692
404
  };
1693
- strategy?: {
1694
- type: "rules";
1695
- rules: {
1696
- conditions: ({
1697
- type: "page_url";
1698
- url: string;
1699
- } | {
1700
- type: "route";
1701
- routeId: string;
1702
- } | {
1703
- type: "anchor_visible";
1704
- anchorId: string;
1705
- state: "visible" | "present" | "absent";
1706
- } | {
1707
- type: "event_occurred";
1708
- eventName: string;
1709
- withinMs?: number | undefined;
1710
- } | {
1711
- type: "state_equals";
1712
- key: string;
1713
- value?: unknown;
1714
- } | {
1715
- type: "viewport";
1716
- minWidth?: number | undefined;
1717
- maxWidth?: number | undefined;
1718
- minHeight?: number | undefined;
1719
- maxHeight?: number | undefined;
1720
- } | {
1721
- type: "session_metric";
1722
- key: string;
1723
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1724
- threshold: number;
1725
- } | {
1726
- type: "dismissed";
1727
- key: string;
1728
- inverted?: boolean | undefined;
1729
- } | {
1730
- type: "cooldown_active";
1731
- key: string;
1732
- inverted?: boolean | undefined;
1733
- } | {
1734
- type: "frequency_limit";
1735
- key: string;
1736
- limit: number;
1737
- inverted?: boolean | undefined;
1738
- } | {
1739
- type: "event_count";
1740
- key: string;
1741
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1742
- count: number;
1743
- withinMs?: number | undefined;
1744
- counter?: {
1745
- events: string[];
1746
- match?: Record<string, {
1747
- equals?: string | number | boolean | undefined;
1748
- contains?: string | undefined;
1749
- }> | undefined;
1750
- } | undefined;
1751
- })[];
1752
- value?: unknown;
1753
- }[];
1754
- default?: unknown;
1755
- } | {
1756
- type: "score";
1757
- threshold: number;
1758
- field: string;
1759
- above?: unknown;
1760
- below?: unknown;
1761
- } | {
1762
- type: "model";
1763
- modelId: string;
1764
- inputs: string[];
1765
- outputMapping: Record<string, unknown>;
1766
- default?: unknown;
1767
- } | {
1768
- type: "external";
1769
- endpoint: string;
1770
- default?: unknown;
1771
- method?: "GET" | "POST" | undefined;
1772
- timeoutMs?: number | undefined;
1773
- } | undefined;
405
+ onlyIfPopulated?: boolean | undefined;
1774
406
  }, {
1775
407
  routes: {
1776
408
  include?: string[] | undefined;
1777
409
  exclude?: string[] | undefined;
1778
410
  };
1779
- strategy?: {
1780
- type: "rules";
1781
- rules: {
1782
- conditions: ({
1783
- type: "page_url";
1784
- url: string;
1785
- } | {
1786
- type: "route";
1787
- routeId: string;
1788
- } | {
1789
- type: "anchor_visible";
1790
- anchorId: string;
1791
- state: "visible" | "present" | "absent";
1792
- } | {
1793
- type: "event_occurred";
1794
- eventName: string;
1795
- withinMs?: number | undefined;
1796
- } | {
1797
- type: "state_equals";
1798
- key: string;
1799
- value?: unknown;
1800
- } | {
1801
- type: "viewport";
1802
- minWidth?: number | undefined;
1803
- maxWidth?: number | undefined;
1804
- minHeight?: number | undefined;
1805
- maxHeight?: number | undefined;
1806
- } | {
1807
- type: "session_metric";
1808
- key: string;
1809
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1810
- threshold: number;
1811
- } | {
1812
- type: "dismissed";
1813
- key: string;
1814
- inverted?: boolean | undefined;
1815
- } | {
1816
- type: "cooldown_active";
1817
- key: string;
1818
- inverted?: boolean | undefined;
1819
- } | {
1820
- type: "frequency_limit";
1821
- key: string;
1822
- limit: number;
1823
- inverted?: boolean | undefined;
1824
- } | {
1825
- type: "event_count";
1826
- key: string;
1827
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1828
- count: number;
1829
- withinMs?: number | undefined;
1830
- counter?: {
1831
- events: string[];
1832
- match?: Record<string, {
1833
- equals?: string | number | boolean | undefined;
1834
- contains?: string | undefined;
1835
- }> | undefined;
1836
- } | undefined;
1837
- })[];
1838
- value?: unknown;
1839
- }[];
1840
- default?: unknown;
1841
- } | {
1842
- type: "score";
1843
- threshold: number;
1844
- field: string;
1845
- above?: unknown;
1846
- below?: unknown;
1847
- } | {
1848
- type: "model";
1849
- modelId: string;
1850
- inputs: string[];
1851
- outputMapping: Record<string, unknown>;
1852
- default?: unknown;
1853
- } | {
1854
- type: "external";
1855
- endpoint: string;
1856
- default?: unknown;
1857
- method?: "GET" | "POST" | undefined;
1858
- timeoutMs?: number | undefined;
1859
- } | undefined;
411
+ onlyIfPopulated?: boolean | undefined;
1860
412
  }>;
1861
413
  } | {
1862
414
  defName: string;