@revturbine/sdk 0.2.71 → 0.2.73
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 +77 -19
- package/dist/headless.js +2 -2
- package/dist/headless.js.map +1 -1
- package/dist/index.d.ts +93 -18
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/web-sdk/customer-side.d.ts +35 -0
- package/dist/types/web-sdk/customer-side.d.ts.map +1 -1
- package/dist/types/web-sdk/headless.d.ts +0 -1
- package/dist/types/web-sdk/headless.d.ts.map +1 -1
- package/dist/types/web-sdk/index.d.ts +1 -0
- package/dist/types/web-sdk/index.d.ts.map +1 -1
- package/dist/types/web-sdk/placements/PlacementRenderer.d.ts +1 -0
- package/dist/types/web-sdk/placements/PlacementRenderer.d.ts.map +1 -1
- package/dist/types/web-sdk/placements/install-builtins.d.ts +2 -0
- package/dist/types/web-sdk/placements/install-builtins.d.ts.map +1 -0
- package/dist/types/web-sdk/placements/registry.d.ts +20 -0
- package/dist/types/web-sdk/placements/registry.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -2152,6 +2152,9 @@ declare const ClientContextSchema: z.ZodObject<{
|
|
|
2152
2152
|
}>>>;
|
|
2153
2153
|
provider_subscription_id: z.ZodOptional<z.ZodString>;
|
|
2154
2154
|
}, z.core.$strip>>;
|
|
2155
|
+
plan: z.ZodOptional<z.ZodObject<{
|
|
2156
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
2157
|
+
}, z.core.$strip>>;
|
|
2155
2158
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
2156
2159
|
can_upgrade: z.ZodOptional<z.ZodBoolean>;
|
|
2157
2160
|
can_manage_billing: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2995,6 +2998,7 @@ declare const SdkMetaEventTypeSchema: z.ZodEnum<{
|
|
|
2995
2998
|
sdk_init: "sdk_init";
|
|
2996
2999
|
sdk_error: "sdk_error";
|
|
2997
3000
|
sdk_validation_warning: "sdk_validation_warning";
|
|
3001
|
+
resolution_failure: "resolution_failure";
|
|
2998
3002
|
}>;
|
|
2999
3003
|
declare const SdkConfigShapeSchema: z.ZodObject<{
|
|
3000
3004
|
plans: z.ZodNumber;
|
|
@@ -3011,6 +3015,7 @@ declare const SdkMetaEventSchema: z.ZodObject<{
|
|
|
3011
3015
|
sdk_init: "sdk_init";
|
|
3012
3016
|
sdk_error: "sdk_error";
|
|
3013
3017
|
sdk_validation_warning: "sdk_validation_warning";
|
|
3018
|
+
resolution_failure: "resolution_failure";
|
|
3014
3019
|
}>;
|
|
3015
3020
|
occurred_at: z.ZodString;
|
|
3016
3021
|
request_id: z.ZodOptional<z.ZodString>;
|
|
@@ -3030,6 +3035,12 @@ declare const SdkMetaEventSchema: z.ZodObject<{
|
|
|
3030
3035
|
surface_templates: z.ZodNumber;
|
|
3031
3036
|
}, z.core.$strip>>;
|
|
3032
3037
|
message: z.ZodOptional<z.ZodString>;
|
|
3038
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
3039
|
+
placement_handle: z.ZodOptional<z.ZodString>;
|
|
3040
|
+
slot_handle: z.ZodOptional<z.ZodString>;
|
|
3041
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
3042
|
+
plan_handle: z.ZodOptional<z.ZodString>;
|
|
3043
|
+
entitlement_handle: z.ZodOptional<z.ZodString>;
|
|
3033
3044
|
}, z.core.$strip>;
|
|
3034
3045
|
declare const SdkMetaIngestBatchSchema: z.ZodObject<{
|
|
3035
3046
|
events: z.ZodArray<z.ZodObject<{
|
|
@@ -3037,6 +3048,7 @@ declare const SdkMetaIngestBatchSchema: z.ZodObject<{
|
|
|
3037
3048
|
sdk_init: "sdk_init";
|
|
3038
3049
|
sdk_error: "sdk_error";
|
|
3039
3050
|
sdk_validation_warning: "sdk_validation_warning";
|
|
3051
|
+
resolution_failure: "resolution_failure";
|
|
3040
3052
|
}>;
|
|
3041
3053
|
occurred_at: z.ZodString;
|
|
3042
3054
|
request_id: z.ZodOptional<z.ZodString>;
|
|
@@ -3056,6 +3068,12 @@ declare const SdkMetaIngestBatchSchema: z.ZodObject<{
|
|
|
3056
3068
|
surface_templates: z.ZodNumber;
|
|
3057
3069
|
}, z.core.$strip>>;
|
|
3058
3070
|
message: z.ZodOptional<z.ZodString>;
|
|
3071
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
3072
|
+
placement_handle: z.ZodOptional<z.ZodString>;
|
|
3073
|
+
slot_handle: z.ZodOptional<z.ZodString>;
|
|
3074
|
+
surface: z.ZodOptional<z.ZodString>;
|
|
3075
|
+
plan_handle: z.ZodOptional<z.ZodString>;
|
|
3076
|
+
entitlement_handle: z.ZodOptional<z.ZodString>;
|
|
3059
3077
|
}, z.core.$strip>>;
|
|
3060
3078
|
}, z.core.$strip>;
|
|
3061
3079
|
declare const eventPaths: ZodOpenApiPathsObject;
|
|
@@ -11413,6 +11431,10 @@ declare function parseUiPath(raw: Record<string, unknown>): PlacementUiPath;
|
|
|
11413
11431
|
declare function parsePromotion(raw?: Record<string, unknown>): PlacementPromotion | undefined;
|
|
11414
11432
|
/**
|
|
11415
11433
|
* Get or create the default global placement type registry.
|
|
11434
|
+
*
|
|
11435
|
+
* On the React entry the registry comes pre-seeded with the built-in slot
|
|
11436
|
+
* types; on the headless entry it starts empty (headless consumers register
|
|
11437
|
+
* their own types via {@link PlacementTypeRegistry.register}).
|
|
11416
11438
|
*/
|
|
11417
11439
|
declare function getDefaultRegistry(): PlacementTypeRegistry;
|
|
11418
11440
|
/**
|
|
@@ -12851,6 +12873,33 @@ declare class RevTurbineCustomerSdk {
|
|
|
12851
12873
|
private warnPiiRedactedOnce;
|
|
12852
12874
|
/** True when keyless anonymous telemetry should fire (REQ-4 conditions). */
|
|
12853
12875
|
private anonymousTelemetryActive;
|
|
12876
|
+
/**
|
|
12877
|
+
* Session-scoped dedup for `resolution_failure` diagnostics (plan 144 Q-4
|
|
12878
|
+
* disposition): one emit per `(reason, primary handle)` pair, capped per
|
|
12879
|
+
* session so a render loop can never flood the channel.
|
|
12880
|
+
*/
|
|
12881
|
+
private readonly emittedResolutionDiagnostics;
|
|
12882
|
+
private static readonly RESOLUTION_DIAGNOSTIC_SESSION_CAP;
|
|
12883
|
+
/**
|
|
12884
|
+
* Gate for `resolution_failure` diagnostics (plan 144 TASK-21). Honors BOTH
|
|
12885
|
+
* opt-outs (124 Q-6, decided 2026-08-12): either `anonymousTelemetry: false`
|
|
12886
|
+
* or `analytics: false` silences diagnostics — the most conservative
|
|
12887
|
+
* reading, so no privacy-minded install is surprised by a new emission.
|
|
12888
|
+
* Unlike {@link anonymousTelemetryActive} there is NO keyless requirement:
|
|
12889
|
+
* keyed production installs emit diagnostics too (124 Q-7). `previewMode`
|
|
12890
|
+
* (docs/playground renders) still suppresses, and the channel is
|
|
12891
|
+
* browser-only for now (server-side diagnostics are a named follow-up).
|
|
12892
|
+
*/
|
|
12893
|
+
private diagnosticTelemetryActive;
|
|
12894
|
+
/**
|
|
12895
|
+
* Emit one `resolution_failure` diagnostic (plan 144 TASK-21 — the plan-124
|
|
12896
|
+
* "silent failure" channel): a placement that resolved to the fallback, or
|
|
12897
|
+
* an entitlement denied for infrastructure reasons, becomes observable on
|
|
12898
|
+
* the keyless meta channel. Field values are author-defined handles and
|
|
12899
|
+
* closed reason codes only (TASK-20 allow-list); deduped per
|
|
12900
|
+
* `(reason, primary handle)` for the session and capped.
|
|
12901
|
+
*/
|
|
12902
|
+
private emitResolutionFailure;
|
|
12854
12903
|
/** Fire the one anonymous `sdk_init` adoption beacon at startup. */
|
|
12855
12904
|
private emitSdkInitTelemetry;
|
|
12856
12905
|
/**
|
|
@@ -12864,6 +12913,14 @@ declare class RevTurbineCustomerSdk {
|
|
|
12864
12913
|
* non-throwing. Stamps SDK/schema versions + a one-way hashed config id.
|
|
12865
12914
|
*/
|
|
12866
12915
|
private emitAnonMeta;
|
|
12916
|
+
/**
|
|
12917
|
+
* Ungated build + POST of one allowlisted meta event — the shared tail of
|
|
12918
|
+
* {@link emitAnonMeta} (keyless adoption beacons, which stay gated on
|
|
12919
|
+
* keyless installs) and the `resolution_failure` diagnostics (plan 144
|
|
12920
|
+
* TASK-21), which are deliberately NOT keyless-only — keyed production
|
|
12921
|
+
* installs emit them too (plan 124 Q-7). Callers gate; this never throws.
|
|
12922
|
+
*/
|
|
12923
|
+
private postAnonMeta;
|
|
12867
12924
|
/** One-time info notice that keyless telemetry is active + how to disable it (REQ-8b). */
|
|
12868
12925
|
private showAnonTelemetryNoticeOnce;
|
|
12869
12926
|
private sendEvents;
|
|
@@ -15174,9 +15231,15 @@ interface components {
|
|
|
15174
15231
|
bundle_version?: components["schemas"]["Anon_e17de468dbc9_4"];
|
|
15175
15232
|
config_shape?: components["schemas"]["Anon_a070b8adf29f"];
|
|
15176
15233
|
message?: components["schemas"]["Anon_7e1c99abdd77_2"];
|
|
15234
|
+
reason?: components["schemas"]["Anon_e17de468dbc9_5"];
|
|
15235
|
+
placement_handle?: components["schemas"]["Anon_e17de468dbc9_6"];
|
|
15236
|
+
slot_handle?: components["schemas"]["Anon_e17de468dbc9_7"];
|
|
15237
|
+
surface?: components["schemas"]["Anon_e17de468dbc9_8"];
|
|
15238
|
+
plan_handle?: components["schemas"]["Anon_e17de468dbc9_9"];
|
|
15239
|
+
entitlement_handle?: components["schemas"]["Anon_e17de468dbc9_10"];
|
|
15177
15240
|
};
|
|
15178
15241
|
/** @enum {string} */
|
|
15179
|
-
SdkMetaEventType: "sdk_init" | "sdk_error" | "sdk_validation_warning";
|
|
15242
|
+
SdkMetaEventType: "sdk_init" | "sdk_error" | "sdk_validation_warning" | "resolution_failure";
|
|
15180
15243
|
SdkConfigShape: {
|
|
15181
15244
|
plans: components["schemas"]["Anon_274ba4ca49d5"];
|
|
15182
15245
|
entitlements: components["schemas"]["Anon_274ba4ca49d5_1"];
|
|
@@ -16007,6 +16070,18 @@ interface components {
|
|
|
16007
16070
|
Anon_274ba4ca49d5_7: number;
|
|
16008
16071
|
Anon_7e1c99abdd77_2: components["schemas"]["Anon_373775e26848_4"];
|
|
16009
16072
|
Anon_373775e26848_4: string;
|
|
16073
|
+
Anon_e17de468dbc9_5: components["schemas"]["Anon_520c691f88f7_5"];
|
|
16074
|
+
Anon_520c691f88f7_5: string;
|
|
16075
|
+
Anon_e17de468dbc9_6: components["schemas"]["Anon_520c691f88f7_6"];
|
|
16076
|
+
Anon_520c691f88f7_6: string;
|
|
16077
|
+
Anon_e17de468dbc9_7: components["schemas"]["Anon_520c691f88f7_7"];
|
|
16078
|
+
Anon_520c691f88f7_7: string;
|
|
16079
|
+
Anon_e17de468dbc9_8: components["schemas"]["Anon_520c691f88f7_8"];
|
|
16080
|
+
Anon_520c691f88f7_8: string;
|
|
16081
|
+
Anon_e17de468dbc9_9: components["schemas"]["Anon_520c691f88f7_9"];
|
|
16082
|
+
Anon_520c691f88f7_9: string;
|
|
16083
|
+
Anon_e17de468dbc9_10: components["schemas"]["Anon_520c691f88f7_10"];
|
|
16084
|
+
Anon_520c691f88f7_10: string;
|
|
16010
16085
|
Anon_761f976a1da1_2: string;
|
|
16011
16086
|
Anon_57796118d046_19: string;
|
|
16012
16087
|
Anon_4e04ec5cc4e6_4: components["schemas"]["Anon_9ac136edb99a_9"];
|
|
@@ -20961,23 +21036,6 @@ interface PostHogIntegrationOptions extends PostHogAnalyticsProviderOptions {
|
|
|
20961
21036
|
*/
|
|
20962
21037
|
declare function createPostHogIntegration(options: PostHogIntegrationOptions): EventConsumerProvider;
|
|
20963
21038
|
|
|
20964
|
-
/**
|
|
20965
|
-
* Register all built-in slot types on the given registry.
|
|
20966
|
-
*
|
|
20967
|
-
* Built-in types cover the core surface types:
|
|
20968
|
-
* - banner → BannerSlot (full-width top/bottom)
|
|
20969
|
-
* - modal → ModalSlot (overlay dialog, optional/blocking)
|
|
20970
|
-
* - in_page → InPageSlot (card/embed in page flow)
|
|
20971
|
-
* - toast → ToastSlot (ephemeral notification)
|
|
20972
|
-
* - button → ButtonSlot (nav bar / CTA button)
|
|
20973
|
-
* - full_page → FullPageSlot (dedicated managed page)
|
|
20974
|
-
* - email/sms/push → channel previews (static out-of-band mocks)
|
|
20975
|
-
*
|
|
20976
|
-
* Additional specialized types registered as in_page variants:
|
|
20977
|
-
* - quota_meter → QuotaMeterSlot (usage meter + upgrade CTA)
|
|
20978
|
-
*/
|
|
20979
|
-
declare function registerBuiltinSlotTypes(registry: PlacementTypeRegistry): void;
|
|
20980
|
-
|
|
20981
21039
|
/**
|
|
20982
21040
|
* Pre-defined surface template ID sets.
|
|
20983
21041
|
*
|
|
@@ -21546,6 +21604,23 @@ declare function registerBuiltinSnoozeResolver(snooze: (outputId: string, second
|
|
|
21546
21604
|
*/
|
|
21547
21605
|
declare function dispatchCtaClick(uiPath: PlacementUiPath, context: CtaResolverContext, resolvers: CtaResolverRegistry, fallback?: (uiPath: PlacementUiPath) => void): boolean;
|
|
21548
21606
|
|
|
21607
|
+
/**
|
|
21608
|
+
* Register all built-in slot types on the given registry.
|
|
21609
|
+
*
|
|
21610
|
+
* Built-in types cover the core surface types:
|
|
21611
|
+
* - banner → BannerSlot (full-width top/bottom)
|
|
21612
|
+
* - modal → ModalSlot (overlay dialog, optional/blocking)
|
|
21613
|
+
* - in_page → InPageSlot (card/embed in page flow)
|
|
21614
|
+
* - toast → ToastSlot (ephemeral notification)
|
|
21615
|
+
* - button → ButtonSlot (nav bar / CTA button)
|
|
21616
|
+
* - full_page → FullPageSlot (dedicated managed page)
|
|
21617
|
+
* - email/sms/push → channel previews (static out-of-band mocks)
|
|
21618
|
+
*
|
|
21619
|
+
* Additional specialized types registered as in_page variants:
|
|
21620
|
+
* - quota_meter → QuotaMeterSlot (usage meter + upgrade CTA)
|
|
21621
|
+
*/
|
|
21622
|
+
declare function registerBuiltinSlotTypes(registry: PlacementTypeRegistry): void;
|
|
21623
|
+
|
|
21549
21624
|
/**
|
|
21550
21625
|
* Props for {@link BannerSlot}.
|
|
21551
21626
|
* Extends {@link PlacementSlotProps} with banner-specific options.
|