@tinkerlandai/indiana-sdk 0.8.0 → 0.8.3

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 (53) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +67 -20
  3. package/README.zh-CN.md +66 -19
  4. package/dist/ai-usage-BV-FlgWr.d.ts +247 -0
  5. package/dist/{ai-usage-Bigjb8MS.d.ts → api-B3FIE41b.d.ts} +554 -423
  6. package/dist/chunk-2QPETWDX.js +1 -0
  7. package/dist/chunk-ANOOBDW5.js +350 -0
  8. package/dist/chunk-BNU6IG3F.js +1 -0
  9. package/dist/chunk-GRLMT5PR.js +1 -0
  10. package/dist/chunk-LMR2TM3X.js +1 -0
  11. package/dist/chunk-OBYJWIRB.js +1 -0
  12. package/dist/{chunk-G2R56FKU.js → chunk-SHSNIJJM.js} +1 -1
  13. package/dist/{chunk-OVMNCZYC.js → chunk-SOQO2RDZ.js} +1 -1
  14. package/dist/chunk-VVV3JNS3.js +1 -0
  15. package/dist/{chunk-YAFMBXIE.js → chunk-X747SY26.js} +1 -1
  16. package/dist/chunk-Y32NPIYY.js +1 -0
  17. package/dist/chunk-ZT66RIFU.js +10 -0
  18. package/dist/{configuration-sync-VFbY1pCN.d.ts → configuration-sync-DNvKXHk-.d.ts} +25 -25
  19. package/dist/{content-K2HCZVC2.js → content-J3FKZTGT.js} +1 -1
  20. package/dist/{errors-BpCmukJr.d.ts → errors-C8lRYZ0n.d.ts} +49 -2
  21. package/dist/{funnel-runtime-start-DKcTCRrd.d.ts → funnel-local-client-wbz-4gFx.d.ts} +701 -6055
  22. package/dist/funnel-runtime-host-C5P5JTV3.js +1 -0
  23. package/dist/index.d.ts +1831 -1901
  24. package/dist/index.js +1 -1
  25. package/dist/native-shell.js +1 -1
  26. package/dist/openrouter.d.ts +4 -3
  27. package/dist/openrouter.js +1 -1
  28. package/dist/page.d.ts +7 -7
  29. package/dist/page.js +1 -1
  30. package/dist/paywall-3GIRKSHN.js +1 -0
  31. package/dist/popup.d.ts +2 -2
  32. package/dist/popup.js +1 -1
  33. package/dist/react-native.d.ts +97 -4
  34. package/dist/react-native.js +1 -1
  35. package/dist/screen-renderer-5FPYVSPW.js +1 -0
  36. package/dist/server.d.ts +4648 -8
  37. package/dist/server.js +1 -1
  38. package/dist/src-BMJCIMIF.js +1 -0
  39. package/dist/visual.js +1 -1
  40. package/package.json +3 -3
  41. package/dist/chunk-2A6UYUFA.js +0 -1
  42. package/dist/chunk-3BQFJANQ.js +0 -1
  43. package/dist/chunk-3ENVRJE6.js +0 -350
  44. package/dist/chunk-A3N4ZZTM.js +0 -7
  45. package/dist/chunk-AE4CUTUE.js +0 -1
  46. package/dist/chunk-CXYOZSOF.js +0 -1
  47. package/dist/funnel-runtime-host-HNZ47TZW.js +0 -1
  48. package/dist/paywall-PD62B2AY.js +0 -1
  49. package/dist/src-4MRSESVS.js +0 -1
  50. package/dist/{chunk-6X42DWOM.js → chunk-DSPLGTQI.js} +0 -0
  51. package/dist/{chunk-S5TVMQRC.js → chunk-EXCPE2XH.js} +0 -0
  52. package/dist/{customer-page-BrCZxcaQ.d.ts → customer-page-WUQVK_tp.d.ts} +4 -4
  53. package/dist/{screen-BazUOjwM.d.ts → screen-BpAejkn0.d.ts} +267 -267
package/dist/server.d.ts CHANGED
@@ -1,9 +1,4649 @@
1
- export { I as IndianaError } from './errors-BpCmukJr.js';
2
- import 'zod';
3
- export { f as AiPricingOptions, d as AiTokenQuote, b as AiTokenUsage, a as AiUsageContext, g as AiUsageMiddlewareOptions, h as AiUsageRecord, i as aiPriceSnapshotSchema, j as aiTokenQuoteSchema, c as createAiPricing, k as createAiUsageMiddleware, l as createConfiguredAiPricing } from './ai-usage-Bigjb8MS.js';
4
- import './screen-BazUOjwM.js';
5
- export { k as FeatureClient, h as FeatureClientOptions, u as FunnelDecisionInput, v as FunnelDecisionTimeoutError, w as FunnelDecisionUsedInput, x as FunnelLocalEvaluation, y as FunnelLocalEvaluator, z as FunnelLocalEvaluatorOptions, A as FunnelLocalSession, B as FunnelLocalSessionOptions, l as FunnelNodeEvaluationContext, C as FunnelSignalInput, j as FunnelStartInput, D as IndianaServerOptions, L as LocalFunnelClient, n as LocalFunnelClientOptions, q as createFeatureClient, E as createFunnelCampaignClient, G as createFunnelDecisionClient, H as createFunnelLocalEvaluator, J as createFunnelOrchestrationClient, K as createFunnelStartClient, M as createGuestToken, N as createIndianaServer, r as createLocalFunnelClient, O as createNativeReceiptClient, Q as createPaywallStartClient, T as createSynchronizedFunnelLocalEvaluator, t as evaluateFunnelNode, U as renewFunnelRun } from './funnel-runtime-start-DKcTCRrd.js';
6
- export { C as ConfigurationSync, c as createConfigurationSync } from './configuration-sync-VFbY1pCN.js';
7
- import '@ai-sdk/provider';
1
+ import { F as FoundationApi, I as InvoiceModeParams } from './api-B3FIE41b.js';
2
+ import { u as IndianaServerOptions, v as FunnelLocalConfiguration, p as PaywallStartInput, g as PaywallSession, h as FeatureClientOptions, R as RemoteFeatureResult } from './funnel-local-client-wbz-4gFx.js';
3
+ export { k as FeatureClient, l as FunnelNodeEvaluationContext, j as FunnelStartInput, L as LocalFunnelClient, n as LocalFunnelClientOptions, q as createFeatureClient, w as createFunnelStartClient, r as createLocalFunnelClient, t as evaluateFunnelNode } from './funnel-local-client-wbz-4gFx.js';
4
+ import * as zod from 'zod';
5
+ import { z } from 'zod';
6
+ import { S as StackNode } from './screen-BpAejkn0.js';
7
+ import { C as ConfigurationSync } from './configuration-sync-DNvKXHk-.js';
8
+ export { c as createConfigurationSync } from './configuration-sync-DNvKXHk-.js';
9
+ import { J as JsonValue, E as EvaluationContext, s as stickyAssignmentDocumentSchema, F as FeatureResult } from './growth-rules-B4YYy64R.js';
10
+ import { I as IndianaError } from './errors-C8lRYZ0n.js';
11
+ export { d as AiPricingOptions, b as AiTokenQuote, a as AiTokenUsage, A as AiUsageContext, e as AiUsageMiddlewareOptions, f as AiUsageRecord, g as aiPriceSnapshotSchema, h as aiTokenQuoteSchema, c as createAiPricing, i as createAiUsageMiddleware, j as createConfiguredAiPricing } from './ai-usage-BV-FlgWr.js';
8
12
  import 'zod/v4';
9
- import './growth-rules-B4YYy64R.js';
13
+ import '@ai-sdk/provider';
14
+
15
+ declare const funnelDecisionSchema: z.ZodObject<{
16
+ requestId: z.ZodUUID;
17
+ decisionId: z.ZodUUID;
18
+ customerId: z.ZodUUID;
19
+ externalUserId: z.ZodNullable<z.ZodString>;
20
+ versionId: z.ZodUUID;
21
+ receiptId: z.ZodUUID;
22
+ value: z.ZodJSONSchema;
23
+ }, z.core.$strict>;
24
+ declare const funnelDecisionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
25
+ funnelId: z.ZodUUID;
26
+ requestId: z.ZodUUID;
27
+ customer: z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ type: z.ZodLiteral<"id">;
29
+ value: z.ZodUUID;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ type: z.ZodLiteral<"externalUserId">;
32
+ value: z.ZodString;
33
+ }, z.core.$strict>], "type">;
34
+ customerData: z.ZodOptional<z.ZodObject<{
35
+ name: z.ZodOptional<z.ZodString>;
36
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
37
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
39
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ }, z.core.$loose>>>;
41
+ fingerprint: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strict>>;
43
+ attributes: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
44
+ operation: z.ZodLiteral<"decide">;
45
+ }, z.core.$strict>, z.ZodObject<{
46
+ operation: z.ZodLiteral<"read_decision">;
47
+ decisionId: z.ZodUUID;
48
+ }, z.core.$strict>, z.ZodObject<{
49
+ operation: z.ZodLiteral<"evaluate_decision">;
50
+ decisionId: z.ZodUUID;
51
+ requestId: z.ZodUUID;
52
+ nodeId: z.ZodString;
53
+ visit: z.ZodNumber;
54
+ revision: z.ZodNumber;
55
+ receiptId: z.ZodUUID;
56
+ policyRevision: z.ZodNumber;
57
+ generation: z.ZodString;
58
+ result: z.ZodObject<{
59
+ port: z.ZodString;
60
+ value: z.ZodOptional<z.ZodJSONSchema>;
61
+ sticky: z.ZodArray<z.ZodObject<{
62
+ expected: z.ZodNullable<z.ZodObject<{
63
+ attributeName: z.ZodString;
64
+ attributeValue: z.ZodString;
65
+ assignments: z.ZodRecord<z.ZodString, z.ZodString>;
66
+ }, z.core.$strict>>;
67
+ next: z.ZodObject<{
68
+ attributeName: z.ZodString;
69
+ attributeValue: z.ZodString;
70
+ assignments: z.ZodRecord<z.ZodString, z.ZodString>;
71
+ }, z.core.$strict>;
72
+ }, z.core.$strict>>;
73
+ exposures: z.ZodArray<z.ZodJSONSchema>;
74
+ features: z.ZodArray<z.ZodJSONSchema>;
75
+ }, z.core.$strict>;
76
+ }, z.core.$strict>, z.ZodObject<{
77
+ operation: z.ZodLiteral<"feature_config">;
78
+ funnelId: z.ZodUUID;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ operation: z.ZodLiteral<"commit_decision_segment">;
81
+ decisionId: z.ZodUUID;
82
+ requestId: z.ZodUUID;
83
+ nodeId: z.ZodString;
84
+ visit: z.ZodNumber;
85
+ revision: z.ZodNumber;
86
+ policyRevision: z.ZodNumber;
87
+ generation: z.ZodString;
88
+ steps: z.ZodArray<z.ZodObject<{
89
+ nodeId: z.ZodString;
90
+ result: z.ZodObject<{
91
+ port: z.ZodString;
92
+ value: z.ZodOptional<z.ZodJSONSchema>;
93
+ sticky: z.ZodArray<z.ZodObject<{
94
+ expected: z.ZodNullable<z.ZodObject<{
95
+ attributeName: z.ZodString;
96
+ attributeValue: z.ZodString;
97
+ assignments: z.ZodRecord<z.ZodString, z.ZodString>;
98
+ }, z.core.$strict>>;
99
+ next: z.ZodObject<{
100
+ attributeName: z.ZodString;
101
+ attributeValue: z.ZodString;
102
+ assignments: z.ZodRecord<z.ZodString, z.ZodString>;
103
+ }, z.core.$strict>;
104
+ }, z.core.$strict>>;
105
+ exposures: z.ZodArray<z.ZodJSONSchema>;
106
+ features: z.ZodArray<z.ZodJSONSchema>;
107
+ }, z.core.$strict>;
108
+ }, z.core.$strict>>;
109
+ boundary: z.ZodOptional<z.ZodObject<{
110
+ nodeId: z.ZodString;
111
+ visit: z.ZodNumber;
112
+ }, z.core.$strict>>;
113
+ }, z.core.$strict>, z.ZodObject<{
114
+ operation: z.ZodLiteral<"segment_configuration">;
115
+ funnelId: z.ZodUUID;
116
+ versionId: z.ZodUUID;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ operation: z.ZodLiteral<"configuration">;
119
+ funnelId: z.ZodUUID;
120
+ versionId: z.ZodOptional<z.ZodUUID>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ operation: z.ZodLiteral<"local_configuration">;
123
+ funnelId: z.ZodUUID;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ operation: z.ZodLiteral<"report_used">;
126
+ decisionId: z.ZodUUID;
127
+ eventId: z.ZodUUID;
128
+ occurredAt: z.ZodISODateTime;
129
+ reference: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strict>], "operation">;
131
+ type FunnelDecision = z.infer<typeof funnelDecisionSchema>;
132
+ type FunnelDecisionCommand = z.infer<typeof funnelDecisionCommandSchema>;
133
+
134
+ /** One Funnel identity represents one merchant campaign, across its published Versions. */
135
+ declare const funnelCampaignCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
+ funnelId: z.ZodUUID;
137
+ requestId: z.ZodUUID;
138
+ customer: z.ZodDiscriminatedUnion<[z.ZodObject<{
139
+ type: z.ZodLiteral<"id">;
140
+ value: z.ZodUUID;
141
+ }, z.core.$strict>, z.ZodObject<{
142
+ type: z.ZodLiteral<"externalUserId">;
143
+ value: z.ZodString;
144
+ }, z.core.$strict>], "type">;
145
+ customerData: z.ZodOptional<z.ZodObject<{
146
+ name: z.ZodOptional<z.ZodString>;
147
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
148
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
149
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
150
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ }, z.core.$loose>>>;
152
+ fingerprint: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strict>>;
154
+ attributes: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
155
+ operation: z.ZodLiteral<"campaign_decide">;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ operation: z.ZodLiteral<"campaign_start">;
158
+ funnelId: z.ZodUUID;
159
+ requestId: z.ZodUUID;
160
+ customer: z.ZodDiscriminatedUnion<[z.ZodObject<{
161
+ type: z.ZodLiteral<"id">;
162
+ value: z.ZodUUID;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ type: z.ZodLiteral<"externalUserId">;
165
+ value: z.ZodString;
166
+ }, z.core.$strict>], "type">;
167
+ customerData: z.ZodOptional<z.ZodObject<{
168
+ name: z.ZodOptional<z.ZodString>;
169
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
170
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
171
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
172
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
173
+ }, z.core.$loose>>>;
174
+ fingerprint: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strict>>;
176
+ locale: z.ZodString;
177
+ parameters: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
178
+ cooldownSeconds: z.ZodNumber;
179
+ }, z.core.$strict>], "operation">;
180
+ type FunnelCampaignCommand = z.infer<typeof funnelCampaignCommandSchema>;
181
+
182
+ /** Current order recovery is independent of a Funnel run credential. The trusted backend supplies its API key. */
183
+ declare const nativeReceiptCommandSchema: z.ZodObject<{
184
+ operation: z.ZodLiteral<"native_receipt">;
185
+ requestId: z.ZodUUID;
186
+ customerToken: z.ZodString;
187
+ orderId: z.ZodUUID;
188
+ receiptId: z.ZodUUID;
189
+ nativeEvidence: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
190
+ provider: z.ZodLiteral<"apple">;
191
+ orderId: z.ZodUUID;
192
+ receiptId: z.ZodUUID;
193
+ signedTransaction: z.ZodString;
194
+ }, z.core.$strict>, z.ZodObject<{
195
+ provider: z.ZodLiteral<"google">;
196
+ orderId: z.ZodUUID;
197
+ receiptId: z.ZodUUID;
198
+ purchaseToken: z.ZodString;
199
+ }, z.core.$strict>], "provider">>;
200
+ }, z.core.$strict>;
201
+ type NativeReceiptCommand = z.infer<typeof nativeReceiptCommandSchema>;
202
+
203
+ declare const funnelOrchestrationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
204
+ operation: z.ZodLiteral<"signal">;
205
+ runId: z.ZodUUID;
206
+ nodeId: z.ZodString;
207
+ eventName: z.ZodString;
208
+ eventId: z.ZodUUID;
209
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
210
+ }, z.core.$strict>, z.ZodObject<{
211
+ operation: z.ZodLiteral<"read_results">;
212
+ runId: z.ZodUUID;
213
+ }, z.core.$strict>], "operation">;
214
+ type FunnelOrchestrationCommand = z.infer<typeof funnelOrchestrationCommandSchema>;
215
+
216
+ /** Server-Key facade: authorizes construction before assembling any domain API. */
217
+ declare function createIndianaServer(options: IndianaServerOptions): FoundationApi;
218
+
219
+ /** Generate on the trusted host and retain in its HttpOnly cookie; reuse for creation retries. */
220
+ declare function createGuestToken(): string;
221
+
222
+ /** Rotate short-lived browser access without starting or authorizing another run. */
223
+ declare function renewFunnelRun(options: IndianaServerOptions, input: {
224
+ runId: string;
225
+ customerId: string;
226
+ }): Promise<{
227
+ scope: {
228
+ projectId: string;
229
+ environment: "sandbox" | "live";
230
+ };
231
+ run: {
232
+ id: string;
233
+ source: {
234
+ type: "funnel";
235
+ id: string;
236
+ versionId: string;
237
+ };
238
+ revision: number;
239
+ visit: number;
240
+ nodeId: string;
241
+ nodeType: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
242
+ status: "failed" | "completed" | "running" | "closed" | "ineligible" | "waiting";
243
+ stopped: boolean;
244
+ canBack: boolean;
245
+ authenticated: boolean;
246
+ locale: string;
247
+ answers: Record<string, string | boolean | string[]>;
248
+ parameters: Record<string, zod.JSONType>;
249
+ variables: Record<string, zod.JSONType>;
250
+ output: zod.JSONType;
251
+ screen: {
252
+ content: {
253
+ type: "document";
254
+ document: {
255
+ kind: "screen";
256
+ schemaVersion: 4;
257
+ name: string;
258
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
259
+ presentation: {
260
+ type: "modal";
261
+ size: "sm" | "md" | "lg";
262
+ } | {
263
+ type: "sheet";
264
+ size: "sm" | "md" | "lg";
265
+ } | {
266
+ type: "fullscreen";
267
+ } | {
268
+ type: "inline";
269
+ };
270
+ theme: {
271
+ primary: string;
272
+ background: string;
273
+ text: string;
274
+ radius: "none" | "sm" | "md" | "lg" | "full";
275
+ font: "system" | "serif" | "rounded" | "mono";
276
+ };
277
+ pages: {
278
+ id: string;
279
+ name: string;
280
+ root: StackNode;
281
+ theme?: {
282
+ primary: string;
283
+ background: string;
284
+ text: string;
285
+ radius: "none" | "sm" | "md" | "lg" | "full";
286
+ font: "system" | "serif" | "rounded" | "mono";
287
+ } | undefined;
288
+ editorPosition?: {
289
+ x: number;
290
+ y: number;
291
+ } | undefined;
292
+ }[];
293
+ strings: {
294
+ defaultLocale: string;
295
+ locales: Record<string, Record<string, string>>;
296
+ };
297
+ actions: ({
298
+ type: "navigate";
299
+ close: false;
300
+ pageId: string;
301
+ id: string;
302
+ event: string;
303
+ properties: Record<string, string | number | boolean | null>;
304
+ } | {
305
+ type: "event";
306
+ close: boolean;
307
+ id: string;
308
+ event: string;
309
+ properties: Record<string, string | number | boolean | null>;
310
+ } | {
311
+ type: "close";
312
+ close: true;
313
+ id: string;
314
+ event: string;
315
+ properties: Record<string, string | number | boolean | null>;
316
+ } | {
317
+ type: "open_url";
318
+ close: boolean;
319
+ url: string;
320
+ id: string;
321
+ event: string;
322
+ properties: Record<string, string | number | boolean | null>;
323
+ } | {
324
+ type: "claim_offer";
325
+ close: boolean;
326
+ couponId: string;
327
+ id: string;
328
+ event: string;
329
+ properties: Record<string, string | number | boolean | null>;
330
+ })[];
331
+ initialPageId?: string | undefined;
332
+ };
333
+ };
334
+ id: string;
335
+ presentation: {
336
+ type: "modal";
337
+ size: "sm" | "md" | "lg";
338
+ } | {
339
+ type: "sheet";
340
+ size: "sm" | "md" | "lg";
341
+ } | {
342
+ type: "fullscreen";
343
+ } | {
344
+ type: "inline";
345
+ };
346
+ outputs: string[];
347
+ inputs: {
348
+ variable: string;
349
+ componentId: string;
350
+ required: boolean;
351
+ }[];
352
+ capabilities: {
353
+ nodes: Record<string, {
354
+ base: {
355
+ text?: string | undefined;
356
+ label?: string | undefined;
357
+ alt?: string | undefined;
358
+ html?: string | undefined;
359
+ price?: {
360
+ current: string;
361
+ original: string | null;
362
+ period: string;
363
+ } | undefined;
364
+ code?: string | undefined;
365
+ countdownAt?: string | undefined;
366
+ planId?: string | undefined;
367
+ planVersionId?: string | undefined;
368
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
369
+ couponId?: string | undefined;
370
+ offerId?: string | undefined;
371
+ unavailable?: boolean | undefined;
372
+ unavailableReason?: string | undefined;
373
+ missing?: string[] | undefined;
374
+ };
375
+ picker?: string | undefined;
376
+ byPlan?: Record<string, {
377
+ text?: string | undefined;
378
+ label?: string | undefined;
379
+ alt?: string | undefined;
380
+ html?: string | undefined;
381
+ price?: {
382
+ current: string;
383
+ original: string | null;
384
+ period: string;
385
+ } | undefined;
386
+ code?: string | undefined;
387
+ countdownAt?: string | undefined;
388
+ planId?: string | undefined;
389
+ planVersionId?: string | undefined;
390
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
391
+ couponId?: string | undefined;
392
+ offerId?: string | undefined;
393
+ unavailable?: boolean | undefined;
394
+ unavailableReason?: string | undefined;
395
+ missing?: string[] | undefined;
396
+ }> | undefined;
397
+ }>;
398
+ plans: Record<string, {
399
+ id: string;
400
+ versionId: string;
401
+ available: boolean;
402
+ name: string;
403
+ price: string;
404
+ period: string;
405
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
406
+ }>;
407
+ pickers: Record<string, {
408
+ options: string[];
409
+ selected: string | null;
410
+ }>;
411
+ diagnostics: {
412
+ nodeId: string;
413
+ message: string;
414
+ }[];
415
+ paywall?: {
416
+ internal_feature_id: string;
417
+ name: string;
418
+ kind: "metered" | "access" | "credit";
419
+ quantity: string;
420
+ allowed: boolean;
421
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
422
+ preview: {
423
+ scenario: "usage_limit" | "feature_flag";
424
+ candidates: {
425
+ productId: string;
426
+ productVersionId: string;
427
+ name: string;
428
+ action: "addon" | "upgrade" | "purchase" | "topup";
429
+ membershipId: string | null;
430
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
431
+ amountMinor: string;
432
+ interval: "free" | "month" | "year" | "week" | "one_time";
433
+ intervalCount: number;
434
+ }[];
435
+ } | null;
436
+ } | undefined;
437
+ };
438
+ customerData: {
439
+ nodes: Record<string, {
440
+ source: "membership" | "credit_balance" | "credit_transactions" | "billing" | "billing_controls" | "customer_plans" | "credit_packs" | "credit_pack_orders" | "offer_history";
441
+ status: "error" | "idle" | "loading" | "ready";
442
+ stale: boolean;
443
+ preview: boolean;
444
+ resources: {
445
+ key: string;
446
+ name: string;
447
+ spendable: string;
448
+ reserved: string;
449
+ available: string;
450
+ expiry: string | null;
451
+ sources: {
452
+ id: string;
453
+ label: string;
454
+ detail: string[];
455
+ facts: {
456
+ label: string;
457
+ value: string;
458
+ }[];
459
+ value?: string | undefined;
460
+ status?: string | undefined;
461
+ purchaseId?: string | undefined;
462
+ invoiceUrl?: string | undefined;
463
+ billingActions?: {
464
+ action: "invoice_open";
465
+ label: string;
466
+ }[] | undefined;
467
+ membershipActions?: {
468
+ value: string;
469
+ label: string;
470
+ }[] | undefined;
471
+ }[];
472
+ sourceCount: number;
473
+ sourcePage: number;
474
+ hasNextSources: boolean;
475
+ hasPreviousSources: boolean;
476
+ }[];
477
+ rows: {
478
+ id: string;
479
+ label: string;
480
+ detail: string[];
481
+ facts: {
482
+ label: string;
483
+ value: string;
484
+ }[];
485
+ value?: string | undefined;
486
+ status?: string | undefined;
487
+ purchaseId?: string | undefined;
488
+ invoiceUrl?: string | undefined;
489
+ billingActions?: {
490
+ action: "invoice_open";
491
+ label: string;
492
+ }[] | undefined;
493
+ membershipActions?: {
494
+ value: string;
495
+ label: string;
496
+ }[] | undefined;
497
+ }[];
498
+ hasNext: boolean;
499
+ hasPrevious: boolean;
500
+ page: number;
501
+ filter: string;
502
+ errorCode?: string | undefined;
503
+ errorMessage?: string | undefined;
504
+ updatedAt?: string | undefined;
505
+ buyingId?: string | undefined;
506
+ membershipBusy?: boolean | undefined;
507
+ billingBusy?: boolean | undefined;
508
+ membershipReview?: {
509
+ title: string;
510
+ note: string;
511
+ facts: {
512
+ label: string;
513
+ value: string;
514
+ }[];
515
+ } | undefined;
516
+ membershipResult?: string | undefined;
517
+ }>;
518
+ };
519
+ dataCursors: Record<string, {
520
+ kind: "ledger";
521
+ cursor: {
522
+ at: string;
523
+ id: string;
524
+ type: "source" | "usage" | "invoice" | "debt" | "transaction" | "settlement";
525
+ };
526
+ } | {
527
+ kind: "billing";
528
+ cursor: string;
529
+ } | null>;
530
+ values?: Record<string, zod.JSONType> | undefined;
531
+ offeringKey?: string | undefined;
532
+ } | null;
533
+ paywall: {
534
+ receiptId: string;
535
+ resolution: {
536
+ id: string;
537
+ paywallId: string;
538
+ version: number;
539
+ document: {
540
+ kind: "paywall";
541
+ name: string;
542
+ products: {
543
+ items: {
544
+ productVersionId: string;
545
+ label: string;
546
+ }[];
547
+ defaultProductVersionId: string | null;
548
+ grouping?: {
549
+ tiers: {
550
+ id: string;
551
+ name: string;
552
+ }[];
553
+ assignments: {
554
+ productVersionId: string;
555
+ tierId: string;
556
+ period: "month" | "year";
557
+ }[];
558
+ } | undefined;
559
+ };
560
+ presentation: {
561
+ type: "modal";
562
+ size: "sm" | "md" | "lg";
563
+ } | {
564
+ type: "sheet";
565
+ size: "sm" | "md" | "lg";
566
+ } | {
567
+ type: "fullscreen";
568
+ } | {
569
+ type: "inline";
570
+ };
571
+ screen: {
572
+ kind: "screen";
573
+ schemaVersion: 4;
574
+ name: string;
575
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
576
+ presentation: {
577
+ type: "modal";
578
+ size: "sm" | "md" | "lg";
579
+ } | {
580
+ type: "sheet";
581
+ size: "sm" | "md" | "lg";
582
+ } | {
583
+ type: "fullscreen";
584
+ } | {
585
+ type: "inline";
586
+ };
587
+ theme: {
588
+ primary: string;
589
+ background: string;
590
+ text: string;
591
+ radius: "none" | "sm" | "md" | "lg" | "full";
592
+ font: "system" | "serif" | "rounded" | "mono";
593
+ };
594
+ pages: {
595
+ id: string;
596
+ name: string;
597
+ root: StackNode;
598
+ theme?: {
599
+ primary: string;
600
+ background: string;
601
+ text: string;
602
+ radius: "none" | "sm" | "md" | "lg" | "full";
603
+ font: "system" | "serif" | "rounded" | "mono";
604
+ } | undefined;
605
+ editorPosition?: {
606
+ x: number;
607
+ y: number;
608
+ } | undefined;
609
+ }[];
610
+ strings: {
611
+ defaultLocale: string;
612
+ locales: Record<string, Record<string, string>>;
613
+ };
614
+ actions: ({
615
+ type: "navigate";
616
+ close: false;
617
+ pageId: string;
618
+ id: string;
619
+ event: string;
620
+ properties: Record<string, string | number | boolean | null>;
621
+ } | {
622
+ type: "event";
623
+ close: boolean;
624
+ id: string;
625
+ event: string;
626
+ properties: Record<string, string | number | boolean | null>;
627
+ } | {
628
+ type: "close";
629
+ close: true;
630
+ id: string;
631
+ event: string;
632
+ properties: Record<string, string | number | boolean | null>;
633
+ } | {
634
+ type: "open_url";
635
+ close: boolean;
636
+ url: string;
637
+ id: string;
638
+ event: string;
639
+ properties: Record<string, string | number | boolean | null>;
640
+ } | {
641
+ type: "claim_offer";
642
+ close: boolean;
643
+ couponId: string;
644
+ id: string;
645
+ event: string;
646
+ properties: Record<string, string | number | boolean | null>;
647
+ })[];
648
+ initialPageId?: string | undefined;
649
+ };
650
+ schemaVersion: 3;
651
+ offeringVersionId: string | null;
652
+ buttons: Record<string, {
653
+ type: "checkout";
654
+ product: {
655
+ type: "picker";
656
+ pickerId: string;
657
+ allowedProductVersionIds: string[];
658
+ } | {
659
+ type: "fixed";
660
+ productVersionId: string;
661
+ };
662
+ } | {
663
+ type: "close";
664
+ } | {
665
+ type: "action";
666
+ action: {
667
+ type: "event";
668
+ event: string;
669
+ } | {
670
+ type: "open_url";
671
+ url: string;
672
+ };
673
+ }>;
674
+ };
675
+ offering: {
676
+ id: string;
677
+ };
678
+ capabilities: {
679
+ nodes: Record<string, {
680
+ base: {
681
+ text?: string | undefined;
682
+ label?: string | undefined;
683
+ alt?: string | undefined;
684
+ html?: string | undefined;
685
+ price?: {
686
+ current: string;
687
+ original: string | null;
688
+ period: string;
689
+ } | undefined;
690
+ code?: string | undefined;
691
+ countdownAt?: string | undefined;
692
+ planId?: string | undefined;
693
+ planVersionId?: string | undefined;
694
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
695
+ couponId?: string | undefined;
696
+ offerId?: string | undefined;
697
+ unavailable?: boolean | undefined;
698
+ unavailableReason?: string | undefined;
699
+ missing?: string[] | undefined;
700
+ };
701
+ picker?: string | undefined;
702
+ byPlan?: Record<string, {
703
+ text?: string | undefined;
704
+ label?: string | undefined;
705
+ alt?: string | undefined;
706
+ html?: string | undefined;
707
+ price?: {
708
+ current: string;
709
+ original: string | null;
710
+ period: string;
711
+ } | undefined;
712
+ code?: string | undefined;
713
+ countdownAt?: string | undefined;
714
+ planId?: string | undefined;
715
+ planVersionId?: string | undefined;
716
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
717
+ couponId?: string | undefined;
718
+ offerId?: string | undefined;
719
+ unavailable?: boolean | undefined;
720
+ unavailableReason?: string | undefined;
721
+ missing?: string[] | undefined;
722
+ }> | undefined;
723
+ }>;
724
+ plans: Record<string, {
725
+ id: string;
726
+ versionId: string;
727
+ available: boolean;
728
+ name: string;
729
+ price: string;
730
+ period: string;
731
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
732
+ }>;
733
+ pickers: Record<string, {
734
+ options: string[];
735
+ selected: string | null;
736
+ }>;
737
+ diagnostics: {
738
+ nodeId: string;
739
+ message: string;
740
+ }[];
741
+ paywall?: {
742
+ internal_feature_id: string;
743
+ name: string;
744
+ kind: "metered" | "access" | "credit";
745
+ quantity: string;
746
+ allowed: boolean;
747
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
748
+ preview: {
749
+ scenario: "usage_limit" | "feature_flag";
750
+ candidates: {
751
+ productId: string;
752
+ productVersionId: string;
753
+ name: string;
754
+ action: "addon" | "upgrade" | "purchase" | "topup";
755
+ membershipId: string | null;
756
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
757
+ amountMinor: string;
758
+ interval: "free" | "month" | "year" | "week" | "one_time";
759
+ intervalCount: number;
760
+ }[];
761
+ } | null;
762
+ } | undefined;
763
+ };
764
+ check: {
765
+ internal_feature_id: string;
766
+ name: string;
767
+ kind: "metered" | "access" | "credit";
768
+ quantity: string;
769
+ allowed: boolean;
770
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
771
+ preview: {
772
+ scenario: "usage_limit" | "feature_flag";
773
+ candidates: {
774
+ productId: string;
775
+ productVersionId: string;
776
+ name: string;
777
+ action: "addon" | "upgrade" | "purchase" | "topup";
778
+ membershipId: string | null;
779
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
780
+ amountMinor: string;
781
+ interval: "free" | "month" | "year" | "week" | "one_time";
782
+ intervalCount: number;
783
+ }[];
784
+ } | null;
785
+ } | null;
786
+ content?: {
787
+ environmentId: string;
788
+ offeringVersionId: string;
789
+ artifact: {
790
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
791
+ formatVersion: number;
792
+ url: string;
793
+ sha256: string;
794
+ byteLength: number;
795
+ generation?: string | undefined;
796
+ };
797
+ } | undefined;
798
+ } | {
799
+ check: {
800
+ internal_feature_id: string;
801
+ name: string;
802
+ kind: "metered" | "access" | "credit";
803
+ quantity: string;
804
+ allowed: boolean;
805
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
806
+ preview: {
807
+ scenario: "usage_limit" | "feature_flag";
808
+ candidates: {
809
+ productId: string;
810
+ productVersionId: string;
811
+ name: string;
812
+ action: "addon" | "upgrade" | "purchase" | "topup";
813
+ membershipId: string | null;
814
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
815
+ amountMinor: string;
816
+ interval: "free" | "month" | "year" | "week" | "one_time";
817
+ intervalCount: number;
818
+ }[];
819
+ } | null;
820
+ } | null;
821
+ id: string;
822
+ version: number;
823
+ paywallId: string;
824
+ capabilities: {
825
+ nodes: Record<string, {
826
+ base: {
827
+ text?: string | undefined;
828
+ label?: string | undefined;
829
+ alt?: string | undefined;
830
+ html?: string | undefined;
831
+ price?: {
832
+ current: string;
833
+ original: string | null;
834
+ period: string;
835
+ } | undefined;
836
+ code?: string | undefined;
837
+ countdownAt?: string | undefined;
838
+ planId?: string | undefined;
839
+ planVersionId?: string | undefined;
840
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
841
+ couponId?: string | undefined;
842
+ offerId?: string | undefined;
843
+ unavailable?: boolean | undefined;
844
+ unavailableReason?: string | undefined;
845
+ missing?: string[] | undefined;
846
+ };
847
+ picker?: string | undefined;
848
+ byPlan?: Record<string, {
849
+ text?: string | undefined;
850
+ label?: string | undefined;
851
+ alt?: string | undefined;
852
+ html?: string | undefined;
853
+ price?: {
854
+ current: string;
855
+ original: string | null;
856
+ period: string;
857
+ } | undefined;
858
+ code?: string | undefined;
859
+ countdownAt?: string | undefined;
860
+ planId?: string | undefined;
861
+ planVersionId?: string | undefined;
862
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
863
+ couponId?: string | undefined;
864
+ offerId?: string | undefined;
865
+ unavailable?: boolean | undefined;
866
+ unavailableReason?: string | undefined;
867
+ missing?: string[] | undefined;
868
+ }> | undefined;
869
+ }>;
870
+ plans: Record<string, {
871
+ id: string;
872
+ versionId: string;
873
+ available: boolean;
874
+ name: string;
875
+ price: string;
876
+ period: string;
877
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
878
+ }>;
879
+ pickers: Record<string, {
880
+ options: string[];
881
+ selected: string | null;
882
+ }>;
883
+ diagnostics: {
884
+ nodeId: string;
885
+ message: string;
886
+ }[];
887
+ paywall?: {
888
+ internal_feature_id: string;
889
+ name: string;
890
+ kind: "metered" | "access" | "credit";
891
+ quantity: string;
892
+ allowed: boolean;
893
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
894
+ preview: {
895
+ scenario: "usage_limit" | "feature_flag";
896
+ candidates: {
897
+ productId: string;
898
+ productVersionId: string;
899
+ name: string;
900
+ action: "addon" | "upgrade" | "purchase" | "topup";
901
+ membershipId: string | null;
902
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
903
+ amountMinor: string;
904
+ interval: "free" | "month" | "year" | "week" | "one_time";
905
+ intervalCount: number;
906
+ }[];
907
+ } | null;
908
+ } | undefined;
909
+ };
910
+ content: {
911
+ environmentId: string;
912
+ offeringVersionId: string;
913
+ artifact: {
914
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
915
+ formatVersion: number;
916
+ url: string;
917
+ sha256: string;
918
+ byteLength: number;
919
+ generation?: string | undefined;
920
+ };
921
+ };
922
+ };
923
+ quote: {
924
+ operationId: string;
925
+ entityId: string | null;
926
+ billingSubscriptionId: string | null;
927
+ discount: {
928
+ offerId: string;
929
+ couponId: string;
930
+ discount: {
931
+ type: "percent";
932
+ percentOff: number;
933
+ } | {
934
+ type: "amount";
935
+ amountOffCents: number;
936
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
937
+ };
938
+ duration: {
939
+ type: "once";
940
+ } | {
941
+ type: "repeating";
942
+ months: number;
943
+ } | {
944
+ type: "forever";
945
+ };
946
+ amountMinor: number;
947
+ allocations: {
948
+ productVersionId: string;
949
+ amountMinor: number;
950
+ }[];
951
+ expiresAt: string;
952
+ } | null;
953
+ charge: {
954
+ effectiveAt: string;
955
+ periodEndsAt: string;
956
+ debitMinor: number;
957
+ discountMinor: number;
958
+ taxMinor: number;
959
+ totalMinor: number;
960
+ } | null;
961
+ expiresAt: string;
962
+ provider: "apple" | "google" | "stripe";
963
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
964
+ lines: {
965
+ lineId: string;
966
+ productVersionId: string;
967
+ productName: string;
968
+ interval: "free" | "month" | "year" | "week" | "one_time";
969
+ baseAmountMinor: number;
970
+ seats: {
971
+ key: string;
972
+ quantity: number;
973
+ includedQuantity: number;
974
+ maximumQuantity: number;
975
+ unitAmountMinor: number;
976
+ }[];
977
+ catalogAmountMinor: number;
978
+ trial: {
979
+ days: number;
980
+ cardRequired: boolean;
981
+ } | null;
982
+ intervalCount?: number | undefined;
983
+ prepaid?: {
984
+ itemKey: string;
985
+ internal_feature_id: string;
986
+ includedAmount: string;
987
+ quantity: number;
988
+ terms: {
989
+ units: string;
990
+ prices: {
991
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
992
+ amountMinor: number;
993
+ pricing?: {
994
+ kind: "graduated" | "volume";
995
+ tiers: {
996
+ upTo: number | null;
997
+ unitAmountMinor: number;
998
+ flatAmountMinor?: number | undefined;
999
+ }[];
1000
+ } | undefined;
1001
+ }[];
1002
+ minimumQuantity: number;
1003
+ maximumQuantity: number;
1004
+ };
1005
+ unitAmountMinor: number;
1006
+ productId: string | null;
1007
+ priceId: string | null;
1008
+ pricing?: {
1009
+ kind: "graduated" | "volume";
1010
+ tiers: {
1011
+ upTo: number | null;
1012
+ unitAmountMinor: number;
1013
+ flatAmountMinor?: number | undefined;
1014
+ }[];
1015
+ } | undefined;
1016
+ }[] | undefined;
1017
+ }[];
1018
+ catalogAmountMinor: number;
1019
+ automaticTax: boolean;
1020
+ execution: {
1021
+ provider: "stripe";
1022
+ executor: "merchant" | "indiana";
1023
+ accountId: string;
1024
+ mode: "subscription" | "payment";
1025
+ lineItems: {
1026
+ price: string | null;
1027
+ quantity: number;
1028
+ priceId: string;
1029
+ productName: string;
1030
+ amountMinor: number;
1031
+ currency: string;
1032
+ interval: "month" | "year" | "one_off" | "week";
1033
+ intervalCount: number;
1034
+ slot: "stripe_price_id" | "stripe_empty_price_id";
1035
+ tiers: {
1036
+ mode: "graduated" | "volume";
1037
+ tiers: {
1038
+ upTo: number | null;
1039
+ unitAmountMinor: number;
1040
+ flatAmountMinor?: number | undefined;
1041
+ }[];
1042
+ } | null;
1043
+ }[];
1044
+ discounts: {
1045
+ coupon: string;
1046
+ terms: {
1047
+ id: string;
1048
+ name: string;
1049
+ duration: "forever" | "once" | "repeating";
1050
+ percent_off?: number | undefined;
1051
+ amount_off?: number | undefined;
1052
+ currency?: string | undefined;
1053
+ duration_in_months?: number | undefined;
1054
+ };
1055
+ }[];
1056
+ trialPeriodDays: number | null;
1057
+ metadata: {
1058
+ grooveCheckoutId: string;
1059
+ grooveCustomerId: string;
1060
+ };
1061
+ expiresAt: string;
1062
+ invoiceMode?: InvoiceModeParams | undefined;
1063
+ append?: {
1064
+ subscriptionId: string;
1065
+ customerId: string;
1066
+ sourceItems: {
1067
+ id: string;
1068
+ price_id: string;
1069
+ quantity: number;
1070
+ discounts?: {
1071
+ id: string;
1072
+ coupon: string;
1073
+ start: number;
1074
+ end: number | null;
1075
+ }[] | undefined;
1076
+ }[];
1077
+ prorationDate: number;
1078
+ amountMinor: number;
1079
+ periodStartMs: number;
1080
+ periodEndMs: number;
1081
+ } | undefined;
1082
+ } | null;
1083
+ nativeOffer?: {
1084
+ offerKind: "none" | "introductory" | "promotional";
1085
+ offerId: string | null;
1086
+ discountMinor: number;
1087
+ trialDays: number | null;
1088
+ } | undefined;
1089
+ } | null;
1090
+ operation: {
1091
+ operationId: string;
1092
+ orderId: string;
1093
+ status: "pending" | "failed" | "complete" | "cancelled";
1094
+ executor: "merchant" | "indiana";
1095
+ checkoutUrl: string | null;
1096
+ execution: {
1097
+ provider: "stripe";
1098
+ executor: "merchant" | "indiana";
1099
+ accountId: string;
1100
+ mode: "subscription" | "payment";
1101
+ lineItems: {
1102
+ price: string | null;
1103
+ quantity: number;
1104
+ priceId: string;
1105
+ productName: string;
1106
+ amountMinor: number;
1107
+ currency: string;
1108
+ interval: "month" | "year" | "one_off" | "week";
1109
+ intervalCount: number;
1110
+ slot: "stripe_price_id" | "stripe_empty_price_id";
1111
+ tiers: {
1112
+ mode: "graduated" | "volume";
1113
+ tiers: {
1114
+ upTo: number | null;
1115
+ unitAmountMinor: number;
1116
+ flatAmountMinor?: number | undefined;
1117
+ }[];
1118
+ } | null;
1119
+ }[];
1120
+ discounts: {
1121
+ coupon: string;
1122
+ terms: {
1123
+ id: string;
1124
+ name: string;
1125
+ duration: "forever" | "once" | "repeating";
1126
+ percent_off?: number | undefined;
1127
+ amount_off?: number | undefined;
1128
+ currency?: string | undefined;
1129
+ duration_in_months?: number | undefined;
1130
+ };
1131
+ }[];
1132
+ trialPeriodDays: number | null;
1133
+ metadata: {
1134
+ grooveCheckoutId: string;
1135
+ grooveCustomerId: string;
1136
+ };
1137
+ expiresAt: string;
1138
+ invoiceMode?: InvoiceModeParams | undefined;
1139
+ append?: {
1140
+ subscriptionId: string;
1141
+ customerId: string;
1142
+ sourceItems: {
1143
+ id: string;
1144
+ price_id: string;
1145
+ quantity: number;
1146
+ discounts?: {
1147
+ id: string;
1148
+ coupon: string;
1149
+ start: number;
1150
+ end: number | null;
1151
+ }[] | undefined;
1152
+ }[];
1153
+ prorationDate: number;
1154
+ amountMinor: number;
1155
+ periodStartMs: number;
1156
+ periodEndMs: number;
1157
+ } | undefined;
1158
+ } | null;
1159
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1160
+ catalogAmountMinor: number;
1161
+ taxMinor: number;
1162
+ totalMinor: number | null;
1163
+ quoteFinalized: boolean;
1164
+ nativePurchase: {
1165
+ type: "native_purchase";
1166
+ receiptId: string;
1167
+ orderId: string;
1168
+ productVersionId: string;
1169
+ provider: "apple" | "google";
1170
+ productId: string;
1171
+ productKind: "membership" | "lifetime" | "credit_pack";
1172
+ replacement: {
1173
+ sourceOrderId: string;
1174
+ sourceProductId: string;
1175
+ policy: "apple_store" | "google_full_price";
1176
+ sourceAccountTokens: string[];
1177
+ } | null;
1178
+ offerKind: "none" | "introductory" | "promotional";
1179
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1180
+ catalogAmountMinor: number;
1181
+ discountMinor: number;
1182
+ trialDays: number | null;
1183
+ seatBundle: {
1184
+ key: string;
1185
+ quantity: number;
1186
+ }[];
1187
+ applePromotionalOffer: {
1188
+ offerId: string;
1189
+ keyId: string;
1190
+ nonce: string;
1191
+ signature: string;
1192
+ timestamp: number;
1193
+ } | null;
1194
+ appAccountToken?: string | undefined;
1195
+ obfuscatedAccountId?: string | undefined;
1196
+ obfuscatedProfileId?: string | undefined;
1197
+ basePlanId?: string | undefined;
1198
+ offerId?: string | undefined;
1199
+ } | null;
1200
+ append?: boolean | undefined;
1201
+ invoiceMode?: boolean | undefined;
1202
+ } | null;
1203
+ purchaseRequestId: string | null;
1204
+ selectionGeneration?: number | undefined;
1205
+ canReselect?: boolean | undefined;
1206
+ } | null;
1207
+ instruction: {
1208
+ environmentId: string;
1209
+ attributes: Record<string, zod.JSONType>;
1210
+ sticky: Record<string, {
1211
+ attributeName: string;
1212
+ attributeValue: string;
1213
+ assignments: Record<string, string>;
1214
+ }>;
1215
+ policyRevision: number;
1216
+ type: "evaluate_segment";
1217
+ } | {
1218
+ type: "wait";
1219
+ receiptId: string;
1220
+ kind: "operation" | "event" | "timer";
1221
+ deadline: string | null;
1222
+ eventName?: string | undefined;
1223
+ } | {
1224
+ type: "open_url";
1225
+ receiptId: string;
1226
+ url: string;
1227
+ openIn: "same_window" | "new_window";
1228
+ } | {
1229
+ type: "event";
1230
+ receiptId: string;
1231
+ event: string;
1232
+ } | null;
1233
+ pendingRequest: {
1234
+ requestId: string;
1235
+ authenticationRequired: boolean;
1236
+ } | null;
1237
+ runExpiresAt: string;
1238
+ credentialExpiresAt: string | null;
1239
+ };
1240
+ settlement?: {
1241
+ requestId: string;
1242
+ state: "unknown" | "pending" | "settled";
1243
+ operationId: string | null;
1244
+ receiptId?: string | null | undefined;
1245
+ } | undefined;
1246
+ purchase?: {
1247
+ receiptId: string;
1248
+ quote: {
1249
+ operationId: string;
1250
+ entityId: string | null;
1251
+ billingSubscriptionId: string | null;
1252
+ discount: {
1253
+ offerId: string;
1254
+ couponId: string;
1255
+ discount: {
1256
+ type: "percent";
1257
+ percentOff: number;
1258
+ } | {
1259
+ type: "amount";
1260
+ amountOffCents: number;
1261
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1262
+ };
1263
+ duration: {
1264
+ type: "once";
1265
+ } | {
1266
+ type: "repeating";
1267
+ months: number;
1268
+ } | {
1269
+ type: "forever";
1270
+ };
1271
+ amountMinor: number;
1272
+ allocations: {
1273
+ productVersionId: string;
1274
+ amountMinor: number;
1275
+ }[];
1276
+ expiresAt: string;
1277
+ } | null;
1278
+ charge: {
1279
+ effectiveAt: string;
1280
+ periodEndsAt: string;
1281
+ debitMinor: number;
1282
+ discountMinor: number;
1283
+ taxMinor: number;
1284
+ totalMinor: number;
1285
+ } | null;
1286
+ expiresAt: string;
1287
+ provider: "apple" | "google" | "stripe";
1288
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1289
+ lines: {
1290
+ lineId: string;
1291
+ productVersionId: string;
1292
+ productName: string;
1293
+ interval: "free" | "month" | "year" | "week" | "one_time";
1294
+ baseAmountMinor: number;
1295
+ seats: {
1296
+ key: string;
1297
+ quantity: number;
1298
+ includedQuantity: number;
1299
+ maximumQuantity: number;
1300
+ unitAmountMinor: number;
1301
+ }[];
1302
+ catalogAmountMinor: number;
1303
+ trial: {
1304
+ days: number;
1305
+ cardRequired: boolean;
1306
+ } | null;
1307
+ intervalCount?: number | undefined;
1308
+ prepaid?: {
1309
+ itemKey: string;
1310
+ internal_feature_id: string;
1311
+ includedAmount: string;
1312
+ quantity: number;
1313
+ terms: {
1314
+ units: string;
1315
+ prices: {
1316
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1317
+ amountMinor: number;
1318
+ pricing?: {
1319
+ kind: "graduated" | "volume";
1320
+ tiers: {
1321
+ upTo: number | null;
1322
+ unitAmountMinor: number;
1323
+ flatAmountMinor?: number | undefined;
1324
+ }[];
1325
+ } | undefined;
1326
+ }[];
1327
+ minimumQuantity: number;
1328
+ maximumQuantity: number;
1329
+ };
1330
+ unitAmountMinor: number;
1331
+ productId: string | null;
1332
+ priceId: string | null;
1333
+ pricing?: {
1334
+ kind: "graduated" | "volume";
1335
+ tiers: {
1336
+ upTo: number | null;
1337
+ unitAmountMinor: number;
1338
+ flatAmountMinor?: number | undefined;
1339
+ }[];
1340
+ } | undefined;
1341
+ }[] | undefined;
1342
+ }[];
1343
+ catalogAmountMinor: number;
1344
+ automaticTax: boolean;
1345
+ execution: {
1346
+ provider: "stripe";
1347
+ executor: "merchant" | "indiana";
1348
+ accountId: string;
1349
+ mode: "subscription" | "payment";
1350
+ lineItems: {
1351
+ price: string | null;
1352
+ quantity: number;
1353
+ priceId: string;
1354
+ productName: string;
1355
+ amountMinor: number;
1356
+ currency: string;
1357
+ interval: "month" | "year" | "one_off" | "week";
1358
+ intervalCount: number;
1359
+ slot: "stripe_price_id" | "stripe_empty_price_id";
1360
+ tiers: {
1361
+ mode: "graduated" | "volume";
1362
+ tiers: {
1363
+ upTo: number | null;
1364
+ unitAmountMinor: number;
1365
+ flatAmountMinor?: number | undefined;
1366
+ }[];
1367
+ } | null;
1368
+ }[];
1369
+ discounts: {
1370
+ coupon: string;
1371
+ terms: {
1372
+ id: string;
1373
+ name: string;
1374
+ duration: "forever" | "once" | "repeating";
1375
+ percent_off?: number | undefined;
1376
+ amount_off?: number | undefined;
1377
+ currency?: string | undefined;
1378
+ duration_in_months?: number | undefined;
1379
+ };
1380
+ }[];
1381
+ trialPeriodDays: number | null;
1382
+ metadata: {
1383
+ grooveCheckoutId: string;
1384
+ grooveCustomerId: string;
1385
+ };
1386
+ expiresAt: string;
1387
+ invoiceMode?: InvoiceModeParams | undefined;
1388
+ append?: {
1389
+ subscriptionId: string;
1390
+ customerId: string;
1391
+ sourceItems: {
1392
+ id: string;
1393
+ price_id: string;
1394
+ quantity: number;
1395
+ discounts?: {
1396
+ id: string;
1397
+ coupon: string;
1398
+ start: number;
1399
+ end: number | null;
1400
+ }[] | undefined;
1401
+ }[];
1402
+ prorationDate: number;
1403
+ amountMinor: number;
1404
+ periodStartMs: number;
1405
+ periodEndMs: number;
1406
+ } | undefined;
1407
+ } | null;
1408
+ nativeOffer?: {
1409
+ offerKind: "none" | "introductory" | "promotional";
1410
+ offerId: string | null;
1411
+ discountMinor: number;
1412
+ trialDays: number | null;
1413
+ } | undefined;
1414
+ } | null;
1415
+ operation: {
1416
+ operationId: string;
1417
+ orderId: string;
1418
+ status: "pending" | "failed" | "complete" | "cancelled";
1419
+ executor: "merchant" | "indiana";
1420
+ checkoutUrl: string | null;
1421
+ execution: {
1422
+ provider: "stripe";
1423
+ executor: "merchant" | "indiana";
1424
+ accountId: string;
1425
+ mode: "subscription" | "payment";
1426
+ lineItems: {
1427
+ price: string | null;
1428
+ quantity: number;
1429
+ priceId: string;
1430
+ productName: string;
1431
+ amountMinor: number;
1432
+ currency: string;
1433
+ interval: "month" | "year" | "one_off" | "week";
1434
+ intervalCount: number;
1435
+ slot: "stripe_price_id" | "stripe_empty_price_id";
1436
+ tiers: {
1437
+ mode: "graduated" | "volume";
1438
+ tiers: {
1439
+ upTo: number | null;
1440
+ unitAmountMinor: number;
1441
+ flatAmountMinor?: number | undefined;
1442
+ }[];
1443
+ } | null;
1444
+ }[];
1445
+ discounts: {
1446
+ coupon: string;
1447
+ terms: {
1448
+ id: string;
1449
+ name: string;
1450
+ duration: "forever" | "once" | "repeating";
1451
+ percent_off?: number | undefined;
1452
+ amount_off?: number | undefined;
1453
+ currency?: string | undefined;
1454
+ duration_in_months?: number | undefined;
1455
+ };
1456
+ }[];
1457
+ trialPeriodDays: number | null;
1458
+ metadata: {
1459
+ grooveCheckoutId: string;
1460
+ grooveCustomerId: string;
1461
+ };
1462
+ expiresAt: string;
1463
+ invoiceMode?: InvoiceModeParams | undefined;
1464
+ append?: {
1465
+ subscriptionId: string;
1466
+ customerId: string;
1467
+ sourceItems: {
1468
+ id: string;
1469
+ price_id: string;
1470
+ quantity: number;
1471
+ discounts?: {
1472
+ id: string;
1473
+ coupon: string;
1474
+ start: number;
1475
+ end: number | null;
1476
+ }[] | undefined;
1477
+ }[];
1478
+ prorationDate: number;
1479
+ amountMinor: number;
1480
+ periodStartMs: number;
1481
+ periodEndMs: number;
1482
+ } | undefined;
1483
+ } | null;
1484
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1485
+ catalogAmountMinor: number;
1486
+ taxMinor: number;
1487
+ totalMinor: number | null;
1488
+ quoteFinalized: boolean;
1489
+ nativePurchase: {
1490
+ type: "native_purchase";
1491
+ receiptId: string;
1492
+ orderId: string;
1493
+ productVersionId: string;
1494
+ provider: "apple" | "google";
1495
+ productId: string;
1496
+ productKind: "membership" | "lifetime" | "credit_pack";
1497
+ replacement: {
1498
+ sourceOrderId: string;
1499
+ sourceProductId: string;
1500
+ policy: "apple_store" | "google_full_price";
1501
+ sourceAccountTokens: string[];
1502
+ } | null;
1503
+ offerKind: "none" | "introductory" | "promotional";
1504
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1505
+ catalogAmountMinor: number;
1506
+ discountMinor: number;
1507
+ trialDays: number | null;
1508
+ seatBundle: {
1509
+ key: string;
1510
+ quantity: number;
1511
+ }[];
1512
+ applePromotionalOffer: {
1513
+ offerId: string;
1514
+ keyId: string;
1515
+ nonce: string;
1516
+ signature: string;
1517
+ timestamp: number;
1518
+ } | null;
1519
+ appAccountToken?: string | undefined;
1520
+ obfuscatedAccountId?: string | undefined;
1521
+ obfuscatedProfileId?: string | undefined;
1522
+ basePlanId?: string | undefined;
1523
+ offerId?: string | undefined;
1524
+ } | null;
1525
+ append?: boolean | undefined;
1526
+ invoiceMode?: boolean | undefined;
1527
+ } | null;
1528
+ canReselect?: boolean | undefined;
1529
+ } | undefined;
1530
+ review?: {
1531
+ activeOperationId: string | null;
1532
+ pages: {
1533
+ receiptId: string;
1534
+ nodeId: string;
1535
+ visit: number;
1536
+ }[];
1537
+ page: {
1538
+ receiptId: string;
1539
+ nodeId: string;
1540
+ visit: number;
1541
+ document: {
1542
+ kind: "screen";
1543
+ schemaVersion: 4;
1544
+ name: string;
1545
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
1546
+ presentation: {
1547
+ type: "modal";
1548
+ size: "sm" | "md" | "lg";
1549
+ } | {
1550
+ type: "sheet";
1551
+ size: "sm" | "md" | "lg";
1552
+ } | {
1553
+ type: "fullscreen";
1554
+ } | {
1555
+ type: "inline";
1556
+ };
1557
+ theme: {
1558
+ primary: string;
1559
+ background: string;
1560
+ text: string;
1561
+ radius: "none" | "sm" | "md" | "lg" | "full";
1562
+ font: "system" | "serif" | "rounded" | "mono";
1563
+ };
1564
+ pages: {
1565
+ id: string;
1566
+ name: string;
1567
+ root: StackNode;
1568
+ theme?: {
1569
+ primary: string;
1570
+ background: string;
1571
+ text: string;
1572
+ radius: "none" | "sm" | "md" | "lg" | "full";
1573
+ font: "system" | "serif" | "rounded" | "mono";
1574
+ } | undefined;
1575
+ editorPosition?: {
1576
+ x: number;
1577
+ y: number;
1578
+ } | undefined;
1579
+ }[];
1580
+ strings: {
1581
+ defaultLocale: string;
1582
+ locales: Record<string, Record<string, string>>;
1583
+ };
1584
+ actions: ({
1585
+ type: "navigate";
1586
+ close: false;
1587
+ pageId: string;
1588
+ id: string;
1589
+ event: string;
1590
+ properties: Record<string, string | number | boolean | null>;
1591
+ } | {
1592
+ type: "event";
1593
+ close: boolean;
1594
+ id: string;
1595
+ event: string;
1596
+ properties: Record<string, string | number | boolean | null>;
1597
+ } | {
1598
+ type: "close";
1599
+ close: true;
1600
+ id: string;
1601
+ event: string;
1602
+ properties: Record<string, string | number | boolean | null>;
1603
+ } | {
1604
+ type: "open_url";
1605
+ close: boolean;
1606
+ url: string;
1607
+ id: string;
1608
+ event: string;
1609
+ properties: Record<string, string | number | boolean | null>;
1610
+ } | {
1611
+ type: "claim_offer";
1612
+ close: boolean;
1613
+ couponId: string;
1614
+ id: string;
1615
+ event: string;
1616
+ properties: Record<string, string | number | boolean | null>;
1617
+ })[];
1618
+ initialPageId?: string | undefined;
1619
+ };
1620
+ answers: Record<string, string | boolean | string[]>;
1621
+ inputs: {
1622
+ variable: string;
1623
+ componentId: string;
1624
+ required: boolean;
1625
+ }[];
1626
+ values?: Record<string, zod.JSONType> | undefined;
1627
+ } | null;
1628
+ coupons: {
1629
+ grantId: string;
1630
+ status: "unknown" | "expired" | "issued" | "reserved" | "redeemed" | "revoked";
1631
+ expiresAt: string | null;
1632
+ }[];
1633
+ purchases: {
1634
+ receiptId: string;
1635
+ operationId: string;
1636
+ status: "unknown" | "pending" | "failed" | "complete" | "cancelled";
1637
+ }[];
1638
+ } | undefined;
1639
+ runToken?: string | undefined;
1640
+ customerId?: string | undefined;
1641
+ }>;
1642
+
1643
+ /** Advisory calculation metadata, never a committed Decision or permission to perform commerce. */
1644
+ type FunnelLocalEvaluation = {
1645
+ evaluationMode: "local";
1646
+ scope: FunnelLocalConfiguration["scope"];
1647
+ funnelId: string;
1648
+ versionId: string;
1649
+ evaluationRevision: number;
1650
+ generation: string;
1651
+ outcome: "completed" | "closed" | "ineligible" | "failed";
1652
+ value: JsonValue;
1653
+ };
1654
+ declare function prepareLocalFunnel(config: FunnelLocalConfiguration): {
1655
+ evaluate(input: {
1656
+ attributes: Record<string, JsonValue>;
1657
+ parameters: Record<string, JsonValue>;
1658
+ context: EvaluationContext;
1659
+ }): Pick<FunnelLocalEvaluation, "outcome" | "value">;
1660
+ };
1661
+
1662
+ type StickyDocument = z.infer<typeof stickyAssignmentDocumentSchema>;
1663
+ type FunnelLocalSessionOptions = {
1664
+ /** Bind this in-memory evaluation session to one caller identity/context snapshot. */
1665
+ attributes: Record<string, JsonValue>;
1666
+ parameters?: Record<string, JsonValue>;
1667
+ stickyBucketAssignmentDocs?: Record<string, StickyDocument>;
1668
+ /** Host storage must provide its own scoped merge/CAS for cross-process consistency. */
1669
+ saveStickyBucketAssignmentDoc?: (doc: StickyDocument) => void | Promise<void>;
1670
+ onFeatureUsage?: EvaluationContext["onFeatureUsage"];
1671
+ onExperimentViewed?: EvaluationContext["onExperimentViewed"];
1672
+ onError?: (error: unknown) => void;
1673
+ };
1674
+ type LocalFunnelSnapshot = {
1675
+ configuration: FunnelLocalConfiguration;
1676
+ program: ReturnType<typeof prepareLocalFunnel>;
1677
+ key: string;
1678
+ expiresAt: number;
1679
+ };
1680
+ declare function createLocalFunnelSession(options: FunnelLocalSessionOptions, load: () => Promise<LocalFunnelSnapshot>, assertCurrent: (snapshot?: LocalFunnelSnapshot) => void): {
1681
+ /** Pure calculation is untracked by default; explicitly track only a result the host uses. */
1682
+ evaluate(input?: {
1683
+ track?: boolean;
1684
+ }): Promise<FunnelLocalEvaluation>;
1685
+ /** Retry a failed host-storage write using the original assignment. */
1686
+ flush: () => Promise<void>;
1687
+ readonly stickyBucketAssignmentDocs: Record<string, {
1688
+ attributeName: string;
1689
+ attributeValue: string;
1690
+ assignments: Record<string, string>;
1691
+ }>;
1692
+ };
1693
+ type FunnelLocalSession = ReturnType<typeof createLocalFunnelSession>;
1694
+
1695
+ type FunnelLocalEvaluatorOptions = {
1696
+ assertUsable?: () => void;
1697
+ scope: LocalFunnelSnapshot["configuration"]["scope"];
1698
+ funnelId: string;
1699
+ load: () => Promise<unknown>;
1700
+ };
1701
+ /** Server-only Local policy execution. Configuration is shared; identity/Sticky/tracking never are. */
1702
+ declare function createFunnelLocalEvaluator(options: FunnelLocalEvaluatorOptions): {
1703
+ session(input: FunnelLocalSessionOptions): {
1704
+ evaluate(input?: {
1705
+ track?: boolean;
1706
+ }): Promise<FunnelLocalEvaluation>;
1707
+ flush: () => Promise<void>;
1708
+ readonly stickyBucketAssignmentDocs: Record<string, {
1709
+ attributeName: string;
1710
+ attributeValue: string;
1711
+ assignments: Record<string, string>;
1712
+ }>;
1713
+ };
1714
+ refresh(): Promise<{
1715
+ evaluationMode: "local";
1716
+ growth: {
1717
+ scope: {
1718
+ projectId: string;
1719
+ environment: "sandbox" | "live";
1720
+ };
1721
+ generation: string;
1722
+ evaluatedAt: string;
1723
+ expiresAt: string | null;
1724
+ features: Record<string, {
1725
+ defaultValue?: zod.JSONType | undefined;
1726
+ rules?: {
1727
+ id?: string | undefined;
1728
+ force?: zod.JSONType | undefined;
1729
+ variations?: zod.JSONType[] | undefined;
1730
+ key?: string | undefined;
1731
+ range?: [number, number] | undefined;
1732
+ tracks?: {
1733
+ experiment: {
1734
+ key: string;
1735
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
1736
+ urlPatterns?: {
1737
+ include: boolean;
1738
+ type: "regex" | "simple";
1739
+ pattern: string;
1740
+ }[] | undefined;
1741
+ force?: number | undefined;
1742
+ active?: boolean | undefined;
1743
+ persistQueryString?: boolean | undefined;
1744
+ condition?: Record<string, zod.JSONType> | undefined;
1745
+ parentConditions?: {
1746
+ id: string;
1747
+ condition: Record<string, zod.JSONType>;
1748
+ gate?: boolean | undefined;
1749
+ }[] | undefined;
1750
+ weights?: number[] | undefined;
1751
+ coverage?: number | undefined;
1752
+ hashAttribute?: string | undefined;
1753
+ fallbackAttribute?: string | undefined;
1754
+ hashVersion?: 2 | undefined;
1755
+ disableStickyBucketing?: boolean | undefined;
1756
+ bucketVersion?: number | undefined;
1757
+ minBucketVersion?: number | undefined;
1758
+ filters?: {
1759
+ seed: string;
1760
+ hashVersion: 2;
1761
+ ranges: [number, number][];
1762
+ attribute?: string | undefined;
1763
+ }[] | undefined;
1764
+ ranges?: [number, number][] | undefined;
1765
+ meta?: {
1766
+ key?: string | undefined;
1767
+ name?: string | undefined;
1768
+ passthrough?: boolean | undefined;
1769
+ }[] | undefined;
1770
+ seed?: string | undefined;
1771
+ name?: string | undefined;
1772
+ phase?: string | undefined;
1773
+ };
1774
+ result: {
1775
+ value: zod.JSONType;
1776
+ variationId: number;
1777
+ key: string;
1778
+ inExperiment: boolean;
1779
+ hashAttribute: string;
1780
+ hashValue: string;
1781
+ featureId: string | null;
1782
+ name?: string | undefined;
1783
+ bucket?: number | undefined;
1784
+ passthrough?: boolean | undefined;
1785
+ hashUsed?: boolean | undefined;
1786
+ stickyBucketUsed?: boolean | undefined;
1787
+ };
1788
+ }[] | undefined;
1789
+ condition?: Record<string, zod.JSONType> | undefined;
1790
+ parentConditions?: {
1791
+ id: string;
1792
+ condition: Record<string, zod.JSONType>;
1793
+ gate?: boolean | undefined;
1794
+ }[] | undefined;
1795
+ weights?: number[] | undefined;
1796
+ coverage?: number | undefined;
1797
+ hashAttribute?: string | undefined;
1798
+ fallbackAttribute?: string | undefined;
1799
+ hashVersion?: 2 | undefined;
1800
+ disableStickyBucketing?: boolean | undefined;
1801
+ bucketVersion?: number | undefined;
1802
+ minBucketVersion?: number | undefined;
1803
+ filters?: {
1804
+ seed: string;
1805
+ hashVersion: 2;
1806
+ ranges: [number, number][];
1807
+ attribute?: string | undefined;
1808
+ }[] | undefined;
1809
+ ranges?: [number, number][] | undefined;
1810
+ meta?: {
1811
+ key?: string | undefined;
1812
+ name?: string | undefined;
1813
+ passthrough?: boolean | undefined;
1814
+ }[] | undefined;
1815
+ seed?: string | undefined;
1816
+ name?: string | undefined;
1817
+ phase?: string | undefined;
1818
+ }[] | undefined;
1819
+ }>;
1820
+ savedGroups: Record<string, {
1821
+ type: "hashed";
1822
+ attributeKey: string;
1823
+ values: string[];
1824
+ } | {
1825
+ type: "list";
1826
+ attributeKey: string;
1827
+ values: (string | number)[];
1828
+ } | {
1829
+ type: "condition";
1830
+ condition: Record<string, zod.JSONType>;
1831
+ }>;
1832
+ experiments: Record<string, {
1833
+ key: string;
1834
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
1835
+ urlPatterns?: {
1836
+ include: boolean;
1837
+ type: "regex" | "simple";
1838
+ pattern: string;
1839
+ }[] | undefined;
1840
+ force?: number | undefined;
1841
+ active?: boolean | undefined;
1842
+ persistQueryString?: boolean | undefined;
1843
+ condition?: Record<string, zod.JSONType> | undefined;
1844
+ parentConditions?: {
1845
+ id: string;
1846
+ condition: Record<string, zod.JSONType>;
1847
+ gate?: boolean | undefined;
1848
+ }[] | undefined;
1849
+ weights?: number[] | undefined;
1850
+ coverage?: number | undefined;
1851
+ hashAttribute?: string | undefined;
1852
+ fallbackAttribute?: string | undefined;
1853
+ hashVersion?: 2 | undefined;
1854
+ disableStickyBucketing?: boolean | undefined;
1855
+ bucketVersion?: number | undefined;
1856
+ minBucketVersion?: number | undefined;
1857
+ filters?: {
1858
+ seed: string;
1859
+ hashVersion: 2;
1860
+ ranges: [number, number][];
1861
+ attribute?: string | undefined;
1862
+ }[] | undefined;
1863
+ ranges?: [number, number][] | undefined;
1864
+ meta?: {
1865
+ key?: string | undefined;
1866
+ name?: string | undefined;
1867
+ passthrough?: boolean | undefined;
1868
+ }[] | undefined;
1869
+ seed?: string | undefined;
1870
+ name?: string | undefined;
1871
+ phase?: string | undefined;
1872
+ }>;
1873
+ };
1874
+ conditions: Record<string, {
1875
+ condition: Record<string, zod.JSONType>;
1876
+ port: string;
1877
+ }[]>;
1878
+ scope: {
1879
+ projectId: string;
1880
+ environment: "sandbox" | "live";
1881
+ };
1882
+ funnelId: string;
1883
+ versionId: string;
1884
+ evaluationRevision: number;
1885
+ expiresAt: string | null;
1886
+ topology: {
1887
+ entry: string;
1888
+ nodes: {
1889
+ id: string;
1890
+ type: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
1891
+ outputs: Record<string, string>;
1892
+ writes: Record<string, string>;
1893
+ resources: {
1894
+ screenId?: string | undefined;
1895
+ paywallVersionId?: string | undefined;
1896
+ couponId?: string | undefined;
1897
+ couponIds?: string[] | undefined;
1898
+ experimentId?: string | undefined;
1899
+ featureKey?: string | undefined;
1900
+ offeringVersionId?: string | undefined;
1901
+ };
1902
+ }[];
1903
+ };
1904
+ evaluation: {
1905
+ maxTransitions: number;
1906
+ variables: Record<string, {
1907
+ nullable: boolean;
1908
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
1909
+ source: {
1910
+ type: "input";
1911
+ } | {
1912
+ type: "node";
1913
+ } | {
1914
+ type: "attribute" | "parameter";
1915
+ key: string;
1916
+ };
1917
+ enum?: string[] | undefined;
1918
+ items?: {
1919
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
1920
+ nullable: boolean;
1921
+ enum?: string[] | undefined;
1922
+ } | undefined;
1923
+ }>;
1924
+ outputSchema: {
1925
+ nullable: boolean;
1926
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
1927
+ enum?: string[] | undefined;
1928
+ items?: {
1929
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
1930
+ nullable: boolean;
1931
+ enum?: string[] | undefined;
1932
+ } | undefined;
1933
+ };
1934
+ terminals: Record<string, {
1935
+ outcome: "failed" | "completed" | "closed" | "ineligible";
1936
+ output: {
1937
+ type: "literal";
1938
+ value: zod.JSONType;
1939
+ } | {
1940
+ type: "variable";
1941
+ key: string;
1942
+ path?: string | undefined;
1943
+ } | {
1944
+ type: "feature";
1945
+ featureKey: string;
1946
+ } | null;
1947
+ }>;
1948
+ };
1949
+ }>;
1950
+ reset(): void;
1951
+ };
1952
+ type FunnelLocalEvaluator = ReturnType<typeof createFunnelLocalEvaluator>;
1953
+ /** Same canonical CDN document and GB generation; existing pure evaluator and server-only boundary remain. */
1954
+ declare function createSynchronizedFunnelLocalEvaluator(configuration: ConfigurationSync, funnelId: string): {
1955
+ session(input: FunnelLocalSessionOptions): {
1956
+ evaluate(input?: {
1957
+ track?: boolean;
1958
+ }): Promise<FunnelLocalEvaluation>;
1959
+ flush: () => Promise<void>;
1960
+ readonly stickyBucketAssignmentDocs: Record<string, {
1961
+ attributeName: string;
1962
+ attributeValue: string;
1963
+ assignments: Record<string, string>;
1964
+ }>;
1965
+ };
1966
+ refresh(): Promise<{
1967
+ evaluationMode: "local";
1968
+ growth: {
1969
+ scope: {
1970
+ projectId: string;
1971
+ environment: "sandbox" | "live";
1972
+ };
1973
+ generation: string;
1974
+ evaluatedAt: string;
1975
+ expiresAt: string | null;
1976
+ features: Record<string, {
1977
+ defaultValue?: zod.JSONType | undefined;
1978
+ rules?: {
1979
+ id?: string | undefined;
1980
+ force?: zod.JSONType | undefined;
1981
+ variations?: zod.JSONType[] | undefined;
1982
+ key?: string | undefined;
1983
+ range?: [number, number] | undefined;
1984
+ tracks?: {
1985
+ experiment: {
1986
+ key: string;
1987
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
1988
+ urlPatterns?: {
1989
+ include: boolean;
1990
+ type: "regex" | "simple";
1991
+ pattern: string;
1992
+ }[] | undefined;
1993
+ force?: number | undefined;
1994
+ active?: boolean | undefined;
1995
+ persistQueryString?: boolean | undefined;
1996
+ condition?: Record<string, zod.JSONType> | undefined;
1997
+ parentConditions?: {
1998
+ id: string;
1999
+ condition: Record<string, zod.JSONType>;
2000
+ gate?: boolean | undefined;
2001
+ }[] | undefined;
2002
+ weights?: number[] | undefined;
2003
+ coverage?: number | undefined;
2004
+ hashAttribute?: string | undefined;
2005
+ fallbackAttribute?: string | undefined;
2006
+ hashVersion?: 2 | undefined;
2007
+ disableStickyBucketing?: boolean | undefined;
2008
+ bucketVersion?: number | undefined;
2009
+ minBucketVersion?: number | undefined;
2010
+ filters?: {
2011
+ seed: string;
2012
+ hashVersion: 2;
2013
+ ranges: [number, number][];
2014
+ attribute?: string | undefined;
2015
+ }[] | undefined;
2016
+ ranges?: [number, number][] | undefined;
2017
+ meta?: {
2018
+ key?: string | undefined;
2019
+ name?: string | undefined;
2020
+ passthrough?: boolean | undefined;
2021
+ }[] | undefined;
2022
+ seed?: string | undefined;
2023
+ name?: string | undefined;
2024
+ phase?: string | undefined;
2025
+ };
2026
+ result: {
2027
+ value: zod.JSONType;
2028
+ variationId: number;
2029
+ key: string;
2030
+ inExperiment: boolean;
2031
+ hashAttribute: string;
2032
+ hashValue: string;
2033
+ featureId: string | null;
2034
+ name?: string | undefined;
2035
+ bucket?: number | undefined;
2036
+ passthrough?: boolean | undefined;
2037
+ hashUsed?: boolean | undefined;
2038
+ stickyBucketUsed?: boolean | undefined;
2039
+ };
2040
+ }[] | undefined;
2041
+ condition?: Record<string, zod.JSONType> | undefined;
2042
+ parentConditions?: {
2043
+ id: string;
2044
+ condition: Record<string, zod.JSONType>;
2045
+ gate?: boolean | undefined;
2046
+ }[] | undefined;
2047
+ weights?: number[] | undefined;
2048
+ coverage?: number | undefined;
2049
+ hashAttribute?: string | undefined;
2050
+ fallbackAttribute?: string | undefined;
2051
+ hashVersion?: 2 | undefined;
2052
+ disableStickyBucketing?: boolean | undefined;
2053
+ bucketVersion?: number | undefined;
2054
+ minBucketVersion?: number | undefined;
2055
+ filters?: {
2056
+ seed: string;
2057
+ hashVersion: 2;
2058
+ ranges: [number, number][];
2059
+ attribute?: string | undefined;
2060
+ }[] | undefined;
2061
+ ranges?: [number, number][] | undefined;
2062
+ meta?: {
2063
+ key?: string | undefined;
2064
+ name?: string | undefined;
2065
+ passthrough?: boolean | undefined;
2066
+ }[] | undefined;
2067
+ seed?: string | undefined;
2068
+ name?: string | undefined;
2069
+ phase?: string | undefined;
2070
+ }[] | undefined;
2071
+ }>;
2072
+ savedGroups: Record<string, {
2073
+ type: "hashed";
2074
+ attributeKey: string;
2075
+ values: string[];
2076
+ } | {
2077
+ type: "list";
2078
+ attributeKey: string;
2079
+ values: (string | number)[];
2080
+ } | {
2081
+ type: "condition";
2082
+ condition: Record<string, zod.JSONType>;
2083
+ }>;
2084
+ experiments: Record<string, {
2085
+ key: string;
2086
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2087
+ urlPatterns?: {
2088
+ include: boolean;
2089
+ type: "regex" | "simple";
2090
+ pattern: string;
2091
+ }[] | undefined;
2092
+ force?: number | undefined;
2093
+ active?: boolean | undefined;
2094
+ persistQueryString?: boolean | undefined;
2095
+ condition?: Record<string, zod.JSONType> | undefined;
2096
+ parentConditions?: {
2097
+ id: string;
2098
+ condition: Record<string, zod.JSONType>;
2099
+ gate?: boolean | undefined;
2100
+ }[] | undefined;
2101
+ weights?: number[] | undefined;
2102
+ coverage?: number | undefined;
2103
+ hashAttribute?: string | undefined;
2104
+ fallbackAttribute?: string | undefined;
2105
+ hashVersion?: 2 | undefined;
2106
+ disableStickyBucketing?: boolean | undefined;
2107
+ bucketVersion?: number | undefined;
2108
+ minBucketVersion?: number | undefined;
2109
+ filters?: {
2110
+ seed: string;
2111
+ hashVersion: 2;
2112
+ ranges: [number, number][];
2113
+ attribute?: string | undefined;
2114
+ }[] | undefined;
2115
+ ranges?: [number, number][] | undefined;
2116
+ meta?: {
2117
+ key?: string | undefined;
2118
+ name?: string | undefined;
2119
+ passthrough?: boolean | undefined;
2120
+ }[] | undefined;
2121
+ seed?: string | undefined;
2122
+ name?: string | undefined;
2123
+ phase?: string | undefined;
2124
+ }>;
2125
+ };
2126
+ conditions: Record<string, {
2127
+ condition: Record<string, zod.JSONType>;
2128
+ port: string;
2129
+ }[]>;
2130
+ scope: {
2131
+ projectId: string;
2132
+ environment: "sandbox" | "live";
2133
+ };
2134
+ funnelId: string;
2135
+ versionId: string;
2136
+ evaluationRevision: number;
2137
+ expiresAt: string | null;
2138
+ topology: {
2139
+ entry: string;
2140
+ nodes: {
2141
+ id: string;
2142
+ type: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
2143
+ outputs: Record<string, string>;
2144
+ writes: Record<string, string>;
2145
+ resources: {
2146
+ screenId?: string | undefined;
2147
+ paywallVersionId?: string | undefined;
2148
+ couponId?: string | undefined;
2149
+ couponIds?: string[] | undefined;
2150
+ experimentId?: string | undefined;
2151
+ featureKey?: string | undefined;
2152
+ offeringVersionId?: string | undefined;
2153
+ };
2154
+ }[];
2155
+ };
2156
+ evaluation: {
2157
+ maxTransitions: number;
2158
+ variables: Record<string, {
2159
+ nullable: boolean;
2160
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2161
+ source: {
2162
+ type: "input";
2163
+ } | {
2164
+ type: "node";
2165
+ } | {
2166
+ type: "attribute" | "parameter";
2167
+ key: string;
2168
+ };
2169
+ enum?: string[] | undefined;
2170
+ items?: {
2171
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2172
+ nullable: boolean;
2173
+ enum?: string[] | undefined;
2174
+ } | undefined;
2175
+ }>;
2176
+ outputSchema: {
2177
+ nullable: boolean;
2178
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2179
+ enum?: string[] | undefined;
2180
+ items?: {
2181
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2182
+ nullable: boolean;
2183
+ enum?: string[] | undefined;
2184
+ } | undefined;
2185
+ };
2186
+ terminals: Record<string, {
2187
+ outcome: "failed" | "completed" | "closed" | "ineligible";
2188
+ output: {
2189
+ type: "literal";
2190
+ value: zod.JSONType;
2191
+ } | {
2192
+ type: "variable";
2193
+ key: string;
2194
+ path?: string | undefined;
2195
+ } | {
2196
+ type: "feature";
2197
+ featureKey: string;
2198
+ } | null;
2199
+ }>;
2200
+ };
2201
+ }>;
2202
+ reset(): void;
2203
+ } & {
2204
+ session(input: FunnelLocalSessionOptions): {
2205
+ evaluate(input?: {
2206
+ track?: boolean;
2207
+ }): Promise<FunnelLocalEvaluation>;
2208
+ flush: () => Promise<void>;
2209
+ readonly stickyBucketAssignmentDocs: Record<string, {
2210
+ attributeName: string;
2211
+ attributeValue: string;
2212
+ assignments: Record<string, string>;
2213
+ }>;
2214
+ } & {
2215
+ evaluate(input?: {
2216
+ track?: boolean;
2217
+ } | undefined): Promise<FunnelLocalEvaluation>;
2218
+ };
2219
+ destroy(): void;
2220
+ };
2221
+
2222
+ /** Each request verifies the Customer token; a Paywall never receives a Funnel credential. */
2223
+ declare function createPaywallStartClient(options: IndianaServerOptions): {
2224
+ start: (input: PaywallStartInput) => Promise<PaywallSession>;
2225
+ };
2226
+
2227
+ declare class FunnelDecisionTimeoutError extends IndianaError {
2228
+ readonly decisionId: string;
2229
+ readonly decisionRequestId: string;
2230
+ constructor(decisionId: string, decisionRequestId: string);
2231
+ }
2232
+
2233
+ type FunnelDecisionInput = Omit<Extract<FunnelDecisionCommand, {
2234
+ operation: "decide";
2235
+ }>, "operation" | "funnelId">;
2236
+ type FunnelDecisionUsedInput = Omit<Extract<FunnelDecisionCommand, {
2237
+ operation: "report_used";
2238
+ }>, "operation">;
2239
+
2240
+ declare function createFunnelDecisionClient(options: IndianaServerOptions & {
2241
+ funnelId: string;
2242
+ }): {
2243
+ /** Explicit pure evaluation; never creates or substitutes for a durable Decision. */
2244
+ local(): {
2245
+ session(input: FunnelLocalSessionOptions): {
2246
+ evaluate(input?: {
2247
+ track?: boolean;
2248
+ }): Promise<FunnelLocalEvaluation>;
2249
+ flush: () => Promise<void>;
2250
+ readonly stickyBucketAssignmentDocs: Record<string, {
2251
+ attributeName: string;
2252
+ attributeValue: string;
2253
+ assignments: Record<string, string>;
2254
+ }>;
2255
+ };
2256
+ refresh(): Promise<{
2257
+ evaluationMode: "local";
2258
+ growth: {
2259
+ scope: {
2260
+ projectId: string;
2261
+ environment: "sandbox" | "live";
2262
+ };
2263
+ generation: string;
2264
+ evaluatedAt: string;
2265
+ expiresAt: string | null;
2266
+ features: Record<string, {
2267
+ defaultValue?: zod.JSONType | undefined;
2268
+ rules?: {
2269
+ id?: string | undefined;
2270
+ force?: zod.JSONType | undefined;
2271
+ variations?: zod.JSONType[] | undefined;
2272
+ key?: string | undefined;
2273
+ range?: [number, number] | undefined;
2274
+ tracks?: {
2275
+ experiment: {
2276
+ key: string;
2277
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2278
+ urlPatterns?: {
2279
+ include: boolean;
2280
+ type: "regex" | "simple";
2281
+ pattern: string;
2282
+ }[] | undefined;
2283
+ force?: number | undefined;
2284
+ active?: boolean | undefined;
2285
+ persistQueryString?: boolean | undefined;
2286
+ condition?: Record<string, zod.JSONType> | undefined;
2287
+ parentConditions?: {
2288
+ id: string;
2289
+ condition: Record<string, zod.JSONType>;
2290
+ gate?: boolean | undefined;
2291
+ }[] | undefined;
2292
+ weights?: number[] | undefined;
2293
+ coverage?: number | undefined;
2294
+ hashAttribute?: string | undefined;
2295
+ fallbackAttribute?: string | undefined;
2296
+ hashVersion?: 2 | undefined;
2297
+ disableStickyBucketing?: boolean | undefined;
2298
+ bucketVersion?: number | undefined;
2299
+ minBucketVersion?: number | undefined;
2300
+ filters?: {
2301
+ seed: string;
2302
+ hashVersion: 2;
2303
+ ranges: [number, number][];
2304
+ attribute?: string | undefined;
2305
+ }[] | undefined;
2306
+ ranges?: [number, number][] | undefined;
2307
+ meta?: {
2308
+ key?: string | undefined;
2309
+ name?: string | undefined;
2310
+ passthrough?: boolean | undefined;
2311
+ }[] | undefined;
2312
+ seed?: string | undefined;
2313
+ name?: string | undefined;
2314
+ phase?: string | undefined;
2315
+ };
2316
+ result: {
2317
+ value: zod.JSONType;
2318
+ variationId: number;
2319
+ key: string;
2320
+ inExperiment: boolean;
2321
+ hashAttribute: string;
2322
+ hashValue: string;
2323
+ featureId: string | null;
2324
+ name?: string | undefined;
2325
+ bucket?: number | undefined;
2326
+ passthrough?: boolean | undefined;
2327
+ hashUsed?: boolean | undefined;
2328
+ stickyBucketUsed?: boolean | undefined;
2329
+ };
2330
+ }[] | undefined;
2331
+ condition?: Record<string, zod.JSONType> | undefined;
2332
+ parentConditions?: {
2333
+ id: string;
2334
+ condition: Record<string, zod.JSONType>;
2335
+ gate?: boolean | undefined;
2336
+ }[] | undefined;
2337
+ weights?: number[] | undefined;
2338
+ coverage?: number | undefined;
2339
+ hashAttribute?: string | undefined;
2340
+ fallbackAttribute?: string | undefined;
2341
+ hashVersion?: 2 | undefined;
2342
+ disableStickyBucketing?: boolean | undefined;
2343
+ bucketVersion?: number | undefined;
2344
+ minBucketVersion?: number | undefined;
2345
+ filters?: {
2346
+ seed: string;
2347
+ hashVersion: 2;
2348
+ ranges: [number, number][];
2349
+ attribute?: string | undefined;
2350
+ }[] | undefined;
2351
+ ranges?: [number, number][] | undefined;
2352
+ meta?: {
2353
+ key?: string | undefined;
2354
+ name?: string | undefined;
2355
+ passthrough?: boolean | undefined;
2356
+ }[] | undefined;
2357
+ seed?: string | undefined;
2358
+ name?: string | undefined;
2359
+ phase?: string | undefined;
2360
+ }[] | undefined;
2361
+ }>;
2362
+ savedGroups: Record<string, {
2363
+ type: "hashed";
2364
+ attributeKey: string;
2365
+ values: string[];
2366
+ } | {
2367
+ type: "list";
2368
+ attributeKey: string;
2369
+ values: (string | number)[];
2370
+ } | {
2371
+ type: "condition";
2372
+ condition: Record<string, zod.JSONType>;
2373
+ }>;
2374
+ experiments: Record<string, {
2375
+ key: string;
2376
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2377
+ urlPatterns?: {
2378
+ include: boolean;
2379
+ type: "regex" | "simple";
2380
+ pattern: string;
2381
+ }[] | undefined;
2382
+ force?: number | undefined;
2383
+ active?: boolean | undefined;
2384
+ persistQueryString?: boolean | undefined;
2385
+ condition?: Record<string, zod.JSONType> | undefined;
2386
+ parentConditions?: {
2387
+ id: string;
2388
+ condition: Record<string, zod.JSONType>;
2389
+ gate?: boolean | undefined;
2390
+ }[] | undefined;
2391
+ weights?: number[] | undefined;
2392
+ coverage?: number | undefined;
2393
+ hashAttribute?: string | undefined;
2394
+ fallbackAttribute?: string | undefined;
2395
+ hashVersion?: 2 | undefined;
2396
+ disableStickyBucketing?: boolean | undefined;
2397
+ bucketVersion?: number | undefined;
2398
+ minBucketVersion?: number | undefined;
2399
+ filters?: {
2400
+ seed: string;
2401
+ hashVersion: 2;
2402
+ ranges: [number, number][];
2403
+ attribute?: string | undefined;
2404
+ }[] | undefined;
2405
+ ranges?: [number, number][] | undefined;
2406
+ meta?: {
2407
+ key?: string | undefined;
2408
+ name?: string | undefined;
2409
+ passthrough?: boolean | undefined;
2410
+ }[] | undefined;
2411
+ seed?: string | undefined;
2412
+ name?: string | undefined;
2413
+ phase?: string | undefined;
2414
+ }>;
2415
+ };
2416
+ conditions: Record<string, {
2417
+ condition: Record<string, zod.JSONType>;
2418
+ port: string;
2419
+ }[]>;
2420
+ scope: {
2421
+ projectId: string;
2422
+ environment: "sandbox" | "live";
2423
+ };
2424
+ funnelId: string;
2425
+ versionId: string;
2426
+ evaluationRevision: number;
2427
+ expiresAt: string | null;
2428
+ topology: {
2429
+ entry: string;
2430
+ nodes: {
2431
+ id: string;
2432
+ type: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
2433
+ outputs: Record<string, string>;
2434
+ writes: Record<string, string>;
2435
+ resources: {
2436
+ screenId?: string | undefined;
2437
+ paywallVersionId?: string | undefined;
2438
+ couponId?: string | undefined;
2439
+ couponIds?: string[] | undefined;
2440
+ experimentId?: string | undefined;
2441
+ featureKey?: string | undefined;
2442
+ offeringVersionId?: string | undefined;
2443
+ };
2444
+ }[];
2445
+ };
2446
+ evaluation: {
2447
+ maxTransitions: number;
2448
+ variables: Record<string, {
2449
+ nullable: boolean;
2450
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2451
+ source: {
2452
+ type: "input";
2453
+ } | {
2454
+ type: "node";
2455
+ } | {
2456
+ type: "attribute" | "parameter";
2457
+ key: string;
2458
+ };
2459
+ enum?: string[] | undefined;
2460
+ items?: {
2461
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2462
+ nullable: boolean;
2463
+ enum?: string[] | undefined;
2464
+ } | undefined;
2465
+ }>;
2466
+ outputSchema: {
2467
+ nullable: boolean;
2468
+ type: "string" | "number" | "boolean" | "array" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2469
+ enum?: string[] | undefined;
2470
+ items?: {
2471
+ type: "string" | "number" | "boolean" | "strings" | "json" | "offering_version" | "reward" | "paywall_version";
2472
+ nullable: boolean;
2473
+ enum?: string[] | undefined;
2474
+ } | undefined;
2475
+ };
2476
+ terminals: Record<string, {
2477
+ outcome: "failed" | "completed" | "closed" | "ineligible";
2478
+ output: {
2479
+ type: "literal";
2480
+ value: zod.JSONType;
2481
+ } | {
2482
+ type: "variable";
2483
+ key: string;
2484
+ path?: string | undefined;
2485
+ } | {
2486
+ type: "feature";
2487
+ featureKey: string;
2488
+ } | null;
2489
+ }>;
2490
+ };
2491
+ }>;
2492
+ reset(): void;
2493
+ };
2494
+ configuration(): Promise<{
2495
+ evaluationMode: "local";
2496
+ growth: {
2497
+ scope: {
2498
+ projectId: string;
2499
+ environment: "sandbox" | "live";
2500
+ };
2501
+ generation: string;
2502
+ evaluatedAt: string;
2503
+ expiresAt: string | null;
2504
+ features: Record<string, {
2505
+ defaultValue?: zod.JSONType | undefined;
2506
+ rules?: {
2507
+ id?: string | undefined;
2508
+ force?: zod.JSONType | undefined;
2509
+ variations?: zod.JSONType[] | undefined;
2510
+ key?: string | undefined;
2511
+ range?: [number, number] | undefined;
2512
+ tracks?: {
2513
+ experiment: {
2514
+ key: string;
2515
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2516
+ urlPatterns?: {
2517
+ include: boolean;
2518
+ type: "regex" | "simple";
2519
+ pattern: string;
2520
+ }[] | undefined;
2521
+ force?: number | undefined;
2522
+ active?: boolean | undefined;
2523
+ persistQueryString?: boolean | undefined;
2524
+ condition?: Record<string, zod.JSONType> | undefined;
2525
+ parentConditions?: {
2526
+ id: string;
2527
+ condition: Record<string, zod.JSONType>;
2528
+ gate?: boolean | undefined;
2529
+ }[] | undefined;
2530
+ weights?: number[] | undefined;
2531
+ coverage?: number | undefined;
2532
+ hashAttribute?: string | undefined;
2533
+ fallbackAttribute?: string | undefined;
2534
+ hashVersion?: 2 | undefined;
2535
+ disableStickyBucketing?: boolean | undefined;
2536
+ bucketVersion?: number | undefined;
2537
+ minBucketVersion?: number | undefined;
2538
+ filters?: {
2539
+ seed: string;
2540
+ hashVersion: 2;
2541
+ ranges: [number, number][];
2542
+ attribute?: string | undefined;
2543
+ }[] | undefined;
2544
+ ranges?: [number, number][] | undefined;
2545
+ meta?: {
2546
+ key?: string | undefined;
2547
+ name?: string | undefined;
2548
+ passthrough?: boolean | undefined;
2549
+ }[] | undefined;
2550
+ seed?: string | undefined;
2551
+ name?: string | undefined;
2552
+ phase?: string | undefined;
2553
+ };
2554
+ result: {
2555
+ value: zod.JSONType;
2556
+ variationId: number;
2557
+ key: string;
2558
+ inExperiment: boolean;
2559
+ hashAttribute: string;
2560
+ hashValue: string;
2561
+ featureId: string | null;
2562
+ name?: string | undefined;
2563
+ bucket?: number | undefined;
2564
+ passthrough?: boolean | undefined;
2565
+ hashUsed?: boolean | undefined;
2566
+ stickyBucketUsed?: boolean | undefined;
2567
+ };
2568
+ }[] | undefined;
2569
+ condition?: Record<string, zod.JSONType> | undefined;
2570
+ parentConditions?: {
2571
+ id: string;
2572
+ condition: Record<string, zod.JSONType>;
2573
+ gate?: boolean | undefined;
2574
+ }[] | undefined;
2575
+ weights?: number[] | undefined;
2576
+ coverage?: number | undefined;
2577
+ hashAttribute?: string | undefined;
2578
+ fallbackAttribute?: string | undefined;
2579
+ hashVersion?: 2 | undefined;
2580
+ disableStickyBucketing?: boolean | undefined;
2581
+ bucketVersion?: number | undefined;
2582
+ minBucketVersion?: number | undefined;
2583
+ filters?: {
2584
+ seed: string;
2585
+ hashVersion: 2;
2586
+ ranges: [number, number][];
2587
+ attribute?: string | undefined;
2588
+ }[] | undefined;
2589
+ ranges?: [number, number][] | undefined;
2590
+ meta?: {
2591
+ key?: string | undefined;
2592
+ name?: string | undefined;
2593
+ passthrough?: boolean | undefined;
2594
+ }[] | undefined;
2595
+ seed?: string | undefined;
2596
+ name?: string | undefined;
2597
+ phase?: string | undefined;
2598
+ }[] | undefined;
2599
+ }>;
2600
+ savedGroups: Record<string, {
2601
+ type: "hashed";
2602
+ attributeKey: string;
2603
+ values: string[];
2604
+ } | {
2605
+ type: "list";
2606
+ attributeKey: string;
2607
+ values: (string | number)[];
2608
+ } | {
2609
+ type: "condition";
2610
+ condition: Record<string, zod.JSONType>;
2611
+ }>;
2612
+ experiments: Record<string, {
2613
+ key: string;
2614
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2615
+ urlPatterns?: {
2616
+ include: boolean;
2617
+ type: "regex" | "simple";
2618
+ pattern: string;
2619
+ }[] | undefined;
2620
+ force?: number | undefined;
2621
+ active?: boolean | undefined;
2622
+ persistQueryString?: boolean | undefined;
2623
+ condition?: Record<string, zod.JSONType> | undefined;
2624
+ parentConditions?: {
2625
+ id: string;
2626
+ condition: Record<string, zod.JSONType>;
2627
+ gate?: boolean | undefined;
2628
+ }[] | undefined;
2629
+ weights?: number[] | undefined;
2630
+ coverage?: number | undefined;
2631
+ hashAttribute?: string | undefined;
2632
+ fallbackAttribute?: string | undefined;
2633
+ hashVersion?: 2 | undefined;
2634
+ disableStickyBucketing?: boolean | undefined;
2635
+ bucketVersion?: number | undefined;
2636
+ minBucketVersion?: number | undefined;
2637
+ filters?: {
2638
+ seed: string;
2639
+ hashVersion: 2;
2640
+ ranges: [number, number][];
2641
+ attribute?: string | undefined;
2642
+ }[] | undefined;
2643
+ ranges?: [number, number][] | undefined;
2644
+ meta?: {
2645
+ key?: string | undefined;
2646
+ name?: string | undefined;
2647
+ passthrough?: boolean | undefined;
2648
+ }[] | undefined;
2649
+ seed?: string | undefined;
2650
+ name?: string | undefined;
2651
+ phase?: string | undefined;
2652
+ }>;
2653
+ };
2654
+ conditions: Record<string, {
2655
+ condition: Record<string, zod.JSONType>;
2656
+ port: string;
2657
+ }[]>;
2658
+ scope: {
2659
+ projectId: string;
2660
+ environment: "sandbox" | "live";
2661
+ };
2662
+ funnelId: string;
2663
+ versionId: string;
2664
+ evaluationRevision: number;
2665
+ expiresAt: string | null;
2666
+ topology: {
2667
+ entry: string;
2668
+ nodes: {
2669
+ id: string;
2670
+ type: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
2671
+ outputs: Record<string, string>;
2672
+ writes: Record<string, string>;
2673
+ resources: {
2674
+ screenId?: string | undefined;
2675
+ paywallVersionId?: string | undefined;
2676
+ couponId?: string | undefined;
2677
+ couponIds?: string[] | undefined;
2678
+ experimentId?: string | undefined;
2679
+ featureKey?: string | undefined;
2680
+ offeringVersionId?: string | undefined;
2681
+ };
2682
+ }[];
2683
+ };
2684
+ } | {
2685
+ evaluationMode: "remote";
2686
+ scope: {
2687
+ projectId: string;
2688
+ environment: "sandbox" | "live";
2689
+ };
2690
+ funnelId: string;
2691
+ versionId: string;
2692
+ evaluationRevision: number;
2693
+ expiresAt: string | null;
2694
+ topology: {
2695
+ entry: string;
2696
+ nodes: {
2697
+ id: string;
2698
+ type: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
2699
+ outputs: Record<string, string>;
2700
+ writes: Record<string, string>;
2701
+ resources: {
2702
+ screenId?: string | undefined;
2703
+ paywallVersionId?: string | undefined;
2704
+ couponId?: string | undefined;
2705
+ couponIds?: string[] | undefined;
2706
+ experimentId?: string | undefined;
2707
+ featureKey?: string | undefined;
2708
+ offeringVersionId?: string | undefined;
2709
+ };
2710
+ }[];
2711
+ };
2712
+ }>;
2713
+ features(input?: Omit<FeatureClientOptions, "load" | "scope">): {
2714
+ init: () => Promise<{
2715
+ scope: {
2716
+ projectId: string;
2717
+ environment: "sandbox" | "live";
2718
+ };
2719
+ generation: string;
2720
+ evaluatedAt: string;
2721
+ expiresAt: string | null;
2722
+ features: Record<string, {
2723
+ defaultValue?: zod.JSONType | undefined;
2724
+ rules?: {
2725
+ id?: string | undefined;
2726
+ force?: zod.JSONType | undefined;
2727
+ variations?: zod.JSONType[] | undefined;
2728
+ key?: string | undefined;
2729
+ range?: [number, number] | undefined;
2730
+ tracks?: {
2731
+ experiment: {
2732
+ key: string;
2733
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2734
+ urlPatterns?: {
2735
+ include: boolean;
2736
+ type: "regex" | "simple";
2737
+ pattern: string;
2738
+ }[] | undefined;
2739
+ force?: number | undefined;
2740
+ active?: boolean | undefined;
2741
+ persistQueryString?: boolean | undefined;
2742
+ condition?: Record<string, zod.JSONType> | undefined;
2743
+ parentConditions?: {
2744
+ id: string;
2745
+ condition: Record<string, zod.JSONType>;
2746
+ gate?: boolean | undefined;
2747
+ }[] | undefined;
2748
+ weights?: number[] | undefined;
2749
+ coverage?: number | undefined;
2750
+ hashAttribute?: string | undefined;
2751
+ fallbackAttribute?: string | undefined;
2752
+ hashVersion?: 2 | undefined;
2753
+ disableStickyBucketing?: boolean | undefined;
2754
+ bucketVersion?: number | undefined;
2755
+ minBucketVersion?: number | undefined;
2756
+ filters?: {
2757
+ seed: string;
2758
+ hashVersion: 2;
2759
+ ranges: [number, number][];
2760
+ attribute?: string | undefined;
2761
+ }[] | undefined;
2762
+ ranges?: [number, number][] | undefined;
2763
+ meta?: {
2764
+ key?: string | undefined;
2765
+ name?: string | undefined;
2766
+ passthrough?: boolean | undefined;
2767
+ }[] | undefined;
2768
+ seed?: string | undefined;
2769
+ name?: string | undefined;
2770
+ phase?: string | undefined;
2771
+ };
2772
+ result: {
2773
+ value: zod.JSONType;
2774
+ variationId: number;
2775
+ key: string;
2776
+ inExperiment: boolean;
2777
+ hashAttribute: string;
2778
+ hashValue: string;
2779
+ featureId: string | null;
2780
+ name?: string | undefined;
2781
+ bucket?: number | undefined;
2782
+ passthrough?: boolean | undefined;
2783
+ hashUsed?: boolean | undefined;
2784
+ stickyBucketUsed?: boolean | undefined;
2785
+ };
2786
+ }[] | undefined;
2787
+ condition?: Record<string, zod.JSONType> | undefined;
2788
+ parentConditions?: {
2789
+ id: string;
2790
+ condition: Record<string, zod.JSONType>;
2791
+ gate?: boolean | undefined;
2792
+ }[] | undefined;
2793
+ weights?: number[] | undefined;
2794
+ coverage?: number | undefined;
2795
+ hashAttribute?: string | undefined;
2796
+ fallbackAttribute?: string | undefined;
2797
+ hashVersion?: 2 | undefined;
2798
+ disableStickyBucketing?: boolean | undefined;
2799
+ bucketVersion?: number | undefined;
2800
+ minBucketVersion?: number | undefined;
2801
+ filters?: {
2802
+ seed: string;
2803
+ hashVersion: 2;
2804
+ ranges: [number, number][];
2805
+ attribute?: string | undefined;
2806
+ }[] | undefined;
2807
+ ranges?: [number, number][] | undefined;
2808
+ meta?: {
2809
+ key?: string | undefined;
2810
+ name?: string | undefined;
2811
+ passthrough?: boolean | undefined;
2812
+ }[] | undefined;
2813
+ seed?: string | undefined;
2814
+ name?: string | undefined;
2815
+ phase?: string | undefined;
2816
+ }[] | undefined;
2817
+ }>;
2818
+ savedGroups: Record<string, {
2819
+ type: "hashed";
2820
+ attributeKey: string;
2821
+ values: string[];
2822
+ } | {
2823
+ type: "list";
2824
+ attributeKey: string;
2825
+ values: (string | number)[];
2826
+ } | {
2827
+ type: "condition";
2828
+ condition: Record<string, zod.JSONType>;
2829
+ }>;
2830
+ experiments: Record<string, {
2831
+ key: string;
2832
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2833
+ urlPatterns?: {
2834
+ include: boolean;
2835
+ type: "regex" | "simple";
2836
+ pattern: string;
2837
+ }[] | undefined;
2838
+ force?: number | undefined;
2839
+ active?: boolean | undefined;
2840
+ persistQueryString?: boolean | undefined;
2841
+ condition?: Record<string, zod.JSONType> | undefined;
2842
+ parentConditions?: {
2843
+ id: string;
2844
+ condition: Record<string, zod.JSONType>;
2845
+ gate?: boolean | undefined;
2846
+ }[] | undefined;
2847
+ weights?: number[] | undefined;
2848
+ coverage?: number | undefined;
2849
+ hashAttribute?: string | undefined;
2850
+ fallbackAttribute?: string | undefined;
2851
+ hashVersion?: 2 | undefined;
2852
+ disableStickyBucketing?: boolean | undefined;
2853
+ bucketVersion?: number | undefined;
2854
+ minBucketVersion?: number | undefined;
2855
+ filters?: {
2856
+ seed: string;
2857
+ hashVersion: 2;
2858
+ ranges: [number, number][];
2859
+ attribute?: string | undefined;
2860
+ }[] | undefined;
2861
+ ranges?: [number, number][] | undefined;
2862
+ meta?: {
2863
+ key?: string | undefined;
2864
+ name?: string | undefined;
2865
+ passthrough?: boolean | undefined;
2866
+ }[] | undefined;
2867
+ seed?: string | undefined;
2868
+ name?: string | undefined;
2869
+ phase?: string | undefined;
2870
+ }>;
2871
+ }>;
2872
+ refresh: () => Promise<{
2873
+ scope: {
2874
+ projectId: string;
2875
+ environment: "sandbox" | "live";
2876
+ };
2877
+ generation: string;
2878
+ evaluatedAt: string;
2879
+ expiresAt: string | null;
2880
+ features: Record<string, {
2881
+ defaultValue?: zod.JSONType | undefined;
2882
+ rules?: {
2883
+ id?: string | undefined;
2884
+ force?: zod.JSONType | undefined;
2885
+ variations?: zod.JSONType[] | undefined;
2886
+ key?: string | undefined;
2887
+ range?: [number, number] | undefined;
2888
+ tracks?: {
2889
+ experiment: {
2890
+ key: string;
2891
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2892
+ urlPatterns?: {
2893
+ include: boolean;
2894
+ type: "regex" | "simple";
2895
+ pattern: string;
2896
+ }[] | undefined;
2897
+ force?: number | undefined;
2898
+ active?: boolean | undefined;
2899
+ persistQueryString?: boolean | undefined;
2900
+ condition?: Record<string, zod.JSONType> | undefined;
2901
+ parentConditions?: {
2902
+ id: string;
2903
+ condition: Record<string, zod.JSONType>;
2904
+ gate?: boolean | undefined;
2905
+ }[] | undefined;
2906
+ weights?: number[] | undefined;
2907
+ coverage?: number | undefined;
2908
+ hashAttribute?: string | undefined;
2909
+ fallbackAttribute?: string | undefined;
2910
+ hashVersion?: 2 | undefined;
2911
+ disableStickyBucketing?: boolean | undefined;
2912
+ bucketVersion?: number | undefined;
2913
+ minBucketVersion?: number | undefined;
2914
+ filters?: {
2915
+ seed: string;
2916
+ hashVersion: 2;
2917
+ ranges: [number, number][];
2918
+ attribute?: string | undefined;
2919
+ }[] | undefined;
2920
+ ranges?: [number, number][] | undefined;
2921
+ meta?: {
2922
+ key?: string | undefined;
2923
+ name?: string | undefined;
2924
+ passthrough?: boolean | undefined;
2925
+ }[] | undefined;
2926
+ seed?: string | undefined;
2927
+ name?: string | undefined;
2928
+ phase?: string | undefined;
2929
+ };
2930
+ result: {
2931
+ value: zod.JSONType;
2932
+ variationId: number;
2933
+ key: string;
2934
+ inExperiment: boolean;
2935
+ hashAttribute: string;
2936
+ hashValue: string;
2937
+ featureId: string | null;
2938
+ name?: string | undefined;
2939
+ bucket?: number | undefined;
2940
+ passthrough?: boolean | undefined;
2941
+ hashUsed?: boolean | undefined;
2942
+ stickyBucketUsed?: boolean | undefined;
2943
+ };
2944
+ }[] | undefined;
2945
+ condition?: Record<string, zod.JSONType> | undefined;
2946
+ parentConditions?: {
2947
+ id: string;
2948
+ condition: Record<string, zod.JSONType>;
2949
+ gate?: boolean | undefined;
2950
+ }[] | undefined;
2951
+ weights?: number[] | undefined;
2952
+ coverage?: number | undefined;
2953
+ hashAttribute?: string | undefined;
2954
+ fallbackAttribute?: string | undefined;
2955
+ hashVersion?: 2 | undefined;
2956
+ disableStickyBucketing?: boolean | undefined;
2957
+ bucketVersion?: number | undefined;
2958
+ minBucketVersion?: number | undefined;
2959
+ filters?: {
2960
+ seed: string;
2961
+ hashVersion: 2;
2962
+ ranges: [number, number][];
2963
+ attribute?: string | undefined;
2964
+ }[] | undefined;
2965
+ ranges?: [number, number][] | undefined;
2966
+ meta?: {
2967
+ key?: string | undefined;
2968
+ name?: string | undefined;
2969
+ passthrough?: boolean | undefined;
2970
+ }[] | undefined;
2971
+ seed?: string | undefined;
2972
+ name?: string | undefined;
2973
+ phase?: string | undefined;
2974
+ }[] | undefined;
2975
+ }>;
2976
+ savedGroups: Record<string, {
2977
+ type: "hashed";
2978
+ attributeKey: string;
2979
+ values: string[];
2980
+ } | {
2981
+ type: "list";
2982
+ attributeKey: string;
2983
+ values: (string | number)[];
2984
+ } | {
2985
+ type: "condition";
2986
+ condition: Record<string, zod.JSONType>;
2987
+ }>;
2988
+ experiments: Record<string, {
2989
+ key: string;
2990
+ variations: [zod.JSONType, zod.JSONType, ...zod.JSONType[]];
2991
+ urlPatterns?: {
2992
+ include: boolean;
2993
+ type: "regex" | "simple";
2994
+ pattern: string;
2995
+ }[] | undefined;
2996
+ force?: number | undefined;
2997
+ active?: boolean | undefined;
2998
+ persistQueryString?: boolean | undefined;
2999
+ condition?: Record<string, zod.JSONType> | undefined;
3000
+ parentConditions?: {
3001
+ id: string;
3002
+ condition: Record<string, zod.JSONType>;
3003
+ gate?: boolean | undefined;
3004
+ }[] | undefined;
3005
+ weights?: number[] | undefined;
3006
+ coverage?: number | undefined;
3007
+ hashAttribute?: string | undefined;
3008
+ fallbackAttribute?: string | undefined;
3009
+ hashVersion?: 2 | undefined;
3010
+ disableStickyBucketing?: boolean | undefined;
3011
+ bucketVersion?: number | undefined;
3012
+ minBucketVersion?: number | undefined;
3013
+ filters?: {
3014
+ seed: string;
3015
+ hashVersion: 2;
3016
+ ranges: [number, number][];
3017
+ attribute?: string | undefined;
3018
+ }[] | undefined;
3019
+ ranges?: [number, number][] | undefined;
3020
+ meta?: {
3021
+ key?: string | undefined;
3022
+ name?: string | undefined;
3023
+ passthrough?: boolean | undefined;
3024
+ }[] | undefined;
3025
+ seed?: string | undefined;
3026
+ name?: string | undefined;
3027
+ phase?: string | undefined;
3028
+ }>;
3029
+ }>;
3030
+ refreshRemote: () => Promise<void>;
3031
+ readonly generation: string | null;
3032
+ readonly expiresAt: string | null;
3033
+ subscribe(listener: () => void): () => void;
3034
+ setAttributes(attributes: Record<string, JsonValue>): void;
3035
+ evalFeature: (key: string) => FeatureResult<JsonValue> | RemoteFeatureResult;
3036
+ isOn(key: string): boolean;
3037
+ isOff(key: string): boolean;
3038
+ getFeatureValue(key: string, fallback: JsonValue): JsonValue;
3039
+ reset(): void;
3040
+ };
3041
+ read: (decisionId: string) => Promise<{
3042
+ scope: {
3043
+ projectId: string;
3044
+ environment: "sandbox" | "live";
3045
+ };
3046
+ decisionId: string;
3047
+ requestId: string;
3048
+ status: "pending" | "failed" | "completed";
3049
+ decision: {
3050
+ requestId: string;
3051
+ decisionId: string;
3052
+ customerId: string;
3053
+ externalUserId: string | null;
3054
+ versionId: string;
3055
+ receiptId: string;
3056
+ value: zod.JSONType;
3057
+ } | null;
3058
+ evaluation?: {
3059
+ type: "evaluate";
3060
+ receiptId: string;
3061
+ environmentId: string;
3062
+ policyRevision: number;
3063
+ attributes: Record<string, zod.JSONType>;
3064
+ sticky: Record<string, {
3065
+ attributeName: string;
3066
+ attributeValue: string;
3067
+ assignments: Record<string, string>;
3068
+ }>;
3069
+ runId: string;
3070
+ versionId: string;
3071
+ nodeId: string;
3072
+ visit: number;
3073
+ revision: number;
3074
+ } | {
3075
+ environmentId: string;
3076
+ attributes: Record<string, zod.JSONType>;
3077
+ sticky: Record<string, {
3078
+ attributeName: string;
3079
+ attributeValue: string;
3080
+ assignments: Record<string, string>;
3081
+ }>;
3082
+ policyRevision: number;
3083
+ type: "evaluate_segment";
3084
+ runId: string;
3085
+ versionId: string;
3086
+ nodeId: string;
3087
+ visit: number;
3088
+ revision: number;
3089
+ parameters: Record<string, zod.JSONType>;
3090
+ answers: Record<string, string | boolean | string[]>;
3091
+ variables: Record<string, zod.JSONType>;
3092
+ } | undefined;
3093
+ }>;
3094
+ /** Accept once and return its current state without waiting for completion. */
3095
+ submit(input: FunnelDecisionInput): Promise<{
3096
+ scope: {
3097
+ projectId: string;
3098
+ environment: "sandbox" | "live";
3099
+ };
3100
+ decisionId: string;
3101
+ requestId: string;
3102
+ status: "pending" | "failed" | "completed";
3103
+ decision: {
3104
+ requestId: string;
3105
+ decisionId: string;
3106
+ customerId: string;
3107
+ externalUserId: string | null;
3108
+ versionId: string;
3109
+ receiptId: string;
3110
+ value: zod.JSONType;
3111
+ } | null;
3112
+ evaluation?: {
3113
+ type: "evaluate";
3114
+ receiptId: string;
3115
+ environmentId: string;
3116
+ policyRevision: number;
3117
+ attributes: Record<string, zod.JSONType>;
3118
+ sticky: Record<string, {
3119
+ attributeName: string;
3120
+ attributeValue: string;
3121
+ assignments: Record<string, string>;
3122
+ }>;
3123
+ runId: string;
3124
+ versionId: string;
3125
+ nodeId: string;
3126
+ visit: number;
3127
+ revision: number;
3128
+ } | {
3129
+ environmentId: string;
3130
+ attributes: Record<string, zod.JSONType>;
3131
+ sticky: Record<string, {
3132
+ attributeName: string;
3133
+ attributeValue: string;
3134
+ assignments: Record<string, string>;
3135
+ }>;
3136
+ policyRevision: number;
3137
+ type: "evaluate_segment";
3138
+ runId: string;
3139
+ versionId: string;
3140
+ nodeId: string;
3141
+ visit: number;
3142
+ revision: number;
3143
+ parameters: Record<string, zod.JSONType>;
3144
+ answers: Record<string, string | boolean | string[]>;
3145
+ variables: Record<string, zod.JSONType>;
3146
+ } | undefined;
3147
+ }>;
3148
+ decide(input: FunnelDecisionInput): Promise<FunnelDecision>;
3149
+ reportUsed(input: FunnelDecisionUsedInput): Promise<{
3150
+ scope: {
3151
+ projectId: string;
3152
+ environment: "sandbox" | "live";
3153
+ };
3154
+ decisionId: string;
3155
+ eventId: string;
3156
+ source: "caller_reported";
3157
+ }>;
3158
+ };
3159
+
3160
+ /** Call from the integrating app's authenticated backend. Never ship its API key to a device. */
3161
+ declare function createNativeReceiptClient(options: IndianaServerOptions): {
3162
+ recover(input: NativeReceiptCommand): Promise<{
3163
+ scope: {
3164
+ projectId: string;
3165
+ environment: "sandbox" | "live";
3166
+ };
3167
+ requestId: string;
3168
+ orderId: string;
3169
+ receiptId: string;
3170
+ orderStatus: "pending" | "failed" | "paid" | "trialing" | "created" | "cancelled";
3171
+ refunded: boolean;
3172
+ nativeCompletion?: {
3173
+ orderId: string;
3174
+ receiptId: string;
3175
+ transactionIds: string[];
3176
+ membership: boolean;
3177
+ } | undefined;
3178
+ }>;
3179
+ };
3180
+
3181
+ type FunnelSignalInput = Omit<Extract<FunnelOrchestrationCommand, {
3182
+ operation: "signal";
3183
+ }>, "operation">;
3184
+ /** Custom receipts are optional application facts. They cannot assert verified payment. */
3185
+ declare function createFunnelOrchestrationClient(options: IndianaServerOptions): {
3186
+ signal(input: FunnelSignalInput): Promise<{
3187
+ scope: {
3188
+ projectId: string;
3189
+ environment: "sandbox" | "live";
3190
+ };
3191
+ runId: string;
3192
+ eventId: string;
3193
+ accepted: boolean;
3194
+ }>;
3195
+ readResults(runId: string): Promise<{
3196
+ scope: {
3197
+ projectId: string;
3198
+ environment: "sandbox" | "live";
3199
+ };
3200
+ runId: string;
3201
+ results: Record<string, zod.JSONType>;
3202
+ }>;
3203
+ };
3204
+
3205
+ type FunnelCampaignStartInput = Omit<Extract<FunnelCampaignCommand, {
3206
+ operation: "campaign_start";
3207
+ }>, "operation" | "funnelId">;
3208
+ /** Explicit merchant entry controls. Canonical Runs/events, never localStorage or Redis authority. */
3209
+ declare function createFunnelCampaignClient(options: IndianaServerOptions & {
3210
+ funnelId: string;
3211
+ }): {
3212
+ /** Returns the original accepted request/decision, even when this lookup has a new request ID. */
3213
+ decide(input: FunnelDecisionInput): Promise<{
3214
+ requestId: string;
3215
+ decisionId: string;
3216
+ customerId: string;
3217
+ externalUserId: string | null;
3218
+ versionId: string;
3219
+ receiptId: string;
3220
+ value: zod.JSONType;
3221
+ }>;
3222
+ /** Call shown on the returned Run only after actual presentation. Closing without showing consumes no window. */
3223
+ start(input: FunnelCampaignStartInput): Promise<{
3224
+ scope: {
3225
+ projectId: string;
3226
+ environment: "sandbox" | "live";
3227
+ };
3228
+ run: {
3229
+ id: string;
3230
+ source: {
3231
+ type: "funnel";
3232
+ id: string;
3233
+ versionId: string;
3234
+ };
3235
+ revision: number;
3236
+ visit: number;
3237
+ nodeId: string;
3238
+ nodeType: "output" | "action" | "feature" | "split" | "condition" | "coupon" | "end" | "screen" | "offering" | "coupons" | "entry" | "external_page" | "wait";
3239
+ status: "failed" | "completed" | "running" | "closed" | "ineligible" | "waiting";
3240
+ stopped: boolean;
3241
+ canBack: boolean;
3242
+ authenticated: boolean;
3243
+ locale: string;
3244
+ answers: Record<string, string | boolean | string[]>;
3245
+ parameters: Record<string, zod.JSONType>;
3246
+ variables: Record<string, zod.JSONType>;
3247
+ output: zod.JSONType;
3248
+ screen: {
3249
+ content: {
3250
+ type: "document";
3251
+ document: {
3252
+ kind: "screen";
3253
+ schemaVersion: 4;
3254
+ name: string;
3255
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
3256
+ presentation: {
3257
+ type: "modal";
3258
+ size: "sm" | "md" | "lg";
3259
+ } | {
3260
+ type: "sheet";
3261
+ size: "sm" | "md" | "lg";
3262
+ } | {
3263
+ type: "fullscreen";
3264
+ } | {
3265
+ type: "inline";
3266
+ };
3267
+ theme: {
3268
+ primary: string;
3269
+ background: string;
3270
+ text: string;
3271
+ radius: "none" | "sm" | "md" | "lg" | "full";
3272
+ font: "system" | "serif" | "rounded" | "mono";
3273
+ };
3274
+ pages: {
3275
+ id: string;
3276
+ name: string;
3277
+ root: StackNode;
3278
+ theme?: {
3279
+ primary: string;
3280
+ background: string;
3281
+ text: string;
3282
+ radius: "none" | "sm" | "md" | "lg" | "full";
3283
+ font: "system" | "serif" | "rounded" | "mono";
3284
+ } | undefined;
3285
+ editorPosition?: {
3286
+ x: number;
3287
+ y: number;
3288
+ } | undefined;
3289
+ }[];
3290
+ strings: {
3291
+ defaultLocale: string;
3292
+ locales: Record<string, Record<string, string>>;
3293
+ };
3294
+ actions: ({
3295
+ type: "navigate";
3296
+ close: false;
3297
+ pageId: string;
3298
+ id: string;
3299
+ event: string;
3300
+ properties: Record<string, string | number | boolean | null>;
3301
+ } | {
3302
+ type: "event";
3303
+ close: boolean;
3304
+ id: string;
3305
+ event: string;
3306
+ properties: Record<string, string | number | boolean | null>;
3307
+ } | {
3308
+ type: "close";
3309
+ close: true;
3310
+ id: string;
3311
+ event: string;
3312
+ properties: Record<string, string | number | boolean | null>;
3313
+ } | {
3314
+ type: "open_url";
3315
+ close: boolean;
3316
+ url: string;
3317
+ id: string;
3318
+ event: string;
3319
+ properties: Record<string, string | number | boolean | null>;
3320
+ } | {
3321
+ type: "claim_offer";
3322
+ close: boolean;
3323
+ couponId: string;
3324
+ id: string;
3325
+ event: string;
3326
+ properties: Record<string, string | number | boolean | null>;
3327
+ })[];
3328
+ initialPageId?: string | undefined;
3329
+ };
3330
+ };
3331
+ id: string;
3332
+ presentation: {
3333
+ type: "modal";
3334
+ size: "sm" | "md" | "lg";
3335
+ } | {
3336
+ type: "sheet";
3337
+ size: "sm" | "md" | "lg";
3338
+ } | {
3339
+ type: "fullscreen";
3340
+ } | {
3341
+ type: "inline";
3342
+ };
3343
+ outputs: string[];
3344
+ inputs: {
3345
+ variable: string;
3346
+ componentId: string;
3347
+ required: boolean;
3348
+ }[];
3349
+ capabilities: {
3350
+ nodes: Record<string, {
3351
+ base: {
3352
+ text?: string | undefined;
3353
+ label?: string | undefined;
3354
+ alt?: string | undefined;
3355
+ html?: string | undefined;
3356
+ price?: {
3357
+ current: string;
3358
+ original: string | null;
3359
+ period: string;
3360
+ } | undefined;
3361
+ code?: string | undefined;
3362
+ countdownAt?: string | undefined;
3363
+ planId?: string | undefined;
3364
+ planVersionId?: string | undefined;
3365
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3366
+ couponId?: string | undefined;
3367
+ offerId?: string | undefined;
3368
+ unavailable?: boolean | undefined;
3369
+ unavailableReason?: string | undefined;
3370
+ missing?: string[] | undefined;
3371
+ };
3372
+ picker?: string | undefined;
3373
+ byPlan?: Record<string, {
3374
+ text?: string | undefined;
3375
+ label?: string | undefined;
3376
+ alt?: string | undefined;
3377
+ html?: string | undefined;
3378
+ price?: {
3379
+ current: string;
3380
+ original: string | null;
3381
+ period: string;
3382
+ } | undefined;
3383
+ code?: string | undefined;
3384
+ countdownAt?: string | undefined;
3385
+ planId?: string | undefined;
3386
+ planVersionId?: string | undefined;
3387
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3388
+ couponId?: string | undefined;
3389
+ offerId?: string | undefined;
3390
+ unavailable?: boolean | undefined;
3391
+ unavailableReason?: string | undefined;
3392
+ missing?: string[] | undefined;
3393
+ }> | undefined;
3394
+ }>;
3395
+ plans: Record<string, {
3396
+ id: string;
3397
+ versionId: string;
3398
+ available: boolean;
3399
+ name: string;
3400
+ price: string;
3401
+ period: string;
3402
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3403
+ }>;
3404
+ pickers: Record<string, {
3405
+ options: string[];
3406
+ selected: string | null;
3407
+ }>;
3408
+ diagnostics: {
3409
+ nodeId: string;
3410
+ message: string;
3411
+ }[];
3412
+ paywall?: {
3413
+ internal_feature_id: string;
3414
+ name: string;
3415
+ kind: "metered" | "access" | "credit";
3416
+ quantity: string;
3417
+ allowed: boolean;
3418
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
3419
+ preview: {
3420
+ scenario: "usage_limit" | "feature_flag";
3421
+ candidates: {
3422
+ productId: string;
3423
+ productVersionId: string;
3424
+ name: string;
3425
+ action: "addon" | "upgrade" | "purchase" | "topup";
3426
+ membershipId: string | null;
3427
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3428
+ amountMinor: string;
3429
+ interval: "free" | "month" | "year" | "week" | "one_time";
3430
+ intervalCount: number;
3431
+ }[];
3432
+ } | null;
3433
+ } | undefined;
3434
+ };
3435
+ customerData: {
3436
+ nodes: Record<string, {
3437
+ source: "membership" | "credit_balance" | "credit_transactions" | "billing" | "billing_controls" | "customer_plans" | "credit_packs" | "credit_pack_orders" | "offer_history";
3438
+ status: "error" | "idle" | "loading" | "ready";
3439
+ stale: boolean;
3440
+ preview: boolean;
3441
+ resources: {
3442
+ key: string;
3443
+ name: string;
3444
+ spendable: string;
3445
+ reserved: string;
3446
+ available: string;
3447
+ expiry: string | null;
3448
+ sources: {
3449
+ id: string;
3450
+ label: string;
3451
+ detail: string[];
3452
+ facts: {
3453
+ label: string;
3454
+ value: string;
3455
+ }[];
3456
+ value?: string | undefined;
3457
+ status?: string | undefined;
3458
+ purchaseId?: string | undefined;
3459
+ invoiceUrl?: string | undefined;
3460
+ billingActions?: {
3461
+ action: "invoice_open";
3462
+ label: string;
3463
+ }[] | undefined;
3464
+ membershipActions?: {
3465
+ value: string;
3466
+ label: string;
3467
+ }[] | undefined;
3468
+ }[];
3469
+ sourceCount: number;
3470
+ sourcePage: number;
3471
+ hasNextSources: boolean;
3472
+ hasPreviousSources: boolean;
3473
+ }[];
3474
+ rows: {
3475
+ id: string;
3476
+ label: string;
3477
+ detail: string[];
3478
+ facts: {
3479
+ label: string;
3480
+ value: string;
3481
+ }[];
3482
+ value?: string | undefined;
3483
+ status?: string | undefined;
3484
+ purchaseId?: string | undefined;
3485
+ invoiceUrl?: string | undefined;
3486
+ billingActions?: {
3487
+ action: "invoice_open";
3488
+ label: string;
3489
+ }[] | undefined;
3490
+ membershipActions?: {
3491
+ value: string;
3492
+ label: string;
3493
+ }[] | undefined;
3494
+ }[];
3495
+ hasNext: boolean;
3496
+ hasPrevious: boolean;
3497
+ page: number;
3498
+ filter: string;
3499
+ errorCode?: string | undefined;
3500
+ errorMessage?: string | undefined;
3501
+ updatedAt?: string | undefined;
3502
+ buyingId?: string | undefined;
3503
+ membershipBusy?: boolean | undefined;
3504
+ billingBusy?: boolean | undefined;
3505
+ membershipReview?: {
3506
+ title: string;
3507
+ note: string;
3508
+ facts: {
3509
+ label: string;
3510
+ value: string;
3511
+ }[];
3512
+ } | undefined;
3513
+ membershipResult?: string | undefined;
3514
+ }>;
3515
+ };
3516
+ dataCursors: Record<string, {
3517
+ kind: "ledger";
3518
+ cursor: {
3519
+ at: string;
3520
+ id: string;
3521
+ type: "source" | "usage" | "invoice" | "debt" | "transaction" | "settlement";
3522
+ };
3523
+ } | {
3524
+ kind: "billing";
3525
+ cursor: string;
3526
+ } | null>;
3527
+ values?: Record<string, zod.JSONType> | undefined;
3528
+ offeringKey?: string | undefined;
3529
+ } | null;
3530
+ paywall: {
3531
+ receiptId: string;
3532
+ resolution: {
3533
+ id: string;
3534
+ paywallId: string;
3535
+ version: number;
3536
+ document: {
3537
+ kind: "paywall";
3538
+ name: string;
3539
+ products: {
3540
+ items: {
3541
+ productVersionId: string;
3542
+ label: string;
3543
+ }[];
3544
+ defaultProductVersionId: string | null;
3545
+ grouping?: {
3546
+ tiers: {
3547
+ id: string;
3548
+ name: string;
3549
+ }[];
3550
+ assignments: {
3551
+ productVersionId: string;
3552
+ tierId: string;
3553
+ period: "month" | "year";
3554
+ }[];
3555
+ } | undefined;
3556
+ };
3557
+ presentation: {
3558
+ type: "modal";
3559
+ size: "sm" | "md" | "lg";
3560
+ } | {
3561
+ type: "sheet";
3562
+ size: "sm" | "md" | "lg";
3563
+ } | {
3564
+ type: "fullscreen";
3565
+ } | {
3566
+ type: "inline";
3567
+ };
3568
+ screen: {
3569
+ kind: "screen";
3570
+ schemaVersion: 4;
3571
+ name: string;
3572
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
3573
+ presentation: {
3574
+ type: "modal";
3575
+ size: "sm" | "md" | "lg";
3576
+ } | {
3577
+ type: "sheet";
3578
+ size: "sm" | "md" | "lg";
3579
+ } | {
3580
+ type: "fullscreen";
3581
+ } | {
3582
+ type: "inline";
3583
+ };
3584
+ theme: {
3585
+ primary: string;
3586
+ background: string;
3587
+ text: string;
3588
+ radius: "none" | "sm" | "md" | "lg" | "full";
3589
+ font: "system" | "serif" | "rounded" | "mono";
3590
+ };
3591
+ pages: {
3592
+ id: string;
3593
+ name: string;
3594
+ root: StackNode;
3595
+ theme?: {
3596
+ primary: string;
3597
+ background: string;
3598
+ text: string;
3599
+ radius: "none" | "sm" | "md" | "lg" | "full";
3600
+ font: "system" | "serif" | "rounded" | "mono";
3601
+ } | undefined;
3602
+ editorPosition?: {
3603
+ x: number;
3604
+ y: number;
3605
+ } | undefined;
3606
+ }[];
3607
+ strings: {
3608
+ defaultLocale: string;
3609
+ locales: Record<string, Record<string, string>>;
3610
+ };
3611
+ actions: ({
3612
+ type: "navigate";
3613
+ close: false;
3614
+ pageId: string;
3615
+ id: string;
3616
+ event: string;
3617
+ properties: Record<string, string | number | boolean | null>;
3618
+ } | {
3619
+ type: "event";
3620
+ close: boolean;
3621
+ id: string;
3622
+ event: string;
3623
+ properties: Record<string, string | number | boolean | null>;
3624
+ } | {
3625
+ type: "close";
3626
+ close: true;
3627
+ id: string;
3628
+ event: string;
3629
+ properties: Record<string, string | number | boolean | null>;
3630
+ } | {
3631
+ type: "open_url";
3632
+ close: boolean;
3633
+ url: string;
3634
+ id: string;
3635
+ event: string;
3636
+ properties: Record<string, string | number | boolean | null>;
3637
+ } | {
3638
+ type: "claim_offer";
3639
+ close: boolean;
3640
+ couponId: string;
3641
+ id: string;
3642
+ event: string;
3643
+ properties: Record<string, string | number | boolean | null>;
3644
+ })[];
3645
+ initialPageId?: string | undefined;
3646
+ };
3647
+ schemaVersion: 3;
3648
+ offeringVersionId: string | null;
3649
+ buttons: Record<string, {
3650
+ type: "checkout";
3651
+ product: {
3652
+ type: "picker";
3653
+ pickerId: string;
3654
+ allowedProductVersionIds: string[];
3655
+ } | {
3656
+ type: "fixed";
3657
+ productVersionId: string;
3658
+ };
3659
+ } | {
3660
+ type: "close";
3661
+ } | {
3662
+ type: "action";
3663
+ action: {
3664
+ type: "event";
3665
+ event: string;
3666
+ } | {
3667
+ type: "open_url";
3668
+ url: string;
3669
+ };
3670
+ }>;
3671
+ };
3672
+ offering: {
3673
+ id: string;
3674
+ };
3675
+ capabilities: {
3676
+ nodes: Record<string, {
3677
+ base: {
3678
+ text?: string | undefined;
3679
+ label?: string | undefined;
3680
+ alt?: string | undefined;
3681
+ html?: string | undefined;
3682
+ price?: {
3683
+ current: string;
3684
+ original: string | null;
3685
+ period: string;
3686
+ } | undefined;
3687
+ code?: string | undefined;
3688
+ countdownAt?: string | undefined;
3689
+ planId?: string | undefined;
3690
+ planVersionId?: string | undefined;
3691
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3692
+ couponId?: string | undefined;
3693
+ offerId?: string | undefined;
3694
+ unavailable?: boolean | undefined;
3695
+ unavailableReason?: string | undefined;
3696
+ missing?: string[] | undefined;
3697
+ };
3698
+ picker?: string | undefined;
3699
+ byPlan?: Record<string, {
3700
+ text?: string | undefined;
3701
+ label?: string | undefined;
3702
+ alt?: string | undefined;
3703
+ html?: string | undefined;
3704
+ price?: {
3705
+ current: string;
3706
+ original: string | null;
3707
+ period: string;
3708
+ } | undefined;
3709
+ code?: string | undefined;
3710
+ countdownAt?: string | undefined;
3711
+ planId?: string | undefined;
3712
+ planVersionId?: string | undefined;
3713
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3714
+ couponId?: string | undefined;
3715
+ offerId?: string | undefined;
3716
+ unavailable?: boolean | undefined;
3717
+ unavailableReason?: string | undefined;
3718
+ missing?: string[] | undefined;
3719
+ }> | undefined;
3720
+ }>;
3721
+ plans: Record<string, {
3722
+ id: string;
3723
+ versionId: string;
3724
+ available: boolean;
3725
+ name: string;
3726
+ price: string;
3727
+ period: string;
3728
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3729
+ }>;
3730
+ pickers: Record<string, {
3731
+ options: string[];
3732
+ selected: string | null;
3733
+ }>;
3734
+ diagnostics: {
3735
+ nodeId: string;
3736
+ message: string;
3737
+ }[];
3738
+ paywall?: {
3739
+ internal_feature_id: string;
3740
+ name: string;
3741
+ kind: "metered" | "access" | "credit";
3742
+ quantity: string;
3743
+ allowed: boolean;
3744
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
3745
+ preview: {
3746
+ scenario: "usage_limit" | "feature_flag";
3747
+ candidates: {
3748
+ productId: string;
3749
+ productVersionId: string;
3750
+ name: string;
3751
+ action: "addon" | "upgrade" | "purchase" | "topup";
3752
+ membershipId: string | null;
3753
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3754
+ amountMinor: string;
3755
+ interval: "free" | "month" | "year" | "week" | "one_time";
3756
+ intervalCount: number;
3757
+ }[];
3758
+ } | null;
3759
+ } | undefined;
3760
+ };
3761
+ check: {
3762
+ internal_feature_id: string;
3763
+ name: string;
3764
+ kind: "metered" | "access" | "credit";
3765
+ quantity: string;
3766
+ allowed: boolean;
3767
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
3768
+ preview: {
3769
+ scenario: "usage_limit" | "feature_flag";
3770
+ candidates: {
3771
+ productId: string;
3772
+ productVersionId: string;
3773
+ name: string;
3774
+ action: "addon" | "upgrade" | "purchase" | "topup";
3775
+ membershipId: string | null;
3776
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3777
+ amountMinor: string;
3778
+ interval: "free" | "month" | "year" | "week" | "one_time";
3779
+ intervalCount: number;
3780
+ }[];
3781
+ } | null;
3782
+ } | null;
3783
+ content?: {
3784
+ environmentId: string;
3785
+ offeringVersionId: string;
3786
+ artifact: {
3787
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
3788
+ formatVersion: number;
3789
+ url: string;
3790
+ sha256: string;
3791
+ byteLength: number;
3792
+ generation?: string | undefined;
3793
+ };
3794
+ } | undefined;
3795
+ } | {
3796
+ check: {
3797
+ internal_feature_id: string;
3798
+ name: string;
3799
+ kind: "metered" | "access" | "credit";
3800
+ quantity: string;
3801
+ allowed: boolean;
3802
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
3803
+ preview: {
3804
+ scenario: "usage_limit" | "feature_flag";
3805
+ candidates: {
3806
+ productId: string;
3807
+ productVersionId: string;
3808
+ name: string;
3809
+ action: "addon" | "upgrade" | "purchase" | "topup";
3810
+ membershipId: string | null;
3811
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3812
+ amountMinor: string;
3813
+ interval: "free" | "month" | "year" | "week" | "one_time";
3814
+ intervalCount: number;
3815
+ }[];
3816
+ } | null;
3817
+ } | null;
3818
+ id: string;
3819
+ version: number;
3820
+ paywallId: string;
3821
+ capabilities: {
3822
+ nodes: Record<string, {
3823
+ base: {
3824
+ text?: string | undefined;
3825
+ label?: string | undefined;
3826
+ alt?: string | undefined;
3827
+ html?: string | undefined;
3828
+ price?: {
3829
+ current: string;
3830
+ original: string | null;
3831
+ period: string;
3832
+ } | undefined;
3833
+ code?: string | undefined;
3834
+ countdownAt?: string | undefined;
3835
+ planId?: string | undefined;
3836
+ planVersionId?: string | undefined;
3837
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3838
+ couponId?: string | undefined;
3839
+ offerId?: string | undefined;
3840
+ unavailable?: boolean | undefined;
3841
+ unavailableReason?: string | undefined;
3842
+ missing?: string[] | undefined;
3843
+ };
3844
+ picker?: string | undefined;
3845
+ byPlan?: Record<string, {
3846
+ text?: string | undefined;
3847
+ label?: string | undefined;
3848
+ alt?: string | undefined;
3849
+ html?: string | undefined;
3850
+ price?: {
3851
+ current: string;
3852
+ original: string | null;
3853
+ period: string;
3854
+ } | undefined;
3855
+ code?: string | undefined;
3856
+ countdownAt?: string | undefined;
3857
+ planId?: string | undefined;
3858
+ planVersionId?: string | undefined;
3859
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3860
+ couponId?: string | undefined;
3861
+ offerId?: string | undefined;
3862
+ unavailable?: boolean | undefined;
3863
+ unavailableReason?: string | undefined;
3864
+ missing?: string[] | undefined;
3865
+ }> | undefined;
3866
+ }>;
3867
+ plans: Record<string, {
3868
+ id: string;
3869
+ versionId: string;
3870
+ available: boolean;
3871
+ name: string;
3872
+ price: string;
3873
+ period: string;
3874
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3875
+ }>;
3876
+ pickers: Record<string, {
3877
+ options: string[];
3878
+ selected: string | null;
3879
+ }>;
3880
+ diagnostics: {
3881
+ nodeId: string;
3882
+ message: string;
3883
+ }[];
3884
+ paywall?: {
3885
+ internal_feature_id: string;
3886
+ name: string;
3887
+ kind: "metered" | "access" | "credit";
3888
+ quantity: string;
3889
+ allowed: boolean;
3890
+ reason: "unavailable" | "insufficient_balance" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "not_entitled" | "capacity_exceeded" | "authentication_required" | null;
3891
+ preview: {
3892
+ scenario: "usage_limit" | "feature_flag";
3893
+ candidates: {
3894
+ productId: string;
3895
+ productVersionId: string;
3896
+ name: string;
3897
+ action: "addon" | "upgrade" | "purchase" | "topup";
3898
+ membershipId: string | null;
3899
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3900
+ amountMinor: string;
3901
+ interval: "free" | "month" | "year" | "week" | "one_time";
3902
+ intervalCount: number;
3903
+ }[];
3904
+ } | null;
3905
+ } | undefined;
3906
+ };
3907
+ content: {
3908
+ environmentId: string;
3909
+ offeringVersionId: string;
3910
+ artifact: {
3911
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
3912
+ formatVersion: number;
3913
+ url: string;
3914
+ sha256: string;
3915
+ byteLength: number;
3916
+ generation?: string | undefined;
3917
+ };
3918
+ };
3919
+ };
3920
+ quote: {
3921
+ operationId: string;
3922
+ entityId: string | null;
3923
+ billingSubscriptionId: string | null;
3924
+ discount: {
3925
+ offerId: string;
3926
+ couponId: string;
3927
+ discount: {
3928
+ type: "percent";
3929
+ percentOff: number;
3930
+ } | {
3931
+ type: "amount";
3932
+ amountOffCents: number;
3933
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3934
+ };
3935
+ duration: {
3936
+ type: "once";
3937
+ } | {
3938
+ type: "repeating";
3939
+ months: number;
3940
+ } | {
3941
+ type: "forever";
3942
+ };
3943
+ amountMinor: number;
3944
+ allocations: {
3945
+ productVersionId: string;
3946
+ amountMinor: number;
3947
+ }[];
3948
+ expiresAt: string;
3949
+ } | null;
3950
+ charge: {
3951
+ effectiveAt: string;
3952
+ periodEndsAt: string;
3953
+ debitMinor: number;
3954
+ discountMinor: number;
3955
+ taxMinor: number;
3956
+ totalMinor: number;
3957
+ } | null;
3958
+ expiresAt: string;
3959
+ provider: "apple" | "google" | "stripe";
3960
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3961
+ lines: {
3962
+ lineId: string;
3963
+ productVersionId: string;
3964
+ productName: string;
3965
+ interval: "free" | "month" | "year" | "week" | "one_time";
3966
+ baseAmountMinor: number;
3967
+ seats: {
3968
+ key: string;
3969
+ quantity: number;
3970
+ includedQuantity: number;
3971
+ maximumQuantity: number;
3972
+ unitAmountMinor: number;
3973
+ }[];
3974
+ catalogAmountMinor: number;
3975
+ trial: {
3976
+ days: number;
3977
+ cardRequired: boolean;
3978
+ } | null;
3979
+ intervalCount?: number | undefined;
3980
+ prepaid?: {
3981
+ itemKey: string;
3982
+ internal_feature_id: string;
3983
+ includedAmount: string;
3984
+ quantity: number;
3985
+ terms: {
3986
+ units: string;
3987
+ prices: {
3988
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3989
+ amountMinor: number;
3990
+ pricing?: {
3991
+ kind: "graduated" | "volume";
3992
+ tiers: {
3993
+ upTo: number | null;
3994
+ unitAmountMinor: number;
3995
+ flatAmountMinor?: number | undefined;
3996
+ }[];
3997
+ } | undefined;
3998
+ }[];
3999
+ minimumQuantity: number;
4000
+ maximumQuantity: number;
4001
+ };
4002
+ unitAmountMinor: number;
4003
+ productId: string | null;
4004
+ priceId: string | null;
4005
+ pricing?: {
4006
+ kind: "graduated" | "volume";
4007
+ tiers: {
4008
+ upTo: number | null;
4009
+ unitAmountMinor: number;
4010
+ flatAmountMinor?: number | undefined;
4011
+ }[];
4012
+ } | undefined;
4013
+ }[] | undefined;
4014
+ }[];
4015
+ catalogAmountMinor: number;
4016
+ automaticTax: boolean;
4017
+ execution: {
4018
+ provider: "stripe";
4019
+ executor: "merchant" | "indiana";
4020
+ accountId: string;
4021
+ mode: "subscription" | "payment";
4022
+ lineItems: {
4023
+ price: string | null;
4024
+ quantity: number;
4025
+ priceId: string;
4026
+ productName: string;
4027
+ amountMinor: number;
4028
+ currency: string;
4029
+ interval: "month" | "year" | "one_off" | "week";
4030
+ intervalCount: number;
4031
+ slot: "stripe_price_id" | "stripe_empty_price_id";
4032
+ tiers: {
4033
+ mode: "graduated" | "volume";
4034
+ tiers: {
4035
+ upTo: number | null;
4036
+ unitAmountMinor: number;
4037
+ flatAmountMinor?: number | undefined;
4038
+ }[];
4039
+ } | null;
4040
+ }[];
4041
+ discounts: {
4042
+ coupon: string;
4043
+ terms: {
4044
+ id: string;
4045
+ name: string;
4046
+ duration: "forever" | "once" | "repeating";
4047
+ percent_off?: number | undefined;
4048
+ amount_off?: number | undefined;
4049
+ currency?: string | undefined;
4050
+ duration_in_months?: number | undefined;
4051
+ };
4052
+ }[];
4053
+ trialPeriodDays: number | null;
4054
+ metadata: {
4055
+ grooveCheckoutId: string;
4056
+ grooveCustomerId: string;
4057
+ };
4058
+ expiresAt: string;
4059
+ invoiceMode?: InvoiceModeParams | undefined;
4060
+ append?: {
4061
+ subscriptionId: string;
4062
+ customerId: string;
4063
+ sourceItems: {
4064
+ id: string;
4065
+ price_id: string;
4066
+ quantity: number;
4067
+ discounts?: {
4068
+ id: string;
4069
+ coupon: string;
4070
+ start: number;
4071
+ end: number | null;
4072
+ }[] | undefined;
4073
+ }[];
4074
+ prorationDate: number;
4075
+ amountMinor: number;
4076
+ periodStartMs: number;
4077
+ periodEndMs: number;
4078
+ } | undefined;
4079
+ } | null;
4080
+ nativeOffer?: {
4081
+ offerKind: "none" | "introductory" | "promotional";
4082
+ offerId: string | null;
4083
+ discountMinor: number;
4084
+ trialDays: number | null;
4085
+ } | undefined;
4086
+ } | null;
4087
+ operation: {
4088
+ operationId: string;
4089
+ orderId: string;
4090
+ status: "pending" | "failed" | "complete" | "cancelled";
4091
+ executor: "merchant" | "indiana";
4092
+ checkoutUrl: string | null;
4093
+ execution: {
4094
+ provider: "stripe";
4095
+ executor: "merchant" | "indiana";
4096
+ accountId: string;
4097
+ mode: "subscription" | "payment";
4098
+ lineItems: {
4099
+ price: string | null;
4100
+ quantity: number;
4101
+ priceId: string;
4102
+ productName: string;
4103
+ amountMinor: number;
4104
+ currency: string;
4105
+ interval: "month" | "year" | "one_off" | "week";
4106
+ intervalCount: number;
4107
+ slot: "stripe_price_id" | "stripe_empty_price_id";
4108
+ tiers: {
4109
+ mode: "graduated" | "volume";
4110
+ tiers: {
4111
+ upTo: number | null;
4112
+ unitAmountMinor: number;
4113
+ flatAmountMinor?: number | undefined;
4114
+ }[];
4115
+ } | null;
4116
+ }[];
4117
+ discounts: {
4118
+ coupon: string;
4119
+ terms: {
4120
+ id: string;
4121
+ name: string;
4122
+ duration: "forever" | "once" | "repeating";
4123
+ percent_off?: number | undefined;
4124
+ amount_off?: number | undefined;
4125
+ currency?: string | undefined;
4126
+ duration_in_months?: number | undefined;
4127
+ };
4128
+ }[];
4129
+ trialPeriodDays: number | null;
4130
+ metadata: {
4131
+ grooveCheckoutId: string;
4132
+ grooveCustomerId: string;
4133
+ };
4134
+ expiresAt: string;
4135
+ invoiceMode?: InvoiceModeParams | undefined;
4136
+ append?: {
4137
+ subscriptionId: string;
4138
+ customerId: string;
4139
+ sourceItems: {
4140
+ id: string;
4141
+ price_id: string;
4142
+ quantity: number;
4143
+ discounts?: {
4144
+ id: string;
4145
+ coupon: string;
4146
+ start: number;
4147
+ end: number | null;
4148
+ }[] | undefined;
4149
+ }[];
4150
+ prorationDate: number;
4151
+ amountMinor: number;
4152
+ periodStartMs: number;
4153
+ periodEndMs: number;
4154
+ } | undefined;
4155
+ } | null;
4156
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4157
+ catalogAmountMinor: number;
4158
+ taxMinor: number;
4159
+ totalMinor: number | null;
4160
+ quoteFinalized: boolean;
4161
+ nativePurchase: {
4162
+ type: "native_purchase";
4163
+ receiptId: string;
4164
+ orderId: string;
4165
+ productVersionId: string;
4166
+ provider: "apple" | "google";
4167
+ productId: string;
4168
+ productKind: "membership" | "lifetime" | "credit_pack";
4169
+ replacement: {
4170
+ sourceOrderId: string;
4171
+ sourceProductId: string;
4172
+ policy: "apple_store" | "google_full_price";
4173
+ sourceAccountTokens: string[];
4174
+ } | null;
4175
+ offerKind: "none" | "introductory" | "promotional";
4176
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4177
+ catalogAmountMinor: number;
4178
+ discountMinor: number;
4179
+ trialDays: number | null;
4180
+ seatBundle: {
4181
+ key: string;
4182
+ quantity: number;
4183
+ }[];
4184
+ applePromotionalOffer: {
4185
+ offerId: string;
4186
+ keyId: string;
4187
+ nonce: string;
4188
+ signature: string;
4189
+ timestamp: number;
4190
+ } | null;
4191
+ appAccountToken?: string | undefined;
4192
+ obfuscatedAccountId?: string | undefined;
4193
+ obfuscatedProfileId?: string | undefined;
4194
+ basePlanId?: string | undefined;
4195
+ offerId?: string | undefined;
4196
+ } | null;
4197
+ append?: boolean | undefined;
4198
+ invoiceMode?: boolean | undefined;
4199
+ } | null;
4200
+ purchaseRequestId: string | null;
4201
+ selectionGeneration?: number | undefined;
4202
+ canReselect?: boolean | undefined;
4203
+ } | null;
4204
+ instruction: {
4205
+ environmentId: string;
4206
+ attributes: Record<string, zod.JSONType>;
4207
+ sticky: Record<string, {
4208
+ attributeName: string;
4209
+ attributeValue: string;
4210
+ assignments: Record<string, string>;
4211
+ }>;
4212
+ policyRevision: number;
4213
+ type: "evaluate_segment";
4214
+ } | {
4215
+ type: "wait";
4216
+ receiptId: string;
4217
+ kind: "operation" | "event" | "timer";
4218
+ deadline: string | null;
4219
+ eventName?: string | undefined;
4220
+ } | {
4221
+ type: "open_url";
4222
+ receiptId: string;
4223
+ url: string;
4224
+ openIn: "same_window" | "new_window";
4225
+ } | {
4226
+ type: "event";
4227
+ receiptId: string;
4228
+ event: string;
4229
+ } | null;
4230
+ pendingRequest: {
4231
+ requestId: string;
4232
+ authenticationRequired: boolean;
4233
+ } | null;
4234
+ runExpiresAt: string;
4235
+ credentialExpiresAt: string | null;
4236
+ };
4237
+ settlement?: {
4238
+ requestId: string;
4239
+ state: "unknown" | "pending" | "settled";
4240
+ operationId: string | null;
4241
+ receiptId?: string | null | undefined;
4242
+ } | undefined;
4243
+ purchase?: {
4244
+ receiptId: string;
4245
+ quote: {
4246
+ operationId: string;
4247
+ entityId: string | null;
4248
+ billingSubscriptionId: string | null;
4249
+ discount: {
4250
+ offerId: string;
4251
+ couponId: string;
4252
+ discount: {
4253
+ type: "percent";
4254
+ percentOff: number;
4255
+ } | {
4256
+ type: "amount";
4257
+ amountOffCents: number;
4258
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4259
+ };
4260
+ duration: {
4261
+ type: "once";
4262
+ } | {
4263
+ type: "repeating";
4264
+ months: number;
4265
+ } | {
4266
+ type: "forever";
4267
+ };
4268
+ amountMinor: number;
4269
+ allocations: {
4270
+ productVersionId: string;
4271
+ amountMinor: number;
4272
+ }[];
4273
+ expiresAt: string;
4274
+ } | null;
4275
+ charge: {
4276
+ effectiveAt: string;
4277
+ periodEndsAt: string;
4278
+ debitMinor: number;
4279
+ discountMinor: number;
4280
+ taxMinor: number;
4281
+ totalMinor: number;
4282
+ } | null;
4283
+ expiresAt: string;
4284
+ provider: "apple" | "google" | "stripe";
4285
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4286
+ lines: {
4287
+ lineId: string;
4288
+ productVersionId: string;
4289
+ productName: string;
4290
+ interval: "free" | "month" | "year" | "week" | "one_time";
4291
+ baseAmountMinor: number;
4292
+ seats: {
4293
+ key: string;
4294
+ quantity: number;
4295
+ includedQuantity: number;
4296
+ maximumQuantity: number;
4297
+ unitAmountMinor: number;
4298
+ }[];
4299
+ catalogAmountMinor: number;
4300
+ trial: {
4301
+ days: number;
4302
+ cardRequired: boolean;
4303
+ } | null;
4304
+ intervalCount?: number | undefined;
4305
+ prepaid?: {
4306
+ itemKey: string;
4307
+ internal_feature_id: string;
4308
+ includedAmount: string;
4309
+ quantity: number;
4310
+ terms: {
4311
+ units: string;
4312
+ prices: {
4313
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4314
+ amountMinor: number;
4315
+ pricing?: {
4316
+ kind: "graduated" | "volume";
4317
+ tiers: {
4318
+ upTo: number | null;
4319
+ unitAmountMinor: number;
4320
+ flatAmountMinor?: number | undefined;
4321
+ }[];
4322
+ } | undefined;
4323
+ }[];
4324
+ minimumQuantity: number;
4325
+ maximumQuantity: number;
4326
+ };
4327
+ unitAmountMinor: number;
4328
+ productId: string | null;
4329
+ priceId: string | null;
4330
+ pricing?: {
4331
+ kind: "graduated" | "volume";
4332
+ tiers: {
4333
+ upTo: number | null;
4334
+ unitAmountMinor: number;
4335
+ flatAmountMinor?: number | undefined;
4336
+ }[];
4337
+ } | undefined;
4338
+ }[] | undefined;
4339
+ }[];
4340
+ catalogAmountMinor: number;
4341
+ automaticTax: boolean;
4342
+ execution: {
4343
+ provider: "stripe";
4344
+ executor: "merchant" | "indiana";
4345
+ accountId: string;
4346
+ mode: "subscription" | "payment";
4347
+ lineItems: {
4348
+ price: string | null;
4349
+ quantity: number;
4350
+ priceId: string;
4351
+ productName: string;
4352
+ amountMinor: number;
4353
+ currency: string;
4354
+ interval: "month" | "year" | "one_off" | "week";
4355
+ intervalCount: number;
4356
+ slot: "stripe_price_id" | "stripe_empty_price_id";
4357
+ tiers: {
4358
+ mode: "graduated" | "volume";
4359
+ tiers: {
4360
+ upTo: number | null;
4361
+ unitAmountMinor: number;
4362
+ flatAmountMinor?: number | undefined;
4363
+ }[];
4364
+ } | null;
4365
+ }[];
4366
+ discounts: {
4367
+ coupon: string;
4368
+ terms: {
4369
+ id: string;
4370
+ name: string;
4371
+ duration: "forever" | "once" | "repeating";
4372
+ percent_off?: number | undefined;
4373
+ amount_off?: number | undefined;
4374
+ currency?: string | undefined;
4375
+ duration_in_months?: number | undefined;
4376
+ };
4377
+ }[];
4378
+ trialPeriodDays: number | null;
4379
+ metadata: {
4380
+ grooveCheckoutId: string;
4381
+ grooveCustomerId: string;
4382
+ };
4383
+ expiresAt: string;
4384
+ invoiceMode?: InvoiceModeParams | undefined;
4385
+ append?: {
4386
+ subscriptionId: string;
4387
+ customerId: string;
4388
+ sourceItems: {
4389
+ id: string;
4390
+ price_id: string;
4391
+ quantity: number;
4392
+ discounts?: {
4393
+ id: string;
4394
+ coupon: string;
4395
+ start: number;
4396
+ end: number | null;
4397
+ }[] | undefined;
4398
+ }[];
4399
+ prorationDate: number;
4400
+ amountMinor: number;
4401
+ periodStartMs: number;
4402
+ periodEndMs: number;
4403
+ } | undefined;
4404
+ } | null;
4405
+ nativeOffer?: {
4406
+ offerKind: "none" | "introductory" | "promotional";
4407
+ offerId: string | null;
4408
+ discountMinor: number;
4409
+ trialDays: number | null;
4410
+ } | undefined;
4411
+ } | null;
4412
+ operation: {
4413
+ operationId: string;
4414
+ orderId: string;
4415
+ status: "pending" | "failed" | "complete" | "cancelled";
4416
+ executor: "merchant" | "indiana";
4417
+ checkoutUrl: string | null;
4418
+ execution: {
4419
+ provider: "stripe";
4420
+ executor: "merchant" | "indiana";
4421
+ accountId: string;
4422
+ mode: "subscription" | "payment";
4423
+ lineItems: {
4424
+ price: string | null;
4425
+ quantity: number;
4426
+ priceId: string;
4427
+ productName: string;
4428
+ amountMinor: number;
4429
+ currency: string;
4430
+ interval: "month" | "year" | "one_off" | "week";
4431
+ intervalCount: number;
4432
+ slot: "stripe_price_id" | "stripe_empty_price_id";
4433
+ tiers: {
4434
+ mode: "graduated" | "volume";
4435
+ tiers: {
4436
+ upTo: number | null;
4437
+ unitAmountMinor: number;
4438
+ flatAmountMinor?: number | undefined;
4439
+ }[];
4440
+ } | null;
4441
+ }[];
4442
+ discounts: {
4443
+ coupon: string;
4444
+ terms: {
4445
+ id: string;
4446
+ name: string;
4447
+ duration: "forever" | "once" | "repeating";
4448
+ percent_off?: number | undefined;
4449
+ amount_off?: number | undefined;
4450
+ currency?: string | undefined;
4451
+ duration_in_months?: number | undefined;
4452
+ };
4453
+ }[];
4454
+ trialPeriodDays: number | null;
4455
+ metadata: {
4456
+ grooveCheckoutId: string;
4457
+ grooveCustomerId: string;
4458
+ };
4459
+ expiresAt: string;
4460
+ invoiceMode?: InvoiceModeParams | undefined;
4461
+ append?: {
4462
+ subscriptionId: string;
4463
+ customerId: string;
4464
+ sourceItems: {
4465
+ id: string;
4466
+ price_id: string;
4467
+ quantity: number;
4468
+ discounts?: {
4469
+ id: string;
4470
+ coupon: string;
4471
+ start: number;
4472
+ end: number | null;
4473
+ }[] | undefined;
4474
+ }[];
4475
+ prorationDate: number;
4476
+ amountMinor: number;
4477
+ periodStartMs: number;
4478
+ periodEndMs: number;
4479
+ } | undefined;
4480
+ } | null;
4481
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4482
+ catalogAmountMinor: number;
4483
+ taxMinor: number;
4484
+ totalMinor: number | null;
4485
+ quoteFinalized: boolean;
4486
+ nativePurchase: {
4487
+ type: "native_purchase";
4488
+ receiptId: string;
4489
+ orderId: string;
4490
+ productVersionId: string;
4491
+ provider: "apple" | "google";
4492
+ productId: string;
4493
+ productKind: "membership" | "lifetime" | "credit_pack";
4494
+ replacement: {
4495
+ sourceOrderId: string;
4496
+ sourceProductId: string;
4497
+ policy: "apple_store" | "google_full_price";
4498
+ sourceAccountTokens: string[];
4499
+ } | null;
4500
+ offerKind: "none" | "introductory" | "promotional";
4501
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
4502
+ catalogAmountMinor: number;
4503
+ discountMinor: number;
4504
+ trialDays: number | null;
4505
+ seatBundle: {
4506
+ key: string;
4507
+ quantity: number;
4508
+ }[];
4509
+ applePromotionalOffer: {
4510
+ offerId: string;
4511
+ keyId: string;
4512
+ nonce: string;
4513
+ signature: string;
4514
+ timestamp: number;
4515
+ } | null;
4516
+ appAccountToken?: string | undefined;
4517
+ obfuscatedAccountId?: string | undefined;
4518
+ obfuscatedProfileId?: string | undefined;
4519
+ basePlanId?: string | undefined;
4520
+ offerId?: string | undefined;
4521
+ } | null;
4522
+ append?: boolean | undefined;
4523
+ invoiceMode?: boolean | undefined;
4524
+ } | null;
4525
+ canReselect?: boolean | undefined;
4526
+ } | undefined;
4527
+ review?: {
4528
+ activeOperationId: string | null;
4529
+ pages: {
4530
+ receiptId: string;
4531
+ nodeId: string;
4532
+ visit: number;
4533
+ }[];
4534
+ page: {
4535
+ receiptId: string;
4536
+ nodeId: string;
4537
+ visit: number;
4538
+ document: {
4539
+ kind: "screen";
4540
+ schemaVersion: 4;
4541
+ name: string;
4542
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
4543
+ presentation: {
4544
+ type: "modal";
4545
+ size: "sm" | "md" | "lg";
4546
+ } | {
4547
+ type: "sheet";
4548
+ size: "sm" | "md" | "lg";
4549
+ } | {
4550
+ type: "fullscreen";
4551
+ } | {
4552
+ type: "inline";
4553
+ };
4554
+ theme: {
4555
+ primary: string;
4556
+ background: string;
4557
+ text: string;
4558
+ radius: "none" | "sm" | "md" | "lg" | "full";
4559
+ font: "system" | "serif" | "rounded" | "mono";
4560
+ };
4561
+ pages: {
4562
+ id: string;
4563
+ name: string;
4564
+ root: StackNode;
4565
+ theme?: {
4566
+ primary: string;
4567
+ background: string;
4568
+ text: string;
4569
+ radius: "none" | "sm" | "md" | "lg" | "full";
4570
+ font: "system" | "serif" | "rounded" | "mono";
4571
+ } | undefined;
4572
+ editorPosition?: {
4573
+ x: number;
4574
+ y: number;
4575
+ } | undefined;
4576
+ }[];
4577
+ strings: {
4578
+ defaultLocale: string;
4579
+ locales: Record<string, Record<string, string>>;
4580
+ };
4581
+ actions: ({
4582
+ type: "navigate";
4583
+ close: false;
4584
+ pageId: string;
4585
+ id: string;
4586
+ event: string;
4587
+ properties: Record<string, string | number | boolean | null>;
4588
+ } | {
4589
+ type: "event";
4590
+ close: boolean;
4591
+ id: string;
4592
+ event: string;
4593
+ properties: Record<string, string | number | boolean | null>;
4594
+ } | {
4595
+ type: "close";
4596
+ close: true;
4597
+ id: string;
4598
+ event: string;
4599
+ properties: Record<string, string | number | boolean | null>;
4600
+ } | {
4601
+ type: "open_url";
4602
+ close: boolean;
4603
+ url: string;
4604
+ id: string;
4605
+ event: string;
4606
+ properties: Record<string, string | number | boolean | null>;
4607
+ } | {
4608
+ type: "claim_offer";
4609
+ close: boolean;
4610
+ couponId: string;
4611
+ id: string;
4612
+ event: string;
4613
+ properties: Record<string, string | number | boolean | null>;
4614
+ })[];
4615
+ initialPageId?: string | undefined;
4616
+ };
4617
+ answers: Record<string, string | boolean | string[]>;
4618
+ inputs: {
4619
+ variable: string;
4620
+ componentId: string;
4621
+ required: boolean;
4622
+ }[];
4623
+ values?: Record<string, zod.JSONType> | undefined;
4624
+ } | null;
4625
+ coupons: {
4626
+ grantId: string;
4627
+ status: "unknown" | "expired" | "issued" | "reserved" | "redeemed" | "revoked";
4628
+ expiresAt: string | null;
4629
+ }[];
4630
+ purchases: {
4631
+ receiptId: string;
4632
+ operationId: string;
4633
+ status: "unknown" | "pending" | "failed" | "complete" | "cancelled";
4634
+ }[];
4635
+ } | undefined;
4636
+ runToken?: string | undefined;
4637
+ customerId?: string | undefined;
4638
+ } | {
4639
+ scope: {
4640
+ projectId: string;
4641
+ environment: "sandbox" | "live";
4642
+ };
4643
+ suppressed: true;
4644
+ reason: "frequency" | "in_progress";
4645
+ retryAt: string;
4646
+ }>;
4647
+ };
4648
+
4649
+ export { ConfigurationSync, FeatureClientOptions, type FunnelDecisionInput, FunnelDecisionTimeoutError, type FunnelDecisionUsedInput, type FunnelLocalEvaluation, type FunnelLocalEvaluator, type FunnelLocalEvaluatorOptions, type FunnelLocalSession, type FunnelLocalSessionOptions, type FunnelSignalInput, IndianaError, IndianaServerOptions, createFunnelCampaignClient, createFunnelDecisionClient, createFunnelLocalEvaluator, createFunnelOrchestrationClient, createGuestToken, createIndianaServer, createNativeReceiptClient, createPaywallStartClient, createSynchronizedFunnelLocalEvaluator, renewFunnelRun };