updown.io
Version:
An updown.io API client
38 lines (37 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Endpoint = void 0;
const encode = encodeURIComponent;
exports.Endpoint = {
CHECKS: 'checks',
DOWNTIMES: 'downtimes',
METRICS: 'metrics',
NODES: 'nodes',
IPV4: 'ipv4',
IPV6: 'ipv6',
Checks: {
check(token) {
return `/${exports.Endpoint.CHECKS}/${encode(token)}/`;
},
downtimes(token) {
return `/${exports.Endpoint.CHECKS}/${encode(token)}/${exports.Endpoint.DOWNTIMES}/`;
},
metrics(token) {
return `/${exports.Endpoint.CHECKS}/${encode(token)}/${exports.Endpoint.METRICS}/`;
},
},
Nodes: {
ipv4() {
return `/${exports.Endpoint.NODES}/${exports.Endpoint.IPV4}/`;
},
ipv6() {
return `/${exports.Endpoint.NODES}/${exports.Endpoint.IPV6}/`;
},
},
checks(token) {
return `/${exports.Endpoint.CHECKS}/${token ? `${encode(token)}/` : ''}`;
},
nodes() {
return `/${exports.Endpoint.NODES}/`;
},
};