stackexchange-api
Version:
A Node.js wrapper for the StackExchange API
44 lines (43 loc) • 3.42 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const RelatedSite_1 = require("./RelatedSite");
const Styling_1 = require("./Styling");
/**
* The equivalent of [Type site](https://api.stackexchange.com/docs/types/site).<br>
* This object represents a Site in the [Stack Exchange network](https://stackexchange.com/sites).
*/
class Site {
constructor(site) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
this.aliases = (_b = (_a = site) === null || _a === void 0 ? void 0 : _a.aliases, (_b !== null && _b !== void 0 ? _b : null));
this.apiSiteParameter = (_d = (_c = site) === null || _c === void 0 ? void 0 : _c.api_site_parameter, (_d !== null && _d !== void 0 ? _d : null));
this.audience = (_f = (_e = site) === null || _e === void 0 ? void 0 : _e.audience, (_f !== null && _f !== void 0 ? _f : null));
this.closedBetaDate = (_h = (_g = site) === null || _g === void 0 ? void 0 : _g.closed_beta_date, (_h !== null && _h !== void 0 ? _h : null));
this.faviconUrl = (_k = (_j = site) === null || _j === void 0 ? void 0 : _j.favicon_url, (_k !== null && _k !== void 0 ? _k : null));
this.highResolutionIconUrl = (_m = (_l = site) === null || _l === void 0 ? void 0 : _l.high_resolution_icon_url, (_m !== null && _m !== void 0 ? _m : null));
this.iconUrl = (_p = (_o = site) === null || _o === void 0 ? void 0 : _o.icon_url, (_p !== null && _p !== void 0 ? _p : null));
this.launchDate = (_r = (_q = site) === null || _q === void 0 ? void 0 : _q.launch_date, (_r !== null && _r !== void 0 ? _r : null));
this.logoUrl = (_t = (_s = site) === null || _s === void 0 ? void 0 : _s.logo_url, (_t !== null && _t !== void 0 ? _t : null));
this.markdownExtensions = (_v = (_u = site) === null || _u === void 0 ? void 0 : _u.markdown_extensions, (_v !== null && _v !== void 0 ? _v : null));
this.name = (_x = (_w = site) === null || _w === void 0 ? void 0 : _w.name, (_x !== null && _x !== void 0 ? _x : null));
this.openBetaDate = (_z = (_y = site) === null || _y === void 0 ? void 0 : _y.open_beta_date, (_z !== null && _z !== void 0 ? _z : null));
if (typeof ((_0 = site) === null || _0 === void 0 ? void 0 : _0.related_sites) === 'undefined') {
this.relatedSites = null;
}
else {
this.relatedSites = site.related_sites
.map((related_site) => new RelatedSite_1.RelatedSite(related_site));
}
this.siteState = (_2 = (_1 = site) === null || _1 === void 0 ? void 0 : _1.site_state, (_2 !== null && _2 !== void 0 ? _2 : null));
this.siteType = (_4 = (_3 = site) === null || _3 === void 0 ? void 0 : _3.site_type, (_4 !== null && _4 !== void 0 ? _4 : null));
this.siteUrl = (_6 = (_5 = site) === null || _5 === void 0 ? void 0 : _5.site_url, (_6 !== null && _6 !== void 0 ? _6 : null));
if (typeof ((_7 = site) === null || _7 === void 0 ? void 0 : _7.styling) === 'undefined') {
this.styling = null;
}
else {
this.styling = new Styling_1.Styling(site.styling);
}
this.twitterAccount = (_9 = (_8 = site) === null || _8 === void 0 ? void 0 : _8.twitter_account, (_9 !== null && _9 !== void 0 ? _9 : null));
}
}
exports.Site = Site;