@adapty/core 3.15.0-dev.11e2c53bb5aaf58bf319abd22d240e6936c010b9

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.
@@ -0,0 +1,3310 @@
1
+ //#region src/adapters/interfaces.d.ts
2
+ type PlatformOS = 'ios' | 'android' | 'web' | 'unknown';
3
+ /**
4
+ * Platform adapter interface for OS-specific behavior
5
+ */
6
+ interface IPlatformAdapter {
7
+ /**
8
+ * Current platform OS
9
+ */
10
+ readonly OS: PlatformOS;
11
+ }
12
+ /**
13
+ * SDK metadata adapter for version and SDK name
14
+ */
15
+ interface ISdkMetadataAdapter {
16
+ /**
17
+ * SDK name (e.g., 'react-native', 'capacitor')
18
+ */
19
+ readonly sdkName: string;
20
+ /**
21
+ * SDK version string
22
+ */
23
+ readonly sdkVersion: string;
24
+ }
25
+ /**
26
+ * Lazy-evaluated log arguments
27
+ */
28
+ type LogArgs = () => Record<string, any>;
29
+ /**
30
+ * Logger adapter interface for platform-specific logging
31
+ */
32
+ interface ILoggerAdapter {
33
+ /**
34
+ * Create logging context for method execution
35
+ */
36
+ createContext(): ILogContext;
37
+ }
38
+ interface ScopeArgs {
39
+ methodName: string;
40
+ }
41
+ interface LogTrace {
42
+ action: string;
43
+ fn: string;
44
+ payload: LogArgs;
45
+ error?: boolean;
46
+ done?: boolean;
47
+ }
48
+ /**
49
+ * Log context interface for tracking method execution
50
+ */
51
+ interface ILogContext {
52
+ readonly stack: LogTrace[];
53
+ decode(args: ScopeArgs): ILogScope;
54
+ encode(args: ScopeArgs): ILogScope;
55
+ call(args: ScopeArgs): ILogScope;
56
+ bridge(args: ScopeArgs): ILogScope;
57
+ event(args: ScopeArgs): ILogScope;
58
+ }
59
+ /**
60
+ * Log scope interface for logging at execution stages
61
+ */
62
+ interface ILogScope {
63
+ start(args: LogArgs): void;
64
+ failed(args: LogArgs): void;
65
+ success(args: LogArgs): void;
66
+ wait?(args: LogArgs): void;
67
+ waitComplete?(args: LogArgs): void;
68
+ } //#endregion
69
+ //#region src/adapters/defaults.d.ts
70
+
71
+ //# sourceMappingURL=interfaces.d.ts.map
72
+ /**
73
+ * Default platform adapter with unknown OS
74
+ */
75
+ declare class DefaultPlatformAdapter implements IPlatformAdapter {
76
+ get OS(): PlatformOS;
77
+ set OS(value: PlatformOS);
78
+ }
79
+ /**
80
+ * Default SDK metadata adapter
81
+ */
82
+ declare class DefaultSdkMetadataAdapter implements ISdkMetadataAdapter {
83
+ readonly sdkName: string;
84
+ readonly sdkVersion: string;
85
+ constructor(sdkName?: string, sdkVersion?: string);
86
+ }
87
+ /**
88
+ * Default logger adapter using the real LogContext implementation
89
+ */
90
+ declare class DefaultLoggerAdapter implements ILoggerAdapter {
91
+ createContext(): ILogContext;
92
+ }
93
+
94
+ //#endregion
95
+ //#region src/logger/log-scope.d.ts
96
+ //# sourceMappingURL=defaults.d.ts.map
97
+ type LogCallback = (LazyParams: LogArgs) => void;
98
+ interface LogScopeConstructor extends ScopeArgs$1 {
99
+ onStart: LogCallback;
100
+ onSuccess: LogCallback;
101
+ onFailed: LogCallback;
102
+ onWait: LogCallback;
103
+ onWaitComplete: LogCallback;
104
+ }
105
+ declare class LogScope {
106
+ methodName: string;
107
+ private onStart;
108
+ private onSuccess;
109
+ private onFailed;
110
+ private onWait;
111
+ private onWaitComplete;
112
+ constructor(args: LogScopeConstructor);
113
+ start(args: LogArgs): void;
114
+ wait(args: LogArgs): void;
115
+ waitComplete(args: LogArgs): void;
116
+ success(args: LogArgs): void;
117
+ failed(args: LogArgs): void;
118
+ }
119
+
120
+ //#endregion
121
+ //#region src/logger/log-context.d.ts
122
+ //# sourceMappingURL=log-scope.d.ts.map
123
+ interface ScopeArgs$1 {
124
+ methodName: string;
125
+ }
126
+ type Scope = 'EVENT' | 'CALL' | 'ENCODE' | 'BRIDGE' | 'DECODE';
127
+ interface Trace {
128
+ action: Scope;
129
+ fn: string;
130
+ payload: LogArgs;
131
+ error?: boolean;
132
+ done?: boolean;
133
+ }
134
+ declare class LogContext {
135
+ stack: Trace[];
136
+ private createScope;
137
+ event(method: ScopeArgs$1): LogScope;
138
+ call(args: ScopeArgs$1): LogScope;
139
+ encode(args: ScopeArgs$1): LogScope;
140
+ bridge(args: ScopeArgs$1): LogScope;
141
+ decode(args: ScopeArgs$1): LogScope;
142
+ }
143
+
144
+ //#endregion
145
+ //#region src/types/error.d.ts
146
+ declare const ErrorCode: Readonly<{
147
+ /**
148
+ * System StoreKit codes
149
+ */
150
+ 0: "unknown";
151
+ /**
152
+ * Client is not allowed to make a request, etc.
153
+ */
154
+ 1: "clientInvalid";
155
+ /**
156
+ * Invalid purchase identifier, etc.
157
+ */
158
+ 3: "paymentInvalid";
159
+ /**
160
+ * This device is not allowed to make the payment.
161
+ */
162
+ 4: "paymentNotAllowed";
163
+ /**
164
+ * Product is not available in the current storefront.
165
+ */
166
+ 5: "storeProductNotAvailable";
167
+ /**
168
+ * User has not allowed access to cloud service information.
169
+ */
170
+ 6: "cloudServicePermissionDenied";
171
+ /**
172
+ * The device could not connect to the network.
173
+ */
174
+ 7: "cloudServiceNetworkConnectionFailed";
175
+ /**
176
+ * User has revoked permission to use this cloud service.
177
+ */
178
+ 8: "cloudServiceRevoked";
179
+ /**
180
+ * The user needs to acknowledge Apple's privacy policy.
181
+ */
182
+ 9: "privacyAcknowledgementRequired";
183
+ /**
184
+ * The app is attempting to use SKPayment's requestData property,
185
+ * but does not have the appropriate entitlement.
186
+ */
187
+ 10: "unauthorizedRequestData";
188
+ /**
189
+ * The specified subscription offer identifier is not valid.
190
+ */
191
+ 11: "invalidOfferIdentifier";
192
+ /**
193
+ * The cryptographic signature provided is not valid.
194
+ */
195
+ 12: "invalidSignature";
196
+ /**
197
+ * One or more parameters from SKPaymentDiscount is missing.
198
+ */
199
+ 13: "missingOfferParams";
200
+ 14: "invalidOfferPrice";
201
+ /**
202
+ * Custom Android codes.
203
+ */
204
+ 20: "adaptyNotInitialized";
205
+ 22: "productNotFound";
206
+ 24: "currentSubscriptionToUpdateNotFoundInHistory";
207
+ 97: "billingServiceTimeout";
208
+ 98: "featureNotSupported";
209
+ 99: "billingServiceDisconnected";
210
+ 102: "billingServiceUnavailable";
211
+ 103: "billingUnavailable";
212
+ 105: "developerError";
213
+ 106: "billingError";
214
+ 107: "itemAlreadyOwned";
215
+ 108: "itemNotOwned";
216
+ 112: "billingNetworkError";
217
+ 1000: "noProductIDsFound";
218
+ 1002: "productRequestFailed";
219
+ /**
220
+ * In-App Purchases are not allowed on this device.
221
+ */
222
+ 1003: "cantMakePayments";
223
+ 1004: "noPurchasesToRestore";
224
+ 1005: "cantReadReceipt";
225
+ 1006: "productPurchaseFailed";
226
+ 1010: "refreshReceiptFailed";
227
+ 1011: "receiveRestoredTransactionsFailed";
228
+ /**
229
+ * You need to be authenticated to perform requests.
230
+ */
231
+ 2002: "notActivated";
232
+ 2003: "badRequest";
233
+ 2004: "serverError";
234
+ 2005: "networkFailed";
235
+ 2006: "decodingFailed";
236
+ 2009: "encodingFailed";
237
+ 3000: "analyticsDisabled";
238
+ /**
239
+ * Wrong parameter was passed.
240
+ */
241
+ 3001: "wrongParam";
242
+ /**
243
+ * It is not possible to call `.activate` method more than once.
244
+ */
245
+ 3005: "activateOnceError";
246
+ /**
247
+ * The user profile was changed during the operation.
248
+ */
249
+ 3006: "profileWasChanged";
250
+ 3007: "unsupportedData";
251
+ 3100: "persistingDataError";
252
+ 3101: "fetchTimeoutError";
253
+ 9000: "operationInterrupted";
254
+ }>;
255
+ type ErrorCode = keyof typeof ErrorCode;
256
+ declare function getErrorCode(error: (typeof ErrorCode)[ErrorCode]): ErrorCode | undefined;
257
+ declare function getErrorPrompt(code: ErrorCode): (typeof ErrorCode)[ErrorCode];
258
+
259
+ //#endregion
260
+ //#region src/adapty-error.d.ts
261
+ //# sourceMappingURL=error.d.ts.map
262
+ interface AdaptyErrorInput {
263
+ adaptyCode: ErrorCode;
264
+ message: string;
265
+ detail?: string | undefined;
266
+ }
267
+ declare class AdaptyError extends Error {
268
+ static prefix: string;
269
+ static middleware?: (error: AdaptyError) => void;
270
+ adaptyCode: ErrorCode;
271
+ localizedDescription: string;
272
+ detail: string | undefined;
273
+ constructor(input: AdaptyErrorInput);
274
+ static set onError(callback: (error: AdaptyError) => void);
275
+ static failedToDecodeNativeError(message: string, error: unknown): AdaptyError;
276
+ static failedToEncode(message: string): AdaptyError;
277
+ static failedToDecode(message: string): AdaptyError;
278
+ private static getMessage;
279
+ }
280
+
281
+ //#endregion
282
+ //#region src/types/index.d.ts
283
+ //# sourceMappingURL=adapty-error.d.ts.map
284
+ declare const VendorStore: Readonly<{
285
+ AppStore: "app_store";
286
+ PlayStore: "play_store";
287
+ Adapty: "adapty";
288
+ }>;
289
+ type VendorStore = (typeof VendorStore)[keyof typeof VendorStore];
290
+ declare const OfferType: Readonly<{
291
+ FreeTrial: "free_trial";
292
+ PayAsYouGo: "pay_as_you_go";
293
+ PayUpFront: "pay_up_front";
294
+ }>;
295
+ type OfferType = (typeof OfferType)[keyof typeof OfferType];
296
+ declare const CancellationReason: Readonly<{
297
+ VolountarilyCancelled: "voluntarily_cancelled";
298
+ BillingError: "billing_error";
299
+ Refund: "refund";
300
+ PriceIncrease: "price_increase";
301
+ ProductWasNotAvailable: "product_was_not_available";
302
+ Unknown: "unknown";
303
+ }>;
304
+ type CancellationReason = (typeof CancellationReason)[keyof typeof CancellationReason];
305
+ declare const Gender: Readonly<{
306
+ Female: "f";
307
+ Male: "m";
308
+ Other: "o";
309
+ }>;
310
+ type Gender = (typeof Gender)[keyof typeof Gender];
311
+ declare const AppTrackingTransparencyStatus: Readonly<{
312
+ NotDetermined: 0;
313
+ Restricted: 1;
314
+ Denied: 2;
315
+ Authorized: 3;
316
+ Unknown: 4;
317
+ }>;
318
+ type AppTrackingTransparencyStatus = (typeof AppTrackingTransparencyStatus)[keyof typeof AppTrackingTransparencyStatus];
319
+ declare const ProductPeriod: Readonly<{
320
+ Day: "day";
321
+ Week: "week";
322
+ Month: "month";
323
+ Year: "year";
324
+ }>;
325
+ type ProductPeriod = (typeof ProductPeriod)[keyof typeof ProductPeriod];
326
+ interface AdaptyPrice {
327
+ /**
328
+ * Price as number
329
+ */
330
+ amount: number;
331
+ /**
332
+ * The currency code of the locale
333
+ * used to format the price of the product.
334
+ * The ISO 4217 (USD, EUR).
335
+ */
336
+ currencyCode?: string;
337
+ /**
338
+ * The currency symbol of the locale
339
+ * used to format the price of the product.
340
+ * ($, €).
341
+ */
342
+ currencySymbol?: string;
343
+ /**
344
+ * A price’s language is determined
345
+ * by the preferred language set on the device.
346
+ * On Android, the formatted price from Google Play as is.
347
+ */
348
+ localizedString?: string;
349
+ }
350
+ /**
351
+ * Describes an object that represents a paywall.
352
+ * Used in {@link Adapty.getPaywall} method.
353
+ * @public
354
+ */
355
+ interface AdaptyPaywall {
356
+ readonly placement: AdaptyPlacement;
357
+ /**
358
+ * If `true`, it is possible to fetch the view object
359
+ * and use it with AdaptyUI library.
360
+ * @readonly
361
+ */
362
+ readonly hasViewConfiguration: boolean;
363
+ /**
364
+ * A paywall name.
365
+ * @readonly
366
+ */
367
+ readonly name: string;
368
+ /**
369
+ * A remote config configured in Adapty Dashboard for this paywall.
370
+ * @readonly
371
+ */
372
+ readonly remoteConfig?: AdaptyRemoteConfig;
373
+ /**
374
+ * An identifier of a variation,
375
+ * used to attribute purchases to this paywall.
376
+ * @readonly
377
+ */
378
+ readonly variationId: string;
379
+ /**
380
+ * Array of initial products info
381
+ * @readonly
382
+ * @deprecated Use {@link AdaptyPaywall.productIdentifiers} instead
383
+ */
384
+ readonly products: ProductReference[];
385
+ /**
386
+ * Array of product identifiers for this paywall
387
+ * @readonly
388
+ */
389
+ readonly productIdentifiers: AdaptyProductIdentifier[];
390
+ id: string;
391
+ version?: number;
392
+ webPurchaseUrl?: string;
393
+ payloadData?: string;
394
+ requestLocale: string;
395
+ paywallBuilder?: AdaptyPaywallBuilder;
396
+ }
397
+ interface AdaptyOnboarding {
398
+ readonly placement: AdaptyPlacement;
399
+ /**
400
+ * If `true`, it is possible to fetch the view object
401
+ * and use it with AdaptyUI library.
402
+ * @readonly
403
+ */
404
+ readonly hasViewConfiguration: boolean;
405
+ /**
406
+ * A paywall name.
407
+ * @readonly
408
+ */
409
+ readonly name: string;
410
+ /**
411
+ * A remote config configured in Adapty Dashboard for this paywall.
412
+ * @readonly
413
+ */
414
+ readonly remoteConfig?: AdaptyRemoteConfig;
415
+ /**
416
+ * An identifier of a variation,
417
+ * used to attribute purchases to this paywall.
418
+ * @readonly
419
+ */
420
+ readonly variationId: string;
421
+ id: string;
422
+ version?: number;
423
+ payloadData?: string;
424
+ requestLocale: string;
425
+ onboardingBuilder?: AdaptyOnboardingBuilder;
426
+ }
427
+ interface AdaptyPlacement {
428
+ /**
429
+ * Parent A/B test name.
430
+ * @readonly
431
+ */
432
+ readonly abTestName: string;
433
+ /**
434
+ * A name of an audience to which the paywall belongs.
435
+ * @readonly
436
+ */
437
+ readonly audienceName: string;
438
+ /**
439
+ * ID of a placement configured in Adapty Dashboard.
440
+ * @readonly
441
+ */
442
+ readonly id: string;
443
+ /**
444
+ * Current revision (version) of a paywall.
445
+ * Every change within a paywall creates a new revision.
446
+ * @readonly
447
+ */
448
+ readonly revision: number;
449
+ isTrackingPurchases?: boolean;
450
+ audienceVersionId: string;
451
+ }
452
+ /**
453
+ * Describes an object that represents a remote config of a paywall.
454
+ * @public
455
+ */
456
+ interface AdaptyRemoteConfig {
457
+ /**
458
+ * Identifier of a paywall locale.
459
+ * @readonly
460
+ */
461
+ readonly lang: string;
462
+ /**
463
+ * A custom dictionary configured in Adapty Dashboard for this paywall.
464
+ * @readonly
465
+ */
466
+ readonly data: Record<string, any>;
467
+ /**
468
+ * A custom JSON string configured in Adapty Dashboard for this paywall.
469
+ * @readonly
470
+ */
471
+ readonly dataString: string;
472
+ }
473
+ interface AdaptyPaywallBuilder {
474
+ readonly id: string;
475
+ readonly lang: string;
476
+ }
477
+ interface AdaptyOnboardingBuilder {
478
+ readonly url: string;
479
+ }
480
+ type AdaptyPurchaseResult = {
481
+ type: 'pending' | 'user_cancelled';
482
+ } | {
483
+ type: 'success';
484
+ profile: AdaptyProfile;
485
+ ios?: {
486
+ jwsTransaction?: string;
487
+ };
488
+ android?: {
489
+ purchaseToken?: string;
490
+ };
491
+ };
492
+ /**
493
+ * Interface representing a user profile in Adapty,
494
+ * including details about the user's subscriptions and consumable products.
495
+ * @public
496
+ */
497
+ interface AdaptyProfile {
498
+ /**
499
+ * Object that maps access level identifiers (configured by you in Adapty Dashboard)
500
+ * to the corresponding access level details. The value can be `null`
501
+ * if the user does not have any access levels.
502
+ * @readonly
503
+ */
504
+ readonly accessLevels?: Record<string, AdaptyAccessLevel>;
505
+ /**
506
+ * Object representing custom attributes set for the user using
507
+ * the {@link Adapty.updateProfile} method.
508
+ * @readonly
509
+ */
510
+ readonly customAttributes?: Record<string, any>;
511
+ /**
512
+ * The identifier for a user in your system.
513
+ * @readonly
514
+ */
515
+ readonly customerUserId?: string;
516
+ /**
517
+ * Object that maps product ids from the store to an array of
518
+ * information about the user's non-subscription purchases.
519
+ * The value can be `null` if the user does not have any purchases.
520
+ * @readonly
521
+ */
522
+ readonly nonSubscriptions?: Record<string, AdaptyNonSubscription[]>;
523
+ /**
524
+ * The identifier for a user in Adapty.
525
+ */
526
+ readonly profileId: string;
527
+ /**
528
+ * Object that maps product ids from a store to
529
+ * information about the user's subscriptions.
530
+ * The value can be `null` if the user does not have any subscriptions.
531
+ * @readonly
532
+ */
533
+ readonly subscriptions?: Record<string, AdaptySubscription>;
534
+ }
535
+ /**
536
+ * Interface representing access level details of a user.
537
+ * @public
538
+ */
539
+ interface AdaptyAccessLevel {
540
+ /**
541
+ * The date and time when the access level was activated.
542
+ * @readonly
543
+ */
544
+ readonly activatedAt: Date;
545
+ /**
546
+ * Type of active introductory offer, if any.
547
+ * @readonly
548
+ */
549
+ readonly activeIntroductoryOfferType?: OfferType;
550
+ /**
551
+ * Identifier of the active promotional offer, if any.
552
+ * @readonly
553
+ */
554
+ readonly activePromotionalOfferId?: string;
555
+ /**
556
+ * Type of the active promotional offer, if any.
557
+ * @readonly
558
+ */
559
+ readonly activePromotionalOfferType?: OfferType;
560
+ /**
561
+ * The date and time when a billing issue was detected.
562
+ * @readonly
563
+ */
564
+ readonly billingIssueDetectedAt?: Date;
565
+ /**
566
+ * The reason for the cancellation of the subscription.
567
+ * @readonly
568
+ */
569
+ readonly cancellationReason?: CancellationReason;
570
+ /**
571
+ * The expiration date of the access level, if applicable.
572
+ * @readonly
573
+ */
574
+ readonly expiresAt?: Date;
575
+ /**
576
+ * Unique identifier of the access level
577
+ * configured by you in Adapty Dashboard.
578
+ * @readonly
579
+ */
580
+ readonly id: string;
581
+ /**
582
+ * Flag indicating whether the access level is currently active.
583
+ * @readonly
584
+ */
585
+ readonly isActive: boolean;
586
+ /**
587
+ * Flag indicating whether this auto-renewable subscription is in the grace period.
588
+ * @readonly
589
+ */
590
+ readonly isInGracePeriod: boolean;
591
+ /**
592
+ * Flag indicating whether this access level is active for a lifetime.
593
+ * @readonly
594
+ */
595
+ readonly isLifetime: boolean;
596
+ /**
597
+ * Flag indicating whether this purchase was refunded.
598
+ * @readonly
599
+ */
600
+ readonly isRefund: boolean;
601
+ /**
602
+ * The date and time when the access level was renewed.
603
+ * @readonly
604
+ */
605
+ readonly renewedAt?: Date;
606
+ /**
607
+ * The start date of this access level.
608
+ * @readonly
609
+ */
610
+ readonly startsAt?: Date;
611
+ /**
612
+ * The store where the purchase that unlocked this access level was made.
613
+ * @readonly
614
+ */
615
+ readonly store: VendorStore;
616
+ /**
617
+ * The date and time when the auto-renewable subscription was cancelled.
618
+ * @readonly
619
+ */
620
+ readonly unsubscribedAt?: Date;
621
+ /**
622
+ * The identifier of the product in the store that unlocked this access level.
623
+ * @readonly
624
+ */
625
+ readonly vendorProductId: string;
626
+ /**
627
+ * Flag indicating whether this auto-renewable subscription is set to renew.
628
+ * @readonly
629
+ */
630
+ readonly willRenew: boolean;
631
+ android?: {
632
+ offerId?: string;
633
+ };
634
+ }
635
+ /**
636
+ * Interface representing a consumable or non-subscription purchase made by the user.
637
+ * @public
638
+ */
639
+ interface AdaptyNonSubscription {
640
+ /**
641
+ * Flag indicating whether the product is consumable.
642
+ * @readonly
643
+ */
644
+ readonly isConsumable: boolean;
645
+ /**
646
+ * Flag indicating whether the purchase was refunded.
647
+ * @readonly
648
+ */
649
+ readonly isRefund: boolean;
650
+ /**
651
+ * Flag indicating whether the product was purchased in a sandbox environment.
652
+ * @readonly
653
+ */
654
+ readonly isSandbox: boolean;
655
+ /**
656
+ * The date and time when the purchase was made.
657
+ * @readonly
658
+ */
659
+ readonly purchasedAt: Date;
660
+ /**
661
+ * The identifier of the product in the store that was purchased.
662
+ * @readonly
663
+ */
664
+ readonly vendorProductId: string;
665
+ /**
666
+ * The identifier of the product in the store that was purchased.
667
+ * @readonly
668
+ */
669
+ readonly vendorTransactionId?: string;
670
+ /**
671
+ * The store where the purchase was made.
672
+ * @readonly
673
+ */
674
+ readonly store: VendorStore;
675
+ /**
676
+ * An identifier of the purchase in Adapty.
677
+ * You can use it to ensure that you've already processed this purchase
678
+ * (for example tracking one time products).
679
+ * @readonly
680
+ */
681
+ readonly purchaseId: string;
682
+ }
683
+ /**
684
+ * Interface representing details about a user's subscription.
685
+ * @public
686
+ */
687
+ interface AdaptySubscription {
688
+ /**
689
+ * The date and time when the subscription was activated.
690
+ * @readonly
691
+ */
692
+ readonly activatedAt: Date;
693
+ /**
694
+ * Type of active introductory offer, if any.
695
+ * @readonly
696
+ */
697
+ readonly activeIntroductoryOfferType?: OfferType;
698
+ /**
699
+ * Identifier of the active promotional offer, if any.
700
+ * @readonly
701
+ */
702
+ readonly activePromotionalOfferId?: string;
703
+ /**
704
+ * Type of the active promotional offer, if any.
705
+ * @readonly
706
+ */
707
+ readonly activePromotionalOfferType?: OfferType;
708
+ /**
709
+ * The date and time when a billing issue was detected.
710
+ * @readonly
711
+ */
712
+ readonly billingIssueDetectedAt?: Date;
713
+ /**
714
+ * The reason for the cancellation of the subscription.
715
+ * @readonly
716
+ */
717
+ readonly cancellationReason?: CancellationReason;
718
+ /**
719
+ * The expiration date of the subscription, if applicable.
720
+ * @readonly
721
+ */
722
+ readonly expiresAt?: Date;
723
+ /**
724
+ * Flag indicating whether the subscription is currently active.
725
+ * @readonly
726
+ */
727
+ readonly isActive: boolean;
728
+ /**
729
+ * Flag indicating whether the subscription is in the grace period.
730
+ * @readonly
731
+ */
732
+ readonly isInGracePeriod: boolean;
733
+ /**
734
+ * Flag indicating whether the subscription is set for a lifetime.
735
+ * @readonly
736
+ */
737
+ readonly isLifetime: boolean;
738
+ /**
739
+ * Flag indicating whether the subscription was refunded.
740
+ * @readonly
741
+ */
742
+ readonly isRefund: boolean;
743
+ /**
744
+ * Flag indicating whether the subscription was purchased in a sandbox environment.
745
+ * @readonly
746
+ */
747
+ readonly isSandbox: boolean;
748
+ /**
749
+ * The date and time when the subscription was renewed.
750
+ * @readonly
751
+ */
752
+ readonly renewedAt?: Date;
753
+ /**
754
+ * The date and time when the subscription starts.
755
+ * @readonly
756
+ */
757
+ readonly startsAt?: Date;
758
+ /**
759
+ * The store where the subscription was made.
760
+ * @readonly
761
+ */
762
+ readonly store: VendorStore;
763
+ /**
764
+ * The date and time when the subscription was cancelled.
765
+ * @readonly
766
+ */
767
+ readonly unsubscribedAt?: Date;
768
+ /**
769
+ * The identifier of the product in the store that was subscribed to.
770
+ * @readonly
771
+ */
772
+ readonly vendorProductId: string;
773
+ /**
774
+ * The identifier of the product in the store that was subscribed to.
775
+ * @readonly
776
+ */
777
+ readonly vendorTransactionId: string;
778
+ /**
779
+ * An original transaction id of the purchase in a store that unlocked this subscription.
780
+ * For auto-renewable subscription, this will be an id of the first transaction in this subscription.
781
+ * @readonly
782
+ */
783
+ readonly vendorOriginalTransactionId: string;
784
+ /**
785
+ * Flag indicating whether the subscription is set to auto-renew.
786
+ * @readonly
787
+ */
788
+ readonly willRenew: boolean;
789
+ }
790
+ /**
791
+ * Describes an object that represents a product.
792
+ * Used in {@link Adapty.getPaywallProducts} method and in {@link Adapty.makePurchase} method.
793
+ * @public
794
+ */
795
+ interface AdaptyPaywallProduct {
796
+ /**
797
+ * A description of the product.
798
+ */
799
+ readonly localizedDescription: string;
800
+ /**
801
+ * The region code of the locale used to format the price of the product.
802
+ * ISO 3166 ALPHA-2 (US, DE)
803
+ */
804
+ readonly regionCode?: string;
805
+ /**
806
+ * The name of the product.
807
+ */
808
+ readonly localizedTitle: string;
809
+ /**
810
+ * Same as `abTestName` property of the parent {@link AdaptyPaywall}.
811
+ */
812
+ readonly paywallABTestName: string;
813
+ /**
814
+ * Same as `name` property of the parent {@link AdaptyPaywall}.
815
+ */
816
+ readonly paywallName: string;
817
+ readonly accessLevelId: string;
818
+ readonly productType: string;
819
+ /**
820
+ * The cost of the product in the local currency
821
+ */
822
+ readonly price?: AdaptyPrice;
823
+ readonly adaptyId: string;
824
+ /**
825
+ * Same as `variationId` property of the parent {@link AdaptyPaywall}.
826
+ */
827
+ readonly variationId: string;
828
+ /**
829
+ * Unique identifier of a product
830
+ * from App Store Connect or Google Play Console
831
+ */
832
+ readonly vendorProductId: string;
833
+ paywallProductIndex: number;
834
+ webPurchaseUrl?: string;
835
+ payloadData?: string;
836
+ subscription?: AdaptySubscriptionDetails;
837
+ ios?: {
838
+ /**
839
+ * Boolean value that indicates
840
+ * whether the product is available for family sharing
841
+ * in App Store Connect.
842
+ * Will be `false` for iOS version below 14.0 and macOS version below 11.0.
843
+ * @see {@link https://developer.apple.com/documentation/storekit/skproduct/3564805-isfamilyshareable}
844
+ */
845
+ readonly isFamilyShareable: boolean;
846
+ };
847
+ }
848
+ interface AdaptySubscriptionDetails {
849
+ /**
850
+ * The period details for products that are subscriptions.
851
+ * Will be `null` for iOS version below 11.2 and macOS version below 10.14.4.
852
+ */
853
+ subscriptionPeriod: AdaptySubscriptionPeriod;
854
+ /**
855
+ * The period’s language is determined
856
+ * by the preferred language set on the device.
857
+ */
858
+ localizedSubscriptionPeriod?: string;
859
+ /**
860
+ * A subscription offer if available for the auto-renewable subscription.
861
+ */
862
+ offer?: AdaptySubscriptionOffer;
863
+ ios?: {
864
+ /**
865
+ * An identifier of the subscription group
866
+ * to which the subscription belongs.
867
+ * Will be `null` for iOS version below 12.0 and macOS version below 10.14.
868
+ */
869
+ subscriptionGroupIdentifier?: string;
870
+ };
871
+ android?: {
872
+ basePlanId: string;
873
+ renewalType?: 'prepaid' | 'autorenewable';
874
+ };
875
+ }
876
+ /**
877
+ * Subscription offer model to products
878
+ * @see {@link https://doc.adapty.io/docs/rn-api-reference#adaptysubscriptionoffer}
879
+ */
880
+ interface AdaptySubscriptionOffer {
881
+ readonly identifier: AdaptySubscriptionOfferId;
882
+ phases: AdaptyDiscountPhase[];
883
+ android?: {
884
+ offerTags?: string[];
885
+ };
886
+ }
887
+ type AdaptySubscriptionOfferId = {
888
+ id?: string;
889
+ type: 'introductory';
890
+ } | {
891
+ id: string;
892
+ type: 'promotional' | 'win_back';
893
+ };
894
+ /**
895
+ * Discount model to products
896
+ * @see {@link https://doc.adapty.io/docs/rn-api-reference#adaptyproductdiscount}
897
+ */
898
+ interface AdaptyDiscountPhase {
899
+ /**
900
+ * A formatted number of periods of a discount for a user’s locale.
901
+ * @readonly
902
+ */
903
+ readonly localizedNumberOfPeriods?: string;
904
+ /**
905
+ * A formatted subscription period of a discount for a user’s locale.
906
+ * @readonly
907
+ */
908
+ readonly localizedSubscriptionPeriod?: string;
909
+ /**
910
+ * A number of periods this product discount is available.
911
+ * @readonly
912
+ */
913
+ readonly numberOfPeriods: number;
914
+ /**
915
+ * Discount price of a product in a local currency.
916
+ * @readonly
917
+ */
918
+ readonly price: AdaptyPrice;
919
+ /**
920
+ * An information about period for a product discount.
921
+ * @readonly
922
+ */
923
+ readonly subscriptionPeriod: AdaptySubscriptionPeriod;
924
+ /**
925
+ * A payment mode for this product discount.
926
+ * @readonly
927
+ */
928
+ readonly paymentMode: OfferType;
929
+ }
930
+ /**
931
+ * An object containing information about a subscription period.
932
+ * @public
933
+ */
934
+ interface AdaptySubscriptionPeriod {
935
+ /**
936
+ * A number of period units.
937
+ * @readonly
938
+ */
939
+ readonly numberOfUnits: number;
940
+ /**
941
+ * A unit of time that a subscription period is specified in.
942
+ * @readonly
943
+ */
944
+ readonly unit: ProductPeriod;
945
+ }
946
+ interface AdaptyProfileParameters {
947
+ analyticsDisabled?: boolean;
948
+ codableCustomAttributes?: {
949
+ [key: string]: any;
950
+ };
951
+ appTrackingTransparencyStatus?: AppTrackingTransparencyStatus;
952
+ firstName?: string;
953
+ lastName?: string;
954
+ gender?: Gender;
955
+ birthday?: string;
956
+ email?: string;
957
+ phoneNumber?: string;
958
+ }
959
+ interface ProductReference {
960
+ vendorId: string;
961
+ adaptyId: string;
962
+ accessLevelId: string;
963
+ productType: string;
964
+ ios?: {
965
+ promotionalOfferId?: string;
966
+ winBackOfferId?: string;
967
+ };
968
+ android?: {
969
+ basePlanId?: string;
970
+ offerId?: string;
971
+ };
972
+ }
973
+ /**
974
+ * Interface representing a product identifier with vendor and platform-specific information.
975
+ * @public
976
+ */
977
+ interface AdaptyProductIdentifier {
978
+ /**
979
+ * The vendor-specific product identifier (e.g., App Store or Google Play product ID).
980
+ * @readonly
981
+ */
982
+ readonly vendorProductId: string;
983
+ /**
984
+ * The base plan identifier for Google Play subscriptions (Android only).
985
+ * @readonly
986
+ */
987
+ readonly basePlanId?: string;
988
+ /**
989
+ * Internal Adapty product identifier.
990
+ * @readonly
991
+ */
992
+ readonly adaptyProductId: string;
993
+ }
994
+ declare const WebPresentation: Readonly<{
995
+ BrowserOutApp: "browser_out_app";
996
+ BrowserInApp: "browser_in_app";
997
+ }>;
998
+ type WebPresentation = (typeof WebPresentation)[keyof typeof WebPresentation];
999
+ declare const RefundPreference: Readonly<{
1000
+ NoPreference: "no_preference";
1001
+ Grant: "grant";
1002
+ Decline: "decline";
1003
+ }>;
1004
+ type RefundPreference = (typeof RefundPreference)[keyof typeof RefundPreference];
1005
+ type AdaptyInstallationStatus = {
1006
+ status: 'not_available' | 'not_determined';
1007
+ } | {
1008
+ status: 'determined';
1009
+ details: AdaptyInstallationDetails;
1010
+ };
1011
+ interface AdaptyInstallationDetails {
1012
+ /**
1013
+ * A unique identifier for this installation.
1014
+ * @readonly
1015
+ */
1016
+ readonly installId?: string;
1017
+ /**
1018
+ * The date and time when the app was installed.
1019
+ * @readonly
1020
+ */
1021
+ readonly installTime: Date;
1022
+ /**
1023
+ * The total number of times the app has been launched.
1024
+ * @readonly
1025
+ */
1026
+ readonly appLaunchCount: number;
1027
+ /**
1028
+ * Custom payload data associated with the installation.
1029
+ * @readonly
1030
+ */
1031
+ readonly payload?: string;
1032
+ } //#endregion
1033
+ //#region src/ui/types.d.ts
1034
+
1035
+ //# sourceMappingURL=index.d.ts.map
1036
+ /**
1037
+ * @internal
1038
+ */
1039
+ type ArgType<T> = T extends (() => any) ? void : T extends ((arg: infer U) => any) ? U : void;
1040
+ /**
1041
+ * EventHandler callback should not return a promise,
1042
+ * because using `await` may postpone closing a paywall view.
1043
+ *
1044
+ * We don't want to block the UI thread.
1045
+ */
1046
+ type EventHandlerResult = boolean | void;
1047
+ /**
1048
+ * Purchase parameters keyed by AdaptyProductIdentifier objects
1049
+ */
1050
+ type ProductPurchaseParams = Array<{
1051
+ productId: AdaptyProductIdentifier;
1052
+ params: MakePurchaseParamsInput;
1053
+ }>;
1054
+ /**
1055
+ * Hashmap of possible events to their callbacks
1056
+ *
1057
+ * @see {@link https://adapty.io/docs/react-native-handling-events-1 | [DOC] Handling View Events}
1058
+ */
1059
+ interface EventHandlers {
1060
+ /**
1061
+ * Called when a user taps the close button on the paywall view
1062
+ *
1063
+ * If you return `true`, the paywall view will be closed.
1064
+ * We strongly recommend to return `true` in this case.
1065
+ * @default true
1066
+ */
1067
+ onCloseButtonPress: () => EventHandlerResult;
1068
+ /**
1069
+ * Called when a user navigates back on Android
1070
+ *
1071
+ * If you return `true`, the paywall view will be closed.
1072
+ * We strongly recommend to return `true` in this case.
1073
+ * @default true
1074
+ */
1075
+ onAndroidSystemBack: () => EventHandlerResult;
1076
+ /**
1077
+ * Called when a user taps the product in the paywall view
1078
+ *
1079
+ * If you return `true` from this callback, the paywall view will be closed.
1080
+ */
1081
+ onProductSelected: (productId: string) => EventHandlerResult;
1082
+ /**
1083
+ * Called when a user taps the purchase button in the paywall view
1084
+ *
1085
+ * If you return `true` from this callback, the paywall view will be closed.
1086
+ */
1087
+ onPurchaseStarted: (product: AdaptyPaywallProduct) => EventHandlerResult;
1088
+ /**
1089
+ * Called when the purchase succeeds, the user cancels their purchase, or the purchase appears to be pending
1090
+ *
1091
+ * If you return `true` from this callback, the paywall view will be closed.
1092
+ * We strongly recommend returning `purchaseResult.type !== 'user_cancelled'` in this case.
1093
+ * @default `purchaseResult.type !== 'user_cancelled'`
1094
+ *
1095
+ * @param {AdaptyPurchaseResult} purchaseResult - object, which provides details about the purchase.
1096
+ * If the result is `'success'`, it also includes the updated user's profile.
1097
+ */
1098
+ onPurchaseCompleted: (purchaseResult: AdaptyPurchaseResult, product: AdaptyPaywallProduct) => EventHandlerResult;
1099
+ /**
1100
+ * Called if a purchase fails after a user taps the purchase button
1101
+ *
1102
+ * If you return `true` from this callback, the paywall view will be closed.
1103
+ *
1104
+ * @param {AdaptyError} error - AdaptyError object with error code and message
1105
+ */
1106
+ onPurchaseFailed: (error: AdaptyError, product: AdaptyPaywallProduct) => EventHandlerResult;
1107
+ /**
1108
+ * Called when a user taps the restore button in the paywall view
1109
+ *
1110
+ * If you return `true` from this callback, the paywall view will be closed.
1111
+ */
1112
+ onRestoreStarted: () => EventHandlerResult;
1113
+ onPaywallClosed: () => EventHandlerResult;
1114
+ onPaywallShown: () => EventHandlerResult;
1115
+ onWebPaymentNavigationFinished: (product?: AdaptyPaywallProduct, error?: AdaptyError) => EventHandlerResult;
1116
+ /**
1117
+ * Called when a purchase is completed
1118
+ *
1119
+ * If you return `true` from this callback, the paywall view will be closed.
1120
+ * We strongly recommend to return `true` in this case.
1121
+ * @default true
1122
+ *
1123
+ * @param {AdaptyProfile} profile - updated user profile
1124
+ */
1125
+ onRestoreCompleted: (profile: AdaptyProfile) => EventHandlerResult;
1126
+ /**
1127
+ * Called if a restore fails after a user taps the restore button
1128
+ *
1129
+ * If you return `true` from this callback, the paywall view will be closed.
1130
+ *
1131
+ * @param {AdaptyError} error - AdaptyError object with error code and message
1132
+ */
1133
+ onRestoreFailed: (error: AdaptyError) => EventHandlerResult;
1134
+ /**
1135
+ * Called if a paywall view fails to render.
1136
+ * This should not ever happen, but if it does, feel free to report it to us.
1137
+ *
1138
+ * If you return `true` from this callback, the paywall view will be closed.
1139
+ *
1140
+ * @param {AdaptyError} error - AdaptyError object with error code and message
1141
+ */
1142
+ onRenderingFailed: (error: AdaptyError) => EventHandlerResult;
1143
+ /**
1144
+ * Called if a product list fails to load on a presented view,
1145
+ * for example, if there is no internet connection
1146
+ *
1147
+ * If you return `true` from this callback, the paywall view will be closed.
1148
+ *
1149
+ * @param {AdaptyError} error - AdaptyError object with error code and message
1150
+ */
1151
+ onLoadingProductsFailed: (error: AdaptyError) => EventHandlerResult;
1152
+ onCustomAction: (actionId: string) => EventHandlerResult;
1153
+ onUrlPress: (url: string) => EventHandlerResult;
1154
+ }
1155
+ interface OnboardingEventHandlers {
1156
+ onClose: (actionId: string, meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1157
+ onCustom: (actionId: string, meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1158
+ onPaywall: (actionId: string, meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1159
+ onStateUpdated: (action: OnboardingStateUpdatedAction, meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1160
+ onFinishedLoading: (meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1161
+ onAnalytics: (event: {
1162
+ name: OnboardingAnalyticsEventName;
1163
+ /**
1164
+ * @deprecated Use `elementId` instead
1165
+ */
1166
+ element_id?: string;
1167
+ elementId?: string;
1168
+ reply?: string;
1169
+ }, meta: AdaptyUiOnboardingMeta) => EventHandlerResult;
1170
+ onError: (error: AdaptyError) => EventHandlerResult;
1171
+ }
1172
+ type OnboardingAnalyticsEventName = 'onboarding_started' | 'screen_presented' | 'screen_completed' | 'second_screen_presented' | 'registration_screen_presented' | 'products_screen_presented' | 'user_email_collected' | 'onboarding_completed' | (string & {});
1173
+ type AdaptyUiOnboardingMeta = {
1174
+ onboardingId: string;
1175
+ screenClientId: string;
1176
+ screenIndex: number;
1177
+ totalScreens: number;
1178
+ };
1179
+ type AdaptyUiOnboardingStateParams = {
1180
+ id: string;
1181
+ value: string;
1182
+ label: string;
1183
+ };
1184
+ type OnboardingStateUpdatedAction = {
1185
+ elementId: string;
1186
+ elementType: 'select';
1187
+ value: AdaptyUiOnboardingStateParams;
1188
+ } | {
1189
+ elementId: string;
1190
+ elementType: 'multi_select';
1191
+ value: AdaptyUiOnboardingStateParams[];
1192
+ } | {
1193
+ elementId: string;
1194
+ elementType: 'input';
1195
+ value: {
1196
+ type: 'text' | 'email';
1197
+ value: string;
1198
+ } | {
1199
+ type: 'number';
1200
+ value: number;
1201
+ };
1202
+ } | {
1203
+ elementId: string;
1204
+ elementType: 'date_picker';
1205
+ value: {
1206
+ day?: number;
1207
+ month?: number;
1208
+ year?: number;
1209
+ };
1210
+ };
1211
+ /**
1212
+ * Additional options for creating a paywall view
1213
+ *
1214
+ * @see {@link https://docs.adapty.io/docs/paywall-builder-fetching | [DOC] Creating Paywall View}
1215
+ */
1216
+ interface CreatePaywallViewParamsInput {
1217
+ /**
1218
+ * `true` if you want to prefetch products before presenting a paywall view.
1219
+ */
1220
+ prefetchProducts?: boolean;
1221
+ /**
1222
+ * This value limits the timeout (in milliseconds) for this method.
1223
+ */
1224
+ loadTimeoutMs?: number;
1225
+ /**
1226
+ * If you are going to use custom tags functionality, pass an object with tags and corresponding replacement values
1227
+ *
1228
+ * ```
1229
+ * {
1230
+ * 'USERNAME': 'Bruce',
1231
+ * 'CITY': 'Philadelphia'
1232
+ * }
1233
+ * ```
1234
+ */
1235
+ customTags?: Record<string, string>;
1236
+ /**
1237
+ * If you are going to use custom timer functionality, pass an object with timer ids and corresponding dates the timers should end at
1238
+ */
1239
+ customTimers?: Record<string, Date>;
1240
+ customAssets?: Record<string, AdaptyCustomAsset>;
1241
+ productPurchaseParams?: ProductPurchaseParams;
1242
+ }
1243
+ /**
1244
+ * Additional options for creating an onboarding view
1245
+ *
1246
+ * @see {@link https://adapty.io/docs/react-native-get-onboardings | [DOC] Creating Onboarding View}
1247
+ */
1248
+ interface CreateOnboardingViewParamsInput {
1249
+ /**
1250
+ * If you want to change the presentation behavior of external URLs, pass a preferred value.
1251
+ *
1252
+ * @default {@link WebPresentation.BrowserInApp}
1253
+ */
1254
+ externalUrlsPresentation?: WebPresentation;
1255
+ }
1256
+ interface AdaptyUiView {
1257
+ id: string;
1258
+ }
1259
+ interface AdaptyUiMediaCache {
1260
+ memoryStorageTotalCostLimit?: number;
1261
+ memoryStorageCountLimit?: number;
1262
+ diskStorageSizeLimit?: number;
1263
+ }
1264
+ interface AdaptyUiDialogConfig {
1265
+ /**
1266
+ * The action title to display as part of the dialog. If you provide two actions,
1267
+ * be sure `primaryAction` cancels the operation and leaves things unchanged.
1268
+ */
1269
+ primaryActionTitle: string;
1270
+ /**
1271
+ * The secondary action title to display as part of the dialog.
1272
+ */
1273
+ secondaryActionTitle?: string;
1274
+ /**
1275
+ * The title of the dialog.
1276
+ */
1277
+ title?: string;
1278
+ /**
1279
+ * Descriptive text that provides additional details about the reason for the dialog.
1280
+ */
1281
+ content?: string;
1282
+ }
1283
+ declare const AdaptyUiDialogActionType: Readonly<{
1284
+ primary: "primary";
1285
+ secondary: "secondary";
1286
+ }>;
1287
+ type AdaptyUiDialogActionType = (typeof AdaptyUiDialogActionType)[keyof typeof AdaptyUiDialogActionType];
1288
+ type AdaptyCustomAsset = AdaptyCustomImageAsset | AdaptyCustomVideoAsset | AdaptyCustomColorAsset | AdaptyCustomGradientAsset;
1289
+ type AdaptyCustomImageAsset = {
1290
+ type: 'image';
1291
+ base64: string;
1292
+ } | {
1293
+ type: 'image';
1294
+ relativeAssetPath: string;
1295
+ } | {
1296
+ type: 'image';
1297
+ fileLocation: FileLocation;
1298
+ };
1299
+ type AdaptyCustomVideoAsset = {
1300
+ type: 'video';
1301
+ relativeAssetPath: string;
1302
+ } | {
1303
+ type: 'video';
1304
+ fileLocation: FileLocation;
1305
+ };
1306
+ type AdaptyCustomColorAsset = {
1307
+ type: 'color';
1308
+ argb: number;
1309
+ } | {
1310
+ type: 'color';
1311
+ rgb: number;
1312
+ } | {
1313
+ type: 'color';
1314
+ rgba: number;
1315
+ };
1316
+ type AdaptyCustomGradientAsset = {
1317
+ type: 'linear-gradient';
1318
+ values: ({
1319
+ p: number;
1320
+ argb: number;
1321
+ } | {
1322
+ p: number;
1323
+ rgb: number;
1324
+ } | {
1325
+ p: number;
1326
+ rgba: number;
1327
+ })[];
1328
+ points?: {
1329
+ x0?: number;
1330
+ y0?: number;
1331
+ x1?: number;
1332
+ y1?: number;
1333
+ };
1334
+ };
1335
+ /**
1336
+ * iOS presentation style for paywall and onboarding views
1337
+ */
1338
+ type AdaptyIOSPresentationStyle = 'full_screen' | 'page_sheet';
1339
+
1340
+ //#endregion
1341
+ //#region src/mock/types.d.ts
1342
+ //# sourceMappingURL=types.d.ts.map
1343
+ /**
1344
+ * Mock types placeholder for platform-agnostic code
1345
+ * Full implementation should be provided by the platform SDK
1346
+ */
1347
+ interface AdaptyMockConfig {
1348
+ [key: string]: unknown;
1349
+ }
1350
+
1351
+ //#endregion
1352
+ //#region src/types/inputs.d.ts
1353
+ //# sourceMappingURL=types.d.ts.map
1354
+
1355
+ /**
1356
+ * Log levels for the SDK
1357
+ *
1358
+ * @remarks
1359
+ * Logging is performed on a native side.
1360
+ * So you are expected to watch logs in Xcode or Android Studio.
1361
+ */
1362
+ declare const LogLevel: Readonly<{
1363
+ /**
1364
+ * Logs any additional information that may be useful during debugging,
1365
+ * such as function calls, API queries, etc.
1366
+ */
1367
+ VERBOSE: "verbose";
1368
+ /**
1369
+ * Logs only errors
1370
+ */
1371
+ ERROR: "error";
1372
+ /**
1373
+ * Logs messages from the SDK
1374
+ * that do not cause critical errors,
1375
+ * but are worth paying attention to
1376
+ */
1377
+ WARN: "warn";
1378
+ /**
1379
+ * Logs various information messages,
1380
+ * such as those that log the lifecycle of various modules
1381
+ */
1382
+ INFO: "info";
1383
+ }>;
1384
+ type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
1385
+ declare const FetchPolicy: Readonly<{
1386
+ ReloadRevalidatingCacheData: "reload_revalidating_cache_data";
1387
+ ReturnCacheDataElseLoad: "return_cache_data_else_load";
1388
+ ReturnCacheDataIfNotExpiredElseLoad: "return_cache_data_if_not_expired_else_load";
1389
+ }>;
1390
+ type FetchPolicy = (typeof FetchPolicy)[keyof typeof FetchPolicy];
1391
+ type GetPlacementParamsInput = GetPlacementForDefaultAudienceParamsInput & {
1392
+ /**
1393
+ * This value limits the timeout (in milliseconds) for this method.
1394
+ *
1395
+ * @remarks
1396
+ * If the timeout is reached, cached data or local fallback will be returned.
1397
+ */
1398
+ loadTimeoutMs?: number;
1399
+ };
1400
+ type GetPlacementForDefaultAudienceParamsInput = {
1401
+ /**
1402
+ * Fetch policy
1403
+ *
1404
+ * @remarks
1405
+ * By default SDK will try to load data from server and will return cached data in case of failure.
1406
+ * Otherwise use `'return_cache_data_else_load'` to return cached data if it exists.
1407
+ */
1408
+ fetchPolicy?: Exclude<FetchPolicy, 'return_cache_data_if_not_expired_else_load'>;
1409
+ } | {
1410
+ /**
1411
+ * Fetch policy
1412
+ *
1413
+ * @remarks
1414
+ * By default SDK will try to load data from server and will return cached data in case of failure.
1415
+ * Otherwise use `'return_cache_data_else_load'` to return cached data if it exists.
1416
+ */
1417
+ fetchPolicy: Extract<FetchPolicy, 'return_cache_data_if_not_expired_else_load'>;
1418
+ /**
1419
+ * Max age for cached data.
1420
+ *
1421
+ * @remarks
1422
+ * Max time (in seconds) the cache is valid in case of `'return_cache_data_if_not_expired_else_load'` fetch policy.
1423
+ */
1424
+ maxAgeSeconds: number;
1425
+ };
1426
+ /**
1427
+ * Describes optional parameters for the {@link activate} method.
1428
+ */
1429
+ interface ActivateParamsInput {
1430
+ /**
1431
+ * Turn it on if you handle purchases and subscription status yourself
1432
+ * and use Adapty for sending subscription events and analytics
1433
+ *
1434
+ * @defaultValue `false`
1435
+ */
1436
+ observerMode?: boolean;
1437
+ /**
1438
+ * User identifier in your system
1439
+ *
1440
+ * @remarks
1441
+ * If none of the parameters are passed, the SDK will generate an ID
1442
+ * and use it for a current device.
1443
+ * Use your own ID:
1444
+ * 1. If you want to support a cross-device experience
1445
+ * 2. If you have your own authentication system,
1446
+ * and you want to associate adapty profile with your user
1447
+ */
1448
+ customerUserId?: string;
1449
+ /**
1450
+ * Log level for the SDK
1451
+ *
1452
+ * @remarks
1453
+ * Logging is performed on a native side.
1454
+ * So you are expected to watch logs in Xcode or Android Studio.
1455
+ */
1456
+ logLevel?: LogLevel;
1457
+ serverCluster?: 'default' | 'eu' | 'cn';
1458
+ backendProxyHost?: string;
1459
+ backendProxyPort?: number;
1460
+ activateUi?: boolean;
1461
+ mediaCache?: AdaptyUiMediaCache;
1462
+ /**
1463
+ * Locks methods threads until the SDK is ready.
1464
+ * @defaultValue `false`
1465
+ * @deprecated Turned on by default
1466
+ */
1467
+ lockMethodsUntilReady?: boolean;
1468
+ /**
1469
+ * Does not activate SDK until any other method is called
1470
+ * Fixes annoying iOS simulator auhtentication
1471
+ */
1472
+ __debugDeferActivation?: boolean;
1473
+ /**
1474
+ * Ignores multiple activation attempts on fast refresh.
1475
+ * If true, skips activation if SDK is already activated.
1476
+ */
1477
+ __ignoreActivationOnFastRefresh?: boolean;
1478
+ /**
1479
+ * Enables mock mode for web platform
1480
+ * @remarks
1481
+ * When enabled, SDK will use mock implementations instead of native modules.
1482
+ * Useful for Expo Web and testing.
1483
+ * @defaultValue `false`
1484
+ */
1485
+ enableMock?: boolean;
1486
+ /**
1487
+ * Configuration for mock mode
1488
+ * @remarks
1489
+ * Allows customization of mock data returned by the SDK.
1490
+ */
1491
+ mockConfig?: AdaptyMockConfig;
1492
+ /**
1493
+ * Disables IP address collection
1494
+ * @defaultValue `false`
1495
+ */
1496
+ ipAddressCollectionDisabled?: boolean;
1497
+ ios?: {
1498
+ /**
1499
+ * Disables IDFA collection
1500
+ * @default false
1501
+ */
1502
+ idfaCollectionDisabled?: boolean;
1503
+ appAccountToken?: string;
1504
+ /**
1505
+ * Controls whether the SDK will create a new profile when the app is restored from an iCloud backup
1506
+ * @defaultValue `false`
1507
+ */
1508
+ clearDataOnBackup?: boolean;
1509
+ };
1510
+ android?: {
1511
+ /**
1512
+ * Disables Google AdvertisingID collection
1513
+ * @default false
1514
+ */
1515
+ adIdCollectionDisabled?: boolean;
1516
+ pendingPrepaidPlansEnabled?: boolean;
1517
+ localAccessLevelAllowed?: boolean;
1518
+ obfuscatedAccountId?: string;
1519
+ };
1520
+ }
1521
+ interface IdentifyParamsInput {
1522
+ ios?: {
1523
+ appAccountToken?: string;
1524
+ };
1525
+ android?: {
1526
+ obfuscatedAccountId?: string;
1527
+ };
1528
+ }
1529
+ interface GetPaywallProductsParamsInput {}
1530
+ declare const AdaptyAndroidSubscriptionUpdateReplacementMode: Readonly<{
1531
+ ChargeFullPrice: "charge_full_price";
1532
+ Deferred: "deferred";
1533
+ WithoutProration: "without_proration";
1534
+ ChargeProratedPrice: "charge_prorated_price";
1535
+ WithTimeProration: "with_time_proration";
1536
+ }>;
1537
+ type AdaptyAndroidSubscriptionUpdateReplacementMode = (typeof AdaptyAndroidSubscriptionUpdateReplacementMode)[keyof typeof AdaptyAndroidSubscriptionUpdateReplacementMode];
1538
+ /**
1539
+ * Android purchase parameters structure
1540
+ * @public
1541
+ */
1542
+ interface AdaptyAndroidPurchaseParams {
1543
+ /**
1544
+ * Android subscription update parameters
1545
+ * @platform android
1546
+ */
1547
+ subscriptionUpdateParams?: {
1548
+ oldSubVendorProductId: string;
1549
+ prorationMode: AdaptyAndroidSubscriptionUpdateReplacementMode;
1550
+ };
1551
+ /**
1552
+ * Whether the offer is personalized
1553
+ * @platform android
1554
+ * @see {@link https://developer.android.com/google/play/billing/integrate#personalized-price}
1555
+ */
1556
+ isOfferPersonalized?: boolean;
1557
+ }
1558
+ interface AdaptyAndroidSubscriptionUpdateParameters {
1559
+ oldSubVendorProductId: string;
1560
+ prorationMode: AdaptyAndroidSubscriptionUpdateReplacementMode;
1561
+ /**
1562
+ * @deprecated Use {@link AdaptyAndroidPurchaseParams.isOfferPersonalized} instead.
1563
+ * This field has been moved to the upper level in the new structure.
1564
+ *
1565
+ * @example
1566
+ * // OLD (deprecated):
1567
+ * android: {
1568
+ * oldSubVendorProductId: 'old_product_id',
1569
+ * prorationMode: 'charge_prorated_price',
1570
+ * isOfferPersonalized: true // This field is deprecated
1571
+ * }
1572
+ *
1573
+ * // NEW:
1574
+ * android: {
1575
+ * subscriptionUpdateParams: {
1576
+ * oldSubVendorProductId: 'old_product_id',
1577
+ * prorationMode: 'charge_prorated_price'
1578
+ * },
1579
+ * isOfferPersonalized: true // Moved to upper level
1580
+ * }
1581
+ */
1582
+ isOfferPersonalized?: boolean;
1583
+ }
1584
+ type MakePurchaseParamsInput = {
1585
+ /**
1586
+ * Android purchase parameters
1587
+ * @platform android
1588
+ */
1589
+ android?: AdaptyAndroidPurchaseParams;
1590
+ } | {
1591
+ /**
1592
+ * @deprecated Use the new parameter structure instead
1593
+ *
1594
+ * @example
1595
+ * // OLD (deprecated):
1596
+ * makePurchase(product, {
1597
+ * android: {
1598
+ * oldSubVendorProductId: 'old_product_id',
1599
+ * prorationMode: 'charge_prorated_price',
1600
+ * isOfferPersonalized: true
1601
+ * }
1602
+ * });
1603
+ *
1604
+ * // NEW:
1605
+ * makePurchase(product, {
1606
+ * android: {
1607
+ * subscriptionUpdateParams: {
1608
+ * oldSubVendorProductId: 'old_product_id',
1609
+ * prorationMode: 'charge_prorated_price'
1610
+ * },
1611
+ * isOfferPersonalized: true, // Note: moved to upper level
1612
+ * }
1613
+ * });
1614
+ *
1615
+ * @platform android
1616
+ */
1617
+ android?: AdaptyAndroidSubscriptionUpdateParameters;
1618
+ };
1619
+ type FileLocation = {
1620
+ ios: {
1621
+ fileName: string;
1622
+ };
1623
+ android: {
1624
+ relativeAssetPath: string;
1625
+ } | {
1626
+ rawResName: string;
1627
+ };
1628
+ };
1629
+
1630
+ //#endregion
1631
+ //#region src/logger/types.d.ts
1632
+ //# sourceMappingURL=inputs.d.ts.map
1633
+ interface LogEvent {
1634
+ timestamp: string;
1635
+ version: string;
1636
+ level: LogLevel;
1637
+ funcName: string;
1638
+ message: string;
1639
+ params?: Record<string, any>;
1640
+ formatted: string;
1641
+ }
1642
+ interface LogSink {
1643
+ id: string;
1644
+ levels?: LogLevel[];
1645
+ handle: (event: LogEvent) => void;
1646
+ destroy?: () => void;
1647
+ }
1648
+ interface LoggerConfig {
1649
+ sinks?: LogSink[];
1650
+ defaultMeta?: Record<string, unknown>;
1651
+ }
1652
+
1653
+ //#endregion
1654
+ //#region src/logger/log.d.ts
1655
+ //# sourceMappingURL=types.d.ts.map
1656
+ type LazyMessage = () => string;
1657
+ type LazyParams = () => Record<string, any>;
1658
+ declare class Log {
1659
+ static logLevel: LogLevel | null;
1660
+ private static sinks;
1661
+ private static defaultMeta?;
1662
+ private static _version;
1663
+ /**
1664
+ * Override the version shown in log messages
1665
+ * @internal
1666
+ */
1667
+ static setVersion(version: string): void;
1668
+ private static formatMessage;
1669
+ /** Configure JS logger: replace sinks and/or set default metadata */
1670
+ static configure(config: LoggerConfig): void;
1671
+ /** Register additional sink */
1672
+ static addSink(sink: LogSink): void;
1673
+ /** Remove sink by id and call its destroy if present */
1674
+ static removeSink(id: string): void;
1675
+ /** Clear all sinks and destroy them */
1676
+ static clearSinks(): void;
1677
+ /**
1678
+ * Gets the appropriate log level integer for a log level.
1679
+ * @internal
1680
+ */
1681
+ private static getLogLevelInt;
1682
+ /**
1683
+ * Logs a message to the console if the log level is appropriate.
1684
+ * Uses lazy evaluation to avoid unnecessary computations.
1685
+ * @internal
1686
+ */
1687
+ static log(logLevel: LogLevel, funcName: string, message: LazyMessage, params?: LazyParams): void;
1688
+ static info(funcName: string, message: LazyMessage, params?: LazyParams): void;
1689
+ static warn(funcName: string, message: LazyMessage, params?: LazyParams): void;
1690
+ static error(funcName: string, message: LazyMessage, params?: LazyParams): void;
1691
+ static verbose(funcName: string, message: LazyMessage, params?: LazyParams): void;
1692
+ }
1693
+
1694
+ //#endregion
1695
+ //#region src/logger/console-sink.d.ts
1696
+ declare const consoleLogSink: LogSink;
1697
+
1698
+ //#endregion
1699
+ //#region src/types/api.d.ts
1700
+ //# sourceMappingURL=console-sink.d.ts.map
1701
+ /** OneOf type helpers */
1702
+ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
1703
+ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
1704
+ type OneOf<T extends any[]> = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR<A, B>, ...Rest]> : never;
1705
+ interface components {
1706
+ requests: {
1707
+ 'Activate.Request': {
1708
+ method: 'activate';
1709
+ configuration: components['defs']['AdaptyConfiguration'];
1710
+ };
1711
+ 'Activate.Response': OneOf<[{
1712
+ error: components['defs']['AdaptyError'];
1713
+ }, {
1714
+ success: true;
1715
+ }]>;
1716
+ 'AdaptyUICreatePaywallView.Request': {
1717
+ method: 'adapty_ui_create_paywall_view';
1718
+ paywall: components['defs']['AdaptyPaywall'];
1719
+ load_timeout?: number;
1720
+ preload_products?: boolean;
1721
+ custom_tags?: components['defs']['AdaptyUI.CustomTagsValues'];
1722
+ custom_timers?: components['defs']['AdaptyUI.CustomTimersValues'];
1723
+ custom_assets?: components['defs']['AdaptyUI.CustomAssets'];
1724
+ product_purchase_parameters?: components['defs']['AdaptyUI.ProductPurchaseParameters'];
1725
+ };
1726
+ 'AdaptyUICreatePaywallView.Response': OneOf<[{
1727
+ error: components['defs']['AdaptyError'];
1728
+ }, {
1729
+ success: components['defs']['AdaptyUI.PaywallView'];
1730
+ }]>;
1731
+ 'AdaptyUIDismissPaywallView.Request': {
1732
+ method: 'adapty_ui_dismiss_paywall_view';
1733
+ id: string;
1734
+ destroy?: boolean;
1735
+ };
1736
+ 'AdaptyUIDismissPaywallView.Response': OneOf<[{
1737
+ error: components['defs']['AdaptyError'];
1738
+ }, {
1739
+ success: true;
1740
+ }]>;
1741
+ 'AdaptyUIPresentPaywallView.Request': {
1742
+ method: 'adapty_ui_present_paywall_view';
1743
+ id: string;
1744
+ ios_presentation_style?: components['defs']['AdaptyUI.IOSPresentationStyle'];
1745
+ };
1746
+ 'AdaptyUIPresentPaywallView.Response': OneOf<[{
1747
+ error: components['defs']['AdaptyError'];
1748
+ }, {
1749
+ success: true;
1750
+ }]>;
1751
+ 'AdaptyUIShowDialog.Request': {
1752
+ method: 'adapty_ui_show_dialog';
1753
+ id: string;
1754
+ configuration: components['defs']['AdaptyUI.DialogConfiguration'];
1755
+ };
1756
+ 'AdaptyUIShowDialog.Response': OneOf<[{
1757
+ error: components['defs']['AdaptyError'];
1758
+ }, {
1759
+ success: components['defs']['AdaptyUI.DialogActionType'];
1760
+ }]>;
1761
+ 'AdaptyUICreateOnboardingView.Request': {
1762
+ method: 'adapty_ui_create_onboarding_view';
1763
+ onboarding: components['defs']['AdaptyOnboarding'];
1764
+ external_urls_presentation?: components['defs']['AdaptyWebPresentation'];
1765
+ };
1766
+ 'AdaptyUICreateOnboardingView.Response': OneOf<[{
1767
+ error: components['defs']['AdaptyError'];
1768
+ }, {
1769
+ success: components['defs']['AdaptyUI.OnboardingView'];
1770
+ }]>;
1771
+ 'AdaptyUIDismissOnboardingView.Request': {
1772
+ method: 'adapty_ui_dismiss_onboarding_view';
1773
+ id: string;
1774
+ destroy?: boolean;
1775
+ };
1776
+ 'AdaptyUIDismissOnboardingView.Response': OneOf<[{
1777
+ error: components['defs']['AdaptyError'];
1778
+ }, {
1779
+ success: true;
1780
+ }]>;
1781
+ 'AdaptyUIPresentOnboardingView.Request': {
1782
+ method: 'adapty_ui_present_onboarding_view';
1783
+ id: string;
1784
+ ios_presentation_style?: components['defs']['AdaptyUI.IOSPresentationStyle'];
1785
+ };
1786
+ 'AdaptyUIPresentOnboardingView.Response': OneOf<[{
1787
+ error: components['defs']['AdaptyError'];
1788
+ }, {
1789
+ success: true;
1790
+ }]>;
1791
+ 'GetPaywall.Request': {
1792
+ method: 'get_paywall';
1793
+ placement_id: string;
1794
+ locale?: components['defs']['AdaptyLocale'];
1795
+ fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy'];
1796
+ load_timeout?: number;
1797
+ };
1798
+ 'GetPaywall.Response': OneOf<[{
1799
+ error: components['defs']['AdaptyError'];
1800
+ }, {
1801
+ success: components['defs']['AdaptyPaywall'];
1802
+ }]>;
1803
+ 'GetPaywallForDefaultAudience.Request': {
1804
+ method: 'get_paywall_for_default_audience';
1805
+ placement_id: string;
1806
+ locale?: components['defs']['AdaptyLocale'];
1807
+ fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy'];
1808
+ };
1809
+ 'GetPaywallForDefaultAudience.Response': OneOf<[{
1810
+ error: components['defs']['AdaptyError'];
1811
+ }, {
1812
+ success: components['defs']['AdaptyPaywall'];
1813
+ }]>;
1814
+ 'GetPaywallProducts.Request': {
1815
+ method: 'get_paywall_products';
1816
+ paywall: components['defs']['AdaptyPaywall'];
1817
+ };
1818
+ 'GetPaywallProducts.Response': OneOf<[{
1819
+ error: components['defs']['AdaptyError'];
1820
+ }, {
1821
+ success: components['defs']['AdaptyPaywallProduct.Response'][];
1822
+ }]>;
1823
+ 'GetOnboarding.Request': {
1824
+ method: 'get_onboarding';
1825
+ placement_id: string;
1826
+ locale?: components['defs']['AdaptyLocale'];
1827
+ fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy'];
1828
+ load_timeout?: number;
1829
+ };
1830
+ 'GetOnboarding.Response': OneOf<[{
1831
+ error: components['defs']['AdaptyError'];
1832
+ }, {
1833
+ success: components['defs']['AdaptyOnboarding'];
1834
+ }]>;
1835
+ 'GetOnboardingForDefaultAudience.Request': {
1836
+ method: 'get_onboarding_for_default_audience';
1837
+ placement_id: string;
1838
+ locale?: components['defs']['AdaptyLocale'];
1839
+ fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy'];
1840
+ };
1841
+ 'GetOnboardingForDefaultAudience.Response': OneOf<[{
1842
+ error: components['defs']['AdaptyError'];
1843
+ }, {
1844
+ success: components['defs']['AdaptyOnboarding'];
1845
+ }]>;
1846
+ 'GetProfile.Request': {
1847
+ method: 'get_profile';
1848
+ };
1849
+ 'GetProfile.Response': OneOf<[{
1850
+ error: components['defs']['AdaptyError'];
1851
+ }, {
1852
+ success: components['defs']['AdaptyProfile'];
1853
+ }]>;
1854
+ 'Identify.Request': {
1855
+ method: 'identify';
1856
+ customer_user_id: string;
1857
+ parameters?: components['defs']['CustomerIdentityParameters'];
1858
+ };
1859
+ 'Identify.Response': OneOf<[{
1860
+ error: components['defs']['AdaptyError'];
1861
+ }, {
1862
+ success: true;
1863
+ }]>;
1864
+ 'IsActivated.Request': {
1865
+ method: 'is_activated';
1866
+ };
1867
+ 'IsActivated.Response': {
1868
+ success: boolean;
1869
+ };
1870
+ 'GetLogLevel.Request': {
1871
+ method: 'get_log_level';
1872
+ };
1873
+ 'GetLogLevel.Response': {
1874
+ success: components['defs']['AdaptyLog.Level'];
1875
+ };
1876
+ 'SetLogLevel.Request': {
1877
+ method: 'set_log_level';
1878
+ value: components['defs']['AdaptyLog.Level'];
1879
+ };
1880
+ 'SetLogLevel.Response': {
1881
+ success: true;
1882
+ };
1883
+ 'Logout.Request': {
1884
+ method: 'logout';
1885
+ };
1886
+ 'Logout.Response': OneOf<[{
1887
+ error: components['defs']['AdaptyError'];
1888
+ }, {
1889
+ success: true;
1890
+ }]>;
1891
+ 'LogShowPaywall.Request': {
1892
+ method: 'log_show_paywall';
1893
+ paywall: components['defs']['AdaptyPaywall'];
1894
+ };
1895
+ 'LogShowPaywall.Response': OneOf<[{
1896
+ error: components['defs']['AdaptyError'];
1897
+ }, {
1898
+ success: true;
1899
+ }]>;
1900
+ 'MakePurchase.Request': {
1901
+ method: 'make_purchase';
1902
+ product: components['defs']['AdaptyPaywallProduct.Request'];
1903
+ parameters?: components['defs']['AdaptyPurchaseParameters'];
1904
+ };
1905
+ 'MakePurchase.Response': OneOf<[{
1906
+ error: components['defs']['AdaptyError'];
1907
+ }, {
1908
+ success: components['defs']['AdaptyPurchaseResult'];
1909
+ }]>;
1910
+ 'OpenWebPaywall.Request': OneOf<[{
1911
+ method: 'open_web_paywall';
1912
+ product: components['defs']['AdaptyPaywallProduct.Request'];
1913
+ open_in?: components['defs']['AdaptyWebPresentation'];
1914
+ }, {
1915
+ method: 'open_web_paywall';
1916
+ paywall: components['defs']['AdaptyPaywall'];
1917
+ open_in?: components['defs']['AdaptyWebPresentation'];
1918
+ }]>;
1919
+ 'OpenWebPaywall.Response': OneOf<[{
1920
+ error: components['defs']['AdaptyError'];
1921
+ }, {
1922
+ success: true;
1923
+ }]>;
1924
+ 'CreateWebPaywallUrl.Request': OneOf<[{
1925
+ method: 'create_web_paywall_url';
1926
+ product: components['defs']['AdaptyPaywallProduct.Request'];
1927
+ }, {
1928
+ method: 'create_web_paywall_url';
1929
+ paywall: components['defs']['AdaptyPaywall'];
1930
+ }]>;
1931
+ 'CreateWebPaywallUrl.Response': OneOf<[{
1932
+ error: components['defs']['AdaptyError'];
1933
+ }, {
1934
+ success: string;
1935
+ }]>;
1936
+ 'PresentCodeRedemptionSheet.Request': {
1937
+ method: 'present_code_redemption_sheet';
1938
+ };
1939
+ 'PresentCodeRedemptionSheet.Response': {
1940
+ success: true;
1941
+ };
1942
+ 'ReportTransaction.Request': {
1943
+ method: 'report_transaction';
1944
+ transaction_id: string;
1945
+ variation_id?: string;
1946
+ };
1947
+ 'ReportTransaction.Response': OneOf<[{
1948
+ error: components['defs']['AdaptyError'];
1949
+ }, {
1950
+ success: true;
1951
+ }]>;
1952
+ 'RestorePurchases.Request': {
1953
+ method: 'restore_purchases';
1954
+ };
1955
+ 'RestorePurchases.Response': OneOf<[{
1956
+ error: components['defs']['AdaptyError'];
1957
+ }, {
1958
+ success: components['defs']['AdaptyProfile'];
1959
+ }]>;
1960
+ 'GetSDKVersion.Request': {
1961
+ method: 'get_sdk_version';
1962
+ };
1963
+ 'GetSDKVersion.Response': {
1964
+ success: string;
1965
+ };
1966
+ 'GetCurrentInstallationStatus.Request': {
1967
+ method: 'get_current_installation_status';
1968
+ };
1969
+ 'GetCurrentInstallationStatus.Response': OneOf<[{
1970
+ error: components['defs']['AdaptyError'];
1971
+ }, {
1972
+ success: components['defs']['AdaptyInstallationStatus'];
1973
+ }]>;
1974
+ 'SetFallback.Request': {
1975
+ method: 'set_fallback';
1976
+ } & OneOf<[{
1977
+ asset_id: string;
1978
+ }, {
1979
+ path: string;
1980
+ }]>;
1981
+ 'SetFallback.Response': OneOf<[{
1982
+ error: components['defs']['AdaptyError'];
1983
+ }, {
1984
+ success: true;
1985
+ }]>;
1986
+ 'SetIntegrationIdentifier.Request': {
1987
+ method: 'set_integration_identifiers';
1988
+ key_values: Record<string, string>;
1989
+ };
1990
+ 'SetIntegrationIdentifier.Response': OneOf<[{
1991
+ error: components['defs']['AdaptyError'];
1992
+ }, {
1993
+ success: true;
1994
+ }]>;
1995
+ 'UpdateAttributionData.Request': {
1996
+ method: 'update_attribution_data';
1997
+ attribution: string;
1998
+ source: string;
1999
+ };
2000
+ 'UpdateAttributionData.Response': OneOf<[{
2001
+ error: components['defs']['AdaptyError'];
2002
+ }, {
2003
+ success: true;
2004
+ }]>;
2005
+ 'UpdateCollectingRefundDataConsent.Request': {
2006
+ method: 'update_collecting_refund_data_consent';
2007
+ consent: boolean;
2008
+ };
2009
+ 'UpdateCollectingRefundDataConsent.Response': OneOf<[{
2010
+ error: components['defs']['AdaptyError'];
2011
+ }, {
2012
+ success: true;
2013
+ }]>;
2014
+ 'UpdateProfile.Request': {
2015
+ method: 'update_profile';
2016
+ params: components['defs']['AdaptyProfileParameters'];
2017
+ };
2018
+ 'UpdateProfile.Response': OneOf<[{
2019
+ error: components['defs']['AdaptyError'];
2020
+ }, {
2021
+ success: true;
2022
+ }]>;
2023
+ 'UpdateRefundPreference.Request': {
2024
+ method: 'update_refund_preference';
2025
+ refund_preference: components['defs']['AdaptyRefundPreference'];
2026
+ };
2027
+ 'UpdateRefundPreference.Response': OneOf<[{
2028
+ error: components['defs']['AdaptyError'];
2029
+ }, {
2030
+ success: true;
2031
+ }]>;
2032
+ };
2033
+ events: {
2034
+ 'Event.DidLoadLatestProfile': {
2035
+ id: 'did_load_latest_profile';
2036
+ profile: components['defs']['AdaptyProfile'];
2037
+ };
2038
+ 'Event.OnInstallationDetailsSuccess': {
2039
+ id: 'on_installation_details_success';
2040
+ details: components['defs']['AdaptyInstallationDetails'];
2041
+ };
2042
+ 'Event.OnInstallationDetailsFail': {
2043
+ id: 'on_installation_details_fail';
2044
+ error: components['defs']['AdaptyError'];
2045
+ };
2046
+ 'PaywallViewEvent.DidAppear': {
2047
+ id: 'paywall_view_did_appear';
2048
+ view: components['defs']['AdaptyUI.PaywallView'];
2049
+ };
2050
+ 'PaywallViewEvent.DidDisappear': {
2051
+ id: 'paywall_view_did_disappear';
2052
+ view: components['defs']['AdaptyUI.PaywallView'];
2053
+ };
2054
+ 'PaywallViewEvent.DidUserAction': {
2055
+ id: 'paywall_view_did_perform_action';
2056
+ view: components['defs']['AdaptyUI.PaywallView'];
2057
+ action: components['defs']['AdaptyUI.UserAction'];
2058
+ };
2059
+ 'PaywallViewEvent.DidSelectProduct': {
2060
+ id: 'paywall_view_did_select_product';
2061
+ view: components['defs']['AdaptyUI.PaywallView'];
2062
+ product_id: string;
2063
+ };
2064
+ 'PaywallViewEvent.WillPurchase': {
2065
+ id: 'paywall_view_did_start_purchase';
2066
+ view: components['defs']['AdaptyUI.PaywallView'];
2067
+ product: components['defs']['AdaptyPaywallProduct.Response'];
2068
+ };
2069
+ 'PaywallViewEvent.DidPurchase': {
2070
+ id: 'paywall_view_did_finish_purchase';
2071
+ view: components['defs']['AdaptyUI.PaywallView'];
2072
+ product: components['defs']['AdaptyPaywallProduct.Response'];
2073
+ purchased_result: components['defs']['AdaptyPurchaseResult'];
2074
+ };
2075
+ 'PaywallViewEvent.DidFailPurchase': {
2076
+ id: 'paywall_view_did_fail_purchase';
2077
+ view: components['defs']['AdaptyUI.PaywallView'];
2078
+ product: components['defs']['AdaptyPaywallProduct.Response'];
2079
+ error: components['defs']['AdaptyError'];
2080
+ };
2081
+ 'PaywallViewEvent.WillRestorePurchase': {
2082
+ id: 'paywall_view_did_start_restore';
2083
+ view: components['defs']['AdaptyUI.PaywallView'];
2084
+ };
2085
+ 'PaywallViewEvent.DidRestorePurchase': {
2086
+ id: 'paywall_view_did_finish_restore';
2087
+ view: components['defs']['AdaptyUI.PaywallView'];
2088
+ profile: components['defs']['AdaptyProfile'];
2089
+ };
2090
+ 'PaywallViewEvent.DidFailRestorePurchase': {
2091
+ id: 'paywall_view_did_fail_restore';
2092
+ view: components['defs']['AdaptyUI.PaywallView'];
2093
+ error: components['defs']['AdaptyError'];
2094
+ };
2095
+ 'PaywallViewEvent.DidFailRendering': {
2096
+ id: 'paywall_view_did_fail_rendering';
2097
+ view: components['defs']['AdaptyUI.PaywallView'];
2098
+ error: components['defs']['AdaptyError'];
2099
+ };
2100
+ 'PaywallViewEvent.DidFailLoadingProducts': {
2101
+ id: 'paywall_view_did_fail_loading_products';
2102
+ view: components['defs']['AdaptyUI.PaywallView'];
2103
+ error: components['defs']['AdaptyError'];
2104
+ };
2105
+ 'PaywallViewEvent.DidFinishWebPaymentNavigation': {
2106
+ id: 'paywall_view_did_finish_web_payment_navigation';
2107
+ view: components['defs']['AdaptyUI.PaywallView'];
2108
+ product?: components['defs']['AdaptyPaywallProduct.Response'];
2109
+ error?: components['defs']['AdaptyError'];
2110
+ };
2111
+ 'OnboardingViewEvent.DidFailWithError': {
2112
+ id: 'onboarding_did_fail_with_error';
2113
+ view: components['defs']['AdaptyUI.OnboardingView'];
2114
+ error: components['defs']['AdaptyError'];
2115
+ };
2116
+ 'OnboardingViewEvent.OnAnalyticsEvent': {
2117
+ id: 'onboarding_on_analytics_action';
2118
+ view: components['defs']['AdaptyUI.OnboardingView'];
2119
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2120
+ event: {
2121
+ name: 'onboarding_started' | 'screen_presented' | 'screen_completed' | 'second_screen_presented' | 'registration_screen_presented' | 'products_screen_presented' | 'user_email_collected' | 'onboarding_completed' | string;
2122
+ element_id?: string;
2123
+ reply?: string;
2124
+ };
2125
+ };
2126
+ 'OnboardingViewEvent.DidFinishLoading': {
2127
+ id: 'onboarding_did_finish_loading';
2128
+ view: components['defs']['AdaptyUI.OnboardingView'];
2129
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2130
+ };
2131
+ 'OnboardingViewEvent.OnCloseAction': {
2132
+ id: 'onboarding_on_close_action';
2133
+ view: components['defs']['AdaptyUI.OnboardingView'];
2134
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2135
+ action_id: string;
2136
+ };
2137
+ 'OnboardingViewEvent.OnCustomAction': {
2138
+ id: 'onboarding_on_custom_action';
2139
+ view: components['defs']['AdaptyUI.OnboardingView'];
2140
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2141
+ action_id: string;
2142
+ };
2143
+ 'OnboardingViewEvent.OnPaywallAction': {
2144
+ id: 'onboarding_on_paywall_action';
2145
+ view: components['defs']['AdaptyUI.OnboardingView'];
2146
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2147
+ action_id: string;
2148
+ };
2149
+ 'OnboardingViewEvent.OnStateUpdatedAction': {
2150
+ id: 'onboarding_on_state_updated_action';
2151
+ view: components['defs']['AdaptyUI.OnboardingView'];
2152
+ meta: components['defs']['AdaptyUI.OnboardingMeta'];
2153
+ action: {
2154
+ element_id: string;
2155
+ element_type: 'select';
2156
+ value: components['defs']['AdaptyUI.OnboardingsStateParams'];
2157
+ } | {
2158
+ element_id: string;
2159
+ element_type: 'multi_select';
2160
+ value: components['defs']['AdaptyUI.OnboardingsStateParams'][];
2161
+ } | {
2162
+ element_id: string;
2163
+ element_type: 'input';
2164
+ value: {
2165
+ type: 'text' | 'email';
2166
+ value: string;
2167
+ } | {
2168
+ type: 'number';
2169
+ value: number;
2170
+ };
2171
+ } | {
2172
+ element_id: string;
2173
+ element_type: 'date_picker';
2174
+ value: {
2175
+ day?: number;
2176
+ month?: number;
2177
+ year?: number;
2178
+ };
2179
+ };
2180
+ };
2181
+ };
2182
+ defs: {
2183
+ AdaptyError: {
2184
+ adapty_code: number;
2185
+ message: string;
2186
+ detail?: string;
2187
+ };
2188
+ 'AdaptyLog.Level': 'error' | 'warn' | 'info' | 'verbose' | 'debug';
2189
+ AdaptyLocale: string;
2190
+ Date: string;
2191
+ AdaptyConfiguration: {
2192
+ api_key: string;
2193
+ customer_user_id?: string;
2194
+ customer_identity_parameters?: components['defs']['CustomerIdentityParameters'];
2195
+ observer_mode?: boolean;
2196
+ apple_idfa_collection_disabled?: boolean;
2197
+ google_adid_collection_disabled?: boolean;
2198
+ google_enable_pending_prepaid_plans?: boolean;
2199
+ google_local_access_level_allowed?: boolean;
2200
+ ip_address_collection_disabled?: boolean;
2201
+ clear_data_on_backup?: boolean;
2202
+ server_cluster?: 'default' | 'eu' | 'cn';
2203
+ backend_proxy_host?: string;
2204
+ backend_proxy_port?: number;
2205
+ log_level?: components['defs']['AdaptyLog.Level'];
2206
+ cross_platform_sdk_name?: string;
2207
+ cross_platform_sdk_version?: string;
2208
+ activate_ui?: boolean;
2209
+ media_cache?: {
2210
+ memory_storage_total_cost_limit?: number;
2211
+ memory_storage_count_limit?: number;
2212
+ disk_storage_size_limit?: number;
2213
+ };
2214
+ };
2215
+ CustomerIdentityParameters: {
2216
+ app_account_token?: string;
2217
+ obfuscated_account_id?: string;
2218
+ obfuscated_profile_id?: string;
2219
+ };
2220
+ 'AdaptyPaywallProduct.Request': {
2221
+ vendor_product_id: string;
2222
+ adapty_product_id: string;
2223
+ access_level_id: string;
2224
+ product_type: string;
2225
+ paywall_product_index: number;
2226
+ subscription_offer_identifier?: components['defs']['AdaptySubscriptionOffer.Identifier'];
2227
+ paywall_variation_id: string;
2228
+ paywall_ab_test_name: string;
2229
+ paywall_name: string;
2230
+ web_purchase_url?: string;
2231
+ payload_data?: string;
2232
+ };
2233
+ 'AdaptyPaywallProduct.Response': {
2234
+ vendor_product_id: string;
2235
+ adapty_product_id: string;
2236
+ access_level_id: string;
2237
+ product_type: string;
2238
+ paywall_product_index: number;
2239
+ paywall_variation_id: string;
2240
+ paywall_ab_test_name: string;
2241
+ paywall_name: string;
2242
+ web_purchase_url?: string;
2243
+ localized_description: string;
2244
+ localized_title: string;
2245
+ is_family_shareable?: boolean;
2246
+ region_code?: string;
2247
+ price: components['defs']['AdaptyPrice'];
2248
+ subscription?: components['defs']['AdaptyPaywallProduct.Subscription'];
2249
+ payload_data?: string;
2250
+ };
2251
+ AdaptyPrice: {
2252
+ amount: number;
2253
+ currency_code?: string;
2254
+ currency_symbol?: string;
2255
+ localized_string?: string;
2256
+ };
2257
+ 'AdaptyPaywallProduct.Subscription': {
2258
+ group_identifier?: string;
2259
+ period: components['defs']['AdaptySubscriptionPeriod'];
2260
+ localized_period?: string;
2261
+ offer?: components['defs']['AdaptySubscriptionOffer'];
2262
+ renewal_type?: 'prepaid' | 'autorenewable';
2263
+ base_plan_id?: string;
2264
+ };
2265
+ AdaptySubscriptionOffer: {
2266
+ offer_identifier: components['defs']['AdaptySubscriptionOffer.Identifier'];
2267
+ phases: components['defs']['AdaptySubscriptionOffer.Phase'][];
2268
+ offer_tags?: string[];
2269
+ };
2270
+ 'AdaptySubscriptionOffer.Phase': {
2271
+ price: components['defs']['AdaptyPrice'];
2272
+ subscription_period: components['defs']['AdaptySubscriptionPeriod'];
2273
+ number_of_periods: number;
2274
+ payment_mode: components['defs']['AdaptySubscriptionOffer.PaymentMode'];
2275
+ localized_subscription_period?: string;
2276
+ localized_number_of_periods?: string;
2277
+ };
2278
+ AdaptyPlacement: {
2279
+ developer_id: string;
2280
+ ab_test_name: string;
2281
+ audience_name: string;
2282
+ revision: number;
2283
+ is_tracking_purchases?: boolean;
2284
+ placement_audience_version_id: string;
2285
+ };
2286
+ AdaptyPaywall: {
2287
+ placement: components['defs']['AdaptyPlacement'];
2288
+ paywall_id: string;
2289
+ paywall_name: string;
2290
+ variation_id: string;
2291
+ products: components['defs']['AdaptyPaywall.ProductReference'][];
2292
+ response_created_at: number;
2293
+ remote_config?: components['defs']['AdaptyRemoteConfig'];
2294
+ paywall_builder?: components['defs']['AdaptyPaywall.ViewConfiguration'];
2295
+ web_purchase_url?: string;
2296
+ payload_data?: string;
2297
+ request_locale: components['defs']['AdaptyLocale'];
2298
+ };
2299
+ AdaptyOnboarding: {
2300
+ placement: components['defs']['AdaptyPlacement'];
2301
+ onboarding_id: string;
2302
+ onboarding_name: string;
2303
+ variation_id: string;
2304
+ response_created_at: number;
2305
+ remote_config?: components['defs']['AdaptyRemoteConfig'];
2306
+ onboarding_builder?: {
2307
+ config_url: string;
2308
+ };
2309
+ payload_data?: string;
2310
+ request_locale: components['defs']['AdaptyLocale'];
2311
+ };
2312
+ AdaptyPlacementFetchPolicy: OneOf<[{
2313
+ type: 'reload_revalidating_cache_data' | 'return_cache_data_else_load';
2314
+ }, {
2315
+ type: 'return_cache_data_if_not_expired_else_load';
2316
+ max_age: number;
2317
+ }]>;
2318
+ AdaptyRemoteConfig: {
2319
+ lang: components['defs']['AdaptyLocale'];
2320
+ data: string;
2321
+ };
2322
+ 'AdaptyPaywall.ProductReference': {
2323
+ vendor_product_id: string;
2324
+ adapty_product_id: string;
2325
+ access_level_id: string;
2326
+ product_type: string;
2327
+ promotional_offer_id?: string;
2328
+ win_back_offer_id?: string;
2329
+ base_plan_id?: string;
2330
+ offer_id?: string;
2331
+ };
2332
+ 'AdaptyPaywall.ViewConfiguration': {
2333
+ paywall_builder_id: string;
2334
+ lang: components['defs']['AdaptyLocale'];
2335
+ };
2336
+ AdaptySubscriptionPeriod: {
2337
+ unit: components['defs']['AdaptySubscriptionPeriod.Unit'];
2338
+ number_of_units: number;
2339
+ };
2340
+ 'AdaptySubscriptionPeriod.Unit': 'day' | 'week' | 'month' | 'year' | 'unknown';
2341
+ AdaptyProfile: {
2342
+ profile_id: string;
2343
+ customer_user_id?: string;
2344
+ segment_hash: string;
2345
+ is_test_user: boolean;
2346
+ timestamp: number;
2347
+ custom_attributes?: components['defs']['AdaptyProfile.CustomAttributes'];
2348
+ paid_access_levels?: {
2349
+ [key: string]: components['defs']['AdaptyProfile.AccessLevel'];
2350
+ };
2351
+ subscriptions?: {
2352
+ [key: string]: components['defs']['AdaptyProfile.Subscription'];
2353
+ };
2354
+ non_subscriptions?: {
2355
+ [key: string]: components['defs']['AdaptyProfile.NonSubscription'][];
2356
+ };
2357
+ };
2358
+ 'AdaptyProfile.AccessLevel': {
2359
+ id: string;
2360
+ is_active: boolean;
2361
+ vendor_product_id: string;
2362
+ store: string;
2363
+ activated_at: components['defs']['Date'];
2364
+ renewed_at?: components['defs']['Date'];
2365
+ expires_at?: components['defs']['Date'];
2366
+ is_lifetime: boolean;
2367
+ active_introductory_offer_type?: string;
2368
+ active_promotional_offer_type?: string;
2369
+ active_promotional_offer_id?: string;
2370
+ offer_id?: string;
2371
+ will_renew: boolean;
2372
+ is_in_grace_period: boolean;
2373
+ unsubscribed_at?: components['defs']['Date'];
2374
+ billing_issue_detected_at?: components['defs']['Date'];
2375
+ starts_at?: components['defs']['Date'];
2376
+ cancellation_reason?: string;
2377
+ is_refund: boolean;
2378
+ };
2379
+ 'AdaptyProfile.NonSubscription': {
2380
+ purchase_id: string;
2381
+ store: string;
2382
+ vendor_product_id: string;
2383
+ vendor_transaction_id?: string;
2384
+ purchased_at: components['defs']['Date'];
2385
+ is_sandbox: boolean;
2386
+ is_refund: boolean;
2387
+ is_consumable: boolean;
2388
+ };
2389
+ 'AdaptyProfile.Subscription': {
2390
+ store: string;
2391
+ vendor_product_id: string;
2392
+ vendor_transaction_id: string;
2393
+ vendor_original_transaction_id: string;
2394
+ is_active: boolean;
2395
+ is_lifetime: boolean;
2396
+ activated_at: components['defs']['Date'];
2397
+ renewed_at?: components['defs']['Date'];
2398
+ expires_at?: components['defs']['Date'];
2399
+ starts_at?: components['defs']['Date'];
2400
+ unsubscribed_at?: components['defs']['Date'];
2401
+ billing_issue_detected_at?: components['defs']['Date'];
2402
+ is_in_grace_period: boolean;
2403
+ is_refund: boolean;
2404
+ is_sandbox: boolean;
2405
+ will_renew: boolean;
2406
+ active_introductory_offer_type?: string;
2407
+ active_promotional_offer_type?: string;
2408
+ active_promotional_offer_id?: string;
2409
+ offer_id?: string;
2410
+ cancellation_reason?: string;
2411
+ };
2412
+ 'AdaptyProfile.CustomAttributes': {
2413
+ [key: string]: string | number;
2414
+ };
2415
+ 'AdaptyProfile.Gender': 'f' | 'm' | 'o';
2416
+ AdaptyProfileParameters: {
2417
+ first_name?: string;
2418
+ last_name?: string;
2419
+ gender?: components['defs']['AdaptyProfile.Gender'];
2420
+ birthday?: string;
2421
+ email?: string;
2422
+ phone_number?: string;
2423
+ att_status?: number;
2424
+ custom_attributes?: components['defs']['AdaptyProfile.CustomAttributes'];
2425
+ analytics_disabled?: boolean;
2426
+ };
2427
+ 'AdaptySubscriptionOffer.Identifier': OneOf<[{
2428
+ type: 'introductory';
2429
+ id?: string;
2430
+ }, {
2431
+ type: 'promotional' | 'win_back';
2432
+ id: string;
2433
+ }]>;
2434
+ 'AdaptySubscriptionOffer.PaymentMode': 'pay_as_you_go' | 'pay_up_front' | 'free_trial' | 'unknown';
2435
+ AdaptyPurchaseResult: OneOf<[{
2436
+ type: 'pending' | 'user_cancelled';
2437
+ }, {
2438
+ type: 'success';
2439
+ profile: components['defs']['AdaptyProfile'];
2440
+ apple_jws_transaction?: string;
2441
+ google_purchase_token?: string;
2442
+ }]>;
2443
+ 'AdaptyUI.CustomAssets': (components['assets']['Color'] | components['assets']['ColorGradient'] | components['assets']['Image'] | components['assets']['Video'])[];
2444
+ 'AdaptyUI.PaywallView': {
2445
+ id: string;
2446
+ placement_id: string;
2447
+ variation_id: string;
2448
+ };
2449
+ 'AdaptyUI.OnboardingView': {
2450
+ id: string;
2451
+ placement_id: string;
2452
+ variation_id: string;
2453
+ };
2454
+ 'AdaptyUI.OnboardingMeta': {
2455
+ onboarding_id: string;
2456
+ screen_cid: string;
2457
+ screen_index: number;
2458
+ total_screens: number;
2459
+ };
2460
+ 'AdaptyUI.OnboardingsStateParams': {
2461
+ id: string;
2462
+ value: string;
2463
+ label: string;
2464
+ };
2465
+ 'AdaptyUI.UserAction': OneOf<[{
2466
+ type: 'close' | 'system_back';
2467
+ }, {
2468
+ type: 'open_url' | 'custom';
2469
+ value: string;
2470
+ }]>;
2471
+ 'AdaptyUI.CustomTagsValues': {
2472
+ [key: string]: string;
2473
+ };
2474
+ 'AdaptyUI.CustomTimersValues': {
2475
+ [key: string]: components['defs']['Date'];
2476
+ };
2477
+ 'AdaptyUI.ProductPurchaseParameters': {
2478
+ [key: string]: components['defs']['AdaptyPurchaseParameters'];
2479
+ };
2480
+ 'AdaptyUI.IOSPresentationStyle': 'full_screen' | 'page_sheet';
2481
+ AdaptyWebPresentation: 'browser_out_app' | 'browser_in_app';
2482
+ 'AdaptyUI.DialogConfiguration': {
2483
+ default_action_title: string;
2484
+ secondary_action_title?: string;
2485
+ title?: string;
2486
+ content?: string;
2487
+ };
2488
+ 'AdaptyUI.DialogActionType': 'primary' | 'secondary';
2489
+ AdaptyPurchaseParameters: {
2490
+ subscription_update_params?: components['defs']['AdaptySubscriptionUpdateParameters'];
2491
+ is_offer_personalized?: boolean;
2492
+ };
2493
+ AdaptySubscriptionUpdateParameters: {
2494
+ old_sub_vendor_product_id: string;
2495
+ replacement_mode: 'charge_full_price' | 'deferred' | 'without_proration' | 'charge_prorated_price' | 'with_time_proration';
2496
+ };
2497
+ AdaptyRefundPreference: 'no_preference' | 'grant' | 'decline';
2498
+ AdaptyInstallationStatus: OneOf<[{
2499
+ status: 'not_available' | 'not_determined';
2500
+ }, {
2501
+ status: 'determined';
2502
+ details: components['defs']['AdaptyInstallationDetails'];
2503
+ }]>;
2504
+ AdaptyInstallationDetails: {
2505
+ install_id?: string;
2506
+ install_time: components['defs']['Date'];
2507
+ app_launch_count: number;
2508
+ payload?: string;
2509
+ };
2510
+ };
2511
+ assets: {
2512
+ Color: {
2513
+ id: string;
2514
+ type: 'color';
2515
+ value: string; // Hex string: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$
2516
+ };
2517
+ ColorGradient: {
2518
+ id: string;
2519
+ type: 'linear-gradient';
2520
+ values: {
2521
+ color: string;
2522
+ p: number;
2523
+ }[];
2524
+ points: {
2525
+ x0: number;
2526
+ y0: number;
2527
+ x1: number;
2528
+ y1: number;
2529
+ };
2530
+ };
2531
+ Image: OneOf<[{
2532
+ id: string;
2533
+ type: 'image';
2534
+ value: string; // base64
2535
+ }, {
2536
+ id: string;
2537
+ type: 'image';
2538
+ asset_id: string;
2539
+ }, {
2540
+ id: string;
2541
+ type: 'image';
2542
+ path: string;
2543
+ }]>;
2544
+ Video: OneOf<[{
2545
+ id: string;
2546
+ type: 'video';
2547
+ asset_id: string;
2548
+ }, {
2549
+ id: string;
2550
+ type: 'video';
2551
+ path: string;
2552
+ }]>;
2553
+ };
2554
+ } //#endregion
2555
+ //#region src/types/schema.d.ts
2556
+ type Req = components['requests'];
2557
+ type Def = components['defs'];
2558
+ type Event = components['events'];
2559
+
2560
+ //#endregion
2561
+ //#region src/coders/types.d.ts
2562
+ type StrType<T> = T extends string ? 'string' : T extends Date ? 'string' : T extends boolean ? 'boolean' : T extends number ? 'number' : T extends any[] ? 'array' : 'object';
2563
+ interface Converter<Model = unknown, Serialized = any> {
2564
+ type?: 'data' | 'error';
2565
+ decode: (input: Serialized) => Model;
2566
+ encode: (value: Model) => Serialized;
2567
+ }
2568
+ interface PropertyMeta<Model = unknown, Key extends string | number | symbol = string> {
2569
+ converter?: Converter<NonNullable<Model>>;
2570
+ key: Key;
2571
+ required: undefined extends Model ? false : true;
2572
+ type: StrType<Model>;
2573
+ }
2574
+ type Properties<Model extends Record<string, any>, SerializableData = Record<string, unknown>> = { [K in keyof Omit<Required<Model>, 'ios' | 'android'>]: PropertyMeta<Model[K], keyof SerializableData> } & ('ios' extends keyof Model ? {
2575
+ ios: { [K in keyof Required<Required<Model>['ios']>]: PropertyMeta<Required<Model>['ios'][K], keyof SerializableData> };
2576
+ } : {}) & ('android' extends keyof Model ? {
2577
+ android: { [K in keyof Required<Required<Model>['android']>]: PropertyMeta<Required<Model>['android'][K], keyof SerializableData> };
2578
+ } : {});
2579
+
2580
+ //#endregion
2581
+ //#region src/coders/coder.d.ts
2582
+ //# sourceMappingURL=types.d.ts.map
2583
+ declare abstract class Coder<Model extends Record<string, any>, CodableModel extends Partial<Model>, Serializable extends Record<string, any> = Record<string, any>> implements Converter<CodableModel, Serializable> {
2584
+ protected readonly platform: IPlatformAdapter;
2585
+ protected abstract properties: Properties<CodableModel, Serializable>;
2586
+ constructor(platform?: IPlatformAdapter);
2587
+ encode(data: CodableModel): Serializable;
2588
+ decode(data: Serializable): CodableModel;
2589
+ protected isType(value: unknown, type: StrType<any>): boolean;
2590
+ private getNestedValue;
2591
+ private assignNestedValue;
2592
+ private encodeWithProperties;
2593
+ private decodeWithProperties;
2594
+ }
2595
+ declare abstract class SimpleCoder<Model extends Record<string, any>, Serializable extends Record<string, any> = Record<string, any>> extends Coder<Model, Model, Serializable> {}
2596
+
2597
+ //#endregion
2598
+ //#region src/coders/adapty-access-level.d.ts
2599
+ //# sourceMappingURL=coder.d.ts.map
2600
+ type Model$32 = AdaptyAccessLevel;
2601
+ type Serializable$33 = Def['AdaptyProfile.AccessLevel'];
2602
+ declare class AdaptyAccessLevelCoder extends SimpleCoder<Model$32, Serializable$33> {
2603
+ protected properties: Properties<Model$32, Serializable$33>;
2604
+ }
2605
+
2606
+ //#endregion
2607
+ //#region src/coders/adapty-configuration.d.ts
2608
+ type Model$31 = ActivateParamsInput;
2609
+ type Serializable$32 = Def['AdaptyConfiguration'];
2610
+ declare class AdaptyConfigurationCoder {
2611
+ private readonly platform;
2612
+ private readonly sdkMetadata;
2613
+ constructor(platform: IPlatformAdapter, sdkMetadata: ISdkMetadataAdapter);
2614
+ encode(apiKey: string, params: Model$31): Serializable$32;
2615
+ }
2616
+
2617
+ //#endregion
2618
+ //#region src/coders/adapty-discount-phase.d.ts
2619
+ type Model$30 = AdaptyDiscountPhase;
2620
+ type Serializable$31 = Def['AdaptySubscriptionOffer.Phase'];
2621
+ declare class AdaptyDiscountPhaseCoder extends SimpleCoder<Model$30, Serializable$31> {
2622
+ protected properties: Properties<Model$30, Serializable$31>;
2623
+ }
2624
+
2625
+ //#endregion
2626
+ //#region src/coders/adapty-identify-params.d.ts
2627
+ type Model$29 = IdentifyParamsInput;
2628
+ type Serializable$30 = {
2629
+ app_account_token?: string;
2630
+ obfuscated_account_id?: string;
2631
+ obfuscated_profile_id?: string;
2632
+ };
2633
+ declare class AdaptyIdentifyParamsCoder {
2634
+ private readonly platform;
2635
+ constructor(platform: IPlatformAdapter);
2636
+ encode(params?: Model$29): Serializable$30 | undefined;
2637
+ }
2638
+
2639
+ //#endregion
2640
+ //#region src/coders/adapty-installation-details.d.ts
2641
+ declare class AdaptyInstallationDetailsCoder implements Converter<AdaptyInstallationDetails, Def['AdaptyInstallationDetails']> {
2642
+ encode(model: AdaptyInstallationDetails): Def['AdaptyInstallationDetails'];
2643
+ decode(json: Def['AdaptyInstallationDetails']): AdaptyInstallationDetails;
2644
+ }
2645
+
2646
+ //#endregion
2647
+ //#region src/coders/adapty-installation-status.d.ts
2648
+ //# sourceMappingURL=adapty-installation-details.d.ts.map
2649
+ declare class AdaptyInstallationStatusCoder implements Converter<AdaptyInstallationStatus, Def['AdaptyInstallationStatus']> {
2650
+ encode(model: AdaptyInstallationStatus): Def['AdaptyInstallationStatus'];
2651
+ decode(json: Def['AdaptyInstallationStatus']): AdaptyInstallationStatus;
2652
+ }
2653
+
2654
+ //#endregion
2655
+ //#region src/types/bridge.d.ts
2656
+ //# sourceMappingURL=adapty-installation-status.d.ts.map
2657
+ /**
2658
+ * Valid list of callable bridge handlers
2659
+ * Must be the same as
2660
+ * - iOS RNAConstants.MethodName
2661
+ * @internal
2662
+ */
2663
+ declare const MethodNames: readonly ["activate", "adapty_ui_activate", "adapty_ui_create_paywall_view", "adapty_ui_dismiss_paywall_view", "adapty_ui_present_paywall_view", "adapty_ui_show_dialog", "adapty_ui_create_onboarding_view", "adapty_ui_dismiss_onboarding_view", "adapty_ui_present_onboarding_view", "create_web_paywall_url", "get_current_installation_status", "is_activated", "get_paywall", "get_paywall_for_default_audience", "get_paywall_products", "get_onboarding", "get_onboarding_for_default_audience", "get_profile", "identify", "log_show_paywall", "logout", "make_purchase", "open_web_paywall", "present_code_redemption_sheet", "report_transaction", "restore_purchases", "set_fallback", "set_integration_identifiers", "set_log_level", "update_attribution_data", "update_collecting_refund_data_consent", "update_profile", "update_refund_preference"];
2664
+ type MethodName = (typeof MethodNames)[number];
2665
+ /**
2666
+ * Types of values that can be passed
2667
+ * to the bridge without corruption
2668
+ */
2669
+ type Serializable$1 = string | number | boolean | string[] | null | undefined;
2670
+ /**
2671
+ * Interface of error that emit from native SDK
2672
+ */
2673
+ interface AdaptyNativeError {
2674
+ adaptyCode: number;
2675
+ message: string;
2676
+ detail?: string | undefined;
2677
+ }
2678
+ /**
2679
+ * Interface of error that was raised by native bridge
2680
+ */
2681
+ interface AdaptyBridgeError {
2682
+ errorType: string;
2683
+ name?: string;
2684
+ type?: string;
2685
+ underlyingError?: string;
2686
+ description?: string;
2687
+ }
2688
+ interface EventMap {
2689
+ onLatestProfileLoad: string;
2690
+ onInstallationDetailsSuccess: string;
2691
+ onInstallationDetailsFail: string;
2692
+ }
2693
+ type UserEventName = keyof EventMap;
2694
+
2695
+ //#endregion
2696
+ //#region src/coders/error-coder.d.ts
2697
+ interface ErrorConverter<Model extends Record<string, any>> extends Converter<Model, any> {
2698
+ type: 'error';
2699
+ getError: (data: Model) => AdaptyError;
2700
+ }
2701
+
2702
+ //#endregion
2703
+ //#region src/coders/adapty-native-error.d.ts
2704
+ //# sourceMappingURL=error-coder.d.ts.map
2705
+ type Model$28 = AdaptyNativeError;
2706
+ type Serializable$29 = Def['AdaptyError'];
2707
+ declare class AdaptyNativeErrorCoder extends SimpleCoder<Model$28, Serializable$29> implements ErrorConverter<Model$28> {
2708
+ type: 'error';
2709
+ protected properties: Properties<Model$28, Serializable$29>;
2710
+ getError(data: Model$28): AdaptyError;
2711
+ }
2712
+
2713
+ //#endregion
2714
+ //#region src/coders/adapty-non-subscription.d.ts
2715
+ type Model$27 = AdaptyNonSubscription;
2716
+ type Serializable$28 = Def['AdaptyProfile.NonSubscription'];
2717
+ declare class AdaptyNonSubscriptionCoder extends SimpleCoder<Model$27, Serializable$28> {
2718
+ protected properties: Properties<Model$27, Serializable$28>;
2719
+ }
2720
+
2721
+ //#endregion
2722
+ //#region src/coders/adapty-onboarding-builder.d.ts
2723
+ type Model$26 = AdaptyOnboardingBuilder;
2724
+ type Serializable$27 = Required<Def['AdaptyOnboarding']>['onboarding_builder'];
2725
+ declare class AdaptyOnboardingBuilderCoder extends SimpleCoder<Model$26, Serializable$27> {
2726
+ protected properties: Properties<Model$26, Serializable$27>;
2727
+ }
2728
+
2729
+ //#endregion
2730
+ //#region src/coders/adapty-onboarding.d.ts
2731
+ type Model$25 = AdaptyOnboarding;
2732
+ type CodableModel$3 = Omit<Model$25, 'hasViewConfiguration'>;
2733
+ type Serializable$26 = Def['AdaptyOnboarding'];
2734
+ declare class AdaptyOnboardingCoder extends Coder<Model$25, CodableModel$3, Serializable$26> {
2735
+ protected properties: Properties<CodableModel$3, Serializable$26>;
2736
+ decode(data: Serializable$26): Model$25;
2737
+ encode(data: Model$25): Serializable$26;
2738
+ }
2739
+
2740
+ //#endregion
2741
+ //#region src/coders/adapty-paywall-builder.d.ts
2742
+ type Model$24 = AdaptyPaywallBuilder;
2743
+ type Serializable$25 = Required<Def['AdaptyPaywall']>['paywall_builder'];
2744
+ declare class AdaptyPaywallBuilderCoder extends SimpleCoder<Model$24, Serializable$25> {
2745
+ protected properties: Properties<Model$24, Serializable$25>;
2746
+ }
2747
+
2748
+ //#endregion
2749
+ //#region src/coders/adapty-paywall-product.d.ts
2750
+ type Model$23 = AdaptyPaywallProduct;
2751
+ type Serializable$24 = Def['AdaptyPaywallProduct.Response'];
2752
+ declare class AdaptyPaywallProductCoder extends SimpleCoder<Model$23, Serializable$24> {
2753
+ protected properties: Properties<Model$23, Serializable$24>;
2754
+ getInput(data: Serializable$24): Def['AdaptyPaywallProduct.Request'];
2755
+ }
2756
+
2757
+ //#endregion
2758
+ //#region src/coders/adapty-paywall.d.ts
2759
+ type Model$22 = AdaptyPaywall;
2760
+ type CodableModel$2 = Omit<Model$22, 'hasViewConfiguration' | 'productIdentifiers'>;
2761
+ type Serializable$23 = Def['AdaptyPaywall'];
2762
+ declare class AdaptyPaywallCoder extends Coder<Model$22, CodableModel$2, Serializable$23> {
2763
+ protected properties: Properties<CodableModel$2, Serializable$23>;
2764
+ decode(data: Serializable$23): Model$22;
2765
+ encode(data: Model$22): Serializable$23;
2766
+ }
2767
+
2768
+ //#endregion
2769
+ //#region src/coders/adapty-placement.d.ts
2770
+ type Model$21 = AdaptyPlacement;
2771
+ type Serializable$22 = Def['AdaptyPlacement'];
2772
+ declare class AdaptyPlacementCoder extends SimpleCoder<Model$21, Serializable$22> {
2773
+ protected properties: Properties<Model$21, Serializable$22>;
2774
+ }
2775
+
2776
+ //#endregion
2777
+ //#region src/coders/adapty-price.d.ts
2778
+ type Model$20 = AdaptyPrice;
2779
+ type Serializable$21 = Def['AdaptyPrice'];
2780
+ declare class AdaptyPriceCoder extends SimpleCoder<Model$20, Serializable$21> {
2781
+ protected properties: Properties<Model$20, Serializable$21>;
2782
+ }
2783
+
2784
+ //#endregion
2785
+ //#region src/coders/adapty-profile-parameters.d.ts
2786
+ type Model$19 = AdaptyProfileParameters;
2787
+ type Serializable$20 = Def['AdaptyProfileParameters'];
2788
+ declare class AdaptyProfileParametersCoder extends SimpleCoder<Model$19, Serializable$20> {
2789
+ protected properties: Properties<Model$19, Serializable$20>;
2790
+ }
2791
+
2792
+ //#endregion
2793
+ //#region src/coders/adapty-profile.d.ts
2794
+ type Model$18 = AdaptyProfile;
2795
+ type Serializable$19 = Def['AdaptyProfile'];
2796
+ declare class AdaptyProfileCoder extends SimpleCoder<Model$18, Serializable$19> {
2797
+ protected properties: Properties<Model$18, Serializable$19>;
2798
+ }
2799
+
2800
+ //#endregion
2801
+ //#region src/coders/adapty-purchase-params.d.ts
2802
+ type Model$17 = MakePurchaseParamsInput;
2803
+ type Serializable$18 = Record<string, any>;
2804
+ declare class AdaptyPurchaseParamsCoder {
2805
+ private readonly platform;
2806
+ constructor(platform: IPlatformAdapter);
2807
+ encode(data: Model$17): Serializable$18;
2808
+ }
2809
+
2810
+ //#endregion
2811
+ //#region src/coders/adapty-purchase-result.d.ts
2812
+ type Model$16 = AdaptyPurchaseResult;
2813
+ type Serializable$17 = Def['AdaptyPurchaseResult'];
2814
+ declare class AdaptyPurchaseResultCoder extends SimpleCoder<Model$16, Serializable$17> {
2815
+ protected properties: Properties<Model$16, Serializable$17>;
2816
+ decode(data: Serializable$17): Model$16;
2817
+ encode(data: Model$16): Serializable$17;
2818
+ }
2819
+
2820
+ //#endregion
2821
+ //#region src/coders/adapty-remote-config.d.ts
2822
+ type Model$15 = AdaptyRemoteConfig;
2823
+ type CodableModel$1 = Omit<Model$15, 'dataString'>;
2824
+ type Serializable$16 = Required<Def['AdaptyPaywall']>['remote_config'];
2825
+ declare class AdaptyRemoteConfigCoder extends Coder<Model$15, CodableModel$1, Serializable$16> {
2826
+ protected properties: Properties<CodableModel$1, Serializable$16>;
2827
+ decode(data: Serializable$16): Model$15;
2828
+ encode(data: Model$15): Serializable$16;
2829
+ }
2830
+
2831
+ //#endregion
2832
+ //#region src/coders/adapty-subscription-details.d.ts
2833
+ type Model$14 = AdaptySubscriptionDetails;
2834
+ type Serializable$15 = Def['AdaptyPaywallProduct.Subscription'];
2835
+ declare class AdaptySubscriptionDetailsCoder extends SimpleCoder<Model$14, Serializable$15> {
2836
+ protected properties: Properties<Model$14, Serializable$15>;
2837
+ decode(data: Serializable$15): Model$14;
2838
+ }
2839
+
2840
+ //#endregion
2841
+ //#region src/coders/adapty-subscription-offer-identifier.d.ts
2842
+ type Model$13 = AdaptySubscriptionOfferId;
2843
+ type Serializable$14 = Def['AdaptySubscriptionOffer.Identifier'];
2844
+ declare class AdaptySubscriptionOfferIdCoder extends SimpleCoder<Model$13, Serializable$14> {
2845
+ protected properties: Properties<Model$13, Serializable$14>;
2846
+ }
2847
+
2848
+ //#endregion
2849
+ //#region src/coders/adapty-subscription-offer.d.ts
2850
+ type Model$12 = AdaptySubscriptionOffer;
2851
+ type Serializable$13 = Def['AdaptySubscriptionOffer'];
2852
+ declare class AdaptySubscriptionOfferCoder extends SimpleCoder<Model$12, Serializable$13> {
2853
+ protected properties: Properties<Model$12, Serializable$13>;
2854
+ decode(data: Serializable$13): Model$12;
2855
+ }
2856
+
2857
+ //#endregion
2858
+ //#region src/coders/adapty-subscription-period.d.ts
2859
+ type Model$11 = AdaptySubscriptionPeriod;
2860
+ type Serializable$12 = Def['AdaptySubscriptionPeriod'];
2861
+ declare class AdaptySubscriptionPeriodCoder extends SimpleCoder<Model$11, Serializable$12> {
2862
+ protected properties: Properties<Model$11, Serializable$12>;
2863
+ }
2864
+
2865
+ //#endregion
2866
+ //#region src/coders/adapty-subscription.d.ts
2867
+ type Model$10 = AdaptySubscription;
2868
+ type Serializable$11 = Def['AdaptyProfile.Subscription'];
2869
+ declare class AdaptySubscriptionCoder extends SimpleCoder<Model$10, Serializable$11> {
2870
+ protected properties: Properties<Model$10, Serializable$11>;
2871
+ }
2872
+
2873
+ //#endregion
2874
+ //#region src/coders/adapty-ui-dialog-config.d.ts
2875
+ type Model$9 = AdaptyUiDialogConfig;
2876
+ type Serializable$10 = Def['AdaptyUI.DialogConfiguration'];
2877
+ declare class AdaptyUiDialogConfigCoder extends SimpleCoder<Model$9, Serializable$10> {
2878
+ protected properties: Properties<Model$9, Serializable$10>;
2879
+ }
2880
+
2881
+ //#endregion
2882
+ //#region src/coders/adapty-ui-create-onboarding-view-params.d.ts
2883
+ type Serializable$9 = Pick<Req['AdaptyUICreateOnboardingView.Request'], 'external_urls_presentation'>;
2884
+ declare class AdaptyUICreateOnboardingViewParamsCoder {
2885
+ encode(data: CreateOnboardingViewParamsInput): Serializable$9;
2886
+ }
2887
+
2888
+ //#endregion
2889
+ //#region src/coders/adapty-ui-create-paywall-view-params.d.ts
2890
+ type Model$8 = CreatePaywallViewParamsInput;
2891
+ type Serializable$8 = {
2892
+ preload_products?: boolean;
2893
+ load_timeout?: number;
2894
+ custom_tags?: Def['AdaptyUI.CustomTagsValues'];
2895
+ custom_timers?: Def['AdaptyUI.CustomTimersValues'];
2896
+ custom_assets?: Def['AdaptyUI.CustomAssets'];
2897
+ product_purchase_parameters?: Def['AdaptyUI.ProductPurchaseParameters'];
2898
+ };
2899
+ declare class AdaptyUICreatePaywallViewParamsCoder {
2900
+ private readonly platform;
2901
+ constructor(platform: IPlatformAdapter);
2902
+ encode(data: Model$8): Serializable$8;
2903
+ private encodeCustomTimers;
2904
+ private encodeCustomAssets;
2905
+ private encodeProductPurchaseParams;
2906
+ }
2907
+
2908
+ //#endregion
2909
+ //#region src/coders/adapty-ui-media-cache.d.ts
2910
+ type Model$7 = AdaptyUiMediaCache;
2911
+ type Serializable$7 = Required<Def['AdaptyConfiguration']>['media_cache'];
2912
+ declare class AdaptyUiMediaCacheCoder extends SimpleCoder<Model$7, Serializable$7> {
2913
+ protected properties: Properties<Model$7, Serializable$7>;
2914
+ }
2915
+
2916
+ //#endregion
2917
+ //#region src/coders/adapty-ui-onboarding-meta.d.ts
2918
+ type Model$6 = AdaptyUiOnboardingMeta;
2919
+ type Serializable$6 = Def['AdaptyUI.OnboardingMeta'];
2920
+ declare class AdaptyUiOnboardingMetaCoder extends SimpleCoder<Model$6, Serializable$6> {
2921
+ protected properties: Properties<Model$6, Serializable$6>;
2922
+ }
2923
+
2924
+ //#endregion
2925
+ //#region src/coders/adapty-ui-onboarding-state-params.d.ts
2926
+ type Model$5 = AdaptyUiOnboardingStateParams;
2927
+ type Serializable$5 = Def['AdaptyUI.OnboardingsStateParams'];
2928
+ declare class AdaptyUiOnboardingStateParamsCoder extends SimpleCoder<Model$5, Serializable$5> {
2929
+ protected properties: Properties<Model$5, Serializable$5>;
2930
+ }
2931
+
2932
+ //#endregion
2933
+ //#region src/coders/adapty-ui-onboarding-state-updated-action.d.ts
2934
+ type Model$4 = OnboardingStateUpdatedAction;
2935
+ type BaseModel = Omit<Model$4, 'value'>;
2936
+ type Serializable$4 = Event['OnboardingViewEvent.OnStateUpdatedAction']['action'];
2937
+ declare class AdaptyUiOnboardingStateUpdatedActionCoder extends SimpleCoder<BaseModel, Serializable$4> {
2938
+ private readonly paramCoder;
2939
+ protected properties: Properties<BaseModel, Serializable$4>;
2940
+ decode(data: Serializable$4): OnboardingStateUpdatedAction;
2941
+ encode(data: OnboardingStateUpdatedAction): Serializable$4;
2942
+ }
2943
+
2944
+ //#endregion
2945
+ //#region src/coders/array.d.ts
2946
+ declare class ArrayCoder<Model, Serializable> implements Converter<Model[], Serializable[]> {
2947
+ private readonly coderFactory;
2948
+ constructor(coderFactory: () => Converter<Model, Serializable>);
2949
+ decode(input: Serializable[]): Model[];
2950
+ encode(value: Model[]): Serializable[];
2951
+ }
2952
+
2953
+ //#endregion
2954
+ //#region src/coders/bridge-error.d.ts
2955
+ //# sourceMappingURL=array.d.ts.map
2956
+ type Model$3 = AdaptyBridgeError;
2957
+ type Serializable$3 = Record<string, any>;
2958
+ declare class BridgeErrorCoder extends SimpleCoder<Model$3, Serializable$3> implements ErrorConverter<Model$3> {
2959
+ type: 'error';
2960
+ protected properties: Properties<Model$3, Serializable$3>;
2961
+ getError(data: Model$3): AdaptyError;
2962
+ }
2963
+
2964
+ //#endregion
2965
+ //#region src/coders/date.d.ts
2966
+ /**
2967
+ * Format: yyyy-MM-dd'T'HH:mm:ss.SSSZ
2968
+ * OpenAPI: Output.Date
2969
+ */
2970
+ declare class DateCoder implements Converter<Date, string> {
2971
+ decode(input: string): Date;
2972
+ encode(value: Date): string;
2973
+ }
2974
+
2975
+ //#endregion
2976
+ //#region src/coders/hashmap.d.ts
2977
+ //# sourceMappingURL=date.d.ts.map
2978
+ declare class HashmapCoder<T extends Converter<any, any>> implements Converter<Record<string, any>, Record<string, any>> {
2979
+ private coder;
2980
+ constructor(coder: T | null);
2981
+ decode(input: Record<string, any>): Record<string, any>;
2982
+ encode(value: Record<string, any>): Record<string, unknown>;
2983
+ }
2984
+
2985
+ //#endregion
2986
+ //#region src/coders/json.d.ts
2987
+ //# sourceMappingURL=hashmap.d.ts.map
2988
+ type Model$2 = any;
2989
+ type Serialized$1 = string;
2990
+ declare class JSONCoder implements Converter<Model$2, Serialized$1> {
2991
+ decode(input: Serialized$1): Model$2;
2992
+ encode(value: Model$2): Serialized$1;
2993
+ }
2994
+
2995
+ //#endregion
2996
+ //#region src/coders/product-reference.d.ts
2997
+ type Model$1 = ProductReference;
2998
+ type Serializable$2 = Def['AdaptyPaywall.ProductReference'];
2999
+ declare class ProductReferenceCoder extends SimpleCoder<Model$1, Serializable$2> {
3000
+ protected properties: Properties<Model$1, Serializable$2>;
3001
+ }
3002
+
3003
+ //#endregion
3004
+ //#region src/coders/factory.d.ts
3005
+ /**
3006
+ * Dependencies container for coders
3007
+ */
3008
+ interface CoderDependencies {
3009
+ platform: IPlatformAdapter;
3010
+ sdkMetadata: ISdkMetadataAdapter;
3011
+ logger?: ILoggerAdapter;
3012
+ }
3013
+ /**
3014
+ * Factory for creating coders with injected dependencies
3015
+ */
3016
+ declare class CoderFactory {
3017
+ private readonly deps;
3018
+ constructor(deps: CoderDependencies);
3019
+ createAccessLevelCoder(): AdaptyAccessLevelCoder;
3020
+ createConfigurationCoder(): AdaptyConfigurationCoder;
3021
+ createDateCoder(): DateCoder;
3022
+ createDiscountPhaseCoder(): AdaptyDiscountPhaseCoder;
3023
+ createPurchaseParamsCoder(): AdaptyPurchaseParamsCoder;
3024
+ createPurchaseResultCoder(): AdaptyPurchaseResultCoder;
3025
+ createIdentifyParamsCoder(): AdaptyIdentifyParamsCoder;
3026
+ createInstallationDetailsCoder(): AdaptyInstallationDetailsCoder;
3027
+ createInstallationStatusCoder(): AdaptyInstallationStatusCoder;
3028
+ createJsonCoder(): JSONCoder;
3029
+ createNativeErrorCoder(): AdaptyNativeErrorCoder;
3030
+ createNonSubscriptionCoder(): AdaptyNonSubscriptionCoder;
3031
+ createOnboardingBuilderCoder(): AdaptyOnboardingBuilderCoder;
3032
+ createOnboardingCoder(): AdaptyOnboardingCoder;
3033
+ createPaywallBuilderCoder(): AdaptyPaywallBuilderCoder;
3034
+ createPaywallCoder(): AdaptyPaywallCoder;
3035
+ createPaywallProductCoder(): AdaptyPaywallProductCoder;
3036
+ createPlacementCoder(): AdaptyPlacementCoder;
3037
+ createPriceCoder(): AdaptyPriceCoder;
3038
+ createProductReferenceCoder(): ProductReferenceCoder;
3039
+ createProfileCoder(): AdaptyProfileCoder;
3040
+ createProfileParametersCoder(): AdaptyProfileParametersCoder;
3041
+ createRemoteConfigCoder(): AdaptyRemoteConfigCoder;
3042
+ createSubscriptionCoder(): AdaptySubscriptionCoder;
3043
+ createSubscriptionDetailsCoder(): AdaptySubscriptionDetailsCoder;
3044
+ createSubscriptionOfferCoder(): AdaptySubscriptionOfferCoder;
3045
+ createSubscriptionOfferIdCoder(): AdaptySubscriptionOfferIdCoder;
3046
+ createSubscriptionPeriodCoder(): AdaptySubscriptionPeriodCoder;
3047
+ createUiCreateOnboardingViewParamsCoder(): AdaptyUICreateOnboardingViewParamsCoder;
3048
+ createUiCreatePaywallViewParamsCoder(): AdaptyUICreatePaywallViewParamsCoder;
3049
+ createUiDialogConfigCoder(): AdaptyUiDialogConfigCoder;
3050
+ createUiMediaCacheCoder(): AdaptyUiMediaCacheCoder;
3051
+ createUiOnboardingMetaCoder(): AdaptyUiOnboardingMetaCoder;
3052
+ createUiOnboardingStateParamsCoder(): AdaptyUiOnboardingStateParamsCoder;
3053
+ createUiOnboardingStateUpdatedActionCoder(): AdaptyUiOnboardingStateUpdatedActionCoder;
3054
+ createBridgeErrorCoder(): BridgeErrorCoder;
3055
+ createArrayCoder<Model, Serializable>(coderFactory: () => Converter<Model, Serializable>): ArrayCoder<Model, Serializable>;
3056
+ createPaywallProductArrayCoder(): ArrayCoder<any, any>;
3057
+ createHashmapCoder<T extends Converter<any, any>>(coder: T | null): HashmapCoder<T>;
3058
+ }
3059
+
3060
+ //#endregion
3061
+ //#region src/types/paywall-events.d.ts
3062
+ //# sourceMappingURL=factory.d.ts.map
3063
+ declare const PaywallEventId: {
3064
+ readonly DidAppear: "paywall_view_did_appear";
3065
+ readonly DidDisappear: "paywall_view_did_disappear";
3066
+ readonly DidPerformAction: "paywall_view_did_perform_action";
3067
+ readonly DidSelectProduct: "paywall_view_did_select_product";
3068
+ readonly DidStartPurchase: "paywall_view_did_start_purchase";
3069
+ readonly DidFinishPurchase: "paywall_view_did_finish_purchase";
3070
+ readonly DidFailPurchase: "paywall_view_did_fail_purchase";
3071
+ readonly DidStartRestore: "paywall_view_did_start_restore";
3072
+ readonly DidFinishRestore: "paywall_view_did_finish_restore";
3073
+ readonly DidFailRestore: "paywall_view_did_fail_restore";
3074
+ readonly DidFailRendering: "paywall_view_did_fail_rendering";
3075
+ readonly DidFailLoadingProducts: "paywall_view_did_fail_loading_products";
3076
+ readonly DidFinishWebPaymentNavigation: "paywall_view_did_finish_web_payment_navigation";
3077
+ };
3078
+ type PaywallEventIdType = (typeof PaywallEventId)[keyof typeof PaywallEventId];
3079
+ interface PaywallEventView {
3080
+ id: string;
3081
+ placementId?: string;
3082
+ variationId?: string;
3083
+ }
3084
+ interface BasePaywallEvent {
3085
+ id: PaywallEventIdType;
3086
+ view: PaywallEventView;
3087
+ }
3088
+ interface PaywallDidAppearEvent extends BasePaywallEvent {
3089
+ id: typeof PaywallEventId.DidAppear;
3090
+ }
3091
+ interface PaywallDidDisappearEvent extends BasePaywallEvent {
3092
+ id: typeof PaywallEventId.DidDisappear;
3093
+ }
3094
+ interface PaywallDidPerformActionEvent extends BasePaywallEvent {
3095
+ id: typeof PaywallEventId.DidPerformAction;
3096
+ action: {
3097
+ type: 'close' | 'system_back' | 'open_url' | 'custom';
3098
+ value?: string;
3099
+ };
3100
+ }
3101
+ interface PaywallDidSelectProductEvent extends BasePaywallEvent {
3102
+ id: typeof PaywallEventId.DidSelectProduct;
3103
+ productId: string;
3104
+ }
3105
+ interface PaywallDidStartPurchaseEvent extends BasePaywallEvent {
3106
+ id: typeof PaywallEventId.DidStartPurchase;
3107
+ product: AdaptyPaywallProduct;
3108
+ }
3109
+ interface PaywallDidFinishPurchaseEvent extends BasePaywallEvent {
3110
+ id: typeof PaywallEventId.DidFinishPurchase;
3111
+ purchaseResult: AdaptyPurchaseResult;
3112
+ product: AdaptyPaywallProduct;
3113
+ }
3114
+ interface PaywallDidFailPurchaseEvent extends BasePaywallEvent {
3115
+ id: typeof PaywallEventId.DidFailPurchase;
3116
+ error: AdaptyError;
3117
+ product: AdaptyPaywallProduct;
3118
+ }
3119
+ interface PaywallDidStartRestoreEvent extends BasePaywallEvent {
3120
+ id: typeof PaywallEventId.DidStartRestore;
3121
+ }
3122
+ interface PaywallDidFinishRestoreEvent extends BasePaywallEvent {
3123
+ id: typeof PaywallEventId.DidFinishRestore;
3124
+ profile: AdaptyProfile;
3125
+ }
3126
+ interface PaywallDidFailRestoreEvent extends BasePaywallEvent {
3127
+ id: typeof PaywallEventId.DidFailRestore;
3128
+ error: AdaptyError;
3129
+ }
3130
+ interface PaywallDidFailRenderingEvent extends BasePaywallEvent {
3131
+ id: typeof PaywallEventId.DidFailRendering;
3132
+ error: AdaptyError;
3133
+ }
3134
+ interface PaywallDidFailLoadingProductsEvent extends BasePaywallEvent {
3135
+ id: typeof PaywallEventId.DidFailLoadingProducts;
3136
+ error: AdaptyError;
3137
+ }
3138
+ interface PaywallDidFinishWebPaymentNavigationEvent extends BasePaywallEvent {
3139
+ id: typeof PaywallEventId.DidFinishWebPaymentNavigation;
3140
+ product?: AdaptyPaywallProduct;
3141
+ error?: AdaptyError;
3142
+ }
3143
+ type ParsedPaywallEvent = PaywallDidAppearEvent | PaywallDidDisappearEvent | PaywallDidPerformActionEvent | PaywallDidSelectProductEvent | PaywallDidStartPurchaseEvent | PaywallDidFinishPurchaseEvent | PaywallDidFailPurchaseEvent | PaywallDidStartRestoreEvent | PaywallDidFinishRestoreEvent | PaywallDidFailRestoreEvent | PaywallDidFailRenderingEvent | PaywallDidFailLoadingProductsEvent | PaywallDidFinishWebPaymentNavigationEvent;
3144
+
3145
+ //#endregion
3146
+ //#region src/types/onboarding-events.d.ts
3147
+ declare const OnboardingEventId: {
3148
+ readonly Close: "onboarding_on_close_action";
3149
+ readonly Custom: "onboarding_on_custom_action";
3150
+ readonly Paywall: "onboarding_on_paywall_action";
3151
+ readonly StateUpdated: "onboarding_on_state_updated_action";
3152
+ readonly FinishedLoading: "onboarding_did_finish_loading";
3153
+ readonly Analytics: "onboarding_on_analytics_action";
3154
+ readonly Error: "onboarding_did_fail_with_error";
3155
+ };
3156
+ type OnboardingEventIdType = (typeof OnboardingEventId)[keyof typeof OnboardingEventId];
3157
+ interface OnboardingEventView {
3158
+ id: string;
3159
+ placementId?: string;
3160
+ variationId?: string;
3161
+ }
3162
+ interface BaseOnboardingEvent {
3163
+ id: OnboardingEventIdType;
3164
+ view: OnboardingEventView;
3165
+ }
3166
+ interface OnboardingCloseEvent extends BaseOnboardingEvent {
3167
+ id: typeof OnboardingEventId.Close;
3168
+ actionId: string;
3169
+ meta: AdaptyUiOnboardingMeta;
3170
+ }
3171
+ interface OnboardingCustomEvent extends BaseOnboardingEvent {
3172
+ id: typeof OnboardingEventId.Custom;
3173
+ actionId: string;
3174
+ meta: AdaptyUiOnboardingMeta;
3175
+ }
3176
+ interface OnboardingPaywallEvent extends BaseOnboardingEvent {
3177
+ id: typeof OnboardingEventId.Paywall;
3178
+ actionId: string;
3179
+ meta: AdaptyUiOnboardingMeta;
3180
+ }
3181
+ interface OnboardingStateUpdatedEvent extends BaseOnboardingEvent {
3182
+ id: typeof OnboardingEventId.StateUpdated;
3183
+ action: OnboardingStateUpdatedAction;
3184
+ meta: AdaptyUiOnboardingMeta;
3185
+ }
3186
+ interface OnboardingFinishedLoadingEvent extends BaseOnboardingEvent {
3187
+ id: typeof OnboardingEventId.FinishedLoading;
3188
+ meta: AdaptyUiOnboardingMeta;
3189
+ }
3190
+ interface OnboardingAnalyticsEvent extends BaseOnboardingEvent {
3191
+ id: typeof OnboardingEventId.Analytics;
3192
+ event: {
3193
+ name: string;
3194
+ elementId?: string;
3195
+ reply?: string;
3196
+ };
3197
+ meta: AdaptyUiOnboardingMeta;
3198
+ }
3199
+ interface OnboardingErrorEvent extends BaseOnboardingEvent {
3200
+ id: typeof OnboardingEventId.Error;
3201
+ error: AdaptyError;
3202
+ }
3203
+ type ParsedOnboardingEvent = OnboardingCloseEvent | OnboardingCustomEvent | OnboardingPaywallEvent | OnboardingStateUpdatedEvent | OnboardingFinishedLoadingEvent | OnboardingAnalyticsEvent | OnboardingErrorEvent;
3204
+
3205
+ //#endregion
3206
+ //#region src/ui/paywall-event-mapping.d.ts
3207
+ type EventName$1 = keyof EventHandlers;
3208
+ /**
3209
+ * Resolves native event to handler name based on event data
3210
+ */
3211
+ declare const NATIVE_EVENT_RESOLVER: Record<PaywallEventIdType, (event: ParsedPaywallEvent) => EventName$1 | null>;
3212
+ /**
3213
+ * Maps handler name to native event name
3214
+ * Used in addListener/addInternalListener to subscribe to correct native event
3215
+ */
3216
+ declare const HANDLER_TO_NATIVE_EVENT: Record<EventName$1, PaywallEventIdType>;
3217
+ type ExtractedArgs$1<T extends keyof EventHandlers> = Parameters<EventHandlers[T]>;
3218
+ declare function extractPaywallCallbackArgs<T extends keyof EventHandlers>(handlerName: T, event: ParsedPaywallEvent): ExtractedArgs$1<T>;
3219
+
3220
+ //#endregion
3221
+ //#region src/ui/onboarding-event-mapping.d.ts
3222
+ type EventName = keyof OnboardingEventHandlers;
3223
+ type UiEventMapping = {
3224
+ [nativeEventId: string]: {
3225
+ handlerName: keyof OnboardingEventHandlers;
3226
+ propertyMap?: {
3227
+ [key: string]: string;
3228
+ };
3229
+ }[];
3230
+ };
3231
+ declare const ONBOARDING_EVENT_MAPPINGS: UiEventMapping;
3232
+ declare const HANDLER_TO_EVENT_CONFIG: Record<keyof OnboardingEventHandlers, {
3233
+ nativeEvent: string;
3234
+ handlerName: keyof OnboardingEventHandlers;
3235
+ }>;
3236
+ declare const NATIVE_EVENT_TO_HANDLERS: Record<string, EventName[]>;
3237
+ type ExtractedArgs<T extends keyof OnboardingEventHandlers> = Parameters<OnboardingEventHandlers[T]>;
3238
+ declare function extractOnboardingCallbackArgs<T extends keyof OnboardingEventHandlers>(_handlerName: T, event: ParsedOnboardingEvent): ExtractedArgs<T>;
3239
+
3240
+ //#endregion
3241
+ //#region src/coders/parse.d.ts
3242
+ declare const AdaptyTypes: readonly ["AdaptyError", "AdaptyProfile", "AdaptyPurchaseResult", "AdaptyPaywall", "AdaptyPaywallProduct", "AdaptyOnboarding", "AdaptyRemoteConfig", "AdaptyPaywallBuilder", "AdaptyInstallationStatus", "AdaptyInstallationDetails", "AdaptyUiView", "AdaptyUiDialogActionType", "AdaptyUiOnboardingMeta", "AdaptyUiOnboardingStateParams", "AdaptyUiOnboardingStateUpdatedAction", "Array<AdaptyPaywallProduct>", "BridgeError", "String", "Boolean", "Void"];
3243
+ type AdaptyType = (typeof AdaptyTypes)[number];
3244
+ declare function parseMethodResult<T>(factory: CoderFactory, input: string, resultType: AdaptyType, ctx?: LogContext): T;
3245
+ declare function parseCommonEvent(factory: CoderFactory, event: string, input: string, ctx?: LogContext): any;
3246
+
3247
+ //#endregion
3248
+ //#region src/coders/parse-paywall.d.ts
3249
+ declare function parsePaywallEvent(factory: CoderFactory, input: string, ctx?: LogContext): ParsedPaywallEvent | null;
3250
+
3251
+ //#endregion
3252
+ //#region src/coders/parse-onboarding.d.ts
3253
+ //# sourceMappingURL=parse-paywall.d.ts.map
3254
+ declare function parseOnboardingEvent(factory: CoderFactory, input: string, ctx?: LogContext): ParsedOnboardingEvent | null;
3255
+
3256
+ //#endregion
3257
+ //#region src/utils/generate-id.d.ts
3258
+ //# sourceMappingURL=parse-onboarding.d.ts.map
3259
+ /**
3260
+ * Generates a short unique identifier.
3261
+ * Format: 12 lowercase alphanumeric characters
3262
+ */
3263
+ declare function generateId(): string;
3264
+
3265
+ //#endregion
3266
+ //#region src/utils/compact-object.d.ts
3267
+ //# sourceMappingURL=generate-id.d.ts.map
3268
+ /**
3269
+ * Removes undefined properties from an object, preserving the original type structure
3270
+ * @param obj - Source object with potentially undefined values
3271
+ * @returns Object with undefined values filtered out
3272
+ */
3273
+ declare function filterUndefined<T extends Record<string, any>>(obj: T): T;
3274
+
3275
+ //#endregion
3276
+ //#region src/utils/map-values.d.ts
3277
+ //# sourceMappingURL=compact-object.d.ts.map
3278
+ /**
3279
+ * Maps over values of an object, transforming each value using the provided function.
3280
+ *
3281
+ * @param obj - The object to map over
3282
+ * @param fn - Function to transform each value
3283
+ * @returns New object with transformed values
3284
+ */
3285
+ declare function mapValues<T extends Record<string, any>>(obj: T, fn: (value: T[keyof T], key: keyof T) => any): T;
3286
+
3287
+ //#endregion
3288
+ //#region src/utils/merge-options.d.ts
3289
+ //# sourceMappingURL=map-values.d.ts.map
3290
+ /**
3291
+ * Universal method for merging options with defaults
3292
+ * @param options - input options
3293
+ * @param defaults - default values
3294
+ * @returns merged object with TResult type
3295
+ */
3296
+ declare function mergeOptions<TResult = any>(options: any, defaults: any): TResult;
3297
+
3298
+ //#endregion
3299
+ //#region src/utils/with-error-context.d.ts
3300
+ //# sourceMappingURL=merge-options.d.ts.map
3301
+ type AnyCallback = (...args: any[]) => any;
3302
+ /**
3303
+ * Wraps a user-provided callback with error context enrichment.
3304
+ * Catches exceptions and wraps them with source and handler information.
3305
+ */
3306
+ declare function withErrorContext<T extends AnyCallback>(callback: T, handlerName: string, source: string): T & AnyCallback;
3307
+
3308
+ //#endregion
3309
+ export { ActivateParamsInput, AdaptyAccessLevel, AdaptyAndroidPurchaseParams, AdaptyAndroidSubscriptionUpdateParameters, AdaptyAndroidSubscriptionUpdateReplacementMode, AdaptyBridgeError, AdaptyCustomAsset, AdaptyCustomColorAsset, AdaptyCustomGradientAsset, AdaptyCustomImageAsset, AdaptyCustomVideoAsset, AdaptyDiscountPhase, AdaptyError, AdaptyErrorInput, AdaptyIOSPresentationStyle, AdaptyInstallationDetails, AdaptyInstallationStatus, AdaptyNativeError, AdaptyNonSubscription, AdaptyOnboarding, AdaptyOnboardingBuilder, AdaptyPaywall, AdaptyPaywallBuilder, AdaptyPaywallProduct, AdaptyPlacement, AdaptyPrice, AdaptyProductIdentifier, AdaptyProfile, AdaptyProfileParameters, AdaptyPurchaseResult, AdaptyRemoteConfig, AdaptySubscription, AdaptySubscriptionDetails, AdaptySubscriptionOffer, AdaptySubscriptionOfferId, AdaptySubscriptionPeriod, AdaptyType, AdaptyUiDialogActionType, AdaptyUiDialogConfig, AdaptyUiMediaCache, AdaptyUiOnboardingMeta, AdaptyUiOnboardingStateParams, AdaptyUiView, AppTrackingTransparencyStatus, ArgType, CancellationReason, CoderDependencies, CoderFactory, Converter, CreateOnboardingViewParamsInput, CreatePaywallViewParamsInput, DefaultLoggerAdapter, DefaultPlatformAdapter, DefaultSdkMetadataAdapter, ErrorCode, ErrorConverter, EventHandlerResult, EventHandlers, FetchPolicy, FileLocation, Gender, GetPaywallProductsParamsInput, GetPlacementForDefaultAudienceParamsInput, GetPlacementParamsInput, HANDLER_TO_EVENT_CONFIG, HANDLER_TO_NATIVE_EVENT, ILogContext, ILogScope, ILoggerAdapter, IPlatformAdapter, ISdkMetadataAdapter, IdentifyParamsInput, Log, LogArgs, LogContext, LogEvent, LogLevel, LogScope, LogSink, LogTrace, LoggerConfig, MakePurchaseParamsInput, MethodName, MethodNames, NATIVE_EVENT_RESOLVER, NATIVE_EVENT_TO_HANDLERS, ONBOARDING_EVENT_MAPPINGS, OfferType, OnboardingAnalyticsEvent, OnboardingAnalyticsEventName, OnboardingCloseEvent, OnboardingCustomEvent, OnboardingErrorEvent, OnboardingEventHandlers, OnboardingEventId, OnboardingEventIdType, OnboardingEventView, OnboardingFinishedLoadingEvent, OnboardingPaywallEvent, OnboardingStateUpdatedAction, OnboardingStateUpdatedEvent, ParsedOnboardingEvent, ParsedPaywallEvent, PaywallDidAppearEvent, PaywallDidDisappearEvent, PaywallDidFailLoadingProductsEvent, PaywallDidFailPurchaseEvent, PaywallDidFailRenderingEvent, PaywallDidFailRestoreEvent, PaywallDidFinishPurchaseEvent, PaywallDidFinishRestoreEvent, PaywallDidFinishWebPaymentNavigationEvent, PaywallDidPerformActionEvent, PaywallDidSelectProductEvent, PaywallDidStartPurchaseEvent, PaywallDidStartRestoreEvent, PaywallEventId, PaywallEventIdType, PaywallEventView, PlatformOS, ProductPeriod, ProductPurchaseParams, ProductReference, RefundPreference, ScopeArgs, Serializable$1 as Serializable, UserEventName, VendorStore, WebPresentation, components, consoleLogSink, extractOnboardingCallbackArgs, extractPaywallCallbackArgs, filterUndefined, generateId, getErrorCode, getErrorPrompt, mapValues, mergeOptions, parseCommonEvent, parseMethodResult, parseOnboardingEvent, parsePaywallEvent, withErrorContext };
3310
+ //# sourceMappingURL=index.d.cts.map