@adapty/core 4.2.0 → 4.3.0-dev.3b2b0c67a42af64750f8431fff08069b37d56f1b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,16 +1,19 @@
1
1
  //#region src/types/inputs.ts
2
2
  /**
3
- * Log levels for the SDK
3
+ * Log levels for the SDK, ordered from the least to the most verbose:
4
+ * `ERROR` < `WARN` < `INFO` < `VERBOSE` < `DEBUG`.
4
5
  *
5
6
  * @remarks
7
+ * Setting a level enables it and all the levels above it in the list.
6
8
  * Logging is performed on a native side.
7
9
  * So you are expected to watch logs in Xcode or Android Studio.
8
10
  */
9
11
  const LogLevel = Object.freeze({
10
- VERBOSE: "verbose",
11
12
  ERROR: "error",
12
13
  WARN: "warn",
13
- INFO: "info"
14
+ INFO: "info",
15
+ VERBOSE: "verbose",
16
+ DEBUG: "debug"
14
17
  });
15
18
  const FetchPolicy = Object.freeze({
16
19
  ReloadRevalidatingCacheData: "reload_revalidating_cache_data",
@@ -31,7 +34,8 @@ function getConsoleForLevel(level) {
31
34
  switch (level) {
32
35
  case "error": return console.error;
33
36
  case "warn": return console.warn;
34
- case "verbose": return console.debug;
37
+ case "verbose":
38
+ case "debug": return console.debug;
35
39
  case "info":
36
40
  default: return console.info;
37
41
  }
@@ -92,6 +96,7 @@ var Log = class Log {
92
96
  case LogLevel.WARN: return 1;
93
97
  case LogLevel.INFO: return 2;
94
98
  case LogLevel.VERBOSE: return 3;
99
+ case LogLevel.DEBUG: return 4;
95
100
  }
96
101
  }
97
102
  /**
@@ -335,6 +340,8 @@ const ErrorCodeMapping = Object.freeze({
335
340
  3007: "unsupportedData",
336
341
  3100: "persistingDataError",
337
342
  3101: "fetchTimeoutError",
343
+ 3201: "operationInProgress",
344
+ 3202: "resolverFailure",
338
345
  9e3: "operationInterrupted"
339
346
  });
340
347
  const ErrorCode = ErrorCodeMapping;
@@ -387,6 +394,8 @@ const ErrorCodeName = Object.freeze({
387
394
  unsupportedData: 3007,
388
395
  persistingDataError: 3100,
389
396
  fetchTimeoutError: 3101,
397
+ operationInProgress: 3201,
398
+ resolverFailure: 3202,
390
399
  operationInterrupted: 9e3
391
400
  });
392
401
  function getErrorCode(error) {
@@ -452,7 +461,7 @@ AdaptyError.middleware = void 0;
452
461
  //#endregion
453
462
  //#region src/coders/coder.ts
454
463
  var Coder = class {
455
- constructor(platform = new DefaultPlatformAdapter()) {
464
+ constructor(platform) {
456
465
  this.platform = void 0;
457
466
  this.platform = platform;
458
467
  }
@@ -556,6 +565,32 @@ var DateCoder = class {
556
565
  }
557
566
  };
558
567
 
568
+ //#endregion
569
+ //#region src/coders/adapty-profile-subscription-commitment-info.ts
570
+ var AdaptyProfileSubscriptionCommitmentInfoCoder = class extends SimpleCoder {
571
+ constructor(..._args) {
572
+ super(..._args);
573
+ this.properties = {
574
+ billingPeriodNumber: {
575
+ key: "billing_period_number",
576
+ required: true,
577
+ type: "number"
578
+ },
579
+ totalBillingPeriods: {
580
+ key: "total_billing_periods",
581
+ required: true,
582
+ type: "number"
583
+ },
584
+ expiresAt: {
585
+ key: "expires_at",
586
+ required: true,
587
+ type: "string",
588
+ converter: new DateCoder()
589
+ }
590
+ };
591
+ }
592
+ };
593
+
559
594
  //#endregion
560
595
  //#region src/coders/adapty-access-level.ts
561
596
  var AdaptyAccessLevelCoder = class extends SimpleCoder {
@@ -658,6 +693,22 @@ var AdaptyAccessLevelCoder = class extends SimpleCoder {
658
693
  required: true,
659
694
  type: "boolean"
660
695
  },
696
+ billingPlan: {
697
+ key: "billing_plan_id",
698
+ required: false,
699
+ type: "string"
700
+ },
701
+ commitmentInfo: {
702
+ key: "commitment",
703
+ required: false,
704
+ type: "object",
705
+ converter: new AdaptyProfileSubscriptionCommitmentInfoCoder(this.platform)
706
+ },
707
+ offerId: {
708
+ key: "offer_id",
709
+ required: false,
710
+ type: "string"
711
+ },
661
712
  android: { offerId: {
662
713
  key: "offer_id",
663
714
  required: false,
@@ -709,12 +760,13 @@ var AdaptyConfigurationCoder = class {
709
760
  config["observer_mode"] = params.observerMode ?? false;
710
761
  config["ip_address_collection_disabled"] = params.ipAddressCollectionDisabled ?? false;
711
762
  config["adapty_attribution_enabled"] = params.adaptyAttributionEnabled ?? false;
763
+ if (params.storeMessagesHandling) config["store_messages_handling"] = params.storeMessagesHandling;
712
764
  if (params.logLevel) config["log_level"] = params.logLevel;
713
765
  config["server_cluster"] = params.serverCluster ?? "default";
714
766
  if (params.backendProxyHost) config["backend_proxy_host"] = params.backendProxyHost;
715
767
  if (params.backendProxyPort) config["backend_proxy_port"] = params.backendProxyPort;
716
768
  config["activate_ui"] = params.activateUi ?? true;
717
- const mediaCacheCoder = new AdaptyUiMediaCacheCoder();
769
+ const mediaCacheCoder = new AdaptyUiMediaCacheCoder(this.platform);
718
770
  config["media_cache"] = mediaCacheCoder.encode(params.mediaCache ?? {
719
771
  memoryStorageTotalCostLimit: 100 * 1024 * 1024,
720
772
  memoryStorageCountLimit: 2147483647,
@@ -815,13 +867,54 @@ var AdaptyDiscountPhaseCoder = class extends SimpleCoder {
815
867
  key: "price",
816
868
  required: true,
817
869
  type: "object",
818
- converter: new AdaptyPriceCoder()
870
+ converter: new AdaptyPriceCoder(this.platform)
819
871
  },
820
872
  subscriptionPeriod: {
821
873
  key: "subscription_period",
822
874
  required: true,
823
875
  type: "object",
824
- converter: new AdaptySubscriptionPeriodCoder()
876
+ converter: new AdaptySubscriptionPeriodCoder(this.platform)
877
+ }
878
+ };
879
+ }
880
+ };
881
+
882
+ //#endregion
883
+ //#region src/coders/array.ts
884
+ var ArrayCoder = class {
885
+ constructor(coderFactory) {
886
+ this.coderFactory = coderFactory;
887
+ }
888
+ decode(input) {
889
+ const coder = this.coderFactory();
890
+ return input.map((item) => coder.decode(item));
891
+ }
892
+ encode(value) {
893
+ const coder = this.coderFactory();
894
+ return value.map((item) => coder.encode(item));
895
+ }
896
+ };
897
+
898
+ //#endregion
899
+ //#region src/coders/product-reference-pricing-terms.ts
900
+ var ProductReferencePricingTermsCoder = class extends SimpleCoder {
901
+ constructor(..._args) {
902
+ super(..._args);
903
+ this.properties = {
904
+ billingPlan: {
905
+ key: "billing_plan_id",
906
+ required: true,
907
+ type: "string"
908
+ },
909
+ promotionalOfferId: {
910
+ key: "promotional_offer_id",
911
+ required: false,
912
+ type: "string"
913
+ },
914
+ winBackOfferId: {
915
+ key: "win_back_offer_id",
916
+ required: false,
917
+ type: "string"
825
918
  }
826
919
  };
827
920
  }
@@ -858,18 +951,12 @@ var ProductReferenceCoder = class extends SimpleCoder {
858
951
  required: true,
859
952
  type: "string"
860
953
  },
861
- ios: {
862
- promotionalOfferId: {
863
- key: "promotional_offer_id",
864
- required: false,
865
- type: "string"
866
- },
867
- winBackOfferId: {
868
- key: "win_back_offer_id",
869
- required: false,
870
- type: "string"
871
- }
872
- },
954
+ ios: { pricingTerms: {
955
+ key: "pricing_terms",
956
+ required: false,
957
+ type: "array",
958
+ converter: new ArrayCoder(() => new ProductReferencePricingTermsCoder(this.platform))
959
+ } },
873
960
  android: {
874
961
  basePlanId: {
875
962
  key: "base_plan_id",
@@ -886,22 +973,6 @@ var ProductReferenceCoder = class extends SimpleCoder {
886
973
  }
887
974
  };
888
975
 
889
- //#endregion
890
- //#region src/coders/array.ts
891
- var ArrayCoder = class {
892
- constructor(coderFactory) {
893
- this.coderFactory = coderFactory;
894
- }
895
- decode(input) {
896
- const coder = this.coderFactory();
897
- return input.map((item) => coder.decode(item));
898
- }
899
- encode(value) {
900
- const coder = this.coderFactory();
901
- return value.map((item) => coder.encode(item));
902
- }
903
- };
904
-
905
976
  //#endregion
906
977
  //#region src/coders/adapty-placement.ts
907
978
  var AdaptyPlacementCoder = class extends SimpleCoder {
@@ -944,44 +1015,43 @@ var AdaptyPlacementCoder = class extends SimpleCoder {
944
1015
 
945
1016
  //#endregion
946
1017
  //#region src/coders/adapty-flow-paywall.ts
947
- const PROPERTIES = {
948
- placement: {
949
- key: "placement",
950
- required: true,
951
- type: "object",
952
- converter: new AdaptyPlacementCoder()
953
- },
954
- id: {
955
- key: "paywall_id",
956
- required: true,
957
- type: "string"
958
- },
959
- name: {
960
- key: "paywall_name",
961
- required: true,
962
- type: "string"
963
- },
964
- products: {
965
- key: "products",
966
- required: true,
967
- type: "array",
968
- converter: new ArrayCoder(() => new ProductReferenceCoder())
969
- },
970
- variationId: {
971
- key: "variation_id",
972
- required: true,
973
- type: "string"
974
- },
975
- webPurchaseUrl: {
976
- key: "web_purchase_url",
977
- required: false,
978
- type: "string"
979
- }
980
- };
981
1018
  var AdaptyFlowPaywallCoder = class extends Coder {
982
1019
  constructor(..._args) {
983
1020
  super(..._args);
984
- this.properties = PROPERTIES;
1021
+ this.properties = {
1022
+ placement: {
1023
+ key: "placement",
1024
+ required: true,
1025
+ type: "object",
1026
+ converter: new AdaptyPlacementCoder(this.platform)
1027
+ },
1028
+ id: {
1029
+ key: "paywall_id",
1030
+ required: true,
1031
+ type: "string"
1032
+ },
1033
+ name: {
1034
+ key: "paywall_name",
1035
+ required: true,
1036
+ type: "string"
1037
+ },
1038
+ products: {
1039
+ key: "products",
1040
+ required: true,
1041
+ type: "array",
1042
+ converter: new ArrayCoder(() => new ProductReferenceCoder(this.platform))
1043
+ },
1044
+ variationId: {
1045
+ key: "variation_id",
1046
+ required: true,
1047
+ type: "string"
1048
+ },
1049
+ webPurchaseUrl: {
1050
+ key: "web_purchase_url",
1051
+ required: false,
1052
+ type: "string"
1053
+ }
1054
+ };
985
1055
  }
986
1056
  decode(data) {
987
1057
  const codablePart = super.decode(data);
@@ -1107,7 +1177,7 @@ var AdaptyFlowCoder = class extends Coder {
1107
1177
  key: "placement",
1108
1178
  required: true,
1109
1179
  type: "object",
1110
- converter: new AdaptyPlacementCoder()
1180
+ converter: new AdaptyPlacementCoder(this.platform)
1111
1181
  },
1112
1182
  id: {
1113
1183
  key: "flow_id",
@@ -1133,7 +1203,7 @@ var AdaptyFlowCoder = class extends Coder {
1133
1203
  key: "remote_configs",
1134
1204
  required: false,
1135
1205
  type: "array",
1136
- converter: new ArrayCoder(() => new AdaptyRemoteConfigCoder())
1206
+ converter: new ArrayCoder(() => new AdaptyRemoteConfigCoder(this.platform))
1137
1207
  },
1138
1208
  flowVersionId: {
1139
1209
  key: "flow_version_id",
@@ -1144,7 +1214,7 @@ var AdaptyFlowCoder = class extends Coder {
1144
1214
  key: "variations",
1145
1215
  required: true,
1146
1216
  type: "array",
1147
- converter: new ArrayCoder(() => new AdaptyFlowPaywallCoder())
1217
+ converter: new ArrayCoder(() => new AdaptyFlowPaywallCoder(this.platform))
1148
1218
  },
1149
1219
  uiSchema: {
1150
1220
  key: "ui_schema",
@@ -1356,7 +1426,7 @@ var AdaptyOnboardingCoder = class extends Coder {
1356
1426
  key: "placement",
1357
1427
  required: true,
1358
1428
  type: "object",
1359
- converter: new AdaptyPlacementCoder()
1429
+ converter: new AdaptyPlacementCoder(this.platform)
1360
1430
  },
1361
1431
  id: {
1362
1432
  key: "onboarding_id",
@@ -1372,7 +1442,7 @@ var AdaptyOnboardingCoder = class extends Coder {
1372
1442
  key: "remote_config",
1373
1443
  required: false,
1374
1444
  type: "object",
1375
- converter: new AdaptyRemoteConfigCoder()
1445
+ converter: new AdaptyRemoteConfigCoder(this.platform)
1376
1446
  },
1377
1447
  variationId: {
1378
1448
  key: "variation_id",
@@ -1388,7 +1458,7 @@ var AdaptyOnboardingCoder = class extends Coder {
1388
1458
  key: "onboarding_builder",
1389
1459
  required: true,
1390
1460
  type: "object",
1391
- converter: new AdaptyOnboardingBuilderCoder()
1461
+ converter: new AdaptyOnboardingBuilderCoder(this.platform)
1392
1462
  },
1393
1463
  payloadData: {
1394
1464
  key: "payload_data",
@@ -1445,13 +1515,13 @@ var AdaptySubscriptionOfferCoder = class extends SimpleCoder {
1445
1515
  key: "offer_identifier",
1446
1516
  required: true,
1447
1517
  type: "object",
1448
- converter: new AdaptySubscriptionOfferIdCoder()
1518
+ converter: new AdaptySubscriptionOfferIdCoder(this.platform)
1449
1519
  },
1450
1520
  phases: {
1451
1521
  key: "phases",
1452
1522
  required: true,
1453
1523
  type: "array",
1454
- converter: new ArrayCoder(() => new AdaptyDiscountPhaseCoder())
1524
+ converter: new ArrayCoder(() => new AdaptyDiscountPhaseCoder(this.platform))
1455
1525
  },
1456
1526
  android: { offerTags: {
1457
1527
  key: "offer_tags",
@@ -1470,6 +1540,61 @@ var AdaptySubscriptionOfferCoder = class extends SimpleCoder {
1470
1540
  }
1471
1541
  };
1472
1542
 
1543
+ //#endregion
1544
+ //#region src/coders/adapty-subscription-commitment-info.ts
1545
+ var AdaptySubscriptionCommitmentInfoCoder = class extends SimpleCoder {
1546
+ constructor(..._args) {
1547
+ super(..._args);
1548
+ this.properties = {
1549
+ price: {
1550
+ key: "price",
1551
+ required: true,
1552
+ type: "object",
1553
+ converter: new AdaptyPriceCoder(this.platform)
1554
+ },
1555
+ period: {
1556
+ key: "period",
1557
+ required: true,
1558
+ type: "object",
1559
+ converter: new AdaptySubscriptionPeriodCoder(this.platform)
1560
+ }
1561
+ };
1562
+ }
1563
+ };
1564
+
1565
+ //#endregion
1566
+ //#region src/coders/adapty-subscription-pricing-terms.ts
1567
+ var AdaptySubscriptionPricingTermsCoder = class extends SimpleCoder {
1568
+ constructor(..._args) {
1569
+ super(..._args);
1570
+ this.properties = {
1571
+ billingPlan: {
1572
+ key: "billing_plan_id",
1573
+ required: true,
1574
+ type: "string"
1575
+ },
1576
+ billingPrice: {
1577
+ key: "billing_price",
1578
+ required: true,
1579
+ type: "object",
1580
+ converter: new AdaptyPriceCoder(this.platform)
1581
+ },
1582
+ billingPeriod: {
1583
+ key: "billing_period",
1584
+ required: true,
1585
+ type: "object",
1586
+ converter: new AdaptySubscriptionPeriodCoder(this.platform)
1587
+ },
1588
+ commitmentInfo: {
1589
+ key: "commitment_info",
1590
+ required: true,
1591
+ type: "object",
1592
+ converter: new AdaptySubscriptionCommitmentInfoCoder(this.platform)
1593
+ }
1594
+ };
1595
+ }
1596
+ };
1597
+
1473
1598
  //#endregion
1474
1599
  //#region src/coders/adapty-subscription-details.ts
1475
1600
  var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
@@ -1480,7 +1605,7 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
1480
1605
  key: "period",
1481
1606
  required: true,
1482
1607
  type: "object",
1483
- converter: new AdaptySubscriptionPeriodCoder()
1608
+ converter: new AdaptySubscriptionPeriodCoder(this.platform)
1484
1609
  },
1485
1610
  localizedSubscriptionPeriod: {
1486
1611
  key: "localized_period",
@@ -1491,13 +1616,21 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
1491
1616
  key: "offer",
1492
1617
  required: false,
1493
1618
  type: "object",
1494
- converter: new AdaptySubscriptionOfferCoder()
1619
+ converter: new AdaptySubscriptionOfferCoder(this.platform)
1620
+ },
1621
+ ios: {
1622
+ subscriptionGroupIdentifier: {
1623
+ key: "group_identifier",
1624
+ required: false,
1625
+ type: "string"
1626
+ },
1627
+ pricingTerms: {
1628
+ key: "pricing_terms",
1629
+ required: false,
1630
+ type: "object",
1631
+ converter: new AdaptySubscriptionPricingTermsCoder(this.platform)
1632
+ }
1495
1633
  },
1496
- ios: { subscriptionGroupIdentifier: {
1497
- key: "group_identifier",
1498
- required: false,
1499
- type: "string"
1500
- } },
1501
1634
  android: {
1502
1635
  basePlanId: {
1503
1636
  key: "base_plan_id",
@@ -1519,6 +1652,15 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
1519
1652
  return partialData;
1520
1653
  }
1521
1654
  };
1655
+ function getSubscriptionInput(data) {
1656
+ const billingPlanId = data?.pricing_terms?.billing_plan_id;
1657
+ const offerIdentifier = data?.offer?.offer_identifier;
1658
+ if (!billingPlanId && !offerIdentifier) return void 0;
1659
+ return {
1660
+ ...billingPlanId && { pricing_terms: { billing_plan_id: billingPlanId } },
1661
+ ...offerIdentifier && { offer: { offer_identifier: offerIdentifier } }
1662
+ };
1663
+ }
1522
1664
 
1523
1665
  //#endregion
1524
1666
  //#region src/coders/adapty-paywall-product.ts
@@ -1585,7 +1727,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
1585
1727
  key: "price",
1586
1728
  required: false,
1587
1729
  type: "object",
1588
- converter: new AdaptyPriceCoder()
1730
+ converter: new AdaptyPriceCoder(this.platform)
1589
1731
  },
1590
1732
  webPurchaseUrl: {
1591
1733
  key: "web_purchase_url",
@@ -1601,7 +1743,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
1601
1743
  key: "subscription",
1602
1744
  required: false,
1603
1745
  type: "object",
1604
- converter: new AdaptySubscriptionDetailsCoder()
1746
+ converter: new AdaptySubscriptionDetailsCoder(this.platform)
1605
1747
  },
1606
1748
  ios: { isFamilyShareable: {
1607
1749
  key: "is_family_shareable",
@@ -1620,7 +1762,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
1620
1762
  payload_data: data.payload_data,
1621
1763
  paywall_name: data.paywall_name,
1622
1764
  paywall_variation_id: data.paywall_variation_id,
1623
- subscription: data.subscription?.offer ? { offer: { offer_identifier: data.subscription.offer.offer_identifier } } : void 0,
1765
+ subscription: getSubscriptionInput(data.subscription),
1624
1766
  vendor_product_id: data.vendor_product_id
1625
1767
  };
1626
1768
  }
@@ -1656,7 +1798,7 @@ var AdaptyPromotedProductCoder = class extends SimpleCoder {
1656
1798
  key: "price",
1657
1799
  required: false,
1658
1800
  type: "object",
1659
- converter: new AdaptyPriceCoder()
1801
+ converter: new AdaptyPriceCoder(this.platform)
1660
1802
  },
1661
1803
  payloadData: {
1662
1804
  key: "payload_data",
@@ -1667,20 +1809,28 @@ var AdaptyPromotedProductCoder = class extends SimpleCoder {
1667
1809
  key: "subscription",
1668
1810
  required: false,
1669
1811
  type: "object",
1670
- converter: new AdaptySubscriptionDetailsCoder()
1812
+ converter: new AdaptySubscriptionDetailsCoder(this.platform)
1671
1813
  },
1672
- ios: { isFamilyShareable: {
1673
- key: "is_family_shareable",
1674
- required: true,
1675
- type: "boolean"
1676
- } }
1814
+ ios: {
1815
+ isFamilyShareable: {
1816
+ key: "is_family_shareable",
1817
+ required: true,
1818
+ type: "boolean"
1819
+ },
1820
+ purchaseIntentId: {
1821
+ key: "purchase_intent_id",
1822
+ required: true,
1823
+ type: "string"
1824
+ }
1825
+ }
1677
1826
  };
1678
1827
  }
1679
1828
  getInput(data) {
1680
1829
  return {
1830
+ purchase_intent_id: data.purchase_intent_id,
1681
1831
  vendor_product_id: data.vendor_product_id,
1682
1832
  payload_data: data.payload_data,
1683
- subscription: data.subscription?.offer ? { offer: { offer_identifier: data.subscription.offer.offer_identifier } } : void 0
1833
+ subscription: getSubscriptionInput(data.subscription)
1684
1834
  };
1685
1835
  }
1686
1836
  };
@@ -1851,6 +2001,22 @@ var AdaptySubscriptionCoder = class extends SimpleCoder {
1851
2001
  key: "cancellation_reason",
1852
2002
  required: false,
1853
2003
  type: "string"
2004
+ },
2005
+ billingPlan: {
2006
+ key: "billing_plan_id",
2007
+ required: false,
2008
+ type: "string"
2009
+ },
2010
+ commitmentInfo: {
2011
+ key: "commitment",
2012
+ required: false,
2013
+ type: "object",
2014
+ converter: new AdaptyProfileSubscriptionCommitmentInfoCoder(this.platform)
2015
+ },
2016
+ offerId: {
2017
+ key: "offer_id",
2018
+ required: false,
2019
+ type: "string"
1854
2020
  }
1855
2021
  };
1856
2022
  }
@@ -1891,7 +2057,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
1891
2057
  key: "paid_access_levels",
1892
2058
  required: false,
1893
2059
  type: "object",
1894
- converter: new HashmapCoder(new AdaptyAccessLevelCoder())
2060
+ converter: new HashmapCoder(new AdaptyAccessLevelCoder(this.platform))
1895
2061
  },
1896
2062
  appliedExternalAttributionProviders: {
1897
2063
  key: "applied_attribution_sources",
@@ -1912,7 +2078,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
1912
2078
  key: "non_subscriptions",
1913
2079
  required: false,
1914
2080
  type: "object",
1915
- converter: new HashmapCoder(new ArrayCoder(() => new AdaptyNonSubscriptionCoder()))
2081
+ converter: new HashmapCoder(new ArrayCoder(() => new AdaptyNonSubscriptionCoder(this.platform)))
1916
2082
  },
1917
2083
  profileId: {
1918
2084
  key: "profile_id",
@@ -1923,7 +2089,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
1923
2089
  key: "subscriptions",
1924
2090
  required: false,
1925
2091
  type: "object",
1926
- converter: new HashmapCoder(new AdaptySubscriptionCoder())
2092
+ converter: new HashmapCoder(new AdaptySubscriptionCoder(this.platform))
1927
2093
  }
1928
2094
  };
1929
2095
  }
@@ -2224,7 +2390,7 @@ var AdaptyUiOnboardingStateParamsCoder = class extends SimpleCoder {
2224
2390
  var AdaptyUiOnboardingStateUpdatedActionCoder = class extends SimpleCoder {
2225
2391
  constructor(..._args) {
2226
2392
  super(..._args);
2227
- this.paramCoder = new AdaptyUiOnboardingStateParamsCoder();
2393
+ this.paramCoder = new AdaptyUiOnboardingStateParamsCoder(this.platform);
2228
2394
  this.properties = {
2229
2395
  elementId: {
2230
2396
  key: "element_id",
@@ -2436,12 +2602,18 @@ var CoderFactory = class {
2436
2602
  createProductReferenceCoder() {
2437
2603
  return new ProductReferenceCoder(this.deps.platform);
2438
2604
  }
2605
+ createProductReferencePricingTermsCoder() {
2606
+ return new ProductReferencePricingTermsCoder(this.deps.platform);
2607
+ }
2439
2608
  createProfileCoder() {
2440
2609
  return new AdaptyProfileCoder(this.deps.platform);
2441
2610
  }
2442
2611
  createProfileParametersCoder() {
2443
2612
  return new AdaptyProfileParametersCoder(this.deps.platform);
2444
2613
  }
2614
+ createProfileSubscriptionCommitmentInfoCoder() {
2615
+ return new AdaptyProfileSubscriptionCommitmentInfoCoder(this.deps.platform);
2616
+ }
2445
2617
  createPromotedProductCoder() {
2446
2618
  return new AdaptyPromotedProductCoder(this.deps.platform);
2447
2619
  }
@@ -2451,6 +2623,9 @@ var CoderFactory = class {
2451
2623
  createSubscriptionCoder() {
2452
2624
  return new AdaptySubscriptionCoder(this.deps.platform);
2453
2625
  }
2626
+ createSubscriptionCommitmentInfoCoder() {
2627
+ return new AdaptySubscriptionCommitmentInfoCoder(this.deps.platform);
2628
+ }
2454
2629
  createSubscriptionDetailsCoder() {
2455
2630
  return new AdaptySubscriptionDetailsCoder(this.deps.platform);
2456
2631
  }
@@ -2463,6 +2638,9 @@ var CoderFactory = class {
2463
2638
  createSubscriptionPeriodCoder() {
2464
2639
  return new AdaptySubscriptionPeriodCoder(this.deps.platform);
2465
2640
  }
2641
+ createSubscriptionPricingTermsCoder() {
2642
+ return new AdaptySubscriptionPricingTermsCoder(this.deps.platform);
2643
+ }
2466
2644
  createUiCreateOnboardingViewParamsCoder() {
2467
2645
  return new AdaptyUICreateOnboardingViewParamsCoder();
2468
2646
  }
@@ -2536,6 +2714,10 @@ const ProductPeriod = Object.freeze({
2536
2714
  Month: "month",
2537
2715
  Year: "year"
2538
2716
  });
2717
+ const SubscriptionBillingPlan = Object.freeze({
2718
+ UpFront: "up_front",
2719
+ Monthly: "monthly"
2720
+ });
2539
2721
  const WebPresentation = Object.freeze({
2540
2722
  BrowserOutApp: "browser_out_app",
2541
2723
  BrowserInApp: "browser_in_app"
@@ -2559,6 +2741,7 @@ const RefundPreference = Object.freeze({
2559
2741
  const MethodNames = [
2560
2742
  "activate",
2561
2743
  "adapty_ui_create_flow_view",
2744
+ "adapty_ui_destroy_flow_view",
2562
2745
  "adapty_ui_dismiss_flow_view",
2563
2746
  "adapty_ui_present_flow_view",
2564
2747
  "adapty_ui_show_dialog",
@@ -2571,6 +2754,7 @@ const MethodNames = [
2571
2754
  "get_flow",
2572
2755
  "get_flow_for_default_audience",
2573
2756
  "get_paywall_products",
2757
+ "get_pending_store_message_types",
2574
2758
  "get_onboarding",
2575
2759
  "get_onboarding_for_default_audience",
2576
2760
  "get_profile",
@@ -2582,12 +2766,15 @@ const MethodNames = [
2582
2766
  "make_promoted_purchase",
2583
2767
  "make_purchase",
2584
2768
  "open_web_paywall",
2769
+ "preload_flows",
2770
+ "preload_flows_for_default_audience",
2585
2771
  "present_code_redemption_sheet",
2586
2772
  "report_transaction",
2587
2773
  "restore_purchases",
2588
2774
  "set_fallback",
2589
2775
  "set_integration_identifiers",
2590
2776
  "set_log_level",
2777
+ "show_store_messages",
2591
2778
  "update_collecting_refund_data_consent",
2592
2779
  "update_external_attribution_data",
2593
2780
  "update_profile",
@@ -2805,7 +2992,8 @@ function parseMethodResult(factory, input, resultType, ctx) {
2805
2992
  "Boolean",
2806
2993
  "Void",
2807
2994
  "AdaptyUiView",
2808
- "AdaptyUiDialogActionType"
2995
+ "AdaptyUiDialogActionType",
2996
+ "Array<AdaptyStoreMessageType>"
2809
2997
  ].includes(resultType)) return obj.success;
2810
2998
  const coder = getCoder(factory, resultType, ctx);
2811
2999
  return coder?.decode(obj.success);
@@ -3215,5 +3403,5 @@ function withErrorContext(callback, handlerName, source) {
3215
3403
  }
3216
3404
 
3217
3405
  //#endregion
3218
- export { AdaptyAndroidSubscriptionUpdateReplacementMode, AdaptyError, AdaptyUiDialogActionType, AppTrackingTransparencyStatus, CancellationReason, CoderFactory, DefaultLoggerAdapter, DefaultPlatformAdapter, DefaultSdkMetadataAdapter, ErrorCode, ErrorCodeName, FetchPolicy, FlowEventId, GLOBAL_EVENT_TO_NATIVE_EVENT, Gender, HANDLER_TO_EVENT_CONFIG, HANDLER_TO_NATIVE_EVENT, Log, LogContext, LogLevel, LogScope, MethodNames, NATIVE_EVENT_RESOLVER, NATIVE_EVENT_TO_HANDLERS, ONBOARDING_EVENT_MAPPINGS, OfferType, OnboardingEventId, ProductPeriod, RefundPreference, VendorStore, WebPresentation, consoleLogSink, extractFlowCallbackArgs, extractOnboardingCallbackArgs, filterUndefined, generateId, getErrorCode, getErrorPrompt, mapValues, mergeOptions, parseCommonEvent, parseFlowEvent, parseMethodResult, parseOnboardingEvent, withErrorContext };
3406
+ export { AdaptyAndroidSubscriptionUpdateReplacementMode, AdaptyError, AdaptyUiDialogActionType, AppTrackingTransparencyStatus, CancellationReason, CoderFactory, DefaultLoggerAdapter, DefaultPlatformAdapter, DefaultSdkMetadataAdapter, ErrorCode, ErrorCodeName, FetchPolicy, FlowEventId, GLOBAL_EVENT_TO_NATIVE_EVENT, Gender, HANDLER_TO_EVENT_CONFIG, HANDLER_TO_NATIVE_EVENT, Log, LogContext, LogLevel, LogScope, MethodNames, NATIVE_EVENT_RESOLVER, NATIVE_EVENT_TO_HANDLERS, ONBOARDING_EVENT_MAPPINGS, OfferType, OnboardingEventId, ProductPeriod, RefundPreference, SubscriptionBillingPlan, VendorStore, WebPresentation, consoleLogSink, extractFlowCallbackArgs, extractOnboardingCallbackArgs, filterUndefined, generateId, getErrorCode, getErrorPrompt, mapValues, mergeOptions, parseCommonEvent, parseFlowEvent, parseMethodResult, parseOnboardingEvent, withErrorContext };
3219
3407
  //# sourceMappingURL=index.mjs.map