@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/index.d.ts
CHANGED
|
@@ -1741,6 +1741,7 @@ declare const PlacementPayloadSchema: z.ZodObject<{
|
|
|
1741
1741
|
session: "session";
|
|
1742
1742
|
}>>;
|
|
1743
1743
|
cooldown_after_dismiss_days: z.ZodDefault<z.ZodNumber>;
|
|
1744
|
+
remind_later_minutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
1744
1745
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1745
1746
|
custom: "custom";
|
|
1746
1747
|
next_tier_up: "next_tier_up";
|
|
@@ -3716,6 +3717,7 @@ declare const PlacementSettingsCapStateSchema: z.ZodObject<{
|
|
|
3716
3717
|
}, z.core.$strip>;
|
|
3717
3718
|
}, z.core.$strip>>>;
|
|
3718
3719
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3720
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3719
3721
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3720
3722
|
off: "off";
|
|
3721
3723
|
test_users: "test_users";
|
|
@@ -3758,6 +3760,7 @@ declare const PlacementSettingsSchema: z.ZodObject<{
|
|
|
3758
3760
|
}, z.core.$strip>;
|
|
3759
3761
|
}, z.core.$strip>>>;
|
|
3760
3762
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3763
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3761
3764
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3762
3765
|
off: "off";
|
|
3763
3766
|
test_users: "test_users";
|
|
@@ -3773,7 +3776,6 @@ declare const PlacementSettingsSchema: z.ZodObject<{
|
|
|
3773
3776
|
}>>>;
|
|
3774
3777
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
3775
3778
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
3776
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNumber>;
|
|
3777
3779
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
3778
3780
|
priority_collision_strategy: z.ZodDefault<z.ZodEnum<{
|
|
3779
3781
|
highest_priority: "highest_priority";
|
|
@@ -3943,6 +3945,7 @@ declare const RevTurbineConfigPlacementSettingsItemSchema: z.ZodObject<{
|
|
|
3943
3945
|
}, z.core.$strip>;
|
|
3944
3946
|
}, z.core.$strip>>>;
|
|
3945
3947
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3948
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
3946
3949
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
3947
3950
|
off: "off";
|
|
3948
3951
|
test_users: "test_users";
|
|
@@ -3958,7 +3961,6 @@ declare const RevTurbineConfigPlacementSettingsItemSchema: z.ZodObject<{
|
|
|
3958
3961
|
}>>>;
|
|
3959
3962
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
3960
3963
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
3961
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
3962
3964
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
3963
3965
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3964
3966
|
}, z.core.$strip>;
|
|
@@ -4348,6 +4350,7 @@ declare const RevTurbineConfigStudioPayloadSchema: z.ZodObject<{
|
|
|
4348
4350
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4349
4351
|
}, z.core.$strip>>;
|
|
4350
4352
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4353
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4351
4354
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4352
4355
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4353
4356
|
custom: "custom";
|
|
@@ -4501,6 +4504,7 @@ declare const RevTurbineConfigPlacementItemSchema: z.ZodObject<{
|
|
|
4501
4504
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4502
4505
|
}, z.core.$strip>>;
|
|
4503
4506
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4507
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4504
4508
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4505
4509
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4506
4510
|
custom: "custom";
|
|
@@ -4532,6 +4536,7 @@ declare const RevTurbineConfigPlacementPayloadItemSchema: z.ZodObject<{
|
|
|
4532
4536
|
}, z.core.$strip>>;
|
|
4533
4537
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4534
4538
|
}, z.core.$strip>>;
|
|
4539
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4535
4540
|
created_at: z.ZodString;
|
|
4536
4541
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
4537
4542
|
source_mode: z.ZodEnum<{
|
|
@@ -4811,6 +4816,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
4811
4816
|
}, z.core.$strip>>;
|
|
4812
4817
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4813
4818
|
}, z.core.$strip>>;
|
|
4819
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4814
4820
|
created_at: z.ZodString;
|
|
4815
4821
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
4816
4822
|
source_mode: z.ZodEnum<{
|
|
@@ -4950,6 +4956,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
4950
4956
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
4951
4957
|
}, z.core.$strip>>;
|
|
4952
4958
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4959
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4953
4960
|
created_at: z.ZodOptional<z.ZodString>;
|
|
4954
4961
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
4955
4962
|
custom: "custom";
|
|
@@ -5149,6 +5156,7 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
5149
5156
|
}, z.core.$strip>;
|
|
5150
5157
|
}, z.core.$strip>>>;
|
|
5151
5158
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5159
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5152
5160
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
5153
5161
|
off: "off";
|
|
5154
5162
|
test_users: "test_users";
|
|
@@ -5164,7 +5172,6 @@ declare const PlaybookBodySchema: z.ZodObject<{
|
|
|
5164
5172
|
}>>>;
|
|
5165
5173
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
5166
5174
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
5167
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
5168
5175
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
5169
5176
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5170
5177
|
}, z.core.$strip>>>;
|
|
@@ -5455,6 +5462,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5455
5462
|
}, z.core.$strip>>;
|
|
5456
5463
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
5457
5464
|
}, z.core.$strip>>;
|
|
5465
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5458
5466
|
created_at: z.ZodString;
|
|
5459
5467
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
5460
5468
|
source_mode: z.ZodEnum<{
|
|
@@ -5594,6 +5602,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5594
5602
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
5595
5603
|
}, z.core.$strip>>;
|
|
5596
5604
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5605
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5597
5606
|
created_at: z.ZodOptional<z.ZodString>;
|
|
5598
5607
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
5599
5608
|
custom: "custom";
|
|
@@ -5793,6 +5802,7 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5793
5802
|
}, z.core.$strip>;
|
|
5794
5803
|
}, z.core.$strip>>>;
|
|
5795
5804
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5805
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
5796
5806
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
5797
5807
|
off: "off";
|
|
5798
5808
|
test_users: "test_users";
|
|
@@ -5808,7 +5818,6 @@ declare const PlaybookObjectSchema: z.ZodObject<{
|
|
|
5808
5818
|
}>>>;
|
|
5809
5819
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
5810
5820
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
5811
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
5812
5821
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
5813
5822
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5814
5823
|
}, z.core.$strip>>>;
|
|
@@ -6086,6 +6095,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6086
6095
|
}, z.core.$strip>>;
|
|
6087
6096
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6088
6097
|
}, z.core.$strip>>;
|
|
6098
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6089
6099
|
created_at: z.ZodString;
|
|
6090
6100
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
6091
6101
|
source_mode: z.ZodEnum<{
|
|
@@ -6225,6 +6235,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6225
6235
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6226
6236
|
}, z.core.$strip>>;
|
|
6227
6237
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6238
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6228
6239
|
created_at: z.ZodOptional<z.ZodString>;
|
|
6229
6240
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6230
6241
|
custom: "custom";
|
|
@@ -6424,6 +6435,7 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6424
6435
|
}, z.core.$strip>;
|
|
6425
6436
|
}, z.core.$strip>>>;
|
|
6426
6437
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
6438
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
6427
6439
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
6428
6440
|
off: "off";
|
|
6429
6441
|
test_users: "test_users";
|
|
@@ -6439,7 +6451,6 @@ declare const PlaybookSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6439
6451
|
}>>>;
|
|
6440
6452
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
6441
6453
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
6442
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
6443
6454
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
6444
6455
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
6445
6456
|
}, z.core.$strip>>>;
|
|
@@ -6735,6 +6746,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6735
6746
|
}, z.core.$strip>>;
|
|
6736
6747
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6737
6748
|
}, z.core.$strip>>;
|
|
6749
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6738
6750
|
created_at: z.ZodString;
|
|
6739
6751
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
6740
6752
|
source_mode: z.ZodEnum<{
|
|
@@ -6874,6 +6886,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
6874
6886
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
6875
6887
|
}, z.core.$strip>>;
|
|
6876
6888
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6889
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6877
6890
|
created_at: z.ZodOptional<z.ZodString>;
|
|
6878
6891
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6879
6892
|
custom: "custom";
|
|
@@ -7073,6 +7086,7 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7073
7086
|
}, z.core.$strip>;
|
|
7074
7087
|
}, z.core.$strip>>>;
|
|
7075
7088
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7089
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7076
7090
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
7077
7091
|
off: "off";
|
|
7078
7092
|
test_users: "test_users";
|
|
@@ -7088,7 +7102,6 @@ declare const PlaybookStrictSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7088
7102
|
}>>>;
|
|
7089
7103
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
7090
7104
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
7091
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
7092
7105
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
7093
7106
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7094
7107
|
}, z.core.$strip>>>;
|
|
@@ -7363,6 +7376,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7363
7376
|
}, z.core.$strip>>;
|
|
7364
7377
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
7365
7378
|
}, z.core.$strip>>;
|
|
7379
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7366
7380
|
created_at: z.ZodString;
|
|
7367
7381
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
7368
7382
|
source_mode: z.ZodEnum<{
|
|
@@ -7502,6 +7516,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7502
7516
|
cooldown_days: z.ZodOptional<z.ZodNumber>;
|
|
7503
7517
|
}, z.core.$strip>>;
|
|
7504
7518
|
surface_slot_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7519
|
+
remind_later_minutes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7505
7520
|
created_at: z.ZodOptional<z.ZodString>;
|
|
7506
7521
|
recommendation_strategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
7507
7522
|
custom: "custom";
|
|
@@ -7701,6 +7716,7 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7701
7716
|
}, z.core.$strip>;
|
|
7702
7717
|
}, z.core.$strip>>>;
|
|
7703
7718
|
sessionCooldownMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7719
|
+
remindLaterMinutes: z.ZodDefault<z.ZodNumber>;
|
|
7704
7720
|
testMode: z.ZodDefault<z.ZodEnum<{
|
|
7705
7721
|
off: "off";
|
|
7706
7722
|
test_users: "test_users";
|
|
@@ -7716,7 +7732,6 @@ declare const RevTurbineConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
7716
7732
|
}>>>;
|
|
7717
7733
|
suppress_for_paid: z.ZodDefault<z.ZodBoolean>;
|
|
7718
7734
|
suppress_for_trial: z.ZodDefault<z.ZodBoolean>;
|
|
7719
|
-
default_dismiss_cooldown_hours: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
7720
7735
|
allow_stacking: z.ZodDefault<z.ZodBoolean>;
|
|
7721
7736
|
priority_collision_strategy: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7722
7737
|
}, 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).
|
|
@@ -12472,6 +12522,13 @@ declare class RevTurbineCustomerSdk {
|
|
|
12472
12522
|
private readonly interactionQueue;
|
|
12473
12523
|
private readonly defaultDecisionTtlMs;
|
|
12474
12524
|
private readonly defaultDismissCooldownMs;
|
|
12525
|
+
/**
|
|
12526
|
+
* Default dismiss cooldown window — 7 days, matching the engine's
|
|
12527
|
+
* `cooldown_after_dismiss_days` default. Applied to `dismiss` and bare
|
|
12528
|
+
* `cta_clicked` when the payload supplies no explicit `cooldown_ms`
|
|
12529
|
+
* (plan 167 REQ-3 / Q-1). Replaces the legacy 24h dismiss window.
|
|
12530
|
+
*/
|
|
12531
|
+
private readonly dismissCooldownDefaultMs;
|
|
12475
12532
|
private readonly defaultRemindLaterMs;
|
|
12476
12533
|
private readonly defaultUsageWarningPercent;
|
|
12477
12534
|
private readonly defaultTrialExpiringDays;
|
|
@@ -12965,26 +13022,43 @@ declare class RevTurbineCustomerSdk {
|
|
|
12965
13022
|
*/
|
|
12966
13023
|
recordImpression(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata): Promise<void>;
|
|
12967
13024
|
/**
|
|
12968
|
-
* Record a placement dismissal — the user explicitly closed it.
|
|
12969
|
-
*
|
|
12970
|
-
* `
|
|
13025
|
+
* Record a placement dismissal — the user explicitly closed it ("No thanks").
|
|
13026
|
+
* Time-boxed: the placement is hidden for the dismiss cooldown
|
|
13027
|
+
* (`cooldown_after_dismiss_days`, default 7 days) and re-shows once it elapses
|
|
13028
|
+
* (plan 167). NOT permanent — for a confirmed conversion use
|
|
13029
|
+
* {@link recordConversion}.
|
|
13030
|
+
*
|
|
13031
|
+
* @param placementId - The placement's stable rule_id.
|
|
13032
|
+
* @param payloadId - Optional payload variant id.
|
|
13033
|
+
* @param surfaceTemplateId - Optional surface template id.
|
|
13034
|
+
* @param metadata - Optional metadata persisted with the record.
|
|
13035
|
+
* @param cooldownMs - Optional explicit cooldown window (ms). Defaults to 7 days.
|
|
13036
|
+
*/
|
|
13037
|
+
recordDismissal(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata, cooldownMs?: number): Promise<void>;
|
|
13038
|
+
/**
|
|
13039
|
+
* Record a bare placement click-through — the user clicked the CTA but did
|
|
13040
|
+
* not confirm the conversion (e.g. abandoned checkout). Time-boxed like a
|
|
13041
|
+
* dismiss; the placement may return (plan 167). For a confirmed conversion
|
|
13042
|
+
* use {@link recordConversion}.
|
|
12971
13043
|
*
|
|
12972
13044
|
* @param placementId - The placement's stable rule_id.
|
|
12973
13045
|
* @param payloadId - Optional payload variant id.
|
|
12974
13046
|
* @param surfaceTemplateId - Optional surface template id.
|
|
12975
13047
|
* @param metadata - Optional metadata persisted with the record.
|
|
13048
|
+
* @param cooldownMs - Optional explicit cooldown window (ms). Defaults to 7 days.
|
|
12976
13049
|
*/
|
|
12977
|
-
|
|
13050
|
+
recordClickThru(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata, cooldownMs?: number): Promise<void>;
|
|
12978
13051
|
/**
|
|
12979
|
-
* Record a
|
|
12980
|
-
*
|
|
13052
|
+
* Record a confirmed conversion — the user completed the CTA action. The
|
|
13053
|
+
* placement is **permanently** retired for this user; subsequent
|
|
13054
|
+
* `getPlacementDecision` calls return `visible: false` for good (plan 167).
|
|
12981
13055
|
*
|
|
12982
13056
|
* @param placementId - The placement's stable rule_id.
|
|
12983
13057
|
* @param payloadId - Optional payload variant id.
|
|
12984
13058
|
* @param surfaceTemplateId - Optional surface template id.
|
|
12985
13059
|
* @param metadata - Optional metadata persisted with the record.
|
|
12986
13060
|
*/
|
|
12987
|
-
|
|
13061
|
+
recordConversion(placementId: string, payloadId?: string, surfaceTemplateId?: string, metadata?: RevTurbineImpressionMetadata): Promise<void>;
|
|
12988
13062
|
getTrialStatus(): Promise<RevTurbineTrialContext>;
|
|
12989
13063
|
/**
|
|
12990
13064
|
* Derive and push the user's trial status from their {@link TrialInstance}
|