@blizzard-api/classic-wow
Version:
A series of helpers to interact with the World of Warcraft Classic Blizzard API
46 lines (45 loc) • 1.26 kB
JavaScript
import { wowBasePath, wowSearchBasePath } from "@blizzard-api/core";
//#region src/realm/index.ts
/**
* Get a realm by slug.
* @param namespace The namespace to use. See {@link BlizzardNamespaces}.
* @param realmSlug The realm slug.
* @returns The realm. See {@link RealmResponse}.
*/
function realm(namespace, realmSlug) {
return {
namespace,
path: `${wowBasePath}/realm/${realmSlug}`
};
}
/**
* Get a realm index.
* @param namespace The namespace to use. See {@link BlizzardNamespaces}.
* @returns The realm index. See {@link RealmIndexResponse}.
*/
function realmIndex(namespace) {
return {
namespace,
path: `${wowBasePath}/realm/index`
};
}
/**
* Search for realms.
* @param namespace The namespace to use. See {@link BlizzardNamespaces}.
* @param options The search parameters. See {@link RealmSearchParameters}.
* @returns The search results. See {@link RealmSearchResponse}.
*/
function realmSearch(namespace, options) {
return {
namespace,
parameters: {
_page: options._page,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
timezone: options.timezone
},
path: `${wowSearchBasePath}/realm`
};
}
//#endregion
export { realm, realmIndex, realmSearch };
//# sourceMappingURL=index.js.map