@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/README.md +1 -1
- package/dist/index.cjs +291 -102
- package/dist/index.d.cts +496 -178
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +496 -178
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +291 -103
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
//#region src/types/inputs.ts
|
|
4
4
|
/**
|
|
5
|
-
* Log levels for the SDK
|
|
5
|
+
* Log levels for the SDK, ordered from the least to the most verbose:
|
|
6
|
+
* `ERROR` < `WARN` < `INFO` < `VERBOSE` < `DEBUG`.
|
|
6
7
|
*
|
|
7
8
|
* @remarks
|
|
9
|
+
* Setting a level enables it and all the levels above it in the list.
|
|
8
10
|
* Logging is performed on a native side.
|
|
9
11
|
* So you are expected to watch logs in Xcode or Android Studio.
|
|
10
12
|
*/
|
|
11
13
|
const LogLevel = Object.freeze({
|
|
12
|
-
VERBOSE: "verbose",
|
|
13
14
|
ERROR: "error",
|
|
14
15
|
WARN: "warn",
|
|
15
|
-
INFO: "info"
|
|
16
|
+
INFO: "info",
|
|
17
|
+
VERBOSE: "verbose",
|
|
18
|
+
DEBUG: "debug"
|
|
16
19
|
});
|
|
17
20
|
const FetchPolicy = Object.freeze({
|
|
18
21
|
ReloadRevalidatingCacheData: "reload_revalidating_cache_data",
|
|
@@ -33,7 +36,8 @@ function getConsoleForLevel(level) {
|
|
|
33
36
|
switch (level) {
|
|
34
37
|
case "error": return console.error;
|
|
35
38
|
case "warn": return console.warn;
|
|
36
|
-
case "verbose":
|
|
39
|
+
case "verbose":
|
|
40
|
+
case "debug": return console.debug;
|
|
37
41
|
case "info":
|
|
38
42
|
default: return console.info;
|
|
39
43
|
}
|
|
@@ -94,6 +98,7 @@ var Log = class Log {
|
|
|
94
98
|
case LogLevel.WARN: return 1;
|
|
95
99
|
case LogLevel.INFO: return 2;
|
|
96
100
|
case LogLevel.VERBOSE: return 3;
|
|
101
|
+
case LogLevel.DEBUG: return 4;
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
/**
|
|
@@ -337,6 +342,8 @@ const ErrorCodeMapping = Object.freeze({
|
|
|
337
342
|
3007: "unsupportedData",
|
|
338
343
|
3100: "persistingDataError",
|
|
339
344
|
3101: "fetchTimeoutError",
|
|
345
|
+
3201: "operationInProgress",
|
|
346
|
+
3202: "resolverFailure",
|
|
340
347
|
9e3: "operationInterrupted"
|
|
341
348
|
});
|
|
342
349
|
const ErrorCode = ErrorCodeMapping;
|
|
@@ -389,6 +396,8 @@ const ErrorCodeName = Object.freeze({
|
|
|
389
396
|
unsupportedData: 3007,
|
|
390
397
|
persistingDataError: 3100,
|
|
391
398
|
fetchTimeoutError: 3101,
|
|
399
|
+
operationInProgress: 3201,
|
|
400
|
+
resolverFailure: 3202,
|
|
392
401
|
operationInterrupted: 9e3
|
|
393
402
|
});
|
|
394
403
|
function getErrorCode(error) {
|
|
@@ -454,7 +463,7 @@ AdaptyError.middleware = void 0;
|
|
|
454
463
|
//#endregion
|
|
455
464
|
//#region src/coders/coder.ts
|
|
456
465
|
var Coder = class {
|
|
457
|
-
constructor(platform
|
|
466
|
+
constructor(platform) {
|
|
458
467
|
this.platform = void 0;
|
|
459
468
|
this.platform = platform;
|
|
460
469
|
}
|
|
@@ -558,6 +567,32 @@ var DateCoder = class {
|
|
|
558
567
|
}
|
|
559
568
|
};
|
|
560
569
|
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/coders/adapty-profile-subscription-commitment-info.ts
|
|
572
|
+
var AdaptyProfileSubscriptionCommitmentInfoCoder = class extends SimpleCoder {
|
|
573
|
+
constructor(..._args) {
|
|
574
|
+
super(..._args);
|
|
575
|
+
this.properties = {
|
|
576
|
+
billingPeriodNumber: {
|
|
577
|
+
key: "billing_period_number",
|
|
578
|
+
required: true,
|
|
579
|
+
type: "number"
|
|
580
|
+
},
|
|
581
|
+
totalBillingPeriods: {
|
|
582
|
+
key: "total_billing_periods",
|
|
583
|
+
required: true,
|
|
584
|
+
type: "number"
|
|
585
|
+
},
|
|
586
|
+
expiresAt: {
|
|
587
|
+
key: "expires_at",
|
|
588
|
+
required: true,
|
|
589
|
+
type: "string",
|
|
590
|
+
converter: new DateCoder()
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
|
|
561
596
|
//#endregion
|
|
562
597
|
//#region src/coders/adapty-access-level.ts
|
|
563
598
|
var AdaptyAccessLevelCoder = class extends SimpleCoder {
|
|
@@ -660,6 +695,22 @@ var AdaptyAccessLevelCoder = class extends SimpleCoder {
|
|
|
660
695
|
required: true,
|
|
661
696
|
type: "boolean"
|
|
662
697
|
},
|
|
698
|
+
billingPlan: {
|
|
699
|
+
key: "billing_plan_id",
|
|
700
|
+
required: false,
|
|
701
|
+
type: "string"
|
|
702
|
+
},
|
|
703
|
+
commitmentInfo: {
|
|
704
|
+
key: "commitment",
|
|
705
|
+
required: false,
|
|
706
|
+
type: "object",
|
|
707
|
+
converter: new AdaptyProfileSubscriptionCommitmentInfoCoder(this.platform)
|
|
708
|
+
},
|
|
709
|
+
offerId: {
|
|
710
|
+
key: "offer_id",
|
|
711
|
+
required: false,
|
|
712
|
+
type: "string"
|
|
713
|
+
},
|
|
663
714
|
android: { offerId: {
|
|
664
715
|
key: "offer_id",
|
|
665
716
|
required: false,
|
|
@@ -711,12 +762,13 @@ var AdaptyConfigurationCoder = class {
|
|
|
711
762
|
config["observer_mode"] = params.observerMode ?? false;
|
|
712
763
|
config["ip_address_collection_disabled"] = params.ipAddressCollectionDisabled ?? false;
|
|
713
764
|
config["adapty_attribution_enabled"] = params.adaptyAttributionEnabled ?? false;
|
|
765
|
+
if (params.storeMessagesHandling) config["store_messages_handling"] = params.storeMessagesHandling;
|
|
714
766
|
if (params.logLevel) config["log_level"] = params.logLevel;
|
|
715
767
|
config["server_cluster"] = params.serverCluster ?? "default";
|
|
716
768
|
if (params.backendProxyHost) config["backend_proxy_host"] = params.backendProxyHost;
|
|
717
769
|
if (params.backendProxyPort) config["backend_proxy_port"] = params.backendProxyPort;
|
|
718
770
|
config["activate_ui"] = params.activateUi ?? true;
|
|
719
|
-
const mediaCacheCoder = new AdaptyUiMediaCacheCoder();
|
|
771
|
+
const mediaCacheCoder = new AdaptyUiMediaCacheCoder(this.platform);
|
|
720
772
|
config["media_cache"] = mediaCacheCoder.encode(params.mediaCache ?? {
|
|
721
773
|
memoryStorageTotalCostLimit: 100 * 1024 * 1024,
|
|
722
774
|
memoryStorageCountLimit: 2147483647,
|
|
@@ -817,13 +869,54 @@ var AdaptyDiscountPhaseCoder = class extends SimpleCoder {
|
|
|
817
869
|
key: "price",
|
|
818
870
|
required: true,
|
|
819
871
|
type: "object",
|
|
820
|
-
converter: new AdaptyPriceCoder()
|
|
872
|
+
converter: new AdaptyPriceCoder(this.platform)
|
|
821
873
|
},
|
|
822
874
|
subscriptionPeriod: {
|
|
823
875
|
key: "subscription_period",
|
|
824
876
|
required: true,
|
|
825
877
|
type: "object",
|
|
826
|
-
converter: new AdaptySubscriptionPeriodCoder()
|
|
878
|
+
converter: new AdaptySubscriptionPeriodCoder(this.platform)
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region src/coders/array.ts
|
|
886
|
+
var ArrayCoder = class {
|
|
887
|
+
constructor(coderFactory) {
|
|
888
|
+
this.coderFactory = coderFactory;
|
|
889
|
+
}
|
|
890
|
+
decode(input) {
|
|
891
|
+
const coder = this.coderFactory();
|
|
892
|
+
return input.map((item) => coder.decode(item));
|
|
893
|
+
}
|
|
894
|
+
encode(value) {
|
|
895
|
+
const coder = this.coderFactory();
|
|
896
|
+
return value.map((item) => coder.encode(item));
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region src/coders/product-reference-pricing-terms.ts
|
|
902
|
+
var ProductReferencePricingTermsCoder = class extends SimpleCoder {
|
|
903
|
+
constructor(..._args) {
|
|
904
|
+
super(..._args);
|
|
905
|
+
this.properties = {
|
|
906
|
+
billingPlan: {
|
|
907
|
+
key: "billing_plan_id",
|
|
908
|
+
required: true,
|
|
909
|
+
type: "string"
|
|
910
|
+
},
|
|
911
|
+
promotionalOfferId: {
|
|
912
|
+
key: "promotional_offer_id",
|
|
913
|
+
required: false,
|
|
914
|
+
type: "string"
|
|
915
|
+
},
|
|
916
|
+
winBackOfferId: {
|
|
917
|
+
key: "win_back_offer_id",
|
|
918
|
+
required: false,
|
|
919
|
+
type: "string"
|
|
827
920
|
}
|
|
828
921
|
};
|
|
829
922
|
}
|
|
@@ -860,18 +953,12 @@ var ProductReferenceCoder = class extends SimpleCoder {
|
|
|
860
953
|
required: true,
|
|
861
954
|
type: "string"
|
|
862
955
|
},
|
|
863
|
-
ios: {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
winBackOfferId: {
|
|
870
|
-
key: "win_back_offer_id",
|
|
871
|
-
required: false,
|
|
872
|
-
type: "string"
|
|
873
|
-
}
|
|
874
|
-
},
|
|
956
|
+
ios: { pricingTerms: {
|
|
957
|
+
key: "pricing_terms",
|
|
958
|
+
required: false,
|
|
959
|
+
type: "array",
|
|
960
|
+
converter: new ArrayCoder(() => new ProductReferencePricingTermsCoder(this.platform))
|
|
961
|
+
} },
|
|
875
962
|
android: {
|
|
876
963
|
basePlanId: {
|
|
877
964
|
key: "base_plan_id",
|
|
@@ -888,22 +975,6 @@ var ProductReferenceCoder = class extends SimpleCoder {
|
|
|
888
975
|
}
|
|
889
976
|
};
|
|
890
977
|
|
|
891
|
-
//#endregion
|
|
892
|
-
//#region src/coders/array.ts
|
|
893
|
-
var ArrayCoder = class {
|
|
894
|
-
constructor(coderFactory) {
|
|
895
|
-
this.coderFactory = coderFactory;
|
|
896
|
-
}
|
|
897
|
-
decode(input) {
|
|
898
|
-
const coder = this.coderFactory();
|
|
899
|
-
return input.map((item) => coder.decode(item));
|
|
900
|
-
}
|
|
901
|
-
encode(value) {
|
|
902
|
-
const coder = this.coderFactory();
|
|
903
|
-
return value.map((item) => coder.encode(item));
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
|
|
907
978
|
//#endregion
|
|
908
979
|
//#region src/coders/adapty-placement.ts
|
|
909
980
|
var AdaptyPlacementCoder = class extends SimpleCoder {
|
|
@@ -946,44 +1017,43 @@ var AdaptyPlacementCoder = class extends SimpleCoder {
|
|
|
946
1017
|
|
|
947
1018
|
//#endregion
|
|
948
1019
|
//#region src/coders/adapty-flow-paywall.ts
|
|
949
|
-
const PROPERTIES = {
|
|
950
|
-
placement: {
|
|
951
|
-
key: "placement",
|
|
952
|
-
required: true,
|
|
953
|
-
type: "object",
|
|
954
|
-
converter: new AdaptyPlacementCoder()
|
|
955
|
-
},
|
|
956
|
-
id: {
|
|
957
|
-
key: "paywall_id",
|
|
958
|
-
required: true,
|
|
959
|
-
type: "string"
|
|
960
|
-
},
|
|
961
|
-
name: {
|
|
962
|
-
key: "paywall_name",
|
|
963
|
-
required: true,
|
|
964
|
-
type: "string"
|
|
965
|
-
},
|
|
966
|
-
products: {
|
|
967
|
-
key: "products",
|
|
968
|
-
required: true,
|
|
969
|
-
type: "array",
|
|
970
|
-
converter: new ArrayCoder(() => new ProductReferenceCoder())
|
|
971
|
-
},
|
|
972
|
-
variationId: {
|
|
973
|
-
key: "variation_id",
|
|
974
|
-
required: true,
|
|
975
|
-
type: "string"
|
|
976
|
-
},
|
|
977
|
-
webPurchaseUrl: {
|
|
978
|
-
key: "web_purchase_url",
|
|
979
|
-
required: false,
|
|
980
|
-
type: "string"
|
|
981
|
-
}
|
|
982
|
-
};
|
|
983
1020
|
var AdaptyFlowPaywallCoder = class extends Coder {
|
|
984
1021
|
constructor(..._args) {
|
|
985
1022
|
super(..._args);
|
|
986
|
-
this.properties =
|
|
1023
|
+
this.properties = {
|
|
1024
|
+
placement: {
|
|
1025
|
+
key: "placement",
|
|
1026
|
+
required: true,
|
|
1027
|
+
type: "object",
|
|
1028
|
+
converter: new AdaptyPlacementCoder(this.platform)
|
|
1029
|
+
},
|
|
1030
|
+
id: {
|
|
1031
|
+
key: "paywall_id",
|
|
1032
|
+
required: true,
|
|
1033
|
+
type: "string"
|
|
1034
|
+
},
|
|
1035
|
+
name: {
|
|
1036
|
+
key: "paywall_name",
|
|
1037
|
+
required: true,
|
|
1038
|
+
type: "string"
|
|
1039
|
+
},
|
|
1040
|
+
products: {
|
|
1041
|
+
key: "products",
|
|
1042
|
+
required: true,
|
|
1043
|
+
type: "array",
|
|
1044
|
+
converter: new ArrayCoder(() => new ProductReferenceCoder(this.platform))
|
|
1045
|
+
},
|
|
1046
|
+
variationId: {
|
|
1047
|
+
key: "variation_id",
|
|
1048
|
+
required: true,
|
|
1049
|
+
type: "string"
|
|
1050
|
+
},
|
|
1051
|
+
webPurchaseUrl: {
|
|
1052
|
+
key: "web_purchase_url",
|
|
1053
|
+
required: false,
|
|
1054
|
+
type: "string"
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
987
1057
|
}
|
|
988
1058
|
decode(data) {
|
|
989
1059
|
const codablePart = super.decode(data);
|
|
@@ -1109,7 +1179,7 @@ var AdaptyFlowCoder = class extends Coder {
|
|
|
1109
1179
|
key: "placement",
|
|
1110
1180
|
required: true,
|
|
1111
1181
|
type: "object",
|
|
1112
|
-
converter: new AdaptyPlacementCoder()
|
|
1182
|
+
converter: new AdaptyPlacementCoder(this.platform)
|
|
1113
1183
|
},
|
|
1114
1184
|
id: {
|
|
1115
1185
|
key: "flow_id",
|
|
@@ -1135,7 +1205,7 @@ var AdaptyFlowCoder = class extends Coder {
|
|
|
1135
1205
|
key: "remote_configs",
|
|
1136
1206
|
required: false,
|
|
1137
1207
|
type: "array",
|
|
1138
|
-
converter: new ArrayCoder(() => new AdaptyRemoteConfigCoder())
|
|
1208
|
+
converter: new ArrayCoder(() => new AdaptyRemoteConfigCoder(this.platform))
|
|
1139
1209
|
},
|
|
1140
1210
|
flowVersionId: {
|
|
1141
1211
|
key: "flow_version_id",
|
|
@@ -1146,7 +1216,7 @@ var AdaptyFlowCoder = class extends Coder {
|
|
|
1146
1216
|
key: "variations",
|
|
1147
1217
|
required: true,
|
|
1148
1218
|
type: "array",
|
|
1149
|
-
converter: new ArrayCoder(() => new AdaptyFlowPaywallCoder())
|
|
1219
|
+
converter: new ArrayCoder(() => new AdaptyFlowPaywallCoder(this.platform))
|
|
1150
1220
|
},
|
|
1151
1221
|
uiSchema: {
|
|
1152
1222
|
key: "ui_schema",
|
|
@@ -1358,7 +1428,7 @@ var AdaptyOnboardingCoder = class extends Coder {
|
|
|
1358
1428
|
key: "placement",
|
|
1359
1429
|
required: true,
|
|
1360
1430
|
type: "object",
|
|
1361
|
-
converter: new AdaptyPlacementCoder()
|
|
1431
|
+
converter: new AdaptyPlacementCoder(this.platform)
|
|
1362
1432
|
},
|
|
1363
1433
|
id: {
|
|
1364
1434
|
key: "onboarding_id",
|
|
@@ -1374,7 +1444,7 @@ var AdaptyOnboardingCoder = class extends Coder {
|
|
|
1374
1444
|
key: "remote_config",
|
|
1375
1445
|
required: false,
|
|
1376
1446
|
type: "object",
|
|
1377
|
-
converter: new AdaptyRemoteConfigCoder()
|
|
1447
|
+
converter: new AdaptyRemoteConfigCoder(this.platform)
|
|
1378
1448
|
},
|
|
1379
1449
|
variationId: {
|
|
1380
1450
|
key: "variation_id",
|
|
@@ -1390,7 +1460,7 @@ var AdaptyOnboardingCoder = class extends Coder {
|
|
|
1390
1460
|
key: "onboarding_builder",
|
|
1391
1461
|
required: true,
|
|
1392
1462
|
type: "object",
|
|
1393
|
-
converter: new AdaptyOnboardingBuilderCoder()
|
|
1463
|
+
converter: new AdaptyOnboardingBuilderCoder(this.platform)
|
|
1394
1464
|
},
|
|
1395
1465
|
payloadData: {
|
|
1396
1466
|
key: "payload_data",
|
|
@@ -1447,13 +1517,13 @@ var AdaptySubscriptionOfferCoder = class extends SimpleCoder {
|
|
|
1447
1517
|
key: "offer_identifier",
|
|
1448
1518
|
required: true,
|
|
1449
1519
|
type: "object",
|
|
1450
|
-
converter: new AdaptySubscriptionOfferIdCoder()
|
|
1520
|
+
converter: new AdaptySubscriptionOfferIdCoder(this.platform)
|
|
1451
1521
|
},
|
|
1452
1522
|
phases: {
|
|
1453
1523
|
key: "phases",
|
|
1454
1524
|
required: true,
|
|
1455
1525
|
type: "array",
|
|
1456
|
-
converter: new ArrayCoder(() => new AdaptyDiscountPhaseCoder())
|
|
1526
|
+
converter: new ArrayCoder(() => new AdaptyDiscountPhaseCoder(this.platform))
|
|
1457
1527
|
},
|
|
1458
1528
|
android: { offerTags: {
|
|
1459
1529
|
key: "offer_tags",
|
|
@@ -1472,6 +1542,61 @@ var AdaptySubscriptionOfferCoder = class extends SimpleCoder {
|
|
|
1472
1542
|
}
|
|
1473
1543
|
};
|
|
1474
1544
|
|
|
1545
|
+
//#endregion
|
|
1546
|
+
//#region src/coders/adapty-subscription-commitment-info.ts
|
|
1547
|
+
var AdaptySubscriptionCommitmentInfoCoder = class extends SimpleCoder {
|
|
1548
|
+
constructor(..._args) {
|
|
1549
|
+
super(..._args);
|
|
1550
|
+
this.properties = {
|
|
1551
|
+
price: {
|
|
1552
|
+
key: "price",
|
|
1553
|
+
required: true,
|
|
1554
|
+
type: "object",
|
|
1555
|
+
converter: new AdaptyPriceCoder(this.platform)
|
|
1556
|
+
},
|
|
1557
|
+
period: {
|
|
1558
|
+
key: "period",
|
|
1559
|
+
required: true,
|
|
1560
|
+
type: "object",
|
|
1561
|
+
converter: new AdaptySubscriptionPeriodCoder(this.platform)
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region src/coders/adapty-subscription-pricing-terms.ts
|
|
1569
|
+
var AdaptySubscriptionPricingTermsCoder = class extends SimpleCoder {
|
|
1570
|
+
constructor(..._args) {
|
|
1571
|
+
super(..._args);
|
|
1572
|
+
this.properties = {
|
|
1573
|
+
billingPlan: {
|
|
1574
|
+
key: "billing_plan_id",
|
|
1575
|
+
required: true,
|
|
1576
|
+
type: "string"
|
|
1577
|
+
},
|
|
1578
|
+
billingPrice: {
|
|
1579
|
+
key: "billing_price",
|
|
1580
|
+
required: true,
|
|
1581
|
+
type: "object",
|
|
1582
|
+
converter: new AdaptyPriceCoder(this.platform)
|
|
1583
|
+
},
|
|
1584
|
+
billingPeriod: {
|
|
1585
|
+
key: "billing_period",
|
|
1586
|
+
required: true,
|
|
1587
|
+
type: "object",
|
|
1588
|
+
converter: new AdaptySubscriptionPeriodCoder(this.platform)
|
|
1589
|
+
},
|
|
1590
|
+
commitmentInfo: {
|
|
1591
|
+
key: "commitment_info",
|
|
1592
|
+
required: true,
|
|
1593
|
+
type: "object",
|
|
1594
|
+
converter: new AdaptySubscriptionCommitmentInfoCoder(this.platform)
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1475
1600
|
//#endregion
|
|
1476
1601
|
//#region src/coders/adapty-subscription-details.ts
|
|
1477
1602
|
var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
|
|
@@ -1482,7 +1607,7 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
|
|
|
1482
1607
|
key: "period",
|
|
1483
1608
|
required: true,
|
|
1484
1609
|
type: "object",
|
|
1485
|
-
converter: new AdaptySubscriptionPeriodCoder()
|
|
1610
|
+
converter: new AdaptySubscriptionPeriodCoder(this.platform)
|
|
1486
1611
|
},
|
|
1487
1612
|
localizedSubscriptionPeriod: {
|
|
1488
1613
|
key: "localized_period",
|
|
@@ -1493,13 +1618,21 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
|
|
|
1493
1618
|
key: "offer",
|
|
1494
1619
|
required: false,
|
|
1495
1620
|
type: "object",
|
|
1496
|
-
converter: new AdaptySubscriptionOfferCoder()
|
|
1621
|
+
converter: new AdaptySubscriptionOfferCoder(this.platform)
|
|
1622
|
+
},
|
|
1623
|
+
ios: {
|
|
1624
|
+
subscriptionGroupIdentifier: {
|
|
1625
|
+
key: "group_identifier",
|
|
1626
|
+
required: false,
|
|
1627
|
+
type: "string"
|
|
1628
|
+
},
|
|
1629
|
+
pricingTerms: {
|
|
1630
|
+
key: "pricing_terms",
|
|
1631
|
+
required: false,
|
|
1632
|
+
type: "object",
|
|
1633
|
+
converter: new AdaptySubscriptionPricingTermsCoder(this.platform)
|
|
1634
|
+
}
|
|
1497
1635
|
},
|
|
1498
|
-
ios: { subscriptionGroupIdentifier: {
|
|
1499
|
-
key: "group_identifier",
|
|
1500
|
-
required: false,
|
|
1501
|
-
type: "string"
|
|
1502
|
-
} },
|
|
1503
1636
|
android: {
|
|
1504
1637
|
basePlanId: {
|
|
1505
1638
|
key: "base_plan_id",
|
|
@@ -1521,6 +1654,15 @@ var AdaptySubscriptionDetailsCoder = class extends SimpleCoder {
|
|
|
1521
1654
|
return partialData;
|
|
1522
1655
|
}
|
|
1523
1656
|
};
|
|
1657
|
+
function getSubscriptionInput(data) {
|
|
1658
|
+
const billingPlanId = data?.pricing_terms?.billing_plan_id;
|
|
1659
|
+
const offerIdentifier = data?.offer?.offer_identifier;
|
|
1660
|
+
if (!billingPlanId && !offerIdentifier) return void 0;
|
|
1661
|
+
return {
|
|
1662
|
+
...billingPlanId && { pricing_terms: { billing_plan_id: billingPlanId } },
|
|
1663
|
+
...offerIdentifier && { offer: { offer_identifier: offerIdentifier } }
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1524
1666
|
|
|
1525
1667
|
//#endregion
|
|
1526
1668
|
//#region src/coders/adapty-paywall-product.ts
|
|
@@ -1587,7 +1729,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
|
|
|
1587
1729
|
key: "price",
|
|
1588
1730
|
required: false,
|
|
1589
1731
|
type: "object",
|
|
1590
|
-
converter: new AdaptyPriceCoder()
|
|
1732
|
+
converter: new AdaptyPriceCoder(this.platform)
|
|
1591
1733
|
},
|
|
1592
1734
|
webPurchaseUrl: {
|
|
1593
1735
|
key: "web_purchase_url",
|
|
@@ -1603,7 +1745,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
|
|
|
1603
1745
|
key: "subscription",
|
|
1604
1746
|
required: false,
|
|
1605
1747
|
type: "object",
|
|
1606
|
-
converter: new AdaptySubscriptionDetailsCoder()
|
|
1748
|
+
converter: new AdaptySubscriptionDetailsCoder(this.platform)
|
|
1607
1749
|
},
|
|
1608
1750
|
ios: { isFamilyShareable: {
|
|
1609
1751
|
key: "is_family_shareable",
|
|
@@ -1622,7 +1764,7 @@ var AdaptyPaywallProductCoder = class extends SimpleCoder {
|
|
|
1622
1764
|
payload_data: data.payload_data,
|
|
1623
1765
|
paywall_name: data.paywall_name,
|
|
1624
1766
|
paywall_variation_id: data.paywall_variation_id,
|
|
1625
|
-
subscription: data.subscription
|
|
1767
|
+
subscription: getSubscriptionInput(data.subscription),
|
|
1626
1768
|
vendor_product_id: data.vendor_product_id
|
|
1627
1769
|
};
|
|
1628
1770
|
}
|
|
@@ -1658,7 +1800,7 @@ var AdaptyPromotedProductCoder = class extends SimpleCoder {
|
|
|
1658
1800
|
key: "price",
|
|
1659
1801
|
required: false,
|
|
1660
1802
|
type: "object",
|
|
1661
|
-
converter: new AdaptyPriceCoder()
|
|
1803
|
+
converter: new AdaptyPriceCoder(this.platform)
|
|
1662
1804
|
},
|
|
1663
1805
|
payloadData: {
|
|
1664
1806
|
key: "payload_data",
|
|
@@ -1669,20 +1811,28 @@ var AdaptyPromotedProductCoder = class extends SimpleCoder {
|
|
|
1669
1811
|
key: "subscription",
|
|
1670
1812
|
required: false,
|
|
1671
1813
|
type: "object",
|
|
1672
|
-
converter: new AdaptySubscriptionDetailsCoder()
|
|
1814
|
+
converter: new AdaptySubscriptionDetailsCoder(this.platform)
|
|
1673
1815
|
},
|
|
1674
|
-
ios: {
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1816
|
+
ios: {
|
|
1817
|
+
isFamilyShareable: {
|
|
1818
|
+
key: "is_family_shareable",
|
|
1819
|
+
required: true,
|
|
1820
|
+
type: "boolean"
|
|
1821
|
+
},
|
|
1822
|
+
purchaseIntentId: {
|
|
1823
|
+
key: "purchase_intent_id",
|
|
1824
|
+
required: true,
|
|
1825
|
+
type: "string"
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1679
1828
|
};
|
|
1680
1829
|
}
|
|
1681
1830
|
getInput(data) {
|
|
1682
1831
|
return {
|
|
1832
|
+
purchase_intent_id: data.purchase_intent_id,
|
|
1683
1833
|
vendor_product_id: data.vendor_product_id,
|
|
1684
1834
|
payload_data: data.payload_data,
|
|
1685
|
-
subscription: data.subscription
|
|
1835
|
+
subscription: getSubscriptionInput(data.subscription)
|
|
1686
1836
|
};
|
|
1687
1837
|
}
|
|
1688
1838
|
};
|
|
@@ -1853,6 +2003,22 @@ var AdaptySubscriptionCoder = class extends SimpleCoder {
|
|
|
1853
2003
|
key: "cancellation_reason",
|
|
1854
2004
|
required: false,
|
|
1855
2005
|
type: "string"
|
|
2006
|
+
},
|
|
2007
|
+
billingPlan: {
|
|
2008
|
+
key: "billing_plan_id",
|
|
2009
|
+
required: false,
|
|
2010
|
+
type: "string"
|
|
2011
|
+
},
|
|
2012
|
+
commitmentInfo: {
|
|
2013
|
+
key: "commitment",
|
|
2014
|
+
required: false,
|
|
2015
|
+
type: "object",
|
|
2016
|
+
converter: new AdaptyProfileSubscriptionCommitmentInfoCoder(this.platform)
|
|
2017
|
+
},
|
|
2018
|
+
offerId: {
|
|
2019
|
+
key: "offer_id",
|
|
2020
|
+
required: false,
|
|
2021
|
+
type: "string"
|
|
1856
2022
|
}
|
|
1857
2023
|
};
|
|
1858
2024
|
}
|
|
@@ -1893,7 +2059,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
|
|
|
1893
2059
|
key: "paid_access_levels",
|
|
1894
2060
|
required: false,
|
|
1895
2061
|
type: "object",
|
|
1896
|
-
converter: new HashmapCoder(new AdaptyAccessLevelCoder())
|
|
2062
|
+
converter: new HashmapCoder(new AdaptyAccessLevelCoder(this.platform))
|
|
1897
2063
|
},
|
|
1898
2064
|
appliedExternalAttributionProviders: {
|
|
1899
2065
|
key: "applied_attribution_sources",
|
|
@@ -1914,7 +2080,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
|
|
|
1914
2080
|
key: "non_subscriptions",
|
|
1915
2081
|
required: false,
|
|
1916
2082
|
type: "object",
|
|
1917
|
-
converter: new HashmapCoder(new ArrayCoder(() => new AdaptyNonSubscriptionCoder()))
|
|
2083
|
+
converter: new HashmapCoder(new ArrayCoder(() => new AdaptyNonSubscriptionCoder(this.platform)))
|
|
1918
2084
|
},
|
|
1919
2085
|
profileId: {
|
|
1920
2086
|
key: "profile_id",
|
|
@@ -1925,7 +2091,7 @@ var AdaptyProfileCoder = class extends SimpleCoder {
|
|
|
1925
2091
|
key: "subscriptions",
|
|
1926
2092
|
required: false,
|
|
1927
2093
|
type: "object",
|
|
1928
|
-
converter: new HashmapCoder(new AdaptySubscriptionCoder())
|
|
2094
|
+
converter: new HashmapCoder(new AdaptySubscriptionCoder(this.platform))
|
|
1929
2095
|
}
|
|
1930
2096
|
};
|
|
1931
2097
|
}
|
|
@@ -2226,7 +2392,7 @@ var AdaptyUiOnboardingStateParamsCoder = class extends SimpleCoder {
|
|
|
2226
2392
|
var AdaptyUiOnboardingStateUpdatedActionCoder = class extends SimpleCoder {
|
|
2227
2393
|
constructor(..._args) {
|
|
2228
2394
|
super(..._args);
|
|
2229
|
-
this.paramCoder = new AdaptyUiOnboardingStateParamsCoder();
|
|
2395
|
+
this.paramCoder = new AdaptyUiOnboardingStateParamsCoder(this.platform);
|
|
2230
2396
|
this.properties = {
|
|
2231
2397
|
elementId: {
|
|
2232
2398
|
key: "element_id",
|
|
@@ -2438,12 +2604,18 @@ var CoderFactory = class {
|
|
|
2438
2604
|
createProductReferenceCoder() {
|
|
2439
2605
|
return new ProductReferenceCoder(this.deps.platform);
|
|
2440
2606
|
}
|
|
2607
|
+
createProductReferencePricingTermsCoder() {
|
|
2608
|
+
return new ProductReferencePricingTermsCoder(this.deps.platform);
|
|
2609
|
+
}
|
|
2441
2610
|
createProfileCoder() {
|
|
2442
2611
|
return new AdaptyProfileCoder(this.deps.platform);
|
|
2443
2612
|
}
|
|
2444
2613
|
createProfileParametersCoder() {
|
|
2445
2614
|
return new AdaptyProfileParametersCoder(this.deps.platform);
|
|
2446
2615
|
}
|
|
2616
|
+
createProfileSubscriptionCommitmentInfoCoder() {
|
|
2617
|
+
return new AdaptyProfileSubscriptionCommitmentInfoCoder(this.deps.platform);
|
|
2618
|
+
}
|
|
2447
2619
|
createPromotedProductCoder() {
|
|
2448
2620
|
return new AdaptyPromotedProductCoder(this.deps.platform);
|
|
2449
2621
|
}
|
|
@@ -2453,6 +2625,9 @@ var CoderFactory = class {
|
|
|
2453
2625
|
createSubscriptionCoder() {
|
|
2454
2626
|
return new AdaptySubscriptionCoder(this.deps.platform);
|
|
2455
2627
|
}
|
|
2628
|
+
createSubscriptionCommitmentInfoCoder() {
|
|
2629
|
+
return new AdaptySubscriptionCommitmentInfoCoder(this.deps.platform);
|
|
2630
|
+
}
|
|
2456
2631
|
createSubscriptionDetailsCoder() {
|
|
2457
2632
|
return new AdaptySubscriptionDetailsCoder(this.deps.platform);
|
|
2458
2633
|
}
|
|
@@ -2465,6 +2640,9 @@ var CoderFactory = class {
|
|
|
2465
2640
|
createSubscriptionPeriodCoder() {
|
|
2466
2641
|
return new AdaptySubscriptionPeriodCoder(this.deps.platform);
|
|
2467
2642
|
}
|
|
2643
|
+
createSubscriptionPricingTermsCoder() {
|
|
2644
|
+
return new AdaptySubscriptionPricingTermsCoder(this.deps.platform);
|
|
2645
|
+
}
|
|
2468
2646
|
createUiCreateOnboardingViewParamsCoder() {
|
|
2469
2647
|
return new AdaptyUICreateOnboardingViewParamsCoder();
|
|
2470
2648
|
}
|
|
@@ -2538,6 +2716,10 @@ const ProductPeriod = Object.freeze({
|
|
|
2538
2716
|
Month: "month",
|
|
2539
2717
|
Year: "year"
|
|
2540
2718
|
});
|
|
2719
|
+
const SubscriptionBillingPlan = Object.freeze({
|
|
2720
|
+
UpFront: "up_front",
|
|
2721
|
+
Monthly: "monthly"
|
|
2722
|
+
});
|
|
2541
2723
|
const WebPresentation = Object.freeze({
|
|
2542
2724
|
BrowserOutApp: "browser_out_app",
|
|
2543
2725
|
BrowserInApp: "browser_in_app"
|
|
@@ -2561,6 +2743,7 @@ const RefundPreference = Object.freeze({
|
|
|
2561
2743
|
const MethodNames = [
|
|
2562
2744
|
"activate",
|
|
2563
2745
|
"adapty_ui_create_flow_view",
|
|
2746
|
+
"adapty_ui_destroy_flow_view",
|
|
2564
2747
|
"adapty_ui_dismiss_flow_view",
|
|
2565
2748
|
"adapty_ui_present_flow_view",
|
|
2566
2749
|
"adapty_ui_show_dialog",
|
|
@@ -2573,6 +2756,7 @@ const MethodNames = [
|
|
|
2573
2756
|
"get_flow",
|
|
2574
2757
|
"get_flow_for_default_audience",
|
|
2575
2758
|
"get_paywall_products",
|
|
2759
|
+
"get_pending_store_message_types",
|
|
2576
2760
|
"get_onboarding",
|
|
2577
2761
|
"get_onboarding_for_default_audience",
|
|
2578
2762
|
"get_profile",
|
|
@@ -2584,12 +2768,15 @@ const MethodNames = [
|
|
|
2584
2768
|
"make_promoted_purchase",
|
|
2585
2769
|
"make_purchase",
|
|
2586
2770
|
"open_web_paywall",
|
|
2771
|
+
"preload_flows",
|
|
2772
|
+
"preload_flows_for_default_audience",
|
|
2587
2773
|
"present_code_redemption_sheet",
|
|
2588
2774
|
"report_transaction",
|
|
2589
2775
|
"restore_purchases",
|
|
2590
2776
|
"set_fallback",
|
|
2591
2777
|
"set_integration_identifiers",
|
|
2592
2778
|
"set_log_level",
|
|
2779
|
+
"show_store_messages",
|
|
2593
2780
|
"update_collecting_refund_data_consent",
|
|
2594
2781
|
"update_external_attribution_data",
|
|
2595
2782
|
"update_profile",
|
|
@@ -2807,7 +2994,8 @@ function parseMethodResult(factory, input, resultType, ctx) {
|
|
|
2807
2994
|
"Boolean",
|
|
2808
2995
|
"Void",
|
|
2809
2996
|
"AdaptyUiView",
|
|
2810
|
-
"AdaptyUiDialogActionType"
|
|
2997
|
+
"AdaptyUiDialogActionType",
|
|
2998
|
+
"Array<AdaptyStoreMessageType>"
|
|
2811
2999
|
].includes(resultType)) return obj.success;
|
|
2812
3000
|
const coder = getCoder(factory, resultType, ctx);
|
|
2813
3001
|
return coder?.decode(obj.success);
|
|
@@ -3246,6 +3434,7 @@ exports.OfferType = OfferType
|
|
|
3246
3434
|
exports.OnboardingEventId = OnboardingEventId
|
|
3247
3435
|
exports.ProductPeriod = ProductPeriod
|
|
3248
3436
|
exports.RefundPreference = RefundPreference
|
|
3437
|
+
exports.SubscriptionBillingPlan = SubscriptionBillingPlan
|
|
3249
3438
|
exports.VendorStore = VendorStore
|
|
3250
3439
|
exports.WebPresentation = WebPresentation
|
|
3251
3440
|
exports.consoleLogSink = consoleLogSink
|