"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServerHouseList = exports.serverList = exports.servers = exports.dc_server = exports.areas = void 0;
const axios_1 = __importDefault(require("axios"));
const axios = axios_1.default.create({
    baseURL: "https://house.ffxiv.cyou/api/"
});
exports.areas = {
    0: { full: "海雾村", short: "海" },
    1: { full: "薰衣草苗圃", short: "森" },
    2: { full: "高脚孤丘", short: "沙" },
    3: { full: "白银乡", short: "白" },
    4: { full: "穹顶皓天", short: "天" }
};
exports.dc_server = [
    {
        dc_name: "陆行鸟",
        servers: {
            1042: "拉诺西亚",
            1044: "幻影群岛",
            1060: "萌芽池",
            1081: "神意之地",
            1167: "红玉海",
            1173: "宇宙和音",
            1174: "沃仙曦染",
            1175: "晨曦王座"
        }
    },
    {
        dc_name: "莫古力",
        servers: {
            1076: "白金幻象",
            1113: "旅人栈桥",
            1121: "拂晓之间",
            1166: "龙巢神殿",
            1170: "潮风亭",
            1171: "神拳痕",
            1172: "白银乡",
            1176: "梦羽宝境"
        }
    },
    {
        dc_name: "猫小胖",
        servers: {
            1043: "紫水栈桥",
            1045: "摩杜纳",
            1106: "静语庄园",
            1169: "延夏",
            1177: "海猫茶屋",
            1178: "柔风海湾",
            1179: "琥珀原"
        }
    },
    {
        dc_name: "豆豆柴",
        servers: {
            1183: "银泪湖",
            1192: "水晶塔",
            1180: "太阳海岸",
            1186: "伊修加德",
            1201: "红茶川"
        }
    }
];
exports.servers = (() => {
    const servers = {};
    exports.dc_server.forEach(d => {
        for (const id in d.servers)
            servers[id] = d.servers[id];
    });
    return servers;
})();
exports.serverList = (() => {
    const serverList = [];
    exports.dc_server.forEach(d => {
        for (const server in d.servers)
            serverList.push(server);
    });
    return serverList;
})();
async function getServerHouseList(server, timestamp) {
    const result = await axios.get("/sales", {
        params: { server, timestamp }
    });
    return result.data;
}
exports.getServerHouseList = getServerHouseList;
