import metricsDemo from './metrics.demo.json';
import eventsDemo from './events.demo.json';

function get(metarr) {
  let metrics = [...metricsDemo.data];

  let result = [];

  metarr.forEach((metricKey) => {
    let match = metrics.filter((metric) => {
      if (metricKey.includes('*')) {
        return true;
      } else {
        return metric.Key == metricKey;
      }
    });
    result = result.concat(match);
  });

  return new Promise((resolve, reject) => {
    resolve({data: result})
  });
}

function reset() {
  return new Promise((resolve, reject) => {
    resolve()
  });
}

function list() {
  return new Promise((resolve, reject) => {
    resolve({"data":{"cosmos.proxy.all.blocked":"Global Blocked Requests","cosmos.proxy.all.bytes":"Global Transfered Bytes","cosmos.proxy.all.error":"Global Request Errors","cosmos.proxy.all.success":"Global Request Success","cosmos.proxy.all.time":"Global Request Time","cosmos.proxy.blocked.hostname":"Blocked By Hostname","cosmos.proxy.blocked.ip-whitelists":"Blocked By IP Whitelists","cosmos.proxy.route.bytes.Code-Servertest":"Transfered Bytes Code-Servertest","cosmos.proxy.route.bytes.Cosmos-Internal":"Transfered Bytes Cosmos-Internal","cosmos.proxy.route.bytes.Gitea":"Transfered Bytes Gitea","cosmos.proxy.route.bytes.Jellyfin":"Transfered Bytes Jellyfin","cosmos.proxy.route.bytes.Lidarr":"Transfered Bytes Lidarr","cosmos.proxy.route.bytes.New Route":"Transfered Bytes New Route","cosmos.proxy.route.bytes.Prowlarr":"Transfered Bytes Prowlarr","cosmos.proxy.route.bytes.Ryot":"Transfered Bytes Ryot","cosmos.proxy.route.bytes.Sonarr":"Transfered Bytes Sonarr","cosmos.proxy.route.bytes.Syncthing":"Transfered Bytes Syncthing","cosmos.proxy.route.bytes._Cosmos":"Transfered Bytes _Cosmos","cosmos.proxy.route.bytes.earthwalker":"Transfered Bytes earthwalker","cosmos.proxy.route.bytes.etesync":"Transfered Bytes etesync","cosmos.proxy.route.bytes.logs":"Transfered Bytes logs","cosmos.proxy.route.bytes.navidrome":"Transfered Bytes navidrome","cosmos.proxy.route.bytes.nzbget":"Transfered Bytes nzbget","cosmos.proxy.route.bytes.photoprism":"Transfered Bytes photoprism","cosmos.proxy.route.bytes.public":"Transfered Bytes public","cosmos.proxy.route.bytes.scrutiny":"Transfered Bytes scrutiny","cosmos.proxy.route.bytes.transmission 2":"Transfered Bytes transmission 2","cosmos.proxy.route.bytes.webtop":"Transfered Bytes webtop","cosmos.proxy.route.error.Code-Servertest":"Request Errors Code-Servertest","cosmos.proxy.route.error.Cosmos-Internal":"Request Errors Cosmos-Internal","cosmos.proxy.route.error.Jellyfin":"Request Errors Jellyfin","cosmos.proxy.route.error.Lidarr":"Request Errors Lidarr","cosmos.proxy.route.error.Prowlarr":"Request Errors Prowlarr","cosmos.proxy.route.error.Ryot":"Request Errors Ryot","cosmos.proxy.route.error.Syncthing":"Request Errors Syncthing","cosmos.proxy.route.error._Cosmos":"Request Errors _Cosmos","cosmos.proxy.route.error.etesync":"Request Errors etesync","cosmos.proxy.route.error.logs":"Request Errors logs","cosmos.proxy.route.error.navidrome":"Request Errors navidrome","cosmos.proxy.route.error.nzbget":"Request Errors nzbget","cosmos.proxy.route.error.public":"Request Errors public","cosmos.proxy.route.error.transmission 2":"Request Errors transmission 2","cosmos.proxy.route.error.webtop":"Request Errors webtop","cosmos.proxy.route.success.Code-Servertest":"Request Success Code-Servertest","cosmos.proxy.route.success.Cosmos-Internal":"Request Success Cosmos-Internal","cosmos.proxy.route.success.Gitea":"Request Success Gitea","cosmos.proxy.route.success.Jellyfin":"Request Success Jellyfin","cosmos.proxy.route.success.Lidarr":"Request Success Lidarr","cosmos.proxy.route.success.New Route":"Request Success New Route","cosmos.proxy.route.success.Sonarr":"Request Success Sonarr","cosmos.proxy.route.success.Syncthing":"Request Success Syncthing","cosmos.proxy.route.success._Cosmos":"Request Success _Cosmos","cosmos.proxy.route.success.earthwalker":"Request Success earthwalker","cosmos.proxy.route.success.etesync":"Request Success etesync","cosmos.proxy.route.success.logs":"Request Success logs","cosmos.proxy.route.success.navidrome":"Request Success navidrome","cosmos.proxy.route.success.nzbget":"Request Success nzbget","cosmos.proxy.route.success.photoprism":"Request Success photoprism","cosmos.proxy.route.success.public":"Request Success public","cosmos.proxy.route.success.scrutiny":"Request Success scrutiny","cosmos.proxy.route.success.transmission 2":"Request Success transmission 2","cosmos.proxy.route.success.webtop":"Request Success webtop","cosmos.proxy.route.time.Code-Servertest":"Response Request Code-Servertest","cosmos.proxy.route.time.Cosmos-Internal":"Response Request Cosmos-Internal","cosmos.proxy.route.time.Gitea":"Response Request Gitea","cosmos.proxy.route.time.Jellyfin":"Response Request Jellyfin","cosmos.proxy.route.time.Lidarr":"Response Request Lidarr","cosmos.proxy.route.time.New Route":"Response Time New Route","cosmos.proxy.route.time.Prowlarr":"Response Time Prowlarr","cosmos.proxy.route.time.Ryot":"Response Time Ryot","cosmos.proxy.route.time.Sonarr":"Response Request Sonarr","cosmos.proxy.route.time.Syncthing":"Response Time Syncthing","cosmos.proxy.route.time._Cosmos":"Response Request _Cosmos","cosmos.proxy.route.time.earthwalker":"Response Time earthwalker","cosmos.proxy.route.time.etesync":"Response Request etesync","cosmos.proxy.route.time.logs":"Response Request logs","cosmos.proxy.route.time.navidrome":"Response Request navidrome","cosmos.proxy.route.time.nzbget":"Response Request nzbget","cosmos.proxy.route.time.photoprism":"Response Request photoprism","cosmos.proxy.route.time.public":"Response Request public","cosmos.proxy.route.time.scrutiny":"Response Time scrutiny","cosmos.proxy.route.time.transmission 2":"Response Request transmission 2","cosmos.proxy.route.time.webtop":"Response Request webtop","cosmos.system.cpu.0":"CPU 0","cosmos.system.disk./":"Disk /","cosmos.system.disk./dev/hugepages":"Disk /dev/hugepages","cosmos.system.disk./dev/mqueue":"Disk /dev/mqueue","cosmos.system.disk./mnt/dropbox":"Disk /mnt/dropbox","cosmos.system.disk./mnt/secure":"Disk /mnt/secure","cosmos.system.docker.cpu.Bazaar":"Docker CPU Bazaar","cosmos.system.docker.cpu.Calibre-web":"Docker CPU Calibre-web","cosmos.system.docker.cpu.Code-Servertest":"Docker CPU Code-Servertest","cosmos.system.docker.cpu.Docker-Mailserver":"Docker CPU Docker-Mailserver","cosmos.system.docker.cpu.Duplicati":"Docker CPU Duplicati","cosmos.system.docker.cpu.Gitea":"Docker CPU Gitea","cosmos.system.docker.cpu.Jellyfin":"Docker CPU Jellyfin","cosmos.system.docker.cpu.Lidarr":"Docker CPU Lidarr","cosmos.system.docker.cpu.Prowlarr":"Docker CPU Prowlarr","cosmos.system.docker.cpu.Radarr":"Docker CPU Radarr","cosmos.system.docker.cpu.Ryot-postgres":"Docker CPU Ryot-postgres","cosmos.system.docker.cpu.Sonarr":"Docker CPU Sonarr","cosmos.system.docker.cpu.Syncthing":"Docker CPU Syncthing","cosmos.system.docker.cpu.TNP6":"Docker CPU TNP6","cosmos.system.docker.cpu.collabora":"Docker CPU collabora","cosmos.system.docker.cpu.cosmos-mongo-GBP":"Docker CPU cosmos-mongo-GBP","cosmos.system.docker.cpu.cosmos-mongo-bE8":"Docker CPU cosmos-mongo-bE8","cosmos.system.docker.cpu.cosmos-server":"Docker CPU cosmos-server","cosmos.system.docker.cpu.earthwalker":"Docker CPU earthwalker","cosmos.system.docker.cpu.echo":"Docker CPU echo","cosmos.system.docker.cpu.etesync":"Docker CPU etesync","cosmos.system.docker.cpu.logs":"Docker CPU logs","cosmos.system.docker.cpu.logs-socket":"Docker CPU logs-socket","cosmos.system.docker.cpu.mariadb":"Docker CPU mariadb","cosmos.system.docker.cpu.navidrome":"Docker CPU navidrome","cosmos.system.docker.cpu.nzbget":"Docker CPU nzbget","cosmos.system.docker.cpu.nzbhydra2":"Docker CPU nzbhydra2","cosmos.system.docker.cpu.photoprism":"Docker CPU photoprism","cosmos.system.docker.cpu.portainer":"Docker CPU portainer","cosmos.system.docker.cpu.rafiki":"Docker CPU rafiki","cosmos.system.docker.cpu.redis":"Docker CPU redis","cosmos.system.docker.cpu.scrutiny":"Docker CPU scrutiny","cosmos.system.docker.cpu.test":"Docker CPU test","cosmos.system.docker.cpu.transmission":"Docker CPU transmission","cosmos.system.docker.cpu.webtop":"Docker CPU webtop","cosmos.system.docker.cpu.xTeVe":"Docker CPU xTeVe","cosmos.system.docker.netRx.Bazaar":"Docker Network Received Bazaar","cosmos.system.docker.netRx.Calibre-web":"Docker Network Received Calibre-web","cosmos.system.docker.netRx.Code-Servertest":"Docker Network Received Code-Servertest","cosmos.system.docker.netRx.Docker-Mailserver":"Docker Network Received Docker-Mailserver","cosmos.system.docker.netRx.Duplicati":"Docker Network Received Duplicati","cosmos.system.docker.netRx.Gitea":"Docker Network Received Gitea","cosmos.system.docker.netRx.Jellyfin":"Docker Network Received Jellyfin","cosmos.system.docker.netRx.Lidarr":"Docker Network Received Lidarr","cosmos.system.docker.netRx.Prowlarr":"Docker Network Received Prowlarr","cosmos.system.docker.netRx.Radarr":"Docker Network Received Radarr","cosmos.system.docker.netRx.Ryot-postgres":"Docker Network Received Ryot-postgres","cosmos.system.docker.netRx.Sonarr":"Docker Network Received Sonarr","cosmos.system.docker.netRx.Syncthing":"Docker Network Received Syncthing","cosmos.system.docker.netRx.TNP6":"Docker Network Received TNP6","cosmos.system.docker.netRx.collabora":"Docker Network Received collabora","cosmos.system.docker.netRx.cosmos-mongo-GBP":"Docker Network Received cosmos-mongo-GBP","cosmos.system.docker.netRx.cosmos-mongo-bE8":"Docker Network Received cosmos-mongo-bE8","cosmos.system.docker.netRx.cosmos-server":"Docker Network Received cosmos-server","cosmos.system.docker.netRx.earthwalker":"Docker Network Received earthwalker","cosmos.system.docker.netRx.echo":"Docker Network Received echo","cosmos.system.docker.netRx.etesync":"Docker Network Received etesync","cosmos.system.docker.netRx.logs":"Docker Network Received logs","cosmos.system.docker.netRx.logs-socket":"Docker Network Received logs-socket","cosmos.system.docker.netRx.mariadb":"Docker Network Received mariadb","cosmos.system.docker.netRx.navidrome":"Docker Network Received navidrome","cosmos.system.docker.netRx.nzbget":"Docker Network Received nzbget","cosmos.system.docker.netRx.nzbhydra2":"Docker Network Received nzbhydra2","cosmos.system.docker.netRx.photoprism":"Docker Network Received photoprism","cosmos.system.docker.netRx.portainer":"Docker Network Received portainer","cosmos.system.docker.netRx.rafiki":"Docker Network Received rafiki","cosmos.system.docker.netRx.redis":"Docker Network Received redis","cosmos.system.docker.netRx.scrutiny":"Docker Network Received scrutiny","cosmos.system.docker.netRx.test":"Docker Network Received test","cosmos.system.docker.netRx.transmission":"Docker Network Received transmission","cosmos.system.docker.netRx.webtop":"Docker Network Received webtop","cosmos.system.docker.netRx.xTeVe":"Docker Network Received xTeVe","cosmos.system.docker.netTx.Bazaar":"Docker Network Sent Bazaar","cosmos.system.docker.netTx.Calibre-web":"Docker Network Sent Calibre-web","cosmos.system.docker.netTx.Code-Servertest":"Docker Network Sent Code-Servertest","cosmos.system.docker.netTx.Docker-Mailserver":"Docker Network Sent Docker-Mailserver","cosmos.system.docker.netTx.Duplicati":"Docker Network Sent Duplicati","cosmos.system.docker.netTx.Gitea":"Docker Network Sent Gitea","cosmos.system.docker.netTx.Jellyfin":"Docker Network Sent Jellyfin","cosmos.system.docker.netTx.Lidarr":"Docker Network Sent Lidarr","cosmos.system.docker.netTx.Prowlarr":"Docker Network Sent Prowlarr","cosmos.system.docker.netTx.Radarr":"Docker Network Sent Radarr","cosmos.system.docker.netTx.Ryot-postgres":"Docker Network Sent Ryot-postgres","cosmos.system.docker.netTx.Sonarr":"Docker Network Sent Sonarr","cosmos.system.docker.netTx.Syncthing":"Docker Network Sent Syncthing","cosmos.system.docker.netTx.TNP6":"Docker Network Sent TNP6","cosmos.system.docker.netTx.collabora":"Docker Network Sent collabora","cosmos.system.docker.netTx.cosmos-mongo-GBP":"Docker Network Sent cosmos-mongo-GBP","cosmos.system.docker.netTx.cosmos-mongo-bE8":"Docker Network Sent cosmos-mongo-bE8","cosmos.system.docker.netTx.cosmos-server":"Docker Network Sent cosmos-server","cosmos.system.docker.netTx.earthwalker":"Docker Network Sent earthwalker","cosmos.system.docker.netTx.echo":"Docker Network Sent echo","cosmos.system.docker.netTx.etesync":"Docker Network Sent etesync","cosmos.system.docker.netTx.logs":"Docker Network Sent logs","cosmos.system.docker.netTx.logs-socket":"Docker Network Sent logs-socket","cosmos.system.docker.netTx.mariadb":"Docker Network Sent mariadb","cosmos.system.docker.netTx.navidrome":"Docker Network Sent navidrome","cosmos.system.docker.netTx.nzbget":"Docker Network Sent nzbget","cosmos.system.docker.netTx.nzbhydra2":"Docker Network Sent nzbhydra2","cosmos.system.docker.netTx.photoprism":"Docker Network Sent photoprism","cosmos.system.docker.netTx.portainer":"Docker Network Sent portainer","cosmos.system.docker.netTx.rafiki":"Docker Network Sent rafiki","cosmos.system.docker.netTx.redis":"Docker Network Sent redis","cosmos.system.docker.netTx.scrutiny":"Docker Network Sent scrutiny","cosmos.system.docker.netTx.test":"Docker Network Sent test","cosmos.system.docker.netTx.transmission":"Docker Network Sent transmission","cosmos.system.docker.netTx.webtop":"Docker Network Sent webtop","cosmos.system.docker.netTx.xTeVe":"Docker Network Sent xTeVe","cosmos.system.docker.ram.Bazaar":"Docker RAM Bazaar","cosmos.system.docker.ram.Calibre-web":"Docker RAM Calibre-web","cosmos.system.docker.ram.Code-Servertest":"Docker RAM Code-Servertest","cosmos.system.docker.ram.Docker-Mailserver":"Docker RAM Docker-Mailserver","cosmos.system.docker.ram.Duplicati":"Docker RAM Duplicati","cosmos.system.docker.ram.Gitea":"Docker RAM Gitea","cosmos.system.docker.ram.Jellyfin":"Docker RAM Jellyfin","cosmos.system.docker.ram.Lidarr":"Docker RAM Lidarr","cosmos.system.docker.ram.Prowlarr":"Docker RAM Prowlarr","cosmos.system.docker.ram.Radarr":"Docker RAM Radarr","cosmos.system.docker.ram.Ryot-postgres":"Docker RAM Ryot-postgres","cosmos.system.docker.ram.Sonarr":"Docker RAM Sonarr","cosmos.system.docker.ram.Syncthing":"Docker RAM Syncthing","cosmos.system.docker.ram.TNP6":"Docker RAM TNP6","cosmos.system.docker.ram.collabora":"Docker RAM collabora","cosmos.system.docker.ram.cosmos-mongo-GBP":"Docker RAM cosmos-mongo-GBP","cosmos.system.docker.ram.cosmos-mongo-bE8":"Docker RAM cosmos-mongo-bE8","cosmos.system.docker.ram.cosmos-server":"Docker RAM cosmos-server","cosmos.system.docker.ram.earthwalker":"Docker RAM earthwalker","cosmos.system.docker.ram.echo":"Docker RAM echo","cosmos.system.docker.ram.etesync":"Docker RAM etesync","cosmos.system.docker.ram.logs":"Docker RAM logs","cosmos.system.docker.ram.logs-socket":"Docker RAM logs-socket","cosmos.system.docker.ram.mariadb":"Docker RAM mariadb","cosmos.system.docker.ram.navidrome":"Docker RAM navidrome","cosmos.system.docker.ram.nzbget":"Docker RAM nzbget","cosmos.system.docker.ram.nzbhydra2":"Docker RAM nzbhydra2","cosmos.system.docker.ram.photoprism":"Docker RAM photoprism","cosmos.system.docker.ram.portainer":"Docker RAM portainer","cosmos.system.docker.ram.rafiki":"Docker RAM rafiki","cosmos.system.docker.ram.redis":"Docker RAM redis","cosmos.system.docker.ram.scrutiny":"Docker RAM scrutiny","cosmos.system.docker.ram.test":"Docker RAM test","cosmos.system.docker.ram.transmission":"Docker RAM transmission","cosmos.system.docker.ram.webtop":"Docker RAM webtop","cosmos.system.docker.ram.xTeVe":"Docker RAM xTeVe","cosmos.system.netDrop":"Network Drops","cosmos.system.netErr":"Network Errors","cosmos.system.netRx":"Network Received","cosmos.system.netTx":"Network Sent","cosmos.system.ram":"RAM","cosmos.system.temp.all":"Temperature - All","cosmos.system.temp.k10temp_tccd1":"Temperature k10temp_tccd1","cosmos.system.temp.k10temp_tctl":"Temperature k10temp_tctl","cosmos.system.temp.k10temp_tdie":"Temperature k10temp_tdie","cosmos.system.temp.nvme_composite":"Temperature nvme_composite","cosmos.system.temp.nvme_sensor_1":"Temperature nvme_sensor_1","cosmos.system.temp.nvme_sensor_2":"Temperature nvme_sensor_2","cosmos.system.temp.nvme_sensor_3":"Temperature nvme_sensor_3"},"status":"OK"}
)
  });
}

function events() {
  return new Promise((resolve, reject) => {
    resolve(eventsDemo)
  });
}

export {
  get,
  reset,
  list,
  events,
};