declare abstract class ApiBase { abstract _call(path: string, request: any): Promise; login_signin(req: ReqLoginSignin): Promise>; login_totp(req: ReqLoginTotp): Promise>; login_create(req: ReqLoginCreate): Promise>; login_totp_prepare(): Promise>; login_totp_setup(req: ReqLoginTotpSetup): Promise>; login_refresh(): Promise>; tunnels_create(req: ReqTunnelsCreate): Promise>; tunnels_delete(req: ReqTunnelsDelete): Promise>; tunnels_list(req: ReqTunnelsList): Promise>; tunnels_update(req: ReqTunnelsUpdate): Promise>; tunnels_firewall_assign(req: ReqTunnelsFirewallAssign): Promise>; agents_list(): Promise>; agents_delete(req: ReqAgentsDelete): Promise>; domains_list(): Promise>; domains_assign(req: ReqDomainsAssign): Promise>; domains_delete(req: ReqDomainsDelete): Promise>; agents_rename(req: ReqAgentsRename): Promise>; allocations_list(req: ReqAllocationsList): Promise>; tunnels_rename(req: ReqTunnelsRename): Promise>; shop_list(): Promise>; shop_add(req: ReqShopAdd): Promise>; shop_remove(req: ReqShopRemove): Promise>; billing_paymethods_list(): Promise>; firewalls_list(): Promise>; firewalls_create(req: ReqFirewallsCreate): Promise>; firewalls_update(req: ReqFirewallsUpdate): Promise>; claim_details(req: ReqClaimDetails): Promise>; claim_setup(req: ReqClaimSetup): Promise>; claim_exchange(req: ReqClaimExchange): Promise>; claim_accept(req: ReqClaimAccept): Promise>; claim_reject(req: ReqClaimReject): Promise>; subs_migrate(req: ReqSubsMigrate): Promise>; subs_list(): Promise>; subs_disable(req: ReqSubsDisable): Promise>; subs_enable(req: ReqSubsEnable): Promise>; domains_subdomain_create(req: ReqDomainSubdomainCreate): Promise>; shop_prices(): Promise>; shop_availability_custom_domain(req: ReqShopAvailabilityCustomDomain): Promise>; firewalls_rename(req: ReqFirewallsRename): Promise>; firewalls_delete(req: ReqFirewallsDelete): Promise>; login_create_guest(): Promise>; account_discord_set(req: ReqAccountDiscordSet): Promise>; account_discord_remove(): Promise>; account_overview(): Promise>; login_totp_remove(req: ReqLoginTotpRemove): Promise>; login_password_change(req: ReqLoginPasswordChange): Promise>; login_email_sendverify(): Promise>; login_email_verify(req: ReqLoginEmailVerify): Promise>; shop_checkout(): Promise>; billing_paymethods_addlink(req: ReqBillingPaymethodsAddLink): Promise>; billing_history(req: ReqBillingHistory): Promise>; allocations_create_ip6(): Promise>; analytics_bitrate(req: ReqAnalyticsBitrate): Promise>; tunnels_ratelimit(req: ReqTunnelsRatelimit): Promise>; analytics_summary(req: ReqAnalyticsSummary): Promise>; tunnels_enable(req: ReqTunnelsEnable): Promise>; login_guest(req: ReqLoginGuest): Promise>; login_session_upgrade(req: ReqLoginSessionUpgrade): Promise>; domains_external_add(req: ReqDomainsExternalAdd): Promise>; domains_external_remove(req: ReqDomainsExternalRemove): Promise>; billing_invoice_url(req: ReqBillingInvoiceUrl): Promise>; login_discourse_session(req: ReqLoginDiscourseSession): Promise>; login_reset_password(req: ReqLoginResetPassword): Promise>; login_reset_send(req: ReqLoginResetSend): Promise>; billing_paymethods_addcomplete(req: ReqBillingPaymethodsAddcomplete): Promise>; billing_paymethods_remove(req: ReqBillingPaymethodsRemove): Promise>; account_delete(req: ReqAccountDelete): Promise>; account_delete_stop(): Promise>; charge_get(req: ReqChargeGet): Promise>; charge_refund(req: ReqChargeRefund): Promise>; admin_possess(req: ReqAdminPossess): Promise>; admin_return(): Promise>; admin_verifyemail(req: ReqAdminVerify): Promise>; admin_finduser(req: ReqAdminFinduser): Promise>; billing_invoice_retry(req: ReqBillingInvoiceRetry): Promise>; admin_banaddress(req: ReqAdminBanaddress): Promise>; subs_invoices(req: ReqSubsInvoices): Promise>; pkts_volume(req: ReqPktsVolume): Promise>; } export default ApiBase; export type ApiResult = { status: "success"; data: S; } | { status: "fail"; data: F; } | { status: "error"; data: ApiResponseError; }; export type ApiResultNoFail = { status: "success"; data: S; } | { status: "error"; data: ApiResponseError; }; export type Option = T | null; export type Arc = T; export type Vec = T[]; export type ApiResponseError = { type: "validation"; message: string; } | { type: "path-not-found"; } | { type: "auth"; message: AuthError; } | { type: "internal"; }; export type String = string; export type AuthError = "AuthRequired" | "InvalidHeader" | "InvalidSignature" | "InvalidTimestamp" | "InvalidApiKey" | "InvalidAgentKey" | "SessionExpired" | "InvalidAuthType" | "ScopeNotAllowed" | "NoLongerValid" | "GuestAccountNotAllowed" | "EmailMustBeVerified" | "AccountDoesNotExist" | "AdminOnly"; export type ReqLoginSignin = LoginCredentials; export type LoginCredentials = { email: String; password: String; }; export type WebSession = { session_key: String; auth: WebAuth; }; export type WebAuth = { update_version: u32; account_id: u64; timestamp: u64; account_status: AccountStatus; totp_status: TotpStatus; admin_id: Option; }; export type u32 = number; export type u64 = number; export type AccountStatus = "guest" | "email-not-verified" | "verified"; export type TotpStatus = { status: "required"; } | { status: "not-setup"; } | { status: "signed"; } & SignedEpoch; export type SignedEpoch = { epoch_sec: u32; }; export type SigninFail = "IncorrectCredentials" | "AccountBanned"; export type ReqLoginTotp = { code: String; }; export type TotpFail = "InvalidCode" | "TotpNotSetup"; export type ReqLoginCreate = LoginCredentials; export type LoginCreateError = "EmailAlreadyInUse" | "AccountIsNotGuest" | "PasswordUnder8Chars"; export type ReqLoginTotpPrepare = {}; export type TotpSecret = { secret: String; }; export type TotpPrepareError = "AlreadySetup"; export type ReqLoginTotpSetup = { code: String; }; export type TotpSetupError = "InvalidCode" | "AlreadySetup" | "NotPrepared" | "InvalidAccount"; export type ReqLoginRefresh = {}; export type Undefined = undefined; export type ReqTunnelsCreate = { name: Option; tunnel_type: Option; port_type: PortType; port_count: u16; origin: TunnelOriginCreate; enabled: bool; alloc: Option; firewall_id: Option; }; export type TunnelType = "minecraft-java" | "minecraft-bedrock" | "valheim" | "terraria" | "starbound" | "rust" | "7days" | "unturned"; export type PortType = "tcp" | "udp" | "both"; export type u16 = number; export type TunnelOriginCreate = { type: "default"; data: AssignedDefaultCreate; } | { type: "agent"; data: AssignedAgentCreate; } | { type: "managed"; data: AssignedManagedCreate; }; export type AssignedDefaultCreate = { local_ip: IpAddr; local_port: Option; }; export type IpAddr = string; export type AssignedAgentCreate = { agent_id: Uuid; local_ip: IpAddr; local_port: Option; }; export type Uuid = string; export type AssignedManagedCreate = { agent_id: Option; }; export type bool = boolean; export type TunnelCreateUseAllocation = { type: "dedicated-ip"; details: UseAllocDedicatedIp; } | { type: "port-allocation"; details: UseAllocPortAlloc; }; export type UseAllocDedicatedIp = { ip_hostname: String; port: Option; }; export type UseAllocPortAlloc = { alloc_id: Uuid; }; export type ObjectId = { id: Uuid; }; export type TunnelCreateError = "AgentIdRequired" | "AgentNotFound" | "InvalidAgentId" | "DedicatedIpNotFound" | "DedicatedIpPortNotAvailable" | "DedicatedIpNotEnoughSpace" | "PortAllocNotFound" | "InvalidIpHostname" | "ManagedMissingAgentId"; export type ReqTunnelsDelete = { tunnel_id: Uuid; }; export type DeleteError = "TunnelNotFound"; export type ReqTunnelsList = { tunnel_id: Option; agent_id: Option; }; export type AccountTunnels = { tcp_alloc: AllocatedPorts; udp_alloc: AllocatedPorts; tunnels: Vec; }; export type AllocatedPorts = { allowed: u32; claimed: u32; desired: u32; }; export type AccountTunnel = { id: Uuid; tunnel_type: Option; created_at: DateTimeUtc; name: Option; port_type: PortType; port_count: u16; alloc: AccountTunnelAllocation; origin: TunnelOrigin; domain: Option; firewall_id: Option; ratelimit: Ratelimit; active: bool; }; export type DateTimeUtc = string; export type AccountTunnelAllocation = { status: "pending"; } | { status: "disabled"; } | { status: "allocated"; data: TunnelAllocated; }; export type TunnelAllocated = { id: Uuid; ip_hostname: String; assigned_domain: String; assigned_srv: Option; tunnel_ip: IpAddr; port_start: u16; port_end: u16; assignment: TunnelAssignment; ip_type: IpType; region: AllocationRegion; }; export type TunnelAssignment = { type: "dedicated-ip"; subscription: SubscriptionId; } | { type: "shared-ip"; } | { type: "dedicated-port"; subscription: SubscriptionId; }; export type SubscriptionId = { sub_id: Uuid; }; export type IpType = "both" | "ip4" | "ip6"; export type AllocationRegion = "smart-global" | "global" | "north-america" | "europe" | "asia" | "india" | "south-america"; export type TunnelOrigin = { type: "default"; data: AssignedDefault; } | { type: "agent"; data: AssignedAgent; } | { type: "managed"; data: AssignedManaged; }; export type AssignedDefault = { local_ip: IpAddr; local_port: Option; }; export type AssignedAgent = { agent_id: Uuid; agent_name: String; local_ip: IpAddr; local_port: Option; }; export type AssignedManaged = { agent_id: Uuid; agent_name: String; }; export type TunnelDomain = { id: Uuid; name: String; is_external: bool; parent: Option; source: TunnelDomainSource; }; export type TunnelDomainSource = "from-ip" | "from-tunnel" | "from-agent-ip"; export type Ratelimit = { bytes_per_second: Option; packets_per_second: Option; }; export type ReqTunnelsUpdate = { tunnel_id: Uuid; local_ip: IpAddr; local_port: Option; agent_id: Option; enabled: bool; }; export type UpdateError = "ChangingAgentIdNotAllowed" | "TunnelNotFound"; export type ReqTunnelsFirewallAssign = { tunnel_id: Uuid; firewall_id: Option; }; export type TunnelsFirewallAssignError = "TunnelNotFound" | "InvalidFirewallId"; export type ReqAgentsList = {}; export type Agents = { agents: Vec; }; export type Agent = { id: Uuid; name: String; created_at: DateTimeUtc; version: Option; agent_type: AgentType; details: AgentStatus; }; export type AgentType = "default" | "assignable" | "self-managed"; export type AgentStatus = { state: "disabled-above-limit"; } | { state: "disabled-by-user"; } | { state: "approval-needed"; } | { state: "connected"; data: AgentConnectedDetails; } | { state: "offline"; } | { state: "unknown"; }; export type AgentConnectedDetails = { tunnel_server_id: u64; data_center_id: u32; data_center_name: String; agent_version: u64; client_addr: SocketAddr; tunnel_addr: SocketAddr; activity_latest_epoch_ms: u64; activity_start_epoch_ms: u64; tunnel_latency_ms: u64; }; export type SocketAddr = string; export type ReqAgentsDelete = { agent_id: Uuid; tunnels_strategy: DeleteAgentTunnelStrategy; }; export type DeleteAgentTunnelStrategy = { type: "require_empty"; } | { type: "delete_tunnels"; } | { type: "move_to_agent"; details: TunnelStrategyMoveToAgent; }; export type TunnelStrategyMoveToAgent = { agent_id: Option; disable_tunnels: bool; }; export type AgentsDeleteError = "AgentNotFound" | "AgentNotAuthorized" | "TunnelStrategyNotAllowed" | "MoveToAgentNotFound" | "AgentHasExistingTunnels"; export type ReqDomainsList = {}; export type Domains = { domains: Vec; }; export type Domain = { id: Uuid; name: String; is_external: bool; parent: Option; sub_id: Uuid; target: Option; }; export type DomainTarget = { type: "ip-address"; details: DomainTargetIp; } | { type: "tunnel"; details: DomainTargetTunnel; } | { type: "external-cname"; details: DomainTargetExternalCName; } | { type: "agent"; details: DomainTargetAgent; }; export type DomainTargetIp = { ip_address: IpAddr; }; export type DomainTargetTunnel = { tunnel_id: Uuid; }; export type DomainTargetExternalCName = { cname: String; }; export type DomainTargetAgent = { agent_id: Uuid; ip_address: IpAddr; }; export type ReqDomainsAssign = { domain_id: Uuid; target: Option; remove_existing: bool; }; export type DomainAssignError = "TargetIpNotOwned" | "TargetAgentNotFound" | "TunnelNotFound" | "DomainNotFound"; export type ReqDomainsDelete = { domain_id: Uuid; }; export type DomainDeleteError = "DomainNotFound" | "CannotDeleteParentDomain"; export type ReqAgentsRename = { agent_id: Uuid; name: String; }; export type AgentRenameError = "AgentNotFound" | "InvalidName" | "InvalidAgentId"; export type ReqAllocationsList = { alloc_id: Option; }; export type AccountAllocations = { ports: Vec; ips: Vec; }; export type DedicatedPortAllocation = { alloc_id: Uuid; ip_hostname: String; port: u16; port_count: u16; port_type: PortType; sub_id: Uuid; region: AllocationRegion; tunnel_id: Option; ip_type: IpType; }; export type DedicatedIpAllocation = { ip_hostname: String; sub_id: Option; region: AllocationRegion; ip_type: IpType; }; export type ReqTunnelsRename = { tunnel_id: Uuid; name: String; }; export type TunnelRenameError = "TunnelNotFound" | "NameTooLong"; export type ReqShopList = {}; export type ShoppingList = { checkout_status: Option; items: Vec; due_today_cents: u32; available_credit_cents: i64; payment_method_status: Option; }; export type InvoiceStatus = "draft" | "open" | "paid" | "void" | "uncollectible"; export type ShoppingCartSubscription = { item: ShoppingCartItem; next_bill: SubNextBill; }; export type ShoppingCartItem = { id: Uuid; cost_per_month_cents: u32; months_per_charge: u32; auto_renew: bool; product: SubscriptionProduct; }; export type SubscriptionProduct = { type: "playit-premium"; } | { type: "dedicated-ip"; details: SubscriptionDedicatedIp; } | { type: "dedicated-ports"; details: SubscriptionDedicatedPorts; } | { type: "ports"; details: SubscriptionPorts; } | { type: "custom-domain"; details: SubscriptionCustomDomain; }; export type SubscriptionDedicatedIp = { region: AllocationRegion; }; export type SubscriptionDedicatedPorts = { region: AllocationRegion; required_ip_hostname: Option; port_number: u16; port_count: u16; }; export type SubscriptionPorts = { port_type: PortType; instances: u32; }; export type SubscriptionCustomDomain = { name: String; }; export type SubNextBill = { bill_date: NaiveDate; period_start: NaiveDate; period_end: NaiveDate; total_cost_cents: i32; month_credits_used: u32; status: SubNextBillStatus; }; export type NaiveDate = string; export type i32 = number; export type SubNextBillStatus = "Upcoming" | "Preparing"; export type i64 = number; export type AccountPaymentMethodStatus = "Ready" | "HasRecentFailure"; export type ReqShopAdd = { product: SubscriptionProduct; auto_renew: bool; months: u32; }; export type ShopAddError = "CustomerNotSetup" | "SubscriptionAlreadyActive" | "ItemAlreadyInCart" | "InvalidMonthCount" | "CustomDomainInvalid" | "CustomDomainInvalidLength" | "CustomDomainTaken" | "ProductComingSoon" | "ShoppingCartPurchasePending" | "RequiresPlayitPremium"; export type ReqShopRemove = { sub_id: Uuid; }; export type ShopRemoveError = "SubNotFound"; export type ReqBillingPaymethodsList = {}; export type PaymentMethods = { methods: Vec; default_payment_method: Option; balance_cents: i64; }; export type PaymentMethod = { id: String; method_type: PaymentMethodType; preview_info: PaymentMethodPreviewInfo; is_default: bool; last_charge: Option; }; export type PaymentMethodType = "acss_debit" | "afterpay_clearpay" | "alipay" | "au_becs_debit" | "bacs_debit" | "bancontact" | "boleto" | "card" | "card_present" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "interac_present" | "klarna" | "oxxo" | "p24" | "sepa_debit" | "sofort" | "wechat_pay"; export type PaymentMethodPreviewInfo = { method_type: PaymentMethodType; icon: String; description: String; expire: String; }; export type PaymentMethodLastCharge = { type: "Succeeded"; } | { type: "Failed"; details: PaymentMethodFailed; }; export type PaymentMethodFailed = { timestamp: DateTimeUtc; message: String; }; export type ReqFirewallsList = {}; export type Firewalls = { max_firewalls: u32; max_rules: u32; firewalls: Vec; }; export type Firewall = { id: Uuid; name: String; description: Option; created_at: DateTimeUtc; updated_at: DateTimeUtc; registered_at: Option; rules: String; rule_count: u32; tunnels_assigned_count: u32; }; export type ReqFirewallsCreate = { name: String; description: Option; rules: String; tunnel_id: Option; }; export type FirewallsCreateError = "TooManyFirewalls" | "TooManyRules" | "InvalidRules" | "InvalidTunnelId"; export type ReqFirewallsUpdate = { firewall_id: Uuid; rules: String; }; export type FirewallsUpdateError = "TooManyRules" | "InvalidRules" | "FirewallNotFound"; export type ReqClaimDetails = { code: String; }; export type AgentClaimDetails = { name: String; remote_ip: IpAddr; agent_type: AgentType; version: String; }; export type ClaimDetailsError = "AlreadyClaimed" | "AlreadyRejected" | "ClaimExpired" | "DifferentOwner" | "WaitingForAgent" | "InvalidCode"; export type ReqClaimSetup = { code: String; agent_type: AgentType; version: String; }; export type ClaimSetupResponse = "WaitingForUserVisit" | "WaitingForUser" | "UserAccepted" | "UserRejected"; export type ClaimSetupError = "InvalidCode" | "CodeExpired" | "VersionTextTooLong"; export type ReqClaimExchange = { code: String; }; export type AgentSecretKey = { secret_key: String; }; export type ClaimExchangeError = "CodeNotFound" | "CodeExpired" | "UserRejected" | "NotAccepted" | "NotSetup"; export type ReqClaimAccept = { code: String; name: String; agent_type: AgentType; }; export type AgentAccepted = { agent_id: Uuid; }; export type ClaimAcceptError = "InvalidCode" | "AgentNotReady" | "CodeNotFound" | "InvalidAgentType" | "ClaimAlreadyAccepted" | "ClaimRejected" | "CodeExpired" | "InvalidName"; export type ReqClaimReject = { code: String; }; export type ClaimRejectError = "CodeNotFound" | "ClaimAccepted" | "ClaimAlreadyRejected" | "CodeExpired" | "AgentNotReady"; export type ReqSubsMigrate = { sub_id: Uuid; }; export type SubMigrateError = "SubscriptionNotFound" | "MigrationNotNeeded" | "SubscriptionCanceled" | "MigrationNotReady"; export type ReqSubsList = {}; export type SubscriptionsList = { subscriptions: Vec; }; export type Subscription = { id: Uuid; created_at: DateTimeUtc; total_monthly_cost_cents: u32; months_per_charge: u32; product: SubProduct; status: SubStatus; requires_migration: bool; month_credits: u32; auto_renew: bool; }; export type SubProduct = { type: "playit-premium"; } | { type: "dedicated-ip"; details: SubProductDedicatedIp; } | { type: "udp-ports"; details: SubProductPortCount; } | { type: "tcp-ports"; details: SubProductPortCount; } | { type: "both-ports"; details: SubProductPortCount; } | { type: "custom-domain"; details: SubProductCustomDomain; } | { type: "dedicated-port-alloc"; details: SubsProductDedicatedPortAlloc; }; export type SubProductDedicatedIp = { ip_address: String; }; export type SubProductPortCount = { ports: u64; }; export type SubProductCustomDomain = { domain_id: Uuid; domain_name: String; }; export type SubsProductDedicatedPortAlloc = { alloc_id: Uuid; ip_address: String; port_number: u16; port_count: u16; port_type: PortType; }; export type SubStatus = { type: "Starting"; details: SubscriptionProcessing; } | { type: "Active"; details: SubscriptionActive; } | { type: "Renewing"; details: SubscriptionProcessing; } | { type: "Ended"; details: SubscriptionEnded; }; export type SubscriptionProcessing = { invoice_id: String; invoice_status: InvoiceStatus; item_amount_cents: u32; }; export type SubscriptionActive = { paid_till: NaiveDate; next_bill: SubNextBill; }; export type SubscriptionEnded = { ended_at: DateTimeUtc; }; export type ReqSubsDisable = { sub_id: Uuid; }; export type SubDisableError = "SubscriptionNotFound" | "SubscriptionEnded" | "TimeoutWaitingForAccountLock"; export type ReqSubsEnable = { sub_id: Uuid; }; export type SubEnableError = "SubscriptionNotFound" | "SubscriptionEnded" | "MigrationNeeded" | "NotAllowed"; export type ReqDomainSubdomainCreate = { parent_domain_id: Uuid; name: String; }; export type SubDomainCreated = { id: Uuid; }; export type DomainCreateError = "ParentDomainNotFound" | "TooManySubDomains" | "InvalidDomain" | "InvalidSubDomain" | "DuplicateDomain" | "InvalidParent"; export type ReqShopPrices = {}; export type ShopPrices = { custom_domain: ShopPrice; dedicated_ip_global: ShopPrice; dedicated_ip_regional: ShopPrice; playit_premium: ShopPrice; ports_both: ShopPrice; ports_tcp: ShopPrice; ports_udp: ShopPrice; dedicated_port_global: ShopPrice; dedicated_port_regional: ShopPrice; }; export type ShopPrice = { monthly: Option; yearly: Option; }; export type ReqShopAvailabilityCustomDomain = { name: String; }; export type IsAvailable = { is_available: bool; }; export type ReqFirewallsRename = { firewall_id: Uuid; name: String; }; export type FirewallsRenameError = "FirewallNotFound" | "InvalidNameLength"; export type ReqFirewallsDelete = { firewall_id: Uuid; }; export type FirewallsDeleteError = "FirewallNotFound"; export type ReqLoginCreateGuest = {}; export type LoginCreateGuestError = "Blocked"; export type ReqAccountDiscordSet = { access_token: String; }; export type AccountDiscordSetError = "MissingOriginHeader" | "InvalidCode" | "AlreadySet"; export type ReqAccountDiscordRemove = {}; export type AccountDiscordRemoveError = "AccountNotSet"; export type ReqAccountOverview = {}; export type AccountOverview = { account_id: u64; created_at: DateTimeUtc; account_status: AccountStatus; email: Option; email_change: Option; email_verified: bool; discord_connected: bool; totp_setup: TotpSetup; purchases_restricted: bool; has_premium: bool; month_usage_bytes: u64; failed_invoice_id: Option; delete_scheduled_at: Option; notice: Option; }; export type PendingEmailChange = { new_email: String; old_email_verified: bool; new_email_verified: bool; }; export type TotpSetup = "NotSetup" | "HasProposed" | "Setup"; export type AccountNotice = { type: "banned"; details: AccountBanned; } | { type: "message"; details: AccountMessage; } | { type: "deleted-scheduled"; details: AccountDeleteScheduled; }; export type AccountBanned = { reason: String; banned_till: Option; }; export type AccountMessage = { message: String; }; export type AccountDeleteScheduled = { scheduled_at: DateTimeUtc; }; export type ReqLoginTotpRemove = { code: String; }; export type TotpRemoveError = "InvalidCode" | "TotpNotSetup"; export type ReqLoginPasswordChange = { current_password: String; updated_password: String; totp_code: Option; }; export type PasswordChangeError = "WrongPassword" | "InvalidUpdatedPasswordLen" | "InvalidTotpCode" | "MissingTotpCode" | "GuestAccount"; export type ReqLoginEmailSendVerify = {}; export type EmailSendVerifyError = "GuestAccount" | "AlreadyVerified" | "SentRecently"; export type ReqLoginEmailVerify = { code: String; }; export type EmailVerifyError = "GuestAccount" | "AlreadyVerified" | "InvalidCode" | "CodeExpired"; export type ReqShopCheckout = {}; export type ShopCheckoutComplete = { invoice_id: String; }; export type ShopCheckoutError = { type: "EmptyCart"; } | { type: "CartError"; details: CartErrors; } | { type: "PurchasesBlockedForUser"; } | { type: "CustomerNotReady"; }; export type CartErrors = { errors: Vec; }; export type CartItemError = { sub_id: Uuid; error: CartError; }; export type CartError = "AlreadyPurchased" | "ProductNotAvailable" | "OutOfStock" | "ItemAlreadySold" | "ReachedAccountLimit" | "RequiresPlayitPremium"; export type ReqBillingPaymethodsAddLink = { source: "Checkout"; } | { source: "BalancePage"; } | { source: "InvoicePage"; details: InvoicePageAddLink; }; export type InvoicePageAddLink = { invoice_id: String; }; export type PaymentMethodSetupLink = { url: String; }; export type PaymentMethodAddLinkError = "CustomerNotSetup"; export type ReqBillingHistory = { invoice_id: Option; before: Option; limit: Option; include_items: Option; }; export type BillingHistory = { invoices: Vec; has_more: bool; }; export type BillingInvoice = { invoice_id: String; reference_code: Option; created_at: DateTimeUtc; currency: String; invoice_type: InvoiceType; invoice_status: InvoiceCurrentStatus; charge_failure_message: Option; total_charge_cents: i32; total_invoice_cents: i32; amount_refunded_cents: i32; payment_method_id: Option; payment_method_preview: Option; items: Option>; }; export type InvoiceType = "Subscription" | "StartSubscription" | "StripeSubscription"; export type InvoiceCurrentStatus = "draft" | "open" | "paid" | "void" | "uncollectible" | "refunded" | "refund-requested" | "fraud-reported" | "disputed"; export type BillingInvoiceItem = { charge_cents: u32; sub_id: Uuid; sub_canceled_at: Option; details: SubProduct; period_start: DateTimeUtc; period_end: DateTimeUtc; }; export type ReqAllocationsCreateIp6 = {}; export type Ip6Created = { ip_hostname: String; }; export type CreateIp6Error = "PlayitPremiumRequired" | "ReachedAccountLimit"; export type ReqAnalyticsBitrate = { filter: BitrateFilter; view: AnalyticsPeriod; show_peak: bool; }; export type BitrateFilter = { type: "account"; } | { type: "tunnel"; details: BitrateTunnelFilter; } | { type: "client"; details: BitrateClientFilter; }; export type BitrateTunnelFilter = { tunnel_id: Uuid; }; export type BitrateClientFilter = { client_ip: IpAddr; tunnel_id: Option; }; export type AnalyticsPeriod = "PastHour" | "PastDay" | "PastWeek"; export type BitrateHistory = { history: Vec; }; export type BitrateEntry = { epoch_sec: u64; upload_bps: f64; download_bps: f64; }; export type f64 = number; export type AnalyticsBitrateError = "TunnelNotFoundOrReady"; export type ReqTunnelsRatelimit = { tunnel_id: Uuid; bytes_per_second: Option; packets_per_second: Option; }; export type TunnelRatelimitError = "TunnelNotFound" | "InvalidRatelimit" | "PlayitPremiumRequired"; export type ReqAnalyticsSummary = { tunnel_id: Option; client_ip: Option; view: AnalyticsPeriod; }; export type AnalyticsSummary = { tunnels: Vec; clients: Vec; }; export type TunnelSummary = { tunnel_id: Uuid; summary: SummaryStats; }; export type SummaryStats = { total_upload_bytes: u64; total_download_bytes: u64; max_upload_pps: u64; max_download_pps: u64; last_use: DateTimeUtc; }; export type ClientSummary = { client_ip: IpAddr; summary: SummaryStats; }; export type ReqTunnelsEnable = { tunnel_id: Uuid; enabled: bool; }; export type TunnelEnableError = "TunnelNotFound"; export type ReqLoginGuest = { agent_secret: String; }; export type GuestLoginError = "InvalidSecret" | "AccountIsNotGuest"; export type ReqLoginSessionUpgrade = { old_session: String; }; export type SessionUpgradeError = "OldSessionInvalid" | "OldSessionExpired"; export type ReqDomainsExternalAdd = { name: String; }; export type ExternalDomainAdded = { id: Uuid; }; export type ExternalDomainAddError = "PlayitPremiumRequired" | "RanIntoLimit" | "InvalidDomain" | "DuplicateDomain" | "ParentDomainAlreadyAdded" | "SubDomainAlreadyAdded" | "InvalidDomainDepth"; export type ReqDomainsExternalRemove = { domain_id: Uuid; }; export type ExternalDomainRemoveError = "DomainNotExternal" | "DomainNotFound" | "SubDomainExists"; export type ReqBillingInvoiceUrl = { request: InvoiceRequested; }; export type InvoiceRequested = { type: "pending-checkout"; } | { type: "invoice"; details: SpecificInvoice; }; export type SpecificInvoice = { invoice_id: String; }; export type InvoiceUrl = { invoice_status: Option; url: Option; }; export type ReqLoginDiscourseSession = { nonce_payload: String; signature: String; }; export type DiscourseSession = { payload: String; signature: String; }; export type DiscourseSessionError = "InvalidSignature" | "FailedToParseNoncePayload"; export type ReqLoginResetPassword = { email: String; reset_code: String; new_password: String; }; export type PasswordResetError = "ResetCodeExpired" | "InvalidResetCode" | "InvalidNewPassword"; export type ReqLoginResetSend = { email: String; }; export type ReqBillingPaymethodsAddcomplete = { session_id: String; }; export type PaymentMethodsAddCompleteError = "InvalidSessionId" | "SessionNotComplete"; export type ReqBillingPaymethodsRemove = { method_id: String; }; export type PaymentMethodsRemoveError = "InvalidMethodId" | "StripeCustomerNotSetup" | "FailedToUpdateCustomer"; export type ReqAccountDelete = { auth: Option; }; export type AccountAuthDetails = { email: String; password: String; totp: Option; }; export type AccountDeleteError = "CredentialRequired" | "InvalidCredentials" | "InvalidTotp" | "AccountHasSubscription" | "AccountBanned"; export type ReqAccountDeleteStop = {}; export type ReqChargeGet = { reference_code: String; }; export type ChargeDetails = { reference_code: String; created_at: DateTimeUtc; invoice_type: InvoiceType; invoice_status: InvoiceStatus; total_cost: String; items: Vec; refund: Option; }; export type ChargeDetailsItem = { product: SubProductType; months: u32; total_cost: String; }; export type SubProductType = "playit-premium" | "dedicated-ip" | "udp-ports" | "tcp-ports" | "both-ports" | "custom-domain" | "dedicated-port-alloc"; export type RefundStatus = { type: "Pending"; details: PendingRefundRequest; } | { type: "Applied"; details: RefundApplied; } | { type: "DisputeCreated"; details: DisputeCreated; }; export type PendingRefundRequest = { created_at: DateTimeUtc; reason: RefundRequestReason; }; export type RefundRequestReason = "fraud" | "not-satisfied" | "issuer-fraud-warning"; export type RefundApplied = { created_at: DateTimeUtc; refund_amount: String; }; export type DisputeCreated = { created_at: DateTimeUtc; }; export type ChargeGetError = "ChargeNotFound"; export type ReqChargeRefund = { reference_code: String; reason: RefundRequestReason; email: Option; refund_message: Option; }; export type ChargeRefundError = "ChargeNotFound" | "MessageTooLarge" | "UnauthorizedReason"; export type ReqAdminPossess = { account_id: i64; }; export type AdminPossessError = "AccountNotFound"; export type ReqAdminReturn = {}; export type AdminReturnError = "NotInSession"; export type ReqAdminVerify = { email: String; }; export type AdminEmailVerifyError = "EmailNotFound" | "AlreadyVerified"; export type ReqAdminFinduser = { search: String; }; export type AccountFound = { account_id: Option; }; export type ReqBillingInvoiceRetry = { invoice_id: String; }; export type InvoiceRetryError = { error: "InvoiceNotFound"; } | { error: "InvoiceAlreadyPaid"; } | { error: "InvoiceIsVoid"; } | { error: "InvoiceIsDraft"; } | { error: "MissingPaymentMethod"; } | { error: "FailedToPay"; details: StripePayFailMessage; }; export type StripePayFailMessage = { message: String; }; export type ReqAdminBanaddress = { ban_duration: BanDuration; report_time: Option; address: String; notes: Option; reason: String; port_type: TcpOrUdp; allow_double_ban: bool; }; export type BanDuration = "day" | "week" | "month" | "year"; export type TcpOrUdp = "tcp" | "tcp"; export type AccountBannedId = { ban_id: i64; }; export type AdminAddressBanError = "InvalidAddress" | "MissingPort" | "AddressUsageNotFound" | "AlreadyBanned"; export type ReqSubsInvoices = { sub_id: Uuid; }; export type SubInvoiceList = { sub_id: Uuid; invoices: Vec; }; export type SubscriptionInvoice = { id: String; invoice_id: String; reference_code: String; invoice_status: InvoiceCurrentStatus; created_at: DateTimeUtc; item_cost_cents: u32; invoice_cost_cents: u32; period_start: NaiveDate; period_end: NaiveDate; }; export type SubInvoicesError = "SubscriptionNotFound"; export type ReqPktsVolume = { ts_start: u64; ts_end: u64; segments: Vec; filter: Option; }; export type PktAttr = "Datacenter" | "Server" | "SrcIp" | "SrcPort" | "DstIp" | "DstPort" | "IpProto" | "Checksum" | "DataLen" | "TcpFlags" | "TcpWindow" | "IcmpType" | "IcmpCode" | "ActionResult"; export type PacketFilter = { type: "IpEqual"; value: IpFilter; } | { type: "ByteEqual"; value: ByteFilter; } | { type: "NumEqual"; value: NumFilter; } | { type: "And"; value: FilterGroup; } | { type: "Or"; value: FilterGroup; }; export type IpFilter = { key: PktIpAttr; value: IpAddr; }; export type PktIpAttr = "SrcIp" | "DstIp"; export type ByteFilter = { key: PktByteAttr; value: u8; }; export type PktByteAttr = "IpProto" | "TcpFlags" | "TcpWindow" | "IcmpType" | "IcmpCode" | "ActionNumber"; export type u8 = number; export type NumFilter = { key: PktNumAttr; value: u16; }; export type PktNumAttr = "SrcPort" | "DstPort" | "Checksum" | "DataLen"; export type FilterGroup = { items: Vec; }; export type PacketVolumeHistory = { ts_start: u64; ts_end: u64; granularity_ms: u64; filter: Option; segment_keys: Vec; data: Vec; }; export type VolumeSegment = { segment_key: PacketVolumeKey; history: Vec; }; export type PacketVolumeKey = { dc_id: PlayitDataCenter; server_id: u32; src_ip: IpAddr; dst_ip: IpAddr; src_port: u16; dst_port: u16; checksum: u16; data_len: u16; ip_proto_num: u8; ip_proto: IpProto; tcp_flags: u8; tcp_window: u16; icmp_type: u8; icmp_code: u8; action_result: ProcessResult; }; export type PlayitDataCenter = "SameDc" | "LosAngeles1" | "Atlanta1" | "Chicago1" | "Dallas1" | "MexicoCity1" | "Miami1" | "NewJersey1" | "Seattle1" | "SiliconValley1" | "Toronto1" | "Stockholm1" | "London1" | "Amsterdam1" | "Frankfurt1" | "Paris1" | "Tokyo1" | "Seoul1" | "Singapore1" | "Sydney1" | "SaoPaulo1" | "Madrid1" | "Warsaw1" | "Melbourne1" | "LasVegas1" | "Mumbai1" | "KansasCity1" | "Honolulu1" | "Mumbai2" | "Dallas2" | "NewYork1" | "Miami2" | "Bangalore1" | "Delhi1" | "Santiago1" | "TelAviv1"; export type IpProto = "Hopopt" | "Icmp" | "Igmp" | "Ggp" | "IpInIp" | "St" | "Tcp" | "Udp" | "Rdp" | "Gre" | "Esp" | "Ip6Icmp" | "Unknown"; export type ProcessResult = "Unknown" | "DataProcessed" | "DataSent" | "PacketQueued" | "NoPortAction" | "InternalError" | "InvalidPacket" | "InvalidPacketForAction" | "InvalidFlowAction" | "Blocked" | "PacketIgnored" | "NotImplemented" | "_End"; export type PacketVolumeValue = { ts: u64; capture_bytes: u64; capture_count: u64; packet_total: u64; }; export type PktVolumeError = "AdminRequired" | "InvalidTimeRange";