@houzhen888/groove-grow 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { c as StackNode, d as ScreenAction, G as GrooveError, e as GrooveOptions, A as ApiInput, f as ApiOutput, a as ScreenDocument, F as FunnelRequest, g as FunnelRun, C as Currency } from './transport-DrW-__2k.js';
2
+ import { c as StackNode, d as ScreenAction, G as GrooveError, e as GrooveOptions, A as ApiInput, f as ApiOutput, a as ScreenDocument, F as FunnelRequest, g as FunnelRun, C as Currency } from './transport-CPPD6uzW.js';
3
3
 
4
4
  declare const couponInputSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -217,6 +217,20 @@ declare const popupDeliverySchema: z.ZodObject<{
217
217
  required: z.ZodBoolean;
218
218
  }, z.core.$strict>>;
219
219
  nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
220
+ id: z.ZodString;
221
+ name: z.ZodString;
222
+ type: z.ZodLiteral<"parameter_branch">;
223
+ parameter: z.ZodString;
224
+ cases: z.ZodArray<z.ZodObject<{
225
+ value: z.ZodString;
226
+ target: z.ZodString;
227
+ }, z.core.$strict>>;
228
+ fallback: z.ZodString;
229
+ editorPosition: z.ZodOptional<z.ZodObject<{
230
+ x: z.ZodNumber;
231
+ y: z.ZodNumber;
232
+ }, z.core.$strict>>;
233
+ }, z.core.$strict>, z.ZodObject<{
220
234
  id: z.ZodString;
221
235
  name: z.ZodString;
222
236
  type: z.ZodLiteral<"branch">;
@@ -330,8 +344,8 @@ declare const popupDeliverySchema: z.ZodObject<{
330
344
  plan: z.ZodUnion<readonly [z.ZodLiteral<"selected">, z.ZodUUID]>;
331
345
  picker: z.ZodOptional<z.ZodString>;
332
346
  offer: z.ZodEnum<{
333
- scope: "scope";
334
347
  none: "none";
348
+ scope: "scope";
335
349
  }>;
336
350
  channel: z.ZodEnum<{
337
351
  web: "web";
@@ -580,7 +594,7 @@ type PopupEvent = {
580
594
  } | {
581
595
  type: "purchase";
582
596
  actionId: string;
583
- status: "started" | "checkout" | "trial_started" | "error";
597
+ status: "started" | "checkout" | "trial_started" | "membership_updated" | "membership_scheduled" | "payment_pending" | "error";
584
598
  url?: string;
585
599
  message?: string;
586
600
  } | {
@@ -599,7 +613,88 @@ declare function formatCouponMoney(cents: number, currency: string, locale?: str
599
613
  declare function formatCouponDiscount(discount: CouponInput["discount"], locale?: string): string;
600
614
  declare function formatCouponTerms(coupon: Pick<CouponInput, "discount" | "duration">, locale?: string, billing?: "month" | "year" | "any"): string;
601
615
 
602
- type FunnelAnswers = Record<string, string | boolean>;
616
+ declare const membershipPreviewSchema: z.ZodObject<{
617
+ action: z.ZodEnum<{
618
+ cancel: "cancel";
619
+ attach: "attach";
620
+ change: "change";
621
+ resume: "resume";
622
+ cancel_change: "cancel_change";
623
+ }>;
624
+ direction: z.ZodEnum<{
625
+ new: "new";
626
+ upgrade: "upgrade";
627
+ downgrade: "downgrade";
628
+ same: "same";
629
+ }>;
630
+ timing: z.ZodEnum<{
631
+ immediate: "immediate";
632
+ end_of_cycle: "end_of_cycle";
633
+ }>;
634
+ group: z.ZodString;
635
+ kind: z.ZodEnum<{
636
+ main: "main";
637
+ addon: "addon";
638
+ }>;
639
+ currentPlanVersionId: z.ZodNullable<z.ZodUUID>;
640
+ targetPlanVersionId: z.ZodNullable<z.ZodUUID>;
641
+ effectiveAt: z.ZodISODateTime;
642
+ amountDueCents: z.ZodNullable<z.ZodNumber>;
643
+ currency: z.ZodEnum<{
644
+ USD: "USD";
645
+ EUR: "EUR";
646
+ CNY: "CNY";
647
+ GBP: "GBP";
648
+ JPY: "JPY";
649
+ CAD: "CAD";
650
+ AUD: "AUD";
651
+ NZD: "NZD";
652
+ CHF: "CHF";
653
+ HKD: "HKD";
654
+ SGD: "SGD";
655
+ KRW: "KRW";
656
+ INR: "INR";
657
+ BRL: "BRL";
658
+ MXN: "MXN";
659
+ TWD: "TWD";
660
+ THB: "THB";
661
+ IDR: "IDR";
662
+ MYR: "MYR";
663
+ PHP: "PHP";
664
+ VND: "VND";
665
+ ZAR: "ZAR";
666
+ AED: "AED";
667
+ SAR: "SAR";
668
+ SEK: "SEK";
669
+ NOK: "NOK";
670
+ DKK: "DKK";
671
+ PLN: "PLN";
672
+ CZK: "CZK";
673
+ HUF: "HUF";
674
+ ILS: "ILS";
675
+ TRY: "TRY";
676
+ RON: "RON";
677
+ }>;
678
+ requiresCheckout: z.ZodBoolean;
679
+ estimate: z.ZodBoolean;
680
+ lineItems: z.ZodArray<z.ZodObject<{
681
+ description: z.ZodString;
682
+ amountCents: z.ZodNumber;
683
+ }, z.core.$strip>>;
684
+ nextCycle: z.ZodNullable<z.ZodObject<{
685
+ startsAt: z.ZodNullable<z.ZodISODateTime>;
686
+ amountCents: z.ZodNumber;
687
+ interval: z.ZodEnum<{
688
+ free: "free";
689
+ month: "month";
690
+ year: "year";
691
+ }>;
692
+ estimate: z.ZodBoolean;
693
+ }, z.core.$strip>>;
694
+ }, z.core.$strip>;
695
+ type MembershipPreview = z.infer<typeof membershipPreviewSchema>;
696
+
697
+ type FunnelAnswers = Record<string, string | boolean | string[]>;
603
698
  type FunnelState = {
604
699
  status: "running" | "waiting" | "completed" | "failed";
605
700
  nodeId: string;
@@ -617,52 +712,13 @@ declare const customerResourceSchema: z.ZodObject<{
617
712
  reserved: z.ZodString;
618
713
  spendable: z.ZodString;
619
714
  consumedInActiveGrants: z.ZodString;
715
+ ownSpendable: z.ZodString;
716
+ sharedSpendable: z.ZodString;
717
+ sourceCount: z.ZodNumber;
620
718
  nextExpiry: z.ZodNullable<z.ZodObject<{
621
719
  at: z.ZodISODateTime;
622
720
  spendable: z.ZodString;
623
- }, z.core.$strip>>;
624
- breakdown: z.ZodArray<z.ZodObject<{
625
- id: z.ZodUUID;
626
- entityId: z.ZodNullable<z.ZodUUID>;
627
- resourceKey: z.ZodString;
628
- name: z.ZodString;
629
- source: z.ZodString;
630
- granted: z.ZodString;
631
- available: z.ZodString;
632
- reserved: z.ZodString;
633
- spendable: z.ZodString;
634
- consumed: z.ZodString;
635
- forfeited: z.ZodString;
636
- rolledOver: z.ZodString;
637
- startsAt: z.ZodISODateTime;
638
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
639
- eligible: z.ZodBoolean;
640
- rates: z.ZodArray<z.ZodObject<{
641
- featureKey: z.ZodString;
642
- units: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
643
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
644
- tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
645
- upTo: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
646
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
647
- }, z.core.$strict>>>;
648
- dimensions: z.ZodOptional<z.ZodArray<z.ZodObject<{
649
- key: z.ZodString;
650
- match: z.ZodRecord<z.ZodString, z.ZodString>;
651
- priority: z.ZodDefault<z.ZodNumber>;
652
- cost: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
653
- tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
654
- upTo: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
655
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
656
- }, z.core.$strict>>>;
657
- }, z.core.$strict>>>;
658
- multipliers: z.ZodOptional<z.ZodArray<z.ZodObject<{
659
- key: z.ZodString;
660
- match: z.ZodRecord<z.ZodString, z.ZodString>;
661
- factor: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
662
- add: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
663
- }, z.core.$strict>>>;
664
- }, z.core.$strict>>;
665
- }, z.core.$strip>>;
721
+ }, z.core.$strict>>;
666
722
  }, z.core.$strict>;
667
723
  type CustomerResource = z.infer<typeof customerResourceSchema>;
668
724
  declare const customerStateSchema: z.ZodObject<{
@@ -684,11 +740,11 @@ declare const customerStateSchema: z.ZodObject<{
684
740
  addon: "addon";
685
741
  }>;
686
742
  source: z.ZodEnum<{
687
- apple: "apple";
688
- google: "google";
689
743
  subscription: "subscription";
690
744
  assignment: "assignment";
691
745
  license: "license";
746
+ apple: "apple";
747
+ google: "google";
692
748
  }>;
693
749
  status: z.ZodString;
694
750
  accessEnabled: z.ZodBoolean;
@@ -803,52 +859,13 @@ declare const customerStateSchema: z.ZodObject<{
803
859
  reserved: z.ZodString;
804
860
  spendable: z.ZodString;
805
861
  consumedInActiveGrants: z.ZodString;
862
+ ownSpendable: z.ZodString;
863
+ sharedSpendable: z.ZodString;
864
+ sourceCount: z.ZodNumber;
806
865
  nextExpiry: z.ZodNullable<z.ZodObject<{
807
866
  at: z.ZodISODateTime;
808
867
  spendable: z.ZodString;
809
- }, z.core.$strip>>;
810
- breakdown: z.ZodArray<z.ZodObject<{
811
- id: z.ZodUUID;
812
- entityId: z.ZodNullable<z.ZodUUID>;
813
- resourceKey: z.ZodString;
814
- name: z.ZodString;
815
- source: z.ZodString;
816
- granted: z.ZodString;
817
- available: z.ZodString;
818
- reserved: z.ZodString;
819
- spendable: z.ZodString;
820
- consumed: z.ZodString;
821
- forfeited: z.ZodString;
822
- rolledOver: z.ZodString;
823
- startsAt: z.ZodISODateTime;
824
- expiresAt: z.ZodNullable<z.ZodISODateTime>;
825
- eligible: z.ZodBoolean;
826
- rates: z.ZodArray<z.ZodObject<{
827
- featureKey: z.ZodString;
828
- units: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
829
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
830
- tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
831
- upTo: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
832
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
833
- }, z.core.$strict>>>;
834
- dimensions: z.ZodOptional<z.ZodArray<z.ZodObject<{
835
- key: z.ZodString;
836
- match: z.ZodRecord<z.ZodString, z.ZodString>;
837
- priority: z.ZodDefault<z.ZodNumber>;
838
- cost: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
839
- tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
840
- upTo: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
841
- cost: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
842
- }, z.core.$strict>>>;
843
- }, z.core.$strict>>>;
844
- multipliers: z.ZodOptional<z.ZodArray<z.ZodObject<{
845
- key: z.ZodString;
846
- match: z.ZodRecord<z.ZodString, z.ZodString>;
847
- factor: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
848
- add: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
849
- }, z.core.$strict>>>;
850
- }, z.core.$strict>>;
851
- }, z.core.$strip>>;
868
+ }, z.core.$strict>>;
852
869
  }, z.core.$strict>>>;
853
870
  }, z.core.$strict>;
854
871
  type CustomerState = z.infer<typeof customerStateSchema>;
@@ -913,9 +930,9 @@ declare const customerPageDataSchema: z.ZodObject<{
913
930
  }>;
914
931
  status: z.ZodEnum<{
915
932
  error: "error";
916
- ready: "ready";
917
933
  idle: "idle";
918
934
  loading: "loading";
935
+ ready: "ready";
919
936
  }>;
920
937
  stale: z.ZodBoolean;
921
938
  preview: z.ZodBoolean;
@@ -939,6 +956,10 @@ declare const customerPageDataSchema: z.ZodObject<{
939
956
  value: z.ZodString;
940
957
  }, z.core.$strict>>;
941
958
  purchaseId: z.ZodOptional<z.ZodUUID>;
959
+ membershipActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
960
+ value: z.ZodString;
961
+ label: z.ZodString;
962
+ }, z.core.$strict>>>;
942
963
  }, z.core.$strict>>;
943
964
  sourceCount: z.ZodNumber;
944
965
  sourcePage: z.ZodNumber;
@@ -956,6 +977,10 @@ declare const customerPageDataSchema: z.ZodObject<{
956
977
  value: z.ZodString;
957
978
  }, z.core.$strict>>;
958
979
  purchaseId: z.ZodOptional<z.ZodUUID>;
980
+ membershipActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
981
+ value: z.ZodString;
982
+ label: z.ZodString;
983
+ }, z.core.$strict>>>;
959
984
  }, z.core.$strict>>;
960
985
  hasNext: z.ZodBoolean;
961
986
  hasPrevious: z.ZodBoolean;
@@ -963,6 +988,16 @@ declare const customerPageDataSchema: z.ZodObject<{
963
988
  filter: z.ZodString;
964
989
  updatedAt: z.ZodOptional<z.ZodISODateTime>;
965
990
  buyingId: z.ZodOptional<z.ZodUUID>;
991
+ membershipBusy: z.ZodOptional<z.ZodBoolean>;
992
+ membershipReview: z.ZodOptional<z.ZodObject<{
993
+ title: z.ZodString;
994
+ note: z.ZodString;
995
+ facts: z.ZodArray<z.ZodObject<{
996
+ label: z.ZodString;
997
+ value: z.ZodString;
998
+ }, z.core.$strict>>;
999
+ }, z.core.$strict>>;
1000
+ membershipResult: z.ZodOptional<z.ZodString>;
966
1001
  }, z.core.$strict>>;
967
1002
  }, z.core.$strict>;
968
1003
  type CustomerPageData = z.infer<typeof customerPageDataSchema>;
@@ -974,6 +1009,9 @@ declare const customerDataIntentSchema: z.ZodObject<{
974
1009
  next: "next";
975
1010
  previous: "previous";
976
1011
  buy_pack: "buy_pack";
1012
+ membership_preview: "membership_preview";
1013
+ membership_confirm: "membership_confirm";
1014
+ membership_dismiss: "membership_dismiss";
977
1015
  sources_next: "sources_next";
978
1016
  sources_previous: "sources_previous";
979
1017
  }>;
@@ -987,8 +1025,8 @@ declare const commerceIntentSchema: z.ZodObject<{
987
1025
  scope: z.ZodObject<{
988
1026
  projectId: z.ZodUUID;
989
1027
  environment: z.ZodEnum<{
990
- live: "live";
991
1028
  sandbox: "sandbox";
1029
+ live: "live";
992
1030
  }>;
993
1031
  }, z.core.$strict>;
994
1032
  expiresAt: z.ZodISODateTime;
@@ -1129,16 +1167,19 @@ declare function createPurchaseHostClient(options: {
1129
1167
  /** Ticket transport deliberately has no identify(): account changes cannot replace this bounded capability. */
1130
1168
  declare function createPurchaseTicketTransport(options: GrooveOptions): PurchaseTicketTransport;
1131
1169
 
1132
- type BrowserInput<K extends "listCreditTransactions" | "listCreditPackOrders" | "listOfferHistory"> = Omit<ApiInput<K>, "customerId" | "entityId">;
1170
+ type BrowserInput<K extends "listCreditTransactions" | "listCreditBalances" | "listCreditPackOrders" | "listOfferHistory"> = Omit<ApiInput<K>, "customerId" | "entityId">;
1133
1171
  interface CustomerPageClient {
1134
1172
  createCustomerStateStore(input: {
1135
1173
  include: ("credits" | "memberships")[];
1136
1174
  }): CustomerStateStore;
1137
1175
  subscribeIdentity(listener: (identified: boolean) => void): () => void;
1138
1176
  listCreditTransactions(input: BrowserInput<"listCreditTransactions">): Promise<ApiOutput<"listCreditTransactions">>;
1177
+ listCreditBalances(input: BrowserInput<"listCreditBalances">): Promise<ApiOutput<"listCreditBalances">>;
1139
1178
  listCreditPackOrders(input: BrowserInput<"listCreditPackOrders">): Promise<ApiOutput<"listCreditPackOrders">>;
1140
1179
  listOfferHistory(input: BrowserInput<"listOfferHistory">): Promise<ApiOutput<"listOfferHistory">>;
1141
1180
  listCustomerPlans(input?: Omit<ApiInput<"listCustomerPlans">, "customerId" | "entityId">): Promise<ApiOutput<"listCustomerPlans">>;
1181
+ previewMembership(input: ApiInput<"previewMembership">): Promise<MembershipPreview>;
1182
+ manageMembership(input: ApiInput<"manageMembership">): Promise<ApiOutput<"manageMembership">>;
1142
1183
  listCreditPacks(): Promise<ApiOutput<"listCreditPacks">>;
1143
1184
  createCreditPackCheckout(input: {
1144
1185
  packVersionId: string;
@@ -1156,7 +1197,9 @@ declare function formatCustomerDecimal(value: string, locale: string): string;
1156
1197
  declare function createCustomerPageController(doc: ScreenDocument, client: CustomerPageClient, options: {
1157
1198
  locale: string;
1158
1199
  onData(data: CustomerPageData): void;
1159
- onCheckout?: (checkout: ApiOutput<"createCreditPackCheckout">) => void | Promise<void>;
1200
+ onCheckout?: (checkout: {
1201
+ url: string;
1202
+ }) => void | Promise<void>;
1160
1203
  onError?: (error: unknown) => void;
1161
1204
  }): CustomerPageController;
1162
1205
 
@@ -1223,7 +1266,7 @@ declare function createFunnelClient(options: GrooveOptions & {
1223
1266
  type: "purchase";
1224
1267
  close: false;
1225
1268
  plan: string;
1226
- offer: "scope" | "none";
1269
+ offer: "none" | "scope";
1227
1270
  channel: "web" | "native";
1228
1271
  id: string;
1229
1272
  event: string;
@@ -1272,6 +1315,20 @@ declare function createFunnelClient(options: GrooveOptions & {
1272
1315
  required: boolean;
1273
1316
  }[];
1274
1317
  nodes: ({
1318
+ id: string;
1319
+ name: string;
1320
+ type: "parameter_branch";
1321
+ parameter: string;
1322
+ cases: {
1323
+ value: string;
1324
+ target: string;
1325
+ }[];
1326
+ fallback: string;
1327
+ editorPosition?: {
1328
+ x: number;
1329
+ y: number;
1330
+ } | undefined;
1331
+ } | {
1275
1332
  id: string;
1276
1333
  name: string;
1277
1334
  type: "branch";
@@ -1340,9 +1397,75 @@ declare function createFunnelClient(options: GrooveOptions & {
1340
1397
  }[];
1341
1398
  } | undefined;
1342
1399
  };
1400
+ capabilities: {
1401
+ nodes: Record<string, {
1402
+ base: {
1403
+ text?: string | undefined;
1404
+ label?: string | undefined;
1405
+ alt?: string | undefined;
1406
+ html?: string | undefined;
1407
+ price?: {
1408
+ current: string;
1409
+ original: string | null;
1410
+ period: string;
1411
+ } | undefined;
1412
+ code?: string | undefined;
1413
+ countdownAt?: string | undefined;
1414
+ planId?: string | undefined;
1415
+ planVersionId?: string | undefined;
1416
+ 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;
1417
+ couponId?: string | undefined;
1418
+ offerId?: string | undefined;
1419
+ unavailable?: boolean | undefined;
1420
+ unavailableReason?: string | undefined;
1421
+ missing?: string[] | undefined;
1422
+ };
1423
+ picker?: string | undefined;
1424
+ byPlan?: Record<string, {
1425
+ text?: string | undefined;
1426
+ label?: string | undefined;
1427
+ alt?: string | undefined;
1428
+ html?: string | undefined;
1429
+ price?: {
1430
+ current: string;
1431
+ original: string | null;
1432
+ period: string;
1433
+ } | undefined;
1434
+ code?: string | undefined;
1435
+ countdownAt?: string | undefined;
1436
+ planId?: string | undefined;
1437
+ planVersionId?: string | undefined;
1438
+ 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;
1439
+ couponId?: string | undefined;
1440
+ offerId?: string | undefined;
1441
+ unavailable?: boolean | undefined;
1442
+ unavailableReason?: string | undefined;
1443
+ missing?: string[] | undefined;
1444
+ }> | undefined;
1445
+ }>;
1446
+ plans: Record<string, {
1447
+ id: string;
1448
+ versionId: string;
1449
+ name: string;
1450
+ price: string;
1451
+ period: string;
1452
+ 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;
1453
+ }>;
1454
+ pickers: Record<string, {
1455
+ options: string[];
1456
+ selected: string | null;
1457
+ }>;
1458
+ diagnostics: {
1459
+ nodeId: string;
1460
+ message: string;
1461
+ }[];
1462
+ };
1343
1463
  locale: string;
1344
1464
  nodeId: string;
1345
1465
  history: string[];
1466
+ answers: Record<string, string | boolean | string[]>;
1467
+ answersRevision: number;
1468
+ parameters: Record<string, string>;
1346
1469
  status: "completed" | "closed" | "running";
1347
1470
  customerId: string | null;
1348
1471
  expiresAt: string;
@@ -1368,8 +1491,8 @@ declare function createFunnelClient(options: GrooveOptions & {
1368
1491
  } | null | undefined;
1369
1492
  price?: {
1370
1493
  amountCents: number;
1371
- currency: string;
1372
- interval: string | null;
1494
+ 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";
1495
+ interval: "free" | "month" | "year" | null;
1373
1496
  } | undefined;
1374
1497
  accepted?: boolean | undefined;
1375
1498
  }>;
@@ -1434,7 +1557,298 @@ declare function createFunnelClient(options: GrooveOptions & {
1434
1557
  type: "purchase";
1435
1558
  close: false;
1436
1559
  plan: string;
1437
- offer: "scope" | "none";
1560
+ offer: "none" | "scope";
1561
+ channel: "web" | "native";
1562
+ id: string;
1563
+ event: string;
1564
+ properties: Record<string, string | number | boolean | null>;
1565
+ picker?: string | undefined;
1566
+ } | {
1567
+ type: "navigate";
1568
+ target: string;
1569
+ close: false;
1570
+ id: string;
1571
+ event: string;
1572
+ properties: Record<string, string | number | boolean | null>;
1573
+ } | {
1574
+ type: "event";
1575
+ close: boolean;
1576
+ id: string;
1577
+ event: string;
1578
+ properties: Record<string, string | number | boolean | null>;
1579
+ } | {
1580
+ type: "close";
1581
+ close: true;
1582
+ id: string;
1583
+ event: string;
1584
+ properties: Record<string, string | number | boolean | null>;
1585
+ } | {
1586
+ type: "open_url";
1587
+ close: boolean;
1588
+ url: string;
1589
+ id: string;
1590
+ event: string;
1591
+ properties: Record<string, string | number | boolean | null>;
1592
+ } | {
1593
+ type: "claim_offer";
1594
+ close: boolean;
1595
+ couponId: string;
1596
+ id: string;
1597
+ event: string;
1598
+ properties: Record<string, string | number | boolean | null>;
1599
+ })[];
1600
+ funnel?: {
1601
+ version: 1;
1602
+ entry: string;
1603
+ questions: {
1604
+ id: string;
1605
+ source: string;
1606
+ required: boolean;
1607
+ }[];
1608
+ nodes: ({
1609
+ id: string;
1610
+ name: string;
1611
+ type: "parameter_branch";
1612
+ parameter: string;
1613
+ cases: {
1614
+ value: string;
1615
+ target: string;
1616
+ }[];
1617
+ fallback: string;
1618
+ editorPosition?: {
1619
+ x: number;
1620
+ y: number;
1621
+ } | undefined;
1622
+ } | {
1623
+ id: string;
1624
+ name: string;
1625
+ type: "branch";
1626
+ question: string;
1627
+ cases: {
1628
+ value: string | boolean;
1629
+ target: string;
1630
+ }[];
1631
+ fallback: string;
1632
+ editorPosition?: {
1633
+ x: number;
1634
+ y: number;
1635
+ } | undefined;
1636
+ } | {
1637
+ id: string;
1638
+ name: string;
1639
+ type: "auth";
1640
+ success: string;
1641
+ cancel: string;
1642
+ failure: string;
1643
+ editorPosition?: {
1644
+ x: number;
1645
+ y: number;
1646
+ } | undefined;
1647
+ } | {
1648
+ id: string;
1649
+ name: string;
1650
+ type: "purchase";
1651
+ planVersionId: string;
1652
+ success: string;
1653
+ cancel: string;
1654
+ failure: string;
1655
+ editorPosition?: {
1656
+ x: number;
1657
+ y: number;
1658
+ } | undefined;
1659
+ } | {
1660
+ id: string;
1661
+ name: string;
1662
+ type: "experiment";
1663
+ experimentId: string;
1664
+ revision: number;
1665
+ bucketVersion: number;
1666
+ variants: {
1667
+ id: string;
1668
+ name: string;
1669
+ weight: number;
1670
+ target: string;
1671
+ }[];
1672
+ editorPosition?: {
1673
+ x: number;
1674
+ y: number;
1675
+ } | undefined;
1676
+ } | {
1677
+ id: string;
1678
+ name: string;
1679
+ type: "complete";
1680
+ editorPosition?: {
1681
+ x: number;
1682
+ y: number;
1683
+ } | undefined;
1684
+ })[];
1685
+ routes: {
1686
+ action: string;
1687
+ target: string;
1688
+ }[];
1689
+ } | undefined;
1690
+ };
1691
+ capabilities: {
1692
+ nodes: Record<string, {
1693
+ base: {
1694
+ text?: string | undefined;
1695
+ label?: string | undefined;
1696
+ alt?: string | undefined;
1697
+ html?: string | undefined;
1698
+ price?: {
1699
+ current: string;
1700
+ original: string | null;
1701
+ period: string;
1702
+ } | undefined;
1703
+ code?: string | undefined;
1704
+ countdownAt?: string | undefined;
1705
+ planId?: string | undefined;
1706
+ planVersionId?: string | undefined;
1707
+ 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;
1708
+ couponId?: string | undefined;
1709
+ offerId?: string | undefined;
1710
+ unavailable?: boolean | undefined;
1711
+ unavailableReason?: string | undefined;
1712
+ missing?: string[] | undefined;
1713
+ };
1714
+ picker?: string | undefined;
1715
+ byPlan?: Record<string, {
1716
+ text?: string | undefined;
1717
+ label?: string | undefined;
1718
+ alt?: string | undefined;
1719
+ html?: string | undefined;
1720
+ price?: {
1721
+ current: string;
1722
+ original: string | null;
1723
+ period: string;
1724
+ } | undefined;
1725
+ code?: string | undefined;
1726
+ countdownAt?: string | undefined;
1727
+ planId?: string | undefined;
1728
+ planVersionId?: string | undefined;
1729
+ 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;
1730
+ couponId?: string | undefined;
1731
+ offerId?: string | undefined;
1732
+ unavailable?: boolean | undefined;
1733
+ unavailableReason?: string | undefined;
1734
+ missing?: string[] | undefined;
1735
+ }> | undefined;
1736
+ }>;
1737
+ plans: Record<string, {
1738
+ id: string;
1739
+ versionId: string;
1740
+ name: string;
1741
+ price: string;
1742
+ period: string;
1743
+ 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;
1744
+ }>;
1745
+ pickers: Record<string, {
1746
+ options: string[];
1747
+ selected: string | null;
1748
+ }>;
1749
+ diagnostics: {
1750
+ nodeId: string;
1751
+ message: string;
1752
+ }[];
1753
+ };
1754
+ locale: string;
1755
+ nodeId: string;
1756
+ history: string[];
1757
+ answers: Record<string, string | boolean | string[]>;
1758
+ answersRevision: number;
1759
+ parameters: Record<string, string>;
1760
+ status: "completed" | "closed" | "running";
1761
+ customerId: string | null;
1762
+ expiresAt: string;
1763
+ assignments: {
1764
+ nodeId: string;
1765
+ variantId: string;
1766
+ target: string;
1767
+ experimentId: string;
1768
+ revision: number;
1769
+ bucketVersion: number;
1770
+ excluded: boolean;
1771
+ }[];
1772
+ } | undefined;
1773
+ runToken?: string | undefined;
1774
+ visitorToken?: string | undefined;
1775
+ visitorExpiresAt?: string | undefined;
1776
+ target?: string | undefined;
1777
+ pending?: boolean | undefined;
1778
+ trialTerms?: string | undefined;
1779
+ checkout?: {
1780
+ checkoutId: string;
1781
+ url: string;
1782
+ } | null | undefined;
1783
+ price?: {
1784
+ amountCents: number;
1785
+ 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";
1786
+ interval: "free" | "month" | "year" | null;
1787
+ } | undefined;
1788
+ accepted?: boolean | undefined;
1789
+ }>;
1790
+ saveAnswers: (input: Omit<Extract<FunnelRequest, {
1791
+ operation: "answers";
1792
+ }>, "operation" | "customerToken">) => Promise<{
1793
+ run?: {
1794
+ id: string;
1795
+ campaignId: string;
1796
+ versionId: string;
1797
+ document: {
1798
+ kind: "screen";
1799
+ schemaVersion: 3;
1800
+ name: string;
1801
+ surface: "popup" | "paywall" | "onboarding" | "page";
1802
+ presentation: {
1803
+ type: "modal";
1804
+ size: "sm" | "md" | "lg";
1805
+ } | {
1806
+ type: "sheet";
1807
+ size: "sm" | "md" | "lg";
1808
+ } | {
1809
+ type: "fullscreen";
1810
+ };
1811
+ theme: {
1812
+ primary: string;
1813
+ background: string;
1814
+ text: string;
1815
+ radius: "sm" | "md" | "lg" | "none" | "full";
1816
+ font: "system" | "serif" | "rounded" | "mono";
1817
+ };
1818
+ pages: {
1819
+ id: string;
1820
+ name: string;
1821
+ root: StackNode;
1822
+ theme?: {
1823
+ primary: string;
1824
+ background: string;
1825
+ text: string;
1826
+ radius: "sm" | "md" | "lg" | "none" | "full";
1827
+ font: "system" | "serif" | "rounded" | "mono";
1828
+ } | undefined;
1829
+ source?: {
1830
+ campaignId: string;
1831
+ versionId: string;
1832
+ map: Record<string, string>;
1833
+ strings?: {
1834
+ defaultLocale: string;
1835
+ locales: Record<string, Record<string, string>>;
1836
+ } | undefined;
1837
+ } | undefined;
1838
+ editorPosition?: {
1839
+ x: number;
1840
+ y: number;
1841
+ } | undefined;
1842
+ }[];
1843
+ strings: {
1844
+ defaultLocale: string;
1845
+ locales: Record<string, Record<string, string>>;
1846
+ };
1847
+ actions: ({
1848
+ type: "purchase";
1849
+ close: false;
1850
+ plan: string;
1851
+ offer: "none" | "scope";
1438
1852
  channel: "web" | "native";
1439
1853
  id: string;
1440
1854
  event: string;
@@ -1483,6 +1897,20 @@ declare function createFunnelClient(options: GrooveOptions & {
1483
1897
  required: boolean;
1484
1898
  }[];
1485
1899
  nodes: ({
1900
+ id: string;
1901
+ name: string;
1902
+ type: "parameter_branch";
1903
+ parameter: string;
1904
+ cases: {
1905
+ value: string;
1906
+ target: string;
1907
+ }[];
1908
+ fallback: string;
1909
+ editorPosition?: {
1910
+ x: number;
1911
+ y: number;
1912
+ } | undefined;
1913
+ } | {
1486
1914
  id: string;
1487
1915
  name: string;
1488
1916
  type: "branch";
@@ -1551,9 +1979,75 @@ declare function createFunnelClient(options: GrooveOptions & {
1551
1979
  }[];
1552
1980
  } | undefined;
1553
1981
  };
1982
+ capabilities: {
1983
+ nodes: Record<string, {
1984
+ base: {
1985
+ text?: string | undefined;
1986
+ label?: string | undefined;
1987
+ alt?: string | undefined;
1988
+ html?: string | undefined;
1989
+ price?: {
1990
+ current: string;
1991
+ original: string | null;
1992
+ period: string;
1993
+ } | undefined;
1994
+ code?: string | undefined;
1995
+ countdownAt?: string | undefined;
1996
+ planId?: string | undefined;
1997
+ planVersionId?: string | undefined;
1998
+ 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;
1999
+ couponId?: string | undefined;
2000
+ offerId?: string | undefined;
2001
+ unavailable?: boolean | undefined;
2002
+ unavailableReason?: string | undefined;
2003
+ missing?: string[] | undefined;
2004
+ };
2005
+ picker?: string | undefined;
2006
+ byPlan?: Record<string, {
2007
+ text?: string | undefined;
2008
+ label?: string | undefined;
2009
+ alt?: string | undefined;
2010
+ html?: string | undefined;
2011
+ price?: {
2012
+ current: string;
2013
+ original: string | null;
2014
+ period: string;
2015
+ } | undefined;
2016
+ code?: string | undefined;
2017
+ countdownAt?: string | undefined;
2018
+ planId?: string | undefined;
2019
+ planVersionId?: string | undefined;
2020
+ 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;
2021
+ couponId?: string | undefined;
2022
+ offerId?: string | undefined;
2023
+ unavailable?: boolean | undefined;
2024
+ unavailableReason?: string | undefined;
2025
+ missing?: string[] | undefined;
2026
+ }> | undefined;
2027
+ }>;
2028
+ plans: Record<string, {
2029
+ id: string;
2030
+ versionId: string;
2031
+ name: string;
2032
+ price: string;
2033
+ period: string;
2034
+ 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;
2035
+ }>;
2036
+ pickers: Record<string, {
2037
+ options: string[];
2038
+ selected: string | null;
2039
+ }>;
2040
+ diagnostics: {
2041
+ nodeId: string;
2042
+ message: string;
2043
+ }[];
2044
+ };
1554
2045
  locale: string;
1555
2046
  nodeId: string;
1556
2047
  history: string[];
2048
+ answers: Record<string, string | boolean | string[]>;
2049
+ answersRevision: number;
2050
+ parameters: Record<string, string>;
1557
2051
  status: "completed" | "closed" | "running";
1558
2052
  customerId: string | null;
1559
2053
  expiresAt: string;
@@ -1579,8 +2073,8 @@ declare function createFunnelClient(options: GrooveOptions & {
1579
2073
  } | null | undefined;
1580
2074
  price?: {
1581
2075
  amountCents: number;
1582
- currency: string;
1583
- interval: string | null;
2076
+ 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";
2077
+ interval: "free" | "month" | "year" | null;
1584
2078
  } | undefined;
1585
2079
  accepted?: boolean | undefined;
1586
2080
  }>;
@@ -1645,7 +2139,7 @@ declare function createFunnelClient(options: GrooveOptions & {
1645
2139
  type: "purchase";
1646
2140
  close: false;
1647
2141
  plan: string;
1648
- offer: "scope" | "none";
2142
+ offer: "none" | "scope";
1649
2143
  channel: "web" | "native";
1650
2144
  id: string;
1651
2145
  event: string;
@@ -1694,6 +2188,20 @@ declare function createFunnelClient(options: GrooveOptions & {
1694
2188
  required: boolean;
1695
2189
  }[];
1696
2190
  nodes: ({
2191
+ id: string;
2192
+ name: string;
2193
+ type: "parameter_branch";
2194
+ parameter: string;
2195
+ cases: {
2196
+ value: string;
2197
+ target: string;
2198
+ }[];
2199
+ fallback: string;
2200
+ editorPosition?: {
2201
+ x: number;
2202
+ y: number;
2203
+ } | undefined;
2204
+ } | {
1697
2205
  id: string;
1698
2206
  name: string;
1699
2207
  type: "branch";
@@ -1762,9 +2270,75 @@ declare function createFunnelClient(options: GrooveOptions & {
1762
2270
  }[];
1763
2271
  } | undefined;
1764
2272
  };
2273
+ capabilities: {
2274
+ nodes: Record<string, {
2275
+ base: {
2276
+ text?: string | undefined;
2277
+ label?: string | undefined;
2278
+ alt?: string | undefined;
2279
+ html?: string | undefined;
2280
+ price?: {
2281
+ current: string;
2282
+ original: string | null;
2283
+ period: string;
2284
+ } | undefined;
2285
+ code?: string | undefined;
2286
+ countdownAt?: string | undefined;
2287
+ planId?: string | undefined;
2288
+ planVersionId?: string | undefined;
2289
+ 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;
2290
+ couponId?: string | undefined;
2291
+ offerId?: string | undefined;
2292
+ unavailable?: boolean | undefined;
2293
+ unavailableReason?: string | undefined;
2294
+ missing?: string[] | undefined;
2295
+ };
2296
+ picker?: string | undefined;
2297
+ byPlan?: Record<string, {
2298
+ text?: string | undefined;
2299
+ label?: string | undefined;
2300
+ alt?: string | undefined;
2301
+ html?: string | undefined;
2302
+ price?: {
2303
+ current: string;
2304
+ original: string | null;
2305
+ period: string;
2306
+ } | undefined;
2307
+ code?: string | undefined;
2308
+ countdownAt?: string | undefined;
2309
+ planId?: string | undefined;
2310
+ planVersionId?: string | undefined;
2311
+ 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;
2312
+ couponId?: string | undefined;
2313
+ offerId?: string | undefined;
2314
+ unavailable?: boolean | undefined;
2315
+ unavailableReason?: string | undefined;
2316
+ missing?: string[] | undefined;
2317
+ }> | undefined;
2318
+ }>;
2319
+ plans: Record<string, {
2320
+ id: string;
2321
+ versionId: string;
2322
+ name: string;
2323
+ price: string;
2324
+ period: string;
2325
+ 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;
2326
+ }>;
2327
+ pickers: Record<string, {
2328
+ options: string[];
2329
+ selected: string | null;
2330
+ }>;
2331
+ diagnostics: {
2332
+ nodeId: string;
2333
+ message: string;
2334
+ }[];
2335
+ };
1765
2336
  locale: string;
1766
2337
  nodeId: string;
1767
2338
  history: string[];
2339
+ answers: Record<string, string | boolean | string[]>;
2340
+ answersRevision: number;
2341
+ parameters: Record<string, string>;
1768
2342
  status: "completed" | "closed" | "running";
1769
2343
  customerId: string | null;
1770
2344
  expiresAt: string;
@@ -1790,8 +2364,8 @@ declare function createFunnelClient(options: GrooveOptions & {
1790
2364
  } | null | undefined;
1791
2365
  price?: {
1792
2366
  amountCents: number;
1793
- currency: string;
1794
- interval: string | null;
2367
+ 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";
2368
+ interval: "free" | "month" | "year" | null;
1795
2369
  } | undefined;
1796
2370
  accepted?: boolean | undefined;
1797
2371
  }>;
@@ -1854,7 +2428,7 @@ declare function createFunnelClient(options: GrooveOptions & {
1854
2428
  type: "purchase";
1855
2429
  close: false;
1856
2430
  plan: string;
1857
- offer: "scope" | "none";
2431
+ offer: "none" | "scope";
1858
2432
  channel: "web" | "native";
1859
2433
  id: string;
1860
2434
  event: string;
@@ -1903,6 +2477,20 @@ declare function createFunnelClient(options: GrooveOptions & {
1903
2477
  required: boolean;
1904
2478
  }[];
1905
2479
  nodes: ({
2480
+ id: string;
2481
+ name: string;
2482
+ type: "parameter_branch";
2483
+ parameter: string;
2484
+ cases: {
2485
+ value: string;
2486
+ target: string;
2487
+ }[];
2488
+ fallback: string;
2489
+ editorPosition?: {
2490
+ x: number;
2491
+ y: number;
2492
+ } | undefined;
2493
+ } | {
1906
2494
  id: string;
1907
2495
  name: string;
1908
2496
  type: "branch";
@@ -1971,9 +2559,75 @@ declare function createFunnelClient(options: GrooveOptions & {
1971
2559
  }[];
1972
2560
  } | undefined;
1973
2561
  };
2562
+ capabilities: {
2563
+ nodes: Record<string, {
2564
+ base: {
2565
+ text?: string | undefined;
2566
+ label?: string | undefined;
2567
+ alt?: string | undefined;
2568
+ html?: string | undefined;
2569
+ price?: {
2570
+ current: string;
2571
+ original: string | null;
2572
+ period: string;
2573
+ } | undefined;
2574
+ code?: string | undefined;
2575
+ countdownAt?: string | undefined;
2576
+ planId?: string | undefined;
2577
+ planVersionId?: string | undefined;
2578
+ 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;
2579
+ couponId?: string | undefined;
2580
+ offerId?: string | undefined;
2581
+ unavailable?: boolean | undefined;
2582
+ unavailableReason?: string | undefined;
2583
+ missing?: string[] | undefined;
2584
+ };
2585
+ picker?: string | undefined;
2586
+ byPlan?: Record<string, {
2587
+ text?: string | undefined;
2588
+ label?: string | undefined;
2589
+ alt?: string | undefined;
2590
+ html?: string | undefined;
2591
+ price?: {
2592
+ current: string;
2593
+ original: string | null;
2594
+ period: string;
2595
+ } | undefined;
2596
+ code?: string | undefined;
2597
+ countdownAt?: string | undefined;
2598
+ planId?: string | undefined;
2599
+ planVersionId?: string | undefined;
2600
+ 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;
2601
+ couponId?: string | undefined;
2602
+ offerId?: string | undefined;
2603
+ unavailable?: boolean | undefined;
2604
+ unavailableReason?: string | undefined;
2605
+ missing?: string[] | undefined;
2606
+ }> | undefined;
2607
+ }>;
2608
+ plans: Record<string, {
2609
+ id: string;
2610
+ versionId: string;
2611
+ name: string;
2612
+ price: string;
2613
+ period: string;
2614
+ 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;
2615
+ }>;
2616
+ pickers: Record<string, {
2617
+ options: string[];
2618
+ selected: string | null;
2619
+ }>;
2620
+ diagnostics: {
2621
+ nodeId: string;
2622
+ message: string;
2623
+ }[];
2624
+ };
1974
2625
  locale: string;
1975
2626
  nodeId: string;
1976
2627
  history: string[];
2628
+ answers: Record<string, string | boolean | string[]>;
2629
+ answersRevision: number;
2630
+ parameters: Record<string, string>;
1977
2631
  status: "completed" | "closed" | "running";
1978
2632
  customerId: string | null;
1979
2633
  expiresAt: string;
@@ -1999,8 +2653,8 @@ declare function createFunnelClient(options: GrooveOptions & {
1999
2653
  } | null | undefined;
2000
2654
  price?: {
2001
2655
  amountCents: number;
2002
- currency: string;
2003
- interval: string | null;
2656
+ 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";
2657
+ interval: "free" | "month" | "year" | null;
2004
2658
  } | undefined;
2005
2659
  accepted?: boolean | undefined;
2006
2660
  }>;
@@ -2086,7 +2740,7 @@ declare function showFunnel(container: HTMLElement, options: {
2086
2740
  type: "purchase";
2087
2741
  close: false;
2088
2742
  plan: string;
2089
- offer: "scope" | "none";
2743
+ offer: "none" | "scope";
2090
2744
  channel: "web" | "native";
2091
2745
  id: string;
2092
2746
  event: string;
@@ -2135,6 +2789,20 @@ declare function showFunnel(container: HTMLElement, options: {
2135
2789
  required: boolean;
2136
2790
  }[];
2137
2791
  nodes: ({
2792
+ id: string;
2793
+ name: string;
2794
+ type: "parameter_branch";
2795
+ parameter: string;
2796
+ cases: {
2797
+ value: string;
2798
+ target: string;
2799
+ }[];
2800
+ fallback: string;
2801
+ editorPosition?: {
2802
+ x: number;
2803
+ y: number;
2804
+ } | undefined;
2805
+ } | {
2138
2806
  id: string;
2139
2807
  name: string;
2140
2808
  type: "branch";
@@ -2203,9 +2871,75 @@ declare function showFunnel(container: HTMLElement, options: {
2203
2871
  }[];
2204
2872
  } | undefined;
2205
2873
  };
2874
+ capabilities: {
2875
+ nodes: Record<string, {
2876
+ base: {
2877
+ text?: string | undefined;
2878
+ label?: string | undefined;
2879
+ alt?: string | undefined;
2880
+ html?: string | undefined;
2881
+ price?: {
2882
+ current: string;
2883
+ original: string | null;
2884
+ period: string;
2885
+ } | undefined;
2886
+ code?: string | undefined;
2887
+ countdownAt?: string | undefined;
2888
+ planId?: string | undefined;
2889
+ planVersionId?: string | undefined;
2890
+ 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;
2891
+ couponId?: string | undefined;
2892
+ offerId?: string | undefined;
2893
+ unavailable?: boolean | undefined;
2894
+ unavailableReason?: string | undefined;
2895
+ missing?: string[] | undefined;
2896
+ };
2897
+ picker?: string | undefined;
2898
+ byPlan?: Record<string, {
2899
+ text?: string | undefined;
2900
+ label?: string | undefined;
2901
+ alt?: string | undefined;
2902
+ html?: string | undefined;
2903
+ price?: {
2904
+ current: string;
2905
+ original: string | null;
2906
+ period: string;
2907
+ } | undefined;
2908
+ code?: string | undefined;
2909
+ countdownAt?: string | undefined;
2910
+ planId?: string | undefined;
2911
+ planVersionId?: string | undefined;
2912
+ 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;
2913
+ couponId?: string | undefined;
2914
+ offerId?: string | undefined;
2915
+ unavailable?: boolean | undefined;
2916
+ unavailableReason?: string | undefined;
2917
+ missing?: string[] | undefined;
2918
+ }> | undefined;
2919
+ }>;
2920
+ plans: Record<string, {
2921
+ id: string;
2922
+ versionId: string;
2923
+ name: string;
2924
+ price: string;
2925
+ period: string;
2926
+ 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;
2927
+ }>;
2928
+ pickers: Record<string, {
2929
+ options: string[];
2930
+ selected: string | null;
2931
+ }>;
2932
+ diagnostics: {
2933
+ nodeId: string;
2934
+ message: string;
2935
+ }[];
2936
+ };
2206
2937
  locale: string;
2207
2938
  nodeId: string;
2208
2939
  history: string[];
2940
+ answers: Record<string, string | boolean | string[]>;
2941
+ answersRevision: number;
2942
+ parameters: Record<string, string>;
2209
2943
  status: "completed" | "closed" | "running";
2210
2944
  customerId: string | null;
2211
2945
  expiresAt: string;
@@ -2280,7 +3014,7 @@ declare function createGroove(options: GrooveOptions & {
2280
3014
  requestId: string;
2281
3015
  scope: {
2282
3016
  projectId: string;
2283
- environment: "live" | "sandbox";
3017
+ environment: "sandbox" | "live";
2284
3018
  };
2285
3019
  offers: {
2286
3020
  id: string;
@@ -2323,7 +3057,7 @@ declare function createGroove(options: GrooveOptions & {
2323
3057
  requestId: string;
2324
3058
  scope: {
2325
3059
  projectId: string;
2326
- environment: "live" | "sandbox";
3060
+ environment: "sandbox" | "live";
2327
3061
  };
2328
3062
  state: {
2329
3063
  customerId: string;
@@ -2340,7 +3074,7 @@ declare function createGroove(options: GrooveOptions & {
2340
3074
  name: string;
2341
3075
  group: string;
2342
3076
  kind: "main" | "addon";
2343
- source: "apple" | "google" | "subscription" | "assignment" | "license";
3077
+ source: "subscription" | "assignment" | "license" | "apple" | "google";
2344
3078
  status: string;
2345
3079
  accessEnabled: boolean;
2346
3080
  startsAt: string | null;
@@ -2405,52 +3139,13 @@ declare function createGroove(options: GrooveOptions & {
2405
3139
  reserved: string;
2406
3140
  spendable: string;
2407
3141
  consumedInActiveGrants: string;
3142
+ ownSpendable: string;
3143
+ sharedSpendable: string;
3144
+ sourceCount: number;
2408
3145
  nextExpiry: {
2409
3146
  at: string;
2410
3147
  spendable: string;
2411
3148
  } | null;
2412
- breakdown: {
2413
- id: string;
2414
- entityId: string | null;
2415
- resourceKey: string;
2416
- name: string;
2417
- source: string;
2418
- granted: string;
2419
- available: string;
2420
- reserved: string;
2421
- spendable: string;
2422
- consumed: string;
2423
- forfeited: string;
2424
- rolledOver: string;
2425
- startsAt: string;
2426
- expiresAt: string | null;
2427
- eligible: boolean;
2428
- rates: {
2429
- featureKey: string;
2430
- units: string;
2431
- cost: string;
2432
- tiers?: {
2433
- upTo: string | null;
2434
- cost: string;
2435
- }[] | undefined;
2436
- dimensions?: {
2437
- key: string;
2438
- match: Record<string, string>;
2439
- priority: number;
2440
- cost?: string | undefined;
2441
- tiers?: {
2442
- upTo: string | null;
2443
- cost: string;
2444
- }[] | undefined;
2445
- }[] | undefined;
2446
- multipliers?: {
2447
- key: string;
2448
- match: Record<string, string>;
2449
- factor: string;
2450
- add: string;
2451
- }[] | undefined;
2452
- }[];
2453
- }[];
2454
3149
  }> | undefined;
2455
3150
  };
2456
3151
  }>;
@@ -2459,7 +3154,7 @@ declare function createGroove(options: GrooveOptions & {
2459
3154
  requestId: string;
2460
3155
  scope: {
2461
3156
  projectId: string;
2462
- environment: "live" | "sandbox";
3157
+ environment: "sandbox" | "live";
2463
3158
  };
2464
3159
  customerId: string;
2465
3160
  entityId: string | null;
@@ -2467,7 +3162,7 @@ declare function createGroove(options: GrooveOptions & {
2467
3162
  plans: {
2468
3163
  plan: {
2469
3164
  projectId: string;
2470
- environment: "live" | "sandbox";
3165
+ environment: "sandbox" | "live";
2471
3166
  id: string;
2472
3167
  planId: string;
2473
3168
  variant: {
@@ -2555,7 +3250,7 @@ declare function createGroove(options: GrooveOptions & {
2555
3250
  requestId: string;
2556
3251
  scope: {
2557
3252
  projectId: string;
2558
- environment: "live" | "sandbox";
3253
+ environment: "sandbox" | "live";
2559
3254
  };
2560
3255
  packs: {
2561
3256
  key: string;
@@ -2575,7 +3270,7 @@ declare function createGroove(options: GrooveOptions & {
2575
3270
  requestId: string;
2576
3271
  scope: {
2577
3272
  projectId: string;
2578
- environment: "live" | "sandbox";
3273
+ environment: "sandbox" | "live";
2579
3274
  };
2580
3275
  orders: {
2581
3276
  id: string;
@@ -2599,7 +3294,7 @@ declare function createGroove(options: GrooveOptions & {
2599
3294
  requestId: string;
2600
3295
  scope: {
2601
3296
  projectId: string;
2602
- environment: "live" | "sandbox";
3297
+ environment: "sandbox" | "live";
2603
3298
  };
2604
3299
  orderId: string;
2605
3300
  url: string;
@@ -2608,7 +3303,7 @@ declare function createGroove(options: GrooveOptions & {
2608
3303
  requestId: string;
2609
3304
  scope: {
2610
3305
  projectId: string;
2611
- environment: "live" | "sandbox";
3306
+ environment: "sandbox" | "live";
2612
3307
  };
2613
3308
  transactions: {
2614
3309
  id: string;
@@ -2640,7 +3335,12 @@ declare function createGroove(options: GrooveOptions & {
2640
3335
  id: string;
2641
3336
  } | null;
2642
3337
  }>;
2643
- getBalances(): Promise<{
3338
+ listCreditBalances(input?: Omit<ApiInput<"listCreditBalances">, "customerId" | "entityId">): Promise<{
3339
+ requestId: string;
3340
+ scope: {
3341
+ projectId: string;
3342
+ environment: "sandbox" | "live";
3343
+ };
2644
3344
  customerId: string;
2645
3345
  entityId: string | null;
2646
3346
  evaluatedAt: string;
@@ -2686,12 +3386,37 @@ declare function createGroove(options: GrooveOptions & {
2686
3386
  }[] | undefined;
2687
3387
  }[];
2688
3388
  }[];
3389
+ nextCursor: {
3390
+ createdAt: string;
3391
+ id: string;
3392
+ } | null;
3393
+ }>;
3394
+ getBalances(): Promise<{
3395
+ customerId: string;
3396
+ entityId: string | null;
3397
+ evaluatedAt: string;
3398
+ resources: Record<string, {
3399
+ resourceKey: string;
3400
+ name: string;
3401
+ granted: string;
3402
+ available: string;
3403
+ reserved: string;
3404
+ spendable: string;
3405
+ consumedInActiveGrants: string;
3406
+ ownSpendable: string;
3407
+ sharedSpendable: string;
3408
+ sourceCount: number;
3409
+ nextExpiry: {
3410
+ at: string;
3411
+ spendable: string;
3412
+ } | null;
3413
+ }>;
2689
3414
  }>;
2690
3415
  checkCredits(input: Omit<ApiInput<"checkCredits">, "customerId">): Promise<{
2691
3416
  requestId: string;
2692
3417
  scope: {
2693
3418
  projectId: string;
2694
- environment: "live" | "sandbox";
3419
+ environment: "sandbox" | "live";
2695
3420
  };
2696
3421
  allowed: boolean;
2697
3422
  featureKey: string;
@@ -2784,7 +3509,7 @@ declare function createGroove(options: GrooveOptions & {
2784
3509
  requestId: string;
2785
3510
  scope: {
2786
3511
  projectId: string;
2787
- environment: "live" | "sandbox";
3512
+ environment: "sandbox" | "live";
2788
3513
  };
2789
3514
  checkoutId: string | null;
2790
3515
  url: string | null;
@@ -2803,6 +3528,41 @@ declare function createGroove(options: GrooveOptions & {
2803
3528
  endsAt: string | null;
2804
3529
  createdAt: string;
2805
3530
  } | undefined;
3531
+ membershipPreview?: {
3532
+ action: "cancel" | "attach" | "change" | "resume" | "cancel_change";
3533
+ direction: "new" | "upgrade" | "downgrade" | "same";
3534
+ timing: "immediate" | "end_of_cycle";
3535
+ group: string;
3536
+ kind: "main" | "addon";
3537
+ currentPlanVersionId: string | null;
3538
+ targetPlanVersionId: string | null;
3539
+ effectiveAt: string;
3540
+ amountDueCents: number | null;
3541
+ 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";
3542
+ requiresCheckout: boolean;
3543
+ estimate: boolean;
3544
+ lineItems: {
3545
+ description: string;
3546
+ amountCents: number;
3547
+ }[];
3548
+ nextCycle: {
3549
+ startsAt: string | null;
3550
+ amountCents: number;
3551
+ interval: "free" | "month" | "year";
3552
+ estimate: boolean;
3553
+ } | null;
3554
+ } | undefined;
3555
+ reviewKey?: string | undefined;
3556
+ membership?: {
3557
+ changeId: string;
3558
+ status: "payment_pending" | "scheduled" | "completed";
3559
+ checkout: {
3560
+ checkoutId: string;
3561
+ url: string;
3562
+ } | null;
3563
+ effectiveAt: string | null;
3564
+ paymentUrl?: string | null | undefined;
3565
+ } | undefined;
2806
3566
  }>;
2807
3567
  createCheckout(planVersionId: string, options?: {
2808
3568
  requestId?: string;
@@ -2813,7 +3573,7 @@ declare function createGroove(options: GrooveOptions & {
2813
3573
  requestId: string;
2814
3574
  scope: {
2815
3575
  projectId: string;
2816
- environment: "live" | "sandbox";
3576
+ environment: "sandbox" | "live";
2817
3577
  };
2818
3578
  checkoutId: string;
2819
3579
  url: string;
@@ -2834,7 +3594,7 @@ declare function createGroove(options: GrooveOptions & {
2834
3594
  name: string;
2835
3595
  group: string;
2836
3596
  kind: "main" | "addon";
2837
- source: "apple" | "google" | "subscription" | "assignment" | "license";
3597
+ source: "subscription" | "assignment" | "license" | "apple" | "google";
2838
3598
  status: string;
2839
3599
  accessEnabled: boolean;
2840
3600
  startsAt: string | null;
@@ -2910,7 +3670,7 @@ declare function createGroove(options: GrooveOptions & {
2910
3670
  requestId: string;
2911
3671
  scope: {
2912
3672
  projectId: string;
2913
- environment: "live" | "sandbox";
3673
+ environment: "sandbox" | "live";
2914
3674
  };
2915
3675
  changeId: string;
2916
3676
  status: "payment_pending" | "scheduled" | "completed";
@@ -2935,7 +3695,7 @@ declare function createGroove(options: GrooveOptions & {
2935
3695
  requestId: string;
2936
3696
  scope: {
2937
3697
  projectId: string;
2938
- environment: "live" | "sandbox";
3698
+ environment: "sandbox" | "live";
2939
3699
  };
2940
3700
  trial: {
2941
3701
  id: string;
@@ -2980,11 +3740,11 @@ declare function createGroove(options: GrooveOptions & {
2980
3740
  requestId: string;
2981
3741
  scope: {
2982
3742
  projectId: string;
2983
- environment: "live" | "sandbox";
3743
+ environment: "sandbox" | "live";
2984
3744
  };
2985
3745
  plans: {
2986
3746
  projectId: string;
2987
- environment: "live" | "sandbox";
3747
+ environment: "sandbox" | "live";
2988
3748
  id: string;
2989
3749
  planId: string;
2990
3750
  variant: {
@@ -3046,7 +3806,7 @@ declare function createGroove(options: GrooveOptions & {
3046
3806
  requestId: string;
3047
3807
  scope: {
3048
3808
  projectId: string;
3049
- environment: "live" | "sandbox";
3809
+ environment: "sandbox" | "live";
3050
3810
  };
3051
3811
  customerId: string;
3052
3812
  evaluatedAt: string;
@@ -3057,7 +3817,7 @@ declare function createGroove(options: GrooveOptions & {
3057
3817
  } | null;
3058
3818
  planVersion: {
3059
3819
  projectId: string;
3060
- environment: "live" | "sandbox";
3820
+ environment: "sandbox" | "live";
3061
3821
  id: string;
3062
3822
  planId: string;
3063
3823
  variant: {