From 7ec1e91a0c43a89889e56f474f287b1309ee8f2c Mon Sep 17 00:00:00 2001 From: Stanislav Mayorov Date: Thu, 26 Feb 2026 19:55:42 +0300 Subject: [PATCH 1/5] feat: add RN yaml --- cross_platform.yaml | 1630 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1630 insertions(+) create mode 100644 cross_platform.yaml diff --git a/cross_platform.yaml b/cross_platform.yaml new file mode 100644 index 0000000..1ad5b9a --- /dev/null +++ b/cross_platform.yaml @@ -0,0 +1,1630 @@ +$schema: "https://json-schema.org/draft/2020-12/schema" +$id: "https://adapty.io/crossPlatform/3.15.2/schema" +title: "Cross Platform Format" + +$requests: + ### activate ### + Activate.Request: #request + type: object + required: [method, configuration] + properties: + method: { const: "activate" } + configuration: { $ref: "#/$defs/AdaptyConfiguration" } + + Activate.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### createPaywallView ### + AdaptyUICreatePaywallView.Request: #request + type: object + required: + - method + - paywall + properties: + method: { const: "adapty_ui_create_paywall_view" } + paywall: { $ref: "#/$defs/AdaptyPaywall" } + load_timeout: { type: number, description: "seconds" } + preload_products: { type: boolean, default: false } + custom_tags: { $ref: "#/$defs/AdaptyUI.CustomTagsValues" } + custom_timers: { $ref: "#/$defs/AdaptyUI.CustomTimersValues" } + custom_assets: { $ref: "#/$defs/AdaptyUI.CustomAssets" } + product_purchase_parameters: + { $ref: "#/$defs/AdaptyUI.ProductPurchaseParameters" } + + AdaptyUICreatePaywallView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyUI.PaywallView" } + + ### createOnboardingView ### + AdaptyUICreateOnboardingView.Request: #request + type: object + required: + - method + - onboarding + properties: + method: { const: "adapty_ui_create_onboarding_view" } + onboarding: { $ref: "#/$defs/AdaptyOnboarding" } + external_urls_presentation: { $ref: "#/$defs/AdaptyWebPresentation" } + + AdaptyUICreateOnboardingView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + + ### dismissOnboardingView ### + AdaptyUIDismissOnboardingView.Request: #request + type: object + required: [method, id] + properties: + method: { const: "adapty_ui_dismiss_onboarding_view" } + id: { type: string, description: "View Id" } + destroy: { type: boolean, default: false } + + AdaptyUIDismissOnboardingView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### dismissPaywallView ### + AdaptyUIDismissPaywallView.Request: #request + type: object + required: [method, id] + properties: + method: { const: "adapty_ui_dismiss_paywall_view" } + id: { type: string, description: "View Id" } + destroy: { type: boolean, default: false } + + AdaptyUIDismissPaywallView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### presentOnboardingView ### + AdaptyUIPresentOnboardingView.Request: #request + type: object + required: [method, id] + properties: + method: { const: "adapty_ui_present_onboarding_view" } + id: { type: string, description: "View Id" } + ios_presentation_style: { $ref: "#/$defs/AdaptyUI.IOSPresentationStyle" } + + AdaptyUIPresentOnboardingView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### presentPaywallView ### + AdaptyUIPresentPaywallView.Request: #request + type: object + required: [method, id] + properties: + method: { const: "adapty_ui_present_paywall_view" } + id: { type: string, description: "View Id" } + ios_presentation_style: { $ref: "#/$defs/AdaptyUI.IOSPresentationStyle" } + + AdaptyUIPresentPaywallView.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### adaptyUIShowDialog ### + AdaptyUIShowDialog.Request: #request + type: object + required: [method, id, configuration] + properties: + method: { const: "adapty_ui_show_dialog" } + id: { type: string, description: "View Id" } + configuration: { $ref: "#/$defs/AdaptyUI.DialogConfiguration" } + + AdaptyUIShowDialog.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyUI.DialogActionType" } + + ### getOnboarding ### + GetOnboarding.Request: #request + type: object + required: [method, placement_id] + properties: + method: { const: "get_onboarding" } + placement_id: { type: string } + locale: { $ref: "#/$defs/AdaptyLocale" } + fetch_policy: { $ref: "#/$defs/AdaptyPlacementFetchPolicy" } + load_timeout: { type: number, description: "seconds" } + + GetOnboarding.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyOnboarding" } + + ### getOnboardingForDefaultAudience ### + GetOnboardingForDefaultAudience.Request: #request + type: object + required: [method, placement_id] + properties: + method: { const: "get_onboarding_for_default_audience" } + placement_id: { type: string } + locale: { $ref: "#/$defs/AdaptyLocale" } + fetch_policy: { $ref: "#/$defs/AdaptyPlacementFetchPolicy" } + + GetOnboardingForDefaultAudience.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyOnboarding" } + + ### getPaywall ### + GetPaywall.Request: #request + type: object + required: [method, placement_id] + properties: + method: { const: "get_paywall" } + placement_id: { type: string } + locale: { $ref: "#/$defs/AdaptyLocale" } + fetch_policy: { $ref: "#/$defs/AdaptyPlacementFetchPolicy" } + load_timeout: { type: number, description: "seconds" } + + GetPaywall.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyPaywall" } + + ### getPaywallForDefaultAudience ### + GetPaywallForDefaultAudience.Request: #request + type: object + required: [method, placement_id] + properties: + method: { const: "get_paywall_for_default_audience" } + placement_id: { type: string } + locale: { $ref: "#/$defs/AdaptyLocale" } + fetch_policy: { $ref: "#/$defs/AdaptyPlacementFetchPolicy" } + + GetPaywallForDefaultAudience.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyPaywall" } + + ### getPaywallProducts ### + GetPaywallProducts.Request: #request + type: object + required: [method, paywall] + properties: + method: { const: "get_paywall_products" } + paywall: { $ref: "#/$defs/AdaptyPaywall" } + + GetPaywallProducts.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: + { + type: array, + items: { $ref: "#/$defs/AdaptyPaywallProduct.Response" }, + } + + ### getProfile ### + GetProfile.Request: #request + type: object + required: [method] + properties: + method: { const: "get_profile" } + + GetProfile.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyProfile" } + + ### identify ### + Identify.Request: #request + type: object + required: [method, customer_user_id] + properties: + method: { const: "identify" } + customer_user_id: { type: string } + parameters: { $ref: "#/$defs/CustomerIdentityParameters" } + + Identify.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### isActivated ### + IsActivated.Request: #request + type: object + required: [method] + properties: + method: { const: "is_activated" } + + IsActivated.Response: #response + type: object + required: [success] + properties: + success: { type: boolean } + + ### getLogLevel ### + GetLogLevel.Request: #request + type: object + required: [method] + properties: + method: { const: "get_log_level" } + + GetLogLevel.Response: #response + type: object + required: [success] + properties: + success: { $ref: "#/$defs/AdaptyLog.Level" } + + ### setLogLevel ### + SetLogLevel.Request: #request + type: object + required: [method, value] + properties: + method: { const: "set_log_level" } + value: { $ref: "#/$defs/AdaptyLog.Level" } + + SetLogLevel.Response: #response + type: object + required: [success] + properties: + success: { const: true } + + ### logout ### + Logout.Request: #request + type: object + required: [method] + properties: + method: { const: "logout" } + + Logout.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### logShowPaywall ### + LogShowPaywall.Request: #request + type: object + required: [method, paywall] + properties: + method: { const: "log_show_paywall" } + paywall: { $ref: "#/$defs/AdaptyPaywall" } + + LogShowPaywall.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### makePurchase ### + MakePurchase.Request: #request + type: object + required: [method, product] + properties: + method: { const: "make_purchase" } + product: { $ref: "#/$defs/AdaptyPaywallProduct.Request" } + parameters: { $ref: "#/$defs/AdaptyPurchaseParameters" } + + MakePurchase.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyPurchaseResult" } + + OpenWebPaywall.Request: #request + type: object + required: [method] + properties: + method: { const: "open_web_paywall" } + open_in: { $ref: "#/$defs/AdaptyWebPresentation", default: "browser_out_app" } + oneOf: + - required: [product] + properties: + product: { $ref: "#/$defs/AdaptyPaywallProduct.Request" } + - required: [paywall] + properties: + paywall: { $ref: "#/$defs/AdaptyPaywall" } + + + OpenWebPaywall.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + CreateWebPaywallUrl.Request: #request + type: object + required: [method] + properties: + method: { const: "create_web_paywall_url" } + oneOf: + - required: [product] + properties: + product: { $ref: "#/$defs/AdaptyPaywallProduct.Request" } + - required: [paywall] + properties: + paywall: { $ref: "#/$defs/AdaptyPaywall" } + + CreateWebPurchaseUrl.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { type: string } + + ### getCurrentInstallationStatus ### + GetCurrentInstallationStatus.Request: #request + type: object + required: [method] + properties: + method: { const: "get_current_installation_status" } + + GetCurrentInstallationStatus.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyInstallationStatus" } + + ### presentCodeRedemptionSheet ### + PresentCodeRedemptionSheet.Request: #request + type: object + required: [method] + properties: + method: { const: "present_code_redemption_sheet" } + + PresentCodeRedemptionSheet.Response: #response + type: object + required: [success] + properties: + success: { const: true } + + ### reportTransaction ### + ReportTransaction.Request: #request + type: object + required: [method, transaction_id] + properties: + method: { const: "report_transaction" } + variation_id: { type: string } + transaction_id: { type: string } + + ReportTransaction.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### restorePurchases ### + RestorePurchases.Request: #request + type: object + required: [method] + properties: + method: { const: "restore_purchases" } + + RestorePurchases.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { $ref: "#/$defs/AdaptyProfile" } + + ### getSDKVersion ### + GetSDKVersion.Request: #request + type: object + required: [method] + properties: + method: { const: "get_sdk_version" } + + GetSDKVersion.Response: #response + type: object + required: [success] + properties: + success: { type: string } + + ### setFallback ### + SetFallback.Request: #request + type: object + required: [method] + properties: + method: { const: "set_fallback" } + oneOf: + - required: [asset_id] + properties: + asset_id: { type: string } + - required: [path] + properties: + path: { type: string } + + SetFallback.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### setIntegrationIdentifier ### + SetIntegrationIdentifier.Request: #request + type: object + required: [method, key_values] + properties: + method: { const: "set_integration_identifiers" } + key_values: + type: object + additionalProperties: + type: string + nullable: false + + SetIntegrationIdentifier.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### updateAttributionData ### + UpdateAttributionData.Request: #request + type: object + required: [method, attribution, source] + properties: + method: { const: "update_attribution_data" } + attribution: { type: string } + source: { type: string } + + UpdateAttributionData.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### updateCollectingRefundDataConsent ### + UpdateCollectingRefundDataConsent.Request: #request + type: object + required: [method, consent] + properties: + method: { const: "update_collecting_refund_data_consent" } + consent: { type: boolean } + + UpdateCollectingRefundDataConsent.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### updateProfile ### + UpdateProfile.Request: #request + type: object + required: [method, params] + properties: + method: { const: "update_profile" } + params: { $ref: "#/$defs/AdaptyProfileParameters" } + + UpdateProfile.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + + ### updateRefundPreference ### + UpdateRefundPreference.Request: #request + type: object + required: [method, refund_preference] + properties: + method: { const: "update_refund_preference" } + refund_preference: { $ref: "#/$defs/AdaptyRefundPreference" } + + UpdateRefundPreference.Response: #response + type: object + oneOf: + - required: [error] + properties: + error: { $ref: "#/$defs/AdaptyError" } + - required: [success] + properties: + success: { const: true } + +$events: + Event.DidLoadLatestProfile: + type: object + required: [id, profile] + properties: + id: { const: "did_load_latest_profile" } + profile: { $ref: "#/$defs/AdaptyProfile" } + + Event.OnInstallationDetailsSuccess: + type: object + required: [id, details] + properties: + id: { const: "on_installation_details_success" } + details: { $ref: "#/$defs/AdaptyInstallationDetails" } + + Event.OnInstallationDetailsFail: + type: object + required: [id, error] + properties: + id: { const: "on_installation_details_fail" } + error: { $ref: "#/$defs/AdaptyError" } + + PaywallViewEvent.DidAppear: + type: object + required: [id, view] + properties: + id: { const: "paywall_view_did_appear" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + + PaywallViewEvent.DidDisappear: + type: object + required: [id, view] + properties: + id: { const: "paywall_view_did_disappear" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + + PaywallViewEvent.DidUserAction: + type: object + required: [id, view, action] + properties: + id: { const: "paywall_view_did_perform_action" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + action: { $ref: "#/$defs/AdaptyUI.UserAction" } + + PaywallViewEvent.DidSelectProduct: + type: object + required: [id, view, product_id] + properties: + id: { const: "paywall_view_did_select_product" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + product_id: { type: string } + + PaywallViewEvent.WillPurchase: + type: object + required: [id, view, product] + properties: + id: { const: "paywall_view_did_start_purchase" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + product: { $ref: "#/$defs/AdaptyPaywallProduct.Response" } + + PaywallViewEvent.DidPurchase: + type: object + required: [id, view, product, purchased_result] + properties: + id: { const: "paywall_view_did_finish_purchase" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + product: { $ref: "#/$defs/AdaptyPaywallProduct.Response" } + purchased_result: { $ref: "#/$defs/AdaptyPurchaseResult" } + + PaywallViewEvent.DidFailPurchase: + type: object + required: [id, view, product, error] + properties: + id: { const: "paywall_view_did_fail_purchase" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + product: { $ref: "#/$defs/AdaptyPaywallProduct.Response" } + error: { $ref: "#/$defs/AdaptyError" } + + PaywallViewEvent.WillRestorePurchase: + type: object + required: [id, view] + properties: + id: { const: "paywall_view_did_start_restore" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + + PaywallViewEvent.DidRestorePurchase: + type: object + required: [id, view, profile] + properties: + id: { const: "paywall_view_did_finish_restore" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + profile: { $ref: "#/$defs/AdaptyProfile" } + + PaywallViewEvent.DidFailRestorePurchase: + type: object + required: [id, view, error] + properties: + id: { const: "paywall_view_did_fail_restore" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + error: { $ref: "#/$defs/AdaptyError" } + + PaywallViewEvent.DidFailRendering: + type: object + required: [id, view, error] + properties: + id: { const: "paywall_view_did_fail_rendering" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + error: { $ref: "#/$defs/AdaptyError" } + + PaywallViewEvent.DidFailLoadingProducts: + type: object + required: [id, view, error] + properties: + id: { const: "paywall_view_did_fail_loading_products" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + error: { $ref: "#/$defs/AdaptyError" } + + PaywallViewEvent.DidFinishWebPaymentNavigation: + type: object + required: [id, view] + properties: + id: { const: "paywall_view_did_finish_web_payment_navigation" } + view: { $ref: "#/$defs/AdaptyUI.PaywallView" } + product: { $ref: "#/$defs/AdaptyPaywallProduct.Response" } + error: { $ref: "#/$defs/AdaptyError" } + + OnboardingViewEvent.DidFailWithError: + type: object + required: [id, view, error] + properties: + id: { const: "onboarding_did_fail_with_error" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + error: { $ref: "#/$defs/AdaptyError" } + + OnboardingViewEvent.OnAnalyticsEvent: + type: object + required: [id, view, meta, event] + properties: + id: { const: "onboarding_on_analytics_action" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + event: + type: object + required: [name] + properties: + name: + oneOf: + - type: string + description: any value for unknown event + - enum: + - onboarding_started + - screen_presented + - screen_completed + - second_screen_presented + - registration_screen_presented + - products_screen_presented + - user_email_collected + - onboarding_completed + element_id: { type: string } + reply: { type: string } + + OnboardingViewEvent.DidFinishLoading: + type: object + required: [id, view, meta] + properties: + id: { const: "onboarding_did_finish_loading" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + + OnboardingViewEvent.OnCloseAction: + type: object + required: [id, view, meta, action_id] + properties: + id: { const: "onboarding_on_close_action" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + action_id: { type: string } + + OnboardingViewEvent.OnCustomAction: + type: object + required: [id, view, meta, action_id] + properties: + id: { const: "onboarding_on_custom_action" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + action_id: { type: string } + + OnboardingViewEvent.OnPaywallAction: + type: object + required: [id, view, meta, action_id] + properties: + id: { const: "onboarding_on_paywall_action" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + action_id: { type: string } + + OnboardingViewEvent.OnStateUpdatedAction: + type: object + required: [id, view, meta, action] + properties: + id: { const: "onboarding_on_state_updated_action" } + view: { $ref: "#/$defs/AdaptyUI.OnboardingView" } + meta: { $ref: "#/$defs/AdaptyUI.OnboardingMeta" } + action: + type: object + required: [element_id, element_type, value] + oneOf: + - properties: + element_id: { type: string } + element_type: { const: select } + value: { $ref: "#/$defs/AdaptyUI.OnboardingsStateParams" } + - properties: + element_id: { type: string } + element_type: { const: multi_select } + value: + type: array + items: { $ref: "#/$defs/AdaptyUI.OnboardingsStateParams" } + - properties: + element_id: { type: string } + element_type: { const: input } + value: + type: object + required: [type, value] + oneOf: + - properties: + type: { enum: [text, email] } + value: { type: string } + - properties: + type: { const: number } + value: { type: number } + - properties: + element_id: { type: string } + element_type: { const: date_picker } + value: + type: object + properties: + day: { type: integer } + month: { type: integer } + year: { type: integer } + +$defs: + ### Entities ### + + AdaptyError: #response + type: object + required: [adapty_code, message] + properties: + adapty_code: { type: integer } + message: { type: string } + detail: { type: string } + + AdaptyLog.Level: #request #response + type: string + enum: + - error + - warn + - info + - verbose + - debug + + AdaptyLocale: + type: string + example: "en" + + UUID: + type: string + format: uuid + pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + description: "UUID in RFC 4122 format" + example: "123e4567-e89b-12d3-a456-426614174000" + + Date: #response #request + type: string + format: "yyyy-MM-dd'T'HH:mm:ss.SSSZ" + + AdaptyConfiguration: #request + type: object + required: [api_key] + properties: + api_key: { type: string } + customer_user_id: { type: string } + customer_identity_parameters: { $ref: "#/$defs/CustomerIdentityParameters" } + observer_mode: { type: boolean, default: false } + apple_idfa_collection_disabled: { type: boolean, default: false } + google_adid_collection_disabled: { type: boolean, default: false } + google_enable_pending_prepaid_plans: { type: boolean, default: false } + google_local_access_level_allowed: { type: boolean, default: false } + ip_address_collection_disabled: { type: boolean, default: false } + clear_data_on_backup: { type: boolean, default: false } + server_cluster: { type: string, enum: ["default", "eu", "cn"] } + backend_proxy_host: { type: string } + backend_proxy_port: { type: integer } + log_level: { $ref: "#/$defs/AdaptyLog.Level" } + cross_platform_sdk_name: { type: string } + cross_platform_sdk_version: { type: string } + activate_ui: { type: boolean, dafault: false } + media_cache: + type: object + properties: + memory_storage_total_cost_limit: + { type: integer, description: "bytes" } + memory_storage_count_limit: { type: integer } + disk_storage_size_limit: { type: integer, description: "bytes" } + + CustomerIdentityParameters: #request + type: object + properties: + app_account_token: { $ref: "#/$defs/UUID", description: "iOS Only" } + obfuscated_account_id: { type: string, description: "Android Only" } + obfuscated_profile_id: { type: string, description: "Android Only" } + + AdaptyPaywallProduct.Response: #response + type: object + required: + - vendor_product_id + - adapty_product_id + - access_level_id + - product_type + - paywall_product_index + - paywall_variation_id + - paywall_ab_test_name + - paywall_name + - localized_description + - localized_title + - is_family_shareable # iOS Only + - price + properties: + vendor_product_id: { type: string } + adapty_product_id: { type: string } + access_level_id: { type: string } + product_type: { type: string } + paywall_product_index: { type: integer } + paywall_variation_id: { type: string } + paywall_ab_test_name: { type: string } + paywall_name: { type: string } + web_purchase_url: { type: string } + localized_description: { type: string } + localized_title: { type: string } + is_family_shareable: + { type: boolean, default: false, description: "iOS Only" } + region_code: { type: string } + price: { $ref: "#/$defs/AdaptyPrice" } + subscription: { $ref: "#/$defs/AdaptyPaywallProduct.Subscription" } + payload_data: { type: string } + + AdaptyPrice: #response + type: object + required: [amount] + properties: + amount: { type: number } + currency_code: { type: string } + currency_symbol: { type: string } + localized_string: { type: string } + + AdaptyPaywallProduct.Subscription: #response + type: object + required: + - group_identifier # iOS Only + - period + - renewal_type # Android Only + - base_plan_id # Android Only + properties: + group_identifier: { type: string, description: "iOS Only" } + period: { $ref: "#/$defs/AdaptySubscriptionPeriod" } + localized_period: { type: string } + offer: { $ref: "#/$defs/AdaptySubscriptionOffer" } + renewal_type: # Android Only + type: string + enum: + - prepaid + - autorenewable + default: autorenewable + description: "Android Only" + base_plan_id: { type: string, description: "Android Only" } # Android Only + + AdaptyPaywallProduct.Request: #request + type: object + required: + - vendor_product_id + - adapty_product_id + - access_level_id + - product_type + - paywall_product_index + - paywall_variation_id + - paywall_ab_test_name + - paywall_name + properties: + vendor_product_id: { type: string } + adapty_product_id: { type: string } + access_level_id: { type: string } + product_type: { type: string } + paywall_product_index: { type: integer } + subscription_offer_identifier: + { $ref: "#/$defs/AdaptySubscriptionOffer.Identifier" } + paywall_variation_id: { type: string } + paywall_ab_test_name: { type: string } + paywall_name: { type: string } + web_purchase_url: { type: string } + payload_data: { type: string } + + AdaptySubscriptionOffer: #response + type: object + required: + - offer_identifier + - phases + properties: + offer_identifier: { $ref: "#/$defs/AdaptySubscriptionOffer.Identifier" } + phases: + type: array + items: { $ref: "#/$defs/AdaptySubscriptionOffer.Phase" } + offer_tags: # Android Only + type: array + items: { type: string } + description: Android Only + + AdaptySubscriptionOffer.Phase: + type: object + required: + - price + - subscription_period + - number_of_periods + - payment_mode + properties: + price: { $ref: "#/$defs/AdaptyPrice" } + number_of_periods: { type: integer } + payment_mode: { $ref: "#/$defs/AdaptySubscriptionOffer.PaymentMode" } + subscription_period: { $ref: "#/$defs/AdaptySubscriptionPeriod" } + localized_subscription_period: { type: string } + localized_number_of_periods: { type: string } + + AdaptyOnboarding: #request #response + type: object + required: + - placement + - onboarding_id + - onboarding_name + - variation_id + - onboarding_builder + - response_created_at + - request_locale + properties: + placement: { $ref: "#/$defs/AdaptyPlacement" } + onboarding_id: { type: string } + onboarding_name: { type: string } + variation_id: { type: string } + remote_config: { $ref: "#/$defs/AdaptyRemoteConfig" } + onboarding_builder: + type: object + required: [config_url] + properties: + config_url: { type: string } + payload_data: { type: string } + response_created_at: { type: integer } + request_locale: { $ref: "#/$defs/AdaptyLocale" } + + + AdaptyPaywall: #request #response + type: object + required: + - placement + - paywall_id + - paywall_name + - variation_id + - products + - response_created_at + - request_locale + properties: + placement: { $ref: "#/$defs/AdaptyPlacement" } + paywall_id: { type: string } + paywall_name: { type: string } + variation_id: { type: string } + remote_config: { $ref: "#/$defs/AdaptyRemoteConfig" } + paywall_builder: { $ref: "#/$defs/AdaptyPaywall.ViewConfiguration" } + products: + type: array + items: { $ref: "#/$defs/AdaptyPaywall.ProductReference" } + web_purchase_url: { type: string } + payload_data: { type: string } + response_created_at: { type: integer } + request_locale: { $ref: "#/$defs/AdaptyLocale" } + + + AdaptyPlacement: #request #response + type: object + required: + - developer_id + - audience_name + - revision + - ab_test_name + - placement_audience_version_id + properties: + developer_id: { type: string } + audience_name: { type: string } + revision: { type: integer } + ab_test_name: { type: string } + is_tracking_purchases: { type: bool, default: false } + placement_audience_version_id: { type: string } + + AdaptyPlacementFetchPolicy: #request + type: object + oneOf: + - required: [type] + properties: + type: + type: string + enum: + - reload_revalidating_cache_data + - return_cache_data_else_load + - required: [type, max_age] + properties: + type: + type: string + const: return_cache_data_if_not_expired_else_load + max_age: + type: number + description: "seconds" + + AdaptyRemoteConfig: #request #response + type: object + required: [lang, data] + properties: + lang: { $ref: "#/$defs/AdaptyLocale" } + data: { type: string, description: "custom JSON string" } + + AdaptyPaywall.ProductReference: #request #response + type: object + required: + - vendor_product_id + - adapty_product_id + - access_level_id + - product_type + properties: + vendor_product_id: { type: string } + adapty_product_id: { type: string } + access_level_id: { type: string } + product_type: { type: string } + promotional_offer_id: { type: string, description: "iOS Only" } + win_back_offer_id: { type: string, description: "iOS Only" } + base_plan_id: { type: string, description: "Android Only" } + offer_id: { type: string, description: "Android Only" } + + AdaptyPaywall.ViewConfiguration: + type: object + required: + - paywall_builder_id + - lang + # - json + properties: + paywall_builder_id: { type: string } + lang: { $ref: "#/$defs/AdaptyLocale" } + json: { type: string } + + AdaptySubscriptionPeriod: #response + type: object + required: [unit, number_of_units] + properties: + unit: { $ref: "#/$defs/AdaptySubscriptionPeriod.Unit" } + number_of_units: { type: integer } + + AdaptySubscriptionPeriod.Unit: #response + type: string + enum: + - day + - week + - month + - year + - unknown + + AdaptyProfile: #response #event + type: object + required: + - profile_id + - segment_hash + - is_test_user + - timestamp + properties: + profile_id: { type: string } + customer_user_id: { type: string } + segment_hash: { type: string } + custom_attributes: { $ref: "#/$defs/AdaptyProfile.CustomAttributes" } + paid_access_levels: + type: object + additionalProperties: { $ref: "#/$defs/AdaptyProfile.AccessLevel" } + subscriptions: + type: object + additionalProperties: { $ref: "#/$defs/AdaptyProfile.Subscription" } + non_subscriptions: + type: object + additionalProperties: + type: array + items: { $ref: "#/$defs/AdaptyProfile.NonSubscription" } + timestamp: { type: integer } + is_test_user: { type: boolean } + + AdaptyProfile.AccessLevel: #response + type: object + required: + - id + - is_active + - vendor_product_id + - store + - activated_at + - is_lifetime + - will_renew + - is_in_grace_period + - is_refund + properties: + id: { type: string } + is_active: { type: boolean } + vendor_product_id: { type: string } + store: { type: string } + activated_at: { $ref: "#/$defs/Date" } + renewed_at: { $ref: "#/$defs/Date" } + expires_at: { $ref: "#/$defs/Date" } + is_lifetime: { type: boolean } + active_introductory_offer_type: { type: string } + active_promotional_offer_type: { type: string } + active_promotional_offer_id: { type: string } + offer_id: { type: string } + will_renew: { type: boolean } + is_in_grace_period: { type: boolean } + unsubscribed_at: { $ref: "#/$defs/Date" } + billing_issue_detected_at: { $ref: "#/$defs/Date" } + starts_at: { $ref: "#/$defs/Date" } + cancellation_reason: { type: string } + is_refund: { type: boolean } + + AdaptyProfile.NonSubscription: #response + type: object + required: + - purchase_id + - store + - vendor_product_id + - purchased_at + - is_sandbox + - is_refund + - is_consumable + properties: + purchase_id: { type: string } + store: { type: string } + vendor_product_id: { type: string } + vendor_transaction_id: { type: string } + purchased_at: { $ref: "#/$defs/Date" } + is_sandbox: { type: boolean } + is_refund: { type: boolean } + is_consumable: { type: boolean } + + AdaptyProfile.Subscription: #response + type: object + required: + - store + - vendor_product_id + - vendor_transaction_id + - vendor_original_transaction_id + - is_active + - is_lifetime + - activated_at + - is_in_grace_period + - is_refund + - is_sandbox + - will_renew + properties: + store: { type: string } + vendor_product_id: { type: string } + vendor_transaction_id: { type: string } + vendor_original_transaction_id: { type: string } + is_active: { type: boolean } + is_lifetime: { type: boolean } + activated_at: { $ref: "#/$defs/Date" } + renewed_at: { $ref: "#/$defs/Date" } + expires_at: { $ref: "#/$defs/Date" } + starts_at: { $ref: "#/$defs/Date" } + unsubscribed_at: { $ref: "#/$defs/Date" } + billing_issue_detected_at: { $ref: "#/$defs/Date" } + is_in_grace_period: { type: boolean } + is_refund: { type: boolean } + is_sandbox: { type: boolean } + will_renew: { type: boolean } + active_introductory_offer_type: { type: string } + active_promotional_offer_type: { type: string } + active_promotional_offer_id: { type: string } + offer_id: { type: string } + cancellation_reason: { type: string } + + AdaptyProfile.CustomAttributes: + type: object + additionalProperties: + oneOf: + - type: string + nullable: false + - type: number + format: double + nullable: false + + AdaptyProfile.Gender: #request + type: string + enum: + - f + - m + - o + description: | + * `f` - female + * `m` - male + * `o` - other + + AdaptyProfileParameters: #request + type: object + properties: + first_name: { type: string } + last_name: { type: string } + gender: { $ref: "#/$defs/AdaptyProfile.Gender" } + birthday: { type: string, format: "YYYY-MM-dd" } + email: { type: string } + phone_number: { type: string } + att_status: { type: integer, description: "iOS Only" } + custom_attributes: { $ref: "#/$defs/AdaptyProfile.CustomAttributes" } + analytics_disabled: { type: boolean } + + AdaptySubscriptionOffer.Identifier: #request #response + type: string + oneOf: + - required: + - type + - id # Android Only + properties: + id: { type: string } + type: { type: string, const: introductory } + - required: [id, type] + properties: + id: { type: string } + type: { type: string, enum: [promotional, win_back] } + + AdaptySubscriptionOffer.PaymentMode: #response + type: string + enum: + - pay_as_you_go + - pay_up_front + - free_trial + - unknown + + AdaptyPurchaseResult: #response + type: object + oneOf: + - required: [type] + properties: + type: { type: string, enum: ["pending", "user_cancelled"] } + - required: [type, profile] + properties: + type: { type: string, const: "success" } + profile: { $ref: "#/$defs/AdaptyProfile" } + apple_jws_transaction: { type: string } + google_purchase_token: { type: string } + + + AdaptyInstallationStatus: #response #event + type: object + oneOf: + - required: [status] + properties: + status: { type: string, enum: ["not_available", "not_determined"] } + - required: [status, details] + properties: + status: { type: string, const: "determined" } + details: { $ref: "#/$defs/AdaptyInstallationDetails" } + + AdaptyInstallationDetails: #response #event + type: object + required: [ install_time, app_launch_count] + properties: + install_id: { type: string } + install_time: { $ref: "#/$defs/Date", nullable: false } + app_launch_count: { type: integer, nullable: false } + payload: { type: string } + + AdaptyUI.CustomAssets: + type: array + items: + oneOf: + - $ref: "#/$assets/Color" + - $ref: "#/$assets/ColorGradient" + - $ref: "#/$assets/Image" + - $ref: "#/$assets/Video" + + AdaptyUI.PaywallView: #response #event + type: object + required: + - id + - placement_id + - variation_id + properties: + id: { type: string } + placement_id: { type: string } + variation_id: { type: string } + + AdaptyUI.OnboardingView: #response #event + type: object + required: + - id + - placement_id + - variation_id + properties: + id: { type: string } + placement_id: { type: string } + variation_id: { type: string } + + AdaptyUI.UserAction: #event + type: object + oneOf: + - required: [type] + properties: + type: { type: string, const: ["close", "system_back"] } + - required: [type, value] + properties: + type: { type: string, enum: ["open_url", "custom"] } + value: { type: string } + + AdaptyUI.CustomTagsValues: #request + type: object + additionalProperties: { type: string, nullable: false } + + AdaptyUI.CustomTimersValues: #request + type: object + additionalProperties: { $ref: "#/$defs/Date", nullable: false } + + AdaptyUI.AndroidPersonalizedOffers: #request + type: object + additionalProperties: { type: boolean, nullable: false } + + AdaptyUI.ProductPurchaseParameters: #request + type: object + propertyNames: { description: "key is adapty_product_id" } + additionalProperties: { + $ref: "#/$defs/AdaptyPurchaseParameters", + nullable: false + } + + AdaptyUI.IOSPresentationStyle: + type: string + enum: + - full_screen + - page_sheet + + AdaptyWebPresentation: #request + type: string + enum: + - browser_out_app + - browser_in_app + + AdaptyUI.DialogConfiguration: #request + type: object + required: [default_action] + properties: + title: { type: string } + content: { type: string } + default_action_title: { type: string } + secondary_action_title: { type: string } + + AdaptyUI.DialogActionType: + type: string + enum: + - primary + - secondary + + AdaptyPurchaseParameters: #request + type: object + properties: + subscription_update_params: + { + $ref: "#/$defs/AdaptySubscriptionUpdateParameters", + description: "Android Only", + } + is_offer_personalized: { type: boolean, description: "Android Only" } + + + AdaptySubscriptionUpdateParameters: #request # Android Only + type: object + required: + - old_sub_vendor_product_id + - replacement_mode + properties: + old_sub_vendor_product_id: { type: string } + replacement_mode: + type: string + enum: + - charge_full_price + - deferred + - without_proration + - charge_prorated_price + - with_time_proration + + AdaptyRefundPreference: + type: string + enum: + - no_preference + - grant + - decline + + AdaptyUI.OnboardingMeta: #event + type: object + required: [onboarding_id, screen_cid, screen_index, total_screens] + properties: + onboarding_id: { type: string } + screen_cid: { type: string } + screen_index: { type: integer } + total_screens: { type: integer } + + AdaptyUI.OnboardingsStateParams: #event + type: object + required: [id, value, label] + properties: + id: { type: string } + value: { type: string } + label: { type: string } + +$assets: + Color: + type: object + required: [id, type, value] + properties: + id: { type: string } + type: { const: color } + value: { $ref: "#/$assets/Color.Hex" } + + Color.Hex: + type: string + pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$" + description: RRGGBB or RRGGBBAA + + ColorGradient: + type: object + required: [id, type, values, points] + properties: + id: { type: string } + type: + type: string + enum: + - linear-gradient + values: + type: array + items: + type: object + required: [color, p] + properties: + color: { $ref: "#/$assets/Color.Hex" } + p: { type: number } + points: + type: object + required: [x0, y0, x1, y1] + properties: + x0: { type: number } + y0: { type: number } + x1: { type: number } + y1: { type: number } + + Image: + type: object + required: [id, type] + properties: + id: { type: string } + type: { const: image } + oneOf: + - required: [value] + properties: + value: { type: string, contentEncoding: base64 } + - required: [asset_id] + properties: + asset_id: { type: string } + - required: [path] + properties: + path: { type: string } + + Video: + type: object + required: [id, type] + properties: + id: { type: string } + type: { const: video } + oneOf: + - required: [asset_id] + properties: + asset_id: { type: string } + - required: [path] + properties: + path: { type: string } From d5a6c6fa1046f0e74c62d059d5a389004d707415 Mon Sep 17 00:00:00 2001 From: Stanislav Mayorov Date: Thu, 26 Feb 2026 19:56:13 +0300 Subject: [PATCH 2/5] fix: update api.d.ts --- src/coders/adapty-onboarding.test.ts | 3 +++ src/types/api.d.ts | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/coders/adapty-onboarding.test.ts b/src/coders/adapty-onboarding.test.ts index 9600da2..e3bcf9b 100644 --- a/src/coders/adapty-onboarding.test.ts +++ b/src/coders/adapty-onboarding.test.ts @@ -38,6 +38,9 @@ const mocks: Def['AdaptyOnboarding'][] = [ onboarding_id: 'onboarding_789', onboarding_name: 'Basic Onboarding', variation_id: 'variation_123', + onboarding_builder: { + config_url: 'https://example.com/basic', + }, response_created_at: 1640995300000, request_locale: 'en', }, diff --git a/src/types/api.d.ts b/src/types/api.d.ts index dffa136..18bcf61 100644 --- a/src/types/api.d.ts +++ b/src/types/api.d.ts @@ -710,7 +710,7 @@ export interface components { variation_id: string; response_created_at: number; remote_config?: components['defs']['AdaptyRemoteConfig']; - onboarding_builder?: { + onboarding_builder: { config_url: string; }; payload_data?: string; @@ -750,6 +750,7 @@ export interface components { 'AdaptyPaywall.ViewConfiguration': { paywall_builder_id: string; lang: components['defs']['AdaptyLocale']; + json?: string; }; AdaptySubscriptionPeriod: { @@ -946,6 +947,10 @@ export interface components { [key: string]: components['defs']['AdaptyPurchaseParameters']; }; + 'AdaptyUI.AndroidPersonalizedOffers': { + [key: string]: boolean; + }; + 'AdaptyUI.IOSPresentationStyle': 'full_screen' | 'page_sheet'; AdaptyWebPresentation: 'browser_out_app' | 'browser_in_app'; From 67d2176928762582574fcfb523dace8a353a5466 Mon Sep 17 00:00:00 2001 From: Stanislav Mayorov Date: Thu, 26 Feb 2026 11:08:36 -0800 Subject: [PATCH 3/5] feat: add YAML-to-TS codegen implementation --- .eslintrc.cjs | 2 +- cross_platform.yaml | 4 +- package.json | 4 + scripts/generate-api-types.ts | 624 ++++++++++++++++++++++++++++++++++ src/types/api.d.ts | 386 ++++++++++----------- yarn.lock | 188 +++++++++- 6 files changed, 990 insertions(+), 218 deletions(-) create mode 100644 scripts/generate-api-types.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a681fc8..e51123d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,7 +9,7 @@ module.exports = { "overrides": [ { - "files": ["scripts/**/*.js"], + "files": ["scripts/**/*.{js,ts}"], "rules": { "no-console": "off" } diff --git a/cross_platform.yaml b/cross_platform.yaml index 1ad5b9a..39baf4c 100644 --- a/cross_platform.yaml +++ b/cross_platform.yaml @@ -436,7 +436,7 @@ $requests: properties: paywall: { $ref: "#/$defs/AdaptyPaywall" } - CreateWebPurchaseUrl.Response: #response + CreateWebPaywallUrl.Response: #response type: object oneOf: - required: [error] @@ -1494,7 +1494,7 @@ $defs: AdaptyUI.DialogConfiguration: #request type: object - required: [default_action] + required: [default_action_title] properties: title: { type: string } content: { type: string } diff --git a/package.json b/package.json index a320fd1..30e5150 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,13 @@ "format": "prettier ./src -w", "format-check": "prettier ./src --check", "test": "jest", + "generate": "tsx scripts/generate-api-types.ts", "tsc": "tsc --noEmit", "prepare": "husky" }, "devDependencies": { "@types/jest": "^29.5.3", + "@types/js-yaml": "^4.0.9", "@typescript-eslint/eslint-plugin": "^8.21.0", "@typescript-eslint/parser": "^8.21.0", "dotenv": "^17.2.3", @@ -46,10 +48,12 @@ "eslint-config-prettier": "^9.1.0", "husky": "^9.1.7", "jest": "^29.3.1", + "js-yaml": "^4.1.1", "lint-staged": "^15.2.11", "prettier": "^3.0.0", "ts-jest": "^29.1.1", "tsdown": "^0.9.0", + "tsx": "^4.21.0", "typescript": "^5.9.3" }, "dependencies": { diff --git a/scripts/generate-api-types.ts b/scripts/generate-api-types.ts new file mode 100644 index 0000000..be71b93 --- /dev/null +++ b/scripts/generate-api-types.ts @@ -0,0 +1,624 @@ +/** + * Generates `src/types/api.d.ts` from `cross_platform.yaml`. + * + * Usage: yarn run yaml-to-ts + * require Node.js >= 24 (native TypeScript support) + * + * The output is a single declaration file with: + * 1. OneOf helper types (Without, XOR, OneOf) + * 2. Empty exports: paths, webhooks + * 3. components interface with requests, events, defs, assets + * 4. Empty exports: $defs, external, operations + */ + +import { readFileSync, writeFileSync } from 'node:fs'; +import { resolve, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import yaml from 'js-yaml'; +import { format, resolveConfig } from 'prettier'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const ROOT = resolve(__dirname, '..'); + +// ── Types ────────────────────────────────────────────────────────── + +interface YamlSchema { + $requests: Record; + $events: Record; + $defs: Record; + $assets: Record; + [key: string]: unknown; +} + +interface SchemaNode { + type?: string; + const?: unknown; + enum?: unknown[]; + $ref?: string; + properties?: Record; + required?: string[]; + additionalProperties?: SchemaNode | boolean; + oneOf?: SchemaNode[]; + items?: SchemaNode; + nullable?: boolean; + default?: unknown; + description?: string; + format?: string; + pattern?: string; + example?: unknown; + contentEncoding?: string; + propertyNames?: SchemaNode; + [key: string]: unknown; +} + +// ── Configuration ────────────────────────────────────────────────── + +// Types from $defs that should NOT be emitted as standalone defs. +// References to these are inlined as their base type. +const EXCLUDED_DEFS = new Set(['UUID']); + +let schema: YamlSchema; + +// ── Platform-specific Required Fields ────────────────────────────── + +/** + * Pre-processes the raw YAML text to remove platform-specific items + * from `required` arrays. Lines like `- field_name # iOS Only` within + * a required block are removed, making those fields optional. + */ +function removePlatformSpecificRequired(rawYaml: string): string { + return rawYaml.replace( + /^(\s+)-\s+\S+\s+#\s*(?:iOS|Android)\s+Only\s*$/gm, + '', + ); +} + +// ── YAML Loading ─────────────────────────────────────────────────── + +function loadYaml(path: string): YamlSchema { + const raw = readFileSync(path, 'utf-8'); + const processed = removePlatformSpecificRequired(raw); + return yaml.load(processed) as YamlSchema; +} + +// ── Ref Resolution ───────────────────────────────────────────────── + +function resolveRef(ref: string): string { + const match = ref.match(/^#\/\$(\w+)\/(.+)$/); + if (!match) throw new Error(`Unsupported $ref: ${ref}`); + + const [, section, typeName] = match; + + // Inline excluded defs as their resolved type + if (section === 'defs' && EXCLUDED_DEFS.has(typeName)) { + const node = schema.$defs[typeName]; + if (node) return resolveType(node, 0); + return 'unknown'; + } + + const tsSection = section === 'defs' ? 'defs' : 'assets'; + return `components['${tsSection}']['${typeName}']`; +} + +// ── Indentation Helper ───────────────────────────────────────────── + +function indent(level: number): string { + return ' '.repeat(level); +} + +// ── Type Resolution ──────────────────────────────────────────────── + +/** + * Resolves a YAML schema node to a TypeScript type string. + * @param node - The schema node + * @param depth - Current indentation depth (in units of 2 spaces) + * @returns TypeScript type string + */ +function resolveType(node: SchemaNode, depth: number): string { + // $ref takes priority (ignore extra fields like nullable) + if (node.$ref) { + return resolveRef(node.$ref); + } + + // const value + if (node.const !== undefined) { + return resolveConst(node.const); + } + + // enum values + if (node.enum) { + return resolveEnum(node.enum); + } + + // Pure oneOf (no type: object with properties) + if (node.oneOf && !node.properties && node.type !== 'object') { + // Special case: oneOf of primitives/enums → simple union + if (isPrimitiveOneOf(node.oneOf)) { + return renderPrimitiveUnion(node.oneOf); + } + return renderOneOf(node.oneOf, depth); + } + + // type: object + if (node.type === 'object') { + return resolveObject(node, depth); + } + + // type: array + if (node.type === 'array') { + return resolveArray(node, depth); + } + + // Primitive types + return resolvePrimitive(node.type); +} + +function resolveConst(value: unknown): string { + if (typeof value === 'string') return `'${value}'`; + if (typeof value === 'boolean' || typeof value === 'number') + return String(value); + if (Array.isArray(value)) { + return value + .map(v => (typeof v === 'string' ? `'${v}'` : String(v))) + .join(' | '); + } + return String(value); +} + +function resolveEnum(values: unknown[]): string { + return values + .map(v => (typeof v === 'string' ? `'${v}'` : String(v))) + .join(' | '); +} + +function resolvePrimitive(type: string | undefined): string { + switch (type) { + case 'string': + return 'string'; + case 'number': + return 'number'; + case 'integer': + return 'number'; + case 'boolean': + return 'boolean'; + case 'bool': + return 'boolean'; + default: + return 'unknown'; + } +} + +/** + * Checks if a oneOf array contains only primitive/enum types (no objects). + * Used to determine if we should render a simple union vs OneOf<>. + */ +function isPrimitiveOneOf(variants: SchemaNode[]): boolean { + return variants.every(v => { + if (v.type === 'string' && !v.properties && !v.oneOf) return true; + if (v.type === 'number' && !v.properties && !v.oneOf) return true; + if (v.type === 'integer' && !v.properties && !v.oneOf) return true; + if (v.type === 'boolean' && !v.properties && !v.oneOf) return true; + if (v.enum) return true; + return false; + }); +} + +/** + * Renders a union of primitive types and enums. + * E.g., oneOf: [{type: string}, {enum: [a, b, c]}] → 'a' | 'b' | 'c' | string + */ +function renderPrimitiveUnion(variants: SchemaNode[]): string { + const parts: string[] = []; + // Put enum values first, then primitive types + for (const v of variants) { + if (v.enum) { + parts.push( + ...v.enum.map(e => (typeof e === 'string' ? `'${e}'` : String(e))), + ); + } + } + for (const v of variants) { + if (!v.enum) { + parts.push(resolvePrimitive(v.type)); + } + } + return parts.join(' | '); +} + +// ── Object Resolution ────────────────────────────────────────────── + +function resolveObject(node: SchemaNode, depth: number): string { + const hasProps = node.properties && Object.keys(node.properties).length > 0; + const hasOneOf = node.oneOf && node.oneOf.length > 0; + const hasAdditionalProps = + node.additionalProperties !== undefined && + node.additionalProperties !== false; + + // Only additionalProperties, no explicit properties + if (!hasProps && hasAdditionalProps) { + return resolveAdditionalPropsOnly(node, depth); + } + + // Properties + oneOf = intersection + if (hasProps && hasOneOf) { + const propsStr = renderObjectBody( + node.properties!, + node.required || [], + depth, + ); + const oneOfStr = renderOneOf(node.oneOf!, depth); + return `${propsStr} & ${oneOfStr}`; + } + + // Only oneOf, with a parent required array → discriminated union + if (!hasProps && hasOneOf && node.required) { + return renderDiscriminatedUnion(node.oneOf!, node.required, depth); + } + + // Only oneOf, no required + if (!hasProps && hasOneOf) { + return renderOneOf(node.oneOf!, depth); + } + + // Standard object with properties + if (hasProps) { + return renderObjectBody(node.properties!, node.required || [], depth); + } + + return 'Record'; +} + +function resolveAdditionalPropsOnly(node: SchemaNode, depth: number): string { + const ap = node.additionalProperties as SchemaNode; + + // additionalProperties with oneOf (like CustomAttributes) + if (ap.oneOf) { + const types = ap.oneOf.map((v: SchemaNode) => resolveType(v, depth)); + return `{\n${indent(depth + 1)}[key: string]: ${types.join(' | ')};\n${indent(depth)}}`; + } + + const valueType = resolveType(ap, depth); + return `{\n${indent(depth + 1)}[key: string]: ${valueType};\n${indent(depth)}}`; +} + +/** + * Renders an object body: { prop: type; prop?: type; } + */ +function renderObjectBody( + properties: Record, + required: string[], + depth: number, +): string { + const requiredSet = new Set(required); + const lines: string[] = []; + const propIndent = indent(depth + 1); + + for (const [propName, propNode] of Object.entries(properties)) { + const isRequired = requiredSet.has(propName); + const opt = isRequired ? '' : '?'; + const propType = resolveType(propNode, depth + 1); + lines.push(`${propIndent}${propName}${opt}: ${propType};`); + } + + return `{\n${lines.join('\n')}\n${indent(depth)}}`; +} + +// ── OneOf Resolution ─────────────────────────────────────────────── + +/** + * Determines if a OneOf variant can be rendered as a single line. + */ +function canRenderVariantInline(variant: SchemaNode): boolean { + if (variant.$ref) return true; + if (!variant.properties) return true; + + const props = Object.entries(variant.properties); + if (props.length > 2) return false; + + for (const [, prop] of props) { + if (prop.properties || prop.oneOf || prop.additionalProperties) + return false; + if (prop.type === 'object') return false; + if (prop.type === 'array' && prop.items?.oneOf) return false; + } + + return true; +} + +/** + * Renders a single variant as an inline object string. + */ +function renderVariantInline(variant: SchemaNode): string { + if (variant.$ref) return resolveRef(variant.$ref); + if (!variant.properties) return resolveType(variant, 0); + + const parts: string[] = []; + const requiredSet = new Set(variant.required || []); + + for (const [propName, propNode] of Object.entries(variant.properties)) { + const isRequired = requiredSet.has(propName); + const opt = isRequired ? '' : '?'; + const propType = resolveType(propNode, 0); + parts.push(`${propName}${opt}: ${propType}`); + } + + return `{ ${parts.join('; ')} }`; +} + +/** + * Renders OneOf<[variant1, variant2, ...]> + */ +function renderOneOf(variants: SchemaNode[], depth: number): string { + if (variants.length === 1) { + return renderVariant(variants[0], depth); + } + + // Check if all variants can be inline + const allInline = variants.every(canRenderVariantInline); + + if (allInline) { + const inlineVariants = variants.map(renderVariantInline); + const combined = `OneOf<[${inlineVariants.join(', ')}]>`; + + if (combined.length <= 80) { + return combined; + } + + // Multi-line with inline variants + return renderMultiLineOneOf(inlineVariants, depth); + } + + // Multi-line with expanded variants + const variantStrs = variants.map(v => renderVariant(v, depth + 2)); + return renderMultiLineOneOfExpanded(variantStrs, depth); +} + +function renderMultiLineOneOf(inlineVariants: string[], depth: number): string { + const lines: string[] = []; + lines.push(`OneOf<`); + lines.push(`${indent(depth + 1)}[`); + for (const v of inlineVariants) { + lines.push(`${indent(depth + 2)}${v},`); + } + lines.push(`${indent(depth + 1)}]`); + lines.push(`${indent(depth)}>`); + return lines.join('\n'); +} + +function renderMultiLineOneOfExpanded( + variantStrs: string[], + depth: number, +): string { + const lines: string[] = []; + lines.push(`OneOf<`); + lines.push(`${indent(depth + 1)}[`); + for (const v of variantStrs) { + lines.push(`${indent(depth + 2)}${v},`); + } + lines.push(`${indent(depth + 1)}]`); + lines.push(`${indent(depth)}>`); + return lines.join('\n'); +} + +/** + * Renders a discriminated union as bare `|` union. + * Used when an object has `required` + `oneOf` but no `properties`. + * Each variant gets its own required set merged with the parent required. + */ +function renderDiscriminatedUnion( + variants: SchemaNode[], + parentRequired: string[], + depth: number, +): string { + const variantStrs = variants.map(v => { + if (v.properties) { + // Merge parent required with variant required + const mergedRequired = [ + ...new Set([...parentRequired, ...(v.required || [])]), + ]; + return renderObjectBody(v.properties, mergedRequired, depth); + } + return resolveType(v, depth); + }); + + if (variantStrs.length === 1) return variantStrs[0]; + + return variantStrs.join(`\n${indent(depth)}| `); +} + +/** + * Renders a single variant (may be an object, a ref, or a primitive). + */ +function renderVariant(variant: SchemaNode, depth: number): string { + if (variant.$ref) return resolveRef(variant.$ref); + + if (variant.properties) { + return renderObjectBody(variant.properties, variant.required || [], depth); + } + + return resolveType(variant, depth); +} + +// ── Array Resolution ─────────────────────────────────────────────── + +function resolveArray(node: SchemaNode, depth: number): string { + if (!node.items) return 'unknown[]'; + + // Array with oneOf items + if (node.items.oneOf) { + const types = node.items.oneOf.map((v: SchemaNode) => + resolveType(v, depth), + ); + return `(${types.join(' | ')})[]`; + } + + const itemType = resolveType(node.items, depth); + + if (itemType.includes('|') || itemType.includes('&')) { + return `(${itemType})[]`; + } + + return `${itemType}[]`; +} + +// ── Top-Level Type Resolution ────────────────────────────────────── + +function resolveTopLevelType(node: SchemaNode, depth: number): string { + // type: string + enum → string union + if (node.type === 'string' && node.enum) { + return resolveEnum(node.enum); + } + + // type: string + oneOf → OneOf with object variants + if (node.type === 'string' && node.oneOf) { + return renderOneOf(node.oneOf, depth); + } + + // type: object with oneOf and no properties → OneOf or discriminated union + if (node.type === 'object' && node.oneOf && !node.properties) { + if (node.required) { + return renderDiscriminatedUnion(node.oneOf, node.required, depth); + } + return renderOneOf(node.oneOf, depth); + } + + // type: object with properties + oneOf → intersection + if (node.type === 'object' && node.oneOf && node.properties) { + const propsStr = renderObjectBody( + node.properties, + node.required || [], + depth, + ); + const oneOfStr = renderOneOf(node.oneOf, depth); + return `${propsStr} & ${oneOfStr}`; + } + + // Simple string aliases + if (node.type === 'string' && !node.enum && !node.oneOf) { + return 'string'; + } + + return resolveType(node, depth); +} + +// ── Section Rendering ────────────────────────────────────────────── + +function renderSection( + sectionName: string, + entries: Record, + sectionKey: string, +): string { + const lines: string[] = []; + lines.push(`${indent(1)}${sectionName}: {`); + + const entryNames = Object.keys(entries); + let lastEmitted = false; + + for (let i = 0; i < entryNames.length; i++) { + const name = entryNames[i]; + + // Skip excluded defs + if (sectionKey === '$defs' && EXCLUDED_DEFS.has(name)) { + continue; + } + + // Add blank line between entries + if (lastEmitted) { + lines.push(''); + } + + const node = entries[name]; + const typeStr = resolveTopLevelType(node, 2); + + // Quote name if needed + const needsQuote = name.includes('.') || name.includes('-'); + const quotedName = needsQuote ? `'${name}'` : name; + + lines.push(`${indent(2)}${quotedName}: ${typeStr};`); + + lastEmitted = true; + } + + lines.push(`${indent(1)}};`); + return lines.join('\n'); +} + +// ── Main Generation ──────────────────────────────────────────────── + +function generate(): string { + const yamlPath = resolve(ROOT, 'cross_platform.yaml'); + schema = loadYaml(yamlPath); + + const parts: string[] = []; + + // 1. OneOf helper types + parts.push(`/** 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;`); + + // 2. Empty exports + parts.push(` +export type paths = Record; + +export type webhooks = Record;`); + + // 3. components interface + const requestsSection = renderSection( + 'requests', + schema.$requests, + '$requests', + ); + const eventsSection = renderSection('events', schema.$events, '$events'); + const defsSection = renderSection('defs', schema.$defs, '$defs'); + const assetsSection = renderSection('assets', schema.$assets, '$assets'); + + parts.push(` +export interface components { +${requestsSection} +${eventsSection} +${defsSection} +${assetsSection} +}`); + + // 4. Empty exports + parts.push(` +export type $defs = Record; + +export type external = Record; + +export type operations = Record; +`); + + return parts.join('\n'); +} + +// ── Write Output ─────────────────────────────────────────────────── + +async function main(): Promise { + const output = generate(); + const outputPath = resolve(ROOT, 'src/types/api.d.ts'); + + const prettierConfig = await resolveConfig(outputPath); + const formatted = await format(output, { + ...prettierConfig, + filepath: outputPath, + }); + + writeFileSync(outputPath, formatted, 'utf-8'); + + // eslint-disable-next-line no-console + console.log(`Generated ${outputPath}`); +} + +main().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/src/types/api.d.ts b/src/types/api.d.ts index 18bcf61..1c6812f 100644 --- a/src/types/api.d.ts +++ b/src/types/api.d.ts @@ -42,6 +42,29 @@ export interface components { ] >; + 'AdaptyUICreateOnboardingView.Request': { + method: 'adapty_ui_create_onboarding_view'; + onboarding: components['defs']['AdaptyOnboarding']; + external_urls_presentation?: components['defs']['AdaptyWebPresentation']; + }; + + 'AdaptyUICreateOnboardingView.Response': OneOf< + [ + { error: components['defs']['AdaptyError'] }, + { success: components['defs']['AdaptyUI.OnboardingView'] }, + ] + >; + + 'AdaptyUIDismissOnboardingView.Request': { + method: 'adapty_ui_dismiss_onboarding_view'; + id: string; + destroy?: boolean; + }; + + 'AdaptyUIDismissOnboardingView.Response': OneOf< + [{ error: components['defs']['AdaptyError'] }, { success: true }] + >; + 'AdaptyUIDismissPaywallView.Request': { method: 'adapty_ui_dismiss_paywall_view'; id: string; @@ -52,6 +75,16 @@ export interface components { [{ error: components['defs']['AdaptyError'] }, { success: true }] >; + 'AdaptyUIPresentOnboardingView.Request': { + method: 'adapty_ui_present_onboarding_view'; + id: string; + ios_presentation_style?: components['defs']['AdaptyUI.IOSPresentationStyle']; + }; + + 'AdaptyUIPresentOnboardingView.Response': OneOf< + [{ error: components['defs']['AdaptyError'] }, { success: true }] + >; + 'AdaptyUIPresentPaywallView.Request': { method: 'adapty_ui_present_paywall_view'; id: string; @@ -75,37 +108,33 @@ export interface components { ] >; - 'AdaptyUICreateOnboardingView.Request': { - method: 'adapty_ui_create_onboarding_view'; - onboarding: components['defs']['AdaptyOnboarding']; - external_urls_presentation?: components['defs']['AdaptyWebPresentation']; + 'GetOnboarding.Request': { + method: 'get_onboarding'; + placement_id: string; + locale?: components['defs']['AdaptyLocale']; + fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy']; + load_timeout?: number; }; - 'AdaptyUICreateOnboardingView.Response': OneOf< + 'GetOnboarding.Response': OneOf< [ { error: components['defs']['AdaptyError'] }, - { success: components['defs']['AdaptyUI.OnboardingView'] }, + { success: components['defs']['AdaptyOnboarding'] }, ] >; - 'AdaptyUIDismissOnboardingView.Request': { - method: 'adapty_ui_dismiss_onboarding_view'; - id: string; - destroy?: boolean; - }; - - 'AdaptyUIDismissOnboardingView.Response': OneOf< - [{ error: components['defs']['AdaptyError'] }, { success: true }] - >; - - 'AdaptyUIPresentOnboardingView.Request': { - method: 'adapty_ui_present_onboarding_view'; - id: string; - ios_presentation_style?: components['defs']['AdaptyUI.IOSPresentationStyle']; + 'GetOnboardingForDefaultAudience.Request': { + method: 'get_onboarding_for_default_audience'; + placement_id: string; + locale?: components['defs']['AdaptyLocale']; + fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy']; }; - 'AdaptyUIPresentOnboardingView.Response': OneOf< - [{ error: components['defs']['AdaptyError'] }, { success: true }] + 'GetOnboardingForDefaultAudience.Response': OneOf< + [ + { error: components['defs']['AdaptyError'] }, + { success: components['defs']['AdaptyOnboarding'] }, + ] >; 'GetPaywall.Request': { @@ -149,35 +178,6 @@ export interface components { ] >; - 'GetOnboarding.Request': { - method: 'get_onboarding'; - placement_id: string; - locale?: components['defs']['AdaptyLocale']; - fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy']; - load_timeout?: number; - }; - - 'GetOnboarding.Response': OneOf< - [ - { error: components['defs']['AdaptyError'] }, - { success: components['defs']['AdaptyOnboarding'] }, - ] - >; - - 'GetOnboardingForDefaultAudience.Request': { - method: 'get_onboarding_for_default_audience'; - placement_id: string; - locale?: components['defs']['AdaptyLocale']; - fetch_policy?: components['defs']['AdaptyPlacementFetchPolicy']; - }; - - 'GetOnboardingForDefaultAudience.Response': OneOf< - [ - { error: components['defs']['AdaptyError'] }, - { success: components['defs']['AdaptyOnboarding'] }, - ] - >; - 'GetProfile.Request': { method: 'get_profile'; }; @@ -254,18 +254,13 @@ export interface components { ] >; - 'OpenWebPaywall.Request': OneOf< + 'OpenWebPaywall.Request': { + method: 'open_web_paywall'; + open_in?: components['defs']['AdaptyWebPresentation']; + } & OneOf< [ - { - method: 'open_web_paywall'; - product: components['defs']['AdaptyPaywallProduct.Request']; - open_in?: components['defs']['AdaptyWebPresentation']; - }, - { - method: 'open_web_paywall'; - paywall: components['defs']['AdaptyPaywall']; - open_in?: components['defs']['AdaptyWebPresentation']; - }, + { product: components['defs']['AdaptyPaywallProduct.Request'] }, + { paywall: components['defs']['AdaptyPaywall'] }, ] >; @@ -273,16 +268,12 @@ export interface components { [{ error: components['defs']['AdaptyError'] }, { success: true }] >; - 'CreateWebPaywallUrl.Request': OneOf< + 'CreateWebPaywallUrl.Request': { + method: 'create_web_paywall_url'; + } & OneOf< [ - { - method: 'create_web_paywall_url'; - product: components['defs']['AdaptyPaywallProduct.Request']; - }, - { - method: 'create_web_paywall_url'; - paywall: components['defs']['AdaptyPaywall']; - }, + { product: components['defs']['AdaptyPaywallProduct.Request'] }, + { paywall: components['defs']['AdaptyPaywall'] }, ] >; @@ -290,6 +281,17 @@ export interface components { [{ error: components['defs']['AdaptyError'] }, { success: string }] >; + 'GetCurrentInstallationStatus.Request': { + method: 'get_current_installation_status'; + }; + + 'GetCurrentInstallationStatus.Response': OneOf< + [ + { error: components['defs']['AdaptyError'] }, + { success: components['defs']['AdaptyInstallationStatus'] }, + ] + >; + 'PresentCodeRedemptionSheet.Request': { method: 'present_code_redemption_sheet'; }; @@ -300,8 +302,8 @@ export interface components { 'ReportTransaction.Request': { method: 'report_transaction'; - transaction_id: string; variation_id?: string; + transaction_id: string; }; 'ReportTransaction.Response': OneOf< @@ -327,17 +329,6 @@ export interface components { success: string; }; - 'GetCurrentInstallationStatus.Request': { - method: 'get_current_installation_status'; - }; - - 'GetCurrentInstallationStatus.Response': OneOf< - [ - { error: components['defs']['AdaptyError'] }, - { success: components['defs']['AdaptyInstallationStatus'] }, - ] - >; - 'SetFallback.Request': { method: 'set_fallback'; } & OneOf<[{ asset_id: string }, { path: string }]>; @@ -348,7 +339,9 @@ export interface components { 'SetIntegrationIdentifier.Request': { method: 'set_integration_identifiers'; - key_values: Record; + key_values: { + [key: string]: string; + }; }; 'SetIntegrationIdentifier.Response': OneOf< @@ -558,8 +551,14 @@ export interface components { element_id: string; element_type: 'input'; value: - | { type: 'text' | 'email'; value: string } - | { type: 'number'; value: number }; + | { + type: 'text' | 'email'; + value: string; + } + | { + type: 'number'; + value: number; + }; } | { element_id: string; @@ -616,20 +615,6 @@ export interface components { obfuscated_profile_id?: string; }; - 'AdaptyPaywallProduct.Request': { - vendor_product_id: string; - adapty_product_id: string; - access_level_id: string; - product_type: string; - paywall_product_index: number; - subscription_offer_identifier?: components['defs']['AdaptySubscriptionOffer.Identifier']; - paywall_variation_id: string; - paywall_ab_test_name: string; - paywall_name: string; - web_purchase_url?: string; - payload_data?: string; - }; - 'AdaptyPaywallProduct.Response': { vendor_product_id: string; adapty_product_id: string; @@ -665,6 +650,20 @@ export interface components { base_plan_id?: string; }; + 'AdaptyPaywallProduct.Request': { + vendor_product_id: string; + adapty_product_id: string; + access_level_id: string; + product_type: string; + paywall_product_index: number; + subscription_offer_identifier?: components['defs']['AdaptySubscriptionOffer.Identifier']; + paywall_variation_id: string; + paywall_ab_test_name: string; + paywall_name: string; + web_purchase_url?: string; + payload_data?: string; + }; + AdaptySubscriptionOffer: { offer_identifier: components['defs']['AdaptySubscriptionOffer.Identifier']; phases: components['defs']['AdaptySubscriptionOffer.Phase'][]; @@ -673,20 +672,25 @@ export interface components { 'AdaptySubscriptionOffer.Phase': { price: components['defs']['AdaptyPrice']; - subscription_period: components['defs']['AdaptySubscriptionPeriod']; number_of_periods: number; payment_mode: components['defs']['AdaptySubscriptionOffer.PaymentMode']; + subscription_period: components['defs']['AdaptySubscriptionPeriod']; localized_subscription_period?: string; localized_number_of_periods?: string; }; - AdaptyPlacement: { - developer_id: string; - ab_test_name: string; - audience_name: string; - revision: number; - is_tracking_purchases?: boolean; - placement_audience_version_id: string; + AdaptyOnboarding: { + placement: components['defs']['AdaptyPlacement']; + onboarding_id: string; + onboarding_name: string; + variation_id: string; + remote_config?: components['defs']['AdaptyRemoteConfig']; + onboarding_builder: { + config_url: string; + }; + payload_data?: string; + response_created_at: number; + request_locale: components['defs']['AdaptyLocale']; }; AdaptyPaywall: { @@ -694,27 +698,22 @@ export interface components { paywall_id: string; paywall_name: string; variation_id: string; - products: components['defs']['AdaptyPaywall.ProductReference'][]; - response_created_at: number; remote_config?: components['defs']['AdaptyRemoteConfig']; paywall_builder?: components['defs']['AdaptyPaywall.ViewConfiguration']; + products: components['defs']['AdaptyPaywall.ProductReference'][]; web_purchase_url?: string; payload_data?: string; + response_created_at: number; request_locale: components['defs']['AdaptyLocale']; }; - AdaptyOnboarding: { - placement: components['defs']['AdaptyPlacement']; - onboarding_id: string; - onboarding_name: string; - variation_id: string; - response_created_at: number; - remote_config?: components['defs']['AdaptyRemoteConfig']; - onboarding_builder: { - config_url: string; - }; - payload_data?: string; - request_locale: components['defs']['AdaptyLocale']; + AdaptyPlacement: { + developer_id: string; + audience_name: string; + revision: number; + ab_test_name: string; + is_tracking_purchases?: boolean; + placement_audience_version_id: string; }; AdaptyPlacementFetchPolicy: OneOf< @@ -724,10 +723,7 @@ export interface components { | 'reload_revalidating_cache_data' | 'return_cache_data_else_load'; }, - { - type: 'return_cache_data_if_not_expired_else_load'; - max_age: number; - }, + { type: 'return_cache_data_if_not_expired_else_load'; max_age: number }, ] >; @@ -769,8 +765,6 @@ export interface components { profile_id: string; customer_user_id?: string; segment_hash: string; - is_test_user: boolean; - timestamp: number; custom_attributes?: components['defs']['AdaptyProfile.CustomAttributes']; paid_access_levels?: { [key: string]: components['defs']['AdaptyProfile.AccessLevel']; @@ -781,6 +775,8 @@ export interface components { non_subscriptions?: { [key: string]: components['defs']['AdaptyProfile.NonSubscription'][]; }; + timestamp: number; + is_test_user: boolean; }; 'AdaptyProfile.AccessLevel': { @@ -860,14 +856,8 @@ export interface components { 'AdaptySubscriptionOffer.Identifier': OneOf< [ - { - type: 'introductory'; - id?: string; - }, - { - type: 'promotional' | 'win_back'; - id: string; - }, + { id?: string; type: 'introductory' }, + { id: string; type: 'promotional' | 'win_back' }, ] >; @@ -891,6 +881,23 @@ export interface components { ] >; + AdaptyInstallationStatus: OneOf< + [ + { status: 'not_available' | 'not_determined' }, + { + status: 'determined'; + details: components['defs']['AdaptyInstallationDetails']; + }, + ] + >; + + AdaptyInstallationDetails: { + install_id?: string; + install_time: components['defs']['Date']; + app_launch_count: number; + payload?: string; + }; + 'AdaptyUI.CustomAssets': ( | components['assets']['Color'] | components['assets']['ColorGradient'] @@ -910,28 +917,10 @@ export interface components { variation_id: string; }; - 'AdaptyUI.OnboardingMeta': { - onboarding_id: string; - screen_cid: string; - screen_index: number; - total_screens: number; - }; - - 'AdaptyUI.OnboardingsStateParams': { - id: string; - value: string; - label: string; - }; - 'AdaptyUI.UserAction': OneOf< [ - { - type: 'close' | 'system_back'; - }, - { - type: 'open_url' | 'custom'; - value: string; - }, + { type: 'close' | 'system_back' }, + { type: 'open_url' | 'custom'; value: string }, ] >; @@ -943,23 +932,23 @@ export interface components { [key: string]: components['defs']['Date']; }; - 'AdaptyUI.ProductPurchaseParameters': { - [key: string]: components['defs']['AdaptyPurchaseParameters']; - }; - 'AdaptyUI.AndroidPersonalizedOffers': { [key: string]: boolean; }; + 'AdaptyUI.ProductPurchaseParameters': { + [key: string]: components['defs']['AdaptyPurchaseParameters']; + }; + 'AdaptyUI.IOSPresentationStyle': 'full_screen' | 'page_sheet'; AdaptyWebPresentation: 'browser_out_app' | 'browser_in_app'; 'AdaptyUI.DialogConfiguration': { - default_action_title: string; - secondary_action_title?: string; title?: string; content?: string; + default_action_title: string; + secondary_action_title?: string; }; 'AdaptyUI.DialogActionType': 'primary' | 'secondary'; @@ -981,37 +970,33 @@ export interface components { AdaptyRefundPreference: 'no_preference' | 'grant' | 'decline'; - AdaptyInstallationStatus: OneOf< - [ - { - status: 'not_available' | 'not_determined'; - }, - { - status: 'determined'; - details: components['defs']['AdaptyInstallationDetails']; - }, - ] - >; + 'AdaptyUI.OnboardingMeta': { + onboarding_id: string; + screen_cid: string; + screen_index: number; + total_screens: number; + }; - AdaptyInstallationDetails: { - install_id?: string; - install_time: components['defs']['Date']; - app_launch_count: number; - payload?: string; + 'AdaptyUI.OnboardingsStateParams': { + id: string; + value: string; + label: string; }; }; assets: { Color: { id: string; type: 'color'; - value: string; // Hex string: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$ + value: components['assets']['Color.Hex']; }; + 'Color.Hex': string; + ColorGradient: { id: string; type: 'linear-gradient'; values: { - color: string; + color: components['assets']['Color.Hex']; p: number; }[]; points: { @@ -1022,40 +1007,15 @@ export interface components { }; }; - Image: OneOf< - [ - { - id: string; - type: 'image'; - value: string; // base64 - }, - { - id: string; - type: 'image'; - asset_id: string; - }, - { - id: string; - type: 'image'; - path: string; - }, - ] - >; + Image: { + id: string; + type: 'image'; + } & OneOf<[{ value: string }, { asset_id: string }, { path: string }]>; - Video: OneOf< - [ - { - id: string; - type: 'video'; - asset_id: string; - }, - { - id: string; - type: 'video'; - path: string; - }, - ] - >; + Video: { + id: string; + type: 'video'; + } & OneOf<[{ asset_id: string }, { path: string }]>; }; } diff --git a/yarn.lock b/yarn.lock index e117971..1c4bfc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,6 +292,136 @@ dependencies: tslib "^2.4.0" +"@esbuild/aix-ppc64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz#815b39267f9bffd3407ea6c376ac32946e24f8d2" + integrity sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg== + +"@esbuild/android-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz#19b882408829ad8e12b10aff2840711b2da361e8" + integrity sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg== + +"@esbuild/android-arm@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.3.tgz#90be58de27915efa27b767fcbdb37a4470627d7b" + integrity sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA== + +"@esbuild/android-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.3.tgz#d7dcc976f16e01a9aaa2f9b938fbec7389f895ac" + integrity sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ== + +"@esbuild/darwin-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz#9f6cac72b3a8532298a6a4493ed639a8988e8abd" + integrity sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg== + +"@esbuild/darwin-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz#ac61d645faa37fd650340f1866b0812e1fb14d6a" + integrity sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg== + +"@esbuild/freebsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz#b8625689d73cf1830fe58c39051acdc12474ea1b" + integrity sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w== + +"@esbuild/freebsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz#07be7dd3c9d42fe0eccd2ab9f9ded780bc53bead" + integrity sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA== + +"@esbuild/linux-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz#bf31918fe5c798586460d2b3d6c46ed2c01ca0b6" + integrity sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg== + +"@esbuild/linux-arm@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz#28493ee46abec1dc3f500223cd9f8d2df08f9d11" + integrity sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw== + +"@esbuild/linux-ia32@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz#750752a8b30b43647402561eea764d0a41d0ee29" + integrity sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg== + +"@esbuild/linux-loong64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz#a5a92813a04e71198c50f05adfaf18fc1e95b9ed" + integrity sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA== + +"@esbuild/linux-mips64el@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz#deb45d7fd2d2161eadf1fbc593637ed766d50bb1" + integrity sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw== + +"@esbuild/linux-ppc64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz#6f39ae0b8c4d3d2d61a65b26df79f6e12a1c3d78" + integrity sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA== + +"@esbuild/linux-riscv64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz#4c5c19c3916612ec8e3915187030b9df0b955c1d" + integrity sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ== + +"@esbuild/linux-s390x@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz#9ed17b3198fa08ad5ccaa9e74f6c0aff7ad0156d" + integrity sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw== + +"@esbuild/linux-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz#12383dcbf71b7cf6513e58b4b08d95a710bf52a5" + integrity sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA== + +"@esbuild/netbsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz#dd0cb2fa543205fcd931df44f4786bfcce6df7d7" + integrity sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA== + +"@esbuild/netbsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz#028ad1807a8e03e155153b2d025b506c3787354b" + integrity sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA== + +"@esbuild/openbsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz#e3c16ff3490c9b59b969fffca87f350ffc0e2af5" + integrity sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw== + +"@esbuild/openbsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz#c5a4693fcb03d1cbecbf8b422422468dfc0d2a8b" + integrity sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ== + +"@esbuild/openharmony-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz#082082444f12db564a0775a41e1991c0e125055e" + integrity sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g== + +"@esbuild/sunos-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz#5ab036c53f929e8405c4e96e865a424160a1b537" + integrity sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA== + +"@esbuild/win32-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz#38de700ef4b960a0045370c171794526e589862e" + integrity sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA== + +"@esbuild/win32-ia32@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz#451b93dc03ec5d4f38619e6cd64d9f9eff06f55c" + integrity sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q== + +"@esbuild/win32-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz#0eaf705c941a218a43dba8e09f1df1d6cd2f1f17" + integrity sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.9.1": version "4.9.1" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595" @@ -901,6 +1031,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/js-yaml@^4.0.9": + version "4.0.9" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" + integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== + "@types/node@*": version "25.1.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-25.1.0.tgz#95cc584f1f478301efc86de4f1867e5875e83571" @@ -1507,6 +1642,38 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +esbuild@~0.27.0: + version "0.27.3" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.3.tgz#5859ca8e70a3af956b26895ce4954d7e73bd27a8" + integrity sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.27.3" + "@esbuild/android-arm" "0.27.3" + "@esbuild/android-arm64" "0.27.3" + "@esbuild/android-x64" "0.27.3" + "@esbuild/darwin-arm64" "0.27.3" + "@esbuild/darwin-x64" "0.27.3" + "@esbuild/freebsd-arm64" "0.27.3" + "@esbuild/freebsd-x64" "0.27.3" + "@esbuild/linux-arm" "0.27.3" + "@esbuild/linux-arm64" "0.27.3" + "@esbuild/linux-ia32" "0.27.3" + "@esbuild/linux-loong64" "0.27.3" + "@esbuild/linux-mips64el" "0.27.3" + "@esbuild/linux-ppc64" "0.27.3" + "@esbuild/linux-riscv64" "0.27.3" + "@esbuild/linux-s390x" "0.27.3" + "@esbuild/linux-x64" "0.27.3" + "@esbuild/netbsd-arm64" "0.27.3" + "@esbuild/netbsd-x64" "0.27.3" + "@esbuild/openbsd-arm64" "0.27.3" + "@esbuild/openbsd-x64" "0.27.3" + "@esbuild/openharmony-arm64" "0.27.3" + "@esbuild/sunos-x64" "0.27.3" + "@esbuild/win32-arm64" "0.27.3" + "@esbuild/win32-ia32" "0.27.3" + "@esbuild/win32-x64" "0.27.3" + escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" @@ -1761,7 +1928,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.3.2: +fsevents@^2.3.2, fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -1808,6 +1975,13 @@ get-tsconfig@^4.10.0: dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.7.5: + version "4.13.6" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.6.tgz#2fbfda558a98a691a798f123afd95915badce876" + integrity sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw== + dependencies: + resolve-pkg-maps "^1.0.0" + glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" @@ -2437,7 +2611,7 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0: +js-yaml@^4.1.0, js-yaml@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== @@ -3376,6 +3550,16 @@ tslib@^2.4.0, tslib@^2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== +tsx@^4.21.0: + version "4.21.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.21.0.tgz#32aa6cf17481e336f756195e6fe04dae3e6308b1" + integrity sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw== + dependencies: + esbuild "~0.27.0" + get-tsconfig "^4.7.5" + optionalDependencies: + fsevents "~2.3.3" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From 54bf48104780b21fc8ef6e981b4b6c9f13319109 Mon Sep 17 00:00:00 2001 From: Stanislav Mayorov Date: Fri, 27 Feb 2026 02:15:43 -0800 Subject: [PATCH 4/5] chore: remove tsx dependency, use native Node TS support --- package.json | 3 +- yarn.lock | 181 +-------------------------------------------------- 2 files changed, 2 insertions(+), 182 deletions(-) diff --git a/package.json b/package.json index 30e5150..23954a2 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "format": "prettier ./src -w", "format-check": "prettier ./src --check", "test": "jest", - "generate": "tsx scripts/generate-api-types.ts", + "yaml-to-ts": "node scripts/generate-api-types.ts", "tsc": "tsc --noEmit", "prepare": "husky" }, @@ -53,7 +53,6 @@ "prettier": "^3.0.0", "ts-jest": "^29.1.1", "tsdown": "^0.9.0", - "tsx": "^4.21.0", "typescript": "^5.9.3" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 1c4bfc0..02a31b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,136 +292,6 @@ dependencies: tslib "^2.4.0" -"@esbuild/aix-ppc64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz#815b39267f9bffd3407ea6c376ac32946e24f8d2" - integrity sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg== - -"@esbuild/android-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz#19b882408829ad8e12b10aff2840711b2da361e8" - integrity sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg== - -"@esbuild/android-arm@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.3.tgz#90be58de27915efa27b767fcbdb37a4470627d7b" - integrity sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA== - -"@esbuild/android-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.3.tgz#d7dcc976f16e01a9aaa2f9b938fbec7389f895ac" - integrity sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ== - -"@esbuild/darwin-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz#9f6cac72b3a8532298a6a4493ed639a8988e8abd" - integrity sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg== - -"@esbuild/darwin-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz#ac61d645faa37fd650340f1866b0812e1fb14d6a" - integrity sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg== - -"@esbuild/freebsd-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz#b8625689d73cf1830fe58c39051acdc12474ea1b" - integrity sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w== - -"@esbuild/freebsd-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz#07be7dd3c9d42fe0eccd2ab9f9ded780bc53bead" - integrity sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA== - -"@esbuild/linux-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz#bf31918fe5c798586460d2b3d6c46ed2c01ca0b6" - integrity sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg== - -"@esbuild/linux-arm@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz#28493ee46abec1dc3f500223cd9f8d2df08f9d11" - integrity sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw== - -"@esbuild/linux-ia32@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz#750752a8b30b43647402561eea764d0a41d0ee29" - integrity sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg== - -"@esbuild/linux-loong64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz#a5a92813a04e71198c50f05adfaf18fc1e95b9ed" - integrity sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA== - -"@esbuild/linux-mips64el@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz#deb45d7fd2d2161eadf1fbc593637ed766d50bb1" - integrity sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw== - -"@esbuild/linux-ppc64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz#6f39ae0b8c4d3d2d61a65b26df79f6e12a1c3d78" - integrity sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA== - -"@esbuild/linux-riscv64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz#4c5c19c3916612ec8e3915187030b9df0b955c1d" - integrity sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ== - -"@esbuild/linux-s390x@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz#9ed17b3198fa08ad5ccaa9e74f6c0aff7ad0156d" - integrity sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw== - -"@esbuild/linux-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz#12383dcbf71b7cf6513e58b4b08d95a710bf52a5" - integrity sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA== - -"@esbuild/netbsd-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz#dd0cb2fa543205fcd931df44f4786bfcce6df7d7" - integrity sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA== - -"@esbuild/netbsd-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz#028ad1807a8e03e155153b2d025b506c3787354b" - integrity sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA== - -"@esbuild/openbsd-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz#e3c16ff3490c9b59b969fffca87f350ffc0e2af5" - integrity sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw== - -"@esbuild/openbsd-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz#c5a4693fcb03d1cbecbf8b422422468dfc0d2a8b" - integrity sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ== - -"@esbuild/openharmony-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz#082082444f12db564a0775a41e1991c0e125055e" - integrity sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g== - -"@esbuild/sunos-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz#5ab036c53f929e8405c4e96e865a424160a1b537" - integrity sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA== - -"@esbuild/win32-arm64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz#38de700ef4b960a0045370c171794526e589862e" - integrity sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA== - -"@esbuild/win32-ia32@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz#451b93dc03ec5d4f38619e6cd64d9f9eff06f55c" - integrity sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q== - -"@esbuild/win32-x64@0.27.3": - version "0.27.3" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz#0eaf705c941a218a43dba8e09f1df1d6cd2f1f17" - integrity sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA== - "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.9.1": version "4.9.1" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595" @@ -1642,38 +1512,6 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -esbuild@~0.27.0: - version "0.27.3" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.3.tgz#5859ca8e70a3af956b26895ce4954d7e73bd27a8" - integrity sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg== - optionalDependencies: - "@esbuild/aix-ppc64" "0.27.3" - "@esbuild/android-arm" "0.27.3" - "@esbuild/android-arm64" "0.27.3" - "@esbuild/android-x64" "0.27.3" - "@esbuild/darwin-arm64" "0.27.3" - "@esbuild/darwin-x64" "0.27.3" - "@esbuild/freebsd-arm64" "0.27.3" - "@esbuild/freebsd-x64" "0.27.3" - "@esbuild/linux-arm" "0.27.3" - "@esbuild/linux-arm64" "0.27.3" - "@esbuild/linux-ia32" "0.27.3" - "@esbuild/linux-loong64" "0.27.3" - "@esbuild/linux-mips64el" "0.27.3" - "@esbuild/linux-ppc64" "0.27.3" - "@esbuild/linux-riscv64" "0.27.3" - "@esbuild/linux-s390x" "0.27.3" - "@esbuild/linux-x64" "0.27.3" - "@esbuild/netbsd-arm64" "0.27.3" - "@esbuild/netbsd-x64" "0.27.3" - "@esbuild/openbsd-arm64" "0.27.3" - "@esbuild/openbsd-x64" "0.27.3" - "@esbuild/openharmony-arm64" "0.27.3" - "@esbuild/sunos-x64" "0.27.3" - "@esbuild/win32-arm64" "0.27.3" - "@esbuild/win32-ia32" "0.27.3" - "@esbuild/win32-x64" "0.27.3" - escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" @@ -1928,7 +1766,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.3.2, fsevents@~2.3.3: +fsevents@^2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -1975,13 +1813,6 @@ get-tsconfig@^4.10.0: dependencies: resolve-pkg-maps "^1.0.0" -get-tsconfig@^4.7.5: - version "4.13.6" - resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.6.tgz#2fbfda558a98a691a798f123afd95915badce876" - integrity sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw== - dependencies: - resolve-pkg-maps "^1.0.0" - glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" @@ -3550,16 +3381,6 @@ tslib@^2.4.0, tslib@^2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== -tsx@^4.21.0: - version "4.21.0" - resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.21.0.tgz#32aa6cf17481e336f756195e6fe04dae3e6308b1" - integrity sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw== - dependencies: - esbuild "~0.27.0" - get-tsconfig "^4.7.5" - optionalDependencies: - fsevents "~2.3.3" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" From c7fc1eb8982f400d23b14c933749597a8a6569b0 Mon Sep 17 00:00:00 2001 From: Stanislav Mayorov Date: Fri, 27 Feb 2026 13:52:33 +0300 Subject: [PATCH 5/5] chore: set typescript v5.9.3 --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 23954a2..e188018 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "prettier": "^3.0.0", "ts-jest": "^29.1.1", "tsdown": "^0.9.0", - "typescript": "^5.9.3" + "typescript": "5.9.3" }, "dependencies": { "tslib": "^2.5.0" diff --git a/yarn.lock b/yarn.lock index 02a31b0..5aa41a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3408,7 +3408,7 @@ type-fest@^4.41.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== -typescript@^5.9.3: +typescript@5.9.3: version "5.9.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f" integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==