@tinkerlandai/indiana-sdk 0.8.0 → 0.8.1

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