UNPKG

noderinth

Version:
432 lines (420 loc) 12.9 kB
declare enum RESTProjectClientSideOptions { Required = "required", Optional = "optional", Unsupported = "unsupported", Unknown = "unknown" } declare enum RESTProjectServerSideOptions { Required = "required", Optional = "optional", Unsupported = "unsupported", Unknown = "unknown" } declare enum RESTProjectTypeOptions { Mod = "mod", Modpack = "modpack", ResourcePack = "resourcepack", Shader = "Shader" } declare enum RESTProjectMonetizationStatusOptions { Monetized = "monetized", Demonetized = "demonetized", ForceDemonetized = "force-demonetized" } declare enum RESTProjectStatusOptions { Approved = "approved", Archived = "archived", Rejected = "rejected", Draft = "draft", Unlisted = "unlisted", Processing = "processing", Witheld = "withheld", Scheduled = "scheduled", Private = "private", Unknown = "unknown" } declare enum RESTProjectRequestedStatusOptions { Approved = "approved", Archived = "archived", Unlisted = "unlisted", Private = "private", Draft = "draft" } declare enum RESTProjectSearchParametersIndex { Relevance = "relevance", Downloads = "downloads", Follows = "follows", Newest = "newest", Updated = "updated" } declare enum RESTCollectionStatusOptions { Private = "private", Public = "public", Unlisted = "unlisted" } declare enum RESTNotificationTypeOptions { ProjectUpdate = "project_update", TeamInvite = "team_invite", StatusChange = "status_change", ModeratorMessage = "moderator_message" } declare enum RESTGameVersionTypeOptions { Release = "release", Snapshot = "snapshot", Alpha = "alpha", Beta = "beta" } declare enum RESTReportItemTypeOptions { Project = "project", User = "user", Version = "version" } declare enum RESTThreadMessageTypeOptions { Project = "project", Report = "report", DirectMessage = "direct_message" } declare enum RESTThreadMessageBodyTypeOptions { StatusChange = "status_change", Text = "text", ThreadClosure = "thread_closure", Deleted = "deleted" } declare enum RESTUserPayoutWalletOptions { PayPal = "paypal", Venmo = "venmo" } declare enum RESTUserPayoutWalletTypeOptions { Email = "email", Phone = "phone", UserHandle = "user_handle" } declare enum RESTUserRoleOptions { Admin = "admin", Moderator = "moderator", Developer = "developer" } declare enum RESTVersionTypeOptions { Release = "release", Beta = "beta", Alpha = "alpha" } declare enum RESTVersionStatusOptions { Listed = "listed", Archived = "archived", Draft = "draft", Unlisted = "unlisted", Scheduled = "scheduled", Unknown = "unknown" } declare enum RESTVersionRequestedStatusOptions { Listed = "listed", Archived = "archived", Draft = "draft", Unlisted = "unlisted" } declare enum RESTVersionFileTypeOptions { RequiredResourcePack = "required-resource-pack", OptionalResourcePack = "optional-resource-pack" } declare enum RESTDependencyTypeOptions { Required = "requiored", Optional = "optional", Incompatible = "incompatible", Embedded = "embedded" } type RESTCollections = RESTCollection[]; type RESTCollection = { id: string; user: string; name: string; description: string; icon_url: string | null; color: number | null; status: RESTCollectionStatusOptions; created: Date; updated: Date; projects: string[]; }; interface RESTOptions { baseURL?: string; apiVersion?: number; userAgent?: string; token?: string; } type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>; type NumberRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>; type RESTStatistics = { projects: number; versions: number; files: number; authors: number; }; type RESTForgeUpdatesJSON = { homepage: string; promos: RESTForgeUpdatesJSONPromos; }; type RESTForgeUpdatesJSONPromos = { [key: string]: string; }; type RESTNotifications = RESTNotification[]; type RESTNotification = { id: string; user_id: string; type: RESTNotificationTypeOptions | null; title: string; text: string; link: string; read: boolean; created: Date; actions: RESTNotificationAction[]; }; type RESTNotificationActions = RESTNotificationAction[]; type RESTNotificationAction = { title: string; action_route: string[]; }; type RESTVersions = RESTVersion[]; type RESTVersion = { name: string; version_number: string; changelog: string | null; dependencies: RESTVersionDependencies; game_versions: string[]; version_type: RESTVersionTypeOptions; loaders: string; featured: boolean; status: RESTVersionStatusOptions; requested_status: RESTVersionRequestedStatusOptions | null; id: string; project_id: string; author_id: string; date_published: Date; downloads: number; changelog_url: null; files: RESTVersionFiles; }; type RESTVersionFiles = RESTVersionFile[]; type RESTVersionFile = { hashes: RESTVersionFileHashes; url: string; filename: string; primary: boolean; size: number; file_type: RESTVersionFileTypeOptions | null; }; type RESTVersionFileHashes = { sha512: string; sha1: string; }; type RESTVersionDependency = { version_id: string | null; project_id: string | null; file_name: string | null; dependency_type: RESTDependencyTypeOptions; }; type RESTVersionDependencies = RESTVersionDependency[]; type RESTProjects = RESTProject[]; interface RESTProject { slug: string; title: string; description: string; categories: string[]; client_side: RESTProjectClientSideOptions; server_side: RESTProjectServerSideOptions; project_type: RESTProjectTypeOptions; downloads: number; icon_url: string | null; color: number | null; thread_id: string; monetization_status: RESTProjectMonetizationStatusOptions; id: string; team: string; body: string; body_url: null; moderator_message: RESTProjectModeratorMessage; published: Date; updated: Date; approved: Date | null; queued: Date | null; followers: number; license: RESTProjectLicense; versions: string[]; game_versions: string[]; loaders: string[]; gallery: RESTProjectGallery[]; status: RESTProjectStatusOptions; requested_status: RESTProjectRequestedStatusOptions | null; additional_categories: string[]; issues_url: string | null; source_url: string | null; wiki_url: string | null; discord_url: string | null; donation_urls: RESTProjectDonationURL[]; } type RESTProjectDonationURL = { id: string; platform: string; url: string; }; type RESTProjectModeratorMessage = { message: string; body: string | null; }; type RESTProjectLicense = { id: string; name: string; url: string | null; }; type RESTProjectGallery = { url: string; featured: boolean; title: string | null; description: string | null; created: Date; ordering: number | null; }; type RESTProjectSearchResponse = { hits: RESTProjects; offset: number; limit: number; total_hits: number; }; type RESTProjectDependenciesResponse = { projects: RESTProjects; versions: RESTVersions; }; type RESTProjectValidityResponse = { id: string; }; type RESTCategoryTags = RESTCategoryTag[]; type RESTCategoryTag = { icon: string; name: string; project_type: string; header: string; }; type RESTLoaderTags = RESTLoaderTag[]; type RESTLoaderTag = { icon: string; name: string; supported_project_types: string[]; }; type RESTGameVersionTags = RESTGameVersionTag[]; type RESTGameVersionTag = { version: string; version_type: RESTGameVersionTypeOptions; date: Date; major: boolean; }; type RESTLicense = { short: string; name: string; }; type RESTLicenseData = { title: string; body: string; }; type RESTDonationPlatformTags = RESTDonationPlatformTag[]; type RESTDonationPlatformTag = { short: string; name: string; }; type RESTReportTypes = string[]; type RESTProjectTypes = string[]; type RESTSideTypes = string[]; type RESTUsers = RESTUser[]; type RESTUser = { username: string; name: string | null; email: string | null; bio: string; payout_data: RESTUserPayoutData | null; id: string; avatar_url: string; created: Date; role: RESTUserRoleOptions; badges: number; auth_providers: string[] | null; email_verified: boolean | null; has_password: boolean | null; has_totp: boolean | null; github_id: null; }; type RESTUserPayoutData = { balance: number; payout_wallet: RESTUserPayoutWalletOptions; payout_wallet_type: RESTUserPayoutWalletTypeOptions; payout_address: string; }; type RESTUserPayoutHistory = { all_time: number; last_month: number; payouts: RESTUserPayouts; }; type RESTUserPayouts = RESTUserPayout[]; type RESTUserPayout = { created: Date; amount: number; status: string; }; type RESTTeamMembers = RESTTeamMember[]; type RESTTeams = RESTTeamMembers[]; type RESTTeamMember = { team_id: string; user: RESTUser; role: string; permissions: number; accepted: boolean; payouts_split: NumberRange<1, 101>; ordering: number; }; type RESTReports = RESTReport[]; type RESTReport = { report_type: string; item_id: string; item_type: RESTReportItemTypeOptions; body: string; id: string; reporter: string; created: Date; closed: boolean; thread_id: string; }; type RESTThread = { id: string; type: RESTThreadMessageTypeOptions; project_id: string | null; report_id: string | null; messages: RESTThreadMessages; members: RESTUsers; }; type RESTThreadMessages = RESTThreadMessage[]; type RESTThreadMessage = { id: string; author_id: string | null; body: RESTThreadMessageBody; created: Date; }; type RESTThreadMessageBody = RESTThreadMessageBodyStatusChange | RESTThreadMessageBodyThreadClosure | RESTThreadMessageBodyText | RESTThreadMessageBodyDeleted; interface RESTThreadMessageBodyBase { type: RESTThreadMessageBodyTypeOptions; } interface RESTThreadMessageBodyThreadClosure extends RESTThreadMessageBodyBase { type: RESTThreadMessageBodyTypeOptions.ThreadClosure; } interface RESTThreadMessageBodyDeleted extends RESTThreadMessageBodyBase { type: RESTThreadMessageBodyTypeOptions.Deleted; } interface RESTThreadMessageBodyText extends RESTThreadMessageBodyBase { type: RESTThreadMessageBodyTypeOptions.Text; body: string; private: boolean; replying_to: string | null; } interface RESTThreadMessageBodyStatusChange extends RESTThreadMessageBodyBase { type: RESTThreadMessageBodyTypeOptions.StatusChange; old_status: RESTProjectStatusOptions; new_status: RESTProjectStatusOptions; } export { type NumberRange, type RESTCategoryTag, type RESTCategoryTags, type RESTCollection, RESTCollectionStatusOptions, type RESTCollections, RESTDependencyTypeOptions, type RESTDonationPlatformTag, type RESTDonationPlatformTags, type RESTForgeUpdatesJSON, type RESTForgeUpdatesJSONPromos, type RESTGameVersionTag, type RESTGameVersionTags, RESTGameVersionTypeOptions, type RESTLicense, type RESTLicenseData, type RESTLoaderTag, type RESTLoaderTags, type RESTNotification, type RESTNotificationAction, type RESTNotificationActions, RESTNotificationTypeOptions, type RESTNotifications, type RESTOptions, type RESTProject, RESTProjectClientSideOptions, type RESTProjectDependenciesResponse, type RESTProjectDonationURL, type RESTProjectGallery, type RESTProjectLicense, type RESTProjectModeratorMessage, RESTProjectMonetizationStatusOptions, RESTProjectRequestedStatusOptions, RESTProjectSearchParametersIndex, type RESTProjectSearchResponse, RESTProjectServerSideOptions, RESTProjectStatusOptions, RESTProjectTypeOptions, type RESTProjectTypes, type RESTProjectValidityResponse, type RESTProjects, type RESTReport, RESTReportItemTypeOptions, type RESTReportTypes, type RESTReports, type RESTSideTypes, type RESTStatistics, type RESTTeamMember, type RESTTeamMembers, type RESTTeams, type RESTThread, RESTThreadMessageBodyTypeOptions, RESTThreadMessageTypeOptions, type RESTUser, type RESTUserPayout, type RESTUserPayoutData, type RESTUserPayoutHistory, RESTUserPayoutWalletOptions, RESTUserPayoutWalletTypeOptions, type RESTUserPayouts, RESTUserRoleOptions, type RESTUsers, type RESTVersion, type RESTVersionDependencies, type RESTVersionDependency, type RESTVersionFile, type RESTVersionFileHashes, RESTVersionFileTypeOptions, type RESTVersionFiles, RESTVersionRequestedStatusOptions, RESTVersionStatusOptions, RESTVersionTypeOptions, type RESTVersions };