UNPKG

@toebean/npc-vortex-api

Version:
887 lines 30 kB
/// <reference types="node" /> import { z } from 'zod'; import { updatePeriodSchema } from './schemas'; export * as schemas from './schemas'; /** * Endorse or abstain from endorsing a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.endorseMod} */ export declare const endorseMod: (options: { input: { gameId: string; modId: number | string; modVersion: string; endorseStatus: 'endorse' | 'abstain'; }; signal?: AbortSignal; }) => Promise<{ message: string; status: "Undecided" | "Abstained" | "Endorsed"; }>; /** * Retrieve all changelogs for a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getChangelogs} */ export declare const getChangelogs: (options: { input: { modId: number | string; gameId: string; }; signal?: AbortSignal; }) => Promise<Record<string, string[]>>; /** * Retrieves details about a collection. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getCollection} */ export declare const getCollection: (options: { input: { slug: string; }; signal?: AbortSignal; }) => Promise<import("./types").ICollection>; /** * Retrieves details about a collection revision. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getCollectionRevision} */ export declare const getCollectionRevision: (options: { input: { collectionSlug: string; revisionNumber: number; }; signal?: AbortSignal; }) => Promise<{ installationInfo?: string | undefined; status: string; revisionNumber: number; rating: { positive: number; average: number; total: number; }; id: number; updatedAt: string; createdAt: string; contentPreviewLink: string; adultContent: string; bugReports: { id: number; description: string; user: { name: string; avatar: string; memberId: number; }; updatedAt: string; createdAt: string; collectionBugStatusId: number; collectionRevisionId: number; title: string; userId: number; }[]; collection: import("./types").ICollection; collectionChangelog: { revisionNumber: number; id: number; description: string; updatedAt: string; createdAt: string; collectionRevisionId: number; }; collectionId: number; collectionSchema: { id: number; version: string; updatedAt: string; createdAt: string; }; collectionSchemaId: number; downloadLink: string; externalResources: { id: number; name: string; version: string; collectionRevisionId: number; fileExpression: string; instructions: string; optional: boolean; resourceType: string; resourceUrl: string; }[]; fileSize: number; gameVersions: { id: number; reference: string; }[]; latest: boolean; metadata: { ratingValue: "positive" | "negative" | "abstained"; }; modFiles: { file?: { sizeInBytes?: string | undefined; modId: number; fileId: number; date: number; count: number; name: string; version: string; description: string; size: number; mod: { author?: string | undefined; pictureUrl?: string | undefined; status: string; gameId: number; modId: number; id: number; name: string; version: string; summary: string; description: string; category: string; game: { id?: number | undefined; name?: string | undefined; domainName: string; }; ipAddress: string; modCategory: { name: string; category_id: number; parent_category: number | false; }; trackingData: { test?: number | undefined; }; uid: string; uploader: { name: string; avatar: string; memberId: number; }; }; game: { id?: number | undefined; name?: string | undefined; domainName: string; }; uid: string; categoryId: number; manager: number; owner: { name: string; avatar: string; memberId: number; }; primary: number; reportLink: string; requirementsAlert: number; scanned: number; uCount: number; uri: string; } | undefined; gameId: number; fileId: number; id: number; version: string; collectionRevisionId: number; optional: boolean; updatePolicy: string; }[]; revisionStatus: string; }>; /** * Retrieves all collections for a game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getCollections} */ export declare const getCollections: (options: { input: { gameId: string; }; signal?: AbortSignal; }) => Promise<import("./types").ICollection[]>; /** * Retrieves a list of color schemes used by Nexus Mods. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getColorSchemes} */ export declare const getColorSchemes: (options?: { signal?: AbortSignal; }) => Promise<{ id: number; name: string; primary_colour: string; secondary_colour: string; darker_colour: string; }[]>; /** * Retrieves a list of download links for a file. * @remarks If the user isn't premium on Nexus Mods, this requires a key that can only be generated on the website. * The key is part of the `nxm:` links which are generated for the "Download with Manager" button on the website. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getDownloadUrls} */ export declare const getDownloadUrls: (options: { input: { modId: number | string; fileId: number | string; key?: string; expires?: number; gameId: string; }; signal?: AbortSignal; }) => Promise<{ name: string; URI: string; short_name: string; }[]>; /** * Retrieves a list of endorsements the user has given. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getEndorsements} */ export declare const getEndorsements: (options?: { signal?: AbortSignal; }) => Promise<{ status: "Undecided" | "Abstained" | "Endorsed"; date: string | number; mod_id: number; domain_name: string; version: string | null; }[]>; /** * Searches for a file by md5 hash and retrieves information about all matching files. * Can be used to lookup a file when you don't know its Nexus Mods mod and file id. * @remarks Note that there may be multiple files matching the same md5 hash, as multiple users may have uploaded the same file or (less likely), * md5 hash collisions are possible and the file may be completely unrelated but happens to have the same hash. It is your responsibility to filter the * list of results and determine whether any of them match the file you are looking for, e.g. by comparing file size, contents, name of the mod, etc. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getFileByMd5} */ export declare const getFileByMd5: (options: { input: { hash: string; gameId: string; }; signal?: AbortSignal; }) => Promise<{ mod: { name?: string | undefined; summary?: string | undefined; description?: string | undefined; picture_url?: string | undefined; mod_downloads?: number | undefined; mod_unique_downloads?: number | undefined; endorsement?: { version: number | null; endorse_status: "Undecided" | "Abstained" | "Endorsed"; timestamp: number | null; } | null | undefined; status: "under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"; mod_id: number; domain_name: string; version: string; game_id: number; category_id: number; contains_adult_content: boolean; author: string; user: { name: string; member_id: number; member_group_id: number; }; uploaded_by: string; uploaded_users_profile_url: string; available: boolean; created_timestamp: number; created_time: string; updated_timestamp: number; updated_time: string; allow_rating: boolean; endorsement_count: number; }; file_details: { name: string; version: string; category_id: number; description: string; file_id: number; category_name: string; changelog_html: string | null; content_preview_link: string; size: number; size_kb: number; file_name: string; uploaded_timestamp: number; uploaded_time: string; mod_version: string; external_virus_scan_url: string; is_primary: boolean; }; }[]>; /** * Retrieves details about a file. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getFileInfo} */ export declare const getFileInfo: (options: { input: { modId: number | string; fileId: number | string; gameId: string; }; signal?: AbortSignal; }) => Promise<{ name: string; version: string; category_id: number; description: string; file_id: number; category_name: string; changelog_html: string | null; content_preview_link: string; size: number; size_kb: number; file_name: string; uploaded_timestamp: number; uploaded_time: string; mod_version: string; external_virus_scan_url: string; is_primary: boolean; }>; /** * Retrieves details about a specific game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getGameInfo} */ export declare const getGameInfo: (options: { input: { gameId: string; }; signal?: AbortSignal; }) => Promise<{ id: number; name: string; domain_name: string; forum_url: string; nexusmods_url: string; genre: string; mods: number; file_count: number; downloads: number; approved_date: number; categories: { name: string; category_id: number; parent_category: number | false; }[]; }>; /** * Retrieves a list of all games currently supported by Nexus Mods. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getGames} */ export declare const getGames: (options?: { signal?: AbortSignal; }) => Promise<{ id: number; name: string; domain_name: string; forum_url: string; nexusmods_url: string; genre: string; mods: number; file_count: number; downloads: number; approved_date: number; }[]>; /** * Retrieves a list of the latest added mods for a game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getLatestAdded} */ export declare const getLatestAdded: (options: { input: { gameId: string; }; signal?: AbortSignal; }) => Promise<{ name?: string | undefined; summary?: string | undefined; description?: string | undefined; picture_url?: string | undefined; mod_downloads?: number | undefined; mod_unique_downloads?: number | undefined; endorsement?: { version: number | null; endorse_status: "Undecided" | "Abstained" | "Endorsed"; timestamp: number | null; } | null | undefined; status: "under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"; mod_id: number; domain_name: string; version: string; game_id: number; category_id: number; contains_adult_content: boolean; author: string; user: { name: string; member_id: number; member_group_id: number; }; uploaded_by: string; uploaded_users_profile_url: string; available: boolean; created_timestamp: number; created_time: string; updated_timestamp: number; updated_time: string; allow_rating: boolean; endorsement_count: number; }[]>; /** * Retrieves a list of the latest updated mods for a game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getLatestUpdated} */ export declare const getLatestUpdated: (options: { input: { gameId: string; }; signal?: AbortSignal; }) => Promise<{ name?: string | undefined; summary?: string | undefined; description?: string | undefined; picture_url?: string | undefined; mod_downloads?: number | undefined; mod_unique_downloads?: number | undefined; endorsement?: { version: number | null; endorse_status: "Undecided" | "Abstained" | "Endorsed"; timestamp: number | null; } | null | undefined; status: "under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"; mod_id: number; domain_name: string; version: string; game_id: number; category_id: number; contains_adult_content: boolean; author: string; user: { name: string; member_id: number; member_group_id: number; }; uploaded_by: string; uploaded_users_profile_url: string; available: boolean; created_timestamp: number; created_time: string; updated_timestamp: number; updated_time: string; allow_rating: boolean; endorsement_count: number; }[]>; /** * Retrieves a list of files uploaded for a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getModFiles} */ export declare const getModFiles: (options: { input: { modId: number; gameId: string; }; signal?: AbortSignal; }) => Promise<{ file_updates: { uploaded_timestamp: number; uploaded_time: string; new_file_id: number; new_file_name: string; old_file_id: number; old_file_name: string; }[]; files: { name: string; version: string; category_id: number; description: string; file_id: number; category_name: string; changelog_html: string | null; content_preview_link: string; size: number; size_kb: number; file_name: string; uploaded_timestamp: number; uploaded_time: string; mod_version: string; external_virus_scan_url: string; is_primary: boolean; }[]; }>; /** * Retrieves details about a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getModInfo} */ export declare const getModInfo: (options: { input: { modId: number; gameId: string; }; signal?: AbortSignal; }) => Promise<{ name?: string | undefined; summary?: string | undefined; description?: string | undefined; picture_url?: string | undefined; mod_downloads?: number | undefined; mod_unique_downloads?: number | undefined; endorsement?: { version: number | null; endorse_status: "Undecided" | "Abstained" | "Endorsed"; timestamp: number | null; } | null | undefined; status: "under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"; mod_id: number; domain_name: string; version: string; game_id: number; category_id: number; contains_adult_content: boolean; author: string; user: { name: string; member_id: number; member_group_id: number; }; uploaded_by: string; uploaded_users_profile_url: string; available: boolean; created_timestamp: number; created_time: string; updated_timestamp: number; updated_time: string; allow_rating: boolean; endorsement_count: number; }>; /** * Retrieves a list of collections the user has created. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getMyCollections} */ export declare const getMyCollections: (options: { input: { gameId: string; count?: number; offset?: number; }; signal?: AbortSignal; }) => Promise<{ installationInfo?: string | undefined; status: string; revisionNumber: number; rating: { positive: number; average: number; total: number; }; id: number; updatedAt: string; createdAt: string; contentPreviewLink: string; adultContent: string; bugReports: { id: number; description: string; user: { name: string; avatar: string; memberId: number; }; updatedAt: string; createdAt: string; collectionBugStatusId: number; collectionRevisionId: number; title: string; userId: number; }[]; collection: import("./types").ICollection; collectionChangelog: { revisionNumber: number; id: number; description: string; updatedAt: string; createdAt: string; collectionRevisionId: number; }; collectionId: number; collectionSchema: { id: number; version: string; updatedAt: string; createdAt: string; }; collectionSchemaId: number; downloadLink: string; externalResources: { id: number; name: string; version: string; collectionRevisionId: number; fileExpression: string; instructions: string; optional: boolean; resourceType: string; resourceUrl: string; }[]; fileSize: number; gameVersions: { id: number; reference: string; }[]; latest: boolean; metadata: { ratingValue: "positive" | "negative" | "abstained"; }; modFiles: { file?: { sizeInBytes?: string | undefined; modId: number; fileId: number; date: number; count: number; name: string; version: string; description: string; size: number; mod: { author?: string | undefined; pictureUrl?: string | undefined; status: string; gameId: number; modId: number; id: number; name: string; version: string; summary: string; description: string; category: string; game: { id?: number | undefined; name?: string | undefined; domainName: string; }; ipAddress: string; modCategory: { name: string; category_id: number; parent_category: number | false; }; trackingData: { test?: number | undefined; }; uid: string; uploader: { name: string; avatar: string; memberId: number; }; }; game: { id?: number | undefined; name?: string | undefined; domainName: string; }; uid: string; categoryId: number; manager: number; owner: { name: string; avatar: string; memberId: number; }; primary: number; reportLink: string; requirementsAlert: number; scanned: number; uCount: number; uri: string; } | undefined; gameId: number; fileId: number; id: number; version: string; collectionRevisionId: number; optional: boolean; updatePolicy: string; }[]; revisionStatus: string; }[]>; /** * Retrieves information about the rate limits for the user. * @remarks This call does not affect your rate limits. * @returns A {@link !Promise Promise} which when resolved, passes details of the user's remaining rate limits to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getRateLimits} */ export declare const getRateLimits: (options?: { signal?: AbortSignal; }) => Promise<{ daily: number; hourly: number; }>; /** * Retrieves a list of mods that have recently been updated for a game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getRecentlyUpdatedMods} */ export declare const getRecentlyUpdatedMods: (options: { input: { period: z.infer<typeof updatePeriodSchema>; gameId: string; }; signal?: AbortSignal; }) => Promise<{ mod_id: number; latest_file_update: number; latest_mod_activity: number; }[]>; /** * Retrieves a list of all mods the user is tracking. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getTrackedMods} */ export declare const getTrackedMods: (options?: { signal?: AbortSignal; }) => Promise<{ mod_id: number; domain_name: string; }[]>; /** * Retrieves a list of trending mods for a game. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getTrending} */ export declare const getTrending: (options: { input: { gameId: string; }; signal?: AbortSignal; }) => Promise<{ name?: string | undefined; summary?: string | undefined; description?: string | undefined; picture_url?: string | undefined; mod_downloads?: number | undefined; mod_unique_downloads?: number | undefined; endorsement?: { version: number | null; endorse_status: "Undecided" | "Abstained" | "Endorsed"; timestamp: number | null; } | null | undefined; status: "under_moderation" | "published" | "not_published" | "publish_with_game" | "removed" | "wastebinned" | "hidden"; mod_id: number; domain_name: string; version: string; game_id: number; category_id: number; contains_adult_content: boolean; author: string; user: { name: string; member_id: number; member_group_id: number; }; uploaded_by: string; uploaded_users_profile_url: string; available: boolean; created_timestamp: number; created_time: string; updated_timestamp: number; updated_time: string; allow_rating: boolean; endorsement_count: number; }[]>; /** * Retrieves the last key validation result. * @remarks This call does not affect your rate limits. * @returns A {@link !Promise Promise} which when resolved, passes the last key validation result to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.getValidationResult} */ export declare const getValidationResult: (options?: { signal?: AbortSignal; }) => Promise<{ key: string; name: string; user_id: number; is_premium: boolean; is_supporter: boolean; email: string; profile_url: string; }>; /** * Rate a collection revision. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.rateCollectionRevision} */ export declare const rateCollectionRevision: (options: { input: { rating: number; revisionId: number; }; signal?: AbortSignal; }) => Promise<any>; /** * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.resolveCollectionUrl} */ export declare const resolveCollectionUrl: (options: { input: { apiLink: string; }; signal?: AbortSignal; }) => Promise<{ name: string; URI: string; short_name: string; }[]>; /** * Track a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.trackMod} */ export declare const trackMod: (options: { input: { modId: string; gameId: string; }; signal?: AbortSignal; }) => Promise<{ mod_id: number; domain_name: string; }>; /** * Stop tracking a mod. * @returns A {@link !Promise Promise} which when resolved, passes the response from the Nexus Mods API to its {@link !Promise.then then} handler(s). * @see {@link https://toebeann.github.io/npc-vortex-api/stable/?page=nexus.Function.untrackMod} */ export declare const untrackMod: (options: { input: { modId: string; gameId: string; }; signal?: AbortSignal; }) => Promise<{ mod_id: number; domain_name: string; }>; //# sourceMappingURL=index.d.ts.map