diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 09847bcee1..06f3e67419 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -7,6 +7,7 @@ PR check list:
- [ ] End-to-end test
- [ ] Pass code linter to client and server
- [ ] Update READ.me ?
+- [ ] Update API documentation ?
QA check list:
diff --git a/app/api/api.js b/app/api/api.js
index 31438c2add..530be0da50 100644
--- a/app/api/api.js
+++ b/app/api/api.js
@@ -26,4 +26,5 @@ export default (app, server) => {
require('./settings/routes.js')(app);
require('./i18n/routes.js')(app);
require('./attachments/routes.js')(app);
+ require('./swagger/swaggerconfig.js')(app);
};
diff --git a/app/api/attachments/routes.ref.js b/app/api/attachments/routes.ref.js
new file mode 100644
index 0000000000..a02cef1ab4
--- /dev/null
+++ b/app/api/attachments/routes.ref.js
@@ -0,0 +1,28 @@
+/**
+* @swagger
+* /attachments/download:
+* get:
+* tags:
+* - attachments
+* description: Returns the attachments for a document
+* parameters:
+* - name: _id
+* description: _id of the attachment requested
+* in: query
+* required: true
+* type: string
+* - name: file
+* description: file name of the attachment requested
+* in: query
+* required: true
+* type: string
+* responses:
+* 200:
+* description: The original file
+* schema:
+* type: file
+* 500:
+* description: Server error
+* schema:
+* $ref: '#/definitions/Error'
+*/
diff --git a/app/api/entities/entitiesModel.js b/app/api/entities/entitiesModel.js
index df05c6b336..5daafebf87 100644
--- a/app/api/entities/entitiesModel.js
+++ b/app/api/entities/entitiesModel.js
@@ -1,9 +1,97 @@
import mongoose from 'mongoose';
import instanceModel from 'api/odm';
+ /**
+ * @swagger
+ * definition:
+ * Entity:
+ * properties:
+ * _id:
+ * type: string
+ * description: A unique ID for this object in the database.
+ * sharedId:
+ * type: string
+ * description: A shared ID with the other copies of this object for the different languages.
+ * language:
+ * type: string
+ * type:
+ * type: string
+ * title:
+ * type: string
+ * template:
+ * type: string
+ * description: The template _id
+ * user:
+ * type: string
+ * description: The user _id
+ * file:
+ * description: Only for documents
+ * type: object
+ * properties:
+ * originalname:
+ * type: string
+ * filename:
+ * type: string
+ * mimetype:
+ * type: string
+ * size:
+ * type: integer
+ * icon:
+ * type: object
+ * properties:
+ * _id:
+ * type: string
+ * label:
+ * type: string
+ * type:
+ * type: string
+ * toc:
+ * type: array
+ * items:
+ * type: object
+ * properties:
+ * label:
+ * type: string
+ * indentation:
+ * type: integer
+ * range:
+ * type: object
+ * properties:
+ * start:
+ * type: integer
+ * end:
+ * type: integer
+ * attachments:
+ * type: array
+ * items:
+ * type: object
+ * properties:
+ * originalname:
+ * type: string
+ * filename:
+ * type: string
+ * mimetype:
+ * type: string
+ * size:
+ * type: integer
+ * creationDate:
+ * type: integer
+ * processed:
+ * type: boolean
+ * uploaded:
+ * type: boolean
+ * published:
+ * type: boolean
+ * metadata:
+ * type: object
+ * description: Changes depending on the template
+ * pdfInfo:
+ * type: object
+ */
+
const entitySchema = new mongoose.Schema({
language: String,
- sharedId: String,
+ sharedId: {type: String, index: true},
type: String,
title: String,
template: {type: mongoose.Schema.Types.ObjectId, ref: 'templates'},
diff --git a/app/api/entities/routes.ref.js b/app/api/entities/routes.ref.js
new file mode 100644
index 0000000000..08b3033750
--- /dev/null
+++ b/app/api/entities/routes.ref.js
@@ -0,0 +1,146 @@
+/**
+* @swagger
+* /entities:
+* post:
+* tags:
+* - entities
+* description: Creates an entity
+* parameters:
+* - name: _id
+* description: sharedId of the entity
+* in: body
+* required: true
+* schema:
+* $ref: '#/definitions/Entity'
+* responses:
+* 200:
+* description: The entity created
+* schema:
+* $ref: '#/definitions/Entity'
+* 401:
+* description: Unauthorized
+* schema:
+* $ref: '#/definitions/Error'
+*/
+
+/**
+* @swagger
+* /entities/count_by_template:
+* get:
+* tags:
+* - entities
+* description: Returns the number of entities using the template
+* parameters:
+* - name: templateId
+* description: _id of the template
+* in: query
+* required: true
+* type: string
+* responses:
+* 200:
+* description: The number of entities using the template in all the languages
+* schema:
+* type: integer
+*/
+
+/**
+* @swagger
+* /entities/uploads:
+* get:
+* deprecated: true
+* tags:
+* - entities
+* description: Returns the entities uploaded by the current user
+* responses:
+* 200:
+* description: An array with entities
+* schema:
+* type: object
+* properties:
+* rows:
+* type: array
+* items:
+* $ref: '#/definitions/Entity'
+*/
+
+/**
+* @swagger
+* /entities:
+* get:
+* tags:
+* - entities
+* description: Returns an entity
+* parameters:
+* - name: _id
+* description: sharedId of the entity
+* in: query
+* required: true
+* type: string
+* responses:
+* 200:
+* description: An object with rows containning the document
+* schema:
+* type: object
+* properties:
+* rows:
+* type: array
+* items:
+* $ref: '#/definitions/Entity'
+* 404:
+* description: Not found
+* schema:
+* type: object
+*/
+
+/**
+* @swagger
+* /entities:
+* delete:
+* tags:
+* - entities
+* description: Deletes an entity
+* parameters:
+* - name: sharedId
+* description: sharedId of the entity
+* in: query
+* required: true
+* type: string
+* responses:
+* 200:
+* description: An array with containning the deleted entities, one for each different language in the instance
+* schema:
+* type: array
+* items:
+* $ref: '#/definitions/Entity'
+* 500:
+* description: Server error
+* schema:
+* type: object
+*/
+
+/**
+* @swagger
+* /entities/multiple:
+* delete:
+* tags:
+* - entities
+* description: Deletes multiple entities
+* parameters:
+* - name: sharedIds
+* description: URL encoded array of the sharedId of the entities
+* in: query
+* required: true
+* type: string
+* example: '["SHARED_ID_ONE","SHARED_ID_TWO"]'
+* responses:
+* 200:
+* description: An array with containning the deleted entities, one for each different language in the instance
+* schema:
+* type: array
+* items:
+* $ref: '#/definitions/Entity'
+* 500:
+* description: Server error
+* schema:
+* type: object
+*/
diff --git a/app/api/references/connectionsModel.js b/app/api/references/connectionsModel.js
index ee959117cb..03be0e9f96 100644
--- a/app/api/references/connectionsModel.js
+++ b/app/api/references/connectionsModel.js
@@ -2,11 +2,11 @@ import mongoose from 'mongoose';
import instanceModel from 'api/odm';
const connectionSchema = new mongoose.Schema({
- sourceDocument: String,
+ sourceDocument: {type: String, index: true},
sourceProperty: String,
sourceType: String,
relationType: String,
- targetDocument: String,
+ targetDocument: {type: String, index: true},
sourceRange: {
start: Number,
end: Number,
diff --git a/app/api/references/references.js b/app/api/references/references.js
index 5fc98dbd88..9fb8d198c5 100644
--- a/app/api/references/references.js
+++ b/app/api/references/references.js
@@ -76,7 +76,6 @@ export default {
g.templates = g.templates.map(excludeRefs);
});
}
-
return groupedReferences;
});
},
diff --git a/app/api/search/documentQueryBuilder.js b/app/api/search/documentQueryBuilder.js
index e305cbda1c..07863dbc9a 100644
--- a/app/api/search/documentQueryBuilder.js
+++ b/app/api/search/documentQueryBuilder.js
@@ -12,7 +12,10 @@ export default function () {
size: 30,
query: {
bool: {
- must: [{match: {published: true}}]
+ must: [],
+ filter: [
+ {term: {published: true}}
+ ]
}
},
sort: [],
@@ -49,9 +52,9 @@ export default function () {
},
includeUnpublished() {
- const matchPulished = baseQuery.query.bool.must.find(i => i.match && i.match.published);
+ const matchPulished = baseQuery.query.bool.filter.find(i => i.term && i.term.published);
if (matchPulished) {
- baseQuery.query.bool.must.splice(baseQuery.query.bool.must.indexOf(matchPulished), 1);
+ baseQuery.query.bool.filter.splice(baseQuery.query.bool.filter.indexOf(matchPulished), 1);
}
return this;
},
@@ -117,14 +120,14 @@ export default function () {
},
language(language) {
- let match = {match: {language: language}};
- baseQuery.query.bool.must.push(match);
+ let match = {term: {language: language}};
+ baseQuery.query.bool.filter.push(match);
aggregations.types.aggregations.filtered.filter.bool.must.push(match);
return this;
},
unpublished() {
- baseQuery.query.bool.must[0].match.published = false;
+ baseQuery.query.bool.filter[0].term.published = false;
baseQuery.aggregations.all.aggregations.types.aggregations.filtered.filter.bool.must[0].match.published = false;
return this;
},
@@ -399,7 +402,7 @@ export default function () {
{terms: {template: _templates}}
]
}};
- baseQuery.query.bool.must.push(match);
+ baseQuery.query.bool.filter.push(match);
return this;
}
@@ -420,7 +423,7 @@ export default function () {
}
if (_ids.length) {
let match = {terms: {'sharedId.raw': _ids}};
- baseQuery.query.bool.must.push(match);
+ baseQuery.query.bool.filter.push(match);
}
return this;
},
diff --git a/app/api/search/routes.ref.js b/app/api/search/routes.ref.js
new file mode 100644
index 0000000000..1cfb586782
--- /dev/null
+++ b/app/api/search/routes.ref.js
@@ -0,0 +1,52 @@
+/**
+* @swagger
+* /search:
+* get:
+* tags:
+* - search
+* description: Returns a list of entities matching the filters
+* parameters:
+* - name: searchTerm
+* description: A string to search for inside documents and titles
+* in: query
+* required: false
+* type: string
+* - name: types
+* description: An url encoded array of type _ids
+* in: query
+* required: false
+* type: string
+* example: '["_id1", "_id2"]'
+* - name: order
+* in: query
+* required: false
+* type: string
+* enum: ['asc', 'desc']
+* - name: sort
+* description: A property to sort results by
+* in: query
+* required: false
+* type: string
+* example: creationDate
+* - name: filters
+* description: An url encoded object with properties to filter by and the values of the filter
+* in: query
+* required: false
+* type: string
+* example: '{"multi_select_property_name":["value_selected", "value_selected"]}'
+* responses:
+* 200:
+* description: Returns an object with the result
+* schema:
+* type: object
+* properties:
+* rows:
+* type: array
+* items:
+* $ref: '#/definitions/Entity'
+* aggregations:
+* type: object
+* description: An object that contains the amount of matches for the different possible filters for the actual selected filters.
+* totalRows:
+* type: integer
+*/
diff --git a/app/api/search/search.js b/app/api/search/search.js
index 9b8ac1b0b3..299ac69262 100644
--- a/app/api/search/search.js
+++ b/app/api/search/search.js
@@ -115,7 +115,6 @@ export default {
.filterById(sharedId)
.language(language)
.query();
-
return elastic.search({index: elasticIndex, body: query})
.then((response) => {
if (response.hits.hits.length === 0) {
diff --git a/app/api/swagger/swaggerconfig.js b/app/api/swagger/swaggerconfig.js
new file mode 100644
index 0000000000..5965b4c503
--- /dev/null
+++ b/app/api/swagger/swaggerconfig.js
@@ -0,0 +1,39 @@
+import express from 'express';
+import path from 'path';
+import swaggerJSDoc from 'swagger-jsdoc';
+
+export default (app) => {
+ const swaggerDefinition = {
+ info: {
+ title: 'Uwazi API',
+ version: '1.0.0',
+ description: 'Uwazi is an open-source solution for building and sharing document collections.
Remember that using the "Try it out" functionality will execute the requests over your local instalation!'
+ },
+ host: 'localhost:3000',
+ basePath: '/api',
+ tags: [
+ {name: 'attachments'},
+ {name: 'entities'}
+ ],
+ definitions: {
+ Error: {
+ properties: {
+ error: {type: 'string'}
+ }
+ }
+ }
+ };
+
+ const options = {
+ swaggerDefinition: swaggerDefinition,
+ apis: [__dirname + '/../**/*.js']
+ };
+
+ const swaggerSpec = swaggerJSDoc(options);
+ app.get('/api/swagger.json', (req, res) => {
+ res.setHeader('Content-Type', 'application/json');
+ res.send(swaggerSpec);
+ });
+
+ app.use('/api', express.static(path.resolve(__dirname, 'ui')));
+};
diff --git a/app/api/swagger/ui/index.html b/app/api/swagger/ui/index.html
new file mode 100755
index 0000000000..916b45cfdf
--- /dev/null
+++ b/app/api/swagger/ui/index.html
@@ -0,0 +1,98 @@
+
+
+
+
>>u&mn;if(_!==h>>>u&mn)break;_&&(l+=(1<i&&(c=c.removeBefore(r,u,a-l)),c&&h
a&&(a=c.size),o(u)||(c=c.map(function(e){return V(e)})),i.push(c)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return es)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},c}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],c=i[1];return t.call(n,c,u,o)?r===xn?e:w(r,u,c,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,c){if(!s||!(s=t.call(n,e,o,c)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,c=0;return new x(function(){var e,o,l;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,c++,void 0,e):w(i,c++,e.value[1],e);var p=e.value;o=p[0],l=p[1],u&&(u=t.call(n,l,o,a))}while(u);return i===xn?e:w(i,o,l,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):z(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var c=new I(i);return r?c=c.toKeyedSeq():s(e)||(c=c.toSetSeq()),c=c.flatten(!0),c.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,c){var l=this;e.__iterate(function(e,i){return(!t||c=Kn)return Te(e,f,c,s,d);if(l&&!d&&2===f.length&&Ee(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&Ee(d))return d;var m=e&&e===this.ownerID,v=l?d?c:c^u:c|u,g=l?d?Ne(f,p,d,m):Be(f,p,m):Fe(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,c=this.nodes,l=c[s];if(u&&!l)return this;var p=Se(l,e,t+hn,n,r,i,o,a);if(p===l)return this;var f=this.count;if(l){if(!p&&--f5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,c=s[0],l=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:l;){if(l=c,c=s[++u],o=p.length>1,!l||f>8&&"\n"==l||[/\S/.test(l),1,1,!/[$\w]/.test(l),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(l),/[\])]/.test(l),/[$\w]/.test(l),"/"==l&&i<2&&"<"!=n,'"'==l,"'"==l,l+c+s[u+1]+s[u+2]=="\x3c!--",l+c=="/*",l+c=="//","#"==l][--f];);p+=l}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default.Map();if(!N.default.Map.isMap(e)||!e.size)return N.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=N.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,c=(0,D.default)(e.entries());!(o=(u=c.next()).done);o=!0){var l=u.value,p=(0,C.default)(l,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=N.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&c.return&&c.return()}finally{if(a)throw s}}return r}function x(e){return(0,z.default)((0,B.default)(e))}function w(e){return x(e.replace(/\.[^.\/]*$/,""))}Object.defineProperty(t,"__esModule",{value:!0}),t.shallowEqualKeys=t.filterConfigs=t.buildFormData=t.sorters=t.btoa=t.parseSeach=t.getSampleSchema=t.validateParam=t.validateFile=t.validateInteger=t.validateNumber=t.propChecker=t.errorLog=t.memoize=t.isImmutable=void 0;var k=n(48),S=r(k),E=n(29),C=r(E),A=n(86),D=r(A),T=n(28),M=r(T),O=n(39),P=r(O),I=n(49),R=r(I);t.objectify=i,t.arrayify=o,t.fromJSOrdered=a,t.bindToState=s,t.normalizeArray=u,t.isFn=c,t.isObject=l,t.isFunc=p,t.isArray=f,t.objMap=h,t.objReduce=d,t.systemThunkMiddleware=m,t.defaultStatusCode=v,t.getList=g,t.formatXml=y,t.highlight=_,t.mapToList=b,t.pascalCase=x,t.pascalCaseFilename=w;var j=n(10),N=r(j),F=n(820),B=r(F),L=n(369),z=r(L),q=n(367),U=r(q),W=n(362),K=r(W),V=n(835),H=r(V),J=n(106),G=r(J),X=n(160),Y=n(47),$=r(Y),Z="default",Q=t.isImmutable=function(e){return N.default.Iterable.isIterable(e)},ee=(t.memoize=U.default,t.errorLog=function(e){return function(){return function(t){return function(n){try{t(n)}catch(t){e().errActions.newThrownErr(t,n)}}}}},t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,R.default)(e).length!==(0,R.default)(t).length||((0,H.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return N.default.Iterable.isIterable(e)?!N.default.is(e,i):("object"!==(void 0===e?"undefined":(0,P.default)(e))||"object"!==(void 0===i?"undefined":(0,P.default)(i)))&&e!==i})||n.some(function(n){return!(0,G.default)(e[n],t[n])}))},t.validateNumber=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"}),te=t.validateInteger=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ne=t.validateFile=function(e){if(e&&!(e instanceof $.default.File))return"Value must be a file"};t.validateParam=function(e,t){var n=[],r=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),i=e.get("required"),o=e.get("type"),a="string"===o&&!r,s="array"===o&&Array.isArray(r)&&!r.length,u="array"===o&&N.default.List.isList(r)&&!r.count(),c="file"===o&&!(r instanceof $.default.File);if(i&&(a||s||u||c))return n.push("Required field is not provided"),n;if("number"===o){var l=ee(r);if(!l)return n;n.push(l)}else if("integer"===o){var p=te(r);if(!p)return n;n.push(p)}else if("array"===o){var f=void 0;if(!r.count())return n;f=e.getIn(["items","type"]),r.forEach(function(e,t){var r=void 0;"number"===f?r=ee(e):"integer"===f&&(r=te(e)),r&&n.push({index:t,error:r})})}else if("file"===o){var h=ne(r);if(!h)return n;n.push(h)}return n},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,X.memoizedCreateXMLExample)(e,n)}return(0,S.default)((0,X.memoizedSampleFromSchema)(e,n),null,2)},t.parseSeach=function(){var e={},t=window.location.search;if(""!=t){var n=t.substr(1).split("&");for(var r in n)r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.filterConfigs=function(e,t){var n=void 0,r={};for(n in e)-1!==t.indexOf(n)&&(r[n]=e[n]);return r},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,G.default)(e[n],t[n])})}}).call(t,n(41).Buffer)},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(d)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function o(e,t){var n=i(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],c=i(u)._domID;if(0!==c){for(;null!==a;a=a.nextSibling)if(r(a,c)){o(u,a);continue e}p("32",c)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function c(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function l(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(9),f=n(80),h=n(380),d=(n(3),f.ID_ATTRIBUTE_NAME),m=h,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:c,getNodeFromInstance:l,precacheChildNodes:s,precacheNode:o,uncacheNode:a};e.exports=g},function(e,t){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=n(101),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(177)("wks"),i=n(125),o=n(21).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=i},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===r(e)}function o(e,t){return!!e&&d.call(e,t)}function a(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function s(e){return e.indexOf("\\")<0?e:e.replace(m,"$1")}function u(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function l(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?c(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,l)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(416),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=c,t.replaceEntities=p,t.escapeHtml=h},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(573)("wks"),i=n(315),o=n(24).Symbol;e.exports=function(e){return r[e]||(r[e]=o&&o[e]||(o||i)("Symbol."+e))}},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++vs&&(n=s-u),c=n;c>=0;c--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a5?c-5:0),p=5;p5?c-5:0),p=5;p