From a92f0250629de49560d91dbacad68f1fdbf1fe0f Mon Sep 17 00:00:00 2001 From: ntimo Date: Sat, 30 May 2020 15:19:58 +0200 Subject: [PATCH] [Web] Update API docs --- data/web/_apidocs.html | 14800 +++++++++++++++++++++++++++------------ 1 file changed, 10489 insertions(+), 4311 deletions(-) diff --git a/data/web/_apidocs.html b/data/web/_apidocs.html index 0e8d884e..c115c9ad 100644 --- a/data/web/_apidocs.html +++ b/data/web/_apidocs.html @@ -59,12 +59,15 @@ return a != a ? b == b : a !== b; } function validate_store(store, name) { - if (!store || typeof store.subscribe !== 'function') { + if (store != null && typeof store.subscribe !== 'function') { throw new Error(`'${name}' is not a store with a 'subscribe' method`); } } - function subscribe(store, callback) { - const unsub = store.subscribe(callback); + function subscribe(store, ...callbacks) { + if (store == null) { + return noop; + } + const unsub = store.subscribe(...callbacks); return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; } function get_store_value(store) { @@ -89,7 +92,10 @@ function get_slot_changes(definition, $$scope, dirty, fn) { if (definition[2] && fn) { const lets = definition[2](fn(dirty)); - if (typeof $$scope.dirty === 'object') { + if ($$scope.dirty === undefined) { + return lets; + } + if (typeof lets === 'object') { const merged = []; const len = Math.max($$scope.dirty.length, lets.length); for (let i = 0; i < len; i += 1) { @@ -125,6 +131,9 @@ return ret; } const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); + function action_destroyer(action_result) { + return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; + } const is_client = typeof window !== 'undefined'; let now = is_client @@ -260,7 +269,7 @@ else if (key === 'style') { node.style.cssText = attributes[key]; } - else if (descriptors[key] && descriptors[key].set) { + else if (key === '__value' || descriptors[key] && descriptors[key].set) { node[key] = attributes[key]; } else { @@ -309,12 +318,17 @@ for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i]; if (node.nodeName === name) { - for (let j = 0; j < node.attributes.length; j += 1) { + let j = 0; + while (j < node.attributes.length) { const attribute = node.attributes[j]; - if (!attributes[attribute.name]) + if (attributes[attribute.name]) { + j++; + } + else { node.removeAttribute(attribute.name); + } } - return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes + return nodes.splice(i, 1)[0]; } } return svg ? svg_element(name) : element(name); @@ -412,6 +426,9 @@ e.initCustomEvent(type, false, false, detail); return e; } + function query_selector_all(selector, parent = document.body) { + return Array.from(parent.querySelectorAll(selector)); + } class HtmlTag { constructor(html, anchor = null) { this.e = element('div'); @@ -637,16 +654,21 @@ function add_flush_callback(fn) { flush_callbacks.push(fn); } + let flushing = false; + const seen_callbacks = new Set(); function flush() { - const seen_callbacks = new Set(); + if (flushing) + return; + flushing = true; do { // first, call beforeUpdate functions // and update components - while (dirty_components.length) { - const component = dirty_components.shift(); + for (let i = 0; i < dirty_components.length; i += 1) { + const component = dirty_components[i]; set_current_component(component); update(component.$$); } + dirty_components.length = 0; while (binding_callbacks.length) binding_callbacks.pop()(); // then, once components are updated, call @@ -655,9 +677,9 @@ for (let i = 0; i < render_callbacks.length; i += 1) { const callback = render_callbacks[i]; if (!seen_callbacks.has(callback)) { - callback(); // ...so guard against infinite loops seen_callbacks.add(callback); + callback(); } } render_callbacks.length = 0; @@ -666,6 +688,8 @@ flush_callbacks.pop()(); } update_scheduled = false; + flushing = false; + seen_callbacks.clear(); } function update($$) { if ($$.fragment !== null) { @@ -1113,12 +1137,15 @@ insert(new_blocks[n - 1]); return new_blocks; } - function measure(blocks) { - const rects = {}; - let i = blocks.length; - while (i--) - rects[blocks[i].key] = blocks[i].node.getBoundingClientRect(); - return rects; + function validate_each_keys(ctx, list, get_context, get_key) { + const keys = new Set(); + for (let i = 0; i < list.length; i++) { + const key = get_key(get_context(ctx, list, i)); + if (keys.has(key)) { + throw new Error(`Cannot have duplicate keys in a keyed each`); + } + keys.add(key); + } } function get_spread_update(levels, updates) { @@ -1211,9 +1238,7 @@ str += " " + name; } else if (value != null) { - str += " " + name + "=" + JSON.stringify(String(value) - .replace(/"/g, '"') - .replace(/'/g, ''')); + str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`; } }); return str; @@ -1272,7 +1297,7 @@ return { render: (props = {}, options = {}) => { on_destroy = []; - const result = { head: '', css: new Set() }; + const result = { title: '', head: '', css: new Set() }; const html = $$render(result, props, {}, options); run_all(on_destroy); return { @@ -1281,7 +1306,7 @@ code: Array.from(result.css).map(css => css.code).join('\n'), map: null // TODO }, - head: result.head + head: result.title + result.head }; }, $$render @@ -1370,7 +1395,8 @@ }; let ready = false; $$.ctx = instance - ? instance(component, prop_values, (i, ret, value = ret) => { + ? instance(component, prop_values, (i, ret, ...rest) => { + const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { if ($$.bound[i]) $$.bound[i](value); @@ -1457,7 +1483,7 @@ } function dispatch_dev(type, detail) { - document.dispatchEvent(custom_event(type, detail)); + document.dispatchEvent(custom_event(type, Object.assign({ version: '3.19.2' }, detail))); } function append_dev(target, node) { dispatch_dev("SvelteDOMInsert", { target, node }); @@ -1521,6 +1547,22 @@ dispatch_dev("SvelteDOMSetData", { node: text, data }); text.data = data; } + function validate_each_argument(arg) { + if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) { + let msg = '{#each} only iterates over array-like objects.'; + if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) { + msg += ' You can use a spread to convert this iterable into an array.'; + } + throw new Error(msg); + } + } + function validate_slots(name, slot, keys) { + for (const slot_key of Object.keys(slot)) { + if (!~keys.indexOf(slot_key)) { + console.warn(`<${name}> received an unexpected slot "${slot_key}".`); + } + } + } class SvelteComponentDev extends SvelteComponent { constructor(options) { if (!options || (!options.target && !options.$$inline)) { @@ -1534,6 +1576,8 @@ console.warn(`Component was already destroyed`); // eslint-disable-line no-console }; } + $capture_state() { } + $inject_state() { } } function loop_guard(timeout) { const start = Date.now(); @@ -1544,6 +1588,2274 @@ }; } + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function commonjsRequire () { + throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs'); + } + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + + 'use strict'; + var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`); + + 'use strict'; + var token = '%[a-f0-9]{2}'; + var singleMatcher = new RegExp(token, 'gi'); + var multiMatcher = new RegExp('(' + token + ')+', 'gi'); + + function decodeComponents(components, split) { + try { + // Try to decode the entire string first + return decodeURIComponent(components.join('')); + } catch (err) { + // Do nothing + } + + if (components.length === 1) { + return components; + } + + split = split || 1; + + // Split the array in 2 parts + var left = components.slice(0, split); + var right = components.slice(split); + + return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); + } + + function decode(input) { + try { + return decodeURIComponent(input); + } catch (err) { + var tokens = input.match(singleMatcher); + + for (var i = 1; i < tokens.length; i++) { + input = decodeComponents(tokens, i).join(''); + + tokens = input.match(singleMatcher); + } + + return input; + } + } + + function customDecodeURIComponent(input) { + // Keep track of all the replacements and prefill the map with the `BOM` + var replaceMap = { + '%FE%FF': '\uFFFD\uFFFD', + '%FF%FE': '\uFFFD\uFFFD' + }; + + var match = multiMatcher.exec(input); + while (match) { + try { + // Decode as big chunks as possible + replaceMap[match[0]] = decodeURIComponent(match[0]); + } catch (err) { + var result = decode(match[0]); + + if (result !== match[0]) { + replaceMap[match[0]] = result; + } + } + + match = multiMatcher.exec(input); + } + + // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else + replaceMap['%C2'] = '\uFFFD'; + + var entries = Object.keys(replaceMap); + + for (var i = 0; i < entries.length; i++) { + // Replace all decoded components + var key = entries[i]; + input = input.replace(new RegExp(key, 'g'), replaceMap[key]); + } + + return input; + } + + var decodeUriComponent = function (encodedURI) { + if (typeof encodedURI !== 'string') { + throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); + } + + try { + encodedURI = encodedURI.replace(/\+/g, ' '); + + // Try the built in decoder first + return decodeURIComponent(encodedURI); + } catch (err) { + // Fallback to a more advanced decoder + return customDecodeURIComponent(encodedURI); + } + }; + + 'use strict'; + + var splitOnFirst = (string, separator) => { + if (!(typeof string === 'string' && typeof separator === 'string')) { + throw new TypeError('Expected the arguments to be of type `string`'); + } + + if (separator === '') { + return [string]; + } + + const separatorIndex = string.indexOf(separator); + + if (separatorIndex === -1) { + return [string]; + } + + return [ + string.slice(0, separatorIndex), + string.slice(separatorIndex + separator.length) + ]; + }; + + var queryString = createCommonjsModule(function (module, exports) { + 'use strict'; + + + + + function encoderForArrayFormat(options) { + switch (options.arrayFormat) { + case 'index': + return key => (result, value) => { + const index = result.length; + if (value === undefined || (options.skipNull && value === null)) { + return result; + } + + if (value === null) { + return [...result, [encode(key, options), '[', index, ']'].join('')]; + } + + return [ + ...result, + [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('') + ]; + }; + + case 'bracket': + return key => (result, value) => { + if (value === undefined || (options.skipNull && value === null)) { + return result; + } + + if (value === null) { + return [...result, [encode(key, options), '[]'].join('')]; + } + + return [...result, [encode(key, options), '[]=', encode(value, options)].join('')]; + }; + + case 'comma': + case 'separator': + return key => (result, value) => { + if (value === null || value === undefined || value.length === 0) { + return result; + } + + if (result.length === 0) { + return [[encode(key, options), '=', encode(value, options)].join('')]; + } + + return [[result, encode(value, options)].join(options.arrayFormatSeparator)]; + }; + + default: + return key => (result, value) => { + if (value === undefined || (options.skipNull && value === null)) { + return result; + } + + if (value === null) { + return [...result, encode(key, options)]; + } + + return [...result, [encode(key, options), '=', encode(value, options)].join('')]; + }; + } + } + + function parserForArrayFormat(options) { + let result; + + switch (options.arrayFormat) { + case 'index': + return (key, value, accumulator) => { + result = /\[(\d*)\]$/.exec(key); + + key = key.replace(/\[\d*\]$/, ''); + + if (!result) { + accumulator[key] = value; + return; + } + + if (accumulator[key] === undefined) { + accumulator[key] = {}; + } + + accumulator[key][result[1]] = value; + }; + + case 'bracket': + return (key, value, accumulator) => { + result = /(\[\])$/.exec(key); + key = key.replace(/\[\]$/, ''); + + if (!result) { + accumulator[key] = value; + return; + } + + if (accumulator[key] === undefined) { + accumulator[key] = [value]; + return; + } + + accumulator[key] = [].concat(accumulator[key], value); + }; + + case 'comma': + case 'separator': + return (key, value, accumulator) => { + const isArray = typeof value === 'string' && value.split('').indexOf(options.arrayFormatSeparator) > -1; + const newValue = isArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options); + accumulator[key] = newValue; + }; + + default: + return (key, value, accumulator) => { + if (accumulator[key] === undefined) { + accumulator[key] = value; + return; + } + + accumulator[key] = [].concat(accumulator[key], value); + }; + } + } + + function validateArrayFormatSeparator(value) { + if (typeof value !== 'string' || value.length !== 1) { + throw new TypeError('arrayFormatSeparator must be single character string'); + } + } + + function encode(value, options) { + if (options.encode) { + return options.strict ? strictUriEncode(value) : encodeURIComponent(value); + } + + return value; + } + + function decode(value, options) { + if (options.decode) { + return decodeUriComponent(value); + } + + return value; + } + + function keysSorter(input) { + if (Array.isArray(input)) { + return input.sort(); + } + + if (typeof input === 'object') { + return keysSorter(Object.keys(input)) + .sort((a, b) => Number(a) - Number(b)) + .map(key => input[key]); + } + + return input; + } + + function removeHash(input) { + const hashStart = input.indexOf('#'); + if (hashStart !== -1) { + input = input.slice(0, hashStart); + } + + return input; + } + + function getHash(url) { + let hash = ''; + const hashStart = url.indexOf('#'); + if (hashStart !== -1) { + hash = url.slice(hashStart); + } + + return hash; + } + + function extract(input) { + input = removeHash(input); + const queryStart = input.indexOf('?'); + if (queryStart === -1) { + return ''; + } + + return input.slice(queryStart + 1); + } + + function parseValue(value, options) { + if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) { + value = Number(value); + } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { + value = value.toLowerCase() === 'true'; + } + + return value; + } + + function parse(input, options) { + options = Object.assign({ + decode: true, + sort: true, + arrayFormat: 'none', + arrayFormatSeparator: ',', + parseNumbers: false, + parseBooleans: false + }, options); + + validateArrayFormatSeparator(options.arrayFormatSeparator); + + const formatter = parserForArrayFormat(options); + + // Create an object with no prototype + const ret = Object.create(null); + + if (typeof input !== 'string') { + return ret; + } + + input = input.trim().replace(/^[?#&]/, ''); + + if (!input) { + return ret; + } + + for (const param of input.split('&')) { + let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '='); + + // Missing `=` should be `null`: + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters + value = value === undefined ? null : options.arrayFormat === 'comma' ? value : decode(value, options); + formatter(decode(key, options), value, ret); + } + + for (const key of Object.keys(ret)) { + const value = ret[key]; + if (typeof value === 'object' && value !== null) { + for (const k of Object.keys(value)) { + value[k] = parseValue(value[k], options); + } + } else { + ret[key] = parseValue(value, options); + } + } + + if (options.sort === false) { + return ret; + } + + return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { + const value = ret[key]; + if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) { + // Sort object keys, not values + result[key] = keysSorter(value); + } else { + result[key] = value; + } + + return result; + }, Object.create(null)); + } + + exports.extract = extract; + exports.parse = parse; + + exports.stringify = (object, options) => { + if (!object) { + return ''; + } + + options = Object.assign({ + encode: true, + strict: true, + arrayFormat: 'none', + arrayFormatSeparator: ',' + }, options); + + validateArrayFormatSeparator(options.arrayFormatSeparator); + + const formatter = encoderForArrayFormat(options); + + const objectCopy = Object.assign({}, object); + if (options.skipNull) { + for (const key of Object.keys(objectCopy)) { + if (objectCopy[key] === undefined || objectCopy[key] === null) { + delete objectCopy[key]; + } + } + } + + const keys = Object.keys(objectCopy); + + if (options.sort !== false) { + keys.sort(options.sort); + } + + return keys.map(key => { + const value = object[key]; + + if (value === undefined) { + return ''; + } + + if (value === null) { + return encode(key, options); + } + + if (Array.isArray(value)) { + return value + .reduce(formatter(key), []) + .join('&'); + } + + return encode(key, options) + '=' + encode(value, options); + }).filter(x => x.length > 0).join('&'); + }; + + exports.parseUrl = (input, options) => { + return { + url: removeHash(input).split('?')[0] || '', + query: parse(extract(input), options) + }; + }; + + exports.stringifyUrl = (input, options) => { + const url = removeHash(input.url).split('?')[0] || ''; + const queryFromUrl = exports.extract(input.url); + const parsedQueryFromUrl = exports.parse(queryFromUrl); + const hash = getHash(input.url); + const query = Object.assign(parsedQueryFromUrl, input.query); + let queryString = exports.stringify(query, options); + if (queryString) { + queryString = `?${queryString}`; + } + + return `${url}${queryString}${hash}`; + }; + }); + var queryString_1 = queryString.extract; + var queryString_2 = queryString.parse; + var queryString_3 = queryString.stringify; + var queryString_4 = queryString.parseUrl; + var queryString_5 = queryString.stringifyUrl; + + var index_umd = createCommonjsModule(function (module, exports) { + (function (global, factory) { + 'object' === 'object' && 'object' !== 'undefined' ? module.exports = factory() : + typeof undefined === 'function' && undefined.amd ? undefined(factory) : + (global = global || self, global.AbstractNestedRouter = factory()); + }(commonjsGlobal, function () { 'use strict'; + + var defaultExport = /*@__PURE__*/(function (Error) { + function defaultExport(route, path) { + var message = "Unreachable '" + route + "', segment '" + path + "' is not defined"; + Error.call(this, message); + this.message = message; + } + + if ( Error ) defaultExport.__proto__ = Error; + defaultExport.prototype = Object.create( Error && Error.prototype ); + defaultExport.prototype.constructor = defaultExport; + + return defaultExport; + }(Error)); + + function buildMatcher(path, parent) { + var regex; + + var _isSplat; + + var _priority = -100; + + var keys = []; + regex = path.replace(/[-$.]/g, '\\$&').replace(/\(/g, '(?:').replace(/\)/g, ')?').replace(/([:*]\w+)(?:<([^<>]+?)>)?/g, function (_, key, expr) { + keys.push(key.substr(1)); + + if (key.charAt() === ':') { + _priority += 100; + return ("((?!#)" + (expr || '[^#/]+?') + ")"); + } + + _isSplat = true; + _priority += 500; + return ("((?!#)" + (expr || '[^#]+?') + ")"); + }); + + try { + regex = new RegExp(("^" + regex + "$")); + } catch (e) { + throw new TypeError(("Invalid route expression, given '" + parent + "'")); + } + + var _hashed = path.includes('#') ? 0.5 : 1; + + var _depth = path.length * _priority * _hashed; + + return { + keys: keys, + regex: regex, + _depth: _depth, + _isSplat: _isSplat + }; + } + var PathMatcher = function PathMatcher(path, parent) { + var ref = buildMatcher(path, parent); + var keys = ref.keys; + var regex = ref.regex; + var _depth = ref._depth; + var _isSplat = ref._isSplat; + return { + _isSplat: _isSplat, + _depth: _depth, + match: function (value) { + var matches = value.match(regex); + + if (matches) { + return keys.reduce(function (prev, cur, i) { + prev[cur] = typeof matches[i + 1] === 'string' ? decodeURIComponent(matches[i + 1]) : null; + return prev; + }, {}); + } + } + }; + }; + + PathMatcher.push = function push (key, prev, leaf, parent) { + var root = prev[key] || (prev[key] = {}); + + if (!root.pattern) { + root.pattern = new PathMatcher(key, parent); + root.route = (leaf || '').replace(/\/$/, '') || '/'; + } + + prev.keys = prev.keys || []; + + if (!prev.keys.includes(key)) { + prev.keys.push(key); + PathMatcher.sort(prev); + } + + return root; + }; + + PathMatcher.sort = function sort (root) { + root.keys.sort(function (a, b) { + return root[a].pattern._depth - root[b].pattern._depth; + }); + }; + + function merge(path, parent) { + return ("" + (parent && parent !== '/' ? parent : '') + (path || '')); + } + function walk(path, cb) { + var matches = path.match(/<[^<>]*\/[^<>]*>/); + + if (matches) { + throw new TypeError(("RegExp cannot contain slashes, given '" + matches + "'")); + } + + var parts = path.split(/(?=\/|#)/); + var root = []; + + if (parts[0] !== '/') { + parts.unshift('/'); + } + + parts.some(function (x, i) { + var parent = root.slice(1).concat(x).join('') || null; + var segment = parts.slice(i + 1).join('') || null; + var retval = cb(x, parent, segment ? ("" + (x !== '/' ? x : '') + segment) : null); + root.push(x); + return retval; + }); + } + function reduce(key, root, _seen) { + var params = {}; + var out = []; + var splat; + walk(key, function (x, leaf, extra) { + var found; + + if (!root.keys) { + throw new defaultExport(key, x); + } + + root.keys.some(function (k) { + if (_seen.includes(k)) { return false; } + var ref = root[k].pattern; + var match = ref.match; + var _isSplat = ref._isSplat; + var matches = match(_isSplat ? extra || x : x); + + if (matches) { + Object.assign(params, matches); + + if (root[k].route) { + var routeInfo = Object.assign({}, root[k].info); // properly handle exact-routes! + + var hasMatch = false; + + if (routeInfo.exact) { + hasMatch = extra === null; + } else { + hasMatch = !(x && leaf === null) || x === leaf || _isSplat || !extra; + } + + routeInfo.matches = hasMatch; + routeInfo.params = Object.assign({}, params); + routeInfo.route = root[k].route; + routeInfo.path = _isSplat && extra || leaf || x; + out.push(routeInfo); + } + + if (extra === null && !root[k].keys) { + return true; + } + + if (k !== '/') { _seen.push(k); } + splat = _isSplat; + root = root[k]; + found = true; + return true; + } + + return false; + }); + + if (!(found || root.keys.some(function (k) { return root[k].pattern.match(x); }))) { + throw new defaultExport(key, x); + } + + return splat || !found; + }); + return out; + } + function find(path, routes, retries) { + var get = reduce.bind(null, path, routes); + var set = []; + + while (retries > 0) { + retries -= 1; + + try { + return get(set); + } catch (e) { + if (retries > 0) { + return get(set); + } + + throw e; + } + } + } + function add(path, routes, parent, routeInfo) { + var fullpath = merge(path, parent); + var root = routes; + var key; + + if (routeInfo && routeInfo.nested !== true) { + key = routeInfo.key; + delete routeInfo.key; + } + + walk(fullpath, function (x, leaf) { + root = PathMatcher.push(x, root, leaf, fullpath); + + if (x !== '/') { + root.info = root.info || Object.assign({}, routeInfo); + } + }); + root.info = root.info || Object.assign({}, routeInfo); + + if (key) { + root.info.key = key; + } + + return fullpath; + } + function rm(path, routes, parent) { + var fullpath = merge(path, parent); + var root = routes; + var leaf = null; + var key = null; + walk(fullpath, function (x) { + if (!root) { + leaf = null; + return true; + } + + if (!root.keys) { + throw new defaultExport(path, x); + } + + key = x; + leaf = root; + root = root[key]; + }); + + if (!(leaf && key)) { + throw new defaultExport(path, key); + } + + if (leaf === routes) { + leaf = routes['/']; + } + + if (leaf.route !== key) { + var offset = leaf.keys.indexOf(key); + + if (offset === -1) { + throw new defaultExport(path, key); + } + + leaf.keys.splice(offset, 1); + PathMatcher.sort(leaf); + delete leaf[key]; + } + + if (root.route === leaf.route) { + delete leaf.info; + } + } + + var Router = function Router() { + var routes = {}; + var stack = []; + return { + resolve: function (path, cb) { + var url = path.split('?')[0]; + var seen = []; + walk(url, function (x, leaf, extra) { + try { + cb(null, find(leaf, routes, 1).filter(function (r) { + if (!seen.includes(r.route)) { + seen.push(r.route); + return true; + } + + return false; + })); + } catch (e) { + cb(e, []); + } + }); + }, + mount: function (path, cb) { + if (path !== '/') { + stack.push(path); + } + + cb(); + stack.pop(); + }, + find: function (path, retries) { return find(path, routes, retries === true ? 2 : retries || 1); }, + add: function (path, routeInfo) { return add(path, routes, stack.join(''), routeInfo); }, + rm: function (path) { return rm(path, routes, stack.join('')); } + }; + }; + + Router.matches = function matches (uri, path) { + return buildMatcher(uri, path).regex.test(path); + }; + + return Router; + + })); + }); + + const subscriber_queue = []; + /** + * Creates a `Readable` store that allows reading by subscription. + * @param value initial value + * @param {StartStopNotifier}start start and stop notifications for subscriptions + */ + function readable(value, start) { + return { + subscribe: writable(value, start).subscribe, + }; + } + /** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions + */ + function writable(value, start = noop) { + let stop; + const subscribers = []; + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { // store is ready + const run_queue = !subscriber_queue.length; + for (let i = 0; i < subscribers.length; i += 1) { + const s = subscribers[i]; + s[1](); + subscriber_queue.push(s, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) { + stop = start(set) || noop; + } + run(value); + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; + } + function derived(stores, fn, initial_value) { + const single = !Array.isArray(stores); + const stores_array = single + ? [stores] + : stores; + const auto = fn.length < 2; + return readable(initial_value, (set) => { + let inited = false; + const values = []; + let pending = 0; + let cleanup = noop; + const sync = () => { + if (pending) { + return; + } + cleanup(); + const result = fn(single ? values[0] : values, set); + if (auto) { + set(result); + } + else { + cleanup = is_function(result) ? result : noop; + } + }; + const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => { + values[i] = value; + pending &= ~(1 << i); + if (inited) { + sync(); + } + }, () => { + pending |= (1 << i); + })); + inited = true; + sync(); + return function stop() { + run_all(unsubscribers); + cleanup(); + }; + }); + } + + const cache = {}; + const baseTag = document.getElementsByTagName('base'); + const basePrefix = (baseTag[0] && baseTag[0].href.replace(/\/$/, '')) || '/'; + + const ROOT_URL = basePrefix.replace(window.location.origin, ''); + + const router = writable({ + path: '/', + query: {}, + params: {}, + }); + + const CTX_ROUTER = {}; + const CTX_ROUTE = {}; + + // use location.hash on embedded pages, e.g. Svelte REPL + let HASHCHANGE = window.location.origin === 'null'; + + function hashchangeEnable(value) { + if (typeof value === 'boolean') { + HASHCHANGE = !!value; + } + + return HASHCHANGE; + } + + function fixedLocation(path, callback) { + const baseUri = hashchangeEnable() ? window.location.hash.replace('#', '') : window.location.pathname; + + // this will rebase anchors to avoid location changes + if (path.charAt() !== '/') { + path = baseUri + path; + } + + const currentURL = baseUri + window.location.hash + window.location.search; + + // do not change location et all... + if (currentURL !== path) { + callback(path); + } + } + + function navigateTo(path, options) { + const { + reload, replace, + params, queryParams, + } = options || {}; + + // If path empty or no string, throws error + if (!path || typeof path !== 'string' || (path[0] !== '/' && path[0] !== '#')) { + throw new Error(`Expecting '/${path}' or '#${path}', given '${path}'`); + } + + if (params) { + path = path.replace(/:([a-zA-Z][a-zA-Z0-9_-]*)/g, (_, key) => params[key]); + } + + // rebase active URL + if (ROOT_URL !== '/' && path.indexOf(ROOT_URL) !== 0) { + path = ROOT_URL + path; + } + + if (queryParams) { + const qs = queryString.stringify(queryParams); + + if (qs) { + path += `?${qs}`; + } + } + + if (hashchangeEnable()) { + window.location.hash = path.replace(/^#/, ''); + return; + } + + // If no History API support, fallbacks to URL redirect + if (reload || !window.history.pushState || !window.dispatchEvent) { + window.location.href = path; + return; + } + + // If has History API support, uses it + fixedLocation(path, nextURL => { + window.history[replace ? 'replaceState' : 'pushState'](null, '', nextURL); + window.dispatchEvent(new Event('popstate')); + }); + } + + function getProps(given, required) { + const { props: sub, ...others } = given; + + // prune all declared props from this component + required = !Array.isArray(required) + ? Object.keys(required) + : required; + + required.forEach(k => { + delete others[k]; + }); + + return { + ...sub, + ...others, + }; + } + + function isActive(uri, path, exact) { + if (!cache[[uri, path, exact]]) { + if (exact !== true && path.indexOf(uri) === 0) { + cache[[uri, path, exact]] = /^[#/?]?$/.test(path.substr(uri.length, 1)); + } else if (uri.includes('*') || uri.includes(':')) { + cache[[uri, path, exact]] = index_umd.matches(uri, path); + } else { + cache[[uri, path, exact]] = path === uri; + } + } + + return cache[[uri, path, exact]]; + } + + const baseRouter = new index_umd(); + const routeInfo = writable({}); + + // private registries + const onError = {}; + const shared = {}; + + let errors = []; + let routers = 0; + let interval; + + // take snapshot from current state... + router.subscribe(value => { shared.router = value; }); + routeInfo.subscribe(value => { shared.routeInfo = value; }); + + function doFallback(failure, fallback) { + routeInfo.update(defaults => ({ + ...defaults, + [fallback]: { + ...shared.router, + failure, + }, + })); + } + + function handleRoutes(map, params) { + const keys = []; + + map.some(x => { + if (x.key && x.matches && !x.fallback && !shared.routeInfo[x.key]) { + if (x.redirect && (x.condition === null || x.condition(shared.router) !== true)) { + if (x.exact && shared.router.path !== x.path) return false; + navigateTo(x.redirect); + return true; + } + + if (x.exact) { + keys.push(x.key); + } + + // extend shared params... + Object.assign(params, x.params); + + // upgrade matching routes! + routeInfo.update(defaults => ({ + ...defaults, + [x.key]: { + ...shared.router, + ...x, + }, + })); + } + + return false; + }); + + return keys; + } + + function evtHandler() { + let baseUri = !hashchangeEnable() ? window.location.href.replace(window.location.origin, '') : window.location.hash || '/'; + let failure; + + // unprefix active URL + if (ROOT_URL !== '/') { + baseUri = baseUri.replace(ROOT_URL, ''); + } + + const [fullpath, qs] = baseUri.replace('/#', '#').replace(/^#\//, '/').split('?'); + const query = queryString.parse(qs); + const params = {}; + const keys = []; + + // reset current state + routeInfo.set({}); + router.set({ + query, + params, + path: fullpath, + }); + + // load all matching routes... + baseRouter.resolve(fullpath, (err, result) => { + if (err) { + failure = err; + return; + } + + // save exact-keys for deletion after failures! + keys.push(...handleRoutes(result, params)); + }); + + const toDelete = {}; + + if (failure) { + keys.reduce((prev, cur) => { + prev[cur] = null; + return prev; + }, toDelete); + } + + // clear previously failed handlers + errors.forEach(cb => cb()); + errors = []; + + try { + // clear routes that not longer matches! + baseRouter.find(fullpath).forEach(sub => { + if (sub.exact && !sub.matches) { + toDelete[sub.key] = null; + } + }); + } catch (e) { + // this is fine + } + + // drop unwanted routes... + routeInfo.update(defaults => ({ + ...defaults, + ...toDelete, + })); + + let fallback; + + // invoke error-handlers to clear out previous state! + Object.keys(onError).forEach(root => { + if (isActive(root, fullpath, false)) { + const fn = onError[root].callback; + + fn(failure); + errors.push(fn); + } + + if (!fallback && onError[root].fallback) { + fallback = onError[root].fallback; + } + }); + + // handle unmatched fallbacks + if (failure && fallback) { + doFallback(failure, fallback); + } + } + + function findRoutes() { + clearTimeout(interval); + interval = setTimeout(evtHandler); + } + + function addRouter(root, fallback, callback) { + if (!routers) { + window.addEventListener('popstate', findRoutes, false); + } + + // register error-handlers + onError[root] = { fallback, callback }; + routers += 1; + + return () => { + delete onError[root]; + routers -= 1; + + if (!routers) { + window.removeEventListener('popstate', findRoutes, false); + } + }; + } + + /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Router.svelte generated by Svelte v3.19.2 */ + + function add_css() { + var style = element("style"); + style.id = "svelte-kx2cky-style"; + style.textContent = "[data-failure].svelte-kx2cky{border:1px dashed silver}"; + append(document.head, style); + } + + // (99:0) {#if !disabled} + function create_if_block_1(ctx) { + let current; + const default_slot_template = /*$$slots*/ ctx[15].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[14], null); + + return { + c() { + if (default_slot) default_slot.c(); + }, + m(target, anchor) { + if (default_slot) { + default_slot.m(target, anchor); + } + + current = true; + }, + p(ctx, dirty) { + if (default_slot && default_slot.p && dirty & /*$$scope*/ 16384) { + default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[14], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[14], dirty, null)); + } + }, + i(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o(local) { + transition_out(default_slot, local); + current = false; + }, + d(detaching) { + if (default_slot) default_slot.d(detaching); + } + }; + } + + // (103:0) {#if failure && !fallback && !nofallback} + function create_if_block(ctx) { + let fieldset; + let legend; + let t0; + let t1; + let t2; + let pre; + let t3; + + return { + c() { + fieldset = element("fieldset"); + legend = element("legend"); + t0 = text("Router failure: "); + t1 = text(/*path*/ ctx[1]); + t2 = space(); + pre = element("pre"); + t3 = text(/*failure*/ ctx[3]); + attr(fieldset, "data-failure", ""); + attr(fieldset, "class", "svelte-kx2cky"); + }, + m(target, anchor) { + insert(target, fieldset, anchor); + append(fieldset, legend); + append(legend, t0); + append(legend, t1); + append(fieldset, t2); + append(fieldset, pre); + append(pre, t3); + }, + p(ctx, dirty) { + if (dirty & /*path*/ 2) set_data(t1, /*path*/ ctx[1]); + if (dirty & /*failure*/ 8) set_data(t3, /*failure*/ ctx[3]); + }, + d(detaching) { + if (detaching) detach(fieldset); + } + }; + } + + function create_fragment(ctx) { + let t; + let if_block1_anchor; + let current; + let if_block0 = !/*disabled*/ ctx[0] && create_if_block_1(ctx); + let if_block1 = /*failure*/ ctx[3] && !/*fallback*/ ctx[4] && !/*nofallback*/ ctx[2] && create_if_block(ctx); + + return { + c() { + if (if_block0) if_block0.c(); + t = space(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); + }, + m(target, anchor) { + if (if_block0) if_block0.m(target, anchor); + insert(target, t, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + if (!/*disabled*/ ctx[0]) { + if (if_block0) { + if_block0.p(ctx, dirty); + transition_in(if_block0, 1); + } else { + if_block0 = create_if_block_1(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(t.parentNode, t); + } + } else if (if_block0) { + group_outros(); + + transition_out(if_block0, 1, 1, () => { + if_block0 = null; + }); + + check_outros(); + } + + if (/*failure*/ ctx[3] && !/*fallback*/ ctx[4] && !/*nofallback*/ ctx[2]) { + if (if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1 = create_if_block(ctx); + if_block1.c(); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + }, + i(local) { + if (current) return; + transition_in(if_block0); + current = true; + }, + o(local) { + transition_out(if_block0); + current = false; + }, + d(detaching) { + if (if_block0) if_block0.d(detaching); + if (detaching) detach(t); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); + } + }; + } + + function unassignRoute(route) { + baseRouter.rm(route); + findRoutes(); + } + + function instance($$self, $$props, $$invalidate) { + let $basePath; + let $router; + component_subscribe($$self, router, $$value => $$invalidate(9, $router = $$value)); + let cleanup; + let failure; + let fallback; + let { path = "/" } = $$props; + let { disabled = false } = $$props; + let { condition = null } = $$props; + let { nofallback = false } = $$props; + const routerContext = getContext(CTX_ROUTER); + const basePath = routerContext ? routerContext.basePath : writable(path); + component_subscribe($$self, basePath, value => $$invalidate(8, $basePath = value)); + + const fixedRoot = $basePath !== path && $basePath !== "/" + ? `${$basePath}${path !== "/" ? path : ""}` + : path; + + try { + if (condition !== null && typeof condition !== "function") { + throw new TypeError(`Expecting condition to be a function, given '${condition}'`); + } + + if (path.charAt() !== "#" && path.charAt() !== "/") { + throw new TypeError(`Expecting a leading slash or hash, given '${path}'`); + } + } catch(e) { + failure = e; + } + + function assignRoute(key, route, detail) { + key = key || Math.random().toString(36).substr(2); + + // consider as nested routes if they does not have any segment + const nested = !route.substr(1).includes("/"); + + const handler = { key, nested, ...detail }; + let fullpath; + + baseRouter.mount(fixedRoot, () => { + fullpath = baseRouter.add(route, handler); + $$invalidate(4, fallback = handler.fallback && key || fallback); + }); + + findRoutes(); + return [key, fullpath]; + } + + function onError(err) { + $$invalidate(3, failure = err); + + if (failure && fallback) { + doFallback(failure, fallback); + } + } + + onMount(() => { + cleanup = addRouter(fixedRoot, fallback, onError); + }); + + onDestroy(() => { + if (cleanup) cleanup(); + }); + + setContext(CTX_ROUTER, { basePath, assignRoute, unassignRoute }); + let { $$slots = {}, $$scope } = $$props; + + $$self.$set = $$props => { + if ("path" in $$props) $$invalidate(1, path = $$props.path); + if ("disabled" in $$props) $$invalidate(0, disabled = $$props.disabled); + if ("condition" in $$props) $$invalidate(6, condition = $$props.condition); + if ("nofallback" in $$props) $$invalidate(2, nofallback = $$props.nofallback); + if ("$$scope" in $$props) $$invalidate(14, $$scope = $$props.$$scope); + }; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*condition, $router*/ 576) { + if (condition) { + $$invalidate(0, disabled = !condition($router)); + } + } + }; + + return [ + disabled, + path, + nofallback, + failure, + fallback, + basePath, + condition, + cleanup, + $basePath, + $router, + routerContext, + fixedRoot, + assignRoute, + onError, + $$scope, + $$slots + ]; + } + + class Router extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-kx2cky-style")) add_css(); + + init(this, options, instance, create_fragment, safe_not_equal, { + path: 1, + disabled: 0, + condition: 6, + nofallback: 2 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Route.svelte generated by Svelte v3.19.2 */ + + function add_css$1() { + var style = element("style"); + style.id = "svelte-7lze0z-style"; + style.textContent = "[data-failure].svelte-7lze0z{color:red}"; + append(document.head, style); + } + + const get_default_slot_changes = dirty => ({ + router: dirty & /*activeRouter*/ 2, + props: dirty & /*activeProps*/ 4 + }); + + const get_default_slot_context = ctx => ({ + router: /*activeRouter*/ ctx[1], + props: /*activeProps*/ ctx[2] + }); + + // (82:0) {#if failure} + function create_if_block_2(ctx) { + let p; + let t; + + return { + c() { + p = element("p"); + t = text(/*failure*/ ctx[3]); + attr(p, "data-failure", ""); + attr(p, "class", "svelte-7lze0z"); + }, + m(target, anchor) { + insert(target, p, anchor); + append(p, t); + }, + p(ctx, dirty) { + if (dirty & /*failure*/ 8) set_data(t, /*failure*/ ctx[3]); + }, + d(detaching) { + if (detaching) detach(p); + } + }; + } + + // (86:0) {#if activeRouter} + function create_if_block$1(ctx) { + let current_block_type_index; + let if_block; + let if_block_anchor; + let current; + const if_block_creators = [create_if_block_1$1, create_else_block]; + const if_blocks = []; + + function select_block_type(ctx, dirty) { + if (/*component*/ ctx[0]) return 0; + return 1; + } + + current_block_type_index = select_block_type(ctx, -1); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + + return { + c() { + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if_blocks[current_block_type_index].m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + p(ctx, dirty) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx, dirty); + + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } else { + group_outros(); + + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + + check_outros(); + if_block = if_blocks[current_block_type_index]; + + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + if_block.c(); + } + + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + // (89:2) {:else} + function create_else_block(ctx) { + let current; + const default_slot_template = /*$$slots*/ ctx[22].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[21], get_default_slot_context); + + return { + c() { + if (default_slot) default_slot.c(); + }, + m(target, anchor) { + if (default_slot) { + default_slot.m(target, anchor); + } + + current = true; + }, + p(ctx, dirty) { + if (default_slot && default_slot.p && dirty & /*$$scope, activeRouter, activeProps*/ 2097158) { + default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[21], get_default_slot_context), get_slot_changes(default_slot_template, /*$$scope*/ ctx[21], dirty, get_default_slot_changes)); + } + }, + i(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o(local) { + transition_out(default_slot, local); + current = false; + }, + d(detaching) { + if (default_slot) default_slot.d(detaching); + } + }; + } + + // (87:2) {#if component} + function create_if_block_1$1(ctx) { + let switch_instance_anchor; + let current; + const switch_instance_spread_levels = [{ router: /*activeRouter*/ ctx[1] }, /*activeProps*/ ctx[2]]; + var switch_value = /*component*/ ctx[0]; + + function switch_props(ctx) { + let switch_instance_props = {}; + + for (let i = 0; i < switch_instance_spread_levels.length; i += 1) { + switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]); + } + + return { props: switch_instance_props }; + } + + if (switch_value) { + var switch_instance = new switch_value(switch_props(ctx)); + } + + return { + c() { + if (switch_instance) create_component(switch_instance.$$.fragment); + switch_instance_anchor = empty(); + }, + m(target, anchor) { + if (switch_instance) { + mount_component(switch_instance, target, anchor); + } + + insert(target, switch_instance_anchor, anchor); + current = true; + }, + p(ctx, dirty) { + const switch_instance_changes = (dirty & /*activeRouter, activeProps*/ 6) + ? get_spread_update(switch_instance_spread_levels, [ + dirty & /*activeRouter*/ 2 && { router: /*activeRouter*/ ctx[1] }, + dirty & /*activeProps*/ 4 && get_spread_object(/*activeProps*/ ctx[2]) + ]) + : {}; + + if (switch_value !== (switch_value = /*component*/ ctx[0])) { + if (switch_instance) { + group_outros(); + const old_component = switch_instance; + + transition_out(old_component.$$.fragment, 1, 0, () => { + destroy_component(old_component, 1); + }); + + check_outros(); + } + + if (switch_value) { + switch_instance = new switch_value(switch_props(ctx)); + create_component(switch_instance.$$.fragment); + transition_in(switch_instance.$$.fragment, 1); + mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor); + } else { + switch_instance = null; + } + } else if (switch_value) { + switch_instance.$set(switch_instance_changes); + } + }, + i(local) { + if (current) return; + if (switch_instance) transition_in(switch_instance.$$.fragment, local); + current = true; + }, + o(local) { + if (switch_instance) transition_out(switch_instance.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(switch_instance_anchor); + if (switch_instance) destroy_component(switch_instance, detaching); + } + }; + } + + function create_fragment$1(ctx) { + let t; + let if_block1_anchor; + let current; + let if_block0 = /*failure*/ ctx[3] && create_if_block_2(ctx); + let if_block1 = /*activeRouter*/ ctx[1] && create_if_block$1(ctx); + + return { + c() { + if (if_block0) if_block0.c(); + t = space(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); + }, + m(target, anchor) { + if (if_block0) if_block0.m(target, anchor); + insert(target, t, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + if (/*failure*/ ctx[3]) { + if (if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0 = create_if_block_2(ctx); + if_block0.c(); + if_block0.m(t.parentNode, t); + } + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + + if (/*activeRouter*/ ctx[1]) { + if (if_block1) { + if_block1.p(ctx, dirty); + transition_in(if_block1, 1); + } else { + if_block1 = create_if_block$1(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + group_outros(); + + transition_out(if_block1, 1, 1, () => { + if_block1 = null; + }); + + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(if_block1); + current = true; + }, + o(local) { + transition_out(if_block1); + current = false; + }, + d(detaching) { + if (if_block0) if_block0.d(detaching); + if (detaching) detach(t); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); + } + }; + } + + function instance$1($$self, $$props, $$invalidate) { + let $routePath; + let $routeInfo; + component_subscribe($$self, routeInfo, $$value => $$invalidate(14, $routeInfo = $$value)); + let { key = null } = $$props; + let { path = "/" } = $$props; + let { exact = null } = $$props; + let { disabled = false } = $$props; + let { fallback = null } = $$props; + let { component = null } = $$props; + let { condition = null } = $$props; + let { redirect = null } = $$props; + const routeContext = getContext(CTX_ROUTE); + const routerContext = getContext(CTX_ROUTER); + const { assignRoute, unassignRoute } = routerContext || {}; + const routePath = routeContext ? routeContext.routePath : writable(path); + component_subscribe($$self, routePath, value => $$invalidate(13, $routePath = value)); + let activeRouter = null; + let activeProps = {}; + let fullpath; + let failure; + + const fixedRoot = $routePath !== path && $routePath !== "/" + ? `${$routePath}${path !== "/" ? path : ""}` + : path; + + try { + if (redirect !== null && !(/^(?:\w+:\/\/|\/)/).test(redirect)) { + throw new TypeError(`Expecting valid URL to redirect, given '${redirect}'`); + } + + if (condition !== null && typeof condition !== "function") { + throw new TypeError(`Expecting condition to be a function, given '${condition}'`); + } + + if (path.charAt() !== "#" && path.charAt() !== "/") { + throw new TypeError(`Expecting a leading slash or hash, given '${path}'`); + } + + if (!assignRoute) { + throw new TypeError(`Missing top-level , given route: ${path}`); + } + + [key, fullpath] = assignRoute(key, fixedRoot, { condition, redirect, fallback, exact }); + } catch(e) { + failure = e; + } + + onDestroy(() => { + if (unassignRoute) { + unassignRoute(fullpath); + } + }); + + setContext(CTX_ROUTE, { routePath }); + let { $$slots = {}, $$scope } = $$props; + + $$self.$set = $$new_props => { + $$invalidate(20, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props))); + if ("key" in $$new_props) $$invalidate(5, key = $$new_props.key); + if ("path" in $$new_props) $$invalidate(6, path = $$new_props.path); + if ("exact" in $$new_props) $$invalidate(7, exact = $$new_props.exact); + if ("disabled" in $$new_props) $$invalidate(8, disabled = $$new_props.disabled); + if ("fallback" in $$new_props) $$invalidate(9, fallback = $$new_props.fallback); + if ("component" in $$new_props) $$invalidate(0, component = $$new_props.component); + if ("condition" in $$new_props) $$invalidate(10, condition = $$new_props.condition); + if ("redirect" in $$new_props) $$invalidate(11, redirect = $$new_props.redirect); + if ("$$scope" in $$new_props) $$invalidate(21, $$scope = $$new_props.$$scope); + }; + + $$self.$$.update = () => { + if (key) { + /* global arguments */ + $$invalidate(1, activeRouter = !disabled && $routeInfo[key]); + + $$invalidate(2, activeProps = getProps($$props, arguments[0].$$.props)); + } + }; + + $$props = exclude_internal_props($$props); + + return [ + component, + activeRouter, + activeProps, + failure, + routePath, + key, + path, + exact, + disabled, + fallback, + condition, + redirect, + fullpath, + $routePath, + $routeInfo, + routeContext, + routerContext, + assignRoute, + unassignRoute, + fixedRoot, + $$props, + $$scope, + $$slots + ]; + } + + class Route extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-7lze0z-style")) add_css$1(); + + init(this, options, instance$1, create_fragment$1, safe_not_equal, { + key: 5, + path: 6, + exact: 7, + disabled: 8, + fallback: 9, + component: 0, + condition: 10, + redirect: 11 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/node_modules/yrv/src/Link.svelte generated by Svelte v3.19.2 */ + + function create_else_block$1(ctx) { + let a; + let current; + let dispose; + const default_slot_template = /*$$slots*/ ctx[18].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[17], null); + + let a_levels = [ + /*fixedProps*/ ctx[5], + { href: /*fixedHref*/ ctx[4] }, + { class: /*className*/ ctx[0] }, + { title: /*title*/ ctx[1] } + ]; + + let a_data = {}; + + for (let i = 0; i < a_levels.length; i += 1) { + a_data = assign(a_data, a_levels[i]); + } + + return { + c() { + a = element("a"); + if (default_slot) default_slot.c(); + set_attributes(a, a_data); + }, + m(target, anchor) { + insert(target, a, anchor); + + if (default_slot) { + default_slot.m(a, null); + } + + /*a_binding*/ ctx[20](a); + current = true; + dispose = listen(a, "click", prevent_default(/*onClick*/ ctx[6])); + }, + p(ctx, dirty) { + if (default_slot && default_slot.p && dirty & /*$$scope*/ 131072) { + default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[17], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[17], dirty, null)); + } + + set_attributes(a, get_spread_update(a_levels, [ + dirty & /*fixedProps*/ 32 && /*fixedProps*/ ctx[5], + dirty & /*fixedHref*/ 16 && { href: /*fixedHref*/ ctx[4] }, + dirty & /*className*/ 1 && { class: /*className*/ ctx[0] }, + dirty & /*title*/ 2 && { title: /*title*/ ctx[1] } + ])); + }, + i(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o(local) { + transition_out(default_slot, local); + current = false; + }, + d(detaching) { + if (detaching) detach(a); + if (default_slot) default_slot.d(detaching); + /*a_binding*/ ctx[20](null); + dispose(); + } + }; + } + + // (73:0) {#if button} + function create_if_block$2(ctx) { + let button_1; + let current; + let dispose; + const default_slot_template = /*$$slots*/ ctx[18].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[17], null); + + let button_1_levels = [ + /*fixedProps*/ ctx[5], + { class: /*className*/ ctx[0] }, + { title: /*title*/ ctx[1] } + ]; + + let button_1_data = {}; + + for (let i = 0; i < button_1_levels.length; i += 1) { + button_1_data = assign(button_1_data, button_1_levels[i]); + } + + return { + c() { + button_1 = element("button"); + if (default_slot) default_slot.c(); + set_attributes(button_1, button_1_data); + }, + m(target, anchor) { + insert(target, button_1, anchor); + + if (default_slot) { + default_slot.m(button_1, null); + } + + /*button_1_binding*/ ctx[19](button_1); + current = true; + dispose = listen(button_1, "click", prevent_default(/*onClick*/ ctx[6])); + }, + p(ctx, dirty) { + if (default_slot && default_slot.p && dirty & /*$$scope*/ 131072) { + default_slot.p(get_slot_context(default_slot_template, ctx, /*$$scope*/ ctx[17], null), get_slot_changes(default_slot_template, /*$$scope*/ ctx[17], dirty, null)); + } + + set_attributes(button_1, get_spread_update(button_1_levels, [ + dirty & /*fixedProps*/ 32 && /*fixedProps*/ ctx[5], + dirty & /*className*/ 1 && { class: /*className*/ ctx[0] }, + dirty & /*title*/ 2 && { title: /*title*/ ctx[1] } + ])); + }, + i(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o(local) { + transition_out(default_slot, local); + current = false; + }, + d(detaching) { + if (detaching) detach(button_1); + if (default_slot) default_slot.d(detaching); + /*button_1_binding*/ ctx[19](null); + dispose(); + } + }; + } + + function create_fragment$2(ctx) { + let current_block_type_index; + let if_block; + let if_block_anchor; + let current; + const if_block_creators = [create_if_block$2, create_else_block$1]; + const if_blocks = []; + + function select_block_type(ctx, dirty) { + if (/*button*/ ctx[2]) return 0; + return 1; + } + + current_block_type_index = select_block_type(ctx, -1); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + + return { + c() { + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if_blocks[current_block_type_index].m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx, dirty); + + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } else { + group_outros(); + + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + + check_outros(); + if_block = if_blocks[current_block_type_index]; + + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + if_block.c(); + } + + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + function instance$2($$self, $$props, $$invalidate) { + let $router; + component_subscribe($$self, router, $$value => $$invalidate(14, $router = $$value)); + let ref; + let active; + let { class: cssClass = "" } = $$props; + let fixedHref = null; + let { go = null } = $$props; + let { href = "/" } = $$props; + let { title = "" } = $$props; + let { button = false } = $$props; + let { exact = false } = $$props; + let { reload = false } = $$props; + let { replace = false } = $$props; + let { className = "" } = $$props; + + onMount(() => { + $$invalidate(0, className = className || cssClass); + }); + + const dispatch = createEventDispatcher(); + + // this will enable `` calls + function onClick(e) { + if (typeof go === "string" && window.history.length > 1) { + if (go === "back") window.history.back(); else if (go === "fwd") window.history.forward(); else window.history.go(parseInt(go, 10)); + return; + } + + fixedLocation(href, nextURL => { + navigateTo(nextURL, { reload, replace }); + dispatch("click", e); + }); + } + + let { $$slots = {}, $$scope } = $$props; + + function button_1_binding($$value) { + binding_callbacks[$$value ? "unshift" : "push"](() => { + $$invalidate(3, ref = $$value); + }); + } + + function a_binding($$value) { + binding_callbacks[$$value ? "unshift" : "push"](() => { + $$invalidate(3, ref = $$value); + }); + } + + $$self.$set = $$new_props => { + $$invalidate(16, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props))); + if ("class" in $$new_props) $$invalidate(7, cssClass = $$new_props.class); + if ("go" in $$new_props) $$invalidate(8, go = $$new_props.go); + if ("href" in $$new_props) $$invalidate(9, href = $$new_props.href); + if ("title" in $$new_props) $$invalidate(1, title = $$new_props.title); + if ("button" in $$new_props) $$invalidate(2, button = $$new_props.button); + if ("exact" in $$new_props) $$invalidate(10, exact = $$new_props.exact); + if ("reload" in $$new_props) $$invalidate(11, reload = $$new_props.reload); + if ("replace" in $$new_props) $$invalidate(12, replace = $$new_props.replace); + if ("className" in $$new_props) $$invalidate(0, className = $$new_props.className); + if ("$$scope" in $$new_props) $$invalidate(17, $$scope = $$new_props.$$scope); + }; + + let fixedProps; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*href*/ 512) { + // rebase active URL + if (ROOT_URL !== "/") { + $$invalidate(4, fixedHref = ROOT_URL + href); + } else { + $$invalidate(4, fixedHref = href); + } + } + + if ($$self.$$.dirty & /*ref, $router, href, exact, active, button*/ 26124) { + if (ref && $router.path) { + if (isActive(href, $router.path, exact)) { + if (!active) { + $$invalidate(13, active = true); + ref.setAttribute("aria-current", "page"); + + if (button) { + ref.setAttribute("disabled", true); + } + } + } else if (active) { + $$invalidate(13, active = false); + ref.removeAttribute("disabled"); + ref.removeAttribute("aria-current"); + } + } + } + + // extract additional props + /* global arguments */ + $$invalidate(5, fixedProps = getProps($$props, arguments[0].$$.props)); + }; + + $$props = exclude_internal_props($$props); + + return [ + className, + title, + button, + ref, + fixedHref, + fixedProps, + onClick, + cssClass, + go, + href, + exact, + reload, + replace, + active, + $router, + dispatch, + $$props, + $$scope, + $$slots, + button_1_binding, + a_binding + ]; + } + + class Link extends SvelteComponent { + constructor(options) { + super(); + + init(this, options, instance$2, create_fragment$2, safe_not_equal, { + class: 7, + go: 8, + href: 9, + title: 1, + button: 2, + exact: 10, + reload: 11, + replace: 12, + className: 0 + }); + } + } + + Object.defineProperty(Router, 'hashchange', { + set: value => hashchangeEnable(value), + get: () => hashchangeEnable(), + configurable: false, + enumerable: false, + }); + 'use strict'; var has = Object.prototype.hasOwnProperty @@ -1556,7 +3868,7 @@ * @returns {String|Null} The decoded string. * @api private */ - function decode(input) { + function decode$1(input) { try { return decodeURIComponent(input.replace(/\+/g, ' ')); } catch (e) { @@ -1592,8 +3904,8 @@ , part; while (part = parser.exec(query)) { - var key = decode(part[1]) - , value = decode(part[2]); + var key = decode$1(part[1]) + , value = decode$1(part[2]); // // Prevent overriding of existing properties. This ensures that build-in @@ -1668,24 +3980,6 @@ parse: parse }; - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); - } - - function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - function getCjsExportFromNamespace (n) { - return n && n['default'] || n; - } - var prism = createCommonjsModule(function (module) { /* ********************************************** Begin prism-core.js @@ -1711,6 +4005,7 @@ var lang = /\blang(?:uage)?-([\w-]+)\b/i; var uniqueId = 0; + var _ = { manual: _self.Prism && _self.Prism.manual, disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, @@ -1775,6 +4070,66 @@ default: return o; } + }, + + /** + * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class. + * + * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned. + * + * @param {Element} element + * @returns {string} + */ + getLanguage: function (element) { + while (element && !lang.test(element.className)) { + element = element.parentElement; + } + if (element) { + return (element.className.match(lang) || [, 'none'])[1].toLowerCase(); + } + return 'none'; + }, + + /** + * Returns the script element that is currently executing. + * + * This does __not__ work for line script element. + * + * @returns {HTMLScriptElement | null} + */ + currentScript: function () { + if (typeof document === 'undefined') { + return null; + } + if ('currentScript' in document) { + return document.currentScript; + } + + // IE11 workaround + // we'll get the src of the current script by parsing IE11's error stack trace + // this will not work for inline scripts + + try { + throw new Error(); + } catch (err) { + // Get file src url from stack. Specifically works with the format of stack traces in IE. + // A stack will look like this: + // + // Error + // at _.util.currentScript (http://localhost/components/prism-core.js:119:5) + // at Global code (http://localhost/components/prism-core.js:606:1) + + var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1]; + if (src) { + var scripts = document.getElementsByTagName('script'); + for (var i in scripts) { + if (scripts[i].src == src) { + return scripts[i]; + } + } + } + return null; + } } }, @@ -1868,41 +4223,33 @@ highlightAllUnder: function(container, async, callback) { var env = { callback: callback, + container: container, selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' }; _.hooks.run('before-highlightall', env); - var elements = container.querySelectorAll(env.selector); + env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector)); - for (var i=0, element; element = elements[i++];) { + _.hooks.run('before-all-elements-highlight', env); + + for (var i = 0, element; element = env.elements[i++];) { _.highlightElement(element, async === true, env.callback); } }, highlightElement: function(element, async, callback) { // Find language - var language = 'none', grammar, parent = element; - - while (parent && !lang.test(parent.className)) { - parent = parent.parentNode; - } - - if (parent) { - language = (parent.className.match(lang) || [,'none'])[1].toLowerCase(); - grammar = _.languages[language]; - } + var language = _.util.getLanguage(element); + var grammar = _.languages[language]; // Set language on the element, if not present element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - if (element.parentNode) { - // Set language on the parent, for styling - parent = element.parentNode; - - if (/pre/i.test(parent.nodeName)) { - parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - } + // Set language on the parent, for styling + var parent = element.parentNode; + if (parent && parent.nodeName.toLowerCase() === 'pre') { + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; } var code = element.textContent; @@ -1914,7 +4261,7 @@ code: code }; - var insertHighlightedCode = function (highlightedCode) { + function insertHighlightedCode(highlightedCode) { env.highlightedCode = highlightedCode; _.hooks.run('before-insert', env); @@ -1924,12 +4271,13 @@ _.hooks.run('after-highlight', env); _.hooks.run('complete', env); callback && callback.call(env.element); - }; + } _.hooks.run('before-sanity-check', env); if (!env.code) { _.hooks.run('complete', env); + callback && callback.call(env.element); return; } @@ -1972,18 +4320,18 @@ matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) { for (var token in grammar) { - if(!grammar.hasOwnProperty(token) || !grammar[token]) { + if (!grammar.hasOwnProperty(token) || !grammar[token]) { continue; } - if (token == target) { - return; - } - var patterns = grammar[token]; - patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns]; + patterns = Array.isArray(patterns) ? patterns : [patterns]; for (var j = 0; j < patterns.length; ++j) { + if (target && target == token + ',' + j) { + return; + } + var pattern = patterns[j], inside = pattern.inside, lookbehind = !!pattern.lookbehind, @@ -1993,8 +4341,8 @@ if (greedy && !pattern.pattern.global) { // Without the global flag, lastIndex won't work - var flags = pattern.pattern.toString().match(/[imuy]*$/)[0]; - pattern.pattern = RegExp(pattern.pattern.source, flags + "g"); + var flags = pattern.pattern.toString().match(/[imsuy]*$/)[0]; + pattern.pattern = RegExp(pattern.pattern.source, flags + 'g'); } pattern = pattern.pattern || pattern; @@ -2020,7 +4368,7 @@ break; } - var from = match.index + (lookbehind ? match[1].length : 0), + var from = match.index + (lookbehind && match[1] ? match[1].length : 0), to = match.index + match[0].length, k = i, p = pos; @@ -2087,7 +4435,7 @@ Array.prototype.splice.apply(strarr, args); if (delNum != 1) - _.matchGrammar(text, strarr, grammar, i, pos, true, token); + _.matchGrammar(text, strarr, grammar, i, pos, true, token + ',' + j); if (oneshot) break; @@ -2148,7 +4496,7 @@ this.content = content; this.alias = alias; // Copy of the full string this token was created from - this.length = (matchedStr || "").length|0; + this.length = (matchedStr || '').length|0; this.greedy = !!greedy; } @@ -2211,21 +4559,37 @@ } //Get current script and highlight - var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop(); + var script = _.util.currentScript(); if (script) { _.filename = script.src; - if (!_.manual && !script.hasAttribute('data-manual')) { - if(document.readyState !== "loading") { - if (window.requestAnimationFrame) { - window.requestAnimationFrame(_.highlightAll); - } else { - window.setTimeout(_.highlightAll, 16); - } + if (script.hasAttribute('data-manual')) { + _.manual = true; + } + } + + if (!_.manual) { + function highlightAutomaticallyCallback() { + if (!_.manual) { + _.highlightAll(); } - else { - document.addEventListener('DOMContentLoaded', _.highlightAll); + } + + // If the document state is "loading", then we'll use DOMContentLoaded. + // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the + // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they + // might take longer one animation frame to execute which can create a race condition where only some plugins have + // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded. + // See https://github.com/PrismJS/prism/issues/2102 + var readyState = document.readyState; + if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { + document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); + } else { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(highlightAutomaticallyCallback); + } else { + window.setTimeout(highlightAutomaticallyCallback, 16); } } } @@ -2251,7 +4615,10 @@ Prism.languages.markup = { 'comment': //, 'prolog': /<\?[\s\S]+?\?>/, - 'doctype': //i, + 'doctype': { + pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i, + greedy: true + }, 'cdata': //i, 'tag': { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i, @@ -2434,17 +4801,17 @@ greedy: true }, 'class-name': { - pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, + pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: true, inside: { - punctuation: /[.\\]/ + 'punctuation': /[.\\]/ } }, 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, 'boolean': /\b(?:true|false)\b/, 'function': /\w+(?=\()/, 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, - 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, + 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, 'punctuation': /[{}[\];(),.:]/ }; @@ -2467,21 +4834,21 @@ lookbehind: true }, { - pattern: /(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: true }, ], 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, - 'operator': /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ + 'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/ }); Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; Prism.languages.insertBefore('javascript', 'keyword', { 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/, + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, lookbehind: true, greedy: true }, @@ -2631,22 +4998,6 @@ xhr.send(null); }); - - if (Prism.plugins.toolbar) { - Prism.plugins.toolbar.registerButton('download-file', function (env) { - var pre = env.element.parentNode; - if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) { - return; - } - var src = pre.getAttribute('data-src'); - var a = document.createElement('a'); - a.textContent = pre.getAttribute('data-download-link-label') || 'Download'; - a.setAttribute('download', ''); - a.href = src; - return a; - }); - } - }; document.addEventListener('DOMContentLoaded', function () { @@ -7305,23 +9656,10 @@ }; }; - /*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - - var isBuffer = function isBuffer (obj) { - return obj != null && obj.constructor != null && - typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) - }; - 'use strict'; - /*global toString:true*/ // utils is a library of generic helper functions non-specific to axios @@ -7338,6 +9676,27 @@ return toString.call(val) === '[object Array]'; } + /** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ + function isUndefined(val) { + return typeof val === 'undefined'; + } + + /** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); + } + /** * Determine if a value is an ArrayBuffer * @@ -7394,16 +9753,6 @@ return typeof val === 'number'; } - /** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ - function isUndefined(val) { - return typeof val === 'undefined'; - } - /** * Determine if a value is an Object * @@ -7928,6 +10277,57 @@ 'use strict'; + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + var isAbsoluteURL = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); + }; + + 'use strict'; + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ + var combineURLs = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; + }; + + 'use strict'; + + + + + /** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ + var buildFullPath = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; + }; + + 'use strict'; + // Headers whose duplicates are ignored by node @@ -8112,6 +10512,7 @@ + var xhr = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; @@ -8130,7 +10531,8 @@ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } - request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; @@ -8191,7 +10593,11 @@ // Handle timeout request.ontimeout = function handleTimeout() { - reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request)); // Clean up request @@ -8205,7 +10611,7 @@ var cookies$1 = cookies; // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies$1.read(config.xsrfCookieName) : undefined; @@ -8228,8 +10634,8 @@ } // Add withCredentials to request if needed - if (config.withCredentials) { - request.withCredentials = true; + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed @@ -8295,13 +10701,12 @@ function getDefaultAdapter() { var adapter; - // Only Node.JS has a process variable that is of [[Class]] process - if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = xhr; - } else if (typeof XMLHttpRequest !== 'undefined') { + if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = xhr; + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = xhr; } return adapter; } @@ -8379,38 +10784,6 @@ 'use strict'; - /** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ - var isAbsoluteURL = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); - }; - - 'use strict'; - - /** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ - var combineURLs = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; - }; - - 'use strict'; - - - @@ -8434,11 +10807,6 @@ var dispatchRequest = function dispatchRequest(config) { throwIfCancellationRequested(config); - // Support baseURL config - if (config.baseURL && !isAbsoluteURL(config.url)) { - config.url = combineURLs(config.baseURL, config.url); - } - // Ensure headers exist config.headers = config.headers || {}; @@ -8453,7 +10821,7 @@ config.headers = utils.merge( config.headers.common || {}, config.headers[config.method] || {}, - config.headers || {} + config.headers ); utils.forEach( @@ -8511,13 +10879,23 @@ config2 = config2 || {}; var config = {}; - utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) { + var valueFromConfig2Keys = ['url', 'method', 'params', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy']; + var defaultToConfig2Keys = [ + 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', + 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath' + ]; + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { if (typeof config2[prop] !== 'undefined') { config[prop] = config2[prop]; } }); - utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) { + utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) { if (utils.isObject(config2[prop])) { config[prop] = utils.deepMerge(config1[prop], config2[prop]); } else if (typeof config2[prop] !== 'undefined') { @@ -8529,13 +10907,25 @@ } }); - utils.forEach([ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', - 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', - 'socketPath' - ], function defaultToConfig2(prop) { + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys); + + var otherKeys = Object + .keys(config2) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) { if (typeof config2[prop] !== 'undefined') { config[prop] = config2[prop]; } else if (typeof config1[prop] !== 'undefined') { @@ -8583,7 +10973,15 @@ } config = mergeConfig(this.defaults, config); - config.method = config.method ? config.method.toLowerCase() : 'get'; + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; @@ -8904,7 +11302,7 @@ }, target); }; - var decode$1 = function (str, decoder, charset) { + var decode$2 = function (str, decoder, charset) { var strWithoutPlus = str.replace(/\+/g, ' '); if (charset === 'iso-8859-1') { // unescape never throws, no try...catch needed: @@ -9026,7 +11424,7 @@ assign: assign$1, combine: combine, compact: compact, - decode: decode$1, + decode: decode$2, encode: encode$2, isBuffer: isBuffer$1, isRegExp: isRegExp, @@ -10186,111 +12584,1262 @@ : Promise.reject(new DOMException('The request is not allowed', 'NotAllowedError')) } - const subscriber_queue = []; - /** - * Creates a `Readable` store that allows reading by subscription. - * @param value initial value - * @param {StartStopNotifier}start start and stop notifications for subscriptions - */ - function readable(value, start) { - return { - subscribe: writable(value, start).subscribe, - }; + var core = createCommonjsModule(function (module, exports) { + ;(function (root, factory) { + if ('object' === "object") { + // CommonJS + module.exports = exports = factory(); + } + else if (typeof undefined === "function" && undefined.amd) { + // AMD + undefined([], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(); + } + }(commonjsGlobal, function () { + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined$1) { + /* + * Local polyfil of Object.create + */ + var create = Object.create || (function () { + function F() {}; + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()); + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined$1) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + var r = (function (m_w) { + var m_w = m_w; + var m_z = 0x3ade68b1; + var mask = 0xffffffff; + + return function () { + m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; + m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; + var result = ((m_z << 0x10) + m_w) & mask; + result /= 0x100000000; + result += 0.5; + return result * (Math.random() > .5 ? 1 : -1); + } + }); + + for (var i = 0, rcache; i < nBytes; i += 4) { + var _r = r((rcache || Math.random()) * 0x100000000); + + rcache = _r() * 0x3ade67b7; + words.push((_r() * 0x100000000) | 0); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + + })); + }); + + var sha256 = createCommonjsModule(function (module, exports) { + ;(function (root, factory) { + if ('object' === "object") { + // CommonJS + module.exports = exports = factory(core); + } + else if (typeof undefined === "function" && undefined.amd) { + // AMD + undefined(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(commonjsGlobal, function (CryptoJS) { + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + return CryptoJS.SHA256; + + })); + }); + + var encBase64 = createCommonjsModule(function (module, exports) { + ;(function (root, factory) { + if ('object' === "object") { + // CommonJS + module.exports = exports = factory(core); + } + else if (typeof undefined === "function" && undefined.amd) { + // AMD + undefined(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(commonjsGlobal, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + return CryptoJS.enc.Base64; + + })); + }); + + var _nodeResolve_empty = {}; + + var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _nodeResolve_empty + }); + + var require$$0 = getCjsExportFromNamespace(_nodeResolve_empty$1); + + var secureRandom = createCommonjsModule(function (module) { + !function(globals){ + 'use strict'; + + //*** UMD BEGIN + if (typeof undefined !== 'undefined' && undefined.amd) { //require.js / AMD + undefined([], function() { + return secureRandom + }); + } else if ('object' !== 'undefined' && module.exports) { //CommonJS + module.exports = secureRandom; + } else { //script / browser + globals.secureRandom = secureRandom; } - /** - * Create a `Writable` store that allows both updating and reading by subscription. - * @param {*=}value initial value - * @param {StartStopNotifier=}start start and stop notifications for subscriptions - */ - function writable(value, start = noop) { - let stop; - const subscribers = []; - function set(new_value) { - if (safe_not_equal(value, new_value)) { - value = new_value; - if (stop) { // store is ready - const run_queue = !subscriber_queue.length; - for (let i = 0; i < subscribers.length; i += 1) { - const s = subscribers[i]; - s[1](); - subscriber_queue.push(s, value); - } - if (run_queue) { - for (let i = 0; i < subscriber_queue.length; i += 2) { - subscriber_queue[i][0](subscriber_queue[i + 1]); - } - subscriber_queue.length = 0; - } - } - } - } - function update(fn) { - set(fn(value)); - } - function subscribe(run, invalidate = noop) { - const subscriber = [run, invalidate]; - subscribers.push(subscriber); - if (subscribers.length === 1) { - stop = start(set) || noop; - } - run(value); - return () => { - const index = subscribers.indexOf(subscriber); - if (index !== -1) { - subscribers.splice(index, 1); - } - if (subscribers.length === 0) { - stop(); - stop = null; - } - }; - } - return { set, update, subscribe }; - } - function derived(stores, fn, initial_value) { - const single = !Array.isArray(stores); - const stores_array = single - ? [stores] - : stores; - const auto = fn.length < 2; - return readable(initial_value, (set) => { - let inited = false; - const values = []; - let pending = 0; - let cleanup = noop; - const sync = () => { - if (pending) { - return; - } - cleanup(); - const result = fn(single ? values[0] : values, set); - if (auto) { - set(result); - } - else { - cleanup = is_function(result) ? result : noop; - } - }; - const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => { - values[i] = value; - pending &= ~(1 << i); - if (inited) { - sync(); - } - }, () => { - pending |= (1 << i); - })); - inited = true; - sync(); - return function stop() { - run_all(unsubscribers); - cleanup(); - }; - }); + //*** UMD END + + //options.type is the only valid option + function secureRandom(count, options) { + options = options || {type: 'Array'}; + //we check for process.pid to prevent browserify from tricking us + if ( + typeof process != 'undefined' + && typeof process.pid == 'number' + && process.versions + && process.versions.node + ) { + return nodeRandom(count, options) + } else { + var crypto = window.crypto || window.msCrypto; + if (!crypto) throw new Error("Your browser does not support window.crypto.") + return browserRandom(count, options) + } } + function nodeRandom(count, options) { + var crypto = require$$0; + var buf = crypto.randomBytes(count); + + switch (options.type) { + case 'Array': + return [].slice.call(buf) + case 'Buffer': + return buf + case 'Uint8Array': + var arr = new Uint8Array(count); + for (var i = 0; i < count; ++i) { arr[i] = buf.readUInt8(i); } + return arr + default: + throw new Error(options.type + " is unsupported.") + } + } + + function browserRandom(count, options) { + var nativeArr = new Uint8Array(count); + var crypto = window.crypto || window.msCrypto; + crypto.getRandomValues(nativeArr); + + switch (options.type) { + case 'Array': + return [].slice.call(nativeArr) + case 'Buffer': + try { var b = new Buffer(1); } catch(e) { throw new Error('Buffer not supported in this environment. Use Node.js or Browserify for browser support.')} + return new Buffer(nativeArr) + case 'Uint8Array': + return nativeArr + default: + throw new Error(options.type + " is unsupported.") + } + } + + secureRandom.randomArray = function(byteCount) { + return secureRandom(byteCount, {type: 'Array'}) + }; + + secureRandom.randomUint8Array = function(byteCount) { + return secureRandom(byteCount, {type: 'Uint8Array'}) + }; + + secureRandom.randomBuffer = function(byteCount) { + return secureRandom(byteCount, {type: 'Buffer'}) + }; + + + }(commonjsGlobal); + }); + + var lib$1 = createCommonjsModule(function (module, exports) { + "use strict"; + exports.__esModule = true; + + + + var mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; + function random(size) { + var value = ""; + var bytes = secureRandom(size); + var scale = 256 / mask.length; // 256 = 0 to 0xFF (randomBytes) + for (var i = 0; i < size; i++) { + value += mask.charAt(Math.floor(bytes[i] / scale)); + } + return value; + } + exports.random = random; + function hash(str) { + return encBase64.stringify(sha256(str)); + } + function base64url(str) { + return str + .replace(/=/g, "") + .replace(/\+/g, "-") + .replace(/\//g, "_"); + } + function createVerifier(length) { + if (length === void 0) { length = 128; } + if (length < 43 || length > 128) { + throw new Error("expected length " + length + " between 43 and 128"); + } + return random(length); + } + exports.createVerifier = createVerifier; + function createChallenge(verifier) { + return base64url(hash(verifier)); + } + exports.createChallenge = createChallenge; + function create(length) { + if (length === void 0) { length = 128; } + var verifier = createVerifier(length); + var challenge = createChallenge(verifier); + return { + codeVerifier: verifier, + codeChallenge: challenge + }; + } + exports.create = create; + }); + + var pkce = unwrapExports(lib$1); + var lib_1$1 = lib$1.random; + var lib_2$1 = lib$1.createVerifier; + var lib_3$1 = lib$1.createChallenge; + var lib_4 = lib$1.create; + const env = writable(""); - const token = writable(""); + const token$1 = writable(""); env.subscribe(val => { if (val != "") { @@ -10465,10 +14014,13 @@ const filterActions = (tagActions, query) => { if (query.startsWith("g:")) { + const slugs = query.substr(2).split("~"); return tagActions .map(tag => { const children = tag.children.filter(child => { - return slugify(child.title) === query.substr(2); + return ( + slugify(child.title) === slugs[1] && slugify(tag.title) === slugs[0] + ); }); return filteredItem(tag.title, "children", children.filter(Boolean)); @@ -10476,6 +14028,18 @@ .filter(Boolean); } + if (query.startsWith("rg:")) { + return tagActions + .map(tag => { + const children = tag.children.filter( + () => slugify(tag.title) === query.substr(3) + ); + + return filteredItem(tag.title, "children", children.filter(Boolean)); + }) + .filter(Boolean); + } + const regex = new RegExp(escape$2(query), "gi"); return tagActions @@ -10490,30 +14054,28 @@ .filter(Boolean); }; - const basePath = config => { - if (config.basePath.endsWith("/")) { - return config.basePath; - } else { - return config.basePath + "/"; - } - }; + const tokenStore = store2.namespace("token"); - const tokenName = env => `token:${env}`; - const setToken = (env, token) => store2.session.set(tokenName(env), token); - const getToken = env => store2.session.get(tokenName(env)); - const removeToken = env => store2.session.remove(tokenName(env)); + const setToken = (env, token) => tokenStore.set(env, token); + const getToken = env => tokenStore.get(env); + const removeToken = env => tokenStore.remove(env); - const refreshTokenName = env => `refresh-token:${env}`; - const setRefreshToken = (env, token) => - store2.session.set(refreshTokenName(env), token); - const getRefreshToken = env => store2.session.get(refreshTokenName(env)); - const removeRefreshToken = env => store2.session.remove(refreshTokenName(env)); + const refreshTokenStore = store2.namespace("refresh-token"); + const setRefreshToken = (env, token) => refreshTokenStore.set(env, token); + const getRefreshToken = env => refreshTokenStore.get(env); + const removeRefreshToken = env => refreshTokenStore.remove(env); const isAuth = (environment, name) => { return environment.auth && environment.auth.name === name; }; - const pushHistory = href => history.pushState(history.state, "", href); + const isPKCE = environment => { + if (isAuth(environment, "oauth2")) { + return environment.auth.options.clientSecret === undefined; + } + + return false; + }; const requestToken = async (client, options) => { const authRequest = src.client(client, options); @@ -10533,10 +14095,23 @@ }; }; - const exchangeToken = async (code, options) => { + const exchangeToken = async (code, options, isPKCE, pkceChallenge) => { + if (isPKCE) { + return requestToken(axios$1.create(), { + url: options.tokenUrl, + grant_type: "authorization_code", + state: getState(), + client_id: options.clientId, + redirect_uri: options.callbackUrl, + code: code, + code_verifier: pkceChallenge.codeVerifier + }); + } + return requestToken(axios$1.create(), { url: options.tokenUrl, grant_type: "authorization_code", + state: getState(), client_id: options.clientId, client_secret: options.clientSecret, redirect_uri: options.callbackUrl, @@ -10546,6 +14121,7 @@ const populate = arr => { return arr + .filter(Boolean) .filter(obj => obj.used) .reduce((prev, cur) => { prev[cur.name] = cur.value; @@ -10567,13 +14143,14 @@ } = await requestToken(axios$1, { url: options.tokenUrl, grant_type: "refresh_token", + state: getState(), client_id: options.clientId, client_secret: options.clientSecret, refresh_token: refreshToken }); if (newAccessToken) { - token.set(newAccessToken); + token$1.set(newAccessToken); setToken(env, newAccessToken); } @@ -10602,21 +14179,6 @@ headers: populate(headers) }; - if (environment.auth) { - switch (environment.auth.name) { - case "basic": - options.auth = environment.auth.options; - break; - case "apikey": - options.headers[environment.auth.options.header] = - environment.auth.options.key; - break; - case "oauth2": - options.headers["Authorization"] = `Bearer ${getToken(env)}`; - break; - } - } - const expandedUrl = expandUrl(action.pathTemplate, populate(parameters)); const destUrl = urlParse(expandedUrl, true); @@ -10645,2010 +14207,2133 @@ const getEnv = () => store2.get("env"); - /* usr/local/lib/node_modules/snowboard/templates/winter/components/MenuItem.svelte generated by Svelte v3.16.5 */ + const pkceStore = store2.namespace("pkce"); - function add_css() { - var style = element("style"); - style.id = "svelte-39af3j-style"; - style.textContent = ".tag.svelte-39af3j{width:3.5rem}.menu-ellipsis.svelte-39af3j{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0.25em 0.75em}.menu-action.svelte-39af3j{vertical-align:middle}"; - append(document.head, style); - } + const getPKCE = () => { + const existing = pkceStore.getAll(); - function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[7] = list[i]; - return child_ctx; - } + if (Object.keys(existing).length === 0) { + const challengePair = pkce.create(); + pkceStore.setAll(challengePair); - // (30:0) {#if title} - function create_if_block_1(ctx) { - let li; - let a0; - let t0; - let a0_data_slug_value; - let a0_href_value; - let t1; - let a1; - let span; - let i; - let dispose; + return challengePair; + } - return { - c() { - li = element("li"); - a0 = element("a"); - t0 = text(/*title*/ ctx[1]); - t1 = space(); - a1 = element("a"); - span = element("span"); - i = element("i"); - attr(a0, "data-slug", a0_data_slug_value = slugify(/*title*/ ctx[1])); - attr(a0, "href", a0_href_value = "#/g~" + slugify(/*title*/ ctx[1])); - attr(a0, "class", "is-inline-block"); - attr(i, "class", "fas"); - toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]); - toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]); - attr(span, "class", "icon is-small has-text-grey-light"); - attr(a1, "href", "javascript:void(0)"); - attr(a1, "class", "is-inline-block is-pulled-right"); + return existing; + }; - dispose = [ - listen(a0, "click", /*handleGroupClick*/ ctx[5]), - listen(a1, "click", /*click_handler*/ ctx[6]) - ]; - }, - m(target, anchor) { - insert(target, li, anchor); - append(li, a0); - append(a0, t0); - append(li, t1); - append(li, a1); - append(a1, span); - append(span, i); - }, - p(ctx, dirty) { - if (dirty & /*title*/ 2) set_data(t0, /*title*/ ctx[1]); + const getState = () => { + const existing = store2.get("state"); + if (existing) return existing; - if (dirty & /*title*/ 2 && a0_data_slug_value !== (a0_data_slug_value = slugify(/*title*/ ctx[1]))) { - attr(a0, "data-slug", a0_data_slug_value); - } + const state = pkce.random(16); + store2.set("state", state); + return state; + }; - if (dirty & /*title*/ 2 && a0_href_value !== (a0_href_value = "#/g~" + slugify(/*title*/ ctx[1]))) { - attr(a0, "href", a0_href_value); - } + const clearPKCE = () => pkceStore.clear(); + const clearState = () => store2.remove("state"); - if (dirty & /*hidden*/ 1) { - toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]); - } + const buildHref = path => { + const pathname = window.location.pathname; - if (dirty & /*hidden*/ 1) { - toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]); - } - }, - d(detaching) { - if (detaching) detach(li); - run_all(dispose); - } - }; - } + if (!path) { + return pathname; + } - // (53:0) {#if actions.length > 0} - function create_if_block(ctx) { - let li; - let ul; - let each_value = /*actions*/ ctx[2]; - let each_blocks = []; + return `${pathname}${path}`.replace("//", "/"); + }; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } + const handleLink = event => { + const pathname = window.location.pathname; - return { - c() { - li = element("li"); - ul = element("ul"); + let href = event.target.getAttribute("href"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } + if (!href) { + href = event.target.parentElement.getAttribute("href"); + } - toggle_class(li, "is-hidden", /*hidden*/ ctx[0]); - }, - m(target, anchor) { - insert(target, li, anchor); - append(li, ul); + const cleanHref = href.replace(pathname, ""); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(ul, null); - } - }, - p(ctx, dirty) { - if (dirty & /*actions, currentSlug, handleClick, colorize*/ 28) { - each_value = /*actions*/ ctx[2]; - let i; + navigateTo(cleanHref); + }; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(ul, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value.length; - } - - if (dirty & /*hidden*/ 1) { - toggle_class(li, "is-hidden", /*hidden*/ ctx[0]); - } - }, - d(detaching) { - if (detaching) detach(li); - destroy_each(each_blocks, detaching); - } - }; - } - - // (56:6) {#each actions as action} - function create_each_block(ctx) { - let li; - let a; - let code; - let t0_value = /*action*/ ctx[7].method + ""; - let t0; - let code_class_value; - let t1; - let span; - let t2_value = /*action*/ ctx[7].title + ""; - let t2; - let a_data_slug_value; - let a_href_value; - let t3; - let dispose; - - return { - c() { - li = element("li"); - a = element("a"); - code = element("code"); - t0 = text(t0_value); - t1 = space(); - span = element("span"); - t2 = text(t2_value); - t3 = space(); - attr(code, "class", code_class_value = "tag " + colorize(/*action*/ ctx[7].method) + " is-uppercase" + " svelte-39af3j"); - attr(span, "class", "menu-action svelte-39af3j"); - attr(a, "data-slug", a_data_slug_value = /*action*/ ctx[7].slug); - attr(a, "href", a_href_value = "#/" + /*action*/ ctx[7].slug); - attr(a, "class", "menu-ellipsis svelte-39af3j"); - toggle_class(a, "is-active", /*action*/ ctx[7].slug === /*currentSlug*/ ctx[3]); - dispose = listen(a, "click", /*handleClick*/ ctx[4]); - }, - m(target, anchor) { - insert(target, li, anchor); - append(li, a); - append(a, code); - append(code, t0); - append(a, t1); - append(a, span); - append(span, t2); - append(li, t3); - }, - p(ctx, dirty) { - if (dirty & /*actions*/ 4 && t0_value !== (t0_value = /*action*/ ctx[7].method + "")) set_data(t0, t0_value); - - if (dirty & /*actions*/ 4 && code_class_value !== (code_class_value = "tag " + colorize(/*action*/ ctx[7].method) + " is-uppercase" + " svelte-39af3j")) { - attr(code, "class", code_class_value); - } - - if (dirty & /*actions*/ 4 && t2_value !== (t2_value = /*action*/ ctx[7].title + "")) set_data(t2, t2_value); - - if (dirty & /*actions*/ 4 && a_data_slug_value !== (a_data_slug_value = /*action*/ ctx[7].slug)) { - attr(a, "data-slug", a_data_slug_value); - } - - if (dirty & /*actions*/ 4 && a_href_value !== (a_href_value = "#/" + /*action*/ ctx[7].slug)) { - attr(a, "href", a_href_value); - } - - if (dirty & /*actions, currentSlug*/ 12) { - toggle_class(a, "is-active", /*action*/ ctx[7].slug === /*currentSlug*/ ctx[3]); - } - }, - d(detaching) { - if (detaching) detach(li); - dispose(); - } - }; - } - - function create_fragment(ctx) { - let t; - let if_block1_anchor; - let if_block0 = /*title*/ ctx[1] && create_if_block_1(ctx); - let if_block1 = /*actions*/ ctx[2].length > 0 && create_if_block(ctx); - - return { - c() { - if (if_block0) if_block0.c(); - t = space(); - if (if_block1) if_block1.c(); - if_block1_anchor = empty(); - }, - m(target, anchor) { - if (if_block0) if_block0.m(target, anchor); - insert(target, t, anchor); - if (if_block1) if_block1.m(target, anchor); - insert(target, if_block1_anchor, anchor); - }, - p(ctx, [dirty]) { - if (/*title*/ ctx[1]) { - if (if_block0) { - if_block0.p(ctx, dirty); - } else { - if_block0 = create_if_block_1(ctx); - if_block0.c(); - if_block0.m(t.parentNode, t); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - - if (/*actions*/ ctx[2].length > 0) { - if (if_block1) { - if_block1.p(ctx, dirty); - } else { - if_block1 = create_if_block(ctx); - if_block1.c(); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block0) if_block0.d(detaching); - if (detaching) detach(t); - if (if_block1) if_block1.d(detaching); - if (detaching) detach(if_block1_anchor); - } - }; - } - - function instance($$self, $$props, $$invalidate) { - let { title } = $$props; - let { actions } = $$props; - let { currentSlug } = $$props; - let { hidden = false } = $$props; - let { handleClick } = $$props; - let { handleGroupClick } = $$props; - const click_handler = () => $$invalidate(0, hidden = !hidden); - - $$self.$set = $$props => { - if ("title" in $$props) $$invalidate(1, title = $$props.title); - if ("actions" in $$props) $$invalidate(2, actions = $$props.actions); - if ("currentSlug" in $$props) $$invalidate(3, currentSlug = $$props.currentSlug); - if ("hidden" in $$props) $$invalidate(0, hidden = $$props.hidden); - if ("handleClick" in $$props) $$invalidate(4, handleClick = $$props.handleClick); - if ("handleGroupClick" in $$props) $$invalidate(5, handleGroupClick = $$props.handleGroupClick); - }; - - return [ - hidden, - title, - actions, - currentSlug, - handleClick, - handleGroupClick, - click_handler - ]; - } - - class MenuItem extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-39af3j-style")) add_css(); - - init(this, options, instance, create_fragment, safe_not_equal, { - title: 1, - actions: 2, - currentSlug: 3, - hidden: 0, - handleClick: 4, - handleGroupClick: 5 - }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/MenuPanel.svelte generated by Svelte v3.16.5 */ - - function add_css$1() { - var style = element("style"); - style.id = "svelte-fvssqr-style"; - style.textContent = ".hero.svelte-fvssqr,.menu-wrapper.svelte-fvssqr{padding:0 2.75rem 0 2rem}.hero.svelte-fvssqr{position:sticky;top:54px;background-color:#fafafa;margin-bottom:1.5rem}.hero.is-darkmode.svelte-fvssqr{background-color:#000}.hero-body.svelte-fvssqr{padding:1.5rem 0;box-shadow:0 2px 0 0 #f5f5f5}.hero-body.is-darkmode.svelte-fvssqr{box-shadow:0 2px 0 0 #363636}.menu-wrapper.svelte-fvssqr::-webkit-scrollbar{display:none}@media screen and (min-width: 768px){.hero.svelte-fvssqr,.menu-wrapper.svelte-fvssqr{width:-moz-calc(25% - 0.5rem);width:-webkit-calc(25% - 0.5rem);width:-o-calc(25% - 0.5rem);width:calc(25% - 0.5rem)}.hero.svelte-fvssqr{position:fixed;padding:0 1.25rem}.menu-wrapper.svelte-fvssqr{position:fixed;top:140px;padding:1.5rem 1.25rem 1.25rem;height:-moz-calc(100% - 150px - 2.5rem);height:-webkit-calc(100% - 150px - 2.5rem);height:-o-calc(100% - 150px - 2.5rem);height:calc(100% - 150px - 2.5rem);overflow:-moz-scrollbars-none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto;transition:opacity 0.3s, left 0.3s}.menu.is-collapsed.svelte-fvssqr{width:3rem}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr,.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{width:calc(3rem - 2px)}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr{padding-left:0;padding-right:0}.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{padding-left:0.3175rem;padding-right:0.3175rem;box-shadow:none}.is-collapsed.svelte-fvssqr .input.is-rounded.svelte-fvssqr{padding-left:0;padding-right:0;opacity:0}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr{color:#b5b5b5;background-color:#eee;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;cursor:pointer;pointer-events:auto}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr:hover{color:#999;background-color:#e0e0e0}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr{color:#ccc;background-color:#484848}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr:hover{color:#fff;background-color:#484848}.is-collapsed.svelte-fvssqr .menu-wrapper.svelte-fvssqr{left:-30%;opacity:0}}"; - append(document.head, style); - } - - function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[17] = list[i]; - return child_ctx; - } - - function get_each_context$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[14] = list[i]; - return child_ctx; - } - - function get_each_context_2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[20] = list[i]; - return child_ctx; - } - - // (165:4) {#if query === ''} - function create_if_block_1$1(ctx) { - let ul; - let li; - let a; - let t0; - let a_href_value; - let t1; - let dispose; - let if_block = /*tagHeaders*/ ctx[2] && create_if_block_2(ctx); - - return { - c() { - ul = element("ul"); - li = element("li"); - a = element("a"); - t0 = text("Introduction"); - t1 = space(); - if (if_block) if_block.c(); - attr(a, "href", a_href_value = basePath(/*config*/ ctx[1])); - attr(ul, "class", "menu-list"); - dispose = listen(a, "click", prevent_default(/*tocClick*/ ctx[9])); - }, - m(target, anchor) { - insert(target, ul, anchor); - append(ul, li); - append(li, a); - append(a, t0); - append(ul, t1); - if (if_block) if_block.m(ul, null); - }, - p(ctx, dirty) { - if (dirty & /*config*/ 2 && a_href_value !== (a_href_value = basePath(/*config*/ ctx[1]))) { - attr(a, "href", a_href_value); - } - - if (/*tagHeaders*/ ctx[2]) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block_2(ctx); - if_block.c(); - if_block.m(ul, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - d(detaching) { - if (detaching) detach(ul); - if (if_block) if_block.d(); - dispose(); - } - }; - } - - // (172:8) {#if tagHeaders} - function create_if_block_2(ctx) { - let li; - let ul; - let each_value_2 = /*tagHeaders*/ ctx[2]; - let each_blocks = []; - - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); - } - - return { - c() { - li = element("li"); - ul = element("ul"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - }, - m(target, anchor) { - insert(target, li, anchor); - append(li, ul); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(ul, null); - } - }, - p(ctx, dirty) { - if (dirty & /*tagHeaders, headerLink, tocClick*/ 516) { - each_value_2 = /*tagHeaders*/ ctx[2]; - let i; - - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx, each_value_2, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_2(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(ul, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value_2.length; - } - }, - d(detaching) { - if (detaching) detach(li); - destroy_each(each_blocks, detaching); - } - }; - } - - // (176:16) {#if header.level === 0} - function create_if_block_3(ctx) { - let li; - let a; - let t0_value = /*header*/ ctx[20].text + ""; - let t0; - let a_href_value; - let t1; - let dispose; - - return { - c() { - li = element("li"); - a = element("a"); - t0 = text(t0_value); - t1 = space(); - attr(a, "href", a_href_value = "#" + headerLink(/*header*/ ctx[20].text)); - dispose = listen(a, "click", /*tocClick*/ ctx[9]); - }, - m(target, anchor) { - insert(target, li, anchor); - append(li, a); - append(a, t0); - append(li, t1); - }, - p(ctx, dirty) { - if (dirty & /*tagHeaders*/ 4 && t0_value !== (t0_value = /*header*/ ctx[20].text + "")) set_data(t0, t0_value); - - if (dirty & /*tagHeaders*/ 4 && a_href_value !== (a_href_value = "#" + headerLink(/*header*/ ctx[20].text))) { - attr(a, "href", a_href_value); - } - }, - d(detaching) { - if (detaching) detach(li); - dispose(); - } - }; - } - - // (175:14) {#each tagHeaders as header} - function create_each_block_2(ctx) { - let if_block_anchor; - let if_block = /*header*/ ctx[20].level === 0 && create_if_block_3(ctx); - - return { - c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - }, - p(ctx, dirty) { - if (/*header*/ ctx[20].level === 0) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block_3(ctx); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); - } - }; - } - - // (191:6) {#if tag.title} - function create_if_block$1(ctx) { - let p; - let t_value = /*tag*/ ctx[14].title + ""; - let t; - - return { - c() { - p = element("p"); - t = text(t_value); - attr(p, "class", "menu-label"); - }, - m(target, anchor) { - insert(target, p, anchor); - append(p, t); - }, - p(ctx, dirty) { - if (dirty & /*filteredActions*/ 2048 && t_value !== (t_value = /*tag*/ ctx[14].title + "")) set_data(t, t_value); - }, - d(detaching) { - if (detaching) detach(p); - } - }; - } - - // (196:8) {#each tag.children as child} - function create_each_block_1(ctx) { - let current; - - const menuitem = new MenuItem({ - props: { - title: /*child*/ ctx[17].title, - actions: /*child*/ ctx[17].actions, - hidden: /*actionsCount*/ ctx[4] > 50, - currentSlug: /*currentSlug*/ ctx[3], - handleClick: /*handleClick*/ ctx[7], - handleGroupClick: /*handleGroupClick*/ ctx[8] - } - }); - - return { - c() { - create_component(menuitem.$$.fragment); - }, - m(target, anchor) { - mount_component(menuitem, target, anchor); - current = true; - }, - p(ctx, dirty) { - const menuitem_changes = {}; - if (dirty & /*filteredActions*/ 2048) menuitem_changes.title = /*child*/ ctx[17].title; - if (dirty & /*filteredActions*/ 2048) menuitem_changes.actions = /*child*/ ctx[17].actions; - if (dirty & /*actionsCount*/ 16) menuitem_changes.hidden = /*actionsCount*/ ctx[4] > 50; - if (dirty & /*currentSlug*/ 8) menuitem_changes.currentSlug = /*currentSlug*/ ctx[3]; - if (dirty & /*handleClick*/ 128) menuitem_changes.handleClick = /*handleClick*/ ctx[7]; - if (dirty & /*handleGroupClick*/ 256) menuitem_changes.handleGroupClick = /*handleGroupClick*/ ctx[8]; - menuitem.$set(menuitem_changes); - }, - i(local) { - if (current) return; - transition_in(menuitem.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(menuitem.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(menuitem, detaching); - } - }; - } - - // (190:4) {#each filteredActions as tag} - function create_each_block$1(ctx) { - let t0; - let ul; - let t1; - let current; - let if_block = /*tag*/ ctx[14].title && create_if_block$1(ctx); - let each_value_1 = /*tag*/ ctx[14].children; - let each_blocks = []; - - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); - } - - const out = i => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - return { - c() { - if (if_block) if_block.c(); - t0 = space(); - ul = element("ul"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - t1 = space(); - attr(ul, "class", "menu-list"); - }, - m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, t0, anchor); - insert(target, ul, anchor); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(ul, null); - } - - append(ul, t1); - current = true; - }, - p(ctx, dirty) { - if (/*tag*/ ctx[14].title) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block$1(ctx); - if_block.c(); - if_block.m(t0.parentNode, t0); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - - if (dirty & /*filteredActions, actionsCount, currentSlug, handleClick, handleGroupClick*/ 2456) { - each_value_1 = /*tag*/ ctx[14].children; - let i; - - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx, each_value_1, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(ul, t1); - } - } - - group_outros(); - - for (i = each_value_1.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros(); - } - }, - i(local) { - if (current) return; - - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in(each_blocks[i]); - } - - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(t0); - if (detaching) detach(ul); - destroy_each(each_blocks, detaching); - } - }; - } - - function create_fragment$1(ctx) { - let aside; - let section; - let div1; - let div0; - let p0; - let input; - let t0; - let span; - let t1; - let div2; - let p1; - let t3; - let t4; - let current; - let dispose; - let if_block = /*query*/ ctx[0] === "" && create_if_block_1$1(ctx); - let each_value = /*filteredActions*/ ctx[11]; - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); - } - - const out = i => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - return { - c() { - aside = element("aside"); - section = element("section"); - div1 = element("div"); - div0 = element("div"); - p0 = element("p"); - input = element("input"); - t0 = space(); - span = element("span"); - span.innerHTML = ``; - t1 = space(); - div2 = element("div"); - p1 = element("p"); - p1.textContent = "API"; - t3 = space(); - if (if_block) if_block.c(); - t4 = space(); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr(input, "id", "search-input-text"); - attr(input, "class", "input is-rounded svelte-fvssqr"); - attr(input, "placeholder", "Filter by path, method, and title..."); - attr(span, "class", "icon is-right icon-input-search svelte-fvssqr"); - attr(p0, "class", "control has-icons-right"); - attr(div0, "class", "field"); - attr(div1, "class", "hero-body svelte-fvssqr"); - toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]); - attr(section, "class", "hero is-sticky svelte-fvssqr"); - toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]); - attr(p1, "class", "menu-label"); - attr(div2, "class", "menu-wrapper svelte-fvssqr"); - attr(aside, "class", "menu svelte-fvssqr"); - toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]); - - dispose = [ - listen(input, "input", /*input_input_handler*/ ctx[13]), - listen(span, "click", /*searchClick*/ ctx[10]) - ]; - }, - m(target, anchor) { - insert(target, aside, anchor); - append(aside, section); - append(section, div1); - append(div1, div0); - append(div0, p0); - append(p0, input); - set_input_value(input, /*query*/ ctx[0]); - append(p0, t0); - append(p0, span); - append(aside, t1); - append(aside, div2); - append(div2, p1); - append(div2, t3); - if (if_block) if_block.m(div2, null); - append(div2, t4); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div2, null); - } - - current = true; - }, - p(ctx, [dirty]) { - if (dirty & /*query*/ 1 && input.value !== /*query*/ ctx[0]) { - set_input_value(input, /*query*/ ctx[0]); - } - - if (dirty & /*isDarkmode*/ 64) { - toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]); - } - - if (dirty & /*isDarkmode*/ 64) { - toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]); - } - - if (/*query*/ ctx[0] === "") { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block_1$1(ctx); - if_block.c(); - if_block.m(div2, t4); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - - if (dirty & /*filteredActions, actionsCount, currentSlug, handleClick, handleGroupClick*/ 2456) { - each_value = /*filteredActions*/ ctx[11]; - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$1(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block$1(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div2, null); - } - } - - group_outros(); - - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros(); - } - - if (dirty & /*isCollapsed*/ 32) { - toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]); - } - }, - i(local) { - if (current) return; - - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (detaching) detach(aside); - if (if_block) if_block.d(); - destroy_each(each_blocks, detaching); - run_all(dispose); - } - }; - } - - function headerLink(text) { - return text.toLowerCase().replace(/\s/g, "-"); - } - - function instance$1($$self, $$props, $$invalidate) { - let { config = {} } = $$props; - let { tagActions = [] } = $$props; - let { tagHeaders = [] } = $$props; - let { currentSlug } = $$props; - let { actionsCount } = $$props; - let { isCollapsed } = $$props; - let { isDarkmode } = $$props; - let { handleClick } = $$props; - let { handleGroupClick } = $$props; - let { tocClick } = $$props; - let { searchClick } = $$props; - let { query } = $$props; - - function input_input_handler() { - query = this.value; - $$invalidate(0, query); - } - - $$self.$set = $$props => { - if ("config" in $$props) $$invalidate(1, config = $$props.config); - if ("tagActions" in $$props) $$invalidate(12, tagActions = $$props.tagActions); - if ("tagHeaders" in $$props) $$invalidate(2, tagHeaders = $$props.tagHeaders); - if ("currentSlug" in $$props) $$invalidate(3, currentSlug = $$props.currentSlug); - if ("actionsCount" in $$props) $$invalidate(4, actionsCount = $$props.actionsCount); - if ("isCollapsed" in $$props) $$invalidate(5, isCollapsed = $$props.isCollapsed); - if ("isDarkmode" in $$props) $$invalidate(6, isDarkmode = $$props.isDarkmode); - if ("handleClick" in $$props) $$invalidate(7, handleClick = $$props.handleClick); - if ("handleGroupClick" in $$props) $$invalidate(8, handleGroupClick = $$props.handleGroupClick); - if ("tocClick" in $$props) $$invalidate(9, tocClick = $$props.tocClick); - if ("searchClick" in $$props) $$invalidate(10, searchClick = $$props.searchClick); - if ("query" in $$props) $$invalidate(0, query = $$props.query); - }; - - let filteredActions; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*tagActions, query*/ 4097) { - $$invalidate(11, filteredActions = filterActions(tagActions, query)); - } - }; - - return [ - query, - config, - tagHeaders, - currentSlug, - actionsCount, - isCollapsed, - isDarkmode, - handleClick, - handleGroupClick, - tocClick, - searchClick, - filteredActions, - tagActions, - input_input_handler - ]; - } - - class MenuPanel extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-fvssqr-style")) add_css$1(); - - init(this, options, instance$1, create_fragment$1, safe_not_equal, { - config: 1, - tagActions: 12, - tagHeaders: 2, - currentSlug: 3, - actionsCount: 4, - isCollapsed: 5, - isDarkmode: 6, - handleClick: 7, - handleGroupClick: 8, - tocClick: 9, - searchClick: 10, - query: 0 - }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/tables/HeaderTable.svelte generated by Svelte v3.16.5 */ - - function get_each_context$2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[1] = list[i].name; - child_ctx[2] = list[i].example; - return child_ctx; - } - - // (5:0) {#if headers.length > 0} - function create_if_block$2(ctx) { - let table; - let thead; - let t1; - let tbody; - let each_value = /*headers*/ ctx[0]; - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); - } - - return { - c() { - table = element("table"); - thead = element("thead"); - thead.innerHTML = `Headers`; - t1 = space(); - tbody = element("tbody"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr(table, "class", "table is-stripped is-fullwidth"); - }, - m(target, anchor) { - insert(target, table, anchor); - append(table, thead); - append(table, t1); - append(table, tbody); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(tbody, null); - } - }, - p(ctx, dirty) { - if (dirty & /*headers*/ 1) { - each_value = /*headers*/ ctx[0]; - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$2(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block$2(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(tbody, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value.length; - } - }, - d(detaching) { - if (detaching) detach(table); - destroy_each(each_blocks, detaching); - } - }; - } - - // (13:6) {#each headers as { name, example }} - function create_each_block$2(ctx) { - let tr; - let td0; - let t0_value = /*name*/ ctx[1] + ""; - let t0; - let t1; - let td1; - let code; - let t2_value = /*example*/ ctx[2] + ""; - let t2; - let t3; - - return { - c() { - tr = element("tr"); - td0 = element("td"); - t0 = text(t0_value); - t1 = space(); - td1 = element("td"); - code = element("code"); - t2 = text(t2_value); - t3 = space(); - }, - m(target, anchor) { - insert(target, tr, anchor); - append(tr, td0); - append(td0, t0); - append(tr, t1); - append(tr, td1); - append(td1, code); - append(code, t2); - append(tr, t3); - }, - p(ctx, dirty) { - if (dirty & /*headers*/ 1 && t0_value !== (t0_value = /*name*/ ctx[1] + "")) set_data(t0, t0_value); - if (dirty & /*headers*/ 1 && t2_value !== (t2_value = /*example*/ ctx[2] + "")) set_data(t2, t2_value); - }, - d(detaching) { - if (detaching) detach(tr); - } - }; - } - - function create_fragment$2(ctx) { - let if_block_anchor; - let if_block = /*headers*/ ctx[0].length > 0 && create_if_block$2(ctx); - - return { - c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - }, - p(ctx, [dirty]) { - if (/*headers*/ ctx[0].length > 0) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block$2(ctx); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); - } - }; - } - - function instance$2($$self, $$props, $$invalidate) { - let { headers = [] } = $$props; - - $$self.$set = $$props => { - if ("headers" in $$props) $$invalidate(0, headers = $$props.headers); - }; - - return [headers]; - } - - class HeaderTable extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance$2, create_fragment$2, safe_not_equal, { headers: 0 }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/components/CodeBlock.svelte generated by Svelte v3.16.5 */ - - function create_if_block$3(ctx) { - let pre; - let code; - let raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + ""; - let code_class_value; - let pre_class_value; - - return { - c() { - pre = element("pre"); - code = element("code"); - attr(code, "class", code_class_value = "language-" + /*mime*/ ctx[1]); - attr(pre, "class", pre_class_value = "language-" + /*mime*/ ctx[1]); - }, - m(target, anchor) { - insert(target, pre, anchor); - append(pre, code); - code.innerHTML = raw_value; - }, - p(ctx, dirty) { - if (dirty & /*body, mime*/ 3 && raw_value !== (raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "")) code.innerHTML = raw_value;; - - if (dirty & /*mime*/ 2 && code_class_value !== (code_class_value = "language-" + /*mime*/ ctx[1])) { - attr(code, "class", code_class_value); - } - - if (dirty & /*mime*/ 2 && pre_class_value !== (pre_class_value = "language-" + /*mime*/ ctx[1])) { - attr(pre, "class", pre_class_value); - } - }, - d(detaching) { - if (detaching) detach(pre); - } - }; - } + /* usr/local/lib/node_modules/snowboard/templates/winter/pages/Home.svelte generated by Svelte v3.19.2 */ function create_fragment$3(ctx) { - let if_block_anchor; - let if_block = /*body*/ ctx[0] && create_if_block$3(ctx); - - return { - c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - }, - p(ctx, [dirty]) { - if (/*body*/ ctx[0]) { - if (if_block) { - if_block.p(ctx, dirty); - } else { - if_block = create_if_block$3(ctx); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - i: noop, - o: noop, - d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); - } - }; - } - - function instance$3($$self, $$props, $$invalidate) { - let { type } = $$props; - let { body } = $$props; - - $$self.$set = $$props => { - if ("type" in $$props) $$invalidate(2, type = $$props.type); - if ("body" in $$props) $$invalidate(0, body = $$props.body); - }; - - let mime; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*type*/ 4) { - $$invalidate(1, mime = alias(type)); - } - }; - - return [body, mime, type]; - } - - class CodeBlock extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance$3, create_fragment$3, safe_not_equal, { type: 2, body: 0 }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CodePanel.svelte generated by Svelte v3.16.5 */ - - function add_css$2() { - var style = element("style"); - style.id = "svelte-15v28ah-style"; - style.textContent = ".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}"; - append(document.head, style); - } - - // (32:0) {#if example || schema} - function create_if_block$4(ctx) { - let div2; - let div0; - let ul; - let li0; - let a0; - let t1; - let li1; - let a1; - let t3; - let div1; - let section0; - let section0_class_value; - let t4; - let section1; - let section1_class_value; - let current; - let dispose; - - const codeblock0 = new CodeBlock({ - props: { - type: /*contentType*/ ctx[0], - body: /*example*/ ctx[1] - } - }); - - const codeblock1 = new CodeBlock({ - props: { - type: "application/json", - body: /*schema*/ ctx[2] - } - }); - - return { - c() { - div2 = element("div"); - div0 = element("div"); - ul = element("ul"); - li0 = element("li"); - a0 = element("a"); - a0.textContent = "Body"; - t1 = space(); - li1 = element("li"); - a1 = element("a"); - a1.textContent = "Schema"; - t3 = space(); - div1 = element("div"); - section0 = element("section"); - create_component(codeblock0.$$.fragment); - t4 = space(); - section1 = element("section"); - create_component(codeblock1.$$.fragment); - attr(a0, "data-index", "0"); - attr(a0, "href", "javascript:void(0)"); - toggle_class(li0, "is-active", /*tabIndex*/ ctx[7] === 0); - attr(a1, "data-index", "1"); - attr(a1, "href", "javascript:void(0)"); - toggle_class(li1, "is-active", /*tabIndex*/ ctx[7] === 1); - attr(div0, "class", "tabs is-fullwidth"); - toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]); - attr(section0, "class", section0_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah"); - attr(section1, "class", section1_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah"); - attr(div2, "class", "tabs-with-content"); - - dispose = [ - listen(a0, "click", /*tabSelect*/ ctx[4]), - listen(a1, "click", /*tabSelect*/ ctx[4]) - ]; - }, - m(target, anchor) { - insert(target, div2, anchor); - append(div2, div0); - append(div0, ul); - append(ul, li0); - append(li0, a0); - append(ul, t1); - append(ul, li1); - append(li1, a1); - append(div2, t3); - append(div2, div1); - append(div1, section0); - mount_component(codeblock0, section0, null); - append(div1, t4); - append(div1, section1); - mount_component(codeblock1, section1, null); - current = true; - }, - p(ctx, dirty) { - if (dirty & /*tabIndex*/ 128) { - toggle_class(li0, "is-active", /*tabIndex*/ ctx[7] === 0); - } - - if (dirty & /*tabIndex*/ 128) { - toggle_class(li1, "is-active", /*tabIndex*/ ctx[7] === 1); - } - - if (dirty & /*asToggle*/ 8) { - toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]); - } - - const codeblock0_changes = {}; - if (dirty & /*contentType*/ 1) codeblock0_changes.type = /*contentType*/ ctx[0]; - if (dirty & /*example*/ 2) codeblock0_changes.body = /*example*/ ctx[1]; - codeblock0.$set(codeblock0_changes); - - if (!current || dirty & /*activeBody*/ 32 && section0_class_value !== (section0_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah")) { - attr(section0, "class", section0_class_value); - } - - const codeblock1_changes = {}; - if (dirty & /*schema*/ 4) codeblock1_changes.body = /*schema*/ ctx[2]; - codeblock1.$set(codeblock1_changes); - - if (!current || dirty & /*activeSchema*/ 64 && section1_class_value !== (section1_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah")) { - attr(section1, "class", section1_class_value); - } - }, - i(local) { - if (current) return; - transition_in(codeblock0.$$.fragment, local); - transition_in(codeblock1.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(codeblock0.$$.fragment, local); - transition_out(codeblock1.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach(div2); - destroy_component(codeblock0); - destroy_component(codeblock1); - run_all(dispose); - } - }; - } - - function create_fragment$4(ctx) { - let if_block_anchor; - let current; - let if_block = (/*example*/ ctx[1] || /*schema*/ ctx[2]) && create_if_block$4(ctx); - - return { - c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - }, - p(ctx, [dirty]) { - if (/*example*/ ctx[1] || /*schema*/ ctx[2]) { - if (if_block) { - if_block.p(ctx, dirty); - transition_in(if_block, 1); - } else { - if_block = create_if_block$4(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - - check_outros(); - } - }, - i(local) { - if (current) return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); - } - }; - } - - function instance$4($$self, $$props, $$invalidate) { - let { contentType } = $$props; - let { example } = $$props; - let { schema } = $$props; - let { asToggle } = $$props; - let activeBody = "is-active"; - let activeSchema = ""; - let tabIndex = 0; - - const tabSelect = event => { - const index = event.target.dataset["index"]; - $$invalidate(7, tabIndex = parseInt(index, 10)); - }; - - $$self.$set = $$props => { - if ("contentType" in $$props) $$invalidate(0, contentType = $$props.contentType); - if ("example" in $$props) $$invalidate(1, example = $$props.example); - if ("schema" in $$props) $$invalidate(2, schema = $$props.schema); - if ("asToggle" in $$props) $$invalidate(3, asToggle = $$props.asToggle); - }; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*tabIndex*/ 128) { - $$invalidate(5, activeBody = tabIndex === 0 ? "is-active" : ""); - } - - if ($$self.$$.dirty & /*tabIndex*/ 128) { - $$invalidate(6, activeSchema = tabIndex === 1 ? "is-active" : ""); - } - }; - - return [ - contentType, - example, - schema, - asToggle, - tabSelect, - activeBody, - activeSchema, - tabIndex - ]; - } - - class CodePanel extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-15v28ah-style")) add_css$2(); - - init(this, options, instance$4, create_fragment$4, safe_not_equal, { - contentType: 0, - example: 1, - schema: 2, - asToggle: 3, - tabSelect: 4 - }); - } - - get tabSelect() { - return this.$$.ctx[4]; - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/RequestPanel.svelte generated by Svelte v3.16.5 */ - - function create_if_block_1$2(ctx) { - let div; - let raw_value = markdown(/*description*/ ctx[0]) + ""; - - return { - c() { - div = element("div"); - attr(div, "class", "content"); - }, - m(target, anchor) { - insert(target, div, anchor); - div.innerHTML = raw_value; - }, - p(ctx, dirty) { - if (dirty & /*description*/ 1 && raw_value !== (raw_value = markdown(/*description*/ ctx[0]) + "")) div.innerHTML = raw_value;; - }, - d(detaching) { - if (detaching) detach(div); - } - }; - } - - // (26:0) {#if showRequest} - function create_if_block$5(ctx) { - let hr; - - return { - c() { - hr = element("hr"); - }, - m(target, anchor) { - insert(target, hr, anchor); - }, - d(detaching) { - if (detaching) detach(hr); - } - }; - } - - function create_fragment$5(ctx) { + let h1; let t0; let t1; - let t2; - let if_block1_anchor; - let current; - let if_block0 = /*description*/ ctx[0] && create_if_block_1$2(ctx); - const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[1] } }); - - const codepanel = new CodePanel({ - props: { - contentType: /*contentType*/ ctx[2], - example: /*example*/ ctx[3], - schema: /*schema*/ ctx[4], - asToggle: true - } - }); - - let if_block1 = /*showRequest*/ ctx[5] && create_if_block$5(ctx); - - return { - c() { - if (if_block0) if_block0.c(); - t0 = space(); - create_component(headertable.$$.fragment); - t1 = space(); - create_component(codepanel.$$.fragment); - t2 = space(); - if (if_block1) if_block1.c(); - if_block1_anchor = empty(); - }, - m(target, anchor) { - if (if_block0) if_block0.m(target, anchor); - insert(target, t0, anchor); - mount_component(headertable, target, anchor); - insert(target, t1, anchor); - mount_component(codepanel, target, anchor); - insert(target, t2, anchor); - if (if_block1) if_block1.m(target, anchor); - insert(target, if_block1_anchor, anchor); - current = true; - }, - p(ctx, [dirty]) { - if (/*description*/ ctx[0]) { - if (if_block0) { - if_block0.p(ctx, dirty); - } else { - if_block0 = create_if_block_1$2(ctx); - if_block0.c(); - if_block0.m(t0.parentNode, t0); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - - const headertable_changes = {}; - if (dirty & /*headers*/ 2) headertable_changes.headers = /*headers*/ ctx[1]; - headertable.$set(headertable_changes); - const codepanel_changes = {}; - if (dirty & /*contentType*/ 4) codepanel_changes.contentType = /*contentType*/ ctx[2]; - if (dirty & /*example*/ 8) codepanel_changes.example = /*example*/ ctx[3]; - if (dirty & /*schema*/ 16) codepanel_changes.schema = /*schema*/ ctx[4]; - codepanel.$set(codepanel_changes); - - if (/*showRequest*/ ctx[5]) { - if (!if_block1) { - if_block1 = create_if_block$5(ctx); - if_block1.c(); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } else { - - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - }, - i(local) { - if (current) return; - transition_in(headertable.$$.fragment, local); - transition_in(codepanel.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(headertable.$$.fragment, local); - transition_out(codepanel.$$.fragment, local); - current = false; - }, - d(detaching) { - if (if_block0) if_block0.d(detaching); - if (detaching) detach(t0); - destroy_component(headertable, detaching); - if (detaching) detach(t1); - destroy_component(codepanel, detaching); - if (detaching) detach(t2); - if (if_block1) if_block1.d(detaching); - if (detaching) detach(if_block1_anchor); - } - }; - } - - function instance$5($$self, $$props, $$invalidate) { - let { description } = $$props; - let { headers } = $$props; - let { contentType } = $$props; - let { example } = $$props; - let { schema } = $$props; - - $$self.$set = $$props => { - if ("description" in $$props) $$invalidate(0, description = $$props.description); - if ("headers" in $$props) $$invalidate(1, headers = $$props.headers); - if ("contentType" in $$props) $$invalidate(2, contentType = $$props.contentType); - if ("example" in $$props) $$invalidate(3, example = $$props.example); - if ("schema" in $$props) $$invalidate(4, schema = $$props.schema); - }; - - let showRequest; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*description, headers, example*/ 11) { - $$invalidate(5, showRequest = !!(description || headers.length !== 0 || example)); - } - }; - - return [description, headers, contentType, example, schema, showRequest]; - } - - class RequestPanel extends SvelteComponent { - constructor(options) { - super(); - - init(this, options, instance$5, create_fragment$5, safe_not_equal, { - description: 0, - headers: 1, - contentType: 2, - example: 3, - schema: 4 - }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ResponsePanel.svelte generated by Svelte v3.16.5 */ - - function create_else_block(ctx) { - let t_value = (/*contentType*/ ctx[4] || "Response") + ""; - let t; - - return { - c() { - t = text(t_value); - }, - m(target, anchor) { - insert(target, t, anchor); - }, - p(ctx, dirty) { - if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "Response") + "")) set_data(t, t_value); - }, - d(detaching) { - if (detaching) detach(t); - } - }; - } - - // (19:6) {#if title} - function create_if_block_2$1(ctx) { - let t0; - let t1; - - return { - c() { - t0 = text("Response "); - t1 = text(/*title*/ ctx[0]); - }, - m(target, anchor) { - insert(target, t0, anchor); - insert(target, t1, anchor); - }, - p(ctx, dirty) { - if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]); - }, - d(detaching) { - if (detaching) detach(t0); - if (detaching) detach(t1); - } - }; - } - - // (23:6) {#if title !== ''} - function create_if_block_1$3(ctx) { - let span; - let t_value = (/*contentType*/ ctx[4] || "") + ""; - let t; - - return { - c() { - span = element("span"); - t = text(t_value); - attr(span, "class", "tag is-medium is-white"); - }, - m(target, anchor) { - insert(target, span, anchor); - append(span, t); - }, - p(ctx, dirty) { - if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "") + "")) set_data(t, t_value); - }, - d(detaching) { - if (detaching) detach(span); - } - }; - } - - // (30:4) {#if description} - function create_if_block$6(ctx) { let div; let raw_value = markdown(/*description*/ ctx[1]) + ""; return { c() { + h1 = element("h1"); + t0 = text(/*title*/ ctx[0]); + t1 = space(); div = element("div"); + attr(h1, "class", "title"); attr(div, "class", "content"); }, m(target, anchor) { + insert(target, h1, anchor); + append(h1, t0); + insert(target, t1, anchor); insert(target, div, anchor); div.innerHTML = raw_value; }, - p(ctx, dirty) { + p(ctx, [dirty]) { + if (dirty & /*title*/ 1) set_data(t0, /*title*/ ctx[0]); if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;; }, + i: noop, + o: noop, d(detaching) { + if (detaching) detach(h1); + if (detaching) detach(t1); if (detaching) detach(div); } }; } - function create_fragment$6(ctx) { - let div1; - let header; - let p; - let t0; - let a; - let t1; - let code; - let t2; - let code_class_value; - let t3; - let div0; - let t4; - let t5; - let current; - - function select_block_type(ctx, dirty) { - if (/*title*/ ctx[0]) return create_if_block_2$1; - return create_else_block; - } - - let current_block_type = select_block_type(ctx, -1); - let if_block0 = current_block_type(ctx); - let if_block1 = /*title*/ ctx[0] !== "" && create_if_block_1$3(ctx); - let if_block2 = /*description*/ ctx[1] && create_if_block$6(ctx); - const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[2] } }); - - const codepanel = new CodePanel({ - props: { - contentType: /*contentType*/ ctx[4], - example: /*example*/ ctx[5], - schema: /*schema*/ ctx[6] - } - }); - - return { - c() { - div1 = element("div"); - header = element("header"); - p = element("p"); - if_block0.c(); - t0 = space(); - a = element("a"); - if (if_block1) if_block1.c(); - t1 = space(); - code = element("code"); - t2 = text(/*statusCode*/ ctx[3]); - t3 = space(); - div0 = element("div"); - if (if_block2) if_block2.c(); - t4 = space(); - create_component(headertable.$$.fragment); - t5 = space(); - create_component(codepanel.$$.fragment); - attr(p, "class", "card-header-title"); - attr(code, "class", code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3])); - attr(a, "href", "javascript:void(0)"); - attr(a, "class", "card-header-icon is-family-code"); - attr(header, "class", "card-header"); - attr(div0, "class", "card-content"); - attr(div1, "class", "card"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, header); - append(header, p); - if_block0.m(p, null); - append(header, t0); - append(header, a); - if (if_block1) if_block1.m(a, null); - append(a, t1); - append(a, code); - append(code, t2); - append(div1, t3); - append(div1, div0); - if (if_block2) if_block2.m(div0, null); - append(div0, t4); - mount_component(headertable, div0, null); - append(div0, t5); - mount_component(codepanel, div0, null); - current = true; - }, - p(ctx, [dirty]) { - if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) { - if_block0.p(ctx, dirty); - } else { - if_block0.d(1); - if_block0 = current_block_type(ctx); - - if (if_block0) { - if_block0.c(); - if_block0.m(p, null); - } - } - - if (/*title*/ ctx[0] !== "") { - if (if_block1) { - if_block1.p(ctx, dirty); - } else { - if_block1 = create_if_block_1$3(ctx); - if_block1.c(); - if_block1.m(a, t1); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - - if (!current || dirty & /*statusCode*/ 8) set_data(t2, /*statusCode*/ ctx[3]); - - if (!current || dirty & /*statusCode*/ 8 && code_class_value !== (code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]))) { - attr(code, "class", code_class_value); - } - - if (/*description*/ ctx[1]) { - if (if_block2) { - if_block2.p(ctx, dirty); - } else { - if_block2 = create_if_block$6(ctx); - if_block2.c(); - if_block2.m(div0, t4); - } - } else if (if_block2) { - if_block2.d(1); - if_block2 = null; - } - - const headertable_changes = {}; - if (dirty & /*headers*/ 4) headertable_changes.headers = /*headers*/ ctx[2]; - headertable.$set(headertable_changes); - const codepanel_changes = {}; - if (dirty & /*contentType*/ 16) codepanel_changes.contentType = /*contentType*/ ctx[4]; - if (dirty & /*example*/ 32) codepanel_changes.example = /*example*/ ctx[5]; - if (dirty & /*schema*/ 64) codepanel_changes.schema = /*schema*/ ctx[6]; - codepanel.$set(codepanel_changes); - }, - i(local) { - if (current) return; - transition_in(headertable.$$.fragment, local); - transition_in(codepanel.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(headertable.$$.fragment, local); - transition_out(codepanel.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach(div1); - if_block0.d(); - if (if_block1) if_block1.d(); - if (if_block2) if_block2.d(); - destroy_component(headertable); - destroy_component(codepanel); - } - }; - } - - function instance$6($$self, $$props, $$invalidate) { + function instance$3($$self, $$props, $$invalidate) { let { title } = $$props; let { description } = $$props; - let { headers } = $$props; - let { statusCode } = $$props; - let { contentType } = $$props; - let { example } = $$props; - let { schema } = $$props; $$self.$set = $$props => { if ("title" in $$props) $$invalidate(0, title = $$props.title); if ("description" in $$props) $$invalidate(1, description = $$props.description); - if ("headers" in $$props) $$invalidate(2, headers = $$props.headers); - if ("statusCode" in $$props) $$invalidate(3, statusCode = $$props.statusCode); - if ("contentType" in $$props) $$invalidate(4, contentType = $$props.contentType); - if ("example" in $$props) $$invalidate(5, example = $$props.example); - if ("schema" in $$props) $$invalidate(6, schema = $$props.schema); }; - return [title, description, headers, statusCode, contentType, example, schema]; + return [title, description]; } - class ResponsePanel extends SvelteComponent { + class Home extends SvelteComponent { constructor(options) { super(); - - init(this, options, instance$6, create_fragment$6, safe_not_equal, { - title: 0, - description: 1, - headers: 2, - statusCode: 3, - contentType: 4, - example: 5, - schema: 6 - }); + init(this, options, instance$3, create_fragment$3, safe_not_equal, { title: 0, description: 1 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/tables/ParameterTable.svelte generated by Svelte v3.16.5 */ + var uint32 = createCommonjsModule(function (module) { + /** + C-like unsigned 32 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ + ;(function (root) { - function get_each_context$3(ctx, list, i) { + // Local cache for typical radices + var radixPowerCache = { + 36: UINT32( Math.pow(36, 5) ) + , 16: UINT32( Math.pow(16, 7) ) + , 10: UINT32( Math.pow(10, 9) ) + , 2: UINT32( Math.pow(2, 30) ) + }; + var radixCache = { + 36: UINT32(36) + , 16: UINT32(16) + , 10: UINT32(10) + , 2: UINT32(2) + }; + + /** + * Represents an unsigned 32 bits integer + * @constructor + * @param {Number|String|Number} low bits | integer as a string | integer as a number + * @param {Number|Number|Undefined} high bits | radix (optional, default=10) + * @return + */ + function UINT32 (l, h) { + if ( !(this instanceof UINT32) ) + return new UINT32(l, h) + + this._low = 0; + this._high = 0; + this.remainder = null; + if (typeof h == 'undefined') + return fromNumber.call(this, l) + + if (typeof l == 'string') + return fromString.call(this, l, h) + + fromBits.call(this, l, h); + } + + /** + * Set the current _UINT32_ object with its low and high bits + * @method fromBits + * @param {Number} low bits + * @param {Number} high bits + * @return ThisExpression + */ + function fromBits (l, h) { + this._low = l | 0; + this._high = h | 0; + + return this + } + UINT32.prototype.fromBits = fromBits; + + /** + * Set the current _UINT32_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._low = value & 0xFFFF; + this._high = value >>> 16; + + return this + } + UINT32.prototype.fromNumber = fromNumber; + + /** + * Set the current _UINT32_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + var value = parseInt(s, radix || 10); + + this._low = value & 0xFFFF; + this._high = value >>> 16; + + return this + } + UINT32.prototype.fromString = fromString; + + /** + * Convert this _UINT32_ to a number + * @method toNumber + * @return {Number} the converted UINT32 + */ + UINT32.prototype.toNumber = function () { + return (this._high * 65536) + this._low + }; + + /** + * Convert this _UINT32_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT32 + */ + UINT32.prototype.toString = function (radix) { + return this.toNumber().toString(radix || 10) + }; + + /** + * Add two _UINT32_. The current _UINT32_ stores the result + * @method add + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.add = function (other) { + var a00 = this._low + other._low; + var a16 = a00 >>> 16; + + a16 += this._high + other._high; + + this._low = a00 & 0xFFFF; + this._high = a16 & 0xFFFF; + + return this + }; + + /** + * Subtract two _UINT32_. The current _UINT32_ stores the result + * @method subtract + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.subtract = function (other) { + //TODO inline + return this.add( other.clone().negate() ) + }; + + /** + * Multiply two _UINT32_. The current _UINT32_ stores the result + * @method multiply + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.multiply = function (other) { + /* + a = a00 + a16 + b = b00 + b16 + a*b = (a00 + a16)(b00 + b16) + = a00b00 + a00b16 + a16b00 + a16b16 + + a16b16 overflows the 32bits + */ + var a16 = this._high; + var a00 = this._low; + var b16 = other._high; + var b00 = other._low; + + /* Removed to increase speed under normal circumstances (i.e. not multiplying by 0 or 1) + // this == 0 or other == 1: nothing to do + if ((a00 == 0 && a16 == 0) || (b00 == 1 && b16 == 0)) return this + + // other == 0 or this == 1: this = other + if ((b00 == 0 && b16 == 0) || (a00 == 1 && a16 == 0)) { + this._low = other._low + this._high = other._high + return this + } + */ + + var c16, c00; + c00 = a00 * b00; + c16 = c00 >>> 16; + + c16 += a16 * b00; + c16 &= 0xFFFF; // Not required but improves performance + c16 += a00 * b16; + + this._low = c00 & 0xFFFF; + this._high = c16 & 0xFFFF; + + return this + }; + + /** + * Divide two _UINT32_. The current _UINT32_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT32_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.div = function (other) { + if ( (other._low == 0) && (other._high == 0) ) throw Error('division by zero') + + // other == 1 + if (other._high == 0 && other._low == 1) { + this.remainder = new UINT32(0); + return this + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone(); + this._low = 0; + this._high = 0; + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT32(0); + this._low = 1; + this._high = 0; + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone(); + var i = -1; + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true); + i++; + } + + // Set the remainder + this.remainder = this.clone(); + // Initialize the current result to 0 + this._low = 0; + this._high = 0; + for (; i >= 0; i--) { + _other.shiftRight(1); + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other); + // Update the current result + if (i >= 16) { + this._high |= 1 << (i - 16); + } else { + this._low |= 1 << i; + } + } + } + + return this + }; + + /** + * Negate the current _UINT32_ + * @method negate + * @return ThisExpression + */ + UINT32.prototype.negate = function () { + var v = ( ~this._low & 0xFFFF ) + 1; + this._low = v & 0xFFFF; + this._high = (~this._high + (v >>> 16)) & 0xFFFF; + + return this + }; + + /** + * Equals + * @method eq + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.equals = UINT32.prototype.eq = function (other) { + return (this._low == other._low) && (this._high == other._high) + }; + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.greaterThan = UINT32.prototype.gt = function (other) { + if (this._high > other._high) return true + if (this._high < other._high) return false + return this._low > other._low + }; + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.lessThan = UINT32.prototype.lt = function (other) { + if (this._high < other._high) return true + if (this._high > other._high) return false + return this._low < other._low + }; + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.or = function (other) { + this._low |= other._low; + this._high |= other._high; + + return this + }; + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.and = function (other) { + this._low &= other._low; + this._high &= other._high; + + return this + }; + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT32.prototype.not = function() { + this._low = ~this._low & 0xFFFF; + this._high = ~this._high & 0xFFFF; + + return this + }; + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.xor = function (other) { + this._low ^= other._low; + this._high ^= other._high; + + return this + }; + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT32.prototype.shiftRight = UINT32.prototype.shiftr = function (n) { + if (n > 16) { + this._low = this._high >> (n - 16); + this._high = 0; + } else if (n == 16) { + this._low = this._high; + this._high = 0; + } else { + this._low = (this._low >> n) | ( (this._high << (16-n)) & 0xFFFF ); + this._high >>= n; + } + + return this + }; + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT32.prototype.shiftLeft = UINT32.prototype.shiftl = function (n, allowOverflow) { + if (n > 16) { + this._high = this._low << (n - 16); + this._low = 0; + if (!allowOverflow) { + this._high &= 0xFFFF; + } + } else if (n == 16) { + this._high = this._low; + this._low = 0; + } else { + this._high = (this._high << n) | (this._low >> (16-n)); + this._low = (this._low << n) & 0xFFFF; + if (!allowOverflow) { + // Overflow only allowed on the high bits... + this._high &= 0xFFFF; + } + } + + return this + }; + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateLeft = UINT32.prototype.rotl = function (n) { + var v = (this._high << 16) | this._low; + v = (v << n) | (v >>> (32 - n)); + this._low = v & 0xFFFF; + this._high = v >>> 16; + + return this + }; + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateRight = UINT32.prototype.rotr = function (n) { + var v = (this._high << 16) | this._low; + v = (v >>> n) | (v << (32 - n)); + this._low = v & 0xFFFF; + this._high = v >>> 16; + + return this + }; + + /** + * Clone the current _UINT32_ + * @method clone + * @return {Object} cloned UINT32 + */ + UINT32.prototype.clone = function () { + return new UINT32(this._low, this._high) + }; + + if (typeof undefined != 'undefined' && undefined.amd) { + // AMD / RequireJS + undefined([], function () { + return UINT32 + }); + } else if ('object' != 'undefined' && module.exports) { + // Node.js + module.exports = UINT32; + } else { + // Browser + root['UINT32'] = UINT32; + } + + })(commonjsGlobal); + }); + + var uint64 = createCommonjsModule(function (module) { + /** + C-like unsigned 64 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ + ;(function (root) { + + // Local cache for typical radices + var radixPowerCache = { + 16: UINT64( Math.pow(16, 5) ) + , 10: UINT64( Math.pow(10, 5) ) + , 2: UINT64( Math.pow(2, 5) ) + }; + var radixCache = { + 16: UINT64(16) + , 10: UINT64(10) + , 2: UINT64(2) + }; + + /** + * Represents an unsigned 64 bits integer + * @constructor + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * or + * @param {String|Number} integer as a string | integer as a number + * @param {Number|Undefined} radix (optional, default=10) + * @return + */ + function UINT64 (a00, a16, a32, a48) { + if ( !(this instanceof UINT64) ) + return new UINT64(a00, a16, a32, a48) + + this.remainder = null; + if (typeof a00 == 'string') + return fromString.call(this, a00, a16) + + if (typeof a16 == 'undefined') + return fromNumber.call(this, a00) + + fromBits.apply(this, arguments); + } + + /** + * Set the current _UINT64_ object with its low and high bits + * @method fromBits + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * @return ThisExpression + */ + function fromBits (a00, a16, a32, a48) { + if (typeof a32 == 'undefined') { + this._a00 = a00 & 0xFFFF; + this._a16 = a00 >>> 16; + this._a32 = a16 & 0xFFFF; + this._a48 = a16 >>> 16; + return this + } + + this._a00 = a00 | 0; + this._a16 = a16 | 0; + this._a32 = a32 | 0; + this._a48 = a48 | 0; + + return this + } + UINT64.prototype.fromBits = fromBits; + + /** + * Set the current _UINT64_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._a00 = value & 0xFFFF; + this._a16 = value >>> 16; + this._a32 = 0; + this._a48 = 0; + + return this + } + UINT64.prototype.fromNumber = fromNumber; + + /** + * Set the current _UINT64_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + radix = radix || 10; + + this._a00 = 0; + this._a16 = 0; + this._a32 = 0; + this._a48 = 0; + + /* + In Javascript, bitwise operators only operate on the first 32 bits + of a number, even though parseInt() encodes numbers with a 53 bits + mantissa. + Therefore UINT64() can only work on 32 bits. + The radix maximum value is 36 (as per ECMA specs) (26 letters + 10 digits) + maximum input value is m = 32bits as 1 = 2^32 - 1 + So the maximum substring length n is: + 36^(n+1) - 1 = 2^32 - 1 + 36^(n+1) = 2^32 + (n+1)ln(36) = 32ln(2) + n = 32ln(2)/ln(36) - 1 + n = 5.189644915687692 + n = 5 + */ + var radixUint = radixPowerCache[radix] || new UINT64( Math.pow(radix, 5) ); + + for (var i = 0, len = s.length; i < len; i += 5) { + var size = Math.min(5, len - i); + var value = parseInt( s.slice(i, i + size), radix ); + this.multiply( + size < 5 + ? new UINT64( Math.pow(radix, size) ) + : radixUint + ) + .add( new UINT64(value) ); + } + + return this + } + UINT64.prototype.fromString = fromString; + + /** + * Convert this _UINT64_ to a number (last 32 bits are dropped) + * @method toNumber + * @return {Number} the converted UINT64 + */ + UINT64.prototype.toNumber = function () { + return (this._a16 * 65536) + this._a00 + }; + + /** + * Convert this _UINT64_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT64 + */ + UINT64.prototype.toString = function (radix) { + radix = radix || 10; + var radixUint = radixCache[radix] || new UINT64(radix); + + if ( !this.gt(radixUint) ) return this.toNumber().toString(radix) + + var self = this.clone(); + var res = new Array(64); + for (var i = 63; i >= 0; i--) { + self.div(radixUint); + res[i] = self.remainder.toNumber().toString(radix); + if ( !self.gt(radixUint) ) break + } + res[i-1] = self.toNumber().toString(radix); + + return res.join('') + }; + + /** + * Add two _UINT64_. The current _UINT64_ stores the result + * @method add + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.add = function (other) { + var a00 = this._a00 + other._a00; + + var a16 = a00 >>> 16; + a16 += this._a16 + other._a16; + + var a32 = a16 >>> 16; + a32 += this._a32 + other._a32; + + var a48 = a32 >>> 16; + a48 += this._a48 + other._a48; + + this._a00 = a00 & 0xFFFF; + this._a16 = a16 & 0xFFFF; + this._a32 = a32 & 0xFFFF; + this._a48 = a48 & 0xFFFF; + + return this + }; + + /** + * Subtract two _UINT64_. The current _UINT64_ stores the result + * @method subtract + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.subtract = function (other) { + return this.add( other.clone().negate() ) + }; + + /** + * Multiply two _UINT64_. The current _UINT64_ stores the result + * @method multiply + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.multiply = function (other) { + /* + a = a00 + a16 + a32 + a48 + b = b00 + b16 + b32 + b48 + a*b = (a00 + a16 + a32 + a48)(b00 + b16 + b32 + b48) + = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + a16b48 + + a32b00 + a32b16 + a32b32 + a32b48 + + a48b00 + a48b16 + a48b32 + a48b48 + + a16b48, a32b32, a48b16, a48b32 and a48b48 overflow the 64 bits + so it comes down to: + a*b = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + + a32b00 + a32b16 + + a48b00 + = a00b00 + + a00b16 + a16b00 + + a00b32 + a16b16 + a32b00 + + a00b48 + a16b32 + a32b16 + a48b00 + */ + var a00 = this._a00; + var a16 = this._a16; + var a32 = this._a32; + var a48 = this._a48; + var b00 = other._a00; + var b16 = other._a16; + var b32 = other._a32; + var b48 = other._a48; + + var c00 = a00 * b00; + + var c16 = c00 >>> 16; + c16 += a00 * b16; + var c32 = c16 >>> 16; + c16 &= 0xFFFF; + c16 += a16 * b00; + + c32 += c16 >>> 16; + c32 += a00 * b32; + var c48 = c32 >>> 16; + c32 &= 0xFFFF; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xFFFF; + c32 += a32 * b00; + + c48 += c32 >>> 16; + c48 += a00 * b48; + c48 &= 0xFFFF; + c48 += a16 * b32; + c48 &= 0xFFFF; + c48 += a32 * b16; + c48 &= 0xFFFF; + c48 += a48 * b00; + + this._a00 = c00 & 0xFFFF; + this._a16 = c16 & 0xFFFF; + this._a32 = c32 & 0xFFFF; + this._a48 = c48 & 0xFFFF; + + return this + }; + + /** + * Divide two _UINT64_. The current _UINT64_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT64_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.div = function (other) { + if ( (other._a16 == 0) && (other._a32 == 0) && (other._a48 == 0) ) { + if (other._a00 == 0) throw Error('division by zero') + + // other == 1: this + if (other._a00 == 1) { + this.remainder = new UINT64(0); + return this + } + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone(); + this._a00 = 0; + this._a16 = 0; + this._a32 = 0; + this._a48 = 0; + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT64(0); + this._a00 = 1; + this._a16 = 0; + this._a32 = 0; + this._a48 = 0; + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone(); + var i = -1; + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true); + i++; + } + + // Set the remainder + this.remainder = this.clone(); + // Initialize the current result to 0 + this._a00 = 0; + this._a16 = 0; + this._a32 = 0; + this._a48 = 0; + for (; i >= 0; i--) { + _other.shiftRight(1); + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other); + // Update the current result + if (i >= 48) { + this._a48 |= 1 << (i - 48); + } else if (i >= 32) { + this._a32 |= 1 << (i - 32); + } else if (i >= 16) { + this._a16 |= 1 << (i - 16); + } else { + this._a00 |= 1 << i; + } + } + } + + return this + }; + + /** + * Negate the current _UINT64_ + * @method negate + * @return ThisExpression + */ + UINT64.prototype.negate = function () { + var v = ( ~this._a00 & 0xFFFF ) + 1; + this._a00 = v & 0xFFFF; + v = (~this._a16 & 0xFFFF) + (v >>> 16); + this._a16 = v & 0xFFFF; + v = (~this._a32 & 0xFFFF) + (v >>> 16); + this._a32 = v & 0xFFFF; + this._a48 = (~this._a48 + (v >>> 16)) & 0xFFFF; + + return this + }; + + /** + + * @method eq + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.equals = UINT64.prototype.eq = function (other) { + return (this._a48 == other._a48) && (this._a00 == other._a00) + && (this._a32 == other._a32) && (this._a16 == other._a16) + }; + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.greaterThan = UINT64.prototype.gt = function (other) { + if (this._a48 > other._a48) return true + if (this._a48 < other._a48) return false + if (this._a32 > other._a32) return true + if (this._a32 < other._a32) return false + if (this._a16 > other._a16) return true + if (this._a16 < other._a16) return false + return this._a00 > other._a00 + }; + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.lessThan = UINT64.prototype.lt = function (other) { + if (this._a48 < other._a48) return true + if (this._a48 > other._a48) return false + if (this._a32 < other._a32) return true + if (this._a32 > other._a32) return false + if (this._a16 < other._a16) return true + if (this._a16 > other._a16) return false + return this._a00 < other._a00 + }; + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.or = function (other) { + this._a00 |= other._a00; + this._a16 |= other._a16; + this._a32 |= other._a32; + this._a48 |= other._a48; + + return this + }; + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.and = function (other) { + this._a00 &= other._a00; + this._a16 &= other._a16; + this._a32 &= other._a32; + this._a48 &= other._a48; + + return this + }; + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.xor = function (other) { + this._a00 ^= other._a00; + this._a16 ^= other._a16; + this._a32 ^= other._a32; + this._a48 ^= other._a48; + + return this + }; + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT64.prototype.not = function() { + this._a00 = ~this._a00 & 0xFFFF; + this._a16 = ~this._a16 & 0xFFFF; + this._a32 = ~this._a32 & 0xFFFF; + this._a48 = ~this._a48 & 0xFFFF; + + return this + }; + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT64.prototype.shiftRight = UINT64.prototype.shiftr = function (n) { + n %= 64; + if (n >= 48) { + this._a00 = this._a48 >> (n - 48); + this._a16 = 0; + this._a32 = 0; + this._a48 = 0; + } else if (n >= 32) { + n -= 32; + this._a00 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF; + this._a16 = (this._a48 >> n) & 0xFFFF; + this._a32 = 0; + this._a48 = 0; + } else if (n >= 16) { + n -= 16; + this._a00 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF; + this._a16 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF; + this._a32 = (this._a48 >> n) & 0xFFFF; + this._a48 = 0; + } else { + this._a00 = ( (this._a00 >> n) | (this._a16 << (16-n)) ) & 0xFFFF; + this._a16 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF; + this._a32 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF; + this._a48 = (this._a48 >> n) & 0xFFFF; + } + + return this + }; + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT64.prototype.shiftLeft = UINT64.prototype.shiftl = function (n, allowOverflow) { + n %= 64; + if (n >= 48) { + this._a48 = this._a00 << (n - 48); + this._a32 = 0; + this._a16 = 0; + this._a00 = 0; + } else if (n >= 32) { + n -= 32; + this._a48 = (this._a16 << n) | (this._a00 >> (16-n)); + this._a32 = (this._a00 << n) & 0xFFFF; + this._a16 = 0; + this._a00 = 0; + } else if (n >= 16) { + n -= 16; + this._a48 = (this._a32 << n) | (this._a16 >> (16-n)); + this._a32 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF; + this._a16 = (this._a00 << n) & 0xFFFF; + this._a00 = 0; + } else { + this._a48 = (this._a48 << n) | (this._a32 >> (16-n)); + this._a32 = ( (this._a32 << n) | (this._a16 >> (16-n)) ) & 0xFFFF; + this._a16 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF; + this._a00 = (this._a00 << n) & 0xFFFF; + } + if (!allowOverflow) { + this._a48 &= 0xFFFF; + } + + return this + }; + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateLeft = UINT64.prototype.rotl = function (n) { + n %= 64; + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // B.C.D.A rotl(16) + // C.D.A.B rotl(32) + var v = this._a00; + this._a00 = this._a32; + this._a32 = v; + v = this._a48; + this._a48 = this._a16; + this._a16 = v; + if (n == 32) return this + n -= 32; + } + + var high = (this._a48 << 16) | this._a32; + var low = (this._a16 << 16) | this._a00; + + var _high = (high << n) | (low >>> (32 - n)); + var _low = (low << n) | (high >>> (32 - n)); + + this._a00 = _low & 0xFFFF; + this._a16 = _low >>> 16; + this._a32 = _high & 0xFFFF; + this._a48 = _high >>> 16; + + return this + }; + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateRight = UINT64.prototype.rotr = function (n) { + n %= 64; + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // D.A.B.C rotr(16) + // C.D.A.B rotr(32) + var v = this._a00; + this._a00 = this._a32; + this._a32 = v; + v = this._a48; + this._a48 = this._a16; + this._a16 = v; + if (n == 32) return this + n -= 32; + } + + var high = (this._a48 << 16) | this._a32; + var low = (this._a16 << 16) | this._a00; + + var _high = (high >>> n) | (low << (32 - n)); + var _low = (low >>> n) | (high << (32 - n)); + + this._a00 = _low & 0xFFFF; + this._a16 = _low >>> 16; + this._a32 = _high & 0xFFFF; + this._a48 = _high >>> 16; + + return this + }; + + /** + * Clone the current _UINT64_ + * @method clone + * @return {Object} cloned UINT64 + */ + UINT64.prototype.clone = function () { + return new UINT64(this._a00, this._a16, this._a32, this._a48) + }; + + if (typeof undefined != 'undefined' && undefined.amd) { + // AMD / RequireJS + undefined([], function () { + return UINT64 + }); + } else if ('object' != 'undefined' && module.exports) { + // Node.js + module.exports = UINT64; + } else { + // Browser + root['UINT64'] = UINT64; + } + + })(commonjsGlobal); + }); + + var UINT32 = uint32; + var UINT64 = uint64; + + var cuint = { + UINT32: UINT32, + UINT64: UINT64 + }; + + /** + xxHash implementation in pure Javascript + + Copyright (C) 2013, Pierre Curto + MIT license + */ + var UINT32$1 = cuint.UINT32; + + /* + Merged this sequence of method calls as it speeds up + the calculations by a factor of 2 + */ + // this.v1.add( other.multiply(PRIME32_2) ).rotl(13).multiply(PRIME32_1); + UINT32$1.prototype.xxh_update = function (low, high) { + var b00 = PRIME32_2._low; + var b16 = PRIME32_2._high; + + var c16, c00; + c00 = low * b00; + c16 = c00 >>> 16; + + c16 += high * b00; + c16 &= 0xFFFF; // Not required but improves performance + c16 += low * b16; + + var a00 = this._low + (c00 & 0xFFFF); + var a16 = a00 >>> 16; + + a16 += this._high + (c16 & 0xFFFF); + + var v = (a16 << 16) | (a00 & 0xFFFF); + v = (v << 13) | (v >>> 19); + + a00 = v & 0xFFFF; + a16 = v >>> 16; + + b00 = PRIME32_1._low; + b16 = PRIME32_1._high; + + c00 = a00 * b00; + c16 = c00 >>> 16; + + c16 += a16 * b00; + c16 &= 0xFFFF; // Not required but improves performance + c16 += a00 * b16; + + this._low = c00 & 0xFFFF; + this._high = c16 & 0xFFFF; + }; + + /* + * Constants + */ + var PRIME32_1 = UINT32$1( '2654435761' ); + var PRIME32_2 = UINT32$1( '2246822519' ); + var PRIME32_3 = UINT32$1( '3266489917' ); + var PRIME32_4 = UINT32$1( '668265263' ); + var PRIME32_5 = UINT32$1( '374761393' ); + + /** + * Convert string to proper UTF-8 array + * @param str Input string + * @returns {Uint8Array} UTF8 array is returned as uint8 array + */ + function toUTF8Array (str) { + var utf8 = []; + for (var i=0, n=str.length; i < n; i++) { + var charcode = str.charCodeAt(i); + if (charcode < 0x80) utf8.push(charcode); + else if (charcode < 0x800) { + utf8.push(0xc0 | (charcode >> 6), + 0x80 | (charcode & 0x3f)); + } + else if (charcode < 0xd800 || charcode >= 0xe000) { + utf8.push(0xe0 | (charcode >> 12), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + // surrogate pair + else { + i++; + // UTF-16 encodes 0x10000-0x10FFFF by + // subtracting 0x10000 and splitting the + // 20 bits of 0x0-0xFFFFF into two halves + charcode = 0x10000 + (((charcode & 0x3ff)<<10) + | (str.charCodeAt(i) & 0x3ff)); + utf8.push(0xf0 | (charcode >>18), + 0x80 | ((charcode>>12) & 0x3f), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + } + + return new Uint8Array(utf8) + } + + /** + * XXH object used as a constructor or a function + * @constructor + * or + * @param {Object|String} input data + * @param {Number|UINT32} seed + * @return ThisExpression + * or + * @return {UINT32} xxHash + */ + function XXH () { + if (arguments.length == 2) + return new XXH( arguments[1] ).update( arguments[0] ).digest() + + if (!(this instanceof XXH)) + return new XXH( arguments[0] ) + + init$1.call(this, arguments[0]); + } + + /** + * Initialize the XXH instance with the given seed + * @method init + * @param {Number|Object} seed as a number or an unsigned 32 bits integer + * @return ThisExpression + */ + function init$1 (seed) { + this.seed = seed instanceof UINT32$1 ? seed.clone() : UINT32$1(seed); + this.v1 = this.seed.clone().add(PRIME32_1).add(PRIME32_2); + this.v2 = this.seed.clone().add(PRIME32_2); + this.v3 = this.seed.clone(); + this.v4 = this.seed.clone().subtract(PRIME32_1); + this.total_len = 0; + this.memsize = 0; + this.memory = null; + + return this + } + XXH.prototype.init = init$1; + + /** + * Add data to be computed for the XXH hash + * @method update + * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer + * @return ThisExpression + */ + XXH.prototype.update = function (input) { + var isString = typeof input == 'string'; + var isArrayBuffer; + + // Convert all strings to utf-8 first (issue #5) + if (isString) { + input = toUTF8Array(input); + isString = false; + isArrayBuffer = true; + } + + if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) + { + isArrayBuffer = true; + input = new Uint8Array(input); + } + + var p = 0; + var len = input.length; + var bEnd = p + len; + + if (len == 0) return this + + this.total_len += len; + + if (this.memsize == 0) + { + if (isString) { + this.memory = ''; + } else if (isArrayBuffer) { + this.memory = new Uint8Array(16); + } else { + this.memory = new Buffer(16); + } + } + + if (this.memsize + len < 16) // fill in tmp buffer + { + // XXH_memcpy(this.memory + this.memsize, input, len) + if (isString) { + this.memory += input; + } else if (isArrayBuffer) { + this.memory.set( input.subarray(0, len), this.memsize ); + } else { + input.copy( this.memory, this.memsize, 0, len ); + } + + this.memsize += len; + return this + } + + if (this.memsize > 0) // some data left from previous update + { + // XXH_memcpy(this.memory + this.memsize, input, 16-this.memsize); + if (isString) { + this.memory += input.slice(0, 16 - this.memsize); + } else if (isArrayBuffer) { + this.memory.set( input.subarray(0, 16 - this.memsize), this.memsize ); + } else { + input.copy( this.memory, this.memsize, 0, 16 - this.memsize ); + } + + var p32 = 0; + if (isString) { + this.v1.xxh_update( + (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) + , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) + ); + p32 += 4; + this.v2.xxh_update( + (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) + , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) + ); + p32 += 4; + this.v3.xxh_update( + (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) + , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) + ); + p32 += 4; + this.v4.xxh_update( + (this.memory.charCodeAt(p32+1) << 8) | this.memory.charCodeAt(p32) + , (this.memory.charCodeAt(p32+3) << 8) | this.memory.charCodeAt(p32+2) + ); + } else { + this.v1.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ); + p32 += 4; + this.v2.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ); + p32 += 4; + this.v3.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ); + p32 += 4; + this.v4.xxh_update( + (this.memory[p32+1] << 8) | this.memory[p32] + , (this.memory[p32+3] << 8) | this.memory[p32+2] + ); + } + + p += 16 - this.memsize; + this.memsize = 0; + if (isString) this.memory = ''; + } + + if (p <= bEnd - 16) + { + var limit = bEnd - 16; + + do + { + if (isString) { + this.v1.xxh_update( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + ); + p += 4; + this.v2.xxh_update( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + ); + p += 4; + this.v3.xxh_update( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + ); + p += 4; + this.v4.xxh_update( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + ); + } else { + this.v1.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ); + p += 4; + this.v2.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ); + p += 4; + this.v3.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ); + p += 4; + this.v4.xxh_update( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ); + } + p += 4; + } while (p <= limit) + } + + if (p < bEnd) + { + // XXH_memcpy(this.memory, p, bEnd-p); + if (isString) { + this.memory += input.slice(p); + } else if (isArrayBuffer) { + this.memory.set( input.subarray(p, bEnd), this.memsize ); + } else { + input.copy( this.memory, this.memsize, p, bEnd ); + } + + this.memsize = bEnd - p; + } + + return this + }; + + /** + * Finalize the XXH computation. The XXH instance is ready for reuse for the given seed + * @method digest + * @return {UINT32} xxHash + */ + XXH.prototype.digest = function () { + var input = this.memory; + var isString = typeof input == 'string'; + var p = 0; + var bEnd = this.memsize; + var h32, h; + var u = new UINT32$1; + + if (this.total_len >= 16) + { + h32 = this.v1.rotl(1).add( this.v2.rotl(7).add( this.v3.rotl(12).add( this.v4.rotl(18) ) ) ); + } + else + { + h32 = this.seed.clone().add( PRIME32_5 ); + } + + h32.add( u.fromNumber(this.total_len) ); + + while (p <= bEnd - 4) + { + if (isString) { + u.fromBits( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + ); + } else { + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + ); + } + h32 + .add( u.multiply(PRIME32_3) ) + .rotl(17) + .multiply( PRIME32_4 ); + p += 4; + } + + while (p < bEnd) + { + u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0 ); + h32 + .add( u.multiply(PRIME32_5) ) + .rotl(11) + .multiply(PRIME32_1); + } + + h = h32.clone().shiftRight(15); + h32.xor(h).multiply(PRIME32_2); + + h = h32.clone().shiftRight(13); + h32.xor(h).multiply(PRIME32_3); + + h = h32.clone().shiftRight(16); + h32.xor(h); + + // Reset the state + this.init( this.seed ); + + return h32 + }; + + var xxhash = XXH; + + /** + xxHash64 implementation in pure Javascript + + Copyright (C) 2016, Pierre Curto + MIT license + */ + var UINT64$1 = cuint.UINT64; + + /* + * Constants + */ + var PRIME64_1 = UINT64$1( '11400714785074694791' ); + var PRIME64_2 = UINT64$1( '14029467366897019727' ); + var PRIME64_3 = UINT64$1( '1609587929392839161' ); + var PRIME64_4 = UINT64$1( '9650029242287828579' ); + var PRIME64_5 = UINT64$1( '2870177450012600261' ); + + /** + * Convert string to proper UTF-8 array + * @param str Input string + * @returns {Uint8Array} UTF8 array is returned as uint8 array + */ + function toUTF8Array$1 (str) { + var utf8 = []; + for (var i=0, n=str.length; i < n; i++) { + var charcode = str.charCodeAt(i); + if (charcode < 0x80) utf8.push(charcode); + else if (charcode < 0x800) { + utf8.push(0xc0 | (charcode >> 6), + 0x80 | (charcode & 0x3f)); + } + else if (charcode < 0xd800 || charcode >= 0xe000) { + utf8.push(0xe0 | (charcode >> 12), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + // surrogate pair + else { + i++; + // UTF-16 encodes 0x10000-0x10FFFF by + // subtracting 0x10000 and splitting the + // 20 bits of 0x0-0xFFFFF into two halves + charcode = 0x10000 + (((charcode & 0x3ff)<<10) + | (str.charCodeAt(i) & 0x3ff)); + utf8.push(0xf0 | (charcode >>18), + 0x80 | ((charcode>>12) & 0x3f), + 0x80 | ((charcode>>6) & 0x3f), + 0x80 | (charcode & 0x3f)); + } + } + + return new Uint8Array(utf8) + } + + /** + * XXH64 object used as a constructor or a function + * @constructor + * or + * @param {Object|String} input data + * @param {Number|UINT64} seed + * @return ThisExpression + * or + * @return {UINT64} xxHash + */ + function XXH64 () { + if (arguments.length == 2) + return new XXH64( arguments[1] ).update( arguments[0] ).digest() + + if (!(this instanceof XXH64)) + return new XXH64( arguments[0] ) + + init$2.call(this, arguments[0]); + } + + /** + * Initialize the XXH64 instance with the given seed + * @method init + * @param {Number|Object} seed as a number or an unsigned 32 bits integer + * @return ThisExpression + */ + function init$2 (seed) { + this.seed = seed instanceof UINT64$1 ? seed.clone() : UINT64$1(seed); + this.v1 = this.seed.clone().add(PRIME64_1).add(PRIME64_2); + this.v2 = this.seed.clone().add(PRIME64_2); + this.v3 = this.seed.clone(); + this.v4 = this.seed.clone().subtract(PRIME64_1); + this.total_len = 0; + this.memsize = 0; + this.memory = null; + + return this + } + XXH64.prototype.init = init$2; + + /** + * Add data to be computed for the XXH64 hash + * @method update + * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer + * @return ThisExpression + */ + XXH64.prototype.update = function (input) { + var isString = typeof input == 'string'; + var isArrayBuffer; + + // Convert all strings to utf-8 first (issue #5) + if (isString) { + input = toUTF8Array$1(input); + isString = false; + isArrayBuffer = true; + } + + if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) + { + isArrayBuffer = true; + input = new Uint8Array(input); + } + + var p = 0; + var len = input.length; + var bEnd = p + len; + + if (len == 0) return this + + this.total_len += len; + + if (this.memsize == 0) + { + if (isString) { + this.memory = ''; + } else if (isArrayBuffer) { + this.memory = new Uint8Array(32); + } else { + this.memory = new Buffer(32); + } + } + + if (this.memsize + len < 32) // fill in tmp buffer + { + // XXH64_memcpy(this.memory + this.memsize, input, len) + if (isString) { + this.memory += input; + } else if (isArrayBuffer) { + this.memory.set( input.subarray(0, len), this.memsize ); + } else { + input.copy( this.memory, this.memsize, 0, len ); + } + + this.memsize += len; + return this + } + + if (this.memsize > 0) // some data left from previous update + { + // XXH64_memcpy(this.memory + this.memsize, input, 16-this.memsize); + if (isString) { + this.memory += input.slice(0, 32 - this.memsize); + } else if (isArrayBuffer) { + this.memory.set( input.subarray(0, 32 - this.memsize), this.memsize ); + } else { + input.copy( this.memory, this.memsize, 0, 32 - this.memsize ); + } + + var p64 = 0; + if (isString) { + var other; + other = UINT64$1( + (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) + , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) + , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) + , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) + ); + this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) + , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) + , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) + , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) + ); + this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) + , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) + , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) + , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) + ); + this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory.charCodeAt(p64+1) << 8) | this.memory.charCodeAt(p64) + , (this.memory.charCodeAt(p64+3) << 8) | this.memory.charCodeAt(p64+2) + , (this.memory.charCodeAt(p64+5) << 8) | this.memory.charCodeAt(p64+4) + , (this.memory.charCodeAt(p64+7) << 8) | this.memory.charCodeAt(p64+6) + ); + this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + } else { + var other; + other = UINT64$1( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ); + this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ); + this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ); + this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p64 += 8; + other = UINT64$1( + (this.memory[p64+1] << 8) | this.memory[p64] + , (this.memory[p64+3] << 8) | this.memory[p64+2] + , (this.memory[p64+5] << 8) | this.memory[p64+4] + , (this.memory[p64+7] << 8) | this.memory[p64+6] + ); + this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + } + + p += 32 - this.memsize; + this.memsize = 0; + if (isString) this.memory = ''; + } + + if (p <= bEnd - 32) + { + var limit = bEnd - 32; + + do + { + if (isString) { + var other; + other = UINT64$1( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) + , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) + ); + this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) + , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) + ); + this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) + , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) + ); + this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) + , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) + ); + this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + } else { + var other; + other = UINT64$1( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] + ); + this.v1.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] + ); + this.v2.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] + ); + this.v3.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + p += 8; + other = UINT64$1( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] + ); + this.v4.add( other.multiply(PRIME64_2) ).rotl(31).multiply(PRIME64_1); + } + p += 8; + } while (p <= limit) + } + + if (p < bEnd) + { + // XXH64_memcpy(this.memory, p, bEnd-p); + if (isString) { + this.memory += input.slice(p); + } else if (isArrayBuffer) { + this.memory.set( input.subarray(p, bEnd), this.memsize ); + } else { + input.copy( this.memory, this.memsize, p, bEnd ); + } + + this.memsize = bEnd - p; + } + + return this + }; + + /** + * Finalize the XXH64 computation. The XXH64 instance is ready for reuse for the given seed + * @method digest + * @return {UINT64} xxHash + */ + XXH64.prototype.digest = function () { + var input = this.memory; + var isString = typeof input == 'string'; + var p = 0; + var bEnd = this.memsize; + var h64, h; + var u = new UINT64$1; + + if (this.total_len >= 32) + { + h64 = this.v1.clone().rotl(1); + h64.add( this.v2.clone().rotl(7) ); + h64.add( this.v3.clone().rotl(12) ); + h64.add( this.v4.clone().rotl(18) ); + + h64.xor( this.v1.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ); + h64.multiply(PRIME64_1).add(PRIME64_4); + + h64.xor( this.v2.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ); + h64.multiply(PRIME64_1).add(PRIME64_4); + + h64.xor( this.v3.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ); + h64.multiply(PRIME64_1).add(PRIME64_4); + + h64.xor( this.v4.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1) ); + h64.multiply(PRIME64_1).add(PRIME64_4); + } + else + { + h64 = this.seed.clone().add( PRIME64_5 ); + } + + h64.add( u.fromNumber(this.total_len) ); + + while (p <= bEnd - 8) + { + if (isString) { + u.fromBits( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , (input.charCodeAt(p+5) << 8) | input.charCodeAt(p+4) + , (input.charCodeAt(p+7) << 8) | input.charCodeAt(p+6) + ); + } else { + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , (input[p+5] << 8) | input[p+4] + , (input[p+7] << 8) | input[p+6] + ); + } + u.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1); + h64 + .xor(u) + .rotl(27) + .multiply( PRIME64_1 ) + .add( PRIME64_4 ); + p += 8; + } + + if (p + 4 <= bEnd) { + if (isString) { + u.fromBits( + (input.charCodeAt(p+1) << 8) | input.charCodeAt(p) + , (input.charCodeAt(p+3) << 8) | input.charCodeAt(p+2) + , 0 + , 0 + ); + } else { + u.fromBits( + (input[p+1] << 8) | input[p] + , (input[p+3] << 8) | input[p+2] + , 0 + , 0 + ); + } + h64 + .xor( u.multiply(PRIME64_1) ) + .rotl(23) + .multiply( PRIME64_2 ) + .add( PRIME64_3 ); + p += 4; + } + + while (p < bEnd) + { + u.fromBits( isString ? input.charCodeAt(p++) : input[p++], 0, 0, 0 ); + h64 + .xor( u.multiply(PRIME64_5) ) + .rotl(11) + .multiply(PRIME64_1); + } + + h = h64.clone().shiftRight(33); + h64.xor(h).multiply(PRIME64_2); + + h = h64.clone().shiftRight(29); + h64.xor(h).multiply(PRIME64_3); + + h = h64.clone().shiftRight(32); + h64.xor(h); + + // Reset the state + this.init( this.seed ); + + return h64 + }; + + var xxhash64 = XXH64; + + var lib$2 = { + h32: xxhash + , h64: xxhash64 + }; + var lib_1$2 = lib$2.h32; + var lib_2$2 = lib$2.h64; + + 'use strict'; + + var fastJsonStableStringify = function (data, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (node) { + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + if (node === undefined) return; + if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; + if (typeof node !== 'object') return JSON.stringify(node); + + var i, out; + if (Array.isArray(node)) { + out = '['; + for (i = 0; i < node.length; i++) { + if (i) out += ','; + out += stringify(node[i]) || 'null'; + } + return out + ']'; + } + + if (node === null) return 'null'; + + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + + var seenIndex = seen.push(node) - 1; + var keys = Object.keys(node).sort(cmp && cmp(node)); + out = ''; + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node[key]); + + if (!value) continue; + if (out) out += ','; + out += JSON.stringify(key) + ':' + value; + } + seen.splice(seenIndex, 1); + return '{' + out + '}'; + })(data); + }; + + /* usr/local/lib/node_modules/snowboard/templates/winter/tables/ParameterTable.svelte generated by Svelte v3.19.2 */ + + function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[2] = list[i].name; child_ctx[3] = list[i].example; @@ -12659,7 +16344,7 @@ } // (36:10) {:else} - function create_else_block$1(ctx) { + function create_else_block$2(ctx) { let div; return { @@ -12679,7 +16364,7 @@ } // (32:10) {#if description} - function create_if_block_2$2(ctx) { + function create_if_block_2$1(ctx) { let div; let raw_value = markdown(/*description*/ ctx[5]) + ""; @@ -12702,7 +16387,7 @@ } // (40:10) {#if example} - function create_if_block_1$4(ctx) { + function create_if_block_1$2(ctx) { let div; let span; let t1; @@ -12737,7 +16422,7 @@ } // (47:10) {#if schema.enum} - function create_if_block$7(ctx) { + function create_if_block$3(ctx) { let div; let span; let t1; @@ -12771,7 +16456,7 @@ } // (15:4) {#each parameters as { name, example, required, description, schema }} - function create_each_block$3(ctx) { + function create_each_block(ctx) { let tr; let td0; let code; @@ -12794,14 +16479,14 @@ let t8; function select_block_type(ctx, dirty) { - if (/*description*/ ctx[5]) return create_if_block_2$2; - return create_else_block$1; + if (/*description*/ ctx[5]) return create_if_block_2$1; + return create_else_block$2; } let current_block_type = select_block_type(ctx, -1); let if_block0 = current_block_type(ctx); - let if_block1 = /*example*/ ctx[3] && create_if_block_1$4(ctx); - let if_block2 = /*schema*/ ctx[6].enum && create_if_block$7(ctx); + let if_block1 = /*example*/ ctx[3] && create_if_block_1$2(ctx); + let if_block2 = /*schema*/ ctx[6].enum && create_if_block$3(ctx); return { c() { @@ -12882,7 +16567,7 @@ if (if_block1) { if_block1.p(ctx, dirty); } else { - if_block1 = create_if_block_1$4(ctx); + if_block1 = create_if_block_1$2(ctx); if_block1.c(); if_block1.m(td2, t7); } @@ -12895,7 +16580,7 @@ if (if_block2) { if_block2.p(ctx, dirty); } else { - if_block2 = create_if_block$7(ctx); + if_block2 = create_if_block$3(ctx); if_block2.c(); if_block2.m(td2, null); } @@ -12913,7 +16598,7 @@ }; } - function create_fragment$7(ctx) { + function create_fragment$4(ctx) { let table; let thead; let tr; @@ -12925,7 +16610,7 @@ let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); + each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } return { @@ -12966,12 +16651,12 @@ let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$3(ctx, each_value, i); + const child_ctx = get_each_context(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$3(child_ctx); + each_blocks[i] = create_each_block(child_ctx); each_blocks[i].c(); each_blocks[i].m(tbody, null); } @@ -12993,7 +16678,7 @@ }; } - function instance$7($$self, $$props, $$invalidate) { + function instance$4($$self, $$props, $$invalidate) { let { title } = $$props; let { parameters } = $$props; @@ -13008,13 +16693,13 @@ class ParameterTable extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$7, create_fragment$7, safe_not_equal, { title: 0, parameters: 1 }); + init(this, options, instance$4, create_fragment$4, safe_not_equal, { title: 0, parameters: 1 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ParameterPanel.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ParameterPanel.svelte generated by Svelte v3.19.2 */ - function create_if_block_1$5(ctx) { + function create_if_block_1$3(ctx) { let current; const parametertable = new ParameterTable({ @@ -13053,7 +16738,7 @@ } // (14:0) {#if queryParameters.length > 0} - function create_if_block$8(ctx) { + function create_if_block$4(ctx) { let current; const parametertable = new ParameterTable({ @@ -13091,12 +16776,12 @@ }; } - function create_fragment$8(ctx) { + function create_fragment$5(ctx) { let t; let if_block1_anchor; let current; - let if_block0 = /*pathParameters*/ ctx[0].length > 0 && create_if_block_1$5(ctx); - let if_block1 = /*queryParameters*/ ctx[1].length > 0 && create_if_block$8(ctx); + let if_block0 = /*pathParameters*/ ctx[0].length > 0 && create_if_block_1$3(ctx); + let if_block1 = /*queryParameters*/ ctx[1].length > 0 && create_if_block$4(ctx); return { c() { @@ -13118,7 +16803,7 @@ if_block0.p(ctx, dirty); transition_in(if_block0, 1); } else { - if_block0 = create_if_block_1$5(ctx); + if_block0 = create_if_block_1$3(ctx); if_block0.c(); transition_in(if_block0, 1); if_block0.m(t.parentNode, t); @@ -13138,7 +16823,7 @@ if_block1.p(ctx, dirty); transition_in(if_block1, 1); } else { - if_block1 = create_if_block$8(ctx); + if_block1 = create_if_block$4(ctx); if_block1.c(); transition_in(if_block1, 1); if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); @@ -13173,7 +16858,7 @@ }; } - function instance$8($$self, $$props, $$invalidate) { + function instance$5($$self, $$props, $$invalidate) { let { parameters = [] } = $$props; $$self.$set = $$props => { @@ -13199,691 +16884,20 @@ class ParameterPanel extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$8, create_fragment$8, safe_not_equal, { parameters: 2 }); + init(this, options, instance$5, create_fragment$5, safe_not_equal, { parameters: 2 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/components/LoginButton.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/components/ToggleIcon.svelte generated by Svelte v3.19.2 */ - function create_fragment$9(ctx) { - let a; - let span0; - let t0; - let span1; - - return { - c() { - a = element("a"); - span0 = element("span"); - span0.innerHTML = ``; - t0 = space(); - span1 = element("span"); - span1.textContent = "Login"; - attr(span0, "class", "icon"); - attr(a, "href", /*authorizeUrl*/ ctx[1]); - attr(a, "class", "button is-dark is-rounded"); - toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]); - }, - m(target, anchor) { - insert(target, a, anchor); - append(a, span0); - append(a, t0); - append(a, span1); - }, - p(ctx, [dirty]) { - if (dirty & /*authorizeUrl*/ 2) { - attr(a, "href", /*authorizeUrl*/ ctx[1]); - } - - if (dirty & /*fullWidth*/ 1) { - toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) detach(a); - } - }; - } - - function instance$9($$self, $$props, $$invalidate) { - let { authOptions } = $$props; - let { fullWidth } = $$props; - - $$self.$set = $$props => { - if ("authOptions" in $$props) $$invalidate(2, authOptions = $$props.authOptions); - if ("fullWidth" in $$props) $$invalidate(0, fullWidth = $$props.fullWidth); - }; - - let authorizeParams; - let authorizeUrl; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*authOptions*/ 4) { - $$invalidate(3, authorizeParams = querystringify_1.stringify( - { - client_id: authOptions.clientId, - redirect_uri: authOptions.callbackUrl, - response_type: "code", - scope: authOptions.scopes || "" - }, - true - )); - } - - if ($$self.$$.dirty & /*authOptions, authorizeParams*/ 12) { - $$invalidate(1, authorizeUrl = `${authOptions.authorizeUrl}${authorizeParams}`); - } - }; - - return [fullWidth, authorizeUrl, authOptions]; - } - - class LoginButton extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance$9, create_fragment$9, safe_not_equal, { authOptions: 2, fullWidth: 0 }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/components/LogoutButton.svelte generated by Svelte v3.16.5 */ - - function create_fragment$a(ctx) { - let a; - let dispose; - - return { - c() { - a = element("a"); - - a.innerHTML = ` - Logout`; - - attr(a, "href", "javascript:void(0)"); - attr(a, "class", "button is-light"); - dispose = listen(a, "click", /*handleClick*/ ctx[0]); - }, - m(target, anchor) { - insert(target, a, anchor); - }, - p: noop, - i: noop, - o: noop, - d(detaching) { - if (detaching) detach(a); - dispose(); - } - }; - } - - function instance$a($$self, $$props, $$invalidate) { - let $env; - component_subscribe($$self, env, $$value => $$invalidate(1, $env = $$value)); - - function handleClick() { - auth.remove($env); - removeToken($env); - removeRefreshToken($env); - } - - return [handleClick]; - } - - class LogoutButton extends SvelteComponent { - constructor(options) { - super(); - init(this, options, instance$a, create_fragment$a, safe_not_equal, {}); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/SelectorPanel.svelte generated by Svelte v3.16.5 */ - - function add_css$3() { - var style = element("style"); - style.id = "svelte-cjzzpf-style"; - style.textContent = ".icon-info.svelte-cjzzpf{cursor:pointer}.content.svelte-cjzzpf{padding:1rem 1.5rem}"; - append(document.head, style); - } - - function get_each_context$4(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[8] = list[i]; - return child_ctx; - } - - // (44:0) {#if isAuth(environment, 'oauth2')} - function create_if_block_1$6(ctx) { - let show_if; - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block_2$3, create_if_block_3$1, create_else_block_1]; - const if_blocks = []; - - function select_block_type(ctx, dirty) { - if (/*authenticating*/ ctx[1]) return 0; - if (dirty & /*$auth, $env*/ 48) show_if = !!/*$auth*/ ctx[5].includes(/*$env*/ ctx[4]); - if (show_if) return 1; - return 2; - } - - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - - return { - c() { - if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - }, - p(ctx, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx, dirty); - - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx, dirty); - } else { - group_outros(); - - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - - check_outros(); - if_block = if_blocks[current_block_type_index]; - - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - if_block.c(); - } - - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i(local) { - if (current) return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if_blocks[current_block_type_index].d(detaching); - if (detaching) detach(if_block_anchor); - } - }; - } - - // (59:2) {:else} - function create_else_block_1(ctx) { - let div1; - let div0; - let p; - let current; - - const loginbutton = new LoginButton({ - props: { - authOptions: /*environment*/ ctx[3].auth.options - } - }); - - return { - c() { - div1 = element("div"); - div0 = element("div"); - p = element("p"); - create_component(loginbutton.$$.fragment); - attr(p, "class", "control"); - attr(div0, "class", "field is-grouped"); - attr(div1, "class", "navbar-item"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, div0); - append(div0, p); - mount_component(loginbutton, p, null); - current = true; - }, - p(ctx, dirty) { - const loginbutton_changes = {}; - if (dirty & /*environment*/ 8) loginbutton_changes.authOptions = /*environment*/ ctx[3].auth.options; - loginbutton.$set(loginbutton_changes); - }, - i(local) { - if (current) return; - transition_in(loginbutton.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(loginbutton.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach(div1); - destroy_component(loginbutton); - } - }; - } - - // (51:33) - function create_if_block_3$1(ctx) { - let div1; - let div0; - let p; - let current; - const logoutbutton = new LogoutButton({}); - - return { - c() { - div1 = element("div"); - div0 = element("div"); - p = element("p"); - create_component(logoutbutton.$$.fragment); - attr(p, "class", "control"); - attr(div0, "class", "field is-grouped"); - attr(div1, "class", "navbar-item"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, div0); - append(div0, p); - mount_component(logoutbutton, p, null); - current = true; - }, - p: noop, - i(local) { - if (current) return; - transition_in(logoutbutton.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(logoutbutton.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach(div1); - destroy_component(logoutbutton); - } - }; - } - - // (45:2) {#if authenticating} - function create_if_block_2$3(ctx) { - let div; - - return { - c() { - div = element("div"); - div.innerHTML = ``; - attr(div, "class", "navbar-item"); - }, - m(target, anchor) { - insert(target, div, anchor); - }, - p: noop, - i: noop, - o: noop, - d(detaching) { - if (detaching) detach(div); - } - }; - } - - // (76:4) {#each Object.keys(environments) as envName} - function create_each_block$4(ctx) { - let a; - let t0_value = /*envName*/ ctx[8] + ""; - let t0; - let t1; - let a_data_name_value; - let dispose; - - return { - c() { - a = element("a"); - t0 = text(t0_value); - t1 = space(); - attr(a, "data-name", a_data_name_value = /*envName*/ ctx[8]); - attr(a, "href", "javascript:void(0)"); - attr(a, "class", "navbar-item"); - dispose = listen(a, "click", /*handleClick*/ ctx[6]); - }, - m(target, anchor) { - insert(target, a, anchor); - append(a, t0); - append(a, t1); - }, - p(ctx, dirty) { - if (dirty & /*environments*/ 1 && t0_value !== (t0_value = /*envName*/ ctx[8] + "")) set_data(t0, t0_value); - - if (dirty & /*environments*/ 1 && a_data_name_value !== (a_data_name_value = /*envName*/ ctx[8])) { - attr(a, "data-name", a_data_name_value); - } - }, - d(detaching) { - if (detaching) detach(a); - dispose(); - } - }; - } - - // (102:8) {:else} - function create_else_block$2(ctx) { - let span; - - return { - c() { - span = element("span"); - span.textContent = "None"; - attr(span, "class", "is-capitalized"); - }, - m(target, anchor) { - insert(target, span, anchor); - }, - p: noop, - d(detaching) { - if (detaching) detach(span); - } - }; - } - - // (100:8) {#if environment.auth} - function create_if_block$9(ctx) { - let span; - let t_value = /*environment*/ ctx[3].auth.name + ""; - let t; - - return { - c() { - span = element("span"); - t = text(t_value); - attr(span, "class", "is-capitalized"); - }, - m(target, anchor) { - insert(target, span, anchor); - append(span, t); - }, - p(ctx, dirty) { - if (dirty & /*environment*/ 8 && t_value !== (t_value = /*environment*/ ctx[3].auth.name + "")) set_data(t, t_value); - }, - d(detaching) { - if (detaching) detach(span); - } - }; - } - - function create_fragment$b(ctx) { - let show_if = isAuth(/*environment*/ ctx[3], "oauth2"); - let t0; - let div1; - let a0; - let t1; - let t2; - let div0; - let t3; - let div4; - let a1; - let t4; - let div3; - let div2; - let p0; - let t5; - let t6_value = /*environment*/ ctx[3].url + ""; - let t6; - let t7; - let p1; - let t8; - let current; - let dispose; - let if_block0 = show_if && create_if_block_1$6(ctx); - let each_value = Object.keys(/*environments*/ ctx[0]); - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i)); - } - - function select_block_type_1(ctx, dirty) { - if (/*environment*/ ctx[3].auth) return create_if_block$9; - return create_else_block$2; - } - - let current_block_type = select_block_type_1(ctx, -1); - let if_block1 = current_block_type(ctx); - - return { - c() { - if (if_block0) if_block0.c(); - t0 = space(); - div1 = element("div"); - a0 = element("a"); - t1 = text(/*$env*/ ctx[4]); - t2 = space(); - div0 = element("div"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - t3 = space(); - div4 = element("div"); - a1 = element("a"); - a1.innerHTML = ``; - t4 = space(); - div3 = element("div"); - div2 = element("div"); - p0 = element("p"); - t5 = text("BaseURL: "); - t6 = text(t6_value); - t7 = space(); - p1 = element("p"); - t8 = text("Auth:\n "); - if_block1.c(); - attr(a0, "href", "javascript:void(0)"); - attr(a0, "class", "navbar-link"); - attr(div0, "class", "navbar-dropdown is-right"); - attr(div1, "class", "navbar-item has-dropdown is-capitalized"); - toggle_class(div1, "is-active", /*show*/ ctx[2]); - attr(a1, "href", "javascript:void(0)"); - attr(a1, "class", "navbar-link is-arrowless"); - attr(div2, "class", "content svelte-cjzzpf"); - attr(div3, "class", "navbar-dropdown is-right"); - attr(div4, "class", "navbar-item has-dropdown is-hoverable"); - dispose = listen(a0, "click", /*toggleClick*/ ctx[7]); - }, - m(target, anchor) { - if (if_block0) if_block0.m(target, anchor); - insert(target, t0, anchor); - insert(target, div1, anchor); - append(div1, a0); - append(a0, t1); - append(div1, t2); - append(div1, div0); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div0, null); - } - - insert(target, t3, anchor); - insert(target, div4, anchor); - append(div4, a1); - append(div4, t4); - append(div4, div3); - append(div3, div2); - append(div2, p0); - append(p0, t5); - append(p0, t6); - append(div2, t7); - append(div2, p1); - append(p1, t8); - if_block1.m(p1, null); - current = true; - }, - p(ctx, [dirty]) { - if (dirty & /*environment*/ 8) show_if = isAuth(/*environment*/ ctx[3], "oauth2"); - - if (show_if) { - if (if_block0) { - if_block0.p(ctx, dirty); - transition_in(if_block0, 1); - } else { - if_block0 = create_if_block_1$6(ctx); - if_block0.c(); - transition_in(if_block0, 1); - if_block0.m(t0.parentNode, t0); - } - } else if (if_block0) { - group_outros(); - - transition_out(if_block0, 1, 1, () => { - if_block0 = null; - }); - - check_outros(); - } - - if (!current || dirty & /*$env*/ 16) set_data(t1, /*$env*/ ctx[4]); - - if (dirty & /*Object, environments, handleClick*/ 65) { - each_value = Object.keys(/*environments*/ ctx[0]); - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$4(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block$4(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div0, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value.length; - } - - if (dirty & /*show*/ 4) { - toggle_class(div1, "is-active", /*show*/ ctx[2]); - } - - if ((!current || dirty & /*environment*/ 8) && t6_value !== (t6_value = /*environment*/ ctx[3].url + "")) set_data(t6, t6_value); - - if (current_block_type === (current_block_type = select_block_type_1(ctx, dirty)) && if_block1) { - if_block1.p(ctx, dirty); - } else { - if_block1.d(1); - if_block1 = current_block_type(ctx); - - if (if_block1) { - if_block1.c(); - if_block1.m(p1, null); - } - } - }, - i(local) { - if (current) return; - transition_in(if_block0); - current = true; - }, - o(local) { - transition_out(if_block0); - current = false; - }, - d(detaching) { - if (if_block0) if_block0.d(detaching); - if (detaching) detach(t0); - if (detaching) detach(div1); - destroy_each(each_blocks, detaching); - if (detaching) detach(t3); - if (detaching) detach(div4); - if_block1.d(); - dispose(); - } - }; - } - - function instance$b($$self, $$props, $$invalidate) { - let $env; - let $auth; - component_subscribe($$self, env, $$value => $$invalidate(4, $env = $$value)); - component_subscribe($$self, auth, $$value => $$invalidate(5, $auth = $$value)); - let { environments } = $$props; - let { authenticating } = $$props; - let show = false; - - function handleClick(event) { - $$invalidate(2, show = false); - const envName = event.target.dataset["name"]; - env.set(envName); - const authToken = getToken($env); - - if (authToken) { - auth.add(envName); - token.set(authToken); - } - } - - function toggleClick() { - $$invalidate(2, show = !show); - } - - $$self.$set = $$props => { - if ("environments" in $$props) $$invalidate(0, environments = $$props.environments); - if ("authenticating" in $$props) $$invalidate(1, authenticating = $$props.authenticating); - }; - - let environment; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*environments, $env*/ 17) { - $$invalidate(3, environment = environments[$env]); - } - }; - - return [ - environments, - authenticating, - show, - environment, - $env, - $auth, - handleClick, - toggleClick - ]; - } - - class SelectorPanel extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-cjzzpf-style")) add_css$3(); - init(this, options, instance$b, create_fragment$b, safe_not_equal, { environments: 0, authenticating: 1 }); - } - } - - /* usr/local/lib/node_modules/snowboard/templates/winter/components/ToggleIcon.svelte generated by Svelte v3.16.5 */ - - function add_css$4() { + function add_css$2() { var style = element("style"); style.id = "svelte-o7a14x-style"; style.textContent = ".toggle-icon.svelte-o7a14x{cursor:pointer}"; append(document.head, style); } - function create_fragment$c(ctx) { + function create_fragment$6(ctx) { let span; let i; let span_class_value; @@ -13898,11 +16912,11 @@ toggle_class(i, "fa-chevron-down", /*show*/ ctx[0]); attr(span, "class", span_class_value = "toggle-icon icon " + /*additionalClass*/ ctx[2] + " svelte-o7a14x"); toggle_class(span, "has-text-grey", !/*dark*/ ctx[1]); - dispose = listen(span, "click", /*toggle*/ ctx[3]); }, m(target, anchor) { insert(target, span, anchor); append(span, i); + dispose = listen(span, "click", /*toggle*/ ctx[3]); }, p(ctx, [dirty]) { if (dirty & /*show*/ 1) { @@ -13930,7 +16944,7 @@ }; } - function instance$c($$self, $$props, $$invalidate) { + function instance$6($$self, $$props, $$invalidate) { let { dark = false } = $$props; let { show = false } = $$props; let { additionalClass = "" } = $$props; @@ -13954,9 +16968,9 @@ class ToggleIcon extends SvelteComponent { constructor(options) { super(); - if (!document.getElementById("svelte-o7a14x-style")) add_css$4(); + if (!document.getElementById("svelte-o7a14x-style")) add_css$2(); - init(this, options, instance$c, create_fragment$c, safe_not_equal, { + init(this, options, instance$6, create_fragment$6, safe_not_equal, { dark: 1, show: 0, additionalClass: 2, @@ -13965,9 +16979,9 @@ } } - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CollapsiblePanel.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CollapsiblePanel.svelte generated by Svelte v3.19.2 */ - function add_css$5() { + function add_css$3() { var style = element("style"); style.id = "svelte-1hkyt70-style"; style.textContent = ".panel-section.svelte-1hkyt70{padding:1em;border:1px solid #dbdbdb;border-top:none}.panel-button.svelte-1hkyt70{border-radius:4px}.panel-dark.svelte-1hkyt70{border:1px solid #363636}.panel-section.is-darkmode.svelte-1hkyt70{background-color:#222 !important;border-color:#333}"; @@ -13979,7 +16993,7 @@ const get_heading_slot_changes = dirty => ({}); const get_heading_slot_context = ctx => ({}); - function create_fragment$d(ctx) { + function create_fragment$7(ctx) { let div2; let div0; let t0; @@ -14101,7 +17115,7 @@ }; } - function instance$d($$self, $$props, $$invalidate) { + function instance$7($$self, $$props, $$invalidate) { let { dark = false } = $$props; let { show = false } = $$props; let { isDarkmode } = $$props; @@ -14121,21 +17135,21 @@ class CollapsiblePanel extends SvelteComponent { constructor(options) { super(); - if (!document.getElementById("svelte-1hkyt70-style")) add_css$5(); - init(this, options, instance$d, create_fragment$d, safe_not_equal, { dark: 1, show: 0, isDarkmode: 2 }); + if (!document.getElementById("svelte-1hkyt70-style")) add_css$3(); + init(this, options, instance$7, create_fragment$7, safe_not_equal, { dark: 1, show: 0, isDarkmode: 2 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldDisabled.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldDisabled.svelte generated by Svelte v3.19.2 */ - function add_css$6() { + function add_css$4() { var style = element("style"); style.id = "svelte-a7ak6u-style"; style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}"; append(document.head, style); } - function create_fragment$e(ctx) { + function create_fragment$8(ctx) { let div; let p0; let input0; @@ -14208,7 +17222,7 @@ attr(input1, "placeholder", /*placeholder*/ ctx[1]); } - if (dirty & /*value*/ 4) { + if (dirty & /*value*/ 4 && input2.value !== /*value*/ ctx[2]) { input2.value = /*value*/ ctx[2]; } }, @@ -14220,7 +17234,7 @@ }; } - function instance$e($$self, $$props, $$invalidate) { + function instance$8($$self, $$props, $$invalidate) { let { name } = $$props; let { placeholder } = $$props; let { value } = $$props; @@ -14237,21 +17251,21 @@ class FieldDisabled extends SvelteComponent { constructor(options) { super(); - if (!document.getElementById("svelte-a7ak6u-style")) add_css$6(); - init(this, options, instance$e, create_fragment$e, safe_not_equal, { name: 0, placeholder: 1, value: 2 }); + if (!document.getElementById("svelte-a7ak6u-style")) add_css$4(); + init(this, options, instance$8, create_fragment$8, safe_not_equal, { name: 0, placeholder: 1, value: 2 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldSwitch.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldSwitch.svelte generated by Svelte v3.19.2 */ - function add_css$7() { + function add_css$5() { var style = element("style"); style.id = "svelte-a7ak6u-style"; style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}"; append(document.head, style); } - function create_fragment$f(ctx) { + function create_fragment$9(ctx) { let div; let p0; let input0; @@ -14296,11 +17310,6 @@ toggle_class(input2, "is-rounded", /*rounded*/ ctx[4]); attr(p2, "class", "control is-expanded"); attr(div, "class", "field has-addons"); - - dispose = [ - listen(input0, "change", /*input0_change_handler*/ ctx[5]), - listen(input2, "input", /*input2_input_handler*/ ctx[6]) - ]; }, m(target, anchor) { insert(target, div, anchor); @@ -14316,6 +17325,11 @@ append(div, p2); append(p2, input2); set_input_value(input2, /*value*/ ctx[1]); + + dispose = [ + listen(input0, "change", /*input0_change_handler*/ ctx[5]), + listen(input2, "input", /*input2_input_handler*/ ctx[6]) + ]; }, p(ctx, [dirty]) { if (dirty & /*name*/ 8 && input0_id_value !== (input0_id_value = "p-" + /*name*/ ctx[3])) { @@ -14355,7 +17369,7 @@ }; } - function instance$f($$self, $$props, $$invalidate) { + function instance$9($$self, $$props, $$invalidate) { let { used } = $$props; let { required } = $$props; let { name } = $$props; @@ -14394,9 +17408,9 @@ class FieldSwitch extends SvelteComponent { constructor(options) { super(); - if (!document.getElementById("svelte-a7ak6u-style")) add_css$7(); + if (!document.getElementById("svelte-a7ak6u-style")) add_css$5(); - init(this, options, instance$f, create_fragment$f, safe_not_equal, { + init(this, options, instance$9, create_fragment$9, safe_not_equal, { used: 0, required: 2, name: 3, @@ -14406,39 +17420,247 @@ } } - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/PlaygroundPanel.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/components/CodeBlock.svelte generated by Svelte v3.19.2 */ - function add_css$8() { + function create_if_block$5(ctx) { + let pre; + let code; + let raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + ""; + let code_class_value; + let pre_class_value; + + return { + c() { + pre = element("pre"); + code = element("code"); + attr(code, "class", code_class_value = "language-" + /*mime*/ ctx[1]); + attr(pre, "class", pre_class_value = "language-" + /*mime*/ ctx[1]); + }, + m(target, anchor) { + insert(target, pre, anchor); + append(pre, code); + code.innerHTML = raw_value; + }, + p(ctx, dirty) { + if (dirty & /*body, mime*/ 3 && raw_value !== (raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "")) code.innerHTML = raw_value;; + + if (dirty & /*mime*/ 2 && code_class_value !== (code_class_value = "language-" + /*mime*/ ctx[1])) { + attr(code, "class", code_class_value); + } + + if (dirty & /*mime*/ 2 && pre_class_value !== (pre_class_value = "language-" + /*mime*/ ctx[1])) { + attr(pre, "class", pre_class_value); + } + }, + d(detaching) { + if (detaching) detach(pre); + } + }; + } + + function create_fragment$a(ctx) { + let if_block_anchor; + let if_block = /*body*/ ctx[0] && create_if_block$5(ctx); + + return { + c() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx, [dirty]) { + if (/*body*/ ctx[0]) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$5(ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + i: noop, + o: noop, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + function instance$a($$self, $$props, $$invalidate) { + let { type } = $$props; + let { body } = $$props; + + $$self.$set = $$props => { + if ("type" in $$props) $$invalidate(2, type = $$props.type); + if ("body" in $$props) $$invalidate(0, body = $$props.body); + }; + + let mime; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*type*/ 4) { + $$invalidate(1, mime = alias(type)); + } + }; + + return [body, mime, type]; + } + + class CodeBlock extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$a, create_fragment$a, safe_not_equal, { type: 2, body: 0 }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/components/LoginButton.svelte generated by Svelte v3.19.2 */ + + function create_fragment$b(ctx) { + let a; + let span0; + let t0; + let span1; + + return { + c() { + a = element("a"); + span0 = element("span"); + span0.innerHTML = ``; + t0 = space(); + span1 = element("span"); + span1.textContent = "Login"; + attr(span0, "class", "icon"); + attr(a, "href", /*authorizeUrl*/ ctx[1]); + attr(a, "class", "button is-dark is-rounded"); + toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]); + }, + m(target, anchor) { + insert(target, a, anchor); + append(a, span0); + append(a, t0); + append(a, span1); + }, + p(ctx, [dirty]) { + if (dirty & /*authorizeUrl*/ 2) { + attr(a, "href", /*authorizeUrl*/ ctx[1]); + } + + if (dirty & /*fullWidth*/ 1) { + toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(a); + } + }; + } + + function instance$b($$self, $$props, $$invalidate) { + let { authOptions } = $$props; + let { fullWidth } = $$props; + let { pkceChallenge } = $$props; + let { isPKCE } = $$props; + + $$self.$set = $$props => { + if ("authOptions" in $$props) $$invalidate(2, authOptions = $$props.authOptions); + if ("fullWidth" in $$props) $$invalidate(0, fullWidth = $$props.fullWidth); + if ("pkceChallenge" in $$props) $$invalidate(3, pkceChallenge = $$props.pkceChallenge); + if ("isPKCE" in $$props) $$invalidate(4, isPKCE = $$props.isPKCE); + }; + + let authorizeParams; + let authorizeUrl; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*isPKCE, authOptions, pkceChallenge*/ 28) { + $$invalidate(5, authorizeParams = isPKCE + ? querystringify_1.stringify( + { + client_id: authOptions.clientId, + redirect_uri: authOptions.callbackUrl, + response_type: "code", + state: getState(), + scope: authOptions.scopes || "", + code_challenge: pkceChallenge.codeChallenge, + code_challenge_method: "S256" + }, + true + ) + : querystringify_1.stringify( + { + client_id: authOptions.clientId, + redirect_uri: authOptions.callbackUrl, + response_type: "code", + scope: authOptions.scopes || "" + }, + true + )); + } + + if ($$self.$$.dirty & /*authOptions, authorizeParams*/ 36) { + $$invalidate(1, authorizeUrl = `${authOptions.authorizeUrl}${authorizeParams}`); + } + }; + + return [fullWidth, authorizeUrl, authOptions, pkceChallenge, isPKCE]; + } + + class LoginButton extends SvelteComponent { + constructor(options) { + super(); + + init(this, options, instance$b, create_fragment$b, safe_not_equal, { + authOptions: 2, + fullWidth: 0, + pkceChallenge: 3, + isPKCE: 4 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/PlaygroundPanel.svelte generated by Svelte v3.19.2 */ + + function add_css$6() { var style = element("style"); style.id = "svelte-c3oocm-style"; style.textContent = ".small-section.svelte-c3oocm{padding-top:0.5rem}.button-left.svelte-c3oocm{justify-content:left}.control-switch.svelte-c3oocm{padding-top:0.4rem}.container-content.svelte-c3oocm{padding:0.5rem 1rem;border-radius:4px;margin-top:0.5rem;background-color:#2b2b2b}.content-header.svelte-c3oocm{color:#fff;border-bottom:dashed 1px #777;padding-top:0.5rem;padding-bottom:1rem}.hero-small.svelte-c3oocm{padding:1.5rem}.has-border.svelte-c3oocm{border-color:#dbdbdb}.hero-rounded.svelte-c3oocm{border-radius:4px}"; append(document.head, style); } - function get_each_context$5(ctx, list, i) { + function get_each_context$1(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[29] = list[i][0]; - child_ctx[30] = list[i][1]; + child_ctx[31] = list[i][0]; + child_ctx[32] = list[i][1]; return child_ctx; } - function get_each_context_1$1(ctx, list, i) { + function get_each_context_1(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[33] = list[i]; - child_ctx[34] = list; - child_ctx[35] = i; + child_ctx[35] = list[i]; + child_ctx[36] = list; + child_ctx[37] = i; return child_ctx; } - function get_each_context_2$1(ctx, list, i) { + function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[36] = list[i]; - child_ctx[37] = list; - child_ctx[38] = i; + child_ctx[38] = list[i]; + child_ctx[39] = list; + child_ctx[40] = i; return child_ctx; } - // (126:2) + // (119:2) function create_heading_slot(ctx) { let span; @@ -14457,19 +17679,19 @@ }; } - // (135:8) {:else} + // (128:8) {:else} function create_else_block_4(ctx) { let a; let span0; - let t0_value = /*currentAction*/ ctx[5].method + ""; + let t0_value = /*currentAction*/ ctx[6].method + ""; let t0; let t1; let span1; - let t2_value = /*currentUrl*/ ctx[12].origin + ""; + let t2_value = /*currentUrl*/ ctx[13].origin + ""; let t2; let t3; let span2; - let t4_value = /*currentUrl*/ ctx[12].pathname + ""; + let t4_value = /*currentUrl*/ ctx[13].pathname + ""; let t4; let dispose; @@ -14488,7 +17710,6 @@ attr(span2, "class", "has-text-weight-bold"); attr(a, "href", "javascript:void(0)"); attr(a, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm"); - dispose = listen(a, "click", /*handleCopy*/ ctx[17]); }, m(target, anchor) { insert(target, a, anchor); @@ -14500,11 +17721,12 @@ append(a, t3); append(a, span2); append(span2, t4); + dispose = listen(a, "click", /*handleCopy*/ ctx[17]); }, p(ctx, dirty) { - if (dirty[0] & /*currentAction*/ 32 && t0_value !== (t0_value = /*currentAction*/ ctx[5].method + "")) set_data(t0, t0_value); - if (dirty[0] & /*currentUrl*/ 4096 && t2_value !== (t2_value = /*currentUrl*/ ctx[12].origin + "")) set_data(t2, t2_value); - if (dirty[0] & /*currentUrl*/ 4096 && t4_value !== (t4_value = /*currentUrl*/ ctx[12].pathname + "")) set_data(t4, t4_value); + if (dirty[0] & /*currentAction*/ 64 && t0_value !== (t0_value = /*currentAction*/ ctx[6].method + "")) set_data(t0, t0_value); + if (dirty[0] & /*currentUrl*/ 8192 && t2_value !== (t2_value = /*currentUrl*/ ctx[13].origin + "")) set_data(t2, t2_value); + if (dirty[0] & /*currentUrl*/ 8192 && t4_value !== (t4_value = /*currentUrl*/ ctx[13].pathname + "")) set_data(t4, t4_value); }, d(detaching) { if (detaching) detach(a); @@ -14513,8 +17735,8 @@ }; } - // (130:8) {#if copying} - function create_if_block_11(ctx) { + // (123:8) {#if copying} + function create_if_block_7(ctx) { let button; return { @@ -14533,7 +17755,7 @@ }; } - // (154:8) {:else} + // (149:8) {:else} function create_else_block_3(ctx) { let button; let dispose; @@ -14546,10 +17768,10 @@ Send`; attr(button, "class", "button is-success is-fullwidth"); - dispose = listen(button, "click", /*handleClick*/ ctx[15]); }, m(target, anchor) { insert(target, button, anchor); + dispose = listen(button, "click", /*handleClick*/ ctx[15]); }, p: noop, i: noop, @@ -14561,13 +17783,15 @@ }; } - // (150:8) {#if isAuth(environment, 'oauth2') && !$auth.includes($env)} - function create_if_block_10(ctx) { + // (143:8) {#if isAuth(environment, 'oauth2') && !$auth.split(';').includes($env)} + function create_if_block_6(ctx) { let current; const loginbutton = new LoginButton({ props: { - authOptions: /*environment*/ ctx[10].auth.options, + authOptions: /*environment*/ ctx[11].auth.options, + isPKCE: isPKCE(/*environment*/ ctx[11]), + pkceChallenge: /*pkceChallenge*/ ctx[7], fullWidth: true } }); @@ -14582,7 +17806,9 @@ }, p(ctx, dirty) { const loginbutton_changes = {}; - if (dirty[0] & /*environment*/ 1024) loginbutton_changes.authOptions = /*environment*/ ctx[10].auth.options; + if (dirty[0] & /*environment*/ 2048) loginbutton_changes.authOptions = /*environment*/ ctx[11].auth.options; + if (dirty[0] & /*environment*/ 2048) loginbutton_changes.isPKCE = isPKCE(/*environment*/ ctx[11]); + if (dirty[0] & /*pkceChallenge*/ 128) loginbutton_changes.pkceChallenge = /*pkceChallenge*/ ctx[7]; loginbutton.$set(loginbutton_changes); }, i(local) { @@ -14600,35 +17826,42 @@ }; } - // (186:6) {:else} + // (181:6) {:else} function create_else_block_2(ctx) { - let each_1_anchor; + let t; + let if_block_anchor; let current; let each_value_2 = /*requestHeaders*/ ctx[0]; let each_blocks = []; for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i)); + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } const out = i => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; }); + let if_block = /*requestAuthHeader*/ ctx[1] && create_if_block_5(ctx); + return { c() { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - each_1_anchor = empty(); + t = space(); + if (if_block) if_block.c(); + if_block_anchor = empty(); }, m(target, anchor) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } - insert(target, each_1_anchor, anchor); + insert(target, t, anchor); + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); current = true; }, p(ctx, dirty) { @@ -14637,16 +17870,16 @@ let i; for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2$1(ctx, each_value_2, i); + const child_ctx = get_each_context_2(ctx, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_2$1(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); + each_blocks[i].m(t.parentNode, t); } } @@ -14658,6 +17891,26 @@ check_outros(); } + + if (/*requestAuthHeader*/ ctx[1]) { + if (if_block) { + if_block.p(ctx, dirty); + transition_in(if_block, 1); + } else { + if_block = create_if_block_5(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + group_outros(); + + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + + check_outros(); + } }, i(local) { if (current) return; @@ -14666,6 +17919,7 @@ transition_in(each_blocks[i]); } + transition_in(if_block); current = true; }, o(local) { @@ -14675,17 +17929,20 @@ transition_out(each_blocks[i]); } + transition_out(if_block); current = false; }, d(detaching) { destroy_each(each_blocks, detaching); - if (detaching) detach(each_1_anchor); + if (detaching) detach(t); + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); } }; } - // (182:6) {#if requestHeaders.length === 0 && !environment.auth} - function create_if_block_9(ctx) { + // (177:6) {#if requestHeaders.length === 0 && !environment.auth} + function create_if_block_4(ctx) { let p; return { @@ -14705,32 +17962,32 @@ }; } - // (187:8) {#each requestHeaders as header} - function create_each_block_2$1(ctx) { + // (182:8) {#each requestHeaders as header} + function create_each_block_2(ctx) { let updating_used; let updating_value; let current; function fieldswitch_used_binding(value) { - /*fieldswitch_used_binding*/ ctx[23].call(null, value, /*header*/ ctx[36]); + /*fieldswitch_used_binding*/ ctx[23].call(null, value, /*header*/ ctx[38]); } - function fieldswitch_value_binding(value_1) { - /*fieldswitch_value_binding*/ ctx[24].call(null, value_1, /*header*/ ctx[36]); + function fieldswitch_value_binding(value) { + /*fieldswitch_value_binding*/ ctx[24].call(null, value, /*header*/ ctx[38]); } let fieldswitch_props = { - name: /*header*/ ctx[36].name, - required: /*header*/ ctx[36].required, + name: /*header*/ ctx[38].name, + required: /*header*/ ctx[38].required, rounded: true }; - if (/*header*/ ctx[36].used !== void 0) { - fieldswitch_props.used = /*header*/ ctx[36].used; + if (/*header*/ ctx[38].used !== void 0) { + fieldswitch_props.used = /*header*/ ctx[38].used; } - if (/*header*/ ctx[36].value !== void 0) { - fieldswitch_props.value = /*header*/ ctx[36].value; + if (/*header*/ ctx[38].value !== void 0) { + fieldswitch_props.value = /*header*/ ctx[38].value; } const fieldswitch = new FieldSwitch({ props: fieldswitch_props }); @@ -14748,18 +18005,18 @@ p(new_ctx, dirty) { ctx = new_ctx; const fieldswitch_changes = {}; - if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.name = /*header*/ ctx[36].name; - if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.required = /*header*/ ctx[36].required; + if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.name = /*header*/ ctx[38].name; + if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.required = /*header*/ ctx[38].required; if (!updating_used && dirty[0] & /*requestHeaders*/ 1) { updating_used = true; - fieldswitch_changes.used = /*header*/ ctx[36].used; + fieldswitch_changes.used = /*header*/ ctx[38].used; add_flush_callback(() => updating_used = false); } if (!updating_value && dirty[0] & /*requestHeaders*/ 1) { updating_value = true; - fieldswitch_changes.value = /*header*/ ctx[36].value; + fieldswitch_changes.value = /*header*/ ctx[38].value; add_flush_callback(() => updating_value = false); } @@ -14780,192 +18037,75 @@ }; } - // (197:6) {#if isAuth(environment, 'basic')} - function create_if_block_8(ctx) { - let current; - - const fielddisabled = new FieldDisabled({ - props: { - name: "authorization", - placeholder: "Authorization", - value: "Basic " + basicAuth(/*environment*/ ctx[10].auth.options.username, /*environment*/ ctx[10].auth.options.password) - } - }); - - return { - c() { - create_component(fielddisabled.$$.fragment); - }, - m(target, anchor) { - mount_component(fielddisabled, target, anchor); - current = true; - }, - p(ctx, dirty) { - const fielddisabled_changes = {}; - if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.value = "Basic " + basicAuth(/*environment*/ ctx[10].auth.options.username, /*environment*/ ctx[10].auth.options.password); - fielddisabled.$set(fielddisabled_changes); - }, - i(local) { - if (current) return; - transition_in(fielddisabled.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(fielddisabled.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(fielddisabled, detaching); - } - }; - } - - // (204:6) {#if isAuth(environment, 'apikey')} - function create_if_block_7(ctx) { - let current; - - const fielddisabled = new FieldDisabled({ - props: { - name: "authorization", - placeholder: /*environment*/ ctx[10].auth.options.header, - value: /*environment*/ ctx[10].auth.options.key - } - }); - - return { - c() { - create_component(fielddisabled.$$.fragment); - }, - m(target, anchor) { - mount_component(fielddisabled, target, anchor); - current = true; - }, - p(ctx, dirty) { - const fielddisabled_changes = {}; - if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.placeholder = /*environment*/ ctx[10].auth.options.header; - if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.value = /*environment*/ ctx[10].auth.options.key; - fielddisabled.$set(fielddisabled_changes); - }, - i(local) { - if (current) return; - transition_in(fielddisabled.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(fielddisabled.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(fielddisabled, detaching); - } - }; - } - - // (211:6) {#if isAuth(environment, 'oauth2')} + // (191:8) {#if requestAuthHeader} function create_if_block_5(ctx) { - let show_if = /*$auth*/ ctx[13].includes(/*$env*/ ctx[11]); - let if_block_anchor; + let updating_value; let current; - let if_block = show_if && create_if_block_6(ctx); + + function fieldswitch_value_binding_1(value) { + /*fieldswitch_value_binding_1*/ ctx[25].call(null, value); + } + + let fieldswitch_props = { + name: /*requestAuthHeader*/ ctx[1].name, + required: /*requestAuthHeader*/ ctx[1].required, + used: /*requestAuthHeader*/ ctx[1].used, + rounded: true + }; + + if (/*requestAuthHeader*/ ctx[1].value !== void 0) { + fieldswitch_props.value = /*requestAuthHeader*/ ctx[1].value; + } + + const fieldswitch = new FieldSwitch({ props: fieldswitch_props }); + binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_1)); return { c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); + create_component(fieldswitch.$$.fragment); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + mount_component(fieldswitch, target, anchor); current = true; }, p(ctx, dirty) { - if (dirty[0] & /*$auth, $env*/ 10240) show_if = /*$auth*/ ctx[13].includes(/*$env*/ ctx[11]); + const fieldswitch_changes = {}; + if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.name = /*requestAuthHeader*/ ctx[1].name; + if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.required = /*requestAuthHeader*/ ctx[1].required; + if (dirty[0] & /*requestAuthHeader*/ 2) fieldswitch_changes.used = /*requestAuthHeader*/ ctx[1].used; - if (show_if) { - if (if_block) { - if_block.p(ctx, dirty); - transition_in(if_block, 1); - } else { - if_block = create_if_block_6(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - - check_outros(); + if (!updating_value && dirty[0] & /*requestAuthHeader*/ 2) { + updating_value = true; + fieldswitch_changes.value = /*requestAuthHeader*/ ctx[1].value; + add_flush_callback(() => updating_value = false); } + + fieldswitch.$set(fieldswitch_changes); }, i(local) { if (current) return; - transition_in(if_block); + transition_in(fieldswitch.$$.fragment, local); current = true; }, o(local) { - transition_out(if_block); + transition_out(fieldswitch.$$.fragment, local); current = false; }, d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); + destroy_component(fieldswitch, detaching); } }; } - // (212:8) {#if $auth.includes($env)} - function create_if_block_6(ctx) { - let current; - - const fielddisabled = new FieldDisabled({ - props: { - name: "authorization", - placeholder: "Authorization", - value: "Bearer " + /*$token*/ ctx[14] - } - }); - - return { - c() { - create_component(fielddisabled.$$.fragment); - }, - m(target, anchor) { - mount_component(fielddisabled, target, anchor); - current = true; - }, - p(ctx, dirty) { - const fielddisabled_changes = {}; - if (dirty[0] & /*$token*/ 16384) fielddisabled_changes.value = "Bearer " + /*$token*/ ctx[14]; - fielddisabled.$set(fielddisabled_changes); - }, - i(local) { - if (current) return; - transition_in(fielddisabled.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(fielddisabled.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(fielddisabled, detaching); - } - }; - } - - // (226:6) {:else} - function create_else_block_1$1(ctx) { + // (207:6) {:else} + function create_else_block_1(ctx) { let each_1_anchor; let current; - let each_value_1 = /*requestParameters*/ ctx[1]; + let each_value_1 = /*requestParameters*/ ctx[2]; let each_blocks = []; for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); + each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); } const out = i => transition_out(each_blocks[i], 1, 1, () => { @@ -14989,18 +18129,18 @@ current = true; }, p(ctx, dirty) { - if (dirty[0] & /*requestParameters*/ 2) { - each_value_1 = /*requestParameters*/ ctx[1]; + if (dirty[0] & /*requestParameters*/ 4) { + each_value_1 = /*requestParameters*/ ctx[2]; let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1$1(ctx, each_value_1, i); + const child_ctx = get_each_context_1(ctx, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_1$1(child_ctx); + each_blocks[i] = create_each_block_1(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); @@ -15041,8 +18181,8 @@ }; } - // (222:6) {#if requestParameters.length === 0} - function create_if_block_4(ctx) { + // (203:6) {#if requestParameters.length === 0} + function create_if_block_3(ctx) { let p; return { @@ -15062,36 +18202,37 @@ }; } - // (227:8) {#each requestParameters as param} - function create_each_block_1$1(ctx) { + // (208:8) {#each requestParameters as param} + function create_each_block_1(ctx) { let updating_used; let updating_value; let current; function fieldswitch_used_binding_1(value) { - /*fieldswitch_used_binding_1*/ ctx[25].call(null, value, /*param*/ ctx[33]); + /*fieldswitch_used_binding_1*/ ctx[26].call(null, value, /*param*/ ctx[35]); } - function fieldswitch_value_binding_1(value_1) { - /*fieldswitch_value_binding_1*/ ctx[26].call(null, value_1, /*param*/ ctx[33]); + function fieldswitch_value_binding_2(value) { + /*fieldswitch_value_binding_2*/ ctx[27].call(null, value, /*param*/ ctx[35]); } let fieldswitch_props = { - name: /*param*/ ctx[33].name, - required: /*param*/ ctx[33].required + name: /*param*/ ctx[35].name, + required: /*param*/ ctx[35].required, + rounded: false }; - if (/*param*/ ctx[33].used !== void 0) { - fieldswitch_props.used = /*param*/ ctx[33].used; + if (/*param*/ ctx[35].used !== void 0) { + fieldswitch_props.used = /*param*/ ctx[35].used; } - if (/*param*/ ctx[33].value !== void 0) { - fieldswitch_props.value = /*param*/ ctx[33].value; + if (/*param*/ ctx[35].value !== void 0) { + fieldswitch_props.value = /*param*/ ctx[35].value; } const fieldswitch = new FieldSwitch({ props: fieldswitch_props }); binding_callbacks.push(() => bind(fieldswitch, "used", fieldswitch_used_binding_1)); - binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_1)); + binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_2)); return { c() { @@ -15104,18 +18245,18 @@ p(new_ctx, dirty) { ctx = new_ctx; const fieldswitch_changes = {}; - if (dirty[0] & /*requestParameters*/ 2) fieldswitch_changes.name = /*param*/ ctx[33].name; - if (dirty[0] & /*requestParameters*/ 2) fieldswitch_changes.required = /*param*/ ctx[33].required; + if (dirty[0] & /*requestParameters*/ 4) fieldswitch_changes.name = /*param*/ ctx[35].name; + if (dirty[0] & /*requestParameters*/ 4) fieldswitch_changes.required = /*param*/ ctx[35].required; - if (!updating_used && dirty[0] & /*requestParameters*/ 2) { + if (!updating_used && dirty[0] & /*requestParameters*/ 4) { updating_used = true; - fieldswitch_changes.used = /*param*/ ctx[33].used; + fieldswitch_changes.used = /*param*/ ctx[35].used; add_flush_callback(() => updating_used = false); } - if (!updating_value && dirty[0] & /*requestParameters*/ 2) { + if (!updating_value && dirty[0] & /*requestParameters*/ 4) { updating_value = true; - fieldswitch_changes.value = /*param*/ ctx[33].value; + fieldswitch_changes.value = /*param*/ ctx[35].value; add_flush_callback(() => updating_value = false); } @@ -15136,7 +18277,7 @@ }; } - // (243:6) {:else} + // (225:6) {:else} function create_else_block$3(ctx) { let p; @@ -15155,8 +18296,8 @@ }; } - // (238:6) {#if allowBody(currentAction)} - function create_if_block_3$2(ctx) { + // (220:6) {#if allowBody(currentAction)} + function create_if_block_2$2(ctx) { let textarea; let dispose; @@ -15165,15 +18306,15 @@ textarea = element("textarea"); attr(textarea, "class", "textarea is-family-code"); attr(textarea, "rows", "8"); - dispose = listen(textarea, "input", /*textarea_input_handler*/ ctx[27]); }, m(target, anchor) { insert(target, textarea, anchor); - set_input_value(textarea, /*requestBody*/ ctx[2]); + set_input_value(textarea, /*requestBody*/ ctx[3]); + dispose = listen(textarea, "input", /*textarea_input_handler*/ ctx[28]); }, p(ctx, dirty) { - if (dirty[0] & /*requestBody*/ 4) { - set_input_value(textarea, /*requestBody*/ ctx[2]); + if (dirty[0] & /*requestBody*/ 8) { + set_input_value(textarea, /*requestBody*/ ctx[3]); } }, d(detaching) { @@ -15183,33 +18324,55 @@ }; } - // (283:4) {:catch} + // (265:4) {:catch error} function create_catch_block(ctx) { - let div; + let div1; + let section1; + let section0; + let div0; + let p; + let t_value = /*error*/ ctx[30] + ""; + let t; return { c() { - div = element("div"); - div.textContent = " "; + div1 = element("div"); + section1 = element("section"); + section0 = element("section"); + div0 = element("div"); + p = element("p"); + t = text(t_value); + attr(p, "class", "subtitle"); + attr(div0, "class", "container"); + attr(section0, "class", "hero-body"); + attr(section1, "class", "hero is-danger"); + attr(div1, "class", "small-section svelte-c3oocm"); }, m(target, anchor) { - insert(target, div, anchor); + insert(target, div1, anchor); + append(div1, section1); + append(section1, section0); + append(section0, div0); + append(div0, p); + append(p, t); + }, + p(ctx, dirty) { + if (dirty[0] & /*response*/ 256 && t_value !== (t_value = /*error*/ ctx[30] + "")) set_data(t, t_value); }, - p: noop, i: noop, o: noop, d(detaching) { - if (detaching) detach(div); + if (detaching) detach(div1); } }; } - // (256:4) {:then value} + // (238:4) {:then value} function create_then_block(ctx) { - let show_if = Object.keys(/*value*/ ctx[28]).length > 0; + let show_if = Object.keys(/*value*/ ctx[29] || {}).length > 0; let if_block_anchor; let current; - let if_block = show_if && create_if_block_1$7(ctx); + let if_block = show_if && create_if_block$6(ctx); return { c() { @@ -15222,14 +18385,14 @@ current = true; }, p(ctx, dirty) { - if (dirty[0] & /*response*/ 64) show_if = Object.keys(/*value*/ ctx[28]).length > 0; + if (dirty[0] & /*response*/ 256) show_if = Object.keys(/*value*/ ctx[29] || {}).length > 0; if (show_if) { if (if_block) { if_block.p(ctx, dirty); transition_in(if_block, 1); } else { - if_block = create_if_block_1$7(ctx); + if_block = create_if_block$6(ctx); if_block.c(); transition_in(if_block, 1); if_block.m(if_block_anchor.parentNode, if_block_anchor); @@ -15260,23 +18423,23 @@ }; } - // (257:6) {#if Object.keys(value).length > 0} - function create_if_block_1$7(ctx) { + // (239:6) {#if Object.keys(value || {}).length > 0} + function create_if_block$6(ctx) { let div1; let section1; let section0; let div0; let h1; - let t0_value = /*value*/ ctx[28].status + ""; + let t0_value = /*value*/ ctx[29].status + ""; let t0; let t1; - let t2_value = /*value*/ ctx[28].statusText + ""; + let t2_value = /*value*/ ctx[29].statusText + ""; let t2; let section1_class_value; let t3; - let show_if = Object.keys(/*value*/ ctx[28].headers).length > 0; + let show_if = Object.keys(/*value*/ ctx[29].headers).length > 0; let current; - let if_block = show_if && create_if_block_2$4(ctx); + let if_block = show_if && create_if_block_1$4(ctx); return { c() { @@ -15293,7 +18456,7 @@ attr(h1, "class", "title"); attr(div0, "class", "container has-text-centered"); attr(section0, "class", "hero-body hero-small svelte-c3oocm"); - attr(section1, "class", section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[28].status) + " svelte-c3oocm"); + attr(section1, "class", section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[29].status) + " svelte-c3oocm"); attr(div1, "class", "small-section svelte-c3oocm"); }, m(target, anchor) { @@ -15310,21 +18473,21 @@ current = true; }, p(ctx, dirty) { - if ((!current || dirty[0] & /*response*/ 64) && t0_value !== (t0_value = /*value*/ ctx[28].status + "")) set_data(t0, t0_value); - if ((!current || dirty[0] & /*response*/ 64) && t2_value !== (t2_value = /*value*/ ctx[28].statusText + "")) set_data(t2, t2_value); + if ((!current || dirty[0] & /*response*/ 256) && t0_value !== (t0_value = /*value*/ ctx[29].status + "")) set_data(t0, t0_value); + if ((!current || dirty[0] & /*response*/ 256) && t2_value !== (t2_value = /*value*/ ctx[29].statusText + "")) set_data(t2, t2_value); - if (!current || dirty[0] & /*response*/ 64 && section1_class_value !== (section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[28].status) + " svelte-c3oocm")) { + if (!current || dirty[0] & /*response*/ 256 && section1_class_value !== (section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[29].status) + " svelte-c3oocm")) { attr(section1, "class", section1_class_value); } - if (dirty[0] & /*response*/ 64) show_if = Object.keys(/*value*/ ctx[28].headers).length > 0; + if (dirty[0] & /*response*/ 256) show_if = Object.keys(/*value*/ ctx[29].headers).length > 0; if (show_if) { if (if_block) { if_block.p(ctx, dirty); transition_in(if_block, 1); } else { - if_block = create_if_block_2$4(ctx); + if_block = create_if_block_1$4(ctx); if_block.c(); transition_in(if_block, 1); if_block.m(div1, null); @@ -15355,23 +18518,23 @@ }; } - // (267:10) {#if Object.keys(value.headers).length > 0} - function create_if_block_2$4(ctx) { + // (249:10) {#if Object.keys(value.headers).length > 0} + function create_if_block_1$4(ctx) { let div1; let div0; let t; let current; - let each_value = Object.entries(/*value*/ ctx[28].headers); + let each_value = Object.entries(/*value*/ ctx[29].headers); let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i)); + each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); } const codeblock = new CodeBlock({ props: { - type: contentType(/*value*/ ctx[28].headers), - body: /*value*/ ctx[28].data + type: contentType(/*value*/ ctx[29].headers), + body: /*value*/ ctx[29].data } }); @@ -15402,17 +18565,17 @@ current = true; }, p(ctx, dirty) { - if (dirty[0] & /*response*/ 64) { - each_value = Object.entries(/*value*/ ctx[28].headers); + if (dirty[0] & /*response*/ 256) { + each_value = Object.entries(/*value*/ ctx[29].headers); let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$5(ctx, each_value, i); + const child_ctx = get_each_context$1(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$5(child_ctx); + each_blocks[i] = create_each_block$1(child_ctx); each_blocks[i].c(); each_blocks[i].m(div0, null); } @@ -15426,8 +18589,8 @@ } const codeblock_changes = {}; - if (dirty[0] & /*response*/ 64) codeblock_changes.type = contentType(/*value*/ ctx[28].headers); - if (dirty[0] & /*response*/ 64) codeblock_changes.body = /*value*/ ctx[28].data; + if (dirty[0] & /*response*/ 256) codeblock_changes.type = contentType(/*value*/ ctx[29].headers); + if (dirty[0] & /*response*/ 256) codeblock_changes.body = /*value*/ ctx[29].data; codeblock.$set(codeblock_changes); }, i(local) { @@ -15447,14 +18610,14 @@ }; } - // (270:16) {#each Object.entries(value.headers) as [key, val]} - function create_each_block$5(ctx) { + // (252:16) {#each Object.entries(value.headers) as [key, val]} + function create_each_block$1(ctx) { let p; let span; - let t0_value = /*key*/ ctx[29] + ""; + let t0_value = /*key*/ ctx[31] + ""; let t0; let t1; - let t2_value = /*val*/ ctx[30] + ""; + let t2_value = /*val*/ ctx[32] + ""; let t2; let t3; @@ -15478,8 +18641,8 @@ append(p, t3); }, p(ctx, dirty) { - if (dirty[0] & /*response*/ 64 && t0_value !== (t0_value = /*key*/ ctx[29] + "")) set_data(t0, t0_value); - if (dirty[0] & /*response*/ 64 && t2_value !== (t2_value = /*val*/ ctx[30] + "")) set_data(t2, t2_value); + if (dirty[0] & /*response*/ 256 && t0_value !== (t0_value = /*key*/ ctx[31] + "")) set_data(t0, t0_value); + if (dirty[0] & /*response*/ 256 && t2_value !== (t2_value = /*val*/ ctx[32] + "")) set_data(t2, t2_value); }, d(detaching) { if (detaching) detach(p); @@ -15487,7 +18650,7 @@ }; } - // (250:21)
{:then value} + // (232:21)
{:then value} function create_pending_block(ctx) { let div; @@ -15509,54 +18672,14 @@ }; } - // (287:4) {#if error} - function create_if_block$a(ctx) { - let div1; - let section1; - let section0; - let div0; - let p; - let t; - - return { - c() { - div1 = element("div"); - section1 = element("section"); - section0 = element("section"); - div0 = element("div"); - p = element("p"); - t = text(/*error*/ ctx[8]); - attr(p, "class", "subtitle"); - attr(div0, "class", "container"); - attr(section0, "class", "hero-body"); - attr(section1, "class", "hero is-danger"); - attr(div1, "class", "small-section svelte-c3oocm"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append(div1, section1); - append(section1, section0); - append(section0, div0); - append(div0, p); - append(p, t); - }, - p(ctx, dirty) { - if (dirty[0] & /*error*/ 256) set_data(t, /*error*/ ctx[8]); - }, - d(detaching) { - if (detaching) detach(div1); - } - }; - } - - // (127:2)
+ // (120:2)
function create_body_slot(ctx) { let div0; let div3; let div1; let t0; let div2; - let show_if_4; + let show_if_1; let current_block_type_index; let if_block1; let t1; @@ -15575,74 +18698,64 @@ let current_block_type_index_1; let if_block2; let t8; - let show_if_3 = isAuth(/*environment*/ ctx[10], "basic"); - let t9; - let show_if_2 = isAuth(/*environment*/ ctx[10], "apikey"); - let t10; - let show_if_1 = isAuth(/*environment*/ ctx[10], "oauth2"); - let t11; let div6; let current_block_type_index_2; - let if_block6; - let t12; + let if_block3; + let t9; let div7; let show_if; - let t13; + let t10; let promise; - let t14; let current; let dispose; function select_block_type(ctx, dirty) { - if (/*copying*/ ctx[9]) return create_if_block_11; + if (/*copying*/ ctx[10]) return create_if_block_7; return create_else_block_4; } - let current_block_type = select_block_type(ctx, -1); + let current_block_type = select_block_type(ctx, [-1]); let if_block0 = current_block_type(ctx); - const if_block_creators = [create_if_block_10, create_else_block_3]; + const if_block_creators = [create_if_block_6, create_else_block_3]; const if_blocks = []; function select_block_type_1(ctx, dirty) { - if (dirty[0] & /*environment, $auth, $env*/ 11264) show_if_4 = !!(isAuth(/*environment*/ ctx[10], "oauth2") && !/*$auth*/ ctx[13].includes(/*$env*/ ctx[11])); - if (show_if_4) return 0; + if (dirty[0] & /*environment, $auth, $env*/ 22528) show_if_1 = !!(isAuth(/*environment*/ ctx[11], "oauth2") && !/*$auth*/ ctx[14].split(";").includes(/*$env*/ ctx[12])); + if (show_if_1) return 0; return 1; } - current_block_type_index = select_block_type_1(ctx, -1); + current_block_type_index = select_block_type_1(ctx, [-1]); if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const if_block_creators_1 = [create_if_block_9, create_else_block_2]; + const if_block_creators_1 = [create_if_block_4, create_else_block_2]; const if_blocks_1 = []; function select_block_type_2(ctx, dirty) { - if (/*requestHeaders*/ ctx[0].length === 0 && !/*environment*/ ctx[10].auth) return 0; + if (/*requestHeaders*/ ctx[0].length === 0 && !/*environment*/ ctx[11].auth) return 0; return 1; } - current_block_type_index_1 = select_block_type_2(ctx, -1); + current_block_type_index_1 = select_block_type_2(ctx, [-1]); if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx); - let if_block3 = show_if_3 && create_if_block_8(ctx); - let if_block4 = show_if_2 && create_if_block_7(ctx); - let if_block5 = show_if_1 && create_if_block_5(ctx); - const if_block_creators_2 = [create_if_block_4, create_else_block_1$1]; + const if_block_creators_2 = [create_if_block_3, create_else_block_1]; const if_blocks_2 = []; function select_block_type_3(ctx, dirty) { - if (/*requestParameters*/ ctx[1].length === 0) return 0; + if (/*requestParameters*/ ctx[2].length === 0) return 0; return 1; } - current_block_type_index_2 = select_block_type_3(ctx, -1); - if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx); + current_block_type_index_2 = select_block_type_3(ctx, [-1]); + if_block3 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx); function select_block_type_4(ctx, dirty) { - if (show_if == null || dirty[0] & /*currentAction*/ 32) show_if = !!allowBody(/*currentAction*/ ctx[5]); - if (show_if) return create_if_block_3$2; + if (show_if == null || dirty[0] & /*currentAction*/ 64) show_if = !!allowBody(/*currentAction*/ ctx[6]); + if (show_if) return create_if_block_2$2; return create_else_block$3; } - let current_block_type_1 = select_block_type_4(ctx, -1); - let if_block7 = current_block_type_1(ctx); + let current_block_type_1 = select_block_type_4(ctx, [-1]); + let if_block4 = current_block_type_1(ctx); let info = { ctx, @@ -15651,12 +18764,12 @@ pending: create_pending_block, then: create_then_block, catch: create_catch_block, - value: 28, + value: 29, + error: 30, blocks: [,,,] }; - handle_promise(promise = /*response*/ ctx[6], info); - let if_block8 = /*error*/ ctx[8] && create_if_block$a(ctx); + handle_promise(promise = /*response*/ ctx[8], info); return { c() { @@ -15685,44 +18798,30 @@ div5 = element("div"); if_block2.c(); t8 = space(); - if (if_block3) if_block3.c(); - t9 = space(); - if (if_block4) if_block4.c(); - t10 = space(); - if (if_block5) if_block5.c(); - t11 = space(); div6 = element("div"); - if_block6.c(); - t12 = space(); + if_block3.c(); + t9 = space(); div7 = element("div"); - if_block7.c(); - t13 = space(); + if_block4.c(); + t10 = space(); info.block.c(); - t14 = space(); - if (if_block8) if_block8.c(); attr(div1, "class", "column"); attr(div2, "class", "column is-one-fifth"); attr(div3, "class", "columns"); attr(a0, "href", "javascript:void(0)"); - toggle_class(li0, "is-active", /*requestTab*/ ctx[7] === 0); + toggle_class(li0, "is-active", /*requestTab*/ ctx[9] === 0); attr(a1, "href", "javascript:void(0)"); - toggle_class(li1, "is-active", /*requestTab*/ ctx[7] === 1); + toggle_class(li1, "is-active", /*requestTab*/ ctx[9] === 1); attr(a2, "href", "javascript:void(0)"); - toggle_class(li2, "is-active", /*requestTab*/ ctx[7] === 2); + toggle_class(li2, "is-active", /*requestTab*/ ctx[9] === 2); attr(div4, "class", "tabs is-boxed"); attr(div5, "class", "section-headers"); - toggle_class(div5, "is-hidden", /*requestTab*/ ctx[7] != 0); + toggle_class(div5, "is-hidden", /*requestTab*/ ctx[9] != 0); attr(div6, "class", "section-parameters"); - toggle_class(div6, "is-hidden", /*requestTab*/ ctx[7] != 1); + toggle_class(div6, "is-hidden", /*requestTab*/ ctx[9] != 1); attr(div7, "class", "section-body"); - toggle_class(div7, "is-hidden", /*requestTab*/ ctx[7] != 2); + toggle_class(div7, "is-hidden", /*requestTab*/ ctx[9] != 2); attr(div0, "slot", "body"); - - dispose = [ - listen(a0, "click", /*click_handler*/ ctx[20]), - listen(a1, "click", /*click_handler_1*/ ctx[21]), - listen(a2, "click", /*click_handler_2*/ ctx[22]) - ]; }, m(target, anchor) { insert(target, div0, anchor); @@ -15746,25 +18845,23 @@ append(div0, t7); append(div0, div5); if_blocks_1[current_block_type_index_1].m(div5, null); - append(div5, t8); - if (if_block3) if_block3.m(div5, null); - append(div5, t9); - if (if_block4) if_block4.m(div5, null); - append(div5, t10); - if (if_block5) if_block5.m(div5, null); - append(div0, t11); + append(div0, t8); append(div0, div6); if_blocks_2[current_block_type_index_2].m(div6, null); - append(div0, t12); + append(div0, t9); append(div0, div7); - if_block7.m(div7, null); - append(div0, t13); + if_block4.m(div7, null); + append(div0, t10); info.block.m(div0, info.anchor = null); info.mount = () => div0; - info.anchor = t14; - append(div0, t14); - if (if_block8) if_block8.m(div0, null); + info.anchor = null; current = true; + + dispose = [ + listen(a0, "click", /*click_handler*/ ctx[20]), + listen(a1, "click", /*click_handler_1*/ ctx[21]), + listen(a2, "click", /*click_handler_2*/ ctx[22]) + ]; }, p(new_ctx, dirty) { ctx = new_ctx; @@ -15805,16 +18902,16 @@ if_block1.m(div2, null); } - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(li0, "is-active", /*requestTab*/ ctx[7] === 0); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(li0, "is-active", /*requestTab*/ ctx[9] === 0); } - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(li1, "is-active", /*requestTab*/ ctx[7] === 1); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(li1, "is-active", /*requestTab*/ ctx[9] === 1); } - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(li2, "is-active", /*requestTab*/ ctx[7] === 2); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(li2, "is-active", /*requestTab*/ ctx[9] === 2); } let previous_block_index_1 = current_block_type_index_1; @@ -15838,77 +18935,11 @@ } transition_in(if_block2, 1); - if_block2.m(div5, t8); + if_block2.m(div5, null); } - if (dirty[0] & /*environment*/ 1024) show_if_3 = isAuth(/*environment*/ ctx[10], "basic"); - - if (show_if_3) { - if (if_block3) { - if_block3.p(ctx, dirty); - transition_in(if_block3, 1); - } else { - if_block3 = create_if_block_8(ctx); - if_block3.c(); - transition_in(if_block3, 1); - if_block3.m(div5, t9); - } - } else if (if_block3) { - group_outros(); - - transition_out(if_block3, 1, 1, () => { - if_block3 = null; - }); - - check_outros(); - } - - if (dirty[0] & /*environment*/ 1024) show_if_2 = isAuth(/*environment*/ ctx[10], "apikey"); - - if (show_if_2) { - if (if_block4) { - if_block4.p(ctx, dirty); - transition_in(if_block4, 1); - } else { - if_block4 = create_if_block_7(ctx); - if_block4.c(); - transition_in(if_block4, 1); - if_block4.m(div5, t10); - } - } else if (if_block4) { - group_outros(); - - transition_out(if_block4, 1, 1, () => { - if_block4 = null; - }); - - check_outros(); - } - - if (dirty[0] & /*environment*/ 1024) show_if_1 = isAuth(/*environment*/ ctx[10], "oauth2"); - - if (show_if_1) { - if (if_block5) { - if_block5.p(ctx, dirty); - transition_in(if_block5, 1); - } else { - if_block5 = create_if_block_5(ctx); - if_block5.c(); - transition_in(if_block5, 1); - if_block5.m(div5, null); - } - } else if (if_block5) { - group_outros(); - - transition_out(if_block5, 1, 1, () => { - if_block5 = null; - }); - - check_outros(); - } - - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(div5, "is-hidden", /*requestTab*/ ctx[7] != 0); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(div5, "is-hidden", /*requestTab*/ ctx[9] != 0); } let previous_block_index_2 = current_block_type_index_2; @@ -15924,68 +18955,52 @@ }); check_outros(); - if_block6 = if_blocks_2[current_block_type_index_2]; + if_block3 = if_blocks_2[current_block_type_index_2]; - if (!if_block6) { - if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx); - if_block6.c(); + if (!if_block3) { + if_block3 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx); + if_block3.c(); } - transition_in(if_block6, 1); - if_block6.m(div6, null); + transition_in(if_block3, 1); + if_block3.m(div6, null); } - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(div6, "is-hidden", /*requestTab*/ ctx[7] != 1); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(div6, "is-hidden", /*requestTab*/ ctx[9] != 1); } - if (current_block_type_1 === (current_block_type_1 = select_block_type_4(ctx, dirty)) && if_block7) { - if_block7.p(ctx, dirty); + if (current_block_type_1 === (current_block_type_1 = select_block_type_4(ctx, dirty)) && if_block4) { + if_block4.p(ctx, dirty); } else { - if_block7.d(1); - if_block7 = current_block_type_1(ctx); + if_block4.d(1); + if_block4 = current_block_type_1(ctx); - if (if_block7) { - if_block7.c(); - if_block7.m(div7, null); + if (if_block4) { + if_block4.c(); + if_block4.m(div7, null); } } - if (dirty[0] & /*requestTab*/ 128) { - toggle_class(div7, "is-hidden", /*requestTab*/ ctx[7] != 2); + if (dirty[0] & /*requestTab*/ 512) { + toggle_class(div7, "is-hidden", /*requestTab*/ ctx[9] != 2); } info.ctx = ctx; - if (dirty[0] & /*response*/ 64 && promise !== (promise = /*response*/ ctx[6]) && handle_promise(promise, info)) { + if (dirty[0] & /*response*/ 256 && promise !== (promise = /*response*/ ctx[8]) && handle_promise(promise, info)) { } else { const child_ctx = ctx.slice(); - child_ctx[28] = info.resolved; + child_ctx[29] = info.resolved; info.block.p(child_ctx, dirty); } - - if (/*error*/ ctx[8]) { - if (if_block8) { - if_block8.p(ctx, dirty); - } else { - if_block8 = create_if_block$a(ctx); - if_block8.c(); - if_block8.m(div0, null); - } - } else if (if_block8) { - if_block8.d(1); - if_block8 = null; - } }, i(local) { if (current) return; transition_in(if_block1); transition_in(if_block2); transition_in(if_block3); - transition_in(if_block4); - transition_in(if_block5); - transition_in(if_block6); transition_in(info.block); current = true; }, @@ -15993,9 +19008,6 @@ transition_out(if_block1); transition_out(if_block2); transition_out(if_block3); - transition_out(if_block4); - transition_out(if_block5); - transition_out(if_block6); for (let i = 0; i < 3; i += 1) { const block = info.blocks[i]; @@ -16009,21 +19021,17 @@ if_block0.d(); if_blocks[current_block_type_index].d(); if_blocks_1[current_block_type_index_1].d(); - if (if_block3) if_block3.d(); - if (if_block4) if_block4.d(); - if (if_block5) if_block5.d(); if_blocks_2[current_block_type_index_2].d(); - if_block7.d(); + if_block4.d(); info.block.d(); info.token = null; info = null; - if (if_block8) if_block8.d(); run_all(dispose); } }; } - // (125:0) + // (118:0) function create_default_slot(ctx) { let t; let current; @@ -16044,14 +19052,14 @@ }; } - function create_fragment$g(ctx) { + function create_fragment$c(ctx) { let current; const collapsiblepanel = new CollapsiblePanel({ props: { dark: true, - isDarkmode: /*isDarkmode*/ ctx[4], - show: /*show*/ ctx[3], + isDarkmode: /*isDarkmode*/ ctx[5], + show: /*show*/ ctx[4], $$slots: { default: [create_default_slot], body: [create_body_slot], @@ -16071,10 +19079,10 @@ }, p(ctx, dirty) { const collapsiblepanel_changes = {}; - if (dirty[0] & /*isDarkmode*/ 16) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[4]; - if (dirty[0] & /*show*/ 8) collapsiblepanel_changes.show = /*show*/ ctx[3]; + if (dirty[0] & /*isDarkmode*/ 32) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[5]; + if (dirty[0] & /*show*/ 16) collapsiblepanel_changes.show = /*show*/ ctx[4]; - if (dirty[0] & /*error, response, requestTab, currentAction, requestBody, requestParameters, environment, $auth, $env, $token, requestHeaders, copying, currentUrl*/ 32743 | dirty[1] & /*$$scope*/ 256) { + if (dirty[0] & /*response, requestTab, requestBody, currentAction, requestParameters, requestHeaders, environment, requestAuthHeader, pkceChallenge, $auth, $env, copying, currentUrl*/ 32719 | dirty[1] & /*$$scope*/ 1024) { collapsiblepanel_changes.$$scope = { dirty, ctx }; } @@ -16099,58 +19107,48 @@ return headers && headers["content-type"]; } - function basicAuth(username, password) { + function basicAuth$1(username, password) { return btoa(`${username}:${password}`); } - function instance$g($$self, $$props, $$invalidate) { + function instance$c($$self, $$props, $$invalidate) { let $env; + let $router; let $auth; - let $token; - component_subscribe($$self, env, $$value => $$invalidate(11, $env = $$value)); - component_subscribe($$self, auth, $$value => $$invalidate(13, $auth = $$value)); - component_subscribe($$self, token, $$value => $$invalidate(14, $token = $$value)); + component_subscribe($$self, env, $$value => $$invalidate(12, $env = $$value)); + component_subscribe($$self, router, $$value => $$invalidate(19, $router = $$value)); + component_subscribe($$self, auth, $$value => $$invalidate(14, $auth = $$value)); let { show = true } = $$props; let { isDarkmode } = $$props; let { environments } = $$props; let { currentAction } = $$props; - let { currentSample } = $$props; let { requestHeaders } = $$props; + let { requestAuthHeader } = $$props; let { requestParameters } = $$props; let { requestBody } = $$props; - let response = {}; + let { pkceChallenge } = $$props; + let response; let requestTab = 0; - let error; let copying = false; - afterUpdate(() => { - $$invalidate(6, response = {}); - }); - function handleClick() { - $$invalidate(8, error = undefined); - - $$invalidate(6, response = sendRequest($env, environment, currentAction, { - headers: requestHeaders, + $$invalidate(8, response = sendRequest($env, environment, currentAction, { + headers: requestHeaders.concat(requestAuthHeader), parameters: requestParameters, body: requestBody - }).catch(function (err) { - $$invalidate(8, error = err); - return Promise.reject(err); })); } function handleTab(index) { - $$invalidate(8, error = undefined); - $$invalidate(7, requestTab = index); + $$invalidate(9, requestTab = index); } function handleCopy() { - $$invalidate(9, copying = true); + $$invalidate(10, copying = true); setTimeout( () => { - $$invalidate(9, copying = false); + $$invalidate(10, copying = false); }, 2000 ); @@ -16167,84 +19165,89 @@ $$invalidate(0, requestHeaders); } - function fieldswitch_value_binding(value_1, header) { - header.value = value_1; + function fieldswitch_value_binding(value, header) { + header.value = value; $$invalidate(0, requestHeaders); } + function fieldswitch_value_binding_1(value) { + requestAuthHeader.value = value; + $$invalidate(1, requestAuthHeader); + } + function fieldswitch_used_binding_1(value, param) { param.used = value; - $$invalidate(1, requestParameters); + $$invalidate(2, requestParameters); } - function fieldswitch_value_binding_1(value_1, param) { - param.value = value_1; - $$invalidate(1, requestParameters); + function fieldswitch_value_binding_2(value, param) { + param.value = value; + $$invalidate(2, requestParameters); } function textarea_input_handler() { requestBody = this.value; - $$invalidate(2, requestBody); + $$invalidate(3, requestBody); } $$self.$set = $$props => { - if ("show" in $$props) $$invalidate(3, show = $$props.show); - if ("isDarkmode" in $$props) $$invalidate(4, isDarkmode = $$props.isDarkmode); + if ("show" in $$props) $$invalidate(4, show = $$props.show); + if ("isDarkmode" in $$props) $$invalidate(5, isDarkmode = $$props.isDarkmode); if ("environments" in $$props) $$invalidate(18, environments = $$props.environments); - if ("currentAction" in $$props) $$invalidate(5, currentAction = $$props.currentAction); - if ("currentSample" in $$props) $$invalidate(19, currentSample = $$props.currentSample); + if ("currentAction" in $$props) $$invalidate(6, currentAction = $$props.currentAction); if ("requestHeaders" in $$props) $$invalidate(0, requestHeaders = $$props.requestHeaders); - if ("requestParameters" in $$props) $$invalidate(1, requestParameters = $$props.requestParameters); - if ("requestBody" in $$props) $$invalidate(2, requestBody = $$props.requestBody); + if ("requestAuthHeader" in $$props) $$invalidate(1, requestAuthHeader = $$props.requestAuthHeader); + if ("requestParameters" in $$props) $$invalidate(2, requestParameters = $$props.requestParameters); + if ("requestBody" in $$props) $$invalidate(3, requestBody = $$props.requestBody); + if ("pkceChallenge" in $$props) $$invalidate(7, pkceChallenge = $$props.pkceChallenge); }; let environment; let currentUrl; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*environments, $env*/ 264192) { - $$invalidate(10, environment = environments[$env]); + if ($$self.$$.dirty[0] & /*environments, $env*/ 266240) { + $$invalidate(11, environment = environments[$env]); } - if ($$self.$$.dirty[0] & /*environment, currentAction*/ 1056) { - $$invalidate(12, currentUrl = urlParse(urlJoin(environment.url, currentAction.path))); + if ($$self.$$.dirty[0] & /*environment, currentAction*/ 2112) { + $$invalidate(13, currentUrl = urlParse(urlJoin(environment.url, currentAction.path))); } - if ($$self.$$.dirty[0] & /*currentUrl*/ 4096) { - { - $$invalidate(8, error = currentUrl && undefined); - } + if ($$self.$$.dirty[0] & /*$router*/ 524288) { + $$invalidate(8, response = $router && undefined); } }; return [ requestHeaders, + requestAuthHeader, requestParameters, requestBody, show, isDarkmode, currentAction, + pkceChallenge, response, requestTab, - error, copying, environment, $env, currentUrl, $auth, - $token, handleClick, handleTab, handleCopy, environments, - currentSample, + $router, click_handler, click_handler_1, click_handler_2, fieldswitch_used_binding, fieldswitch_value_binding, - fieldswitch_used_binding_1, fieldswitch_value_binding_1, + fieldswitch_used_binding_1, + fieldswitch_value_binding_2, textarea_input_handler ]; } @@ -16252,37 +19255,1043 @@ class PlaygroundPanel extends SvelteComponent { constructor(options) { super(); - if (!document.getElementById("svelte-c3oocm-style")) add_css$8(); + if (!document.getElementById("svelte-c3oocm-style")) add_css$6(); init( this, options, - instance$g, - create_fragment$g, + instance$c, + create_fragment$c, safe_not_equal, { - show: 3, - isDarkmode: 4, + show: 4, + isDarkmode: 5, environments: 18, - currentAction: 5, - currentSample: 19, + currentAction: 6, requestHeaders: 0, - requestParameters: 1, - requestBody: 2 + requestAuthHeader: 1, + requestParameters: 2, + requestBody: 3, + pkceChallenge: 7 }, [-1, -1] ); } } - /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ScenarioPanel.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/tables/HeaderTable.svelte generated by Svelte v3.19.2 */ + + function get_each_context$2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[1] = list[i].name; + child_ctx[2] = list[i].example; + return child_ctx; + } + + // (5:0) {#if headers.length > 0} + function create_if_block$7(ctx) { + let table; + let thead; + let t1; + let tbody; + let each_value = /*headers*/ ctx[0]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); + } + + return { + c() { + table = element("table"); + thead = element("thead"); + thead.innerHTML = `Headers`; + t1 = space(); + tbody = element("tbody"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(table, "class", "table is-stripped is-fullwidth"); + }, + m(target, anchor) { + insert(target, table, anchor); + append(table, thead); + append(table, t1); + append(table, tbody); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(tbody, null); + } + }, + p(ctx, dirty) { + if (dirty & /*headers*/ 1) { + each_value = /*headers*/ ctx[0]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$2(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$2(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(tbody, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + d(detaching) { + if (detaching) detach(table); + destroy_each(each_blocks, detaching); + } + }; + } + + // (13:6) {#each headers as { name, example }} + function create_each_block$2(ctx) { + let tr; + let td0; + let t0_value = /*name*/ ctx[1] + ""; + let t0; + let t1; + let td1; + let code; + let t2_value = /*example*/ ctx[2] + ""; + let t2; + let t3; + + return { + c() { + tr = element("tr"); + td0 = element("td"); + t0 = text(t0_value); + t1 = space(); + td1 = element("td"); + code = element("code"); + t2 = text(t2_value); + t3 = space(); + }, + m(target, anchor) { + insert(target, tr, anchor); + append(tr, td0); + append(td0, t0); + append(tr, t1); + append(tr, td1); + append(td1, code); + append(code, t2); + append(tr, t3); + }, + p(ctx, dirty) { + if (dirty & /*headers*/ 1 && t0_value !== (t0_value = /*name*/ ctx[1] + "")) set_data(t0, t0_value); + if (dirty & /*headers*/ 1 && t2_value !== (t2_value = /*example*/ ctx[2] + "")) set_data(t2, t2_value); + }, + d(detaching) { + if (detaching) detach(tr); + } + }; + } + + function create_fragment$d(ctx) { + let if_block_anchor; + let if_block = /*headers*/ ctx[0].length > 0 && create_if_block$7(ctx); + + return { + c() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx, [dirty]) { + if (/*headers*/ ctx[0].length > 0) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$7(ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + i: noop, + o: noop, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + function instance$d($$self, $$props, $$invalidate) { + let { headers = [] } = $$props; + + $$self.$set = $$props => { + if ("headers" in $$props) $$invalidate(0, headers = $$props.headers); + }; + + return [headers]; + } + + class HeaderTable extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$d, create_fragment$d, safe_not_equal, { headers: 0 }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CodePanel.svelte generated by Svelte v3.19.2 */ + + function add_css$7() { + var style = element("style"); + style.id = "svelte-15v28ah-style"; + style.textContent = ".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}"; + append(document.head, style); + } + + // (32:0) {#if example || schema} + function create_if_block$8(ctx) { + let div2; + let div0; + let ul; + let li; + let a; + let t1; + let t2; + let div1; + let section; + let section_class_value; + let t3; + let current; + let dispose; + let if_block0 = /*schema*/ ctx[2] && create_if_block_2$3(ctx); + + const codeblock = new CodeBlock({ + props: { + type: /*contentType*/ ctx[0], + body: /*example*/ ctx[1] + } + }); + + let if_block1 = /*schema*/ ctx[2] && create_if_block_1$5(ctx); + + return { + c() { + div2 = element("div"); + div0 = element("div"); + ul = element("ul"); + li = element("li"); + a = element("a"); + a.textContent = "Body"; + t1 = space(); + if (if_block0) if_block0.c(); + t2 = space(); + div1 = element("div"); + section = element("section"); + create_component(codeblock.$$.fragment); + t3 = space(); + if (if_block1) if_block1.c(); + attr(a, "data-index", "0"); + attr(a, "href", "javascript:void(0)"); + toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 0); + attr(div0, "class", "tabs is-fullwidth"); + toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]); + attr(section, "class", section_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah"); + attr(div2, "class", "tabs-with-content"); + }, + m(target, anchor) { + insert(target, div2, anchor); + append(div2, div0); + append(div0, ul); + append(ul, li); + append(li, a); + append(ul, t1); + if (if_block0) if_block0.m(ul, null); + append(div2, t2); + append(div2, div1); + append(div1, section); + mount_component(codeblock, section, null); + append(div1, t3); + if (if_block1) if_block1.m(div1, null); + current = true; + dispose = listen(a, "click", /*tabSelect*/ ctx[4]); + }, + p(ctx, dirty) { + if (dirty & /*tabIndex*/ 128) { + toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 0); + } + + if (/*schema*/ ctx[2]) { + if (if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0 = create_if_block_2$3(ctx); + if_block0.c(); + if_block0.m(ul, null); + } + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + + if (dirty & /*asToggle*/ 8) { + toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]); + } + + const codeblock_changes = {}; + if (dirty & /*contentType*/ 1) codeblock_changes.type = /*contentType*/ ctx[0]; + if (dirty & /*example*/ 2) codeblock_changes.body = /*example*/ ctx[1]; + codeblock.$set(codeblock_changes); + + if (!current || dirty & /*activeBody*/ 32 && section_class_value !== (section_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah")) { + attr(section, "class", section_class_value); + } + + if (/*schema*/ ctx[2]) { + if (if_block1) { + if_block1.p(ctx, dirty); + transition_in(if_block1, 1); + } else { + if_block1 = create_if_block_1$5(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(div1, null); + } + } else if (if_block1) { + group_outros(); + + transition_out(if_block1, 1, 1, () => { + if_block1 = null; + }); + + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(codeblock.$$.fragment, local); + transition_in(if_block1); + current = true; + }, + o(local) { + transition_out(codeblock.$$.fragment, local); + transition_out(if_block1); + current = false; + }, + d(detaching) { + if (detaching) detach(div2); + if (if_block0) if_block0.d(); + destroy_component(codeblock); + if (if_block1) if_block1.d(); + dispose(); + } + }; + } + + // (42:8) {#if schema} + function create_if_block_2$3(ctx) { + let li; + let a; + let dispose; + + return { + c() { + li = element("li"); + a = element("a"); + a.textContent = "Schema"; + attr(a, "data-index", "1"); + attr(a, "href", "javascript:void(0)"); + toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 1); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, a); + dispose = listen(a, "click", /*tabSelect*/ ctx[4]); + }, + p(ctx, dirty) { + if (dirty & /*tabIndex*/ 128) { + toggle_class(li, "is-active", /*tabIndex*/ ctx[7] === 1); + } + }, + d(detaching) { + if (detaching) detach(li); + dispose(); + } + }; + } + + // (55:6) {#if schema} + function create_if_block_1$5(ctx) { + let section; + let section_class_value; + let current; + + const codeblock = new CodeBlock({ + props: { + type: "application/json", + body: /*schema*/ ctx[2] + } + }); + + return { + c() { + section = element("section"); + create_component(codeblock.$$.fragment); + attr(section, "class", section_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah"); + }, + m(target, anchor) { + insert(target, section, anchor); + mount_component(codeblock, section, null); + current = true; + }, + p(ctx, dirty) { + const codeblock_changes = {}; + if (dirty & /*schema*/ 4) codeblock_changes.body = /*schema*/ ctx[2]; + codeblock.$set(codeblock_changes); + + if (!current || dirty & /*activeSchema*/ 64 && section_class_value !== (section_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah")) { + attr(section, "class", section_class_value); + } + }, + i(local) { + if (current) return; + transition_in(codeblock.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(codeblock.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(section); + destroy_component(codeblock); + } + }; + } + + function create_fragment$e(ctx) { + let if_block_anchor; + let current; + let if_block = (/*example*/ ctx[1] || /*schema*/ ctx[2]) && create_if_block$8(ctx); + + return { + c() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + if (/*example*/ ctx[1] || /*schema*/ ctx[2]) { + if (if_block) { + if_block.p(ctx, dirty); + transition_in(if_block, 1); + } else { + if_block = create_if_block$8(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + group_outros(); + + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + function instance$e($$self, $$props, $$invalidate) { + let { contentType } = $$props; + let { example } = $$props; + let { schema } = $$props; + let { asToggle } = $$props; + let activeBody = "is-active"; + let activeSchema = ""; + let tabIndex = 0; + + const tabSelect = event => { + const index = event.target.dataset["index"]; + $$invalidate(7, tabIndex = parseInt(index, 10)); + }; + + $$self.$set = $$props => { + if ("contentType" in $$props) $$invalidate(0, contentType = $$props.contentType); + if ("example" in $$props) $$invalidate(1, example = $$props.example); + if ("schema" in $$props) $$invalidate(2, schema = $$props.schema); + if ("asToggle" in $$props) $$invalidate(3, asToggle = $$props.asToggle); + }; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*tabIndex*/ 128) { + $$invalidate(5, activeBody = tabIndex === 0 ? "is-active" : ""); + } + + if ($$self.$$.dirty & /*tabIndex*/ 128) { + $$invalidate(6, activeSchema = tabIndex === 1 ? "is-active" : ""); + } + }; + + return [ + contentType, + example, + schema, + asToggle, + tabSelect, + activeBody, + activeSchema, + tabIndex + ]; + } + + class CodePanel extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-15v28ah-style")) add_css$7(); + + init(this, options, instance$e, create_fragment$e, safe_not_equal, { + contentType: 0, + example: 1, + schema: 2, + asToggle: 3, + tabSelect: 4 + }); + } + + get tabSelect() { + return this.$$.ctx[4]; + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/RequestPanel.svelte generated by Svelte v3.19.2 */ + + function create_if_block_1$6(ctx) { + let div; + let raw_value = markdown(/*description*/ ctx[0]) + ""; + + return { + c() { + div = element("div"); + attr(div, "class", "content"); + }, + m(target, anchor) { + insert(target, div, anchor); + div.innerHTML = raw_value; + }, + p(ctx, dirty) { + if (dirty & /*description*/ 1 && raw_value !== (raw_value = markdown(/*description*/ ctx[0]) + "")) div.innerHTML = raw_value;; + }, + d(detaching) { + if (detaching) detach(div); + } + }; + } + + // (26:0) {#if showRequest} + function create_if_block$9(ctx) { + let hr; + + return { + c() { + hr = element("hr"); + }, + m(target, anchor) { + insert(target, hr, anchor); + }, + d(detaching) { + if (detaching) detach(hr); + } + }; + } + + function create_fragment$f(ctx) { + let t0; + let t1; + let t2; + let if_block1_anchor; + let current; + let if_block0 = /*description*/ ctx[0] && create_if_block_1$6(ctx); + const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[1] } }); + + const codepanel = new CodePanel({ + props: { + contentType: /*contentType*/ ctx[2], + example: /*example*/ ctx[3], + schema: /*schema*/ ctx[4], + asToggle: true + } + }); + + let if_block1 = /*showRequest*/ ctx[5] && create_if_block$9(ctx); + + return { + c() { + if (if_block0) if_block0.c(); + t0 = space(); + create_component(headertable.$$.fragment); + t1 = space(); + create_component(codepanel.$$.fragment); + t2 = space(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); + }, + m(target, anchor) { + if (if_block0) if_block0.m(target, anchor); + insert(target, t0, anchor); + mount_component(headertable, target, anchor); + insert(target, t1, anchor); + mount_component(codepanel, target, anchor); + insert(target, t2, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); + current = true; + }, + p(ctx, [dirty]) { + if (/*description*/ ctx[0]) { + if (if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0 = create_if_block_1$6(ctx); + if_block0.c(); + if_block0.m(t0.parentNode, t0); + } + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + + const headertable_changes = {}; + if (dirty & /*headers*/ 2) headertable_changes.headers = /*headers*/ ctx[1]; + headertable.$set(headertable_changes); + const codepanel_changes = {}; + if (dirty & /*contentType*/ 4) codepanel_changes.contentType = /*contentType*/ ctx[2]; + if (dirty & /*example*/ 8) codepanel_changes.example = /*example*/ ctx[3]; + if (dirty & /*schema*/ 16) codepanel_changes.schema = /*schema*/ ctx[4]; + codepanel.$set(codepanel_changes); + + if (/*showRequest*/ ctx[5]) { + if (!if_block1) { + if_block1 = create_if_block$9(ctx); + if_block1.c(); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } else { + + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + }, + i(local) { + if (current) return; + transition_in(headertable.$$.fragment, local); + transition_in(codepanel.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(headertable.$$.fragment, local); + transition_out(codepanel.$$.fragment, local); + current = false; + }, + d(detaching) { + if (if_block0) if_block0.d(detaching); + if (detaching) detach(t0); + destroy_component(headertable, detaching); + if (detaching) detach(t1); + destroy_component(codepanel, detaching); + if (detaching) detach(t2); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); + } + }; + } + + function instance$f($$self, $$props, $$invalidate) { + let { description } = $$props; + let { headers } = $$props; + let { contentType } = $$props; + let { example } = $$props; + let { schema } = $$props; + + $$self.$set = $$props => { + if ("description" in $$props) $$invalidate(0, description = $$props.description); + if ("headers" in $$props) $$invalidate(1, headers = $$props.headers); + if ("contentType" in $$props) $$invalidate(2, contentType = $$props.contentType); + if ("example" in $$props) $$invalidate(3, example = $$props.example); + if ("schema" in $$props) $$invalidate(4, schema = $$props.schema); + }; + + let showRequest; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*description, headers, example*/ 11) { + $$invalidate(5, showRequest = !!(description || headers.length !== 0 || example)); + } + }; + + return [description, headers, contentType, example, schema, showRequest]; + } + + class RequestPanel extends SvelteComponent { + constructor(options) { + super(); + + init(this, options, instance$f, create_fragment$f, safe_not_equal, { + description: 0, + headers: 1, + contentType: 2, + example: 3, + schema: 4 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ResponsePanel.svelte generated by Svelte v3.19.2 */ function create_else_block$4(ctx) { + let t_value = (/*contentType*/ ctx[4] || "Response") + ""; + let t; + + return { + c() { + t = text(t_value); + }, + m(target, anchor) { + insert(target, t, anchor); + }, + p(ctx, dirty) { + if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "Response") + "")) set_data(t, t_value); + }, + d(detaching) { + if (detaching) detach(t); + } + }; + } + + // (19:6) {#if title} + function create_if_block_2$4(ctx) { + let t0; + let t1; + + return { + c() { + t0 = text("Response "); + t1 = text(/*title*/ ctx[0]); + }, + m(target, anchor) { + insert(target, t0, anchor); + insert(target, t1, anchor); + }, + p(ctx, dirty) { + if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]); + }, + d(detaching) { + if (detaching) detach(t0); + if (detaching) detach(t1); + } + }; + } + + // (23:6) {#if title !== ''} + function create_if_block_1$7(ctx) { + let span; + let t_value = (/*contentType*/ ctx[4] || "") + ""; + let t; + + return { + c() { + span = element("span"); + t = text(t_value); + attr(span, "class", "tag is-medium is-white"); + }, + m(target, anchor) { + insert(target, span, anchor); + append(span, t); + }, + p(ctx, dirty) { + if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "") + "")) set_data(t, t_value); + }, + d(detaching) { + if (detaching) detach(span); + } + }; + } + + // (30:4) {#if description} + function create_if_block$a(ctx) { + let div; + let raw_value = markdown(/*description*/ ctx[1]) + ""; + + return { + c() { + div = element("div"); + attr(div, "class", "content"); + }, + m(target, anchor) { + insert(target, div, anchor); + div.innerHTML = raw_value; + }, + p(ctx, dirty) { + if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;; + }, + d(detaching) { + if (detaching) detach(div); + } + }; + } + + function create_fragment$g(ctx) { + let div1; + let header; + let p; + let t0; + let a; + let t1; + let code; + let t2; + let code_class_value; + let t3; + let div0; + let t4; + let t5; + let current; + + function select_block_type(ctx, dirty) { + if (/*title*/ ctx[0]) return create_if_block_2$4; + return create_else_block$4; + } + + let current_block_type = select_block_type(ctx, -1); + let if_block0 = current_block_type(ctx); + let if_block1 = /*title*/ ctx[0] !== "" && create_if_block_1$7(ctx); + let if_block2 = /*description*/ ctx[1] && create_if_block$a(ctx); + const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[2] } }); + + const codepanel = new CodePanel({ + props: { + contentType: /*contentType*/ ctx[4], + example: /*example*/ ctx[5], + schema: /*schema*/ ctx[6] + } + }); + + return { + c() { + div1 = element("div"); + header = element("header"); + p = element("p"); + if_block0.c(); + t0 = space(); + a = element("a"); + if (if_block1) if_block1.c(); + t1 = space(); + code = element("code"); + t2 = text(/*statusCode*/ ctx[3]); + t3 = space(); + div0 = element("div"); + if (if_block2) if_block2.c(); + t4 = space(); + create_component(headertable.$$.fragment); + t5 = space(); + create_component(codepanel.$$.fragment); + attr(p, "class", "card-header-title"); + attr(code, "class", code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3])); + attr(a, "href", "javascript:void(0)"); + attr(a, "class", "card-header-icon is-family-code"); + attr(header, "class", "card-header"); + attr(div0, "class", "card-content"); + attr(div1, "class", "card"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, header); + append(header, p); + if_block0.m(p, null); + append(header, t0); + append(header, a); + if (if_block1) if_block1.m(a, null); + append(a, t1); + append(a, code); + append(code, t2); + append(div1, t3); + append(div1, div0); + if (if_block2) if_block2.m(div0, null); + append(div0, t4); + mount_component(headertable, div0, null); + append(div0, t5); + mount_component(codepanel, div0, null); + current = true; + }, + p(ctx, [dirty]) { + if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0.d(1); + if_block0 = current_block_type(ctx); + + if (if_block0) { + if_block0.c(); + if_block0.m(p, null); + } + } + + if (/*title*/ ctx[0] !== "") { + if (if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1 = create_if_block_1$7(ctx); + if_block1.c(); + if_block1.m(a, t1); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + + if (!current || dirty & /*statusCode*/ 8) set_data(t2, /*statusCode*/ ctx[3]); + + if (!current || dirty & /*statusCode*/ 8 && code_class_value !== (code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]))) { + attr(code, "class", code_class_value); + } + + if (/*description*/ ctx[1]) { + if (if_block2) { + if_block2.p(ctx, dirty); + } else { + if_block2 = create_if_block$a(ctx); + if_block2.c(); + if_block2.m(div0, t4); + } + } else if (if_block2) { + if_block2.d(1); + if_block2 = null; + } + + const headertable_changes = {}; + if (dirty & /*headers*/ 4) headertable_changes.headers = /*headers*/ ctx[2]; + headertable.$set(headertable_changes); + const codepanel_changes = {}; + if (dirty & /*contentType*/ 16) codepanel_changes.contentType = /*contentType*/ ctx[4]; + if (dirty & /*example*/ 32) codepanel_changes.example = /*example*/ ctx[5]; + if (dirty & /*schema*/ 64) codepanel_changes.schema = /*schema*/ ctx[6]; + codepanel.$set(codepanel_changes); + }, + i(local) { + if (current) return; + transition_in(headertable.$$.fragment, local); + transition_in(codepanel.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(headertable.$$.fragment, local); + transition_out(codepanel.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(div1); + if_block0.d(); + if (if_block1) if_block1.d(); + if (if_block2) if_block2.d(); + destroy_component(headertable); + destroy_component(codepanel); + } + }; + } + + function instance$g($$self, $$props, $$invalidate) { + let { title } = $$props; + let { description } = $$props; + let { headers } = $$props; + let { statusCode } = $$props; + let { contentType } = $$props; + let { example } = $$props; + let { schema } = $$props; + + $$self.$set = $$props => { + if ("title" in $$props) $$invalidate(0, title = $$props.title); + if ("description" in $$props) $$invalidate(1, description = $$props.description); + if ("headers" in $$props) $$invalidate(2, headers = $$props.headers); + if ("statusCode" in $$props) $$invalidate(3, statusCode = $$props.statusCode); + if ("contentType" in $$props) $$invalidate(4, contentType = $$props.contentType); + if ("example" in $$props) $$invalidate(5, example = $$props.example); + if ("schema" in $$props) $$invalidate(6, schema = $$props.schema); + }; + + return [title, description, headers, statusCode, contentType, example, schema]; + } + + class ResponsePanel extends SvelteComponent { + constructor(options) { + super(); + + init(this, options, instance$g, create_fragment$g, safe_not_equal, { + title: 0, + description: 1, + headers: 2, + statusCode: 3, + contentType: 4, + example: 5, + schema: 6 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ScenarioPanel.svelte generated by Svelte v3.19.2 */ + + function get_each_context_1$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[7] = list[i]; + child_ctx[4] = i; + return child_ctx; + } + + function get_each_context$3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[7] = list[i]; + child_ctx[4] = i; + return child_ctx; + } + + // (50:0) {:else} + function create_else_block$5(ctx) { let current; const collapsiblepanel = new CollapsiblePanel({ props: { - isDarkmode: /*isDarkmode*/ ctx[4], + isDarkmode: /*isDarkmode*/ ctx[3], show: /*show*/ ctx[0], $$slots: { default: [create_default_slot$1], @@ -16303,10 +20312,10 @@ }, p(ctx, dirty) { const collapsiblepanel_changes = {}; - if (dirty & /*isDarkmode*/ 16) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[4]; + if (dirty & /*isDarkmode*/ 8) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[3]; if (dirty & /*show*/ 1) collapsiblepanel_changes.show = /*show*/ ctx[0]; - if (dirty & /*$$scope, response, request, index*/ 142) { + if (dirty & /*$$scope, responses, request, index*/ 1046) { collapsiblepanel_changes.$$scope = { dirty, ctx }; } @@ -16329,17 +20338,163 @@ // (30:0) {#if request.title === ''} function create_if_block$b(ctx) { + let t0; + let t1; + let div; + let current; + let if_block = /*show*/ ctx[0] && create_if_block_1$8(ctx); + let each_value = /*responses*/ ctx[2]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + + return { + c() { + if (if_block) if_block.c(); + t0 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t1 = space(); + div = element("div"); + attr(div, "class", "panel"); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, t0, anchor); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(target, anchor); + } + + insert(target, t1, anchor); + insert(target, div, anchor); + current = true; + }, + p(ctx, dirty) { + if (/*show*/ ctx[0]) { + if (if_block) { + if_block.p(ctx, dirty); + transition_in(if_block, 1); + } else { + if_block = create_if_block_1$8(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(t0.parentNode, t0); + } + } else if (if_block) { + group_outros(); + + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + + check_outros(); + } + + if (dirty & /*responses*/ 4) { + each_value = /*responses*/ ctx[2]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$3(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block$3(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(t1.parentNode, t1); + } + } + + group_outros(); + + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + transition_out(if_block); + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(t0); + destroy_each(each_blocks, detaching); + if (detaching) detach(t1); + if (detaching) detach(div); + } + }; + } + + // (52:4) + function create_heading_slot$1(ctx) { + let span; + let t_value = /*title*/ ctx[5](/*index*/ ctx[4]) + ""; + let t; + + return { + c() { + span = element("span"); + t = text(t_value); + attr(span, "slot", "heading"); + }, + m(target, anchor) { + insert(target, span, anchor); + append(span, t); + }, + p(ctx, dirty) { + if (dirty & /*index*/ 16 && t_value !== (t_value = /*title*/ ctx[5](/*index*/ ctx[4]) + "")) set_data(t, t_value); + }, + d(detaching) { + if (detaching) detach(span); + } + }; + } + + // (61:6) {#each responses as response, index} + function create_each_block_1$1(ctx) { let current; const responsepanel = new ResponsePanel({ props: { - title: /*response*/ ctx[3].title, - description: /*response*/ ctx[3].description, - statusCode: /*response*/ ctx[3].statusCode, - headers: /*response*/ ctx[3].headers, - contentType: /*response*/ ctx[3].contentType, - example: /*response*/ ctx[3].example, - schema: /*response*/ ctx[3].schema + title: /*response*/ ctx[7].title, + description: /*response*/ ctx[7].description, + statusCode: /*response*/ ctx[7].statusCode, + headers: /*response*/ ctx[7].headers, + contentType: /*response*/ ctx[7].contentType, + example: /*response*/ ctx[7].example, + schema: /*response*/ ctx[7].schema } }); @@ -16353,13 +20508,13 @@ }, p(ctx, dirty) { const responsepanel_changes = {}; - if (dirty & /*response*/ 8) responsepanel_changes.title = /*response*/ ctx[3].title; - if (dirty & /*response*/ 8) responsepanel_changes.description = /*response*/ ctx[3].description; - if (dirty & /*response*/ 8) responsepanel_changes.statusCode = /*response*/ ctx[3].statusCode; - if (dirty & /*response*/ 8) responsepanel_changes.headers = /*response*/ ctx[3].headers; - if (dirty & /*response*/ 8) responsepanel_changes.contentType = /*response*/ ctx[3].contentType; - if (dirty & /*response*/ 8) responsepanel_changes.example = /*response*/ ctx[3].example; - if (dirty & /*response*/ 8) responsepanel_changes.schema = /*response*/ ctx[3].schema; + if (dirty & /*responses*/ 4) responsepanel_changes.title = /*response*/ ctx[7].title; + if (dirty & /*responses*/ 4) responsepanel_changes.description = /*response*/ ctx[7].description; + if (dirty & /*responses*/ 4) responsepanel_changes.statusCode = /*response*/ ctx[7].statusCode; + if (dirty & /*responses*/ 4) responsepanel_changes.headers = /*response*/ ctx[7].headers; + if (dirty & /*responses*/ 4) responsepanel_changes.contentType = /*response*/ ctx[7].contentType; + if (dirty & /*responses*/ 4) responsepanel_changes.example = /*response*/ ctx[7].example; + if (dirty & /*responses*/ 4) responsepanel_changes.schema = /*response*/ ctx[7].schema; responsepanel.$set(responsepanel_changes); }, i(local) { @@ -16377,32 +20532,7 @@ }; } - // (41:4) - function create_heading_slot$1(ctx) { - let span; - let t_value = /*title*/ ctx[5](/*index*/ ctx[1]) + ""; - let t; - - return { - c() { - span = element("span"); - t = text(t_value); - attr(span, "slot", "heading"); - }, - m(target, anchor) { - insert(target, span, anchor); - append(span, t); - }, - p(ctx, dirty) { - if (dirty & /*index*/ 2 && t_value !== (t_value = /*title*/ ctx[5](/*index*/ ctx[1]) + "")) set_data(t, t_value); - }, - d(detaching) { - if (detaching) detach(span); - } - }; - } - - // (42:4)
+ // (53:4)
function create_body_slot$1(ctx) { let div; let t; @@ -16410,79 +20540,113 @@ const requestpanel = new RequestPanel({ props: { - description: /*request*/ ctx[2].description, - headers: /*request*/ ctx[2].headers, - contentType: /*request*/ ctx[2].contentType, - example: /*request*/ ctx[2].example, - schema: /*request*/ ctx[2].schema + description: /*request*/ ctx[1].description, + headers: /*request*/ ctx[1].headers, + contentType: /*request*/ ctx[1].contentType, + example: /*request*/ ctx[1].example, + schema: /*request*/ ctx[1].schema } }); - const responsepanel = new ResponsePanel({ - props: { - title: /*response*/ ctx[3].title, - description: /*response*/ ctx[3].description, - statusCode: /*response*/ ctx[3].statusCode, - headers: /*response*/ ctx[3].headers, - contentType: /*response*/ ctx[3].contentType, - example: /*response*/ ctx[3].example, - schema: /*response*/ ctx[3].schema - } - }); + let each_value_1 = /*responses*/ ctx[2]; + let each_blocks = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); return { c() { div = element("div"); create_component(requestpanel.$$.fragment); t = space(); - create_component(responsepanel.$$.fragment); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + attr(div, "slot", "body"); }, m(target, anchor) { insert(target, div, anchor); mount_component(requestpanel, div, null); append(div, t); - mount_component(responsepanel, div, null); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(div, null); + } + current = true; }, p(ctx, dirty) { const requestpanel_changes = {}; - if (dirty & /*request*/ 4) requestpanel_changes.description = /*request*/ ctx[2].description; - if (dirty & /*request*/ 4) requestpanel_changes.headers = /*request*/ ctx[2].headers; - if (dirty & /*request*/ 4) requestpanel_changes.contentType = /*request*/ ctx[2].contentType; - if (dirty & /*request*/ 4) requestpanel_changes.example = /*request*/ ctx[2].example; - if (dirty & /*request*/ 4) requestpanel_changes.schema = /*request*/ ctx[2].schema; + if (dirty & /*request*/ 2) requestpanel_changes.description = /*request*/ ctx[1].description; + if (dirty & /*request*/ 2) requestpanel_changes.headers = /*request*/ ctx[1].headers; + if (dirty & /*request*/ 2) requestpanel_changes.contentType = /*request*/ ctx[1].contentType; + if (dirty & /*request*/ 2) requestpanel_changes.example = /*request*/ ctx[1].example; + if (dirty & /*request*/ 2) requestpanel_changes.schema = /*request*/ ctx[1].schema; requestpanel.$set(requestpanel_changes); - const responsepanel_changes = {}; - if (dirty & /*response*/ 8) responsepanel_changes.title = /*response*/ ctx[3].title; - if (dirty & /*response*/ 8) responsepanel_changes.description = /*response*/ ctx[3].description; - if (dirty & /*response*/ 8) responsepanel_changes.statusCode = /*response*/ ctx[3].statusCode; - if (dirty & /*response*/ 8) responsepanel_changes.headers = /*response*/ ctx[3].headers; - if (dirty & /*response*/ 8) responsepanel_changes.contentType = /*response*/ ctx[3].contentType; - if (dirty & /*response*/ 8) responsepanel_changes.example = /*response*/ ctx[3].example; - if (dirty & /*response*/ 8) responsepanel_changes.schema = /*response*/ ctx[3].schema; - responsepanel.$set(responsepanel_changes); + + if (dirty & /*responses*/ 4) { + each_value_1 = /*responses*/ ctx[2]; + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1$1(ctx, each_value_1, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block_1$1(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(div, null); + } + } + + group_outros(); + + for (i = each_value_1.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } }, i(local) { if (current) return; transition_in(requestpanel.$$.fragment, local); - transition_in(responsepanel.$$.fragment, local); + + for (let i = 0; i < each_value_1.length; i += 1) { + transition_in(each_blocks[i]); + } + current = true; }, o(local) { transition_out(requestpanel.$$.fragment, local); - transition_out(responsepanel.$$.fragment, local); + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + current = false; }, d(detaching) { if (detaching) detach(div); destroy_component(requestpanel); - destroy_component(responsepanel); + destroy_each(each_blocks, detaching); } }; } - // (40:2) + // (51:2) function create_default_slot$1(ctx) { let t; let current; @@ -16503,16 +20667,112 @@ }; } + // (31:2) {#if show} + function create_if_block_1$8(ctx) { + let current; + + const requestpanel = new RequestPanel({ + props: { + description: /*request*/ ctx[1].description, + headers: /*request*/ ctx[1].headers, + contentType: /*request*/ ctx[1].contentType, + example: /*request*/ ctx[1].example, + schema: /*request*/ ctx[1].schema + } + }); + + return { + c() { + create_component(requestpanel.$$.fragment); + }, + m(target, anchor) { + mount_component(requestpanel, target, anchor); + current = true; + }, + p(ctx, dirty) { + const requestpanel_changes = {}; + if (dirty & /*request*/ 2) requestpanel_changes.description = /*request*/ ctx[1].description; + if (dirty & /*request*/ 2) requestpanel_changes.headers = /*request*/ ctx[1].headers; + if (dirty & /*request*/ 2) requestpanel_changes.contentType = /*request*/ ctx[1].contentType; + if (dirty & /*request*/ 2) requestpanel_changes.example = /*request*/ ctx[1].example; + if (dirty & /*request*/ 2) requestpanel_changes.schema = /*request*/ ctx[1].schema; + requestpanel.$set(requestpanel_changes); + }, + i(local) { + if (current) return; + transition_in(requestpanel.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(requestpanel.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(requestpanel, detaching); + } + }; + } + + // (39:2) {#each responses as response, index} + function create_each_block$3(ctx) { + let current; + + const responsepanel = new ResponsePanel({ + props: { + title: /*response*/ ctx[7].title, + description: /*response*/ ctx[7].description, + statusCode: /*response*/ ctx[7].statusCode, + headers: /*response*/ ctx[7].headers, + contentType: /*response*/ ctx[7].contentType, + example: /*response*/ ctx[7].example, + schema: /*response*/ ctx[7].schema + } + }); + + return { + c() { + create_component(responsepanel.$$.fragment); + }, + m(target, anchor) { + mount_component(responsepanel, target, anchor); + current = true; + }, + p(ctx, dirty) { + const responsepanel_changes = {}; + if (dirty & /*responses*/ 4) responsepanel_changes.title = /*response*/ ctx[7].title; + if (dirty & /*responses*/ 4) responsepanel_changes.description = /*response*/ ctx[7].description; + if (dirty & /*responses*/ 4) responsepanel_changes.statusCode = /*response*/ ctx[7].statusCode; + if (dirty & /*responses*/ 4) responsepanel_changes.headers = /*response*/ ctx[7].headers; + if (dirty & /*responses*/ 4) responsepanel_changes.contentType = /*response*/ ctx[7].contentType; + if (dirty & /*responses*/ 4) responsepanel_changes.example = /*response*/ ctx[7].example; + if (dirty & /*responses*/ 4) responsepanel_changes.schema = /*response*/ ctx[7].schema; + responsepanel.$set(responsepanel_changes); + }, + i(local) { + if (current) return; + transition_in(responsepanel.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(responsepanel.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(responsepanel, detaching); + } + }; + } + function create_fragment$h(ctx) { let current_block_type_index; let if_block; let if_block_anchor; let current; - const if_block_creators = [create_if_block$b, create_else_block$4]; + const if_block_creators = [create_if_block$b, create_else_block$5]; const if_blocks = []; function select_block_type(ctx, dirty) { - if (/*request*/ ctx[2].title === "") return 0; + if (/*request*/ ctx[1].title === "") return 0; return 1; } @@ -16575,7 +20835,7 @@ let { count } = $$props; let { index } = $$props; let { request } = $$props; - let { response } = $$props; + let { responses } = $$props; let { isDarkmode } = $$props; function title(index) { @@ -16593,13 +20853,13 @@ $$self.$set = $$props => { if ("show" in $$props) $$invalidate(0, show = $$props.show); if ("count" in $$props) $$invalidate(6, count = $$props.count); - if ("index" in $$props) $$invalidate(1, index = $$props.index); - if ("request" in $$props) $$invalidate(2, request = $$props.request); - if ("response" in $$props) $$invalidate(3, response = $$props.response); - if ("isDarkmode" in $$props) $$invalidate(4, isDarkmode = $$props.isDarkmode); + if ("index" in $$props) $$invalidate(4, index = $$props.index); + if ("request" in $$props) $$invalidate(1, request = $$props.request); + if ("responses" in $$props) $$invalidate(2, responses = $$props.responses); + if ("isDarkmode" in $$props) $$invalidate(3, isDarkmode = $$props.isDarkmode); }; - return [show, index, request, response, isDarkmode, title, count]; + return [show, request, responses, isDarkmode, index, title, count]; } class ScenarioPanel extends SvelteComponent { @@ -16609,204 +20869,65 @@ init(this, options, instance$h, create_fragment$h, safe_not_equal, { show: 0, count: 6, - index: 1, - request: 2, - response: 3, - isDarkmode: 4 + index: 4, + request: 1, + responses: 2, + isDarkmode: 3 }); } } - /* usr/local/lib/node_modules/snowboard/templates/winter.svelte generated by Svelte v3.16.5 */ + /* usr/local/lib/node_modules/snowboard/templates/winter/pages/Action.svelte generated by Svelte v3.19.2 */ - const { document: document_1 } = globals; - - function add_css$9() { + function add_css$8() { var style = element("style"); - style.id = "svelte-1jcck2f-style"; - style.textContent = "html{height:100%}body{min-height:100%}.sidenav.svelte-1jcck2f{padding:1rem 0 1rem 0.75rem}.main.svelte-1jcck2f{padding:3rem;background-color:#fff;box-shadow:0 2px 0 2px #f5f5f5}.main.is-darkmode.svelte-1jcck2f{background-color:#000;box-shadow:0 2px 0 2px #363636}.breadcrumb-right.svelte-1jcck2f{margin-top:0.3em}.box-wrapper.svelte-1jcck2f{border-radius:0}.body-inner.svelte-1jcck2f{min-height:100vh;background-color:#fafafa}.body-inner.is-darkmode.svelte-1jcck2f{background-color:#000}.is-darkmode .input, .is-darkmode .select select, .is-darkmode\n .textarea{background-color:#484848;border-color:#484848;color:#fff}.is-darkmode .input:hover, .is-darkmode\n .is-hovered.input, .is-darkmode .is-hovered.textarea, .is-darkmode\n .select\n select.is-hovered, .is-darkmode .select select:hover, .is-darkmode\n .textarea:hover{border-color:#666}.is-darkmode .select select.is-focused, .is-darkmode\n .select\n select:active, .is-darkmode .select select:focus, .is-darkmode\n .textarea:active, .is-darkmode .textarea:focus{border-color:#888}.is-darkmode .input::placeholder, .is-darkmode\n .select\n select::placeholder, .is-darkmode .textarea::placeholder{color:#ccc}code[class*=\"language-\"], pre[class*=\"language-\"]{font-family:monospace}.token.number, .token.tag{display:inline;padding:inherit;font-size:inherit;line-height:inherit;text-align:inherit;vertical-align:inherit;border-radius:inherit;font-weight:inherit;white-space:inherit;background:inherit;margin:inherit}.icon-brand.svelte-1jcck2f{margin-right:0.5rem}.menu-collapsible.svelte-1jcck2f{display:none;position:fixed;width:calc(25% - 0.5rem);height:calc(2.5rem + 10px);left:0;bottom:0;font-size:1.33333em;line-height:calc(2.5rem + 5px);text-align:center;color:#b5b5b5;font-weight:300;border-top:1px solid #eee;box-shadow:2px 0 0 #f5f5f5;cursor:pointer}.menu-collapsible.svelte-1jcck2f:hover{background:rgba(0, 0, 0, 0.05);box-shadow:2px 0 0 #eee;border-color:#e8e8e8}.menu-collapsible.is-darkmode.svelte-1jcck2f{border-color:#363636;box-shadow:2px 0 0 #363636}.menu-collapsible.is-darkmode.svelte-1jcck2f:hover{background:rgba(255, 255, 255, 0.2);border-color:#363636;box-shadow:2px 0 0 #363636}.footer.is-darkmode.svelte-1jcck2f{background-color:#000}.footer.svelte-1jcck2f .content.svelte-1jcck2f{transition:margin 0.3s}@media screen and (min-width: 768px){.menu-collapsible.svelte-1jcck2f{display:block}.is-collapsed.svelte-1jcck2f .sidenav.svelte-1jcck2f{width:3.75rem}.is-collapsed.svelte-1jcck2f .main.svelte-1jcck2f{width:calc(100% - 4.5rem)}.is-collapsed.svelte-1jcck2f .menu-collapsible.svelte-1jcck2f{width:calc(3rem - 2px)}.menu-collapsible.svelte-1jcck2f,.sidenav.svelte-1jcck2f,.main.svelte-1jcck2f{transition:width 0.3s}}"; - append(document_1.head, style); + style.id = "svelte-1kw1ago-style"; + style.textContent = ".breadcrumb-right.svelte-1kw1ago{margin-top:0.3em}.box-wrapper.svelte-1kw1ago{border-radius:0}"; + append(document.head, style); } - function get_each_context$6(ctx, list, i) { + function get_each_context$4(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[22] = list[i].request; - child_ctx[23] = list[i].response; - child_ctx[12] = i; + child_ctx[11] = list[i].request; + child_ctx[12] = list[i].responses; + child_ctx[14] = i; return child_ctx; } function get_each_context_1$2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[25] = list[i]; - child_ctx[12] = i; + child_ctx[15] = list[i]; + child_ctx[14] = i; return child_ctx; } - // (438:8) {#if config.playground.enabled} - function create_if_block_8$1(ctx) { - let current; - - const selectorpanel = new SelectorPanel({ - props: { - environments: /*config*/ ctx[4].playground.environments, - authenticating: /*authenticating*/ ctx[7] - } - }); + // (192:0) {:else} + function create_else_block_1$1(ctx) { + let h3; return { c() { - create_component(selectorpanel.$$.fragment); + h3 = element("h3"); + h3.textContent = "404 - Not Found"; }, m(target, anchor) { - mount_component(selectorpanel, target, anchor); - current = true; - }, - p(ctx, dirty) { - const selectorpanel_changes = {}; - if (dirty & /*config*/ 16) selectorpanel_changes.environments = /*config*/ ctx[4].playground.environments; - if (dirty & /*authenticating*/ 128) selectorpanel_changes.authenticating = /*authenticating*/ ctx[7]; - selectorpanel.$set(selectorpanel_changes); - }, - i(local) { - if (current) return; - transition_in(selectorpanel.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(selectorpanel.$$.fragment, local); - current = false; + insert(target, h3, anchor); }, + p: noop, + i: noop, + o: noop, d(detaching) { - destroy_component(selectorpanel, detaching); + if (detaching) detach(h3); } }; } - // (443:8) {#if darkMode.enable} - function create_if_block_7$1(ctx) { - let div; - let a; - let span; - let i; - let dispose; - - return { - c() { - div = element("div"); - a = element("a"); - span = element("span"); - i = element("i"); - attr(i, "class", "fas fa-lg"); - toggle_class(i, "fa-moon", /*darkMode*/ ctx[9].active); - toggle_class(i, "fa-sun", !/*darkMode*/ ctx[9].active); - attr(span, "class", "icon is-medium has-text-grey-light"); - attr(a, "href", "javascript:void(0)"); - attr(a, "title", "Dark Mode"); - attr(a, "class", "navbar-link is-arrowless"); - attr(div, "class", "navbar-item has-dropdown is-hoverable"); - dispose = listen(a, "click", /*darkToggle*/ ctx[19]); - }, - m(target, anchor) { - insert(target, div, anchor); - append(div, a); - append(a, span); - append(span, i); - }, - p(ctx, dirty) { - if (dirty & /*darkMode*/ 512) { - toggle_class(i, "fa-moon", /*darkMode*/ ctx[9].active); - } - - if (dirty & /*darkMode*/ 512) { - toggle_class(i, "fa-sun", !/*darkMode*/ ctx[9].active); - } - }, - d(detaching) { - if (detaching) detach(div); - dispose(); - } - }; - } - - // (485:8) {#if collapsed} - function create_if_block_6$1(ctx) { - let span; - - return { - c() { - span = element("span"); - span.textContent = "»"; - attr(span, "class", "icon"); - attr(span, "title", "Expand ["); - }, - m(target, anchor) { - insert(target, span, anchor); - }, - d(detaching) { - if (detaching) detach(span); - } - }; - } - - // (488:8) {#if !collapsed} - function create_if_block_5$1(ctx) { - let span0; - let t1; - let span1; - - return { - c() { - span0 = element("span"); - span0.textContent = "«"; - t1 = space(); - span1 = element("span"); - span1.textContent = "Collapse sidebar"; - attr(span0, "class", "icon"); - attr(span1, "class", "fa-xs"); - }, - m(target, anchor) { - insert(target, span0, anchor); - insert(target, t1, anchor); - insert(target, span1, anchor); - }, - d(detaching) { - if (detaching) detach(span0); - if (detaching) detach(t1); - if (detaching) detach(span1); - } - }; - } - - // (498:6) {#if index === -1} - function create_if_block_4$1(ctx) { - let div; - let raw_value = markdown(/*description*/ ctx[1]) + ""; - - return { - c() { - div = element("div"); - attr(div, "class", "content"); - }, - m(target, anchor) { - insert(target, div, anchor); - div.innerHTML = raw_value; - }, - p(ctx, dirty) { - if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;; - }, - d(detaching) { - if (detaching) detach(div); - } - }; - } - - // (504:6) {#if currentAction} + // (126:0) {#if action} function create_if_block$c(ctx) { let div2; let div0; let h1; - let t0_value = /*currentAction*/ ctx[10].title + ""; + let t0_value = /*action*/ ctx[0].title + ""; let t0; let t1; let div1; @@ -16817,41 +20938,39 @@ let t3; let div3; let code0; - let t4_value = /*currentAction*/ ctx[10].method + ""; + let t4_value = /*action*/ ctx[0].method + ""; let t4; let code0_class_value; let t5; let code1; - let t6_value = /*currentAction*/ ctx[10].pathTemplate + ""; + let t6_value = /*action*/ ctx[0].pathTemplate + ""; let t6; let t7; let div4; - let raw_value = markdown(/*currentAction*/ ctx[10].description) + ""; + let raw_value = markdown(/*action*/ ctx[0].description) + ""; let t8; let t9; let t10; let each1_anchor; let current; - let each_value_1 = /*currentAction*/ ctx[10].tags; + let each_value_1 = /*action*/ ctx[0].tags; let each_blocks_1 = []; for (let i = 0; i < each_value_1.length; i += 1) { each_blocks_1[i] = create_each_block_1$2(get_each_context_1$2(ctx, each_value_1, i)); } - let if_block = /*config*/ ctx[4].playground.enabled && create_if_block_1$8(ctx); + let if_block = /*config*/ ctx[1].playground.enabled && create_if_block_1$9(ctx); const parameterpanel = new ParameterPanel({ - props: { - parameters: /*currentAction*/ ctx[10].parameters - } + props: { parameters: /*action*/ ctx[0].parameters } }); - let each_value = /*currentAction*/ ctx[10].transactions; + let each_value = /*transactions*/ ctx[5]; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i)); + each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i)); } const out = i => transition_out(each_blocks[i], 1, 1, () => { @@ -16897,11 +21016,11 @@ each1_anchor = empty(); attr(h1, "class", "title is-4"); attr(div0, "class", "column"); - attr(nav, "class", "breadcrumb breadcrumb-right is-pulled-right svelte-1jcck2f"); + attr(nav, "class", "breadcrumb breadcrumb-right is-pulled-right svelte-1kw1ago"); attr(nav, "aria-label", "breadcrumbs"); attr(div1, "class", "column"); attr(div2, "class", "columns"); - attr(code0, "class", code0_class_value = "tag is-uppercase " + colorize(/*currentAction*/ ctx[10].method) + " svelte-1jcck2f"); + attr(code0, "class", code0_class_value = "tag is-uppercase " + colorize(/*action*/ ctx[0].method) + " svelte-1kw1ago"); attr(code1, "class", "tag "); attr(div3, "class", "tags has-addons are-large"); attr(div4, "class", "content"); @@ -16946,10 +21065,10 @@ current = true; }, p(ctx, dirty) { - if ((!current || dirty & /*currentAction*/ 1024) && t0_value !== (t0_value = /*currentAction*/ ctx[10].title + "")) set_data(t0, t0_value); + if ((!current || dirty & /*action*/ 1) && t0_value !== (t0_value = /*action*/ ctx[0].title + "")) set_data(t0, t0_value); - if (dirty & /*currentAction, slugify, handleGroupClick*/ 17408) { - each_value_1 = /*currentAction*/ ctx[10].tags; + if (dirty & /*action, slugify, handleLink*/ 1) { + each_value_1 = /*action*/ ctx[0].tags; let i; for (i = 0; i < each_value_1.length; i += 1) { @@ -16971,21 +21090,21 @@ each_blocks_1.length = each_value_1.length; } - if ((!current || dirty & /*currentAction*/ 1024) && t4_value !== (t4_value = /*currentAction*/ ctx[10].method + "")) set_data(t4, t4_value); + if ((!current || dirty & /*action*/ 1) && t4_value !== (t4_value = /*action*/ ctx[0].method + "")) set_data(t4, t4_value); - if (!current || dirty & /*currentAction*/ 1024 && code0_class_value !== (code0_class_value = "tag is-uppercase " + colorize(/*currentAction*/ ctx[10].method) + " svelte-1jcck2f")) { + if (!current || dirty & /*action*/ 1 && code0_class_value !== (code0_class_value = "tag is-uppercase " + colorize(/*action*/ ctx[0].method) + " svelte-1kw1ago")) { attr(code0, "class", code0_class_value); } - if ((!current || dirty & /*currentAction*/ 1024) && t6_value !== (t6_value = /*currentAction*/ ctx[10].pathTemplate + "")) set_data(t6, t6_value); - if ((!current || dirty & /*currentAction*/ 1024) && raw_value !== (raw_value = markdown(/*currentAction*/ ctx[10].description) + "")) div4.innerHTML = raw_value;; + if ((!current || dirty & /*action*/ 1) && t6_value !== (t6_value = /*action*/ ctx[0].pathTemplate + "")) set_data(t6, t6_value); + if ((!current || dirty & /*action*/ 1) && raw_value !== (raw_value = markdown(/*action*/ ctx[0].description) + "")) div4.innerHTML = raw_value;; - if (/*config*/ ctx[4].playground.enabled) { + if (/*config*/ ctx[1].playground.enabled) { if (if_block) { if_block.p(ctx, dirty); transition_in(if_block, 1); } else { - if_block = create_if_block_1$8(ctx); + if_block = create_if_block_1$9(ctx); if_block.c(); transition_in(if_block, 1); if_block.m(t9.parentNode, t9); @@ -17001,21 +21120,21 @@ } const parameterpanel_changes = {}; - if (dirty & /*currentAction*/ 1024) parameterpanel_changes.parameters = /*currentAction*/ ctx[10].parameters; + if (dirty & /*action*/ 1) parameterpanel_changes.parameters = /*action*/ ctx[0].parameters; parameterpanel.$set(parameterpanel_changes); - if (dirty & /*darkMode, currentAction*/ 1536) { - each_value = /*currentAction*/ ctx[10].transactions; + if (dirty & /*darkMode, transactions*/ 48) { + each_value = /*transactions*/ ctx[5]; let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$6(ctx, each_value, i); + const child_ctx = get_each_context$4(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block$6(child_ctx); + each_blocks[i] = create_each_block$4(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(each1_anchor.parentNode, each1_anchor); @@ -17073,12 +21192,11 @@ }; } - // (518:20) {:else} - function create_else_block$5(ctx) { + // (140:14) {:else} + function create_else_block$6(ctx) { let a; - let t_value = /*tag*/ ctx[25] + ""; + let t_value = /*tag*/ ctx[15] + ""; let t; - let a_data_slug_value; let a_href_value; let dispose; @@ -17086,22 +21204,17 @@ c() { a = element("a"); t = text(t_value); - attr(a, "data-slug", a_data_slug_value = slugify(/*tag*/ ctx[25])); - attr(a, "href", a_href_value = "#/g~" + slugify(/*tag*/ ctx[25])); - dispose = listen(a, "click", /*handleGroupClick*/ ctx[14]); + attr(a, "href", a_href_value = "/#/g~" + slugify(/*action*/ ctx[0].tags[0]) + "~" + slugify(/*tag*/ ctx[15])); }, m(target, anchor) { insert(target, a, anchor); append(a, t); + dispose = listen(a, "click", handleLink); }, p(ctx, dirty) { - if (dirty & /*currentAction*/ 1024 && t_value !== (t_value = /*tag*/ ctx[25] + "")) set_data(t, t_value); + if (dirty & /*action*/ 1 && t_value !== (t_value = /*tag*/ ctx[15] + "")) set_data(t, t_value); - if (dirty & /*currentAction*/ 1024 && a_data_slug_value !== (a_data_slug_value = slugify(/*tag*/ ctx[25]))) { - attr(a, "data-slug", a_data_slug_value); - } - - if (dirty & /*currentAction*/ 1024 && a_href_value !== (a_href_value = "#/g~" + slugify(/*tag*/ ctx[25]))) { + if (dirty & /*action*/ 1 && a_href_value !== (a_href_value = "/#/g~" + slugify(/*action*/ ctx[0].tags[0]) + "~" + slugify(/*tag*/ ctx[15]))) { attr(a, "href", a_href_value); } }, @@ -17112,10 +21225,10 @@ }; } - // (516:20) {#if index === 0} - function create_if_block_3$3(ctx) { + // (138:14) {#if index === 0} + function create_if_block_3$1(ctx) { let a; - let t_value = /*tag*/ ctx[25] + ""; + let t_value = /*tag*/ ctx[15] + ""; let t; return { @@ -17129,7 +21242,7 @@ append(a, t); }, p(ctx, dirty) { - if (dirty & /*currentAction*/ 1024 && t_value !== (t_value = /*tag*/ ctx[25] + "")) set_data(t, t_value); + if (dirty & /*action*/ 1 && t_value !== (t_value = /*tag*/ ctx[15] + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(a); @@ -17137,17 +21250,17 @@ }; } - // (514:16) {#each currentAction.tags as tag, index} + // (136:10) {#each action.tags as tag, index} function create_each_block_1$2(ctx) { let li; let t; - function select_block_type(ctx, dirty) { - if (/*index*/ ctx[12] === 0) return create_if_block_3$3; - return create_else_block$5; + function select_block_type_1(ctx, dirty) { + if (/*index*/ ctx[14] === 0) return create_if_block_3$1; + return create_else_block$6; } - let current_block_type = select_block_type(ctx, -1); + let current_block_type = select_block_type_1(ctx, -1); let if_block = current_block_type(ctx); return { @@ -17171,11 +21284,11 @@ }; } - // (546:8) {#if config.playground.enabled} - function create_if_block_1$8(ctx) { + // (167:2) {#if config.playground.enabled} + function create_if_block_1$9(ctx) { let if_block_anchor; let current; - let if_block = /*environment*/ ctx[11].playground !== false && create_if_block_2$5(ctx); + let if_block = /*environment*/ ctx[2].playground !== false && create_if_block_2$5(ctx); return { c() { @@ -17188,7 +21301,7 @@ current = true; }, p(ctx, dirty) { - if (/*environment*/ ctx[11].playground !== false) { + if (/*environment*/ ctx[2].playground !== false) { if (if_block) { if_block.p(ctx, dirty); transition_in(if_block, 1); @@ -17224,19 +21337,20 @@ }; } - // (547:10) {#if environment.playground !== false} + // (168:4) {#if environment.playground !== false} function create_if_block_2$5(ctx) { let current; const playgroundpanel = new PlaygroundPanel({ props: { - currentAction: /*currentAction*/ ctx[10], - environments: /*config*/ ctx[4].playground.environments, - currentSample: sample(/*currentAction*/ ctx[10]), - requestHeaders: headersMap(/*currentAction*/ ctx[10]), - requestParameters: parametersMap(/*currentAction*/ ctx[10]), - requestBody: bodyMap(/*currentAction*/ ctx[10]), - isDarkmode: /*darkMode*/ ctx[9].active + currentAction: /*action*/ ctx[0], + pkceChallenge: /*challengePair*/ ctx[3], + environments: /*config*/ ctx[1].playground.environments, + requestHeaders: headersMap(/*action*/ ctx[0]), + requestAuthHeader: /*authHeader*/ ctx[6](/*action*/ ctx[0], /*environment*/ ctx[2]), + requestParameters: parametersMap(/*action*/ ctx[0]), + requestBody: bodyMap(/*action*/ ctx[0]), + isDarkmode: /*darkMode*/ ctx[4].active } }); @@ -17250,13 +21364,14 @@ }, p(ctx, dirty) { const playgroundpanel_changes = {}; - if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.currentAction = /*currentAction*/ ctx[10]; - if (dirty & /*config*/ 16) playgroundpanel_changes.environments = /*config*/ ctx[4].playground.environments; - if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.currentSample = sample(/*currentAction*/ ctx[10]); - if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestHeaders = headersMap(/*currentAction*/ ctx[10]); - if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestParameters = parametersMap(/*currentAction*/ ctx[10]); - if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestBody = bodyMap(/*currentAction*/ ctx[10]); - if (dirty & /*darkMode*/ 512) playgroundpanel_changes.isDarkmode = /*darkMode*/ ctx[9].active; + if (dirty & /*action*/ 1) playgroundpanel_changes.currentAction = /*action*/ ctx[0]; + if (dirty & /*challengePair*/ 8) playgroundpanel_changes.pkceChallenge = /*challengePair*/ ctx[3]; + if (dirty & /*config*/ 2) playgroundpanel_changes.environments = /*config*/ ctx[1].playground.environments; + if (dirty & /*action*/ 1) playgroundpanel_changes.requestHeaders = headersMap(/*action*/ ctx[0]); + if (dirty & /*action, environment*/ 5) playgroundpanel_changes.requestAuthHeader = /*authHeader*/ ctx[6](/*action*/ ctx[0], /*environment*/ ctx[2]); + if (dirty & /*action*/ 1) playgroundpanel_changes.requestParameters = parametersMap(/*action*/ ctx[0]); + if (dirty & /*action*/ 1) playgroundpanel_changes.requestBody = bodyMap(/*action*/ ctx[0]); + if (dirty & /*darkMode*/ 16) playgroundpanel_changes.isDarkmode = /*darkMode*/ ctx[4].active; playgroundpanel.$set(playgroundpanel_changes); }, i(local) { @@ -17274,18 +21389,18 @@ }; } - // (561:8) {#each currentAction.transactions as { request, response } - function create_each_block$6(ctx) { + // (183:2) {#each transactions as { request, responses } + function create_each_block$4(ctx) { let current; const scenariopanel = new ScenarioPanel({ props: { - show: /*index*/ ctx[12] === 0, - isDarkmode: /*darkMode*/ ctx[9].active, - request: /*request*/ ctx[22], - response: /*response*/ ctx[23], - index: /*index*/ ctx[12], - count: /*currentAction*/ ctx[10].transactions.length + show: /*index*/ ctx[14] === 0, + isDarkmode: /*darkMode*/ ctx[4].active, + request: /*request*/ ctx[11], + responses: /*responses*/ ctx[12], + index: /*index*/ ctx[14], + count: /*transactions*/ ctx[5].length } }); @@ -17299,10 +21414,10 @@ }, p(ctx, dirty) { const scenariopanel_changes = {}; - if (dirty & /*darkMode*/ 512) scenariopanel_changes.isDarkmode = /*darkMode*/ ctx[9].active; - if (dirty & /*currentAction*/ 1024) scenariopanel_changes.request = /*request*/ ctx[22]; - if (dirty & /*currentAction*/ 1024) scenariopanel_changes.response = /*response*/ ctx[23]; - if (dirty & /*currentAction*/ 1024) scenariopanel_changes.count = /*currentAction*/ ctx[10].transactions.length; + if (dirty & /*darkMode*/ 16) scenariopanel_changes.isDarkmode = /*darkMode*/ ctx[4].active; + if (dirty & /*transactions*/ 32) scenariopanel_changes.request = /*request*/ ctx[11]; + if (dirty & /*transactions*/ 32) scenariopanel_changes.responses = /*responses*/ ctx[12]; + if (dirty & /*transactions*/ 32) scenariopanel_changes.count = /*transactions*/ ctx[5].length; scenariopanel.$set(scenariopanel_changes); }, i(local) { @@ -17321,350 +21436,68 @@ } function create_fragment$i(ctx) { - let div8; - let nav; - let div0; - let a0; - let span0; - let t0; - let span1; - let t1; - let t2; - let a1; - let t5; - let div2; - let div1; - let t6; - let t7; - let div6; - let div4; - let t8; - let div3; - let t9; - let t10; - let div5; - let t11; - let t12; - let footer; - let div7; - let p; - let strong0; - let t13; - let t14; - let a2; + let current_block_type_index; + let if_block; + let if_block_anchor; let current; - let dispose; - let if_block0 = /*config*/ ctx[4].playground.enabled && create_if_block_8$1(ctx); - let if_block1 = /*darkMode*/ ctx[9].enable && create_if_block_7$1(ctx); + const if_block_creators = [create_if_block$c, create_else_block_1$1]; + const if_blocks = []; - const menupanel = new MenuPanel({ - props: { - tagActions: /*tagActions*/ ctx[3], - tagHeaders: toc(/*description*/ ctx[1]), - currentSlug: /*currentAction*/ ctx[10] && /*currentAction*/ ctx[10].slug, - actionsCount: /*actions*/ ctx[2].length, - isCollapsed: /*collapsed*/ ctx[6], - isDarkmode: /*darkMode*/ ctx[9].active, - query: /*query*/ ctx[8], - config: /*config*/ ctx[4], - handleClick: /*handleClick*/ ctx[13], - handleGroupClick: /*handleGroupClick*/ ctx[14], - tocClick: /*tocClick*/ ctx[15], - searchClick: /*searchClick*/ ctx[18] - } - }); + function select_block_type(ctx, dirty) { + if (/*action*/ ctx[0]) return 0; + return 1; + } - let if_block2 = /*collapsed*/ ctx[6] && create_if_block_6$1(ctx); - let if_block3 = !/*collapsed*/ ctx[6] && create_if_block_5$1(ctx); - let if_block4 = /*index*/ ctx[12] === -1 && create_if_block_4$1(ctx); - let if_block5 = /*currentAction*/ ctx[10] && create_if_block$c(ctx); + current_block_type_index = select_block_type(ctx, -1); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); return { c() { - div8 = element("div"); - nav = element("nav"); - div0 = element("div"); - a0 = element("a"); - span0 = element("span"); - span0.innerHTML = ``; - t0 = space(); - span1 = element("span"); - t1 = text(/*title*/ ctx[0]); - t2 = space(); - a1 = element("a"); - - a1.innerHTML = ` - - `; - - t5 = space(); - div2 = element("div"); - div1 = element("div"); - if (if_block0) if_block0.c(); - t6 = space(); - if (if_block1) if_block1.c(); - t7 = space(); - div6 = element("div"); - div4 = element("div"); - create_component(menupanel.$$.fragment); - t8 = space(); - div3 = element("div"); - if (if_block2) if_block2.c(); - t9 = space(); - if (if_block3) if_block3.c(); - t10 = space(); - div5 = element("div"); - if (if_block4) if_block4.c(); - t11 = space(); - if (if_block5) if_block5.c(); - t12 = space(); - footer = element("footer"); - div7 = element("div"); - p = element("p"); - strong0 = element("strong"); - t13 = text(/*title*/ ctx[0]); - t14 = text("\n powered by\n "); - a2 = element("a"); - a2.innerHTML = `Snowboard.`; - attr(span0, "class", "icon icon-brand is-medium has-text-grey-light svelte-1jcck2f"); - attr(span1, "class", "title is-4"); - attr(a0, "href", "javascript:void(0)"); - attr(a0, "class", "navbar-item"); - attr(a1, "href", "javascript:void(0)"); - attr(a1, "role", "button"); - attr(a1, "class", "navbar-burger"); - attr(a1, "aria-label", "menu"); - attr(a1, "aria-expanded", "false"); - attr(a1, "data-target", "mainnav"); - attr(div0, "class", "navbar-brand"); - attr(div1, "class", "navbar-end"); - attr(div2, "class", "navbar-menu"); - attr(nav, "class", "navbar is-fixed-top has-shadow"); - attr(nav, "role", "navigation"); - attr(nav, "aria-label", "main navigation"); - attr(div3, "class", "menu-collapsible svelte-1jcck2f"); - toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[9].active); - attr(div4, "class", "column is-one-quarter sidenav svelte-1jcck2f"); - attr(div4, "id", "mainnav"); - toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[5]); - attr(div5, "class", "column is-three-quarters main svelte-1jcck2f"); - toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[9].active); - attr(div6, "class", "columns svelte-1jcck2f"); - toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[6]); - attr(a2, "href", "https://github.com/bukalapak/snowboard"); - attr(a2, "target", "_blank"); - attr(div7, "class", "content column is-paddingless has-text-centered svelte-1jcck2f"); - toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[6]); - attr(footer, "class", "footer svelte-1jcck2f"); - toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[9].active); - attr(div8, "class", "body-inner svelte-1jcck2f"); - toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[9].active); - - dispose = [ - listen(a1, "click", /*burgerClick*/ ctx[16]), - listen(div3, "click", /*collapseToggle*/ ctx[17]) - ]; + if_block.c(); + if_block_anchor = empty(); }, m(target, anchor) { - insert(target, div8, anchor); - append(div8, nav); - append(nav, div0); - append(div0, a0); - append(a0, span0); - append(a0, t0); - append(a0, span1); - append(span1, t1); - append(div0, t2); - append(div0, a1); - append(nav, t5); - append(nav, div2); - append(div2, div1); - if (if_block0) if_block0.m(div1, null); - append(div1, t6); - if (if_block1) if_block1.m(div1, null); - append(div8, t7); - append(div8, div6); - append(div6, div4); - mount_component(menupanel, div4, null); - append(div4, t8); - append(div4, div3); - if (if_block2) if_block2.m(div3, null); - append(div3, t9); - if (if_block3) if_block3.m(div3, null); - append(div6, t10); - append(div6, div5); - if (if_block4) if_block4.m(div5, null); - append(div5, t11); - if (if_block5) if_block5.m(div5, null); - append(div8, t12); - append(div8, footer); - append(footer, div7); - append(div7, p); - append(p, strong0); - append(strong0, t13); - append(p, t14); - append(p, a2); + if_blocks[current_block_type_index].m(target, anchor); + insert(target, if_block_anchor, anchor); current = true; }, p(ctx, [dirty]) { - if (!current || dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]); + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx, dirty); - if (/*config*/ ctx[4].playground.enabled) { - if (if_block0) { - if_block0.p(ctx, dirty); - transition_in(if_block0, 1); - } else { - if_block0 = create_if_block_8$1(ctx); - if_block0.c(); - transition_in(if_block0, 1); - if_block0.m(div1, t6); - } - } else if (if_block0) { + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } else { group_outros(); - transition_out(if_block0, 1, 1, () => { - if_block0 = null; + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; }); check_outros(); - } + if_block = if_blocks[current_block_type_index]; - if (/*darkMode*/ ctx[9].enable) { - if (if_block1) { - if_block1.p(ctx, dirty); - } else { - if_block1 = create_if_block_7$1(ctx); - if_block1.c(); - if_block1.m(div1, null); + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + if_block.c(); } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - const menupanel_changes = {}; - if (dirty & /*tagActions*/ 8) menupanel_changes.tagActions = /*tagActions*/ ctx[3]; - if (dirty & /*description*/ 2) menupanel_changes.tagHeaders = toc(/*description*/ ctx[1]); - if (dirty & /*currentAction*/ 1024) menupanel_changes.currentSlug = /*currentAction*/ ctx[10] && /*currentAction*/ ctx[10].slug; - if (dirty & /*actions*/ 4) menupanel_changes.actionsCount = /*actions*/ ctx[2].length; - if (dirty & /*collapsed*/ 64) menupanel_changes.isCollapsed = /*collapsed*/ ctx[6]; - if (dirty & /*darkMode*/ 512) menupanel_changes.isDarkmode = /*darkMode*/ ctx[9].active; - if (dirty & /*query*/ 256) menupanel_changes.query = /*query*/ ctx[8]; - if (dirty & /*config*/ 16) menupanel_changes.config = /*config*/ ctx[4]; - menupanel.$set(menupanel_changes); - - if (/*collapsed*/ ctx[6]) { - if (!if_block2) { - if_block2 = create_if_block_6$1(ctx); - if_block2.c(); - if_block2.m(div3, t9); - } else { - - } - } else if (if_block2) { - if_block2.d(1); - if_block2 = null; - } - - if (!/*collapsed*/ ctx[6]) { - if (!if_block3) { - if_block3 = create_if_block_5$1(ctx); - if_block3.c(); - if_block3.m(div3, null); - } else { - - } - } else if (if_block3) { - if_block3.d(1); - if_block3 = null; - } - - if (dirty & /*darkMode*/ 512) { - toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[9].active); - } - - if (dirty & /*showMenu*/ 32) { - toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[5]); - } - - if (/*index*/ ctx[12] === -1) { - if (if_block4) { - if_block4.p(ctx, dirty); - } else { - if_block4 = create_if_block_4$1(ctx); - if_block4.c(); - if_block4.m(div5, t11); - } - } else if (if_block4) { - if_block4.d(1); - if_block4 = null; - } - - if (/*currentAction*/ ctx[10]) { - if (if_block5) { - if_block5.p(ctx, dirty); - transition_in(if_block5, 1); - } else { - if_block5 = create_if_block$c(ctx); - if_block5.c(); - transition_in(if_block5, 1); - if_block5.m(div5, null); - } - } else if (if_block5) { - group_outros(); - - transition_out(if_block5, 1, 1, () => { - if_block5 = null; - }); - - check_outros(); - } - - if (dirty & /*darkMode*/ 512) { - toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[9].active); - } - - if (dirty & /*collapsed*/ 64) { - toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[6]); - } - - if (!current || dirty & /*title*/ 1) set_data(t13, /*title*/ ctx[0]); - - if (dirty & /*collapsed*/ 64) { - toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[6]); - } - - if (dirty & /*darkMode*/ 512) { - toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[9].active); - } - - if (dirty & /*darkMode*/ 512) { - toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[9].active); + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); } }, i(local) { if (current) return; - transition_in(if_block0); - transition_in(menupanel.$$.fragment, local); - transition_in(if_block5); + transition_in(if_block); current = true; }, o(local) { - transition_out(if_block0); - transition_out(menupanel.$$.fragment, local); - transition_out(if_block5); + transition_out(if_block); current = false; }, d(detaching) { - if (detaching) detach(div8); - if (if_block0) if_block0.d(); - if (if_block1) if_block1.d(); - destroy_component(menupanel); - if (if_block2) if_block2.d(); - if (if_block3) if_block3.d(); - if (if_block4) if_block4.d(); - if (if_block5) if_block5.d(); - run_all(dispose); + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach(if_block_anchor); } }; } @@ -17701,44 +21534,2403 @@ } function instance$i($$self, $$props, $$invalidate) { + let $auth; let $env; - component_subscribe($$self, env, $$value => $$invalidate(20, $env = $$value)); + let $token; + component_subscribe($$self, auth, $$value => $$invalidate(7, $auth = $$value)); + component_subscribe($$self, env, $$value => $$invalidate(8, $env = $$value)); + component_subscribe($$self, token$1, $$value => $$invalidate(9, $token = $$value)); + let { action } = $$props; + let { config } = $$props; + let { environment } = $$props; + let { challengePair } = $$props; + let { darkMode } = $$props; + + function authHeader(action, environment) { + const header = sample(action).headers.find(header => header.name === "Authorization"); + if (!header) return; + header.value = header.example; + header.used = true; + + if (isAuth(environment, "basic")) { + header.value = `Basic ${basicAuth(environment.auth.options.username, environment.auth.options.password)}`; + } + + if (isAuth(environment, "apikey")) { + header.name = environment.auth.options.header; + header.value = environment.auth.options.key; + } + + if (isAuth(environment, "oauth2")) { + if ($auth.split(";").includes($env)) { + header.value = `Bearer ${$token}`; + } + } + + return header; + } + + function toTransactions(transactions) { + if (!transactions) return []; + const items = {}; + + transactions.forEach(transaction => { + const { request, response } = transaction; + const requestHash = lib$2.h32(fastJsonStableStringify(request), 703710).toString(16); + + if (!Object.keys(items).includes(requestHash)) { + items[requestHash] = { request, responses: [response] }; + } else { + items[requestHash].responses.push(response); + } + }); + + return Object.values(items); + } + + $$self.$set = $$props => { + if ("action" in $$props) $$invalidate(0, action = $$props.action); + if ("config" in $$props) $$invalidate(1, config = $$props.config); + if ("environment" in $$props) $$invalidate(2, environment = $$props.environment); + if ("challengePair" in $$props) $$invalidate(3, challengePair = $$props.challengePair); + if ("darkMode" in $$props) $$invalidate(4, darkMode = $$props.darkMode); + }; + + let transactions; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*action*/ 1) { + $$invalidate(5, transactions = toTransactions(action && action.transactions)); + } + }; + + return [action, config, environment, challengePair, darkMode, transactions, authHeader]; + } + + class Action extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-1kw1ago-style")) add_css$8(); + + init(this, options, instance$i, create_fragment$i, safe_not_equal, { + action: 0, + config: 1, + environment: 2, + challengePair: 3, + darkMode: 4 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/components/MenuItem.svelte generated by Svelte v3.19.2 */ + + function add_css$9() { + var style = element("style"); + style.id = "svelte-39af3j-style"; + style.textContent = ".tag.svelte-39af3j{width:3.5rem}.menu-ellipsis.svelte-39af3j{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0.25em 0.75em}.menu-action.svelte-39af3j{vertical-align:middle}"; + append(document.head, style); + } + + function get_each_context$5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[6] = list[i]; + return child_ctx; + } + + // (28:0) {#if title} + function create_if_block_1$a(ctx) { + let li; + let a0; + let t0; + let a0_href_value; + let t1; + let a1; + let span; + let i; + let dispose; + + return { + c() { + li = element("li"); + a0 = element("a"); + t0 = text(/*title*/ ctx[1]); + t1 = space(); + a1 = element("a"); + span = element("span"); + i = element("i"); + attr(a0, "href", a0_href_value = buildHref(`#/g~${/*parentSlug*/ ctx[3]}~${slugify(/*title*/ ctx[1])}`)); + attr(a0, "class", "is-inline-block"); + attr(i, "class", "fas"); + toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]); + toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]); + attr(span, "class", "icon is-small has-text-grey-light"); + attr(a1, "href", "javascript:void(0)"); + attr(a1, "class", "is-inline-block is-pulled-right"); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, a0); + append(a0, t0); + append(li, t1); + append(li, a1); + append(a1, span); + append(span, i); + + dispose = [ + listen(a0, "click", handleLink), + listen(a1, "click", /*click_handler*/ ctx[5]) + ]; + }, + p(ctx, dirty) { + if (dirty & /*title*/ 2) set_data(t0, /*title*/ ctx[1]); + + if (dirty & /*parentSlug, title*/ 10 && a0_href_value !== (a0_href_value = buildHref(`#/g~${/*parentSlug*/ ctx[3]}~${slugify(/*title*/ ctx[1])}`))) { + attr(a0, "href", a0_href_value); + } + + if (dirty & /*hidden*/ 1) { + toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]); + } + + if (dirty & /*hidden*/ 1) { + toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]); + } + }, + d(detaching) { + if (detaching) detach(li); + run_all(dispose); + } + }; + } + + // (50:0) {#if actions.length > 0} + function create_if_block$d(ctx) { + let li; + let ul; + let each_value = /*actions*/ ctx[2]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i)); + } + + return { + c() { + li = element("li"); + ul = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + toggle_class(li, "is-hidden", /*hidden*/ ctx[0]); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, ul); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(ul, null); + } + }, + p(ctx, dirty) { + if (dirty & /*buildHref, actions, $router, handleLink, colorize*/ 20) { + each_value = /*actions*/ ctx[2]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$5(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$5(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + + if (dirty & /*hidden*/ 1) { + toggle_class(li, "is-hidden", /*hidden*/ ctx[0]); + } + }, + d(detaching) { + if (detaching) detach(li); + destroy_each(each_blocks, detaching); + } + }; + } + + // (53:6) {#each actions as action} + function create_each_block$5(ctx) { + let li; + let a; + let code; + let t0_value = /*action*/ ctx[6].method + ""; + let t0; + let code_class_value; + let t1; + let span; + let t2_value = /*action*/ ctx[6].title + ""; + let t2; + let a_href_value; + let t3; + let dispose; + + return { + c() { + li = element("li"); + a = element("a"); + code = element("code"); + t0 = text(t0_value); + t1 = space(); + span = element("span"); + t2 = text(t2_value); + t3 = space(); + attr(code, "class", code_class_value = "tag " + colorize(/*action*/ ctx[6].method) + " is-uppercase" + " svelte-39af3j"); + attr(span, "class", "menu-action svelte-39af3j"); + attr(a, "href", a_href_value = buildHref(`#/${/*action*/ ctx[6].slug}`)); + attr(a, "class", "menu-ellipsis svelte-39af3j"); + toggle_class(a, "is-active", /*action*/ ctx[6].slug === /*$router*/ ctx[4].params.slug); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, a); + append(a, code); + append(code, t0); + append(a, t1); + append(a, span); + append(span, t2); + append(li, t3); + dispose = listen(a, "click", handleLink); + }, + p(ctx, dirty) { + if (dirty & /*actions*/ 4 && t0_value !== (t0_value = /*action*/ ctx[6].method + "")) set_data(t0, t0_value); + + if (dirty & /*actions*/ 4 && code_class_value !== (code_class_value = "tag " + colorize(/*action*/ ctx[6].method) + " is-uppercase" + " svelte-39af3j")) { + attr(code, "class", code_class_value); + } + + if (dirty & /*actions*/ 4 && t2_value !== (t2_value = /*action*/ ctx[6].title + "")) set_data(t2, t2_value); + + if (dirty & /*actions*/ 4 && a_href_value !== (a_href_value = buildHref(`#/${/*action*/ ctx[6].slug}`))) { + attr(a, "href", a_href_value); + } + + if (dirty & /*actions, $router*/ 20) { + toggle_class(a, "is-active", /*action*/ ctx[6].slug === /*$router*/ ctx[4].params.slug); + } + }, + d(detaching) { + if (detaching) detach(li); + dispose(); + } + }; + } + + function create_fragment$j(ctx) { + let t; + let if_block1_anchor; + let if_block0 = /*title*/ ctx[1] && create_if_block_1$a(ctx); + let if_block1 = /*actions*/ ctx[2].length > 0 && create_if_block$d(ctx); + + return { + c() { + if (if_block0) if_block0.c(); + t = space(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); + }, + m(target, anchor) { + if (if_block0) if_block0.m(target, anchor); + insert(target, t, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); + }, + p(ctx, [dirty]) { + if (/*title*/ ctx[1]) { + if (if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0 = create_if_block_1$a(ctx); + if_block0.c(); + if_block0.m(t.parentNode, t); + } + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + + if (/*actions*/ ctx[2].length > 0) { + if (if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1 = create_if_block$d(ctx); + if_block1.c(); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + }, + i: noop, + o: noop, + d(detaching) { + if (if_block0) if_block0.d(detaching); + if (detaching) detach(t); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); + } + }; + } + + function instance$j($$self, $$props, $$invalidate) { + let $router; + component_subscribe($$self, router, $$value => $$invalidate(4, $router = $$value)); + let { title } = $$props; + let { actions } = $$props; + let { parentSlug } = $$props; + let { hidden = false } = $$props; + const click_handler = () => $$invalidate(0, hidden = !hidden); + + $$self.$set = $$props => { + if ("title" in $$props) $$invalidate(1, title = $$props.title); + if ("actions" in $$props) $$invalidate(2, actions = $$props.actions); + if ("parentSlug" in $$props) $$invalidate(3, parentSlug = $$props.parentSlug); + if ("hidden" in $$props) $$invalidate(0, hidden = $$props.hidden); + }; + + return [hidden, title, actions, parentSlug, $router, click_handler]; + } + + class MenuItem extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-39af3j-style")) add_css$9(); + + init(this, options, instance$j, create_fragment$j, safe_not_equal, { + title: 1, + actions: 2, + parentSlug: 3, + hidden: 0 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/MenuPanel.svelte generated by Svelte v3.19.2 */ + + function add_css$a() { + var style = element("style"); + style.id = "svelte-fvssqr-style"; + style.textContent = ".hero.svelte-fvssqr.svelte-fvssqr,.menu-wrapper.svelte-fvssqr.svelte-fvssqr{padding:0 2.75rem 0 2rem}.hero.svelte-fvssqr.svelte-fvssqr{position:sticky;top:54px;background-color:#fafafa;margin-bottom:1.5rem}.hero.is-darkmode.svelte-fvssqr.svelte-fvssqr{background-color:#000}.hero-body.svelte-fvssqr.svelte-fvssqr{padding:1.5rem 0;box-shadow:0 2px 0 0 #f5f5f5}.hero-body.is-darkmode.svelte-fvssqr.svelte-fvssqr{box-shadow:0 2px 0 0 #363636}.menu-wrapper.svelte-fvssqr.svelte-fvssqr::-webkit-scrollbar{display:none}@media screen and (min-width: 768px){.hero.svelte-fvssqr.svelte-fvssqr,.menu-wrapper.svelte-fvssqr.svelte-fvssqr{width:-moz-calc(25% - 0.5rem);width:-webkit-calc(25% - 0.5rem);width:-o-calc(25% - 0.5rem);width:calc(25% - 0.5rem)}.hero.svelte-fvssqr.svelte-fvssqr{position:fixed;padding:0 1.25rem}.menu-wrapper.svelte-fvssqr.svelte-fvssqr{position:fixed;top:140px;padding:1.5rem 1.25rem 1.25rem;height:-moz-calc(100% - 150px - 2.5rem);height:-webkit-calc(100% - 150px - 2.5rem);height:-o-calc(100% - 150px - 2.5rem);height:calc(100% - 150px - 2.5rem);overflow:-moz-scrollbars-none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto;transition:opacity 0.3s, left 0.3s}.menu.is-collapsed.svelte-fvssqr.svelte-fvssqr{width:3rem}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr,.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{width:calc(3rem - 2px)}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr{padding-left:0;padding-right:0}.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{padding-left:0.3175rem;padding-right:0.3175rem;box-shadow:none}.is-collapsed.svelte-fvssqr .input.is-rounded.svelte-fvssqr{padding-left:0;padding-right:0;opacity:0}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr{color:#b5b5b5;background-color:#eee;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;cursor:pointer;pointer-events:auto}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr:hover{color:#999;background-color:#e0e0e0}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr{color:#ccc;background-color:#484848}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr:hover{color:#fff;background-color:#484848}.is-collapsed.svelte-fvssqr .menu-wrapper.svelte-fvssqr{left:-30%;opacity:0}}"; + append(document.head, style); + } + + function get_each_context_1$3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[13] = list[i]; + return child_ctx; + } + + function get_each_context$6(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[10] = list[i]; + return child_ctx; + } + + function get_each_context_2$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[16] = list[i]; + return child_ctx; + } + + // (169:4) {#if query === ''} + function create_if_block_1$b(ctx) { + let if_block_anchor; + let if_block = /*tagHeaders*/ ctx[3] && create_if_block_2$6(ctx); + + return { + c() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx, dirty) { + if (/*tagHeaders*/ ctx[3]) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block_2$6(ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + // (170:6) {#if tagHeaders} + function create_if_block_2$6(ctx) { + let ul1; + let li; + let ul0; + let each_value_2 = /*tagHeaders*/ ctx[3]; + let each_blocks = []; + + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i)); + } + + return { + c() { + ul1 = element("ul"); + li = element("li"); + ul0 = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(ul1, "class", "menu-list"); + }, + m(target, anchor) { + insert(target, ul1, anchor); + append(ul1, li); + append(li, ul0); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(ul0, null); + } + }, + p(ctx, dirty) { + if (dirty & /*headerLink, tagHeaders, tocClick*/ 136) { + each_value_2 = /*tagHeaders*/ ctx[3]; + let i; + + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2$1(ctx, each_value_2, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block_2$1(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul0, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value_2.length; + } + }, + d(detaching) { + if (detaching) detach(ul1); + destroy_each(each_blocks, detaching); + } + }; + } + + // (175:16) {#if header.level === 0} + function create_if_block_3$2(ctx) { + let li; + let a; + let t0_value = /*header*/ ctx[16].text + ""; + let t0; + let a_href_value; + let t1; + let dispose; + + return { + c() { + li = element("li"); + a = element("a"); + t0 = text(t0_value); + t1 = space(); + attr(a, "href", a_href_value = "#" + headerLink(/*header*/ ctx[16].text)); + }, + m(target, anchor) { + insert(target, li, anchor); + append(li, a); + append(a, t0); + append(li, t1); + + dispose = listen(a, "click", prevent_default(function () { + if (is_function(/*tocClick*/ ctx[7])) /*tocClick*/ ctx[7].apply(this, arguments); + })); + }, + p(new_ctx, dirty) { + ctx = new_ctx; + if (dirty & /*tagHeaders*/ 8 && t0_value !== (t0_value = /*header*/ ctx[16].text + "")) set_data(t0, t0_value); + + if (dirty & /*tagHeaders*/ 8 && a_href_value !== (a_href_value = "#" + headerLink(/*header*/ ctx[16].text))) { + attr(a, "href", a_href_value); + } + }, + d(detaching) { + if (detaching) detach(li); + dispose(); + } + }; + } + + // (174:14) {#each tagHeaders as header} + function create_each_block_2$1(ctx) { + let if_block_anchor; + let if_block = /*header*/ ctx[16].level === 0 && create_if_block_3$2(ctx); + + return { + c() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, if_block_anchor, anchor); + }, + p(ctx, dirty) { + if (/*header*/ ctx[16].level === 0) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block_3$2(ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + // (192:6) {#if tag.title} + function create_if_block$e(ctx) { + let p; + let a; + let t_value = /*tag*/ ctx[10].title + ""; + let t; + let a_href_value; + let dispose; + + return { + c() { + p = element("p"); + a = element("a"); + t = text(t_value); + attr(a, "href", a_href_value = buildHref(`#/rg~${slugify(/*tag*/ ctx[10].title)}`)); + attr(a, "class", "is-inline-block"); + attr(p, "class", "menu-label"); + }, + m(target, anchor) { + insert(target, p, anchor); + append(p, a); + append(a, t); + dispose = listen(a, "click", handleLink); + }, + p(ctx, dirty) { + if (dirty & /*tagActions*/ 4 && t_value !== (t_value = /*tag*/ ctx[10].title + "")) set_data(t, t_value); + + if (dirty & /*tagActions*/ 4 && a_href_value !== (a_href_value = buildHref(`#/rg~${slugify(/*tag*/ ctx[10].title)}`))) { + attr(a, "href", a_href_value); + } + }, + d(detaching) { + if (detaching) detach(p); + dispose(); + } + }; + } + + // (204:8) {#each tag.children as child} + function create_each_block_1$3(ctx) { + let current; + + const menuitem = new MenuItem({ + props: { + title: /*child*/ ctx[13].title, + actions: /*child*/ ctx[13].actions, + hidden: /*actionsCount*/ ctx[4] > 50, + parentSlug: slugify(/*tag*/ ctx[10].title) + } + }); + + return { + c() { + create_component(menuitem.$$.fragment); + }, + m(target, anchor) { + mount_component(menuitem, target, anchor); + current = true; + }, + p(ctx, dirty) { + const menuitem_changes = {}; + if (dirty & /*tagActions*/ 4) menuitem_changes.title = /*child*/ ctx[13].title; + if (dirty & /*tagActions*/ 4) menuitem_changes.actions = /*child*/ ctx[13].actions; + if (dirty & /*actionsCount*/ 16) menuitem_changes.hidden = /*actionsCount*/ ctx[4] > 50; + if (dirty & /*tagActions*/ 4) menuitem_changes.parentSlug = slugify(/*tag*/ ctx[10].title); + menuitem.$set(menuitem_changes); + }, + i(local) { + if (current) return; + transition_in(menuitem.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(menuitem.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(menuitem, detaching); + } + }; + } + + // (191:4) {#each tagActions as tag} + function create_each_block$6(ctx) { + let t0; + let ul; + let t1; + let current; + let if_block = /*tag*/ ctx[10].title && create_if_block$e(ctx); + let each_value_1 = /*tag*/ ctx[10].children; + let each_blocks = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1$3(get_each_context_1$3(ctx, each_value_1, i)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + + return { + c() { + if (if_block) if_block.c(); + t0 = space(); + ul = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t1 = space(); + attr(ul, "class", "menu-list"); + }, + m(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert(target, t0, anchor); + insert(target, ul, anchor); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(ul, null); + } + + append(ul, t1); + current = true; + }, + p(ctx, dirty) { + if (/*tag*/ ctx[10].title) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$e(ctx); + if_block.c(); + if_block.m(t0.parentNode, t0); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + + if (dirty & /*tagActions, actionsCount, slugify*/ 20) { + each_value_1 = /*tag*/ ctx[10].children; + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1$3(ctx, each_value_1, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block_1$3(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(ul, t1); + } + } + + group_outros(); + + for (i = each_value_1.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } + }, + i(local) { + if (current) return; + + for (let i = 0; i < each_value_1.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach(t0); + if (detaching) detach(ul); + destroy_each(each_blocks, detaching); + } + }; + } + + function create_fragment$k(ctx) { + let aside; + let section; + let div1; + let div0; + let p0; + let input; + let t0; + let span; + let t1; + let div2; + let p1; + let a; + let t2; + let a_href_value; + let t3; + let t4; + let current; + let dispose; + let if_block = /*query*/ ctx[0] === "" && create_if_block_1$b(ctx); + let each_value = /*tagActions*/ ctx[2]; + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i)); + } + + const out = i => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + + return { + c() { + aside = element("aside"); + section = element("section"); + div1 = element("div"); + div0 = element("div"); + p0 = element("p"); + input = element("input"); + t0 = space(); + span = element("span"); + span.innerHTML = ``; + t1 = space(); + div2 = element("div"); + p1 = element("p"); + a = element("a"); + t2 = text(/*title*/ ctx[1]); + t3 = space(); + if (if_block) if_block.c(); + t4 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + attr(input, "id", "search-input-text"); + attr(input, "class", "input is-rounded svelte-fvssqr"); + attr(input, "placeholder", "Filter by path, method, and title..."); + attr(span, "class", "icon is-right icon-input-search svelte-fvssqr"); + attr(p0, "class", "control has-icons-right"); + attr(div0, "class", "field"); + attr(div1, "class", "hero-body svelte-fvssqr"); + toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]); + attr(section, "class", "hero is-sticky svelte-fvssqr"); + toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]); + attr(a, "href", a_href_value = buildHref("")); + attr(p1, "class", "menu-label"); + attr(div2, "class", "menu-wrapper svelte-fvssqr"); + attr(aside, "class", "menu svelte-fvssqr"); + toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]); + }, + m(target, anchor) { + insert(target, aside, anchor); + append(aside, section); + append(section, div1); + append(div1, div0); + append(div0, p0); + append(p0, input); + set_input_value(input, /*query*/ ctx[0]); + append(p0, t0); + append(p0, span); + append(aside, t1); + append(aside, div2); + append(div2, p1); + append(p1, a); + append(a, t2); + append(div2, t3); + if (if_block) if_block.m(div2, null); + append(div2, t4); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(div2, null); + } + + current = true; + + dispose = [ + listen(input, "input", /*input_input_handler*/ ctx[9]), + listen(span, "click", function () { + if (is_function(/*searchClick*/ ctx[8])) /*searchClick*/ ctx[8].apply(this, arguments); + }), + listen(a, "click", prevent_default(function () { + if (is_function(/*tocClick*/ ctx[7])) /*tocClick*/ ctx[7].apply(this, arguments); + })) + ]; + }, + p(new_ctx, [dirty]) { + ctx = new_ctx; + + if (dirty & /*query*/ 1 && input.value !== /*query*/ ctx[0]) { + set_input_value(input, /*query*/ ctx[0]); + } + + if (dirty & /*isDarkmode*/ 64) { + toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]); + } + + if (dirty & /*isDarkmode*/ 64) { + toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]); + } + + if (!current || dirty & /*title*/ 2) set_data(t2, /*title*/ ctx[1]); + + if (/*query*/ ctx[0] === "") { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block_1$b(ctx); + if_block.c(); + if_block.m(div2, t4); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + + if (dirty & /*tagActions, actionsCount, slugify, buildHref, handleLink*/ 20) { + each_value = /*tagActions*/ ctx[2]; + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$6(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block$6(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(div2, null); + } + } + + group_outros(); + + for (i = each_value.length; i < each_blocks.length; i += 1) { + out(i); + } + + check_outros(); + } + + if (dirty & /*isCollapsed*/ 32) { + toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]); + } + }, + i(local) { + if (current) return; + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + + current = true; + }, + o(local) { + each_blocks = each_blocks.filter(Boolean); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + + current = false; + }, + d(detaching) { + if (detaching) detach(aside); + if (if_block) if_block.d(); + destroy_each(each_blocks, detaching); + run_all(dispose); + } + }; + } + + function headerLink(text) { + return text.toLowerCase().replace(/\s/g, "-"); + } + + function instance$k($$self, $$props, $$invalidate) { + let { title } = $$props; + let { tagActions = [] } = $$props; + let { tagHeaders = [] } = $$props; + let { actionsCount } = $$props; + let { isCollapsed } = $$props; + let { isDarkmode } = $$props; + let { tocClick } = $$props; + let { searchClick } = $$props; + let { query } = $$props; + + function input_input_handler() { + query = this.value; + $$invalidate(0, query); + } + + $$self.$set = $$props => { + if ("title" in $$props) $$invalidate(1, title = $$props.title); + if ("tagActions" in $$props) $$invalidate(2, tagActions = $$props.tagActions); + if ("tagHeaders" in $$props) $$invalidate(3, tagHeaders = $$props.tagHeaders); + if ("actionsCount" in $$props) $$invalidate(4, actionsCount = $$props.actionsCount); + if ("isCollapsed" in $$props) $$invalidate(5, isCollapsed = $$props.isCollapsed); + if ("isDarkmode" in $$props) $$invalidate(6, isDarkmode = $$props.isDarkmode); + if ("tocClick" in $$props) $$invalidate(7, tocClick = $$props.tocClick); + if ("searchClick" in $$props) $$invalidate(8, searchClick = $$props.searchClick); + if ("query" in $$props) $$invalidate(0, query = $$props.query); + }; + + return [ + query, + title, + tagActions, + tagHeaders, + actionsCount, + isCollapsed, + isDarkmode, + tocClick, + searchClick, + input_input_handler + ]; + } + + class MenuPanel extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-fvssqr-style")) add_css$a(); + + init(this, options, instance$k, create_fragment$k, safe_not_equal, { + title: 1, + tagActions: 2, + tagHeaders: 3, + actionsCount: 4, + isCollapsed: 5, + isDarkmode: 6, + tocClick: 7, + searchClick: 8, + query: 0 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/components/LogoutButton.svelte generated by Svelte v3.19.2 */ + + function create_fragment$l(ctx) { + let a; + let dispose; + + return { + c() { + a = element("a"); + + a.innerHTML = ` + Logout`; + + attr(a, "href", "javascript:void(0)"); + attr(a, "class", "button is-light"); + }, + m(target, anchor) { + insert(target, a, anchor); + dispose = listen(a, "click", /*handleClick*/ ctx[0]); + }, + p: noop, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(a); + dispose(); + } + }; + } + + function instance$l($$self, $$props, $$invalidate) { + let $env; + component_subscribe($$self, env, $$value => $$invalidate(1, $env = $$value)); + + function handleClick() { + auth.remove($env); + removeToken($env); + removeRefreshToken($env); + } + + return [handleClick]; + } + + class LogoutButton extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance$l, create_fragment$l, safe_not_equal, {}); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter/panels/SelectorPanel.svelte generated by Svelte v3.19.2 */ + + function add_css$b() { + var style = element("style"); + style.id = "svelte-cjzzpf-style"; + style.textContent = ".icon-info.svelte-cjzzpf{cursor:pointer}.content.svelte-cjzzpf{padding:1rem 1.5rem}"; + append(document.head, style); + } + + function get_each_context$7(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[10] = list[i]; + return child_ctx; + } + + // (52:0) {#if isAuth(environment, 'oauth2')} + function create_if_block_1$c(ctx) { + let current_block_type_index; + let if_block; + let if_block_anchor; + let current; + const if_block_creators = [create_if_block_2$7, create_if_block_3$3, create_else_block_1$2]; + const if_blocks = []; + + function select_block_type(ctx, dirty) { + if (/*authenticating*/ ctx[1]) return 0; + if (/*authenticated*/ ctx[3]) return 1; + return 2; + } + + current_block_type_index = select_block_type(ctx, -1); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + + return { + c() { + if_block.c(); + if_block_anchor = empty(); + }, + m(target, anchor) { + if_blocks[current_block_type_index].m(target, anchor); + insert(target, if_block_anchor, anchor); + current = true; + }, + p(ctx, dirty) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx, dirty); + + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } else { + group_outros(); + + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + + check_outros(); + if_block = if_blocks[current_block_type_index]; + + if (!if_block) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + if_block.c(); + } + + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + i(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach(if_block_anchor); + } + }; + } + + // (67:2) {:else} + function create_else_block_1$2(ctx) { + let div1; + let div0; + let p; + let current; + + const loginbutton = new LoginButton({ + props: { + authOptions: /*environment*/ ctx[5].auth.options, + isPKCE: isPKCE(/*environment*/ ctx[5]), + pkceChallenge: /*pkceChallenge*/ ctx[2] + } + }); + + return { + c() { + div1 = element("div"); + div0 = element("div"); + p = element("p"); + create_component(loginbutton.$$.fragment); + attr(p, "class", "control"); + attr(div0, "class", "field is-grouped"); + attr(div1, "class", "navbar-item"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, div0); + append(div0, p); + mount_component(loginbutton, p, null); + current = true; + }, + p(ctx, dirty) { + const loginbutton_changes = {}; + if (dirty & /*environment*/ 32) loginbutton_changes.authOptions = /*environment*/ ctx[5].auth.options; + if (dirty & /*environment*/ 32) loginbutton_changes.isPKCE = isPKCE(/*environment*/ ctx[5]); + if (dirty & /*pkceChallenge*/ 4) loginbutton_changes.pkceChallenge = /*pkceChallenge*/ ctx[2]; + loginbutton.$set(loginbutton_changes); + }, + i(local) { + if (current) return; + transition_in(loginbutton.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(loginbutton.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(div1); + destroy_component(loginbutton); + } + }; + } + + // (59:26) + function create_if_block_3$3(ctx) { + let div1; + let div0; + let p; + let current; + const logoutbutton = new LogoutButton({}); + + return { + c() { + div1 = element("div"); + div0 = element("div"); + p = element("p"); + create_component(logoutbutton.$$.fragment); + attr(p, "class", "control"); + attr(div0, "class", "field is-grouped"); + attr(div1, "class", "navbar-item"); + }, + m(target, anchor) { + insert(target, div1, anchor); + append(div1, div0); + append(div0, p); + mount_component(logoutbutton, p, null); + current = true; + }, + p: noop, + i(local) { + if (current) return; + transition_in(logoutbutton.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(logoutbutton.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(div1); + destroy_component(logoutbutton); + } + }; + } + + // (53:2) {#if authenticating} + function create_if_block_2$7(ctx) { + let div; + + return { + c() { + div = element("div"); + div.innerHTML = ``; + attr(div, "class", "navbar-item"); + }, + m(target, anchor) { + insert(target, div, anchor); + }, + p: noop, + i: noop, + o: noop, + d(detaching) { + if (detaching) detach(div); + } + }; + } + + // (87:4) {#each Object.keys(environments) as envName} + function create_each_block$7(ctx) { + let a; + let t0_value = /*envName*/ ctx[10] + ""; + let t0; + let t1; + let a_data_name_value; + let dispose; + + return { + c() { + a = element("a"); + t0 = text(t0_value); + t1 = space(); + attr(a, "data-name", a_data_name_value = /*envName*/ ctx[10]); + attr(a, "href", "javascript:void(0)"); + attr(a, "class", "navbar-item"); + }, + m(target, anchor) { + insert(target, a, anchor); + append(a, t0); + append(a, t1); + dispose = listen(a, "click", /*handleClick*/ ctx[7]); + }, + p(ctx, dirty) { + if (dirty & /*environments*/ 1 && t0_value !== (t0_value = /*envName*/ ctx[10] + "")) set_data(t0, t0_value); + + if (dirty & /*environments*/ 1 && a_data_name_value !== (a_data_name_value = /*envName*/ ctx[10])) { + attr(a, "data-name", a_data_name_value); + } + }, + d(detaching) { + if (detaching) detach(a); + dispose(); + } + }; + } + + // (113:8) {:else} + function create_else_block$7(ctx) { + let span; + + return { + c() { + span = element("span"); + span.textContent = "None"; + attr(span, "class", "is-capitalized"); + }, + m(target, anchor) { + insert(target, span, anchor); + }, + p: noop, + d(detaching) { + if (detaching) detach(span); + } + }; + } + + // (111:8) {#if environment.auth} + function create_if_block$f(ctx) { + let span; + let t_value = /*environment*/ ctx[5].auth.name + ""; + let t; + + return { + c() { + span = element("span"); + t = text(t_value); + attr(span, "class", "is-capitalized"); + }, + m(target, anchor) { + insert(target, span, anchor); + append(span, t); + }, + p(ctx, dirty) { + if (dirty & /*environment*/ 32 && t_value !== (t_value = /*environment*/ ctx[5].auth.name + "")) set_data(t, t_value); + }, + d(detaching) { + if (detaching) detach(span); + } + }; + } + + function create_fragment$m(ctx) { + let show_if = isAuth(/*environment*/ ctx[5], "oauth2"); + let t0; + let div1; + let a0; + let t1; + let t2; + let div0; + let t3; + let div4; + let a1; + let t4; + let div3; + let div2; + let p0; + let t5; + let t6_value = /*environment*/ ctx[5].url + ""; + let t6; + let t7; + let p1; + let t8; + let current; + let dispose; + let if_block0 = show_if && create_if_block_1$c(ctx); + let each_value = Object.keys(/*environments*/ ctx[0]); + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$7(get_each_context$7(ctx, each_value, i)); + } + + function select_block_type_1(ctx, dirty) { + if (/*environment*/ ctx[5].auth) return create_if_block$f; + return create_else_block$7; + } + + let current_block_type = select_block_type_1(ctx, -1); + let if_block1 = current_block_type(ctx); + + return { + c() { + if (if_block0) if_block0.c(); + t0 = space(); + div1 = element("div"); + a0 = element("a"); + t1 = text(/*$env*/ ctx[6]); + t2 = space(); + div0 = element("div"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t3 = space(); + div4 = element("div"); + a1 = element("a"); + a1.innerHTML = ``; + t4 = space(); + div3 = element("div"); + div2 = element("div"); + p0 = element("p"); + t5 = text("BaseURL: "); + t6 = text(t6_value); + t7 = space(); + p1 = element("p"); + t8 = text("Auth:\n "); + if_block1.c(); + attr(a0, "href", "javascript:void(0)"); + attr(a0, "class", "navbar-link"); + attr(div0, "class", "navbar-dropdown is-right"); + attr(div1, "class", "navbar-item has-dropdown is-capitalized"); + toggle_class(div1, "is-active", /*show*/ ctx[4]); + attr(a1, "href", "javascript:void(0)"); + attr(a1, "class", "navbar-link is-arrowless"); + attr(div2, "class", "content svelte-cjzzpf"); + attr(div3, "class", "navbar-dropdown is-right"); + attr(div4, "class", "navbar-item has-dropdown is-hoverable"); + }, + m(target, anchor) { + if (if_block0) if_block0.m(target, anchor); + insert(target, t0, anchor); + insert(target, div1, anchor); + append(div1, a0); + append(a0, t1); + append(div1, t2); + append(div1, div0); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(div0, null); + } + + insert(target, t3, anchor); + insert(target, div4, anchor); + append(div4, a1); + append(div4, t4); + append(div4, div3); + append(div3, div2); + append(div2, p0); + append(p0, t5); + append(p0, t6); + append(div2, t7); + append(div2, p1); + append(p1, t8); + if_block1.m(p1, null); + current = true; + dispose = listen(a0, "click", /*toggleClick*/ ctx[8]); + }, + p(ctx, [dirty]) { + if (dirty & /*environment*/ 32) show_if = isAuth(/*environment*/ ctx[5], "oauth2"); + + if (show_if) { + if (if_block0) { + if_block0.p(ctx, dirty); + transition_in(if_block0, 1); + } else { + if_block0 = create_if_block_1$c(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(t0.parentNode, t0); + } + } else if (if_block0) { + group_outros(); + + transition_out(if_block0, 1, 1, () => { + if_block0 = null; + }); + + check_outros(); + } + + if (!current || dirty & /*$env*/ 64) set_data(t1, /*$env*/ ctx[6]); + + if (dirty & /*Object, environments, handleClick*/ 129) { + each_value = Object.keys(/*environments*/ ctx[0]); + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$7(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$7(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(div0, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + + if (dirty & /*show*/ 16) { + toggle_class(div1, "is-active", /*show*/ ctx[4]); + } + + if ((!current || dirty & /*environment*/ 32) && t6_value !== (t6_value = /*environment*/ ctx[5].url + "")) set_data(t6, t6_value); + + if (current_block_type === (current_block_type = select_block_type_1(ctx, dirty)) && if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1.d(1); + if_block1 = current_block_type(ctx); + + if (if_block1) { + if_block1.c(); + if_block1.m(p1, null); + } + } + }, + i(local) { + if (current) return; + transition_in(if_block0); + current = true; + }, + o(local) { + transition_out(if_block0); + current = false; + }, + d(detaching) { + if (if_block0) if_block0.d(detaching); + if (detaching) detach(t0); + if (detaching) detach(div1); + destroy_each(each_blocks, detaching); + if (detaching) detach(t3); + if (detaching) detach(div4); + if_block1.d(); + dispose(); + } + }; + } + + function instance$m($$self, $$props, $$invalidate) { + let $env; + let $auth; + component_subscribe($$self, env, $$value => $$invalidate(6, $env = $$value)); + component_subscribe($$self, auth, $$value => $$invalidate(9, $auth = $$value)); + let { environments } = $$props; + let { authenticating } = $$props; + let { pkceChallenge } = $$props; + let authenticated = false; + let show = false; + + function handleClick(event) { + $$invalidate(4, show = false); + const envName = event.target.dataset["name"]; + env.set(envName); + const authToken = getToken($env); + + if (authToken) { + auth.add(envName); + token$1.set(authToken); + } else { + auth.remove(envName); + token$1.set(null); + } + } + + function toggleClick() { + $$invalidate(4, show = !show); + } + + $$self.$set = $$props => { + if ("environments" in $$props) $$invalidate(0, environments = $$props.environments); + if ("authenticating" in $$props) $$invalidate(1, authenticating = $$props.authenticating); + if ("pkceChallenge" in $$props) $$invalidate(2, pkceChallenge = $$props.pkceChallenge); + }; + + let environment; + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*environments, $env*/ 65) { + $$invalidate(5, environment = environments[$env]); + } + + if ($$self.$$.dirty & /*$auth, $env*/ 576) { + { + $$invalidate(3, authenticated = $auth.split(";").includes($env)); + } + } + }; + + return [ + environments, + authenticating, + pkceChallenge, + authenticated, + show, + environment, + $env, + handleClick, + toggleClick + ]; + } + + class SelectorPanel extends SvelteComponent { + constructor(options) { + super(); + if (!document.getElementById("svelte-cjzzpf-style")) add_css$b(); + + init(this, options, instance$m, create_fragment$m, safe_not_equal, { + environments: 0, + authenticating: 1, + pkceChallenge: 2 + }); + } + } + + /* usr/local/lib/node_modules/snowboard/templates/winter.svelte generated by Svelte v3.19.2 */ + + const { document: document_1 } = globals; + + function add_css$c() { + var style = element("style"); + style.id = "svelte-1s8fs56-style"; + style.textContent = "html{height:100%}body{min-height:100%}.sidenav.svelte-1s8fs56.svelte-1s8fs56{padding:1rem 0 1rem 0.75rem}.main.svelte-1s8fs56.svelte-1s8fs56{padding:3rem;background-color:#fff;box-shadow:0 2px 0 2px #f5f5f5}.main.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000;box-shadow:0 2px 0 2px #363636}.body-inner.svelte-1s8fs56.svelte-1s8fs56{min-height:100vh;background-color:#fafafa}.body-inner.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000}.is-darkmode .input, .is-darkmode .select select, .is-darkmode\n .textarea{background-color:#484848;border-color:#484848;color:#fff}.is-darkmode .input:hover, .is-darkmode\n .is-hovered.input, .is-darkmode .is-hovered.textarea, .is-darkmode\n .select\n select.is-hovered, .is-darkmode .select select:hover, .is-darkmode\n .textarea:hover{border-color:#666}.is-darkmode .select select.is-focused, .is-darkmode\n .select\n select:active, .is-darkmode .select select:focus, .is-darkmode\n .textarea:active, .is-darkmode .textarea:focus{border-color:#888}.is-darkmode .input::placeholder, .is-darkmode\n .select\n select::placeholder, .is-darkmode .textarea::placeholder{color:#ccc}code[class*=\"language-\"], pre[class*=\"language-\"]{font-family:monospace}.token.number, .token.tag{display:inline;padding:inherit;font-size:inherit;line-height:inherit;text-align:inherit;vertical-align:inherit;border-radius:inherit;font-weight:inherit;white-space:inherit;background:inherit;margin:inherit}.icon-brand.svelte-1s8fs56.svelte-1s8fs56{margin-right:0.5rem}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56{display:none;position:fixed;width:calc(25% - 0.5rem);height:calc(2.5rem + 10px);left:0;bottom:0;font-size:1.33333em;line-height:calc(2.5rem + 5px);text-align:center;color:#b5b5b5;font-weight:300;border-top:1px solid #eee;box-shadow:2px 0 0 #f5f5f5;cursor:pointer}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56:hover{background:rgba(0, 0, 0, 0.05);box-shadow:2px 0 0 #eee;border-color:#e8e8e8}.menu-collapsible.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{border-color:#363636;box-shadow:2px 0 0 #363636}.menu-collapsible.is-darkmode.svelte-1s8fs56.svelte-1s8fs56:hover{background:rgba(255, 255, 255, 0.2);border-color:#363636;box-shadow:2px 0 0 #363636}.footer.is-darkmode.svelte-1s8fs56.svelte-1s8fs56{background-color:#000}.footer.svelte-1s8fs56 .content.svelte-1s8fs56{transition:margin 0.3s}@media screen and (min-width: 768px){.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56{display:block}.is-collapsed.svelte-1s8fs56 .sidenav.svelte-1s8fs56{width:3.75rem}.is-collapsed.svelte-1s8fs56 .main.svelte-1s8fs56{width:calc(100% - 4.5rem)}.is-collapsed.svelte-1s8fs56 .menu-collapsible.svelte-1s8fs56{width:calc(3rem - 2px)}.menu-collapsible.svelte-1s8fs56.svelte-1s8fs56,.sidenav.svelte-1s8fs56.svelte-1s8fs56,.main.svelte-1s8fs56.svelte-1s8fs56{transition:width 0.3s}.content.svelte-1s8fs56.svelte-1s8fs56{scroll-margin:200px}}"; + append(document_1.head, style); + } + + // (412:6) + function create_default_slot_3(ctx) { + let span0; + let t0; + let span1; + let t1; + + return { + c() { + span0 = element("span"); + span0.innerHTML = ``; + t0 = space(); + span1 = element("span"); + t1 = text(/*title*/ ctx[0]); + attr(span0, "class", "icon icon-brand is-medium has-text-grey-light svelte-1s8fs56"); + attr(span1, "class", "title is-4"); + }, + m(target, anchor) { + insert(target, span0, anchor); + insert(target, t0, anchor); + insert(target, span1, anchor); + append(span1, t1); + }, + p(ctx, dirty) { + if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]); + }, + d(detaching) { + if (detaching) detach(span0); + if (detaching) detach(t0); + if (detaching) detach(span1); + } + }; + } + + // (435:8) {#if config.playground.enabled} + function create_if_block_3$4(ctx) { + let current; + + const selectorpanel = new SelectorPanel({ + props: { + environments: /*config*/ ctx[3].playground.environments, + pkceChallenge: /*challengePair*/ ctx[12], + authenticating: /*authenticating*/ ctx[6] + } + }); + + return { + c() { + create_component(selectorpanel.$$.fragment); + }, + m(target, anchor) { + mount_component(selectorpanel, target, anchor); + current = true; + }, + p(ctx, dirty) { + const selectorpanel_changes = {}; + if (dirty & /*config*/ 8) selectorpanel_changes.environments = /*config*/ ctx[3].playground.environments; + if (dirty & /*authenticating*/ 64) selectorpanel_changes.authenticating = /*authenticating*/ ctx[6]; + selectorpanel.$set(selectorpanel_changes); + }, + i(local) { + if (current) return; + transition_in(selectorpanel.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(selectorpanel.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(selectorpanel, detaching); + } + }; + } + + // (441:8) {#if darkMode.enable} + function create_if_block_2$8(ctx) { + let div; + let a; + let span; + let i; + let dispose; + + return { + c() { + div = element("div"); + a = element("a"); + span = element("span"); + i = element("i"); + attr(i, "class", "fas fa-lg"); + toggle_class(i, "fa-moon", /*darkMode*/ ctx[7].active); + toggle_class(i, "fa-sun", !/*darkMode*/ ctx[7].active); + attr(span, "class", "icon is-medium has-text-grey-light"); + attr(a, "href", "javascript:void(0)"); + attr(a, "title", "Dark Mode"); + attr(a, "class", "navbar-link is-arrowless"); + attr(div, "class", "navbar-item has-dropdown is-hoverable"); + }, + m(target, anchor) { + insert(target, div, anchor); + append(div, a); + append(a, span); + append(span, i); + dispose = listen(a, "click", /*darkToggle*/ ctx[16]); + }, + p(ctx, dirty) { + if (dirty & /*darkMode*/ 128) { + toggle_class(i, "fa-moon", /*darkMode*/ ctx[7].active); + } + + if (dirty & /*darkMode*/ 128) { + toggle_class(i, "fa-sun", !/*darkMode*/ ctx[7].active); + } + }, + d(detaching) { + if (detaching) detach(div); + dispose(); + } + }; + } + + // (481:8) {#if collapsed} + function create_if_block_1$d(ctx) { + let span; + + return { + c() { + span = element("span"); + span.textContent = "»"; + attr(span, "class", "icon"); + attr(span, "title", "Expand ["); + }, + m(target, anchor) { + insert(target, span, anchor); + }, + d(detaching) { + if (detaching) detach(span); + } + }; + } + + // (484:8) {#if !collapsed} + function create_if_block$g(ctx) { + let span0; + let t1; + let span1; + + return { + c() { + span0 = element("span"); + span0.textContent = "«"; + t1 = space(); + span1 = element("span"); + span1.textContent = "Collapse sidebar"; + attr(span0, "class", "icon"); + attr(span1, "class", "fa-xs"); + }, + m(target, anchor) { + insert(target, span0, anchor); + insert(target, t1, anchor); + insert(target, span1, anchor); + }, + d(detaching) { + if (detaching) detach(span0); + if (detaching) detach(t1); + if (detaching) detach(span1); + } + }; + } + + // (495:8) + function create_default_slot_2(ctx) { + let current; + + const home = new Home({ + props: { + title: /*title*/ ctx[0], + description: /*description*/ ctx[1] + } + }); + + return { + c() { + create_component(home.$$.fragment); + }, + m(target, anchor) { + mount_component(home, target, anchor); + current = true; + }, + p(ctx, dirty) { + const home_changes = {}; + if (dirty & /*title*/ 1) home_changes.title = /*title*/ ctx[0]; + if (dirty & /*description*/ 2) home_changes.description = /*description*/ ctx[1]; + home.$set(home_changes); + }, + i(local) { + if (current) return; + transition_in(home.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(home.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(home, detaching); + } + }; + } + + // (498:8) + function create_default_slot_1(ctx) { + let current; + + const action_1 = new Action({ + props: { + action: /*action*/ ctx[8], + config: /*config*/ ctx[3], + environment: /*environment*/ ctx[11], + challengePair: /*challengePair*/ ctx[12], + darkMode: /*darkMode*/ ctx[7] + } + }); + + return { + c() { + create_component(action_1.$$.fragment); + }, + m(target, anchor) { + mount_component(action_1, target, anchor); + current = true; + }, + p(ctx, dirty) { + const action_1_changes = {}; + if (dirty & /*action*/ 256) action_1_changes.action = /*action*/ ctx[8]; + if (dirty & /*config*/ 8) action_1_changes.config = /*config*/ ctx[3]; + if (dirty & /*environment*/ 2048) action_1_changes.environment = /*environment*/ ctx[11]; + if (dirty & /*darkMode*/ 128) action_1_changes.darkMode = /*darkMode*/ ctx[7]; + action_1.$set(action_1_changes); + }, + i(local) { + if (current) return; + transition_in(action_1.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(action_1.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(action_1, detaching); + } + }; + } + + // (494:6) + function create_default_slot$2(ctx) { + let t; + let current; + + const route0 = new Route({ + props: { + exact: true, + $$slots: { default: [create_default_slot_2] }, + $$scope: { ctx } + } + }); + + const route1 = new Route({ + props: { + exact: true, + path: "/:slug", + $$slots: { default: [create_default_slot_1] }, + $$scope: { ctx } + } + }); + + return { + c() { + create_component(route0.$$.fragment); + t = space(); + create_component(route1.$$.fragment); + }, + m(target, anchor) { + mount_component(route0, target, anchor); + insert(target, t, anchor); + mount_component(route1, target, anchor); + current = true; + }, + p(ctx, dirty) { + const route0_changes = {}; + + if (dirty & /*$$scope, title, description*/ 16777219) { + route0_changes.$$scope = { dirty, ctx }; + } + + route0.$set(route0_changes); + const route1_changes = {}; + + if (dirty & /*$$scope, action, config, environment, darkMode*/ 16779656) { + route1_changes.$$scope = { dirty, ctx }; + } + + route1.$set(route1_changes); + }, + i(local) { + if (current) return; + transition_in(route0.$$.fragment, local); + transition_in(route1.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(route0.$$.fragment, local); + transition_out(route1.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(route0, detaching); + if (detaching) detach(t); + destroy_component(route1, detaching); + } + }; + } + + function create_fragment$n(ctx) { + let div8; + let nav; + let div0; + let t0; + let a0; + let t3; + let div2; + let div1; + let t4; + let t5; + let div6; + let div4; + let t6; + let div3; + let t7; + let t8; + let div5; + let t9; + let footer; + let div7; + let p; + let strong0; + let t10; + let t11; + let a1; + let current; + let dispose; + + const link = new Link({ + props: { + href: "/", + class: "navbar-item", + $$slots: { default: [create_default_slot_3] }, + $$scope: { ctx } + } + }); + + let if_block0 = /*config*/ ctx[3].playground.enabled && create_if_block_3$4(ctx); + let if_block1 = /*darkMode*/ ctx[7].enable && create_if_block_2$8(ctx); + + const menupanel = new MenuPanel({ + props: { + title: /*title*/ ctx[0], + tagActions: /*filteredActions*/ ctx[10], + tagHeaders: toc(/*description*/ ctx[1]), + currentSlug: /*action*/ ctx[8] && /*action*/ ctx[8].slug, + actionsCount: /*actions*/ ctx[2].length, + isCollapsed: /*collapsed*/ ctx[5], + isDarkmode: /*darkMode*/ ctx[7].active, + query: /*query*/ ctx[9], + tocClick, + searchClick: /*searchClick*/ ctx[15] + } + }); + + let if_block2 = /*collapsed*/ ctx[5] && create_if_block_1$d(ctx); + let if_block3 = !/*collapsed*/ ctx[5] && create_if_block$g(ctx); + + const router_1 = new Router({ + props: { + $$slots: { default: [create_default_slot$2] }, + $$scope: { ctx } + } + }); + + return { + c() { + div8 = element("div"); + nav = element("nav"); + div0 = element("div"); + create_component(link.$$.fragment); + t0 = space(); + a0 = element("a"); + + a0.innerHTML = ` + + `; + + t3 = space(); + div2 = element("div"); + div1 = element("div"); + if (if_block0) if_block0.c(); + t4 = space(); + if (if_block1) if_block1.c(); + t5 = space(); + div6 = element("div"); + div4 = element("div"); + create_component(menupanel.$$.fragment); + t6 = space(); + div3 = element("div"); + if (if_block2) if_block2.c(); + t7 = space(); + if (if_block3) if_block3.c(); + t8 = space(); + div5 = element("div"); + create_component(router_1.$$.fragment); + t9 = space(); + footer = element("footer"); + div7 = element("div"); + p = element("p"); + strong0 = element("strong"); + t10 = text(/*title*/ ctx[0]); + t11 = text("\n powered by\n "); + a1 = element("a"); + a1.innerHTML = `Snowboard.`; + attr(a0, "href", "javascript:void(0)"); + attr(a0, "role", "button"); + attr(a0, "class", "navbar-burger"); + attr(a0, "aria-label", "menu"); + attr(a0, "aria-expanded", "false"); + attr(a0, "data-target", "mainnav"); + attr(div0, "class", "navbar-brand"); + attr(div1, "class", "navbar-end"); + attr(div2, "class", "navbar-menu"); + attr(nav, "class", "navbar is-fixed-top has-shadow"); + attr(nav, "role", "navigation"); + attr(nav, "aria-label", "main navigation"); + attr(div3, "class", "menu-collapsible svelte-1s8fs56"); + toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[7].active); + attr(div4, "class", "column is-one-quarter sidenav svelte-1s8fs56"); + attr(div4, "id", "mainnav"); + toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[4]); + attr(div5, "class", "column is-three-quarters main svelte-1s8fs56"); + toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[7].active); + attr(div6, "class", "columns svelte-1s8fs56"); + toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[5]); + attr(a1, "href", "https://github.com/bukalapak/snowboard"); + attr(a1, "target", "_blank"); + attr(div7, "class", "content column is-paddingless has-text-centered svelte-1s8fs56"); + toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[5]); + attr(footer, "class", "footer svelte-1s8fs56"); + toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[7].active); + attr(div8, "class", "body-inner svelte-1s8fs56"); + toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[7].active); + }, + m(target, anchor) { + insert(target, div8, anchor); + append(div8, nav); + append(nav, div0); + mount_component(link, div0, null); + append(div0, t0); + append(div0, a0); + append(nav, t3); + append(nav, div2); + append(div2, div1); + if (if_block0) if_block0.m(div1, null); + append(div1, t4); + if (if_block1) if_block1.m(div1, null); + append(div8, t5); + append(div8, div6); + append(div6, div4); + mount_component(menupanel, div4, null); + append(div4, t6); + append(div4, div3); + if (if_block2) if_block2.m(div3, null); + append(div3, t7); + if (if_block3) if_block3.m(div3, null); + append(div6, t8); + append(div6, div5); + mount_component(router_1, div5, null); + append(div8, t9); + append(div8, footer); + append(footer, div7); + append(div7, p); + append(p, strong0); + append(strong0, t10); + append(p, t11); + append(p, a1); + current = true; + + dispose = [ + listen(a0, "click", /*burgerClick*/ ctx[13]), + listen(div3, "click", /*collapseToggle*/ ctx[14]) + ]; + }, + p(ctx, [dirty]) { + const link_changes = {}; + + if (dirty & /*$$scope, title*/ 16777217) { + link_changes.$$scope = { dirty, ctx }; + } + + link.$set(link_changes); + + if (/*config*/ ctx[3].playground.enabled) { + if (if_block0) { + if_block0.p(ctx, dirty); + transition_in(if_block0, 1); + } else { + if_block0 = create_if_block_3$4(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(div1, t4); + } + } else if (if_block0) { + group_outros(); + + transition_out(if_block0, 1, 1, () => { + if_block0 = null; + }); + + check_outros(); + } + + if (/*darkMode*/ ctx[7].enable) { + if (if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1 = create_if_block_2$8(ctx); + if_block1.c(); + if_block1.m(div1, null); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + + const menupanel_changes = {}; + if (dirty & /*title*/ 1) menupanel_changes.title = /*title*/ ctx[0]; + if (dirty & /*filteredActions*/ 1024) menupanel_changes.tagActions = /*filteredActions*/ ctx[10]; + if (dirty & /*description*/ 2) menupanel_changes.tagHeaders = toc(/*description*/ ctx[1]); + if (dirty & /*action*/ 256) menupanel_changes.currentSlug = /*action*/ ctx[8] && /*action*/ ctx[8].slug; + if (dirty & /*actions*/ 4) menupanel_changes.actionsCount = /*actions*/ ctx[2].length; + if (dirty & /*collapsed*/ 32) menupanel_changes.isCollapsed = /*collapsed*/ ctx[5]; + if (dirty & /*darkMode*/ 128) menupanel_changes.isDarkmode = /*darkMode*/ ctx[7].active; + if (dirty & /*query*/ 512) menupanel_changes.query = /*query*/ ctx[9]; + menupanel.$set(menupanel_changes); + + if (/*collapsed*/ ctx[5]) { + if (!if_block2) { + if_block2 = create_if_block_1$d(ctx); + if_block2.c(); + if_block2.m(div3, t7); + } else { + + } + } else if (if_block2) { + if_block2.d(1); + if_block2 = null; + } + + if (!/*collapsed*/ ctx[5]) { + if (!if_block3) { + if_block3 = create_if_block$g(ctx); + if_block3.c(); + if_block3.m(div3, null); + } else { + + } + } else if (if_block3) { + if_block3.d(1); + if_block3 = null; + } + + if (dirty & /*darkMode*/ 128) { + toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[7].active); + } + + if (dirty & /*showMenu*/ 16) { + toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[4]); + } + + const router_1_changes = {}; + + if (dirty & /*$$scope, action, config, environment, darkMode, title, description*/ 16779659) { + router_1_changes.$$scope = { dirty, ctx }; + } + + router_1.$set(router_1_changes); + + if (dirty & /*darkMode*/ 128) { + toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[7].active); + } + + if (dirty & /*collapsed*/ 32) { + toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[5]); + } + + if (!current || dirty & /*title*/ 1) set_data(t10, /*title*/ ctx[0]); + + if (dirty & /*collapsed*/ 32) { + toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[5]); + } + + if (dirty & /*darkMode*/ 128) { + toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[7].active); + } + + if (dirty & /*darkMode*/ 128) { + toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[7].active); + } + }, + i(local) { + if (current) return; + transition_in(link.$$.fragment, local); + transition_in(if_block0); + transition_in(menupanel.$$.fragment, local); + transition_in(router_1.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(link.$$.fragment, local); + transition_out(if_block0); + transition_out(menupanel.$$.fragment, local); + transition_out(router_1.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) detach(div8); + destroy_component(link); + if (if_block0) if_block0.d(); + if (if_block1) if_block1.d(); + destroy_component(menupanel); + if (if_block2) if_block2.d(); + if (if_block3) if_block3.d(); + destroy_component(router_1); + run_all(dispose); + } + }; + } + + function getQuery(slug) { + if (!slug) return ""; + + if (slug.startsWith("rg~")) { + const tagPrefix = slug.substr(0, 2); + const tagSlug = slug.substr(3); + return `${tagPrefix}:${tagSlug}`; + } + + if (slug.startsWith("g~")) { + const groupPrefix = slug.substr(0, 1); + const groupSlug = slug.substr(2); + return `${groupPrefix}:${groupSlug}`; + } + + return ""; + } + + function tocClick(event) { + navigateTo("/"); + let href = event.target.getAttribute("href"); + const target = document.getElementById(href.substr(1)); + window.scrollTo(0, target ? target.offsetTop - 80 : 20); + } + + function instance$n($$self, $$props, $$invalidate) { + let $router; + let $env; + component_subscribe($$self, router, $$value => $$invalidate(18, $router = $$value)); + component_subscribe($$self, env, $$value => $$invalidate(19, $env = $$value)); + Router.hashchange = true; let { title } = $$props; let { description } = $$props; let { actions } = $$props; let { tagActions } = $$props; let { config } = $$props; - let index = -1; - function handleClick(event) { - let target = event.target; - - if (target.nodeName == "SPAN") { - target = target.parentElement; - } - - const slug = target.dataset["slug"]; - $$invalidate(12, index = actions.findIndex(el => el.slug === slug)); - document.body.scrollTop = document.documentElement.scrollTop = 0; + function findAction(slug) { + return actions.find(el => el.slug === slug); } - function handleGroupClick(event) { - const groupSlug = event.target.dataset["slug"]; - const firstAction = firstGroupAction(groupSlug); + function getAction(slug) { + if (!slug) return; - if (firstAction) { - const slug = firstAction.slug; - $$invalidate(12, index = actions.findIndex(el => el.slug === slug)); - $$invalidate(8, query = `g:${groupSlug}`); - document.body.scrollTop = document.documentElement.scrollTop = 0; + if (slug.startsWith("rg~")) { + const tagSlug = slug.substr(3); + const firstGroup = firstTagGroup(tagSlug); + + if (firstGroup) { + const groupSlug = `${tagSlug}~${slugify(firstGroup.title)}`; + const selected = firstGroupAction(groupSlug); + return findAction(selected.slug); + } + + return; + } + + if (slug.startsWith("g~")) { + const groupSlug = slug.substr(2); + const selected = firstGroupAction(groupSlug); + return findAction(selected.slug); + } + + return findAction(slug); + } + + function firstTagGroup(tagSlug) { + let matches = []; + + tagActions.forEach(tag => { + if (slugify(tag.title) === tagSlug) { + matches.push(tag); + } + }); + + if (matches.length > 0) { + return matches[0].children[0]; } } function firstGroupAction(groupSlug) { let matches = []; + const slugs = groupSlug.split("~"); tagActions.forEach(tag => { - matches = matches.concat(tag.children.filter(child => slugify(child.title) === groupSlug)); + matches = matches.concat(tag.children.filter(child => slugify(child.title) === slugs[1] && slugify(tag.title) === slugs[0])); }); if (matches.length > 0) { @@ -17746,12 +23938,6 @@ } } - function tocClick(event) { - $$invalidate(12, index = -1); - let href = event.target.getAttribute("href"); - pushHistory(href); - } - if (config.playground.enabled) { const savedEnv = getEnv(); @@ -17765,21 +23951,21 @@ if (authToken) { auth.add($env); - token.set(authToken); + token$1.set(authToken); } } let showMenu = true; let collapsed = false; let authenticating = false; - let query = ""; + let challengePair = getPKCE(); function burgerClick() { - $$invalidate(5, showMenu = !showMenu); + $$invalidate(4, showMenu = !showMenu); } function collapseToggle() { - $$invalidate(6, collapsed = !collapsed); + $$invalidate(5, collapsed = !collapsed); } function searchClick() { @@ -17800,7 +23986,7 @@ }; function darkToggle() { - $$invalidate(9, darkMode.active = !darkMode.active, darkMode); + $$invalidate(7, darkMode.active = !darkMode.active, darkMode); document.getElementById(`bulma-theme-${darkMode.mode[Number(!darkMode.active)]}`).media = "none"; document.getElementById(`bulma-theme-${darkMode.mode[Number(darkMode.active)]}`).media = ""; darkMode.store.setItem(darkMode.toggle, darkMode.mode[Number(darkMode.active)]); @@ -17815,41 +24001,25 @@ const authParam = querystringify_1.parse(location.search); if (authParam.code) { - $$invalidate(7, authenticating = true); - pushHistory(basePath(config)); - const { accessToken, refreshToken } = await exchangeToken(authParam.code, environment.auth.options); + $$invalidate(6, authenticating = true); + navigateTo(config.basePath); + const { accessToken, refreshToken } = await exchangeToken(authParam.code, environment.auth.options, isPKCE(environment), challengePair); if (accessToken) { setToken($env, accessToken); auth.add($env); - token.set(accessToken); + token$1.set(accessToken); if (refreshToken) { setRefreshToken($env, refreshToken); } } - $$invalidate(7, authenticating = false); + $$invalidate(6, authenticating = false); + clearPKCE(); + clearState(); } } - - const hash = location.hash; - - if (hash.match("#/")) { - let slug = hash.replace("#/", ""); - - if (slug.startsWith("g~")) { - const groupSlug = slug.substr(2); - const firstAction = firstGroupAction(groupSlug); - - if (firstAction) { - slug = firstAction.slug; - $$invalidate(8, query = `g:${groupSlug}`); - } - } - - $$invalidate(12, index = actions.findIndex(el => el.slug === slug)); - } }); document.onkeyup = function (e) { @@ -17862,25 +24032,35 @@ if ("title" in $$props) $$invalidate(0, title = $$props.title); if ("description" in $$props) $$invalidate(1, description = $$props.description); if ("actions" in $$props) $$invalidate(2, actions = $$props.actions); - if ("tagActions" in $$props) $$invalidate(3, tagActions = $$props.tagActions); - if ("config" in $$props) $$invalidate(4, config = $$props.config); + if ("tagActions" in $$props) $$invalidate(17, tagActions = $$props.tagActions); + if ("config" in $$props) $$invalidate(3, config = $$props.config); }; - let currentAction; + let action; + let query; + let filteredActions; let environment; $$self.$$.update = () => { - if ($$self.$$.dirty & /*actions, index*/ 4100) { - $$invalidate(10, currentAction = actions[index]); + if ($$self.$$.dirty & /*$router*/ 262144) { + $$invalidate(8, action = getAction($router.params.slug)); } - if ($$self.$$.dirty & /*currentAction, title*/ 1025) { + if ($$self.$$.dirty & /*$router*/ 262144) { + $$invalidate(9, query = getQuery($router.params.slug)); + } + + if ($$self.$$.dirty & /*tagActions, query*/ 131584) { + $$invalidate(10, filteredActions = filterActions(tagActions, query)); + } + + if ($$self.$$.dirty & /*action, title*/ 257) { { - document.title = currentAction && `${currentAction.title} - ${title}` || title; + document.title = action && `${action.title} - ${title}` || title; } } - if ($$self.$$.dirty & /*config, $env*/ 1048592) { + if ($$self.$$.dirty & /*config, $env*/ 524296) { $$invalidate(11, environment = config.playground.enabled && config.playground.environments[$env]); } }; @@ -17889,44 +24069,42 @@ title, description, actions, - tagActions, config, showMenu, collapsed, authenticating, - query, darkMode, - currentAction, + action, + query, + filteredActions, environment, - index, - handleClick, - handleGroupClick, - tocClick, + challengePair, burgerClick, collapseToggle, searchClick, - darkToggle + darkToggle, + tagActions ]; } class Winter extends SvelteComponent { constructor(options) { super(); - if (!document_1.getElementById("svelte-1jcck2f-style")) add_css$9(); + if (!document_1.getElementById("svelte-1s8fs56-style")) add_css$c(); - init(this, options, instance$i, create_fragment$i, safe_not_equal, { + init(this, options, instance$n, create_fragment$n, safe_not_equal, { title: 0, description: 1, actions: 2, - tagActions: 3, - config: 4 + tagActions: 17, + config: 3 }); } } const app = new Winter({ target: document.body, - props: {"title":"mailcow API","description":"mailcow is complete e-mailing solution with advanced antispam, antivirus, nice UI and API.\n\nIn order to use this API you have to create a API key and add your IP address to the whitelist of allowed IPs this can be done by logging into the Mailcow UI using your admin account, then go to Configuration > Access > Edit administrator details > API. There you will find a collapsed API menu.\n\n**This documentation is in Work In Progress status. It contains only few endpoints.**","version":"","servers":[{"url":"https://mailcow.host/"}],"tags":[{"title":"Domains","description":"","children":[{"title":"Get domains","description":"","children":[]},{"title":"Create domain","description":"","children":[]},{"title":"Update domain","description":"","children":[]},{"title":"Delete domain","description":"","children":[]}]},{"title":"Domain antispam policies","description":"You can create antispam whitelist and blacklist policies","children":[{"title":"List whitelist domain policy","description":"","children":[]},{"title":"List blacklist domain policy","description":"","children":[]},{"title":"Create domain policy","description":"","children":[]},{"title":"Delete domain policy","description":"","children":[]}]},{"title":"Mailboxes","description":"","children":[{"title":"Get mailboxes","description":"","children":[]},{"title":"Create mailbox","description":"","children":[]},{"title":"Update mailbox","description":"","children":[]},{"title":"Delete mailbox","description":"","children":[]},{"title":"Quarantine Notifications","description":"","children":[]}]},{"title":"Aliases","description":"","children":[{"title":"Get aliases","description":"","children":[]},{"title":"Create alias","description":"","children":[]},{"title":"Update alias","description":"","children":[]},{"title":"Delete alias","description":"","children":[]}]},{"title":"Sync jobs","description":"","children":[{"title":"Get sync jobs","description":"","children":[]},{"title":"Create sync job","description":"","children":[]},{"title":"Update sync job","description":"","children":[]},{"title":"Delete sync job","description":"","children":[]}]},{"title":"Fordwarding Hosts","description":"","children":[{"title":"Get Forwarding Hosts","description":"","children":[]},{"title":"Add Forward Host","description":"","children":[]}]},{"title":"Logs","description":"","children":[{"title":"Get Postfix logs","description":"","children":[]},{"title":"Get Rspamd logs","description":"","children":[]},{"title":"Get Dovecot logs","description":"","children":[]},{"title":"Get ACME logs","description":"","children":[]},{"title":"Get SOGo logs","description":"","children":[]},{"title":"Get Watchdog logs","description":"","children":[]},{"title":"Get Api logs","description":"","children":[]},{"title":"Get Ratelimit logs","description":"","children":[]},{"title":"Get Netfilter logs","description":"","children":[]},{"title":"Get Autodiscover logs","description":"","children":[]}]},{"title":"Queue Manager","description":"","children":[{"title":"Get Queue","description":"","children":[]},{"title":"Flush Queue","description":"","children":[]},{"title":"Delete Queue","description":"","children":[]}]},{"title":"Quarantine","description":"","children":[{"title":"Get mails in Quarantine","description":"","children":[]},{"title":"Delete mails in Quarantine","description":"","children":[]}]},{"title":"Fail2Ban","description":"","children":[{"title":"Get Fail2Ban Config","description":"","children":[]},{"title":"Edit Fail2Ban","description":"","children":[]}]},{"title":"DKIM","description":"","children":[{"title":"Get DKIM Key","description":"","children":[]},{"title":"Generate DKIM Key","description":"","children":[]},{"title":"Duplicate DKIM Key","description":"","children":[]},{"title":"Delete DKIM Key","description":"","children":[]}]},{"title":"Domain admin","description":"","children":[{"title":"Get Domain Admins","description":"","children":[]},{"title":"Create Domain Admin user","description":"","children":[]},{"title":"Delete Domain Admin","description":"","children":[]}]},{"title":"Address Rewriting","description":"","children":[{"title":"Get BCC Map","description":"","children":[]},{"title":"Create BCC Map","description":"","children":[]},{"title":"Delete BCC Map","description":"","children":[]},{"title":"Get Recipient Map","description":"","children":[]},{"title":"Create Recipient Map","description":"","children":[]},{"title":"Delete Recipient Map","description":"","children":[]}]},{"title":"Outgoing TLS Policy Map Overrides","description":"","children":[{"title":"Get TLS Policy Map","description":"","children":[]},{"title":"Create TLS Policy Map","description":"","children":[]},{"title":"Delete TLS Policy Map","description":"","children":[]}]},{"title":"oAuth Clients","description":"","children":[{"title":"Get oAuth Clients","description":"","children":[]},{"title":"Create oAuth Client","description":"","children":[]},{"title":"Delete oAuth Client","description":"","children":[]}]},{"title":"Routing","description":"","children":[{"title":"Get Sender-Dependent Transports","description":"","children":[]},{"title":"Create Sender-Dependent Transports","description":"","children":[]},{"title":"Delete Sender-Dependent Transports","description":"","children":[]},{"title":"Get Transport Maps","description":"","children":[]},{"title":"Create Transport Maps","description":"","children":[]},{"title":"Delete Transport Maps","description":"","children":[]}]},{"title":"Resources","description":"","children":[{"title":"Get Resources","description":"","children":[]},{"title":"Create Resources","description":"","children":[]},{"title":"Delete Resources","description":"","children":[]}]},{"title":"App Passwords","description":"","children":[{"title":"Get App Password","description":"","children":[]},{"title":"Create App Password","description":"","children":[]},{"title":"Delete App Password","description":"","children":[]}]},{"title":"status","description":"","children":[{"title":"Get container status","description":"","children":[]},{"title":"Get vmail status","description":"","children":[]},{"title":"Get solr status","description":"","children":[]}]}],"actions":[{"title":"Get domains","path":"/api/v1/get/domain/{id}","pathTemplate":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id","method":"get","description":"\nYou can list all domains existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","mailcow.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain.tld\",\n \"description\": \"Some description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"✘\",\n \"gal\": \"✘\",\n \"backupmx_int\": 0,\n \"gal_int\": 0,\n \"lang\": \"en\",\n \"rl\": false,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"✘\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n },\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain2.tld\",\n \"description\": \"domain description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"✔\",\n \"gal\": \"✘\",\n \"backupmx_int\": 1,\n \"gal_int\": 0,\n \"lang\": \"cs\",\n \"rl\": false,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"✘\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n }\n]\n","schema":""}}],"tags":["Domains","Get domains"]},{"title":"Create domain","path":"/api/v1/add/domain","pathTemplate":"/api/v1/add/domain","slug":"post~api~v1~add~domain","method":"post","description":"\nYou may create your own domain using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"You can also define rate limiting. If `rl_value` is not empty string, them ratelimit object is created and returned in response.","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"Fully qualified domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"description","description":"Description of domain","required":false,"members":[],"schema":{"type":"string"}},{"key":"aliases","description":"limit count of aliases associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"mailboxes","description":"limit count of mailboxes associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"defquota","description":"predefined mailbox quota in `add mailbox` form","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxquota","description":"maximum quota per mailbox","required":false,"members":[],"schema":{"type":"number"}},{"key":"quota","description":"maximum quota for this domain (for all mailboxes in sum)","required":false,"members":[],"schema":{"type":"number"}},{"key":"active","description":"is domain active or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"rl_value","description":"rate limit value","required":false,"members":[],"schema":{"type":"number"}},{"key":"rl_frame","required":false,"members":[],"schema":{"type":"enum"}},{"key":"backupmx","description":"relay domain or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"relay_all_recipients","description":"if not, them you have to create \"dummy\" mailbox for each address to relay","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"lang","description":"language code","required":false,"members":[],"schema":{"type":"enum"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"description\":\"some decsription\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"rl_value\":\"10\",\n \"rl_frame\":\"s\",\n \"backupmx\":\"0\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"rl_value\": {\n \"type\": \"number\"\n },\n \"rl_frame\": {\n \"enum\": [\n \"s\",\n \"m\",\n \"h\"\n ]\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\": \"success\",\n \"log\": [\n \"ratelimit\",\n \"edit\",\n \"domain\",\n {\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"object\": \"domain.tld\"\n }\n ],\n \"msg\": [\n \"rl_saved\",\n \"domain.tld\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"domain\",\n {\n \"domain\": \"domain.tld\",\n \"description\": \"some decsription\",\n \"aliases\": \"400\",\n \"mailboxes\": \"10\",\n \"defquota\": \"3072\",\n \"maxquota\": \"10240\",\n \"quota\": \"10240\",\n \"active\": \"1\",\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"backupmx\": \"0\",\n \"relay_all_recipients\": \"0\",\n \"lang\":\"cs\"\n },\n null\n ],\n \"msg\": [\n \"domain_added\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Create domain"]},{"title":"Update domain","path":"/api/v1/edit/domain","pathTemplate":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain","method":"post","description":"\nYou can update one or more domains per request. You can also send just attributes you want to change. \nExample: You can add domain names to items list and in attr object just include `\"active\": \"0\"` to deactivate domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domain names you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"domain.tld\"\n ],\n \"attr\":{\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"gal\": {\n \"type\": \"boolean\"\n },\n \"relayhost\": {\n \"type\": \"number\"\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\"\n ],\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang:\"cs\"\n },\n null\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Update domain"]},{"title":"Delete domain","path":"/api/v1/delete/domain","pathTemplate":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain","method":"post","description":"\nYou can delete one or more domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domains you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"domain.tld\",\n \"domain2.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain2.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Delete domain"]},{"title":"List whitelist domain policy","path":"/api/v1/get/policy_wl_domain/{domain}","pathTemplate":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain","method":"get","description":"\nYou can list all whitelist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@gooddomain.tld\",\n \"prefid\": 1\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List whitelist domain policy"]},{"title":"List blacklist domain policy","path":"/api/v1/get/policy_bl_domain/{domain}","pathTemplate":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain","method":"get","description":"\nYou can list all blacklist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@baddomain.tld\",\n \"prefid\": 2\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List blacklist domain policy"]},{"title":"Create domain policy","path":"/api/v1/add/domain-policy","pathTemplate":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy","method":"post","description":"\nYou may create your own domain policy using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"domain name to which policy is associated to","required":false,"members":[],"schema":{"type":"string"}},{"key":"object_list","required":false,"members":[],"schema":{"type":"enum"}},{"key":"object_from","description":"exact address or use wildcard to match whole domain","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"object_list\": {\n \"enum\": [\n \"wl\",\n \"bl\"\n ]\n },\n \"object_from\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"add\",\n \"domain\",\n {\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n }\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Create domain policy"]},{"title":"Delete domain policy","path":"/api/v1/delete/domain-policy","pathTemplate":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy","method":"post","description":"\nYou can delete one o more domain policies.","parameters":[],"transactions":[{"request":{"title":"json","description":"Delete domain policy by ID","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of domain policys you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"1\",\n \"2\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"1\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Delete domain policy"]},{"title":"Get mailboxes","path":"/api/v1/get/mailbox/{id}","pathTemplate":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id","method":"get","description":"\nYou can list all mailboxes existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","user@domain.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_quota\":10737418240,\n \"username\":\"info@doman3.tld\",\n \"rl\":false,\n \"is_relayed\":0,\n \"name\":\"Full name\",\n \"active\":\"✔\",\n \"active_int\":1,\n \"domain\":\"doman3.tld\",\n \"local_part\":\"info\",\n \"quota\":3221225472,\n \"attributes\":{\n \"force_pw_update\":\"0\",\n \"tls_enforce_in\":\"0\",\n \"tls_enforce_out\":\"0\",\n \"sogo_access\":\"1\",\n \"mailbox_format\":\"maildir:\",\n \"quarantine_notification\":\"never\"\n },\n \"quota_used\":0,\n \"percent_in_use\":0,\n \"messages\":0,\n \"spam_aliases\":0,\n \"percent_class\":\"success\"\n }\n]\n","schema":""}}],"tags":["Mailboxes","Get mailboxes"]},{"title":"Create mailbox","path":"/api/v1/add/mailbox","pathTemplate":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox","method":"post","description":"\nYou may create your own mailbox using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_part","description":"left part of email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"name","description":"Full name of the mailbox user","required":false,"members":[],"schema":{"type":"string"}},{"key":"quota","description":"mailbox quota","required":false,"members":[],"schema":{"type":"number"}},{"key":"pasword","description":"mailbox password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"mailbox password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"is mailbox active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"atedismonsin\",\n \"password2\":\"atedismonsin\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_part\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"mailbox\",\n {\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_added\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Create mailbox"]},{"title":"Update mailbox","path":"/api/v1/edit/mailbox","pathTemplate":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox","method":"post","description":"\nYou can update one or more mailboxes per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"sender_acl":["default","info@domain2.tld","domain3.tld","asterix"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"info@domain.tld\"\n ],\n \"attr\":{\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"\",\n \"password2\":\"\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"sender_acl\": {\n \"type\": \"array\"\n },\n \"force_pw_update\": {\n \"type\": \"boolean\"\n },\n \"sogo_access\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\"\n ],\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox"]},{"title":"Delete mailbox","path":"/api/v1/delete/mailbox","pathTemplate":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox","method":"post","description":"\nYou can delete one or more mailboxes.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"info@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"sales@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Delete mailbox"]},{"title":"Quarantine Notifications","path":"/api/v1/edit/quarantine_notification","pathTemplate":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification","method":"post","description":"\nYou can update one or more mailboxes per request.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want set qurantine notifications","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"mailbox1@domain.tld\",\n \"mailbox2@domain.tld\"\n ],\n \"attr\":{\n \"quarantine_notification\":\"hourly\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"quarantine_notification\": {\n \"enum\": [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"never\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"","schema":""}}],"tags":["Mailboxes","Quarantine Notifications"]},{"title":"Get aliases","path":"/api/v1/get/alias/{id}","pathTemplate":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id","method":"get","description":"\nYou can list mailbox aliases existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"in_primary_domain\": \"\",\n \"id\": 6,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"alias@domain.tld\",\n \"is_catch_all\": 0,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"created\": \"2019-04-04 19:29:49\",\n \"modified\": null\n },\n {\n \"in_primary_domain\": \"\",\n \"id\": 10,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"@domain.tld\",\n \"is_catch_all\": 1,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"created\": \"2019-04-27 13:42:39\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Aliases","Get aliases"]},{"title":"Create alias","path":"/api/v1/add/alias","pathTemplate":"/api/v1/add/alias","slug":"post~api~v1~add~alias","method":"post","description":"\nYou may create your own mailbox alias using this action. It takes a JSON object containing a domain informations. \nOnly one `goto*` option can be used, for ex. if you want learn as spam, then send just `goto_spam = 1` in request body.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"address","description":"alias address, for catchall use \"@domain.tld\"","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto","description":"destination address, comma separated","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto_null","description":"silently ignore","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_spam","description":"learn as spam","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_ham","description":"learn as ham","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"is alias active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"alias\",\n {\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_added\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Create alias"]},{"title":"Update alias","path":"/api/v1/edit/alias","pathTemplate":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias","method":"post","description":"\nYou can update one or more aliases per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"6\"\n ],\n \"attr\":{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"private_comment\": {\n \"type\": \"string\"\n },\n \"public_comment\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"alias\",\n {\n \"id\":[\n \"6\"\n ],\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_modified\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Update alias"]},{"title":"Delete alias","path":"/api/v1/delete/alias","pathTemplate":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias","method":"post","description":"\nYou can delete one or more aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\n \"6\",\n \"9\"\n]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias2@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Delete alias"]},{"title":"Get sync jobs","path":"/api/v1/get/syncjobs/all/no_log","pathTemplate":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log","method":"get","description":"\nYou can list all syn jobs existing in system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"user2\": \"mailbox@domain.tld\",\n \"host1\": \"imap.server.tld\",\n \"authmech1\": \"PLAIN\",\n \"regextrans2\": \"\",\n \"authmd51\": 0,\n \"domain2\": \"\",\n \"subfolder2\": \"External\",\n \"user1\": \"username\",\n \"exclude\": \"(?i)spam|(?i)junk\",\n \"maxage\": 0,\n \"mins_interval\": \"20\",\n \"maxbytespersecond\": \"0\",\n \"port1\": 993,\n \"enc1\": \"TLS\",\n \"delete2duplicates\": 1,\n \"delete1\": 0,\n \"delete2\": 0,\n \"automap\": 1,\n \"skipcrossduplicates\": 0,\n \"custom_params\": \"\",\n \"timeout1\": 600,\n \"timeout2\": 600,\n \"subscribeall\": 1,\n \"is_running\": 0,\n \"last_run\": \"2019-05-22 11:40:02\",\n \"created\": \"2019-05-22 11:37:25\",\n \"modified\": \"2019-05-22 11:40:02\",\n \"active\": \"✓\",\n \"active_int\": 1,\n \"log\": \"\"\n }\n]\n","schema":""}}],"tags":["Sync jobs","Get sync jobs"]},{"title":"Create sync job","path":"/api/v1/add/syncjob","pathTemplate":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob","method":"post","description":"\nYou can create new sync job using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"The target mailbox","required":false,"members":[],"schema":{"type":"string"}},{"key":"delete2duplicates","description":"Delete duplicates on destination","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete1","description":"Delete from source when completed","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete2","description":"Delete messages on destination that are not on source","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"automap","description":"Try to automap folders (\"Sent items\", \"Sent\" => \"Sent\" etc.)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"skipcrossduplicates","description":"Skip duplicate messages across folders (first come, first serve)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"Is sync job active","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"subscribeall","description":"Subscribe all folders","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"host1","description":"Hostname","required":false,"members":[],"schema":{"type":"string"}},{"key":"port1","description":"Port","required":false,"members":[],"schema":{"type":"string"}},{"key":"user1","description":"Username","required":false,"members":[],"schema":{"type":"string"}},{"key":"password1","description":"Password","required":false,"members":[],"schema":{"type":"string"}},{"key":"enc1","description":"Encryption","required":false,"members":[],"schema":{"type":"enum"}},{"key":"mins_interval","description":"Interval (min)","required":false,"members":[],"schema":{"type":"number"}},{"key":"subfolder2","description":"Sync into subfolder on destination (empty = do not use subfolder)","required":false,"members":[],"schema":{"type":"string"}},{"key":"maxage","description":"Maximum age of messages in days that will be polled from remote (0 = ignore age)","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxbytespersecond","description":"Max. bytes per second (0 = unlimited)","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout1","description":"Timeout for connection to remote host","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout2","description":"Timeout for connection to local host","required":false,"members":[],"schema":{"type":"number"}},{"key":"exclude","description":"Exclude objects (regex)","required":false,"members":[],"schema":{"type":"string"}},{"key":"custom_params","description":"Custom parameters passed to imapsync command","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\",\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"syncjob\",\n {\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":993,\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"mailbox@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Create sync job"]},{"title":"Update sync job","path":"/api/v1/edit/syncjob","pathTemplate":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob","method":"post","description":"\nYou can update one or more sync jobs per request. You can also send just attributes you want to change.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"1\"\n ],\n \"attr\":{\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"active\":\"1\",\n \"subscribeall\":\"1\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Update sync job"]},{"title":"Delete sync job","path":"/api/v1/delete/syncjob","pathTemplate":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob","method":"post","description":"\nYou can delete one or more sync jobs.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"6\",\n \"9\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Delete sync job"]},{"title":"Get Forwarding Hosts","path":"/api/v1/get/fwdhost/all","pathTemplate":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all","method":"get","description":"\nYou can list all Forwarding Hosts in your system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"host\": \"5.1.76.202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n },\n {\n \"host\": \"2a00:f820:417::202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n }\n]\n","schema":""}}],"tags":["Fordwarding Hosts","Get Forwarding Hosts"]},{"title":"Add Forward Host","path":"/api/v1/add/fwdhost","pathTemplate":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost","method":"post","description":"\nAdd a new Forwarding host to mailcow. You can chose to enable or disable spam filtering of incoming emails by specifing `filter_spam` 0 = inactive, 1 = active.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"contains the hostname you want to add","required":false,"members":[],"schema":{"type":"string"}},{"key":"filter_spam","description":"1 to enable spam filter, 0 to disable spam filter","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"filter_spam\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"add\",\n {\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n }\n ],\n \"msg\": [\n \"forwarding_host_added\",\n \"5.1.76.202, 2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Add Forward Host"]},{"title":"Get Postfix logs","path":"/api/v1/get/logs/postfix/{count}","pathTemplate":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count","method":"get","description":"\nThis Api endpoint lists all Postfix logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569937433\",\n \"program\": \"postfix/qmgr\",\n \"priority\": \"info\",\n \"message\": \"EF1711500458: removed\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Postfix logs"]},{"title":"Get Rspamd logs","path":"/api/v1/get/logs/rspamd-history/{count}","pathTemplate":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count","method":"get","description":"\nThis Api endpoint lists all Rspamd logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n {\n \"time_virtual\": 0.235653,\n \"rcpt_mime\": [\n \"github@mailcow.tld\"\n ],\n \"message-id\": \"cm.0521259281087.phrkjuk.wdljulyl.i@cmail20.com\",\n \"ip\": \"1.1.1.1\",\n \"rcpt_smtp\": [\n \"github@mailcow.tld\"\n ],\n \"action\": \"soft reject\",\n \"time_real\": 2.856102,\n \"score\": 11.59,\n \"is_skipped\": false,\n \"size\": 35513,\n \"user\": \"unknown\",\n \"sender_mime\": \"noreply@github.com\",\n \"symbols\": {\n \"FROM_NEQ_ENVFROM\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0,\n \"name\": \"FROM_NEQ_ENVFROM\",\n \"description\": \"From address is different to the envelope\"\n },\n \"FORGED_SENDER\": {\n \"metric_score\": 0.3,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0.3,\n \"name\": \"FORGED_SENDER\",\n \"description\": \"Sender is forged (different From: header and smtp MAIL FROM: addresses)\"\n },\n \"RWL_MAILSPIKE_NEUTRAL\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.rep.mailspike.net : 127.0.0.13\"\n ],\n \"score\": 0,\n \"name\": \"RWL_MAILSPIKE_NEUTRAL\",\n \"description\": \"Neutral result from Mailspike\"\n },\n \"HAS_LIST_UNSUB\": {\n \"metric_score\": -0.01,\n \"score\": -0.01,\n \"name\": \"HAS_LIST_UNSUB\",\n \"description\": \"Has List-Unsubscribe header\"\n },\n \"URI_COUNT_ODD\": {\n \"metric_score\": 1,\n \"options\": [\n \"25\"\n ],\n \"score\": 1,\n \"name\": \"URI_COUNT_ODD\",\n \"description\": \"Odd number of URIs in multipart\\/alternative message\"\n },\n \"MIME_TRACE\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"MIME_TRACE\",\n \"options\": [\n \"0:+\",\n \"1:+\",\n \"2:~\"\n ]\n },\n \"R_DKIM_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"github.com:s=cm\",\n \"cmail2.com:s=cs2013\"\n ],\n \"score\": 0,\n \"name\": \"R_DKIM_ALLOW\",\n \"description\": \"DKIM verification succeed\"\n },\n \"FROM_HAS_DN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"FROM_HAS_DN\",\n \"description\": \"From header has a display name\"\n },\n \"MIME_GOOD\": {\n \"metric_score\": -0.1,\n \"options\": [\n \"multipart\\/alternative\",\n \"text\\/plain\"\n ],\n \"score\": -0.1,\n \"name\": \"MIME_GOOD\",\n \"description\": \"Known content-type\"\n },\n \"REPLYTO_ADDR_EQ_FROM\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"REPLYTO_ADDR_EQ_FROM\",\n \"description\": \"Reply-To header is identical to SMTP From\"\n },\n \"TO_MATCH_ENVRCPT_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_MATCH_ENVRCPT_ALL\",\n \"description\": \"All of the recipients match the envelope\"\n },\n \"ASN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ASN\",\n \"options\": [\n \"asn:55819, ipnet:203.55.21.0\\/24, country:AU\"\n ]\n },\n \"HTML_SHORT_LINK_IMG_1\": {\n \"metric_score\": 2,\n \"score\": 2,\n \"name\": \"HTML_SHORT_LINK_IMG_1\",\n \"description\": \"Short html part (0..1K) with a link to an image\"\n },\n \"SCHAALIT_URI_823\": {\n \"metric_score\": 5,\n \"score\": 5,\n \"name\": \"SCHAALIT_URI_823\",\n \"options\": [\n \"SCHAALIT_URI_823\"\n ]\n },\n \"DMARC_POLICY_ALLOW\": {\n \"metric_score\": -0.5,\n \"options\": [\n \"github.com\",\n \"none\"\n ],\n \"score\": 0,\n \"name\": \"DMARC_POLICY_ALLOW\",\n \"description\": \"DMARC permit policy\"\n },\n \"MANY_INVISIBLE_PARTS\": {\n \"metric_score\": 1,\n \"options\": [\n \"4\"\n ],\n \"score\": 0.3,\n \"name\": \"MANY_INVISIBLE_PARTS\",\n \"description\": \"Many parts are visually hidden\"\n },\n \"DKIM_TRACE\": {\n \"metric_score\": 0,\n \"options\": [\n \"github.com:+\",\n \"cmail2.com:+\"\n ],\n \"score\": 0,\n \"name\": \"DKIM_TRACE\",\n \"description\": \"DKIM trace symbol\"\n },\n \"MX_GOOD\": {\n \"metric_score\": -0.01,\n \"options\": [\n \"mx20.inbound.createsend.com\",\n \"mx21.inbound.createsend.com\"\n ],\n \"score\": -0.01,\n \"name\": \"MX_GOOD\",\n \"description\": \"MX was ok\"\n },\n \"TO_DN_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_DN_ALL\",\n \"description\": \"All the recipients have display names\"\n },\n \"RCPT_MAILCOW_DOMAIN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"RCPT_MAILCOW_DOMAIN\",\n \"options\": [\n \"gc-mc.de\"\n ]\n },\n \"XM_UA_NO_VERSION\": {\n \"metric_score\": 0.01,\n \"score\": 0.01,\n \"name\": \"XM_UA_NO_VERSION\",\n \"description\": \"X-Mailer\\/User-Agent has no version\"\n },\n \"HAS_REPLYTO\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\"\n ],\n \"score\": 0,\n \"name\": \"HAS_REPLYTO\",\n \"description\": \"Has Reply-To header\"\n },\n \"R_SPF_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"+ip4:203.55.21.0\\/24\"\n ],\n \"score\": 0,\n \"name\": \"R_SPF_ALLOW\",\n \"description\": \"SPF verification allows sending\"\n },\n \"URIBL_GREY\": {\n \"metric_score\": 1.5,\n \"options\": [\n \"cmail2.com.multi.uribl.com\",\n \"cmail20.com.multi.uribl.com\",\n \"updatemyprofile.com.multi.uribl.com\"\n ],\n \"score\": 1.5,\n \"name\": \"URIBL_GREY\",\n \"description\": \"uribl.com grey url\"\n },\n \"CLAM_VIRUS_FAIL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"CLAM_VIRUS_FAIL\",\n \"options\": [\n \"failed to scan and retransmits exceed\"\n ]\n },\n \"GREYLIST\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"GREYLIST\",\n \"options\": [\n \"greylisted\",\n \"Wed, 25 Sep 2019 19:27:10 GMT\",\n \"new record\"\n ]\n },\n \"ARC_NA\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ARC_NA\",\n \"description\": \"ARC signature absent\"\n },\n \"RCVD_COUNT_ZERO\": {\n \"metric_score\": 0,\n \"options\": [\n \"0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_COUNT_ZERO\",\n \"description\": \"Message has no Received headers\"\n },\n \"BAD_REP_POLICIES\": {\n \"metric_score\": 0.1,\n \"score\": 0.1,\n \"name\": \"BAD_REP_POLICIES\",\n \"description\": \"Contains valid policies but are also marked by fuzzy\\/bayes\\/surbl\\/rbl\"\n },\n \"RCPT_COUNT_ONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"1\"\n ],\n \"score\": 0,\n \"name\": \"RCPT_COUNT_ONE\",\n \"description\": \"One recipient\"\n },\n \"RBL_UCEPROTECT_LEVEL1\": {\n \"metric_score\": 3.5,\n \"score\": 3.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL1\",\n \"options\": [\n \"17.21.55.203.dnsbl-1.uceprotect.net\"\n ]\n },\n \"DWL_DNSWL_HI\": {\n \"metric_score\": -3.5,\n \"options\": [\n \"github.com.dwl.dnswl.org : 127.0.9.3\"\n ],\n \"score\": -3.5,\n \"name\": \"DWL_DNSWL_HI\",\n \"description\": \"Message has a valid dkim signature originated from domain listed at https:\\/\\/www.dnswl.org, high trust\"\n },\n \"RCVD_IN_DNSWL_NONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.list.dnswl.org : 127.0.15.0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_IN_DNSWL_NONE\",\n \"description\": \"Sender listed at https:\\/\\/www.dnswl.org, no trust\"\n },\n \"RBL_UCEPROTECT_LEVEL2\": {\n \"metric_score\": 1.5,\n \"score\": 1.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL2\",\n \"options\": [\n \"17.21.55.203.dnsbl-2.uceprotect.net\"\n ]\n }\n },\n \"subject\": \"[mailcow/mailcow-dockerized] Unable to change name of alias email address (#2997)\",\n \"required_score\": 15,\n \"unix_time\": 1569439327,\n \"sender_smtp\": \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n }\n}\n","schema":""}}],"tags":["Logs","Get Rspamd logs"]},{"title":"Get Dovecot logs","path":"/api/v1/get/logs/dovecot/{count}","pathTemplate":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count","method":"get","description":"\nThis Api endpoint lists all Dovecot logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938740\",\n \"program\": \"dovecot\",\n \"priority\": \"info\",\n \"message\": \"managesieve-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.22.1.3, lip=172.22.1.250\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Dovecot logs"]},{"title":"Get ACME logs","path":"/api/v1/get/logs/acme/{count}","pathTemplate":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count","method":"get","description":"\nThis Api endpoint lists all ACME logs from issued Lets Enctypts certificates. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569927728\",\n \"message\": \"Certificate validation done, neither changed nor due for renewal, sleeping for another day.\"\n }\n]\n","schema":""}}],"tags":["Logs","Get ACME logs"]},{"title":"Get SOGo logs","path":"/api/v1/get/logs/sogo/{count}","pathTemplate":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count","method":"get","description":"\nThis Api endpoint lists all SOGo logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938874\",\n \"program\": \"sogod\",\n \"priority\": \"notice\",\n \"message\": \"[109]: mailcowdockerized_watchdog-mailcow_1.mailcowdockerized_mailcow-network \\\"GET \\/SOGo.index\\/ HTTP\\/1.1\\\" 200 2531\\/0 0.005 - - 0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get SOGo logs"]},{"title":"Get Watchdog logs","path":"/api/v1/get/logs/watchdog/{count}","pathTemplate":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count","method":"get","description":"\nThis Api endpoint lists all Watchdog logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938958\",\n \"service\": \"Fail2ban\",\n \"lvl\": \"100\",\n \"hpnow\": \"1\",\n \"hptotal\": \"1\",\n \"hpdiff\": \"0\"\n },\n {\n \"time\": \"1569938956\",\n \"service\": \"Rspamd\",\n \"lvl\": \"100\",\n \"hpnow\": \"5\",\n \"hptotal\": \"5\",\n \"hpdiff\": \"0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Watchdog logs"]},{"title":"Get Api logs","path":"/api/v1/get/logs/api/{count}","pathTemplate":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count","method":"get","description":"\nThis Api endpoint lists all Api logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569939001,\n \"uri\": \"\\/api\\/v1\\/get\\/logs\\/api\\/2\",\n \"method\": \"GET\",\n \"remote\": \"1.1.1.1\",\n \"data\": \"\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Api logs"]},{"title":"Get Ratelimit logs","path":"/api/v1/get/logs/ratelimited/{count}","pathTemplate":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count","method":"get","description":"\nThis Api endpoint lists all Ratelimit logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569269003,\n \"rcpt\": \"hello@mailcow.email\",\n \"from\": \"awesome@mailcow.email\",\n \"user\": \"awesome@mailcow.email\",\n \"rl_info\": \"mailcow(RLsdz3tuabozgd4oacbdh8kc78)\",\n \"rl_name\": \"mailcow\",\n \"rl_hash\": \"RLsdz3tuabozgd4oacbdh8kc78\",\n \"qid\": \"E3CF91500458\",\n \"ip\": \"172.22.1.248\",\n \"message_id\": \"6a-5d892500-7-240abd80@90879116\",\n \"header_subject\": \"Mailcow is amazing\",\n \"header_from\": \"\\\"Awesome\\\" \"\n }\n]\n","schema":""}}],"tags":["Logs","Get Ratelimit logs"]},{"title":"Get Netfilter logs","path":"/api/v1/get/logs/netfilter/{count}","pathTemplate":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count","method":"get","description":"\nThis Api endpoint lists all Netfilter logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569754911,\n \"priority\": \"info\",\n \"message\": \"Whitelist was changed, it has 1 entries\"\n },\n {\n \"time\": 1569754911,\n \"priority\": \"crit\",\n \"message\": \"Add host\\/network 1.1.1.1\\/32 to blacklist\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Netfilter logs"]},{"title":"Get Autodiscover logs","path":"/api/v1/get/logs/autodiscover/{count}","pathTemplate":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count","method":"get","description":"\nThis Api endpoint lists all Autodiscover logs. \nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569684212,\n \"ua\": \"Microsoft Office\\/16.0 (Windows NT 6.2; MAPICPL 16.0.11328; Pro)\",\n \"user\": \"awesome@mailcow.de\",\n \"service\": \"activesync\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Autodiscover logs"]},{"title":"Get Queue","path":"/api/v1/get/mailq/all","pathTemplate":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all","method":"get","description":"\nGet the current mail queue and everything it contains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"queue_name\": \"incoming\",\n \"queue_id\": \"B98C6260CA1\",\n \"arrival_time\": 1570091234,\n \"message_size\": 1848,\n \"sender\": \"sender@mailcow.tld\",\n \"recipients\": [\n \"recipient@awesomecow.tld\"\n ]\n }\n]\n","schema":""}}],"tags":["Queue Manager","Get Queue"]},{"title":"Flush Queue","path":"/api/v1/edit/mailq","pathTemplate":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq","method":"post","description":"\nUsing this API you can flush the current mail queue. This will try to deliver all mails currently in it.\nThis API uses the command: `postqueue -f`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use flush to flush the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{ \n \"action\":\"flush\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Flush Queue"]},{"title":"Delete Queue","path":"/api/v1/delete/mailq","pathTemplate":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq","method":"post","description":"\nUsing this API you can delete the current mail queue. This will delete all mails in it.\nThis API uses the command: `postsuper -d`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use super_delete to delete the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"super_delete\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Delete Queue"]},{"title":"Get mails in Quarantine","path":"/api/v1/get/quarantine/all","pathTemplate":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all","method":"get","description":"\nGet all mails that are currently in Quarantine.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"id\": 33,\n \"qid\": \"8224615004C1\",\n \"subject\": \"mailcow is awesome\",\n \"virus_flag\": 0,\n \"score\": 15.48,\n \"rcpt\": \"admin@domain.tld\",\n \"sender\": \"bounces@send.domain.tld\",\n \"created\": 1572688831,\n \"notified\": 1\n}\n","schema":""}}],"tags":["Quarantine","Get mails in Quarantine"]},{"title":"Delete mails in Quarantine","path":"/api/v1/delete/qitem","pathTemplate":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem","method":"post","description":"\nUsing this endpoint you can delete a email from quarantine, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of emails you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"33\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"quarantine\",\n \"delete\",\n {\n \"id\": [\n \"33\"\n ]\n }\n ],\n \"msg\": [\n \"item_deleted\",\n \"33\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Quarantine","Delete mails in Quarantine"]},{"title":"Get Fail2Ban Config","path":"/api/v1/get/fail2ban","pathTemplate":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban","method":"get","description":"\nGets the current Fail2Ban configuration.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ban_time\": 604800,\n \"netban_ipv4\": 32,\n \"netban_ipv6\": 128,\n \"max_attempts\": 1,\n \"retry_window\": 7200,\n \"whitelist\": \"1.1.1.1\",\n \"blacklist\": \"45.82.153.37\\/32\\n92.118.38.52\\/32\",\n \"perm_bans\": [\n \"45.82.153.37\\/32\",\n \"92.118.38.52\\/32\"\n ]\n}\n","schema":""}}],"tags":["Fail2Ban","Get Fail2Ban Config"]},{"title":"Edit Fail2Ban","path":"/api/v1/edit/fail2ban","pathTemplate":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban","method":"post","description":"\nUsing this endpoint you can edit the Fail2Ban config and black or whitelist new ips.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":[],"description":"has to be none","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"description":"array containing the fail2ban settings","required":false,"members":[],"schema":{"type":"object"}}]},"example":"{ \n \"items\":[\n \"none\"\n ],\n \"attr\": {\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"ban_time\": {\n \"type\": \"number\"\n },\n \"max_attempts\": {\n \"type\": \"number\"\n },\n \"retry_window\": {\n \"type\": \"number\"\n },\n \"netban_ipv4\": {\n \"type\": \"number\"\n },\n \"netban_ipv6\": {\n \"type\": \"number\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n },\n \"backlist\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"type\": \"success\",\n \"log\": [\n \"fail2ban\",\n \"edit\",\n {\n \"network\": [\n \"none\"\n ],\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n ],\n \"msg\": \"f2b_modified\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fail2Ban","Edit Fail2Ban"]},{"title":"Get DKIM Key","path":"/api/v1/get/dkim/{domain}","pathTemplate":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain","method":"get","description":"\nUsing this endpoint you can get the DKIM public key for a specific domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"pubkey\": \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"length\": \"2048\",\n \"dkim_txt\": \"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"dkim_selector\": \"dkim\",\n \"privkey\": \"\"\n}\n","schema":""}}],"tags":["DKIM","Get DKIM Key"]},{"title":"Generate DKIM Key","path":"/api/v1/add/dkim","pathTemplate":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim","method":"post","description":"\nUsing this endpoint you can generate new DKIM keys.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"the domain which a key should be generated for","required":false,"members":[],"schema":{"type":"string"}},{"key":"dkim_selector","description":"the DKIM selector default dkim","required":false,"members":[],"schema":{"type":"string"}},{"key":"key_size","description":"the key size (1024 or 2048)","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"domains\":\"mailcow.tld\",\n \"dkim_selector\":\"dkim\",\n \"key_size\":\"2048\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"dkim_selector\": {\n \"type\": \"string\"\n },\n \"key_size\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"add\",\n {\n \"domains\": \"hanspeterlol.de\",\n \"dkim_selector\": \"dkim\",\n \"key_size\": \"2048\"\n }\n ],\n \"msg\": [\n \"dkim_added\",\n \"hanspeterlol.de\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Generate DKIM Key"]},{"title":"Duplicate DKIM Key","path":"/api/v1/add/dkim_duplicate","pathTemplate":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate","method":"post","description":"\nUsing this endpoint you can duplicate the DKIM Key of one domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"fron_domain","description":"the domain where the dkim key should be copied from","required":false,"members":[],"schema":{"type":"string"}},{"key":"to_domain","description":"the domain where the dkim key should be copied to","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"from_domain\":\"mailcow.tld\",\n \"to_domain\":\"awesomecow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"fron_domain\": {\n \"type\": \"string\"\n },\n \"to_domain\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"duplicate\",\n {\n \"from_domain\": \"mailcow.tld\",\n \"to_domain\": \"awesomecow.tld\"\n }\n ],\n \"msg\": [\n \"dkim_duplicated\",\n \"mailcow.tld\",\n \"awesomecow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Duplicate DKIM Key"]},{"title":"Delete DKIM Key","path":"/api/v1/delete/dkim","pathTemplate":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim","method":"post","description":"\nUsing this endpoint a existing DKIM Key can be deleted","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\"mailcow.tld\"]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"delete\",\n {\n \"domains\": [\n \"mailcow.tld\"\n ]\n }\n ],\n \"msg\": [\n \"dkim_removed\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Delete DKIM Key"]},{"title":"Get Domain Admins","path":"/api/v1/get/domain-admin/all","pathTemplate":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all","method":"get","description":"\n","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"username\": \"testadmin\",\n \"tfa_active\": \"✕\",\n \"active\": \"✓\",\n \"tfa_active_int\": null,\n \"active_int\": 1,\n \"created\": \"2019-10-02 10:29:41\",\n \"selected_domains\": [\n \"mailcow.tld\"\n ],\n \"unselected_domains\": [\n \"awesomemailcow.de\",\n \"mailcowisgreat.de\"\n ]\n }\n]\n","schema":""}}],"tags":["Domain admin","Get Domain Admins"]},{"title":"Create Domain Admin user","path":"/api/v1/add/domain-admin","pathTemplate":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin","method":"post","description":"\nUsing this endpoint you can create a new Domain Admin user. This user has full control over a domain, and can create new mailboxes and aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username for the admin user","required":false,"members":[],"schema":{"type":"string"}},{"key":"domains","description":"the domains the user should be a admin of","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"supersecurepw\",\n \"password2\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"domains\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"add\",\n {\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"*\",\n \"password2\": \"*\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"domain_admin_added\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Create Domain Admin user"]},{"title":"Delete Domain Admin","path":"/api/v1/delete/domain-admin","pathTemplate":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin","method":"post","description":"\nUsing this endpoint a existing Domain Admin user can be deleted.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["username"],"description":"contains list of usernames of the users you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"testadmin\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"delete\",\n {\n \"username\": [\n \"testadmin\"\n ]\n }\n ],\n \"msg\": [\n \"domain_admin_removed\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Delete Domain Admin"]},{"title":"Get BCC Map","path":"/api/v1/get/bcc/{id}","pathTemplate":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id","method":"get","description":"\nUsing this endpoint you can get all BCC maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"local_dest\": \"@mailcow.tld\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"type\": \"sender\",\n \"created\": \"2019-10-02 21:44:34\",\n \"domain\": \"mailcow.tld\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get BCC Map"]},{"title":"Create BCC Map","path":"/api/v1/add/bcc","pathTemplate":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc","method":"post","description":"\nUsing this endpoint you can create a BCC map to forward all mails via a bcc for a given domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_dest","description":"the domain which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"type","description":"the type of bcc map can be `sender` or `recipient`","required":false,"members":[],"schema":{"type":"string"}},{"key":"bcc_dest","description":"the email address where all mails should be send to","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_dest\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"bcc_dest\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"add\",\n {\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": \"bcc_saved\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create BCC Map"]},{"title":"Delete BCC Map","path":"/api/v1/delete/bcc","pathTemplate":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc","method":"post","description":"\nUsing this endpoint you can delete a BCC map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of bcc maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"delete\",\n {\n \"id\": [\n \"4\"\n ]\n },\n null\n ],\n \"msg\": [\n \"bcc_deleted\",\n \"4\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete BCC Map"]},{"title":"Get Recipient Map","path":"/api/v1/get/recipient_map/{id}","pathTemplate":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id","method":"get","description":"\nUsing this endpoint you can get all recipient maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"created\": \"2019-10-02 22:06:29\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get Recipient Map"]},{"title":"Create Recipient Map","path":"/api/v1/add/recipient_map","pathTemplate":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map","method":"post","description":"\nUsing this endpoint you can create a recipient map to forward all mails from one email address to another.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"recipient_map_old","description":"the email address which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"recipient_map_new","description":"the email address that should receive the forwarded emails","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"recipient_map_old\": {\n \"type\": \"string\"\n },\n \"recipient_map_new\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"add\",\n {\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_saved\",\n \"recipient@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create Recipient Map"]},{"title":"Delete Recipient Map","path":"/api/v1/delete/recipient_map","pathTemplate":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map","method":"post","description":"\nUsing this endpoint you can delete a recipient map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of recipient maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete Recipient Map"]},{"title":"Get TLS Policy Map","path":"/api/v1/get/tls-policy-map/{id}","pathTemplate":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id","method":"get","description":"\nUsing this endpoint you can get all TLS policy map override maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"created\": \"2019-10-03 08:42:12\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Outgoing TLS Policy Map Overrides","Get TLS Policy Map"]},{"title":"Create TLS Policy Map","path":"/api/v1/add/tls-policy-map","pathTemplate":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map","method":"post","description":"\nUsing this endpoint you can create a TLS policy map override.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"dest","description":"the target domain or email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"policy","description":"the policy","required":false,"members":[],"schema":{"type":"enum"}},{"key":"parameters","description":"custom parameters you find out more about them [here](http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"dest\": {\n \"type\": \"string\"\n },\n \"policy\": {\n \"enum\": [\n \"none\",\n \"may\",\n \"encrypt\",\n \"dane\",\n \"fingerprint\",\n \"verify\",\n \"secure\"\n ]\n },\n \"parameters\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"add\",\n {\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_saved\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Create TLS Policy Map"]},{"title":"Delete TLS Policy Map","path":"/api/v1/delete/tls-policy-map","pathTemplate":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map","method":"post","description":"\nUsing this endpoint you can delete a TLS Policy Map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of tls policy maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Delete TLS Policy Map"]},{"title":"Get oAuth Clients","path":"/api/v1/get/oauth2-client/{id}","pathTemplate":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id","method":"get","description":"\nUsing this endpoint you can get all oAuth clients.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"client_id\": \"17c76aaa88c0\",\n \"client_secret\": \"73fc668a88147e32a31ff80c\",\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\",\n \"grant_types\": null,\n \"scope\": \"profile\",\n \"user_id\": null\n }\n]\n","schema":""}}],"tags":["oAuth Clients","Get oAuth Clients"]},{"title":"Create oAuth Client","path":"/api/v1/add/oauth2-client","pathTemplate":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client","method":"post","description":"\nUsing this endpoint you can create a oAuth clients.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"redirect_uri","description":"the uri where you should be redirected after oAuth","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"redirect_uri\":\"https://mailcow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"redirect_uri\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"add\",\n \"client\",\n {\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\"\n }\n ],\n \"msg\": \"Added client access\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Create oAuth Client"]},{"title":"Delete oAuth Client","path":"/api/v1/delete/oauth2-client","pathTemplate":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client","method":"post","description":"\nUsing this endpoint you can delete a oAuth client, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of oAuth clients you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"delete\",\n \"client\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"items_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Delete oAuth Client"]},{"title":"Get Sender-Dependent Transports","path":"/api/v1/get/relayhost/{id}","pathTemplate":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id","method":"get","description":"\nUsing this endpoint you can get all Sender-Dependent Transports.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\",\n \"active_int\": 1,\n \"password_short\": \"tes...\",\n \"active\": \"✓\",\n \"used_by_domains\": \"\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Sender-Dependent Transports"]},{"title":"Create Sender-Dependent Transports","path":"/api/v1/add/relayhost","pathTemplate":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"the hostname of the smtp server with port","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"add\",\n {\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Sender-Dependent Transports"]},{"title":"Delete Sender-Dependent Transports","path":"/api/v1/delete/relayhost","pathTemplate":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost","method":"post","description":"\nUsing this endpoint you can delete a Sender-Dependent Transport, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of Sender-Dependent Transport you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Sender-Dependent Transports"]},{"title":"Get Transport Maps","path":"/api/v1/get/transport/{id}","pathTemplate":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id","method":"get","description":"\nUsing this endpoint you can get all Transport Maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active_int\": 1,\n \"lookup_mx_int\": 0,\n \"password_short\": \"sup...\",\n \"active\": \"✓\",\n \"lookup_mx\": \"✕\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Transport Maps"]},{"title":"Create Transport Maps","path":"/api/v1/add/transport/all","pathTemplate":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"destination","required":false,"members":[],"schema":{"type":"string"}},{"key":"nexthop","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\"\n },\n \"nexthop\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"add\",\n {\n \"destination\": \"example2.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Transport Maps"]},{"title":"Delete Transport Maps","path":"/api/v1/delete/transport","pathTemplate":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport","method":"post","description":"\nUsing this endpoint you can delete a Transport Maps, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of transport maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Transport Maps"]},{"title":"Get Resources","path":"/api/v1/get/resource/all","pathTemplate":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all","method":"get","description":"\nUsing this endpoint you can get all Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"name\": \"test@mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings\": 0,\n \"description\": \"test\",\n \"active\": \"✓\",\n \"active_int\": 1,\n \"domain\": \"mailcow.tld\",\n \"local_part\": \"test\"\n }\n]\n","schema":""}}],"tags":["Resources","Get Resources"]},{"title":"Create Resources","path":"/api/v1/add/resource","pathTemplate":"/api/v1/add/resource","slug":"post~api~v1~add~resource","method":"post","description":"\nUsing this endpoint you can create Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"description","description":"a description of the resource","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"the domain for which the resource should be","required":false,"members":[],"schema":{"type":"string"}},{"key":"kind","description":"the kind of recouse","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_select","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_custom","description":"always empty","required":false,"members":[],"schema":{"type":"number"}},{"key":"multiple_bookings","required":false,"members":[],"schema":{"type":"enum"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"kind\": {\n \"enum\": [\n \"location\",\n \"group\",\n \"thing\"\n ]\n },\n \"multiple_bookings_select\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"multiple_bookings_custom\": {\n \"type\": \"number\"\n },\n \"multiple_bookings\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"resource\",\n {\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"resource_added\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Create Resources"]},{"title":"Delete Resources","path":"/api/v1/delete/resource","pathTemplate":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource","method":"post","description":"\nUsing this endpoint you can delete a Resources, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["description@domain"],"description":"contains list of Resources you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"test@mailcow.tld\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"delete\",\n \"resource\",\n {\n \"name\": [\n \"test@mailcow.tld\"\n ]\n },\n null\n ],\n \"msg\": [\n \"resource_removed\",\n \"test@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Delete Resources"]},{"title":"Get App Password","path":"/api/v1/get/app-passwd/all/{mailbox}","pathTemplate":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox","method":"get","description":"\nUsing this endpoint you can get all app passwords from a specific mailbox.","parameters":[{"location":"path","name":"mailbox","description":"mailbox of entry you want to get","required":true,"example":"hello@mailcow.email","schema":{"type":"string","enum":["hello@mailcow.email"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 2,\n \"name\": \"emclient\",\n \"mailbox\": \"hello@mailcow.email\",\n \"domain\": \"mailcow.email\",\n \"created\": \"2019-12-21 16:04:55\",\n \"modified\": null,\n \"active_int\": 1,\n \"active\": \"✓\"\n }\n]\n","schema":""}}],"tags":["App Passwords","Get App Password"]},{"title":"Create App Password","path":"/api/v1/add/app-passwd","pathTemplate":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd","method":"post","description":"\nUsing this endpoint you can create a new app password for a specific mailbox.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username user@domain.tld","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_name","description":"name of the app password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd","description":"the password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd2","description":"the password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"hello@mailcow.email\"\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"app_name\": {\n \"type\": \"string\"\n },\n \"app_passwd\": {\n \"type\": \"string\"\n },\n \"app_passwd2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"add\",\n {\n \"username\": \"hello@mailcow.email\",\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n }\n ],\n \"msg\": \"app_passwd_added\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Create App Password"]},{"title":"Delete App Password","path":"/api/v1/delete/app-passwd","pathTemplate":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd","method":"post","description":"\nUsing this endpoint you can delete a single app password.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of app passwords you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"delete\",\n {\n \"id\": [\n \"2\"\n ]\n }\n ],\n \"msg\": [\n \"app_passwd_removed\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Delete App Password"]},{"title":"Get container status","path":"/api/v1/get/status/containers","pathTemplate":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ipv6nat-mailcow\": {\n \"type\": \"info\",\n \"container\": \"ipv6nat-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:06:37.273225445Z\",\n \"image\": \"robbertkl/ipv6nat\"\n },\n \"netfilter-mailcow\": {\n \"type\": \"info\",\n \"container\": \"netfilter-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:09.851559297Z\",\n \"image\": \"mailcow/netfilter:1.31\"\n },\n \"rspamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"rspamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.456075355Z\",\n \"image\": \"mailcow/rspamd:1.56\"\n },\n \"acme-mailcow\": {\n \"type\": \"info\",\n \"container\": \"acme-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.270660275Z\",\n \"image\": \"mailcow/acme:1.63\"\n },\n \"dovecot-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dovecot-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.988680259Z\",\n \"image\": \"mailcow/dovecot:1.104\"\n },\n \"postfix-mailcow\": {\n \"type\": \"info\",\n \"container\": \"postfix-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:07.186717617Z\",\n \"image\": \"mailcow/postfix:1.44\"\n },\n \"nginx-mailcow\": {\n \"type\": \"info\",\n \"container\": \"nginx-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.9843038Z\",\n \"image\": \"nginx:mainline-alpine\"\n },\n \"mysql-mailcow\": {\n \"type\": \"info\",\n \"container\": \"mysql-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:02.201937528Z\",\n \"image\": \"mariadb:10.3\"\n },\n \"php-fpm-mailcow\": {\n \"type\": \"info\",\n \"container\": \"php-fpm-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:00.955808957Z\",\n \"image\": \"mailcow/phpfpm:1.55\"\n },\n \"clamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"clamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:01.622856172Z\",\n \"image\": \"mailcow/clamd:1.35\"\n },\n \"memcached-mailcow\": {\n \"type\": \"info\",\n \"container\": \"memcached-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.0907785Z\",\n \"image\": \"memcached:alpine\"\n },\n \"solr-mailcow\": {\n \"type\": \"info\",\n \"container\": \"solr-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.635413798Z\",\n \"image\": \"mailcow/solr:1.7\"\n },\n \"olefy-mailcow\": {\n \"type\": \"info\",\n \"container\": \"olefy-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.676259274Z\",\n \"image\": \"mailcow/olefy:1.2\"\n },\n \"sogo-mailcow\": {\n \"type\": \"info\",\n \"container\": \"sogo-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.382274592Z\",\n \"image\": \"mailcow/sogo:1.65\"\n },\n \"unbound-mailcow\": {\n \"type\": \"info\",\n \"container\": \"unbound-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.760595825Z\",\n \"image\": \"mailcow/unbound:1.10\"\n },\n \"dockerapi-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dockerapi-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.984797808Z\",\n \"image\": \"mailcow/dockerapi:1.36\"\n },\n \"redis-mailcow\": {\n \"type\": \"info\",\n \"container\": \"redis-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.827166834Z\",\n \"image\": \"redis:5-alpine\"\n },\n \"watchdog-mailcow\": {\n \"type\": \"info\",\n \"container\": \"watchdog-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.028660382Z\",\n \"image\": \"mailcow/watchdog:1.65\"\n }\n}\n","schema":""}}],"tags":["status","Get container status"]},{"title":"Get vmail status","path":"/api/v1/get/status/vmail","pathTemplate":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail","method":"get","description":"\nUsing this endpoint you can get the status of the vmail and the amount of used storage.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"disk\": \"/dev/mapper/mail--vg-root\",\n \"used\": \"11G\",\n \"total\": \"41G\",\n \"used_percent\": \"28%\"\n}\n","schema":""}}],"tags":["status","Get vmail status"]},{"title":"Get solr status","path":"/api/v1/get/status/solr","pathTemplate":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"solr_enabled\": false,\n \"solr_size\": null,\n \"solr_documents\": null\n}\n","schema":""}}],"tags":["status","Get solr status"]}],"tagActions":[{"title":"Domains","children":[{"title":"Get domains","actions":[{"title":"Get domains","method":"get","path":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id"}]},{"title":"Create domain","actions":[{"title":"Create domain","method":"post","path":"/api/v1/add/domain","slug":"post~api~v1~add~domain"}]},{"title":"Update domain","actions":[{"title":"Update domain","method":"post","path":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain"}]},{"title":"Delete domain","actions":[{"title":"Delete domain","method":"post","path":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain"}]}]},{"title":"Domain antispam policies","children":[{"title":"List whitelist domain policy","actions":[{"title":"List whitelist domain policy","method":"get","path":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain"}]},{"title":"List blacklist domain policy","actions":[{"title":"List blacklist domain policy","method":"get","path":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain"}]},{"title":"Create domain policy","actions":[{"title":"Create domain policy","method":"post","path":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy"}]},{"title":"Delete domain policy","actions":[{"title":"Delete domain policy","method":"post","path":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy"}]}]},{"title":"Mailboxes","children":[{"title":"Get mailboxes","actions":[{"title":"Get mailboxes","method":"get","path":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id"}]},{"title":"Create mailbox","actions":[{"title":"Create mailbox","method":"post","path":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox"}]},{"title":"Update mailbox","actions":[{"title":"Update mailbox","method":"post","path":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox"}]},{"title":"Delete mailbox","actions":[{"title":"Delete mailbox","method":"post","path":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox"}]},{"title":"Quarantine Notifications","actions":[{"title":"Quarantine Notifications","method":"post","path":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification"}]}]},{"title":"Aliases","children":[{"title":"Get aliases","actions":[{"title":"Get aliases","method":"get","path":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id"}]},{"title":"Create alias","actions":[{"title":"Create alias","method":"post","path":"/api/v1/add/alias","slug":"post~api~v1~add~alias"}]},{"title":"Update alias","actions":[{"title":"Update alias","method":"post","path":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias"}]},{"title":"Delete alias","actions":[{"title":"Delete alias","method":"post","path":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias"}]}]},{"title":"Sync jobs","children":[{"title":"Get sync jobs","actions":[{"title":"Get sync jobs","method":"get","path":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log"}]},{"title":"Create sync job","actions":[{"title":"Create sync job","method":"post","path":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob"}]},{"title":"Update sync job","actions":[{"title":"Update sync job","method":"post","path":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob"}]},{"title":"Delete sync job","actions":[{"title":"Delete sync job","method":"post","path":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob"}]}]},{"title":"Fordwarding Hosts","children":[{"title":"Get Forwarding Hosts","actions":[{"title":"Get Forwarding Hosts","method":"get","path":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all"}]},{"title":"Add Forward Host","actions":[{"title":"Add Forward Host","method":"post","path":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost"}]}]},{"title":"Logs","children":[{"title":"Get Postfix logs","actions":[{"title":"Get Postfix logs","method":"get","path":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count"}]},{"title":"Get Rspamd logs","actions":[{"title":"Get Rspamd logs","method":"get","path":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count"}]},{"title":"Get Dovecot logs","actions":[{"title":"Get Dovecot logs","method":"get","path":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count"}]},{"title":"Get ACME logs","actions":[{"title":"Get ACME logs","method":"get","path":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count"}]},{"title":"Get SOGo logs","actions":[{"title":"Get SOGo logs","method":"get","path":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count"}]},{"title":"Get Watchdog logs","actions":[{"title":"Get Watchdog logs","method":"get","path":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count"}]},{"title":"Get Api logs","actions":[{"title":"Get Api logs","method":"get","path":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count"}]},{"title":"Get Ratelimit logs","actions":[{"title":"Get Ratelimit logs","method":"get","path":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count"}]},{"title":"Get Netfilter logs","actions":[{"title":"Get Netfilter logs","method":"get","path":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count"}]},{"title":"Get Autodiscover logs","actions":[{"title":"Get Autodiscover logs","method":"get","path":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count"}]}]},{"title":"Queue Manager","children":[{"title":"Get Queue","actions":[{"title":"Get Queue","method":"get","path":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all"}]},{"title":"Flush Queue","actions":[{"title":"Flush Queue","method":"post","path":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq"}]},{"title":"Delete Queue","actions":[{"title":"Delete Queue","method":"post","path":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq"}]}]},{"title":"Quarantine","children":[{"title":"Get mails in Quarantine","actions":[{"title":"Get mails in Quarantine","method":"get","path":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all"}]},{"title":"Delete mails in Quarantine","actions":[{"title":"Delete mails in Quarantine","method":"post","path":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem"}]}]},{"title":"Fail2Ban","children":[{"title":"Get Fail2Ban Config","actions":[{"title":"Get Fail2Ban Config","method":"get","path":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban"}]},{"title":"Edit Fail2Ban","actions":[{"title":"Edit Fail2Ban","method":"post","path":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban"}]}]},{"title":"DKIM","children":[{"title":"Get DKIM Key","actions":[{"title":"Get DKIM Key","method":"get","path":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain"}]},{"title":"Generate DKIM Key","actions":[{"title":"Generate DKIM Key","method":"post","path":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim"}]},{"title":"Duplicate DKIM Key","actions":[{"title":"Duplicate DKIM Key","method":"post","path":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate"}]},{"title":"Delete DKIM Key","actions":[{"title":"Delete DKIM Key","method":"post","path":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim"}]}]},{"title":"Domain admin","children":[{"title":"Get Domain Admins","actions":[{"title":"Get Domain Admins","method":"get","path":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all"}]},{"title":"Create Domain Admin user","actions":[{"title":"Create Domain Admin user","method":"post","path":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin"}]},{"title":"Delete Domain Admin","actions":[{"title":"Delete Domain Admin","method":"post","path":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin"}]}]},{"title":"Address Rewriting","children":[{"title":"Get BCC Map","actions":[{"title":"Get BCC Map","method":"get","path":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id"}]},{"title":"Create BCC Map","actions":[{"title":"Create BCC Map","method":"post","path":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc"}]},{"title":"Delete BCC Map","actions":[{"title":"Delete BCC Map","method":"post","path":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc"}]},{"title":"Get Recipient Map","actions":[{"title":"Get Recipient Map","method":"get","path":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id"}]},{"title":"Create Recipient Map","actions":[{"title":"Create Recipient Map","method":"post","path":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map"}]},{"title":"Delete Recipient Map","actions":[{"title":"Delete Recipient Map","method":"post","path":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map"}]}]},{"title":"Outgoing TLS Policy Map Overrides","children":[{"title":"Get TLS Policy Map","actions":[{"title":"Get TLS Policy Map","method":"get","path":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id"}]},{"title":"Create TLS Policy Map","actions":[{"title":"Create TLS Policy Map","method":"post","path":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map"}]},{"title":"Delete TLS Policy Map","actions":[{"title":"Delete TLS Policy Map","method":"post","path":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map"}]}]},{"title":"oAuth Clients","children":[{"title":"Get oAuth Clients","actions":[{"title":"Get oAuth Clients","method":"get","path":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id"}]},{"title":"Create oAuth Client","actions":[{"title":"Create oAuth Client","method":"post","path":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client"}]},{"title":"Delete oAuth Client","actions":[{"title":"Delete oAuth Client","method":"post","path":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client"}]}]},{"title":"Routing","children":[{"title":"Get Sender-Dependent Transports","actions":[{"title":"Get Sender-Dependent Transports","method":"get","path":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id"}]},{"title":"Create Sender-Dependent Transports","actions":[{"title":"Create Sender-Dependent Transports","method":"post","path":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost"}]},{"title":"Delete Sender-Dependent Transports","actions":[{"title":"Delete Sender-Dependent Transports","method":"post","path":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost"}]},{"title":"Get Transport Maps","actions":[{"title":"Get Transport Maps","method":"get","path":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id"}]},{"title":"Create Transport Maps","actions":[{"title":"Create Transport Maps","method":"post","path":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all"}]},{"title":"Delete Transport Maps","actions":[{"title":"Delete Transport Maps","method":"post","path":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport"}]}]},{"title":"Resources","children":[{"title":"Get Resources","actions":[{"title":"Get Resources","method":"get","path":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all"}]},{"title":"Create Resources","actions":[{"title":"Create Resources","method":"post","path":"/api/v1/add/resource","slug":"post~api~v1~add~resource"}]},{"title":"Delete Resources","actions":[{"title":"Delete Resources","method":"post","path":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource"}]}]},{"title":"App Passwords","children":[{"title":"Get App Password","actions":[{"title":"Get App Password","method":"get","path":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox"}]},{"title":"Create App Password","actions":[{"title":"Create App Password","method":"post","path":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd"}]},{"title":"Delete App Password","actions":[{"title":"Delete App Password","method":"post","path":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd"}]}]},{"title":"status","children":[{"title":"Get container status","actions":[{"title":"Get container status","method":"get","path":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers"}]},{"title":"Get vmail status","actions":[{"title":"Get vmail status","method":"get","path":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail"}]},{"title":"Get solr status","actions":[{"title":"Get solr status","method":"get","path":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr"}]}]}],"config":{"playground":{"enabled":true,"env":"easy","environments":{"easy":{"playground":false,"url":"/"},"advanced":{"url":"/"}}},"sidebar":{"groupOrder":"auto"},"basePath":"/","stylesheets":[]}} + props: {"title":"mailcow API","description":"mailcow is complete e-mailing solution with advanced antispam, antivirus, nice UI and API.\n\nIn order to use this API you have to create a API key and add your IP address to the whitelist of allowed IPs this can be done by logging into the Mailcow UI using your admin account, then go to Configuration > Access > Edit administrator details > API. There you will find a collapsed API menu.\n\n**This documentation is in Work In Progress status. It contains only few endpoints.**","version":"","servers":[{"url":"https://mailcow.host/"}],"tags":[{"title":"Domains","description":"","children":[{"title":"Get domains","description":"","children":[]},{"title":"Create domain","description":"","children":[]},{"title":"Update domain","description":"","children":[]},{"title":"Delete domain","description":"","children":[]}]},{"title":"Domain antispam policies","description":"You can create antispam whitelist and blacklist policies","children":[{"title":"List whitelist domain policy","description":"","children":[]},{"title":"List blacklist domain policy","description":"","children":[]},{"title":"Create domain policy","description":"","children":[]},{"title":"Delete domain policy","description":"","children":[]}]},{"title":"Mailboxes","description":"","children":[{"title":"Get mailboxes","description":"","children":[]},{"title":"Create mailbox","description":"","children":[]},{"title":"Update mailbox","description":"","children":[]},{"title":"Update mailbox ACL","description":"","children":[]},{"title":"Update Pushover settings","description":"","children":[]},{"title":"Delete mailbox","description":"","children":[]},{"title":"Quarantine Notifications","description":"","children":[]}]},{"title":"Aliases","description":"","children":[{"title":"Get aliases","description":"","children":[]},{"title":"Create alias","description":"","children":[]},{"title":"Update alias","description":"","children":[]},{"title":"Delete alias","description":"","children":[]}]},{"title":"Sync jobs","description":"","children":[{"title":"Get sync jobs","description":"","children":[]},{"title":"Create sync job","description":"","children":[]},{"title":"Update sync job","description":"","children":[]},{"title":"Delete sync job","description":"","children":[]}]},{"title":"Fordwarding Hosts","description":"","children":[{"title":"Get Forwarding Hosts","description":"","children":[]},{"title":"Add Forward Host","description":"","children":[]},{"title":"Delete Forward Host","description":"","children":[]}]},{"title":"Logs","description":"","children":[{"title":"Get Postfix logs","description":"","children":[]},{"title":"Get Rspamd logs","description":"","children":[]},{"title":"Get Dovecot logs","description":"","children":[]},{"title":"Get ACME logs","description":"","children":[]},{"title":"Get SOGo logs","description":"","children":[]},{"title":"Get Watchdog logs","description":"","children":[]},{"title":"Get Api logs","description":"","children":[]},{"title":"Get Ratelimit logs","description":"","children":[]},{"title":"Get Netfilter logs","description":"","children":[]},{"title":"Get Autodiscover logs","description":"","children":[]}]},{"title":"Queue Manager","description":"","children":[{"title":"Get Queue","description":"","children":[]},{"title":"Flush Queue","description":"","children":[]},{"title":"Delete Queue","description":"","children":[]}]},{"title":"Quarantine","description":"","children":[{"title":"Get mails in Quarantine","description":"","children":[]},{"title":"Delete mails in Quarantine","description":"","children":[]}]},{"title":"Fail2Ban","description":"","children":[{"title":"Get Fail2Ban Config","description":"","children":[]},{"title":"Edit Fail2Ban","description":"","children":[]}]},{"title":"DKIM","description":"","children":[{"title":"Get DKIM Key","description":"","children":[]},{"title":"Generate DKIM Key","description":"","children":[]},{"title":"Duplicate DKIM Key","description":"","children":[]},{"title":"Delete DKIM Key","description":"","children":[]}]},{"title":"Domain admin","description":"","children":[{"title":"Get Domain Admins","description":"","children":[]},{"title":"Create Domain Admin user","description":"","children":[]},{"title":"Delete Domain Admin","description":"","children":[]}]},{"title":"Address Rewriting","description":"","children":[{"title":"Get BCC Map","description":"","children":[]},{"title":"Create BCC Map","description":"","children":[]},{"title":"Delete BCC Map","description":"","children":[]},{"title":"Get Recipient Map","description":"","children":[]},{"title":"Create Recipient Map","description":"","children":[]},{"title":"Delete Recipient Map","description":"","children":[]}]},{"title":"Outgoing TLS Policy Map Overrides","description":"","children":[{"title":"Get TLS Policy Map","description":"","children":[]},{"title":"Create TLS Policy Map","description":"","children":[]},{"title":"Delete TLS Policy Map","description":"","children":[]}]},{"title":"oAuth Clients","description":"","children":[{"title":"Get oAuth Clients","description":"","children":[]},{"title":"Create oAuth Client","description":"","children":[]},{"title":"Delete oAuth Client","description":"","children":[]}]},{"title":"Routing","description":"","children":[{"title":"Get Sender-Dependent Transports","description":"","children":[]},{"title":"Create Sender-Dependent Transports","description":"","children":[]},{"title":"Delete Sender-Dependent Transports","description":"","children":[]},{"title":"Get Transport Maps","description":"","children":[]},{"title":"Create Transport Maps","description":"","children":[]},{"title":"Delete Transport Maps","description":"","children":[]}]},{"title":"Resources","description":"","children":[{"title":"Get Resources","description":"","children":[]},{"title":"Create Resources","description":"","children":[]},{"title":"Delete Resources","description":"","children":[]}]},{"title":"App Passwords","description":"","children":[{"title":"Get App Password","description":"","children":[]},{"title":"Create App Password","description":"","children":[]},{"title":"Delete App Password","description":"","children":[]}]},{"title":"status","description":"","children":[{"title":"Get container status","description":"","children":[]},{"title":"Get vmail status","description":"","children":[]},{"title":"Get solr status","description":"","children":[]}]},{"title":"Ratelimits","description":"","children":[{"title":"Get Ratelimits","description":"","children":[]}]}],"actions":[{"title":"Get domains","path":"/api/v1/get/domain/{id}","pathTemplate":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id","method":"get","description":"\nYou can list all domains existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","mailcow.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"bytes_total\": \"5076666944\",\n \"msgs_total\": \"172440\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain.tld\",\n \"description\": \"Some description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"✘\",\n \"gal\": \"✘\",\n \"backupmx_int\": 0,\n \"gal_int\": 0,\n \"lang\": \"en\",\n \"rl\": false,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"✘\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n },\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"bytes_total\": \"5076666944\",\n \"msgs_total\": \"172440\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain2.tld\",\n \"description\": \"domain description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"✔\",\n \"gal\": \"✘\",\n \"backupmx_int\": 1,\n \"gal_int\": 0,\n \"lang\": \"cs\",\n \"rl\": false,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"✘\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n }\n]\n","schema":""}}],"tags":["Domains","Get domains"]},{"title":"Create domain","path":"/api/v1/add/domain","pathTemplate":"/api/v1/add/domain","slug":"post~api~v1~add~domain","method":"post","description":"\nYou may create your own domain using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"You can also define rate limiting. If `rl_value` is not empty string, them ratelimit object is created and returned in response.","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"Fully qualified domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"description","description":"Description of domain","required":false,"members":[],"schema":{"type":"string"}},{"key":"aliases","description":"limit count of aliases associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"mailboxes","description":"limit count of mailboxes associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"defquota","description":"predefined mailbox quota in `add mailbox` form","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxquota","description":"maximum quota per mailbox","required":false,"members":[],"schema":{"type":"number"}},{"key":"quota","description":"maximum quota for this domain (for all mailboxes in sum)","required":false,"members":[],"schema":{"type":"number"}},{"key":"active","description":"is domain active or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"rl_value","description":"rate limit value","required":false,"members":[],"schema":{"type":"number"}},{"key":"rl_frame","required":false,"members":[],"schema":{"type":"enum"}},{"key":"backupmx","description":"relay domain or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"relay_all_recipients","description":"if not, them you have to create \"dummy\" mailbox for each address to relay","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"lang","description":"language code","required":false,"members":[],"schema":{"type":"enum"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"description\":\"some decsription\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"rl_value\":\"10\",\n \"rl_frame\":\"s\",\n \"backupmx\":\"0\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"rl_value\": {\n \"type\": \"number\"\n },\n \"rl_frame\": {\n \"enum\": [\n \"s\",\n \"m\",\n \"h\"\n ]\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\": \"success\",\n \"log\": [\n \"ratelimit\",\n \"edit\",\n \"domain\",\n {\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"object\": \"domain.tld\"\n }\n ],\n \"msg\": [\n \"rl_saved\",\n \"domain.tld\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"domain\",\n {\n \"domain\": \"domain.tld\",\n \"description\": \"some decsription\",\n \"aliases\": \"400\",\n \"mailboxes\": \"10\",\n \"defquota\": \"3072\",\n \"maxquota\": \"10240\",\n \"quota\": \"10240\",\n \"active\": \"1\",\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"backupmx\": \"0\",\n \"relay_all_recipients\": \"0\",\n \"lang\":\"cs\"\n },\n null\n ],\n \"msg\": [\n \"domain_added\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Create domain"]},{"title":"Update domain","path":"/api/v1/edit/domain","pathTemplate":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain","method":"post","description":"\nYou can update one or more domains per request. You can also send just attributes you want to change.\nExample: You can add domain names to items list and in attr object just include `\"active\": \"0\"` to deactivate domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domain names you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"domain.tld\"\n ],\n \"attr\":{\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"gal\": {\n \"type\": \"boolean\"\n },\n \"relayhost\": {\n \"type\": \"number\"\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\"\n ],\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang:\"cs\"\n },\n null\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Update domain"]},{"title":"Delete domain","path":"/api/v1/delete/domain","pathTemplate":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain","method":"post","description":"\nYou can delete one or more domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domains you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"domain.tld\",\n \"domain2.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain2.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Delete domain"]},{"title":"List whitelist domain policy","path":"/api/v1/get/policy_wl_domain/{domain}","pathTemplate":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain","method":"get","description":"\nYou can list all whitelist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@gooddomain.tld\",\n \"prefid\": 1\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List whitelist domain policy"]},{"title":"List blacklist domain policy","path":"/api/v1/get/policy_bl_domain/{domain}","pathTemplate":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain","method":"get","description":"\nYou can list all blacklist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@baddomain.tld\",\n \"prefid\": 2\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List blacklist domain policy"]},{"title":"Create domain policy","path":"/api/v1/add/domain-policy","pathTemplate":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy","method":"post","description":"\nYou may create your own domain policy using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"domain name to which policy is associated to","required":false,"members":[],"schema":{"type":"string"}},{"key":"object_list","required":false,"members":[],"schema":{"type":"enum"}},{"key":"object_from","description":"exact address or use wildcard to match whole domain","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"object_list\": {\n \"enum\": [\n \"wl\",\n \"bl\"\n ]\n },\n \"object_from\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"add\",\n \"domain\",\n {\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n }\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Create domain policy"]},{"title":"Delete domain policy","path":"/api/v1/delete/domain-policy","pathTemplate":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy","method":"post","description":"\nYou can delete one o more domain policies.","parameters":[],"transactions":[{"request":{"title":"json","description":"Delete domain policy by ID","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of domain policys you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"1\",\n \"2\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"1\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Delete domain policy"]},{"title":"Get mailboxes","path":"/api/v1/get/mailbox/{id}","pathTemplate":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id","method":"get","description":"\nYou can list all mailboxes existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","user@domain.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_quota\":10737418240,\n \"username\":\"info@doman3.tld\",\n \"rl\":false,\n \"is_relayed\":0,\n \"name\":\"Full name\",\n \"active\":\"✔\",\n \"active_int\":1,\n \"domain\":\"doman3.tld\",\n \"local_part\":\"info\",\n \"quota\":3221225472,\n \"attributes\":{\n \"force_pw_update\":\"0\",\n \"tls_enforce_in\":\"0\",\n \"tls_enforce_out\":\"0\",\n \"sogo_access\":\"1\",\n \"mailbox_format\":\"maildir:\",\n \"quarantine_notification\":\"never\"\n },\n \"quota_used\":0,\n \"percent_in_use\":0,\n \"messages\":0,\n \"spam_aliases\":0,\n \"percent_class\":\"success\"\n }\n]\n","schema":""}}],"tags":["Mailboxes","Get mailboxes"]},{"title":"Create mailbox","path":"/api/v1/add/mailbox","pathTemplate":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox","method":"post","description":"\nYou may create your own mailbox using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_part","description":"left part of email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"name","description":"Full name of the mailbox user","required":false,"members":[],"schema":{"type":"string"}},{"key":"quota","description":"mailbox quota","required":false,"members":[],"schema":{"type":"number"}},{"key":"pasword","description":"mailbox password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"mailbox password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"is mailbox active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"atedismonsin\",\n \"password2\":\"atedismonsin\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_part\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"mailbox\",\n {\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_added\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Create mailbox"]},{"title":"Update mailbox","path":"/api/v1/edit/mailbox","pathTemplate":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox","method":"post","description":"\nYou can update one or more mailboxes per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"sender_acl":["default","info@domain2.tld","domain3.tld","asterix"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"info@domain.tld\"\n ],\n \"attr\":{\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"\",\n \"password2\":\"\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"sender_acl\": {\n \"type\": \"array\"\n },\n \"force_pw_update\": {\n \"type\": \"boolean\"\n },\n \"sogo_access\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\"\n ],\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox"]},{"title":"Update mailbox ACL","path":"/api/v1/edit/user-acl","pathTemplate":"/api/v1/edit/user-acl","slug":"post~api~v1~edit~user-acl","method":"post","description":"\nUsing this endpoints its possible to update the ACL's for mailboxes","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"user_acl":["spam_alias","tls_policy","spam_score","spam_policy","delimiter_action","syncjobs","eas_reset","quarantine","sogo_profile_reset","quarantine_attachments","quarantine_notification","app_passwds","pushover"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\": [\"info@domain.tld\"],\n \"attr\": {\n \"user_acl\": [\"spam_alias\",\"tls_policy\",\"spam_score\",\"spam_policy\",\"delimiter_action\",\"syncjobs\",\"eas_reset\",\"quarantine\",\"sogo_profile_reset\",\"quarantine_attachments\",\"quarantine_notification\",\"app_passwds\",\"pushover\"]\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"user_acl\": {\n \"type\": \"array\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"acl\",\n \"edit\",\n \"user\",\n {\n \"username\": [\n \"info@domain.tld\"\n ],\n \"user_acl\": [\n \"spam_alias\",\n \"tls_policy\",\n \"spam_score\",\n \"spam_policy\",\n \"delimiter_action\",\n \"syncjobs\",\n \"eas_reset\",\n \"quarantine\",\n \"sogo_profile_reset\",\n \"quarantine_attachments\",\n \"quarantine_notification\",\n \"app_passwds\",\n \"pushover\"\n ]\n }\n ],\n \"msg\": [\n \"acl_saved\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox ACL"]},{"title":"Update Pushover settings","path":"/api/v1/edit/pushover","pathTemplate":"/api/v1/edit/pushover","slug":"post~api~v1~edit~pushover","method":"post","description":"\nUsing this endpoint it is possible to update the pushover settings for mailboxes","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\": [\"info@domain.tld\"],\n \"attr\":\n {\n \"evaluate_x_prio\": \"0\",\n \"only_x_prio\": \"0\",\n \"active\": \"0\",\n \"token\":\"9023e2ohcwed27d1idu2\",\n \"key\":\"21e8918e1jksdjcpis712\",\n \"title\":\"Mail\",\n \"text\":\"\",\n \"senders\":\"\",\n \"senders_regex\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"evaluate_x_prio\": {\n \"type\": \"number\"\n },\n \"only_x_prio\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"number\"\n },\n \"token\": {\n \"type\": \"string\"\n },\n \"key\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"senders\": {\n \"type\": \"string\"\n },\n \"senders_regex\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"pushover\",\n \"edit\",\n {\n \"username\": [\n \"info@domain.tld\"\n ],\n \"evaluate_x_prio\": \"0\",\n \"only_x_prio\": \"0\",\n \"active\": \"0\",\n \"token\": \"9023e2ohcwed27d1idu2\",\n \"key\": \"21e8918e1jksdjcpis712\",\n \"title\": \"Mail\",\n \"text\": \"\",\n \"senders\": \"\",\n \"senders_regex\": \"\"\n }\n ],\n \"msg\": \"pushover_settings_edited\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update Pushover settings"]},{"title":"Delete mailbox","path":"/api/v1/delete/mailbox","pathTemplate":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox","method":"post","description":"\nYou can delete one or more mailboxes.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"info@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"sales@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Delete mailbox"]},{"title":"Quarantine Notifications","path":"/api/v1/edit/quarantine_notification","pathTemplate":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification","method":"post","description":"\nYou can update one or more mailboxes per request.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want set qurantine notifications","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"mailbox1@domain.tld\",\n \"mailbox2@domain.tld\"\n ],\n \"attr\":{\n \"quarantine_notification\":\"hourly\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"quarantine_notification\": {\n \"enum\": [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"never\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"","schema":""}}],"tags":["Mailboxes","Quarantine Notifications"]},{"title":"Get aliases","path":"/api/v1/get/alias/{id}","pathTemplate":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id","method":"get","description":"\nYou can list mailbox aliases existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"in_primary_domain\": \"\",\n \"id\": 6,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"alias@domain.tld\",\n \"is_catch_all\": 0,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"created\": \"2019-04-04 19:29:49\",\n \"modified\": null\n },\n {\n \"in_primary_domain\": \"\",\n \"id\": 10,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"@domain.tld\",\n \"is_catch_all\": 1,\n \"active\": \"✔\",\n \"active_int\": 1,\n \"created\": \"2019-04-27 13:42:39\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Aliases","Get aliases"]},{"title":"Create alias","path":"/api/v1/add/alias","pathTemplate":"/api/v1/add/alias","slug":"post~api~v1~add~alias","method":"post","description":"\nYou may create your own mailbox alias using this action. It takes a JSON object containing a domain informations.\nOnly one `goto*` option can be used, for ex. if you want learn as spam, then send just `goto_spam = 1` in request body.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"address","description":"alias address, for catchall use \"@domain.tld\"","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto","description":"destination address, comma separated","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto_null","description":"silently ignore","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_spam","description":"learn as spam","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_ham","description":"learn as ham","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"is alias active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"alias\",\n {\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_added\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Create alias"]},{"title":"Update alias","path":"/api/v1/edit/alias","pathTemplate":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias","method":"post","description":"\nYou can update one or more aliases per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"6\"\n ],\n \"attr\":{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"private_comment\": {\n \"type\": \"string\"\n },\n \"public_comment\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"alias\",\n {\n \"id\":[\n \"6\"\n ],\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_modified\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Update alias"]},{"title":"Delete alias","path":"/api/v1/delete/alias","pathTemplate":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias","method":"post","description":"\nYou can delete one or more aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\n \"6\",\n \"9\"\n]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias2@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Delete alias"]},{"title":"Get sync jobs","path":"/api/v1/get/syncjobs/all/no_log","pathTemplate":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log","method":"get","description":"\nYou can list all syn jobs existing in system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"user2\": \"mailbox@domain.tld\",\n \"host1\": \"imap.server.tld\",\n \"authmech1\": \"PLAIN\",\n \"regextrans2\": \"\",\n \"authmd51\": 0,\n \"domain2\": \"\",\n \"subfolder2\": \"External\",\n \"user1\": \"username\",\n \"exclude\": \"(?i)spam|(?i)junk\",\n \"maxage\": 0,\n \"mins_interval\": \"20\",\n \"maxbytespersecond\": \"0\",\n \"port1\": 993,\n \"enc1\": \"TLS\",\n \"delete2duplicates\": 1,\n \"delete1\": 0,\n \"delete2\": 0,\n \"automap\": 1,\n \"skipcrossduplicates\": 0,\n \"custom_params\": \"\",\n \"timeout1\": 600,\n \"timeout2\": 600,\n \"subscribeall\": 1,\n \"is_running\": 0,\n \"last_run\": \"2019-05-22 11:40:02\",\n \"created\": \"2019-05-22 11:37:25\",\n \"modified\": \"2019-05-22 11:40:02\",\n \"active\": \"✓\",\n \"active_int\": 1,\n \"log\": \"\"\n }\n]\n","schema":""}}],"tags":["Sync jobs","Get sync jobs"]},{"title":"Create sync job","path":"/api/v1/add/syncjob","pathTemplate":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob","method":"post","description":"\nYou can create new sync job using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"The target mailbox","required":false,"members":[],"schema":{"type":"string"}},{"key":"delete2duplicates","description":"Delete duplicates on destination","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete1","description":"Delete from source when completed","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete2","description":"Delete messages on destination that are not on source","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"automap","description":"Try to automap folders (\"Sent items\", \"Sent\" => \"Sent\" etc.)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"skipcrossduplicates","description":"Skip duplicate messages across folders (first come, first serve)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"Is sync job active","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"subscribeall","description":"Subscribe all folders","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"host1","description":"Hostname","required":false,"members":[],"schema":{"type":"string"}},{"key":"port1","description":"Port","required":false,"members":[],"schema":{"type":"string"}},{"key":"user1","description":"Username","required":false,"members":[],"schema":{"type":"string"}},{"key":"password1","description":"Password","required":false,"members":[],"schema":{"type":"string"}},{"key":"enc1","description":"Encryption","required":false,"members":[],"schema":{"type":"enum"}},{"key":"mins_interval","description":"Interval (min)","required":false,"members":[],"schema":{"type":"number"}},{"key":"subfolder2","description":"Sync into subfolder on destination (empty = do not use subfolder)","required":false,"members":[],"schema":{"type":"string"}},{"key":"maxage","description":"Maximum age of messages in days that will be polled from remote (0 = ignore age)","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxbytespersecond","description":"Max. bytes per second (0 = unlimited)","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout1","description":"Timeout for connection to remote host","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout2","description":"Timeout for connection to local host","required":false,"members":[],"schema":{"type":"number"}},{"key":"exclude","description":"Exclude objects (regex)","required":false,"members":[],"schema":{"type":"string"}},{"key":"custom_params","description":"Custom parameters passed to imapsync command","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\",\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"syncjob\",\n {\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":993,\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"mailbox@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Create sync job"]},{"title":"Update sync job","path":"/api/v1/edit/syncjob","pathTemplate":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob","method":"post","description":"\nYou can update one or more sync jobs per request. You can also send just attributes you want to change.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"1\"\n ],\n \"attr\":{\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"active\":\"1\",\n \"subscribeall\":\"1\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Update sync job"]},{"title":"Delete sync job","path":"/api/v1/delete/syncjob","pathTemplate":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob","method":"post","description":"\nYou can delete one or more sync jobs.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"6\",\n \"9\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Delete sync job"]},{"title":"Get Forwarding Hosts","path":"/api/v1/get/fwdhost/all","pathTemplate":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all","method":"get","description":"\nYou can list all Forwarding Hosts in your mailcow.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"host\": \"5.1.76.202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n },\n {\n \"host\": \"2a00:f820:417::202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n }\n]\n","schema":""}}],"tags":["Fordwarding Hosts","Get Forwarding Hosts"]},{"title":"Add Forward Host","path":"/api/v1/add/fwdhost","pathTemplate":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost","method":"post","description":"\nAdd a new Forwarding host to mailcow. You can chose to enable or disable spam filtering of incoming emails by specifing `filter_spam` 0 = inactive, 1 = active.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"contains the hostname you want to add","required":false,"members":[],"schema":{"type":"string"}},{"key":"filter_spam","description":"1 to enable spam filter, 0 to disable spam filter","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"filter_spam\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"add\",\n {\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n }\n ],\n \"msg\": [\n \"forwarding_host_added\",\n \"5.1.76.202, 2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Add Forward Host"]},{"title":"Delete Forward Host","path":"/api/v1/delete/fwdhost","pathTemplate":"/api/v1/delete/fwdhost","slug":"post~api~v1~delete~fwdhost","method":"post","description":"\nUsing this endpoint you can delete a forwarding host, in order to do so you need to know the IP of the host.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"ip","description":"contains the ip of the fowarding host you want to delete","required":false,"members":[],"schema":{"type":"string"}}]},"example":"[\"5.1.76.202\",\"2a00:f820:417::202\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"ip\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"delete\",\n {\n \"forwardinghost\": [\n \"5.1.76.202\",\n \"2a00:f820:417::202\"\n ]\n }\n ],\n \"msg\": [\n \"forwarding_host_removed\",\n \"5.1.76.202\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"delete\",\n {\n \"forwardinghost\": [\n \"5.1.76.202\",\n \"2a00:f820:417::202\"\n ]\n }\n ],\n \"msg\": [\n \"forwarding_host_removed\",\n \"2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Delete Forward Host"]},{"title":"Get Postfix logs","path":"/api/v1/get/logs/postfix/{count}","pathTemplate":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count","method":"get","description":"\nThis Api endpoint lists all Postfix logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569937433\",\n \"program\": \"postfix/qmgr\",\n \"priority\": \"info\",\n \"message\": \"EF1711500458: removed\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Postfix logs"]},{"title":"Get Rspamd logs","path":"/api/v1/get/logs/rspamd-history/{count}","pathTemplate":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count","method":"get","description":"\nThis Api endpoint lists all Rspamd logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n {\n \"time_virtual\": 0.235653,\n \"rcpt_mime\": [\n \"github@mailcow.tld\"\n ],\n \"message-id\": \"cm.0521259281087.phrkjuk.wdljulyl.i@cmail20.com\",\n \"ip\": \"1.1.1.1\",\n \"rcpt_smtp\": [\n \"github@mailcow.tld\"\n ],\n \"action\": \"soft reject\",\n \"time_real\": 2.856102,\n \"score\": 11.59,\n \"is_skipped\": false,\n \"size\": 35513,\n \"user\": \"unknown\",\n \"sender_mime\": \"noreply@github.com\",\n \"symbols\": {\n \"FROM_NEQ_ENVFROM\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0,\n \"name\": \"FROM_NEQ_ENVFROM\",\n \"description\": \"From address is different to the envelope\"\n },\n \"FORGED_SENDER\": {\n \"metric_score\": 0.3,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0.3,\n \"name\": \"FORGED_SENDER\",\n \"description\": \"Sender is forged (different From: header and smtp MAIL FROM: addresses)\"\n },\n \"RWL_MAILSPIKE_NEUTRAL\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.rep.mailspike.net : 127.0.0.13\"\n ],\n \"score\": 0,\n \"name\": \"RWL_MAILSPIKE_NEUTRAL\",\n \"description\": \"Neutral result from Mailspike\"\n },\n \"HAS_LIST_UNSUB\": {\n \"metric_score\": -0.01,\n \"score\": -0.01,\n \"name\": \"HAS_LIST_UNSUB\",\n \"description\": \"Has List-Unsubscribe header\"\n },\n \"URI_COUNT_ODD\": {\n \"metric_score\": 1,\n \"options\": [\n \"25\"\n ],\n \"score\": 1,\n \"name\": \"URI_COUNT_ODD\",\n \"description\": \"Odd number of URIs in multipart\\/alternative message\"\n },\n \"MIME_TRACE\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"MIME_TRACE\",\n \"options\": [\n \"0:+\",\n \"1:+\",\n \"2:~\"\n ]\n },\n \"R_DKIM_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"github.com:s=cm\",\n \"cmail2.com:s=cs2013\"\n ],\n \"score\": 0,\n \"name\": \"R_DKIM_ALLOW\",\n \"description\": \"DKIM verification succeed\"\n },\n \"FROM_HAS_DN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"FROM_HAS_DN\",\n \"description\": \"From header has a display name\"\n },\n \"MIME_GOOD\": {\n \"metric_score\": -0.1,\n \"options\": [\n \"multipart\\/alternative\",\n \"text\\/plain\"\n ],\n \"score\": -0.1,\n \"name\": \"MIME_GOOD\",\n \"description\": \"Known content-type\"\n },\n \"REPLYTO_ADDR_EQ_FROM\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"REPLYTO_ADDR_EQ_FROM\",\n \"description\": \"Reply-To header is identical to SMTP From\"\n },\n \"TO_MATCH_ENVRCPT_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_MATCH_ENVRCPT_ALL\",\n \"description\": \"All of the recipients match the envelope\"\n },\n \"ASN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ASN\",\n \"options\": [\n \"asn:55819, ipnet:203.55.21.0\\/24, country:AU\"\n ]\n },\n \"HTML_SHORT_LINK_IMG_1\": {\n \"metric_score\": 2,\n \"score\": 2,\n \"name\": \"HTML_SHORT_LINK_IMG_1\",\n \"description\": \"Short html part (0..1K) with a link to an image\"\n },\n \"SCHAALIT_URI_823\": {\n \"metric_score\": 5,\n \"score\": 5,\n \"name\": \"SCHAALIT_URI_823\",\n \"options\": [\n \"SCHAALIT_URI_823\"\n ]\n },\n \"DMARC_POLICY_ALLOW\": {\n \"metric_score\": -0.5,\n \"options\": [\n \"github.com\",\n \"none\"\n ],\n \"score\": 0,\n \"name\": \"DMARC_POLICY_ALLOW\",\n \"description\": \"DMARC permit policy\"\n },\n \"MANY_INVISIBLE_PARTS\": {\n \"metric_score\": 1,\n \"options\": [\n \"4\"\n ],\n \"score\": 0.3,\n \"name\": \"MANY_INVISIBLE_PARTS\",\n \"description\": \"Many parts are visually hidden\"\n },\n \"DKIM_TRACE\": {\n \"metric_score\": 0,\n \"options\": [\n \"github.com:+\",\n \"cmail2.com:+\"\n ],\n \"score\": 0,\n \"name\": \"DKIM_TRACE\",\n \"description\": \"DKIM trace symbol\"\n },\n \"MX_GOOD\": {\n \"metric_score\": -0.01,\n \"options\": [\n \"mx20.inbound.createsend.com\",\n \"mx21.inbound.createsend.com\"\n ],\n \"score\": -0.01,\n \"name\": \"MX_GOOD\",\n \"description\": \"MX was ok\"\n },\n \"TO_DN_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_DN_ALL\",\n \"description\": \"All the recipients have display names\"\n },\n \"RCPT_MAILCOW_DOMAIN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"RCPT_MAILCOW_DOMAIN\",\n \"options\": [\n \"gc-mc.de\"\n ]\n },\n \"XM_UA_NO_VERSION\": {\n \"metric_score\": 0.01,\n \"score\": 0.01,\n \"name\": \"XM_UA_NO_VERSION\",\n \"description\": \"X-Mailer\\/User-Agent has no version\"\n },\n \"HAS_REPLYTO\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\"\n ],\n \"score\": 0,\n \"name\": \"HAS_REPLYTO\",\n \"description\": \"Has Reply-To header\"\n },\n \"R_SPF_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"+ip4:203.55.21.0\\/24\"\n ],\n \"score\": 0,\n \"name\": \"R_SPF_ALLOW\",\n \"description\": \"SPF verification allows sending\"\n },\n \"URIBL_GREY\": {\n \"metric_score\": 1.5,\n \"options\": [\n \"cmail2.com.multi.uribl.com\",\n \"cmail20.com.multi.uribl.com\",\n \"updatemyprofile.com.multi.uribl.com\"\n ],\n \"score\": 1.5,\n \"name\": \"URIBL_GREY\",\n \"description\": \"uribl.com grey url\"\n },\n \"CLAM_VIRUS_FAIL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"CLAM_VIRUS_FAIL\",\n \"options\": [\n \"failed to scan and retransmits exceed\"\n ]\n },\n \"GREYLIST\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"GREYLIST\",\n \"options\": [\n \"greylisted\",\n \"Wed, 25 Sep 2019 19:27:10 GMT\",\n \"new record\"\n ]\n },\n \"ARC_NA\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ARC_NA\",\n \"description\": \"ARC signature absent\"\n },\n \"RCVD_COUNT_ZERO\": {\n \"metric_score\": 0,\n \"options\": [\n \"0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_COUNT_ZERO\",\n \"description\": \"Message has no Received headers\"\n },\n \"BAD_REP_POLICIES\": {\n \"metric_score\": 0.1,\n \"score\": 0.1,\n \"name\": \"BAD_REP_POLICIES\",\n \"description\": \"Contains valid policies but are also marked by fuzzy\\/bayes\\/surbl\\/rbl\"\n },\n \"RCPT_COUNT_ONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"1\"\n ],\n \"score\": 0,\n \"name\": \"RCPT_COUNT_ONE\",\n \"description\": \"One recipient\"\n },\n \"RBL_UCEPROTECT_LEVEL1\": {\n \"metric_score\": 3.5,\n \"score\": 3.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL1\",\n \"options\": [\n \"17.21.55.203.dnsbl-1.uceprotect.net\"\n ]\n },\n \"DWL_DNSWL_HI\": {\n \"metric_score\": -3.5,\n \"options\": [\n \"github.com.dwl.dnswl.org : 127.0.9.3\"\n ],\n \"score\": -3.5,\n \"name\": \"DWL_DNSWL_HI\",\n \"description\": \"Message has a valid dkim signature originated from domain listed at https:\\/\\/www.dnswl.org, high trust\"\n },\n \"RCVD_IN_DNSWL_NONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.list.dnswl.org : 127.0.15.0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_IN_DNSWL_NONE\",\n \"description\": \"Sender listed at https:\\/\\/www.dnswl.org, no trust\"\n },\n \"RBL_UCEPROTECT_LEVEL2\": {\n \"metric_score\": 1.5,\n \"score\": 1.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL2\",\n \"options\": [\n \"17.21.55.203.dnsbl-2.uceprotect.net\"\n ]\n }\n },\n \"subject\": \"[mailcow/mailcow-dockerized] Unable to change name of alias email address (#2997)\",\n \"required_score\": 15,\n \"unix_time\": 1569439327,\n \"sender_smtp\": \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n }\n}\n","schema":""}}],"tags":["Logs","Get Rspamd logs"]},{"title":"Get Dovecot logs","path":"/api/v1/get/logs/dovecot/{count}","pathTemplate":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count","method":"get","description":"\nThis Api endpoint lists all Dovecot logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938740\",\n \"program\": \"dovecot\",\n \"priority\": \"info\",\n \"message\": \"managesieve-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.22.1.3, lip=172.22.1.250\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Dovecot logs"]},{"title":"Get ACME logs","path":"/api/v1/get/logs/acme/{count}","pathTemplate":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count","method":"get","description":"\nThis Api endpoint lists all ACME logs from issued Lets Enctypts certificates.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569927728\",\n \"message\": \"Certificate validation done, neither changed nor due for renewal, sleeping for another day.\"\n }\n]\n","schema":""}}],"tags":["Logs","Get ACME logs"]},{"title":"Get SOGo logs","path":"/api/v1/get/logs/sogo/{count}","pathTemplate":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count","method":"get","description":"\nThis Api endpoint lists all SOGo logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938874\",\n \"program\": \"sogod\",\n \"priority\": \"notice\",\n \"message\": \"[109]: mailcowdockerized_watchdog-mailcow_1.mailcowdockerized_mailcow-network \\\"GET \\/SOGo.index\\/ HTTP\\/1.1\\\" 200 2531\\/0 0.005 - - 0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get SOGo logs"]},{"title":"Get Watchdog logs","path":"/api/v1/get/logs/watchdog/{count}","pathTemplate":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count","method":"get","description":"\nThis Api endpoint lists all Watchdog logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938958\",\n \"service\": \"Fail2ban\",\n \"lvl\": \"100\",\n \"hpnow\": \"1\",\n \"hptotal\": \"1\",\n \"hpdiff\": \"0\"\n },\n {\n \"time\": \"1569938956\",\n \"service\": \"Rspamd\",\n \"lvl\": \"100\",\n \"hpnow\": \"5\",\n \"hptotal\": \"5\",\n \"hpdiff\": \"0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Watchdog logs"]},{"title":"Get Api logs","path":"/api/v1/get/logs/api/{count}","pathTemplate":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count","method":"get","description":"\nThis Api endpoint lists all Api logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569939001,\n \"uri\": \"\\/api\\/v1\\/get\\/logs\\/api\\/2\",\n \"method\": \"GET\",\n \"remote\": \"1.1.1.1\",\n \"data\": \"\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Api logs"]},{"title":"Get Ratelimit logs","path":"/api/v1/get/logs/ratelimited/{count}","pathTemplate":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count","method":"get","description":"\nThis Api endpoint lists all Ratelimit logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569269003,\n \"rcpt\": \"hello@mailcow.email\",\n \"from\": \"awesome@mailcow.email\",\n \"user\": \"awesome@mailcow.email\",\n \"rl_info\": \"mailcow(RLsdz3tuabozgd4oacbdh8kc78)\",\n \"rl_name\": \"mailcow\",\n \"rl_hash\": \"RLsdz3tuabozgd4oacbdh8kc78\",\n \"qid\": \"E3CF91500458\",\n \"ip\": \"172.22.1.248\",\n \"message_id\": \"6a-5d892500-7-240abd80@90879116\",\n \"header_subject\": \"Mailcow is amazing\",\n \"header_from\": \"\\\"Awesome\\\" \"\n }\n]\n","schema":""}}],"tags":["Logs","Get Ratelimit logs"]},{"title":"Get Netfilter logs","path":"/api/v1/get/logs/netfilter/{count}","pathTemplate":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count","method":"get","description":"\nThis Api endpoint lists all Netfilter logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569754911,\n \"priority\": \"info\",\n \"message\": \"Whitelist was changed, it has 1 entries\"\n },\n {\n \"time\": 1569754911,\n \"priority\": \"crit\",\n \"message\": \"Add host\\/network 1.1.1.1\\/32 to blacklist\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Netfilter logs"]},{"title":"Get Autodiscover logs","path":"/api/v1/get/logs/autodiscover/{count}","pathTemplate":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count","method":"get","description":"\nThis Api endpoint lists all Autodiscover logs.\nTip: You can limit how many logs you want to get by using `/` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569684212,\n \"ua\": \"Microsoft Office\\/16.0 (Windows NT 6.2; MAPICPL 16.0.11328; Pro)\",\n \"user\": \"awesome@mailcow.de\",\n \"service\": \"activesync\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Autodiscover logs"]},{"title":"Get Queue","path":"/api/v1/get/mailq/all","pathTemplate":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all","method":"get","description":"\nGet the current mail queue and everything it contains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"queue_name\": \"incoming\",\n \"queue_id\": \"B98C6260CA1\",\n \"arrival_time\": 1570091234,\n \"message_size\": 1848,\n \"sender\": \"sender@mailcow.tld\",\n \"recipients\": [\n \"recipient@awesomecow.tld\"\n ]\n }\n]\n","schema":""}}],"tags":["Queue Manager","Get Queue"]},{"title":"Flush Queue","path":"/api/v1/edit/mailq","pathTemplate":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq","method":"post","description":"\nUsing this API you can flush the current mail queue. This will try to deliver all mails currently in it.\nThis API uses the command: `postqueue -f`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use flush to flush the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"flush\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Flush Queue"]},{"title":"Delete Queue","path":"/api/v1/delete/mailq","pathTemplate":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq","method":"post","description":"\nUsing this API you can delete the current mail queue. This will delete all mails in it.\nThis API uses the command: `postsuper -d`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use super_delete to delete the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"super_delete\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Delete Queue"]},{"title":"Get mails in Quarantine","path":"/api/v1/get/quarantine/all","pathTemplate":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all","method":"get","description":"\nGet all mails that are currently in Quarantine.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"id\": 33,\n \"qid\": \"8224615004C1\",\n \"subject\": \"mailcow is awesome\",\n \"virus_flag\": 0,\n \"score\": 15.48,\n \"rcpt\": \"admin@domain.tld\",\n \"sender\": \"bounces@send.domain.tld\",\n \"created\": 1572688831,\n \"notified\": 1\n}\n","schema":""}}],"tags":["Quarantine","Get mails in Quarantine"]},{"title":"Delete mails in Quarantine","path":"/api/v1/delete/qitem","pathTemplate":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem","method":"post","description":"\nUsing this endpoint you can delete a email from quarantine, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of emails you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"33\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"quarantine\",\n \"delete\",\n {\n \"id\": [\n \"33\"\n ]\n }\n ],\n \"msg\": [\n \"item_deleted\",\n \"33\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Quarantine","Delete mails in Quarantine"]},{"title":"Get Fail2Ban Config","path":"/api/v1/get/fail2ban","pathTemplate":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban","method":"get","description":"\nGets the current Fail2Ban configuration.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ban_time\": 604800,\n \"netban_ipv4\": 32,\n \"netban_ipv6\": 128,\n \"max_attempts\": 1,\n \"retry_window\": 7200,\n \"whitelist\": \"1.1.1.1\",\n \"blacklist\": \"45.82.153.37\\/32\\n92.118.38.52\\/32\",\n \"perm_bans\": [\n \"45.82.153.37\\/32\",\n \"92.118.38.52\\/32\"\n ]\n}\n","schema":""}}],"tags":["Fail2Ban","Get Fail2Ban Config"]},{"title":"Edit Fail2Ban","path":"/api/v1/edit/fail2ban","pathTemplate":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban","method":"post","description":"\nUsing this endpoint you can edit the Fail2Ban config and black or whitelist new ips.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":[],"description":"has to be none","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"description":"array containing the fail2ban settings","required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"none\"\n ],\n \"attr\": {\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"ban_time\": {\n \"type\": \"number\"\n },\n \"max_attempts\": {\n \"type\": \"number\"\n },\n \"retry_window\": {\n \"type\": \"number\"\n },\n \"netban_ipv4\": {\n \"type\": \"number\"\n },\n \"netban_ipv6\": {\n \"type\": \"number\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n },\n \"backlist\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"type\": \"success\",\n \"log\": [\n \"fail2ban\",\n \"edit\",\n {\n \"network\": [\n \"none\"\n ],\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n ],\n \"msg\": \"f2b_modified\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fail2Ban","Edit Fail2Ban"]},{"title":"Get DKIM Key","path":"/api/v1/get/dkim/{domain}","pathTemplate":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain","method":"get","description":"\nUsing this endpoint you can get the DKIM public key for a specific domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"pubkey\": \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"length\": \"2048\",\n \"dkim_txt\": \"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"dkim_selector\": \"dkim\",\n \"privkey\": \"\"\n}\n","schema":""}}],"tags":["DKIM","Get DKIM Key"]},{"title":"Generate DKIM Key","path":"/api/v1/add/dkim","pathTemplate":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim","method":"post","description":"\nUsing this endpoint you can generate new DKIM keys.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"the domain which a key should be generated for","required":false,"members":[],"schema":{"type":"string"}},{"key":"dkim_selector","description":"the DKIM selector default dkim","required":false,"members":[],"schema":{"type":"string"}},{"key":"key_size","description":"the key size (1024 or 2048)","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"domains\":\"mailcow.tld\",\n \"dkim_selector\":\"dkim\",\n \"key_size\":\"2048\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"dkim_selector\": {\n \"type\": \"string\"\n },\n \"key_size\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"add\",\n {\n \"domains\": \"hanspeterlol.de\",\n \"dkim_selector\": \"dkim\",\n \"key_size\": \"2048\"\n }\n ],\n \"msg\": [\n \"dkim_added\",\n \"hanspeterlol.de\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Generate DKIM Key"]},{"title":"Duplicate DKIM Key","path":"/api/v1/add/dkim_duplicate","pathTemplate":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate","method":"post","description":"\nUsing this endpoint you can duplicate the DKIM Key of one domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"fron_domain","description":"the domain where the dkim key should be copied from","required":false,"members":[],"schema":{"type":"string"}},{"key":"to_domain","description":"the domain where the dkim key should be copied to","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"from_domain\":\"mailcow.tld\",\n \"to_domain\":\"awesomecow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"fron_domain\": {\n \"type\": \"string\"\n },\n \"to_domain\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"duplicate\",\n {\n \"from_domain\": \"mailcow.tld\",\n \"to_domain\": \"awesomecow.tld\"\n }\n ],\n \"msg\": [\n \"dkim_duplicated\",\n \"mailcow.tld\",\n \"awesomecow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Duplicate DKIM Key"]},{"title":"Delete DKIM Key","path":"/api/v1/delete/dkim","pathTemplate":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim","method":"post","description":"\nUsing this endpoint a existing DKIM Key can be deleted","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\"mailcow.tld\"]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"delete\",\n {\n \"domains\": [\n \"mailcow.tld\"\n ]\n }\n ],\n \"msg\": [\n \"dkim_removed\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Delete DKIM Key"]},{"title":"Get Domain Admins","path":"/api/v1/get/domain-admin/all","pathTemplate":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all","method":"get","description":"\n","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"username\": \"testadmin\",\n \"tfa_active\": \"✕\",\n \"active\": \"✓\",\n \"tfa_active_int\": null,\n \"active_int\": 1,\n \"created\": \"2019-10-02 10:29:41\",\n \"selected_domains\": [\n \"mailcow.tld\"\n ],\n \"unselected_domains\": [\n \"awesomemailcow.de\",\n \"mailcowisgreat.de\"\n ]\n }\n]\n","schema":""}}],"tags":["Domain admin","Get Domain Admins"]},{"title":"Create Domain Admin user","path":"/api/v1/add/domain-admin","pathTemplate":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin","method":"post","description":"\nUsing this endpoint you can create a new Domain Admin user. This user has full control over a domain, and can create new mailboxes and aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username for the admin user","required":false,"members":[],"schema":{"type":"string"}},{"key":"domains","description":"the domains the user should be a admin of","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"supersecurepw\",\n \"password2\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"domains\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"add\",\n {\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"*\",\n \"password2\": \"*\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"domain_admin_added\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Create Domain Admin user"]},{"title":"Delete Domain Admin","path":"/api/v1/delete/domain-admin","pathTemplate":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin","method":"post","description":"\nUsing this endpoint a existing Domain Admin user can be deleted.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["username"],"description":"contains list of usernames of the users you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"testadmin\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"delete\",\n {\n \"username\": [\n \"testadmin\"\n ]\n }\n ],\n \"msg\": [\n \"domain_admin_removed\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Delete Domain Admin"]},{"title":"Get BCC Map","path":"/api/v1/get/bcc/{id}","pathTemplate":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id","method":"get","description":"\nUsing this endpoint you can get all BCC maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"local_dest\": \"@mailcow.tld\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"type\": \"sender\",\n \"created\": \"2019-10-02 21:44:34\",\n \"domain\": \"mailcow.tld\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get BCC Map"]},{"title":"Create BCC Map","path":"/api/v1/add/bcc","pathTemplate":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc","method":"post","description":"\nUsing this endpoint you can create a BCC map to forward all mails via a bcc for a given domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_dest","description":"the domain which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"type","description":"the type of bcc map can be `sender` or `recipient`","required":false,"members":[],"schema":{"type":"string"}},{"key":"bcc_dest","description":"the email address where all mails should be send to","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_dest\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"bcc_dest\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"add\",\n {\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": \"bcc_saved\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create BCC Map"]},{"title":"Delete BCC Map","path":"/api/v1/delete/bcc","pathTemplate":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc","method":"post","description":"\nUsing this endpoint you can delete a BCC map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of bcc maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"delete\",\n {\n \"id\": [\n \"4\"\n ]\n },\n null\n ],\n \"msg\": [\n \"bcc_deleted\",\n \"4\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete BCC Map"]},{"title":"Get Recipient Map","path":"/api/v1/get/recipient_map/{id}","pathTemplate":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id","method":"get","description":"\nUsing this endpoint you can get all recipient maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"created\": \"2019-10-02 22:06:29\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get Recipient Map"]},{"title":"Create Recipient Map","path":"/api/v1/add/recipient_map","pathTemplate":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map","method":"post","description":"\nUsing this endpoint you can create a recipient map to forward all mails from one email address to another.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"recipient_map_old","description":"the email address which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"recipient_map_new","description":"the email address that should receive the forwarded emails","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"recipient_map_old\": {\n \"type\": \"string\"\n },\n \"recipient_map_new\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"add\",\n {\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_saved\",\n \"recipient@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create Recipient Map"]},{"title":"Delete Recipient Map","path":"/api/v1/delete/recipient_map","pathTemplate":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map","method":"post","description":"\nUsing this endpoint you can delete a recipient map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of recipient maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete Recipient Map"]},{"title":"Get TLS Policy Map","path":"/api/v1/get/tls-policy-map/{id}","pathTemplate":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id","method":"get","description":"\nUsing this endpoint you can get all TLS policy map override maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active_int\": 1,\n \"active\": \"✓\",\n \"created\": \"2019-10-03 08:42:12\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Outgoing TLS Policy Map Overrides","Get TLS Policy Map"]},{"title":"Create TLS Policy Map","path":"/api/v1/add/tls-policy-map","pathTemplate":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map","method":"post","description":"\nUsing this endpoint you can create a TLS policy map override.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"dest","description":"the target domain or email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"policy","description":"the policy","required":false,"members":[],"schema":{"type":"enum"}},{"key":"parameters","description":"custom parameters you find out more about them [here](http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"dest\": {\n \"type\": \"string\"\n },\n \"policy\": {\n \"enum\": [\n \"none\",\n \"may\",\n \"encrypt\",\n \"dane\",\n \"'dane\",\n \"fingerprint\",\n \"verify\",\n \"secure\"\n ]\n },\n \"parameters\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object"],"description":"contains request object","required":false,"members":[],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"add\",\n {\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_saved\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Create TLS Policy Map"]},{"title":"Delete TLS Policy Map","path":"/api/v1/delete/tls-policy-map","pathTemplate":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map","method":"post","description":"\nUsing this endpoint you can delete a TLS Policy Map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of tls policy maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Delete TLS Policy Map"]},{"title":"Get oAuth Clients","path":"/api/v1/get/oauth2-client/{id}","pathTemplate":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id","method":"get","description":"\nUsing this endpoint you can get all oAuth clients.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"client_id\": \"17c76aaa88c0\",\n \"client_secret\": \"73fc668a88147e32a31ff80c\",\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\",\n \"grant_types\": null,\n \"scope\": \"profile\",\n \"user_id\": null\n }\n]\n","schema":""}}],"tags":["oAuth Clients","Get oAuth Clients"]},{"title":"Create oAuth Client","path":"/api/v1/add/oauth2-client","pathTemplate":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client","method":"post","description":"\nUsing this endpoint you can create a oAuth clients.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"redirect_uri","description":"the uri where you should be redirected after oAuth","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"redirect_uri\":\"https://mailcow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"redirect_uri\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"add\",\n \"client\",\n {\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\"\n }\n ],\n \"msg\": \"Added client access\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Create oAuth Client"]},{"title":"Delete oAuth Client","path":"/api/v1/delete/oauth2-client","pathTemplate":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client","method":"post","description":"\nUsing this endpoint you can delete a oAuth client, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of oAuth clients you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"delete\",\n \"client\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"items_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Delete oAuth Client"]},{"title":"Get Sender-Dependent Transports","path":"/api/v1/get/relayhost/{id}","pathTemplate":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id","method":"get","description":"\nUsing this endpoint you can get all Sender-Dependent Transports.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\",\n \"active_int\": 1,\n \"password_short\": \"tes...\",\n \"active\": \"✓\",\n \"used_by_domains\": \"\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Sender-Dependent Transports"]},{"title":"Create Sender-Dependent Transports","path":"/api/v1/add/relayhost","pathTemplate":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"the hostname of the smtp server with port","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"add\",\n {\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Sender-Dependent Transports"]},{"title":"Delete Sender-Dependent Transports","path":"/api/v1/delete/relayhost","pathTemplate":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost","method":"post","description":"\nUsing this endpoint you can delete a Sender-Dependent Transport, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of Sender-Dependent Transport you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Sender-Dependent Transports"]},{"title":"Get Transport Maps","path":"/api/v1/get/transport/{id}","pathTemplate":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id","method":"get","description":"\nUsing this endpoint you can get all Transport Maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active_int\": 1,\n \"lookup_mx_int\": 0,\n \"password_short\": \"sup...\",\n \"active\": \"✓\",\n \"lookup_mx\": \"✕\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Transport Maps"]},{"title":"Create Transport Maps","path":"/api/v1/add/transport/all","pathTemplate":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"destination","required":false,"members":[],"schema":{"type":"string"}},{"key":"nexthop","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\"\n },\n \"nexthop\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"add\",\n {\n \"destination\": \"example2.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Transport Maps"]},{"title":"Delete Transport Maps","path":"/api/v1/delete/transport","pathTemplate":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport","method":"post","description":"\nUsing this endpoint you can delete a Transport Maps, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of transport maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Transport Maps"]},{"title":"Get Resources","path":"/api/v1/get/resource/all","pathTemplate":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all","method":"get","description":"\nUsing this endpoint you can get all Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"name\": \"test@mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings\": 0,\n \"description\": \"test\",\n \"active\": \"✓\",\n \"active_int\": 1,\n \"domain\": \"mailcow.tld\",\n \"local_part\": \"test\"\n }\n]\n","schema":""}}],"tags":["Resources","Get Resources"]},{"title":"Create Resources","path":"/api/v1/add/resource","pathTemplate":"/api/v1/add/resource","slug":"post~api~v1~add~resource","method":"post","description":"\nUsing this endpoint you can create Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"description","description":"a description of the resource","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"the domain for which the resource should be","required":false,"members":[],"schema":{"type":"string"}},{"key":"kind","description":"the kind of recouse","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_select","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_custom","description":"always empty","required":false,"members":[],"schema":{"type":"number"}},{"key":"multiple_bookings","required":false,"members":[],"schema":{"type":"enum"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"kind\": {\n \"enum\": [\n \"location\",\n \"group\",\n \"thing\"\n ]\n },\n \"multiple_bookings_select\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"multiple_bookings_custom\": {\n \"type\": \"number\"\n },\n \"multiple_bookings\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"resource\",\n {\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"resource_added\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Create Resources"]},{"title":"Delete Resources","path":"/api/v1/delete/resource","pathTemplate":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource","method":"post","description":"\nUsing this endpoint you can delete a Resources, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["description@domain"],"description":"contains list of Resources you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"test@mailcow.tld\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"delete\",\n \"resource\",\n {\n \"name\": [\n \"test@mailcow.tld\"\n ]\n },\n null\n ],\n \"msg\": [\n \"resource_removed\",\n \"test@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Delete Resources"]},{"title":"Get App Password","path":"/api/v1/get/app-passwd/all/{mailbox}","pathTemplate":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox","method":"get","description":"\nUsing this endpoint you can get all app passwords from a specific mailbox.","parameters":[{"location":"path","name":"mailbox","description":"mailbox of entry you want to get","required":true,"example":"hello@mailcow.email","schema":{"type":"string","enum":["hello@mailcow.email"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 2,\n \"name\": \"emclient\",\n \"mailbox\": \"hello@mailcow.email\",\n \"domain\": \"mailcow.email\",\n \"created\": \"2019-12-21 16:04:55\",\n \"modified\": null,\n \"active_int\": 1,\n \"active\": \"✓\"\n }\n]\n","schema":""}}],"tags":["App Passwords","Get App Password"]},{"title":"Create App Password","path":"/api/v1/add/app-passwd","pathTemplate":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd","method":"post","description":"\nUsing this endpoint you can create a new app password for a specific mailbox.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username user@domain.tld","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_name","description":"name of the app password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd","description":"the password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd2","description":"the password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"hello@mailcow.email\"\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"app_name\": {\n \"type\": \"string\"\n },\n \"app_passwd\": {\n \"type\": \"string\"\n },\n \"app_passwd2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"add\",\n {\n \"username\": \"hello@mailcow.email\",\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n }\n ],\n \"msg\": \"app_passwd_added\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Create App Password"]},{"title":"Delete App Password","path":"/api/v1/delete/app-passwd","pathTemplate":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd","method":"post","description":"\nUsing this endpoint you can delete a single app password.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of app passwords you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"delete\",\n {\n \"id\": [\n \"2\"\n ]\n }\n ],\n \"msg\": [\n \"app_passwd_removed\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Delete App Password"]},{"title":"Get container status","path":"/api/v1/get/status/containers","pathTemplate":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ipv6nat-mailcow\": {\n \"type\": \"info\",\n \"container\": \"ipv6nat-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:06:37.273225445Z\",\n \"image\": \"robbertkl/ipv6nat\"\n },\n \"netfilter-mailcow\": {\n \"type\": \"info\",\n \"container\": \"netfilter-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:09.851559297Z\",\n \"image\": \"mailcow/netfilter:1.31\"\n },\n \"rspamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"rspamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.456075355Z\",\n \"image\": \"mailcow/rspamd:1.56\"\n },\n \"acme-mailcow\": {\n \"type\": \"info\",\n \"container\": \"acme-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.270660275Z\",\n \"image\": \"mailcow/acme:1.63\"\n },\n \"dovecot-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dovecot-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.988680259Z\",\n \"image\": \"mailcow/dovecot:1.104\"\n },\n \"postfix-mailcow\": {\n \"type\": \"info\",\n \"container\": \"postfix-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:07.186717617Z\",\n \"image\": \"mailcow/postfix:1.44\"\n },\n \"nginx-mailcow\": {\n \"type\": \"info\",\n \"container\": \"nginx-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.9843038Z\",\n \"image\": \"nginx:mainline-alpine\"\n },\n \"mysql-mailcow\": {\n \"type\": \"info\",\n \"container\": \"mysql-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:02.201937528Z\",\n \"image\": \"mariadb:10.3\"\n },\n \"php-fpm-mailcow\": {\n \"type\": \"info\",\n \"container\": \"php-fpm-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:00.955808957Z\",\n \"image\": \"mailcow/phpfpm:1.55\"\n },\n \"clamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"clamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:01.622856172Z\",\n \"image\": \"mailcow/clamd:1.35\"\n },\n \"memcached-mailcow\": {\n \"type\": \"info\",\n \"container\": \"memcached-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.0907785Z\",\n \"image\": \"memcached:alpine\"\n },\n \"solr-mailcow\": {\n \"type\": \"info\",\n \"container\": \"solr-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.635413798Z\",\n \"image\": \"mailcow/solr:1.7\"\n },\n \"olefy-mailcow\": {\n \"type\": \"info\",\n \"container\": \"olefy-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.676259274Z\",\n \"image\": \"mailcow/olefy:1.2\"\n },\n \"sogo-mailcow\": {\n \"type\": \"info\",\n \"container\": \"sogo-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.382274592Z\",\n \"image\": \"mailcow/sogo:1.65\"\n },\n \"unbound-mailcow\": {\n \"type\": \"info\",\n \"container\": \"unbound-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.760595825Z\",\n \"image\": \"mailcow/unbound:1.10\"\n },\n \"dockerapi-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dockerapi-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.984797808Z\",\n \"image\": \"mailcow/dockerapi:1.36\"\n },\n \"redis-mailcow\": {\n \"type\": \"info\",\n \"container\": \"redis-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.827166834Z\",\n \"image\": \"redis:5-alpine\"\n },\n \"watchdog-mailcow\": {\n \"type\": \"info\",\n \"container\": \"watchdog-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.028660382Z\",\n \"image\": \"mailcow/watchdog:1.65\"\n }\n}\n","schema":""}}],"tags":["status","Get container status"]},{"title":"Get vmail status","path":"/api/v1/get/status/vmail","pathTemplate":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail","method":"get","description":"\nUsing this endpoint you can get the status of the vmail and the amount of used storage.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"disk\": \"/dev/mapper/mail--vg-root\",\n \"used\": \"11G\",\n \"total\": \"41G\",\n \"used_percent\": \"28%\"\n}\n","schema":""}}],"tags":["status","Get vmail status"]},{"title":"Get solr status","path":"/api/v1/get/status/solr","pathTemplate":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"solr_enabled\": false,\n \"solr_size\": null,\n \"solr_documents\": null\n}\n","schema":""}}],"tags":["status","Get solr status"]},{"title":"Get Ratelimits","path":"/api/v1/get/rl-mbox/{mailbox}","pathTemplate":"/api/v1/get/rl-mbox/{mailbox}","slug":"get~api~v1~get~rl-mbox~mailbox","method":"get","description":"\nUsing this endpoint you can get the ratelimits for a certain mailbox. You can use all for all mailboxes.","parameters":[{"location":"path","name":"mailbox","description":"name of mailbox or all","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"value\": \"5\",\n \"frame\": \"s\",\n \"mailbox\": \"leon@mailcow.tld\"\n },\n {\n \"value\": \"3\",\n \"frame\": \"s\",\n \"mailbox\": \"lisa@mailcow.tld\"\n }\n]\n","schema":""}}],"tags":["Ratelimits","Get Ratelimits"]}],"tagActions":[{"title":"Domains","children":[{"title":"Get domains","actions":[{"title":"Get domains","method":"get","path":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id"}]},{"title":"Create domain","actions":[{"title":"Create domain","method":"post","path":"/api/v1/add/domain","slug":"post~api~v1~add~domain"}]},{"title":"Update domain","actions":[{"title":"Update domain","method":"post","path":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain"}]},{"title":"Delete domain","actions":[{"title":"Delete domain","method":"post","path":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain"}]}]},{"title":"Domain antispam policies","children":[{"title":"List whitelist domain policy","actions":[{"title":"List whitelist domain policy","method":"get","path":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain"}]},{"title":"List blacklist domain policy","actions":[{"title":"List blacklist domain policy","method":"get","path":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain"}]},{"title":"Create domain policy","actions":[{"title":"Create domain policy","method":"post","path":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy"}]},{"title":"Delete domain policy","actions":[{"title":"Delete domain policy","method":"post","path":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy"}]}]},{"title":"Mailboxes","children":[{"title":"Get mailboxes","actions":[{"title":"Get mailboxes","method":"get","path":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id"}]},{"title":"Create mailbox","actions":[{"title":"Create mailbox","method":"post","path":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox"}]},{"title":"Update mailbox","actions":[{"title":"Update mailbox","method":"post","path":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox"}]},{"title":"Update mailbox ACL","actions":[{"title":"Update mailbox ACL","method":"post","path":"/api/v1/edit/user-acl","slug":"post~api~v1~edit~user-acl"}]},{"title":"Update Pushover settings","actions":[{"title":"Update Pushover settings","method":"post","path":"/api/v1/edit/pushover","slug":"post~api~v1~edit~pushover"}]},{"title":"Delete mailbox","actions":[{"title":"Delete mailbox","method":"post","path":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox"}]},{"title":"Quarantine Notifications","actions":[{"title":"Quarantine Notifications","method":"post","path":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification"}]}]},{"title":"Aliases","children":[{"title":"Get aliases","actions":[{"title":"Get aliases","method":"get","path":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id"}]},{"title":"Create alias","actions":[{"title":"Create alias","method":"post","path":"/api/v1/add/alias","slug":"post~api~v1~add~alias"}]},{"title":"Update alias","actions":[{"title":"Update alias","method":"post","path":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias"}]},{"title":"Delete alias","actions":[{"title":"Delete alias","method":"post","path":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias"}]}]},{"title":"Sync jobs","children":[{"title":"Get sync jobs","actions":[{"title":"Get sync jobs","method":"get","path":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log"}]},{"title":"Create sync job","actions":[{"title":"Create sync job","method":"post","path":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob"}]},{"title":"Update sync job","actions":[{"title":"Update sync job","method":"post","path":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob"}]},{"title":"Delete sync job","actions":[{"title":"Delete sync job","method":"post","path":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob"}]}]},{"title":"Fordwarding Hosts","children":[{"title":"Get Forwarding Hosts","actions":[{"title":"Get Forwarding Hosts","method":"get","path":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all"}]},{"title":"Add Forward Host","actions":[{"title":"Add Forward Host","method":"post","path":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost"}]},{"title":"Delete Forward Host","actions":[{"title":"Delete Forward Host","method":"post","path":"/api/v1/delete/fwdhost","slug":"post~api~v1~delete~fwdhost"}]}]},{"title":"Logs","children":[{"title":"Get Postfix logs","actions":[{"title":"Get Postfix logs","method":"get","path":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count"}]},{"title":"Get Rspamd logs","actions":[{"title":"Get Rspamd logs","method":"get","path":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count"}]},{"title":"Get Dovecot logs","actions":[{"title":"Get Dovecot logs","method":"get","path":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count"}]},{"title":"Get ACME logs","actions":[{"title":"Get ACME logs","method":"get","path":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count"}]},{"title":"Get SOGo logs","actions":[{"title":"Get SOGo logs","method":"get","path":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count"}]},{"title":"Get Watchdog logs","actions":[{"title":"Get Watchdog logs","method":"get","path":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count"}]},{"title":"Get Api logs","actions":[{"title":"Get Api logs","method":"get","path":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count"}]},{"title":"Get Ratelimit logs","actions":[{"title":"Get Ratelimit logs","method":"get","path":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count"}]},{"title":"Get Netfilter logs","actions":[{"title":"Get Netfilter logs","method":"get","path":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count"}]},{"title":"Get Autodiscover logs","actions":[{"title":"Get Autodiscover logs","method":"get","path":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count"}]}]},{"title":"Queue Manager","children":[{"title":"Get Queue","actions":[{"title":"Get Queue","method":"get","path":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all"}]},{"title":"Flush Queue","actions":[{"title":"Flush Queue","method":"post","path":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq"}]},{"title":"Delete Queue","actions":[{"title":"Delete Queue","method":"post","path":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq"}]}]},{"title":"Quarantine","children":[{"title":"Get mails in Quarantine","actions":[{"title":"Get mails in Quarantine","method":"get","path":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all"}]},{"title":"Delete mails in Quarantine","actions":[{"title":"Delete mails in Quarantine","method":"post","path":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem"}]}]},{"title":"Fail2Ban","children":[{"title":"Get Fail2Ban Config","actions":[{"title":"Get Fail2Ban Config","method":"get","path":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban"}]},{"title":"Edit Fail2Ban","actions":[{"title":"Edit Fail2Ban","method":"post","path":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban"}]}]},{"title":"DKIM","children":[{"title":"Get DKIM Key","actions":[{"title":"Get DKIM Key","method":"get","path":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain"}]},{"title":"Generate DKIM Key","actions":[{"title":"Generate DKIM Key","method":"post","path":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim"}]},{"title":"Duplicate DKIM Key","actions":[{"title":"Duplicate DKIM Key","method":"post","path":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate"}]},{"title":"Delete DKIM Key","actions":[{"title":"Delete DKIM Key","method":"post","path":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim"}]}]},{"title":"Domain admin","children":[{"title":"Get Domain Admins","actions":[{"title":"Get Domain Admins","method":"get","path":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all"}]},{"title":"Create Domain Admin user","actions":[{"title":"Create Domain Admin user","method":"post","path":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin"}]},{"title":"Delete Domain Admin","actions":[{"title":"Delete Domain Admin","method":"post","path":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin"}]}]},{"title":"Address Rewriting","children":[{"title":"Get BCC Map","actions":[{"title":"Get BCC Map","method":"get","path":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id"}]},{"title":"Create BCC Map","actions":[{"title":"Create BCC Map","method":"post","path":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc"}]},{"title":"Delete BCC Map","actions":[{"title":"Delete BCC Map","method":"post","path":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc"}]},{"title":"Get Recipient Map","actions":[{"title":"Get Recipient Map","method":"get","path":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id"}]},{"title":"Create Recipient Map","actions":[{"title":"Create Recipient Map","method":"post","path":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map"}]},{"title":"Delete Recipient Map","actions":[{"title":"Delete Recipient Map","method":"post","path":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map"}]}]},{"title":"Outgoing TLS Policy Map Overrides","children":[{"title":"Get TLS Policy Map","actions":[{"title":"Get TLS Policy Map","method":"get","path":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id"}]},{"title":"Create TLS Policy Map","actions":[{"title":"Create TLS Policy Map","method":"post","path":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map"}]},{"title":"Delete TLS Policy Map","actions":[{"title":"Delete TLS Policy Map","method":"post","path":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map"}]}]},{"title":"oAuth Clients","children":[{"title":"Get oAuth Clients","actions":[{"title":"Get oAuth Clients","method":"get","path":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id"}]},{"title":"Create oAuth Client","actions":[{"title":"Create oAuth Client","method":"post","path":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client"}]},{"title":"Delete oAuth Client","actions":[{"title":"Delete oAuth Client","method":"post","path":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client"}]}]},{"title":"Routing","children":[{"title":"Get Sender-Dependent Transports","actions":[{"title":"Get Sender-Dependent Transports","method":"get","path":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id"}]},{"title":"Create Sender-Dependent Transports","actions":[{"title":"Create Sender-Dependent Transports","method":"post","path":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost"}]},{"title":"Delete Sender-Dependent Transports","actions":[{"title":"Delete Sender-Dependent Transports","method":"post","path":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost"}]},{"title":"Get Transport Maps","actions":[{"title":"Get Transport Maps","method":"get","path":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id"}]},{"title":"Create Transport Maps","actions":[{"title":"Create Transport Maps","method":"post","path":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all"}]},{"title":"Delete Transport Maps","actions":[{"title":"Delete Transport Maps","method":"post","path":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport"}]}]},{"title":"Resources","children":[{"title":"Get Resources","actions":[{"title":"Get Resources","method":"get","path":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all"}]},{"title":"Create Resources","actions":[{"title":"Create Resources","method":"post","path":"/api/v1/add/resource","slug":"post~api~v1~add~resource"}]},{"title":"Delete Resources","actions":[{"title":"Delete Resources","method":"post","path":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource"}]}]},{"title":"App Passwords","children":[{"title":"Get App Password","actions":[{"title":"Get App Password","method":"get","path":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox"}]},{"title":"Create App Password","actions":[{"title":"Create App Password","method":"post","path":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd"}]},{"title":"Delete App Password","actions":[{"title":"Delete App Password","method":"post","path":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd"}]}]},{"title":"status","children":[{"title":"Get container status","actions":[{"title":"Get container status","method":"get","path":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers"}]},{"title":"Get vmail status","actions":[{"title":"Get vmail status","method":"get","path":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail"}]},{"title":"Get solr status","actions":[{"title":"Get solr status","method":"get","path":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr"}]}]},{"title":"Ratelimits","children":[{"title":"Get Ratelimits","actions":[{"title":"Get Ratelimits","method":"get","path":"/api/v1/get/rl-mbox/{mailbox}","slug":"get~api~v1~get~rl-mbox~mailbox"}]}]}],"config":{"playground":{"enabled":true,"env":"easy","environments":{"easy":{"playground":false,"url":"/"},"advanced":{"url":"/"}}},"optimized":false,"stylesheets":[],"sidebar":{"groupOrder":"auto"},"basePath":"/"}} }); return app;