UNPKG

app-store-server-api

Version:
309 lines (308 loc) 17.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UserStatus = exports.RefundPreference = exports.PlayTime = exports.Platform = exports.LifetimeDollarsRefunded = exports.LifetimeDollarsPurchased = exports.DeliveryStatus = exports.ConsumptionStatus = exports.AccountTenure = exports.ExtendReasonCode = exports.SendAttemptResult = exports.NotificationSubtype = exports.NotificationType = exports.isDecodedNotificationSummaryPayload = exports.isDecodedNotificationDataPayload = exports.OrderLookupStatus = exports.PriceIncreaseStatus = exports.OfferType = exports.ExpirationIntent = exports.AutoRenewStatus = exports.SubscriptionStatus = exports.TransactionReason = exports.TransactionType = exports.OwnershipType = exports.OfferDiscountType = exports.TransactionHistoryVersion = exports.ProductTypeParameter = exports.SortParameter = exports.Environment = void 0; /** * https://developer.apple.com/documentation/appstoreserverapi/environment */ var Environment; (function (Environment) { Environment["Production"] = "Production"; Environment["Sandbox"] = "Sandbox"; })(Environment = exports.Environment || (exports.Environment = {})); var SortParameter; (function (SortParameter) { SortParameter["Ascending"] = "ASCENDING"; SortParameter["Descending"] = "DESCENDING"; })(SortParameter = exports.SortParameter || (exports.SortParameter = {})); var ProductTypeParameter; (function (ProductTypeParameter) { ProductTypeParameter["AutoRenewable"] = "AUTO_RENEWABLE"; ProductTypeParameter["NonRenewable"] = "NON_RENEWABLE"; ProductTypeParameter["Consumable"] = "CONSUMABLE"; ProductTypeParameter["NonConsumable"] = "NON_CONSUMABLE"; })(ProductTypeParameter = exports.ProductTypeParameter || (exports.ProductTypeParameter = {})); var TransactionHistoryVersion; (function (TransactionHistoryVersion) { /** @deprecated */ TransactionHistoryVersion["v1"] = "v1"; TransactionHistoryVersion["v2"] = "v2"; })(TransactionHistoryVersion = exports.TransactionHistoryVersion || (exports.TransactionHistoryVersion = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/offerdiscounttype */ var OfferDiscountType; (function (OfferDiscountType) { OfferDiscountType["FreeTrial"] = "FREE_TRIAL"; OfferDiscountType["PayAsYouGo"] = "PAY_AS_YOU_GO"; OfferDiscountType["PayUpFront"] = "PAY_UP_FRONT"; })(OfferDiscountType = exports.OfferDiscountType || (exports.OfferDiscountType = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/inappownershiptype */ var OwnershipType; (function (OwnershipType) { OwnershipType["Purchased"] = "PURCHASED"; OwnershipType["FamilyShared"] = "FAMILY_SHARED"; })(OwnershipType = exports.OwnershipType || (exports.OwnershipType = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/type */ var TransactionType; (function (TransactionType) { TransactionType["AutoRenewableSubscription"] = "Auto-Renewable Subscription"; TransactionType["NonConsumable"] = "Non-Consumable"; TransactionType["Consumable"] = "Consumable"; TransactionType["NonRenewingSubscription"] = "Non-Renewing Subscription"; })(TransactionType = exports.TransactionType || (exports.TransactionType = {})); /** * https://developer.apple.com/documentation/appstoreservernotifications/transactionreason */ var TransactionReason; (function (TransactionReason) { TransactionReason["Purchase"] = "PURCHASE"; TransactionReason["Renewal"] = "RENEWAL"; })(TransactionReason = exports.TransactionReason || (exports.TransactionReason = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/status */ var SubscriptionStatus; (function (SubscriptionStatus) { SubscriptionStatus[SubscriptionStatus["Active"] = 1] = "Active"; SubscriptionStatus[SubscriptionStatus["Expired"] = 2] = "Expired"; SubscriptionStatus[SubscriptionStatus["InBillingRetry"] = 3] = "InBillingRetry"; SubscriptionStatus[SubscriptionStatus["InBillingGracePeriod"] = 4] = "InBillingGracePeriod"; SubscriptionStatus[SubscriptionStatus["Revoked"] = 5] = "Revoked"; })(SubscriptionStatus = exports.SubscriptionStatus || (exports.SubscriptionStatus = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/autorenewstatus */ var AutoRenewStatus; (function (AutoRenewStatus) { AutoRenewStatus[AutoRenewStatus["Off"] = 0] = "Off"; AutoRenewStatus[AutoRenewStatus["On"] = 1] = "On"; })(AutoRenewStatus = exports.AutoRenewStatus || (exports.AutoRenewStatus = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/expirationintent */ var ExpirationIntent; (function (ExpirationIntent) { ExpirationIntent[ExpirationIntent["Canceled"] = 1] = "Canceled"; ExpirationIntent[ExpirationIntent["BillingError"] = 2] = "BillingError"; ExpirationIntent[ExpirationIntent["RejectedPriceIncrease"] = 3] = "RejectedPriceIncrease"; ExpirationIntent[ExpirationIntent["ProductUnavailable"] = 4] = "ProductUnavailable"; })(ExpirationIntent = exports.ExpirationIntent || (exports.ExpirationIntent = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/offertype */ var OfferType; (function (OfferType) { OfferType[OfferType["Introductory"] = 1] = "Introductory"; OfferType[OfferType["Promotional"] = 2] = "Promotional"; OfferType[OfferType["SubscriptionOfferCode"] = 3] = "SubscriptionOfferCode"; OfferType[OfferType["WinBackOffer"] = 4] = "WinBackOffer"; })(OfferType = exports.OfferType || (exports.OfferType = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/priceincreasestatus */ var PriceIncreaseStatus; (function (PriceIncreaseStatus) { PriceIncreaseStatus[PriceIncreaseStatus["NoResponse"] = 0] = "NoResponse"; PriceIncreaseStatus[PriceIncreaseStatus["Consented"] = 1] = "Consented"; })(PriceIncreaseStatus = exports.PriceIncreaseStatus || (exports.PriceIncreaseStatus = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/orderlookupstatus */ var OrderLookupStatus; (function (OrderLookupStatus) { OrderLookupStatus[OrderLookupStatus["Valid"] = 0] = "Valid"; OrderLookupStatus[OrderLookupStatus["Invalid"] = 1] = "Invalid"; })(OrderLookupStatus = exports.OrderLookupStatus || (exports.OrderLookupStatus = {})); function isDecodedNotificationDataPayload(decodedNotificationPayload) { return "data" in decodedNotificationPayload; } exports.isDecodedNotificationDataPayload = isDecodedNotificationDataPayload; function isDecodedNotificationSummaryPayload(decodedNotificationPayload) { return "summary" in decodedNotificationPayload; } exports.isDecodedNotificationSummaryPayload = isDecodedNotificationSummaryPayload; /** * https://developer.apple.com/documentation/appstoreservernotifications/notificationtype */ var NotificationType; (function (NotificationType) { NotificationType["ConsumptionRequest"] = "CONSUMPTION_REQUEST"; NotificationType["DidChangeRenewalPref"] = "DID_CHANGE_RENEWAL_PREF"; NotificationType["DidChangeRenewalStatus"] = "DID_CHANGE_RENEWAL_STATUS"; NotificationType["DidFailToRenew"] = "DID_FAIL_TO_RENEW"; NotificationType["DidRenew"] = "DID_RENEW"; NotificationType["Expired"] = "EXPIRED"; NotificationType["ExternalPurchaseToken"] = "EXTERNAL_PURCHASE_TOKEN"; NotificationType["GracePeriodExpired"] = "GRACE_PERIOD_EXPIRED"; NotificationType["OfferRedeemed"] = "OFFER_REDEEMED"; NotificationType["OneTimeCharge"] = "ONE_TIME_CHARGE"; NotificationType["PriceIncrease"] = "PRICE_INCREASE"; NotificationType["Refund"] = "REFUND"; NotificationType["RefundDeclined"] = "REFUND_DECLINED"; NotificationType["RefundReversed"] = "REFUND_REVERSED"; NotificationType["RenewalExtended"] = "RENEWAL_EXTENDED"; NotificationType["RenewalExtension"] = "RENEWAL_EXTENSION"; NotificationType["Revoke"] = "REVOKE"; NotificationType["Subscribed"] = "SUBSCRIBED"; NotificationType["Test"] = "TEST"; })(NotificationType = exports.NotificationType || (exports.NotificationType = {})); /** * https://developer.apple.com/documentation/appstoreservernotifications/subtype */ var NotificationSubtype; (function (NotificationSubtype) { NotificationSubtype["InitialBuy"] = "INITIAL_BUY"; NotificationSubtype["Resubscribe"] = "RESUBSCRIBE"; NotificationSubtype["Downgrade"] = "DOWNGRADE"; NotificationSubtype["Upgrade"] = "UPGRADE"; NotificationSubtype["AutoRenewEnabled"] = "AUTO_RENEW_ENABLED"; NotificationSubtype["AutoRenewDisabled"] = "AUTO_RENEW_DISABLED"; NotificationSubtype["Voluntary"] = "VOLUNTARY"; NotificationSubtype["BillingRetry"] = "BILLING_RETRY"; NotificationSubtype["PriceIncrease"] = "PRICE_INCREASE"; NotificationSubtype["ProductNotForSale"] = "PRODUCT_NOT_FOR_SALE"; NotificationSubtype["GracePeriod"] = "GRACE_PERIOD"; NotificationSubtype["BillingRecovery"] = "BILLING_RECOVERY"; NotificationSubtype["Pending"] = "PENDING"; NotificationSubtype["Accepted"] = "ACCEPTED"; NotificationSubtype["Summary"] = "SUMMARY"; NotificationSubtype["Failure"] = "FAILURE"; })(NotificationSubtype = exports.NotificationSubtype || (exports.NotificationSubtype = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/sendattemptresult */ var SendAttemptResult; (function (SendAttemptResult) { SendAttemptResult["Success"] = "SUCCESS"; SendAttemptResult["TimedOut"] = "TIMED_OUT"; SendAttemptResult["TlsIssue"] = "TLS_ISSUE"; SendAttemptResult["CircularRedirect"] = "CIRCULAR_REDIRECT"; SendAttemptResult["NoResponse"] = "NO_RESPONSE"; SendAttemptResult["SocketIssue"] = "SOCKET_ISSUE"; SendAttemptResult["UnsupportedCharset"] = "UNSUPPORTED_CHARSET"; SendAttemptResult["InvalidResponse"] = "INVALID_RESPONSE"; SendAttemptResult["PrematureClose"] = "PREMATURE_CLOSE"; SendAttemptResult["Other"] = "OTHER"; })(SendAttemptResult = exports.SendAttemptResult || (exports.SendAttemptResult = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/extendreasoncode */ var ExtendReasonCode; (function (ExtendReasonCode) { ExtendReasonCode[ExtendReasonCode["UNDECLARED"] = 0] = "UNDECLARED"; ExtendReasonCode[ExtendReasonCode["CUSTOMER_SATISFACTION"] = 1] = "CUSTOMER_SATISFACTION"; ExtendReasonCode[ExtendReasonCode["OTHER_REASON"] = 2] = "OTHER_REASON"; ExtendReasonCode[ExtendReasonCode["SERVICE_ISSUE"] = 3] = "SERVICE_ISSUE"; })(ExtendReasonCode = exports.ExtendReasonCode || (exports.ExtendReasonCode = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/accounttenure */ var AccountTenure; (function (AccountTenure) { AccountTenure[AccountTenure["Undeclared"] = 0] = "Undeclared"; AccountTenure[AccountTenure["Between0_3Days"] = 1] = "Between0_3Days"; AccountTenure[AccountTenure["Between3_10Days"] = 2] = "Between3_10Days"; AccountTenure[AccountTenure["Between10_30Days"] = 3] = "Between10_30Days"; AccountTenure[AccountTenure["Between30_90Days"] = 4] = "Between30_90Days"; AccountTenure[AccountTenure["Between90_180Days"] = 5] = "Between90_180Days"; AccountTenure[AccountTenure["Between180_365Days"] = 6] = "Between180_365Days"; AccountTenure[AccountTenure["Over365Days"] = 7] = "Over365Days"; })(AccountTenure = exports.AccountTenure || (exports.AccountTenure = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/consumptionstatus */ var ConsumptionStatus; (function (ConsumptionStatus) { ConsumptionStatus[ConsumptionStatus["Undeclared"] = 0] = "Undeclared"; ConsumptionStatus[ConsumptionStatus["NotConsumed"] = 1] = "NotConsumed"; ConsumptionStatus[ConsumptionStatus["PartiallyConsumed"] = 2] = "PartiallyConsumed"; ConsumptionStatus[ConsumptionStatus["FullyConsumed"] = 3] = "FullyConsumed"; })(ConsumptionStatus = exports.ConsumptionStatus || (exports.ConsumptionStatus = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/deliverystatus */ var DeliveryStatus; (function (DeliveryStatus) { DeliveryStatus[DeliveryStatus["DeliveredAndWorkingProperly"] = 0] = "DeliveredAndWorkingProperly"; DeliveryStatus[DeliveryStatus["DidntDeliverDueToQualityIssue"] = 1] = "DidntDeliverDueToQualityIssue"; DeliveryStatus[DeliveryStatus["DeliveredWrongItem"] = 2] = "DeliveredWrongItem"; DeliveryStatus[DeliveryStatus["DidntDeliverDueToServerOutage"] = 3] = "DidntDeliverDueToServerOutage"; DeliveryStatus[DeliveryStatus["DidntDeliverDueToInGameCurrencyChange"] = 4] = "DidntDeliverDueToInGameCurrencyChange"; DeliveryStatus[DeliveryStatus["DidntDeliverDueToOtherReason"] = 5] = "DidntDeliverDueToOtherReason"; })(DeliveryStatus = exports.DeliveryStatus || (exports.DeliveryStatus = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarspurchased */ var LifetimeDollarsPurchased; (function (LifetimeDollarsPurchased) { LifetimeDollarsPurchased[LifetimeDollarsPurchased["Undeclared"] = 0] = "Undeclared"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["ZeroUSD"] = 1] = "ZeroUSD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Between_0_01_And_49_99USD"] = 2] = "Between_0_01_And_49_99USD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Between_50_And_99_99USD"] = 3] = "Between_50_And_99_99USD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Between_100_And_499_99USD"] = 4] = "Between_100_And_499_99USD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Between_500_And_999_99USD"] = 5] = "Between_500_And_999_99USD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Between_1000_And_1999_99USD"] = 6] = "Between_1000_And_1999_99USD"; LifetimeDollarsPurchased[LifetimeDollarsPurchased["Over_2000USD"] = 7] = "Over_2000USD"; })(LifetimeDollarsPurchased = exports.LifetimeDollarsPurchased || (exports.LifetimeDollarsPurchased = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/lifetimedollarsrefunded */ var LifetimeDollarsRefunded; (function (LifetimeDollarsRefunded) { LifetimeDollarsRefunded[LifetimeDollarsRefunded["Undeclared"] = 0] = "Undeclared"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["ZeroUSD"] = 1] = "ZeroUSD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Between_0_01_And_49_99USD"] = 2] = "Between_0_01_And_49_99USD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Between_50_And_99_99USD"] = 3] = "Between_50_And_99_99USD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Between_100_And_499_99USD"] = 4] = "Between_100_And_499_99USD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Between_500_And_999_99USD"] = 5] = "Between_500_And_999_99USD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Between_1000_And_1999_99USD"] = 6] = "Between_1000_And_1999_99USD"; LifetimeDollarsRefunded[LifetimeDollarsRefunded["Over_2000USD"] = 7] = "Over_2000USD"; })(LifetimeDollarsRefunded = exports.LifetimeDollarsRefunded || (exports.LifetimeDollarsRefunded = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/platform */ var Platform; (function (Platform) { Platform[Platform["Undeclared"] = 0] = "Undeclared"; Platform[Platform["Apple"] = 1] = "Apple"; Platform[Platform["NonApple"] = 2] = "NonApple"; })(Platform = exports.Platform || (exports.Platform = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/playtime */ var PlayTime; (function (PlayTime) { PlayTime[PlayTime["Undeclared"] = 0] = "Undeclared"; PlayTime[PlayTime["Between0_5Minutes"] = 1] = "Between0_5Minutes"; PlayTime[PlayTime["Between5_60Minutes"] = 2] = "Between5_60Minutes"; PlayTime[PlayTime["Between1_6Hours"] = 3] = "Between1_6Hours"; PlayTime[PlayTime["Between6_24Hours"] = 4] = "Between6_24Hours"; PlayTime[PlayTime["Between1_4Days"] = 5] = "Between1_4Days"; PlayTime[PlayTime["Between4_16Days"] = 6] = "Between4_16Days"; PlayTime[PlayTime["Over16Days"] = 7] = "Over16Days"; })(PlayTime = exports.PlayTime || (exports.PlayTime = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/refundpreference */ var RefundPreference; (function (RefundPreference) { RefundPreference[RefundPreference["Undeclared"] = 0] = "Undeclared"; RefundPreference[RefundPreference["PreferAppleGrantsRefund"] = 1] = "PreferAppleGrantsRefund"; RefundPreference[RefundPreference["PreferAppleDeclinesRefund"] = 2] = "PreferAppleDeclinesRefund"; RefundPreference[RefundPreference["NoPreference"] = 3] = "NoPreference"; })(RefundPreference = exports.RefundPreference || (exports.RefundPreference = {})); /** * https://developer.apple.com/documentation/appstoreserverapi/userstatus */ var UserStatus; (function (UserStatus) { UserStatus[UserStatus["Undeclared"] = 0] = "Undeclared"; UserStatus[UserStatus["AccountIsActive"] = 1] = "AccountIsActive"; UserStatus[UserStatus["AccountIsSuspended"] = 2] = "AccountIsSuspended"; UserStatus[UserStatus["AccountIsTerminated"] = 3] = "AccountIsTerminated"; UserStatus[UserStatus["AccountHasLimitedAccess"] = 4] = "AccountHasLimitedAccess"; })(UserStatus = exports.UserStatus || (exports.UserStatus = {}));