@revturbine/sdk 0.2.57 → 0.2.58
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/headless.d.ts +106 -32
- package/dist/headless.js +2 -2
- package/dist/headless.js.map +1 -1
- package/dist/index.d.ts +106 -32
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/web-sdk/customer-side.d.ts +31 -7
- package/dist/types/web-sdk/customer-side.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/headless.d.ts
CHANGED
|
@@ -1739,6 +1739,7 @@ declare const PlacementPayloadSchema: z.ZodObject<{
|
|
|
1739
1739
|
session: "session";
|
|
1740
1740
|
}>>;
|
|
1741
1741
|
cooldown_after_dismiss_days: z.ZodDefault<z.ZodNumber>;
|
|
1742
|
+
remind_later_minutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
1742
1743
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1743
1744
|
custom: "custom";
|
|
1744
1745
|
next_tier_up: "next_tier_up";
|
|
@@ -3714,6 +3715,7 @@ declare const PlacementSettingsCapStateSchema: z.ZodObject<{
|
|
|
3714
3715
|
}, z.core.$strip>;
|
|
3715
3716
|
}, z.core.$strip>>>;
|
|
3716
3717
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3718
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3717
3719
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3718
3720
|
off: "off";
|
|
3719
3721
|
test_users: "test_users";
|
|
@@ -3756,6 +3758,7 @@ declare const PlacementSettingsSchema: z.ZodObject<{
|
|
|
3756
3758
|
}, z.core.$strip>;
|
|
3757
3759
|
}, z.core.$strip>>>;
|
|
3758
3760
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3761
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3759
3762
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3760
3763
|
off: "off";
|
|
3761
3764
|
test_users: "test_users";
|
|
@@ -3771,7 +3774,6 @@ declare const PlacementSettingsSchema: z.ZodObject<{
|
|
|
3771
3774
|
}>>>;
|
|
3772
3775
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
3773
3776
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
3774
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNumber>;
|
|
3775
3777
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
3776
3778
|
priority_collision_strategy: z.ZodDefault<z.ZodEnum<{
|
|
3777
3779
|
highest_priority: "highest_priority";
|
|
@@ -3941,6 +3943,7 @@ declare const RevTurbineConfigPlacementSettingsItemSchema: z.ZodObject<{
|
|
|
3941
3943
|
}, z.core.$strip>;
|
|
3942
3944
|
}, z.core.$strip>>>;
|
|
3943
3945
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3946
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3944
3947
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3945
3948
|
off: "off";
|
|
3946
3949
|
test_users: "test_users";
|
|
@@ -3956,7 +3959,6 @@ declare const RevTurbineConfigPlacementSettingsItemSchema: z.ZodObject<{
|
|
|
3956
3959
|
}>>>;
|
|
3957
3960
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
3958
3961
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
3959
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
3960
3962
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
3961
3963
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3962
3964
|
}, z.core.$strip>;
|
|
@@ -4346,6 +4348,7 @@ declare const RevTurbineConfigStudioPayloadSchema: z.ZodObject<{
|
|
|
4346
4348
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4347
4349
|
}, z.core.$strip>>;
|
|
4348
4350
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4351
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4349
4352
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4350
4353
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4351
4354
|
custom: "custom";
|
|
@@ -4499,6 +4502,7 @@ declare const RevTurbineConfigPlacementItemSchema: z.ZodObject<{
|
|
|
4499
4502
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4500
4503
|
}, z.core.$strip>>;
|
|
4501
4504
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4505
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4502
4506
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4503
4507
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4504
4508
|
custom: "custom";
|
|
@@ -4530,6 +4534,7 @@ declare const RevTurbineConfigPlacementPayloadItemSchema: z.ZodObject<{
|
|
|
4530
4534
|
}, z.core.$strip>>;
|
|
4531
4535
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4532
4536
|
}, z.core.$strip>>;
|
|
4537
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4533
4538
|
created_at: z.ZodString;
|
|
4534
4539
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
4535
4540
|
source_mode: z.ZodEnum<{
|
|
@@ -4809,6 +4814,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
4809
4814
|
}, z.core.$strip>>;
|
|
4810
4815
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4811
4816
|
}, z.core.$strip>>;
|
|
4817
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4812
4818
|
created_at: z.ZodString;
|
|
4813
4819
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
4814
4820
|
source_mode: z.ZodEnum<{
|
|
@@ -4948,6 +4954,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
4948
4954
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4949
4955
|
}, z.core.$strip>>;
|
|
4950
4956
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4957
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4951
4958
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4952
4959
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4953
4960
|
custom: "custom";
|
|
@@ -5147,6 +5154,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
5147
5154
|
}, z.core.$strip>;
|
|
5148
5155
|
}, z.core.$strip>>>;
|
|
5149
5156
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5157
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5150
5158
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
5151
5159
|
off: "off";
|
|
5152
5160
|
test_users: "test_users";
|
|
@@ -5162,7 +5170,6 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
5162
5170
|
}>>>;
|
|
5163
5171
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
5164
5172
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
5165
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
5166
5173
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
5167
5174
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5168
5175
|
}, z.core.$strip>>>;
|
|
@@ -5453,6 +5460,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5453
5460
|
}, z.core.$strip>>;
|
|
5454
5461
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
5455
5462
|
}, z.core.$strip>>;
|
|
5463
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5456
5464
|
created_at: z.ZodString;
|
|
5457
5465
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
5458
5466
|
source_mode: z.ZodEnum<{
|
|
@@ -5592,6 +5600,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5592
5600
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
5593
5601
|
}, z.core.$strip>>;
|
|
5594
5602
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5603
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5595
5604
|
created_at: z.ZodOptional<z.ZodString>;
|
|
5596
5605
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
5597
5606
|
custom: "custom";
|
|
@@ -5791,6 +5800,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5791
5800
|
}, z.core.$strip>;
|
|
5792
5801
|
}, z.core.$strip>>>;
|
|
5793
5802
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5803
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5794
5804
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
5795
5805
|
off: "off";
|
|
5796
5806
|
test_users: "test_users";
|
|
@@ -5806,7 +5816,6 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5806
5816
|
}>>>;
|
|
5807
5817
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
5808
5818
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
5809
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
5810
5819
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
5811
5820
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5812
5821
|
}, z.core.$strip>>>;
|
|
@@ -6084,6 +6093,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6084
6093
|
}, z.core.$strip>>;
|
|
6085
6094
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6086
6095
|
}, z.core.$strip>>;
|
|
6096
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6087
6097
|
created_at: z.ZodString;
|
|
6088
6098
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
6089
6099
|
source_mode: z.ZodEnum<{
|
|
@@ -6223,6 +6233,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6223
6233
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6224
6234
|
}, z.core.$strip>>;
|
|
6225
6235
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6236
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6226
6237
|
created_at: z.ZodOptional<z.ZodString>;
|
|
6227
6238
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6228
6239
|
custom: "custom";
|
|
@@ -6422,6 +6433,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6422
6433
|
}, z.core.$strip>;
|
|
6423
6434
|
}, z.core.$strip>>>;
|
|
6424
6435
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
6436
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
6425
6437
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
6426
6438
|
off: "off";
|
|
6427
6439
|
test_users: "test_users";
|
|
@@ -6437,7 +6449,6 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6437
6449
|
}>>>;
|
|
6438
6450
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
6439
6451
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
6440
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
6441
6452
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
6442
6453
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
6443
6454
|
}, z.core.$strip>>>;
|
|
@@ -6733,6 +6744,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6733
6744
|
}, z.core.$strip>>;
|
|
6734
6745
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6735
6746
|
}, z.core.$strip>>;
|
|
6747
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6736
6748
|
created_at: z.ZodString;
|
|
6737
6749
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
6738
6750
|
source_mode: z.ZodEnum<{
|
|
@@ -6872,6 +6884,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6872
6884
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6873
6885
|
}, z.core.$strip>>;
|
|
6874
6886
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6887
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6875
6888
|
created_at: z.ZodOptional<z.ZodString>;
|
|
6876
6889
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6877
6890
|
custom: "custom";
|
|
@@ -7071,6 +7084,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7071
7084
|
}, z.core.$strip>;
|
|
7072
7085
|
}, z.core.$strip>>>;
|
|
7073
7086
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7087
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7074
7088
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
7075
7089
|
off: "off";
|
|
7076
7090
|
test_users: "test_users";
|
|
@@ -7086,7 +7100,6 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7086
7100
|
}>>>;
|
|
7087
7101
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
7088
7102
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
7089
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
7090
7103
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
7091
7104
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7092
7105
|
}, z.core.$strip>>>;
|
|
@@ -7361,6 +7374,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7361
7374
|
}, z.core.$strip>>;
|
|
7362
7375
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
7363
7376
|
}, z.core.$strip>>;
|
|
7377
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7364
7378
|
created_at: z.ZodString;
|
|
7365
7379
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
7366
7380
|
source_mode: z.ZodEnum<{
|
|
@@ -7500,6 +7514,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7500
7514
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
7501
7515
|
}, z.core.$strip>>;
|
|
7502
7516
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7517
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7503
7518
|
created_at: z.ZodOptional<z.ZodString>;
|
|
7504
7519
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
7505
7520
|
custom: "custom";
|
|
@@ -7699,6 +7714,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7699
7714
|
}, z.core.$strip>;
|
|
7700
7715
|
}, z.core.$strip>>>;
|
|
7701
7716
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7717
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7702
7718
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
7703
7719
|
off: "off";
|
|
7704
7720
|
test_users: "test_users";
|
|
@@ -7714,7 +7730,6 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7714
7730
|
}>>>;
|
|
7715
7731
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
7716
7732
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
7717
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
7718
7733
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
7719
7734
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7720
7735
|
}, z.core.$strip>>>;
|
|
@@ -9866,7 +9881,7 @@ interface InteractionTrackerOptions {
|
|
|
9866
9881
|
storage: RevTurbineStorage;
|
|
9867
9882
|
tenantId: string;
|
|
9868
9883
|
userId: string;
|
|
9869
|
-
/** Default dismiss cooldown (ms). Default:
|
|
9884
|
+
/** Default dismiss cooldown (ms). Default: 7 days (`cooldown_after_dismiss_days`). */
|
|
9870
9885
|
defaultDismissCooldownMs?: number;
|
|
9871
9886
|
/** Default remind-me-later delay (ms). Default: 1 hour. */
|
|
9872
9887
|
defaultRemindLaterMs?: number;
|
|
@@ -10029,19 +10044,29 @@ declare class DecisionEngine {
|
|
|
10029
10044
|
/**
|
|
10030
10045
|
* Impression history types.
|
|
10031
10046
|
*
|
|
10032
|
-
* Tracks placement impressions and
|
|
10033
|
-
* suppress) so the decision engine can
|
|
10034
|
-
* has already acted on
|
|
10047
|
+
* Tracks placement impressions and interactions (dismiss, click-through,
|
|
10048
|
+
* conversion, suppress) so the decision engine can exclude placements the user
|
|
10049
|
+
* has already acted on — permanently for a confirmed conversion, or for a
|
|
10050
|
+
* cooldown window for a dismiss / bare click / system suppression.
|
|
10035
10051
|
*/
|
|
10036
10052
|
/**
|
|
10037
10053
|
* Interaction outcomes tracked by the impression history system.
|
|
10038
10054
|
*
|
|
10039
|
-
* - `'impressed'`
|
|
10040
|
-
* - `'dismissed'`
|
|
10041
|
-
*
|
|
10042
|
-
*
|
|
10055
|
+
* - `'impressed'` — the placement was shown to the user.
|
|
10056
|
+
* - `'dismissed'` — user explicitly closed the placement ("No thanks").
|
|
10057
|
+
* Time-boxed: the placement re-shows after the dismiss cooldown
|
|
10058
|
+
* (`cooldown_after_dismiss_days`, default 7d). Spec: placement-studio-ui.md §
|
|
10059
|
+
* "Cooldown After Dismiss". NOT permanent.
|
|
10060
|
+
* - `'clicked_thru'` — user clicked the CTA but did **not** confirm completion
|
|
10061
|
+
* (e.g. abandoned checkout). Time-boxed like a dismiss — they may return.
|
|
10062
|
+
* - `'cta_completed'` — user confirmed the conversion action. **Permanent** —
|
|
10063
|
+
* a converted user never sees the upsell again.
|
|
10064
|
+
* - `'suppressed'` — system or admin suppressed the placement (time-based).
|
|
10065
|
+
*
|
|
10066
|
+
* See plan 167 (Q-1 ruling): only a confirmed conversion is terminal; a dismiss
|
|
10067
|
+
* or a bare click is a cooldown.
|
|
10043
10068
|
*/
|
|
10044
|
-
type ImpressionOutcome = 'impressed' | 'dismissed' | 'clicked_thru' | 'suppressed';
|
|
10069
|
+
type ImpressionOutcome = 'impressed' | 'dismissed' | 'clicked_thru' | 'cta_completed' | 'suppressed';
|
|
10045
10070
|
/**
|
|
10046
10071
|
* A single impression/interaction history record.
|
|
10047
10072
|
*/
|
|
@@ -10086,14 +10111,16 @@ interface ImpressionHistoryStore {
|
|
|
10086
10111
|
query(userId: string, query?: ImpressionQuery): ImpressionRecord[] | Promise<ImpressionRecord[]>;
|
|
10087
10112
|
/**
|
|
10088
10113
|
* Return the set of placement IDs that have a terminal outcome
|
|
10089
|
-
* for this user (
|
|
10114
|
+
* for this user (`cta_completed` — a confirmed conversion).
|
|
10090
10115
|
*
|
|
10091
10116
|
* This is the hot-path check used by the resolver.
|
|
10092
10117
|
*/
|
|
10093
10118
|
getRetiredPlacementIds(userId: string): Set<string> | Promise<Set<string>>;
|
|
10094
10119
|
/**
|
|
10095
10120
|
* Return a map of placement IDs → `suppressUntil` ISO timestamps
|
|
10096
|
-
* for placements with active
|
|
10121
|
+
* for placements with an active cooldown window — i.e. any record
|
|
10122
|
+
* (`dismissed`, `clicked_thru`, or `suppressed`) carrying a future
|
|
10123
|
+
* `suppressUntil`.
|
|
10097
10124
|
*/
|
|
10098
10125
|
getSuppressedPlacements(userId: string): Map<string, string> | Promise<Map<string, string>>;
|
|
10099
10126
|
/** Remove all records for a user. */
|
|
@@ -10118,17 +10145,25 @@ interface ImpressionHistoryOptions {
|
|
|
10118
10145
|
userId: string;
|
|
10119
10146
|
/** Default suppression duration in milliseconds. Default: 24 h. */
|
|
10120
10147
|
defaultSuppressionMs?: number;
|
|
10148
|
+
/**
|
|
10149
|
+
* Default dismiss cooldown in milliseconds — applied to `dismissed` and bare
|
|
10150
|
+
* `clicked_thru` outcomes when no explicit window is supplied. Default: 7 days
|
|
10151
|
+
* (mirrors `cooldown_after_dismiss_days`).
|
|
10152
|
+
*/
|
|
10153
|
+
defaultDismissCooldownMs?: number;
|
|
10121
10154
|
}
|
|
10122
10155
|
declare class ImpressionHistory {
|
|
10123
10156
|
private readonly store;
|
|
10124
10157
|
private userId;
|
|
10125
10158
|
private readonly defaultSuppressionMs;
|
|
10159
|
+
private readonly defaultDismissCooldownMs;
|
|
10126
10160
|
/**
|
|
10127
|
-
* Hot cache of permanently retired placement IDs (
|
|
10161
|
+
* Hot cache of permanently retired placement IDs (confirmed conversions).
|
|
10128
10162
|
*/
|
|
10129
10163
|
private retiredCache;
|
|
10130
10164
|
/**
|
|
10131
10165
|
* Hot cache of time-suppressed placement IDs → suppressUntil ISO timestamp.
|
|
10166
|
+
* Covers dismiss / bare-click cooldowns and system suppressions.
|
|
10132
10167
|
*/
|
|
10133
10168
|
private suppressedCache;
|
|
10134
10169
|
constructor(options: ImpressionHistoryOptions);
|
|
@@ -10137,15 +10172,30 @@ declare class ImpressionHistory {
|
|
|
10137
10172
|
*/
|
|
10138
10173
|
recordImpression(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
10139
10174
|
/**
|
|
10140
|
-
* Record a dismissal — the user explicitly closed the placement.
|
|
10141
|
-
*
|
|
10175
|
+
* Record a dismissal — the user explicitly closed the placement ("No thanks").
|
|
10176
|
+
* Time-boxed: the placement is hidden for a cooldown window and re-shows once
|
|
10177
|
+
* it elapses (plan 167, Q-1; spec placement-studio-ui.md:311). NOT permanent.
|
|
10178
|
+
*
|
|
10179
|
+
* @param cooldownMs — cooldown window in ms. Falls back to
|
|
10180
|
+
* `defaultDismissCooldownMs` (7 days). The SDK resolves this from the
|
|
10181
|
+
* placement's `cooldown_after_dismiss_days`.
|
|
10182
|
+
*/
|
|
10183
|
+
recordDismissal(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: Record<string, unknown>, cooldownMs?: number): Promise<void>;
|
|
10184
|
+
/**
|
|
10185
|
+
* Record a bare click-through — the user clicked the CTA but did **not**
|
|
10186
|
+
* confirm the conversion (e.g. abandoned checkout). Treated as a cooldown,
|
|
10187
|
+
* identical to a dismiss — they may return (plan 167, Q-1). For a confirmed
|
|
10188
|
+
* conversion use {@link recordConversion} instead.
|
|
10189
|
+
*
|
|
10190
|
+
* @param cooldownMs — cooldown window in ms. Falls back to
|
|
10191
|
+
* `defaultDismissCooldownMs` (7 days).
|
|
10142
10192
|
*/
|
|
10143
|
-
|
|
10193
|
+
recordClickThru(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: Record<string, unknown>, cooldownMs?: number): Promise<void>;
|
|
10144
10194
|
/**
|
|
10145
|
-
* Record a
|
|
10146
|
-
* The placement is permanently retired for this user.
|
|
10195
|
+
* Record a confirmed conversion — the user completed the CTA action.
|
|
10196
|
+
* The placement is **permanently** retired for this user (plan 167, Q-1).
|
|
10147
10197
|
*/
|
|
10148
|
-
|
|
10198
|
+
recordConversion(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: Record<string, unknown>): Promise<void>;
|
|
10149
10199
|
/**
|
|
10150
10200
|
* Record a suppression — the system or admin suppressed the placement.
|
|
10151
10201
|
* The placement is hidden for a configurable duration (not permanent).
|
|
@@ -12379,6 +12429,13 @@ declare class RevTurbineCustomerSdk {
|
|
|
12379
12429
|
private readonly interactionQueue;
|
|
12380
12430
|
private readonly defaultDecisionTtlMs;
|
|
12381
12431
|
private readonly defaultDismissCooldownMs;
|
|
12432
|
+
/**
|
|
12433
|
+
* Default dismiss cooldown window — 7 days, matching the engine's
|
|
12434
|
+
* `cooldown_after_dismiss_days` default. Applied to `dismiss` and bare
|
|
12435
|
+
* `cta_clicked` when the payload supplies no explicit `cooldown_ms`
|
|
12436
|
+
* (plan 167 REQ-3 / Q-1). Replaces the legacy 24h dismiss window.
|
|
12437
|
+
*/
|
|
12438
|
+
private readonly dismissCooldownDefaultMs;
|
|
12382
12439
|
private readonly defaultRemindLaterMs;
|
|
12383
12440
|
private readonly defaultUsageWarningPercent;
|
|
12384
12441
|
private readonly defaultTrialExpiringDays;
|
|
@@ -12872,26 +12929,43 @@ declare class RevTurbineCustomerSdk {
|
|
|
12872
12929
|
*/
|
|
12873
12930
|
recordImpression(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata): Promise<void>;
|
|
12874
12931
|
/**
|
|
12875
|
-
* Record a placement dismissal — the user explicitly closed it.
|
|
12876
|
-
*
|
|
12877
|
-
* `
|
|
12932
|
+
* Record a placement dismissal — the user explicitly closed it ("No thanks").
|
|
12933
|
+
* Time-boxed: the placement is hidden for the dismiss cooldown
|
|
12934
|
+
* (`cooldown_after_dismiss_days`, default 7 days) and re-shows once it elapses
|
|
12935
|
+
* (plan 167). NOT permanent — for a confirmed conversion use
|
|
12936
|
+
* {@link recordConversion}.
|
|
12937
|
+
*
|
|
12938
|
+
* @param placementId - The placement's stable rule_id.
|
|
12939
|
+
* @param payloadId - Optional payload variant id.
|
|
12940
|
+
* @param surfaceTemplateId - Optional surface template id.
|
|
12941
|
+
* @param metadata - Optional metadata persisted with the record.
|
|
12942
|
+
* @param cooldownMs - Optional explicit cooldown window (ms). Defaults to 7 days.
|
|
12943
|
+
*/
|
|
12944
|
+
recordDismissal(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata, cooldownMs?: number): Promise<void>;
|
|
12945
|
+
/**
|
|
12946
|
+
* Record a bare placement click-through — the user clicked the CTA but did
|
|
12947
|
+
* not confirm the conversion (e.g. abandoned checkout). Time-boxed like a
|
|
12948
|
+
* dismiss; the placement may return (plan 167). For a confirmed conversion
|
|
12949
|
+
* use {@link recordConversion}.
|
|
12878
12950
|
*
|
|
12879
12951
|
* @param placementId - The placement's stable rule_id.
|
|
12880
12952
|
* @param payloadId - Optional payload variant id.
|
|
12881
12953
|
* @param surfaceTemplateId - Optional surface template id.
|
|
12882
12954
|
* @param metadata - Optional metadata persisted with the record.
|
|
12955
|
+
* @param cooldownMs - Optional explicit cooldown window (ms). Defaults to 7 days.
|
|
12883
12956
|
*/
|
|
12884
|
-
|
|
12957
|
+
recordClickThru(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata, cooldownMs?: number): Promise<void>;
|
|
12885
12958
|
/**
|
|
12886
|
-
* Record a
|
|
12887
|
-
*
|
|
12959
|
+
* Record a confirmed conversion — the user completed the CTA action. The
|
|
12960
|
+
* placement is **permanently** retired for this user; subsequent
|
|
12961
|
+
* `getPlacementDecision` calls return `visible: false` for good (plan 167).
|
|
12888
12962
|
*
|
|
12889
12963
|
* @param placementId - The placement's stable rule_id.
|
|
12890
12964
|
* @param payloadId - Optional payload variant id.
|
|
12891
12965
|
* @param surfaceTemplateId - Optional surface template id.
|
|
12892
12966
|
* @param metadata - Optional metadata persisted with the record.
|
|
12893
12967
|
*/
|
|
12894
|
-
|
|
12968
|
+
recordConversion(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata): Promise<void>;
|
|
12895
12969
|
getTrialStatus(): Promise<RevTurbineTrialContext>;
|
|
12896
12970
|
/**
|
|
12897
12971
|
* Derive and push the user's trial status from their {@link TrialInstance}
|