feat: start of cross platform page system (#4731)

* feat: abstract api-client DI into ui package

* feat: cross platform page system

* feat: tanstack as cross platform useAsyncData

* feat: archon servers routes + labrinth billing routes

* fix: dont use partial

* feat: migrate server list page to tanstack + api-client + re-enabled broken features!

* feat: migrate servers manage page to api-client before page system

* feat: migrate manage page to page system

* fix: type issues

* fix: upgrade wrapper bugs

* refactor: move state types into api-client

* feat: disable financial stuff on app frontend

* feat: finalize cross platform page system for now

* fix: lint

* fix: build issues

* feat: remove papaparse

* fix: lint

* fix: interface error

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Calum H.
2025-11-14 17:15:09 +00:00
committed by GitHub
parent 26feaf753a
commit 7ccc32675b
79 changed files with 2631 additions and 1259 deletions

View File

@@ -0,0 +1,189 @@
import { AbstractModule } from '../../../core/abstract-module'
import type { Labrinth } from '../types'
export class LabrinthBillingInternalModule extends AbstractModule {
public getModuleID(): string {
return 'labrinth_billing_internal'
}
/**
* Get user's subscriptions
* GET /_internal/billing/subscriptions
*/
public async getSubscriptions(
userId?: string,
): Promise<Labrinth.Billing.Internal.UserSubscription[]> {
const params = userId ? `?user_id=${userId}` : ''
return this.client.request<Labrinth.Billing.Internal.UserSubscription[]>(
`/billing/subscriptions${params}`,
{
api: 'labrinth',
version: 'internal',
method: 'GET',
},
)
}
/**
* Get available products for purchase
* GET /_internal/billing/products
*/
public async getProducts(): Promise<Labrinth.Billing.Internal.Product[]> {
return this.client.request<Labrinth.Billing.Internal.Product[]>('/billing/products', {
api: 'labrinth',
version: 'internal',
method: 'GET',
})
}
/**
* Get Stripe customer information
* GET /_internal/billing/customer
*/
public async getCustomer(): Promise<unknown> {
return this.client.request<unknown>('/billing/customer', {
api: 'labrinth',
version: 'internal',
method: 'GET',
})
}
/**
* Edit a subscription (change product, interval, cancel, etc.)
* PATCH /_internal/billing/subscription/{id}
*/
public async editSubscription(
id: string,
edit: Labrinth.Billing.Internal.EditSubscriptionRequest,
dry?: boolean,
): Promise<Labrinth.Billing.Internal.EditSubscriptionResponse | void> {
const params = dry ? '?dry=true' : ''
return this.client.request<Labrinth.Billing.Internal.EditSubscriptionResponse | void>(
`/billing/subscription/${id}${params}`,
{
api: 'labrinth',
version: 'internal',
method: 'PATCH',
body: edit,
},
)
}
/**
* Get user's payment methods
* GET /_internal/billing/payment_methods
*/
public async getPaymentMethods(): Promise<unknown[]> {
return this.client.request<unknown[]>('/billing/payment_methods', {
api: 'labrinth',
version: 'internal',
method: 'GET',
})
}
/**
* Initiate flow to add a new payment method
* POST /_internal/billing/payment_method
*/
public async addPaymentMethodFlow(): Promise<Labrinth.Billing.Internal.AddPaymentMethodFlowResponse> {
return this.client.request<Labrinth.Billing.Internal.AddPaymentMethodFlowResponse>(
'/billing/payment_method',
{
api: 'labrinth',
version: 'internal',
method: 'POST',
},
)
}
/**
* Edit a payment method (set as primary)
* PATCH /_internal/billing/payment_method/{id}
*/
public async editPaymentMethod(
id: string,
body: Labrinth.Billing.Internal.EditPaymentMethodRequest,
): Promise<void> {
return this.client.request<void>(`/billing/payment_method/${id}`, {
api: 'labrinth',
version: 'internal',
method: 'PATCH',
body,
})
}
/**
* Remove a payment method
* DELETE /_internal/billing/payment_method/{id}
*/
public async removePaymentMethod(id: string): Promise<void> {
return this.client.request<void>(`/billing/payment_method/${id}`, {
api: 'labrinth',
version: 'internal',
method: 'DELETE',
})
}
/**
* Get payment history (charges)
* GET /_internal/billing/payments
*/
public async getPayments(userId?: string): Promise<Labrinth.Billing.Internal.Charge[]> {
const params = userId ? `?user_id=${userId}` : ''
return this.client.request<Labrinth.Billing.Internal.Charge[]>(`/billing/payments${params}`, {
api: 'labrinth',
version: 'internal',
method: 'GET',
})
}
/**
* Initiate a payment
* POST /_internal/billing/payment
*/
public async initiatePayment(
request: Labrinth.Billing.Internal.InitiatePaymentRequest,
): Promise<Labrinth.Billing.Internal.InitiatePaymentResponse> {
return this.client.request<Labrinth.Billing.Internal.InitiatePaymentResponse>(
'/billing/payment',
{
api: 'labrinth',
version: 'internal',
method: 'POST',
body: request,
},
)
}
/**
* Refund a charge (Admin only)
* POST /_internal/billing/charge/{id}/refund
*/
public async refundCharge(
id: string,
refund: Labrinth.Billing.Internal.RefundChargeRequest,
): Promise<void> {
return this.client.request<void>(`/billing/charge/${id}/refund`, {
api: 'labrinth',
version: 'internal',
method: 'POST',
body: refund,
})
}
/**
* Credit subscriptions (Admin only)
* POST /_internal/billing/credit
*/
public async credit(request: Labrinth.Billing.Internal.CreditRequest): Promise<void> {
return this.client.request<void>('/billing/credit', {
api: 'labrinth',
version: 'internal',
method: 'POST',
body: request,
})
}
}

View File

@@ -1,2 +1,4 @@
export * from './billing/internal'
export * from './projects/v2'
export * from './projects/v3'
export * from './state'

View File

@@ -1,115 +0,0 @@
export type Environment = 'required' | 'optional' | 'unsupported' | 'unknown'
export type ProjectStatus =
| 'approved'
| 'archived'
| 'rejected'
| 'draft'
| 'unlisted'
| 'processing'
| 'withheld'
| 'scheduled'
| 'private'
| 'unknown'
export type MonetizationStatus = 'monetized' | 'demonetized' | 'force-demonetized'
export type ProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader' | 'plugin' | 'datapack'
export type GalleryImageV2 = {
url: string
featured: boolean
title?: string
description?: string
created: string
ordering: number
}
export type DonationLinkV2 = {
id: string
platform: string
url: string
}
export type ProjectV2 = {
id: string
slug: string
project_type: ProjectType
team: string
title: string
description: string
body: string
published: string
updated: string
approved?: string
queued?: string
status: ProjectStatus
requested_status?: ProjectStatus
moderator_message?: {
message: string
body?: string
}
license: {
id: string
name: string
url?: string
}
client_side: Environment
server_side: Environment
downloads: number
followers: number
categories: string[]
additional_categories: string[]
game_versions: string[]
loaders: string[]
versions: string[]
icon_url?: string
issues_url?: string
source_url?: string
wiki_url?: string
discord_url?: string
donation_urls?: DonationLinkV2[]
gallery?: GalleryImageV2[]
color?: number
thread_id: string
monetization_status: MonetizationStatus
}
export type SearchResultHit = {
project_id: string
project_type: ProjectType
slug: string
author: string
title: string
description: string
categories: string[]
display_categories: string[]
versions: string[]
downloads: number
follows: number
icon_url: string
date_created: string
date_modified: string
latest_version?: string
license: string
client_side: Environment
server_side: Environment
gallery: string[]
color?: number
}
export type SearchResult = {
hits: SearchResultHit[]
offset: number
limit: number
total_hits: number
}
export type ProjectSearchParams = {
query?: string
facets?: string[][]
filters?: string
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
offset?: number
limit?: number
}

View File

@@ -1,54 +0,0 @@
import type { MonetizationStatus, ProjectStatus } from './v2'
export type GalleryItemV3 = {
url: string
raw_url: string
featured: boolean
name?: string
description?: string
created: string
ordering: number
}
export type LinkV3 = {
platform: string
donation: boolean
url: string
}
export type ProjectV3 = {
id: string
slug?: string
project_types: string[]
games: string[]
team_id: string
organization?: string
name: string
summary: string
description: string
published: string
updated: string
approved?: string
queued?: string
status: ProjectStatus
requested_status?: ProjectStatus
license: {
id: string
name: string
url?: string
}
downloads: number
followers: number
categories: string[]
additional_categories: string[]
loaders: string[]
versions: string[]
icon_url?: string
link_urls: Record<string, LinkV3>
gallery: GalleryItemV3[]
color?: number
thread_id: string
monetization_status: MonetizationStatus
side_types_migration_review_status: 'reviewed' | 'pending'
[key: string]: unknown
}

View File

@@ -1,5 +1,5 @@
import { AbstractModule } from '../../../core/abstract-module'
import type { ProjectSearchParams, ProjectV2, SearchResult } from './types/v2'
import type { Labrinth } from '../types'
export class LabrinthProjectsV2Module extends AbstractModule {
public getModuleID(): string {
@@ -18,8 +18,8 @@ export class LabrinthProjectsV2Module extends AbstractModule {
* console.log(project.title) // "Sodium"
* ```
*/
public async get(id: string): Promise<ProjectV2> {
return this.client.request<ProjectV2>(`/project/${id}`, {
public async get(id: string): Promise<Labrinth.Projects.v2.Project> {
return this.client.request<Labrinth.Projects.v2.Project>(`/project/${id}`, {
api: 'labrinth',
version: 2,
method: 'GET',
@@ -37,8 +37,8 @@ export class LabrinthProjectsV2Module extends AbstractModule {
* const projects = await client.labrinth.projects_v2.getMultiple(['sodium', 'lithium', 'phosphor'])
* ```
*/
public async getMultiple(ids: string[]): Promise<ProjectV2[]> {
return this.client.request<ProjectV2[]>(`/projects`, {
public async getMultiple(ids: string[]): Promise<Labrinth.Projects.v2.Project[]> {
return this.client.request<Labrinth.Projects.v2.Project[]>(`/projects`, {
api: 'labrinth',
version: 2,
method: 'GET',
@@ -61,8 +61,10 @@ export class LabrinthProjectsV2Module extends AbstractModule {
* })
* ```
*/
public async search(params: ProjectSearchParams): Promise<SearchResult> {
return this.client.request<SearchResult>(`/search`, {
public async search(
params: Labrinth.Projects.v2.ProjectSearchParams,
): Promise<Labrinth.Projects.v2.SearchResult> {
return this.client.request<Labrinth.Projects.v2.SearchResult>(`/search`, {
api: 'labrinth',
version: 2,
method: 'GET',
@@ -83,7 +85,7 @@ export class LabrinthProjectsV2Module extends AbstractModule {
* })
* ```
*/
public async edit(id: string, data: Partial<ProjectV2>): Promise<void> {
public async edit(id: string, data: Partial<Labrinth.Projects.v2.Project>): Promise<void> {
return this.client.request(`/project/${id}`, {
api: 'labrinth',
version: 2,

View File

@@ -1,5 +1,5 @@
import { AbstractModule } from '../../../core/abstract-module'
import type { ProjectV3 } from './types/v3'
import type { Labrinth } from '../types'
export class LabrinthProjectsV3Module extends AbstractModule {
public getModuleID(): string {
@@ -18,8 +18,8 @@ export class LabrinthProjectsV3Module extends AbstractModule {
* console.log(project.project_types) // v3 field
* ```
*/
public async get(id: string): Promise<ProjectV3> {
return this.client.request<ProjectV3>(`/project/${id}`, {
public async get(id: string): Promise<Labrinth.Projects.v3.Project> {
return this.client.request<Labrinth.Projects.v3.Project>(`/project/${id}`, {
api: 'labrinth',
version: 3,
method: 'GET',
@@ -37,8 +37,8 @@ export class LabrinthProjectsV3Module extends AbstractModule {
* const projects = await client.labrinth.projects_v3.getMultiple(['sodium', 'lithium'])
* ```
*/
public async getMultiple(ids: string[]): Promise<ProjectV3[]> {
return this.client.request<ProjectV3[]>(`/projects`, {
public async getMultiple(ids: string[]): Promise<Labrinth.Projects.v3.Project[]> {
return this.client.request<Labrinth.Projects.v3.Project[]>(`/projects`, {
api: 'labrinth',
version: 3,
method: 'GET',
@@ -59,7 +59,7 @@ export class LabrinthProjectsV3Module extends AbstractModule {
* })
* ```
*/
public async edit(id: string, data: Partial<ProjectV3>): Promise<void> {
public async edit(id: string, data: Labrinth.Projects.v3.EditProjectRequest): Promise<void> {
return this.client.request(`/project/${id}`, {
api: 'labrinth',
version: 3,

View File

@@ -0,0 +1,135 @@
import { AbstractModule } from '../../../core/abstract-module'
import type { Labrinth } from '../types'
export class LabrinthStateModule extends AbstractModule {
public getModuleID(): string {
return 'labrinth_state'
}
/**
* Build the complete generated state by fetching from multiple endpoints
*
* @returns Promise resolving to the generated state containing categories, loaders, products, etc.
*
* @example
* ```typescript
* const state = await client.labrinth.state.build()
* console.log(state.products) // Available billing products
* ```
*/
public async build(): Promise<Labrinth.State.GeneratedState> {
const errors: unknown[] = []
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleError = (err: any, defaultValue: any) => {
console.error('Error fetching state data:', err)
errors.push(err)
return defaultValue
}
// TODO: as we add new modules, move these raw requests to actual
// abstractions
const [
categories,
loaders,
gameVersions,
donationPlatforms,
reportTypes,
homePageProjects,
homePageSearch,
homePageNotifs,
products,
muralBankDetails,
iso3166Data,
] = await Promise.all([
// Tag endpoints
this.client
.request<Labrinth.Tags.v2.Category[]>('/tag/category', {
api: 'labrinth',
version: 2,
method: 'GET',
})
.catch((err) => handleError(err, [])),
this.client
.request<Labrinth.Tags.v2.Loader[]>('/tag/loader', {
api: 'labrinth',
version: 2,
method: 'GET',
})
.catch((err) => handleError(err, [])),
this.client
.request<Labrinth.Tags.v2.GameVersion[]>('/tag/game_version', {
api: 'labrinth',
version: 2,
method: 'GET',
})
.catch((err) => handleError(err, [])),
this.client
.request<Labrinth.Tags.v2.DonationPlatform[]>('/tag/donation_platform', {
api: 'labrinth',
version: 2,
method: 'GET',
})
.catch((err) => handleError(err, [])),
this.client
.request<string[]>('/tag/report_type', { api: 'labrinth', version: 2, method: 'GET' })
.catch((err) => handleError(err, [])),
// Homepage data
this.client
.request<Labrinth.Projects.v2.Project[]>('/projects_random', {
api: 'labrinth',
version: 2,
method: 'GET',
params: { count: '60' },
})
.catch((err) => handleError(err, [])),
this.client
.request<Labrinth.Search.v2.SearchResults>('/search', {
api: 'labrinth',
version: 2,
method: 'GET',
params: { limit: '3', query: 'leave', index: 'relevance' },
})
.catch((err) => handleError(err, {} as Labrinth.Search.v2.SearchResults)),
this.client
.request<Labrinth.Search.v2.SearchResults>('/search', {
api: 'labrinth',
version: 2,
method: 'GET',
params: { limit: '3', query: '', index: 'updated' },
})
.catch((err) => handleError(err, {} as Labrinth.Search.v2.SearchResults)),
// Internal billing/mural endpoints
this.client.labrinth.billing_internal.getProducts().catch((err) => handleError(err, [])),
this.client
.request<{ bankDetails: Record<string, { bankNames: string[] }> }>('/mural/bank-details', {
api: 'labrinth',
version: 'internal',
method: 'GET',
})
.catch((err) => handleError(err, null)),
// ISO3166 country and subdivision data
this.client.iso3166.data
.build()
.catch((err) => handleError(err, { countries: [], subdivisions: {} })),
])
return {
categories,
loaders,
gameVersions,
donationPlatforms,
reportTypes,
homePageProjects,
homePageSearch,
homePageNotifs,
products,
muralBankDetails: muralBankDetails?.bankDetails,
countries: iso3166Data.countries,
subdivisions: iso3166Data.subdivisions,
errors,
}
}
}

View File

@@ -0,0 +1,453 @@
import type { ISO3166 } from '../iso3166/types'
export namespace Labrinth {
export namespace Billing {
export namespace Internal {
export type PriceDuration = 'five-days' | 'monthly' | 'quarterly' | 'yearly'
export type SubscriptionStatus = 'provisioned' | 'unprovisioned'
export type UserSubscription = {
id: string
user_id: string
price_id: string
interval: PriceDuration
status: SubscriptionStatus
created: string // ISO datetime string
metadata?: SubscriptionMetadata
}
export type SubscriptionMetadata =
| { type: 'pyro'; id: string; region?: string }
| { type: 'medal'; id: string }
export type ChargeStatus =
| 'open'
| 'processing'
| 'succeeded'
| 'failed'
| 'cancelled'
| 'expiring'
export type ChargeType = 'one-time' | 'subscription' | 'proration' | 'refund'
export type PaymentPlatform = 'Stripe' | 'None'
export type Charge = {
id: string
user_id: string
price_id: string
amount: number
currency_code: string
status: ChargeStatus
due: string // ISO datetime string
last_attempt: string | null // ISO datetime string
type: ChargeType
subscription_id: string | null
subscription_interval: PriceDuration | null
platform: PaymentPlatform
parent_charge_id: string | null
net: number | null
}
export type ProductMetadata =
| { type: 'midas' }
| {
type: 'pyro'
cpu: number
ram: number
swap: number
storage: number
}
| {
type: 'medal'
cpu: number
ram: number
swap: number
storage: number
region: string
}
export type Price =
| { type: 'one-time'; price: number }
| { type: 'recurring'; intervals: Record<PriceDuration, number> }
export type ProductPrice = {
id: string
product_id: string
prices: Price
currency_code: string
}
export type Product = {
id: string
metadata: ProductMetadata
prices: ProductPrice[]
unitary: boolean
}
export type EditSubscriptionRequest = {
interval?: PriceDuration
payment_method?: string
cancelled?: boolean
region?: string
product?: string
}
export type EditSubscriptionResponse = {
payment_intent_id: string
client_secret: string
tax: number
total: number
}
export type AddPaymentMethodFlowResponse = {
client_secret: string
}
export type EditPaymentMethodRequest = {
primary: boolean
}
export type InitiatePaymentRequest = {
type: 'payment_method' | 'confirmation_token'
id?: string
token?: string
charge:
| { type: 'existing'; id: string }
| { type: 'new'; product_id: string; interval?: PriceDuration }
existing_payment_intent?: string
metadata?: {
type: 'pyro'
server_name?: string
server_region?: string
source: unknown
}
}
export type InitiatePaymentResponse = {
payment_intent_id?: string
client_secret?: string
price_id: string
tax: number
total: number
payment_method?: string
}
export type RefundChargeRequest = {
type: 'full' | 'partial' | 'none'
amount?: number
unprovision?: boolean
}
export type CreditRequest =
| { subscription_ids: string[]; days: number; send_email: boolean; message: string }
| { nodes: string[]; days: number; send_email: boolean; message: string }
| { region: string; days: number; send_email: boolean; message: string }
}
}
export namespace Projects {
export namespace v2 {
export type Environment = 'required' | 'optional' | 'unsupported' | 'unknown'
export type ProjectStatus =
| 'approved'
| 'archived'
| 'rejected'
| 'draft'
| 'unlisted'
| 'processing'
| 'withheld'
| 'scheduled'
| 'private'
| 'unknown'
export type MonetizationStatus = 'monetized' | 'demonetized' | 'force-demonetized'
export type ProjectType =
| 'mod'
| 'modpack'
| 'resourcepack'
| 'shader'
| 'plugin'
| 'datapack'
export type GalleryImage = {
url: string
featured: boolean
title?: string
description?: string
created: string
ordering: number
}
export type DonationLink = {
id: string
platform: string
url: string
}
export type Project = {
id: string
slug: string
project_type: ProjectType
team: string
title: string
description: string
body: string
published: string
updated: string
approved?: string
queued?: string
status: ProjectStatus
requested_status?: ProjectStatus
moderator_message?: {
message: string
body?: string
}
license: {
id: string
name: string
url?: string
}
client_side: Environment
server_side: Environment
downloads: number
followers: number
categories: string[]
additional_categories: string[]
game_versions: string[]
loaders: string[]
versions: string[]
icon_url?: string
issues_url?: string
source_url?: string
wiki_url?: string
discord_url?: string
donation_urls?: DonationLink[]
gallery?: GalleryImage[]
color?: number
thread_id: string
monetization_status: MonetizationStatus
}
export type SearchResultHit = {
project_id: string
project_type: ProjectType
slug: string
author: string
title: string
description: string
categories: string[]
display_categories: string[]
versions: string[]
downloads: number
follows: number
icon_url: string
date_created: string
date_modified: string
latest_version?: string
license: string
client_side: Environment
server_side: Environment
gallery: string[]
color?: number
}
export type SearchResult = {
hits: SearchResultHit[]
offset: number
limit: number
total_hits: number
}
export type ProjectSearchParams = {
query?: string
facets?: string[][]
filters?: string
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
offset?: number
limit?: number
}
}
export namespace v3 {
export type Environment =
| 'client_and_server'
| 'client_only'
| 'client_only_server_optional'
| 'singleplayer_only'
| 'server_only'
| 'server_only_client_optional'
| 'dedicated_server_only'
| 'client_or_server'
| 'client_or_server_prefers_both'
| 'unknown'
export type GalleryItem = {
url: string
raw_url: string
featured: boolean
name?: string
description?: string
created: string
ordering: number
}
export type Link = {
platform: string
donation: boolean
url: string
}
export type Project = {
id: string
slug?: string
project_types: string[]
games: string[]
team_id: string
organization?: string
name: string
summary: string
description: string
published: string
updated: string
approved?: string
queued?: string
status: v2.ProjectStatus
requested_status?: v2.ProjectStatus
license: {
id: string
name: string
url?: string
}
downloads: number
followers: number
categories: string[]
additional_categories: string[]
loaders: string[]
versions: string[]
icon_url?: string
link_urls: Record<string, Link>
gallery: GalleryItem[]
color?: number
thread_id: string
monetization_status: v2.MonetizationStatus
side_types_migration_review_status: 'reviewed' | 'pending'
environment?: Environment[]
[key: string]: unknown
}
export type EditProjectRequest = {
name?: string
summary?: string
description?: string
categories?: string[]
additional_categories?: string[]
license_url?: string | null
link_urls?: Record<string, string | null>
license_id?: string
slug?: string
status?: v2.ProjectStatus
requested_status?: v2.ProjectStatus | null
moderation_message?: string | null
moderation_message_body?: string | null
monetization_status?: v2.MonetizationStatus
side_types_migration_review_status?: 'reviewed' | 'pending'
environment?: Environment
[key: string]: unknown
}
}
}
export namespace Tags {
export namespace v2 {
export interface Category {
icon: string
name: string
project_type: string
header: string
}
export interface Loader {
icon: string
name: string
supported_project_types: string[]
}
export interface GameVersion {
version: string
version_type: string
date: string // RFC 3339 DateTime
major: boolean
}
export interface DonationPlatform {
short: string
name: string
}
}
}
export namespace Search {
export namespace v2 {
export interface ResultSearchProject {
project_id: string
project_type: string
slug: string | null
author: string
title: string
description: string
categories: string[]
display_categories: string[]
versions: string[]
downloads: number
follows: number
icon_url: string
date_created: string
date_modified: string
latest_version: string
license: string
client_side: string
server_side: string
gallery: string[]
featured_gallery: string | null
color: number | null
}
export interface SearchResults {
hits: ResultSearchProject[]
offset: number
limit: number
total_hits: number
}
}
}
export namespace State {
export interface GeneratedState {
categories: Tags.v2.Category[]
loaders: Tags.v2.Loader[]
gameVersions: Tags.v2.GameVersion[]
donationPlatforms: Tags.v2.DonationPlatform[]
reportTypes: string[]
muralBankDetails?: Record<
string,
{
bankNames: string[]
}
>
homePageProjects?: Projects.v2.Project[]
homePageSearch?: Search.v2.SearchResults
homePageNotifs?: Search.v2.SearchResults
products?: Billing.Internal.Product[]
countries: ISO3166.Country[]
subdivisions: Record<string, ISO3166.Subdivision[]>
errors: unknown[]
}
}
}