Skip to content

Commit

Permalink
Do not expose phc api (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonidero authored Aug 29, 2024
2 parents f0b6b90 + e4e360b commit cefbbdb
Show file tree
Hide file tree
Showing 275 changed files with 3,956 additions and 3,904 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ GEM

PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23

DEPENDENCIES
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import com.revenuecat.purchases.kmp.models.BillingFeature

@Suppress("unused")
private class BillingFeatureAPI {

fun check(billingFeature: BillingFeature) {
when (billingFeature) {
BillingFeature.PRICE_CHANGE_CONFIRMATION,
BillingFeature.SUBSCRIPTIONS,
BillingFeature.SUBSCRIPTIONS_UPDATE,
BillingFeature.PRICE_CHANGE_CONFIRMATION,
-> {
}
}.exhaustive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.CustomerInfo
import com.revenuecat.purchases.kmp.EntitlementInfos
import com.revenuecat.purchases.kmp.activeSubscriptions
import com.revenuecat.purchases.kmp.allExpirationDateMillis
import com.revenuecat.purchases.kmp.allPurchaseDateMillis
import com.revenuecat.purchases.kmp.allPurchasedProductIdentifiers
import com.revenuecat.purchases.kmp.datetime.allExpirationInstants
import com.revenuecat.purchases.kmp.datetime.allPurchaseInstants
import com.revenuecat.purchases.kmp.datetime.firstSeenInstant
import com.revenuecat.purchases.kmp.datetime.latestExpirationInstant
import com.revenuecat.purchases.kmp.datetime.originalPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.requestInstant
import com.revenuecat.purchases.kmp.entitlements
import com.revenuecat.purchases.kmp.firstSeenMillis
import com.revenuecat.purchases.kmp.latestExpirationDateMillis
import com.revenuecat.purchases.kmp.managementUrlString
import com.revenuecat.purchases.kmp.models.Transaction
import com.revenuecat.purchases.kmp.nonSubscriptionTransactions
import com.revenuecat.purchases.kmp.originalAppUserId
import com.revenuecat.purchases.kmp.originalPurchaseDateMillis
import com.revenuecat.purchases.kmp.requestDateMillis
import kotlinx.datetime.Instant

private class CustomerInfoAPI {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.DiscountPaymentMode

@Suppress("unused")
private class DiscountPaymentModeAPI {

fun check(mode: DiscountPaymentMode) {
when (mode) {
DiscountPaymentMode.FREE_TRIAL,
DiscountPaymentMode.PAY_AS_YOU_GO,
DiscountPaymentMode.PAY_UP_FRONT,
-> {
}
}.exhaustive
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.DiscountType

@Suppress("unused")
private class DiscountTypeAPI {

fun check(type: DiscountType) {
when (type) {
DiscountType.INTRODUCTORY,
DiscountType.PROMOTIONAL,
-> {
}
}.exhaustive
}
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.EntitlementInfo
import com.revenuecat.purchases.kmp.OwnershipType
import com.revenuecat.purchases.kmp.PeriodType
import com.revenuecat.purchases.kmp.Store
import com.revenuecat.purchases.kmp.VerificationResult
import com.revenuecat.purchases.kmp.billingIssueDetectedAtMillis
import com.revenuecat.purchases.kmp.datetime.billingIssueDetectedAtInstant
import com.revenuecat.purchases.kmp.datetime.expirationInstant
import com.revenuecat.purchases.kmp.datetime.latestPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.originalPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.unsubscribeDetectedAtInstant
import com.revenuecat.purchases.kmp.expirationDateMillis
import com.revenuecat.purchases.kmp.identifier
import com.revenuecat.purchases.kmp.isActive
import com.revenuecat.purchases.kmp.isSandbox
import com.revenuecat.purchases.kmp.latestPurchaseDateMillis
import com.revenuecat.purchases.kmp.originalPurchaseDateMillis
import com.revenuecat.purchases.kmp.ownershipType
import com.revenuecat.purchases.kmp.periodType
import com.revenuecat.purchases.kmp.productIdentifier
import com.revenuecat.purchases.kmp.productPlanIdentifier
import com.revenuecat.purchases.kmp.store
import com.revenuecat.purchases.kmp.unsubscribeDetectedAtMillis
import com.revenuecat.purchases.kmp.verification
import com.revenuecat.purchases.kmp.willRenew
import kotlinx.datetime.Instant

@Suppress("unused", "UNUSED_VARIABLE")
Expand All @@ -34,23 +15,27 @@ private class EntitlementInfoAPI {
val identifier: String = identifier
val active: Boolean = isActive
val willRenew: Boolean = willRenew
val periodType: PeriodType = periodType
// FIXME re-enable in SDK-3530
// val periodType: PeriodType = periodType
val latestPurchaseDate: Long? = latestPurchaseDateMillis
val latestPurchaseInstant: Instant? = latestPurchaseInstant
val originalPurchaseDate: Long? = originalPurchaseDateMillis
val originalPurchaseInstant: Instant? = originalPurchaseInstant
val expirationDate: Long? = expirationDateMillis
val expirationInstant: Instant? = expirationInstant
val store: Store = store
// FIXME re-enable in SDK-3530
// val store: Store = store
val productIdentifier: String = productIdentifier
val productPlanIdentifier: String? = productPlanIdentifier
val sandbox: Boolean = isSandbox
val unsubscribeDetectedAt: Long? = unsubscribeDetectedAtMillis
val unsubscribeDetectedAtInstant: Instant? = unsubscribeDetectedAtInstant
val billingIssueDetectedAt: Long? = billingIssueDetectedAtMillis
val billingIssueDetectedAtInstant: Instant? = billingIssueDetectedAtInstant
val ownershipType: OwnershipType = ownershipType
val verification: VerificationResult = verification
// FIXME re-enable in SDK-3530
// val ownershipType: OwnershipType = ownershipType
// FIXME re-enable in SDK-3530
// val verification: VerificationResult = verification
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.EntitlementInfo
import com.revenuecat.purchases.kmp.EntitlementInfos
import com.revenuecat.purchases.kmp.VerificationResult
import com.revenuecat.purchases.kmp.active
import com.revenuecat.purchases.kmp.all
import com.revenuecat.purchases.kmp.get
import com.revenuecat.purchases.kmp.verification

@Suppress("unused", "UNUSED_VARIABLE")
private class EntitlementInfosAPI {
fun check(infos: EntitlementInfos) {
val active: Map<String, EntitlementInfo> = infos.active
val all: Map<String, EntitlementInfo> = infos.all
val i: EntitlementInfo? = infos[""]
val verification: VerificationResult = infos.verification
// FIXME re-enable in SDK-3530
// val verification: VerificationResult = verification
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.PresentedOfferingContext
import com.revenuecat.purchases.kmp.StoreKitVersion
import com.revenuecat.purchases.kmp.models.InstallmentsInfo
import com.revenuecat.purchases.kmp.models.PricingPhase
import com.revenuecat.purchases.kmp.models.SubscriptionOption
import com.revenuecat.purchases.kmp.models.isBasePlan
import com.revenuecat.purchases.kmp.models.isPrepaid

@Suppress("unused")
@Suppress("unused", "UNUSED_VARIABLE")
private class InstallmentsInfoAPI {
fun checkInstallmentsInfo(installmentsInfo: InstallmentsInfo) {
val commitmentPaymentsCount: Int = installmentsInfo.commitmentPaymentsCount
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.LogLevel

@Suppress("unused")
private class LogLevelAPI {
fun check(logLevel: LogLevel) {
when (logLevel) {
LogLevel.VERBOSE,
LogLevel.DEBUG,
LogLevel.INFO,
LogLevel.WARN,
LogLevel.ERROR,
-> {
}
}.exhaustive
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.Offering
import com.revenuecat.purchases.kmp.Package
import com.revenuecat.purchases.kmp.annual
import com.revenuecat.purchases.kmp.availablePackages
import com.revenuecat.purchases.kmp.get
import com.revenuecat.purchases.kmp.getMetadataString
import com.revenuecat.purchases.kmp.getPackage
import com.revenuecat.purchases.kmp.identifier
import com.revenuecat.purchases.kmp.lifetime
import com.revenuecat.purchases.kmp.metadata
import com.revenuecat.purchases.kmp.monthly
import com.revenuecat.purchases.kmp.serverDescription
import com.revenuecat.purchases.kmp.sixMonth
import com.revenuecat.purchases.kmp.threeMonth
import com.revenuecat.purchases.kmp.twoMonth
import com.revenuecat.purchases.kmp.weekly

@Suppress("unused", "UNUSED_VARIABLE")
private class OfferingAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.Offering
import com.revenuecat.purchases.kmp.Offerings
import com.revenuecat.purchases.kmp.all
import com.revenuecat.purchases.kmp.current
import com.revenuecat.purchases.kmp.get
import com.revenuecat.purchases.kmp.getOffering

@Suppress("unused", "UNUSED_VARIABLE")
private class OfferingsAPI {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.Package
import com.revenuecat.purchases.kmp.PackageType
import com.revenuecat.purchases.kmp.PresentedOfferingContext
import com.revenuecat.purchases.kmp.identifier
import com.revenuecat.purchases.kmp.models.StoreProduct
import com.revenuecat.purchases.kmp.packageType
import com.revenuecat.purchases.kmp.presentedOfferingContext
import com.revenuecat.purchases.kmp.storeProduct

@Suppress("unused", "UNUSED_VARIABLE")
private class PackageAPI {
fun check(p: Package) {
with(p) {
val identifier: String = identifier
val packageType: PackageType = packageType
// FIXME re-enable in SDK-3529
// val packageType: PackageType = packageType
val product: StoreProduct = storeProduct
val presentedOfferingContext: PresentedOfferingContext = presentedOfferingContext
// FIXME re-enable in SDK-3529
// val presentedOfferingContext: PresentedOfferingContext = presentedOfferingContext
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.revenuecat.purchases.kmp.PackageType

@Suppress("unused")
private class PackageTypeAPI {

fun check(type: PackageType) {
when (type) {
PackageType.UNKNOWN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.Period
import com.revenuecat.purchases.kmp.models.PeriodUnit
import com.revenuecat.purchases.kmp.models.unit
import com.revenuecat.purchases.kmp.models.value
import com.revenuecat.purchases.kmp.models.valueInMonths

@Suppress("unused", "UNUSED_VARIABLE")
private class PeriodAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.PresentedOfferingContext
import com.revenuecat.purchases.kmp.PresentedOfferingTargetingContext
import com.revenuecat.purchases.kmp.offeringIdentifier
import com.revenuecat.purchases.kmp.placementIdentifier
import com.revenuecat.purchases.kmp.revision
import com.revenuecat.purchases.kmp.ruleId
import com.revenuecat.purchases.kmp.targetingContext

@Suppress("unused", "UNUSED_VARIABLE")
private class PresentedOfferingContextAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import com.revenuecat.purchases.kmp.models.OfferPaymentMode
import com.revenuecat.purchases.kmp.models.Period
import com.revenuecat.purchases.kmp.models.Price
import com.revenuecat.purchases.kmp.models.PricingPhase
import com.revenuecat.purchases.kmp.models.RecurrenceMode

@Suppress("unused", "UNUSED_VARIABLE")
private class PricingPhaseAPI {
fun checkPricingPhase(pricingPhase: PricingPhase) {
val billingPeriod: Period = pricingPhase.billingPeriod
val recurrenceMode: RecurrenceMode = pricingPhase.recurrenceMode
// FIXME re-enable in SDK-3528
// val recurrenceMode: RecurrenceMode = pricingPhase.recurrenceMode
val billingCycleCount: Int? = pricingPhase.billingCycleCount
val price: Price = pricingPhase.price
val offerPaymentMode: OfferPaymentMode? = pricingPhase.offerPaymentMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package com.revenuecat.purchases.kmp.apitester
import com.revenuecat.purchases.kmp.PurchasesAreCompletedBy
import com.revenuecat.purchases.kmp.StoreKitVersion

@Suppress("unused")
@Suppress("unused", "UNUSED_VARIABLE")
private class PurchasesAreCompletedByAPI {
fun check(mode: PurchasesAreCompletedBy) {
when (mode) {
is PurchasesAreCompletedBy.RevenueCat -> { }
is PurchasesAreCompletedBy.MyApp -> {
val storeKitVersion: StoreKitVersion = mode.storeKitVersion
val storeKitVersion: StoreKitVersion = mode.storeKitVersion
}
}.exhaustive
}

fun checkStoreKitValueInPurchasesAreCompletedByMyApp() {
PurchasesAreCompletedBy.MyApp(storeKitVersion = StoreKitVersion.STOREKIT_2)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.models.RecurrenceMode

@Suppress("unused", "UNUSED_VARIABLE")
@Suppress("unused")
private class RecurrenceModeAPI {
fun check(recurrenceMode: RecurrenceMode) {
when (recurrenceMode) {
Expand All @@ -13,7 +13,5 @@ private class RecurrenceModeAPI {
-> {
}
}.exhaustive

val identifier: Int? = recurrenceMode.identifier
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.ReplacementMode
import com.revenuecat.purchases.kmp.models.GoogleReplacementMode

@Suppress("unused", "UNUSED_VARIABLE")
private class ReplacementModeAPI {
fun check(mode: ReplacementMode, googleReplacementMode: GoogleReplacementMode) {
val name: String = mode.name
val googleMode: ReplacementMode = googleReplacementMode
val newMode = object : ReplacementMode {
override val name: String = "newMode"
}
}
}
Loading

0 comments on commit cefbbdb

Please sign in to comment.