From 603335f751e62875467948d4a6e17cd8da4d5d76 Mon Sep 17 00:00:00 2001 From: vlad Date: Thu, 30 May 2024 23:43:18 +0400 Subject: [PATCH 1/3] chores --- lib/src/adapty-handler.ts | 9 +- lib/src/coders/adapty-non-subscription.ts | 5 +- lib/src/coders/adapty-paywall-builder.test.ts | 4 +- lib/src/coders/adapty-paywall-builder.ts | 7 +- lib/src/coders/adapty-paywall-product.ts | 5 +- lib/src/coders/adapty-paywall.test.ts | 6 +- lib/src/coders/adapty-paywall.ts | 11 +- lib/src/coders/adapty-profile-parameters.ts | 5 +- lib/src/coders/adapty-remote-config.test.ts | 4 +- lib/src/coders/adapty-remote-config.ts | 15 +- lib/src/coders/adapty-subscription-details.ts | 5 +- lib/src/coders/adapty-subscription-period.ts | 5 +- lib/src/coders/coder.ts | 2 +- lib/src/types/api.d.ts | 186 +++++++++++------- lib/src/types/inputs.ts | 23 ++- 15 files changed, 178 insertions(+), 114 deletions(-) diff --git a/lib/src/adapty-handler.ts b/lib/src/adapty-handler.ts index 777a23d..094b4d6 100644 --- a/lib/src/adapty-handler.ts +++ b/lib/src/adapty-handler.ts @@ -130,7 +130,10 @@ export class Adapty { body.set('user_id', params.customerUserId); } if (params.ipAddressCollectionDisabled) { - body.set('ip_address_collection_disabled', params.ipAddressCollectionDisabled); + body.set( + 'ip_address_collection_disabled', + params.ipAddressCollectionDisabled, + ); } if (logLevel) { body.set('log_level', logLevel); @@ -621,7 +624,9 @@ export class Adapty { * * @returns {Promise} resolves when fallback paywalls are saved */ - public async setFallbackPaywalls(paywallsLocation: Input.FallbackPaywallsLocation): Promise { + public async setFallbackPaywalls( + paywallsLocation: Input.FallbackPaywallsLocation, + ): Promise { const ctx = new LogContext(); const log = ctx.call({ methodName: 'setFallbackPaywalls' }); const paywallsLocationJson = Platform.select({ diff --git a/lib/src/coders/adapty-non-subscription.ts b/lib/src/coders/adapty-non-subscription.ts index 30fd4d9..2692e41 100644 --- a/lib/src/coders/adapty-non-subscription.ts +++ b/lib/src/coders/adapty-non-subscription.ts @@ -7,7 +7,10 @@ import { DateCoder } from './date'; type Model = AdaptyNonSubscription; type Serializable = Schema['Output.AdaptyNonSubscription']; -export class AdaptyNonSubscriptionCoder extends SimpleCoder { +export class AdaptyNonSubscriptionCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { isConsumable: { key: 'is_consumable', required: true, type: 'boolean' }, isRefund: { key: 'is_refund', required: true, type: 'boolean' }, diff --git a/lib/src/coders/adapty-paywall-builder.test.ts b/lib/src/coders/adapty-paywall-builder.test.ts index dc75b23..7e47157 100644 --- a/lib/src/coders/adapty-paywall-builder.test.ts +++ b/lib/src/coders/adapty-paywall-builder.test.ts @@ -3,9 +3,7 @@ import type { AdaptyPaywallBuilder } from '@/types'; import type { Schema } from '@/types/schema'; type Model = AdaptyPaywallBuilder; -const mocks: Required< -Schema['InOutput.AdaptyPaywall'] ->['paywall_builder'][] = [ +const mocks: Required['paywall_builder'][] = [ { paywall_builder_id: 'paywallBuilder1', lang: 'en', diff --git a/lib/src/coders/adapty-paywall-builder.ts b/lib/src/coders/adapty-paywall-builder.ts index 7bd119a..f0d306e 100644 --- a/lib/src/coders/adapty-paywall-builder.ts +++ b/lib/src/coders/adapty-paywall-builder.ts @@ -5,10 +5,13 @@ import { SimpleCoder } from './coder'; type Model = AdaptyPaywallBuilder; type Serializable = Required< -Schema['InOutput.AdaptyPaywall'] + Schema['InOutput.AdaptyPaywall'] >['paywall_builder']; -export class AdaptyPaywallBuilderCoder extends SimpleCoder { +export class AdaptyPaywallBuilderCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { id: { key: 'paywall_builder_id', diff --git a/lib/src/coders/adapty-paywall-product.ts b/lib/src/coders/adapty-paywall-product.ts index bfdd9f1..9c11566 100644 --- a/lib/src/coders/adapty-paywall-product.ts +++ b/lib/src/coders/adapty-paywall-product.ts @@ -8,7 +8,10 @@ import { AdaptySubscriptionDetailsCoder } from './adapty-subscription-details'; type Model = AdaptyPaywallProduct; type Serializable = Schema['Output.AdaptyPaywallProduct']; -export class AdaptyPaywallProductCoder extends SimpleCoder { +export class AdaptyPaywallProductCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { vendorProductId: { key: 'vendor_product_id', diff --git a/lib/src/coders/adapty-paywall.test.ts b/lib/src/coders/adapty-paywall.test.ts index 51373b4..38dbcf4 100644 --- a/lib/src/coders/adapty-paywall.test.ts +++ b/lib/src/coders/adapty-paywall.test.ts @@ -37,7 +37,7 @@ const mocks: Schema['InOutput.AdaptyPaywall'][] = [ variation_id: 'var001', paywall_builder: { paywall_builder_id: 'paywallBuilder1', - lang: 'en' + lang: 'en', }, }, { @@ -70,13 +70,13 @@ function toModel(mock: (typeof mocks)[number]): Model { name: mock.paywall_name, products: _products.decode(mock.products), ...(mock.remote_config && { - remoteConfig: _remoteConfig.decode(mock.remote_config) + remoteConfig: _remoteConfig.decode(mock.remote_config), }), revision: mock.revision, variationId: mock.variation_id, version: mock.response_created_at, ...(mock.paywall_builder && { - paywallBuilder: _paywallBuilder.decode(mock.paywall_builder) + paywallBuilder: _paywallBuilder.decode(mock.paywall_builder), }), hasViewConfiguration: mock.paywall_builder !== undefined, }; diff --git a/lib/src/coders/adapty-paywall.ts b/lib/src/coders/adapty-paywall.ts index 7039a5e..a8089d8 100644 --- a/lib/src/coders/adapty-paywall.ts +++ b/lib/src/coders/adapty-paywall.ts @@ -11,7 +11,11 @@ type Model = AdaptyPaywall; type CodableModel = Omit; type Serializable = Schema['InOutput.AdaptyPaywall']; -export class AdaptyPaywallCoder extends Coder { +export class AdaptyPaywallCoder extends Coder< + Model, + CodableModel, + Serializable +> { protected properties: Properties = { abTestName: { key: 'ab_test_name', required: true, type: 'string' }, placementId: { key: 'developer_id', required: true, type: 'string' }, @@ -43,7 +47,10 @@ export class AdaptyPaywallCoder extends Coder override decode(data: Serializable): Model { const codablePart = super.decode(data); - return {...codablePart, hasViewConfiguration: codablePart.paywallBuilder !== undefined }; + return { + ...codablePart, + hasViewConfiguration: codablePart.paywallBuilder !== undefined, + }; } override encode(data: Model): Serializable { diff --git a/lib/src/coders/adapty-profile-parameters.ts b/lib/src/coders/adapty-profile-parameters.ts index 2424153..6a6cb1f 100644 --- a/lib/src/coders/adapty-profile-parameters.ts +++ b/lib/src/coders/adapty-profile-parameters.ts @@ -6,7 +6,10 @@ import { SimpleCoder } from './coder'; type Model = AdaptyProfileParameters; type Serializable = Schema['Input.AdaptyProfileParameters']; -export class AdaptyProfileParametersCoder extends SimpleCoder { +export class AdaptyProfileParametersCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { firstName: { key: 'first_name', required: false, type: 'string' }, lastName: { key: 'last_name', required: false, type: 'string' }, diff --git a/lib/src/coders/adapty-remote-config.test.ts b/lib/src/coders/adapty-remote-config.test.ts index 3e84fe3..8f7bd90 100644 --- a/lib/src/coders/adapty-remote-config.test.ts +++ b/lib/src/coders/adapty-remote-config.test.ts @@ -3,9 +3,7 @@ import type { AdaptyRemoteConfig } from '@/types'; import type { Schema } from '@/types/schema'; type Model = AdaptyRemoteConfig; -const mocks: Required< -Schema['InOutput.AdaptyPaywall'] ->['remote_config'][] = [ +const mocks: Required['remote_config'][] = [ { lang: 'en', data: '{"key":"value"}', // A custom JSON string configured in Adapty Dashboard diff --git a/lib/src/coders/adapty-remote-config.ts b/lib/src/coders/adapty-remote-config.ts index cf95c8e..b2a8e12 100644 --- a/lib/src/coders/adapty-remote-config.ts +++ b/lib/src/coders/adapty-remote-config.ts @@ -6,11 +6,13 @@ import { JSONCoder } from './json'; type Model = AdaptyRemoteConfig; type CodableModel = Omit; -type Serializable = Required< -Schema['InOutput.AdaptyPaywall'] ->['remote_config']; +type Serializable = Required['remote_config']; -export class AdaptyRemoteConfigCoder extends Coder { +export class AdaptyRemoteConfigCoder extends Coder< + Model, + CodableModel, + Serializable +> { protected properties: Properties = { data: { key: 'data', @@ -28,7 +30,10 @@ export class AdaptyRemoteConfigCoder extends Coder['subscription_details']; -export class AdaptySubscriptionDetailsCoder extends SimpleCoder { +export class AdaptySubscriptionDetailsCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { subscriptionPeriod: { key: 'subscription_period', diff --git a/lib/src/coders/adapty-subscription-period.ts b/lib/src/coders/adapty-subscription-period.ts index 3b6cc54..92747a1 100644 --- a/lib/src/coders/adapty-subscription-period.ts +++ b/lib/src/coders/adapty-subscription-period.ts @@ -6,7 +6,10 @@ import { SimpleCoder } from './coder'; type Model = AdaptySubscriptionPeriod; type Serializable = Schema['Output.AdaptySubscriptionPeriod']; -export class AdaptySubscriptionPeriodCoder extends SimpleCoder { +export class AdaptySubscriptionPeriodCoder extends SimpleCoder< + Model, + Serializable +> { protected properties: Properties = { unit: { key: 'unit', required: true, type: 'string' }, numberOfUnits: { key: 'number_of_units', required: true, type: 'number' }, diff --git a/lib/src/coders/coder.ts b/lib/src/coders/coder.ts index e9de497..b3ea114 100644 --- a/lib/src/coders/coder.ts +++ b/lib/src/coders/coder.ts @@ -181,4 +181,4 @@ export abstract class Coder< export abstract class SimpleCoder< Model extends Record, Serializable extends Record = Record, -> extends Coder {} \ No newline at end of file +> extends Coder {} diff --git a/lib/src/types/api.d.ts b/lib/src/types/api.d.ts index 7b25345..b20cca8 100644 --- a/lib/src/types/api.d.ts +++ b/lib/src/types/api.d.ts @@ -3,11 +3,16 @@ * Do not make direct changes to the file. */ - /** OneOf type helpers */ type Without = { [P in Exclude]?: never }; -type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; -type OneOf = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR, ...Rest]> : never; +type XOR = T | U extends object + ? (Without & U) | (Without & T) + : T | U; +type OneOf = T extends [infer Only] + ? Only + : T extends [infer A, infer B, ...infer Rest] + ? OneOf<[XOR, ...Rest]> + : never; export type paths = Record; @@ -19,8 +24,13 @@ export interface components { * @example custom * @enum {string} */ - "Input.AdaptyAttributionSource": "adjust" | "appsflyer" | "branch" | "apple_search_ads" | "custom"; - "Input.AdaptyConfiguration": { + 'Input.AdaptyAttributionSource': + | 'adjust' + | 'appsflyer' + | 'branch' + | 'apple_search_ads' + | 'custom'; + 'Input.AdaptyConfiguration': { api_key: string; customer_user_id?: string; /** @default false */ @@ -34,12 +44,12 @@ export interface components { backend_proxy_host?: string; backend_proxy_port?: number; }; - "Input.AdaptyOnboardingScreenParameters": { + 'Input.AdaptyOnboardingScreenParameters': { onboarding_name?: string; onboarding_screen_name?: string; onboarding_screen_order: number; }; - "Input.AdaptyPaywallProduct": { + 'Input.AdaptyPaywallProduct': { /** @example yearly.premium.6999 */ vendor_product_id: string; adapty_product_id: string; @@ -54,12 +64,18 @@ export interface components { * @description iOS Only * @enum {string} */ - "Input.AdaptyIOSProductsFetchPolicy": "default" | "wait_for_receipt_validation"; + 'Input.AdaptyIOSProductsFetchPolicy': + | 'default' + | 'wait_for_receipt_validation'; /** * @description iOS Only * @enum {string} */ - "Input.AdaptyIOSAppTrackingTransparencyStatus": "not_determined" | "restricted" | "denied" | "authorized"; + 'Input.AdaptyIOSAppTrackingTransparencyStatus': + | 'not_determined' + | 'restricted' + | 'denied' + | 'authorized'; /** * @description * `f` - female * * `m` - male @@ -67,11 +83,11 @@ export interface components { * * @enum {string} */ - "Input.AdaptyProfileGender": "f" | "m" | "o"; - "Input.AdaptyProfileParameters": { + 'Input.AdaptyProfileGender': 'f' | 'm' | 'o'; + 'Input.AdaptyProfileParameters': { first_name?: string; last_name?: string; - gender?: components["schemas"]["Input.AdaptyProfileGender"]; + gender?: components['schemas']['Input.AdaptyProfileGender']; /** Format: YYYY-MM-dd */ birthday?: string; email?: string; @@ -84,7 +100,7 @@ export interface components { appmetrica_device_id?: string; /** @description iOS Only */ att_status?: number; - custom_attributes?: components["schemas"]["InOutput.AdaptyProfile.CustomAttributes"]; + custom_attributes?: components['schemas']['InOutput.AdaptyProfile.CustomAttributes']; analytics_disabled?: boolean; one_signal_player_id?: string; one_signal_subscription_id?: string; @@ -93,32 +109,41 @@ export interface components { airbridge_device_id?: string; }; /** @description Android Only */ - "Input.AdaptyAndroidSubscriptionUpdateParameters": { + 'Input.AdaptyAndroidSubscriptionUpdateParameters': { old_sub_vendor_product_id: string; - replacement_mode: components["schemas"]["Input.AdaptyAndroidSubscriptionUpdateReplacementMode"]; + replacement_mode: components['schemas']['Input.AdaptyAndroidSubscriptionUpdateReplacementMode']; }; /** * @description Android Only * @enum {string} */ - "Input.AdaptyAndroidSubscriptionUpdateReplacementMode": "charge_full_price" | "deferred" | "without_proration" | "charge_prorated_price" | "with_time_proration"; - "InOutput.AdaptyPaywallFetchPolicy": ({ - /** @enum {string} */ - type: "reload_revalidating_cache_data" | "return_cache_data_else_load"; - }) | { - /** @enum {string} */ - type: "return_cache_data_if_not_expired_else_load"; - /** Format: double */ - max_age: number; - }; - "InOutput.AdaptyPaywall": { + 'Input.AdaptyAndroidSubscriptionUpdateReplacementMode': + | 'charge_full_price' + | 'deferred' + | 'without_proration' + | 'charge_prorated_price' + | 'with_time_proration'; + 'InOutput.AdaptyPaywallFetchPolicy': + | { + /** @enum {string} */ + type: + | 'reload_revalidating_cache_data' + | 'return_cache_data_else_load'; + } + | { + /** @enum {string} */ + type: 'return_cache_data_if_not_expired_else_load'; + /** Format: double */ + max_age: number; + }; + 'InOutput.AdaptyPaywall': { developer_id: string; paywall_id: string; revision: number; variation_id: string; ab_test_name: string; paywall_name: string; - products: components["schemas"]["InOutput.ProductReference"][]; + products: components['schemas']['InOutput.ProductReference'][]; remote_config?: { lang: string; /** @description A custom JSON string configured in Adapty Dashboard for this paywall. */ @@ -135,7 +160,7 @@ export interface components { response_created_at?: number; payload_data?: string; }; - "InOutput.ProductReference": { + 'InOutput.ProductReference': { vendor_product_id: string; adapty_product_id: string; /** @description iOS Only */ @@ -149,16 +174,16 @@ export interface components { * @example eligible * @enum {string} */ - "InOutput.AdaptyEligibility": "ineligible" | "eligible" | "not_applicable"; + 'InOutput.AdaptyEligibility': 'ineligible' | 'eligible' | 'not_applicable'; /** * @example info * @enum {string} */ - "InOutput.AdaptyLoglevel": "error" | "warn" | "info" | "verbose" | "debug"; - "InOutput.AdaptyProfile.CustomAttributes": { + 'InOutput.AdaptyLoglevel': 'error' | 'warn' | 'info' | 'verbose' | 'debug'; + 'InOutput.AdaptyProfile.CustomAttributes': { [key: string]: (string | null) | (number | null); }; - "Output.AdaptyPaywallProduct": { + 'Output.AdaptyPaywallProduct': { /** @example yearly.premium.6999 */ vendor_product_id: string; adapty_product_id: string; @@ -173,7 +198,7 @@ export interface components { paywall_variation_id: string; paywall_ab_test_name: string; paywall_name: string; - price?: components["schemas"]["Output.AdaptyPrice"]; + price?: components['schemas']['Output.AdaptyPrice']; subscription_details?: { /** @description iOS Only */ subscription_group_identifier?: string; @@ -182,28 +207,28 @@ export interface components { /** @description Android Only */ android_base_plan_id: string; /** @description Android Only */ - introductory_offer_eligibility: components["schemas"]["InOutput.AdaptyEligibility"]; + introductory_offer_eligibility: components['schemas']['InOutput.AdaptyEligibility']; /** @description Android Only */ android_offer_tags?: string[]; /** * @default autorenewable * @enum {string} */ - renewal_type?: "prepaid" | "autorenewable"; - subscription_period: components["schemas"]["Output.AdaptySubscriptionPeriod"]; + renewal_type?: 'prepaid' | 'autorenewable'; + subscription_period: components['schemas']['Output.AdaptySubscriptionPeriod']; localized_subscription_period?: string; - introductory_offer_phases?: components["schemas"]["Output.AdaptyDiscountPhase"][]; - promotional_offer?: components["schemas"]["Output.AdaptyDiscountPhase"]; + introductory_offer_phases?: components['schemas']['Output.AdaptyDiscountPhase'][]; + promotional_offer?: components['schemas']['Output.AdaptyDiscountPhase']; }; payload_data?: string; }; - "Output.AdaptyDiscountPhase": { - price: components["schemas"]["Output.AdaptyPrice"]; + 'Output.AdaptyDiscountPhase': { + price: components['schemas']['Output.AdaptyPrice']; /** @description iOS Only */ identifier?: string; number_of_periods: number; - payment_mode: components["schemas"]["Output.AdaptyPaymentMode"]; - subscription_period: components["schemas"]["Output.AdaptySubscriptionPeriod"]; + payment_mode: components['schemas']['Output.AdaptyPaymentMode']; + subscription_period: components['schemas']['Output.AdaptySubscriptionPeriod']; localized_subscription_period?: string; localized_number_of_periods?: string; }; @@ -211,8 +236,8 @@ export interface components { * @example month * @enum {string} */ - "Output.AdaptyPeriodUnit": "day" | "week" | "month" | "year" | "unknown"; - "Output.AdaptyPrice": { + 'Output.AdaptyPeriodUnit': 'day' | 'week' | 'month' | 'year' | 'unknown'; + 'Output.AdaptyPrice': { /** Format: float */ amount: number; currency_code?: string; @@ -223,45 +248,49 @@ export interface components { * @example free_trial * @enum {string} */ - "Output.AdaptyPaymentMode": "pay_as_you_go" | "pay_up_front" | "free_trial" | "unknown"; + 'Output.AdaptyPaymentMode': + | 'pay_as_you_go' + | 'pay_up_front' + | 'free_trial' + | 'unknown'; /** * @example { * "unit": "year", * "number_of_units": 1 * } */ - "Output.AdaptySubscriptionPeriod": { - unit: components["schemas"]["Output.AdaptyPeriodUnit"]; + 'Output.AdaptySubscriptionPeriod': { + unit: components['schemas']['Output.AdaptyPeriodUnit']; /** @example 1 */ number_of_units: number; }; - "Output.AdaptyProfile": { + 'Output.AdaptyProfile': { /** Format: uuid */ profile_id: string; customer_user_id?: string; segment_hash: string; - custom_attributes?: components["schemas"]["InOutput.AdaptyProfile.CustomAttributes"]; + custom_attributes?: components['schemas']['InOutput.AdaptyProfile.CustomAttributes']; /** @description Key - Paid Access Level ID. Value - Profile Paid Access Level object */ paid_access_levels?: { - [key: string]: components["schemas"]["Output.AdaptyAccessLevel"]; + [key: string]: components['schemas']['Output.AdaptyAccessLevel']; }; /** @description Key - Product ID in Store. Value - Profile Subscription object */ subscriptions?: { - [key: string]: components["schemas"]["Output.AdaptySubscription"]; + [key: string]: components['schemas']['Output.AdaptySubscription']; }; /** @description Key - Product ID in Store. Value - List of Profile Non-Subscription object */ non_subscriptions?: { - [key: string]: components["schemas"]["Output.AdaptyNonSubscription"][]; + [key: string]: components['schemas']['Output.AdaptyNonSubscription'][]; }; }; - "Output.AdaptyAccessLevel": { + 'Output.AdaptyAccessLevel': { id: string; is_active: boolean; vendor_product_id: string; store: string; - activated_at: components["schemas"]["Output.Date"]; - renewed_at?: components["schemas"]["Output.Date"]; - expires_at?: components["schemas"]["Output.Date"]; + activated_at: components['schemas']['Output.Date']; + renewed_at?: components['schemas']['Output.Date']; + expires_at?: components['schemas']['Output.Date']; is_lifetime: boolean; active_introductory_offer_type?: string; active_promotional_offer_type?: string; @@ -271,31 +300,31 @@ export interface components { offer_id?: string; will_renew: boolean; is_in_grace_period: boolean; - unsubscribed_at?: components["schemas"]["Output.Date"]; - billing_issue_detected_at?: components["schemas"]["Output.Date"]; - starts_at?: components["schemas"]["Output.Date"]; + unsubscribed_at?: components['schemas']['Output.Date']; + billing_issue_detected_at?: components['schemas']['Output.Date']; + starts_at?: components['schemas']['Output.Date']; cancellation_reason?: string; is_refund: boolean; }; - "Output.AdaptyNonSubscription": { + 'Output.AdaptyNonSubscription': { purchase_id: string; store: string; vendor_product_id: string; vendor_transaction_id?: string; - purchased_at: components["schemas"]["Output.Date"]; + purchased_at: components['schemas']['Output.Date']; is_sandbox: boolean; is_refund: boolean; is_consumable: boolean; }; - "Output.AdaptySubscription": { + 'Output.AdaptySubscription': { is_active: boolean; vendor_product_id: string; vendor_transaction_id: string; vendor_original_transaction_id: string; store: string; - activated_at: components["schemas"]["Output.Date"]; - renewed_at?: components["schemas"]["Output.Date"]; - expires_at?: components["schemas"]["Output.Date"]; + activated_at: components['schemas']['Output.Date']; + renewed_at?: components['schemas']['Output.Date']; + expires_at?: components['schemas']['Output.Date']; is_lifetime: boolean; active_introductory_offer_type?: string; active_promotional_offer_type?: string; @@ -305,23 +334,28 @@ export interface components { offer_id?: string; will_renew: boolean; is_in_grace_period: boolean; - unsubscribed_at?: components["schemas"]["Output.Date"]; - billing_issue_detected_at?: components["schemas"]["Output.Date"]; - starts_at?: components["schemas"]["Output.Date"]; + unsubscribed_at?: components['schemas']['Output.Date']; + billing_issue_detected_at?: components['schemas']['Output.Date']; + starts_at?: components['schemas']['Output.Date']; cancellation_reason?: string; is_refund: boolean; is_sandbox: boolean; }; /** Format: yyyy-MM-dd'T'HH:mm:ss.SSSZ */ - "Output.Date": string; - "Output.AdaptyResult": OneOf<[{ - /** @description Can be any value */ - success: unknown; - }, { - error: components["schemas"]["Output.AdaptyError"]; - }]>; + 'Output.Date': string; + 'Output.AdaptyResult': OneOf< + [ + { + /** @description Can be any value */ + success: unknown; + }, + { + error: components['schemas']['Output.AdaptyError']; + }, + ] + >; /** @description TODO */ - "Output.AdaptyError": { + 'Output.AdaptyError': { adapty_code: number; message: string; detail?: string; diff --git a/lib/src/types/inputs.ts b/lib/src/types/inputs.ts index ffe2992..d577dd7 100644 --- a/lib/src/types/inputs.ts +++ b/lib/src/types/inputs.ts @@ -185,16 +185,15 @@ export interface MakePurchaseParamsInput { android?: AdaptyAndroidSubscriptionUpdateParameters; } -export type FallbackPaywallsLocation = - { - ios: { - fileName: string - }, - android: - | { - relativeAssetPath: string - } - | { - rawResName: string +export type FallbackPaywallsLocation = { + ios: { + fileName: string; + }; + android: + | { + relativeAssetPath: string; } - } \ No newline at end of file + | { + rawResName: string; + }; +}; From a0a8418b2b3d98f4cab5a2cc4a3606d66682cc22 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 5 Aug 2024 21:19:17 +0400 Subject: [PATCH 2/3] upgraded native deps --- lib/android/build.gradle | 2 +- react-native-adapty-sdk.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/android/build.gradle b/lib/android/build.gradle index ba4a4d4..e05bc7a 100644 --- a/lib/android/build.gradle +++ b/lib/android/build.gradle @@ -105,7 +105,7 @@ def getExtOrDefault(name) { def kotlin_version = getExtOrDefault('kotlinVersion') dependencies { - api 'io.adapty:android-sdk:2.11.2' + api 'io.adapty:android-sdk:2.11.3' //noinspection GradleDynamicVersion api 'io.adapty.internal:crossplatform:2.11.1' diff --git a/react-native-adapty-sdk.podspec b/react-native-adapty-sdk.podspec index dbc349e..a8a8139 100644 --- a/react-native-adapty-sdk.podspec +++ b/react-native-adapty-sdk.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.resources = "lib/ios/**/*.{plist}" s.requires_arc = true - s.dependency "Adapty", "2.11.0" + s.dependency "Adapty", "2.11.1" s.dependency "React" end From aaacd10bade6116faa5eea6852994728764574ed Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 5 Aug 2024 21:19:17 +0400 Subject: [PATCH 3/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef02ee6..0ee4e5d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "react-native-adapty", - "version": "2.11.0", + "version": "2.11.1", "description": "Adapty React Native SDK", "license": "MIT", "author": "Vanya Dorofeyev (https://github.com/divanc)",