=0))break;0===o?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ce(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(Q(a)){do{a=e.input.charCodeAt(++e.position)}while(Q(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!J(a)&&0!==a)}for(;0!==a;){for(he(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent
0){for(r=a,o=0;r>0;r--)(a=ee(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:ce(e,"expected hexadecimal character");e.result+=ne(o),e.position++}else ce(e,"unknown escape sequence");n=i=e.position}else J(l)?(pe(e,n,i,!0),ye(e,ge(e,!1,t)),n=i=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?y=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!z(i)&&!X(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),P.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,c,s,u,p=e.kind,f=e.result;if(z(u=e.input.charCodeAt(e.position))||X(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(z(i=e.input.charCodeAt(e.position+1))||n&&X(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(z(i=e.input.charCodeAt(e.position+1))||n&&X(i))break}else if(35===u){if(z(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&me(e)||n&&X(u))break;if(J(u)){if(l=e.line,c=e.lineStart,s=e.lineIndent,ge(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=c,e.lineIndent=s;break}}a&&(pe(e,r,o,!1),ye(e,e.line-l),r=o=e.position,a=!1),Q(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return pe(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,d,1===i)&&(y=!0,null===e.tag&&(e.tag="?")):(y=!0,null===e.tag&&null===e.anchor||ce(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===g&&(y=c&&be(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ce(e,'unacceptable node kind for !> tag; it should be "scalar", not "'+e.kind+'"'),s=0,u=e.implicitTypes.length;s"),null!==e.result&&f.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||y}function ke(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(r=e.input.charCodeAt(e.position))&&(ge(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&ce(e,"directive name must not be less than one character in length");0!==r;){for(;Q(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!J(r));break}if(J(r))break;for(t=e.position;0!==r&&!z(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&he(e),P.call(ue,n)?ue[n](e,n,i):se(e,'unknown document directive "'+n+'"')}ge(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,ge(e,!0,-1)):a&&ce(e,"directives end mark is expected"),we(e,e.lineIndent-1,4,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&H.test(e.input.slice(o,e.position))&&se(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&me(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,ge(e,!0,-1)):e.position=55296&&i<=56319&&t+1=56320&&n<=57343?1024*(i-55296)+n-56320+65536:i}function Re(e){return/^\n* /.test(e)}function Be(e,t,n,i,r,o,a,l){var c,s,u=0,p=null,f=!1,d=!1,h=-1!==i,g=-1,m=De(s=Ye(e,0))&&s!==Oe&&!_e(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&function(e){return!_e(e)&&58!==e}(Ye(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!De(u=Ye(e,c)))return 5;m=m&&qe(u,p,l),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ye(e,c)))f=!0,h&&(d=d||c-g-1>i&&" "!==e[g+1],g=c);else if(!De(u))return 5;m=m&&qe(u,p,l),p=u}d=d||h&&c-g-1>i&&" "!==e[g+1]}return f||d?n>9&&Re(e)?5:a?2===o?5:2:d?4:3:!m||a||r(e)?2===o?5:2:1}function Ke(e,t,n,i,r){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Te.indexOf(t)||Ne.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),l=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=i||e.flowLevel>-1&&n>=e.flowLevel;switch(Be(t,c,e.indent,l,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+Pe(t,e.indent)+We(Me(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,r.lastIndex=l,He(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;i=r.exec(e);){var c=i[1],s=i[2];n=" "===s[0],o+=c+(a||n||""===s?"":"\n")+He(s,t),a=n}return o}(t,l),a));case 5:return'"'+function(e){for(var t,n="",i=0,r=0;r=65536?r+=2:r++)i=Ye(e,r),!(t=je[i])&&De(i)?(n+=e[r],i>=65536&&(n+=e[r+1])):n+=t||Fe(i);return n}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function Pe(e,t){var n=Re(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function We(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function He(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,l=0,c="";n=r.exec(e);)(l=n.index)-o>t&&(i=a>o?a:l,c+="\n"+e.slice(o,i),o=i+1),a=l;return c+="\n",e.length-o>t&&a>o?c+=e.slice(o,a)+"\n"+e.slice(a+1):c+=e.slice(o),c.slice(1)}function $e(e,t,n,i){var r,o,a,l="",c=e.tag;for(r=0,o=n.length;r tag resolver accepts not "'+s+'" style');i=c.represent[s](t,s)}e.dump=i}return!0}return!1}function Ve(e,t,n,i,r,a,l){e.tag=null,e.dump=n,Ge(e,n,!1)||Ge(e,n,!0);var c,s=Ie.call(e.dump),u=i;i&&(i=e.flowLevel<0||e.flowLevel>t);var p,f,d="[object Object]"===s||"[object Array]"===s;if(d&&(f=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(r=!1),f&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&f&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===s)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,a,l,c,s,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(r=0,a=d.length;r1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,s&&(u+=Le(e,t)),Ve(e,t+1,c,!0,s)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a,l,c="",s=e.tag,u=Object.keys(n);for(i=0,r=u.length;i1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ve(e,t,a,!1,!1)&&(c+=l+=e.dump));e.tag=s,e.dump="{"+c+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===s)i&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?$e(e,t-1,e.dump,r):$e(e,t,e.dump,r),f&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var i,r,o,a="",l=e.tag;for(i=0,r=n.length;i",e.dump=c+" "+e.dump)}return!0}function Ze(e,t){var n,i,r=[],o=[];for(Je(e,r,o),n=0,i=o.length;n maxHalfLength) {
+ head = ' ... ';
+ lineStart = position - maxHalfLength + head.length;
+ }
+
+ if (lineEnd - position > maxHalfLength) {
+ tail = ' ...';
+ lineEnd = position + maxHalfLength - tail.length;
+ }
+
+ return {
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail,
+ pos: position - lineStart + head.length // relative position
+ };
+}
+
+
+function padStart(string, max) {
+ return common.repeat(' ', max - string.length) + string;
+}
+
+
+function makeSnippet(mark, options) {
+ options = Object.create(options || null);
+
+ if (!mark.buffer) return null;
+
+ if (!options.maxLength) options.maxLength = 79;
+ if (typeof options.indent !== 'number') options.indent = 1;
+ if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
+ if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
+
+ var re = /\r?\n|\r|\0/g;
+ var lineStarts = [ 0 ];
+ var lineEnds = [];
+ var match;
+ var foundLineNo = -1;
+
+ while ((match = re.exec(mark.buffer))) {
+ lineEnds.push(match.index);
+ lineStarts.push(match.index + match[0].length);
+
+ if (mark.position <= match.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
+ }
+ }
+
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
+
+ var result = '', i, line;
+ var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
+ var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
+
+ for (i = 1; i <= options.linesBefore; i++) {
+ if (foundLineNo - i < 0) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo - i],
+ lineEnds[foundLineNo - i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
+ maxLineLength
+ );
+ result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n' + result;
+ }
+
+ line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
+ result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
+
+ for (i = 1; i <= options.linesAfter; i++) {
+ if (foundLineNo + i >= lineEnds.length) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo + i],
+ lineEnds[foundLineNo + i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
+ maxLineLength
+ );
+ result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ }
+
+ return result.replace(/\n$/, '');
+}
+
+
+var snippet = makeSnippet;
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'multi',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'representName',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (map !== null) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type$1(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.options = options; // keep original options in case user wants to extend this type later
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.representName = options['representName'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.multi = options['multi'] || false;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+var type = Type$1;
+
+/*eslint-disable max-len*/
+
+
+
+
+
+function compileList(schema, name) {
+ var result = [];
+
+ schema[name].forEach(function (currentType) {
+ var newIndex = result.length;
+
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag &&
+ previousType.kind === currentType.kind &&
+ previousType.multi === currentType.multi) {
+
+ newIndex = previousIndex;
+ }
+ });
+
+ result[newIndex] = currentType;
+ });
+
+ return result;
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length;
+
+ function collectType(type) {
+ if (type.multi) {
+ result.multi[type.kind].push(type);
+ result.multi['fallback'].push(type);
+ } else {
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
+ }
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+}
+
+
+function Schema$1(definition) {
+ return this.extend(definition);
+}
+
+
+Schema$1.prototype.extend = function extend(definition) {
+ var implicit = [];
+ var explicit = [];
+
+ if (definition instanceof type) {
+ // Schema.extend(type)
+ explicit.push(definition);
+
+ } else if (Array.isArray(definition)) {
+ // Schema.extend([ type1, type2, ... ])
+ explicit = explicit.concat(definition);
+
+ } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
+ // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
+
+ } else {
+ throw new exception('Schema.extend argument should be a Type, [ Type ], ' +
+ 'or a schema definition ({ implicit: [...], explicit: [...] })');
+ }
+
+ implicit.forEach(function (type$1) {
+ if (!(type$1 instanceof type)) {
+ throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ if (type$1.loadKind && type$1.loadKind !== 'scalar') {
+ throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+
+ if (type$1.multi) {
+ throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
+ }
+ });
+
+ explicit.forEach(function (type$1) {
+ if (!(type$1 instanceof type)) {
+ throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+ });
+
+ var result = Object.create(Schema$1.prototype);
+
+ result.implicit = (this.implicit || []).concat(implicit);
+ result.explicit = (this.explicit || []).concat(explicit);
+
+ result.compiledImplicit = compileList(result, 'implicit');
+ result.compiledExplicit = compileList(result, 'explicit');
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
+
+ return result;
+};
+
+
+var schema = Schema$1;
+
+var str = new type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return data !== null ? data : ''; }
+});
+
+var seq = new type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return data !== null ? data : []; }
+});
+
+var map = new type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return data !== null ? data : {}; }
+});
+
+var failsafe = new schema({
+ explicit: [
+ str,
+ seq,
+ map
+ ]
+});
+
+function resolveYamlNull(data) {
+ if (data === null) return true;
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return object === null;
+}
+
+var _null = new type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; },
+ empty: function () { return ''; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+function resolveYamlBoolean(data) {
+ if (data === null) return false;
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
+}
+
+var bool = new type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (data === null) return false;
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) return false;
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'o') {
+ // base 8
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+ }
+
+ // base 10 (except 0)
+
+ // value should not start with `_`;
+ if (ch === '_') return false;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
+
+ return true;
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch;
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if (value === '0') return 0;
+
+ if (ch === '0') {
+ if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
+ if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
+ if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+}
+
+var int = new type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
+ octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
+ decimal: function (obj) { return obj.toString(10); },
+ /* eslint-disable max-len */
+ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
+ // .2e4, .2
+ // special case, seems not from spec
+ '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
+ // .inf
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ // .nan
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (data === null) return false;
+
+ if (!YAML_FLOAT_PATTERN.test(data) ||
+ // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data[data.length - 1] === '_') {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
+
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
+
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if (value === '.nan') {
+ return NaN;
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase': return '.nan';
+ case 'uppercase': return '.NAN';
+ case 'camelcase': return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '.inf';
+ case 'uppercase': return '.INF';
+ case 'camelcase': return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '-.inf';
+ case 'uppercase': return '-.INF';
+ case 'camelcase': return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
+}
+
+var float = new type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+var json = failsafe.extend({
+ implicit: [
+ _null,
+ bool,
+ int,
+ float
+ ]
+});
+
+var core = json;
+
+var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (match === null) throw new Error('Date resolve error');
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if (match[9] === '-') delta = -delta;
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) date.setTime(date.getTime() - delta);
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+var timestamp = new type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
+}
+
+var merge = new type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+/*eslint-disable no-bitwise*/
+
+
+
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (data === null) return false;
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) continue;
+
+ // Fail on illegal characters
+ if (code < 0) return false;
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ return new Uint8Array(result);
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === '[object Uint8Array]';
+}
+
+var binary = new type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+var _toString$2 = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (data === null) return true;
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if (_toString$2.call(pair) !== '[object Object]') return false;
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty$3.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
+ }
+
+ if (!pairHasKey) return false;
+
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return data !== null ? data : [];
+}
+
+var omap = new type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+var _toString$1 = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (data === null) return true;
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if (_toString$1.call(pair) !== '[object Object]') return false;
+
+ keys = Object.keys(pair);
+
+ if (keys.length !== 1) return false;
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (data === null) return [];
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+var pairs = new type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (data === null) return true;
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty$2.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return data !== null ? data : {};
+}
+
+var set = new type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+var _default = core.extend({
+ implicit: [
+ timestamp,
+ merge
+ ],
+ explicit: [
+ binary,
+ omap,
+ pairs,
+ set
+ ]
+});
+
+/*eslint-disable max-len,no-use-before-define*/
+
+
+
+
+
+
+
+var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function _class(obj) { return Object.prototype.toString.call(obj); }
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ /* eslint-disable indent */
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(
+ ((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00
+ );
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State$1(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || _default;
+ this.onWarning = options['onWarning'] || null;
+ // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
+ // if such documents have no explicit %YAML directive
+ this.legacy = options['legacy'] || false;
+
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ // position of first leading tab in the current line,
+ // used to make sure there are no tabs in the indentation
+ this.firstTabInLine = -1;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ var mark = {
+ name: state.filename,
+ buffer: state.input.slice(0, -1), // omit trailing \0
+ position: state.position,
+ line: state.line,
+ column: state.position - state.lineStart
+ };
+
+ mark.snippet = snippet(mark);
+
+ return new exception(message, mark);
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty$1.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state, 'tag prefix is malformed: ' + prefix);
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 0x09 ||
+ (0x20 <= _character && _character <= 0x10FFFF))) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty$1.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+}
+
+function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
+ startLine, startLineStart, startPos) {
+
+ var index, quantity;
+
+ // The output is a plain object here, so keys can only be strings.
+ // We need to convert keyNode to a string, but doing so can hang the process
+ // (deeply nested arrays that explode exponentially using aliases).
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state, 'nested arrays are not supported inside keys');
+ }
+
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
+
+ // Avoid code execution in load() via toString property
+ // (still use its own toString for arrays, timestamps,
+ // and whatever user schema extensions happen to have @@toStringTag)
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
+ keyNode = '[object Object]';
+ }
+
+
+ keyNode = String(keyNode);
+
+ if (_result === null) {
+ _result = {};
+ }
+
+ if (keyTag === 'tag:yaml.org,2002:merge') {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state.json &&
+ !_hasOwnProperty$1.call(overridableKeys, keyNode) &&
+ _hasOwnProperty$1.call(_result, keyNode)) {
+ state.line = startLine || state.line;
+ state.lineStart = startLineStart || state.lineStart;
+ state.position = startPos || state.position;
+ throwError(state, 'duplicated mapping key');
+ }
+
+ // used for this specific key only because Object.defineProperty is slow
+ if (keyNode === '__proto__') {
+ Object.defineProperty(_result, keyNode, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: valueNode
+ });
+ } else {
+ _result[keyNode] = valueNode;
+ }
+ delete overridableKeys[keyNode];
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x0A/* LF */) {
+ state.position++;
+ } else if (ch === 0x0D/* CR */) {
+ state.position++;
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+ state.firstTabInLine = -1;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
+ state.firstTabInLine = state.position;
+ }
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
+ ch === state.input.charCodeAt(_position + 1) &&
+ ch === state.input.charCodeAt(_position + 2)) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ ch === 0x23/* # */ ||
+ ch === 0x26/* & */ ||
+ ch === 0x2A/* * */ ||
+ ch === 0x21/* ! */ ||
+ ch === 0x7C/* | */ ||
+ ch === 0x3E/* > */ ||
+ ch === 0x27/* ' */ ||
+ ch === 0x22/* " */ ||
+ ch === 0x25/* % */ ||
+ ch === 0x40/* @ */ ||
+ ch === 0x60/* ` */) {
+ return false;
+ }
+
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (ch !== 0) {
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (ch === 0x23/* # */) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x22/* " */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _lineStart,
+ _pos,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = Object.create(null),
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ } else if (ch === 0x2C/* , */) {
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
+ throwError(state, "expected the node content, but found ','");
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (ch === 0x3F/* ? */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line; // Save the current line.
+ _lineStart = state.lineStart;
+ _pos = state.position;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (ch !== 0));
+ }
+ }
+
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ // except for the first content line (cf. Example 8.1)
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (emptyLines === 0) {
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else {
+ // Keep all line breaks except the header line break.
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ }
+
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (ch !== 0)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _keyLine,
+ _keyLineStart,
+ _keyPos,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ overridableKeys = Object.create(null),
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
+
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ // Neither implicit nor explicit notation.
+ // Reading is done. Go to the epilogue.
+ break;
+ }
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x3A/* : */) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+ }
+
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x21/* ! */) return false;
+
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x3C/* < */) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (ch === 0x21/* ! */) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state, 'tag name is malformed: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
+
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x26/* & */) return false;
+
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x2A/* * */) return false;
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (indentStatus === 1) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (indentStatus === 1) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (indentStatus === 0) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (state.tag === null) {
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+
+ } else if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (state.tag !== '!') {
+ if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+ } else {
+ // looking for multi type
+ type = null;
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
+
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type = typeList[typeIndex];
+ break;
+ }
+ }
+ }
+
+ if (!type) {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result, state.tag);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ }
+
+ if (state.listener !== null) {
+ state.listener('close', state);
+ }
+ return state.tag !== null || state.anchor !== null || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = Object.create(null);
+ state.anchorMap = Object.create(null);
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) break;
+
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (ch !== 0) readLineBreak(state);
+
+ if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (state.lineIndent === 0 &&
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State$1(input, options);
+
+ var nullpos = input.indexOf('\0');
+
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll$1(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ var documents = loadDocuments(input, options);
+
+ if (typeof iterator !== 'function') {
+ return documents;
+ }
+
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load$1(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (documents.length === 0) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new exception('expected a single document in the stream, but found more');
+}
+
+
+var loadAll_1 = loadAll$1;
+var load_1 = load$1;
+
+var loader = {
+ loadAll: loadAll_1,
+ load: load_1
+};
+
+/*eslint-disable no-use-before-define*/
+
+
+
+
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_BOM = 0xFEFF;
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_EQUALS = 0x3D; /* = */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new exception('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+
+var QUOTING_TYPE_SINGLE = 1,
+ QUOTING_TYPE_DOUBLE = 2;
+
+function State(options) {
+ this.schema = options['schema'] || _default;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.noArrayIndent = options['noArrayIndent'] || false;
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+ this.noRefs = options['noRefs'] || false;
+ this.noCompatMode = options['noCompatMode'] || false;
+ this.condenseFlow = options['condenseFlow'] || false;
+ this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
+ this.forceQuotes = options['forceQuotes'] || false;
+ this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+// Indents every line in a string. Empty lines (\n only) are not indented.
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+
+ if (line.length && line !== '\n') result += ind;
+
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// [33] s-white ::= s-space | s-tab
+function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+}
+
+// Returns true if the character can be printed without escaping.
+// From YAML 1.2: "any allowed characters known to be non-printable
+// should also be escaped. [However,] This isn’t mandatory"
+// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
+ || (0x10000 <= c && c <= 0x10FFFF);
+}
+
+// [34] ns-char ::= nb-char - s-white
+// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+// [26] b-char ::= b-line-feed | b-carriage-return
+// Including s-white (for some reason, examples doesn't match specs in this aspect)
+// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
+function isNsCharOrWhitespace(c) {
+ return isPrintable(c)
+ && c !== CHAR_BOM
+ // - b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+}
+
+// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
+// c = flow-in ⇒ ns-plain-safe-in
+// c = block-key ⇒ ns-plain-safe-out
+// c = flow-key ⇒ ns-plain-safe-in
+// [128] ns-plain-safe-out ::= ns-char
+// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
+// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
+// | ( /* An ns-char preceding */ “#” )
+// | ( “:” /* Followed by an ns-plain-safe(c) */ )
+function isPlainSafe(c, prev, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
+ return (
+ // ns-plain-safe
+ inblock ? // c = flow-in
+ cIsNsCharOrWhitespace
+ : cIsNsCharOrWhitespace
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ )
+ // ns-plain-char
+ && c !== CHAR_SHARP // false on '#'
+ && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
+ || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
+ || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
+}
+
+// Simplified test for values allowed as the first character in plain style.
+function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
+ return isPrintable(c) && c !== CHAR_BOM
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | “%” | “@” | “`”)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+}
+
+// Simplified test for values allowed as the last character in plain style.
+function isPlainSafeLast(c) {
+ // just not whitespace or colon, it will be checked to be plain character later
+ return !isWhitespace(c) && c !== CHAR_COLON;
+}
+
+// Same as 'string'.codePointAt(pos), but works in older browsers.
+function codePointAt(string, pos) {
+ var first = string.charCodeAt(pos), second;
+ if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
+ second = string.charCodeAt(pos + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+}
+
+// Determines whether block indentation indicator is required.
+function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+}
+
+var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+// Determines which scalar styles are possible and returns the preferred style.
+// lineWidth = -1 => no limit.
+// Pre-conditions: str.length > 0.
+// Post-conditions:
+// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
+ testAmbiguousType, quotingType, forceQuotes, inblock) {
+
+ var i;
+ var char = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(codePointAt(string, 0))
+ && isPlainSafeLast(codePointAt(string, string.length - 1));
+
+ if (singleLineOnly || forceQuotes) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ if (plain && !forceQuotes && !testAmbiguousType(string)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+}
+
+// Note: line breaking/folding is implemented for only the folded style.
+// NB. We drop the last trailing newline (if any) of a returned block scalar
+// since the dumper adds its own newline. This always works:
+// • No ending newline => unaffected; already using strip "-" chomping.
+// • Ending newline => removed then restored.
+// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+function writeScalar(state, string, level, iskey, inblock) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
+ }
+ }
+
+ var indent = state.indent * Math.max(1, level); // no 0-indent scalars
+ // As indentation gets deeper, let the width decrease monotonically
+ // to the lower bound min(state.lineWidth, 40).
+ // Note that this implies
+ // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
+ // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
+ // This behaves better than a constant minimum width which disallows narrower options,
+ // or an indent threshold which causes the width to suddenly increase.
+ var lineWidth = state.lineWidth === -1
+ ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
+
+ // Without knowing if keys are implicit/explicit, assume implicit for safety.
+ var singleLineOnly = iskey
+ // No block styles in flow mode.
+ || (state.flowLevel > -1 && level >= state.flowLevel);
+ function testAmbiguity(string) {
+ return testImplicitResolving(state, string);
+ }
+
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
+ testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
+
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string) + '"';
+ default:
+ throw new exception('impossible error: invalid scalar style');
+ }
+ }());
+}
+
+// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+}
+
+// (See the note for writeScalar.)
+function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+}
+
+// Note: a long line without a suitable break point will exceed the width limit.
+// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+}
+
+// Greedy line breaking.
+// Picks the longest line under the limit each time,
+// otherwise settles for the shortest line over the limit.
+// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
+
+ // By the invariants, start <= length-1, so there is something left over.
+ // It is either the whole string or a part starting from non-whitespace.
+ result += '\n';
+ // Insert a break if the remainder is too long and there is a break available.
+ if (line.length - start > width && curr > start) {
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
+ } else {
+ result += line.slice(start);
+ }
+
+ return result.slice(1); // drop extra \n joiner
+}
+
+// Escapes a double-quoted string.
+function escapeString(string) {
+ var result = '';
+ var char = 0;
+ var escapeSeq;
+
+ for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ escapeSeq = ESCAPE_SEQUENCES[char];
+
+ if (!escapeSeq && isPrintable(char)) {
+ result += string[i];
+ if (char >= 0x10000) result += string[i + 1];
+ } else {
+ result += escapeSeq || encodeHex(char);
+ }
+ }
+
+ return result;
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level, value, false, false) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level, null, false, false))) {
+
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level + 1, value, true, true, false, true) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level + 1, null, true, true, false, true))) {
+
+ if (!compact || _result !== '') {
+ _result += generateNextLine(state, level);
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
+
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+
+ pairBuffer = '';
+ if (_result !== '') pairBuffer += ', ';
+
+ if (state.condenseFlow) pairBuffer += '"';
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) pairBuffer += '? ';
+
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new exception('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || _result !== '') {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ if (explicit) {
+ if (type.multi && type.representName) {
+ state.tag = type.representName(object);
+ } else {
+ state.tag = type.tag;
+ }
+ } else {
+ state.tag = '?';
+ }
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if (_toString.call(type.represent) === '[object Function]') {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey, isblockseq) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+ var inblock = block;
+ var tagStr;
+
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
+
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type === '[object Object]') {
+ if (block && (Object.keys(state.dump).length !== 0)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object Array]') {
+ if (block && (state.dump.length !== 0)) {
+ if (state.noArrayIndent && !isblockseq && level > 0) {
+ writeBlockSequence(state, level - 1, state.dump, compact);
+ } else {
+ writeBlockSequence(state, level, state.dump, compact);
+ }
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object String]') {
+ if (state.tag !== '?') {
+ writeScalar(state, state.dump, level, iskey, inblock);
+ }
+ } else if (type === '[object Undefined]') {
+ return false;
+ } else {
+ if (state.skipInvalid) return false;
+ throw new exception('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (state.tag !== null && state.tag !== '?') {
+ // Need to encode all characters except those allowed by the spec:
+ //
+ // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
+ // [36] ns-hex-digit ::= ns-dec-digit
+ // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
+ // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
+ // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”
+ // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”
+ // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”
+ // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”
+ //
+ // Also need to encode '!' because it has special meaning (end of tag prefix).
+ //
+ tagStr = encodeURI(
+ state.tag[0] === '!' ? state.tag.slice(1) : state.tag
+ ).replace(/!/g, '%21');
+
+ if (state.tag[0] === '!') {
+ tagStr = '!' + tagStr;
+ } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
+ tagStr = '!!' + tagStr.slice(18);
+ } else {
+ tagStr = '!<' + tagStr + '>';
+ }
+
+ state.dump = tagStr + ' ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (object !== null && typeof object === 'object') {
+ index = objects.indexOf(object);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump$1(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ if (!state.noRefs) getDuplicateReferences(input, state);
+
+ var value = input;
+
+ if (state.replacer) {
+ value = state.replacer.call({ '': value }, '', value);
+ }
+
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
+
+ return '';
+}
+
+var dump_1 = dump$1;
+
+var dumper = {
+ dump: dump_1
+};
+
+function renamed(from, to) {
+ return function () {
+ throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
+ 'Use yaml.' + to + ' instead, which is now safe by default.');
+ };
+}
+
+
+var Type = type;
+var Schema = schema;
+var FAILSAFE_SCHEMA = failsafe;
+var JSON_SCHEMA = json;
+var CORE_SCHEMA = core;
+var DEFAULT_SCHEMA = _default;
+var load = loader.load;
+var loadAll = loader.loadAll;
+var dump = dumper.dump;
+var YAMLException = exception;
+
+// Re-export all types in case user wants to create custom schema
+var types = {
+ binary: binary,
+ float: float,
+ map: map,
+ null: _null,
+ pairs: pairs,
+ set: set,
+ timestamp: timestamp,
+ bool: bool,
+ int: int,
+ merge: merge,
+ omap: omap,
+ seq: seq,
+ str: str
+};
+
+// Removed functions from JS-YAML 3.0.x
+var safeLoad = renamed('safeLoad', 'load');
+var safeLoadAll = renamed('safeLoadAll', 'loadAll');
+var safeDump = renamed('safeDump', 'dump');
+
+var jsYaml = {
+ Type: Type,
+ Schema: Schema,
+ FAILSAFE_SCHEMA: FAILSAFE_SCHEMA,
+ JSON_SCHEMA: JSON_SCHEMA,
+ CORE_SCHEMA: CORE_SCHEMA,
+ DEFAULT_SCHEMA: DEFAULT_SCHEMA,
+ load: load,
+ loadAll: loadAll,
+ dump: dump,
+ YAMLException: YAMLException,
+ types: types,
+ safeLoad: safeLoad,
+ safeLoadAll: safeLoadAll,
+ safeDump: safeDump
+};
+
+export default jsYaml;
+export { CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types };
diff --git a/node_modules/js-yaml/index.js b/node_modules/js-yaml/index.js
new file mode 100644
index 0000000..bcb7eba
--- /dev/null
+++ b/node_modules/js-yaml/index.js
@@ -0,0 +1,47 @@
+'use strict';
+
+
+var loader = require('./lib/loader');
+var dumper = require('./lib/dumper');
+
+
+function renamed(from, to) {
+ return function () {
+ throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
+ 'Use yaml.' + to + ' instead, which is now safe by default.');
+ };
+}
+
+
+module.exports.Type = require('./lib/type');
+module.exports.Schema = require('./lib/schema');
+module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./lib/schema/json');
+module.exports.CORE_SCHEMA = require('./lib/schema/core');
+module.exports.DEFAULT_SCHEMA = require('./lib/schema/default');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.dump = dumper.dump;
+module.exports.YAMLException = require('./lib/exception');
+
+// Re-export all types in case user wants to create custom schema
+module.exports.types = {
+ binary: require('./lib/type/binary'),
+ float: require('./lib/type/float'),
+ map: require('./lib/type/map'),
+ null: require('./lib/type/null'),
+ pairs: require('./lib/type/pairs'),
+ set: require('./lib/type/set'),
+ timestamp: require('./lib/type/timestamp'),
+ bool: require('./lib/type/bool'),
+ int: require('./lib/type/int'),
+ merge: require('./lib/type/merge'),
+ omap: require('./lib/type/omap'),
+ seq: require('./lib/type/seq'),
+ str: require('./lib/type/str')
+};
+
+// Removed functions from JS-YAML 3.0.x
+module.exports.safeLoad = renamed('safeLoad', 'load');
+module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');
+module.exports.safeDump = renamed('safeDump', 'dump');
diff --git a/node_modules/js-yaml/lib/common.js b/node_modules/js-yaml/lib/common.js
new file mode 100644
index 0000000..25ef7d8
--- /dev/null
+++ b/node_modules/js-yaml/lib/common.js
@@ -0,0 +1,59 @@
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (subject === null);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (subject !== null);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
+
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
diff --git a/node_modules/js-yaml/lib/dumper.js b/node_modules/js-yaml/lib/dumper.js
new file mode 100644
index 0000000..f357a6a
--- /dev/null
+++ b/node_modules/js-yaml/lib/dumper.js
@@ -0,0 +1,965 @@
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_SCHEMA = require('./schema/default');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_BOM = 0xFEFF;
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_EQUALS = 0x3D; /* = */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+
+var QUOTING_TYPE_SINGLE = 1,
+ QUOTING_TYPE_DOUBLE = 2;
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.noArrayIndent = options['noArrayIndent'] || false;
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+ this.noRefs = options['noRefs'] || false;
+ this.noCompatMode = options['noCompatMode'] || false;
+ this.condenseFlow = options['condenseFlow'] || false;
+ this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
+ this.forceQuotes = options['forceQuotes'] || false;
+ this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+// Indents every line in a string. Empty lines (\n only) are not indented.
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+
+ if (line.length && line !== '\n') result += ind;
+
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// [33] s-white ::= s-space | s-tab
+function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+}
+
+// Returns true if the character can be printed without escaping.
+// From YAML 1.2: "any allowed characters known to be non-printable
+// should also be escaped. [However,] This isn’t mandatory"
+// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
+ || (0x10000 <= c && c <= 0x10FFFF);
+}
+
+// [34] ns-char ::= nb-char - s-white
+// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+// [26] b-char ::= b-line-feed | b-carriage-return
+// Including s-white (for some reason, examples doesn't match specs in this aspect)
+// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
+function isNsCharOrWhitespace(c) {
+ return isPrintable(c)
+ && c !== CHAR_BOM
+ // - b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+}
+
+// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
+// c = flow-in ⇒ ns-plain-safe-in
+// c = block-key ⇒ ns-plain-safe-out
+// c = flow-key ⇒ ns-plain-safe-in
+// [128] ns-plain-safe-out ::= ns-char
+// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
+// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
+// | ( /* An ns-char preceding */ “#” )
+// | ( “:” /* Followed by an ns-plain-safe(c) */ )
+function isPlainSafe(c, prev, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
+ return (
+ // ns-plain-safe
+ inblock ? // c = flow-in
+ cIsNsCharOrWhitespace
+ : cIsNsCharOrWhitespace
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ )
+ // ns-plain-char
+ && c !== CHAR_SHARP // false on '#'
+ && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
+ || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
+ || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
+}
+
+// Simplified test for values allowed as the first character in plain style.
+function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
+ return isPrintable(c) && c !== CHAR_BOM
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | “%” | “@” | “`”)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+}
+
+// Simplified test for values allowed as the last character in plain style.
+function isPlainSafeLast(c) {
+ // just not whitespace or colon, it will be checked to be plain character later
+ return !isWhitespace(c) && c !== CHAR_COLON;
+}
+
+// Same as 'string'.codePointAt(pos), but works in older browsers.
+function codePointAt(string, pos) {
+ var first = string.charCodeAt(pos), second;
+ if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
+ second = string.charCodeAt(pos + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+}
+
+// Determines whether block indentation indicator is required.
+function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+}
+
+var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+// Determines which scalar styles are possible and returns the preferred style.
+// lineWidth = -1 => no limit.
+// Pre-conditions: str.length > 0.
+// Post-conditions:
+// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
+ testAmbiguousType, quotingType, forceQuotes, inblock) {
+
+ var i;
+ var char = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(codePointAt(string, 0))
+ && isPlainSafeLast(codePointAt(string, string.length - 1));
+
+ if (singleLineOnly || forceQuotes) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ if (plain && !forceQuotes && !testAmbiguousType(string)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+}
+
+// Note: line breaking/folding is implemented for only the folded style.
+// NB. We drop the last trailing newline (if any) of a returned block scalar
+// since the dumper adds its own newline. This always works:
+// • No ending newline => unaffected; already using strip "-" chomping.
+// • Ending newline => removed then restored.
+// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+function writeScalar(state, string, level, iskey, inblock) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
+ }
+ }
+
+ var indent = state.indent * Math.max(1, level); // no 0-indent scalars
+ // As indentation gets deeper, let the width decrease monotonically
+ // to the lower bound min(state.lineWidth, 40).
+ // Note that this implies
+ // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
+ // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
+ // This behaves better than a constant minimum width which disallows narrower options,
+ // or an indent threshold which causes the width to suddenly increase.
+ var lineWidth = state.lineWidth === -1
+ ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
+
+ // Without knowing if keys are implicit/explicit, assume implicit for safety.
+ var singleLineOnly = iskey
+ // No block styles in flow mode.
+ || (state.flowLevel > -1 && level >= state.flowLevel);
+ function testAmbiguity(string) {
+ return testImplicitResolving(state, string);
+ }
+
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
+ testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
+
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string, lineWidth) + '"';
+ default:
+ throw new YAMLException('impossible error: invalid scalar style');
+ }
+ }());
+}
+
+// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+}
+
+// (See the note for writeScalar.)
+function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+}
+
+// Note: a long line without a suitable break point will exceed the width limit.
+// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+}
+
+// Greedy line breaking.
+// Picks the longest line under the limit each time,
+// otherwise settles for the shortest line over the limit.
+// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
+
+ // By the invariants, start <= length-1, so there is something left over.
+ // It is either the whole string or a part starting from non-whitespace.
+ result += '\n';
+ // Insert a break if the remainder is too long and there is a break available.
+ if (line.length - start > width && curr > start) {
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
+ } else {
+ result += line.slice(start);
+ }
+
+ return result.slice(1); // drop extra \n joiner
+}
+
+// Escapes a double-quoted string.
+function escapeString(string) {
+ var result = '';
+ var char = 0;
+ var escapeSeq;
+
+ for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ escapeSeq = ESCAPE_SEQUENCES[char];
+
+ if (!escapeSeq && isPrintable(char)) {
+ result += string[i];
+ if (char >= 0x10000) result += string[i + 1];
+ } else {
+ result += escapeSeq || encodeHex(char);
+ }
+ }
+
+ return result;
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level, value, false, false) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level, null, false, false))) {
+
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level + 1, value, true, true, false, true) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level + 1, null, true, true, false, true))) {
+
+ if (!compact || _result !== '') {
+ _result += generateNextLine(state, level);
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
+
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+
+ pairBuffer = '';
+ if (_result !== '') pairBuffer += ', ';
+
+ if (state.condenseFlow) pairBuffer += '"';
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) pairBuffer += '? ';
+
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || _result !== '') {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ if (explicit) {
+ if (type.multi && type.representName) {
+ state.tag = type.representName(object);
+ } else {
+ state.tag = type.tag;
+ }
+ } else {
+ state.tag = '?';
+ }
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if (_toString.call(type.represent) === '[object Function]') {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey, isblockseq) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+ var inblock = block;
+ var tagStr;
+
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
+
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type === '[object Object]') {
+ if (block && (Object.keys(state.dump).length !== 0)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object Array]') {
+ if (block && (state.dump.length !== 0)) {
+ if (state.noArrayIndent && !isblockseq && level > 0) {
+ writeBlockSequence(state, level - 1, state.dump, compact);
+ } else {
+ writeBlockSequence(state, level, state.dump, compact);
+ }
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object String]') {
+ if (state.tag !== '?') {
+ writeScalar(state, state.dump, level, iskey, inblock);
+ }
+ } else if (type === '[object Undefined]') {
+ return false;
+ } else {
+ if (state.skipInvalid) return false;
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (state.tag !== null && state.tag !== '?') {
+ // Need to encode all characters except those allowed by the spec:
+ //
+ // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
+ // [36] ns-hex-digit ::= ns-dec-digit
+ // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
+ // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
+ // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”
+ // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”
+ // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”
+ // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”
+ //
+ // Also need to encode '!' because it has special meaning (end of tag prefix).
+ //
+ tagStr = encodeURI(
+ state.tag[0] === '!' ? state.tag.slice(1) : state.tag
+ ).replace(/!/g, '%21');
+
+ if (state.tag[0] === '!') {
+ tagStr = '!' + tagStr;
+ } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
+ tagStr = '!!' + tagStr.slice(18);
+ } else {
+ tagStr = '!<' + tagStr + '>';
+ }
+
+ state.dump = tagStr + ' ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (object !== null && typeof object === 'object') {
+ index = objects.indexOf(object);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ if (!state.noRefs) getDuplicateReferences(input, state);
+
+ var value = input;
+
+ if (state.replacer) {
+ value = state.replacer.call({ '': value }, '', value);
+ }
+
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
+
+ return '';
+}
+
+module.exports.dump = dump;
diff --git a/node_modules/js-yaml/lib/exception.js b/node_modules/js-yaml/lib/exception.js
new file mode 100644
index 0000000..7f62daa
--- /dev/null
+++ b/node_modules/js-yaml/lib/exception.js
@@ -0,0 +1,55 @@
+// YAML error class. http://stackoverflow.com/questions/8458984
+//
+'use strict';
+
+
+function formatError(exception, compact) {
+ var where = '', message = exception.reason || '(unknown reason)';
+
+ if (!exception.mark) return message;
+
+ if (exception.mark.name) {
+ where += 'in "' + exception.mark.name + '" ';
+ }
+
+ where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
+
+ if (!compact && exception.mark.snippet) {
+ where += '\n\n' + exception.mark.snippet;
+ }
+
+ return message + ' ' + where;
+}
+
+
+function YAMLException(reason, mark) {
+ // Super constructor
+ Error.call(this);
+
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = formatError(this, false);
+
+ // Include stack trace in error object
+ if (Error.captureStackTrace) {
+ // Chrome and NodeJS
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ // FF, IE 10+ and Safari 6+. Fallback for others
+ this.stack = (new Error()).stack || '';
+ }
+}
+
+
+// Inherit from Error
+YAMLException.prototype = Object.create(Error.prototype);
+YAMLException.prototype.constructor = YAMLException;
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ return this.name + ': ' + formatError(this, compact);
+};
+
+
+module.exports = YAMLException;
diff --git a/node_modules/js-yaml/lib/loader.js b/node_modules/js-yaml/lib/loader.js
new file mode 100644
index 0000000..39f13f5
--- /dev/null
+++ b/node_modules/js-yaml/lib/loader.js
@@ -0,0 +1,1727 @@
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var makeSnippet = require('./snippet');
+var DEFAULT_SCHEMA = require('./schema/default');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function _class(obj) { return Object.prototype.toString.call(obj); }
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ /* eslint-disable indent */
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(
+ ((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00
+ );
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
+ // if such documents have no explicit %YAML directive
+ this.legacy = options['legacy'] || false;
+
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ // position of first leading tab in the current line,
+ // used to make sure there are no tabs in the indentation
+ this.firstTabInLine = -1;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ var mark = {
+ name: state.filename,
+ buffer: state.input.slice(0, -1), // omit trailing \0
+ position: state.position,
+ line: state.line,
+ column: state.position - state.lineStart
+ };
+
+ mark.snippet = makeSnippet(mark);
+
+ return new YAMLException(message, mark);
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state, 'tag prefix is malformed: ' + prefix);
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 0x09 ||
+ (0x20 <= _character && _character <= 0x10FFFF))) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+}
+
+function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
+ startLine, startLineStart, startPos) {
+
+ var index, quantity;
+
+ // The output is a plain object here, so keys can only be strings.
+ // We need to convert keyNode to a string, but doing so can hang the process
+ // (deeply nested arrays that explode exponentially using aliases).
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state, 'nested arrays are not supported inside keys');
+ }
+
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
+
+ // Avoid code execution in load() via toString property
+ // (still use its own toString for arrays, timestamps,
+ // and whatever user schema extensions happen to have @@toStringTag)
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
+ keyNode = '[object Object]';
+ }
+
+
+ keyNode = String(keyNode);
+
+ if (_result === null) {
+ _result = {};
+ }
+
+ if (keyTag === 'tag:yaml.org,2002:merge') {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state.json &&
+ !_hasOwnProperty.call(overridableKeys, keyNode) &&
+ _hasOwnProperty.call(_result, keyNode)) {
+ state.line = startLine || state.line;
+ state.lineStart = startLineStart || state.lineStart;
+ state.position = startPos || state.position;
+ throwError(state, 'duplicated mapping key');
+ }
+
+ // used for this specific key only because Object.defineProperty is slow
+ if (keyNode === '__proto__') {
+ Object.defineProperty(_result, keyNode, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: valueNode
+ });
+ } else {
+ _result[keyNode] = valueNode;
+ }
+ delete overridableKeys[keyNode];
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x0A/* LF */) {
+ state.position++;
+ } else if (ch === 0x0D/* CR */) {
+ state.position++;
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+ state.firstTabInLine = -1;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
+ state.firstTabInLine = state.position;
+ }
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
+ ch === state.input.charCodeAt(_position + 1) &&
+ ch === state.input.charCodeAt(_position + 2)) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ ch === 0x23/* # */ ||
+ ch === 0x26/* & */ ||
+ ch === 0x2A/* * */ ||
+ ch === 0x21/* ! */ ||
+ ch === 0x7C/* | */ ||
+ ch === 0x3E/* > */ ||
+ ch === 0x27/* ' */ ||
+ ch === 0x22/* " */ ||
+ ch === 0x25/* % */ ||
+ ch === 0x40/* @ */ ||
+ ch === 0x60/* ` */) {
+ return false;
+ }
+
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (ch !== 0) {
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (ch === 0x23/* # */) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x22/* " */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _lineStart,
+ _pos,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = Object.create(null),
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ } else if (ch === 0x2C/* , */) {
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
+ throwError(state, "expected the node content, but found ','");
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (ch === 0x3F/* ? */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line; // Save the current line.
+ _lineStart = state.lineStart;
+ _pos = state.position;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (ch !== 0));
+ }
+ }
+
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ // except for the first content line (cf. Example 8.1)
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (emptyLines === 0) {
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else {
+ // Keep all line breaks except the header line break.
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ }
+
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (ch !== 0)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _keyLine,
+ _keyLineStart,
+ _keyPos,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ overridableKeys = Object.create(null),
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
+
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ // Neither implicit nor explicit notation.
+ // Reading is done. Go to the epilogue.
+ break;
+ }
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x3A/* : */) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+ }
+
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x21/* ! */) return false;
+
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x3C/* < */) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (ch === 0x21/* ! */) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state, 'tag name is malformed: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
+
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x26/* & */) return false;
+
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x2A/* * */) return false;
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (indentStatus === 1) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (indentStatus === 1) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (indentStatus === 0) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (state.tag === null) {
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+
+ } else if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (state.tag !== '!') {
+ if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+ } else {
+ // looking for multi type
+ type = null;
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
+
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type = typeList[typeIndex];
+ break;
+ }
+ }
+ }
+
+ if (!type) {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result, state.tag);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ }
+
+ if (state.listener !== null) {
+ state.listener('close', state);
+ }
+ return state.tag !== null || state.anchor !== null || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = Object.create(null);
+ state.anchorMap = Object.create(null);
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) break;
+
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (ch !== 0) readLineBreak(state);
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (state.lineIndent === 0 &&
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ var nullpos = input.indexOf('\0');
+
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ var documents = loadDocuments(input, options);
+
+ if (typeof iterator !== 'function') {
+ return documents;
+ }
+
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (documents.length === 0) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
diff --git a/node_modules/js-yaml/lib/schema.js b/node_modules/js-yaml/lib/schema.js
new file mode 100644
index 0000000..65b41f4
--- /dev/null
+++ b/node_modules/js-yaml/lib/schema.js
@@ -0,0 +1,121 @@
+'use strict';
+
+/*eslint-disable max-len*/
+
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name) {
+ var result = [];
+
+ schema[name].forEach(function (currentType) {
+ var newIndex = result.length;
+
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag &&
+ previousType.kind === currentType.kind &&
+ previousType.multi === currentType.multi) {
+
+ newIndex = previousIndex;
+ }
+ });
+
+ result[newIndex] = currentType;
+ });
+
+ return result;
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length;
+
+ function collectType(type) {
+ if (type.multi) {
+ result.multi[type.kind].push(type);
+ result.multi['fallback'].push(type);
+ } else {
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
+ }
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+}
+
+
+function Schema(definition) {
+ return this.extend(definition);
+}
+
+
+Schema.prototype.extend = function extend(definition) {
+ var implicit = [];
+ var explicit = [];
+
+ if (definition instanceof Type) {
+ // Schema.extend(type)
+ explicit.push(definition);
+
+ } else if (Array.isArray(definition)) {
+ // Schema.extend([ type1, type2, ... ])
+ explicit = explicit.concat(definition);
+
+ } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
+ // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
+
+ } else {
+ throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +
+ 'or a schema definition ({ implicit: [...], explicit: [...] })');
+ }
+
+ implicit.forEach(function (type) {
+ if (!(type instanceof Type)) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ if (type.loadKind && type.loadKind !== 'scalar') {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+
+ if (type.multi) {
+ throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
+ }
+ });
+
+ explicit.forEach(function (type) {
+ if (!(type instanceof Type)) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+ });
+
+ var result = Object.create(Schema.prototype);
+
+ result.implicit = (this.implicit || []).concat(implicit);
+ result.explicit = (this.explicit || []).concat(explicit);
+
+ result.compiledImplicit = compileList(result, 'implicit');
+ result.compiledExplicit = compileList(result, 'explicit');
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
+
+ return result;
+};
+
+
+module.exports = Schema;
diff --git a/node_modules/js-yaml/lib/schema/core.js b/node_modules/js-yaml/lib/schema/core.js
new file mode 100644
index 0000000..608b26d
--- /dev/null
+++ b/node_modules/js-yaml/lib/schema/core.js
@@ -0,0 +1,11 @@
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+module.exports = require('./json');
diff --git a/node_modules/js-yaml/lib/schema/default.js b/node_modules/js-yaml/lib/schema/default.js
new file mode 100644
index 0000000..3af0520
--- /dev/null
+++ b/node_modules/js-yaml/lib/schema/default.js
@@ -0,0 +1,22 @@
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+module.exports = require('./core').extend({
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
diff --git a/node_modules/js-yaml/lib/schema/failsafe.js b/node_modules/js-yaml/lib/schema/failsafe.js
new file mode 100644
index 0000000..b7a33eb
--- /dev/null
+++ b/node_modules/js-yaml/lib/schema/failsafe.js
@@ -0,0 +1,17 @@
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
diff --git a/node_modules/js-yaml/lib/schema/json.js b/node_modules/js-yaml/lib/schema/json.js
new file mode 100644
index 0000000..b73df78
--- /dev/null
+++ b/node_modules/js-yaml/lib/schema/json.js
@@ -0,0 +1,19 @@
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+module.exports = require('./failsafe').extend({
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
diff --git a/node_modules/js-yaml/lib/snippet.js b/node_modules/js-yaml/lib/snippet.js
new file mode 100644
index 0000000..00e2133
--- /dev/null
+++ b/node_modules/js-yaml/lib/snippet.js
@@ -0,0 +1,101 @@
+'use strict';
+
+
+var common = require('./common');
+
+
+// get snippet for a single line, respecting maxLength
+function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
+ var head = '';
+ var tail = '';
+ var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
+
+ if (position - lineStart > maxHalfLength) {
+ head = ' ... ';
+ lineStart = position - maxHalfLength + head.length;
+ }
+
+ if (lineEnd - position > maxHalfLength) {
+ tail = ' ...';
+ lineEnd = position + maxHalfLength - tail.length;
+ }
+
+ return {
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail,
+ pos: position - lineStart + head.length // relative position
+ };
+}
+
+
+function padStart(string, max) {
+ return common.repeat(' ', max - string.length) + string;
+}
+
+
+function makeSnippet(mark, options) {
+ options = Object.create(options || null);
+
+ if (!mark.buffer) return null;
+
+ if (!options.maxLength) options.maxLength = 79;
+ if (typeof options.indent !== 'number') options.indent = 1;
+ if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
+ if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
+
+ var re = /\r?\n|\r|\0/g;
+ var lineStarts = [ 0 ];
+ var lineEnds = [];
+ var match;
+ var foundLineNo = -1;
+
+ while ((match = re.exec(mark.buffer))) {
+ lineEnds.push(match.index);
+ lineStarts.push(match.index + match[0].length);
+
+ if (mark.position <= match.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
+ }
+ }
+
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
+
+ var result = '', i, line;
+ var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
+ var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
+
+ for (i = 1; i <= options.linesBefore; i++) {
+ if (foundLineNo - i < 0) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo - i],
+ lineEnds[foundLineNo - i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
+ maxLineLength
+ );
+ result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n' + result;
+ }
+
+ line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
+ result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
+
+ for (i = 1; i <= options.linesAfter; i++) {
+ if (foundLineNo + i >= lineEnds.length) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo + i],
+ lineEnds[foundLineNo + i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
+ maxLineLength
+ );
+ result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ }
+
+ return result.replace(/\n$/, '');
+}
+
+
+module.exports = makeSnippet;
diff --git a/node_modules/js-yaml/lib/type.js b/node_modules/js-yaml/lib/type.js
new file mode 100644
index 0000000..5e57877
--- /dev/null
+++ b/node_modules/js-yaml/lib/type.js
@@ -0,0 +1,66 @@
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'multi',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'representName',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (map !== null) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.options = options; // keep original options in case user wants to extend this type later
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.representName = options['representName'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.multi = options['multi'] || false;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
diff --git a/node_modules/js-yaml/lib/type/binary.js b/node_modules/js-yaml/lib/type/binary.js
new file mode 100644
index 0000000..e152351
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/binary.js
@@ -0,0 +1,125 @@
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (data === null) return false;
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) continue;
+
+ // Fail on illegal characters
+ if (code < 0) return false;
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ return new Uint8Array(result);
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === '[object Uint8Array]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
diff --git a/node_modules/js-yaml/lib/type/bool.js b/node_modules/js-yaml/lib/type/bool.js
new file mode 100644
index 0000000..cb77459
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/bool.js
@@ -0,0 +1,35 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (data === null) return false;
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
diff --git a/node_modules/js-yaml/lib/type/float.js b/node_modules/js-yaml/lib/type/float.js
new file mode 100644
index 0000000..74d77ec
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/float.js
@@ -0,0 +1,97 @@
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
+ // .2e4, .2
+ // special case, seems not from spec
+ '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
+ // .inf
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ // .nan
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (data === null) return false;
+
+ if (!YAML_FLOAT_PATTERN.test(data) ||
+ // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data[data.length - 1] === '_') {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
+
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
+
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if (value === '.nan') {
+ return NaN;
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase': return '.nan';
+ case 'uppercase': return '.NAN';
+ case 'camelcase': return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '.inf';
+ case 'uppercase': return '.INF';
+ case 'camelcase': return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '-.inf';
+ case 'uppercase': return '-.INF';
+ case 'camelcase': return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
diff --git a/node_modules/js-yaml/lib/type/int.js b/node_modules/js-yaml/lib/type/int.js
new file mode 100644
index 0000000..3fe3a44
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/int.js
@@ -0,0 +1,156 @@
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (data === null) return false;
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) return false;
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'o') {
+ // base 8
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+ }
+
+ // base 10 (except 0)
+
+ // value should not start with `_`;
+ if (ch === '_') return false;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
+
+ return true;
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch;
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if (value === '0') return 0;
+
+ if (ch === '0') {
+ if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
+ if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
+ if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
+ octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
+ decimal: function (obj) { return obj.toString(10); },
+ /* eslint-disable max-len */
+ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
diff --git a/node_modules/js-yaml/lib/type/map.js b/node_modules/js-yaml/lib/type/map.js
new file mode 100644
index 0000000..f327bee
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/map.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return data !== null ? data : {}; }
+});
diff --git a/node_modules/js-yaml/lib/type/merge.js b/node_modules/js-yaml/lib/type/merge.js
new file mode 100644
index 0000000..ae08a86
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/merge.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
diff --git a/node_modules/js-yaml/lib/type/null.js b/node_modules/js-yaml/lib/type/null.js
new file mode 100644
index 0000000..315ca4e
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/null.js
@@ -0,0 +1,35 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (data === null) return true;
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return object === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; },
+ empty: function () { return ''; }
+ },
+ defaultStyle: 'lowercase'
+});
diff --git a/node_modules/js-yaml/lib/type/omap.js b/node_modules/js-yaml/lib/type/omap.js
new file mode 100644
index 0000000..b2b5323
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/omap.js
@@ -0,0 +1,44 @@
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (data === null) return true;
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
+ }
+
+ if (!pairHasKey) return false;
+
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return data !== null ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
diff --git a/node_modules/js-yaml/lib/type/pairs.js b/node_modules/js-yaml/lib/type/pairs.js
new file mode 100644
index 0000000..74b5240
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/pairs.js
@@ -0,0 +1,53 @@
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (data === null) return true;
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ keys = Object.keys(pair);
+
+ if (keys.length !== 1) return false;
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (data === null) return [];
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
diff --git a/node_modules/js-yaml/lib/type/seq.js b/node_modules/js-yaml/lib/type/seq.js
new file mode 100644
index 0000000..be8f77f
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/seq.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return data !== null ? data : []; }
+});
diff --git a/node_modules/js-yaml/lib/type/set.js b/node_modules/js-yaml/lib/type/set.js
new file mode 100644
index 0000000..f885a32
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/set.js
@@ -0,0 +1,29 @@
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (data === null) return true;
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return data !== null ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
diff --git a/node_modules/js-yaml/lib/type/str.js b/node_modules/js-yaml/lib/type/str.js
new file mode 100644
index 0000000..27acc10
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/str.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return data !== null ? data : ''; }
+});
diff --git a/node_modules/js-yaml/lib/type/timestamp.js b/node_modules/js-yaml/lib/type/timestamp.js
new file mode 100644
index 0000000..8fa9c58
--- /dev/null
+++ b/node_modules/js-yaml/lib/type/timestamp.js
@@ -0,0 +1,88 @@
+'use strict';
+
+var Type = require('../type');
+
+var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (match === null) throw new Error('Date resolve error');
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if (match[9] === '-') delta = -delta;
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) date.setTime(date.getTime() - delta);
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json
new file mode 100644
index 0000000..17574da
--- /dev/null
+++ b/node_modules/js-yaml/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "js-yaml",
+ "version": "4.1.0",
+ "description": "YAML 1.2 parser and serializer",
+ "keywords": [
+ "yaml",
+ "parser",
+ "serializer",
+ "pyyaml"
+ ],
+ "author": "Vladimir Zapparov ",
+ "contributors": [
+ "Aleksey V Zapparov (http://www.ixti.net/)",
+ "Vitaly Puzrin (https://github.com/puzrin)",
+ "Martin Grenfell (http://got-ravings.blogspot.com)"
+ ],
+ "license": "MIT",
+ "repository": "nodeca/js-yaml",
+ "files": [
+ "index.js",
+ "lib/",
+ "bin/",
+ "dist/"
+ ],
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ },
+ "module": "./dist/js-yaml.mjs",
+ "exports": {
+ ".": {
+ "import": "./dist/js-yaml.mjs",
+ "require": "./index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "npm run lint && mocha",
+ "coverage": "npm run lint && nyc mocha && nyc report --reporter html",
+ "demo": "npm run lint && node support/build_demo.js",
+ "gh-demo": "npm run demo && gh-pages -d demo -f",
+ "browserify": "rollup -c support/rollup.config.js",
+ "prepublishOnly": "npm run gh-demo"
+ },
+ "unpkg": "dist/js-yaml.min.js",
+ "jsdelivr": "dist/js-yaml.min.js",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "devDependencies": {
+ "@rollup/plugin-commonjs": "^17.0.0",
+ "@rollup/plugin-node-resolve": "^11.0.0",
+ "ansi": "^0.3.1",
+ "benchmark": "^2.1.4",
+ "codemirror": "^5.13.4",
+ "eslint": "^7.0.0",
+ "fast-check": "^2.8.0",
+ "gh-pages": "^3.1.0",
+ "mocha": "^8.2.1",
+ "nyc": "^15.1.0",
+ "rollup": "^2.34.1",
+ "rollup-plugin-node-polyfills": "^0.2.1",
+ "rollup-plugin-terser": "^7.0.2",
+ "shelljs": "^0.8.4"
+ }
+}
diff --git a/openapi.yaml b/openapi.yaml
index f468a90..9a326e1 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -1,1906 +1,1470 @@
openapi: 3.1.0
info:
title: PDCP API
- version: '1.0'
+ version: "1.0"
summary: ProjectDiscovery Cloud Platform
- description: 'For more details, checkout https://docs.projectdiscovery.io/api-reference/editor/scan'
+ description: For more details, checkout https://docs.projectdiscovery.io/api-reference/editor/scan
servers:
- - url: 'https://api.projectdiscovery.io'
- description: Production
- - url: 'https://api.dev.projectdiscovery.io'
- description: Development
- - url: 'http://localhost:8080'
- description: Localhost
+- url: https://api.projectdiscovery.io
+ description: Production
+- url: https://api.dev.projectdiscovery.io
+ description: Development
+- url: http://localhost:8080
+ description: Localhost
paths:
- /v1/scans:
+ /v2/template/search:
get:
- operationId: get-v1-scans
- summary: Get Scan List
- description: Get user scans status
+ summary: Search Templates
+ tags:
+ - template/v2
parameters:
- - name: offset
- in: query
- description: number of scan-status results to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of scan-status results to fetch
- schema:
- type: integer
- - name: search
- in: query
- description: search term for running scans
- schema:
- type: string
- - name: status
- in: query
- description: 'filter by status (failed, finished, queued, running, starting, uploaded, scheduled)'
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,severity'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,severity'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
+ - schema:
+ type: string
+ enum:
+ - public
+ - private
+ - public_private
+ default: public_private
+ in: query
+ name: scope
+ description: Scope of templates to search (public or private)
+ - schema:
+ type: integer
+ default: 50
+ in: query
+ name: limit
+ description: Maximum number of results to return
+ - schema:
+ type: integer
+ default: 0
+ in: query
+ name: offset
+ description: Number of results to skip for pagination
+ - schema:
+ type: string
+ items:
type: string
+ in: query
+ name: fields
+ description: Specific fields to return in the response
+ style: form
+ explode: true
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: Field to sort results in ascending order
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: Field to sort results in descending order
+ - schema:
+ type: string
+ in: query
+ name: q
+ description: Search query string
+ - schema:
+ type: boolean
+ default: false
+ in: query
+ name: highlight
+ description: Whether to highlight search matches in results
+ - schema:
+ type: integer
+ default: 5
+ in: query
+ name: facet_size
+ description: Number of facets to return in the response
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
responses:
- '200':
- $ref: '#/components/responses/GetScansStatusResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ description: Successful search response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - results
+ - total
+ - count
+ - facets
+ properties:
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/TemplateData"
+ total:
+ type: integer
+ description: Total number of matching results
+ count:
+ type: integer
+ description: Number of results in this response
+ facets:
+ $ref: "#/components/schemas/TemplateStats"
+ message:
+ type: string
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/MessageResponse"
security:
- - X-API-Key: []
+ - X-API-Key: []
+ description: Search templates with filtering, sorting, and faceting capabilities
+ operationId: get-v2-template-search
+ /v1/scans:
+ get:
+ summary: Get Scan List
tags:
- - scans
+ - scans
+ responses:
+ "200":
+ $ref: "#/components/responses/GetScansStatusResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "499":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans
+ description: Get user scans status
+ security:
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of scan-status results to skip
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of scan-status results to fetch
+ - schema:
+ type: string
+ in: query
+ name: search
+ description: search term for running scans
+ - schema:
+ type: string
+ in: query
+ name: status
+ description: filter by status (failed, finished, queued, running, starting, uploaded, scheduled)
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,severity
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: comma separated descending sorting e.g sort_desc=created_at,severity
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
x-internal: false
post:
- operationId: post-v1-scans
summary: Create Scan
- description: Trigger a scan
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/TriggerUserScanRequest'
+ tags:
+ - scans
+ operationId: post-v1-scans
responses:
- '200':
- $ref: '#/components/responses/TriggerUserScanResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/TriggerUserScanResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ description: Trigger a scan
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ requestBody:
+ $ref: "#/components/requestBodies/TriggerUserScanRequest"
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
+ summary: Delete Scan in bulk
+ tags:
+ - scans
operationId: delete-v1-scans
- summary: Delete Bulk Scans
- description: Delete multiple scans using scan ids
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ responses:
+ "200":
+ $ref: "#/components/responses/DeleteScansResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - scan_ids
properties:
scan_ids:
type: array
items:
type: string
- required:
- - scan_ids
- responses:
- '200':
- $ref: '#/components/responses/DeleteScansResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
+ description: Delete scans using scan ids
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scan_id}':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ parameters:
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/{scan_id}:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
get:
- operationId: get-v1-scans-scan_id
summary: Get Scan
- description: Get details of a scan by scan ID
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/GetScanDetailsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '404':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetScanDetailsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "499":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-scan_id
+ description: Get details of a scan by scan ID
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
- operationId: delete-v1-scans-scan_id
summary: Delete Scan
- description: Delete a scan using scanId
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
+ operationId: delete-v1-scans-scan_id
responses:
- '200':
- $ref: '#/components/responses/DeleteScansResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/DeleteScansResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ description: Delete a scan using scanId
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
patch:
- operationId: patch-v1-scans-scan_id
summary: Update Scan
- description: Update scan metadata
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/UpdateScanRequest'
+ tags:
+ - scans
+ operationId: patch-v1-scans-scan_id
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ description: Update scan metadata
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ requestBody:
+ $ref: "#/components/requestBodies/UpdateScanRequest"
+ parameters:
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
/v1/scans/import:
post:
- operationId: post-v1-scans-import
summary: Import OSS Scan
+ tags:
+ - scans
+ operationId: post-v1-scans-import
+ responses:
+ "200":
+ $ref: "#/components/responses/ImportScanResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
description: Import scan details
- parameters:
- - name: name
- in: query
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ security:
+ - X-API-Key: []
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
- responses:
- '200':
- $ref: '#/components/responses/ImportScanResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scan_id}/stop':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ parameters:
+ - schema:
+ type: string
+ in: query
+ name: name
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/{scan_id}/stop:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
post:
- operationId: post-v1-scans-scan_id-stop
summary: Stop Scan
- description: 'Stop a running scan, not applied in any other state.'
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
+ operationId: post-v1-scans-scan_id-stop
responses:
- '200':
- $ref: '#/components/responses/DeleteScansResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/DeleteScansResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scan_id}/rescan':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ description: Stop a running scan, not applied in any other state.
+ parameters:
+ - schema:
type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ /v1/scans/{scan_id}/rescan:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
post:
- operationId: post-v1-scans-scan_id-rescan
summary: Rescan scan
- description: Re-run a existing scan
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
+ operationId: post-v1-scans-scan_id-rescan
responses:
- '200':
- $ref: '#/components/responses/TriggerUserScanResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/TriggerUserScanResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/vuln/{vuln_id}':
+ - X-API-Key: []
+ description: Re-run a existing scan
+ parameters:
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ /v1/scans/vuln/{vuln_id}:
get:
- operationId: 'get-v1-scans-vuln-:vulnId'
summary: Get Scan Vulnerability
- description: 'Get scan result vulnerability by ID '
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - results
responses:
- '200':
- $ref: '#/components/responses/GetScansVulnIdResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetScansVulnIdResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-vuln-:vulnId
+ description: "Get scan result vulnerability by ID "
security:
- - X-API-Key: []
- tags:
- - results
- parameters:
- - name: vuln_id
- in: path
- description: vulnerability ID
- required: true
- schema:
+ - X-API-Key: []
+ parameters:
+ - schema:
type: string
- '/v1/scans/result/{scanId}':
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ parameters:
+ - schema:
+ type: string
+ name: vuln_id
+ in: path
+ required: true
+ description: vulnerability ID
+ /v1/scans/vuln/{vuln_id}/changelogs:
get:
- operationId: 'get-v1-scans-result-:scanId'
- summary: Get Scan Results
- description: get results of specific scan by id
- parameters:
- - name: severity
- in: query
- description: 'comma separated severity e.g. severity=info,high'
- schema:
- type: string
- - name: search
- in: query
- description: search term
- schema:
- type: string
- - name: limit
- in: query
- description: 'number of results '
- schema:
- type: integer
- - name: offset
- in: query
- description: number of results to skip
- schema:
- type: integer
- - name: templates
- in: query
- description: 'comma separated templates e.g. templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: hosts
- in: query
- description: 'comma separated host e.g. hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: time
- in: query
- description: 'filter by time ( last_day, last_week, last_month )'
- schema:
- type: string
- - name: vuln_status
- in: query
- description: 'comma separated vuln_status e.g vuln_status=open,fixed'
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,severity'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,severity'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Get Vulnerability Changelogs
+ tags:
+ - results
responses:
- '200':
- $ref: '#/components/responses/GetScanResultsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetVulnChangelogsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "499":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-vuln-vuln_id-changelogs
+ description: get changelogs of specific vulnerability by id
security:
- - X-API-Key: []
- tags:
- - results
- parameters:
- - name: scanId
- in: path
- description: scan specific results (by scanId)
- required: true
- schema:
- type: string
- /v1/scans/results:
- get:
- operationId: get-v1-results
- summary: Get All Results
- description: Get scans results of a user
+ - X-API-Key: []
parameters:
- - name: offset
- in: query
- description: number of results to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of results to get
- schema:
- type: integer
- - name: severity
- in: query
- description: 'string separated by comma e.g. info,high'
- schema:
- type: string
- - name: search
- in: query
- description: search term
- schema:
- type: string
- - name: hosts
- in: query
- description: 'comma separated host e.g. hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: templates
- in: query
- description: 'comma separated templates e.g. templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: time
- in: query
- description: 'filter by time ( last_day, last_week, last_month )'
- schema:
- type: string
- - name: vuln_status
- in: query
- description: 'comma separated vuln_status e.g vuln_status=open,fixed'
- schema:
- type: string
- - name: tags
- in: query
- description: 'comma separated tags e.g tags=xss,cve'
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,severity'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,severity'
- schema:
- type: string
- - name: is_ticket
- in: query
- description: Return the records that have issue trackers
- schema:
- type: boolean
- - name: labels
- in: query
- description: 'filter by comma separated labels e.g labels=p1,p2'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetScanResultsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - results
- parameters: []
- /v1/scans/stats:
+ - schema:
+ type: string
+ enum:
+ - last_day
+ - last_week
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ default: all_time
+ in: query
+ name: time
+ description: time filter to select
+ - schema:
+ type: string
+ in: query
+ name: event_type
+ description: comma separated event_type e.g. event_type=vul_status,vul_status_change
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,severity
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: comma separated descending sorting e.g sort_desc=created_at,severity
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of results to get
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of results to skip
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ parameters:
+ - schema:
+ type: string
+ name: vuln_id
+ in: path
+ required: true
+ description: vulnerability ID
+ /v1/scans/vuln/changelogs:
get:
- operationId: get-v1-scans-stats
- summary: Get All Scan Stats
- description: Get all scans statistics for a user
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Get all Vulnerability Changelogs
+ tags:
+ - results
responses:
- '200':
- $ref: '#/components/responses/ScanStatsResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetVulnChangelogsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "499":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-vuln-changelogs
+ description: get changelogs of all vulnerabilities
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{vuln_id}/retest':
- parameters:
- - name: vuln_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - last_day
+ - last_week
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ default: all_time
+ in: query
+ name: time
+ description: time filter to select
+ - schema:
+ type: string
+ in: query
+ name: event_type
+ description: comma separated event_type e.g. event_type=vul_status,vul_status_change
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,severity
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: comma separated descending sorting e.g sort_desc=created_at,severity
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of results to get
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of results to skip
+ - schema:
type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ /v1/scans/{vuln_id}/retest:
+ parameters:
+ - schema:
+ type: string
+ name: vuln_id
+ in: path
+ required: true
post:
- operationId: post-v1-scans-vuln_id-retest
summary: Retest vulnerability
- description: Retest a scan vulnerability
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/PostRescanVulnResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
tags:
- - scans
- /v1/scans/results/filters:
- get:
- operationId: get-v1-scans-results-filters
- summary: Get Scans Result Filters
- description: Get users scan-result filters
- parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: scan_id
- in: query
- description: specific scan_id results filters
- schema:
- type: string
- - name: severity
- in: query
- description: 'comma separated severity e.g. severities=info,high'
- schema:
- type: string
- - name: templates
- in: query
- description: 'comma separated templates e.g. templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: hosts
- in: query
- description: 'comma separated host e.g. hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: search
- in: query
- description: search term
- schema:
- type: string
- - name: type
- in: query
- description: type of filter
- required: true
- schema:
- type: string
- - name: time
- in: query
- description: 'filter by time ( last_day, last_week, last_month )'
- schema:
- type: string
- - name: vuln_status
- in: query
- description: 'comma separated vuln_status e.g vuln_status=open,fixed'
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,severity'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,severity'
- schema:
- type: string
- - name: tags
- in: query
- description: 'comma separated tags e.g tags=xss,cve'
- schema:
- type: string
- - name: not_hosts
- in: query
- description: 'comma separated hosts that should not be returned e.g. not_hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: not_severity
- in: query
- description: 'comma separated severity that should not be returned e.g. not_severity=info,high'
- schema:
- type: string
- - name: not_templates
- in: query
- description: 'comma separated templates that should not be returned e.g. not_templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: labels
- in: query
- description: 'filter by comma separated labels e.g labels=p1,p2'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - scans
+ operationId: post-v1-scans-vuln_id-retest
responses:
- '200':
- $ref: '#/components/responses/GetScanResultsFiltersResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/PostRescanVulnResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - results
- /v1/scans/results/stats:
- get:
- operationId: get-v1-scans-results-stats
- summary: Get Results Stats
- description: Get user scan results stats
+ - X-API-Key: []
+ description: Retest a scan vulnerability
parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: hosts
- in: query
- description: 'comma separated host e.g. hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: templates
- in: query
- description: 'comma separated templates e.g. templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: severity
- in: query
- description: 'comma separated severity e.g. severities=info,high'
- schema:
- type: string
- - name: search
- in: query
- description: search term
- schema:
- type: string
- - name: scan_id
- in: query
- description: specific scan_id results filters
- schema:
- type: string
- - name: time
- in: query
- description: 'filter by time ( last_day, last_week, last_month )'
- schema:
- type: string
- - name: vuln_status
- in: query
- description: 'comma separated vuln_status e.g vuln_status=open,fixed'
- schema:
- type: string
- - name: tags
- in: query
- description: 'comma separated tags e.g tags=xss,cve'
- schema:
- type: string
- - name: not_hosts
- in: query
- description: 'comma separated hosts that should not be returned e.g. not_hosts=https://example.com,https://x.com'
- schema:
- type: string
- - name: not_severity
- in: query
- description: 'comma separated severity that should not be returned e.g. not_severity=info,high'
- schema:
- type: string
- - name: not_templates
- in: query
- description: 'comma separated templates that should not be returned e.g. not_templates=tech-detect,azure-takeover'
- schema:
- type: string
- - name: labels
- in: query
- description: 'filter by comma separated labels e.g labels=p1,p2'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetScanResultStatsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - results
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ socks5_proxy:
+ type: string
/v1/scans/schedule:
get:
- operationId: get-v1-scans-schedule
summary: Get Scan Schedules
- description: Get scan schedules for a user
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/GetScanScheduleResponse'
- '400':
- $ref: '#/components/responses/GetScanScheduleResponse'
- '401':
- $ref: '#/components/responses/SetScanScheduleResponse'
- '500':
- $ref: '#/components/responses/SetScanScheduleResponse'
+ "200":
+ $ref: "#/components/responses/GetScanScheduleResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-schedule
+ description: Get scan schedules for a user
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
post:
- operationId: post-v1-scans-schedule
summary: Set Scan Schedule
- description: 'set a scan schedule for a user '
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/SetScanScheduleRequest'
+ tags:
+ - scans
+ operationId: post-v1-scans-schedule
responses:
- '200':
- $ref: '#/components/responses/SetScanScheduleResponse'
- '400':
- $ref: '#/components/responses/SetScanScheduleResponse'
- '401':
- $ref: '#/components/responses/SetScanScheduleResponse'
- '500':
- $ref: '#/components/responses/SetScanScheduleResponse'
+ "200":
+ $ref: "#/components/responses/SetScanScheduleResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ description: "set a scan schedule for a user "
+ requestBody:
+ $ref: "#/components/requestBodies/SetScanScheduleRequest"
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
- operationId: delete-v1-scans-schedule
summary: Delete Scan Schedule
- description: Delete scan schedule for a user
- parameters:
- - name: scan_id
- in: query
- description: scan_id of schedule to be deleted
- required: true
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
+ operationId: delete-v1-scans-schedule
responses:
- '200':
- $ref: '#/components/responses/DeleteScanScheduleResponse'
- '400':
- $ref: '#/components/responses/DeleteScanScheduleResponse'
- '401':
- $ref: '#/components/responses/DeleteScanScheduleResponse'
- '500':
- $ref: '#/components/responses/DeleteScanScheduleResponse'
+ "200":
+ $ref: "#/components/responses/DeleteScanScheduleResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - scans
- /v1/retest:
- get:
- operationId: get-v1-retest
- summary: Get All Retest
- description: Get user retest results
+ $ref: "#/components/responses/ErrorResponse"
parameters:
- - name: offset
- in: query
- description: number of results to skip
- required: true
- schema:
- type: integer
- - name: limit
- in: query
- description: number of results
- required: true
- schema:
- type: integer
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetRetestResultsResponse'
- '401':
- $ref: '#/components/responses/GetRetestResultsResponse'
- '500':
- $ref: '#/components/responses/GetRetestResultsResponse'
+ - schema:
+ type: string
+ in: query
+ name: scan_id
+ required: true
+ description: scan_id of schedule to be deleted
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
+ - X-API-Key: []
+ description: Delete scan schedule for a user
+ /v1/retest/{vuln_id}:
+ get:
+ summary: Get Retest Vulnerability
tags:
- - retests
- post:
- operationId: post-v1-retest
- summary: Create Retest
- description: Trigger a retest scan
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/RetestTemplateRequest'
+ - retests
responses:
- '200':
- $ref: '#/components/responses/PostRetestTemplateResponse'
- '400':
- $ref: '#/components/responses/PostRetestTemplateResponse'
- '401':
- $ref: '#/components/responses/PostRetestTemplateResponse'
- '500':
- $ref: '#/components/responses/PostRetestTemplateResponse'
- security:
- - X-API-Key: []
- tags:
- - retests
- parameters: []
- '/v1/retest/{vuln_id}':
- get:
+ "200":
+ $ref: "#/components/responses/GetSingleRetestResultResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
operationId: get-v1-retest-vuln_id
- summary: Get Retest Vulnerability
+ security:
+ - X-API-Key: []
description: Get retest vulnerability (retests from editor)
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetSingleRetestResultResponse'
- '400':
- $ref: '#/components/responses/GetSingleRetestResultResponse'
- '401':
- $ref: '#/components/responses/GetSingleRetestResultResponse'
- '500':
- $ref: '#/components/responses/GetSingleRetestResultResponse'
- security:
- - X-API-Key: []
- tags:
- - retests
- parameters:
- - name: vuln_id
- in: path
- required: true
- schema:
+ - schema:
type: string
- /v1/assets:
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ parameters:
+ - schema:
+ type: string
+ name: vuln_id
+ in: path
+ required: true
+ /v1/user/apikey:
get:
- operationId: get-v1-assets
- summary: Get Asset List
- description: Get user asset list
- parameters:
- - name: offset
- in: query
- description: number of assets to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of assets to fetch
- schema:
- type: integer
- - name: search
- in: query
- description: search term for asset list
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetAssetsListResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
+ summary: Get API Key
tags:
- - assets
- post:
- operationId: post-v1-assets
- summary: Upload Asset
- description: Manually upload user assets (uploaded to manual enumeration)
- parameters:
- - name: name
- in: query
- description: name of asset
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- - name: Content-Type
- in: header
- description: set the content type header
- schema:
- type: string
- requestBody:
- content:
- application/octet-stream:
- schema:
- type: string
- format: binary
+ - users
responses:
- '200':
- $ref: '#/components/responses/UploadAssetResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetUserAPIKeyResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-user-apikey
security:
- - X-API-Key: []
+ - X-API-Key: []
+ description: Get user api-key
+ post:
+ summary: Create API Key
tags:
- - assets
- '/v1/assets/{asset_Id}':
- parameters:
- - name: asset_Id
- in: path
- required: true
- schema:
- type: string
- get:
- operationId: get-v1-assets-assetId
- summary: Get Asset Metadata
- description: Get asset metadata
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - users
+ operationId: post-v1-user-apikey
responses:
- '200':
- $ref: '#/components/responses/GetUserAssetResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetUserAPIKeyResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - assets
+ - X-API-Key: []
+ description: Create user api-key, this won't create a new api-key if it already exists.
delete:
- operationId: delete-v1-assets-asset_Id
- summary: Delete Asset
- description: Delete asset by ID
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Delete API Key
+ tags:
+ - users
+ operationId: delete-v1-user-apikey
responses:
- '200':
- $ref: '#/components/responses/DeleteAssetResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/DeleteUserAPIKeyResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
+ - X-API-Key: []
+ description: Delete user api-key
+ /v1/user/apikey/rotate:
+ post:
+ summary: Rotate API Key
tags:
- - assets
- patch:
- operationId: patch-v1-assets-asset_Id
- summary: Update Asset Metadata
- description: Update asset metadata
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/UpdateAssetRequest'
+ - users
+ operationId: post-v1-user-apikey-rotate
responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- required:
- - message
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/PostApiKeyRotateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - assets
- '/v1/assets/{asset_id}/contents':
+ - X-API-Key: []
+ description: Rotate user api-key
+ /v1/template/public:
get:
- operationId: get-v1-assets-id-contents
- summary: Get Asset Content
- description: Get user asset content
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Get Public Template List
+ tags:
+ - templates
responses:
- '200':
- description: OK
- content:
- application/octet-stream:
- schema:
- type: string
- format: binary
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetPublicTemplateList"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - assets
- parameters:
- - name: asset_id
- in: path
- required: true
- schema:
- type: string
- patch:
- operationId: patch-v1-assets-asset_id-contents
- summary: Update Asset Content
- description: Update existing asset content
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-template-public
+ description: Get public-template list
parameters:
- - name: update_type
- in: query
- description: 'use append or replace '
- schema:
- type: string
- enum:
- - append
- - replace
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- - name: Content-Type
- in: header
- description: set the content type header
- schema:
- type: string
- requestBody:
- content:
- application/octet-stream:
- schema:
- type: string
- format: binary
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: Pagination offset (no. of results to skip)
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: Pagination limit (max no. of results in response)
+ - schema:
+ type: string
+ in: query
+ description: "template data fields "
+ name: fields
+ /v1/template/early:
+ get:
+ summary: Get Early Template List
+ tags:
+ - templates
responses:
- '200':
- $ref: '#/components/responses/PatchAssetContentResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetEarlyTempateList"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-early-templates
+ description: Get pdcp early template lists
security:
- - X-API-Key: []
- tags:
- - assets
- /v1/user/feedback:
- post:
- operationId: post-v1-user-feedback
- summary: Create Feedback
- description: Add user feedback
+ - X-API-Key: []
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/PostFeedbackRequest'
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ - schema:
+ type: string
+ in: query
+ name: fields
+ parameters: []
+ /v1/template/early/{id}:
+ get:
+ summary: Get Early Template
+ tags:
+ - templates
responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- required:
- - message
- '401':
+ "200":
description: Shared Response
content:
- application/json:
+ text/plain:
schema:
- type: object
- properties:
- message:
- type: string
- required:
- - message
- '500':
- description: Internal Server Error
- content:
+ type: string
application/json:
schema:
type: object
+ required:
+ - message
properties:
message:
type: string
- required:
- - message
+ template:
+ $ref: "#/components/schemas/TemplateData"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-early-templates-id
+ description: Get early template text
security:
- - X-API-Key: []
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ parameters:
+ - schema:
+ type: string
+ name: id
+ in: path
+ required: true
+ /v1/template/public/{template_id}:
+ get:
+ summary: Get Public Template
tags:
- - users
- /v1/user/delete/code:
- parameters: []
- post:
- operationId: post-v1-user-delete-code
- summary: Email user deletion verification code
- description: generate and email user deletion verification code
+ - templates
+ responses:
+ "200":
+ $ref: "#/components/responses/GetTemplateDataResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-public-template-data
+ description: Get public template data
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: query
+ name: fields
+ description: "template data fields "
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ parameters:
+ - schema:
+ type: string
+ name: template_id
+ in: path
+ required: true
+ description: "unique Id of template "
+ /v1/template:
+ get:
+ summary: Get Template List
+ tags:
+ - templates
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '403':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/GetUserTemplateListResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-templates
security:
- - X-API-Key: []
- tags:
- - users
- /v1/user:
- get:
- operationId: get-v1-user
- summary: Get User Profile
- description: Get user profile and permissions
+ - X-API-Key: []
+ description: Get user private(my) templates
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ - schema:
+ type: string
+ in: query
+ name: fields
+ parameters: []
+ post:
+ summary: Create Template
+ tags:
+ - templates
+ operationId: post-v1-template
responses:
- '200':
- $ref: '#/components/responses/GetUserProfileResponse'
- '401':
- $ref: '#/components/responses/GetUserProfileResponse'
- '500':
- $ref: '#/components/responses/GetUserProfileResponse'
+ "200":
+ $ref: "#/components/responses/CreateTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - users
- delete:
- operationId: delete-v1-user
- summary: Delete user from system along with all data
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - X-API-Key: []
requestBody:
content:
application/json:
schema:
type: object
+ required:
+ - template
properties:
- code:
+ template:
type: string
- required:
- - code
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '403':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
+ description: |
+ Template in text format
+ prompt:
+ type: string
+ description: Create a private template
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: string
+ in: query
+ name: filename
+ description: filename for template
+ - schema:
+ type: string
+ in: query
+ name: dir
+ description: directories for template
+ patch:
+ summary: Update Template
tags:
- - users
- /v1/user/apikey:
- get:
- operationId: get-v1-user-apikey
- summary: Get API Key
- description: Get user api-key
+ - templates
+ operationId: patch-v1-template
responses:
- '200':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- '401':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- '404':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- '500':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
+ "200":
+ $ref: "#/components/responses/UpdateTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
+ - X-API-Key: []
+ requestBody:
+ $ref: "#/components/requestBodies/UpdateTemplateRequest"
+ description: "Update existing private template "
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/template/{template_id}:
+ parameters:
+ - schema:
+ type: string
+ name: template_id
+ in: path
+ required: true
+ description: "unique Id of template "
+ get:
+ summary: Get Template
tags:
- - users
- post:
- operationId: post-v1-user-apikey
- summary: Create API Key
- description: 'Create user api-key, this won''t create a new api-key if it already exists.'
+ - templates
responses:
- '200':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- '400':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- '500':
- $ref: '#/components/responses/GetUserAPIKeyResponse'
- security:
- - X-API-Key: []
- tags:
- - users
+ "200":
+ $ref: "#/components/responses/GetTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-template-t_id
+ security:
+ - X-API-Key: []
+ description: Get private template text using ID
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
- operationId: delete-v1-user-apikey
- summary: Delete API Key
- description: Delete user api-key
+ summary: Delete Template
+ tags:
+ - templates
+ operationId: delete-v1-template-template_id
responses:
- '200':
- $ref: '#/components/responses/DeleteUserAPIKeyResponse'
- '401':
- $ref: '#/components/responses/DeleteUserAPIKeyResponse'
- '500':
- $ref: '#/components/responses/DeleteUserAPIKeyResponse'
+ "200":
+ $ref: "#/components/responses/DeleteTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - users
- /v1/user/apikey/rotate:
+ - X-API-Key: []
+ description: Delete private template using ID
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/template/ai:
post:
- operationId: post-v1-user-apikey-rotate
- summary: Rotate API Key
- description: Rotate user api-key
+ summary: Generate AI Template
+ tags:
+ - templates
+ operationId: post-v1-template-ai
responses:
- '200':
- $ref: '#/components/responses/PostApiKeyRotateResponse'
- '401':
- $ref: '#/components/responses/PostApiKeyRotateResponse'
- '500':
- $ref: '#/components/responses/PostApiKeyRotateResponse'
+ "200":
+ $ref: "#/components/responses/GenerateTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/GenerateTemplateRequest"
security:
- - X-API-Key: []
- tags:
- - users
- /v1/template/public:
- get:
- operationId: get-v1-template-public
- summary: Get Public Template List
- description: Get public-template list
+ - X-API-Key: []
+ description: Generate a private template with AI Engine
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetPublicTemplateList'
- '201':
- $ref: '#/components/responses/GetPublicTemplateList'
- '500':
- $ref: '#/components/responses/GetPublicTemplateList'
- tags:
- - templates
- /v1/template/early:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/template/share:
get:
- operationId: get-v1-early-templates
- summary: Get Early Template List
- description: Get pdcp early template lists
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Get Shared Template List
+ tags:
+ - templates
responses:
- '200':
- $ref: '#/components/responses/GetEarlyTempateList'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '403':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/GetShareStatusResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-template-share
security:
- - X-API-Key: []
- tags:
- - templates
- parameters: []
- '/v1/template/early/{id}':
- get:
- operationId: get-v1-early-templates-id
- summary: Get Early Template
- description: Get early template text
+ - X-API-Key: []
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: string
+ in: query
+ name: fields
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: Limit The numbers of items to return
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: Offset The numbers of items to skip
+ - schema:
+ type: string
+ in: query
+ description: SortAsc Sort results in ascending order (CSV field names)
+ name: sort_asc
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: SortDesc Sort results in descending order (CSV field names)
+ description: Shared template list
+ post:
+ summary: Share Template
+ tags:
+ - templates
+ operationId: post-v1-template-share
responses:
- '200':
- description: Shared Response
- content:
- text/plain:
- schema:
- type: string
- '400':
- $ref: '#/components/responses/MessageResponse'
- '403':
- $ref: '#/components/responses/MessageResponse'
- '404':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/ShareTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - templates
- parameters:
- - name: id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ requestBody:
+ $ref: "#/components/requestBodies/ShareTemplateRequest"
+ description: Share a private template (shared-with-link)
+ parameters:
+ - schema:
type: string
- '/v1/template/public/{template_id}':
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/template/share/{template_id}:
+ parameters:
+ - schema:
+ type: string
+ name: template_id
+ in: path
+ required: true
+ description: unique template ID
get:
- summary: Get Public Template
+ summary: Get Shared Template
tags:
- - templates
+ - templates
responses:
- '200':
- $ref: '#/components/responses/GetTemplateDataResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/GetSharedTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/MessageResponse'
- operationId: get-v1-public-template-data
- description: Get public template data using template id
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-template-share-template_id
parameters:
- - schema:
- type: string
- in: query
- name: fields
- description: 'template data fields '
- - schema:
- type: string
- in: header
- name: X-Team-Id
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- parameters:
- schema:
type: string
- name: template_id
- in: path
- required: true
- description: 'Public Template ID'
- /v1/template:
- get:
- operationId: get-v1-templates
- summary: Get Template List
- description: Get user private(my) templates
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ in: query
+ name: fields
+ description: get selected fields e.g. name,template_id,severity, etc
+ description: Get a shared template text
+ requestBody:
+ content: {}
+ patch:
+ summary: Update Shared Template
+ tags: []
responses:
- '200':
- $ref: '#/components/responses/GetUserTemplateListResponse'
- '401':
- $ref: '#/components/responses/GetUserTemplateListResponse'
- '500':
- $ref: '#/components/responses/GetUserTemplateListResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- parameters: []
- post:
- operationId: post-v1-template
- summary: Create Template
- description: Create a private template
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ "200":
+ $ref: "#/components/responses/UpdateSharedTemplateResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: patch-v1-template-share-template_id
+ parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
- template:
+ ttl:
type: string
- prompt:
+ share_type:
type: string
- required:
- - template
- responses:
- '200':
- $ref: '#/components/responses/CreateTemplateResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- patch:
- operationId: patch-v1-template
- summary: Update Template
- description: 'Update existing private template '
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/UpdateTemplateRequest'
- responses:
- '200':
- $ref: '#/components/responses/UpdateTemplateResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- '/v1/template/{template_id}':
- parameters:
- - name: template_id
- in: path
- description: 'unique Id of template '
- required: true
- schema:
- type: string
- get:
- operationId: get-v1-template-t_id
- summary: Get Template
- description: Get private template text using ID
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetTemplateResponse'
- '400':
- $ref: '#/components/responses/GetTemplateResponse'
- '401':
- $ref: '#/components/responses/GetTemplateResponse'
- '404':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/GetTemplateResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
+ users:
+ type: array
+ items:
+ type: integer
+ emails:
+ type: array
+ items:
+ type: string
+ organizations:
+ type: array
+ items:
+ type: string
delete:
- operationId: delete-v1-template-template_id
- summary: Delete Template
- description: Delete private template using ID
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/DeleteTemplateResponse'
- '400':
- $ref: '#/components/responses/DeleteTemplateResponse'
- '401':
- $ref: '#/components/responses/DeleteTemplateResponse'
- '500':
- $ref: '#/components/responses/DeleteTemplateResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- /v1/template/ai:
- post:
- operationId: post-v1-template-ai
- summary: Generate AI Template
- description: Generate a private template with AI Engine
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/GenerateTemplateRequest'
- responses:
- '200':
- $ref: '#/components/responses/GenerateTemplateResponse'
- '400':
- $ref: '#/components/responses/GenerateTemplateResponse'
- '401':
- $ref: '#/components/responses/GenerateTemplateResponse'
- '403':
- $ref: '#/components/responses/GenerateTemplateResponse'
- '500':
- $ref: '#/components/responses/GenerateTemplateResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- /v1/template/share:
- get:
- operationId: get-v1-template-share
- summary: Get Share Status
- description: Get template sahred status (shared-with-link)
- parameters:
- - name: template_id
- in: query
- description: short uuid of requested template
- required: true
- schema:
- type: string
- - name: user_name
- in: query
- description: user name of logged in user
- required: true
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetShareStatusResponse'
- '400':
- $ref: '#/components/responses/GetShareStatusResponse'
- '401':
- $ref: '#/components/responses/GetShareStatusResponse'
- '404':
- $ref: '#/components/responses/GetShareStatusResponse'
- '500':
- $ref: '#/components/responses/GetShareStatusResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- post:
- operationId: post-v1-template-share
- summary: Share Template
- description: Share a private template (shared-with-link)
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/ShareTemplateRequest'
- responses:
- '200':
- $ref: '#/components/responses/ShareTemplateResponse'
- '400':
- $ref: '#/components/responses/ShareTemplateResponse'
- '401':
- $ref: '#/components/responses/ShareTemplateResponse'
- '404':
- $ref: '#/components/responses/ShareTemplateResponse'
- '500':
- $ref: '#/components/responses/ShareTemplateResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- '/v1/template/share/{template_id}':
- parameters:
- - name: template_id
- in: path
- description: unique template ID
- required: true
- schema:
- type: string
- get:
- operationId: get-v1-template-share-template_id
- summary: Get Shared Template
- description: Get a shared template text
- parameters:
- - name: user_name
- in: query
- description: user name of template owner
- required: true
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Unshare/Delete template
+ tags: []
responses:
- '200':
- $ref: '#/components/responses/GetSharedTemplateResponse'
- '400':
- $ref: '#/components/responses/GetSharedTemplateResponse'
- '401':
- $ref: '#/components/responses/GetSharedTemplateResponse'
- '404':
- $ref: '#/components/responses/GetSharedTemplateResponse'
- '500':
- $ref: '#/components/responses/GetSharedTemplateResponse'
- tags:
- - templates
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: delete-v1-template-share-template_id
/v1/scans/scan_ips:
get:
- operationId: get-v1-scans-scan_ips
summary: Get Scan IPs
- description: Get list of static IPs used for scan
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/StaticScanIPsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/StaticScanIPsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-scan_ips
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scan_id}/import':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ description: Get user static scan IPs list
+ parameters:
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/{scan_id}/import:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
patch:
- operationId: patch-v1-scans-scan_id-import
summary: Update Imported Scan
+ operationId: patch-v1-scans-scan_id-import
+ tags:
+ - scans
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
description: Import more results to a given scan
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scan_id}/export':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ parameters:
+ - schema:
type: string
- - name: async
- in: query
- schema:
- type: boolean
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/{scan_id}/export:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
+ - schema:
+ type: boolean
+ in: query
+ name: async
get:
- operationId: get-v1-scans-scan_id-export
summary: Export Scan
- description: Export scan results
- parameters:
- - name: type
- in: query
- description: 'json, csv, pdf (default json)'
- schema:
- type: string
- enum:
- - json
- - csv
- - pdf
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
+ "200":
description: OK
content:
application/octet-stream:
schema:
type: string
- '201':
+ "201":
description: Created
content:
application/json:
@@ -1910,38 +1474,80 @@ paths:
export_id:
type: string
required:
- - export_id
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ - export_id
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-scan_id-export
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - json
+ - csv
+ - pdf
+ in: query
+ name: type
+ description: json, csv, pdf (default json)
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: Export scan results
post:
- operationId: post-v1-scans-scan_id-export
summary: Export Filtered Scan
- description: Export filtered scan results
+ tags:
+ - scans
+ responses:
+ "200":
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ "201":
+ description: Created
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ export_id:
+ type: string
+ required:
+ - export_id
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: post-v1-scans-scan_id-export
parameters:
- - name: type
- in: query
- description: 'json, csv, pdf (default json)'
- schema:
- type: string
- enum:
- - json
- - csv
- - pdf
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ enum:
+ - json
+ - csv
+ - pdf
+ in: query
+ name: type
+ description: json, csv, pdf (default json)
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
requestBody:
content:
application/json:
@@ -1962,20 +1568,45 @@ paths:
type: array
items:
type: string
+ domain:
+ type: array
+ items:
+ type: string
+ port:
+ type: array
+ items:
+ type: integer
template:
type: array
items:
type: string
search:
type: string
+ category:
+ type: array
+ items:
+ type: string
+ security:
+ - X-API-Key: []
+ description: Export filtered scan results
+ /v1/scans/results/export:
+ parameters:
+ - schema:
+ type: boolean
+ in: query
+ name: async
+ post:
+ summary: Export filtered Scan results
+ tags:
+ - export
responses:
- '200':
+ "200":
description: OK
content:
application/octet-stream:
schema:
type: string
- '201':
+ "201":
description: Created
content:
application/json:
@@ -1985,44 +1616,31 @@ paths:
export_id:
type: string
required:
- - export_id
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ - export_id
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - scans
- /v1/scans/results/export:
- parameters:
- - name: async
- in: query
- schema:
- type: boolean
- post:
+ $ref: "#/components/responses/ErrorResponse"
operationId: post-v1-scans-results-export
- summary: Export filtered Scan results
- description: Export filtered scan results
parameters:
- - name: type
- in: query
- description: 'json, csv, pdf (default json)'
- schema:
- type: string
- enum:
- - json
- - csv
- - pdf
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ enum:
+ - json
+ - csv
+ - pdf
+ in: query
+ name: type
+ description: json, csv, pdf (default json)
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
requestBody:
content:
application/json:
@@ -2043,304 +1661,241 @@ paths:
type: array
items:
type: string
+ domain:
+ type: array
+ items:
+ type: string
+ port:
+ type: array
+ items:
+ type: integer
template:
type: array
items:
type: string
search:
type: string
- scan_ids:
+ category:
type: array
items:
type: string
- responses:
- '200':
- description: OK
- content:
- application/octet-stream:
- schema:
- type: string
- '201':
- description: Created
- content:
- application/json:
- schema:
- type: object
- properties:
- export_id:
+ scan_ids:
+ type: array
+ items:
type: string
- required:
- - export_id
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
security:
- - X-API-Key: []
- tags:
- - export
- /v1/export/list:
- get:
- operationId: get-v1-export-list
- summary: Get export list for user
- parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- schema:
- type: integer
- - name: export_status
- in: query
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- properties:
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- data:
- type: array
- items:
- $ref: '#/components/schemas/ExportListItem'
- required:
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - export
- '/v1/scans/vuln/{vuln_id}/export':
+ - X-API-Key: []
+ description: Export filtered scan results
+ /v1/scans/vuln/{vuln_id}/export:
parameters:
- - name: vuln_id
- in: path
- required: true
- schema:
- type: string
+ - schema:
+ type: string
+ name: vuln_id
+ in: path
+ required: true
get:
- operationId: get-v1-scans-vuln-vuln_id-export
summary: Export Scan Vulnerability
- description: Export a specific scan vulnerability
- parameters:
- - name: type
- in: query
- description: 'json, csv (default json)'
- schema:
- type: string
- enum:
- - json
- - csv
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
+ "200":
description: OK
content:
application/octet-stream:
schema:
type: string
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-vuln-vuln_id-export
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - json
+ - csv
+ in: query
+ name: type
+ description: json, csv (default json)
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: Export a specific scan vulnerability
/v1/scans/vulns:
patch:
- operationId: patch-v1-scans-vulns
summary: Update Vulnerability Status
- description: Batch update vulnerability status
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/PatchScanVulnsRequest'
+ operationId: patch-v1-scans-vulns
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/PatchScanVulnsRequest"
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: Batch update vulnerability status
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
- operationId: delete-v1-scans-vulns
summary: Delete Scan Vulnerability
- description: Batch Delete scan vulnerability
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/DeleteVulnsRequest'
+ operationId: delete-v1-scans-vulns
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/DeleteVulnsRequest"
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: Batch Delete scan vulnerability
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
/v1/scans/vulns/labels:
patch:
- operationId: patch-v1-scans-vulns-labels
summary: Update Vulnerability Labels
- description: Batch update vulnerability labels
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/PatchScanVulnsLabelsRequest'
+ operationId: patch-v1-scans-vulns-labels
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/PatchScanVulnsLabelsRequest"
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: Batch update vulnerability labels
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
/v1/scans/config:
get:
- operationId: get-v1-scans-config
summary: Get Configs List
- description: Get user scan configurations list
- parameters:
- - name: type
- in: query
- description: filter by the type of config
- schema:
- type: string
- enum:
- - scan
- - reporting
- - template
- - alerting
- - cloudlist
- - name: search
- in: query
- description: search by config name
- schema:
- type: string
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - configurations
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: array
items:
- $ref: '#/components/schemas/ConfigResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/schemas/ConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-config
+ parameters:
+ - schema:
+ enum:
+ - scan
+ - reporting
+ - template
+ - alerting
+ - cloudlist
+ - subfinder
+ - remediation
+ - vuln_score
+ type: string
+ in: query
+ name: type
+ description: filter by the type of config
+ - schema:
+ type: string
+ in: query
+ name: search
+ description: search by config name
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: The numbers of items to return
+ - schema:
+ type: integer
+ in: query
+ description: The number of items to skip before starting to collect the result set
+ name: offset
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - configurations
+ - X-API-Key: []
+ description: Get user scan configurations list
post:
- operationId: post-v1-scans-config
summary: Add Config
- description: Add a new scan configuration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- content:
+ operationId: post-v1-scans-config
+ tags:
+ - configurations
+ responses:
+ "200":
+ $ref: "#/components/responses/PostScanConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ content:
application/json:
schema:
type: object
@@ -2348,79 +1903,84 @@ paths:
config:
type: string
config_type:
- $ref: '#/components/schemas/ConfigTypeEnum'
+ $ref: "#/components/schemas/ConfigTypeEnum"
name:
type: string
global:
type: boolean
required:
- - config
- - name
- responses:
- '200':
- $ref: '#/components/responses/PostScanConfigResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
+ - config
+ - name
security:
- - X-API-Key: []
- tags:
- - configurations
- '/v1/scans/config/{config_id}':
- parameters:
- - name: config_id
- in: path
- required: true
- schema:
+ - X-API-Key: []
+ description: Add a new scan configuration
+ parameters:
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/config/{config_id}:
+ parameters:
+ - schema:
+ type: string
+ name: config_id
+ in: path
+ required: true
get:
- operationId: get-v1-scans-config-config_id
summary: Get Config
- description: Get a scan configuration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - configurations
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- $ref: '#/components/schemas/ConfigResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/schemas/ConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-config-config_id
security:
- - X-API-Key: []
- tags:
- - configurations
+ - X-API-Key: []
+ description: Get a scan configuration
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: boolean
+ in: query
+ name: config_json
+ description: config is in json format
patch:
- operationId: patch-v1-scans-config-config_id
summary: Update Config
- description: Update existing scan configuration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ operationId: patch-v1-scans-config-config_id
+ tags:
+ - configurations
+ responses:
+ "200":
+ $ref: "#/components/responses/PostScanConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
requestBody:
content:
application/json:
@@ -2433,168 +1993,91 @@ paths:
type: string
global:
type: boolean
- responses:
- '200':
- $ref: '#/components/responses/PostScanConfigResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
security:
- - X-API-Key: []
- tags:
- - configurations
+ - X-API-Key: []
+ description: Update existing scan configuration
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: boolean
+ in: query
+ description: Specify payload is in json
+ name: config_json
delete:
- operationId: delete-v1-scans-config-config_id
summary: Delete Config
- description: Delete scan configuration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
+ operationId: delete-v1-scans-config-config_id
tags:
- - configurations
- /v1/scans/config/verify:
- post:
- operationId: post-v1-scans-config-verify
- summary: Verify Config
- description: Verify scan configuration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/VerifyConfigRequest'
+ - configurations
responses:
- '200':
- $ref: '#/components/responses/VerifyConfigResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - configurations
- /v1/scans/config/verify/contents:
- post:
- operationId: post-v1-scans-config-verify-contents
- summary: Get Verify Config Contents
- description: Get Verify scan configuration contents
+ - X-API-Key: []
+ description: Delete scan configuration
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/VerifyConfigContentsRequest'
- responses:
- '200':
- $ref: '#/components/responses/VerifyConfigContentsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - configurations
- '/v1/scans/{scan_id}/config':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/scans/{scan_id}/config:
+ parameters:
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
get:
- operationId: get-scans-id-config
summary: Get Scan Config
- description: 'Get scan metadata config '
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
+ "200":
description: OK
+ headers: {}
content:
application/json:
schema:
- $ref: '#/components/schemas/ScanConfig'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/schemas/ScanConfig"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-scans-id-config
security:
- - X-API-Key: []
- tags:
- - scans
+ - X-API-Key: []
+ description: "Get scan metadata config "
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
patch:
- operationId: patch-scans-id-config
summary: Update Scan Config
- description: Update scan metadata config
- parameters:
- - name: update_type
- in: query
- description: 'Update type: append or replace'
- schema:
- type: string
- default: append
- enum:
- - append
- - replace
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ScanConfigUpdateItem'
+ operationId: patch-scans-id-config
+ tags:
+ - scans
responses:
- '200':
+ "200":
description: OK
content:
application/json:
@@ -2603,3824 +2086,3411 @@ paths:
properties:
ok:
type: boolean
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ScanConfigUpdateItem"
security:
- - X-API-Key: []
- tags:
- - scans
- /v1/user/subscription:
+ - X-API-Key: []
+ description: Update scan metadata config
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - append
+ - replace
+ default: append
+ in: query
+ name: update_type
+ description: "Update type: append or replace"
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/asset/enumerate:
get:
- operationId: get-v1-user-subscription
- summary: Get Subscription Status
- description: Get user subscription status
+ summary: Get Enumeration List
+ tags:
+ - enumerations
+ responses:
+ "200":
+ $ref: "#/components/responses/EnumerateResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-enumerate
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: The number of items to skip before starting to collect the result set
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: The numbers of items to return
+ - schema:
+ type: string
+ in: query
+ name: search
+ description: search keyword in enumeration list
+ - schema:
+ type: string
+ in: query
+ name: enum_type
+ description: types of enumeration list (comma seperated)
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,name
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: comma separated descending sorting e.g sort_desc=created_at,name
+ - schema:
+ type: string
+ in: query
+ name: status
+ description: comma separated filter enumeration result by status
+ - schema:
+ type: string
+ enum:
+ - last_day
+ - last_week
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ default: all_time
+ in: query
+ name: time
+ description: time range to get enumerations from
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
+ type: string
+ in: query
+ name: custom_filter
+ description: custom query to filter. double encode the query string.
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ security:
+ - X-API-Key: []
+ description: Get enumeration list
+ post:
+ summary: Create Enumeration
+ tags:
+ - enumerations
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: object
properties:
- status:
- type: string
- message:
+ id:
type: string
- amount:
- type: integer
- monthly_token:
+ truncated-scan-targets:
type: integer
- price_id:
- type: string
- recurrence:
- type: string
- from:
- type: string
- to:
- type: string
- card:
- type: string
- brand:
+ is-public:
+ type: boolean
+ bulk_ids:
+ type: array
+ items:
+ type: string
+ failed_domains:
+ type: object
+ additionalProperties:
+ type: string
+ description: Map of domain to failure reason
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: post-v1-asset-enumerate
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ root_domains:
+ type: array
+ items:
type: string
- payment_mode:
+ enrichment_inputs:
+ type: array
+ items:
type: string
- cancel_at:
+ cloudlist_config_ids:
+ type: array
+ items:
type: string
- trial:
+ name:
+ type: string
+ steps:
+ type: array
+ items:
type: string
- required:
- - status
- - message
- '400':
- description: Bad Request
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
+ enum:
+ - dns_resolve
+ - dns_bruteforce
+ - dns_permute
+ - port_scan
+ - http_probe
+ - http_screenshot
+ - endpoint_crawling
+ - dns_passive
+ - tls_scan
+ - uncover_assets
+ - dns_scraping
+ enumeration_ports:
+ type: string
+ alerting_config_ids:
+ type: array
+ items:
type: string
- required:
- - message
- '500':
- description: Internal Server Error
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
+ disable_global_alert_config:
+ type: boolean
+ exclude_targets:
+ type: array
+ items:
type: string
- required:
- - message
+ enumeration_config:
+ type: object
+ properties:
+ follow-redirect:
+ type: boolean
+ ports:
+ type: string
+ automatic_vuln_scans:
+ type: boolean
+ per_domain_enumeration:
+ type: boolean
security:
- - X-API-Key: []
- tags:
- - users
- patch:
- operationId: patch-v1-user-subscription
- summary: Update current subscription
+ - X-API-Key: []
+ description: Create a new enumeration
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ delete:
+ summary: Delete Assets in bulk
+ tags:
+ - enumerations
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: delete-v1-asset-enumerates
requestBody:
content:
application/json:
schema:
type: object
- properties:
- price_id:
- type: string
required:
- - price_id
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- invoice:
- type: string
- status:
+ - asset_ids
+ properties:
+ asset_ids:
+ type: array
+ items:
type: string
- required:
- - message
- - status
- '400':
- $ref: '#/components/responses/MessageResponse'
- '403':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
security:
- - X-API-Key: []
- tags:
- - users
- /v1/asset/enumerate:
- get:
- operationId: get-v1-asset-enumerate
- summary: Get Enumeration List
- description: Get enumeration list
+ - X-API-Key: []
+ description: Delete enumeration by enumerate ids
parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: search
- in: query
- description: search keyword in enumeration list
- schema:
- type: string
- - name: enum_type
- in: query
- description: types of enumeration list (comma seperated)
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,name'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,name'
- schema:
- type: string
- - name: status
- in: query
- description: comma separated filter enumeration result by status
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/asset/enumerate/{enumerate_id}:
+ parameters:
+ - schema:
+ type: string
+ name: enumerate_id
+ in: path
+ required: true
+ get:
+ summary: Get Enumeration
+ tags:
+ - enumerations
responses:
- '200':
- $ref: '#/components/responses/EnumerateResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetEnumerateIdContentsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "499":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-enumerate-enumerate_id
security:
- - X-API-Key: []
- tags:
- - enumerations
- post:
- operationId: post-v1-asset-enumerate
- summary: Create Enumeration
- description: Create a new enumeration
+ - X-API-Key: []
+ description: Get enumeration by enumerate_id
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ patch:
+ summary: Update Enumeration
+ tags:
+ - enumerations
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: patch-v1-asset-enumerate-enumerate_id
requestBody:
content:
application/json:
schema:
type: object
properties:
- root_domains:
- type: array
- items:
- type: string
- enrichment_inputs:
- type: array
- items:
- type: string
- cloudlist_config_ids:
- type: array
- items:
- type: string
name:
type: string
- steps:
- type: array
- items:
- type: string
- enum:
- - dns_passive
- - dns_resolve
- - dns_bruteforce
- - dns_permute
- - port_scan
- - http_probe
- - http_screenshot
- enumeration_ports:
- type: string
- alerting_config_ids:
- type: array
- items:
- type: string
- disable_global_alert_config:
- type: boolean
- exclude_targets:
- type: array
- items:
- type: string
- enumeration_config:
- type: object
- properties:
- follow-redirect:
- type: boolean
- ports:
- type: string
+ security:
+ - X-API-Key: []
+ description: Update enumeration by enumerate_id
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ delete:
+ summary: Delete Enumeration
+ tags:
+ - enumerations
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: delete-v1-asset-enumerate-enumerate_id
+ security:
+ - X-API-Key: []
+ description: Delete enumeration by enumerate_id
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/asset/enumerate/{enumerate_id}/rescan:
+ parameters:
+ - schema:
+ type: string
+ name: enumerate_id
+ in: path
+ required: true
+ post:
+ summary: Rescan Enumeration
+ operationId: post-v1-asset-enumerate-enumerate_id-rescan
+ tags:
+ - enumerations
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: object
+ required:
+ - id
properties:
id:
type: string
truncated-scan-targets:
type: integer
- required:
- - id
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
security:
- - X-API-Key: []
- tags:
- - enumerations
- delete:
- operationId: delete-v1-asset-enumerates
- summary: Delete Bulk Enumeration
- description: Delete enumeration by enumerate ids
+ - X-API-Key: []
+ description: Re-run a existing enumeration
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- asset_ids:
- type: array
- items:
- type: string
- required:
- - asset_ids
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ - schema:
type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ /v1/asset/enumerate/{enum_id}/export:
+ parameters:
+ - schema:
+ type: string
+ name: enum_id
+ in: path
+ required: true
+ - schema:
+ type: boolean
+ in: query
+ name: async
get:
- operationId: get-v1-asset-enumerate-enumerate_id
- summary: Get Enumeration
- description: Get enumeration by enumerate_id
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetEnumerateIdContentsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '499':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
+ summary: Export Enumeration
tags:
- - enumerations
- patch:
- operationId: patch-v1-asset-enumerate-enumerate_id
- summary: Update Enumeration
- description: Update enumeration by enumerate_id
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- name:
- type: string
+ - enumerations
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ "201":
+ description: Created
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ export_id:
+ type: string
+ required:
+ - export_id
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- delete:
- operationId: delete-v1-asset-enumerate-enumerate_id
- summary: Delete Enumeration
- description: Delete enumeration by enumerate_id
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-enumerate-id-export
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}/contents':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ - schema:
+ $ref: "#/components/schemas/EnumExportFormats"
+ in: query
+ name: format
+ - schema:
type: string
- get:
- operationId: get-v1-asset-enumerate-enumerate_id-contents
- summary: Get Enumeration Contents
- description: Get enumeration content by enumerate_id
- parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- default: 0
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- default: 100
- - name: is_tech
- in: query
- description: Return records that have technologies
- schema:
- type: boolean
- - name: is_favicon
- in: query
- description: Return the records that have favicon
- schema:
- type: boolean
- - name: search
- in: query
- description: Search on the content name
- schema:
- type: string
- - name: labels
- in: query
- description: 'Filter by comma separated labels, e.g-> labels=p1,p2'
- schema:
- type: string
- - name: is_new
- in: query
- description: Filter by new content
- schema:
- type: boolean
- - name: host
- in: query
- description: 'Filter by comma separated labels, e.g-> host=p1,p2'
- schema:
- type: string
- - name: port
- in: query
- description: 'Filter by port separated labels, e.g-> port=p1,p2'
- schema:
- type: string
- - name: status_code
- in: query
- description: 'Filter by status code separated labels, e.g-> status_code=p1,p2'
- schema:
- type: string
- - name: title
- in: query
- description: 'Filter by title separated labels, e.g-> title=p1,p2'
- schema:
- type: string
- - name: content_length
- in: query
- description: 'Filter by content length separated labels, e.g-> content_length=p1,p2'
- schema:
- type: string
- - name: cname
- in: query
- description: cname to filter
- schema:
- type: string
- - name: domain
- in: query
- description: 'Filter by domain names separated labels, e.g-> domain=domain1.com,domain2.com'
- schema:
- type: string
- - name: technologies
- in: query
- description: technologies to filter
- schema:
- type: string
- - name: ip
- in: query
- description: ips to filter
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,name'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,name'
- schema:
- type: string
- - name: is_screenshot
- in: query
- description: asset with screenshots
- schema:
- type: boolean
- - name: time
- in: query
- description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
- in: query
- description: time filter start date
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: time filter end date
- schema:
- type: string
- format: date
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetEnumerateIdContents'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- /v1/asset/enumerate/contents:
- get:
- operationId: get-v1-asset-enumerate-contents
- summary: Get All Enumeration Contents
- description: Get All enumeration content
- parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- default: 0
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- default: 100
- - name: is_tech
- in: query
- description: Return records that have technologies
- schema:
- type: boolean
- - name: is_favicon
- in: query
- description: Return the records that have favicon
- schema:
- type: boolean
- - name: search
- in: query
- description: Search on the content name
- schema:
- type: string
- - name: labels
- in: query
- description: 'Filter by comma separated labels, e.g-> labels=p1,p2'
- schema:
- type: string
- - name: is_new
- in: query
- description: Filter by new content
- schema:
- type: boolean
- - name: host
- in: query
- description: 'Filter by comma separated labels, e.g-> host=p1,p2'
- schema:
- type: string
- - name: port
- in: query
- description: 'Filter by port separated labels, e.g-> port=p1,p2'
- schema:
- type: string
- - name: status_code
- in: query
- description: 'Filter by status code separated labels, e.g-> status_code=p1,p2'
- schema:
- type: string
- - name: title
- in: query
- description: 'Filter by title separated labels, e.g-> title=p1,p2'
- schema:
- type: string
- - name: content_length
- in: query
- description: 'Filter by content length separated labels, e.g-> content_length=p1,p2'
- schema:
- type: string
- - name: domain
- in: query
- description: 'Filter by domain names separated labels, e.g-> domain=domain1.com,domain2.com'
- schema:
- type: string
- - name: cname
- in: query
- description: cname to filter
- schema:
- type: string
- - name: technologies
- in: query
- description: technologies to filter
- schema:
- type: string
- - name: ip
- in: query
- description: ips to filter
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,name'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'comma separated descending sorting e.g sort_desc=created_at,name'
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetEnumerateIdContents'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}/stop':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ in: query
+ name: search
+ description: Search by string
+ - schema:
type: string
- post:
- operationId: post-v1-asset-enumerate-enumerate_id-stop
- summary: Stop Enumeration
- description: Stop a running enumeration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}/rescan':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ in: query
+ name: labels
+ description: Filter by comma separated labels, e.g-> labels=p1,p2
+ - schema:
+ type: boolean
+ in: query
+ name: is_new
+ description: Filter by new content
+ - schema:
+ type: string
+ in: query
+ name: host
+ description: Filter by comma separated hosts, e.g-> host=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: domains
+ description: Filter by comma separated domains, e.g-> domains=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: port
+ description: Filter by comma separated ports, e.g-> port=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: status_code
+ description: Filter by comma separated status codes, e.g-> status_code=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: title
+ description: Filter by comma separated titles, e.g-> title=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: content_length
+ description: Filter by comma separated content lengths, e.g-> content_length=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: cname
+ description: cname to filter
+ - schema:
+ type: string
+ in: query
+ name: technologies
+ description: technologies to filter
+ - schema:
+ type: string
+ in: query
+ name: ip
+ description: ips to filter
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: string
+ in: query
+ name: custom_filter
+ description: custom query to filter. double encode the query string.
+ - schema:
+ type: boolean
+ in: query
+ name: is_screenshot
+ description: Return records that have screenshots
+ - schema:
+ type: boolean
+ in: query
+ name: is_tech
+ description: Return records that have technologies
+ - schema:
+ type: boolean
+ in: query
+ name: is_favicon
+ description: Return the records that have favicon
+ - schema:
+ $ref: "#/components/schemas/TimeRangeQueryParameter"
+ default: all_time
+ in: query
+ name: time
+ description: time filter to select
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
type: string
+ in: query
+ name: favicon
+ description: Filter by comma separated favicons, e.g-> favicon=p1,p2
+ - schema:
+ type: boolean
+ in: query
+ name: only_dns
+ description: Query only dns FQDN records
+ - schema:
+ type: boolean
+ in: query
+ name: only_ip
+ description: Query only dns IP records
+ security:
+ - X-API-Key: []
+ description: Export enumeration content
+ /v1/asset/enumerate/group:
post:
- operationId: post-v1-asset-enumerate-enumerate_id-rescan
- summary: Rescan Enumeration
- description: Re-run a existing enumeration
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Create an asset group
+ tags:
+ - enumerations
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: object
+ required:
+ - id
properties:
id:
type: string
- truncated-scan-targets:
- type: integer
- required:
- - id
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '403':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/CreateAssetGroupRequest"
+ operationId: post-v1-asset-enumerate-group
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - enumerations
- '/v1/asset/enumerate/{enum_id}/export':
+ - X-API-Key: []
+ description: Create an asset group from existing enumeration data using filters
+ /v1/asset/enumerate/group/{group_id}:
parameters:
- - name: enum_id
- in: path
- required: true
- schema:
- type: string
- - name: async
- in: query
- schema:
- type: boolean
- get:
- operationId: get-enumerate-id-export
- summary: Export Enumeration
- description: Export enumeration content
- parameters:
- - name: format
- in: query
- schema:
- $ref: '#/components/schemas/EnumExportFormats'
- - name: search
- in: query
- description: Search by string
- schema:
- type: string
- - name: labels
- in: query
- description: 'Filter by comma separated labels, e.g-> labels=p1,p2'
- schema:
- type: string
- - name: is_new
- in: query
- description: Filter by new content
- schema:
- type: boolean
- - name: host
- in: query
- description: 'Filter by comma separated labels, e.g-> host=p1,p2'
- schema:
- type: string
- - name: port
- in: query
- description: 'Filter by port separated labels, e.g-> port=p1,p2'
- schema:
- type: string
- - name: status_code
- in: query
- description: 'Filter by status code separated labels, e.g-> status_code=p1,p2'
- schema:
- type: string
- - name: title
- in: query
- description: 'Filter by title separated labels, e.g-> title=p1,p2'
- schema:
- type: string
- - name: content_length
- in: query
- description: 'Filter by content length separated labels, e.g-> content_length=p1,p2'
- schema:
- type: string
- - name: cname
- in: query
- description: cname to filter
- schema:
- type: string
- - name: technologies
- in: query
- description: technologies to filter
- schema:
- type: string
- - name: ip
- in: query
- description: ips to filter
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ name: group_id
+ in: path
+ required: true
+ patch:
+ summary: Update an asset group
+ tags:
+ - enumerations
responses:
- '200':
- description: OK
- content:
- application/octet-stream:
- schema:
- type: string
- '201':
- description: Created
- content:
- application/json:
- schema:
- type: object
- properties:
- export_id:
- type: string
- required:
- - export_id
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/UpdateAssetGroupRequest"
+ operationId: patch-v1-asset-enumerate-group
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - append
+ - replace
+ default: append
+ in: query
+ name: update_type
+ description: Append vs Replace update_type. Default is append
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - enumerations
+ - X-API-Key: []
+ description: Update an asset group by customising the filters
/v1/enumeration/schedule:
get:
- operationId: get-v1-enumeration-schedule
summary: Get Enumeration Schedules
- description: Get enumeration re-scan schedule
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - enumerations
responses:
- '200':
- $ref: '#/components/responses/GetEnumerationScheduleResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/GetEnumerationScheduleResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-enumeration-schedule
security:
- - X-API-Key: []
- tags:
- - enumerations
+ - X-API-Key: []
+ description: Get enumeration re-scan schedule
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
post:
- operationId: post-v1-enumeration-schedule
summary: Set Enumeration Schedule
- description: Set enumeration re-scan frequency
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/SetEnumerationScheduleRequest'
+ operationId: post-v1-enumeration-schedule
+ tags:
+ - enumerations
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ requestBody:
+ $ref: "#/components/requestBodies/SetEnumerationScheduleRequest"
security:
- - X-API-Key: []
- tags:
- - enumerations
+ - X-API-Key: []
+ description: Set enumeration re-scan frequency
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
delete:
- operationId: delete-v1-enumeration-schedule
summary: Delete Enumeration Schedule
- description: Delete a re-scan schedule
- parameters:
- - name: enumeration_id
- in: query
- description: enumeration_id of the schedule to be deleted
- required: true
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ operationId: delete-v1-enumeration-schedule
+ tags:
+ - enumerations
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ parameters:
+ - schema:
+ type: string
+ in: query
+ name: enumeration_id
+ description: enumeration_id of the schedule to be deleted
+ required: true
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - enumerations
+ - X-API-Key: []
+ description: Delete a re-scan schedule
/v1/team/audit_log:
get:
- operationId: get-v1-audit-log
summary: Get audit logs for team
- parameters:
- - name: email
- in: query
- description: filter by specific user
- schema:
- type: string
- - name: action
- in: query
- description: filter by specific action name
- schema:
- type: string
- - name: offset
- in: query
- description: number of rows to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of rows to get
- schema:
- type: integer
- - name: start_date
- in: query
- description: start date from which you want to get logs
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: end date till which you want to get logs
- schema:
- type: string
- format: date
- - name: time_range
- in: query
- description: time range to get logs
- schema:
- type: string
- enum:
- - current_month
- - last_month
- - last_3_months
- - last_6_months
- - last_12_months
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags: []
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - data
properties:
message:
type: string
data:
type: array
items:
- $ref: '#/components/schemas/UserAuditLogItems'
- required:
- - message
- - data
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ $ref: "#/components/schemas/UserAuditLogItems"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ operationId: get-v1-audit-log
security:
- - X-API-Key: []
- tags: []
+ - X-API-Key: []
+ parameters:
+ - schema:
+ type: string
+ in: query
+ name: email
+ description: filter by specific user
+ - schema:
+ type: string
+ in: query
+ name: action
+ description: filter by specific action name
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of rows to skip
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of rows to get
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: start_date
+ description: start date from which you want to get logs
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: end date till which you want to get logs
+ - schema:
+ type: string
+ enum:
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ in: query
+ name: time_range
+ description: time range to get logs
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
/v1/scans/history:
get:
- operationId: get-v1-scans-history
summary: Get All Scans History
- description: Get user scan history details
- parameters:
- - name: offset
- in: query
- description: number of rows to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of rows to get
- schema:
- type: integer
- - name: start_date
- in: query
- description: start date from which you want to get history
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: end date till which you want to get history
- schema:
- type: string
- format: date
- - name: time_range
- in: query
- description: time range to get history
- schema:
- type: string
- enum:
- - current_month
- - last_month
- - last_3_months
- - last_6_months
- - last_12_months
- - all_time
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/GetScansHistoryResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetScansHistoryResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-history
+ parameters:
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of rows to skip
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of rows to get
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: start_date
+ description: start date from which you want to get history
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: end date till which you want to get history
+ - schema:
+ type: string
+ enum:
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ in: query
+ name: time_range
+ description: time range to get history
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - scans
- '/v1/scans/{scanId}/history':
+ - X-API-Key: []
+ description: Get user scan history details
+ /v1/scans/{scanId}/history:
parameters:
- - name: scanId
- in: path
- required: true
- schema:
- type: string
+ - schema:
+ type: string
+ name: scanId
+ in: path
+ required: true
get:
- operationId: get-v1-scans-scanId-history
summary: Get Scan History
- description: Get scan history detial by scanId
- parameters:
- - name: offset
- in: query
- description: number of rows to skip
- schema:
- type: integer
- - name: limit
- in: query
- description: number of rows to get
- schema:
- type: integer
- - name: start_date
- in: query
- description: start date from which you want to get history
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: end date till which you want to get history
- schema:
- type: string
- format: date
- - name: time_range
- in: query
- description: time range to get history
- schema:
- type: string
- enum:
- - current_month
- - last_month
- - last_3_months
- - last_6_months
- - last_12_months
- - all_time
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - scans
responses:
- '200':
- $ref: '#/components/responses/GetScansHistoryResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetScansHistoryResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - scans
- /v1/template/github:
- get:
- operationId: get-v1-github-templates
- summary: Get Github Template List
- description: List of all user's github templates
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-scanId-history
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/GithubTemplateListItem'
- required:
- - data
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- parameters: []
- '/v1/template/github/{id}':
- parameters:
- - name: id
- in: path
- required: true
- schema:
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of rows to skip
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of rows to get
+ - schema:
type: string
- get:
- operationId: get-v1-github-templates-id
- summary: Get Github Template
- description: Get github template text
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- text/plain:
- schema:
- type: string
- '400':
- $ref: '#/components/responses/MessageResponse'
- '404':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
- tags:
- - templates
- /v1/template/stats:
- get:
- operationId: get-v1-template-stats
- summary: Get Public Template Stats
- description: Get public template statistics
- parameters:
- - name: from
- in: query
- description: define result number to return from
- schema:
- type: integer
- - name: size
- in: query
- description: define number of results to return
- schema:
- type: integer
- - name: q
- in: query
- description: query string to match against all response value
- schema:
- type: string
- - name: fq
- in: query
- description: define specific field to query
- schema:
- type: string
- - name: fl
- in: query
- description: define specific field to return
- schema:
- type: string
- - name: sort_by
- in: query
- description: sort response value based on given key
- schema:
- type: string
- - name: sort_dir
- in: query
- description: sort direction for given key
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TemplateStats'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ format: date
+ in: query
+ name: start_date
+ description: start date from which you want to get history
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: end date till which you want to get history
+ - schema:
+ type: string
+ enum:
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ in: query
+ name: time_range
+ description: time range to get history
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - templates
- '/v1/scans/{scan_id}/error_log':
+ - X-API-Key: []
+ description: Get scan history detial by scanId
+ /v1/scans/{scan_id}/scan_log/export:
parameters:
- - name: scan_id
- in: path
- required: true
- schema:
- type: string
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
get:
- operationId: get-scans-id-elog
- summary: Get elogs of given scan id
- parameters:
- - name: host
- in: query
- description: target to search in log
- schema:
- type: string
- - name: template
- in: query
- description: template to search in log
- schema:
- type: string
- - name: matched
- in: query
- description: status to search in log
- schema:
- type: string
- - name: time
- in: query
- description: time to filter the logs
- schema:
- type: string
- format: date-time
- - name: search
- in: query
- description: 'string to search in error, target and template'
- schema:
- type: string
- - name: error
- in: query
- description: error to search in log
- schema:
- type: string
- - name: next_page_token
- in: query
- description: next page token
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Export scan log of given scan id
+ tags:
+ - scan_log
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
type: object
+ required:
+ - url
properties:
- logs:
- type: array
- items:
- $ref: '#/components/schemas/ScanLogResp'
- next_page_token:
+ url:
type: string
- required:
- - logs
- - next_page_token
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - elog
- '/v1/scans/{scan_id}/scan_log':
- parameters:
- - name: scan_id
- in: path
- required: true
- schema:
- type: string
- get:
- operationId: get-scans-id-scan-log
- summary: Get scan log of given scan id
- parameters:
- - name: host
- in: query
- description: target to search in log
- schema:
- type: string
- - name: template
- in: query
- description: template to search in log
- schema:
- type: string
- - name: matched
- in: query
- description: status to search in log
- schema:
- type: string
- - name: time
- in: query
- description: time to filter the logs
- schema:
- type: string
- format: date-time
- - name: search
- in: query
- description: 'string to search in error, target and template'
- schema:
- type: string
- - name: next_page_token
- in: query
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- description: OK
+ "201":
+ description: Created
content:
application/json:
schema:
type: object
properties:
- logs:
- type: array
- items:
- $ref: '#/components/schemas/ScanLogResp'
- next_page_token:
+ export_id:
type: string
required:
- - logs
- - next_page_token
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - scan_log
- '/v1/scans/vulns/{vuln_id}/ticket':
- parameters:
- - name: vuln_id
- in: path
- required: true
- schema:
- type: string
- post:
- operationId: post-vulns-id-ticket
- summary: Create vulns export to tracker
- description: Create vulns export to tracker
- parameters:
- - name: reporting_config_id
- in: query
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/VulnsTrackerExportResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '424':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ - export_id
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-scans-id-scan-log-export
security:
- - X-API-Key: []
- tags:
- - scans
- delete:
- operationId: delete-vulns-id-ticket
- summary: Delete vulns tracker association
- description: Delete vulns export tracker
+ - X-API-Key: []
parameters:
- - name: provider_name
- in: query
- schema:
- type: string
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: integer
+ format: int64
+ in: query
+ name: rescan_count
+ - schema:
+ type: string
+ in: query
+ name: host
+ description: target to search in log
+ - schema:
+ type: string
+ in: query
+ name: template
+ description: template to search in log
+ - schema:
+ type: string
+ in: query
+ name: matched
+ description: status to search in log
+ - schema:
+ type: string
+ format: date-time
+ in: query
+ name: time
+ description: time to filter the logs
+ - schema:
+ type: string
+ in: query
+ name: search
+ description: string to search in error, target and template
+ - schema:
+ type: string
+ in: query
+ name: error
+ description: error to search in log
+ - schema:
+ $ref: "#/components/schemas/LogExportFormat"
+ name: format
+ in: query
+ description: format of the log file
+ - schema:
+ type: boolean
+ in: query
+ name: async
+ - schema:
+ type: string
+ in: query
+ name: alert_email
+ - schema:
+ type: string
+ enum:
+ - error
+ - info
+ - all_logs
+ default: all_logs
+ x-go-type-name: ScanLogExportSeverityTypes
+ in: query
+ name: severity
+ /v1/scans/vulns/history:
+ get:
+ summary: Get scan log stats of given scan id
+ tags:
+ - history
+ - vuln
responses:
- '200':
+ "200":
description: OK
content:
application/json:
schema:
- type: object
- properties:
- ok:
- type: boolean
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '424':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/schemas/VulnerabilityHistoryDetail"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
- tags:
- - Scans
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-vulns-history
+ parameters:
+ - schema:
+ type: array
+ items:
+ type: string
+ in: query
+ name: vuln_hash
+ - schema:
+ type: integer
+ format: int64
+ default: 5
+ in: query
+ name: history_limit
+ required: false
+ description: Specifies the maximum number of revisions to be returned.
/v1/scans/config/exclude:
get:
- operationId: get-scans-config-exclude
summary: Get excluded templates
- description: Get excluded templates
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - configurations
responses:
- '200':
- $ref: '#/components/responses/ExcludedTemplateResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/ExcludedTemplateResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-scans-config-exclude
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
security:
- - X-API-Key: []
- tags:
- - configurations
+ - X-API-Key: []
+ description: Get excluded templates
post:
+ summary: Add excluded templates and targets
operationId: post-scans-config-exclude
- summary: Add excluded templates
- description: Add excluded templates
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/ExcludeConfigRequest'
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
+ $ref: "#/components/responses/ErrorResponse"
tags:
- - configurations
- delete:
- operationId: delete-scans-config-exclude
- summary: Delete excluded template ids
- description: Delete excluded template ids
+ - configurations
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
requestBody:
- $ref: '#/components/requestBodies/DeleteExcludedConfigRequest'
+ $ref: "#/components/requestBodies/ExcludeConfigRequest"
+ security:
+ - X-API-Key: []
+ description: Add excluded templates or targets
+ delete:
+ summary: Delete excluded templates or targets by ids
+ operationId: delete-scans-config-exclude
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- security:
- - X-API-Key: []
+ $ref: "#/components/responses/ErrorResponse"
tags:
- - configurations
- parameters: []
- /v1/scans/token:
- get:
- operationId: get-v1-scans-token
- summary: Get Scans Token
- description: Get user scan token usage details
+ - configurations
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetScansTokenResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '404':
- $ref: '#/components/responses/GetScanTokenErrorResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- tags:
- - scans
- '/v1/asset/{asset_id}':
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ requestBody:
+ $ref: "#/components/requestBodies/DeleteExcludedConfigRequest"
+ security:
+ - X-API-Key: []
+ description: Delete excluded templates or targets by ids
+ parameters: []
+ /v1/scans/{scan_id}/asset/export:
parameters:
- - name: asset_id
- in: path
- required: true
- schema:
- type: integer
- format: int64
+ - schema:
+ type: string
+ name: scan_id
+ in: path
+ required: true
get:
- operationId: get-v1-asset-id
- summary: Get enumerated asset details
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetAssetResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '404':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
+ summary: Export Scan Assets
tags:
- - assets
- delete:
- operationId: delete-v1-asset-asset_id
- summary: Delete enumerated asset
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - scans
responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - assets
- patch:
- operationId: patch-v1-asset-asset_id
- summary: Update asset details
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-scan-id-assets-export
+ security:
+ - X-API-Key: []
+ description: Export the list of all unique assets for a scan.
parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/UpdateEnumeratedAssetRequest'
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - assets
- '/v1/asset/enumerate/{enumerate_id}/stats':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ - schema:
type: string
- - name: time
in: query
- description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
+ name: search
+ description: Search with host or port
+ - schema:
+ type: string
in: query
- description: time filter start date
- schema:
+ name: format
+ description: supported format is csv, json, or raw (default json)
+ /v1/asset/enumerate/{enumerate_id}/domains/export:
+ parameters:
+ - schema:
+ type: string
+ name: enumerate_id
+ in: path
+ required: true
+ get:
+ summary: Export Enumeration Domains
+ tags:
+ - asset
+ responses:
+ "200":
+ description: OK
+ content:
+ application/octet-stream:
+ schema:
+ type: string
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-enumerate-enum-id-domains-export
+ security:
+ - X-API-Key: []
+ description: Export list of unique domains discovered in an enumeration.
+ parameters:
+ - schema:
type: string
- format: date
- - name: end_date
in: query
- description: time filter end date
- schema:
+ name: search
+ description: Search with domain name
+ - schema:
type: string
- format: date
+ in: query
+ name: format
+ description: supported format is csv, raw, or json (default json)
+ /v1/asset/{asset_id}/changelogs:
+ parameters:
+ - schema:
+ type: integer
+ format: int64
+ name: asset_id
+ in: path
+ required: true
get:
- operationId: get-v1-asset-enumerate-enumerate_id-stats
- summary: Get enumeration stats
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Get Asset Changelogs for a given asset_id
+ tags:
+ - assets
responses:
- '200':
- $ref: '#/components/responses/EnumerationStatsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ "200":
+ $ref: "#/components/responses/GetAssetChangelogsResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - enumerations
- /v1/asset/enumerate/stats:
- parameters:
- - name: time
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-assetId-changelogs
+ parameters:
+ - schema:
+ type: string
+ enum:
+ - last_day
+ - last_week
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ default: all_time
in: query
+ name: time
description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
+ - schema:
+ type: string
in: query
- description: time filter start date
- schema:
+ name: event_type
+ description: comma separated event_type e.g. event_type=vul_status,vul_status_change
+ - schema:
type: string
- format: date
- - name: end_date
in: query
- description: time filter end date
- schema:
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,severity
+ - schema:
type: string
- format: date
- get:
- operationId: get-v1-asset-enumerate-stats
- summary: Get all enumeration stats
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/EnumerationStatsResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}/config':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ in: query
+ name: sort_desc
+ description: comma separated descending sorting e.g sort_desc=created_at,severity
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: number of results to get
+ - schema:
+ type: integer
+ in: query
+ name: offset
+ description: number of results to skip
+ - schema:
type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ security:
+ - X-API-Key: []
+ description: Get asset changelogs
+ /v1/asset/enumerate/{enumerate_id}/config:
+ parameters:
+ - schema:
+ type: string
+ name: enumerate_id
+ in: path
+ required: true
get:
- operationId: get-v1-asset-enumerate-enumerate_id-config
summary: Get enumeration config
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ tags:
+ - enumerations
responses:
- '200':
+ "200":
description: Shared Response
content:
application/json:
schema:
- $ref: '#/components/schemas/EnumerationConfig'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
+ $ref: "#/components/schemas/EnumerationConfig"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - enumerations
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-enumerate-enumerate_id-config
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
patch:
- operationId: patch-v1-asset-enumerate-enumerate_id-config
summary: Update enumeration config
+ tags: []
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: patch-v1-asset-enumerate-enumerate_id-config
parameters:
- - name: update_type
- in: query
- description: default mode is append
- schema:
- type: string
- enum:
- - append
- - replace
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ - schema:
+ type: string
+ enum:
+ - append
+ - replace
+ in: query
+ name: update_type
+ description: default mode is append
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
requestBody:
description: Shared Request
content:
application/json:
schema:
- $ref: '#/components/schemas/EnumerationConfig'
- responses:
- '200':
- $ref: '#/components/responses/MessageResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags: []
- '/v1/asset/screenshot/{asset_id}':
+ $ref: "#/components/schemas/EnumerationConfig"
+ /v1/asset/enumerate/export:
parameters:
- - name: asset_id
- in: path
- required: true
- schema:
- type: string
+ - schema:
+ type: boolean
+ in: query
+ name: async
get:
- operationId: get-v1-asset-screenshot-asset_id
- summary: Get Asset Screenshot
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
+ summary: Export Enumeration of user
+ tags:
+ - enumerations
responses:
- '200':
+ "200":
description: OK
content:
- image/png:
+ application/octet-stream:
schema:
type: string
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - assets
- /v1/user/usage:
- get:
- operationId: get-v1-user-usage
- summary: Get API Services Usage
- parameters:
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- requestBody:
- $ref: '#/components/requestBodies/UsageRequest'
- responses:
- '200':
- $ref: '#/components/responses/UsageResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
- tags:
- - usage
- parameters: []
- /v1/asset/enumerate/filters:
- get:
- operationId: get-v1-asset-enumerate-filters
- summary: Group assets by filters
+ "201":
+ description: Created
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ export_id:
+ type: string
+ required:
+ - export_id
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-enumerate-export
parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: host
- in: query
- schema:
- type: string
- - name: port
- in: query
- schema:
- type: string
- - name: ip
- in: query
- schema:
- type: string
- - name: cname
- in: query
- schema:
- type: string
- - name: technologies
- in: query
- schema:
- type: string
- - name: status_code
- in: query
- schema:
- type: string
- - name: content_length
- in: query
- schema:
- type: string
- - name: domain
- in: query
- schema:
- type: array
- items:
- type: string
- - name: title
- in: query
- schema:
- type: string
- - name: webserver
- in: query
- schema:
- type: string
- - name: favicon
- in: query
- schema:
- type: string
- - name: group_by
- in: query
- description: 'Group by type. e.g. - host, port, favicon.'
- required: true
- schema:
- $ref: '#/components/schemas/EnumerateFilterTypes'
- - name: sort_asc
- in: query
- description: 'supported sort fields [count]'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'supported sort fields [count]'
- schema:
- type: string
- - name: time
- in: query
- description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
- in: query
- description: time filter start date
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: time filter end date
- schema:
- type: string
- format: date
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetEnumerateFiltersResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - enumerations
- '/v1/asset/enumerate/{enumerate_id}/filters':
- parameters:
- - name: enumerate_id
- in: path
- required: true
- schema:
+ - schema:
+ $ref: "#/components/schemas/EnumExportFormats"
+ in: query
+ name: format
+ - schema:
type: string
- get:
- operationId: get-v1-asset-enumerate-id-filters
- summary: Group assets by filters for an enumeration
- parameters:
- - name: offset
- in: query
- description: The number of items to skip before starting to collect the result set
- schema:
- type: integer
- - name: limit
- in: query
- description: The numbers of items to return
- schema:
- type: integer
- - name: host
- in: query
- schema:
- type: string
- - name: port
- in: query
- schema:
- type: string
- - name: ip
- in: query
- schema:
- type: string
- - name: cname
- in: query
- schema:
- type: string
- - name: technologies
- in: query
- schema:
- type: string
- - name: status_code
- in: query
- schema:
- type: string
- - name: content_length
- in: query
- schema:
- type: string
- - name: domain
- in: query
- schema:
- type: array
- items:
- type: string
- - name: title
- in: query
- schema:
- type: string
- - name: webserver
- in: query
- schema:
- type: string
- - name: favicon
- in: query
- schema:
- type: string
- - name: group_by
- in: query
- description: 'Group by type. e.g. - host, port, favicon.'
- required: true
- schema:
- $ref: '#/components/schemas/EnumerateFilterTypes'
- - name: sort_asc
- in: query
- description: 'supported sort fields [count]'
- schema:
- type: string
- - name: sort_desc
- in: query
- description: 'supported sort fields [count]'
- schema:
- type: string
- - name: time
- in: query
- description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
- in: query
- description: time filter start date
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: time filter end date
- schema:
- type: string
- format: date
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- $ref: '#/components/responses/GetEnumerateFiltersResponse'
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
- tags:
- - enumerations
- /v1/asset/enumerate/export:
- parameters:
- - name: async
+ name: search
in: query
- schema:
+ description: Search on the content name
+ - schema:
+ type: string
+ in: query
+ name: labels
+ description: Filter by comma separated labels, e.g-> labels=p1,p2
+ - schema:
type: boolean
- get:
- operationId: get-enumerate-export
- summary: Export Enumeration of user
- description: Export enumeration content
- parameters:
- - name: format
- in: query
- schema:
- $ref: '#/components/schemas/EnumExportFormats'
- - name: search
- in: query
- description: Search on the content name
- schema:
- type: string
- - name: labels
- in: query
- description: 'Filter by comma separated labels, e.g-> labels=p1,p2'
- schema:
- type: string
- - name: is_new
- in: query
- description: Filter by new content
- schema:
- type: boolean
- - name: host
- in: query
- description: 'Filter by comma separated labels, e.g-> host=p1,p2'
- schema:
- type: string
- - name: port
- in: query
- description: 'Filter by port separated labels, e.g-> port=p1,p2'
- schema:
- type: string
- - name: status_code
- in: query
- description: 'Filter by status code separated labels, e.g-> status_code=p1,p2'
- schema:
- type: string
- - name: title
- in: query
- description: 'Filter by title separated labels, e.g-> title=p1,p2'
- schema:
- type: string
- - name: content_length
- in: query
- description: 'Filter by content length separated labels, e.g-> content_length=p1,p2'
- schema:
- type: string
- - name: domain
- in: query
- description: 'Filter by domain names separated labels, e.g-> domain=domain1.com,domain2.com'
- schema:
- type: string
- - name: cname
- in: query
- description: cname to filter
- schema:
- type: string
- - name: technologies
- in: query
- description: technologies to filter
- schema:
- type: string
- - name: sort_asc
- in: query
- description: 'comma separated ascending sorting e.g sort_asc=created_at,name'
- schema:
- type: string
- - name: sort_desc
- in: query
- schema:
- type: string
- - name: time
- in: query
- description: time filter to select
- schema:
- default: all_time
- $ref: '#/components/schemas/TimeRangeQueryParameter'
- - name: start_date
- in: query
- description: time filter start date
- schema:
- type: string
- format: date
- - name: end_date
- in: query
- description: time filter end date
- schema:
- type: string
- format: date
- - name: X-Team-Id
- in: header
- description: 'Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team'
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- application/octet-stream:
- schema:
- type: string
- '201':
- description: Created
- content:
- application/json:
- schema:
- type: object
- properties:
- export_id:
- type: string
- required:
- - export_id
- '400':
- $ref: '#/components/responses/ErrorResponse'
- '401':
- $ref: '#/components/responses/ErrorResponse'
- '500':
- $ref: '#/components/responses/ErrorResponse'
- default:
- $ref: '#/components/responses/ErrorResponse'
+ in: query
+ name: is_new
+ description: Filter by new content
+ - schema:
+ type: string
+ in: query
+ name: host
+ description: Filter by comma separated labels, e.g-> host=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: port
+ description: Filter by port separated labels, e.g-> port=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: status_code
+ description: Filter by status code separated labels, e.g-> status_code=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: title
+ description: Filter by title separated labels, e.g-> title=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: content_length
+ description: Filter by content length separated labels, e.g-> content_length=p1,p2
+ - schema:
+ type: string
+ in: query
+ name: domain
+ description: Filter by domain names separated labels, e.g-> domain=domain1.com,domain2.com
+ - schema:
+ type: string
+ in: query
+ name: cname
+ description: cname to filter
+ - schema:
+ type: string
+ in: query
+ name: technologies
+ description: technologies to filter
+ - schema:
+ type: string
+ in: query
+ name: sort_asc
+ description: comma separated ascending sorting e.g sort_asc=created_at,name
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ - schema:
+ $ref: "#/components/schemas/TimeRangeQueryParameter"
+ default: all_time
+ in: query
+ name: time
+ description: time filter to select
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
+ type: string
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ - schema:
+ type: string
+ in: query
+ name: custom_filter
+ description: custom query to filter. double encode the query string.
+ - schema:
+ type: boolean
+ in: query
+ name: is_screenshot
+ - schema:
+ type: string
+ in: query
+ name: ip
+ description: ips to filter
+ - schema:
+ type: string
+ in: query
+ name: favicon
+ description: Filter by comma separated favicons, e.g-> favicon=p1,p2
+ - schema:
+ type: boolean
+ in: query
+ name: only_dns
+ description: Query only dns FQDN records
+ - schema:
+ type: boolean
+ in: query
+ name: only_ip
+ description: Query only dns IP records
security:
- - X-API-Key: []
- tags:
- - enumerations
+ - X-API-Key: []
+ description: Export enumeration content
/v1/user/tunnels:
get:
- operationId: get-v1-user-tunnels
summary: Get Tunnels List
+ tags:
+ - users
responses:
- '200':
- $ref: '#/components/responses/GetUserTunnelResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '404':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/GetUserTunnelResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
default:
- $ref: '#/components/responses/MessageResponse'
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-user-tunnels
security:
- - X-API-Key: []
- tags:
- - users
+ - X-API-Key: []
parameters: []
- /v1/asset/exposures/metrics:
+ patch:
+ summary: Rename Tunnel
+ tags: []
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: patch-v1-user-tunnels
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - name
+ - id
+ properties:
+ name:
+ type: string
+ id:
+ type: string
+ /v1/scans/config/severity:
get:
- operationId: get-v1-asset-exposures-metrics
- summary: Get exposure metrics
+ summary: Get custom severity mappings
+ tags:
+ - configurations
+ responses:
+ "200":
+ $ref: "#/components/responses/GetSeverityConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-scans-config-severity
parameters:
- - name: interval
- in: query
- description: The time interval for the metrics
- required: false
- schema:
- type: string
- default: monthly
- enum:
- - monthly
+ - schema:
+ type: string
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ post:
+ summary: Add custom severity mapping
+ tags:
+ - configurations
responses:
- '200':
- $ref: '#/components/responses/ExposureMetricsResponse'
- '400':
- $ref: '#/components/responses/MessageResponse'
- '401':
- $ref: '#/components/responses/MessageResponse'
- '404':
- $ref: '#/components/responses/MessageResponse'
- '500':
- $ref: '#/components/responses/MessageResponse'
+ "200":
+ $ref: "#/components/responses/PostSeverityConfigResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
default:
- $ref: '#/components/responses/MessageResponse'
- security:
- - X-API-Key: []
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: post-v1-scans-config-severity
+ parameters:
+ - schema:
+ type: string
+ in: header
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ name: X-Team-Id
+ requestBody:
+ $ref: "#/components/requestBodies/AddCustomSeverityMappingRequest"
+ delete:
+ summary: Delete custom severity mapping
tags:
- - asset
-components:
- parameters:
- template_id:
- name: template_id
- in: query
- schema:
- type: string
- description: short uuid of requested template
- required: true
- user_name:
- name: user_name
- in: query
- required: true
- schema:
- type: string
- description: user name of logged in user
- schemas:
- EnumExportFormats:
- type: string
- enum:
- - raw
- - json
- - csv
- title: EnumExportFormats
- TimeRangeQueryParameter:
- type: string
- enum:
- - last_day
- - last_week
- - last_month
- - last_3_months
- - last_6_months
- - last_12_months
- - all_time
- title: TimeRangeQueryParameter
- EnumerateFilterTypes:
- type: string
- enum:
- - host
- - port
- - ip
- - cname
- - technologies
- - status_code
- - content_length
- - title
- - webserver
- - favicon
- - domain
- title: EnumerateFilterTypes
- EnumerateFiltersItem:
- type: object
- properties:
- value:
- type: string
- port:
- type: integer
- technologies:
- type: integer
- categories:
- type: array
- items:
- type: string
- description:
- type: string
- website:
- type: string
- cpe:
+ - configurations
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: delete-v1-scans-config-severity
+ parameters:
+ - schema:
type: string
- icon:
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ requestBody:
+ $ref: "#/components/requestBodies/DeleteCustomSeverityMappingRequest"
+ /v1/scans/config/{config_id}/severity:
+ parameters:
+ - schema:
+ type: integer
+ format: int64
+ name: config_id
+ in: path
+ required: true
+ patch:
+ summary: Modify custom severity mapping
+ tags:
+ - configurations
+ responses:
+ "200":
+ $ref: "#/components/responses/MessageResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: patch-v1-scans-config-config_id-severity
+ parameters:
+ - schema:
type: string
- favicon_body:
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ requestBody:
+ $ref: "#/components/requestBodies/AddCustomSeverityMappingRequest"
+ /v1/leaks/domain:
+ get:
+ summary: Your GET endpoint
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/LeaksEntity"
+ total_leaks:
+ type: number
+ filtered:
+ type: boolean
+ search_query:
+ type: string
+ total_pages:
+ type: number
+ current_page:
+ type: number
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-leaks-domain
+ parameters:
+ - schema:
type: string
- count:
- type: integer
- required:
- - value
- - count
- title: EnumerateFiltersItem
- VulnerabilityResults:
- type: object
- properties:
- matcher_status:
- type: boolean
- vuln_id:
+ in: query
+ name: search
+ description: Search query to filter results across all fields
+ - schema:
+ type: number
+ in: query
+ name: limit
+ description: Number of results per page for pagination
+ - schema:
+ type: number
+ in: query
+ name: page_number
+ description: Page number for pagination (starts from 1)
+ - schema:
type: string
- target:
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
type: string
- template_url:
+ default: all_time
+ enum:
+ - all_time
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ in: query
+ name: time_range
+ - schema:
type: string
- created_at:
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
type: string
- updated_at:
+ enum:
+ - url
+ - username
+ - log_date
+ - country
+ - device_ip
+ - host_username
+ - hostname
+ - os
+ - source
+ - hardware_id
+ - malware_path
+ in: query
+ name: sort_by
+ description: supported sort fields
+ - schema:
type: string
- scan_id:
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ description: supported sort order (asc or desc)
+ - schema:
type: string
- event:
- type: array
- items:
- $ref: '#/components/schemas/VulnerabilityEvent'
- template_id:
+ enum:
+ - fixed
+ - unfixed
+ in: query
+ name: status
+ description: supported status (fixed or unfixed)
+ /v1/leaks/email:
+ get:
+ summary: Your GET endpoint
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/LeaksEntity"
+ total_leaks:
+ type: number
+ total_pages:
+ type: number
+ current_page:
+ type: number
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-leaks-email
+ parameters:
+ - schema:
type: string
- template_path:
+ in: query
+ name: search
+ description: Search query to filter results across all fields
+ - schema:
+ type: number
+ in: query
+ name: limit
+ description: Number of results per page for pagination
+ - schema:
+ type: number
+ in: query
+ name: page_number
+ description: Page number for pagination (starts from 1)
+ - schema:
type: string
- template_encoded:
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
type: string
- result_type:
+ default: all_time
+ enum:
+ - all_time
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ in: query
+ name: time_range
+ - schema:
type: string
- vuln_status:
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
type: string
- vuln_hash:
+ enum:
+ - url
+ - username
+ - log_date
+ - country
+ - device_ip
+ - host_username
+ - hostname
+ - os
+ - source
+ - hardware_id
+ - malware_path
+ in: query
+ name: sort_by
+ description: supported sort fields
+ - schema:
type: string
- labels:
- type: array
- items:
- type: string
- required:
- - matcher_status
- - vuln_id
- - target
- - created_at
- - scan_id
- - event
- - template_id
- - result_type
- - vuln_hash
- PrivateTemplates:
- type: object
- properties:
- name:
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ description: supported sort order (asc or desc)
+ - schema:
type: string
- contents:
+ enum:
+ - fixed
+ - unfixed
+ in: query
+ name: status
+ description: supported status (fixed or unfixed)
+ /v1/leaks/domain/customers:
+ get:
+ summary: Your GET endpoint
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/LeaksEntity"
+ total_leaks:
+ type: number
+ total_pages:
+ type: number
+ current_page:
+ type: number
+ "400":
+ $ref: "#/components/responses/MessageResponse"
+ "401":
+ $ref: "#/components/responses/MessageResponse"
+ "403":
+ $ref: "#/components/responses/MessageResponse"
+ "404":
+ $ref: "#/components/responses/MessageResponse"
+ "500":
+ $ref: "#/components/responses/MessageResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-leaks-domain-customers
+ parameters:
+ - schema:
type: string
- required:
- - name
- - contents
- title: PrivateTemplates
- AssetListItem:
- type: object
- properties:
- asset_count:
+ in: query
+ name: search
+ description: Search query to filter results across all fields
+ - schema:
type: integer
- asset_id:
- type: string
- uploaded_at:
- type: string
- name:
- type: string
- required:
- - asset_count
- - asset_id
- - uploaded_at
- - name
- title: AssetListItem
- ScanSchedule:
- type: object
- properties:
- scan_frequency:
+ in: query
+ name: limit
+ description: Number of results per page for pagination
+ - schema:
+ type: integer
+ in: query
+ name: page_number
+ description: Page number for pagination (starts from 1)
+ - schema:
type: string
- scan_id:
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
type: string
- schedule_last_run:
+ default: all_time
+ enum:
+ - all_time
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ in: query
+ name: time_range
+ - schema:
type: string
- schedule_next_run:
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
type: string
- start_time:
+ enum:
+ - url
+ - username
+ - log_date
+ - country
+ - device_ip
+ - host_username
+ - hostname
+ - os
+ - source
+ - hardware_id
+ - malware_path
+ in: query
+ name: sort_by
+ description: supported sort fields
+ - schema:
type: string
- format: time
- hourly_frequency:
- type: integer
- custom_weekdays:
- description: |-
- Array of integer denoting the weekdays on which the scan is supposed to run.
- 0-6 denoting Sunday-Saturday.
- type: array
- items:
- type: integer
- minimum: 0
- maximum: 6
- required:
- - scan_frequency
- - scan_id
- - schedule_last_run
- - schedule_next_run
- title: ScanSchedule
- ScanStatusItem:
- type: object
- properties:
- scan_id:
+ enum:
+ - asc
+ - desc
+ in: query
+ name: sort_order
+ description: supported sort order (asc or desc)
+ - schema:
type: string
- status:
- type: string
- scan_time_elapsed:
- type: string
- progress:
+ enum:
+ - fixed
+ - unfixed
+ in: query
+ name: status
+ description: supported status (fixed or unfixed)
+ /v1/asset/enumerate/{enumerate_id}/history:
+ parameters:
+ - schema:
+ type: string
+ name: enumerate_id
+ in: path
+ required: true
+ get:
+ summary: Get Enumeration History
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_pages:
+ type: integer
+ total_results:
+ type: integer
+ total_enumeration:
+ type: integer
+ format: int64
+ total_unique_enumeration:
+ type: integer
+ format: int64
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationHistoryDataResponse"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v1-asset-enumerate-enumerate_id-history
+ parameters:
+ - schema:
type: integer
- failure_reason:
+ in: query
+ name: offset
+ description: The number of items to skip before starting to collect the result set
+ - schema:
+ type: integer
+ in: query
+ name: limit
+ description: The numbers of items to return
+ - schema:
type: string
- created_at:
+ format: date
+ in: query
+ name: start_date
+ description: time filter start date
+ - schema:
type: string
- updated_at:
+ default: all_time
+ enum:
+ - all_time
+ - current_month
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ in: query
+ name: time_range
+ - schema:
type: string
- total_target:
- type: integer
- completed_at:
+ format: date
+ in: query
+ name: end_date
+ description: time filter end date
+ - schema:
type: string
- total_scan:
+ in: header
+ name: X-Team-Id
+ description: "Retrieve the Team ID from: https://cloud.projectdiscovery.io/settings/team"
+ description: Get asset enumeration history data
+ /v2/vulnerability/search:
+ get:
+ summary: Full Text Search
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ count:
+ type: integer
+ facets:
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/Facets"
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/Vulnerability"
+ total:
+ type: integer
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "401":
+ $ref: "#/components/responses/ErrorResponse"
+ "403":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v2-vulnerability-search
+ description: Full text search on vulnerabilities
+ parameters:
+ - schema:
type: integer
- total_template:
+ in: query
+ name: limit
+ description: The numbers of items to return
+ - schema:
type: integer
- name:
+ in: query
+ name: offset
+ description: The numbers of items to skip
+ - schema:
type: string
- severity:
- type: object
- is_oss:
- type: boolean
- is_cloud:
- type: boolean
- asset_ids:
- type: array
- items:
- type: string
- is_rescan:
- type: boolean
- public_templates:
- type: array
- items:
- type: string
- report_config_ids:
- type: array
+ in: query
+ name: sort_asc
+ description: Sort results in ascending order (CSV field names)
+ - schema:
+ type: string
+ in: query
+ name: sort_desc
+ description: Sort results in descending order (CSV field names)
+ - schema:
items:
type: string
- rescan_count:
- type: integer
- scan_config_ids:
type: array
+ in: query
+ name: fields
+ description: List of fields to return(comma separated)
+ - schema:
items:
type: string
- template_ids:
type: array
+ in: query
+ name: term_facets
+ description: List of fields to return(comma separated)
+ - schema:
items:
type: string
- template_urls:
type: array
- items:
- type: string
- schedule:
- $ref: '#/components/schemas/ScanSchedule'
- total_result:
+ in: query
+ name: range_facets
+ description: List of fields to return(comma separated)
+ - schema:
+ type: string
+ in: query
+ name: q
+ description: query
+ - schema:
+ type: boolean
+ in: query
+ name: highlight
+ description: Whether to highlight the search results
+ - schema:
+ type: integer
+ in: query
+ name: facet_size
+ description: Number of facets to return
+ parameters: []
+ /v2/vulnerability/{id}:
+ parameters:
+ - schema:
+ type: string
+ name: id
+ in: path
+ required: true
+ get:
+ summary: Get Vulnerability by ID
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ $ref: "#/components/schemas/Vulnerability"
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-vulnerability-by-id
+ description: Get Vulnerability by ID
+ parameters:
+ - schema:
+ type: string
+ in: query
+ name: fields
+ description: "template data fields "
+ /v2/vulnerability/filters:
+ get:
+ summary: Get All Filters for Vulnerabilities
+ tags: []
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: object
+ required:
+ - can_sort
+ - data_type
+ - description
+ - examples
+ - facet_possible
+ - field
+ - search_analyzer
+ - enum_values
+ properties:
+ can_sort:
+ type: boolean
+ description: Indicates if sorting is possible by this field.
+ data_type:
+ type: string
+ description: The data type of the filter field (e.g., string, number, datetime).
+ description:
+ type: string
+ description: A human-readable description of the filter field.
+ examples:
+ type: array
+ description: Example usage of the filter.
+ items:
+ type: string
+ facet_possible:
+ type: boolean
+ description: Indicates if faceting is possible for this field.
+ field:
+ type: string
+ description: The name of the filter field.
+ search_analyzer:
+ type: string
+ description: The search analyzer used for this field.
+ enum_values:
+ description: The possible values for this field.
+ items:
+ type: string
+ type: array
+ "400":
+ $ref: "#/components/responses/ErrorResponse"
+ "404":
+ $ref: "#/components/responses/ErrorResponse"
+ "500":
+ $ref: "#/components/responses/ErrorResponse"
+ default:
+ $ref: "#/components/responses/ErrorResponse"
+ operationId: get-v2-vulnerability-filters
+ description: Get all filters for vulnerabilities
+ parameters: []
+components:
+ schemas:
+ AssetCategory:
+ title: AssetCategory
+ type: object
+ required:
+ - name
+ - total_assets
+ - technologies
+ properties:
+ name:
+ type: string
+ total_assets:
type: integer
+ technologies:
+ type: object
+ additionalProperties:
+ type: integer
+ DomainVerificationRequest:
+ title: DomainVerificationRequest
+ type: object
required:
- - scan_id
- - status
- - scan_time_elapsed
- - progress
- - failure_reason
- - created_at
- - updated_at
- - total_target
- - completed_at
- - total_scan
- - total_template
- - name
- - is_oss
- - is_cloud
- - total_result
- title: ScanStatusItem
- JiraVerifyContentItemIssueType:
+ - domain
+ - status
+ - created_at
+ - expires_at
+ - verification_attempts
+ properties:
+ domain:
+ type: string
+ description: The domain being verified
+ status:
+ type: string
+ enum:
+ - pending
+ - verified
+ - expired
+ description: Current verification status
+ verification_string:
+ type: string
+ description: TXT record value to add to DNS (only present for pending requests)
+ created_at:
+ type: string
+ format: date-time
+ description: When the verification request was created
+ expires_at:
+ type: string
+ format: date-time
+ description: When the verification request expires
+ verification_attempts:
+ type: integer
+ description: Number of verification attempts made
+ last_attempt_at:
+ type: string
+ format: date-time
+ description: When the last verification attempt was made
+ VerifyConfigContentsRequestProvider:
+ title: VerifyConfigContentsRequestProvider
+ type: string
+ enum:
+ - jira
+ - linear
+ OAuthStatus:
+ title: OAuthStatus
+ type: string
+ enum:
+ - not_connected
+ - pending
+ - success
+ OAuthMetadata:
+ title: OAuthMetadata
+ type: object
+ properties:
+ installation_url:
+ type: string
+ required:
+ - installation_url
+ LogExportFormat:
+ title: LogExportFormat
+ type: string
+ enum:
+ - raw
+ - json
+ - csv
+ EnumExportFormats:
+ title: EnumExportFormats
+ type: string
+ enum:
+ - raw
+ - json
+ - csv
+ TimeRangeQueryParameter:
+ title: TimeRangeQueryParameter
+ type: string
+ enum:
+ - last_day
+ - last_week
+ - last_month
+ - last_3_months
+ - last_6_months
+ - last_12_months
+ - all_time
+ EnumerateFilterTypes:
+ title: EnumerateFilterTypes
+ type: string
+ enum:
+ - host
+ - port
+ - ip
+ - cname
+ - technologies
+ - status_code
+ - content_length
+ - title
+ - webserver
+ - favicon
+ - domain
+ - labels
+ ExcludeConfigRequestType:
+ title: ExcludeConfigRequestType
+ type: string
+ enum:
+ - scan_target
+ - template
+ - enumeration_target
+ AssetChangelogs:
type: object
+ required:
+ - id
+ - enumeration_id
+ - name
+ - created_at
+ - updated_at
properties:
id:
+ type: integer
+ format: int64
+ enumeration_id:
type: string
name:
type: string
- statuses:
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ status_code:
+ type: integer
+ technologies:
type: array
items:
type: string
- required:
- - id
- - name
- title: JiraVerifyContentItemIssueType
- JiraVerifyContentItem:
- type: object
- properties:
- project_id:
+ webserver:
type: string
- project_name:
+ request:
type: string
- issue_types:
+ response:
+ type: string
+ cname:
type: array
items:
- type: object
- $ref: '#/components/schemas/JiraVerifyContentItemIssueType'
- required:
- - project_id
- - project_name
- - issue_types
- title: JiraVerifyContentItem
- VulnerabilityEvent:
- type: object
- properties:
- curl-command:
- type: string
- extracted-results:
+ type: string
+ labels:
type: array
items:
type: string
- extractor-name:
+ ip:
+ type: string
+ content_length:
+ type: integer
+ title:
type: string
host:
type: string
- info:
- type: object
- properties:
- classification:
- type: object
- properties:
- cpe:
- type: string
- cve-id:
- type: array
- items:
- type: string
- cvss-metrics:
- type: string
- cvss-score:
- type: number
- cwe-id:
- type: array
- items:
- type: string
- epss-percentile:
- type: number
- epss-score:
- type: number
- metadata:
- type: object
- author:
- type: array
- items:
- type: string
- description:
- type: string
- impact:
- type: string
- name:
- type: string
- tags:
- type: array
- items:
- type: string
- reference:
- type: array
- items:
- type: string
- remediation:
- type: string
- severity:
- type: string
- required:
- - name
- ip:
+ port:
+ type: integer
+ technology_details:
type: string
- matched-at:
+ format: json
+ is_new:
+ type: boolean
+ body:
type: string
- matched-line:
+ change_event:
type: array
items:
- type: integer
- matcher-name:
- type: string
- matcher-status:
- type: boolean
- path:
- type: string
- request:
- type: string
- response:
- type: string
- template-id:
- type: string
- template-path:
- type: string
- timestamp:
- type: string
- type:
- type: string
- issue_trackers:
- type: object
- properties:
- jira:
- $ref: '#/components/schemas/VulnIssueTrackerItem'
- github:
- $ref: '#/components/schemas/VulnIssueTrackerItem'
- gitlab:
- $ref: '#/components/schemas/VulnIssueTrackerItem'
- linear:
- $ref: '#/components/schemas/VulnIssueTrackerItem'
- title: VulnerabilityEvent
- FiltersItem:
+ $ref: "#/components/schemas/VulnerabilityChangelogsEvent"
+ EnumerateFiltersItem:
+ title: EnumerateFiltersItem
type: object
properties:
+ labels:
+ type: string
value:
type: string
- name:
+ port:
+ type: integer
+ technologies:
+ type: integer
+ categories:
+ type: array
+ items:
+ type: string
+ description:
type: string
- severity:
+ website:
type: string
- count:
- type: integer
- required:
- - value
- - count
- title: FilterItem
- UserWorkspaces:
- type: object
- properties:
- name:
+ cpe:
type: string
- team_id:
+ icon:
type: string
- active:
- type: boolean
- plan:
+ favicon_body:
type: string
- member_count:
- type: integer
- required:
- - name
- - team_id
- - active
- - plan
- - member_count
- title: UserWorkspaces
- ScanStats:
- type: object
- properties:
- cves:
- type: integer
- matched:
- type: integer
- not_matched:
- type: integer
- severity:
- type: object
- total_count:
- type: integer
- total_scan:
- type: integer
- total_target:
- type: integer
- total_template:
+ count:
type: integer
- vuln_status:
- type: object
required:
- - cves
- - matched
- - not_matched
- - total_count
- - total_scan
- - total_target
- - total_template
- title: ScanStats
- VulnerabilityResultsOld:
+ - value
+ - count
+ VulnerabilityResults:
type: object
properties:
- scan_id:
+ matcher_status:
+ type: boolean
+ vuln_id:
type: string
target:
type: string
- template_encoded:
- type: string
template_url:
type: string
- template_path:
- type: string
- template_id:
- type: string
- vuln_id:
- type: string
- matcher_status:
- type: boolean
created_at:
type: string
updated_at:
type: string
+ scan_id:
+ type: string
event:
- $ref: '#/components/schemas/VulnerabilityEvent'
- id:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnerabilityEvent"
+ template_id:
+ type: string
+ template_path:
+ type: string
+ template_encoded:
+ type: string
+ result_type:
type: string
vuln_status:
type: string
vuln_hash:
type: string
+ is_regression:
+ type: boolean
+ labels:
+ type: array
+ items:
+ type: string
+ port:
+ type: integer
+ asset_metadata:
+ type: object
+ $ref: "#/components/schemas/EnumerationContent"
required:
- - scan_id
- - target
- - template_id
- - vuln_id
- - matcher_status
- - created_at
- - event
- title: VulnerabilityResultsOld
- templateListItem:
+ - matcher_status
+ - vuln_id
+ - target
+ - created_at
+ - scan_id
+ - event
+ - template_id
+ - result_type
+ - vuln_hash
+ VulnerabilityChangelogs:
+ title: VulnerabilityChangelogs
type: object
properties:
- created_at:
+ matcher_status:
+ type: boolean
+ vuln_id:
type: string
- id:
+ target:
type: string
- name:
+ template_url:
+ type: string
+ created_at:
type: string
- shared_publicly:
- type: boolean
updated_at:
type: string
- required:
- - created_at
- - id
- - name
- title: templateListItem
- ExportListItem:
- description: Export List Item
- type: object
- properties:
- id:
+ scan_id:
type: string
- name:
+ event:
+ type: object
+ $ref: "#/components/schemas/VulnerabilityEvent"
+ change_event:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnerabilityChangelogsEvent"
+ template_id:
type: string
- export_status:
+ template_path:
type: string
- item_type:
+ template_encoded:
type: string
- download_signed_url:
+ result_type:
type: string
- created_at:
+ vuln_status:
type: string
- format: date-time
+ vuln_hash:
+ type: string
+ labels:
+ type: array
+ items:
+ type: string
required:
- - id
- - name
- - export_status
- - item_type
- - created_at
- title: ExportListItem
- UserAuditLogItems:
+ - matcher_status
+ - vuln_id
+ - target
+ - created_at
+ - scan_id
+ - event
+ - template_id
+ - result_type
+ - vuln_hash
+ PrivateTemplates:
+ title: PrivateTemplates
type: object
properties:
- created_at:
- type: string
- email:
- type: string
- action:
- type: string
- status:
- type: integer
- method:
+ name:
type: string
- ip:
+ contents:
type: string
required:
- - created_at
- - email
- - action
- - status
- - method
- - ip
- title: UserAuditLogItems
- PublicTemplateListItem:
+ - name
+ - contents
+ AssetListItem:
+ title: AssetListItem
type: object
properties:
- id:
+ asset_count:
+ type: integer
+ asset_id:
type: string
- templateURL:
+ uploaded_at:
type: string
name:
type: string
required:
- - id
- - templateURL
- - name
- title: PublicTemplateListItem
- EarlyTemplateListItem:
- type: object
- properties:
- id:
- type: string
- templateURL:
- type: string
- name:
- type: string
- required:
- - id
- - templateURL
- - name
- title: EarlyTemplateListItem
- TeamMemberItem:
+ - asset_count
+ - asset_id
+ - uploaded_at
+ - name
+ ScanSchedule:
+ title: ScanSchedule
type: object
+ required:
+ - scan_frequency
+ - scan_id
+ - schedule_last_run
+ - schedule_next_run
properties:
- email:
- type: string
- status:
+ scan_frequency:
type: string
- role:
+ scan_id:
type: string
- invited_at:
+ schedule_last_run:
type: string
- accepted_at:
+ schedule_next_run:
type: string
- profile_image:
+ start_time:
type: string
- required:
- - email
- - status
- - role
- title: TeamMemberItem
- WorkspaceItem:
+ format: time
+ hourly_frequency:
+ type: integer
+ custom_weekdays:
+ type: array
+ description: |-
+ Array of integer denoting the weekdays on which the scan is supposed to run.
+ 0-6 denoting Sunday-Saturday.
+ items:
+ type: integer
+ minimum: 0
+ maximum: 6
+ ScanAssetListItem:
+ title: ScanAssetListItem
type: object
+ required:
+ - host
+ - scanned_on
properties:
- id:
- type: string
- name:
- type: string
- created_at:
+ host:
type: string
- member_count:
+ port:
type: integer
- owner_email:
+ scanned_on:
type: string
- required:
- - id
- - name
- - created_at
- - member_count
- - owner_email
- title: TeamMemberItem
- ScanUsageStatsResponse:
- description: 'Scan Usage Stats '
+ format: date-time
+ ScanAssetListItemOptional:
+ title: ScanAssetListItem
type: object
+ required:
+ - host
+ - scanned_on
properties:
- time:
- type: string
- format: date-time
- scan_id:
+ host:
type: string
- user_id:
- type: integer
- format: int64
- completed_request:
- type: integer
- format: int64
- total_target:
- type: integer
- format: int64
- total_templates:
- type: integer
- format: int64
- total_result:
+ port:
type: integer
- format: int64
- severity_breakdown:
+ scanned_on:
type: string
- format: json
- required:
- - time
- - scan_id
- - user_id
- - completed_request
- - total_target
- - total_templates
- - total_result
- - severity_breakdown
- title: ScanUsageStatsResponse
- VulnStatusEnum:
- enum:
- - open
- - false_positive
- - fixed
- - duplicate
- - fix_in_progress
- - accepted_risk
- title: VulnStatusEnum
- ConfigResponse:
+ format: date-time
+ EnumerationDomainListItem:
+ title: EnumerationDomainListItem
type: object
+ required:
+ - domain
+ - enumerated_on
properties:
- id:
- type: string
- config:
- type: string
- config_type:
- $ref: '#/components/schemas/ConfigTypeEnum'
- name:
- type: string
- read_only:
- type: boolean
- global:
- type: boolean
- provider_name:
- type: string
- created_at:
+ domain:
type: string
- format: date-time
- updated_at:
+ enumerated_on:
type: string
format: date-time
- required:
- - id
- - config
- - config_type
- - name
- - created_at
- - updated_at
- title: ConfigResponse
- ConfigTypeEnum:
- type: string
- enum:
- - scan
- - reporting
- - template
- - alerting
- - cloudlist
- title: ConfigTypeEnum
- EnumerationStats:
+ ScanStatusItem:
+ title: ScanStatusItem
type: object
- properties:
- hosts:
- type: integer
- format: int64
- http:
- type: integer
- format: int64
- endpoints:
- type: integer
- format: int64
- ports:
- type: integer
- format: int64
- total_assets:
- type: integer
- format: int64
required:
- - hosts
- - http
- - endpoints
- - ports
- - total_assets
- title: EnumerationStats
- EnumerateData:
- type: object
+ - scan_id
+ - status
+ - scan_time_elapsed
+ - progress
+ - failure_reason
+ - created_at
+ - updated_at
+ - total_target
+ - completed_at
+ - total_scan
+ - total_template
+ - name
+ - is_oss
+ - is_cloud
+ - total_result
properties:
- id:
- type: string
- name:
+ scan_id:
type: string
status:
type: string
- failure_reason:
- type: string
- completed_at:
- type: string
- format: date-time
- enumeration_time:
+ scan_time_elapsed:
type: string
- format: duration
- enumeration_type:
+ progress:
+ type: integer
+ failure_reason:
type: string
- enumeration_stats:
- $ref: '#/components/schemas/EnumerationStats'
created_at:
type: string
- format: date-time
updated_at:
type: string
- format: date-time
- root_domains:
+ total_target:
+ type: integer
+ completed_at:
+ type: string
+ total_scan:
+ type: integer
+ total_template:
+ type: integer
+ name:
+ type: string
+ severity:
+ type: object
+ is_oss:
+ type: boolean
+ is_cloud:
+ type: boolean
+ asset_ids:
type: array
items:
type: string
- enrichment_hosts_count:
- type: integer
is_rescan:
type: boolean
- rescan_count:
- type: integer
- cloudlist_config_ids:
+ public_templates:
type: array
items:
type: string
- cloudlist_provider_name:
- type: string
- enumeration_time_elapsed:
- type: string
- total_assets:
- type: integer
- format: int64
- new_assets:
- type: integer
- format: int64
- domain_names:
+ report_config_ids:
type: array
items:
type: string
- schedule:
- $ref: '#/components/schemas/EnumerationSchedule'
- required:
- - id
- - name
- - status
- - created_at
- title: EnumerateData
- EnumerationContent:
- type: object
- properties:
- enumeration_id:
- type: string
- name:
- type: string
- created_at:
- type: string
- updated_at:
- type: string
- id:
+ rescan_count:
type: integer
- format: int64
- labels:
+ scan_config_ids:
type: array
items:
type: string
- cname:
+ template_ids:
type: array
items:
type: string
- host:
- type: string
- port:
- type: integer
- ip:
+ template_urls:
type: array
items:
type: string
- status_code:
- type: integer
- content_length:
+ schedule:
+ $ref: "#/components/schemas/ScanSchedule"
+ total_result:
type: integer
- title:
+ is_automatic:
+ type: boolean
+ JiraVerifyContentItemIssueType:
+ title: JiraVerifyContentItemIssueType
+ type: object
+ properties:
+ id:
type: string
- technologies:
+ name:
+ type: string
+ statuses:
type: array
items:
type: string
- webserver:
+ required:
+ - id
+ - name
+ JiraVerifyContentItem:
+ title: JiraVerifyContentItem
+ type: object
+ properties:
+ project_id:
type: string
- method:
+ project_name:
type: string
- source:
+ issue_types:
+ type: array
+ items:
+ type: object
+ $ref: "#/components/schemas/JiraVerifyContentItemIssueType"
+ required:
+ - project_id
+ - project_name
+ - issue_types
+ LinearVerifyContentItemOpenState:
+ title: LinearVerifyContentItemOpenState
+ type: object
+ properties:
+ id:
type: string
- is_new:
- type: boolean
- type:
+ name:
type: string
- asset_hash:
+ required:
+ - id
+ - name
+ LinearVerifyContentItem:
+ title: LinearVerifyContentItem
+ type: object
+ properties:
+ team_id:
type: string
- technology_details:
- type: object
- additionalProperties:
- $ref: '#/components/schemas/EnumerationContentTechnologyDetails'
- screenshot_path:
- type: string
- favicon:
- type: string
- favicon_body:
- type: string
- cdn_name:
+ team_name:
type: string
- chain_status_codes:
+ open_states:
type: array
items:
- type: string
- domain_name:
- type: string
- redirect_location:
- type: string
+ type: object
+ $ref: "#/components/schemas/LinearVerifyContentItemOpenState"
required:
- - enumeration_id
- - name
- - created_at
- - id
- - is_new
- title: EnumerationContent
- EnumerationContentTechnologyDetails:
+ - team_id
+ - team_name
+ - open_states
+ VulnerabilityChangelogsEvent:
+ title: VulnerabilityChangelogsEvent
type: object
properties:
- description:
- type: string
- website:
- type: string
- icon:
+ name:
+ description: The name of the event
type: string
- categories:
- type: array
- items:
- type: string
- title: EnumerationContentTechnologyDetails
- EnumerationIds:
+ from:
+ description: The from value of the event
+ to:
+ description: The to value of the event
+ VulnerabilityEvent:
+ title: VulnerabilityEvent
type: object
properties:
- id:
+ curl-command:
type: string
- type:
+ extracted-results:
type: array
items:
type: string
- required:
- - id
- - type
- title: EnumerationIds
- EnumerationSchedule:
- type: object
- properties:
- enumeration_id:
- type: string
- scan_frequency:
+ extractor-name:
type: string
- schedule_last_run:
+ host:
type: string
- schedule_next_run:
+ info:
+ type: object
+ required:
+ - name
+ properties:
+ classification:
+ type: object
+ properties:
+ cpe:
+ type: string
+ cve-id:
+ type: array
+ items:
+ type: string
+ cvss-metrics:
+ type: string
+ cvss-score:
+ type: number
+ cwe-id:
+ type: array
+ items:
+ type: string
+ epss-percentile:
+ type: number
+ epss-score:
+ type: number
+ metadata:
+ type: object
+ author:
+ type: array
+ items:
+ type: string
+ description:
+ type: string
+ impact:
+ type: string
+ name:
+ type: string
+ tags:
+ type: array
+ items:
+ type: string
+ reference:
+ type: array
+ items:
+ type: string
+ remediation:
+ type: string
+ severity:
+ type: string
+ ip:
type: string
- start_time:
+ matched-at:
type: string
- format: time
- hourly_frequency:
- type: integer
- custom_weekdays:
- description: |-
- Array of integer denoting the weekdays on which the scan is supposed to run.
- 0-6 denoting Sunday-Saturday.
+ matched-line:
type: array
items:
type: integer
- minimum: 0
- maximum: 6
- required:
- - enumeration_id
- - scan_frequency
- - schedule_last_run
- - schedule_next_run
- title: EnumerationSchedule
- ScansHistoryItems:
+ matcher-name:
+ type: string
+ matcher-status:
+ type: boolean
+ path:
+ type: string
+ request:
+ type: string
+ response:
+ type: string
+ template-id:
+ type: string
+ template-path:
+ type: string
+ timestamp:
+ type: string
+ type:
+ type: string
+ error:
+ type: string
+ issue_trackers:
+ type: object
+ properties:
+ jira:
+ $ref: "#/components/schemas/VulnIssueTrackerItem"
+ github:
+ $ref: "#/components/schemas/VulnIssueTrackerItem"
+ gitlab:
+ $ref: "#/components/schemas/VulnIssueTrackerItem"
+ linear:
+ $ref: "#/components/schemas/VulnIssueTrackerItem"
+ custom:
+ $ref: "#/components/schemas/VulnIssueTrackerItem"
+ port:
+ type: string
+ FiltersItem:
+ title: FilterItem
type: object
properties:
- completed_request:
+ value:
+ type: string
+ name:
+ type: string
+ severity:
+ type: string
+ count:
type: integer
+ required:
+ - value
+ - count
+ UserWorkspaces:
+ title: UserWorkspaces
+ type: object
+ required:
+ - name
+ - team_id
+ - active
+ - plan
+ - member_count
+ - role
+ - default
+ properties:
name:
type: string
- scan_id:
+ team_id:
type: string
- scan_time:
+ active:
+ type: boolean
+ plan:
+ type: string
+ member_count:
+ type: integer
+ role:
type: string
+ default:
+ type: boolean
+ ScanStats:
+ title: ScanStats
+ type: object
+ properties:
+ cves:
+ type: integer
+ matched:
+ type: integer
+ not_matched:
+ type: integer
severity:
type: object
- status:
- type: string
- time:
- type: string
- total_request:
+ total_count:
type: integer
- total_result:
+ total_scan:
type: integer
total_target:
type: integer
- total_templates:
+ total_template:
type: integer
- title: ScansHistoryItems
- GithubTemplateListItem:
+ vuln_status:
+ type: object
+ total_regression:
+ type: integer
+ format: int64
+ required:
+ - cves
+ - matched
+ - not_matched
+ - total_count
+ - total_scan
+ - total_target
+ - total_template
+ - total_regression
+ VulnerabilityResultsOld:
+ title: VulnerabilityResultsOld
type: object
+ required:
+ - scan_id
+ - target
+ - template_id
+ - vuln_id
+ - matcher_status
+ - created_at
+ - event
properties:
- id:
+ scan_id:
type: string
- templateURL:
+ target:
type: string
- name:
+ template_encoded:
type: string
- required:
- - id
- - templateURL
- - name
- title: GithubTemplateListItem
- IntegrationListItems:
- type: object
- properties:
- connection_id:
+ template_url:
type: string
- integration_id:
+ template_path:
type: string
- status:
+ template_id:
type: string
- identifier:
+ vuln_id:
type: string
- org_name:
+ matcher_status:
+ type: boolean
+ created_at:
type: string
- account_type:
+ updated_at:
type: string
- handle:
+ event:
+ $ref: "#/components/schemas/VulnerabilityEvent"
+ id:
+ type: string
+ vuln_status:
+ type: string
+ vuln_hash:
+ type: string
+ port:
+ type: integer
+ asset_metadata:
+ type: object
+ $ref: "#/components/schemas/EnumerationContent"
+ templateListItem:
+ title: templateListItem
+ type: object
+ properties:
+ created_at:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ shared_publicly:
+ type: boolean
+ updated_at:
type: string
required:
- - connection_id
- - integration_id
- - status
- - identifier
- - org_name
- - account_type
- - handle
- title: GithubTemplateListItem
- TemplateStats:
+ - created_at
+ - id
+ - name
+ ExportListItem:
+ title: ExportListItem
type: object
properties:
- date:
+ id:
type: string
- statistics:
- type: object
- properties:
- authors:
- type: object
- classification:
- type: object
- properties:
- total:
- type: integer
- cvss-metrics:
- type: integer
- cvss-score:
- type: integer
- cve-id:
- type: integer
- cwe-id:
- type: integer
- description:
- type: integer
- directory:
- type: object
- properties:
- total:
- type: integer
- name:
- type: integer
- references:
- type: integer
- remediation:
- type: integer
- severity:
- type: object
- properties:
- total:
- type: integer
- critical:
- type: integer
- high:
- type: integer
- medium:
- type: integer
- low:
- type: integer
- info:
- type: integer
- unknown:
- type: integer
- tags:
- type: object
- total:
- type: integer
- type:
- type: object
- properties:
- total:
- type: integer
- http:
- type: integer
- dns:
- type: integer
- network:
- type: integer
- file:
- type: integer
- ssl:
- type: integer
- websocket:
- type: integer
- workflow:
- type: integer
- headless:
- type: integer
- template-version:
+ name:
type: string
- x-examples:
- Example 1:
- date: '2024-02-03T08:40:19.911720715Z'
- statistics:
- authors:
- 0h1in9e: 1
- 0ri2n: 13
- 0ut0fb4nd: 1
- 0w4ys: 3
- classification:
- total: 4772
- cvss-metrics: 4650
- cvss-score: 2999
- cve-id: 2349
- cwe-id: 4679
- description: 6665
- directory:
- total: 0
- name: 7810
- references: 5369
- remediation: 2231
- severity:
- total: 7810
- critical: 947
- high: 1563
- medium: 1457
- low: 257
- info: 3551
- unknown: 35
- tags:
- '360': 1
- '3600': 1
- '''rpcms''': 1
- total: 7810
- type:
- total: 7810
- http: 7005
- dns: 21
- network: 134
- file: 312
- ssl: 27
- websocket: 0
- workflow: 191
- headless: 16
- template-version: main
- TemplateLeaderboard:
+ export_status:
+ type: string
+ item_type:
+ type: string
+ download_signed_url:
+ type: string
+ created_at:
+ type: string
+ format: date-time
+ description: Export List Item
+ required:
+ - id
+ - name
+ - export_status
+ - item_type
+ - created_at
+ UserAuditLogItems:
+ title: UserAuditLogItems
type: object
+ required:
+ - created_at
+ - email
+ - action
+ - status
+ - method
+ - ip
+ - path
properties:
- data:
- type: array
- items:
- type: object
- properties:
- author:
- type: string
- category:
- type: object
- properties:
- cloud:
- type: integer
- cve:
- type: integer
- fuzz:
- type: integer
- kve:
- type: integer
- links:
- type: object
- properties:
- email:
- type: string
- github:
- type: string
- linkedin:
- type: string
- twitter:
- type: string
- website:
- type: string
- points:
- type: integer
- protocol:
- type: object
- properties:
- dns:
- type: integer
- file:
- type: integer
- headless:
- type: integer
- http:
- type: integer
- ssl:
- type: integer
- tcp:
- type: integer
- rank:
- type: integer
- severity:
- type: object
- properties:
- critical:
- type: integer
- high:
- type: integer
- info:
- type: integer
- low:
- type: integer
- medium:
- type: integer
- unknown:
- type: integer
- templates:
- type: integer
- date:
+ created_at:
type: string
- result:
- type: integer
- total:
+ email:
+ type: string
+ action:
+ type: string
+ status:
type: integer
- x-examples:
- Example 1:
- data:
- - author: dhiyaneshdk
- category:
- cloud: 0
- cve: 154
- fuzz: 1
- kve: 34
- links:
- email: ''
- github: ''
- linkedin: ''
- twitter: ''
- website: ''
- points: 26065
- protocol:
- dns: 0
- file: 85
- headless: 1
- http: 1044
- ssl: 0
- tcp: 1
- rank: 1
- severity:
- critical: 90
- high: 195
- info: 592
- low: 89
- medium: 161
- unknown: 12
- templates: 1139
- - author: naglis
- category:
- cloud: 0
- cve: 0
- fuzz: 0
- kve: 0
- links:
- email: ''
- github: ''
- linkedin: ''
- twitter: ''
- website: ''
- points: 10
- protocol:
- dns: 0
- file: 1
- headless: 0
- http: 0
- ssl: 0
- tcp: 0
- rank: 792
- severity:
- critical: 0
- high: 0
- info: 1
- low: 0
- medium: 0
- unknown: 0
- templates: 1
- date: all_time
- result: 794
- total: 794
- EnumerationIDTypes:
+ method:
+ type: string
+ ip:
+ type: string
+ path:
+ type: string
+ PublicTemplateListItem:
+ title: PublicTemplateListItem
type: object
properties:
id:
type: string
+ templateURL:
+ type: string
+ name:
+ type: string
required:
- - id
- title: EnumerationIDTypes
- EnumerationIDTypesDetail:
+ - id
+ - templateURL
+ - name
+ EarlyTemplateListItem:
+ title: EarlyTemplateListItem
type: object
properties:
id:
type: string
- name:
- type: string
- total_assets:
- type: integer
- enumeration_type:
+ templateURL:
type: string
- cloudlist_provider_name:
+ name:
type: string
- types:
- type: array
- items:
- enum:
- - hosts
- - ports
- - http
- - endpoints
required:
- - id
- - types
- - name
- - enumeration_type
- title: EnumerationIDTypesDetail
- ScanConfigItem:
+ - id
+ - templateURL
+ - name
+ TeamMemberItem:
+ title: TeamMemberItem
type: object
properties:
- id:
+ email:
type: string
- name:
+ status:
type: string
- provider_name:
+ role:
type: string
- config_type:
+ invited_at:
+ type: string
+ accepted_at:
+ type: string
+ profile_image:
+ type: string
+ last_sign_in:
type: string
required:
- - id
- - name
- - config_type
- title: ScanConfigItem
- ScanConfig:
+ - email
+ - status
+ - role
+ InvoiceItem:
+ description: Example response
type: object
+ required:
+ - invoice_number
+ - amount
+ - paid_on
+ - status
+ - invoice_url
properties:
- targets:
- type: array
- items:
- type: string
- assets_lists:
- type: array
- items:
- type: string
- public_templates:
- type: array
- items:
- type: string
- early_templates:
- type: array
- items:
- type: string
- template_urls:
- type: array
- items:
- type: string
- template_ids:
- type: array
- items:
- type: string
- scan_config_ids:
- type: array
- items:
- $ref: '#/components/schemas/ScanConfigItem'
- report_config_ids:
- type: array
- items:
- $ref: '#/components/schemas/ScanConfigItem'
- alerting_config_ids:
- type: array
- items:
- $ref: '#/components/schemas/ScanConfigItem'
- enumeration_ids:
- type: array
- items:
- $ref: '#/components/schemas/EnumerationIDTypesDetail'
- title: ScanConfig
- ScanConfigUpdateItem:
- type: object
- properties:
- targets:
- type: array
- items:
- type: string
- assets_lists:
- type: array
- items:
- type: string
- templates:
- type: array
- items:
- type: string
- early_templates:
- type: array
- items:
- type: string
- scan_config_ids:
- type: array
- items:
- type: string
- report_config_ids:
- type: array
- items:
- type: string
- alerting_config_ids:
- type: array
- items:
- type: string
- enumeration_ids:
- type: array
- items:
- $ref: '#/components/schemas/EnumerationIDTypes'
- title: ScanConfigUpdateItem
- ScanLogResp:
- type: object
- properties:
- target:
- type: string
- template_id:
- type: string
- matched:
- type: boolean
- error:
- type: string
- timestamp:
+ invoice_number:
type: string
- severity:
+ description: The invoice number
+ amount:
+ type: integer
+ format: int64
+ description: Total amount of the invoice in USD
+ paid_on:
type: string
- event:
+ format: date-time
+ nullable: true
+ description: The date when the invoice was paid
+ status:
type: string
- vuln_hash:
+ description: The status of the invoice
+ invoice_url:
type: string
- required:
- - target
- - template_id
- - matched
- - timestamp
- title: ScanLogResp
- SchedulerFrequency:
- description: Allowed frequencies for the scheduler
- type: string
- enum:
- - hourly
- - daily
- - weekly
- - monthly
- - custom
- title: SchedulerFrequency
- ExcludedTemplate:
+ format: uri
+ description: URL to view the invoice
+ WorkspaceItem:
+ title: TeamMemberItem
type: object
properties:
id:
- type: integer
- format: int64
- value:
+ type: string
+ name:
type: string
created_at:
type: string
- format: date-time
- updated_at:
+ member_count:
+ type: integer
+ owner_email:
type: string
- format: date-time
required:
- - id
- - value
- - created_at
- - updated_at
- title: ExcludedTemplate
- EnumerationCounts:
- description: Example response
+ - id
+ - name
+ - created_at
+ - member_count
+ - owner_email
+ ScanUsageStatsResponse:
+ title: ScanUsageStatsResponse
type: object
+ description: "Scan Usage Stats "
properties:
- total_enumeration:
+ time:
+ type: string
+ format: date-time
+ scan_id:
+ type: string
+ user_id:
type: integer
format: int64
- total_unique_enumeration:
+ completed_request:
type: integer
format: int64
- total_uploaded_enumeration:
+ total_target:
type: integer
format: int64
- total_discovery_enumeration:
+ total_templates:
type: integer
format: int64
- total_cloud_enumeration:
+ total_result:
type: integer
format: int64
- title: EnumerationCounts
- AssetStats:
+ severity_breakdown:
+ type: string
+ format: json
+ required:
+ - time
+ - scan_id
+ - user_id
+ - completed_request
+ - total_target
+ - total_templates
+ - total_result
+ - severity_breakdown
+ VulnStatusEnum:
+ title: VulnStatusEnum
+ enum:
+ - open
+ - false_positive
+ - fixed
+ - duplicate
+ - fix_in_progress
+ - accepted_risk
+ - triaged
+ ConfigResponse:
+ title: ConfigResponse
+ type: object
+ properties:
+ id:
+ type: string
+ config:
+ type: string
+ config_type:
+ $ref: "#/components/schemas/ConfigTypeEnum"
+ name:
+ type: string
+ read_only:
+ type: boolean
+ global:
+ type: boolean
+ provider_name:
+ type: string
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ required:
+ - id
+ - config
+ - config_type
+ - name
+ - created_at
+ - updated_at
+ ConfigTypeEnum:
+ title: ConfigTypeEnum
+ type: string
+ enum:
+ - scan
+ - reporting
+ - template
+ - alerting
+ - cloudlist
+ - subfinder
+ EnumerationStats:
+ title: EnumerationStats
type: object
+ required:
+ - hosts
+ - http
+ - endpoints
+ - ports
+ - total_assets
properties:
hosts:
type: integer
@@ -6434,888 +5504,3716 @@ components:
ports:
type: integer
format: int64
- new_assets:
- type: integer
- format: int64
total_assets:
type: integer
format: int64
- technologies:
+ total_asset_groups:
type: integer
format: int64
- required:
- - hosts
- - http
- - endpoints
- - ports
- - total_assets
- - new_assets
- - technologies
- title: AssetStats
- PriceListItem:
+ EnumerateData:
+ title: EnumerateData
type: object
- properties:
- price_id:
- type: string
- amount:
- type: integer
- monthly_token:
- type: integer
- recurrence:
- type: string
required:
- - price_id
- - amount
- - recurrence
- - monthly_token
- title: PriceListItem
- VulnIssueTrackerItem:
- type: object
+ - id
+ - name
+ - status
+ - created_at
properties:
id:
type: string
- url:
- type: string
- title: VulnIssueTrackerItem
- EnumerationConfig:
- type: object
- properties:
name:
type: string
+ status:
+ type: string
+ failure_reason:
+ type: string
+ completed_at:
+ type: string
+ format: date-time
+ enumeration_time:
+ type: string
+ format: duration
+ enumeration_type:
+ type: string
+ enumeration_stats:
+ $ref: "#/components/schemas/EnumerationStats"
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
root_domains:
type: array
items:
type: string
- enrichment_inputs:
+ enrichment_hosts_count:
+ type: integer
+ is_rescan:
+ type: boolean
+ rescan_count:
+ type: integer
+ cloudlist_config_ids:
type: array
items:
type: string
- steps:
+ cloudlist_provider_name:
+ type: string
+ enumeration_time_elapsed:
+ type: string
+ total_assets:
+ type: integer
+ format: int64
+ new_assets:
+ type: integer
+ format: int64
+ domain_names:
type: array
items:
type: string
- enum:
- - dns_resolve
- - dns_bruteforce
- - dns_permute
- - port_scan
- - http_probe
- - http_screenshot
- - dns_passive
- enum_ports:
- type: string
- enumeration_config:
- $ref: '#/components/schemas/EnumerationLaunchConfig'
- title: EnumerationConfig
- EnumerationLaunchConfig:
- type: object
- properties:
- follow-redirect:
+ schedule:
+ $ref: "#/components/schemas/EnumerationSchedule"
+ is_public:
type: boolean
- ports:
+ asset_group_filters:
+ type: object
+ $ref: "#/components/schemas/AssetFilters"
+ body:
type: string
- title: EnumerationLaunchConfig
- TunnelItem:
+ automatic_vuln_scans:
+ type: boolean
+ EnumerationContent:
+ title: EnumerationContent
type: object
+ required:
+ - enumeration_id
+ - name
+ - created_at
+ - id
+ - is_new
properties:
- name:
+ enumeration_id:
type: string
- os:
+ name:
type: string
- arch:
+ created_at:
type: string
- tunnel_ip:
+ updated_at:
type: string
- tunnel_port:
+ id:
+ type: integer
+ format: int64
+ labels:
+ type: array
+ items:
+ type: string
+ cname:
+ type: array
+ items:
+ type: string
+ host:
type: string
- client_ip:
+ port:
+ type: integer
+ ip:
+ type: array
+ items:
+ type: string
+ status_code:
+ type: integer
+ content_length:
+ type: integer
+ vulnerabilities:
+ type: integer
+ format: int64
+ title:
type: string
- username:
+ technologies:
+ type: array
+ items:
+ type: string
+ webserver:
type: string
- token:
+ method:
+ type: string
+ is_new:
+ type: boolean
+ type:
+ type: string
+ asset_hash:
+ type: string
+ technology_details:
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/EnumerationContentTechnologyDetails"
+ screenshot_path:
+ type: string
+ favicon:
+ type: string
+ favicon_body:
+ type: string
+ cdn_name:
+ type: string
+ chain_status_codes:
+ type: array
+ items:
+ type: string
+ domain_name:
+ type: string
+ redirect_location:
+ type: string
+ asn:
+ as_number:
+ type: string
+ as_country:
+ type: string
+ as_name:
+ type: string
+ as_range:
+ type: array
+ items:
+ type: string
+ type: object
+ properties:
+ as_country:
+ type: string
+ as_name:
+ type: string
+ as_number:
+ type: string
+ as_range:
+ type: array
+ items:
+ type: string
+ tls_serial_number:
+ type: string
+ tls_subject_org:
+ type: string
+ tls_issuer_org:
+ type: string
+ tls_expired:
+ type: boolean
+ tls_not_before:
+ type: string
+ format: date-time
+ tls_self_signed:
+ type: boolean
+ tls_mismatched:
+ type: boolean
+ tls_revoked:
+ type: boolean
+ tls_untrusted:
+ type: boolean
+ tls_subject_cn:
+ type: string
+ tls_subject_an:
+ type: array
+ items:
+ type: string
+ body:
+ type: string
+ tls_not_after:
+ type: string
+ format: date-time
+ enumeration_name:
type: string
+ extended_metadata:
+ type: object
+ source_type:
+ type: string
+ source:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationSourceValue"
+ EnumerationSourceValue:
+ type: object
required:
- - name
- - os
- - arch
- - tunnel_ip
- - tunnel_port
- - client_ip
- - username
- - token
- title: TunnelItem
- ServiceUsageItem:
+ - source
+ - metadata
+ properties:
+ source:
+ type: string
+ metadata:
+ type: object
+ additionalProperties:
+ type: string
+ EnumerationContentTechnologyDetails:
+ title: EnumerationContentTechnologyDetails
type: object
properties:
- used:
+ description:
+ type: string
+ website:
+ type: string
+ icon:
+ type: string
+ categories:
+ type: array
+ items:
+ type: string
+ EnumerationIds:
+ title: EnumerationIds
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ EnumerationSchedule:
+ title: EnumerationSchedule
+ type: object
+ required:
+ - enumeration_id
+ - scan_frequency
+ - schedule_last_run
+ - schedule_next_run
+ properties:
+ enumeration_id:
+ type: string
+ scan_frequency:
+ type: string
+ schedule_last_run:
+ type: string
+ schedule_next_run:
+ type: string
+ start_time:
+ type: string
+ format: time
+ hourly_frequency:
type: integer
- remaining:
+ custom_weekdays:
+ type: array
+ description: |-
+ Array of integer denoting the weekdays on which the scan is supposed to run.
+ 0-6 denoting Sunday-Saturday.
+ items:
+ type: integer
+ minimum: 0
+ maximum: 6
+ ScansHistoryItems:
+ title: ScansHistoryItems
+ type: object
+ properties:
+ completed_request:
type: integer
- total:
+ name:
+ type: string
+ scan_id:
+ type: string
+ scan_time:
+ type: string
+ severity:
+ type: object
+ status:
+ type: string
+ time:
+ type: string
+ total_request:
+ type: integer
+ total_result:
+ type: integer
+ total_target:
type: integer
+ total_templates:
+ type: integer
+ error_details:
+ type: string
+ GithubTemplateListItem:
+ title: GithubTemplateListItem
+ type: object
+ properties:
+ id:
+ type: string
+ templateURL:
+ type: string
+ name:
+ type: string
required:
- - used
- - remaining
- - total
- title: ServiceUsageLimitItem
- UsageRangeEnum:
- type: string
- enum:
- - daily
- - weekly
- - monthly
- - custom
- title: UsageRangeEnum
- ExposuresTimeSeries:
+ - id
+ - templateURL
+ - name
+ IntegrationListItems:
+ title: GithubTemplateListItem
type: object
properties:
- date:
+ connection_id:
type: string
- format: date
- assets:
- type: integer
- technologies:
- type: integer
- title: ExposuresTimeSeries
- requestBodies:
- UpdateTemplateRequest:
+ integration_id:
+ type: string
+ status:
+ type: string
+ identifier:
+ type: string
+ org_name:
+ type: string
+ account_type:
+ type: string
+ handle:
+ type: string
+ required:
+ - connection_id
+ - integration_id
+ - status
+ - identifier
+ - org_name
+ - account_type
+ - handle
+ TemplateStats:
+ type: object
+ x-examples:
+ Example 1:
+ date: "2024-02-03T08:40:19.911720715Z"
+ statistics:
+ authors:
+ 0h1in9e: 1
+ 0ri2n: 13
+ 0ut0fb4nd: 1
+ 0w4ys: 3
+ classification:
+ total: 4772
+ cvss-metrics: 4650
+ cvss-score: 2999
+ cve-id: 2349
+ cwe-id: 4679
+ description: 6665
+ directory:
+ total: 0
+ name: 7810
+ references: 5369
+ remediation: 2231
+ severity:
+ total: 7810
+ critical: 947
+ high: 1563
+ medium: 1457
+ low: 257
+ info: 3551
+ unknown: 35
+ tags:
+ "360": 1
+ "3600": 1
+ "rpcms": 1
+ total: 7810
+ type:
+ total: 7810
+ http: 7005
+ dns: 21
+ network: 134
+ file: 312
+ ssl: 27
+ websocket: 0
+ workflow: 191
+ headless: 16
+ template-version: main
+ required:
+ - buckets
+ - missing
+ - other
+ - total
+ properties:
+ is_new:
+ $ref: "#/components/schemas/StatBuckets"
+ creation_stats:
+ $ref: "#/components/schemas/StatBuckets"
+ author:
+ $ref: "#/components/schemas/StatBuckets"
+ is_early:
+ $ref: "#/components/schemas/StatBuckets"
+ dir:
+ $ref: "#/components/schemas/StatBuckets"
+ product:
+ $ref: "#/components/schemas/StatBuckets"
+ severity:
+ $ref: "#/components/schemas/StatBuckets"
+ tags:
+ $ref: "#/components/schemas/StatBuckets"
+ type:
+ $ref: "#/components/schemas/StatBuckets"
+ vendor:
+ $ref: "#/components/schemas/StatBuckets"
+ TemplateLeaderboard:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ type: object
+ properties:
+ author:
+ type: string
+ category:
+ type: object
+ properties:
+ cloud:
+ type: integer
+ cve:
+ type: integer
+ fuzz:
+ type: integer
+ kve:
+ type: integer
+ links:
+ type: object
+ properties:
+ email:
+ type: string
+ github:
+ type: string
+ linkedin:
+ type: string
+ twitter:
+ type: string
+ website:
+ type: string
+ points:
+ type: integer
+ protocol:
+ type: object
+ properties:
+ dns:
+ type: integer
+ file:
+ type: integer
+ headless:
+ type: integer
+ http:
+ type: integer
+ ssl:
+ type: integer
+ tcp:
+ type: integer
+ rank:
+ type: integer
+ severity:
+ type: object
+ properties:
+ critical:
+ type: integer
+ high:
+ type: integer
+ info:
+ type: integer
+ low:
+ type: integer
+ medium:
+ type: integer
+ unknown:
+ type: integer
+ templates:
+ type: integer
+ date:
+ type: string
+ result:
+ type: integer
+ total:
+ type: integer
+ x-examples:
+ Example 1:
+ data:
+ - author: dhiyaneshdk
+ category:
+ cloud: 0
+ cve: 154
+ fuzz: 1
+ kve: 34
+ links:
+ email: ""
+ github: ""
+ linkedin: ""
+ twitter: ""
+ website: ""
+ points: 26065
+ protocol:
+ dns: 0
+ file: 85
+ headless: 1
+ http: 1044
+ ssl: 0
+ tcp: 1
+ rank: 1
+ severity:
+ critical: 90
+ high: 195
+ info: 592
+ low: 89
+ medium: 161
+ unknown: 12
+ templates: 1139
+ - author: naglis
+ category:
+ cloud: 0
+ cve: 0
+ fuzz: 0
+ kve: 0
+ links:
+ email: ""
+ github: ""
+ linkedin: ""
+ twitter: ""
+ website: ""
+ points: 10
+ protocol:
+ dns: 0
+ file: 1
+ headless: 0
+ http: 0
+ ssl: 0
+ tcp: 0
+ rank: 792
+ severity:
+ critical: 0
+ high: 0
+ info: 1
+ low: 0
+ medium: 0
+ unknown: 0
+ templates: 1
+ date: all_time
+ result: 794
+ total: 794
+ EnumerationIDTypes:
+ title: EnumerationIDTypes
+ type: object
+ required:
+ - id
+ properties:
+ id:
+ type: string
+ EnumerationIDTypesDetail:
+ title: EnumerationIDTypesDetail
+ type: object
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ total_assets:
+ type: integer
+ enumeration_type:
+ type: string
+ cloudlist_provider_name:
+ type: string
+ types:
+ type: array
+ items:
+ enum:
+ - hosts
+ - ports
+ - http
+ - endpoints
+ required:
+ - id
+ - types
+ - name
+ - enumeration_type
+ ScanConfigItem:
+ title: ScanConfigItem
+ type: object
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ provider_name:
+ type: string
+ config_type:
+ type: string
+ required:
+ - id
+ - name
+ - config_type
+ ScanConfig:
+ title: ScanConfig
+ type: object
+ properties:
+ targets:
+ type: array
+ items:
+ type: string
+ assets_lists:
+ type: array
+ items:
+ type: string
+ public_templates:
+ type: array
+ items:
+ type: string
+ early_templates:
+ type: array
+ items:
+ type: string
+ template_urls:
+ type: array
+ items:
+ type: string
+ template_ids:
+ type: array
+ items:
+ type: string
+ scan_config_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanConfigItem"
+ report_config_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanConfigItem"
+ alerting_config_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanConfigItem"
+ enumeration_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationIDTypesDetail"
+ socks5_proxy:
+ type: string
+ scan_all_assets:
+ type: boolean
+ ScanConfigUpdateItem:
+ title: ScanConfigUpdateItem
+ type: object
+ properties:
+ targets:
+ type: array
+ items:
+ type: string
+ assets_lists:
+ type: array
+ items:
+ type: string
+ templates:
+ type: array
+ items:
+ type: string
+ early_templates:
+ type: array
+ items:
+ type: string
+ scan_config_ids:
+ type: array
+ items:
+ type: string
+ report_config_ids:
+ type: array
+ items:
+ type: string
+ alerting_config_ids:
+ type: array
+ items:
+ type: string
+ enumeration_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationIDTypes"
+ socks5_proxy:
+ type: string
+ scan_all_assets:
+ type: boolean
+ ScanLogResp:
+ title: ScanLogResp
+ type: object
+ required:
+ - target
+ - template_id
+ - matched
+ - timestamp
+ properties:
+ target:
+ type: string
+ template_id:
+ type: string
+ matched:
+ type: boolean
+ error:
+ type: string
+ timestamp:
+ type: string
+ severity:
+ type: string
+ event:
+ type: string
+ vuln_hash:
+ type: string
+ SchedulerFrequency:
+ title: SchedulerFrequency
+ type: string
+ enum:
+ - hourly
+ - daily
+ - weekly
+ - monthly
+ - custom
+ description: Allowed frequencies for the scheduler
+ ExcludedTemplate:
+ title: Excluded Templates and targets
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ value:
+ type: string
+ exclude_type:
+ $ref: "#/components/schemas/ExcludeConfigRequestType"
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ required:
+ - id
+ - value
+ - exclude_type
+ - created_at
+ - updated_at
+ EnumerationCounts:
+ description: Example response
+ title: EnumerationCounts
+ type: object
+ properties:
+ total_enumeration:
+ type: integer
+ format: int64
+ total_unique_enumeration:
+ type: integer
+ format: int64
+ total_uploaded_enumeration:
+ type: integer
+ format: int64
+ total_discovery_enumeration:
+ type: integer
+ format: int64
+ total_cloud_enumeration:
+ type: integer
+ format: int64
+ AssetStats:
+ title: AssetStats
+ type: object
+ properties:
+ host:
+ type: integer
+ format: int64
+ new_assets:
+ type: integer
+ format: int64
+ total_assets:
+ type: integer
+ format: int64
+ technologies:
+ type: integer
+ format: int64
+ domains:
+ type: integer
+ format: int64
+ port:
+ type: integer
+ format: int64
+ screenshots:
+ type: integer
+ format: int64
+ vulnerabilities:
+ type: integer
+ format: int64
+ required:
+ - domains
+ - host
+ - port
+ - total_assets
+ - new_assets
+ - technologies
+ - vulnerabilities
+ - screenshots
+ PriceListItem:
+ title: PriceListItem
+ type: object
+ required:
+ - price_id
+ - amount
+ - recurrence
+ - monthly_token
+ properties:
+ price_id:
+ type: string
+ amount:
+ type: integer
+ monthly_token:
+ type: integer
+ recurrence:
+ type: string
+ VulnIssueTrackerItem:
+ title: VulnIssueTrackerItem
+ type: object
+ properties:
+ id:
+ type: string
+ url:
+ type: string
+ AIMeta:
+ type: object
+ properties:
+ model_used:
+ description: The AI model used to generate the template
+ type: string
+ is_prompt_by_human:
+ description: Whether the prompt was written by a human
+ type: boolean
+ is_template_by_human:
+ description: Whether the template was written by a human
+ type: boolean
+ prompt:
+ description: The prompt used to generate the template
+ type: string
+ TemplateData:
+ description: Template Document or object
+ type: object
+ properties:
+ uri:
+ type: string
+ description: The URI of the template (could be a path or a ksuid)
+ id:
+ type: string
+ description: The ID of the template
+ name:
+ type: string
+ description: The name of the template
+ author:
+ type: array
+ description: The authors of the template
+ items:
+ type: string
+ tags:
+ type: array
+ description: The tags of the template
+ items:
+ type: string
+ severity:
+ type: string
+ description: The severity of the template
+ type:
+ type: string
+ description: The type of the template
+ dir:
+ type: string
+ ref:
+ type: string
+ vendor:
+ type: string
+ description: The vendor of the template
+ product:
+ type: string
+ description: The product of the template
+ classification:
+ $ref: "#/components/schemas/Classification"
+ description: Classification of template including additional metadata like cve-id, cwe-id etc
+ metadata:
+ type: object
+ digest:
+ type: string
+ description: The digest of the template
+ created_at:
+ type: string
+ format: date-time
+ description: The time when template was created
+ updated_at:
+ type: string
+ format: date-time
+ description: The time when template was updated
+ release_tag:
+ type: string
+ description: The release tag of the template (contains tag when the file was first released)
+ is_early:
+ type: boolean
+ description: True if template is in early access
+ raw:
+ type: string
+ description: The raw unparsed template
+ template_id:
+ type: string
+ description:
+ type: string
+ filename:
+ type: string
+ impact:
+ type: string
+ ai_meta:
+ $ref: "#/components/schemas/AIMeta"
+ references:
+ type: array
+ items:
+ type: string
+ template_type:
+ enum:
+ - public
+ - user
+ - shared
+ is_draft:
+ type: boolean
+ is_github:
+ type: boolean
+ is_new:
+ type: boolean
+ is_pdresearch:
+ type: boolean
+ is_pdteam:
+ type: boolean
+ is_pdtemplate:
+ type: boolean
+ remediation:
+ type: string
+ SharedTemplateData:
+ allOf:
+ - $ref: "#/components/schemas/TemplateData"
+ - type: object
+ properties:
+ ttl:
+ type: string
+ description: Time to live duration (1d ,1m etc)
+ share_type:
+ type: string
+ description: Type of share (unlisted, users, organization)
+ users_email:
+ type: array
+ description: List of email addresses or user IDs to share with (required if share_type is set to "users")
+ items:
+ type: string
+ organizations:
+ type: array
+ items:
+ type: string
+ Classification:
+ description: Classification of template including additional metadata like cve-id, cwe-id etc
+ type: object
+ properties:
+ cve-id:
+ type: array
+ items:
+ type: string
+ description: CVE IDs for the template
+ cwe-id:
+ type: array
+ items:
+ type: string
+ description: CWE IDs for the template
+ cvss-metrics:
+ type: string
+ description: CVSS Metrics for the template
+ cvss-score:
+ type: number
+ format: float
+ description: CVSS Score for the template
+ epss-score:
+ type: number
+ format: float
+ description: EPSS Score for the template
+ epss-percentile:
+ type: number
+ format: float
+ description: EPSS Percentile for the template
+ cpe:
+ type: string
+ description: CPE for the template
+ EnumerationConfig:
+ title: EnumerationConfig
+ type: object
+ properties:
+ name:
+ type: string
+ root_domains:
+ type: array
+ items:
+ type: string
+ enrichment_inputs:
+ type: array
+ items:
+ type: string
+ steps:
+ type: array
+ items:
+ type: string
+ enum:
+ - dns_resolve
+ - dns_bruteforce
+ - dns_permute
+ - port_scan
+ - http_probe
+ - http_screenshot
+ - endpoint_crawling
+ - dns_passive
+ - tls_scan
+ - uncover_assets
+ - dns_scraping
+ enum_ports:
+ type: string
+ enumeration_config:
+ $ref: "#/components/schemas/EnumerationLaunchConfig"
+ alerting_config_ids:
+ type: array
+ items:
+ type: string
+ subfinder_config_ids:
+ type: array
+ items:
+ type: string
+ automatic_vuln_scans:
+ type: boolean
+ EnumerationLaunchConfig:
+ title: EnumerationLaunchConfig
+ type: object
+ properties:
+ follow-redirect:
+ type: boolean
+ ports:
+ type: string
+ UserSetupStatsItem:
+ title: UserSetupStatsItem
+ type: object
+ required:
+ - name
+ - count
+ properties:
+ name:
+ type: string
+ count:
+ type: integer
+ first_created_at:
+ type: string
+ last_created_at:
+ type: string
+ TunnelItem:
+ title: TunnelItem
+ type: object
+ required:
+ - name
+ - os
+ - arch
+ - tunnel_ip
+ - tunnel_port
+ - client_ip
+ - username
+ - token
+ - id
+ - status
+ properties:
+ name:
+ type: string
+ os:
+ type: string
+ arch:
+ type: string
+ tunnel_ip:
+ type: string
+ tunnel_port:
+ type: string
+ client_ip:
+ type: string
+ username:
+ type: string
+ token:
+ type: string
+ id:
+ type: string
+ last_update:
+ type: string
+ status:
+ type: string
+ ServiceUsageItem:
+ title: ServiceUsageLimitItem
+ type: object
+ required:
+ - used
+ - remaining
+ - total
+ properties:
+ used:
+ type: integer
+ remaining:
+ type: integer
+ total:
+ type: integer
+ UsageRangeEnum:
+ title: UsageRangeEnum
+ type: string
+ enum:
+ - daily
+ - weekly
+ - monthly
+ - custom
+ GetAutomationsListItem:
+ title: GetAutomationsListItem
+ type: object
+ required:
+ - name
+ - event
+ - status
+ - created_at
+ - updated_at
+ properties:
+ name:
+ type: string
+ event:
+ type: string
+ status:
+ type: string
+ created_at:
+ type: string
+ updated_at:
+ type: string
+ AutomationScanData:
+ title: AutomationScanData
+ type: object
+ properties:
+ targets:
+ type: array
+ items:
+ type: string
+ templates:
+ type: array
+ items:
+ type: string
+ name:
+ type: string
+ alerting_config_ids:
+ type: array
+ items:
+ type: string
+ scan_config_ids:
+ type: array
+ items:
+ type: string
+ reporting_config_ids:
+ type: array
+ items:
+ type: string
+ early_templates:
+ type: array
+ items:
+ type: string
+ exclude_targets:
+ type: array
+ items:
+ type: string
+ enumeration_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationIds"
+ disable_global_alert_config:
+ type: boolean
+ disable_global_report_config:
+ type: boolean
+ disable_global_scan_config:
+ type: boolean
+ socks5_proxy:
+ type: string
+ scan_id:
+ type: string
+ update_existing_scan:
+ type: boolean
+ scan_all_assets:
+ type: boolean
+ GetAutomationItem:
+ title: GetAutomationItem
+ type: object
+ required:
+ - id
+ - name
+ - event
+ - status
+ - created_at
+ - updated_at
+ - data
+ properties:
+ id:
+ type: integer
+ name:
+ type: string
+ event:
+ type: string
+ status:
+ type: string
+ created_at:
+ type: string
+ updated_at:
+ type: string
+ data:
+ $ref: "#/components/schemas/AutomationScanData"
+ AdminAutomationsItem:
+ title: AdminAutomationsItem
+ type: object
+ required:
+ - name
+ - status
+ - created_at
+ - updated_at
+ - user_id
+ - scan_data
+ properties:
+ name:
+ type: string
+ status:
+ type: string
+ created_at:
+ type: string
+ updated_at:
+ type: string
+ user_id:
+ type: integer
+ scan_data:
+ $ref: "#/components/schemas/AutomationScanData"
+ ExposuresTimeSeries:
+ title: ExposuresTimeSeries
+ type: object
+ properties:
+ date:
+ type: string
+ format: date
+ assets:
+ type: integer
+ technologies:
+ type: integer
+ hosts:
+ type: integer
+ ScanExposuresTimeSeries:
+ title: ScanExposuresTimeSeries
+ type: object
+ required:
+ - date
+ - open_vulnerability
+ - fixed_vulnerability
+ - new_vulnerability
+ properties:
+ date:
+ type: string
+ format: date
+ open_vulnerability:
+ $ref: "#/components/schemas/VulnMetricSeverityBreakdown"
+ fixed_vulnerability:
+ $ref: "#/components/schemas/VulnMetricSeverityBreakdown"
+ new_vulnerability:
+ $ref: "#/components/schemas/VulnMetricSeverityBreakdown"
+ ScanRegressionRemediationTimeSeries:
+ title: ScanRegressionRemediationTimeSeries
+ type: object
+ required:
+ - date
+ - data
+ properties:
+ date:
+ type: string
+ format: date
+ avg_remediation_time:
+ type: string
+ data:
+ $ref: "#/components/schemas/VulnMetricSeverityBreakdown"
+ ContributorSummary:
+ title: ContributorSummary
+ type: object
+ properties:
+ category_breakdown:
+ type: object
+ properties:
+ cloud:
+ type: integer
+ cve:
+ type: integer
+ dast:
+ type: integer
+ kev:
+ type: integer
+ other:
+ type: integer
+ contributor:
+ type: string
+ score:
+ type: integer
+ socials:
+ type: object
+ total_templates:
+ type: integer
+ StatBuckets:
+ title: StatBuckets
+ type: object
+ properties:
+ buckets:
+ type: object
+ additionalProperties:
+ type: integer
+ missing:
+ type: integer
+ other:
+ type: integer
+ total:
+ type: integer
+ VulnerabilityHistoryDetail:
+ type: object
+ additionalProperties:
+ $ref: "#/components/schemas/VulnerabilityHistory"
+ VulnerabilityHistory:
+ type: object
+ properties:
+ history_count:
+ type: integer
+ format: int64
+ description: The total number of revisions for the vulnerability.
+ history:
+ type: array
+ items:
+ type: object
+ properties:
+ severity:
+ type: string
+ target:
+ type: string
+ template_id:
+ type: string
+ matched:
+ type: boolean
+ timestamp:
+ type: string
+ format: date-time
+ vuln_hash:
+ type: string
+ event:
+ type: string
+ description: A list of events associated with the vulnerability.
+ required:
+ - history_count
+ - history
+ AssetFilters:
+ title: AssetFilters
+ type: object
+ additionalProperties: false
+ properties:
+ is_tech:
+ type: boolean
+ description: Return records that have technologies
+ is_favicon:
+ type: boolean
+ description: Return the records that have favicon
+ is_new:
+ type: boolean
+ description: Filter by new content
+ labels:
+ type: string
+ description: Filter by comma separated labels, e.g-> labels=p1,p2
+ host:
+ type: string
+ description: Filter by comma separated hosts, e.g-> host=p1,p2
+ port:
+ type: string
+ description: Filter by comma separated ports, e.g-> port=p1,p2
+ status_code:
+ type: string
+ description: Filter by comma separated status codes, e.g-> status_code=p1,p2
+ content_length:
+ type: string
+ description: Filter by comma separated content lengths, e.g-> content_length=p1,p2
+ title:
+ type: string
+ description: Filter by comma separated titles, e.g-> title=p1,p2
+ domain:
+ type: array
+ description: Filter by comma separated domain names, e.g-> domain=domain1.com,domain2.com
+ items:
+ type: string
+ cname:
+ type: string
+ description: Filter by comma separated cnames, e.g-> cname=p1,p2
+ technologies:
+ type: string
+ description: Filter by comma separated technologies, e.g-> technologies=p1,p2
+ ip:
+ type: string
+ description: Filter by comma separated ips, e.g-> ip=p1,p2
+ is_screenshot:
+ type: boolean
+ description: Return the records with screenshots
+ time:
+ $ref: "#/components/schemas/TimeRangeQueryParameter"
+ description: Filter by time range
+ start_date:
+ type: string
+ format: date
+ description: Filter by start date
+ end_date:
+ type: string
+ format: date
+ description: Filter by end date
+ custom_filter:
+ type: string
+ description: Filter by custom filter. Double encode the query string.
+ search:
+ type: string
+ description: Search on the content name
+ enumeration_id:
+ type: string
+ description: Filter by enumeration id
+ only_dns:
+ type: boolean
+ description: Query only dns FQDN records
+ only_ip:
+ type: boolean
+ description: Query only dns IP records
+ BillingCycle:
+ title: BillingCycle
+ type: object
+ required:
+ - id
+ - start_date
+ - end_date
+ - unique_asset_count
+ properties:
+ id:
+ type: integer
+ start_date:
+ type: string
+ format: date-time
+ end_date:
+ type: string
+ format: date-time
+ unique_asset_count:
+ type: integer
+ VulnMetricSeverityBreakdown:
+ title: VulnMetricSeverityBreakdown
+ type: object
+ required:
+ - total_count
+ - severity_breakdown
+ - total_fixed
+ properties:
+ total_fixed:
+ type: integer
+ total_count:
+ type: integer
+ severity_breakdown:
+ $ref: "#/components/schemas/SeverityBreakdown"
+ status_breakdown:
+ $ref: "#/components/schemas/StatusBreakdown"
+ SeverityBreakdown:
+ title: SeverityBreakdown
+ type: object
+ properties:
+ critical:
+ type: integer
+ high:
+ type: integer
+ medium:
+ type: integer
+ low:
+ type: integer
+ info:
+ type: integer
+ unknown:
+ type: integer
+ StatusBreakdown:
+ title: StatusBreakdown
+ type: object
+ properties:
+ open:
+ type: integer
+ fixed:
+ type: integer
+ false_positive:
+ type: integer
+ duplicate:
+ type: integer
+ fix_in_progress:
+ type: integer
+ accepted_risk:
+ type: integer
+ triaged:
+ type: integer
+ RemediationEfficiencyData:
+ title: RemediationEfficiencyData
+ type: object
+ required:
+ - vulnerability_severity
+ - average_time_to_remediate
+ - target_time_to_remediate
+ - remediation_trend
+ - timely_remediated_count
+ - total_vulnerabilities
+ properties:
+ vulnerability_severity:
+ type: string
+ average_time_to_remediate:
+ type: integer
+ target_time_to_remediate:
+ type: integer
+ remediation_trend:
+ type: integer
+ timely_remediated_count:
+ type: integer
+ total_vulnerabilities:
+ type: integer
+ OrganizationInfo:
+ title: OrganizationInfo
+ description: Organization Information
+ properties:
+ acquirer_slug:
+ description: Slug of acquiring organization if applicable
+ type: string
+ contact_email:
+ description: Contact email address
+ type: string
+ domain:
+ description: Primary domain of the organization
+ type: string
+ image_url:
+ description: URL to organization's image
+ type: string
+ industries:
+ description: Industries of the organization
+ items:
+ type: string
+ type: array
+ legal_name:
+ description: Legal name of the organization
+ type: string
+ linkedin:
+ description: LinkedIn profile URL
+ type: string
+ name:
+ description: The organization name
+ type: string
+ num_employees_enum:
+ description: Employee count range category
+ type: string
+ org_status:
+ description: Status of the organization
+ type: string
+ short_description:
+ description: Brief description of the organization
+ type: string
+ slug:
+ description: URL-friendly identifier
+ type: string
+ subsidary_domains:
+ description: List of subsidiary domains
+ items:
+ type: string
+ type: array
+ total_subdomains:
+ description: Total number of subdomains
+ type: integer
+ total_subsidaries:
+ description: Total number of subsidiaries
+ type: integer
+ total_subsidary_domains:
+ description: Total number of subsidiary domains
+ type: integer
+ total_subsidary_subdomains:
+ description: Total number of subdomains across all subsidiary domains
+ type: integer
+ twitter:
+ description: Twitter profile URL
+ type: string
+ type: object
+ OrganizationFullInfo:
+ allOf:
+ - $ref: "#/components/schemas/OrganizationInfo"
+ - properties:
+ aliases:
+ description: List of organization aliases
+ items:
+ type: string
+ type: array
+ category_groups:
+ description: Macro level category groups (e.g. AI instead of generative_ai)
+ items:
+ type: string
+ type: array
+ created_at:
+ description: Timestamp when the organization record was created
+ format: date-time
+ type: string
+ description:
+ description: Full description of the organization
+ type: string
+ founded_on.value:
+ description: Organization founding date (YYYY-MM-DD)
+ type: string
+ rank:
+ description: Organization's rank
+ type: integer
+ subsidaries:
+ description: List of all subsidiary organizations
+ items:
+ $ref: "#/components/schemas/OrganizationInfo"
+ type: array
+ updated_at:
+ description: Timestamp when the organization record was last updated
+ format: date-time
+ type: string
+ type: object
+ RootDomainInfo:
+ title: RootDomainInfo
+ additionalProperties: false
+ description: Root Domain Information
+ properties:
+ domain:
+ description: The root domain name
+ type: string
+ image_url:
+ description: URL to domain's image
+ type: string
+ name:
+ description: The domain name
+ type: string
+ organization_slug:
+ description: Slug identifier of the associated organization
+ type: string
+ total_subdomains:
+ description: The total number of subdomains
+ type: integer
+ type: object
+ DomainSearchItem:
+ title: DomainSearchItem
+ type: object
+ required:
+ - name
+ - type
+ - search_score
+ properties:
+ domain:
+ $ref: "#/components/schemas/RootDomainInfo"
+ name:
+ description: The display name for autocomplete
+ type: string
+ organization:
+ $ref: "#/components/schemas/OrganizationInfo"
+ search_score:
+ description: The search score of the result
+ type: number
+ type:
+ description: Indicates whether this is an organization or domain result
+ enum:
+ - organization
+ - domain
+ type: string
+ OpenVulnerabilityScoreMetrics:
+ title: OpenVulnerabilityScoreMetrics
+ type: object
+ properties:
+ severity_breakdown:
+ $ref: "#/components/schemas/SeverityBreakdown"
+ total_cve:
+ type: integer
+ total_kev:
+ type: integer
+ VulnScoreMetricsTimeSeries:
+ title: VulnScoreMetricsTimeSeries
+ type: object
+ properties:
+ date:
+ type: string
+ format: date
+ security_score:
+ type: number
+ format: double
+ open_vulnerability:
+ $ref: "#/components/schemas/OpenVulnerabilityScoreMetrics"
+ total_scanned_assets:
+ type: integer
+ total_affected_assets:
+ type: integer
+ description: ""
+ SharedTemplateMetaData:
+ title: SharedTemplateMetaData
+ type: object
+ properties:
+ expires_at:
+ type: string
+ format: date-time
+ organizations:
+ type: array
+ items:
+ type: string
+ share_type:
+ type: string
+ template_id:
+ type: string
+ users_email:
+ type: array
+ items:
+ type: string
+ UploadTemplate:
+ title: UploadTemplate
+ type: object
+ properties:
+ ai_meta:
+ $ref: "#/components/schemas/AIMeta"
+ dir:
+ type: string
+ filename:
+ type: string
+ template:
+ type: string
+ TemplateFileMetadata:
+ title: TemplateFileMetadata
+ type: object
+ required:
+ - dir
+ - filename
+ - template_id
+ - uri
+ properties:
+ dir:
+ type: string
+ description: |
+ Directory of the template
+ filename:
+ type: string
+ description: |
+ Name of the template
+ template_id:
+ type: string
+ description: Template ID
+ uri:
+ type: string
+ description: URI of the template
+ description: Template File Metadata
+ FailedTemplateFileMetadataUpdate:
+ title: FailedTemplateFileMetadataUpdate
+ type: object
+ required:
+ - dir
+ - filename
+ - template_id
+ - error
+ properties:
+ dir:
+ type: string
+ description: Directory of the template
+ filename:
+ type: string
+ description: Name of the template
+ template_id:
+ type: string
+ description: Template ID
+ error:
+ type: string
+ description: Error message
+ PatchTemplateFileMetadata:
+ title: PatchTemplateFileMetadata
+ type: object
+ required:
+ - dir
+ - filename
+ - template_id
+ properties:
+ dir:
+ type: string
+ filename:
+ type: string
+ template_id:
+ type: string
+ CustomSeverityMapping:
+ title: CustomSeverityMapping
+ type: object
+ required:
+ - id
+ - template_id
+ - original_severity
+ - custom_severity
+ - created_at
+ - updated_at
+ properties:
+ id:
+ type: integer
+ format: int64
+ template_id:
+ type: string
+ original_severity:
+ type: string
+ custom_severity:
+ type: string
+ vuln_id:
+ type: string
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ DevicesCount:
+ title: DevicesCount
+ type: object
+ properties:
+ devices:
+ type: number
+ CustomersCount:
+ title: CustomersCount
+ type: object
+ properties:
+ customers:
+ type: number
+ EmployeesCount:
+ title: EmployeesCount
+ type: object
+ properties:
+ employees:
+ type: number
+ UsersCount:
+ title: UsersCount
+ type: object
+ properties:
+ user:
+ type: number
+ CombolistExposureCount:
+ title: CombolistExposureCount
+ type: object
+ properties:
+ combolist_exposure:
+ type: number
+ LeakCountryStats:
+ title: LeakCountryStats
+ type: object
+ properties:
+ Country:
+ type: string
+ CredentialsCount:
+ type: number
+ UsedUrlsCount:
+ title: UsedUrlsCount
+ type: object
+ properties:
+ Occurrences:
+ type: number
+ url:
+ type: string
+ LeaksTimeline:
+ title: LeaksTimeline
+ type: object
+ properties:
+ CredentialsCount:
+ type: number
+ Month:
+ type: number
+ Year:
+ type: number
+ LeaksUsersSampleData:
+ title: LeaksUsersSampleData
+ type: object
+ properties:
+ password:
+ type: string
+ username:
+ type: string
+ url:
+ type: string
+ country:
+ type: string
+ log_date:
+ type: string
+ LeaksEntity:
+ title: LeaksEntity
+ type: object
+ properties:
+ id:
+ type: string
+ url:
+ type: string
+ username:
+ type: string
+ password:
+ type: string
+ device_ip:
+ type: string
+ host_username:
+ type: string
+ os:
+ type: string
+ malware_path:
+ type: string
+ country:
+ type: string
+ log_date:
+ type: string
+ hardware_id:
+ type: string
+ hostname:
+ type: string
+ status:
+ $ref: "#/components/schemas/LeaksEntityStatus"
+ EnumerationHistoryDataResponse:
+ title: EnumerationHistoryDataResponse
+ type: object
+ required:
+ - enum_id
+ - name
+ - enum_type
+ - enum_started_at
+ - enum_finished_at
+ - enumeration_time
+ - status
+ - new_assets_discovered
+ - total_targets_processed
+ properties:
+ enum_id:
+ type: string
+ name:
+ type: string
+ enum_type:
+ type: string
+ enum_started_at:
+ type: string
+ format: date-time
+ enum_finished_at:
+ type: string
+ format: date-time
+ enumeration_time:
+ type: string
+ format: duration
+ status:
+ type: string
+ new_assets_discovered:
+ type: integer
+ total_targets_processed:
+ type: integer
+ error_details:
+ type: string
+ Facets:
+ title: Facets
+ type: object
+ properties:
+ buckets:
+ type: object
+ additionalProperties:
+ type: integer
+ missing:
+ type: integer
+ others:
+ type: integer
+ total:
+ type: integer
+ Vulnerability:
+ title: Vulnerability
+ allOf:
+ - $ref: "#/components/schemas/VulnerabilityInfo"
+ - $ref: "#/components/schemas/NucleiTemplate"
+ - type: object
+ properties:
+ affected_products:
+ type: array
+ items:
+ $ref: "#/components/schemas/ProductInfo"
+ created_at:
+ type: string
+ format: date-time
+ doc_id:
+ type: string
+ doc_type:
+ type: string
+ exposure:
+ $ref: "#/components/schemas/VulnExposure"
+ h1:
+ $ref: "#/components/schemas/H1Stats"
+ updated_at:
+ type: string
+ format: date-time
+ ntps:
+ type: integer
+ VulnerabilityInfo:
+ additionalProperties: false
+ allOf:
+ - $ref: "#/components/schemas/CVEInfo"
+ - properties:
+ citations:
+ description: Citations for the vulnerability/template
+ items:
+ $ref: "#/components/schemas/Citation"
+ type: array
+ cwe:
+ description: CWE IDs associated with the vulnerability
+ items:
+ type: string
+ type: array
+ description:
+ description: Description of the vulnerability/template
+ type: string
+ impact:
+ description: Impact of the vulnerability/template
+ type: string
+ name:
+ description: Name of the vulnerability/template
+ type: string
+ product:
+ description: Product associated with the vulnerability/template
+ type: string
+ remediation:
+ description: Remediation for the vulnerability/template
+ type: string
+ severity:
+ description: Severity of the vulnerability/template
+ type: string
+ vendor:
+ description: Vendor associated with the vulnerability/template
+ type: string
+ weaknesses:
+ description: Weaknesses associated with the vulnerability
+ items:
+ $ref: "#/components/schemas/Weakness"
+ type: array
+ type: object
+ type: object
+ title: ""
+ CVEInfo:
+ additionalProperties: false
+ properties:
+ age_in_days:
+ description: Age in days for the cve
+ type: integer
+ assignee:
+ description: Assignee for the cve
+ type: string
+ cve_created_at:
+ description: Created at date for the cve
+ format: date-time
+ type: string
+ cve_id:
+ description: CVE ID for the cve
+ type: string
+ cve_updated_at:
+ description: Updated at date for the cve
+ format: date-time
+ type: string
+ cvss_metrics:
+ description: CVSS Metrics for the cve
+ example: 3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
+ type: string
+ cvss_score:
+ description: CVSS Score for the cve
+ example: 9.8
+ format: double
+ type: number
+ epss_percentile:
+ description: EPSS Percentile for the template.
+ example: 0.42509
+ format: double
+ type: number
+ epss_score:
+ description: EPSS Score for the template.
+ example: 0.42509
+ format: double
+ type: number
+ is_kev:
+ description: True if the cve is a kev
+ type: boolean
+ is_vkev:
+ description: True if the cve is a vkev
+ type: boolean
+ is_oss:
+ description: True if the cve is an oss cve
+ type: boolean
+ is_patch_available:
+ description: True if the cve has a patch available
+ type: boolean
+ is_poc:
+ description: True if the cve has a poc
+ type: boolean
+ is_remote:
+ description: True if the cve is a remote cve
+ type: boolean
+ is_template:
+ description: True if the cve has a template
+ type: boolean
+ kev:
+ description: KEV info for the cve
+ items:
+ $ref: "#/components/schemas/KevInfo"
+ type: array
+ poc_count:
+ description: Count of pocs for the vulnerability
+ type: integer
+ pocs:
+ description: Contains all known proof of concepts for the vulnerability
+ items:
+ $ref: "#/components/schemas/POC"
+ type: array
+ vuln_status:
+ description: Status of the cve
+ type: string
+ type: object
+ KevInfo:
+ title: KevInfo
+ type: object
+ properties:
+ added_date:
+ type: string
+ format: date-time
+ due_date:
+ type: string
+ format: date-time
+ known_ransomware_campaign_use:
+ type: boolean
+ source:
+ type: string
+ POC:
+ title: POC
+ type: object
+ properties:
+ added_at:
+ type: string
+ format: date-time
+ source:
+ type: string
+ url:
+ type: string
+ Citation:
+ title: Citation
+ type: object
+ properties:
+ source:
+ type: string
+ description: Source for the citation
+ tags:
+ type: array
+ description: Tags for the citation
+ items:
+ type: string
+ url:
+ type: string
+ description: Url for the citation
+ Weakness:
+ title: Weakness
+ type: object
+ properties:
+ cwe_id:
+ type: string
+ description: CWE ID for the weakness
+ cwe_name:
+ type: string
+ description: CWE Name for the weakness
+ NucleiTemplate:
+ title: NucleiTemplate
+ allOf:
+ - $ref: "#/components/schemas/TemplateSourceMeta"
+ - $ref: "#/components/schemas/TemplateStatus"
+ - $ref: "#/components/schemas/TemplateFileMeta"
+ - $ref: "#/components/schemas/TemplateContent"
+ - $ref: "#/components/schemas/TemplateSharingMetadata"
+ - type: object
+ properties:
+ ai_meta:
+ $ref: "#/components/schemas/AIMeta"
+ classification:
+ $ref: "#/components/schemas/Classification"
+ id:
+ type: string
+ TemplateSharingMetadata:
+ properties:
+ organizations:
+ description: Organizations of the template
+ items:
+ type: string
+ type: array
+ origin_template_id:
+ description: Origin template ID of the template
+ type: string
+ share_type:
+ description: Share type of the template
+ type: string
+ ttl:
+ description: TTL of the template
+ type: string
+ ttl_from:
+ description: TTL from of the template
+ type: string
+ users:
+ description: Users of the template
+ items:
+ type: integer
+ type: array
+ type: object
+ TemplateSourceMeta:
+ properties:
+ category:
+ description: Category of the template
+ type: string
+ integration_id:
+ description: Integration ID of the template
+ type: string
+ integration_type:
+ description: Integration type of the template
+ type: string
+ pull_request:
+ description: Pull request of the template
+ type: string
+ ref:
+ description: Reference of the template
+ type: string
+ release_tag:
+ description: Release tag of the template
+ type: string
+ score:
+ description: Score of the template
+ type: integer
+ template_type:
+ description: Type of the template
+ type: string
+ type: object
+ TemplateStatus:
+ properties:
+ is_draft:
+ description: Is the template a draft
+ type: boolean
+ is_early:
+ description: Is the template in early access
+ type: boolean
+ is_github:
+ description: Is the template from github
+ type: boolean
+ is_new:
+ description: Is the template new
+ type: boolean
+ is_pdresearch:
+ description: Is the template from pdresearch
+ type: boolean
+ is_pdteam:
+ description: Is the template from pdteam
+ type: boolean
+ is_pdtemplate:
+ description: Is the template from pdtemplate
+ type: boolean
+ type: object
+ TemplateFileMeta:
+ title: TemplateFileMeta
+ type: object
+ properties:
+ directory:
+ type: string
+ description: Directory of template
+ filename:
+ type: string
+ description: |
+ Filename of template
+ uri:
+ type: string
+ description: Uri of template
+ TemplateContent:
+ title: TemplateContent
+ type: object
+ properties:
+ author:
+ type: array
+ description: Authors of the template
+ items:
+ type: string
+ digest:
+ type: string
+ description: Digest of the template
+ metadata:
+ type: object
+ description: MetaData of the template
+ raw:
+ type: string
+ description: Raw string of the template
+ tags:
+ type: array
+ description: Tags of the template
+ items:
+ type: string
+ type:
+ type: string
+ description: Type of the template
+ ProductInfo:
+ title: ProductInfo
+ type: object
+ properties:
+ cpe:
+ type: array
+ items:
+ type: string
+ product:
+ type: string
+ project_repos:
+ type: object
+ projects:
+ type: array
+ items:
+ type: string
+ vendor:
+ type: string
+ product_category:
+ type: string
+ product_type:
+ type: string
+ industry:
+ type: string
+ tech_domain:
+ type: string
+ is_pd:
+ type: boolean
+ SearchEngineStats:
+ title: SearchEngineStats
+ type: object
+ properties:
+ max_hosts:
+ type: integer
+ description: Maximum number of hosts for the product
+ min_hosts:
+ type: integer
+ description: Minimum number of hosts for the product
+ queries:
+ type: array
+ description: Queries for the product
+ items:
+ type: string
+ ExposureStats:
+ title: ExposureStats
+ type: object
+ properties:
+ fofa:
+ $ref: "#/components/schemas/SearchEngineStats"
+ id:
+ type: string
+ max_hosts:
+ type: integer
+ min_hosts:
+ type: integer
+ shodan:
+ $ref: "#/components/schemas/SearchEngineStats"
+ VulnExposure:
+ title: VulnExposure
+ type: object
+ properties:
+ max_hosts:
+ type: integer
+ min_hosts:
+ type: integer
+ values:
+ type: array
+ items:
+ $ref: "#/components/schemas/ExposureStats"
+ H1Stats:
+ title: H1Stats
+ type: object
+ properties:
+ delta_rank:
+ type: integer
+ delta_reports:
+ type: integer
+ rank:
+ type: integer
+ reports:
+ type: integer
+ StatisticsResponse:
+ title: StatisticsResponse
+ type: object
+ properties:
+ status_code_stats:
+ type: object
+ additionalProperties:
+ type: integer
+ error_stats:
+ type: object
+ additionalProperties:
+ type: integer
+ waf_stats:
+ type: object
+ additionalProperties:
+ type: integer
+ LeaksEntityStatus:
+ title: LeaksEntityStatus
+ enum:
+ - fixed
+ - unfixed
+ - NA
+ securitySchemes:
+ X-API-Key:
+ name: X-API-Key
+ type: apiKey
+ in: header
+ responses:
+ GetTemplateDataResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ properties:
+ message:
+ type: string
+ data:
+ $ref: "#/components/schemas/TemplateData"
+ GetTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ properties:
+ message:
+ type: string
+ template:
+ $ref: "#/components/schemas/TemplateData"
+ application/xml:
+ schema:
+ type: object
+ properties: {}
+ examples: {}
+ CreateTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ - template_id
+ - template_name
+ properties:
+ message:
+ type: string
+ template_id:
+ type: string
+ template_name:
+ type: string
+ template:
+ $ref: "#/components/schemas/TemplateData"
+ UpdateTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ - template_id
+ - template_name
+ properties:
+ message:
+ type: string
+ status:
+ type: boolean
+ template_id:
+ type: string
+ template_name:
+ type: string
+ template:
+ $ref: "#/components/schemas/TemplateData"
+ GenerateTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ properties:
+ template_id:
+ type: string
+ message:
+ type: string
+ completion:
+ type: string
+ name:
+ type: string
+ canRun:
+ type: boolean
+ comment:
+ type: string
+ is_valid:
+ type: boolean
+ retry_count:
+ type: integer
+ feedback:
+ type: string
+ targets:
+ type: array
+ items:
+ type: string
+ retest:
+ type: array
+ items:
+ type: object
+ properties:
+ target:
+ type: string
+ matched:
+ type: boolean
+ vuln_id:
+ type: string
+ ShareTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ - result
+ properties:
+ message:
+ type: string
+ result:
+ $ref: "#/components/schemas/SharedTemplateMetaData"
+ GetSharedTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ - result
+ properties:
+ message:
+ type: string
+ result:
+ $ref: "#/components/schemas/SharedTemplateData"
+ GetUserProfileResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ properties:
+ ai_status:
+ type: boolean
+ email:
+ type: string
+ name:
+ type: string
+ message:
+ type: string
+ cloud_scans:
+ type: boolean
+ static_scan:
+ type: boolean
+ early_template:
+ type: boolean
+ team_name:
+ type: string
+ is_team_owner:
+ type: boolean
+ is_read_only:
+ type: boolean
+ team_owner_name:
+ type: string
+ trial_status:
+ type: string
+ role:
+ type: string
+ plan:
+ type: string
+ personal_account_plan:
+ type: string
+ applied_promo_code:
+ type: string
+ full_port_scan:
+ type: boolean
+ workspaces:
+ type: array
+ items:
+ $ref: "#/components/schemas/UserWorkspaces"
+ DeleteTemplateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ status:
+ type: boolean
+ required:
+ - message
+ GetPublicTemplateList:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ - count
+ - total
+ - results
+ properties:
+ message:
+ type: string
+ count:
+ type: integer
+ total:
+ type: integer
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/TemplateData"
+ GetRetestResultsResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnerabilityResults"
+ required:
+ - message
+ - results
+ application/xml:
+ schema:
+ type: object
+ properties: {}
+ GetSingleRetestResultResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ results:
+ $ref: "#/components/schemas/VulnerabilityResults"
+ required:
+ - message
+ - results
+ GetScansStatusResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ message:
+ type: string
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanStatusItem"
+ required:
+ - message
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - data
+ TriggerUserScanResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - message
+ properties:
+ id:
+ type: string
+ message:
+ type: string
+ truncated-scan-targets:
+ type: integer
+ application/xml:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ id:
+ type: string
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ id:
+ type: string
+ required:
+ - message
+ text/html:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ id:
+ type: string
+ required:
+ - message
+ GetScanDetailsResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ScanStatusItem"
+ DeleteScansResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
+ type: string
+ ok:
+ type: boolean
+ required:
+ - message
+ GetScanResultsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - message
+ - data
properties:
- template:
- type: string
- template_id:
- type: string
- prompt:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ message:
type: string
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnerabilityResults"
+ stats:
+ type: object
+ properties:
+ total:
+ type: integer
+ filters:
+ type: object
+ GetVulnChangelogsResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - template
- - template_id
- CreateTemplateRequest:
+ - data
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnerabilityChangelogs"
+ PostRetestTemplateResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- template:
+ message:
type: string
- GenerateTemplateRequest:
+ results:
+ $ref: "#/components/schemas/VulnerabilityResults"
+ required:
+ - message
+ GetScansVulnIdResponse:
+ description: /scans/vuln/:vuln_id
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/VulnerabilityResultsOld"
+ ImportScanResponse:
+ description: ""
content:
application/json:
schema:
type: object
+ description: Scan is a single scan object
properties:
- prompt:
+ id:
+ type: string
+ message:
type: string
required:
- - prompt
- RetestTemplateRequest:
+ - id
+ - message
+ GetAssetsListResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- template_encoded:
+ message:
type: string
- target:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/AssetListItem"
+ required:
+ - message
+ - data
+ UploadAssetResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ message:
type: string
- template_path:
+ upload_status:
type: string
- template_url:
+ asset_id:
type: string
- template_id:
+ uploaded_at:
type: string
- vuln_id:
+ name:
type: string
- ShareTemplateRequest:
+ required:
+ - message
+ GetUserAssetResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- template_id:
+ message:
+ type: string
+ asset_count:
+ type: integer
+ asset_id:
+ type: string
+ uploaded_at:
+ type: string
+ name:
type: string
- is_public:
- type: boolean
required:
- - template_id
- - is_public
- TriggerUserScanRequest:
+ - message
+ DeleteAssetResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- targets:
- type: array
- items:
- type: string
- templates:
- type: array
- items:
- type: string
- assets:
- type: array
- items:
- type: string
- private_templates:
- type: array
- items:
- $ref: '#/components/schemas/PrivateTemplates'
- name:
- type: string
- recommended:
- type: boolean
- all:
- type: boolean
- alerting_config_ids:
- type: array
- items:
- type: string
- scan_config_ids:
- type: array
- items:
- type: string
- reporting_config_ids:
- type: array
- items:
- type: string
- early_templates:
- type: array
- items:
- type: string
- exclude_targets:
- type: array
- items:
- type: string
- enumeration_ids:
- type: array
- items:
- $ref: '#/components/schemas/EnumerationIds'
- schedule_only:
- type: boolean
- disable_global_alert_config:
- type: boolean
- disable_global_report_config:
- type: boolean
- disable_global_scan_config:
- type: boolean
- socks5_proxy:
+ message:
type: string
- SetScanScheduleRequest:
+ required:
+ - message
+ GetUserAPIKeyResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- scan_id:
+ message:
type: string
- scan_frequency:
- $ref: '#/components/schemas/SchedulerFrequency'
- start_time:
+ api_key:
type: string
- format: time
- hourly_frequency:
- type: integer
- maximum: 24
- minimum: 1
- custom_weekdays:
- description: |-
- 0-6 denoting Sunday-Saturday.
- It accepts an array of weekday
- type: array
- items:
- type: integer
- minimum: 0
- maximum: 6
required:
- - scan_id
- - scan_frequency
- SetEnumerationScheduleRequest:
+ - message
+ - api_key
+ DeleteUserAPIKeyResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- enumeration_id:
- type: string
- scan_frequency:
- $ref: '#/components/schemas/SchedulerFrequency'
- start_time:
+ message:
type: string
- format: time
- hourly_frequency:
- type: integer
- maximum: 24
- minimum: 1
- custom_weekdays:
- description: |-
- 0-6 denoting Sunday-Saturday.
- It accepts an array of weekday
- type: array
- items:
- type: integer
- minimum: 0
- maximum: 6
required:
- - enumeration_id
- - scan_frequency
- UpdateAssetRequest:
+ - message
+ GetScanResultsFiltersResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - data
+ - new_matched
properties:
- name:
+ message:
type: string
- required:
- - name
- UpdateScanRequest:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/FiltersItem"
+ new_matched:
+ type: integer
+ GetScanResultStatsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- name:
+ message:
type: string
+ stats:
+ $ref: "#/components/schemas/ScanStats"
required:
- - name
- PostFeedbackRequest:
+ - message
+ SetScanScheduleResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- feedback_text:
+ message:
type: string
required:
- - feedback_text
- PatchUserProfile:
+ - message
+ GetScanScheduleResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- email:
+ message:
type: string
- ai_status:
- type: boolean
- scan_status:
- type: boolean
- static_scan:
- type: boolean
- early_template:
- type: boolean
- max_team:
- type: integer
- read_only:
- type: boolean
- audit_log:
- type: boolean
+ schedules:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanSchedule"
required:
- - email
- CreateTeamRequest:
+ - message
+ - schedules
+ PatchAssetContentResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- name:
+ message:
+ type: string
+ update_status:
type: string
required:
- - name
- AddTeamMemberRequest:
+ - message
+ GetUserTemplateListResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - results
properties:
- email:
+ message:
type: string
- required:
- - email
- DeleteTeamMemberRequest:
+ count:
+ type: integer
+ total:
+ type: integer
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/TemplateData"
+ GetShareStatusResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
- email:
+ count:
+ type: integer
+ message:
type: string
- required:
- - email
- InviteTeamMemberRequest:
+ total:
+ type: integer
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/SharedTemplateData"
+ DeleteScanScheduleResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- invite_code:
+ message:
type: string
required:
- - invite_code
- PatchTeamMemberRequest:
+ - message
+ PostApiKeyRotateResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- email:
+ message:
type: string
- role:
+ api_key:
type: string
required:
- - email
- AdminAddTeamMemberRequest:
+ - message
+ - api_key
+ GetUserSetupStatsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- owner_email:
- type: string
- member_email:
+ message:
type: string
+ onboarding_steps:
+ type: object
+ properties:
+ vulnerability_scan:
+ type: boolean
+ asset_discovery:
+ type: boolean
+ alerting_integration:
+ type: boolean
+ reporting_integration:
+ type: boolean
+ cloud_integration:
+ type: boolean
+ subfinder_integration:
+ type: boolean
+ vulnerability_upload:
+ type: boolean
+ realtime_autoscan:
+ type: boolean
+ team_member_invitation:
+ type: boolean
required:
- - owner_email
- - member_email
- PatchScanVulnsRequest:
+ - message
+ - onboarding_steps
+ GetBillingAssetsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- vuln_ids:
- type: array
- items:
- type: string
- vuln_status:
- $ref: '#/components/schemas/VulnStatusEnum'
- type:
- type: string
- scan_id:
- type: string
- severity:
- type: array
- items:
- type: string
- host:
- type: array
- items:
- type: string
- template:
+ total_asset:
+ type: integer
+ total_unique_asset:
+ type: integer
+ total_billing_asset:
+ type: integer
+ total_unique_billing_asset:
+ type: integer
+ total_asset_group:
+ type: integer
+ asset_groups:
type: array
items:
- type: string
- search:
- type: string
- required:
- - vuln_status
- PatchScanVulnsLabelsRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ total_unique_asset:
+ type: integer
+ total_asset:
+ type: integer
+ total_billing_asset:
+ type: integer
+ total_unique_billing_asset:
+ type: integer
+ GetPromocodeDetailsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - promo_code
+ - allowed_plan
+ - valid_for_days
+ - base_domain_count
+ - scan_tokens
properties:
- ids:
- type: array
- items:
- type: string
- type:
+ message:
type: string
- labels:
+ promo_code:
+ type: string
+ allowed_plan:
type: array
items:
type: string
- required:
- - ids
- VerifyConfigRequest:
+ valid_for_days:
+ type: integer
+ base_domain_count:
+ type: integer
+ scan_tokens:
+ type: integer
+ MessageResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
- config:
- type: string
- config_type:
+ message:
type: string
- required:
- - config
- VerifyConfigContentsRequest:
+ PatchUserProfileResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- config:
- type: string
- config_type:
+ message:
type: string
+ ai_status:
+ type: boolean
+ scan_status:
+ type: boolean
+ static_scan:
+ type: boolean
+ early_template:
+ type: boolean
required:
- - config
- DeleteVulnsRequest:
+ - message
+ PostCreateUserResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- ids:
- type: array
- items:
- type: string
- type:
+ message:
type: string
- vuln_status:
- type: array
- items:
- type: string
- scan_id:
+ ai_status:
+ type: boolean
+ scan_status:
+ type: boolean
+ static_scan:
+ type: boolean
+ early_template:
+ type: boolean
+ user_id:
+ type: integer
+ name:
type: string
- severity:
- type: array
- items:
- type: string
- host:
- type: array
- items:
- type: string
- template:
- type: array
- items:
- type: string
- search:
+ email:
type: string
- CreateContributeRequest:
+ role:
+ type: string
+ invite_url:
+ type: string
+ password:
+ type: string
+ required:
+ - message
+ PostRescanVulnResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- email:
- type: string
- name:
- type: string
- template:
+ message:
type: string
- anonymous:
- type: boolean
+ results:
+ $ref: "#/components/schemas/VulnerabilityResultsOld"
required:
- - template
- - anonymous
- ExcludeConfigRequest:
+ - message
+ GetEarlyTempateList:
+ description: Early Template Response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
- values:
+ message:
+ type: string
+ total:
+ type: integer
+ count:
+ type: integer
+ results:
type: array
items:
- type: string
- required:
- - values
- DeleteExcludedConfigRequest:
+ $ref: "#/components/schemas/TemplateData"
+ UpdateTeamResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- ids:
- type: array
- items:
- type: integer
- format: int64
+ name:
+ type: string
+ message:
+ type: string
required:
- - ids
- UpdateEnumeratedAssetRequest:
+ - message
+ GetTeamResponse:
+ description: Get the workspace details
content:
application/json:
schema:
type: object
properties:
- labels:
+ workspaces:
type: array
items:
- type: string
+ $ref: "#/components/schemas/WorkspaceItem"
+ message:
+ type: string
name:
type: string
- PatchTeamAdmin:
+ required:
+ - message
+ GetTeamMembersResponse:
+ description: Example response
content:
application/json:
schema:
type: object
properties:
- max_members:
+ message:
+ type: string
+ max_team_members:
type: integer
+ members:
+ type: array
+ items:
+ $ref: "#/components/schemas/TeamMemberItem"
required:
- - max_members
- UsageRequest:
+ - message
+ - members
+ - max_team_members
+ StaticScanIPsResponse:
+ description: ""
content:
application/json:
schema:
type: object
- properties:
- range:
- $ref: '#/components/schemas/UsageRangeEnum'
- startDate:
- type: string
- endDate:
- type: string
required:
- - range
- AdminSetUsageLimit:
+ - ips
+ properties:
+ ips:
+ type: array
+ items:
+ type: object
+ required:
+ - ip
+ properties:
+ ip:
+ type: string
+ GetEnumerateIdContents:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - message
+ - data
properties:
- email:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ message:
type: string
- format: email
- chaos_allowed_requests:
- type: number
- cvemap_allowed_requests:
- type: number
- asnmap_allpwed_requests:
- type: number
- required:
- - email
- AdminUsageRequest:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationContent"
+ GetEnumerateIdContentsResponse:
+ description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - data
properties:
- email:
- type: string
- format: email
- range:
- $ref: '#/components/schemas/UsageRangeEnum'
- startDate:
- type: string
- endDate:
+ message:
type: string
- required:
- - email
- - range
- responses:
- GetTemplateResponse:
+ data:
+ $ref: "#/components/schemas/EnumerateData"
+ GetEnumerationScheduleResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - schedules
properties:
- prompt:
- type: string
message:
type: string
- template:
- type: string
- is_public:
- type: boolean
- required:
- - message
- application/xml:
- schema:
- type: object
- CreateTemplateResponse:
+ schedules:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationSchedule"
+ VerifyConfigResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - is_verified
+ - response
properties:
- message:
- type: string
- status:
+ is_verified:
type: boolean
- template_id:
- type: string
- template_name:
+ response:
type: string
- required:
- - message
- - template_id
- - template_name
- UpdateTemplateResponse:
+ VerifyConfigContentsResponse:
description: Example response
content:
application/json:
schema:
type: object
properties:
- message:
- type: string
- status:
- type: boolean
- template_id:
- type: string
- template_name:
- type: string
- required:
- - message
- - template_id
- - template_name
- GenerateTemplateResponse:
+ jira:
+ type: array
+ items:
+ type: object
+ $ref: "#/components/schemas/JiraVerifyContentItem"
+ linear:
+ type: array
+ items:
+ type: object
+ $ref: "#/components/schemas/LinearVerifyContentItem"
+ ScanStatsResponse:
description: Example response
content:
application/json:
schema:
type: object
- properties:
- template_id:
- type: string
- message:
- type: string
- completion:
- type: string
- name:
- type: string
required:
- - message
- ShareTemplateResponse:
+ - scan_stats
+ - scan_status
+ properties:
+ scan_stats:
+ type: object
+ required:
+ - total_scan
+ - total_unique_scan
+ - total_uploaded_scan
+ - total_scheduled_scan
+ properties:
+ total_scan:
+ type: integer
+ total_unique_scan:
+ type: integer
+ total_uploaded_scan:
+ type: integer
+ total_scheduled_scan:
+ type: integer
+ scan_status:
+ type: object
+ required:
+ - failed
+ - finished
+ - queued
+ - running
+ - starting
+ - stopped
+ - uploaded
+ properties:
+ failed:
+ type: integer
+ finished:
+ type: integer
+ queued:
+ type: integer
+ running:
+ type: integer
+ starting:
+ type: integer
+ stopped:
+ type: integer
+ uploaded:
+ type: integer
+ GetScansHistoryResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - message
+ - data
properties:
message:
type: string
- template_id:
- type: string
- status:
- type: boolean
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScansHistoryItems"
+ total_completed_request:
+ type: integer
+ total_scan_run:
+ type: integer
+ total_unique_scan_run:
+ type: integer
+ EnumerateResponse:
+ description: Example response
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- GetSharedTemplateResponse:
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - data
+ properties:
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerateData"
+ PostScanConfigResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
- template:
- type: string
- template_name:
+ id:
type: string
message:
type: string
- required:
- - message
- GetUserProfileResponse:
+ ErrorResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
- ai_status:
- type: boolean
- email:
- type: string
- name:
- type: string
message:
type: string
- cloud_scans:
- type: boolean
- static_scan:
- type: boolean
- early_template:
- type: boolean
- team_name:
+ kind:
type: string
- is_team_owner:
- type: boolean
- is_read_only:
- type: boolean
- team_owner_name:
+ code:
type: string
- trial_status:
+ error:
type: string
- role:
+ error_id:
type: string
- plan:
+ param:
type: string
- workspaces:
- type: array
- items:
- $ref: '#/components/schemas/UserWorkspaces'
- required:
- - message
- DeleteTemplateResponse:
+ status:
+ type: integer
+ VulnsTrackerExportResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - ok
+ - vuln_id
+ - reporting_config_id
+ - reporting_config_name
+ - ticket_url
+ - ticket_id
+ - tracker_name
properties:
- message:
- type: string
- status:
+ ok:
type: boolean
- required:
- - message
- GetPublicTemplateList:
+ vuln_id:
+ type: string
+ reporting_config_id:
+ type: string
+ reporting_config_name:
+ type: string
+ ticket_url:
+ type: string
+ ticket_id:
+ type: string
+ tracker_name:
+ type: string
+ ExcludedTemplateResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - data
properties:
- version:
- type: string
data:
type: array
items:
- $ref: '#/components/schemas/PublicTemplateListItem'
- required:
- - version
- - data
- GetRetestResultsResponse:
+ $ref: "#/components/schemas/ExcludedTemplate"
+ GetScansTokenResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - scan_tokens
+ - used_scan_token
+ - remaining_scan_token
+ - is_scannable
+ - start_date
+ - end_date
+ - subscription_type
+ - base_domain_count
+ - remaining_domain_count
properties:
- message:
+ scan_tokens:
+ type: integer
+ format: int64
+ used_scan_token:
+ type: integer
+ format: int64
+ remaining_scan_token:
+ type: integer
+ format: int64
+ base_domain_count:
+ type: integer
+ format: int64
+ remaining_domain_count:
+ type: integer
+ format: int64
+ is_scannable:
+ type: boolean
+ start_date:
type: string
- results:
+ format: date-time
+ end_date:
+ type: string
+ format: date-time
+ expire_date:
+ type: string
+ format: date-time
+ verified_domain:
type: array
items:
- $ref: '#/components/schemas/VulnerabilityResults'
- required:
- - message
- - results
- application/xml:
- schema:
- type: object
- GetSingleRetestResultResponse:
+ type: string
+ old_plan:
+ type: string
+ old_plan_expired_at:
+ type: string
+ format: date-time
+ subscription_type:
+ enum:
+ - TRIAL
+ - ENT_TRIAL
+ - PRO
+ - ENT
+ - FREE
+ - VERIFIED_FREE
+ - GROWTH
+ AssetCountResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - asset_count
properties:
message:
type: string
- results:
- $ref: '#/components/schemas/VulnerabilityResults'
- required:
- - message
- - results
- GetScansStatusResponse:
+ asset_count:
+ type: integer
+ GetAssetChangelogsResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - data
properties:
+ message:
+ type: string
current_page:
type: integer
result_count:
@@ -7324,1043 +9222,1125 @@ components:
type: integer
total_pages:
type: integer
- message:
- type: string
data:
type: array
items:
- $ref: '#/components/schemas/ScanStatusItem'
- required:
- - message
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- TriggerUserScanResponse:
+ type: object
+ $ref: "#/components/schemas/AssetChangelogs"
+ GetAssetResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - id
+ - enumeration_id
+ - name
+ - created_at
+ - updated_at
properties:
id:
+ type: integer
+ format: int64
+ enumeration_id:
type: string
- message:
+ name:
type: string
- truncated-scan-targets:
+ created_at:
+ type: string
+ format: date-time
+ updated_at:
+ type: string
+ format: date-time
+ status_code:
type: integer
- required:
- - message
- application/xml:
- schema:
- type: object
- properties:
- message:
+ technologies:
+ type: array
+ items:
+ type: string
+ webserver:
type: string
- id:
+ request:
type: string
- multipart/form-data:
- schema:
- type: object
- properties:
- message:
+ response:
type: string
- id:
+ cname:
+ type: array
+ items:
+ type: string
+ labels:
+ type: array
+ items:
+ type: string
+ ip:
type: string
- required:
- - message
- text/html:
- schema:
- type: object
- properties:
- message:
+ content_length:
+ type: integer
+ title:
type: string
- id:
+ host:
type: string
- required:
- - message
- GetScanDetailsResponse:
- description: Example response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ScanStatusItem'
- DeleteScansResponse:
+ port:
+ type: integer
+ technology_details:
+ type: string
+ format: json
+ is_new:
+ type: boolean
+ body:
+ type: string
+ EnumerationStatsResponse:
description: Example response
content:
application/json:
schema:
type: object
- properties:
- message:
- type: string
- ok:
- type: boolean
required:
- - message
- GetScanResultsResponse:
+ - asset_stats
+ properties:
+ asset_stats:
+ $ref: "#/components/schemas/AssetStats"
+ enumeration_stats:
+ $ref: "#/components/schemas/EnumerationCounts"
+ PriceListResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - list
+ - message
properties:
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- message:
- type: string
- data:
+ list:
type: array
items:
- $ref: '#/components/schemas/VulnerabilityResults'
- stats:
- type: object
- properties:
- total:
- type: integer
- filters:
- type: object
- required:
- - current_page
- - result_count
- - total_results
- - total_pages
- - message
- - data
- PostRetestTemplateResponse:
+ $ref: "#/components/schemas/PriceListItem"
+ message:
+ type: string
+ GetScanTokenErrorResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - subscription_type
properties:
message:
type: string
- results:
- $ref: '#/components/schemas/VulnerabilityResults'
- required:
- - message
- GetScansVulnIdResponse:
- description: '/scans/vuln/:vuln_id'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VulnerabilityResultsOld'
- ImportScanResponse:
- description: ''
+ subscription_type:
+ type: string
+ UsageResponse:
+ description: Example response
content:
application/json:
schema:
- description: Scan is a single scan object
type: object
+ required:
+ - message
properties:
- id:
- type: string
message:
type: string
- required:
- - id
- - message
- GetAssetsListResponse:
+ cvemap:
+ $ref: "#/components/schemas/ServiceUsageItem"
+ chaos:
+ $ref: "#/components/schemas/ServiceUsageItem"
+ asnmap:
+ $ref: "#/components/schemas/ServiceUsageItem"
+ GetEnumerateFiltersResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - current_page
+ - result_count
+ - total_results
+ - total_pages
+ - data
properties:
message:
type: string
+ current_page:
+ type: integer
+ result_count:
+ type: integer
+ total_results:
+ type: integer
+ total_pages:
+ type: integer
data:
type: array
items:
- $ref: '#/components/schemas/AssetListItem'
- required:
- - message
- - data
- UploadAssetResponse:
+ $ref: "#/components/schemas/EnumerateFiltersItem"
+ GetUserTunnelResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
properties:
message:
type: string
- upload_status:
- type: string
- asset_id:
- type: string
- uploaded_at:
- type: string
- name:
- type: string
- required:
- - message
- GetUserAssetResponse:
+ tunnels:
+ type: array
+ items:
+ $ref: "#/components/schemas/TunnelItem"
+ ExposureMetricsResponse:
description: Example response
content:
application/json:
schema:
type: object
properties:
- message:
- type: string
- asset_count:
+ total_assets:
type: integer
- asset_id:
- type: string
- uploaded_at:
- type: string
- name:
- type: string
- required:
- - message
- DeleteAssetResponse:
+ new_assets:
+ type: integer
+ unique_technologies:
+ type: integer
+ new_technologies:
+ type: integer
+ total_hosts:
+ type: integer
+ new_hosts:
+ type: integer
+ time_series:
+ type: array
+ items:
+ $ref: "#/components/schemas/ExposuresTimeSeries"
+ ScanExposureMetricsResponse:
description: Example response
content:
application/json:
schema:
type: object
properties:
- message:
- type: string
- required:
- - message
- GetUserAPIKeyResponse:
+ new_vulnerability:
+ type: integer
+ open_vulnerability:
+ type: integer
+ fixed_vulnerability:
+ type: integer
+ time_series:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanExposuresTimeSeries"
+ ScanRegressionRemediationMetricsResponse:
description: Example response
content:
application/json:
schema:
type: object
properties:
- message:
+ regression_rate:
+ type: integer
+ avg_remediation_time:
type: string
- api_key:
+ regression_state:
type: string
- required:
- - message
- - api_key
- DeleteUserAPIKeyResponse:
+ total_fixed:
+ type: integer
+ total_count:
+ type: integer
+ severity_breakdown:
+ $ref: "#/components/schemas/SeverityBreakdown"
+ status_breakdown:
+ $ref: "#/components/schemas/StatusBreakdown"
+ time_series:
+ type: array
+ items:
+ $ref: "#/components/schemas/ScanRegressionRemediationTimeSeries"
+ GetAutomationsListResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - automations
properties:
message:
type: string
- required:
- - message
- GetScanResultsFiltersResponse:
+ automations:
+ type: array
+ items:
+ $ref: "#/components/schemas/GetAutomationsListItem"
+ GetAutomationIdResponse:
description: Example response
content:
application/json:
schema:
type: object
- properties:
- message:
- type: string
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- data:
- type: array
- items:
- $ref: '#/components/schemas/FiltersItem'
- new_matched:
- type: integer
required:
- - message
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- - new_matched
- GetScanResultStatsResponse:
+ - message
+ properties:
+ message:
+ type: string
+ automation:
+ $ref: "#/components/schemas/GetAutomationItem"
+ AdminAutomationsResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - automations
properties:
message:
type: string
- stats:
- $ref: '#/components/schemas/ScanStats'
- required:
- - message
- SetScanScheduleResponse:
+ automations:
+ type: array
+ items:
+ $ref: "#/components/schemas/AdminAutomationsItem"
+ BillingCycleResponse:
description: Example response
content:
application/json:
schema:
type: object
- properties:
- message:
- type: string
required:
- - message
- GetScanScheduleResponse:
+ - cycles
+ properties:
+ cycles:
+ type: array
+ items:
+ $ref: "#/components/schemas/BillingCycle"
+ GetRemediationEfficiencyResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - remediation_efficiency
+ - remediation_state
+ - data
properties:
- message:
+ remediation_efficiency:
+ type: integer
+ remediation_state:
type: string
- schedules:
+ data:
type: array
items:
- $ref: '#/components/schemas/ScanSchedule'
- required:
- - message
- - schedules
- PatchAssetContentResponse:
+ $ref: "#/components/schemas/RemediationEfficiencyData"
+ VulnScoreMetricsResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - security_score
+ - security_state
+ - open_vulnerability
+ - total_scanned_assets
+ - total_affected_assets
+ - time_series
properties:
- message:
- type: string
- update_status:
+ security_score:
+ type: number
+ format: double
+ security_state:
type: string
- required:
- - message
- GetUserTemplateListResponse:
- description: Example response
+ open_vulnerability:
+ $ref: "#/components/schemas/OpenVulnerabilityScoreMetrics"
+ total_scanned_assets:
+ type: integer
+ total_affected_assets:
+ type: integer
+ time_series:
+ type: array
+ items:
+ $ref: "#/components/schemas/VulnScoreMetricsTimeSeries"
+ DomainSearchResults:
+ description: Domain Search Results
content:
application/json:
schema:
type: object
+ required:
+ - count
+ - results
+ - total
properties:
- data:
+ count:
+ type: integer
+ results:
type: array
items:
- $ref: '#/components/schemas/templateListItem'
- message:
- type: string
- required:
- - data
- - message
- GetShareStatusResponse:
- description: Example response
+ $ref: "#/components/schemas/DomainSearchItem"
+ total:
+ type: integer
+ OrganizationSearchResults:
+ description: Organization Search Results
content:
application/json:
schema:
type: object
- properties:
- is_public:
- type: boolean
- template_identifier:
- type: string
- message:
- type: string
required:
- - message
- DeleteScanScheduleResponse:
+ - count
+ - results
+ - total
+ properties:
+ count:
+ type: integer
+ results:
+ type: array
+ items:
+ $ref: "#/components/schemas/OrganizationFullInfo"
+ total:
+ type: integer
+ UpdateSharedTemplateResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - result
properties:
message:
type: string
- required:
- - message
- PostApiKeyRotateResponse:
+ result:
+ $ref: "#/components/schemas/SharedTemplateMetaData"
+ GetSeverityConfigResponse:
description: Example response
content:
application/json:
schema:
type: object
- properties:
- message:
- type: string
- api_key:
- type: string
required:
- - message
- - api_key
- MessageResponse:
+ - custom_severity_mappings
+ properties:
+ custom_severity_mappings:
+ type: array
+ items:
+ $ref: "#/components/schemas/CustomSeverityMapping"
+ PostSeverityConfigResponse:
description: Example response
content:
application/json:
schema:
type: object
+ required:
+ - message
+ - id
properties:
+ id:
+ type: integer
+ format: int64
message:
type: string
+ parameters:
+ template_id:
+ name: template_id
+ in: query
+ schema:
+ type: string
+ description: short uuid of requested template
+ required: true
+ user_name:
+ name: user_name
+ in: query
+ required: true
+ schema:
+ type: string
+ description: user name of logged in user
+ requestBodies:
+ DeleteAssetsRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- PatchUserProfileResponse:
- description: Example response
+ - filters
+ properties:
+ filters:
+ $ref: "#/components/schemas/AssetFilters"
+ UpdateAssetLabelsRequest:
content:
application/json:
schema:
type: object
+ required:
+ - filters
+ - labels
properties:
- message:
- type: string
- ai_status:
- type: boolean
- scan_status:
- type: boolean
- static_scan:
- type: boolean
- early_template:
- type: boolean
+ filters:
+ $ref: "#/components/schemas/AssetFilters"
+ labels:
+ type: array
+ items:
+ type: string
+ AssetIdLabelsRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- PostCreateUserResponse:
- description: Example response
+ - labels
+ properties:
+ labels:
+ type: array
+ items:
+ type: string
+ UpdateTemplateRequest:
content:
application/json:
schema:
type: object
+ required:
+ - template
+ - template_id
properties:
- message:
+ template:
type: string
- ai_status:
- type: boolean
- scan_status:
- type: boolean
- static_scan:
- type: boolean
- early_template:
- type: boolean
- user_id:
- type: integer
- name:
+ template_id:
type: string
- email:
+ prompt:
type: string
- role:
+ filename:
type: string
- required:
- - message
- PostRescanVulnResponse:
- description: Example response
+ dir:
+ type: string
+ CreateTemplateRequest:
content:
application/json:
schema:
type: object
properties:
- message:
+ template:
type: string
- results:
- $ref: '#/components/schemas/VulnerabilityResultsOld'
- required:
- - message
- GetEarlyTempateList:
- description: Early Template Response
+ GenerateTemplateRequest:
content:
application/json:
schema:
type: object
+ required:
+ - prompt
properties:
- version:
+ prompt:
type: string
- data:
+ retest:
+ type: boolean
+ disableAutoSave:
+ type: boolean
+ default: false
+ images:
type: array
items:
- $ref: '#/components/schemas/EarlyTemplateListItem'
- required:
- - version
- - data
- UpdateTeamResponse:
- description: Example response
+ type: string
+ RetestTemplateRequest:
content:
application/json:
schema:
type: object
properties:
- name:
+ template_encoded:
type: string
- message:
+ target:
+ type: string
+ template_path:
+ type: string
+ template_url:
+ type: string
+ template_id:
+ type: string
+ vuln_id:
type: string
+ ShareTemplateRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- GetTeamResponse:
- description: Get the workspace details
+ - template_id
+ - share_type
+ properties:
+ template_id:
+ type: string
+ share_type:
+ enum:
+ - unlisted
+ - organization
+ - users
+ ttl:
+ type: string
+ organizations:
+ type: array
+ items:
+ type: string
+ emails:
+ type: array
+ items:
+ type: string
+ TriggerUserScanRequest:
content:
application/json:
schema:
type: object
properties:
- workspaces:
+ targets:
type: array
items:
- $ref: '#/components/schemas/WorkspaceItem'
- message:
- type: string
+ type: string
+ templates:
+ type: array
+ items:
+ type: string
+ assets:
+ type: array
+ items:
+ type: string
+ private_templates:
+ type: array
+ items:
+ $ref: "#/components/schemas/PrivateTemplates"
name:
type: string
- required:
- - message
- GetTeamMembersResponse:
- description: Example response
+ recommended:
+ type: boolean
+ all:
+ type: boolean
+ alerting_config_ids:
+ type: array
+ items:
+ type: string
+ scan_config_ids:
+ type: array
+ items:
+ type: string
+ reporting_config_ids:
+ type: array
+ items:
+ type: string
+ early_templates:
+ type: array
+ items:
+ type: string
+ exclude_targets:
+ type: array
+ items:
+ type: string
+ enumeration_ids:
+ type: array
+ items:
+ $ref: "#/components/schemas/EnumerationIds"
+ schedule_only:
+ type: boolean
+ disable_global_alert_config:
+ type: boolean
+ disable_global_report_config:
+ type: boolean
+ disable_global_scan_config:
+ type: boolean
+ socks5_proxy:
+ type: string
+ automatic_scan:
+ type: boolean
+ scan_all_assets:
+ type: boolean
+ SetScanScheduleRequest:
content:
application/json:
schema:
type: object
+ required:
+ - scan_id
+ - scan_frequency
properties:
- message:
+ scan_id:
type: string
- max_team_members:
+ scan_frequency:
+ $ref: "#/components/schemas/SchedulerFrequency"
+ start_time:
+ type: string
+ format: time
+ hourly_frequency:
type: integer
- members:
+ minimum: 1
+ maximum: 24
+ custom_weekdays:
type: array
+ description: |-
+ 0-6 denoting Sunday-Saturday.
+ It accepts an array of weekday
items:
- $ref: '#/components/schemas/TeamMemberItem'
- required:
- - message
- - members
- - max_team_members
- StaticScanIPsResponse:
- description: ''
+ type: integer
+ minimum: 0
+ maximum: 6
+ SetEnumerationScheduleRequest:
content:
application/json:
schema:
type: object
+ required:
+ - enumeration_id
+ - scan_frequency
properties:
- ips:
+ enumeration_id:
+ type: string
+ scan_frequency:
+ $ref: "#/components/schemas/SchedulerFrequency"
+ start_time:
+ type: string
+ format: time
+ hourly_frequency:
+ type: integer
+ minimum: 1
+ maximum: 24
+ custom_weekdays:
type: array
+ description: |-
+ 0-6 denoting Sunday-Saturday.
+ It accepts an array of weekday
items:
- type: object
- required:
- - ip
- properties:
- ip:
- type: string
- required:
- - ips
- GetEnumerateIdContents:
- description: Example response
+ type: integer
+ minimum: 0
+ maximum: 6
+ UpdateAssetRequest:
content:
application/json:
schema:
type: object
properties:
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- message:
+ name:
type: string
- data:
- type: array
- items:
- $ref: '#/components/schemas/EnumerationContent'
required:
- - message
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- GetEnumerateIdContentsResponse:
- description: Example response
+ - name
+ UpdateScanRequest:
content:
application/json:
schema:
type: object
properties:
- message:
+ name:
type: string
- data:
- $ref: '#/components/schemas/EnumerateData'
required:
- - message
- - data
- GetEnumerationScheduleResponse:
- description: Example response
+ - name
+ PostFeedbackRequest:
content:
application/json:
schema:
type: object
properties:
- message:
+ feedback_text:
type: string
- schedules:
- type: array
- items:
- $ref: '#/components/schemas/EnumerationSchedule'
required:
- - message
- - schedules
- VerifyConfigResponse:
- description: Example response
+ - feedback_text
+ PatchUserProfile:
content:
application/json:
schema:
type: object
properties:
- is_verified:
+ email:
+ type: string
+ ai_status:
type: boolean
- response:
+ scan_status:
+ type: boolean
+ static_scan:
+ type: boolean
+ early_template:
+ type: boolean
+ max_team:
+ type: integer
+ read_only:
+ type: boolean
+ audit_log:
+ type: boolean
+ cloud_region:
type: string
+ full_port_scan:
+ type: boolean
required:
- - is_verified
- - response
- VerifyConfigContentsResponse:
- description: Example response
+ - email
+ CreateTeamRequest:
content:
application/json:
schema:
type: object
properties:
- jira:
- type: array
- items:
- type: object
- $ref: '#/components/schemas/JiraVerifyContentItem'
- ScanStatsResponse:
- description: Example response
+ name:
+ type: string
+ required:
+ - name
+ AddTeamMemberRequest:
content:
application/json:
schema:
type: object
properties:
- scan_stats:
- type: object
- properties:
- total_scan:
- type: integer
- total_unique_scan:
- type: integer
- total_uploaded_scan:
- type: integer
- total_scheduled_scan:
- type: integer
- required:
- - total_scan
- - total_unique_scan
- - total_uploaded_scan
- - total_scheduled_scan
- scan_status:
- type: object
- properties:
- failed:
- type: integer
- finished:
- type: integer
- queued:
- type: integer
- running:
- type: integer
- starting:
- type: integer
- stopped:
- type: integer
- uploaded:
- type: integer
- required:
- - failed
- - finished
- - queued
- - running
- - starting
- - stopped
- - uploaded
+ email:
+ type: string
required:
- - scan_stats
- - scan_status
- GetScansHistoryResponse:
- description: Example response
+ - email
+ DeleteTeamMemberRequest:
content:
application/json:
schema:
type: object
properties:
- message:
+ email:
type: string
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- data:
- type: array
- items:
- $ref: '#/components/schemas/ScansHistoryItems'
- total_completed_request:
- type: integer
- total_scan_run:
- type: integer
- total_unique_scan_run:
- type: integer
required:
- - current_page
- - result_count
- - total_results
- - total_pages
- - message
- - data
- EnumerateResponse:
- description: Example response
+ - email
+ InviteTeamMemberRequest:
content:
application/json:
schema:
type: object
properties:
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- data:
- type: array
- items:
- $ref: '#/components/schemas/EnumerateData'
+ invite_code:
+ type: string
required:
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- PostScanConfigResponse:
- description: Example response
+ - invite_code
+ PatchTeamMemberRequest:
content:
application/json:
schema:
type: object
properties:
- id:
+ email:
type: string
- message:
+ role:
type: string
required:
- - message
- ErrorResponse:
- description: Example response
+ - email
+ AdminAddTeamMemberRequest:
content:
application/json:
schema:
type: object
properties:
- message:
- type: string
- kind:
- type: string
- code:
- type: string
- error:
- type: string
- error_id:
+ owner_email:
type: string
- param:
+ member_email:
type: string
- status:
- type: integer
required:
- - message
- VulnsTrackerExportResponse:
- description: Example response
+ - owner_email
+ - member_email
+ PatchScanVulnsRequest:
content:
application/json:
schema:
type: object
+ required:
+ - vuln_status
properties:
- ok:
- type: boolean
- vuln_id:
- type: string
- reporting_config_id:
- type: string
- reporting_config_name:
- type: string
- ticket_url:
+ vuln_ids:
+ type: array
+ items:
+ type: string
+ vuln_status:
+ $ref: "#/components/schemas/VulnStatusEnum"
+ type:
type: string
- ticket_id:
+ scan_id:
type: string
- tracker_name:
+ severity:
+ type: array
+ items:
+ type: string
+ host:
+ type: array
+ items:
+ type: string
+ template:
+ type: array
+ items:
+ type: string
+ search:
type: string
- required:
- - ok
- - vuln_id
- - reporting_config_id
- - reporting_config_name
- - ticket_url
- - ticket_id
- - tracker_name
- ExcludedTemplateResponse:
- description: Example response
+ PatchScanVulnsLabelsRequest:
content:
application/json:
schema:
type: object
+ required:
+ - ids
properties:
- data:
+ ids:
type: array
items:
- $ref: '#/components/schemas/ExcludedTemplate'
- required:
- - data
- GetScansTokenResponse:
- description: Example response
+ type: string
+ type:
+ type: string
+ labels:
+ type: array
+ items:
+ type: string
+ VerifyConfigRequest:
content:
application/json:
schema:
type: object
+ required:
+ - config
properties:
- scan_tokens:
- type: integer
- format: int64
- used_scan_token:
- type: integer
- format: int64
- remaining_scan_token:
- type: integer
- format: int64
- base_domain_count:
- type: integer
- format: int64
- remaining_domain_count:
- type: integer
- format: int64
- is_scannable:
- type: boolean
- start_date:
- type: string
- format: date-time
- end_date:
+ config:
type: string
- format: date-time
- expire_date:
+ config_type:
type: string
- format: date-time
- subscription_type:
- enum:
- - BASIC
- - TRIAL
- - CUSTOM
- - PRO
- required:
- - scan_tokens
- - used_scan_token
- - remaining_scan_token
- - is_scannable
- - start_date
- - end_date
- - subscription_type
- - base_domain_count
- - remaining_domain_count
- - expire_date
- GetAssetResponse:
- description: Example response
+ VerifyConfigContentsRequest:
content:
application/json:
schema:
type: object
properties:
- id:
- type: integer
- format: int64
- enumeration_id:
- type: string
- name:
- type: string
- created_at:
+ config:
type: string
- format: date-time
- updated_at:
+ config_type:
type: string
- format: date-time
- status_code:
- type: integer
- technologies:
+ provider:
+ $ref: "#/components/schemas/VerifyConfigContentsRequestProvider"
+ DeleteVulnsRequest:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ids:
type: array
items:
type: string
- webserver:
- type: string
- request:
+ type:
type: string
- response:
+ vuln_status:
+ type: array
+ items:
+ type: string
+ scan_id:
type: string
- cname:
+ severity:
type: array
items:
type: string
- labels:
+ host:
type: array
items:
type: string
- ip:
+ template:
+ type: array
+ items:
+ type: string
+ search:
type: string
- content_length:
- type: integer
- title:
+ CreateContributeRequest:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
type: string
- host:
+ name:
type: string
- port:
- type: integer
- technology_details:
+ template:
type: string
- format: json
- is_new:
+ anonymous:
type: boolean
required:
- - id
- - enumeration_id
- - name
- - created_at
- - updated_at
- EnumerationStatsResponse:
- description: Example response
+ - template
+ - anonymous
+ ExcludeConfigRequest:
content:
application/json:
schema:
type: object
+ required:
+ - values
+ - exclude_type
properties:
- asset_stats:
- $ref: '#/components/schemas/AssetStats'
- enumeration_stats:
- $ref: '#/components/schemas/EnumerationCounts'
+ values:
+ type: array
+ items:
+ type: string
+ exclude_type:
+ $ref: "#/components/schemas/ExcludeConfigRequestType"
+ DeleteExcludedConfigRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - asset_stats
- PriceListResponse:
- description: Example response
+ - ids
+ properties:
+ ids:
+ type: array
+ items:
+ type: integer
+ format: int64
+ UpdateEnumeratedAssetRequest:
content:
application/json:
schema:
type: object
properties:
- list:
+ labels:
type: array
items:
- $ref: '#/components/schemas/PriceListItem'
- message:
+ type: string
+ name:
type: string
+ PatchTeamAdmin:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - list
- - message
- GetScanTokenErrorResponse:
- description: Example response
+ - max_members
+ properties:
+ max_members:
+ type: integer
+ UsageRequest:
content:
application/json:
schema:
type: object
+ required:
+ - range
properties:
- message:
+ range:
+ $ref: "#/components/schemas/UsageRangeEnum"
+ startDate:
type: string
- subscription_type:
+ endDate:
type: string
+ AdminSetUsageLimit:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- - subscription_type
- UsageResponse:
- description: Example response
+ - email
+ properties:
+ email:
+ type: string
+ format: email
+ chaos_allowed_requests:
+ type: number
+ cvemap_allowed_requests:
+ type: number
+ asnmap_allpwed_requests:
+ type: number
+ AdminUsageRequest:
content:
application/json:
schema:
type: object
+ required:
+ - email
+ - range
properties:
- message:
+ email:
type: string
- cvemap:
- $ref: '#/components/schemas/ServiceUsageItem'
- chaos:
- $ref: '#/components/schemas/ServiceUsageItem'
- asnmap:
- $ref: '#/components/schemas/ServiceUsageItem'
+ format: email
+ range:
+ $ref: "#/components/schemas/UsageRangeEnum"
+ startDate:
+ type: string
+ endDate:
+ type: string
+ AddAutomation:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- GetEnumerateFiltersResponse:
- description: Example response
+ - name
+ - status
+ - event
+ - scan_data
+ properties:
+ name:
+ type: string
+ status:
+ type: string
+ event:
+ type: string
+ scan_data:
+ $ref: "#/components/schemas/AutomationScanData"
+ enumeration_id:
+ type: string
+ UpdateAutomationRequest:
content:
application/json:
schema:
type: object
properties:
- message:
+ name:
type: string
- current_page:
- type: integer
- result_count:
- type: integer
- total_results:
- type: integer
- total_pages:
- type: integer
- data:
- type: array
- items:
- $ref: '#/components/schemas/EnumerateFiltersItem'
+ status:
+ type: string
+ scan_data:
+ $ref: "#/components/schemas/AutomationScanData"
+ CreateAssetGroupRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- - current_page
- - result_count
- - total_results
- - total_pages
- - data
- GetUserTunnelResponse:
- description: Example response
+ - filters
+ properties:
+ filters:
+ $ref: "#/components/schemas/AssetFilters"
+ name:
+ type: string
+ UpdateAssetGroupRequest:
content:
application/json:
schema:
type: object
+ required:
+ - filters
properties:
- message:
+ filters:
+ $ref: "#/components/schemas/AssetFilters"
+ name:
type: string
- tunnels:
- type: array
- items:
- $ref: '#/components/schemas/TunnelItem'
+ AddCustomSeverityMappingRequest:
+ content:
+ application/json:
+ schema:
+ type: object
required:
- - message
- ExposureMetricsResponse:
- description: Example response
+ - template_id
+ - custom_severity
+ properties:
+ template_id:
+ type: string
+ custom_severity:
+ type: string
+ vuln_id:
+ type: string
+ DeleteCustomSeverityMappingRequest:
content:
application/json:
schema:
type: object
+ required:
+ - ids
properties:
- total_assets:
- type: integer
- new_assets:
- type: integer
- unique_technologies:
- type: integer
- new_technologies:
- type: integer
- time_series:
+ ids:
type: array
items:
- $ref: '#/components/schemas/ExposuresTimeSeries'
- securitySchemes:
- X-API-Key:
- name: X-API-Key
- type: apiKey
- in: header
-security:
- - X-API-Key: []
+ type: integer
+ format: int64
x-internal: false
+security:
+- X-API-Key: []
diff --git a/package-lock.json b/package-lock.json
index 100640e..6788b3a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,6 +7,7 @@
"dependencies": {
"@types/react": "^19.0.8",
"clsx": "^2.1.1",
+ "js-yaml": "^4.1.0",
"react": "^19.0.0",
"tailwind-merge": "^3.0.1"
}
@@ -20,6 +21,12 @@
"csstype": "^3.0.2"
}
},
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "license": "Python-2.0"
+ },
"node_modules/clsx": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
@@ -35,6 +42,18 @@
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"license": "MIT"
},
+ "node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
"node_modules/react": {
"version": "19.0.0",
"resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz",
diff --git a/package.json b/package.json
index daa4ae2..a0723fc 100644
--- a/package.json
+++ b/package.json
@@ -2,6 +2,7 @@
"dependencies": {
"@types/react": "^19.0.8",
"clsx": "^2.1.1",
+ "js-yaml": "^4.1.0",
"react": "^19.0.0",
"tailwind-merge": "^3.0.1"
}