@tinkerlandai/longplay-sdk 0.10.23 → 0.10.25

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 (60) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +79 -0
  3. package/README.zh-CN.md +31 -0
  4. package/dist/{ai-usage-WFwbPTiq.d.ts → ai-usage-B6RepnmH.d.ts} +1 -1
  5. package/dist/{api-rZ_QoNQi.d.ts → api-C9P338XT.d.ts} +1547 -6
  6. package/dist/{chunk-5SHVM4AF.js → chunk-2KI63SPJ.js} +2 -2
  7. package/dist/{chunk-7MF2YMN4.js → chunk-2ZJ5CS5Q.js} +1 -1
  8. package/dist/chunk-34I23EKZ.js +1 -0
  9. package/dist/{chunk-XFO4FBFG.js → chunk-5HJMAZ7A.js} +1 -1
  10. package/dist/chunk-7AXCG6NU.js +1 -0
  11. package/dist/chunk-BB5P5HPS.js +1 -0
  12. package/dist/chunk-C2BODHNY.js +1 -0
  13. package/dist/chunk-EIYWDWXP.js +1 -0
  14. package/dist/chunk-LFFBNGXP.js +1 -0
  15. package/dist/{chunk-HDVLCRC6.js → chunk-MHEYMXGZ.js} +2 -2
  16. package/dist/{chunk-EZLLTGV3.js → chunk-ML3BIPM6.js} +1 -1
  17. package/dist/{chunk-KZ63ANBP.js → chunk-O3LZPMS4.js} +1 -1
  18. package/dist/chunk-O4535GJR.js +6 -0
  19. package/dist/{chunk-PKLLZXNM.js → chunk-OEH47Y2L.js} +1 -1
  20. package/dist/chunk-RKREEPCT.js +1 -0
  21. package/dist/{chunk-QVGTHPWT.js → chunk-SJNF6JDJ.js} +1 -1
  22. package/dist/chunk-THGLNE4K.js +1 -0
  23. package/dist/chunk-TUYBXAAK.js +1 -0
  24. package/dist/chunk-ZX2RWS3T.js +1 -0
  25. package/dist/content-FD2Q6XD6.js +1 -0
  26. package/dist/{coupon-Btz_KFKp.d.ts → coupon-DyKA-BRG.d.ts} +8 -0
  27. package/dist/funnel-host-purchase-XW7IF52Y.js +1 -0
  28. package/dist/{funnel-local-client-BYdKGnMb.d.ts → funnel-local-client-CSA9XoC4.d.ts} +3270 -32
  29. package/dist/{funnel-node-evaluation-eLMEZIFz.d.ts → funnel-node-evaluation-Cg-4tcAs.d.ts} +88 -0
  30. package/dist/funnel-process-client-RXgS2i-R.d.ts +23184 -0
  31. package/dist/funnel-runtime-host-I6PJXVRC.js +1 -0
  32. package/dist/index.d.ts +1219 -31
  33. package/dist/index.js +1 -1
  34. package/dist/native-shell.js +1 -1
  35. package/dist/openrouter.d.ts +2 -2
  36. package/dist/openrouter.js +1 -1
  37. package/dist/page.js +1 -1
  38. package/dist/paywall-CGBFHFRU.js +1 -0
  39. package/dist/popup.d.ts +3 -3
  40. package/dist/popup.js +1 -1
  41. package/dist/{presentation-loading-Ctk1djAi.d.ts → presentation-loading-D0A9G_kT.d.ts} +16 -2
  42. package/dist/react-native.d.ts +6 -6
  43. package/dist/react-native.js +1 -1
  44. package/dist/screen-renderer-WOMWOEYL.js +1 -0
  45. package/dist/server.d.ts +2402 -17
  46. package/dist/server.js +1 -1
  47. package/dist/visual.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-3J24TUO7.js +0 -1
  50. package/dist/chunk-6DTGBDYG.js +0 -1
  51. package/dist/chunk-DUZ2E7BK.js +0 -1
  52. package/dist/chunk-IIYIIXNB.js +0 -1
  53. package/dist/chunk-KRQESEG2.js +0 -6
  54. package/dist/chunk-WMIDEJTZ.js +0 -1
  55. package/dist/chunk-YAVWELIV.js +0 -1
  56. package/dist/content-FM52HLRX.js +0 -1
  57. package/dist/funnel-process-client-C87pmLC9.d.ts +0 -64499
  58. package/dist/funnel-runtime-host-MZKLVLC4.js +0 -1
  59. package/dist/paywall-JL4SXFXT.js +0 -1
  60. package/dist/screen-renderer-TEVGVUT5.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import { z } from 'zod';
2
- import { S as ScreenAnswers, P as PresentationLoadingOptions, s as screenInputBindingsSchema, a as SurfaceData, C as CustomerDataIntent } from './presentation-loading-Ctk1djAi.js';
3
- export { b as PresentationState } from './presentation-loading-Ctk1djAi.js';
2
+ import { S as ScreenAnswers, P as PresentationLoadingOptions, s as screenInputBindingsSchema, a as SurfaceData, C as CustomerDataIntent, c as createPresentationLoading } from './presentation-loading-D0A9G_kT.js';
3
+ export { b as PresentationState } from './presentation-loading-D0A9G_kT.js';
4
4
  import { J as JsonValue } from './growth-rules-B4YYy64R.js';
5
5
  import { S as StackNode, a as ScreenSelection } from './screen-DRP7nsrQ.js';
6
- import { P as PaywallSession, S as SubscriptionOperation, F as FunnelRunController, a as FunnelRunView, b as PaywallRecovery, c as FunnelCommandStorage, I as IndianaOptions, d as IamFunnelEntryDelivery, e as FunnelProcessRunView } from './funnel-local-client-BYdKGnMb.js';
7
- export { C as CustomerSession, f as FeatureClient, g as FeatureClientOptions, h as FunnelControllerResponse, i as FunnelPendingEntry, j as FunnelPurchaseRecovery, k as FunnelRuntimeResponse, l as FunnelSegmentPrediction, L as LocalFunnelClient, m as LocalFunnelClientOptions, n as LongplayError, o as PaywallPurchaseInput, p as PaywallStartInput, q as PushHost, r as PushJournal, s as SessionCredentials, t as createFeatureClient, u as createFunnelRunController, v as createLocalFunnelClient, w as createPaywallSession, x as getPaywallRecovery, y as preparePaywallFallback } from './funnel-local-client-BYdKGnMb.js';
8
- import { E as EntitlementCheckResult, M as MerchantBridgeManifest } from './funnel-node-evaluation-eLMEZIFz.js';
9
- export { a as EntitlementCheckInput, b as EntitlementCheckObservation, c as EntitlementRequirement, F as FunnelNodeEvaluationContext, e as evaluateFunnelNode } from './funnel-node-evaluation-eLMEZIFz.js';
10
- import { C as CouponInput } from './coupon-Btz_KFKp.js';
11
- export { O as Offer, a as OfferUnavailableReason } from './coupon-Btz_KFKp.js';
12
- import { c as createFunnelProcess } from './funnel-process-client-C87pmLC9.js';
13
- export { F as FunnelProcessAdapter, a as FunnelProcessOptions, b as FunnelResourceSource, I as LongplayFeatureOptions, d as createFunnelClient, e as createLongplay } from './funnel-process-client-C87pmLC9.js';
6
+ import { P as PaywallSession, S as SubscriptionOperation, F as FunnelRunController, a as FunnelRunView, b as PaywallRecovery, c as FunnelCommandStorage, s as scopeSchema, I as IndianaOptions, d as SessionCredentials, e as FunnelExecutionPolicy, f as SubscriptionAttachQuote, g as FunnelStartInput, h as IamFunnelEntryDelivery, i as FunnelProcessRunView } from './funnel-local-client-CSA9XoC4.js';
7
+ export { C as CustomerSession, j as FeatureClient, k as FeatureClientOptions, l as FunnelControllerResponse, m as FunnelPendingEntry, n as FunnelPurchaseRecovery, o as FunnelRuntimeResponse, p as FunnelSegmentPrediction, L as LocalFunnelClient, q as LocalFunnelClientOptions, r as LongplayError, t as PaywallPurchaseInput, u as PaywallStartInput, v as PushHost, w as PushJournal, x as createFeatureClient, y as createFunnelRunController, z as createLocalFunnelClient, A as createPaywallSession, B as getPaywallRecovery, D as preparePaywallFallback } from './funnel-local-client-CSA9XoC4.js';
8
+ import { E as EntitlementCheckResult, M as MerchantBridgeManifest } from './funnel-node-evaluation-Cg-4tcAs.js';
9
+ export { a as EntitlementCheckInput, b as EntitlementCheckObservation, c as EntitlementRequirement, F as FunnelNodeEvaluationContext, e as evaluateFunnelNode } from './funnel-node-evaluation-Cg-4tcAs.js';
10
+ import { C as CouponInput } from './coupon-DyKA-BRG.js';
11
+ export { O as Offer, a as OfferUnavailableReason } from './coupon-DyKA-BRG.js';
12
+ import { c as createFunnelProcess } from './funnel-process-client-RXgS2i-R.js';
13
+ export { F as FunnelProcessAdapter, a as FunnelProcessOptions, b as FunnelResourceSource, I as LongplayFeatureOptions, d as createFunnelClient, e as createLongplay } from './funnel-process-client-RXgS2i-R.js';
14
14
  export { C as ConfigurationStorage, a as ConfigurationSync, b as ConfigurationSyncOptions, c as createConfigurationSync } from './configuration-sync-eEFj_oKG.js';
15
- import './api-rZ_QoNQi.js';
15
+ import './api-C9P338XT.js';
16
16
  import 'zod/v4';
17
17
 
18
18
  /** Currency always comes from business data; locale only controls notation. No currency conversion. */
@@ -255,6 +255,8 @@ type ContentHostOptions = PresentationLoadingOptions & {
255
255
  content: ContentVersion;
256
256
  locale?: string;
257
257
  inputs?: Record<string, JsonValue>;
258
+ /** Host-owned display inputs that may change in place. All other inputs stay frozen. */
259
+ mutableInputs?: readonly string[];
258
260
  bindings?: z.infer<typeof screenInputBindingsSchema>;
259
261
  capabilities?: SurfaceData;
260
262
  actions: Record<string, (intent: ContentActionIntent) => unknown | Promise<unknown>>;
@@ -273,7 +275,9 @@ declare function mountContent$1(container: HTMLElement, options: ContentHostOpti
273
275
  show: () => void;
274
276
  readonly pendingAction: ContentActionIntent | null;
275
277
  retryAction: () => Promise<void>;
276
- updateCapabilities: (data: SurfaceData) => void | undefined;
278
+ /** Patch declared mutable inputs without replacing the presentation or an accepted action. */
279
+ updateInputs(patch: Record<string, JsonValue>): void;
280
+ updateCapabilities(data: SurfaceData): void;
277
281
  }>;
278
282
  /** Prepare already-resolved content without displaying it or executing actions.
279
283
  * Resolves after the first render. Call show() from the opening click. */
@@ -282,7 +286,9 @@ declare function prepareContent$1(container: HTMLElement, options: ContentHostOp
282
286
  show: () => void;
283
287
  readonly pendingAction: ContentActionIntent | null;
284
288
  retryAction: () => Promise<void>;
285
- updateCapabilities: (data: SurfaceData) => void | undefined;
289
+ /** Patch declared mutable inputs without replacing the presentation or an accepted action. */
290
+ updateInputs(patch: Record<string, JsonValue>): void;
291
+ updateCapabilities(data: SurfaceData): void;
286
292
  }>;
287
293
 
288
294
  /** Display intent only. The merchant still authorizes any subsequent purchase. */
@@ -308,6 +314,8 @@ type PaywallHostOptions = PresentationLoadingOptions & {
308
314
  signal: AbortSignal;
309
315
  }) => unknown | Promise<unknown>;
310
316
  onCheckoutUrl?: (url: string) => unknown;
317
+ /** Recovery waits for Continue checkout; an active explicit confirmation can navigate once. */
318
+ checkoutNavigation?: "automatic" | "after_confirmation";
311
319
  /** Explicit merchant selection from the Customer's claimed offers. The server validates eligibility. */
312
320
  resolveOfferId?: (purchase: {
313
321
  actionId: string;
@@ -329,6 +337,7 @@ type FunnelHostOptions = PresentationLoadingOptions & {
329
337
  appManifestRelease?: string;
330
338
  onPurchase?: PaywallHostOptions["onPurchase"];
331
339
  onCheckoutUrl?: PaywallHostOptions["onCheckoutUrl"];
340
+ checkoutNavigation?: PaywallHostOptions["checkoutNavigation"];
332
341
  resolveOfferId?: PaywallHostOptions["resolveOfferId"];
333
342
  /**
334
343
  * Opens an external page or a Paywall link. Return `false` (or throw) when the page could not be
@@ -351,7 +360,7 @@ type FunnelHostOptions = PresentationLoadingOptions & {
351
360
  * A current-protocol host. Refresh, rendering and shown telemetry never authorize a purchase.
352
361
  * A Run the controller already holds renders at once; with none yet, the first read comes first.
353
362
  */
354
- declare function showFunnelRun$1(container: HTMLElement, input: FunnelHostOptions): Promise<{
363
+ declare function showFunnelRun$1(container: HTMLElement, input: FunnelHostOptions, initialLoading?: ReturnType<typeof createPresentationLoading>): Promise<{
355
364
  destroy: () => void;
356
365
  refresh: () => Promise<void>;
357
366
  readonly recovery: PaywallRecovery;
@@ -360,6 +369,1187 @@ declare function showFunnelRun$1(container: HTMLElement, input: FunnelHostOption
360
369
  exitReview: () => Promise<void>;
361
370
  readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
362
371
  }>;
372
+ /** Share an authenticated purchase observation and its current loading lifecycle. */
373
+ declare function showObservedFunnelRun(container: HTMLElement, input: FunnelHostOptions, initialLoading?: ReturnType<typeof createPresentationLoading>): Promise<{
374
+ destroy: () => void;
375
+ refresh: () => Promise<void>;
376
+ readonly recovery: PaywallRecovery;
377
+ prepareFallback(): Promise<PaywallRecovery>;
378
+ review: (receiptId?: string) => Promise<void>;
379
+ exitReview: () => Promise<void>;
380
+ readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
381
+ }>;
382
+
383
+ interface FunnelStorageLocks {
384
+ request<T>(name: string, options: {
385
+ mode: "exclusive";
386
+ }, work: () => T | PromiseLike<T>): Promise<T>;
387
+ }
388
+ /** Web Locks serialize the revision CAS across tabs; localStorage survives a
389
+ * reload. The key hashes the original credential; no credential is stored. */
390
+ declare function createBrowserFunnelCommandStorage(input: {
391
+ baseUrl?: string;
392
+ runToken: string;
393
+ storage?: Storage;
394
+ locks?: FunnelStorageLocks;
395
+ }): FunnelCommandStorage;
396
+
397
+ declare const funnelPurchaseEntrySchema: z.ZodObject<{
398
+ schemaVersion: z.ZodLiteral<1>;
399
+ baseUrl: z.ZodURL;
400
+ scope: z.ZodObject<{
401
+ projectId: z.ZodString;
402
+ environment: z.ZodEnum<{
403
+ sandbox: "sandbox";
404
+ live: "live";
405
+ }>;
406
+ }, z.core.$strict>;
407
+ customerId: z.ZodUUID;
408
+ sessionId: z.ZodUUID;
409
+ start: z.ZodObject<{
410
+ operation: z.ZodLiteral<"start">;
411
+ funnelId: z.ZodUUID;
412
+ requestId: z.ZodUUID;
413
+ customer: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
414
+ type: z.ZodLiteral<"id">;
415
+ value: z.ZodUUID;
416
+ }, z.core.$strict>, z.ZodObject<{
417
+ type: z.ZodLiteral<"externalUserId">;
418
+ value: z.ZodString;
419
+ }, z.core.$strict>], "type">>;
420
+ customerData: z.ZodOptional<z.ZodObject<{
421
+ name: z.ZodOptional<z.ZodString>;
422
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
423
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
424
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
425
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
426
+ }, z.core.$loose>>>;
427
+ fingerprint: z.ZodOptional<z.ZodString>;
428
+ }, z.core.$strict>>;
429
+ locale: z.ZodString;
430
+ parameters: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
431
+ }, z.core.$strict>;
432
+ allowed: z.ZodArray<z.ZodEnum<{
433
+ merchant: "merchant";
434
+ indiana: "indiana";
435
+ record_only: "record_only";
436
+ native: "native";
437
+ }>>;
438
+ run: z.ZodOptional<z.ZodObject<{
439
+ id: z.ZodUUID;
440
+ versionId: z.ZodUUID;
441
+ status: z.ZodEnum<{
442
+ failed: "failed";
443
+ running: "running";
444
+ completed: "completed";
445
+ closed: "closed";
446
+ ineligible: "ineligible";
447
+ waiting: "waiting";
448
+ }>;
449
+ revision: z.ZodNumber;
450
+ runExpiresAt: z.ZodOptional<z.ZodISODateTime>;
451
+ }, z.core.$strict>>;
452
+ purchases: z.ZodArray<z.ZodObject<{
453
+ receiptId: z.ZodUUID;
454
+ operationId: z.ZodUUID;
455
+ terminal: z.ZodNullable<z.ZodEnum<{
456
+ complete: "complete";
457
+ native: "native";
458
+ }>>;
459
+ }, z.core.$strict>>;
460
+ operationCommand: z.ZodOptional<z.ZodObject<{
461
+ operationId: z.ZodUUID;
462
+ intent: z.ZodLiteral<"confirm">;
463
+ }, z.core.$strict>>;
464
+ journal: z.ZodObject<{
465
+ revision: z.ZodNumber;
466
+ entry: z.ZodNullable<z.ZodObject<{
467
+ schemaVersion: z.ZodLiteral<1>;
468
+ scope: z.ZodObject<{
469
+ projectId: z.ZodString;
470
+ environment: z.ZodEnum<{
471
+ sandbox: "sandbox";
472
+ live: "live";
473
+ }>;
474
+ }, z.core.$strict>;
475
+ runId: z.ZodUUID;
476
+ funnelId: z.ZodUUID;
477
+ versionId: z.ZodUUID;
478
+ processBindingIds: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodNullable<z.ZodUUID>>>;
479
+ command: z.ZodOptional<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
480
+ operation: z.ZodLiteral<"start">;
481
+ funnelId: z.ZodUUID;
482
+ requestId: z.ZodUUID;
483
+ customer: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
484
+ type: z.ZodLiteral<"id">;
485
+ value: z.ZodUUID;
486
+ }, z.core.$strict>, z.ZodObject<{
487
+ type: z.ZodLiteral<"externalUserId">;
488
+ value: z.ZodString;
489
+ }, z.core.$strict>], "type">>;
490
+ customerData: z.ZodOptional<z.ZodObject<{
491
+ name: z.ZodOptional<z.ZodString>;
492
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
493
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
494
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
495
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
496
+ }, z.core.$loose>>>;
497
+ fingerprint: z.ZodOptional<z.ZodString>;
498
+ }, z.core.$strict>>;
499
+ locale: z.ZodString;
500
+ parameters: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
501
+ }, z.core.$strict>, z.ZodObject<{
502
+ operation: z.ZodLiteral<"get">;
503
+ settlementRequestId: z.ZodOptional<z.ZodUUID>;
504
+ data: z.ZodOptional<z.ZodObject<{
505
+ nodeId: z.ZodString;
506
+ visit: z.ZodNumber;
507
+ revision: z.ZodNumber;
508
+ components: z.ZodRecord<z.ZodString, z.ZodObject<{
509
+ resourceKey: z.ZodOptional<z.ZodString>;
510
+ page: z.ZodNumber;
511
+ after: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
512
+ kind: z.ZodLiteral<"ledger">;
513
+ cursor: z.ZodObject<{
514
+ at: z.ZodISODateTime;
515
+ id: z.ZodUUID;
516
+ type: z.ZodEnum<{
517
+ invoice: "invoice";
518
+ usage: "usage";
519
+ source: "source";
520
+ debt: "debt";
521
+ transaction: "transaction";
522
+ settlement: "settlement";
523
+ }>;
524
+ }, z.core.$strict>;
525
+ }, z.core.$strict>, z.ZodObject<{
526
+ kind: z.ZodLiteral<"billing">;
527
+ cursor: z.ZodUUID;
528
+ }, z.core.$strict>], "kind">>;
529
+ filter: z.ZodEnum<{
530
+ purchase: "purchase";
531
+ refund: "refund";
532
+ expired: "expired";
533
+ revoked: "revoked";
534
+ usage: "usage";
535
+ all: "all";
536
+ source: "source";
537
+ issued: "issued";
538
+ reserved: "reserved";
539
+ redeemed: "redeemed";
540
+ debt: "debt";
541
+ settlement: "settlement";
542
+ }>;
543
+ }, z.core.$strict>>;
544
+ }, z.core.$strict>>;
545
+ purchase: z.ZodOptional<z.ZodObject<{
546
+ receiptId: z.ZodUUID;
547
+ operationId: z.ZodUUID;
548
+ }, z.core.$strict>>;
549
+ customerToken: z.ZodOptional<z.ZodString>;
550
+ }, z.core.$strict>, z.ZodObject<{
551
+ operation: z.ZodLiteral<"resume">;
552
+ requestId: z.ZodUUID;
553
+ customerToken: z.ZodOptional<z.ZodString>;
554
+ }, z.core.$strict>, z.ZodObject<{
555
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
556
+ type: z.ZodLiteral<"screen">;
557
+ output: z.ZodString;
558
+ answers: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
559
+ selection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>>;
560
+ }, z.core.$strict>, z.ZodObject<{
561
+ type: z.ZodLiteral<"paywall_quote">;
562
+ featureQuantities: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodNumber>>;
563
+ actionId: z.ZodString;
564
+ productVersionId: z.ZodUUID;
565
+ offerId: z.ZodOptional<z.ZodUUID>;
566
+ nativeOffer: z.ZodOptional<z.ZodObject<{
567
+ offerKind: z.ZodEnum<{
568
+ none: "none";
569
+ introductory: "introductory";
570
+ promotional: "promotional";
571
+ }>;
572
+ offerId: z.ZodNullable<z.ZodString>;
573
+ discountMinor: z.ZodNumber;
574
+ trialDays: z.ZodNullable<z.ZodNumber>;
575
+ }, z.core.$strict>>;
576
+ predecessor: z.ZodOptional<z.ZodObject<{
577
+ operationId: z.ZodNullable<z.ZodUUID>;
578
+ generation: z.ZodNumber;
579
+ }, z.core.$strict>>;
580
+ }, z.core.$strict>, z.ZodObject<{
581
+ type: z.ZodLiteral<"paywall_confirm">;
582
+ operationId: z.ZodUUID;
583
+ }, z.core.$strict>, z.ZodObject<{
584
+ type: z.ZodLiteral<"paywall_cancel">;
585
+ operationId: z.ZodUUID;
586
+ }, z.core.$strict>, z.ZodObject<{
587
+ type: z.ZodLiteral<"client_action">;
588
+ receiptId: z.ZodUUID;
589
+ outcome: z.ZodEnum<{
590
+ success: "success";
591
+ cancel: "cancel";
592
+ failed: "failed";
593
+ opened: "opened";
594
+ failure: "failure";
595
+ }>;
596
+ }, z.core.$strict>], "type">;
597
+ requestId: z.ZodUUID;
598
+ nodeId: z.ZodString;
599
+ visit: z.ZodNumber;
600
+ revision: z.ZodNumber;
601
+ customerToken: z.ZodOptional<z.ZodString>;
602
+ operation: z.ZodLiteral<"submit">;
603
+ }, z.core.$strict>, z.ZodObject<{
604
+ requestId: z.ZodUUID;
605
+ nodeId: z.ZodString;
606
+ visit: z.ZodNumber;
607
+ revision: z.ZodNumber;
608
+ customerToken: z.ZodOptional<z.ZodString>;
609
+ operation: z.ZodLiteral<"back">;
610
+ }, z.core.$strict>, z.ZodObject<{
611
+ requestId: z.ZodUUID;
612
+ nodeId: z.ZodString;
613
+ visit: z.ZodNumber;
614
+ revision: z.ZodNumber;
615
+ customerToken: z.ZodOptional<z.ZodString>;
616
+ operation: z.ZodLiteral<"shown">;
617
+ }, z.core.$strict>, z.ZodObject<{
618
+ requestId: z.ZodUUID;
619
+ nodeId: z.ZodString;
620
+ visit: z.ZodNumber;
621
+ revision: z.ZodNumber;
622
+ customerToken: z.ZodOptional<z.ZodString>;
623
+ operation: z.ZodLiteral<"close">;
624
+ }, z.core.$strict>, z.ZodObject<{
625
+ policyRevision: z.ZodNumber;
626
+ generation: z.ZodString;
627
+ requestId: z.ZodUUID;
628
+ nodeId: z.ZodString;
629
+ visit: z.ZodNumber;
630
+ revision: z.ZodNumber;
631
+ customerToken: z.ZodOptional<z.ZodString>;
632
+ operation: z.ZodLiteral<"commit_segment">;
633
+ }, z.core.$strict>, z.ZodObject<{
634
+ operation: z.ZodLiteral<"review">;
635
+ receiptId: z.ZodOptional<z.ZodUUID>;
636
+ customerToken: z.ZodOptional<z.ZodString>;
637
+ }, z.core.$strict>], "operation">, z.ZodTransform<{
638
+ operation: "resume";
639
+ requestId: string;
640
+ customerToken?: string | undefined;
641
+ } | {
642
+ input: {
643
+ type: "screen";
644
+ output: string;
645
+ answers: Record<string, string | boolean | string[]>;
646
+ selection?: Record<string, string | number | boolean> | undefined;
647
+ } | {
648
+ type: "paywall_quote";
649
+ actionId: string;
650
+ productVersionId: string;
651
+ featureQuantities?: Record<string, number> | undefined;
652
+ offerId?: string | undefined;
653
+ nativeOffer?: {
654
+ offerKind: "none" | "introductory" | "promotional";
655
+ offerId: string | null;
656
+ discountMinor: number;
657
+ trialDays: number | null;
658
+ } | undefined;
659
+ predecessor?: {
660
+ operationId: string | null;
661
+ generation: number;
662
+ } | undefined;
663
+ } | {
664
+ type: "paywall_confirm";
665
+ operationId: string;
666
+ } | {
667
+ type: "paywall_cancel";
668
+ operationId: string;
669
+ } | {
670
+ type: "client_action";
671
+ receiptId: string;
672
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
673
+ };
674
+ requestId: string;
675
+ nodeId: string;
676
+ visit: number;
677
+ revision: number;
678
+ operation: "submit";
679
+ customerToken?: string | undefined;
680
+ } | {
681
+ requestId: string;
682
+ nodeId: string;
683
+ visit: number;
684
+ revision: number;
685
+ operation: "back";
686
+ customerToken?: string | undefined;
687
+ } | {
688
+ requestId: string;
689
+ nodeId: string;
690
+ visit: number;
691
+ revision: number;
692
+ operation: "shown";
693
+ customerToken?: string | undefined;
694
+ } | {
695
+ requestId: string;
696
+ nodeId: string;
697
+ visit: number;
698
+ revision: number;
699
+ operation: "close";
700
+ customerToken?: string | undefined;
701
+ } | {
702
+ policyRevision: number;
703
+ generation: string;
704
+ requestId: string;
705
+ nodeId: string;
706
+ visit: number;
707
+ revision: number;
708
+ operation: "commit_segment";
709
+ customerToken?: string | undefined;
710
+ }, {
711
+ operation: "start";
712
+ funnelId: string;
713
+ requestId: string;
714
+ locale: string;
715
+ parameters: Record<string, z.core.util.JSONType>;
716
+ customer?: {
717
+ type: "id";
718
+ value: string;
719
+ } | {
720
+ type: "externalUserId";
721
+ value: string;
722
+ } | undefined;
723
+ customerData?: {
724
+ name?: string | undefined;
725
+ email?: string | undefined;
726
+ phone?: string | null | undefined;
727
+ attributes?: (Record<string, z.core.util.JSONType> & {
728
+ [x: string]: unknown;
729
+ tags?: string[] | undefined;
730
+ }) | undefined;
731
+ fingerprint?: string | undefined;
732
+ } | undefined;
733
+ } | {
734
+ operation: "get";
735
+ settlementRequestId?: string | undefined;
736
+ data?: {
737
+ nodeId: string;
738
+ visit: number;
739
+ revision: number;
740
+ components: Record<string, {
741
+ page: number;
742
+ after: {
743
+ kind: "ledger";
744
+ cursor: {
745
+ at: string;
746
+ id: string;
747
+ type: "invoice" | "usage" | "source" | "debt" | "transaction" | "settlement";
748
+ };
749
+ } | {
750
+ kind: "billing";
751
+ cursor: string;
752
+ } | null;
753
+ filter: "purchase" | "refund" | "expired" | "revoked" | "usage" | "all" | "source" | "issued" | "reserved" | "redeemed" | "debt" | "settlement";
754
+ resourceKey?: string | undefined;
755
+ }>;
756
+ } | undefined;
757
+ purchase?: {
758
+ receiptId: string;
759
+ operationId: string;
760
+ } | undefined;
761
+ customerToken?: string | undefined;
762
+ } | {
763
+ operation: "resume";
764
+ requestId: string;
765
+ customerToken?: string | undefined;
766
+ } | {
767
+ input: {
768
+ type: "screen";
769
+ output: string;
770
+ answers: Record<string, string | boolean | string[]>;
771
+ selection?: Record<string, string | number | boolean> | undefined;
772
+ } | {
773
+ type: "paywall_quote";
774
+ actionId: string;
775
+ productVersionId: string;
776
+ featureQuantities?: Record<string, number> | undefined;
777
+ offerId?: string | undefined;
778
+ nativeOffer?: {
779
+ offerKind: "none" | "introductory" | "promotional";
780
+ offerId: string | null;
781
+ discountMinor: number;
782
+ trialDays: number | null;
783
+ } | undefined;
784
+ predecessor?: {
785
+ operationId: string | null;
786
+ generation: number;
787
+ } | undefined;
788
+ } | {
789
+ type: "paywall_confirm";
790
+ operationId: string;
791
+ } | {
792
+ type: "paywall_cancel";
793
+ operationId: string;
794
+ } | {
795
+ type: "client_action";
796
+ receiptId: string;
797
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
798
+ };
799
+ requestId: string;
800
+ nodeId: string;
801
+ visit: number;
802
+ revision: number;
803
+ operation: "submit";
804
+ customerToken?: string | undefined;
805
+ } | {
806
+ requestId: string;
807
+ nodeId: string;
808
+ visit: number;
809
+ revision: number;
810
+ operation: "back";
811
+ customerToken?: string | undefined;
812
+ } | {
813
+ requestId: string;
814
+ nodeId: string;
815
+ visit: number;
816
+ revision: number;
817
+ operation: "shown";
818
+ customerToken?: string | undefined;
819
+ } | {
820
+ requestId: string;
821
+ nodeId: string;
822
+ visit: number;
823
+ revision: number;
824
+ operation: "close";
825
+ customerToken?: string | undefined;
826
+ } | {
827
+ policyRevision: number;
828
+ generation: string;
829
+ requestId: string;
830
+ nodeId: string;
831
+ visit: number;
832
+ revision: number;
833
+ operation: "commit_segment";
834
+ customerToken?: string | undefined;
835
+ } | {
836
+ operation: "review";
837
+ receiptId?: string | undefined;
838
+ customerToken?: string | undefined;
839
+ }>>>;
840
+ closeCommand: z.ZodOptional<z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
841
+ operation: z.ZodLiteral<"start">;
842
+ funnelId: z.ZodUUID;
843
+ requestId: z.ZodUUID;
844
+ customer: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
845
+ type: z.ZodLiteral<"id">;
846
+ value: z.ZodUUID;
847
+ }, z.core.$strict>, z.ZodObject<{
848
+ type: z.ZodLiteral<"externalUserId">;
849
+ value: z.ZodString;
850
+ }, z.core.$strict>], "type">>;
851
+ customerData: z.ZodOptional<z.ZodObject<{
852
+ name: z.ZodOptional<z.ZodString>;
853
+ email: z.ZodOptional<z.ZodUnion<readonly [z.ZodEmail, z.ZodLiteral<"">]>>;
854
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
855
+ attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodJSONSchema>, z.ZodObject<{
856
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
857
+ }, z.core.$loose>>>;
858
+ fingerprint: z.ZodOptional<z.ZodString>;
859
+ }, z.core.$strict>>;
860
+ locale: z.ZodString;
861
+ parameters: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
862
+ }, z.core.$strict>, z.ZodObject<{
863
+ operation: z.ZodLiteral<"get">;
864
+ settlementRequestId: z.ZodOptional<z.ZodUUID>;
865
+ data: z.ZodOptional<z.ZodObject<{
866
+ nodeId: z.ZodString;
867
+ visit: z.ZodNumber;
868
+ revision: z.ZodNumber;
869
+ components: z.ZodRecord<z.ZodString, z.ZodObject<{
870
+ resourceKey: z.ZodOptional<z.ZodString>;
871
+ page: z.ZodNumber;
872
+ after: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
873
+ kind: z.ZodLiteral<"ledger">;
874
+ cursor: z.ZodObject<{
875
+ at: z.ZodISODateTime;
876
+ id: z.ZodUUID;
877
+ type: z.ZodEnum<{
878
+ invoice: "invoice";
879
+ usage: "usage";
880
+ source: "source";
881
+ debt: "debt";
882
+ transaction: "transaction";
883
+ settlement: "settlement";
884
+ }>;
885
+ }, z.core.$strict>;
886
+ }, z.core.$strict>, z.ZodObject<{
887
+ kind: z.ZodLiteral<"billing">;
888
+ cursor: z.ZodUUID;
889
+ }, z.core.$strict>], "kind">>;
890
+ filter: z.ZodEnum<{
891
+ purchase: "purchase";
892
+ refund: "refund";
893
+ expired: "expired";
894
+ revoked: "revoked";
895
+ usage: "usage";
896
+ all: "all";
897
+ source: "source";
898
+ issued: "issued";
899
+ reserved: "reserved";
900
+ redeemed: "redeemed";
901
+ debt: "debt";
902
+ settlement: "settlement";
903
+ }>;
904
+ }, z.core.$strict>>;
905
+ }, z.core.$strict>>;
906
+ purchase: z.ZodOptional<z.ZodObject<{
907
+ receiptId: z.ZodUUID;
908
+ operationId: z.ZodUUID;
909
+ }, z.core.$strict>>;
910
+ customerToken: z.ZodOptional<z.ZodString>;
911
+ }, z.core.$strict>, z.ZodObject<{
912
+ operation: z.ZodLiteral<"resume">;
913
+ requestId: z.ZodUUID;
914
+ customerToken: z.ZodOptional<z.ZodString>;
915
+ }, z.core.$strict>, z.ZodObject<{
916
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
917
+ type: z.ZodLiteral<"screen">;
918
+ output: z.ZodString;
919
+ answers: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
920
+ selection: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>>;
921
+ }, z.core.$strict>, z.ZodObject<{
922
+ type: z.ZodLiteral<"paywall_quote">;
923
+ featureQuantities: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodNumber>>;
924
+ actionId: z.ZodString;
925
+ productVersionId: z.ZodUUID;
926
+ offerId: z.ZodOptional<z.ZodUUID>;
927
+ nativeOffer: z.ZodOptional<z.ZodObject<{
928
+ offerKind: z.ZodEnum<{
929
+ none: "none";
930
+ introductory: "introductory";
931
+ promotional: "promotional";
932
+ }>;
933
+ offerId: z.ZodNullable<z.ZodString>;
934
+ discountMinor: z.ZodNumber;
935
+ trialDays: z.ZodNullable<z.ZodNumber>;
936
+ }, z.core.$strict>>;
937
+ predecessor: z.ZodOptional<z.ZodObject<{
938
+ operationId: z.ZodNullable<z.ZodUUID>;
939
+ generation: z.ZodNumber;
940
+ }, z.core.$strict>>;
941
+ }, z.core.$strict>, z.ZodObject<{
942
+ type: z.ZodLiteral<"paywall_confirm">;
943
+ operationId: z.ZodUUID;
944
+ }, z.core.$strict>, z.ZodObject<{
945
+ type: z.ZodLiteral<"paywall_cancel">;
946
+ operationId: z.ZodUUID;
947
+ }, z.core.$strict>, z.ZodObject<{
948
+ type: z.ZodLiteral<"client_action">;
949
+ receiptId: z.ZodUUID;
950
+ outcome: z.ZodEnum<{
951
+ success: "success";
952
+ cancel: "cancel";
953
+ failed: "failed";
954
+ opened: "opened";
955
+ failure: "failure";
956
+ }>;
957
+ }, z.core.$strict>], "type">;
958
+ requestId: z.ZodUUID;
959
+ nodeId: z.ZodString;
960
+ visit: z.ZodNumber;
961
+ revision: z.ZodNumber;
962
+ customerToken: z.ZodOptional<z.ZodString>;
963
+ operation: z.ZodLiteral<"submit">;
964
+ }, z.core.$strict>, z.ZodObject<{
965
+ requestId: z.ZodUUID;
966
+ nodeId: z.ZodString;
967
+ visit: z.ZodNumber;
968
+ revision: z.ZodNumber;
969
+ customerToken: z.ZodOptional<z.ZodString>;
970
+ operation: z.ZodLiteral<"back">;
971
+ }, z.core.$strict>, z.ZodObject<{
972
+ requestId: z.ZodUUID;
973
+ nodeId: z.ZodString;
974
+ visit: z.ZodNumber;
975
+ revision: z.ZodNumber;
976
+ customerToken: z.ZodOptional<z.ZodString>;
977
+ operation: z.ZodLiteral<"shown">;
978
+ }, z.core.$strict>, z.ZodObject<{
979
+ requestId: z.ZodUUID;
980
+ nodeId: z.ZodString;
981
+ visit: z.ZodNumber;
982
+ revision: z.ZodNumber;
983
+ customerToken: z.ZodOptional<z.ZodString>;
984
+ operation: z.ZodLiteral<"close">;
985
+ }, z.core.$strict>, z.ZodObject<{
986
+ policyRevision: z.ZodNumber;
987
+ generation: z.ZodString;
988
+ requestId: z.ZodUUID;
989
+ nodeId: z.ZodString;
990
+ visit: z.ZodNumber;
991
+ revision: z.ZodNumber;
992
+ customerToken: z.ZodOptional<z.ZodString>;
993
+ operation: z.ZodLiteral<"commit_segment">;
994
+ }, z.core.$strict>, z.ZodObject<{
995
+ operation: z.ZodLiteral<"review">;
996
+ receiptId: z.ZodOptional<z.ZodUUID>;
997
+ customerToken: z.ZodOptional<z.ZodString>;
998
+ }, z.core.$strict>], "operation">, z.ZodTransform<{
999
+ operation: "resume";
1000
+ requestId: string;
1001
+ customerToken?: string | undefined;
1002
+ } | {
1003
+ input: {
1004
+ type: "screen";
1005
+ output: string;
1006
+ answers: Record<string, string | boolean | string[]>;
1007
+ selection?: Record<string, string | number | boolean> | undefined;
1008
+ } | {
1009
+ type: "paywall_quote";
1010
+ actionId: string;
1011
+ productVersionId: string;
1012
+ featureQuantities?: Record<string, number> | undefined;
1013
+ offerId?: string | undefined;
1014
+ nativeOffer?: {
1015
+ offerKind: "none" | "introductory" | "promotional";
1016
+ offerId: string | null;
1017
+ discountMinor: number;
1018
+ trialDays: number | null;
1019
+ } | undefined;
1020
+ predecessor?: {
1021
+ operationId: string | null;
1022
+ generation: number;
1023
+ } | undefined;
1024
+ } | {
1025
+ type: "paywall_confirm";
1026
+ operationId: string;
1027
+ } | {
1028
+ type: "paywall_cancel";
1029
+ operationId: string;
1030
+ } | {
1031
+ type: "client_action";
1032
+ receiptId: string;
1033
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
1034
+ };
1035
+ requestId: string;
1036
+ nodeId: string;
1037
+ visit: number;
1038
+ revision: number;
1039
+ operation: "submit";
1040
+ customerToken?: string | undefined;
1041
+ } | {
1042
+ requestId: string;
1043
+ nodeId: string;
1044
+ visit: number;
1045
+ revision: number;
1046
+ operation: "back";
1047
+ customerToken?: string | undefined;
1048
+ } | {
1049
+ requestId: string;
1050
+ nodeId: string;
1051
+ visit: number;
1052
+ revision: number;
1053
+ operation: "shown";
1054
+ customerToken?: string | undefined;
1055
+ } | {
1056
+ requestId: string;
1057
+ nodeId: string;
1058
+ visit: number;
1059
+ revision: number;
1060
+ operation: "close";
1061
+ customerToken?: string | undefined;
1062
+ } | {
1063
+ policyRevision: number;
1064
+ generation: string;
1065
+ requestId: string;
1066
+ nodeId: string;
1067
+ visit: number;
1068
+ revision: number;
1069
+ operation: "commit_segment";
1070
+ customerToken?: string | undefined;
1071
+ }, {
1072
+ operation: "start";
1073
+ funnelId: string;
1074
+ requestId: string;
1075
+ locale: string;
1076
+ parameters: Record<string, z.core.util.JSONType>;
1077
+ customer?: {
1078
+ type: "id";
1079
+ value: string;
1080
+ } | {
1081
+ type: "externalUserId";
1082
+ value: string;
1083
+ } | undefined;
1084
+ customerData?: {
1085
+ name?: string | undefined;
1086
+ email?: string | undefined;
1087
+ phone?: string | null | undefined;
1088
+ attributes?: (Record<string, z.core.util.JSONType> & {
1089
+ [x: string]: unknown;
1090
+ tags?: string[] | undefined;
1091
+ }) | undefined;
1092
+ fingerprint?: string | undefined;
1093
+ } | undefined;
1094
+ } | {
1095
+ operation: "get";
1096
+ settlementRequestId?: string | undefined;
1097
+ data?: {
1098
+ nodeId: string;
1099
+ visit: number;
1100
+ revision: number;
1101
+ components: Record<string, {
1102
+ page: number;
1103
+ after: {
1104
+ kind: "ledger";
1105
+ cursor: {
1106
+ at: string;
1107
+ id: string;
1108
+ type: "invoice" | "usage" | "source" | "debt" | "transaction" | "settlement";
1109
+ };
1110
+ } | {
1111
+ kind: "billing";
1112
+ cursor: string;
1113
+ } | null;
1114
+ filter: "purchase" | "refund" | "expired" | "revoked" | "usage" | "all" | "source" | "issued" | "reserved" | "redeemed" | "debt" | "settlement";
1115
+ resourceKey?: string | undefined;
1116
+ }>;
1117
+ } | undefined;
1118
+ purchase?: {
1119
+ receiptId: string;
1120
+ operationId: string;
1121
+ } | undefined;
1122
+ customerToken?: string | undefined;
1123
+ } | {
1124
+ operation: "resume";
1125
+ requestId: string;
1126
+ customerToken?: string | undefined;
1127
+ } | {
1128
+ input: {
1129
+ type: "screen";
1130
+ output: string;
1131
+ answers: Record<string, string | boolean | string[]>;
1132
+ selection?: Record<string, string | number | boolean> | undefined;
1133
+ } | {
1134
+ type: "paywall_quote";
1135
+ actionId: string;
1136
+ productVersionId: string;
1137
+ featureQuantities?: Record<string, number> | undefined;
1138
+ offerId?: string | undefined;
1139
+ nativeOffer?: {
1140
+ offerKind: "none" | "introductory" | "promotional";
1141
+ offerId: string | null;
1142
+ discountMinor: number;
1143
+ trialDays: number | null;
1144
+ } | undefined;
1145
+ predecessor?: {
1146
+ operationId: string | null;
1147
+ generation: number;
1148
+ } | undefined;
1149
+ } | {
1150
+ type: "paywall_confirm";
1151
+ operationId: string;
1152
+ } | {
1153
+ type: "paywall_cancel";
1154
+ operationId: string;
1155
+ } | {
1156
+ type: "client_action";
1157
+ receiptId: string;
1158
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
1159
+ };
1160
+ requestId: string;
1161
+ nodeId: string;
1162
+ visit: number;
1163
+ revision: number;
1164
+ operation: "submit";
1165
+ customerToken?: string | undefined;
1166
+ } | {
1167
+ requestId: string;
1168
+ nodeId: string;
1169
+ visit: number;
1170
+ revision: number;
1171
+ operation: "back";
1172
+ customerToken?: string | undefined;
1173
+ } | {
1174
+ requestId: string;
1175
+ nodeId: string;
1176
+ visit: number;
1177
+ revision: number;
1178
+ operation: "shown";
1179
+ customerToken?: string | undefined;
1180
+ } | {
1181
+ requestId: string;
1182
+ nodeId: string;
1183
+ visit: number;
1184
+ revision: number;
1185
+ operation: "close";
1186
+ customerToken?: string | undefined;
1187
+ } | {
1188
+ policyRevision: number;
1189
+ generation: string;
1190
+ requestId: string;
1191
+ nodeId: string;
1192
+ visit: number;
1193
+ revision: number;
1194
+ operation: "commit_segment";
1195
+ customerToken?: string | undefined;
1196
+ } | {
1197
+ operation: "review";
1198
+ receiptId?: string | undefined;
1199
+ customerToken?: string | undefined;
1200
+ }>> & z.ZodType<{
1201
+ requestId: string;
1202
+ nodeId: string;
1203
+ visit: number;
1204
+ revision: number;
1205
+ operation: "close";
1206
+ customerToken?: string | undefined;
1207
+ }, {
1208
+ operation: "start";
1209
+ funnelId: string;
1210
+ requestId: string;
1211
+ locale: string;
1212
+ parameters: Record<string, z.core.util.JSONType>;
1213
+ customer?: {
1214
+ type: "id";
1215
+ value: string;
1216
+ } | {
1217
+ type: "externalUserId";
1218
+ value: string;
1219
+ } | undefined;
1220
+ customerData?: {
1221
+ name?: string | undefined;
1222
+ email?: string | undefined;
1223
+ phone?: string | null | undefined;
1224
+ attributes?: (Record<string, z.core.util.JSONType> & {
1225
+ [x: string]: unknown;
1226
+ tags?: string[] | undefined;
1227
+ }) | undefined;
1228
+ fingerprint?: string | undefined;
1229
+ } | undefined;
1230
+ } | {
1231
+ operation: "get";
1232
+ settlementRequestId?: string | undefined;
1233
+ data?: {
1234
+ nodeId: string;
1235
+ visit: number;
1236
+ revision: number;
1237
+ components: Record<string, {
1238
+ page: number;
1239
+ after: {
1240
+ kind: "ledger";
1241
+ cursor: {
1242
+ at: string;
1243
+ id: string;
1244
+ type: "invoice" | "usage" | "source" | "debt" | "transaction" | "settlement";
1245
+ };
1246
+ } | {
1247
+ kind: "billing";
1248
+ cursor: string;
1249
+ } | null;
1250
+ filter: "purchase" | "refund" | "expired" | "revoked" | "usage" | "all" | "source" | "issued" | "reserved" | "redeemed" | "debt" | "settlement";
1251
+ resourceKey?: string | undefined;
1252
+ }>;
1253
+ } | undefined;
1254
+ purchase?: {
1255
+ receiptId: string;
1256
+ operationId: string;
1257
+ } | undefined;
1258
+ customerToken?: string | undefined;
1259
+ } | {
1260
+ operation: "resume";
1261
+ requestId: string;
1262
+ customerToken?: string | undefined;
1263
+ } | {
1264
+ input: {
1265
+ type: "screen";
1266
+ output: string;
1267
+ answers: Record<string, string | boolean | string[]>;
1268
+ selection?: Record<string, string | number | boolean> | undefined;
1269
+ } | {
1270
+ type: "paywall_quote";
1271
+ actionId: string;
1272
+ productVersionId: string;
1273
+ featureQuantities?: Record<string, number> | undefined;
1274
+ offerId?: string | undefined;
1275
+ nativeOffer?: {
1276
+ offerKind: "none" | "introductory" | "promotional";
1277
+ offerId: string | null;
1278
+ discountMinor: number;
1279
+ trialDays: number | null;
1280
+ } | undefined;
1281
+ predecessor?: {
1282
+ operationId: string | null;
1283
+ generation: number;
1284
+ } | undefined;
1285
+ } | {
1286
+ type: "paywall_confirm";
1287
+ operationId: string;
1288
+ } | {
1289
+ type: "paywall_cancel";
1290
+ operationId: string;
1291
+ } | {
1292
+ type: "client_action";
1293
+ receiptId: string;
1294
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
1295
+ };
1296
+ requestId: string;
1297
+ nodeId: string;
1298
+ visit: number;
1299
+ revision: number;
1300
+ operation: "submit";
1301
+ customerToken?: string | undefined;
1302
+ } | {
1303
+ requestId: string;
1304
+ nodeId: string;
1305
+ visit: number;
1306
+ revision: number;
1307
+ operation: "back";
1308
+ customerToken?: string | undefined;
1309
+ } | {
1310
+ requestId: string;
1311
+ nodeId: string;
1312
+ visit: number;
1313
+ revision: number;
1314
+ operation: "shown";
1315
+ customerToken?: string | undefined;
1316
+ } | {
1317
+ requestId: string;
1318
+ nodeId: string;
1319
+ visit: number;
1320
+ revision: number;
1321
+ operation: "close";
1322
+ customerToken?: string | undefined;
1323
+ } | {
1324
+ policyRevision: number;
1325
+ generation: string;
1326
+ requestId: string;
1327
+ nodeId: string;
1328
+ visit: number;
1329
+ revision: number;
1330
+ operation: "commit_segment";
1331
+ customerToken?: string | undefined;
1332
+ } | {
1333
+ operation: "review";
1334
+ receiptId?: string | undefined;
1335
+ customerToken?: string | undefined;
1336
+ }, z.core.$ZodTypeInternals<{
1337
+ requestId: string;
1338
+ nodeId: string;
1339
+ visit: number;
1340
+ revision: number;
1341
+ operation: "close";
1342
+ customerToken?: string | undefined;
1343
+ }, {
1344
+ operation: "start";
1345
+ funnelId: string;
1346
+ requestId: string;
1347
+ locale: string;
1348
+ parameters: Record<string, z.core.util.JSONType>;
1349
+ customer?: {
1350
+ type: "id";
1351
+ value: string;
1352
+ } | {
1353
+ type: "externalUserId";
1354
+ value: string;
1355
+ } | undefined;
1356
+ customerData?: {
1357
+ name?: string | undefined;
1358
+ email?: string | undefined;
1359
+ phone?: string | null | undefined;
1360
+ attributes?: (Record<string, z.core.util.JSONType> & {
1361
+ [x: string]: unknown;
1362
+ tags?: string[] | undefined;
1363
+ }) | undefined;
1364
+ fingerprint?: string | undefined;
1365
+ } | undefined;
1366
+ } | {
1367
+ operation: "get";
1368
+ settlementRequestId?: string | undefined;
1369
+ data?: {
1370
+ nodeId: string;
1371
+ visit: number;
1372
+ revision: number;
1373
+ components: Record<string, {
1374
+ page: number;
1375
+ after: {
1376
+ kind: "ledger";
1377
+ cursor: {
1378
+ at: string;
1379
+ id: string;
1380
+ type: "invoice" | "usage" | "source" | "debt" | "transaction" | "settlement";
1381
+ };
1382
+ } | {
1383
+ kind: "billing";
1384
+ cursor: string;
1385
+ } | null;
1386
+ filter: "purchase" | "refund" | "expired" | "revoked" | "usage" | "all" | "source" | "issued" | "reserved" | "redeemed" | "debt" | "settlement";
1387
+ resourceKey?: string | undefined;
1388
+ }>;
1389
+ } | undefined;
1390
+ purchase?: {
1391
+ receiptId: string;
1392
+ operationId: string;
1393
+ } | undefined;
1394
+ customerToken?: string | undefined;
1395
+ } | {
1396
+ operation: "resume";
1397
+ requestId: string;
1398
+ customerToken?: string | undefined;
1399
+ } | {
1400
+ input: {
1401
+ type: "screen";
1402
+ output: string;
1403
+ answers: Record<string, string | boolean | string[]>;
1404
+ selection?: Record<string, string | number | boolean> | undefined;
1405
+ } | {
1406
+ type: "paywall_quote";
1407
+ actionId: string;
1408
+ productVersionId: string;
1409
+ featureQuantities?: Record<string, number> | undefined;
1410
+ offerId?: string | undefined;
1411
+ nativeOffer?: {
1412
+ offerKind: "none" | "introductory" | "promotional";
1413
+ offerId: string | null;
1414
+ discountMinor: number;
1415
+ trialDays: number | null;
1416
+ } | undefined;
1417
+ predecessor?: {
1418
+ operationId: string | null;
1419
+ generation: number;
1420
+ } | undefined;
1421
+ } | {
1422
+ type: "paywall_confirm";
1423
+ operationId: string;
1424
+ } | {
1425
+ type: "paywall_cancel";
1426
+ operationId: string;
1427
+ } | {
1428
+ type: "client_action";
1429
+ receiptId: string;
1430
+ outcome: "success" | "cancel" | "failed" | "opened" | "failure";
1431
+ };
1432
+ requestId: string;
1433
+ nodeId: string;
1434
+ visit: number;
1435
+ revision: number;
1436
+ operation: "submit";
1437
+ customerToken?: string | undefined;
1438
+ } | {
1439
+ requestId: string;
1440
+ nodeId: string;
1441
+ visit: number;
1442
+ revision: number;
1443
+ operation: "back";
1444
+ customerToken?: string | undefined;
1445
+ } | {
1446
+ requestId: string;
1447
+ nodeId: string;
1448
+ visit: number;
1449
+ revision: number;
1450
+ operation: "shown";
1451
+ customerToken?: string | undefined;
1452
+ } | {
1453
+ requestId: string;
1454
+ nodeId: string;
1455
+ visit: number;
1456
+ revision: number;
1457
+ operation: "close";
1458
+ customerToken?: string | undefined;
1459
+ } | {
1460
+ policyRevision: number;
1461
+ generation: string;
1462
+ requestId: string;
1463
+ nodeId: string;
1464
+ visit: number;
1465
+ revision: number;
1466
+ operation: "commit_segment";
1467
+ customerToken?: string | undefined;
1468
+ } | {
1469
+ operation: "review";
1470
+ receiptId?: string | undefined;
1471
+ customerToken?: string | undefined;
1472
+ }>>>;
1473
+ purchase: z.ZodOptional<z.ZodObject<{
1474
+ receiptId: z.ZodUUID;
1475
+ operationId: z.ZodUUID;
1476
+ generation: z.ZodNumber;
1477
+ }, z.core.$strict>>;
1478
+ closed: z.ZodOptional<z.ZodLiteral<true>>;
1479
+ }, z.core.$strict>>;
1480
+ }, z.core.$strict>;
1481
+ }, z.core.$strict>;
1482
+ type FunnelPurchaseEntry = z.infer<typeof funnelPurchaseEntrySchema>;
1483
+ /** Atomic revision CAS, with the same contract as FunnelCommandStorage. No credentials. */
1484
+ interface FunnelPurchaseStorage {
1485
+ read(): Promise<{
1486
+ revision: number;
1487
+ entry: unknown | null;
1488
+ }>;
1489
+ write(expectedRevision: number, entry: FunnelPurchaseEntry | null): Promise<number | null>;
1490
+ }
1491
+ declare function createBrowserFunnelPurchaseStorage(input: {
1492
+ baseUrl?: string;
1493
+ scope: z.infer<typeof scopeSchema>;
1494
+ customerId: string;
1495
+ storage?: Storage;
1496
+ locks?: FunnelStorageLocks;
1497
+ }): FunnelPurchaseStorage;
1498
+
1499
+ type FunnelPurchaseStart = Omit<FunnelStartInput, "customer" | "customerData" | "requestId"> & {
1500
+ requestId?: string;
1501
+ };
1502
+ /** Detached original Start input; available after start/refresh, including an unknown result. */
1503
+ type FunnelPurchaseAttempt = Readonly<Pick<FunnelPurchaseEntry["start"], "requestId" | "funnelId" | "locale" | "parameters">>;
1504
+ type FunnelPurchaseState = {
1505
+ mode: "idle" | "run" | "operation" | "blocked";
1506
+ status: "idle" | "ready" | "waiting_result" | "checkout" | "fulfillment" | "recording" | "complete" | "blocked";
1507
+ actions: readonly ("start" | "refresh" | "continue_checkout" | "confirm" | "retry" | "close")[];
1508
+ purchases: readonly PaywallRecovery[];
1509
+ confirmation?: {
1510
+ operationId: string;
1511
+ quote: SubscriptionAttachQuote;
1512
+ };
1513
+ error?: {
1514
+ code: string;
1515
+ message: string;
1516
+ status?: number;
1517
+ };
1518
+ };
1519
+ type FunnelPurchaseOptions = Omit<IndianaOptions, "funnelCommandStorage" | "session" | "funnelExecutionPolicy"> & {
1520
+ scope: NonNullable<IndianaOptions["scope"]>;
1521
+ session: SessionCredentials;
1522
+ executionPolicy: FunnelExecutionPolicy;
1523
+ storage?: FunnelPurchaseStorage;
1524
+ onRecovery?: (state: FunnelPurchaseState) => unknown;
1525
+ };
1526
+ /** Owns SDK-created purchases only. Customer credentials remain in the existing session. */
1527
+ declare function createFunnelPurchaseClient(input: FunnelPurchaseOptions): {
1528
+ readonly controller: FunnelRunController | null;
1529
+ readonly recovery: FunnelPurchaseState;
1530
+ readonly attempt: FunnelPurchaseAttempt | null;
1531
+ readonly identitySignal: AbortSignal;
1532
+ start(start: FunnelPurchaseStart): Promise<FunnelPurchaseState>;
1533
+ refresh: () => Promise<FunnelPurchaseState>;
1534
+ confirm: () => Promise<FunnelPurchaseState>;
1535
+ retry: () => Promise<FunnelPurchaseState>;
1536
+ close(): Promise<FunnelPurchaseState>;
1537
+ /** Explicit user action; the merchant owns allowed destinations and navigation. */
1538
+ continueCheckout(open: (url: string) => unknown): Promise<void>;
1539
+ subscribe(listener: (state: FunnelPurchaseState) => unknown): () => void;
1540
+ destroy: () => void;
1541
+ };
1542
+ type FunnelPurchaseClient = ReturnType<typeof createFunnelPurchaseClient>;
1543
+
1544
+ type FunnelPurchaseHostOptions = Omit<FunnelHostOptions, "client" | "checkoutNavigation" | "resolveOfferId"> & {
1545
+ client: FunnelPurchaseClient;
1546
+ /** Omit to recover only; no new attempt is allocated. */
1547
+ start?: FunnelPurchaseStart;
1548
+ resolveOfferId?: (purchase: Parameters<NonNullable<FunnelHostOptions["resolveOfferId"]>>[0], attempt: FunnelPurchaseAttempt) => ReturnType<NonNullable<FunnelHostOptions["resolveOfferId"]>>;
1549
+ };
1550
+ type Host = Awaited<ReturnType<typeof showObservedFunnelRun>>;
1551
+ /** Same Controller/Host lifecycle; operation-only or blocked recovery goes to onRecovery. */
1552
+ declare function showFunnelPurchase$1(container: HTMLElement, options: FunnelPurchaseHostOptions): Promise<Host | null>;
363
1553
 
364
1554
  declare class MerchantBridgeError extends Error {
365
1555
  readonly code: string;
@@ -560,20 +1750,6 @@ declare function createMerchantBridge(options: MerchantBridgeOptions): {
560
1750
  reset(): void;
561
1751
  };
562
1752
 
563
- interface FunnelStorageLocks {
564
- request<T>(name: string, options: {
565
- mode: "exclusive";
566
- }, work: () => T | PromiseLike<T>): Promise<T>;
567
- }
568
- /** Web Locks serialize the revision CAS across tabs; localStorage survives a
569
- * reload. The key hashes the original credential; no credential is stored. */
570
- declare function createBrowserFunnelCommandStorage(input: {
571
- baseUrl?: string;
572
- runToken: string;
573
- storage?: Storage;
574
- locks?: FunnelStorageLocks;
575
- }): FunnelCommandStorage;
576
-
577
1753
  type IamFunnelEntriesOptions = IndianaOptions & {
578
1754
  scope: NonNullable<IndianaOptions["scope"]>;
579
1755
  environmentId: string;
@@ -1093,12 +2269,23 @@ declare function showFunnelRun(...args: Parameters<typeof showFunnelRun$1>): Pro
1093
2269
  readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
1094
2270
  }>;
1095
2271
 
2272
+ declare function showFunnelPurchase(...args: Parameters<typeof showFunnelPurchase$1>): Promise<{
2273
+ destroy: () => void;
2274
+ refresh: () => Promise<void>;
2275
+ readonly recovery: PaywallRecovery;
2276
+ prepareFallback(): Promise<PaywallRecovery>;
2277
+ review: (receiptId?: string) => Promise<void>;
2278
+ exitReview: () => Promise<void>;
2279
+ readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
2280
+ } | null>;
2281
+
1096
2282
  declare function mountContent(...args: Parameters<typeof mountContent$1>): Promise<{
1097
2283
  destroy: () => void;
1098
2284
  show: () => void;
1099
2285
  readonly pendingAction: ContentActionIntent | null;
1100
2286
  retryAction: () => Promise<void>;
1101
- updateCapabilities: (data: SurfaceData) => void | undefined;
2287
+ updateInputs(patch: Record<string, JsonValue>): void;
2288
+ updateCapabilities(data: SurfaceData): void;
1102
2289
  }>;
1103
2290
  /** Load the presentation module and render resolved content before the opening click. */
1104
2291
  declare function prepareContent(...args: Parameters<typeof prepareContent$1>): Promise<{
@@ -1106,7 +2293,8 @@ declare function prepareContent(...args: Parameters<typeof prepareContent$1>): P
1106
2293
  show: () => void;
1107
2294
  readonly pendingAction: ContentActionIntent | null;
1108
2295
  retryAction: () => Promise<void>;
1109
- updateCapabilities: (data: SurfaceData) => void | undefined;
2296
+ updateInputs(patch: Record<string, JsonValue>): void;
2297
+ updateCapabilities(data: SurfaceData): void;
1110
2298
  }>;
1111
2299
 
1112
- export { type ContentActionIntent, type ContentHostOptions, EntitlementCheckResult, FunnelCommandStorage, type FunnelHostOptions, FunnelRunController, type IamFunnelEntriesOptions, type IamFunnelProcessEntriesOptions, IndianaOptions as LongplayOptions, MerchantBridgeError, type MerchantBridgeOptions, type PaywallHostOptions, type PaywallPurchaseIntent, PaywallRecovery, PaywallSession, PresentationLoadingOptions, createBrowserFunnelCommandStorage, createFunnelPageExperiments, createFunnelProcess, createIamFunnelEntries, createIamFunnelProcessEntries, createMerchantBridge, formatCouponDiscount, formatCouponMoney, formatCouponTerms, mountContent, prepareContent, showFunnelRun, showPaywall };
2300
+ export { type ContentActionIntent, type ContentHostOptions, EntitlementCheckResult, FunnelCommandStorage, FunnelExecutionPolicy, type FunnelHostOptions, type FunnelPurchaseAttempt, type FunnelPurchaseClient, type FunnelPurchaseEntry, type FunnelPurchaseHostOptions, type FunnelPurchaseOptions, type FunnelPurchaseStart, type FunnelPurchaseState, type FunnelPurchaseStorage, FunnelRunController, type IamFunnelEntriesOptions, type IamFunnelProcessEntriesOptions, IndianaOptions as LongplayOptions, MerchantBridgeError, type MerchantBridgeOptions, type PaywallHostOptions, type PaywallPurchaseIntent, PaywallRecovery, PaywallSession, PresentationLoadingOptions, SessionCredentials, createBrowserFunnelCommandStorage, createBrowserFunnelPurchaseStorage, createFunnelPageExperiments, createFunnelProcess, createFunnelPurchaseClient, createIamFunnelEntries, createIamFunnelProcessEntries, createMerchantBridge, formatCouponDiscount, formatCouponMoney, formatCouponTerms, mountContent, prepareContent, showFunnelPurchase, showFunnelRun, showPaywall };